diff --git a/blade-biz-common/src/main/java/org/springblade/common/constant/WorkNodeEnums.java b/blade-biz-common/src/main/java/org/springblade/common/constant/WorkNodeEnums.java index 893277c0b..270d49312 100644 --- a/blade-biz-common/src/main/java/org/springblade/common/constant/WorkNodeEnums.java +++ b/blade-biz-common/src/main/java/org/springblade/common/constant/WorkNodeEnums.java @@ -81,7 +81,7 @@ public enum WorkNodeEnums implements Serializable { DISTRIBUTION_CAR_START(302040, "配送发车"), DISTRIBUTION_CAR_ARRIVED(302050, "配送到达"), DISTRIBUTION_SIGN_FOR(302060, "配送签收"), - DISTRIBUTION_RETENTION(302070, "配送滞留"), + DISTRIBUTION_RETENTION(302070, "配送回库"), DISTRIBUTION_ABNORMAL_SIGN_FOR(302080, "异常签收"), DISTRIBUTION_FAIL(302090, "配送失败"), diff --git a/blade-biz-common/src/main/java/org/springblade/common/model/RetentionVO.java b/blade-biz-common/src/main/java/org/springblade/common/model/RetentionVO.java new file mode 100644 index 000000000..f5423abb0 --- /dev/null +++ b/blade-biz-common/src/main/java/org/springblade/common/model/RetentionVO.java @@ -0,0 +1,89 @@ +package org.springblade.common.model; + + +import lombok.Data; + +import java.util.Date; +import java.util.List; + +/** + * 预约作业节点VO + */ +@Data +public class RetentionVO { + + private Long id; + + /** + * 预约单号 + */ + private String reservationCode; + + + /** + * 预约时间 + */ + private Date reservationDate; + + /** + * 收货单位 + */ + private String receivingUnit; + + /** + * 收货人 + */ + private String consignee; + /** + * 收件地址 + */ + private String deliveryAddress; + + /** + * 收件电话 + */ + private String deliveryPhone; + + /** + * 商场名称 + */ + private String mallName; + + + /** + * 门店名称 + */ + private String storeName; + + /** + * 仓库名称 + */ + private String warehouseName; + + /** + * 预约库存品数量 + */ + private Integer reservationStockListNum; + + /** + * 预约定制品数量+预约零担数量 + */ + private Integer reservationNum; + + + /** + * 配送类型;1-商配、2-市配 + */ + private String deliveryType; + + /** + * 预约数据列表 + * 包含包件 零担 库存破 + */ + private List packageDataList; + + + + + +} 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 e76b29f1d..100fb93f0 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 @@ -20,10 +20,14 @@ import com.logpm.distribution.entity.DistributionReservationEntity; import com.logpm.distribution.vo.DistributionRetentionScanVo; import org.apache.ibatis.annotations.Param; import org.springblade.common.constant.ModuleNameConstant; +import org.springblade.common.model.NodeFanoutMsg; +import org.springblade.common.model.ReservationVO; import org.springblade.core.mp.support.BladePage; +import org.springblade.core.secure.BladeUser; import org.springblade.core.tool.api.R; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; @@ -102,4 +106,12 @@ public interface IDistributionReservationClient { */ @GetMapping(TOP+"/maintainReservationInfo") Boolean maintainReservationInfo(String params); + + /** + * 广播 + * @param nodeFanoutMsg + * @param user + */ + @PostMapping(TOP+"/maintainReservationInfo") + void planRetention(@RequestBody NodeFanoutMsg nodeFanoutMsg,@RequestBody BladeUser user); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionNodeWorkService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionNodeWorkService.java index aff4dae71..8014b515c 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionNodeWorkService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionNodeWorkService.java @@ -25,6 +25,13 @@ public interface IDistributionNodeWorkService { */ void planReservation(NodeFanoutMsg nodeFanoutMsg, BladeUser user); + /** + * 预约 + * @param nodeFanoutMsg + * @param user + */ + void planRetention(NodeFanoutMsg nodeFanoutMsg, BladeUser user); + /** * 取消预约 * @param nodeFanoutMsg diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionNodeWorkServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionNodeWorkServiceImpl.java index c4ae8c1dd..4f4474126 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionNodeWorkServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionNodeWorkServiceImpl.java @@ -63,6 +63,17 @@ public class DistributionNodeWorkServiceImpl implements IDistributionNodeWorkSer } + @Override + public void planRetention(NodeFanoutMsg nodeFanoutMsg, BladeUser user) { + try { + if (distributionProperties.getSendFanoutMsg()) { + rabbitTemplate.convertAndSend(FanoutConstants.distribution.DeliveryRetention.EXCHANGE, null, com.alibaba.fastjson.JSONObject.toJSONString(nodeFanoutMsg)); + } + } catch (AmqpException e) { + log.error(">>>>>>>>>>>>>>>>>>>>>>>>>> 消息推送失败~ 请联系管理员! ", e); + } + } + @Override public void planDelivery(NodeFanoutMsg nodeFanoutMsg, BladeUser user) { try { diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionScanServiceImpl.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionScanServiceImpl.java index b94e16455..2a7710a79 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionScanServiceImpl.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionScanServiceImpl.java @@ -20,6 +20,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.logpm.basicdata.entity.BasicdataWarehouseEntity; import com.logpm.basicdata.feign.IBasicdataWarehouseClient; import com.logpm.distribution.entity.DistributionLoadscanAbnormalEntity; +import com.logpm.distribution.entity.DistributionReservationEntity; import com.logpm.distribution.entity.DistributionRetentionScanEntity; import com.logpm.distribution.feign.IDistributionLoadscanAbnormalClient; import com.logpm.distribution.feign.IDistributionReservationClient; @@ -38,9 +39,13 @@ import com.logpm.warehouse.vo.WarehouseRetentionRecordVO; import com.logpm.warehouse.excel.WarehouseRetentionRecordExcel; import com.logpm.warehouse.vo.WarehouseRetentionScanVO; import lombok.AllArgsConstructor; +import org.springblade.common.constant.WorkNodeEnums; import org.springblade.common.constant.common.IsOrNoConstant; import org.springblade.common.constant.loading.LoadingAbnormalAuditingStatusConstant; import org.springblade.common.constant.loading.LoadingAbnormalTypeConstant; +import org.springblade.common.enums.BizOperationEnums; +import org.springblade.common.model.NodeFanoutMsg; +import org.springblade.common.model.ReservationVO; import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.redis.cache.BladeRedis; import org.springblade.core.secure.BladeUser; @@ -170,9 +175,47 @@ public class WarehouseRetentionScanServiceImpl extends BaseServiceImpl nodeFanoutMsg = buildNodeFanoutMsgByRestention(warehouseRetentionScan.getReservationId(),distributionLoadscanAbnormalEntity.getWarehouseId()); + reservationClient.planRetention(nodeFanoutMsg,AuthUtil.getUser()); return R.success("操作成功"); } + private NodeFanoutMsg buildNodeFanoutMsgByRestention(Long reservationId,Long warehouseId) { + NodeFanoutMsg nodeFanoutMsg = new NodeFanoutMsg<>(); + + nodeFanoutMsg.setNode(WorkNodeEnums.DISTRIBUTION_RETENTION); + nodeFanoutMsg.setBizOperation(BizOperationEnums.ADD); + nodeFanoutMsg.setOperator(AuthUtil.getNickName()); + nodeFanoutMsg.setOperatorTime(new Date()); + nodeFanoutMsg.setTenantId(AuthUtil.getTenantId()); + ReservationVO reservationVO = getReservationVO(reservationId); + nodeFanoutMsg.setWarehouse(reservationVO.getWarehouseName()); + nodeFanoutMsg.setWarehouseId(warehouseId); + nodeFanoutMsg.setMain(reservationVO); + return nodeFanoutMsg; + + } + + private ReservationVO getReservationVO(Long reservationId) { + List reservationList = reservationClient.getReservationList(reservationId + ""); + DistributionReservationEntity reservationEntity = reservationList.get(0); + ReservationVO reservationVO = new ReservationVO(); + reservationVO.setReservationCode(reservationEntity.getReservationCode()); + reservationVO.setReservationDate(reservationEntity.getReservationDate()); + reservationVO.setConsignee(reservationEntity.getConsignee()); + reservationVO.setDeliveryAddress(reservationEntity.getDeliveryAddress()); + reservationVO.setDeliveryPhone(reservationEntity.getDeliveryPhone()); + reservationVO.setMallName(reservationEntity.getMallName()); + reservationVO.setStoreName(reservationEntity.getStoreName()); + reservationVO.setWarehouseName(reservationEntity.getWarehouseName()); + reservationVO.setDeliveryType(reservationEntity.getDeliveryType()); + reservationVO.setReservationNum(reservationEntity.getReservationNum()); + reservationVO.setReceivingUnit(reservationEntity.getReceivingUnit()); + reservationVO.setId(reservationEntity.getId()); + reservationVO.setReservationStockListNum(reservationEntity.getReservationStockListNum()); + return reservationVO; + } + @Override public R selectWarehouseRetentionRecordNewPage(IPage page, WarehouseRetentionScanDTO warehouseRetentionScan) {