Browse Source

1.补丁-新增零担拉取逻辑更新优化

pull/4/head
zhenghaoyu 11 months ago
parent
commit
169b5b9cf0
  1. 6
      blade-service/logpm-factory/pom.xml
  2. 8
      blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java
  3. 6
      blade-service/logpm-patch/pom.xml
  4. 22
      blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncOrderInfoServiceImpl.java

6
blade-service/logpm-factory/pom.xml

@ -113,6 +113,12 @@
<version>3.2.0.RELEASE</version> <version>3.2.0.RELEASE</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-system-api</artifactId>
<version>3.2.0.RELEASE</version>
<scope>compile</scope>
</dependency>
</dependencies> </dependencies>

8
blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java

@ -54,7 +54,6 @@ import com.logpm.warehouse.feign.IWarehouseWaybillClient;
import com.logpm.warehouse.feign.IWarehouseWaybillDetailClient; import com.logpm.warehouse.feign.IWarehouseWaybillDetailClient;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.TenantNum; import org.springblade.common.constant.TenantNum;
import org.springblade.common.constant.order.*; import org.springblade.common.constant.order.*;
import org.springblade.common.constant.orderpackage.*; import org.springblade.common.constant.orderpackage.*;
@ -64,6 +63,7 @@ import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.ObjectUtil; import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil; import org.springblade.core.tool.utils.StringUtil;
import org.springblade.system.feign.IRegionFeign;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -118,6 +118,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
private final IOrderCountClient orderCountClient; private final IOrderCountClient orderCountClient;
private final BladeRedis redis; private final BladeRedis redis;
private final IRegionFeign regionFeign;
// @Override // @Override
// public FactoryTokenVO getToken(String corpId, String appKey, String appSecret) throws NoSuchAlgorithmException { // public FactoryTokenVO getToken(String corpId, String appKey, String appSecret) throws NoSuchAlgorithmException {
@ -541,6 +542,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
distributionStockArticleEntity.setDeliveryQuantity(0); //配送件数 distributionStockArticleEntity.setDeliveryQuantity(0); //配送件数
distributionStockArticleEntity.setTransferQuantity(0); //中转件数 distributionStockArticleEntity.setTransferQuantity(0); //中转件数
distributionStockArticleEntity.setSigninQuantity(0); //签收件数 distributionStockArticleEntity.setSigninQuantity(0); //签收件数
distributionStockArticleEntity.setIsZero("0");
distributionStockArticleEntity.setFreezeStatus(OrderFreezeStatusConstant.weidongjie.getValue()); //冻结状态 distributionStockArticleEntity.setFreezeStatus(OrderFreezeStatusConstant.weidongjie.getValue()); //冻结状态
distributionStockArticleEntity.setReservationStatus(OrderReservationStatusConstant.daiyuyue.getValue()); //预约状态 distributionStockArticleEntity.setReservationStatus(OrderReservationStatusConstant.daiyuyue.getValue()); //预约状态
distributionStockArticleEntity.setStockupStatus(OrderStockupStatusConstant.daibeihuo.getValue()); //备货状态 distributionStockArticleEntity.setStockupStatus(OrderStockupStatusConstant.daibeihuo.getValue()); //备货状态
@ -845,10 +847,14 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
warehouseWaybill.setConsigneeName(wayBillEntity.getTakePerson()); warehouseWaybill.setConsigneeName(wayBillEntity.getTakePerson());
warehouseWaybill.setConsigneeMobile(wayBillEntity.getTakeMobile()); warehouseWaybill.setConsigneeMobile(wayBillEntity.getTakeMobile());
warehouseWaybill.setConsigneeAddress(wayBillEntity.getTakeAddress()); warehouseWaybill.setConsigneeAddress(wayBillEntity.getTakeAddress());
String arriveSite = wayBillEntity.getArriveSite();
String code = regionFeign.getCode(arriveSite);
warehouseWaybill.setDestinationCode(code);
warehouseWaybill.setDestination(wayBillEntity.getArriveSite()); warehouseWaybill.setDestination(wayBillEntity.getArriveSite());
warehouseWaybill.setGoodsName(packname); warehouseWaybill.setGoodsName(packname);
warehouseWaybill.setTotalCount(number); warehouseWaybill.setTotalCount(number);
warehouseWaybill.setStockCount(1); warehouseWaybill.setStockCount(1);
warehouseWaybill.setWaybillType(1);
warehouseWaybill.setTotalWeight(wayBillEntity.getWeight()); warehouseWaybill.setTotalWeight(wayBillEntity.getWeight());
warehouseWaybill.setTotalVolume(wayBillEntity.getVolume()); warehouseWaybill.setTotalVolume(wayBillEntity.getVolume());
warehouseWaybill.setDeliveryMethod(wayBillEntity.getSendType()); warehouseWaybill.setDeliveryMethod(wayBillEntity.getSendType());

6
blade-service/logpm-patch/pom.xml

@ -80,6 +80,12 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId> <artifactId>spring-boot-starter-amqp</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-system-api</artifactId>
<version>3.2.0.RELEASE</version>
<scope>compile</scope>
</dependency>
</dependencies> </dependencies>
<build> <build>

22
blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncOrderInfoServiceImpl.java

@ -44,6 +44,7 @@ import org.springblade.common.utils.CommonUtil;
import org.springblade.core.redis.cache.BladeRedis; import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.tool.utils.ObjectUtil; import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil; import org.springblade.core.tool.utils.StringUtil;
import org.springblade.system.feign.IRegionFeign;
import org.springframework.amqp.rabbit.connection.CorrelationData; import org.springframework.amqp.rabbit.connection.CorrelationData;
import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -95,6 +96,8 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
private final RabbitTemplate rabbitTemplate; private final RabbitTemplate rabbitTemplate;
private final IRegionFeign regionFeign;
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
@ -811,6 +814,12 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
log.warn("##############waybillDataHandler: 老系统中未找到对应运单waybillNo={}", orderCode); log.warn("##############waybillDataHandler: 老系统中未找到对应运单waybillNo={}", orderCode);
throw new CustomerException("老系统中未找到对应运单"); throw new CustomerException("老系统中未找到对应运单");
} }
// Integer desOldWarehouseId = wayBillEntity.getWarehouseId();
// if(!oldWarehouseId.equals(desOldWarehouseId)){
// log.warn("##############waybillDataHandler: 该运单还未到达目的仓 oldWarehouseId={}", oldWarehouseId);
// throw new CustomerException("该运单还未到达目的仓");
// }
String waybillNo = wayBillEntity.getWaybillNo(); String waybillNo = wayBillEntity.getWaybillNo();
@ -820,11 +829,11 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
warehouseWaybill = saveZeroWayBillData(wayBillEntity); warehouseWaybill = saveZeroWayBillData(wayBillEntity);
} }
//创建在库订单 //创建在库订单
createZeroStockArticle(warehouseWaybill,num); createZeroStockArticle(warehouseWaybill,num,newWarehouseId);
log.info("###############waybillDataHandler: 处理数据结束 waybillNo={}", waybillNo); log.info("###############waybillDataHandler: 处理数据结束 waybillNo={}", waybillNo);
} }
private void createZeroStockArticle(WarehouseWaybillEntity warehouseWaybill,Integer num) { private void createZeroStockArticle(WarehouseWaybillEntity warehouseWaybill,Integer num,Long newWarehouseId) {
//判断新系统是否有这条订单数据 //判断新系统是否有这条订单数据
//自动生成的在库订单就用运单号作为订单号 //自动生成的在库订单就用运单号作为订单号
String waybillNo = warehouseWaybill.getWaybillNo(); String waybillNo = warehouseWaybill.getWaybillNo();
@ -954,6 +963,11 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
entity.setOrderPackageLoadingStatus("10"); entity.setOrderPackageLoadingStatus("10");
entity.setWaybillNumber(distributionStockArticleEntity.getWaybillNumber()); entity.setWaybillNumber(distributionStockArticleEntity.getWaybillNumber());
entity.setWarehouseEntryTimeEnd(date); entity.setWarehouseEntryTimeEnd(date);
if(destinationWarehouseId.equals(newWarehouseId)){
entity.setIsTransfer(0);
}else{
entity.setIsTransfer(1);
}
entity.setSendWarehouseId(warehouseWaybill.getDepartureWarehouseId()); entity.setSendWarehouseId(warehouseWaybill.getDepartureWarehouseId());
entity.setSendWarehouseName(warehouseWaybill.getDepartureWarehouseName()); entity.setSendWarehouseName(warehouseWaybill.getDepartureWarehouseName());
entity.setAcceptWarehouseId(warehouseWaybill.getDestinationWarehouseId()); entity.setAcceptWarehouseId(warehouseWaybill.getDestinationWarehouseId());
@ -1048,6 +1062,9 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
warehouseWaybill.setConsigneeName(wayBillEntity.getTakePerson()); warehouseWaybill.setConsigneeName(wayBillEntity.getTakePerson());
warehouseWaybill.setConsigneeMobile(wayBillEntity.getTakeMobile()); warehouseWaybill.setConsigneeMobile(wayBillEntity.getTakeMobile());
warehouseWaybill.setConsigneeAddress(wayBillEntity.getTakeAddress()); warehouseWaybill.setConsigneeAddress(wayBillEntity.getTakeAddress());
String arriveSite = wayBillEntity.getArriveSite();
String code = regionFeign.getCode(arriveSite);
warehouseWaybill.setDestinationCode(code);
warehouseWaybill.setDestination(wayBillEntity.getArriveSite()); warehouseWaybill.setDestination(wayBillEntity.getArriveSite());
warehouseWaybill.setGoodsName(packname); warehouseWaybill.setGoodsName(packname);
warehouseWaybill.setTotalCount(number); warehouseWaybill.setTotalCount(number);
@ -1078,6 +1095,7 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
warehouseWaybill.setClaimingValue(wayBillEntity.getValue()); warehouseWaybill.setClaimingValue(wayBillEntity.getValue());
warehouseWaybill.setPayType(wayBillEntity.getPayType()+""); warehouseWaybill.setPayType(wayBillEntity.getPayType()+"");
warehouseWaybill.setPayWay(wayBillEntity.getPaymentMethod()+""); warehouseWaybill.setPayWay(wayBillEntity.getPaymentMethod()+"");
warehouseWaybill.setWaybillType(2);
warehouseWaybill.setXPay(wayBillEntity.getXPay()); warehouseWaybill.setXPay(wayBillEntity.getXPay());
warehouseWaybill.setDPay(wayBillEntity.getDPay()); warehouseWaybill.setDPay(wayBillEntity.getDPay());
warehouseWaybill.setHPay(wayBillEntity.getHPay()); warehouseWaybill.setHPay(wayBillEntity.getHPay());

Loading…
Cancel
Save