|
|
|
@ -483,9 +483,11 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
.eq(DistributionLoadscanEntity::getReservationId, distrilbutionloadingscanDTO.getReservationId()) |
|
|
|
|
.eq(DistributionLoadscanEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcode()) |
|
|
|
|
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())); |
|
|
|
|
if (Func.isNotEmpty(loadscanEntity)){ |
|
|
|
|
if (loadscanEntity.getSignforState().equals(LoadScanSigningStatusConstant.yiqianshou.getValue())) { |
|
|
|
|
return Resp.scanFail("重复操作!!", "重复操作"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
switch (reservationEntity.getDeliveryType()) { |
|
|
|
|
case "1": |
|
|
|
|
//商配
|
|
|
|
@ -814,8 +816,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
distributionLoadscaninvnService.updateById(loadscaninvnEntity); |
|
|
|
|
//维护签收数量
|
|
|
|
|
Integer j = distributionSignforMapper.updateSignforNum(loadscaninvnEntity.getDeliveryId(), loadscaninvnEntity.getReservationId(), loadscaninvnEntity.getPackageNub()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
//库存品未进行装车
|
|
|
|
|
//这里装车的数据需要进行补录
|
|
|
|
@ -951,7 +951,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
if (Func.isNotEmpty(orderMap.get(stockArticleEntity.getId()))) { |
|
|
|
|
//统计装车数
|
|
|
|
|
int loadingNum = orderMap.get(stockArticleEntity.getId()).stream().mapToInt(DistributionLoadscanEntity::getLoadedNub).sum(); |
|
|
|
|
int signforNub = orderMap.get(stockArticleEntity.getId()).stream().filter(f -> Func.equals(f.getIsSignfor(), LoadScanSigningStatusConstant.yiqianshou.getValue())).mapToInt(DistributionLoadscanEntity::getReceivedQuantity).sum(); |
|
|
|
|
int signforNub = orderMap.get(stockArticleEntity.getId()).stream().filter(f -> Func.equals(f.getSignforState(), LoadScanSigningStatusConstant.yiqianshou.getValue())).mapToInt(DistributionLoadscanEntity::getReceivedQuantity).sum(); |
|
|
|
|
distributionAppStockArticleVO.setLoadingNub(loadingNum); |
|
|
|
|
distributionAppStockArticleVO.setSignforNub(signforNub); |
|
|
|
|
} |
|
|
|
@ -1075,17 +1075,39 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
//转换字典字段
|
|
|
|
|
for (DistributionAppDeliveryListVO distributionAppDeliveryListVO : distributionAppDeliveryListVOS) { |
|
|
|
|
//查询包件签收件数
|
|
|
|
|
int lad = distributionLoadscanMapper.selectList(new QueryWrapper<DistributionLoadscanEntity>().lambda() |
|
|
|
|
List<DistributionLoadscanEntity> loadscanEntities = distributionLoadscanMapper.selectList(new QueryWrapper<DistributionLoadscanEntity>().lambda() |
|
|
|
|
.eq(DistributionLoadscanEntity::getDeliveryId, distributionAppDeliveryListVO.getId()) |
|
|
|
|
.eq(DistributionLoadscanEntity::getSignforState, 2) |
|
|
|
|
).stream().mapToInt(DistributionLoadscanEntity::getReceivedQuantity).sum(); |
|
|
|
|
); |
|
|
|
|
AtomicInteger signNum = new AtomicInteger(); |
|
|
|
|
AtomicInteger loadNum = new AtomicInteger(); |
|
|
|
|
if (Func.isNotEmpty(loadscanEntities)){ |
|
|
|
|
//统计库存品配送数和签收数
|
|
|
|
|
loadNum.getAndAdd(loadscanEntities.stream().mapToInt(DistributionLoadscanEntity::getLoadedNub).sum()); |
|
|
|
|
signNum.getAndAdd(loadscanEntities.stream().mapToInt(DistributionLoadscanEntity::getReceivedQuantity).sum()); |
|
|
|
|
} |
|
|
|
|
// int lad = distributionLoadscanMapper.selectList(new QueryWrapper<DistributionLoadscanEntity>().lambda()
|
|
|
|
|
// .eq(DistributionLoadscanEntity::getDeliveryId, distributionAppDeliveryListVO.getId())
|
|
|
|
|
// .eq(DistributionLoadscanEntity::getSignforState, 2)
|
|
|
|
|
// ).stream().mapToInt(DistributionLoadscanEntity::getReceivedQuantity).sum();
|
|
|
|
|
|
|
|
|
|
//查询库存品签收件数
|
|
|
|
|
Integer nad = distributionLoadscaninvnMapper.selectList(new QueryWrapper<DistributionLoadscaninvnEntity>().lambda() |
|
|
|
|
List<DistributionLoadscaninvnEntity> distributionLoadscaninvnEntities = distributionLoadscaninvnMapper.selectList(new QueryWrapper<DistributionLoadscaninvnEntity>().lambda() |
|
|
|
|
.eq(DistributionLoadscaninvnEntity::getDeliveryId, distributionAppDeliveryListVO.getId()) |
|
|
|
|
.eq(DistributionLoadscaninvnEntity::getSignforState, 2) |
|
|
|
|
).stream().mapToInt(DistributionLoadscaninvnEntity::getReceivedQuantity).sum(); |
|
|
|
|
distributionAppDeliveryListVO.setSignNub(lad + nad); |
|
|
|
|
); |
|
|
|
|
if (Func.isNotEmpty(distributionLoadscaninvnEntities)){ |
|
|
|
|
//统计库存品配送数和签收数
|
|
|
|
|
loadNum.getAndAdd(distributionLoadscaninvnEntities.stream().mapToInt(DistributionLoadscaninvnEntity::getLoadedNub).sum()); |
|
|
|
|
signNum.getAndAdd(distributionLoadscaninvnEntities.stream().mapToInt(DistributionLoadscaninvnEntity::getReceivedQuantity).sum()); |
|
|
|
|
} |
|
|
|
|
// Integer nad = distributionLoadscaninvnMapper.selectList(new QueryWrapper<DistributionLoadscaninvnEntity>().lambda()
|
|
|
|
|
// .eq(DistributionLoadscaninvnEntity::getDeliveryId, distributionAppDeliveryListVO.getId())
|
|
|
|
|
// .eq(DistributionLoadscaninvnEntity::getSignforState, 2)
|
|
|
|
|
// ).stream().mapToInt(DistributionLoadscaninvnEntity::getReceivedQuantity).sum();
|
|
|
|
|
|
|
|
|
|
distributionAppDeliveryListVO.setSignNub(signNum.get()); |
|
|
|
|
distributionAppDeliveryListVO.setDeliveryNumber(loadNum.get()); |
|
|
|
|
//查询完成客户数
|
|
|
|
|
Integer cusCount = distributionDeliveryListMapper.selectCompletecusInCount(distributionAppDeliveryListVO.getId()); |
|
|
|
|
//查询完成订单数
|
|
|
|
@ -2279,26 +2301,25 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
//存在签收数据,这里对签收的数量进行修改,修改不得超过计划数
|
|
|
|
|
loadscanEntityList.setReceivedQuantity(signingNum.intValue()); |
|
|
|
|
parcelNumberEntity.setSigninQuantity(signinQuantity.subtract(receivedQuantity).add(signingNum).intValue()); |
|
|
|
|
|
|
|
|
|
DistributionSignforEntity signforEntity = distributionSignforMapper.selectOne(Wrappers.<DistributionSignforEntity>query().lambda().eq(DistributionSignforEntity::getDeliveryId, loadscanEntityList.getDeliveryId()).eq(DistributionSignforEntity::getReservationId, loadscanEntityList.getReservationId())); |
|
|
|
|
BigDecimal loadedNumber = new BigDecimal(signforEntity.getLoadedNumber()); |
|
|
|
|
BigDecimal signingNumber = new BigDecimal(signforEntity.getReceivedQuantity()); |
|
|
|
|
if (loadscanEntityList.getLoadedNub() < p.getSigningNum()){ |
|
|
|
|
//这里需要同时维护装车和签收数量
|
|
|
|
|
loadscanEntityList.setLoadedNub(p.getSigningNum()); |
|
|
|
|
loadscanEntityList.setPackageNub(p.getSigningNum()); |
|
|
|
|
loadscanEntityList.setLoadedNub(p.getSigningNum()); |
|
|
|
|
loadscanEntityList.setPackageNub(p.getSigningNum()); |
|
|
|
|
// loadscanEntityList.setLoadedNub(p.getSigningNum());
|
|
|
|
|
// loadscanEntityList.setPackageNub(p.getSigningNum());
|
|
|
|
|
// loadscanEntityList.setLoadedNub(p.getSigningNum());
|
|
|
|
|
// loadscanEntityList.setPackageNub(p.getSigningNum());
|
|
|
|
|
loadscanEntityList.setMsg("签收数量大于装车数"); |
|
|
|
|
parcelNumberEntity.setDeliveryQuantity(newDeliveryQuantity); |
|
|
|
|
parcelNumberEntity.setOutboundQuantity(newOunBoundQuantity); |
|
|
|
|
parcelNumberEntity.setHandQuantity(newHandQuantity); |
|
|
|
|
signforEntity.setLoadedNumber(loadedNumber.subtract(loadedNub).add(signingNum).intValue()); |
|
|
|
|
} |
|
|
|
|
if (p.getSigningNum() == 0) { |
|
|
|
|
//签收状态
|
|
|
|
|
loadscanEntityList.setSignforState(LoadScanSigningStatusConstant.weiqianshou.getValue()); |
|
|
|
|
} |
|
|
|
|
DistributionSignforEntity signforEntity = distributionSignforMapper.selectOne(Wrappers.<DistributionSignforEntity>query().lambda().eq(DistributionSignforEntity::getDeliveryId, loadscanEntityList.getDeliveryId()).eq(DistributionSignforEntity::getReservationId, loadscanEntityList.getReservationId())); |
|
|
|
|
BigDecimal loadedNumber = new BigDecimal(signforEntity.getLoadedNumber()); |
|
|
|
|
BigDecimal signingNumber = new BigDecimal(signforEntity.getReceivedQuantity()); |
|
|
|
|
signforEntity.setLoadedNumber(loadedNumber.subtract(loadedNub).add(signingNum).intValue()); |
|
|
|
|
signforEntity.setReceivedQuantity(signingNumber.subtract(receivedQuantity).add(signingNum).intValue()); |
|
|
|
|
distributionSignforMapper.updateById(signforEntity); |
|
|
|
|
distributionLoadscanService.updateById(loadscanEntityList); |
|
|
|
|