From eb0c7bfcfde2aa0b4afdff80f6a134105d514fdd Mon Sep 17 00:00:00 2001
From: PigBaoBei <2739175034@qq.com>
Date: Wed, 6 Dec 2023 17:11:51 +0800
Subject: [PATCH 1/3] =?UTF-8?q?=E5=BA=93=E5=AD=98=E5=93=81=E5=A2=9E?=
=?UTF-8?q?=E5=8A=A0=E6=9F=A5=E7=9C=8B=E4=BA=8C=E7=BB=B4=E7=A0=81=E5=8A=9F?=
=?UTF-8?q?=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../DistributionReservationStocklistVO.java | 24 ++++++
.../vo/DistributionStockListVO.java | 6 ++
.../DistributionStockListController.java | 17 ++++
.../mapper/DistributionDeliveryListMapper.xml | 12 ++-
.../mapper/DistributionReservationMapper.xml | 3 +
.../mapper/DistributionStockListMapper.xml | 7 +-
.../IDistributionStockListService.java | 7 ++
.../DistributionDeliveryListServiceImpl.java | 49 +++++------
.../DistributionStockArticleServiceImpl.java | 2 +-
.../DistributionStockListServiceImpl.java | 82 ++++++++++++++++++-
10 files changed, 171 insertions(+), 38 deletions(-)
diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionReservationStocklistVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionReservationStocklistVO.java
index f0ba31fe4..9ab188020 100644
--- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionReservationStocklistVO.java
+++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionReservationStocklistVO.java
@@ -41,11 +41,29 @@ public class DistributionReservationStocklistVO extends DistributionReservationS
*/
@ApiModelProperty(value = "门店名称")
private String storeName;
+
+ /**
+ * 订单自编码
+ */
+ @ApiModelProperty(value = "订单自编码")
+ private String orderCode;
+
+ /**
+ * 批次号
+ */
+ @ApiModelProperty(value = "批次号")
+ private String incomingBatch;
/**
* 货物名称
*/
@ApiModelProperty(value = "货物名称")
private String descriptionGoods;
+
+ /**
+ * 服务号
+ */
+ @ApiModelProperty(value = "服务号")
+ private String serviceNumber;
/**
* 物料编号
*/
@@ -137,6 +155,12 @@ public class DistributionReservationStocklistVO extends DistributionReservationS
@ApiModelProperty(value = "签收时间")
private String signTime;
+ /**
+ * 库存品批次ID
+ */
+ @ApiModelProperty(value = "库存品批次ID")
+ private Long stockListId;
+
/**
* 签收时间
diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockListVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockListVO.java
index 3d97d9459..bcf16ff97 100644
--- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockListVO.java
+++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockListVO.java
@@ -133,4 +133,10 @@ public class DistributionStockListVO extends DistributionStockListEntity {
@ApiModelProperty(value = "shan")
private String mallName;
+ /**
+ * 预约Id
+ */
+ @ApiModelProperty(value = "预约Id")
+ private Long reservationId;
+
}
diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockListController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockListController.java
index 2a71277ed..019a40b72 100644
--- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockListController.java
+++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockListController.java
@@ -27,6 +27,7 @@ import com.logpm.distribution.service.IDistributionStockListService;
import com.logpm.distribution.vo.DistributionStockArticleVO;
import com.logpm.distribution.vo.DistributionStockListAllocationVO;
import com.logpm.distribution.vo.DistributionStockListVO;
+import com.logpm.distribution.vo.OrderPackgeCodeDataVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@@ -141,6 +142,22 @@ public class DistributionStockListController extends BladeController {
return R.data(pages);
}
+
+ @GetMapping("/showOrderPackgeCode")
+ @ApiOperationSupport(order = 2)
+ @ApiOperation(value = "返回模板和模板内容")
+ public R showOrderPackgeCode(@ApiIgnore @RequestParam Long reservationId,@RequestParam Long stockListId){
+
+ OrderPackgeCodeDataVO orderPackgeCodeDataVo= null;
+ try {
+ orderPackgeCodeDataVo = distributionStockListService.showOrderPackgeCode(reservationId,stockListId);
+ } catch (Exception e) {
+ return R.fail(e.getMessage());
+ }
+ return R.data(orderPackgeCodeDataVo);
+
+ }
+
/**
* 库存品管理 新增
*/
diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml
index eca214a7b..278e3217c 100644
--- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml
+++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml
@@ -1381,7 +1381,11 @@
+
diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceMapper.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceMapper.java
index aeee18ca6..f403eef3d 100644
--- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceMapper.java
+++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceMapper.java
@@ -53,4 +53,5 @@ public interface AdvanceMapper {
List getAdvanceList(@Param("orderSelfNum") String orderSelfNum);
+ List findListByAdvanceIds(@Param("advanceIds") List advanceIds);
}
diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceMapper.xml b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceMapper.xml
index 97bada10e..02e171e15 100644
--- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceMapper.xml
+++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceMapper.xml
@@ -68,4 +68,16 @@
and delete_time = 0
+
+
diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/DetailProductMapper.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/DetailProductMapper.java
index 2fcc6632d..56eed12b8 100644
--- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/DetailProductMapper.java
+++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/DetailProductMapper.java
@@ -51,4 +51,6 @@ public interface DetailProductMapper extends BaseMapper {
Boolean addAll(@Param("param") DetailProductEntity detailProduct);
Boolean addList(@Param("list") List detailProducts);
+
+ List findListByUnitNo(@Param("unitNo") String unitNo);
}
diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/DetailProductMapper.xml b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/DetailProductMapper.xml
index ce7058a54..21b762bc4 100644
--- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/DetailProductMapper.xml
+++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/DetailProductMapper.xml
@@ -31,4 +31,10 @@
+
+
diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/OrderMapper.xml b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/OrderMapper.xml
index 67fc679f2..72509ccde 100644
--- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/OrderMapper.xml
+++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/OrderMapper.xml
@@ -12,6 +12,7 @@
INNER JOIN `ht_order` `order` ON `order`.`selfnumber` = `i`.`orderSelfNum`
WHERE
`i`.`status` <> 11
+ and `i`.`history_type` = 0
AND `i`.`delete_time` = '0'
AND ( ( `i`.`in_num` + `i`.`delives_num` ) > 0 )
AND `i`.`goods_type` = '1'
@@ -33,6 +34,7 @@
INNER JOIN `ht_order` `order` ON `order`.`selfnumber` = `i`.`orderSelfNum`
WHERE
`i`.`status` <> 11
+ and `i`.`history_type` = 0
AND `i`.`delete_time` = '0'
AND ( ( `i`.`in_num` + `i`.`delives_num` ) > 0 )
AND `i`.`goods_type` = '1'
diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/WayBillMapper.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/WayBillMapper.java
index 9d4b7095c..201b11c07 100644
--- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/WayBillMapper.java
+++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/WayBillMapper.java
@@ -4,8 +4,12 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.oldproject.entity.WayBillEntity;
import org.apache.ibatis.annotations.Param;
+import java.util.List;
+
public interface WayBillMapper extends BaseMapper {
WayBillEntity getByWayBillByAdvanceId(@Param("advId") Integer advId);
+
+ List findAdvanceIdsByWaybillNo(@Param("waybillNo") String waybillNo);
}
diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/WayBillMapper.xml b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/WayBillMapper.xml
index cdec93bbb..99651a142 100644
--- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/WayBillMapper.xml
+++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/WayBillMapper.xml
@@ -8,5 +8,11 @@
select ht_way_bill.* FROM ht_way_bill LEFT JOIN ht_advance on ht_advance.waybill_no=ht_way_bill.waybill_no WHERE ht_advance.id = #{advId} and ht_way_bill.`status` !=-1
+
diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IAdvanceDetailService.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IAdvanceDetailService.java
index d690d7f86..3b7c30a70 100644
--- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IAdvanceDetailService.java
+++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IAdvanceDetailService.java
@@ -60,4 +60,6 @@ public interface IAdvanceDetailService {
DistributionParcelListEntityVO getByUnitNoAndWarehouseId(String unitNo, Integer oldWarehouseId);
DistributionParcelListEntityVO getByUnitNoByPyl(String unitNo);
+
+ List findListByAdvanceId(Integer advanceId);
}
diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IAdvanceService.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IAdvanceService.java
index a97ddbc04..572881bd6 100644
--- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IAdvanceService.java
+++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IAdvanceService.java
@@ -52,4 +52,6 @@ public interface IAdvanceService {
List findAdvanceEntityByLogiBillNoAndOrderCode(String logiBillNo, String orderCode);
List getAdvanceList(String orderSelfNum);
+
+ List findListByAdvanceIds(List advanceIds);
}
diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IDetailProductService.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IDetailProductService.java
index 905f2b3a7..c897b93f0 100644
--- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IDetailProductService.java
+++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IDetailProductService.java
@@ -33,4 +33,5 @@ public interface IDetailProductService{
Boolean saveBatch(List detailProductEntitys);
+ List findListByUnitNo(String unitNo);
}
diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IWayBillService.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IWayBillService.java
index 964550c1c..d414d2620 100644
--- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IWayBillService.java
+++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IWayBillService.java
@@ -3,6 +3,8 @@ package com.logpm.oldproject.service;
import com.logpm.oldproject.entity.WayBillEntity;
+import java.util.List;
+
public interface IWayBillService {
@@ -15,4 +17,5 @@ public interface IWayBillService {
WayBillEntity getByWayBillByAdvanceId(Integer advId);
+ List findAdvanceIdsByWaybillNo(String waybillNo);
}
diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/AdvanceDetailServiceImpl.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/AdvanceDetailServiceImpl.java
index 4a6c9e145..b759c7f30 100644
--- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/AdvanceDetailServiceImpl.java
+++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/AdvanceDetailServiceImpl.java
@@ -74,6 +74,11 @@ public class AdvanceDetailServiceImpl implements IAdvanceDetailService {
return advanceDetailMapper.getByUnitNoByPyl(unitNo);
}
+ @Override
+ public List findListByAdvanceId(Integer advanceId) {
+ return advanceDetailMapper.findListByAdvanceId(advanceId);
+ }
+
@Override
public Integer getAllNumByOrderNo(String orderSelfNum) {
QueryWrapper queryWrapper = new QueryWrapper<>();
diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/AdvanceServiceImpl.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/AdvanceServiceImpl.java
index bd4729bab..1e76768b5 100644
--- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/AdvanceServiceImpl.java
+++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/AdvanceServiceImpl.java
@@ -79,4 +79,9 @@ public class AdvanceServiceImpl implements IAdvanceService {
public List getAdvanceList(String orderSelfNum) {
return advanceMapper.getAdvanceList(orderSelfNum);
}
+
+ @Override
+ public List findListByAdvanceIds(List advanceIds) {
+ return advanceMapper.findListByAdvanceIds(advanceIds);
+ }
}
diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/DetailProductServiceImpl.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/DetailProductServiceImpl.java
index ea798b0ed..8bb300f8d 100644
--- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/DetailProductServiceImpl.java
+++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/DetailProductServiceImpl.java
@@ -45,4 +45,9 @@ public class DetailProductServiceImpl implements IDetailProductService {
public Boolean saveBatch(List detailProductEntitys) {
return detailProductMapper.addList(detailProductEntitys);
}
+
+ @Override
+ public List findListByUnitNo(String unitNo) {
+ return detailProductMapper.findListByUnitNo(unitNo);
+ }
}
diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/WayBillServiceImpl.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/WayBillServiceImpl.java
index 377db7183..f77833ae3 100644
--- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/WayBillServiceImpl.java
+++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/WayBillServiceImpl.java
@@ -9,6 +9,8 @@ import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
+import java.util.List;
+
@Log4j2
@Service
@AllArgsConstructor
@@ -35,4 +37,9 @@ public class WayBillServiceImpl implements IWayBillService {
return wayBillMapper.getByWayBillByAdvanceId(advId);
}
+
+ @Override
+ public List findAdvanceIdsByWaybillNo(String waybillNo) {
+ return wayBillMapper.findAdvanceIdsByWaybillNo(waybillNo);
+ }
}
diff --git a/blade-service/logpm-patch/pom.xml b/blade-service/logpm-patch/pom.xml
index 98debe483..8bc35f33e 100644
--- a/blade-service/logpm-patch/pom.xml
+++ b/blade-service/logpm-patch/pom.xml
@@ -69,6 +69,12 @@
3.2.0.RELEASE
compile
+
+ org.springblade
+ logpm-trunkline-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 5f4920919..102380abe 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
@@ -16,6 +16,14 @@ import com.logpm.oldproject.entity.*;
import com.logpm.oldproject.feign.*;
import com.logpm.oldproject.vo.DistributionParcelListEntityVO;
import com.logpm.patch.service.ISyncOrderInfoService;
+import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
+import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
+import com.logpm.trunkline.entity.TrunklineDetailProductEntity;
+import com.logpm.trunkline.entity.TrunklineWaybillOrderEntity;
+import com.logpm.trunkline.feign.ITrunklineAdvanceClient;
+import com.logpm.trunkline.feign.ITrunklineAdvanceDetailClient;
+import com.logpm.trunkline.feign.ITrunklineDetailProductClient;
+import com.logpm.trunkline.feign.ITrunklineWaybillOrderClient;
import com.logpm.warehouse.entity.WarehouseWayBillDetail;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.feign.IWarehouseTrayTypeClient;
@@ -68,6 +76,12 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
private final IOrderLocationClient orderLocationClient;
private final IWarehouseUpdownTypeClient warehouseUpdownTypeClient;
+ private final ITrunklineWaybillOrderClient waybillOrderClient;
+ private final ITrunklineAdvanceClient trunklineAdvanceClient;
+ private final IDetailProductClient detailProductClient;
+ private final ITrunklineDetailProductClient trunklineDetailProductClient;
+ private final ITrunklineAdvanceDetailClient trunklineAdvanceDetailClient;
+
@Transactional(rollbackFor = Exception.class)
@Override
public void handleData(List orderCodeList,Integer oldWarehouseId,Long newWarehouseId) {
@@ -1522,6 +1536,7 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
warehouseWaybill = new WarehouseWaybillEntity();
warehouseWaybill.setWaybillNo(waybillNo);
+ warehouseWaybill.setOrderNo(wayBillEntity.getOrderNo());
warehouseWaybill.setDestinationWarehouseName(warehouseName);
warehouseWaybill.setDestinationWarehouseId(Objects.isNull(endhouse) ? null : endhouse.getId());
warehouseWaybill.setDepartureWarehouseName(startSite);
@@ -1555,7 +1570,7 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
warehouseWaybill.setDestination(wayBillEntity.getArriveSite());
warehouseWaybill.setGoodsName(packname);
warehouseWaybill.setTotalCount(number);
- warehouseWaybill.setStockCount(1);
+ warehouseWaybill.setStockCount(number);
warehouseWaybill.setTotalWeight(wayBillEntity.getWeight());
warehouseWaybill.setTotalVolume(wayBillEntity.getVolume());
warehouseWaybill.setDeliveryMethod(wayBillEntity.getSendType());
@@ -1571,6 +1586,29 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
warehouseWaybill.setWaybillType(wayBillEntity.getType());
warehouseWaybill.setReceivedStatus(0);
+ warehouseWaybill.setTotalFreight(wayBillEntity.getFreight());
+ warehouseWaybill.setDeliveryFee(wayBillEntity.getDeliveryCost());
+ warehouseWaybill.setPickupFee(wayBillEntity.getTakeCost());
+ warehouseWaybill.setWarehouseManagementFee(wayBillEntity.getWarehouseManagementFee());
+ warehouseWaybill.setStorageFee(wayBillEntity.getWarehousingFee());
+ warehouseWaybill.setHandlingFee(wayBillEntity.getPretendCost());
+ warehouseWaybill.setOtherFee(wayBillEntity.getOtherFee());
+ warehouseWaybill.setInsuranceFee(wayBillEntity.getPriceProtectionFee());
+ warehouseWaybill.setClaimingValue(wayBillEntity.getValue());
+ warehouseWaybill.setPayType(wayBillEntity.getPayType()+"");
+ warehouseWaybill.setPayWay(wayBillEntity.getPaymentMethod()+"");
+ warehouseWaybill.setXPay(wayBillEntity.getXPay());
+ warehouseWaybill.setDPay(wayBillEntity.getDPay());
+ warehouseWaybill.setHPay(wayBillEntity.getHPay());
+ warehouseWaybill.setYPay(wayBillEntity.getYPay());
+ warehouseWaybill.setThirdOperationFee(wayBillEntity.getThreeHandleFee());
+ warehouseWaybill.setDeliveryWay(wayBillEntity.getSendType()+"");
+ warehouseWaybill.setUrgency(wayBillEntity.getUrgency()+"");
+ warehouseWaybill.setReceipt(wayBillEntity.getReceiptAsk());
+ warehouseWaybill.setReceiptNum(wayBillEntity.getReceiptNum());
+ warehouseWaybill.setTransportType(wayBillEntity.getShippingType()+"");
+ warehouseWaybill.setRebate(wayBillEntity.getRebate());
+
BasicdataClientEntity agentClient = basicdataClientClient.findByName(agent);
if (!Objects.isNull(agentClient)) {
Long clientEntityId = agentClient.getId();//基础客户
@@ -1588,14 +1626,188 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
warehouseWaybill.setUpdateTime(date);
warehouseWaybillClient.addEnntity(warehouseWaybill);
} else {
- warehouseWaybill.setStockCount(warehouseWaybill.getStockCount() + 1);
+// warehouseWaybill.setStockCount(warehouseWaybill.getStockCount() + 1);
warehouseWaybill.setUpdateTime(new Date());
warehouseWaybillClient.updateEntity(warehouseWaybill);
}
+ //暂存单与运单的关联
+ saveAdvanceData(warehouseWaybill);
+
return wayBillEntity;
}
+ private void saveAdvanceData(WarehouseWaybillEntity warehouseWaybill) {
+
+ String waybillNo = warehouseWaybill.getWaybillNo();
+ Long waybillId = warehouseWaybill.getId();
+ //查看新系统是否有关联数据
+ List waybillOrderList = waybillOrderClient.findListByWaybillNo(waybillNo);
+ if(waybillOrderList.isEmpty()){
+ //没有关联订单数据
+ //查老系统的运单关联哪些订单
+ List advanceIds = wayBillClient.findAdvanceIdsByWaybillNo(waybillNo);
+ if(advanceIds.isEmpty()){
+ log.warn("#############saveAdvanceData: 老系统运单未有关联订单 waybillNo={}",waybillNo);
+ throw new CustomerException(405,"老系统运单未有关联订单");
+ }
+ List advanceList = advanceClient.findListByAdvanceIds(advanceIds);
+ for (AdvanceEntity advanceEntity : advanceList) {
+ Integer advanceId = advanceEntity.getId();
+ Integer oldWarehouseId = advanceEntity.getWarehouseId();
+ String orderCode = advanceEntity.getOrderSelfNum();
+ Integer totalNum = advanceEntity.getTotal();
+ String brand = advanceEntity.getType();
+ BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getWarehouseByOldId(oldWarehouseId);
+ Date date = new Date();
+ TrunklineAdvanceEntity trunklineAdvanceEntity = new TrunklineAdvanceEntity();
+ trunklineAdvanceEntity.setTenantId(TenantNum.HUITONGCODE);
+ trunklineAdvanceEntity.setCreateUser(1714696768639311873L);
+ trunklineAdvanceEntity.setCreateTime(date);
+ trunklineAdvanceEntity.setUpdateUser(1714696768639311873L);
+ trunklineAdvanceEntity.setUpdateTime(date);
+ trunklineAdvanceEntity.setStatus(1);
+ trunklineAdvanceEntity.setIsDeleted(0);
+ trunklineAdvanceEntity.setCreateDept(1649331096241836033L);
+ trunklineAdvanceEntity.setWarehouseId(basicdataWarehouseEntity.getId());
+ trunklineAdvanceEntity.setWarehouseName(basicdataWarehouseEntity.getName());
+ trunklineAdvanceEntity.setOrderCode(orderCode);
+ trunklineAdvanceEntity.setSiteName(advanceEntity.getSiteName());
+ trunklineAdvanceEntity.setArea(advanceEntity.getArea());
+ trunklineAdvanceEntity.setOrderType(advanceEntity.getOrderTypeName());
+ trunklineAdvanceEntity.setBrand(advanceEntity.getType());
+ trunklineAdvanceEntity.setTotalNum(totalNum);
+ trunklineAdvanceEntity.setPackCode(advanceEntity.getFirstPackCode());
+ trunklineAdvanceEntity.setPackName(advanceEntity.getFirstPackName());
+ trunklineAdvanceEntity.setDealerCode(advanceEntity.getDealerCode());
+ trunklineAdvanceEntity.setDealerName(advanceEntity.getDealerName());
+ trunklineAdvanceEntity.setCarrierName(advanceEntity.getCarrierName());
+ trunklineAdvanceEntity.setCustomerName(advanceEntity.getCustomerName());
+ trunklineAdvanceEntity.setCustomerPhone(advanceEntity.getCustomerPhone());
+ trunklineAdvanceEntity.setCustomerAddress(advanceEntity.getCustomerRoad());
+ trunklineAdvanceEntity.setSystemType(advanceEntity.getSystemType());
+ trunklineAdvanceEntity.setStoreCode(advanceEntity.getStoreNo());
+ trunklineAdvanceEntity.setStoreName(advanceEntity.getStoreName());
+ trunklineAdvanceEntity.setServiceNum(advanceEntity.getServiceNum());
+ trunklineAdvanceEntity.setMatingType(advanceEntity.getMatingCode());
+ trunklineAdvanceEntity.setSenderName(advanceEntity.getSenderName());
+ trunklineAdvanceEntity.setSenderPhone(advanceEntity.getSenderMobile());
+ trunklineAdvanceEntity.setSenderAddress(advanceEntity.getSenderAddress());
+ Integer waybillStatus = advanceEntity.getWaybillStatus();
+ if(waybillStatus == 1){
+ trunklineAdvanceEntity.setWaybillStatus("0");
+ }else if(waybillStatus == 2){
+ trunklineAdvanceEntity.setWaybillStatus("1");
+ }
+ trunklineAdvanceEntity.setWaybillNo(advanceEntity.getWaybillNo());
+ trunklineAdvanceEntity.setTrainNumber(advanceEntity.getMctsTruck());
+ Integer freeze = advanceEntity.getFreeze();
+ if(freeze == 1){
+ trunklineAdvanceEntity.setFreezeStatus("0");
+ }else if(freeze == 2){
+ trunklineAdvanceEntity.setFreezeStatus("1");
+ }
+ String leaveBehind = advanceEntity.getLeaveBehind();
+ if("N".equals(leaveBehind)){
+ trunklineAdvanceEntity.setLegacyStatus("0");
+ }else if("Y".equals(leaveBehind)){
+ trunklineAdvanceEntity.setLegacyStatus("1");
+ }
+ trunklineAdvanceEntity.setDeliveryDate(CommonUtil.StringToDate(advanceEntity.getDueDate()));
+ Long newAdvanceId = trunklineAdvanceClient.addAdvanceReturnId(trunklineAdvanceEntity);
+ if(Objects.isNull(newAdvanceId)){
+ log.warn("#############saveAdvanceData: 保存暂存单失败 orderCode={}",orderCode);
+ continue;
+ }else{
+ //生成对应的运单关联订单信息
+ TrunklineWaybillOrderEntity trunklineWaybillOrderEntity = new TrunklineWaybillOrderEntity();
+ trunklineWaybillOrderEntity.setTenantId(TenantNum.HUITONGCODE);
+ trunklineWaybillOrderEntity.setCreateUser(1714696768639311873L);
+ trunklineWaybillOrderEntity.setCreateTime(date);
+ trunklineWaybillOrderEntity.setUpdateUser(1714696768639311873L);
+ trunklineWaybillOrderEntity.setUpdateTime(date);
+ trunklineWaybillOrderEntity.setStatus(1);
+ trunklineWaybillOrderEntity.setIsDeleted(0);
+ trunklineWaybillOrderEntity.setCreateDept(1649331096241836033L);
+ trunklineWaybillOrderEntity.setWarehouseId(basicdataWarehouseEntity.getId());
+ trunklineWaybillOrderEntity.setWaybillNo(basicdataWarehouseEntity.getName());
+ trunklineWaybillOrderEntity.setWaybillId(waybillId);
+ trunklineWaybillOrderEntity.setWaybillNo(waybillNo);
+ trunklineWaybillOrderEntity.setAdvanceId(newAdvanceId);
+ trunklineWaybillOrderEntity.setOrderCode(orderCode);
+ trunklineWaybillOrderEntity.setTotalNumber(totalNum);
+ trunklineWaybillOrderEntity.setHandleNumber(0);
+ waybillOrderClient.addEntityReturnId(trunklineWaybillOrderEntity);
+
+ //查询暂存单包件
+ List detailList = advanceDetailClient.findListByAdvanceId(advanceId);
+ List newPackageList = new ArrayList<>();
+ for (AdvanceDetailEntity advanceDetailEntity : detailList) {
+ String unitNo = advanceDetailEntity.getUnitNo();
+ TrunklineAdvanceDetailEntity trunklineAdvanceDetailEntity = new TrunklineAdvanceDetailEntity();
+ trunklineAdvanceDetailEntity.setTenantId(TenantNum.HUITONGCODE);
+ trunklineAdvanceDetailEntity.setCreateUser(1714696768639311873L);
+ trunklineAdvanceDetailEntity.setCreateTime(date);
+ trunklineAdvanceDetailEntity.setUpdateUser(1714696768639311873L);
+ trunklineAdvanceDetailEntity.setUpdateTime(date);
+ trunklineAdvanceDetailEntity.setStatus(1);
+ trunklineAdvanceDetailEntity.setIsDeleted(0);
+ trunklineAdvanceDetailEntity.setCreateDept(1649331096241836033L);
+ trunklineAdvanceDetailEntity.setWarehouseId(basicdataWarehouseEntity.getId());
+ trunklineAdvanceDetailEntity.setWarehouseName(basicdataWarehouseEntity.getName());
+ trunklineAdvanceDetailEntity.setAdvanceId(newAdvanceId);
+ trunklineAdvanceDetailEntity.setOrderCode(advanceDetailEntity.getOrderSelfNum());
+ trunklineAdvanceDetailEntity.setBrand(advanceDetailEntity.getType());
+ trunklineAdvanceDetailEntity.setSystemType(advanceDetailEntity.getSystemType());
+ trunklineAdvanceDetailEntity.setFirstPackName(advanceDetailEntity.getFirstPackName());
+ trunklineAdvanceDetailEntity.setSecondPackName(advanceDetailEntity.getSecondPackName());
+ trunklineAdvanceDetailEntity.setThirdPackName(advanceDetailEntity.getThirdPackName());
+ trunklineAdvanceDetailEntity.setSiteCode(advanceDetailEntity.getSiteCode());
+ trunklineAdvanceDetailEntity.setSiteName(advanceDetailEntity.getSiteName());
+ trunklineAdvanceDetailEntity.setQuantity(Integer.parseInt(advanceDetailEntity.getMscsNum()));
+ trunklineAdvanceDetailEntity.setOrderPackageCode(unitNo);
+ trunklineAdvanceDetailEntity.setTrainNumber(advanceDetailEntity.getMctsTruck());
+ trunklineAdvanceDetailEntity.setServiceNum(advanceDetailEntity.getServiceNum());
+ trunklineAdvanceDetailEntity.setWaybillNo(waybillNo);
+ trunklineAdvanceDetailEntity.setPackageStatus("1");
+ trunklineAdvanceDetailEntity.setChargeType(1);
+ newPackageList.add(trunklineAdvanceDetailEntity);
+
+ //同步包内明细
+ List detailProductList = detailProductClient.findListByUnitNo(unitNo);
+ List trunklineDetailProductEntities = new ArrayList<>();
+ for (DetailProductEntity detailProductEntity : detailProductList) {
+
+ TrunklineDetailProductEntity trunklineDetailProductEntity = new TrunklineDetailProductEntity();
+ trunklineDetailProductEntity.setTenantId(TenantNum.HUITONGCODE);
+ trunklineDetailProductEntity.setCreateUser(1714696768639311873L);
+ trunklineDetailProductEntity.setCreateTime(date);
+ trunklineDetailProductEntity.setUpdateUser(1714696768639311873L);
+ trunklineDetailProductEntity.setUpdateTime(date);
+ trunklineDetailProductEntity.setStatus(1);
+ trunklineDetailProductEntity.setIsDeleted(0);
+ trunklineDetailProductEntity.setCreateDept(1649331096241836033L);
+ trunklineDetailProductEntity.setWarehouseId(basicdataWarehouseEntity.getId());
+ trunklineDetailProductEntity.setWarehouseName(basicdataWarehouseEntity.getName());
+ trunklineDetailProductEntity.setUnitNo(detailProductEntity.getUnitNo());
+ trunklineDetailProductEntity.setProductCode(detailProductEntity.getProductcode());
+ trunklineDetailProductEntity.setProductName(detailProductEntity.getProductname());
+ trunklineDetailProductEntity.setQuantity(detailProductEntity.getDelivernum());
+ trunklineDetailProductEntities.add(trunklineDetailProductEntity);
+
+ }
+ trunklineDetailProductClient.addListEntity(trunklineDetailProductEntities);
+ }
+ trunklineAdvanceDetailClient.addAdvanceBatch(newPackageList);
+ }
+ }
+ log.info("##############saveAdvanceData: 运单同步已完成 waybillNo={}",waybillNo);
+ }else{
+ log.info("##############saveAdvanceData: 运单已有关联订单 waybillNo={}",waybillNo);
+ }
+
+ }
+
private void saveTrayTypeInfoPackageNew(String orderCode,Integer oldWarehouseId, Long newWarehouseId,Integer inventoryId) {
diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklineAdvanceClient.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklineAdvanceClient.java
new file mode 100644
index 000000000..93e0c4e8e
--- /dev/null
+++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklineAdvanceClient.java
@@ -0,0 +1,26 @@
+package com.logpm.trunkline.feign;
+
+import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
+import com.logpm.trunkline.service.ITrunklineAdvanceService;
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.RestController;
+import springfox.documentation.annotations.ApiIgnore;
+
+@Slf4j
+@ApiIgnore()
+@RestController
+@AllArgsConstructor
+public class TrunklineAdvanceClient implements ITrunklineAdvanceClient{
+
+ private final ITrunklineAdvanceService advanceService;
+
+ @Override
+ public Long addAdvanceReturnId(TrunklineAdvanceEntity trunklineAdvanceEntity) {
+ boolean save = advanceService.save(trunklineAdvanceEntity);
+ if(!save){
+ return null;
+ }
+ return trunklineAdvanceEntity.getId();
+ }
+}
diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklineAdvanceDetailClient.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklineAdvanceDetailClient.java
new file mode 100644
index 000000000..e4f9572a2
--- /dev/null
+++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklineAdvanceDetailClient.java
@@ -0,0 +1,24 @@
+package com.logpm.trunkline.feign;
+
+import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
+import com.logpm.trunkline.service.ITrunklineAdvanceDetailService;
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.RestController;
+import springfox.documentation.annotations.ApiIgnore;
+
+import java.util.List;
+
+@Slf4j
+@ApiIgnore()
+@RestController
+@AllArgsConstructor
+public class TrunklineAdvanceDetailClient implements ITrunklineAdvanceDetailClient{
+
+ private final ITrunklineAdvanceDetailService advanceDetailService;
+
+ @Override
+ public void addAdvanceBatch(List advanceDetailEntities) {
+ advanceDetailService.saveBatch(advanceDetailEntities);
+ }
+}
diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklineDetailProductClient.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklineDetailProductClient.java
new file mode 100644
index 000000000..942cc7337
--- /dev/null
+++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklineDetailProductClient.java
@@ -0,0 +1,33 @@
+package com.logpm.trunkline.feign;
+
+import com.logpm.trunkline.entity.TrunklineDetailProductEntity;
+import com.logpm.trunkline.service.ITrunklineDetailProductService;
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.RestController;
+import springfox.documentation.annotations.ApiIgnore;
+
+import java.util.List;
+
+@Slf4j
+@ApiIgnore()
+@RestController
+@AllArgsConstructor
+public class TrunklineDetailProductClient implements ITrunklineDetailProductClient {
+
+ private final ITrunklineDetailProductService detailProductService;
+
+ @Override
+ public Long addEntityReturnId(TrunklineDetailProductEntity trunklineDetailProductEntity) {
+ boolean save = detailProductService.save(trunklineDetailProductEntity);
+ if(!save){
+ return null;
+ }
+ return trunklineDetailProductEntity.getId();
+ }
+
+ @Override
+ public void addListEntity(List trunklineDetailProductEntities) {
+ detailProductService.saveBatch(trunklineDetailProductEntities);
+ }
+}
diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklineWaybillOrderClient.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklineWaybillOrderClient.java
new file mode 100644
index 000000000..005016eee
--- /dev/null
+++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklineWaybillOrderClient.java
@@ -0,0 +1,37 @@
+package com.logpm.trunkline.feign;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.logpm.trunkline.entity.TrunklineWaybillOrderEntity;
+import com.logpm.trunkline.service.ITrunklineWaybillOrderService;
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.RestController;
+import springfox.documentation.annotations.ApiIgnore;
+
+import java.util.List;
+
+@Slf4j
+@ApiIgnore()
+@RestController
+@AllArgsConstructor
+public class TrunklineWaybillOrderClient implements ITrunklineWaybillOrderClient{
+
+ private final ITrunklineWaybillOrderService waybillOrderService;
+
+ @Override
+ public List findListByWaybillNo(String waybillNo) {
+ QueryWrapper queryWrapper = new QueryWrapper<>();
+ queryWrapper.eq("waybill_no",waybillNo);
+ List list = waybillOrderService.list(queryWrapper);
+ return list;
+ }
+
+ @Override
+ public Long addEntityReturnId(TrunklineWaybillOrderEntity trunklineWaybillOrderEntity) {
+ boolean save = waybillOrderService.save(trunklineWaybillOrderEntity);
+ if(!save){
+ return null;
+ }
+ return trunklineWaybillOrderEntity.getId();
+ }
+}
From f143a734cdb458b88591b497e07d60c7c1dce4aa Mon Sep 17 00:00:00 2001
From: "pref_mail@163.com"
Date: Wed, 6 Dec 2023 17:51:26 +0800
Subject: [PATCH 3/3] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E8=A7=A3=E5=86=B3?=
=?UTF-8?q?=E6=AC=A7=E6=B4=BE=E6=95=B0=E6=8D=AE=E6=8E=A8=E9=80=81=20?=
=?UTF-8?q?=E9=87=8D=E5=A4=8D=E6=8E=A8=E9=80=81=E7=9A=84=E9=97=AE=E9=A2=98?=
=?UTF-8?q?=201.2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../DistributionErrorQueueHandler.java | 6 ++++++
.../com/logpm/distribution/TestService.java | 18 +++++++++++++++++-
2 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/DistributionErrorQueueHandler.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/DistributionErrorQueueHandler.java
index 45d99ce87..aec08feb2 100644
--- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/DistributionErrorQueueHandler.java
+++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/DistributionErrorQueueHandler.java
@@ -1,6 +1,7 @@
package com.logpm.distribution.receiver;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.logpm.distribution.entity.DistributionStockEntity;
import com.logpm.distribution.service.IDistributionStockService;
import com.rabbitmq.client.Channel;
@@ -35,6 +36,11 @@ public class DistributionErrorQueueHandler {
final long deliveryTag = message.getMessageProperties().getDeliveryTag();
try {
Long logId = (Long) map.get("logId");
+ if(ObjectUtils.isNull(logId)){
+ // 没有备货任务ID
+ channel.basicAck(deliveryTag, false);
+ return;
+ }
UpdateWrapper updateWrapper = new UpdateWrapper<>();
updateWrapper.set("conditions",2)
.eq("id",logId);
diff --git a/blade-service/logpm-distribution/src/test/java/com/logpm/distribution/TestService.java b/blade-service/logpm-distribution/src/test/java/com/logpm/distribution/TestService.java
index 75d1aab13..a64faf65e 100644
--- a/blade-service/logpm-distribution/src/test/java/com/logpm/distribution/TestService.java
+++ b/blade-service/logpm-distribution/src/test/java/com/logpm/distribution/TestService.java
@@ -1,6 +1,8 @@
package com.logpm.distribution;
+import com.logpm.distribution.dto.DistributionSignforDTO;
import com.logpm.distribution.service.IDistributionDeliveryListService;
+import com.logpm.distribution.service.IDistributionSignforService;
import com.logpm.distribution.vo.print.PrintPreviewVO;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
@@ -11,12 +13,15 @@ import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
@ExtendWith(BladeSpringExtension.class)
-@BladeBootTest(appName = "logpm-distribution-tjj", enableLoader = true)
+@BladeBootTest(appName = "logpm-distribution-pref", enableLoader = true)
public class TestService {
@Autowired
private IDistributionDeliveryListService distributionDeliveryListService;
+ @Autowired
+ private IDistributionSignforService iDistributionSignforService;
+
@Test
public void test2() throws Exception {
@@ -37,6 +42,17 @@ public class TestService {
+ }
+ @Test
+ public void test4(){
+
+ // 测试推送数据
+ DistributionSignforDTO dto = new DistributionSignforDTO();
+ iDistributionSignforService.updateSign(dto);
+
+
+
+
}
}