Browse Source

Merge remote-tracking branch 'origin/dist.1.2.0' into dist.1.2.0

dist.1.3.0
汤建军 5 months ago
parent
commit
152a1d9fd7
  1. 5
      blade-biz-common/src/main/java/org/springblade/common/model/StockUpVO.java
  2. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionPlanLogMapper.java
  3. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionPlanLogMapper.xml
  4. 27
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/log/ReservationLogListener.java
  5. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/PlanReportListener.java
  6. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/StockReportListener.java
  7. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionPlanLogService.java
  8. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  9. 20
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionNodeWorkServiceImpl.java
  10. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionPlanLogServiceImpl.java
  11. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  12. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  13. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java

5
blade-biz-common/src/main/java/org/springblade/common/model/StockUpVO.java

@ -25,4 +25,9 @@ public class StockUpVO implements Serializable {
*/
private Date stockupDate;
/**
* 备货区
*/
private String stockupArea;
}

3
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionPlanLogMapper.java

@ -41,6 +41,5 @@ import java.util.Map;
public interface DistributionPlanLogMapper extends BaseMapper<DistributionPlanLogEntity> {
DistributionPlanLogEntity findLastLogByRefCode(@Param("reservationCode") String reservationCode);
}

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionPlanLogMapper.xml

@ -26,5 +26,10 @@
<result column="operator" property="operator"/>
<result column="type" property="type"/>
</resultMap>
<select id="findLastLogByRefCode" resultType="com.logpm.distribution.entity.DistributionPlanLogEntity">
select * from logpm_distribution_plan_log where ref_code = #{refCode} order by create_time desc limit 1
</select>
</mapper>

27
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/log/ReservationLogListener.java

@ -2,6 +2,8 @@ package com.logpm.distribution.receiver.log;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.logpm.distribution.entity.DistributionPlanLogEntity;
import com.logpm.distribution.service.IDistributionPlanLogService;
import lombok.AllArgsConstructor;
@ -10,7 +12,6 @@ import org.springblade.common.constant.DistributionTypeConstant;
import org.springblade.common.constant.broadcast.FanoutConstants;
import org.springblade.common.enums.BizOperationEnums;
import org.springblade.common.model.NodeFanoutMsg;
import org.springblade.common.model.PackageData;
import org.springblade.common.model.ReservationVO;
import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.Exchange;
@ -19,8 +20,6 @@ import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
import java.util.List;
@Slf4j
@Component
@AllArgsConstructor
@ -37,22 +36,23 @@ public class ReservationLogListener {
if (StrUtil.isEmpty(msg)) {
return;
}
NodeFanoutMsg<ReservationVO> bean = JSONUtil.toBean(msg, NodeFanoutMsg.class);
NodeFanoutMsg<ReservationVO> bean = JSONObject.parseObject(msg, new TypeReference<NodeFanoutMsg<ReservationVO>>(){});
if (bean == null) {
return;
}
BizOperationEnums bizOperation = bean.getBizOperation();
if(bizOperation.equals(BizOperationEnums.ADD)){
// addLog(bean);
addLog(bean);
}else if (bizOperation.equals(BizOperationEnums.MODIFY)){
log.warn("修改预约信息未记录日志");
updataLog(bean);
}
}
private void addLog(NodeFanoutMsg<ReservationVO> bean) {
log.info(" bean: {}",bean.getMain().toString());
ReservationVO main = bean.getMain();
if (main == null) {
return;
@ -77,5 +77,18 @@ public class ReservationLogListener {
distributionPlanLogService.save(distributionPlanLogEntity);
}
private void updataLog(NodeFanoutMsg<ReservationVO> bean) {
ReservationVO main = bean.getMain();
if (main == null) {
return;
}
log.info(" 这里对日志记录的处理存在问题 bean: {}",bean.getMain());
// todo 这里对日志记录的处理存在问题
}
}

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/PlanReportListener.java

@ -87,6 +87,7 @@ public class PlanReportListener {
QualityDeliverEntity qualityDeliverEntity = QualityDeliverEntity.builder()
.warehouseName(bean.getWarehouse())
.warehouseId(warehouseId)
.orderPackageCode(detail.getPackageCode())
.planTrainNumber(vo.getTrainNumber())
.deliveryTime(DateUtil.parseDate(vo.getTaskTime()))
.deliveryType(vo.getType())

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/StockReportListener.java

@ -83,6 +83,7 @@ public class StockReportListener {
QualityDeliverEntity qualityDeliverEntity = QualityDeliverEntity.builder()
.warehouseName(bean.getWarehouse())
.warehouseId(warehouseId)
.orderPackageCode(detail.getPackageCode())
.stockupCode(vo.getStockupCode())
.stockupUserName(bean.getOperator())
.stockupFinishTime(vo.getStockupDate())

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionPlanLogService.java

@ -28,4 +28,5 @@ import org.springblade.core.mp.base.BaseService;
public interface IDistributionPlanLogService extends BaseService<DistributionPlanLogEntity> {
DistributionPlanLogEntity findLastLogByRefCode(String reservationCode);
}

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

@ -1181,6 +1181,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
PackageData packageData = new PackageData();
packageData.setPackageCode(distributionParcelListEntity.getOrderPackageCode());
packageData.setPackageType(PackageTypeEnums.CMP);
packageData.setNumber(1);
data.add(packageData);
}
@ -3635,6 +3636,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
packageData.setPackageCode((String) map.get("packageCode"));
PackageTypeEnums type = PackageTypeEnums.CMP;
packageData.setPackageType(type);
packageData.setNumber(1);
packageDataList.add(packageData);
}

20
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionNodeWorkServiceImpl.java

@ -1,42 +1,28 @@
package com.logpm.distribution.service.impl;
import cn.hutool.core.convert.Convert;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.logpm.distribution.entity.*;
import com.logpm.distribution.service.IDistributionDeliveryListService;
import com.logpm.distribution.service.IDistributionDeliverySelfService;
import com.logpm.distribution.service.IDistributionDeliveryTripartiteService;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.service.IDistributionNodeWorkService;
import com.logpm.distribution.vo.DistributionStockupVO;
import com.logpm.factorydata.enums.BrandEnums;
import com.logpm.factorydata.util.FactoryDataMessageSender;
import com.logpm.factorydata.vo.NodePushMsg;
import com.logpm.factorydata.vo.PushData;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.checkerframework.checker.units.qual.A;
import org.jetbrains.annotations.NotNull;
import org.springblade.common.constant.WorkNodeEnums;
import org.springblade.common.constant.broadcast.FanoutConstants;
import org.springblade.common.enums.BizOperationEnums;
import org.springblade.common.enums.PackageTypeEnums;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.model.*;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.utils.BeanUtil;
import org.springframework.amqp.AmqpException;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.retry.annotation.Backoff;
import org.springframework.retry.annotation.Retryable;
import org.springframework.stereotype.Service;
import java.util.*;
import java.util.Collections;
import java.util.Date;
@Service
@Slf4j

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionPlanLogServiceImpl.java

@ -34,5 +34,8 @@ import org.springframework.stereotype.Service;
public class DistributionPlanLogServiceImpl extends BaseServiceImpl<DistributionPlanLogMapper, DistributionPlanLogEntity> implements IDistributionPlanLogService {
@Override
public DistributionPlanLogEntity findLastLogByRefCode(String reservationCode) {
return baseMapper.findLastLogByRefCode(reservationCode);
}
}

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java

@ -3535,6 +3535,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
PackageData packageData = new PackageData();
packageData.setPackageCode(distributionReservationPackageEntity.getPacketBarCode());
packageData.setPackageType(PackageTypeEnums.CMP);
packageData.setNumber(1);
packageDataList.add(packageData);
}
}

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

@ -749,6 +749,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
if (distributionLoadscanEntity.getIsZero() == null) {
packageData.setPackageCode(distributionLoadscanEntity.getOrderPackageCode());
packageData.setPackageType(PackageTypeEnums.CMP);
packageData.setNumber(1);
} else {
// 零担
packageData.setPackageType(PackageTypeEnums.LTL);
@ -3006,6 +3007,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
PackageData packageData = new PackageData();
packageData.setPackageCode(distributionParcelListEntity.getOrderPackageCode());
packageData.setPackageType(PackageTypeEnums.CMP);
packageData.setNumber(1);
data.add(packageData);
}

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java

@ -4347,7 +4347,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
stockUpVO.setTypeService(distributionStockupEntity.getTypeService());
stockUpVO.setStockupDate(distributionStockupEntity.getStockupDate());
stockUpVO.setStockupCode(distributionStockupEntity.getStockupCode());
stockUpVO.setStockupArea(distributionStockupEntity.getStockupArea());
nodeFanoutMsg.setMain(stockUpVO);
nodeFanoutMsg.setTenantId(AuthUtil.getTenantId());

Loading…
Cancel
Save