Browse Source

Merge remote-tracking branch 'origin/dev' into dev

training
pref_mail@163.com 1 year ago
parent
commit
56102b725e
  1. 24
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionReservationStocklistVO.java
  2. 6
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockListVO.java
  3. 4
      blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/entity/AdvanceEntity.java
  4. 3
      blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IAdvanceClient.java
  5. 5
      blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IAdvanceDetailClient.java
  6. 7
      blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IDetailProductClient.java
  7. 4
      blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IWayBillClient.java
  8. 4
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineCarsLoadEntity.java
  9. 8
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineCarsLoadLineEntity.java
  10. 20
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/feign/ITrunklineAdvanceClient.java
  11. 21
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/feign/ITrunklineAdvanceDetailClient.java
  12. 23
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/feign/ITrunklineDetailProductClient.java
  13. 25
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/feign/ITrunklineWaybillOrderClient.java
  14. 17
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockListController.java
  15. 12
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml
  16. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml
  17. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.xml
  18. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java
  19. 49
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  20. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java
  21. 82
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java
  22. 211
      blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java
  23. 8
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/AdvanceClient.java
  24. 5
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/AdvanceDetailClient.java
  25. 5
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/DetailProductClient.java
  26. 7
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/WayBillClient.java
  27. 2
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceDetailMapper.java
  28. 6
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceDetailMapper.xml
  29. 1
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceMapper.java
  30. 12
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceMapper.xml
  31. 2
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/DetailProductMapper.java
  32. 6
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/DetailProductMapper.xml
  33. 2
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/OrderMapper.xml
  34. 4
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/WayBillMapper.java
  35. 6
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/WayBillMapper.xml
  36. 2
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IAdvanceDetailService.java
  37. 2
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IAdvanceService.java
  38. 1
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IDetailProductService.java
  39. 3
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IWayBillService.java
  40. 5
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/AdvanceDetailServiceImpl.java
  41. 5
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/AdvanceServiceImpl.java
  42. 5
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/DetailProductServiceImpl.java
  43. 7
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/WayBillServiceImpl.java
  44. 6
      blade-service/logpm-patch/pom.xml
  45. 216
      blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncOrderInfoServiceImpl.java
  46. 26
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklineAdvanceClient.java
  47. 24
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklineAdvanceDetailClient.java
  48. 33
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklineDetailProductClient.java
  49. 37
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklineWaybillOrderClient.java

24
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;
/**
* 签收时间

6
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;
}

4
blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/entity/AdvanceEntity.java

@ -254,7 +254,7 @@ public class AdvanceEntity {
* 开单状态1=未开单2=已开单
*/
@ApiModelProperty(value = "开单状态:1=未开单,2=已开单")
private Byte waybillStatus;
private Integer waybillStatus;
/**
* 运单号
*/
@ -287,7 +287,7 @@ public class AdvanceEntity {
* 冻结状态1=正常2=冻结
*/
@ApiModelProperty(value = "冻结状态:1=正常,2=冻结")
private Byte freeze;
private Integer freeze;
/**
* 删除原因
*/

3
blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IAdvanceClient.java

@ -96,4 +96,7 @@ public interface IAdvanceClient {
@GetMapping(API_PREFIX + "/getAdvanceList")
List<AdvanceEntity> getAdvanceList(@RequestParam String orderSelfNum);
@PostMapping(API_PREFIX + "/findListByAdvanceIds")
List<AdvanceEntity> findListByAdvanceIds(@RequestBody List<Integer> advanceIds);
}

5
blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IAdvanceDetailClient.java

@ -39,7 +39,7 @@ import java.util.Map;
)
public interface IAdvanceDetailClient {
String API_PREFIX = "/client";
String API_PREFIX = "/oldAdvanceDetail/client";
String TOP = API_PREFIX + "/top1";
// /**
@ -105,4 +105,7 @@ public interface IAdvanceDetailClient {
@GetMapping(API_PREFIX + "/getByUnitNoAndWarehouseId")
DistributionParcelListEntityVO getByUnitNoAndWarehouseId(@RequestParam String unitNo, @RequestParam Integer oldWarehouseId);
@GetMapping(API_PREFIX + "/findListByAdvanceId")
List<AdvanceDetailEntity> findListByAdvanceId(@RequestParam Integer advanceId);
}

7
blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IDetailProductClient.java

@ -19,8 +19,10 @@ package com.logpm.oldproject.feign;
import com.logpm.oldproject.entity.DetailProductEntity;
import org.springblade.common.constant.ModuleNameConstant;
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;
import java.util.List;
@ -35,7 +37,7 @@ import java.util.List;
)
public interface IDetailProductClient {
String API_PREFIX = "/client";
String API_PREFIX = "detailProduct/client";
String TOP = API_PREFIX + "/top2";
// /**
@ -58,4 +60,7 @@ public interface IDetailProductClient {
@PostMapping(API_PREFIX + "/addDetailProductList")
Boolean addDetailProductList(@RequestBody List<DetailProductEntity> detailProductEntitys);
@GetMapping(API_PREFIX + "/findListByUnitNo")
List<DetailProductEntity> findListByUnitNo(@RequestParam String unitNo);
}

4
blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IWayBillClient.java

@ -22,6 +22,8 @@ import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
/**
* 运单详情 Feign接口类
*
@ -44,4 +46,6 @@ public interface IWayBillClient {
@GetMapping(API_PREFIX + "/getByWayBillByAdvanceId")
WayBillEntity getByWayBillByAdvanceId(@RequestParam("advId") Integer advId);
@GetMapping(API_PREFIX + "/findAdvanceIdsByWaybillNo")
List<Integer> findAdvanceIdsByWaybillNo(@RequestParam String waybillNo);
}

4
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineCarsLoadEntity.java

@ -1,5 +1,7 @@
package com.logpm.trunkline.entity;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -129,9 +131,11 @@ public class TrunklineCarsLoadEntity extends TenantEntity {
@ApiModelProperty(name = "最新到车仓库id",notes = "")
private Long nowWarehouseId ;
/** 发车时间 */
@TableField(updateStrategy = FieldStrategy.ALWAYS)
@ApiModelProperty(name = "发车时间",notes = "")
private Date startTime ;
/** 到车时间 */
@TableField(updateStrategy = FieldStrategy.ALWAYS)
@ApiModelProperty(name = "到车时间",notes = "")
private Date arriveTime ;
/** 取消时间 */

8
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineCarsLoadLineEntity.java

@ -1,5 +1,7 @@
package com.logpm.trunkline.entity;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -77,21 +79,27 @@ public class TrunklineCarsLoadLineEntity extends TenantEntity {
@ApiModelProperty(name = "排序",notes = "")
private Integer sort ;
/** 到车时间 */
@TableField(updateStrategy = FieldStrategy.ALWAYS)
@ApiModelProperty(name = "到车时间",notes = "")
private Date arriveDate ;
/** 到车时间确认人id */
@TableField(updateStrategy = FieldStrategy.ALWAYS)
@ApiModelProperty(name = "到车时间确认人id",notes = "")
private Long arriveUserId ;
/** 到车时间确认人名称 */
@TableField(updateStrategy = FieldStrategy.ALWAYS)
@ApiModelProperty(name = "到车时间确认人名称",notes = "")
private String arriveUserName ;
/** 发车时间 */
@TableField(updateStrategy = FieldStrategy.ALWAYS)
@ApiModelProperty(name = "发车时间",notes = "")
private Date startDate ;
/** 发车时间确认人id */
@TableField(updateStrategy = FieldStrategy.ALWAYS)
@ApiModelProperty(name = "发车时间确认人id",notes = "")
private Long startUserId ;
/** 发车时间确认人名称 */
@TableField(updateStrategy = FieldStrategy.ALWAYS)
@ApiModelProperty(name = "发车时间确认人名称",notes = "")
private String startUserName ;
/** 计划装车件数 */

20
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/feign/ITrunklineAdvanceClient.java

@ -0,0 +1,20 @@
package com.logpm.trunkline.feign;
import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
import org.springblade.common.constant.ModuleNameConstant;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@FeignClient(
value = ModuleNameConstant.APPLICATION_TRUNKLINE_NAME
)
public interface ITrunklineAdvanceClient {
String API_PREFIX = "trunklineAdvance/client";
@PostMapping(API_PREFIX+"/addAdvanceReturnId")
Long addAdvanceReturnId(@RequestBody TrunklineAdvanceEntity trunklineAdvanceEntity);
}

21
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/feign/ITrunklineAdvanceDetailClient.java

@ -0,0 +1,21 @@
package com.logpm.trunkline.feign;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import org.springblade.common.constant.ModuleNameConstant;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
@FeignClient(
value = ModuleNameConstant.APPLICATION_TRUNKLINE_NAME
)
public interface ITrunklineAdvanceDetailClient {
String API_PREFIX = "trunklineAdvanceDetail/client";
@PostMapping(API_PREFIX+"/addAdvanceBatch")
void addAdvanceBatch(@RequestBody List<TrunklineAdvanceDetailEntity> advanceDetailEntities);
}

23
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/feign/ITrunklineDetailProductClient.java

@ -0,0 +1,23 @@
package com.logpm.trunkline.feign;
import com.logpm.trunkline.entity.TrunklineDetailProductEntity;
import org.springblade.common.constant.ModuleNameConstant;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
@FeignClient(
value = ModuleNameConstant.APPLICATION_TRUNKLINE_NAME
)
public interface ITrunklineDetailProductClient {
String API_PREFIX = "trunklineDetailProduct/client";
@PostMapping(API_PREFIX+"/addEntityReturnId")
Long addEntityReturnId(@RequestBody TrunklineDetailProductEntity trunklineDetailProductEntity);
@PostMapping(API_PREFIX+"/addListEntity")
void addListEntity(@RequestBody List<TrunklineDetailProductEntity> trunklineDetailProductEntities);
}

25
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/feign/ITrunklineWaybillOrderClient.java

@ -0,0 +1,25 @@
package com.logpm.trunkline.feign;
import com.logpm.trunkline.entity.TrunklineWaybillOrderEntity;
import org.springblade.common.constant.ModuleNameConstant;
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;
import java.util.List;
@FeignClient(
value = ModuleNameConstant.APPLICATION_TRUNKLINE_NAME
)
public interface ITrunklineWaybillOrderClient {
String API_PREFIX = "trunklineWaybillOrder/client";
@GetMapping(API_PREFIX+"/findListByWaybillNo")
List<TrunklineWaybillOrderEntity> findListByWaybillNo(@RequestParam String waybillNo);
@PostMapping(API_PREFIX+"/addEntityReturnId")
Long addEntityReturnId(@RequestBody TrunklineWaybillOrderEntity trunklineWaybillOrderEntity);
}

17
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);
}
/**
* 库存品管理 新增
*/

12
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml

@ -1381,7 +1381,11 @@
<select id="getInventoryByDeliveryId"
resultType="com.logpm.distribution.vo.DistributionReservationStocklistVO">
SELECT
ldrp.*,
ldrp.reservation_id AS reservationId,
ldrp.stocklist_id AS stockListId,
ldrp.reservation_num AS reservationNum,
ldrp.loading_status AS loadingStatus,
ldrp.signing_status AS signingStatus,
ldsl.description_goods AS descriptionGoods,
ldsl.cargo_number AS cargoNumber,
ldsl.cargo_norms AS cargoNorms,
@ -1390,7 +1394,11 @@
ldsl.category AS category,
ldsl.shopping_mall AS shoppingMall,
ldsl.market_name AS marketName,
ldsl.brand_name AS brandName
ldsl.brand_name AS brandName,
ldsl.order_code AS orderCode,
ldsl.incoming_batch AS incomingBatch,
ldsl.id AS id,
ldsl.service_number AS serviceNumber
FROM
logpm_distribution_signfor AS lds
INNER JOIN logpm_distribution_reservation_stocklist AS ldrp ON lds.reservation_id = ldrp.reservation_id

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

@ -576,6 +576,8 @@
resultType="com.logpm.distribution.vo.DistributionStockListVO">
SELECT
ldsl.order_code,
ldsl.id,
ldrs.reservation_id,
ldsl.incoming_batch,
ldsl.service_number,
ldsl.material_id,
@ -616,6 +618,7 @@
ldsl.tray_id,
ldsl.tray_name,
ldsl.sku,
ldsl.source_type,
ldrs.reservation_num,
count(ldsld.stock_package_code) AS stockupNum,
(SELECT lds.stockup_area FROM logpm_distribution_stockup_info AS ldsi INNER JOIN logpm_distribution_stockup AS lds ON ldsi.stockup_id = lds.id WHERE ldsi.reservation_id = ldrs.reservation_id) AS stockupArea

7
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.xml

@ -427,7 +427,7 @@
stock_article_id,
factory,
category,
unpack,
<!-- unpack,-->
parcel_list_id,
shopping_mall,
market_id,
@ -444,8 +444,9 @@
tray_id,
tray_name,
sku,
grounding_time
FROM
grounding_time,
unpack
FROM
logpm_distribution_stock_list
<where>
service_type = #{par.serviceType} and warehouse_id = #{par.warehouseId}

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

@ -160,6 +160,13 @@ public interface IDistributionStockListService extends BaseService<DistributionS
*/
DistributionStockListEntity selectStockInforByOrderPackageCode(String orderPackageCode);
/**
* 查看库存品包件
* @param params
* @return
*/
OrderPackgeCodeDataVO showOrderPackgeCode(Long reservationId,Long stockListId) throws Exception;
// /**
// * 查询库存品详情

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

@ -4499,41 +4499,32 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//取出所有的装车操作人
//所有扫描装车的用户名称
List<String> collect = list.stream().filter(l -> !l.getScanStatus().equals(LoadingStatusConstant.quxiao.getValue())).map(DistributionLoadscaninvnEntity::getScanUser).collect(Collectors.toList());
rs.setLoadedinNumber(list.stream().mapToInt(DistributionLoadscaninvnEntity::getLoadedNub).sum());
int loadingNum = list.stream().mapToInt(DistributionLoadscaninvnEntity::getLoadedNub).sum();
rs.setLoadedinNumber(loadingNum);
HashSet<String> strings = new HashSet<>();
strings.addAll(collect);
rs.setScanUser(String.join(",", strings));
}
switch (rs.getLoadingStatus()) {
case "10":
rs.setLoadingStatusName(ReservationInventoryLoadingStatusConstant.weizhuangche.getName());
break;
case "20":
rs.setLoadingStatusName(ReservationInventoryLoadingStatusConstant.bufenzhuangche.getName());
break;
case "30":
rs.setLoadingStatusName(ReservationInventoryLoadingStatusConstant.yizhuangche.getName());
break;
default:
rs.setLoadingStatusName(ReservationInventoryLoadingStatusConstant.weizhuangche.getName());
break;
}
switch (rs.getSigningStatus()) {
case "10":
rs.setSigningStatusName(ReservationInventorySigningStatusConstant.weiqianshou.getName());
break;
case "20":
rs.setSigningStatusName(ReservationInventorySigningStatusConstant.bufenqianshou.getName());
break;
case "30":
rs.setSigningStatusName(ReservationInventorySigningStatusConstant.yiqianshou.getName());
break;
default:
rs.setSigningStatusName(ReservationInventorySigningStatusConstant.weiqianshou.getName());
break;
if (loadingNum > 0 && loadingNum == rs.getReservationNum()){
rs.setLoadingStatusName(DeliveryLoadingStatusConstant.yizhuangche.getName());
}else if (loadingNum > 0 && loadingNum < rs.getReservationNum()){
rs.setLoadingStatusName(DeliveryLoadingStatusConstant.bunfenzhuangche.getName());
}else {
rs.setLoadingStatusName(DeliveryLoadingStatusConstant.weizhuangche.getName());
}
int signNum = list.stream().filter(f->f.getSignforState().equals(LoadScanSigningStatusConstant.yiqianshou.getValue())).mapToInt(DistributionLoadscaninvnEntity::getLoadedNub).sum();
if (signNum > 0 && signNum == rs.getReservationNum()){
rs.setSigningStatusName(ReservationSigningStatusConstant.yiqianshou.getValue());
}else if (signNum > 0 && signNum < rs.getReservationNum()){
rs.setSigningStatusName(ReservationSigningStatusConstant.bufenqianshou.getName());
}else {
rs.setSigningStatusName(ReservationSigningStatusConstant.daiqianshou.getName());
}
}
});

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

@ -103,7 +103,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
// private final IDistributionStockService distributionStockService;
private IBasicPrintTemplateClient basicPrintTemplateClient;
private IBasicPrintTemplateClient basicPrintTemplateClient;
private final IDistributionAddvalueService distributionAddvalueService;

82
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java

@ -23,17 +23,18 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.basic.entity.BasicMaterialEntity;
import com.logpm.basic.entity.BasicPrintTemplateEntity;
import com.logpm.basic.feign.IBasicMaterialClient;
import com.logpm.basic.feign.IBasicPrintTemplateClient;
import com.logpm.basicdata.entity.BasicdataClientEntity;
import com.logpm.basicdata.entity.BasicdataClientUserEntity;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataClientClient;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.distribution.dto.DistributionStockListDTO;
import com.logpm.distribution.entity.DistributionStockListEntity;
import com.logpm.distribution.entity.DistributionStockListInfoEntity;
import com.logpm.distribution.entity.DistributionUnpackingDetailsEntity;
import com.logpm.distribution.entity.*;
import com.logpm.distribution.excel.DistributionStockListExcel;
import com.logpm.distribution.mapper.DistributionReservationMapper;
import com.logpm.distribution.mapper.DistributionStockListMapper;
import com.logpm.distribution.service.IDistributionReservationStocklistService;
import com.logpm.distribution.service.IDistributionStockListInfoService;
@ -47,6 +48,9 @@ import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.DistributionTypeConstant;
import org.springblade.common.constant.printTemplate.PrintTemplateStatusConstant;
import org.springblade.common.utils.QRCodeUtil;
import org.springblade.common.utils.TemplateUtil;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseEntity;
import org.springblade.core.mp.base.BaseServiceImpl;
@ -92,6 +96,11 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
private final IDistributionReservationStocklistService reservationStocklistService;
private final IWarehouseTrayGoodsClient warehouseTrayGoodsClient;
private IBasicPrintTemplateClient basicPrintTemplateClient;
private final DistributionReservationMapper distributionReservationMapper;
@Override
@ -489,6 +498,73 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
}
@Override
public OrderPackgeCodeDataVO showOrderPackgeCode(Long reservationId,Long stockListId) throws Exception {
OrderPackgeCodeDataVO orderPackgeCodeDataVO = new OrderPackgeCodeDataVO();
List<Map> data = new ArrayList<>();
BasicPrintTemplateEntity template = basicPrintTemplateClient.getPrintTemplate(PrintTemplateStatusConstant.daiqueren_11.getValue());
if (ObjectUtil.isEmpty(template)) {
throw new ServiceException("模板内容未找到");
}
if (Func.isEmpty(reservationId)){
throw new ServiceException("参数缺少");
}
if (Func.isEmpty(stockListId)){
throw new ServiceException("参数缺少");
}
String html = TemplateUtil.getTemplateByUrl(template.getTemplateUrl());
orderPackgeCodeDataVO.setTemplateHtml(html);
orderPackgeCodeDataVO.setTemplateId(template.getId());
//查询出该品类的库存品是否已经进行备货操作了
//查询该客户的所有库存品包件
List<DisStockListDetailEntity> disStockListDetailEntities = distributionReservationMapper.selectInventoryListByReservation(reservationId);
if (Func.isEmpty(disStockListDetailEntities)){
throw new ServiceException("此预约不存在库存品信息");
}
//对指定批次的库存品进行查询是否存在备货包件
List<DisStockListDetailEntity> stockUpStockListPack = disStockListDetailEntities.stream().filter(f -> f.getStockListId().equals(stockListId) && f.getReservationId().equals(reservationId) && Func.isNotEmpty(f.getStockPackageCode())).collect(Collectors.toList());
if (Func.isEmpty(stockUpStockListPack)){
log.info("##############客户库存品包件信息:{}",disStockListDetailEntities);
throw new ServiceException("该库存品不存在备货包件信息");
}
//查询库存品信息
DistributionStockListEntity stockListEntity = this.getById(stockListId);
if (Func.isEmpty(stockListEntity)){
log.info("##############查询ID:{}",stockListId);
throw new ServiceException("查询库存品信息失败");
}
DistributionReservationEntity distributionReservationEntity = distributionReservationMapper.selectById(reservationId);
if (Func.isEmpty(distributionReservationEntity)){
log.info("##############查询ID:{}",distributionReservationEntity);
throw new ServiceException("查询库存品信息失败");
}
for (DisStockListDetailEntity disStockListDetailEntity : stockUpStockListPack) {
Map<String, Object> map = JSONObject.parseObject(JSONObject.toJSONString(stockListEntity), Map.class);
map.put("id",disStockListDetailEntity.getId());
map.put("customerName",distributionReservationEntity.getConsignee());
map.put("customerTelephone",distributionReservationEntity.getDeliveryPhone());
map.put("customerAddress",distributionReservationEntity.getDeliveryAddress());
map.put("shipperName"," ");
map.put("shipperAddress"," ");
map.put("stockPackageCode",disStockListDetailEntity.getStockPackageCode());
String filename = QRCodeUtil.createCodeToFile(disStockListDetailEntity.getStockPackageCode());
map.put("img", QRCodeUtil.getEmpAutograph(filename));
if (Func.isNotEmpty(stockListEntity.getOrderCode())){
String fileTypeName = QRCodeUtil.createCodeToFile(stockListEntity.getOrderCode());
map.put("imgType", QRCodeUtil.getEmpAutograph(fileTypeName));
}
data.add(map);
}
orderPackgeCodeDataVO.setDataList(data);
return orderPackgeCodeDataVO;
}
}

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

@ -38,10 +38,19 @@ import com.logpm.factory.snm.entity.PanPackageList;
import com.logpm.oldproject.entity.*;
import com.logpm.oldproject.feign.*;
import com.logpm.oldproject.vo.DistributionParcelListEntityVO;
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.WarehouseWaybillEntity;
import com.logpm.warehouse.feign.IWarehouseTrayTypeClient;
import com.logpm.warehouse.feign.IWarehouseWaybillClient;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springblade.common.constant.TenantNum;
@ -59,6 +68,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.*;
@Slf4j
@AllArgsConstructor
@Service
public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
@ -96,6 +106,12 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
private final BladeRedis bladeRedis;
private final ITrunklineWaybillOrderClient waybillOrderClient;
private final ITrunklineAdvanceClient trunklineAdvanceClient;
private final IDetailProductClient detailProductClient;
private final ITrunklineDetailProductClient trunklineDetailProductClient;
private final ITrunklineAdvanceDetailClient trunklineAdvanceDetailClient;
// @Override
// public FactoryTokenVO getToken(String corpId, String appKey, String appSecret) throws NoSuchAlgorithmException {
//
@ -833,6 +849,29 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
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();//基础客户
@ -855,9 +894,181 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
warehouseWaybillClient.updateEntity(warehouseWaybill);
}
//暂存单与运单的关联
saveAdvanceData(warehouseWaybill);
}
private void saveAdvanceData(WarehouseWaybillEntity warehouseWaybill) {
String waybillNo = warehouseWaybill.getWaybillNo();
Long waybillId = warehouseWaybill.getId();
//查看新系统是否有关联数据
List<TrunklineWaybillOrderEntity> waybillOrderList = waybillOrderClient.findListByWaybillNo(waybillNo);
if(waybillOrderList.isEmpty()){
//没有关联订单数据
//查老系统的运单关联哪些订单
List<Integer> advanceIds = wayBillClient.findAdvanceIdsByWaybillNo(waybillNo);
if(advanceIds.isEmpty()){
log.warn("#############saveAdvanceData: 老系统运单未有关联订单 waybillNo={}",waybillNo);
throw new CustomerException(405,"老系统运单未有关联订单");
}
List<AdvanceEntity> 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<AdvanceDetailEntity> detailList = advanceDetailClient.findListByAdvanceId(advanceId);
List<TrunklineAdvanceDetailEntity> 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<DetailProductEntity> detailProductList = detailProductClient.findListByUnitNo(unitNo);
List<TrunklineDetailProductEntity> 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);
}
}
/**
* 构建订单的经销商信息和门店信息
*

8
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/AdvanceClient.java

@ -95,4 +95,12 @@ public class AdvanceClient implements IAdvanceClient {
public List<AdvanceEntity> getAdvanceList(String orderSelfNum) {
return service.getAdvanceList(orderSelfNum);
}
@Override
public List<AdvanceEntity> findListByAdvanceIds(List<Integer> advanceIds) {
List<AdvanceEntity> list = service.findListByAdvanceIds(advanceIds);
return null;
}
}

5
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/AdvanceDetailClient.java

@ -111,4 +111,9 @@ public class AdvanceDetailClient implements IAdvanceDetailClient {
public DistributionParcelListEntityVO getByUnitNoAndWarehouseId(String unitNo, Integer oldWarehouseId) {
return advanceDetailService.getByUnitNoAndWarehouseId(unitNo,oldWarehouseId);
}
@Override
public List<AdvanceDetailEntity> findListByAdvanceId(Integer advanceId) {
return advanceDetailService.findListByAdvanceId(advanceId);
}
}

5
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/DetailProductClient.java

@ -62,4 +62,9 @@ public class DetailProductClient implements IDetailProductClient {
return detailProductService.saveBatch(detailProductEntitys);
}
@Override
public List<DetailProductEntity> findListByUnitNo(String unitNo) {
return detailProductService.findListByUnitNo(unitNo);
}
}

7
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/WayBillClient.java

@ -23,6 +23,8 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
/**
* 运单详情 Feign接口类
*
@ -54,4 +56,9 @@ public class WayBillClient implements IWayBillClient {
public WayBillEntity getByWayBillByAdvanceId(Integer advId) {
return wayBillService.getByWayBillByAdvanceId(advId);
}
@Override
public List<Integer> findAdvanceIdsByWaybillNo(String waybillNo) {
return wayBillService.findAdvanceIdsByWaybillNo(waybillNo);
}
}

2
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceDetailMapper.java

@ -62,4 +62,6 @@ public interface AdvanceDetailMapper extends BaseMapper<AdvanceDetailEntity> {
DistributionParcelListEntityVO getByUnitNoAndWarehouseId(@Param("unitNo") String unitNo, @Param("oldWarehouseId") Integer oldWarehouseId);
DistributionParcelListEntityVO getByUnitNoByPyl(@Param("unitNo")String unitNo);
List<AdvanceDetailEntity> findListByAdvanceId(@Param("advanceId") Integer advanceId);
}

6
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceDetailMapper.xml

@ -196,5 +196,11 @@
limit 1
</select>
<select id="findListByAdvanceId" resultType="com.logpm.oldproject.entity.AdvanceDetailEntity">
select *
from ht_advance_detail
where delete_time = 0
and advance_id = #{advanceId}
</select>
</mapper>

1
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceMapper.java

@ -53,4 +53,5 @@ public interface AdvanceMapper {
List<AdvanceEntity> getAdvanceList(@Param("orderSelfNum") String orderSelfNum);
List<AdvanceEntity> findListByAdvanceIds(@Param("advanceIds") List<Integer> advanceIds);
}

12
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceMapper.xml

@ -68,4 +68,16 @@
and delete_time = 0
</select>
<select id="findListByAdvanceIds" resultType="com.logpm.oldproject.entity.AdvanceEntity">
select *
from ht_advance
where delete_time = 0
<if test="advanceIds != null">
and id in
<foreach collection="advanceIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
</mapper>

2
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/DetailProductMapper.java

@ -51,4 +51,6 @@ public interface DetailProductMapper extends BaseMapper<DetailProductEntity> {
Boolean addAll(@Param("param") DetailProductEntity detailProduct);
Boolean addList(@Param("list") List<DetailProductEntity> detailProducts);
List<DetailProductEntity> findListByUnitNo(@Param("unitNo") String unitNo);
}

6
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/DetailProductMapper.xml

@ -31,4 +31,10 @@
</insert>
<select id="findListByUnitNo" resultType="com.logpm.oldproject.entity.DetailProductEntity">
select *
from ht_detail_product
where unit_no = #{unitNo}
</select>
</mapper>

2
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` &lt;&gt; 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` &lt;&gt; 11
and `i`.`history_type` = 0
AND `i`.`delete_time` = '0'
AND ( ( `i`.`in_num` + `i`.`delives_num` ) > 0 )
AND `i`.`goods_type` = '1'

4
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> {
WayBillEntity getByWayBillByAdvanceId(@Param("advId") Integer advId);
List<Integer> findAdvanceIdsByWaybillNo(@Param("waybillNo") String waybillNo);
}

6
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
</select>
<select id="findAdvanceIdsByWaybillNo" resultType="int">
select advance_id
from ht_waybill_order
where delete_time = 0
and waybill_no = #{waybillNo}
</select>
</mapper>

2
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<AdvanceDetailEntity> findListByAdvanceId(Integer advanceId);
}

2
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IAdvanceService.java

@ -52,4 +52,6 @@ public interface IAdvanceService {
List<AdvanceEntity> findAdvanceEntityByLogiBillNoAndOrderCode(String logiBillNo, String orderCode);
List<AdvanceEntity> getAdvanceList(String orderSelfNum);
List<AdvanceEntity> findListByAdvanceIds(List<Integer> advanceIds);
}

1
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IDetailProductService.java

@ -33,4 +33,5 @@ public interface IDetailProductService{
Boolean saveBatch(List<DetailProductEntity> detailProductEntitys);
List<DetailProductEntity> findListByUnitNo(String unitNo);
}

3
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<Integer> findAdvanceIdsByWaybillNo(String waybillNo);
}

5
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<AdvanceDetailEntity> findListByAdvanceId(Integer advanceId) {
return advanceDetailMapper.findListByAdvanceId(advanceId);
}
@Override
public Integer getAllNumByOrderNo(String orderSelfNum) {
QueryWrapper<AdvanceDetailEntity> queryWrapper = new QueryWrapper<>();

5
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<AdvanceEntity> getAdvanceList(String orderSelfNum) {
return advanceMapper.getAdvanceList(orderSelfNum);
}
@Override
public List<AdvanceEntity> findListByAdvanceIds(List<Integer> advanceIds) {
return advanceMapper.findListByAdvanceIds(advanceIds);
}
}

5
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<DetailProductEntity> detailProductEntitys) {
return detailProductMapper.addList(detailProductEntitys);
}
@Override
public List<DetailProductEntity> findListByUnitNo(String unitNo) {
return detailProductMapper.findListByUnitNo(unitNo);
}
}

7
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<Integer> findAdvanceIdsByWaybillNo(String waybillNo) {
return wayBillMapper.findAdvanceIdsByWaybillNo(waybillNo);
}
}

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

@ -69,6 +69,12 @@
<version>3.2.0.RELEASE</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>logpm-trunkline-api</artifactId>
<version>3.2.0.RELEASE</version>
<scope>compile</scope>
</dependency>
</dependencies>

216
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<String> 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<TrunklineWaybillOrderEntity> waybillOrderList = waybillOrderClient.findListByWaybillNo(waybillNo);
if(waybillOrderList.isEmpty()){
//没有关联订单数据
//查老系统的运单关联哪些订单
List<Integer> advanceIds = wayBillClient.findAdvanceIdsByWaybillNo(waybillNo);
if(advanceIds.isEmpty()){
log.warn("#############saveAdvanceData: 老系统运单未有关联订单 waybillNo={}",waybillNo);
throw new CustomerException(405,"老系统运单未有关联订单");
}
List<AdvanceEntity> 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<AdvanceDetailEntity> detailList = advanceDetailClient.findListByAdvanceId(advanceId);
List<TrunklineAdvanceDetailEntity> 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<DetailProductEntity> detailProductList = detailProductClient.findListByUnitNo(unitNo);
List<TrunklineDetailProductEntity> 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) {

26
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();
}
}

24
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<TrunklineAdvanceDetailEntity> advanceDetailEntities) {
advanceDetailService.saveBatch(advanceDetailEntities);
}
}

33
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<TrunklineDetailProductEntity> trunklineDetailProductEntities) {
detailProductService.saveBatch(trunklineDetailProductEntities);
}
}

37
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<TrunklineWaybillOrderEntity> findListByWaybillNo(String waybillNo) {
QueryWrapper<TrunklineWaybillOrderEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("waybill_no",waybillNo);
List<TrunklineWaybillOrderEntity> list = waybillOrderService.list(queryWrapper);
return list;
}
@Override
public Long addEntityReturnId(TrunklineWaybillOrderEntity trunklineWaybillOrderEntity) {
boolean save = waybillOrderService.save(trunklineWaybillOrderEntity);
if(!save){
return null;
}
return trunklineWaybillOrderEntity.getId();
}
}
Loading…
Cancel
Save