|
|
|
@ -8001,72 +8001,71 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
.eq(DisStockListDetailEntity::getStockPackageCode, distrilbutionloadingscanDTO.getBarcode()) |
|
|
|
|
.ne(DisStockListDetailEntity::getStockPackageStatus, ReservationPackageStatusConstant.quxiao.getValue()) |
|
|
|
|
); |
|
|
|
|
if (list.isEmpty()) { |
|
|
|
|
if (!list.isEmpty()) { |
|
|
|
|
return Resp.scanFail("请在库存品页面扫描此码", "请在库存品页面扫描此码"); |
|
|
|
|
} else { |
|
|
|
|
}else { |
|
|
|
|
return Resp.scanFail("系统无编码", "系统无编码"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (OrderPackageLoadingStatusConstant.yizhuangche.getValue().equals(parcelListEntity.getOrderPackageLoadingStatus())) { |
|
|
|
|
return Resp.scanFail("此包件已装车", "此包件已装车"); |
|
|
|
|
} |
|
|
|
|
//再次校验是否装车
|
|
|
|
|
List<DistributionLoadscanEntity> loadscanEntityList = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda() |
|
|
|
|
.eq(DistributionLoadscanEntity::getOrderPackageCode, orderPackageCode) |
|
|
|
|
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()) |
|
|
|
|
); |
|
|
|
|
if (!loadscanEntityList.isEmpty()) { |
|
|
|
|
return Resp.scanFail("此包件已装车", "此包件已装车"); |
|
|
|
|
} |
|
|
|
|
//查询是否满足计划 以及计划在哪个客户中
|
|
|
|
|
Long reservationId = baseMapper.selectPackageByorderPackageCodeAndDeliveryId(orderPackageCode, deliveryId, warehouseId); |
|
|
|
|
DistributionReservationEntity reservationEntity = distributionReservationService.getById(reservationId); |
|
|
|
|
if (Objects.isNull(reservationEntity)) { |
|
|
|
|
log.error(method + "预约任务错误reservationId:{}",reservationId); |
|
|
|
|
return R.fail(403, "预约任务错误!!!"); |
|
|
|
|
} |
|
|
|
|
if (Objects.isNull(reservationId)) { |
|
|
|
|
//判定是否满足异常装车
|
|
|
|
|
Boolean isAbnormalLoadingFlag = judgeIsAbnormalLoading(deliveryId, parcelListEntity,reservationId); |
|
|
|
|
if (isAbnormalLoadingFlag) { |
|
|
|
|
return R.fail(5000, "异常装车"); |
|
|
|
|
log.info("异常装车判定成功>>>>>>packageCode:{},reservationId:{}", distrilbutionloadingscanDTO.getBarcode(), distrilbutionloadingscanDTO.getReservationId()); |
|
|
|
|
} |
|
|
|
|
return Resp.scanFail("蹿货", "蹿货"); |
|
|
|
|
} |
|
|
|
|
//正常进行装车
|
|
|
|
|
DistributionLoadscanEntity loadscanEntity = createdDistributionLoadscanEntity(deliveryListEntity,distributionDeliverySelfEntity,reservationId,parcelListEntity,myCurrentWarehouse,user); |
|
|
|
|
distributionLoadscanService.save(loadscanEntity); |
|
|
|
|
//更新包件装车状态
|
|
|
|
|
packageLockIds.add(parcelListEntity.getId()); |
|
|
|
|
parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue()); |
|
|
|
|
parcelListEntity.setOrderPackageGroundingStatus(OrderPackageGroundingStatusConstant.daishangjia.getValue()); |
|
|
|
|
parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yichuku.getValue()); |
|
|
|
|
distributionParcelListService.updateById(parcelListEntity); |
|
|
|
|
//更新装车时间
|
|
|
|
|
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId()); |
|
|
|
|
//更新签收表的装车数量
|
|
|
|
|
Integer j = distributionSignforMapper.updateloadByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub()); |
|
|
|
|
//进行解托操作
|
|
|
|
|
Map<String, Object> info = new HashMap<>(); |
|
|
|
|
info.put("orderPackageCode", parcelListEntity.getOrderPackageCode()); |
|
|
|
|
info.put("warehouseId", myCurrentWarehouse.getId()); |
|
|
|
|
if (StringUtils.isNotBlank(parcelListEntity.getOrderPackageCode())) { |
|
|
|
|
warehouseUpdownTypeClient.downPackageOrDelTray(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId(), "扫描装车进行下架、解托"); |
|
|
|
|
} |
|
|
|
|
if (OrderPackageLoadingStatusConstant.yizhuangche.getValue().equals(parcelListEntity.getOrderPackageLoadingStatus())) { |
|
|
|
|
return Resp.scanFail("此包件已装车", "此包件已装车"); |
|
|
|
|
} |
|
|
|
|
//再次校验是否装车
|
|
|
|
|
List<DistributionLoadscanEntity> loadscanEntityList = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda() |
|
|
|
|
.eq(DistributionLoadscanEntity::getOrderPackageCode, orderPackageCode) |
|
|
|
|
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()) |
|
|
|
|
); |
|
|
|
|
if (!loadscanEntityList.isEmpty()) { |
|
|
|
|
return Resp.scanFail("此包件已装车", "此包件已装车"); |
|
|
|
|
} |
|
|
|
|
//查询是否满足计划 以及计划在哪个客户中
|
|
|
|
|
Long reservationId = baseMapper.selectPackageByorderPackageCodeAndDeliveryId(orderPackageCode, deliveryId, warehouseId); |
|
|
|
|
DistributionReservationEntity reservationEntity = distributionReservationService.getById(reservationId); |
|
|
|
|
if (Objects.isNull(reservationEntity)) { |
|
|
|
|
log.error(method + "预约任务错误reservationId:{}",reservationId); |
|
|
|
|
return R.fail(403, "预约任务错误!!!"); |
|
|
|
|
} |
|
|
|
|
if (Objects.isNull(reservationId)) { |
|
|
|
|
//判定是否满足异常装车
|
|
|
|
|
Boolean isAbnormalLoadingFlag = judgeIsAbnormalLoading(deliveryId, parcelListEntity,reservationId); |
|
|
|
|
if (isAbnormalLoadingFlag) { |
|
|
|
|
return R.fail(5000, "异常装车"); |
|
|
|
|
log.info("异常装车判定成功>>>>>>packageCode:{},reservationId:{}", distrilbutionloadingscanDTO.getBarcode(), distrilbutionloadingscanDTO.getReservationId()); |
|
|
|
|
} |
|
|
|
|
String content = "包件在" + myCurrentWarehouse.getName() + "由" + loadscanEntity.getScanUser() + "扫描装车,配送车次号:" + deliveryListEntity.getTrainNumber() + "预约任务号:" + reservationEntity.getReservationCode(); |
|
|
|
|
JSONObject packageLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_LOADING.getCode()); |
|
|
|
|
packageLogs.add(packageLog); |
|
|
|
|
JSONObject jsonObject = new JSONObject(); |
|
|
|
|
jsonObject.put("code", orderPackageCode); |
|
|
|
|
jsonObject.put("warehouseId", myCurrentWarehouse.getId()); |
|
|
|
|
jsonObject.put("taskId", reservationId); |
|
|
|
|
jsonObject.put("type", 1); |
|
|
|
|
jsonObject.put("num", 1); |
|
|
|
|
jsonObject.put("remark", "装车下架"); |
|
|
|
|
jsonObjects.add(jsonObject); |
|
|
|
|
pushList.add(parcelListEntity); |
|
|
|
|
return Resp.scanFail("蹿货", "蹿货"); |
|
|
|
|
} |
|
|
|
|
//正常进行装车
|
|
|
|
|
DistributionLoadscanEntity loadscanEntity = createdDistributionLoadscanEntity(deliveryListEntity,distributionDeliverySelfEntity,reservationId,parcelListEntity,myCurrentWarehouse,user); |
|
|
|
|
distributionLoadscanService.save(loadscanEntity); |
|
|
|
|
//更新包件装车状态
|
|
|
|
|
packageLockIds.add(parcelListEntity.getId()); |
|
|
|
|
parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue()); |
|
|
|
|
parcelListEntity.setOrderPackageGroundingStatus(OrderPackageGroundingStatusConstant.daishangjia.getValue()); |
|
|
|
|
parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yichuku.getValue()); |
|
|
|
|
distributionParcelListService.updateById(parcelListEntity); |
|
|
|
|
//更新装车时间
|
|
|
|
|
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId()); |
|
|
|
|
//更新签收表的装车数量
|
|
|
|
|
Integer j = distributionSignforMapper.updateloadByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub()); |
|
|
|
|
//进行解托操作
|
|
|
|
|
Map<String, Object> info = new HashMap<>(); |
|
|
|
|
info.put("orderPackageCode", parcelListEntity.getOrderPackageCode()); |
|
|
|
|
info.put("warehouseId", myCurrentWarehouse.getId()); |
|
|
|
|
if (StringUtils.isNotBlank(parcelListEntity.getOrderPackageCode())) { |
|
|
|
|
warehouseUpdownTypeClient.downPackageOrDelTray(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId(), "扫描装车进行下架、解托"); |
|
|
|
|
} |
|
|
|
|
String content = "包件在" + myCurrentWarehouse.getName() + "由" + loadscanEntity.getScanUser() + "扫描装车,配送车次号:" + deliveryListEntity.getTrainNumber() + "预约任务号:" + reservationEntity.getReservationCode(); |
|
|
|
|
JSONObject packageLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_LOADING.getCode()); |
|
|
|
|
packageLogs.add(packageLog); |
|
|
|
|
JSONObject jsonObject = new JSONObject(); |
|
|
|
|
jsonObject.put("code", orderPackageCode); |
|
|
|
|
jsonObject.put("warehouseId", myCurrentWarehouse.getId()); |
|
|
|
|
jsonObject.put("taskId", reservationId); |
|
|
|
|
jsonObject.put("type", 1); |
|
|
|
|
jsonObject.put("num", 1); |
|
|
|
|
jsonObject.put("remark", "装车下架"); |
|
|
|
|
jsonObjects.add(jsonObject); |
|
|
|
|
pushList.add(parcelListEntity); |
|
|
|
|
break; |
|
|
|
|
case 2: |
|
|
|
|
if (Objects.isNull(distrilbutionloadingscanDTO.getReservationId())){ |
|
|
|
@ -8198,7 +8197,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
} |
|
|
|
|
String inventoryPackageCode = distrilbutionloadingscanDTO.getBarcode(); |
|
|
|
|
//查询库存品
|
|
|
|
|
Long reservationId = baseMapper.selectInventoryPackageByDeliveryIdAndInventoryPackageCode(deliveryId,inventoryPackageCode); |
|
|
|
|
reservationId = baseMapper.selectInventoryPackageByDeliveryIdAndInventoryPackageCode(deliveryId,inventoryPackageCode); |
|
|
|
|
if (Objects.nonNull(reservationId)){ |
|
|
|
|
parcelListEntity = distributionParcelListMapper.selectByOrderPackageCode(inventoryPackageCode, myCurrentWarehouse.getId()); |
|
|
|
|
if (!Objects.isNull(parcelListEntity)) { |
|
|
|
|