Browse Source

回库广播

pre-production
汤建军 4 months ago
parent
commit
bbd6f26105
  1. 2
      blade-biz-common/src/main/java/org/springblade/common/constant/WorkNodeEnums.java
  2. 89
      blade-biz-common/src/main/java/org/springblade/common/model/RetentionVO.java
  3. 12
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionReservationClient.java
  4. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionNodeWorkService.java
  5. 11
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionNodeWorkServiceImpl.java
  6. 43
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionScanServiceImpl.java

2
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, "配送失败"),

89
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<PackageData> packageDataList;
}

12
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<ReservationVO> nodeFanoutMsg,@RequestBody BladeUser user);
}

7
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionNodeWorkService.java

@ -25,6 +25,13 @@ public interface IDistributionNodeWorkService {
*/
void planReservation(NodeFanoutMsg<ReservationVO> nodeFanoutMsg, BladeUser user);
/**
* 预约
* @param nodeFanoutMsg
* @param user
*/
void planRetention(NodeFanoutMsg<ReservationVO> nodeFanoutMsg, BladeUser user);
/**
* 取消预约
* @param nodeFanoutMsg

11
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<ReservationVO> 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<DistributionTaskVO> nodeFanoutMsg, BladeUser user) {
try {

43
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<Warehouse
this.save(warehouseRetentionScan);
redis.setEx(AuthUtil.getTenantId() + ":warehouse:" + warehouseRetentionScan.getWarehouseId() + ":orderPackageCode:" + warehouseRetentionScan.getOrderPackageCode()+ ":retentionSave:",warehouseRetentionScan.getTaskCode(),60L*3L);
distributionSignforClient.updateIsHaveAbnormalPackage(warehouseRetentionScan.getReservationId());
NodeFanoutMsg<ReservationVO> nodeFanoutMsg = buildNodeFanoutMsgByRestention(warehouseRetentionScan.getReservationId(),distributionLoadscanAbnormalEntity.getWarehouseId());
reservationClient.planRetention(nodeFanoutMsg,AuthUtil.getUser());
return R.success("操作成功");
}
private NodeFanoutMsg<ReservationVO> buildNodeFanoutMsgByRestention(Long reservationId,Long warehouseId) {
NodeFanoutMsg<ReservationVO> 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<DistributionReservationEntity> 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<WarehouseRetentionScanVO> page, WarehouseRetentionScanDTO warehouseRetentionScan) {

Loading…
Cancel
Save