|
|
|
@ -268,7 +268,7 @@ public class DistributionStockupAppController extends BladeController {
|
|
|
|
|
map.put("consignee", reservationEntity.getConsignee()); |
|
|
|
|
String stockupArea = distributionStockupService.selectStockupAreaByReservationId(reservationEntity.getId()); |
|
|
|
|
map.put("goodsAreaName", stockupArea); |
|
|
|
|
if (orderStatus==1) { |
|
|
|
|
if (orderStatus == 1) { |
|
|
|
|
//查询客户订单对应的
|
|
|
|
|
List<DistributionStockupOrderListVO> list = distributionStockupService.selectStockupOrderList(stockupDTO); |
|
|
|
|
|
|
|
|
@ -281,15 +281,15 @@ public class DistributionStockupAppController extends BladeController {
|
|
|
|
|
if (!list.isEmpty()) { |
|
|
|
|
for (DistributionStockupOrderListVO vo : list) { |
|
|
|
|
|
|
|
|
|
log.info(" 定制品备货 信息 DistributionStockupOrderListVO {}",vo); |
|
|
|
|
if(ObjectUtils.isNotNull(vo)){ |
|
|
|
|
if(ObjectUtils.isNotNull(vo.getPlanNum())){ |
|
|
|
|
log.info(" 定制品备货 信息 DistributionStockupOrderListVO {}", vo); |
|
|
|
|
if (ObjectUtils.isNotNull(vo)) { |
|
|
|
|
if (ObjectUtils.isNotNull(vo.getPlanNum())) { |
|
|
|
|
planNum = planNum + vo.getPlanNum(); |
|
|
|
|
} |
|
|
|
|
if(ObjectUtils.isNotNull(vo.getScanNum())){ |
|
|
|
|
if (ObjectUtils.isNotNull(vo.getScanNum())) { |
|
|
|
|
scanNum = scanNum + vo.getScanNum(); |
|
|
|
|
} |
|
|
|
|
if(ObjectUtils.isNotNull(vo.getAllocationNumber())){ |
|
|
|
|
if (ObjectUtils.isNotNull(vo.getAllocationNumber())) { |
|
|
|
|
trayNum = trayNum + vo.getAllocationNumber(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -304,7 +304,7 @@ public class DistributionStockupAppController extends BladeController {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
if (IsOrNoConstant.yes.getValue().equals(stockupDTO.getIsZero())){ |
|
|
|
|
if (IsOrNoConstant.yes.getValue().equals(stockupDTO.getIsZero())) { |
|
|
|
|
//查询客户零担计划数量
|
|
|
|
|
List<DistributionReservationStockarticleEntity> reservationStockarticleEntities = distributionReservationStockarticleService.list(Wrappers.<DistributionReservationStockarticleEntity>query().lambda() |
|
|
|
|
.eq(DistributionReservationStockarticleEntity::getReservationId, reservationId) |
|
|
|
@ -324,9 +324,9 @@ public class DistributionStockupAppController extends BladeController {
|
|
|
|
|
map.put("planNum", planNum); |
|
|
|
|
map.put("scanNum", scanNum); |
|
|
|
|
map.put("trayNum", trayNum); |
|
|
|
|
list.stream().forEach(f->f.setCompleteStact(false)); |
|
|
|
|
list.stream().forEach(f -> f.setCompleteStact(false)); |
|
|
|
|
map.put("orderList", list); |
|
|
|
|
} else if (orderStatus==2) { |
|
|
|
|
} else if (orderStatus == 2) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//查询客户订单对应的库存品
|
|
|
|
@ -364,8 +364,8 @@ public class DistributionStockupAppController extends BladeController {
|
|
|
|
|
@ApiOperationSupport(order = 1) |
|
|
|
|
@ApiOperation(value = "配置包条码", notes = "传入stockupDTO") |
|
|
|
|
public R stockConfigList(@RequestBody StockupDTO stockupDTO) { |
|
|
|
|
if(ObjectUtils.isNull( stockupDTO.getTypeService()) ){ |
|
|
|
|
throw new ServiceException("服务类型不能为空!!!"); |
|
|
|
|
if (ObjectUtils.isNull(stockupDTO.getTypeService())) { |
|
|
|
|
throw new ServiceException("服务类型不能为空!!!"); |
|
|
|
|
} |
|
|
|
|
StockConfigInfoVO stockConfigOrderPackageListVOS = distributionStockupService.stockConfigList(stockupDTO); |
|
|
|
|
return R.data(stockConfigOrderPackageListVOS); |
|
|
|
@ -456,12 +456,12 @@ public class DistributionStockupAppController extends BladeController {
|
|
|
|
|
@ApiOperation(value = "备货库存品生成包件码", notes = "传入stockupDTO") |
|
|
|
|
public R stockupStockListPackageCode(@RequestBody StockupDTO stockupDTO) { |
|
|
|
|
Long reservationId = stockupDTO.getReservationId();//预约单id
|
|
|
|
|
if(ObjectUtils.isNull(stockupDTO.getTypeService())){ |
|
|
|
|
if (ObjectUtils.isNull(stockupDTO.getTypeService())) { |
|
|
|
|
throw new ServiceException("服务类型不能为空!!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 根据当前库位获取最早入库的入库批次
|
|
|
|
|
Long stockListId = distributionStockupService.selectStockListInfoByCargoNumber(stockupDTO.getReservationId(), stockupDTO.getCargoNumber(), stockupDTO.getAllocationId(),stockupDTO.getTypeService()); |
|
|
|
|
Long stockListId = distributionStockupService.selectStockListInfoByCargoNumber(stockupDTO.getReservationId(), stockupDTO.getCargoNumber(), stockupDTO.getAllocationId(), stockupDTO.getTypeService()); |
|
|
|
|
log.warn("##############stockupStockListPackageCode: 库存品id为空 stockListId={}", stockListId); |
|
|
|
|
if (Objects.isNull(stockListId)) { |
|
|
|
|
return R.fail("当前库位没有无数据的库存品"); |
|
|
|
@ -656,7 +656,7 @@ public class DistributionStockupAppController extends BladeController {
|
|
|
|
|
public R stockupScanCheck(@RequestBody StockupDTO stockupDTO) { |
|
|
|
|
Integer scanType = stockupDTO.getScanType();//扫码类型
|
|
|
|
|
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse(); |
|
|
|
|
if (Func.isEmpty(myCurrentWarehouse)){ |
|
|
|
|
if (Func.isEmpty(myCurrentWarehouse)) { |
|
|
|
|
return R.data(403, "未授权!"); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
@ -674,21 +674,21 @@ public class DistributionStockupAppController extends BladeController {
|
|
|
|
|
.eq(DistributionParcelListEntity::getWarehouseId, myCurrentWarehouse.getId()) |
|
|
|
|
.eq(DistributionParcelListEntity::getOrderPackageFreezeStatus, OrderPackageFreezeStatusConstant.weidongjie.getValue()) |
|
|
|
|
); |
|
|
|
|
if (Func.isEmpty(distributionParcelListEntity)){ |
|
|
|
|
if (Func.isEmpty(distributionParcelListEntity)) { |
|
|
|
|
//包件不存在
|
|
|
|
|
return Resp.scanFail(60004,"不是包件!!!","不是包件!!!",""); |
|
|
|
|
return Resp.scanFail(60004, "不是包件!!!", "不是包件!!!", ""); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!distributionParcelListEntity.getConditions().equals(2)){ |
|
|
|
|
if (!distributionParcelListEntity.getConditions().equals(2)) { |
|
|
|
|
//不是库存品
|
|
|
|
|
return Resp.scanFail(60005,"此包件不是库存品!!!","此包件不是库存品!!!",""); |
|
|
|
|
return Resp.scanFail(60005, "此包件不是库存品!!!", "此包件不是库存品!!!", ""); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
String cargoNumber = stockupDTO.getCargoNumber(); |
|
|
|
|
if (!distributionParcelListEntity.getMaterialCode().equals(cargoNumber)){ |
|
|
|
|
if (!distributionParcelListEntity.getMaterialCode().equals(cargoNumber)) { |
|
|
|
|
//不属于该物料库存品包件
|
|
|
|
|
return Resp.scanFail(60006,"无效的库存品包件!!!","无效的库存品包件!!!",""); |
|
|
|
|
return Resp.scanFail(60006, "无效的库存品包件!!!", "无效的库存品包件!!!", ""); |
|
|
|
|
} |
|
|
|
|
//该包件不在此库位
|
|
|
|
|
WarehouseUpdownGoodsEntity warehouseUpdownGoodsEntity = new WarehouseUpdownGoodsEntity(); |
|
|
|
@ -697,16 +697,16 @@ public class DistributionStockupAppController extends BladeController {
|
|
|
|
|
warehouseUpdownGoodsEntity.setAllocationId(stockupDTO.getAllocationId()); |
|
|
|
|
warehouseUpdownGoodsEntity.setWarehouseId(myCurrentWarehouse.getId()); |
|
|
|
|
WarehouseUpdownGoodsEntity locationInformation = warehouseUpdownGoodsClient.getLocationInformation(warehouseUpdownGoodsEntity); |
|
|
|
|
if (Func.isEmpty(locationInformation)){ |
|
|
|
|
return Resp.scanFail(60007,"库位无此包件!!!","库位无此包件!!!",""); |
|
|
|
|
if (Func.isEmpty(locationInformation)) { |
|
|
|
|
return Resp.scanFail(60007, "库位无此包件!!!", "库位无此包件!!!", ""); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//判断扫描的包件是否可以继续进行该预约的库存品备货
|
|
|
|
|
int isStockUp = judgmentIsStockUp(stockupDTO.getReservationId(),stockupDTO.getStockListId(),distributionParcelListEntity,myCurrentWarehouse.getId(),stockupDTO.getCargoNumber()); |
|
|
|
|
int isStockUp = judgmentIsStockUp(stockupDTO.getReservationId(), stockupDTO.getStockListId(), distributionParcelListEntity, myCurrentWarehouse.getId(), stockupDTO.getCargoNumber()); |
|
|
|
|
DistributionStockListEntity distributionStockListEntities = distributionStockupService.selectStockListInfoByCargoNumberList(stockupDTO.getReservationId(), stockupDTO.getCargoNumber(), stockupDTO.getAllocationId(), stockupDTO.getPacketBarCode()); |
|
|
|
|
switch (isStockUp){ |
|
|
|
|
switch (isStockUp) { |
|
|
|
|
case 1: |
|
|
|
|
return Resp.scanFail(60008,"包件不属于此计划!!!","包件不属于此计划!!!",""); |
|
|
|
|
return Resp.scanFail(60008, "包件不属于此计划!!!", "包件不属于此计划!!!", ""); |
|
|
|
|
case 2: |
|
|
|
|
return R.data(60002, distributionStockListEntities.getId(), "当前包件批次号与入库批次号不符,是否确认修改计划批次"); |
|
|
|
|
// case 3:
|
|
|
|
@ -751,9 +751,9 @@ public class DistributionStockupAppController extends BladeController {
|
|
|
|
|
return R.data(200, "", "扫描成功!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private int judgmentIsStockUp(Long reservationId,Long stockListId, DistributionParcelListEntity distributionParcelListEntity, Long warehouseId,String cargoNumber) { |
|
|
|
|
private int judgmentIsStockUp(Long reservationId, Long stockListId, DistributionParcelListEntity distributionParcelListEntity, Long warehouseId, String cargoNumber) { |
|
|
|
|
List<DistributionReservationStocklistEntity> distributionReservationStocklistEntities = distributionReservationMapper.selectStockListByReservationId(reservationId); |
|
|
|
|
if (Func.isNotEmpty(distributionReservationStocklistEntities)){ |
|
|
|
|
if (Func.isNotEmpty(distributionReservationStocklistEntities)) { |
|
|
|
|
//查询库存品信息
|
|
|
|
|
List<Long> stockListIds = distributionReservationStocklistEntities.stream().map(DistributionReservationStocklistEntity::getStocklistId).collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
@ -785,13 +785,13 @@ public class DistributionStockupAppController extends BladeController {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
boolean isHave = stockListEntityList.stream().map(DistributionStockListEntity::getCargoNumber).anyMatch(s -> s.contains(distributionParcelListEntity.getMaterialCode())); |
|
|
|
|
if (!isHave){ |
|
|
|
|
if (!isHave) { |
|
|
|
|
//判断包件是否属于计划物料信息
|
|
|
|
|
return 1; |
|
|
|
|
} |
|
|
|
|
//判断该库存品包件是否属于计划的批次
|
|
|
|
|
boolean isHaveIncomingBatch = stockListEntityList.stream().map(DistributionStockListEntity::getIncomingBatch).anyMatch(s -> s.contains( distributionParcelListEntity.getOrderCode())); |
|
|
|
|
if (!isHaveIncomingBatch){ |
|
|
|
|
boolean isHaveIncomingBatch = stockListEntityList.stream().map(DistributionStockListEntity::getIncomingBatch).anyMatch(s -> s.contains(distributionParcelListEntity.getOrderCode())); |
|
|
|
|
if (!isHaveIncomingBatch) { |
|
|
|
|
return 2; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -801,6 +801,7 @@ public class DistributionStockupAppController extends BladeController {
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 获取计划中库存品 |
|
|
|
|
* |
|
|
|
|
* @param stockupDTO |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
@ -819,7 +820,6 @@ public class DistributionStockupAppController extends BladeController {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//todo 这里代码没有写完 等TJJ 和CYZ 空了来写
|
|
|
|
|
@ResponseBody |
|
|
|
|
@PostMapping("/updateStockup") |
|
|
|
@ -963,18 +963,18 @@ public class DistributionStockupAppController extends BladeController {
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
if (Func.isNotEmpty(distributionReservationStocklistEntities)){ |
|
|
|
|
if (Func.isNotEmpty(distributionReservationStocklistEntities)) { |
|
|
|
|
|
|
|
|
|
boolean isAdd = distributionReservationStocklistEntities.stream().map(DistributionReservationStocklistEntity::getStocklistId).anyMatch(s -> s.equals(stockupDTO.getStockListId())); |
|
|
|
|
//扣减对应的库存品信息
|
|
|
|
|
// DistributionStockListEntity newStockListEntity = distributionStockListService.getById(stockupDTO.getStockListId());
|
|
|
|
|
if (!isAdd){ |
|
|
|
|
if (!isAdd) { |
|
|
|
|
///先进行对应的扣减
|
|
|
|
|
//查询该预约该物料的库存品信息
|
|
|
|
|
List<DistributionReservationStocklistEntity> reservationStocklistEntities = distributionReservationMapper.selectInventoryListByIdAndMateriel(stockupDTO.getReservationId(),stockupDTO.getCargoNumber()); |
|
|
|
|
List<DistributionReservationStocklistEntity> reservationStocklistEntities = distributionReservationMapper.selectInventoryListByIdAndMateriel(stockupDTO.getReservationId(), stockupDTO.getCargoNumber()); |
|
|
|
|
//可能会出现同一物料不同批次的库存品
|
|
|
|
|
List<DistributionReservationStocklistEntity> reservationStockList = reservationStocklistEntities.stream().filter(drs -> drs.getReservationNum() > 0 && drs.getRealityNum() < drs.getReservationNum()).collect(Collectors.toList()); |
|
|
|
|
if (Func.isNotEmpty(reservationStockList)){ |
|
|
|
|
if (Func.isNotEmpty(reservationStockList)) { |
|
|
|
|
DistributionReservationStocklistEntity oldReservationStocklistEntity = reservationStockList.get(0); |
|
|
|
|
//扣减计划数量
|
|
|
|
|
oldReservationStocklistEntity.setReservationNum(oldReservationStocklistEntity.getReservationNum() - 1); |
|
|
|
@ -993,7 +993,7 @@ public class DistributionStockupAppController extends BladeController {
|
|
|
|
|
|
|
|
|
|
//对指定库存品包件进行库存品ID修改
|
|
|
|
|
DisStockListDetailEntity disStockListDetailEntity = stockListDetailEntities.stream().filter(sd -> Func.isEmpty(sd.getStockPackageCode())).collect(Collectors.toList()).get(0); |
|
|
|
|
if (Func.isNotEmpty(disStockListDetailEntity)){ |
|
|
|
|
if (Func.isNotEmpty(disStockListDetailEntity)) { |
|
|
|
|
disStockListDetailEntity.setStockListId(stockupDTO.getStockListId()); |
|
|
|
|
disStockListDetailService.updateById(disStockListDetailEntity); |
|
|
|
|
} |
|
|
|
@ -1010,7 +1010,7 @@ public class DistributionStockupAppController extends BladeController {
|
|
|
|
|
reservationStocklistEntity.setSigningStatus("10"); |
|
|
|
|
reservationStocklistEntity.setStockListStatus("3"); |
|
|
|
|
DistributionStockListEntity stockListEntity = distributionStockListService.getById(stockupDTO.getStockListId()); |
|
|
|
|
if(ObjectUtils.isNotNull(stockListEntity)){ |
|
|
|
|
if (ObjectUtils.isNotNull(stockListEntity)) { |
|
|
|
|
reservationStocklistEntity.setStocklistId(stockListEntity.getId()); |
|
|
|
|
reservationStocklistEntity.setUnit(stockListEntity.getCargoUnit()); |
|
|
|
|
reservationStocklistEntity.setRealityNum(0); |
|
|
|
@ -1067,7 +1067,7 @@ public class DistributionStockupAppController extends BladeController {
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
} |
|
|
|
|
// 默认 计划数量和实际数量为0
|
|
|
|
|
// 默认 计划数量和实际数量为0
|
|
|
|
|
return R.success("操作成功"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1082,7 +1082,7 @@ public class DistributionStockupAppController extends BladeController {
|
|
|
|
|
// TransactionStatus transactionStatus = dataSourceTransactionManager.getTransaction(transactionDefinition);
|
|
|
|
|
// try{
|
|
|
|
|
//设置lockey
|
|
|
|
|
String lockKey = "Lock:"+stockupDTO.getPacketBarCode() + stockupDTO.getStockupId(); |
|
|
|
|
String lockKey = "Lock:" + stockupDTO.getPacketBarCode() + stockupDTO.getStockupId(); |
|
|
|
|
log.info("#################stockupScan:获取redisson对象开始"); |
|
|
|
|
// RLock lock = redisson.getLock(lockKey);
|
|
|
|
|
// if (lock.isLocked()) {
|
|
|
|
@ -1090,11 +1090,11 @@ public class DistributionStockupAppController extends BladeController {
|
|
|
|
|
// return Resp.scanFail(PdaAudioLingoStatus.chongfusaomiao.getName(), audioValue2);
|
|
|
|
|
// }
|
|
|
|
|
// lock.lock(5, TimeUnit.SECONDS);
|
|
|
|
|
if(redis.exists(lockKey)){ |
|
|
|
|
if (redis.exists(lockKey)) { |
|
|
|
|
String audioValue2 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, PdaAudioLingoStatus.chongfusaomiao.getValue()); |
|
|
|
|
return Resp.scanFail(PdaAudioLingoStatus.chongfusaomiao.getName(), audioValue2); |
|
|
|
|
} |
|
|
|
|
redis.setEx(lockKey,stockupDTO.getPacketBarCode() + stockupDTO.getStockupId(),5L); |
|
|
|
|
redis.setEx(lockKey, stockupDTO.getPacketBarCode() + stockupDTO.getStockupId(), 5L); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (scanType == 1) { |
|
|
|
@ -1105,8 +1105,8 @@ public class DistributionStockupAppController extends BladeController {
|
|
|
|
|
//库存平
|
|
|
|
|
R fail = stockupScanByStock(stockupDTO); |
|
|
|
|
if (fail != null) { |
|
|
|
|
return fail; |
|
|
|
|
} |
|
|
|
|
return fail; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
log.warn("###################stockupScan: 未知的扫码类型 scanType={}", scanType); |
|
|
|
@ -1132,8 +1132,8 @@ public class DistributionStockupAppController extends BladeController {
|
|
|
|
|
Long allocationId = stockupDTO.getAllocationId();//备货区
|
|
|
|
|
Integer stockPrint = stockupDTO.getStockPrint(); // 库存
|
|
|
|
|
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse(); |
|
|
|
|
if (Func.isEmpty(myCurrentWarehouse)){ |
|
|
|
|
return R.data(403,"未授权!!!"); |
|
|
|
|
if (Func.isEmpty(myCurrentWarehouse)) { |
|
|
|
|
return R.data(403, "未授权!!!"); |
|
|
|
|
} |
|
|
|
|
if (StringUtil.isBlank(packetBarCode)) { |
|
|
|
|
log.warn("##################stockupScan: 库存品扫码,包件码为空"); |
|
|
|
@ -1161,156 +1161,156 @@ public class DistributionStockupAppController extends BladeController {
|
|
|
|
|
return R.fail("货位ID不能为空"); |
|
|
|
|
} |
|
|
|
|
//判断是否可以继续备货
|
|
|
|
|
DistributionStockListEntity byId = null; |
|
|
|
|
DistributionStockListEntity byId = null; |
|
|
|
|
// if (ObjectUtils.isNull(stockListId)) {
|
|
|
|
|
// 通过扫码的二维码 查询其对应的库存存信息
|
|
|
|
|
if (stockupDTO.getStockPrint() == 1) { |
|
|
|
|
//1 原有包条
|
|
|
|
|
byId = distributionStockListService.selectStockInforByOrderPackageCode(stockupDTO.getPacketBarCode()); |
|
|
|
|
} else { |
|
|
|
|
// 通过扫码的二维码 查询其对应的库存存信息
|
|
|
|
|
if (stockupDTO.getStockPrint() == 1) { |
|
|
|
|
//1 原有包条
|
|
|
|
|
byId = distributionStockListService.selectStockInforByOrderPackageCode(stockupDTO.getPacketBarCode()); |
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
// 判断stockupDTO.getMallName() 是否存在
|
|
|
|
|
if(ObjectUtils.isNull(stockupDTO.getMallName())){ |
|
|
|
|
// 查询出来 重新复制
|
|
|
|
|
DistributionStockListEntity byId1 = distributionStockListService.getById(stockupDTO.getStockListId()); |
|
|
|
|
if(!ObjectUtils.isNull(byId1)){ |
|
|
|
|
stockupDTO.setMallName(byId1.getMallName()); |
|
|
|
|
} |
|
|
|
|
// 判断stockupDTO.getMallName() 是否存在
|
|
|
|
|
if (ObjectUtils.isNull(stockupDTO.getMallName()) || "null".equals(stockupDTO.getMallName())) { |
|
|
|
|
// 查询出来 重新复制
|
|
|
|
|
DistributionStockListEntity byId1 = distributionStockListService.getById(stockupDTO.getStockListId()); |
|
|
|
|
if (!ObjectUtils.isNull(byId1)) { |
|
|
|
|
stockupDTO.setMallName(byId1.getMallName()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 2打印处理的扫码
|
|
|
|
|
// 查询当前库位上最早入库的指定物料库存品
|
|
|
|
|
byId = disStockOrdercodeRecoService.selectStockOrdercodeRecoListByCode(stockupDTO.getCargoNumber(),stockupDTO.getAllocationId(),stockupDTO.getMallName()); |
|
|
|
|
// 2打印处理的扫码
|
|
|
|
|
// 查询当前库位上最早入库的指定物料库存品
|
|
|
|
|
byId = disStockOrdercodeRecoService.selectStockOrdercodeRecoListByCode(stockupDTO.getCargoNumber(), stockupDTO.getAllocationId(), stockupDTO.getMallName()); |
|
|
|
|
|
|
|
|
|
// 需要判断当前这个找到的备货批次和计划的批次是否一直,如果不一致 就需要新增一个预约备货记录 扣减当前的数量
|
|
|
|
|
// 需要判断当前这个找到的备货批次和计划的批次是否一直,如果不一致 就需要新增一个预约备货记录 扣减当前的数量
|
|
|
|
|
// updateStockOrdercodeRecoS(reservationId,byId);
|
|
|
|
|
|
|
|
|
|
if (Func.isEmpty(byId)){ |
|
|
|
|
return Resp.scanFail("当前库位无此物料库存品","当前库位无此物料库存品"); |
|
|
|
|
} |
|
|
|
|
//判断当前库位上满足条件的库存品是否存在于预约计划中,如果不存在则需要对预约计划进行修改
|
|
|
|
|
List<DistributionReservationStocklistEntity> reservationStocklistEntityList = distributionReservationMapper.selectInventoryListByIdAndMateriel(stockupDTO.getReservationId(), stockupDTO.getCargoNumber()); |
|
|
|
|
if (Func.isNotEmpty(reservationStocklistEntityList)){ |
|
|
|
|
DistributionStockListEntity finalById = byId; |
|
|
|
|
boolean flag = reservationStocklistEntityList.stream() |
|
|
|
|
.map(DistributionReservationStocklistEntity::getStocklistId) |
|
|
|
|
.anyMatch(s -> s.equals(finalById.getId())); |
|
|
|
|
if (!flag){ |
|
|
|
|
DistributionReservationStocklistEntity rs = new DistributionReservationStocklistEntity(); |
|
|
|
|
rs.setReservationNum(1); |
|
|
|
|
rs.setStockListStatus(ReservationOrderStatusConstant.zengjia.getValue()); |
|
|
|
|
rs.setReservationId(stockupDTO.getReservationId()); |
|
|
|
|
rs.setRealityNum(0); |
|
|
|
|
rs.setUnit(byId.getCargoUnit()); |
|
|
|
|
rs.setLoadingStatus(ReservationLoadingStatusConstant.daizhuangche.getValue()); |
|
|
|
|
rs.setSigningStatus(ReservationSigningStatusConstant.daiqianshou.getValue()); |
|
|
|
|
rs.setStocklistId(byId.getId()); |
|
|
|
|
distributionReservationStocklistService.save(rs); |
|
|
|
|
|
|
|
|
|
DistributionStockListEntity stockListEntity = distributionStockListService.getById(byId.getId()); |
|
|
|
|
stockListEntity.setQuantityOccupied(stockListEntity.getQuantityOccupied() + 1); |
|
|
|
|
distributionStockListService.updateById(stockListEntity); |
|
|
|
|
if (Func.isEmpty(byId)) { |
|
|
|
|
return Resp.scanFail("当前库位无此物料库存品", "当前库位无此物料库存品"); |
|
|
|
|
} |
|
|
|
|
//判断当前库位上满足条件的库存品是否存在于预约计划中,如果不存在则需要对预约计划进行修改
|
|
|
|
|
List<DistributionReservationStocklistEntity> reservationStocklistEntityList = distributionReservationMapper.selectInventoryListByIdAndMateriel(stockupDTO.getReservationId(), stockupDTO.getCargoNumber()); |
|
|
|
|
if (Func.isNotEmpty(reservationStocklistEntityList)) { |
|
|
|
|
DistributionStockListEntity finalById = byId; |
|
|
|
|
boolean flag = reservationStocklistEntityList.stream() |
|
|
|
|
.map(DistributionReservationStocklistEntity::getStocklistId) |
|
|
|
|
.anyMatch(s -> s.equals(finalById.getId())); |
|
|
|
|
if (!flag) { |
|
|
|
|
DistributionReservationStocklistEntity rs = new DistributionReservationStocklistEntity(); |
|
|
|
|
rs.setReservationNum(1); |
|
|
|
|
rs.setStockListStatus(ReservationOrderStatusConstant.zengjia.getValue()); |
|
|
|
|
rs.setReservationId(stockupDTO.getReservationId()); |
|
|
|
|
rs.setRealityNum(0); |
|
|
|
|
rs.setUnit(byId.getCargoUnit()); |
|
|
|
|
rs.setLoadingStatus(ReservationLoadingStatusConstant.daizhuangche.getValue()); |
|
|
|
|
rs.setSigningStatus(ReservationSigningStatusConstant.daiqianshou.getValue()); |
|
|
|
|
rs.setStocklistId(byId.getId()); |
|
|
|
|
distributionReservationStocklistService.save(rs); |
|
|
|
|
|
|
|
|
|
DistributionStockListEntity stockListEntity = distributionStockListService.getById(byId.getId()); |
|
|
|
|
stockListEntity.setQuantityOccupied(stockListEntity.getQuantityOccupied() + 1); |
|
|
|
|
distributionStockListService.updateById(stockListEntity); |
|
|
|
|
|
|
|
|
|
//原来对应的需要进行计划减少
|
|
|
|
|
//收集满足修改条件的计划库存品
|
|
|
|
|
List<DistributionReservationStocklistEntity> reservationStocklistEntities = new ArrayList<>(); |
|
|
|
|
for (DistributionReservationStocklistEntity reservationStocklistEntity : reservationStocklistEntityList) { |
|
|
|
|
if (reservationStocklistEntity.getReservationNum() >= reservationStocklistEntity.getRealityNum() && reservationStocklistEntity.getReservationNum() > 0) { |
|
|
|
|
reservationStocklistEntities.add(reservationStocklistEntity); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (Func.isEmpty(reservationStocklistEntities)) { |
|
|
|
|
return R.fail("该物料库存品备货已完成"); |
|
|
|
|
} |
|
|
|
|
DistributionReservationStocklistEntity reservationStocklistEntity = reservationStocklistEntities.get(0); |
|
|
|
|
int oldRsNum = reservationStocklistEntity.getReservationNum() - 1; |
|
|
|
|
if (oldRsNum < 0) { |
|
|
|
|
return R.fail("操作数据错误"); |
|
|
|
|
} |
|
|
|
|
reservationStocklistEntity.setReservationNum(oldRsNum); |
|
|
|
|
if (reservationStocklistEntity.getReservationNum() == 0) { |
|
|
|
|
reservationStocklistEntity.setStockListStatus(ReservationOrderStatusConstant.quxiao.getValue()); |
|
|
|
|
} |
|
|
|
|
distributionReservationStocklistService.updateById(reservationStocklistEntity); |
|
|
|
|
|
|
|
|
|
//维护老的的冻结数量
|
|
|
|
|
DistributionStockListEntity oldStockList = distributionStockListService.getById(reservationStocklistEntity.getStocklistId()); |
|
|
|
|
oldStockList.setQuantityOccupied(oldStockList.getQuantityOccupied() - 1); |
|
|
|
|
distributionStockListService.updateById(oldStockList); |
|
|
|
|
|
|
|
|
|
//原来对应的需要进行计划减少
|
|
|
|
|
//收集满足修改条件的计划库存品
|
|
|
|
|
List<DistributionReservationStocklistEntity> reservationStocklistEntities = new ArrayList<>(); |
|
|
|
|
for (DistributionReservationStocklistEntity reservationStocklistEntity : reservationStocklistEntityList) { |
|
|
|
|
if (reservationStocklistEntity.getReservationNum() >= reservationStocklistEntity.getRealityNum() && reservationStocklistEntity.getReservationNum() > 0){ |
|
|
|
|
reservationStocklistEntities.add(reservationStocklistEntity); |
|
|
|
|
|
|
|
|
|
//查询对应的包件进行修改
|
|
|
|
|
List<DisStockListDetailEntity> stockListDetailEntities = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda() |
|
|
|
|
.eq(DisStockListDetailEntity::getReservationId, stockupDTO.getReservationId()) |
|
|
|
|
.eq(DisStockListDetailEntity::getStockListId, oldStockList.getId()) |
|
|
|
|
.ne(DisStockListDetailEntity::getStockPackageStatus, ReservationPackageStatusConstant.quxiao.getValue()) |
|
|
|
|
); |
|
|
|
|
DisStockListDetailEntity disStockListDetailEntity = stockListDetailEntities.stream().filter(s -> Func.isBlank(s.getStockPackageCode())).collect(Collectors.toList()).get(0); |
|
|
|
|
disStockListDetailEntity.setStockListId(rs.getStocklistId()); |
|
|
|
|
// disStockListDetailEntity.setStockStatus(OrderPackageStockupStatusConstant.yibeihu.getValue());
|
|
|
|
|
disStockListDetailService.updateById(disStockListDetailEntity); |
|
|
|
|
} else { |
|
|
|
|
//判断是否是为增加库存品进行数据维护
|
|
|
|
|
DistributionStockListEntity finalById1 = byId; |
|
|
|
|
DistributionReservationStocklistEntity reservationStocklistEntity = reservationStocklistEntityList.stream().filter(f -> f.getStocklistId().equals(finalById1.getId())).collect(Collectors.toList()).get(0); |
|
|
|
|
//因为新增库存品的时候会完成扫描 此时的增加数和备货数量时一样的
|
|
|
|
|
if (reservationStocklistEntity.getStockListStatus().equals(ReservationOrderStatusConstant.zengjia.getValue()) && Objects.equals(reservationStocklistEntity.getReservationNum(), reservationStocklistEntity.getRealityNum())) { |
|
|
|
|
List<DistributionReservationStocklistEntity> oldRS = distributionReservationMapper.selectStockListByReservationIdAndCargoNumber(reservationStocklistEntity.getReservationId(), stockupDTO.getCargoNumber(), reservationStocklistEntity.getStocklistId()); |
|
|
|
|
//收集满足条件的库存品
|
|
|
|
|
List<DistributionReservationStocklistEntity> rs = new ArrayList<>(); |
|
|
|
|
for (DistributionReservationStocklistEntity oldR : oldRS) { |
|
|
|
|
if (oldR.getReservationNum() >= oldR.getRealityNum() && oldR.getReservationNum() > 0) { |
|
|
|
|
rs.add(oldR); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (Func.isEmpty(reservationStocklistEntities)){ |
|
|
|
|
if (Func.isEmpty(rs)) { |
|
|
|
|
//不存在还需要进行备货的库存品
|
|
|
|
|
return R.fail("该物料库存品备货已完成"); |
|
|
|
|
} |
|
|
|
|
DistributionReservationStocklistEntity reservationStocklistEntity = reservationStocklistEntities.get(0); |
|
|
|
|
int oldRsNum = reservationStocklistEntity.getReservationNum() - 1; |
|
|
|
|
if (oldRsNum<0){ |
|
|
|
|
return R.fail("操作数据错误"); |
|
|
|
|
} |
|
|
|
|
reservationStocklistEntity.setReservationNum(oldRsNum); |
|
|
|
|
if (reservationStocklistEntity.getReservationNum() == 0){ |
|
|
|
|
reservationStocklistEntity.setStockListStatus(ReservationOrderStatusConstant.quxiao.getValue()); |
|
|
|
|
} |
|
|
|
|
distributionReservationStocklistService.updateById(reservationStocklistEntity); |
|
|
|
|
DistributionReservationStocklistEntity oldReservationStockList = rs.get(0); |
|
|
|
|
int oldReservationNum = oldReservationStockList.getReservationNum() - 1; |
|
|
|
|
|
|
|
|
|
//维护老的的冻结数量
|
|
|
|
|
DistributionStockListEntity oldStockList = distributionStockListService.getById(reservationStocklistEntity.getStocklistId()); |
|
|
|
|
oldStockList.setQuantityOccupied(oldStockList.getQuantityOccupied() - 1); |
|
|
|
|
distributionStockListService.updateById(oldStockList); |
|
|
|
|
oldReservationStockList.setReservationNum(oldReservationNum); |
|
|
|
|
if (oldReservationNum == 0) { |
|
|
|
|
oldReservationStockList.setStockListStatus(ReservationOrderStatusConstant.quxiao.getValue()); |
|
|
|
|
} |
|
|
|
|
distributionReservationStocklistService.updateById(oldReservationStockList); |
|
|
|
|
//修改对应库存品数量
|
|
|
|
|
DistributionStockListEntity stockListEntity = distributionStockListService.getById(oldReservationStockList.getStocklistId()); |
|
|
|
|
stockListEntity.setQuantityOccupied(stockListEntity.getQuantityOccupied() - 1); |
|
|
|
|
distributionStockListService.updateById(stockListEntity); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//查询对应的包件进行修改
|
|
|
|
|
List<DisStockListDetailEntity> stockListDetailEntities = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda() |
|
|
|
|
.eq(DisStockListDetailEntity::getReservationId, stockupDTO.getReservationId()) |
|
|
|
|
.eq(DisStockListDetailEntity::getStockListId, oldStockList.getId()) |
|
|
|
|
//找出对库存品包件信息进行包件的修改
|
|
|
|
|
List<DisStockListDetailEntity> oldRsPack = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda() |
|
|
|
|
.eq(DisStockListDetailEntity::getReservationId, oldReservationStockList.getReservationId()) |
|
|
|
|
.eq(DisStockListDetailEntity::getStockListId, oldReservationStockList.getStocklistId()) |
|
|
|
|
.ne(DisStockListDetailEntity::getStockPackageStatus, ReservationPackageStatusConstant.quxiao.getValue()) |
|
|
|
|
); |
|
|
|
|
DisStockListDetailEntity disStockListDetailEntity = stockListDetailEntities.stream().filter(s -> Func.isBlank(s.getStockPackageCode())).collect(Collectors.toList()).get(0); |
|
|
|
|
disStockListDetailEntity.setStockListId(rs.getStocklistId()); |
|
|
|
|
// disStockListDetailEntity.setStockStatus(OrderPackageStockupStatusConstant.yibeihu.getValue());
|
|
|
|
|
disStockListDetailService.updateById(disStockListDetailEntity); |
|
|
|
|
}else { |
|
|
|
|
//判断是否是为增加库存品进行数据维护
|
|
|
|
|
DistributionStockListEntity finalById1 = byId; |
|
|
|
|
DistributionReservationStocklistEntity reservationStocklistEntity = reservationStocklistEntityList.stream().filter(f -> f.getStocklistId().equals(finalById1.getId())).collect(Collectors.toList()).get(0); |
|
|
|
|
//因为新增库存品的时候会完成扫描 此时的增加数和备货数量时一样的
|
|
|
|
|
if (reservationStocklistEntity.getStockListStatus().equals(ReservationOrderStatusConstant.zengjia.getValue()) && Objects.equals(reservationStocklistEntity.getReservationNum(), reservationStocklistEntity.getRealityNum())){ |
|
|
|
|
List<DistributionReservationStocklistEntity> oldRS = distributionReservationMapper.selectStockListByReservationIdAndCargoNumber(reservationStocklistEntity.getReservationId(), stockupDTO.getCargoNumber(), reservationStocklistEntity.getStocklistId()); |
|
|
|
|
//收集满足条件的库存品
|
|
|
|
|
List<DistributionReservationStocklistEntity> rs = new ArrayList<>(); |
|
|
|
|
for (DistributionReservationStocklistEntity oldR : oldRS) { |
|
|
|
|
if (oldR.getReservationNum() >= oldR.getRealityNum() && oldR.getReservationNum() > 0){ |
|
|
|
|
rs.add(oldR); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (Func.isEmpty(rs)){ |
|
|
|
|
//不存在还需要进行备货的库存品
|
|
|
|
|
return R.fail("该物料库存品备货已完成"); |
|
|
|
|
} |
|
|
|
|
DistributionReservationStocklistEntity oldReservationStockList = rs.get(0); |
|
|
|
|
int oldReservationNum = oldReservationStockList.getReservationNum() - 1; |
|
|
|
|
|
|
|
|
|
oldReservationStockList.setReservationNum(oldReservationNum); |
|
|
|
|
if (oldReservationNum == 0){ |
|
|
|
|
oldReservationStockList.setStockListStatus(ReservationOrderStatusConstant.quxiao.getValue()); |
|
|
|
|
} |
|
|
|
|
distributionReservationStocklistService.updateById(oldReservationStockList); |
|
|
|
|
//修改对应库存品数量
|
|
|
|
|
DistributionStockListEntity stockListEntity = distributionStockListService.getById(oldReservationStockList.getStocklistId()); |
|
|
|
|
stockListEntity.setQuantityOccupied(stockListEntity.getQuantityOccupied() -1 ); |
|
|
|
|
distributionStockListService.updateById(stockListEntity); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//找出对库存品包件信息进行包件的修改
|
|
|
|
|
List<DisStockListDetailEntity> oldRsPack = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda() |
|
|
|
|
.eq(DisStockListDetailEntity::getReservationId, oldReservationStockList.getReservationId()) |
|
|
|
|
.eq(DisStockListDetailEntity::getStockListId, oldReservationStockList.getStocklistId()) |
|
|
|
|
.ne(DisStockListDetailEntity::getStockPackageStatus, ReservationPackageStatusConstant.quxiao.getValue()) |
|
|
|
|
); |
|
|
|
|
if (Func.isEmpty(oldRsPack)){ |
|
|
|
|
return R.fail("该物料库存品备货已完成"); |
|
|
|
|
} |
|
|
|
|
List<DisStockListDetailEntity> collect = oldRsPack.stream().filter(f -> Func.isBlank(f.getStockPackageCode())).collect(Collectors.toList()); |
|
|
|
|
DisStockListDetailEntity disStockListDetailEntity = collect.get(0); |
|
|
|
|
disStockListDetailEntity.setStockListId(reservationStocklistEntity.getStocklistId()); |
|
|
|
|
if (Func.isEmpty(oldRsPack)) { |
|
|
|
|
return R.fail("该物料库存品备货已完成"); |
|
|
|
|
} |
|
|
|
|
List<DisStockListDetailEntity> collect = oldRsPack.stream().filter(f -> Func.isBlank(f.getStockPackageCode())).collect(Collectors.toList()); |
|
|
|
|
DisStockListDetailEntity disStockListDetailEntity = collect.get(0); |
|
|
|
|
disStockListDetailEntity.setStockListId(reservationStocklistEntity.getStocklistId()); |
|
|
|
|
// disStockListDetailEntity.setStockStatus(OrderPackageStockupStatusConstant.yibeihu.getValue());
|
|
|
|
|
disStockListDetailService.updateById(disStockListDetailEntity); |
|
|
|
|
disStockListDetailService.updateById(disStockListDetailEntity); |
|
|
|
|
|
|
|
|
|
reservationStocklistEntity.setReservationNum(reservationStocklistEntity.getReservationNum() + 1 ); |
|
|
|
|
distributionReservationStocklistService.updateById(reservationStocklistEntity); |
|
|
|
|
reservationStocklistEntity.setReservationNum(reservationStocklistEntity.getReservationNum() + 1); |
|
|
|
|
distributionReservationStocklistService.updateById(reservationStocklistEntity); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//维护库存品在库数量
|
|
|
|
|
DistributionStockListEntity newStockList = distributionStockListService.getById(reservationStocklistEntity.getStocklistId()); |
|
|
|
|
newStockList.setQuantityOccupied(newStockList.getQuantityOccupied() +1); |
|
|
|
|
distributionStockListService.updateById(newStockList); |
|
|
|
|
} |
|
|
|
|
//维护库存品在库数量
|
|
|
|
|
DistributionStockListEntity newStockList = distributionStockListService.getById(reservationStocklistEntity.getStocklistId()); |
|
|
|
|
newStockList.setQuantityOccupied(newStockList.getQuantityOccupied() + 1); |
|
|
|
|
distributionStockListService.updateById(newStockList); |
|
|
|
|
} |
|
|
|
|
//当前库位最先入库的批次和计划批次一致
|
|
|
|
|
} |
|
|
|
|
//当前库位最先入库的批次和计划批次一致
|
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(byId)){ |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(byId)) { |
|
|
|
|
stockupDTO.setStockListId(byId.getId()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1369,10 +1369,10 @@ public class DistributionStockupAppController extends BladeController {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//有数数据校验 修改库存品数据
|
|
|
|
|
if ("1".equals(byId.getSourceType())){ |
|
|
|
|
if ("1".equals(byId.getSourceType())) { |
|
|
|
|
R r1 = distributionStockupService.handlingPackages(stockupDTO); |
|
|
|
|
if(r1.getCode() != 200){ |
|
|
|
|
Resp.scanFail(r1.getMsg(),r1.getMsg()); |
|
|
|
|
if (r1.getCode() != 200) { |
|
|
|
|
Resp.scanFail(r1.getMsg(), r1.getMsg()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
Integer i = distributionStockupService.selectPackagePrint(stockupDTO); |
|
|
|
@ -1422,7 +1422,7 @@ public class DistributionStockupAppController extends BladeController {
|
|
|
|
|
jsonObject.put("incomingBatch", byId.getIncomingBatch()); |
|
|
|
|
jsonObject.put("enterNum", 1); |
|
|
|
|
jsonObject.put("allocationId", stockupDTO.getAllocationId()); |
|
|
|
|
jsonObject.put("remark","备货无数据库存品下架"); |
|
|
|
|
jsonObject.put("remark", "备货无数据库存品下架"); |
|
|
|
|
List<JSONObject> list = new ArrayList<>(); |
|
|
|
|
list.add(jsonObject); |
|
|
|
|
R r = warehouseUpdownTypeClient.downStock(list); |
|
|
|
@ -1431,7 +1431,7 @@ public class DistributionStockupAppController extends BladeController {
|
|
|
|
|
// return Resp.scanFail("下架失败,请联系管理员!!", "下架失败,请联系管理员!!");
|
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
R r = warehouseUpdownTypeClient.downPackage(packetBarCode, byId.getWarehouseId(),"备货下架包件"); |
|
|
|
|
R r = warehouseUpdownTypeClient.downPackage(packetBarCode, byId.getWarehouseId(), "备货下架包件"); |
|
|
|
|
if (r.getCode() != 200) { |
|
|
|
|
log.debug("##########" + r.getMsg()); |
|
|
|
|
// return Resp.scanFail("下架失败,请联系管理员!!", "下架失败,请联系管理员!!");
|
|
|
|
@ -1471,10 +1471,10 @@ public class DistributionStockupAppController extends BladeController {
|
|
|
|
|
String audioValue = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, PdaAudioLingoStatus.saomiaochenggong.getValue()); |
|
|
|
|
|
|
|
|
|
//进行备货库位上架
|
|
|
|
|
if (!Func.isEmpty(stockupDTO.getStockupAllocationId())){ |
|
|
|
|
if (!Func.isEmpty(stockupDTO.getStockupAllocationId())) { |
|
|
|
|
JSONObject jsonObject = new JSONObject(); |
|
|
|
|
jsonObject.put("warehouseId", myCurrentWarehouse.getId()); |
|
|
|
|
jsonObject.put("code",packetBarCode); |
|
|
|
|
jsonObject.put("code", packetBarCode); |
|
|
|
|
jsonObject.put("stockUpAllocationId", stockupDTO.getStockupAllocationId()); |
|
|
|
|
jsonObject.put("type", 2); |
|
|
|
|
jsonObject.put("num", 1); |
|
|
|
@ -1551,7 +1551,7 @@ public class DistributionStockupAppController extends BladeController {
|
|
|
|
|
// Long stockUpAllocationId = stockupDTO.getStockupAllocationId();//备货库位ID
|
|
|
|
|
if (Objects.isNull(myCurrentWarehouse)) { |
|
|
|
|
log.warn("##################stockupScan: 未选择仓库,订单自编号为空"); |
|
|
|
|
return R.fail(403,"未授权!!"); |
|
|
|
|
return R.fail(403, "未授权!!"); |
|
|
|
|
} |
|
|
|
|
if (StringUtil.isBlank(orderCode)) { |
|
|
|
|
log.warn("##################stockupScan: 包件扫码,订单自编号为空"); |
|
|
|
@ -1613,7 +1613,7 @@ public class DistributionStockupAppController extends BladeController {
|
|
|
|
|
warehouseUpdownGoodsEntity.setAssociationValue(stockupDTO.getPacketBarCode()); |
|
|
|
|
warehouseUpdownGoodsEntity.setWarehouseId(distributionStockupEntity.getWarehouseId()); |
|
|
|
|
WarehouseUpdownGoodsEntity locationInformation = warehouseUpdownGoodsClient.getLocationInformation(warehouseUpdownGoodsEntity); |
|
|
|
|
if(ObjectUtils.isNotNull(locationInformation)){ |
|
|
|
|
if (ObjectUtils.isNotNull(locationInformation)) { |
|
|
|
|
entity.setAllocationTitle(locationInformation.getPositionCode()); |
|
|
|
|
} |
|
|
|
|
entity.setAllocationId(stockupDTO.getAllocationId()); |
|
|
|
@ -1648,33 +1648,33 @@ public class DistributionStockupAppController extends BladeController {
|
|
|
|
|
mapState.put("reservationId", stockupDTO.getReservationId()); |
|
|
|
|
mapState.put("logId", entity.getId()); |
|
|
|
|
mapState.put("messageData", entity); |
|
|
|
|
mapState.put("warehouseId",myCurrentWarehouse.getId()); |
|
|
|
|
mapState.put("warehouseId", myCurrentWarehouse.getId()); |
|
|
|
|
mapState.put("createTime", System.currentTimeMillis()); |
|
|
|
|
String audioValue = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, PdaAudioLingoStatus.saomiaochenggong.getValue()); |
|
|
|
|
|
|
|
|
|
log.info(">>>>>>>>>>>>>>>>>>>> 对扫码的包件进行下架"); |
|
|
|
|
//将消息携带绑定键值
|
|
|
|
|
rabbitTemplate.convertAndSend(RabbitConstant.STOCKUP_STATE_UPDATE_EXCHANGE, RabbitConstant.STOCKUP_STATE_UPDATE_ROUTING, mapState,message -> { |
|
|
|
|
rabbitTemplate.convertAndSend(RabbitConstant.STOCKUP_STATE_UPDATE_EXCHANGE, RabbitConstant.STOCKUP_STATE_UPDATE_ROUTING, mapState, message -> { |
|
|
|
|
message.getMessageProperties() |
|
|
|
|
.setHeader("x-delay", 3000); |
|
|
|
|
return message; |
|
|
|
|
}); |
|
|
|
|
//查询是否货位数据是否该下架
|
|
|
|
|
|
|
|
|
|
if (!Func.isEmpty(stockupDTO.getStockupAllocationId())){ |
|
|
|
|
JSONObject jsonObject = new JSONObject(); |
|
|
|
|
jsonObject.put("warehouseId", myCurrentWarehouse.getId()); |
|
|
|
|
jsonObject.put("code",packetBarCode); |
|
|
|
|
jsonObject.put("stockUpAllocationId", stockupDTO.getStockupAllocationId()); |
|
|
|
|
jsonObject.put("type", 1); |
|
|
|
|
jsonObject.put("num", 1); |
|
|
|
|
//进行了备货库位的选择才进行备货库位的上架
|
|
|
|
|
warehouseUpdownStockUpAreaClient.upStockUpShelf(jsonObject); |
|
|
|
|
entity.setStockupAreaId(stockupDTO.getStockupAllocationId()); |
|
|
|
|
} |
|
|
|
|
if (!Func.isEmpty(stockupDTO.getStockupAllocationId())) { |
|
|
|
|
JSONObject jsonObject = new JSONObject(); |
|
|
|
|
jsonObject.put("warehouseId", myCurrentWarehouse.getId()); |
|
|
|
|
jsonObject.put("code", packetBarCode); |
|
|
|
|
jsonObject.put("stockUpAllocationId", stockupDTO.getStockupAllocationId()); |
|
|
|
|
jsonObject.put("type", 1); |
|
|
|
|
jsonObject.put("num", 1); |
|
|
|
|
//进行了备货库位的选择才进行备货库位的上架
|
|
|
|
|
warehouseUpdownStockUpAreaClient.upStockUpShelf(jsonObject); |
|
|
|
|
entity.setStockupAreaId(stockupDTO.getStockupAllocationId()); |
|
|
|
|
} |
|
|
|
|
distributionStockService.save(entity); |
|
|
|
|
|
|
|
|
|
//修改包件备货状态
|
|
|
|
|
//修改包件备货状态
|
|
|
|
|
DistributionParcelListEntity parcelListEntity = new DistributionParcelListEntity(); |
|
|
|
|
parcelListEntity.setId(entity.getParcelListId()); |
|
|
|
|
parcelListEntity.setOrderPackageStockupStatus(OrderPackageStockupStatusConstant.yibeihu.getValue()); |
|
|
|
|