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);