diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java index f8bc5a64c..3a5315530 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java @@ -260,5 +260,5 @@ public interface IDistributionParcelListClient { * @return */ @GetMapping(API_PREFIX + "/clearWaybillInfoByParceListIds") - boolean maintainInWarehouse(@RequestParam("orderPackageId") Long orderPackageId); + boolean maintainInWarehouse(@RequestParam("orderPackageId") Long orderPackageId,@RequestParam("taskCode") String taskCode); } diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DisStockListDetailVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DisStockListDetailVO.java index 77d7dfa36..dbe569671 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DisStockListDetailVO.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DisStockListDetailVO.java @@ -35,6 +35,8 @@ public class DisStockListDetailVO extends DisStockListDetailEntity { private String signingStatusName; + private String orderPackageCode; + private String signingUser; private String loadingUser; diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java index 231593cb0..d10de8671 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java @@ -562,7 +562,7 @@ public class DistributionParcelListClient implements IDistributionParcelListClie } @Override - public boolean maintainInWarehouse(Long orderPackageId) { - return distributionParcelListService.maintainInWarehouse(orderPackageId); + public boolean maintainInWarehouse(Long orderPackageId,String taskCode) { + return distributionParcelListService.maintainInWarehouse(orderPackageId,taskCode); } } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java index e62b029c6..d4f31e547 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java @@ -467,4 +467,12 @@ public interface DistributionSignforMapper extends BaseMapper selectNewAbnormalPackageList(@Param("reservationId")Long reservationId,@Param("deliveryId") Long deliveryId); + + /** + * 进行签收数量扣减 + * @param deliveryId + * @param reservationId + * @param nub + */ + void deductionSignforPacjageNum(@Param("deliveryId")Long deliveryId,@Param("reservationId") Long reservationId,@Param("nub") int nub); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml index e31ee874d..f154d5535 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml @@ -85,6 +85,11 @@ lds.is_deleted =0 and lds.reservation_id = #{reservationId} and loaded_number !=0 and lds.delivery_id = #{deliveryId} + + UPDATE logpm_distribution_signfor lds set lds.received_quantity = ( lds.received_quantity - #{nub} ) WHERE + lds.is_deleted =0 and lds.reservation_id = #{reservationId} and loaded_number !=0 and lds.delivery_id = + #{deliveryId} + UPDATE logpm_distribution_signfor lds set lds.loadedin_number = ( lds.loadedin_number - #{nub} ) WHERE lds.is_deleted =0 and lds.reservation_id = #{reservationId} and loadedin_number !=0 and lds.delivery_id = @@ -1979,7 +1984,9 @@ logpm_distribution_delivery_list lddl LEFT JOIN logpm_distribution_delivery_self ldds ON lddl.id = ldds.delivery_id WHERE - lddl.is_deleted = 0 AND lddl.warehouse_id = #{param.warehouseId} + lddl.is_deleted = 0 + AND lddl.warehouse_id = #{param.warehouseId} + AND lddl.type = #{param.type} and lddl.id in diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java index 43abf5567..25b23ab2a 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java @@ -281,5 +281,5 @@ public interface IDistributionParcelListService extends BaseService deliverySelfServices = distributionDeliverySelfService.list(Wrappers.query().lambda().eq(DistributionDeliverySelfEntity::getDeliveryId, distributionDeliveryListVO.getId()).eq(DistributionDeliverySelfEntity::getIsMaster, 2)); + List deliverySelfServices = distributionDeliverySelfService.list(Wrappers.query().lambda() + .eq(DistributionDeliverySelfEntity::getDeliveryId, distributionDeliveryListVO.getId()) +// .eq(DistributionDeliverySelfEntity::getIsMaster, 2) + ); if (!deliverySelfServices.isEmpty()) { StringBuffer sb1 = new StringBuffer(); @@ -1463,12 +1466,16 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl parcelListDTOS = distrilbutionloadingscanDTO.getParcelListDTOS(); @@ -8850,7 +8857,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl reservationZeroPackageEntityList = distributionReservationZeroPackageService.list(Wrappers.query().lambda(). eq(DistributionReservationZeroPackageEntity::getReservationId, reservationStockarticleEntity.getReservationId()). - eq(DistributionReservationZeroPackageEntity::getStockArticleId, distrilbutionloadingscanDTO.getOrderId()). + in(DistributionReservationZeroPackageEntity::getStockArticleId, reservationStockarticleEntityList.stream().map(DistributionReservationStockarticleEntity::getStockArticleId).collect(Collectors.toList())). ne(DistributionReservationZeroPackageEntity::getZeroPackageStatus, ReservationPackageStatusConstant.quxiao.getValue())); if (Func.isNotEmpty(reservationZeroPackageEntityList)) { //查询零担订单品类信息 @@ -8864,7 +8871,11 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl zeroPackageMap = parcelNumberEntityList.stream().collect(Collectors.toMap(DistributionParcelNumberEntity::getParcelListId, Function.identity(), (k1, k2) -> k2)); List operationZeroPackageIds = parcelListDTOS.stream().map(DistributionParcelNumberDTO::getParcelListId).collect(Collectors.toList()); //查询是否已经有装车数据了 - List zeroLoadscanEntityList = distributionLoadscanService.list(Wrappers.query().lambda().eq(DistributionLoadscanEntity::getReservationId, reservationStockarticleEntity.getReservationId()).eq(DistributionLoadscanEntity::getOrderId, reservationStockarticleEntity.getStockArticleId()).in(DistributionLoadscanEntity::getPackageId, operationZeroPackageIds).ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())); + List zeroLoadscanEntityList = distributionLoadscanService.list(Wrappers.query().lambda() + .eq(DistributionLoadscanEntity::getReservationId, distrilbutionloadingscanDTO.getReservationId()) + .in(DistributionLoadscanEntity::getOrderId, reservationStockarticleEntityList.stream().map(DistributionReservationStockarticleEntity::getStockArticleId).collect(Collectors.toList())) + .in(DistributionLoadscanEntity::getPackageId, operationZeroPackageIds) + .ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())); Map> loadMap = null; if (Func.isNotEmpty(zeroLoadscanEntityList)) { loadMap = zeroLoadscanEntityList.stream().collect(Collectors.groupingBy(DistributionLoadscanEntity::getPackageId)); @@ -8882,7 +8893,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl loadscanEntities = loadMap.get(parcelListDTO.getParcelListId()); + if (Func.isNotEmpty(loadscanEntities)) { + int sum = loadscanEntities.stream().mapToInt(DistributionLoadscanEntity::getLoadedNub).sum(); + distributionSignforMapper.deductionLoadingPacjageNum(distrilbutionloadingscanDTO.getReservationId(),distrilbutionloadingscanDTO.getDeliveryId(),sum); if (parcelListDTO.getLoadingNum() <= reservationZeroPackageEntity.getQuantity()) { //零担修改装车 DistributionLoadscanEntity zeroLoadscanEntity = loadscanEntities.get(0); @@ -9470,6 +9484,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImplquery().lambda().eq(DistributionSignforEntity::getDeliveryId, loadscanEntity.getDeliveryId()).eq(DistributionSignforEntity::getReservationId, loadscanEntity.getReservationId())); BigDecimal loadedNumber = new BigDecimal(signforEntity.getLoadedNumber()); - signforEntity.setLoadedNumber(loadedNumber.add(loadedNum).subtract(loadedNub).intValue()); - distributionSignforService.updateById(signforEntity); +// signforEntity.setLoadedNumber(loadedNumber.add(loadedNum).subtract(loadedNub).intValue()); +// distributionSignforService.updateById(signforEntity); loadscanEntity.setLoadedNub(parcelListDTO.getLoadingNum()); loadscanEntity.setPackageNub(parcelListDTO.getLoadingNum()); @@ -9912,8 +9927,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl logList = new ArrayList<>(); JSONObject logJS = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_FAIL.getCode()); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java index bc495eb6d..825357692 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java @@ -27,16 +27,7 @@ import com.logpm.basicdata.entity.BasicdataClientUserEntity; import com.logpm.basicdata.entity.BasicdataWarehouseEntity; import com.logpm.basicdata.feign.IBasicdataClientClient; import com.logpm.basicdata.feign.IBasicdataWarehouseClient; -import com.logpm.distribution.dto.DistributionCancelReservationPackageDTO; -import com.logpm.distribution.dto.DistributionDeliveryAllocationDTO; -import com.logpm.distribution.dto.DistributionDeliverySelfDTO; -import com.logpm.distribution.dto.DistributionDeliveryTripartiteDTO; -import com.logpm.distribution.dto.DistributionParcelListDTO; -import com.logpm.distribution.dto.DistributionReservationDTO; -import com.logpm.distribution.dto.DistributionReservationPackageDTO; -import com.logpm.distribution.dto.DistributionStockArticleDTO; -import com.logpm.distribution.dto.DistributionStockListDTO; -import com.logpm.distribution.dto.DistributionStockupDTO; +import com.logpm.distribution.dto.*; import com.logpm.distribution.entity.*; import com.logpm.distribution.excel.DistributionReservationExcel; import com.logpm.distribution.mapper.DisStockListDetailMapper; @@ -86,6 +77,7 @@ import org.springblade.common.constant.RabbitConstant; import org.springblade.common.constant.WorkNodeEnums; import org.springblade.common.constant.common.IsOrNoConstant; import org.springblade.common.constant.delivery.DeliveryLoadingStatusConstant; +import org.springblade.common.constant.delivery.DeliveryStartStatusConstant; import org.springblade.common.constant.delivery.DeliveryStatusConstant; import org.springblade.common.constant.loading.LoadingStatusConstant; import org.springblade.common.constant.order.OrderReservationStatusConstant; @@ -1467,6 +1459,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl distributionParcelListEntities = distributionReservationMapper.selectPackageListByReservationId(reservationId); if (Func.isNotEmpty(distributionParcelListEntities)) { - int sum = distributionParcelListEntities.stream().mapToInt(DistributionParcelListEntity::getQuantity).sum(); - reservationEntity.setReservationNum(sum); - } else { - reservationEntity.setReservationNum(0); + sum += distributionParcelListEntities.stream().mapToInt(DistributionParcelListEntity::getQuantity).sum(); + } + List distributionParcelNumberDTOS = distributionReservationMapper.selectZeroPackageListByReservationId(reservationId); + if (Func.isNotEmpty(distributionParcelNumberDTOS)) { + sum += distributionParcelNumberDTOS.stream().mapToInt(DistributionParcelNumberDTO::getReservationNum).sum(); } + reservationEntity.setReservationNum(sum); + int iSum = 0; List reservationStocklistEntities = distributionReservationMapper.selectStockListByReservationId(reservationId); if (Func.isNotEmpty(reservationStocklistEntities)) { - int sum = reservationStocklistEntities.stream().mapToInt(DistributionReservationStocklistEntity::getReservationNum).sum(); - reservationEntity.setReservationStockListNum(sum); + iSum = reservationStocklistEntities.stream().mapToInt(DistributionReservationStocklistEntity::getReservationNum).sum(); + reservationEntity.setReservationStockListNum(iSum); } else { reservationEntity.setReservationStockListNum(0); } @@ -3988,7 +3986,6 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl distributionParcelListEntities = distributionReservationMapper.selectPackageByReservationAndStockArticle(reservationId, orderId, warehouseId); - if (Func.isNotEmpty(distributionParcelListEntities)) { - int sum = distributionParcelListEntities.stream().mapToInt(DistributionParcelListEntity::getQuantity).sum(); - reservationStockarticleEntity.setReservationNum(sum); - } else { - reservationStockarticleEntity.setReservationNum(0); - reservationStockarticleEntity.setStockArticleStatus(ReservationOrderStatusConstant.quxiao.getValue()); - reservationStockarticleEntity.setCancelStatus(1); - } + if (reservationStockarticleEntity.getIsZero().equals(IsOrNoConstant.no.getValue())){ + List distributionParcelListEntities = distributionReservationMapper.selectPackageByReservationAndStockArticle(reservationId, orderId, warehouseId); + if (Func.isNotEmpty(distributionParcelListEntities)) { + int sum = distributionParcelListEntities.stream().mapToInt(DistributionParcelListEntity::getQuantity).sum(); + reservationStockarticleEntity.setReservationNum(sum); + } else { + reservationStockarticleEntity.setReservationNum(0); + reservationStockarticleEntity.setStockArticleStatus(ReservationOrderStatusConstant.quxiao.getValue()); + reservationStockarticleEntity.setCancelStatus(1); + } + }else { + List distributionParcelNumberVOS = distributionReservationMapper.selectReservationZeroOrderDetail(orderId,reservationId); + if (!distributionParcelNumberVOS.isEmpty()) { + int sum = distributionParcelNumberVOS.stream().mapToInt(DistributionParcelNumberVO::getReservationNum).sum(); + reservationStockarticleEntity.setReservationNum(sum); + }else { + reservationStockarticleEntity.setReservationNum(0); + reservationStockarticleEntity.setStockArticleStatus(ReservationOrderStatusConstant.quxiao.getValue()); + reservationStockarticleEntity.setCancelStatus(1); + } + } this.updateById(reservationStockarticleEntity); - } } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationZeroPackageServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationZeroPackageServiceImpl.java index 56c72e4ad..51b12e702 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationZeroPackageServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationZeroPackageServiceImpl.java @@ -29,6 +29,7 @@ import com.logpm.distribution.mapper.DistributionReservationZeroPackageMapper; import com.logpm.distribution.service.*; import com.logpm.distribution.vo.DistributionReservationZeroPackageVO; import io.jsonwebtoken.lang.Objects; +import lombok.extern.slf4j.Slf4j; import org.springblade.common.constant.orderpackage.OrderPackageReservationStatusConstant; import org.springblade.common.constant.reservation.ReservationPackageStatusConstant; import org.springblade.core.mp.base.BaseServiceImpl; @@ -47,6 +48,7 @@ import java.util.List; * @since 2023-10-08 */ @Service +@Slf4j public class DistributionReservationZeroPackageServiceImpl extends BaseServiceImpl implements IDistributionReservationZeroPackageService { @@ -154,6 +156,7 @@ public class DistributionReservationZeroPackageServiceImpl extends BaseServiceIm ); if (!Func.isNull(one)){ if (one.getQuantity() == 0) { + log.info("当前查询数量>>>>>>>>>one.getQuantity():{}",one.getQuantity()); one.setZeroPackageStatus(ReservationPackageStatusConstant.quxiao.getValue()); this.updateById(one); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java index b1edbfa77..354df24e9 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java @@ -6500,7 +6500,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl list = iDistributionSignPrintService.list(Wrappers.query().lambda() .eq(DistributionSignPrintEntity::getReservationId, distributionSignfor.getReservationId()) - .eq(DistributionSignPrintEntity::getIsDeleted, "0") ); Map> collect = list.stream().collect(Collectors.groupingBy(DistributionSignPrintEntity::getType)); @@ -7913,7 +7912,11 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl entityList = loadingMap.get(parcelNumberDTO.getParcelListId()); + if (entityList.size() == 1) { + int sum = entityList.stream().mapToInt(DistributionLoadscanEntity::getReceivedQuantity).sum(); + //进行已签收数量扣减 + distributionSignforMapper.deductionSignforPacjageNum(deliveryId,reservationId,sum); DistributionLoadscanEntity distributionLoadscanEntity = entityList.get(0); if (parcelNumberDTO.getSigningNum() > distributionReservationZeroPackageEntity.getQuantity()) { //存在配置要求必须装车才能进行签收 @@ -7924,12 +7927,14 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl inventoryPackageList = baseMapper.selectAppDeliveryInventoryPackage(reservationId); if (!orderList.isEmpty()) { reservationAppDetailVO.setOrderList(orderList); @@ -8472,7 +8477,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl> prices = new HashMap<>(); + prices = this.prices(distributionSignfor); if (deliveryListEntity.getKind().equals("1")) { BladeUser user = AuthUtil.getUser(); Boolean driver = distributionDeliveryListService.judgeIsDriver(user); @@ -8765,12 +8782,10 @@ public class DistributionSignforServiceImpl extends BaseServiceImplquery().lambda() .eq(DistributionSignforEntity::getReservationId, distributionSignfor.getReservationId()) ); diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionRecordServiceImpl.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionRecordServiceImpl.java index 6e074475b..00d3d1c01 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionRecordServiceImpl.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionRecordServiceImpl.java @@ -464,9 +464,9 @@ public class WarehouseRetentionRecordServiceImpl extends BaseServiceImpl