diff --git a/blade-service/logpm-factory/pom.xml b/blade-service/logpm-factory/pom.xml
index 0f3e41fd1..dbe8dab39 100644
--- a/blade-service/logpm-factory/pom.xml
+++ b/blade-service/logpm-factory/pom.xml
@@ -113,6 +113,12 @@
3.2.0.RELEASE
compile
+
+ org.springblade
+ blade-system-api
+ 3.2.0.RELEASE
+ compile
+
diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java
index ad6da3c7f..20f3288d3 100644
--- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java
+++ b/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 lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
-
import org.springblade.common.constant.TenantNum;
import org.springblade.common.constant.order.*;
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.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
+import org.springblade.system.feign.IRegionFeign;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -118,6 +118,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
private final IOrderCountClient orderCountClient;
private final BladeRedis redis;
+ private final IRegionFeign regionFeign;
// @Override
// public FactoryTokenVO getToken(String corpId, String appKey, String appSecret) throws NoSuchAlgorithmException {
@@ -541,6 +542,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
distributionStockArticleEntity.setDeliveryQuantity(0); //配送件数
distributionStockArticleEntity.setTransferQuantity(0); //中转件数
distributionStockArticleEntity.setSigninQuantity(0); //签收件数
+ distributionStockArticleEntity.setIsZero("0");
distributionStockArticleEntity.setFreezeStatus(OrderFreezeStatusConstant.weidongjie.getValue()); //冻结状态
distributionStockArticleEntity.setReservationStatus(OrderReservationStatusConstant.daiyuyue.getValue()); //预约状态
distributionStockArticleEntity.setStockupStatus(OrderStockupStatusConstant.daibeihuo.getValue()); //备货状态
@@ -845,10 +847,14 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
warehouseWaybill.setConsigneeName(wayBillEntity.getTakePerson());
warehouseWaybill.setConsigneeMobile(wayBillEntity.getTakeMobile());
warehouseWaybill.setConsigneeAddress(wayBillEntity.getTakeAddress());
+ String arriveSite = wayBillEntity.getArriveSite();
+ String code = regionFeign.getCode(arriveSite);
+ warehouseWaybill.setDestinationCode(code);
warehouseWaybill.setDestination(wayBillEntity.getArriveSite());
warehouseWaybill.setGoodsName(packname);
warehouseWaybill.setTotalCount(number);
warehouseWaybill.setStockCount(1);
+ warehouseWaybill.setWaybillType(1);
warehouseWaybill.setTotalWeight(wayBillEntity.getWeight());
warehouseWaybill.setTotalVolume(wayBillEntity.getVolume());
warehouseWaybill.setDeliveryMethod(wayBillEntity.getSendType());
diff --git a/blade-service/logpm-patch/pom.xml b/blade-service/logpm-patch/pom.xml
index 6b0ef520b..435c98467 100644
--- a/blade-service/logpm-patch/pom.xml
+++ b/blade-service/logpm-patch/pom.xml
@@ -80,6 +80,12 @@
org.springframework.boot
spring-boot-starter-amqp
+
+ org.springblade
+ blade-system-api
+ 3.2.0.RELEASE
+ compile
+
diff --git a/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncOrderInfoServiceImpl.java b/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncOrderInfoServiceImpl.java
index e3546f19e..2c5d5c0d0 100644
--- a/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncOrderInfoServiceImpl.java
+++ b/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.tool.utils.ObjectUtil;
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.core.RabbitTemplate;
import org.springframework.stereotype.Service;
@@ -95,6 +96,8 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
private final RabbitTemplate rabbitTemplate;
+ private final IRegionFeign regionFeign;
+
@Transactional(rollbackFor = Exception.class)
@Override
@@ -811,6 +814,12 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
log.warn("##############waybillDataHandler: 老系统中未找到对应运单waybillNo={}", orderCode);
throw new CustomerException("老系统中未找到对应运单");
}
+// Integer desOldWarehouseId = wayBillEntity.getWarehouseId();
+// if(!oldWarehouseId.equals(desOldWarehouseId)){
+// log.warn("##############waybillDataHandler: 该运单还未到达目的仓 oldWarehouseId={}", oldWarehouseId);
+// throw new CustomerException("该运单还未到达目的仓");
+// }
+
String waybillNo = wayBillEntity.getWaybillNo();
@@ -820,11 +829,11 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
warehouseWaybill = saveZeroWayBillData(wayBillEntity);
}
//创建在库订单
- createZeroStockArticle(warehouseWaybill,num);
+ createZeroStockArticle(warehouseWaybill,num,newWarehouseId);
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();
@@ -954,6 +963,11 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
entity.setOrderPackageLoadingStatus("10");
entity.setWaybillNumber(distributionStockArticleEntity.getWaybillNumber());
entity.setWarehouseEntryTimeEnd(date);
+ if(destinationWarehouseId.equals(newWarehouseId)){
+ entity.setIsTransfer(0);
+ }else{
+ entity.setIsTransfer(1);
+ }
entity.setSendWarehouseId(warehouseWaybill.getDepartureWarehouseId());
entity.setSendWarehouseName(warehouseWaybill.getDepartureWarehouseName());
entity.setAcceptWarehouseId(warehouseWaybill.getDestinationWarehouseId());
@@ -1048,6 +1062,9 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
warehouseWaybill.setConsigneeName(wayBillEntity.getTakePerson());
warehouseWaybill.setConsigneeMobile(wayBillEntity.getTakeMobile());
warehouseWaybill.setConsigneeAddress(wayBillEntity.getTakeAddress());
+ String arriveSite = wayBillEntity.getArriveSite();
+ String code = regionFeign.getCode(arriveSite);
+ warehouseWaybill.setDestinationCode(code);
warehouseWaybill.setDestination(wayBillEntity.getArriveSite());
warehouseWaybill.setGoodsName(packname);
warehouseWaybill.setTotalCount(number);
@@ -1078,6 +1095,7 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
warehouseWaybill.setClaimingValue(wayBillEntity.getValue());
warehouseWaybill.setPayType(wayBillEntity.getPayType()+"");
warehouseWaybill.setPayWay(wayBillEntity.getPaymentMethod()+"");
+ warehouseWaybill.setWaybillType(2);
warehouseWaybill.setXPay(wayBillEntity.getXPay());
warehouseWaybill.setDPay(wayBillEntity.getDPay());
warehouseWaybill.setHPay(wayBillEntity.getHPay());