From ce364820dc4c2d9fb6138dfcfb47c0229e5a0e88 Mon Sep 17 00:00:00 2001 From: caoyizhong <1270296080> Date: Fri, 5 Jan 2024 16:41:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=B3=BB=E7=BB=9F=E5=A4=87?= =?UTF-8?q?=E8=B4=A7=E6=95=B0=E9=87=8F=E4=B8=8D=E5=A2=9E=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/DistributionStockupMapper.java | 6 +++ .../impl/DistributionStockServiceImpl.java | 49 +++++++++++++++++-- 2 files changed, 50 insertions(+), 5 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.java index 9eaae60c0..880ae65fb 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.java @@ -51,6 +51,12 @@ public interface DistributionStockupMapper extends BaseMapper selectDistributionStockupPage(IPage page, DistributionStockupVO distributionStockup); + /** + * 商 市 查询备货数据 + * @param page + * @param distributionStockupEntity + * @return + */ IPage pageList(IPage page,@Param("param") DistributionStockupEntity distributionStockupEntity); IPage selectStockupPage(IPage page, @Param("param") StockupDTO stockupDTO); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockServiceImpl.java index b69502332..1396749e1 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockServiceImpl.java @@ -42,10 +42,7 @@ import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; -import java.util.Optional; +import java.util.*; /** * 库存品详情信息 服务实现类 @@ -206,6 +203,7 @@ public class DistributionStockServiceImpl extends BaseServiceImpl ids = distributionStocks.getIds(); List list = new ArrayList<>(); + for (int ii = 0; ii < ids.size(); ii++) { String i = ids.get(ii); DistributionStockEntity stockEntity = new DistributionStockEntity(); @@ -258,6 +256,38 @@ public class DistributionStockServiceImpl extends BaseServiceImplquery().lambda().eq()); + //添加备货数据 + if(ObjectUtils.isNotNull(distributionStocks.getStockupType()) && distributionStocks.getStockupType().equals("ZT")){ + //自提 + DistrilbutionBillLadingEntity billLadingEntity = distrilbutionBillLadingMapper.selectById(stockEntity.getBillLadingId()); + if(ObjectUtils.isNotNull(billLadingEntity)){ + DistrilbutionBillLadingEntity billLading = new DistrilbutionBillLadingEntity(); + billLading.setId(billLadingEntity.getId()); + billLading.setStockOrderQuantity(billLadingEntity.getStockOrderQuantity()+1); + distrilbutionBillLadingMapper.updateById(billLading); + } + }else{ + //商 市 + DistributionReservationEntity byId2 = distributionReservationService.getById(stockEntity.getReservationId()); + if(ObjectUtils.isNotNull(byId2)){ + DistributionReservationEntity reservationEntity = new DistributionReservationEntity(); + reservationEntity.setId(byId2.getId()); + int yu =byId2.getReservationNum() + byId2.getReservationStockListNum(); + int bei = byId2.getStockOrderQuantity()+1 + byId2.getReserveQuantity(); + if(bei >= yu){ + reservationEntity.setStockOrderQuantity(byId2.getStockOrderQuantity()+1); + reservationEntity.setStockStatus("3"); + reservationEntity.setEndTimeStocking(new Date()); + }else{ + reservationEntity.setStockOrderQuantity(byId2.getStockOrderQuantity()+1); + reservationEntity.setStockStatus("2"); + if(ObjectUtils.isNull(reservationEntity.getStartTimeStocking())){ + reservationEntity.setStartTimeStocking(new Date()); + } + } + distributionReservationService.updateById(reservationEntity); + } + } } if(ObjectUtils.isNotNull(distributionStocks.getStockupType()) && distributionStocks.getStockupType().equals("ZT")){ //修改备货状态 自提 @@ -279,6 +309,7 @@ public class DistributionStockServiceImpl extends BaseServiceImplquery().lambda() + .eq(DistributionStockupInfoEntity::getStockupId, pageId) + ); DistributionStockVO distributionStockSelf = baseMapper.selectStockupInfoSelf(pageId); //查询库存品 DistributionDeliveryDetailsVO distributionSelf = distributionDeliveryDetailsService.selectCount(pageId); @@ -349,6 +382,12 @@ public class DistributionStockServiceImpl extends BaseServiceImpl= qb){ //修改备货任务 getUpdateStockup(pageId,2); + DistrilbutionBillLadingEntity billLadingEntity = distrilbutionBillLadingMapper.selectById(one.getReservationId()); + DistrilbutionBillLadingEntity billLading = new DistrilbutionBillLadingEntity(); + billLading.setId(billLadingEntity.getId()); + billLading.setStockStatus("3"); + billLading.setEndTimeStocking(new Date()); + distrilbutionBillLadingMapper.updateById(billLading); }else{ //没有完成 getUpdateStockup(pageId,1);