|
|
|
@ -6078,17 +6078,16 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
log.error("##########配送计划异常:{}", deliveryListEntity); |
|
|
|
|
return Resp.scanFail("服务器正忙...", "服务器正忙"); |
|
|
|
|
} |
|
|
|
|
Integer loadingNumber = 0; |
|
|
|
|
Integer signingNumber = 0; |
|
|
|
|
|
|
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); |
|
|
|
|
// DistributionDeliverySelfEntity finalDistributionDeliverySelfEntity = distributionDeliverySelfEntity;
|
|
|
|
|
List<String> orderCodes = new ArrayList<>(); |
|
|
|
|
BladeUser user = AuthUtil.getUser(); |
|
|
|
|
DistributionSignforEntity signforEntity = distributionSignforMapper.selectOne(Wrappers.<DistributionSignforEntity>query().lambda() |
|
|
|
|
.eq(DistributionSignforEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId()) |
|
|
|
|
.eq(DistributionSignforEntity::getReservationId, distrilbutionloadingscanDTO.getReservationId())); |
|
|
|
|
//查询零担装车
|
|
|
|
|
|
|
|
|
|
Integer loadedNumber = signforEntity.getLoadedNumber(); |
|
|
|
|
Integer receivedQuantity = signforEntity.getReceivedQuantity(); |
|
|
|
|
if (!parcelNumberDTOS.isEmpty()) { |
|
|
|
|
List<Long> packageIds = parcelNumberDTOS.stream().map(DistributionParcelNumberDTO::getParcelListId).collect(Collectors.toList()); |
|
|
|
|
List<DistributionLoadscanEntity> loadscanEntityList = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda() |
|
|
|
@ -6099,9 +6098,12 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())); |
|
|
|
|
Map<Long, List<DistributionLoadscanEntity>> loadingMap = null; |
|
|
|
|
Map<Long, List<DistributionReservationZeroPackageEntity>> reservationMap = null; |
|
|
|
|
|
|
|
|
|
if (!loadscanEntityList.isEmpty()) { |
|
|
|
|
loadingNumber = signforEntity.getLoadedNumber() - loadscanEntityList.stream().mapToInt(DistributionLoadscanEntity::getLoadedNub).sum(); |
|
|
|
|
signingNumber = signforEntity.getReceivedQuantity() - loadscanEntityList.stream().mapToInt(DistributionLoadscanEntity::getReceivedQuantity).sum(); |
|
|
|
|
int sum1 = loadscanEntityList.stream().mapToInt(DistributionLoadscanEntity::getLoadedNub).sum(); |
|
|
|
|
int sum2 = loadscanEntityList.stream().mapToInt(DistributionLoadscanEntity::getReceivedQuantity).sum(); |
|
|
|
|
loadedNumber = loadedNumber - sum1; |
|
|
|
|
receivedQuantity = receivedQuantity - sum2; |
|
|
|
|
loadingMap = loadscanEntityList.stream().collect(Collectors.groupingBy(DistributionLoadscanEntity::getPackageId)); |
|
|
|
|
} |
|
|
|
|
//查询对应的计划品类
|
|
|
|
@ -6112,7 +6114,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
if (!reservationZeroPackageEntity.isEmpty()) { |
|
|
|
|
reservationMap = reservationZeroPackageEntity.stream().collect(Collectors.groupingBy(DistributionReservationZeroPackageEntity::getParcelListId)); |
|
|
|
|
} |
|
|
|
|
int sum = parcelNumberDTOS.stream().mapToInt(DistributionParcelNumberDTO::getSigningNum).sum(); |
|
|
|
|
List<JSONObject> jsonObjects = new ArrayList<>(); |
|
|
|
|
for (DistributionParcelNumberDTO parcelNumberDTO : parcelNumberDTOS) { |
|
|
|
|
List<DistributionReservationZeroPackageEntity> zeroPackageEntities = reservationMap.get(parcelNumberDTO.getParcelListId()); |
|
|
|
@ -6160,8 +6161,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
distributionLoadscanEntity.setSignforType(LoadScanSigningTypeStatusConstant.sijiqianshou.getValue()); |
|
|
|
|
distributionLoadscanEntity.setSigningTime(simpleDateFormat.format(new Date())); |
|
|
|
|
distributionLoadscanEntity.setSigningUser(user.getNickName()); |
|
|
|
|
loadingNumber += distributionLoadscanEntity.getLoadedNub() + signforEntity.getLoadedNumber(); |
|
|
|
|
signingNumber += distributionLoadscanEntity.getReceivedQuantity() + signforEntity.getReceivedQuantity(); |
|
|
|
|
loadedNumber += parcelNumberDTO.getSigningNum() ; |
|
|
|
|
receivedQuantity += parcelNumberDTO.getSigningNum() ; |
|
|
|
|
//进行签收数量的统计
|
|
|
|
|
distributionLoadscanService.updateById(distributionLoadscanEntity); |
|
|
|
|
JSONObject jsonObject = new JSONObject(); |
|
|
|
@ -6218,8 +6219,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
loadscanEntity.setOneQclick(2); |
|
|
|
|
loadscanEntity.setSigningTime(simpleDateFormat.format(new Date())); |
|
|
|
|
distributionLoadscanService.save(loadscanEntity); |
|
|
|
|
loadingNumber += loadscanEntity.getLoadedNub(); |
|
|
|
|
signingNumber += loadscanEntity.getReceivedQuantity(); |
|
|
|
|
loadedNumber += loadscanEntity.getLoadedNub(); |
|
|
|
|
receivedQuantity += loadscanEntity.getReceivedQuantity(); |
|
|
|
|
//维护零担品类信息
|
|
|
|
|
deliveryNumber = distributionParcelNumberEntity.getDeliveryQuantity() - parcelNumberDTO.getSigningNum(); |
|
|
|
|
handQuantity = distributionParcelNumberEntity.getHandQuantity() - parcelNumberDTO.getSigningNum(); |
|
|
|
@ -6242,7 +6243,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
if (handQuantity == 0) { |
|
|
|
|
parcelListEntity.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.yiyueyue.getValue()); |
|
|
|
|
} |
|
|
|
|
if (signingNumber.equals(distributionParcelNumberEntity.getQuantity())) { |
|
|
|
|
if (receivedQuantity.equals(distributionParcelNumberEntity.getQuantity())) { |
|
|
|
|
parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yiqianshou.getValue()); |
|
|
|
|
} |
|
|
|
|
distributionParcelListService.updateById(parcelListEntity); |
|
|
|
@ -6259,8 +6260,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
signforEntity.setLoadedNumber(loadingNumber); |
|
|
|
|
signforEntity.setReceivedQuantity(signingNumber); |
|
|
|
|
signforEntity.setLoadedNumber(loadedNumber); |
|
|
|
|
signforEntity.setReceivedQuantity(receivedQuantity); |
|
|
|
|
distributionSignforMapper.updateById(signforEntity); |
|
|
|
|
if (!packageLockIds.isEmpty()) { |
|
|
|
|
List<Long> a = bladeRedis.get("warehouseId:" + myCurrentWarehouse.getId() + "trainNumber:" + deliveryListEntity.getTrainNumber() + "orderPackageCode:"); |
|
|
|
|