From 3e7e3152fd193dd732b9519c17e5c93036bb5559 Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Tue, 5 Nov 2024 18:45:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=85=8D=E9=80=81=E6=97=A5?= =?UTF-8?q?=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feign/IDistributionReservationClient.java | 1 + .../DistributionReservationController.java | 8 ++- .../IDistributionReservationService.java | 9 +++ .../DistributionDeliveryListServiceImpl.java | 28 +++++++++- .../DistributionReservationServiceImpl.java | 56 +++++++++++++++++-- .../impl/DistributionStockupServiceImpl.java | 3 +- 6 files changed, 95 insertions(+), 10 deletions(-) diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionReservationClient.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionReservationClient.java index 22a98fdf8..e76b29f1d 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionReservationClient.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionReservationClient.java @@ -100,5 +100,6 @@ public interface IDistributionReservationClient { * @param params * @return */ + @GetMapping(TOP+"/maintainReservationInfo") Boolean maintainReservationInfo(String params); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java index 03e0c3a1f..dd6942d88 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java @@ -202,8 +202,12 @@ public class DistributionReservationController extends BladeController { @ApiOperationSupport(order = 5) @ApiOperation(value = "修改", notes = "传入distrbutionReservation") public R update(@Valid @RequestBody DistributionReservationDTO distributionReservationDTO) { - R result = reservationService.updateReservation(distributionReservationDTO); - return result; + try{ + R result = reservationService.updateReservation(distributionReservationDTO); + return result; + }catch (Exception e){ + return R.fail(e.getMessage()); + } } /** diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java index 8ee49767a..dd063ccaa 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java @@ -18,6 +18,7 @@ package com.logpm.distribution.service; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.logpm.basicdata.entity.BasicdataWarehouseEntity; import com.logpm.distribution.dto.DistributionCancelReservationPackageDTO; import com.logpm.distribution.dto.DistributionDeliveryAllocationDTO; import com.logpm.distribution.dto.DistributionReservationDTO; @@ -30,6 +31,7 @@ import org.springblade.common.enums.BizOperationEnums; import org.springblade.common.model.NodeFanoutMsg; import org.springblade.common.model.ReservationVO; import org.springblade.core.mp.base.BaseService; +import org.springblade.core.secure.BladeUser; import org.springblade.core.tool.api.R; import java.util.List; @@ -145,6 +147,8 @@ public interface IDistributionReservationService extends BaseService reservationEntityList = distributionReservationMapper.getDeliveryReservation(deliveryListEntity.getId()); Map> oldClient = reservationEntityList.stream().collect(Collectors.groupingBy(DistributionReservationEntity::getReceivingUnit)); + String oldReservationCode = reservationEntityList.stream().map(DistributionReservationEntity::getReservationCode).collect(Collectors.joining(",")); //订单总数量 AtomicInteger orderTotal = new AtomicInteger(); //配送任务仓库名称 @@ -2885,6 +2886,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl allPackageList = new ArrayList<>(); List allZeroPackageList = new ArrayList<>(); + StringBuilder saa = new StringBuilder(); newClient.forEach((k, v) -> { HashSet orderNumber = new HashSet<>(); //运单号 @@ -2958,6 +2960,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl { @@ -3177,6 +3180,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImplquery().lambda() .eq(DistributionSignforEntity::getReservationId, reservationEntity.getId()) .eq(DistributionSignforEntity::getDeliveryId, deliveryListEntity.getId()) ); + saa.append(reservationEntity.getReservationCode()).append(","); //查询出该预约下的订单信息 List reservationStockarticleEntityList = distributionReservationStockarticleMapper.selectList(Wrappers.query().lambda().eq(DistributionReservationStockarticleEntity::getReservationId, reservationEntity.getId()).ne(DistributionReservationStockarticleEntity::getStockArticleStatus, ReservationOrderStatusConstant.quxiao.getValue())); Map> oldOrder = reservationStockarticleEntityList.stream().collect(Collectors.groupingBy(DistributionReservationStockarticleEntity::getStockArticleId)); @@ -3672,6 +3678,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl entities = distributionReservationStockarticleMapper.selectList(Wrappers.query().lambda().ne(DistributionReservationStockarticleEntity::getStockArticleStatus, "2").eq(DistributionReservationStockarticleEntity::getReservationId, reservationEntity.getId())); entities.forEach(e -> { @@ -3810,7 +3818,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl[" + newReservationCode + "]" + "当前总件数:" + (deliveryListEntity.getDeliveryNumber()); + DistributionPlanLogEntity distributionPlanLogEntity = new DistributionPlanLogEntity(); + distributionPlanLogEntity.setContent(distributionContent); + distributionPlanLogEntity.setRefId(deliveryListEntity.getId()); + distributionPlanLogEntity.setRefCode(deliveryListEntity.getTrainNumber()); + distributionPlanLogEntity.setWarehouseId(myCurrentWarehouse.getId()); + distributionPlanLogEntity.setWarehouseName(myCurrentWarehouse.getName()); + distributionPlanLogEntity.setOperator(user.getNickName()); + distributionPlanLogEntity.setType(3); + distributionPlanLogService.save(distributionPlanLogEntity); + } + + @Override public IPage getPackageListByDeliverylistId(IPage page, Map distributionDeliveryInfoDTO) throws ParseException { if (Func.isEmpty(distributionDeliveryInfoDTO.get("deliveryId"))) { 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 6c5cbec69..b91d20356 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 @@ -145,7 +145,6 @@ import java.util.Objects; import java.util.Set; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; -import java.util.function.Function; import java.util.stream.Collectors; /** @@ -1546,6 +1545,21 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl aaa = new ArrayList<>(); + StringBuffer saa = new StringBuffer(); mallClient.forEach((k, v) -> { clientTotal.getAndIncrement(); DistributionReservationDTO reservation = allocationDTO.getReservation(); @@ -2540,6 +2556,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl nodeFanoutMsg =buildNodeFanoutMsgByReservationByCancel(reservationEntity); - distributionNodeWorkService.cancelReservation(nodeFanoutMsg,AuthUtil.getUser()); @@ -3673,7 +3694,8 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl list = distributionStockService.list(Wrappers.query().lambda().eq(DistributionStockEntity::getStockupId, vo.getId())); + List list = distributionStockService.list(Wrappers.query().lambda() + .eq(DistributionStockEntity::getStockupId, vo.getId())); if (list.isEmpty()) { vo.setRealNum(0); } else {