Browse Source

Merge branch 'dev' into 商家2.1

# Conflicts:
#	blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java
#	blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java
master
pref_mail@163.com 10 months ago
parent
commit
433b5c2abd
  1. 1
      blade-biz-common/src/main/java/org/springblade/common/constant/CodeNumConstant.java
  2. 4
      blade-biz-common/src/main/java/org/springblade/common/constant/ModuleNameConstant.java
  3. 50
      blade-biz-common/src/main/java/org/springblade/common/constant/WaybillStatusEnum.java
  4. 2
      blade-biz-common/src/main/java/org/springblade/common/constant/WorkNodeEnums.java
  5. 10
      blade-biz-common/src/main/java/org/springblade/common/constant/factorydata/FactoryDataConstants.java
  6. 4
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersaleSurveyRecordEntity.java
  7. 2
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesProcessorVO.java
  8. 3
      blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/mt/dto/MtReceiveContentDTO.java
  9. 1
      blade-service-api/logpm-factory-data-api/src/main/java/com/logpm/factorydata/util/FactoryDataUtil.java
  10. 20
      blade-service-api/logpm-factory-data-api/src/main/java/com/logpm/factorydata/vo/PushData.java
  11. 3
      blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IWayBillClient.java
  12. 45
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/ChangesRecordDTO.java
  13. 11
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/MerchantStatisticsDTO.java
  14. 14
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/StatisticsBalanceAbnormalDTO.java
  15. 14
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/StatisticsBalanceRecordDTO.java
  16. 53
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsBalanceAbnormalEntity.java
  17. 46
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsBalanceAbnormalPhotoEntity.java
  18. 128
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsBalanceOrderInfoEntity.java
  19. 51
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsBalanceRecordEntity.java
  20. 46
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsBalanceRecordPhotoEntity.java
  21. 47
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsChangesPhotoEntity.java
  22. 83
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsChangesRecordEntity.java
  23. 3
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsDistributionPackageEntity.java
  24. 10
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsOrderInfoEntity.java
  25. 13
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/StatisticsBalanceAbnormalVO.java
  26. 8
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/StatisticsBalanceOrderInfoVO.java
  27. 14
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/StatisticsBalanceRecordVO.java
  28. 15
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/StatisticsChangesRecordVO.java
  29. 138
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/StatisticsOrderInfoVO.java
  30. 41
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/StatisticsWaybillInfoVO.java
  31. 2
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/LoadCarsDTO.java
  32. 3
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineAdvanceDetailEntity.java
  33. 3
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineCarsLoadScanEntity.java
  34. 21
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/feign/ITrunklinePackageTrackLogClient.java
  35. 1
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/OpenOrderVO.java
  36. 4
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/SignOrderDetailVO.java
  37. 4
      blade-service-api/logpm-warehouse-api/pom.xml
  38. 191
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/ExportWarehouseWaybillVO.java
  39. 10
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java
  40. 4
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/dto/AftersalesAppealDTO.java
  41. 43
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/dto/AftersalesWorkOrderListExcelDTO.java
  42. 4
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesAppealMapper.xml
  43. 7
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.java
  44. 119
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml
  45. 5
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/IAftersalesWorkOrderService.java
  46. 2
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesAppealServiceImpl.java
  47. 26
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java
  48. 40
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataCodeServiceImpl.java
  49. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml
  50. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml
  51. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.xml
  52. 112
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java
  53. 115
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  54. 92
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  55. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java
  56. 14
      blade-service/logpm-factory-data/logpm-factory-data-mwh/Dockerfile
  57. 93
      blade-service/logpm-factory-data/logpm-factory-data-mwh/pom.xml
  58. 20
      blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/FactoryDataMwhApplication.java
  59. 51
      blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/aspect/AsyncAnnotationAspect.java
  60. 48
      blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/aspect/RabbitAnnotationAspect.java
  61. 161
      blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/config/CustomMessageConverter.java
  62. 79
      blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/config/ExecutorConfig.java
  63. 40
      blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/config/FactoryDataConfiguration.java
  64. 32
      blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/config/InterceptorAdapterConfig.java
  65. 17
      blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/config/RabbitConfig.java
  66. 53
      blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/controller/OrderController.java
  67. 169
      blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/entity/DeliveryNoteEntity.java
  68. 58
      blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/entity/FactoryOrderLogEntity.java
  69. 32
      blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/entity/FactoryToken.java
  70. 64
      blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/entity/PackageInfoEntity.java
  71. 28
      blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/enums/FactoryNodeEnums.java
  72. 62
      blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/enums/NodeMappingEnums.java
  73. 34
      blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/enums/NodeNeedEnums.java
  74. 87
      blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/interceptor/FactoryAccountsInterceptor.java
  75. 100
      blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/interceptor/LocalServerLoginAccountsInterceptor.java
  76. 60
      blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/launcher/FactoryDataBaseLauncherServiceImpl.java
  77. 16
      blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/mapper/DeliveryNoteMapper.java
  78. 5
      blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/mapper/FactoryNodeOrderMapper.xml
  79. 16
      blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/mapper/FactoryOrderLogMapper.java
  80. 5
      blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/mapper/FactoryOrderLogMapper.xml
  81. 31
      blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/mapper/FactoryTokenMapper.java
  82. 20
      blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/mapper/FactoryTokenMapper.xml
  83. 16
      blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/mapper/PackageInfoMapper.java
  84. 5
      blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/mapper/PackageInfoMapper.xml
  85. 143
      blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/mq/FactoryOrderListener.java
  86. 20
      blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/pros/FactoryDataProperties.java
  87. 18
      blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/service/DeliveryNoteService.java
  88. 17
      blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/service/FactoryOrderLogService.java
  89. 15
      blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/service/IFactoryTokenService.java
  90. 14
      blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/service/PackageInfoService.java
  91. 178
      blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/service/impl/DeliveryNoteServiceImpl.java
  92. 110
      blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/service/impl/FactoryOrderLogServiceImpl.java
  93. 62
      blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/service/impl/FactoryTokenServiceImpl.java
  94. 22
      blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/service/impl/PackageInfoServiceImpl.java
  95. 93
      blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/vo/DeliveryNoteVO.java
  96. 38
      blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/vo/PackageInfoVO.java
  97. 43
      blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/vo/ReceiverVO.java
  98. 41
      blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/vo/SenderVO.java
  99. 38
      blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/wrapper/CustomHttpServletRequestWrapper.java
  100. 75
      blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/wrapper/RequestWrapper.java
  101. Some files were not shown because too many files have changed in this diff Show More

1
blade-biz-common/src/main/java/org/springblade/common/constant/CodeNumConstant.java

@ -16,5 +16,6 @@ public class CodeNumConstant {
public final static int TRUNKLINE_CARS_LOAD = 12;//干线配载批次号
public final static int TRUNKLINE_TRIPARTITE_LOAD = 13;//干线三方中转批次号
public final static int TRUNKLINE_LOAD_SIGN = 14;//干线直发商家签收单号
public final static int BALANCE_ORDER = 15;//结算单号
}

4
blade-biz-common/src/main/java/org/springblade/common/constant/ModuleNameConstant.java

@ -114,6 +114,10 @@ public interface ModuleNameConstant {
* 林氏工厂数据模块
*/
String LOGPM_FACTORY_DATA_LINSY_NAME = "logpm-factory-data-linsy" + DEVAUTH;
/**
* 曼好家工厂数据模块
*/
String LOGPM_FACTORY_DATA_MWH_NAME = "logpm-factory-data-mwh" + DEVAUTH;
/**
* 金牌工厂数据模块
*/

50
blade-biz-common/src/main/java/org/springblade/common/constant/WaybillStatusEnum.java

@ -0,0 +1,50 @@
package org.springblade.common.constant;
public enum WaybillStatusEnum {
BUFENRUKU("10", "部分入库"),
RUKU("20", "入库"),
BUFENZHONGZHUAN("30", "部分中转"),
ZHONGZHAUN("40", "中转"),
MUDICANGBUFENDAODA("50", "目的仓部分到达"),
MUDICANGDAODA("60", "目的仓到达"),
PEISOSNGBUFENZHUANGCHE("70", "配送部分装车"),
PEISONGZHUANGCHE("80", "配送装车"),
BUFENQIANSHOU("90", "部分签收"),
QIANSHOU("100", "已签收");
private String code;
private String value;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
WaybillStatusEnum(String code, String value) {
this.code = code;
this.value = value;
}
public static String getValue(String code) {
for (WaybillStatusEnum value : WaybillStatusEnum.values()) {
if (value.getCode().equals(code)) {
return value.getValue();
}
}
return null;
}
}

2
blade-biz-common/src/main/java/org/springblade/common/constant/WorkNodeEnums.java

@ -40,7 +40,9 @@ public enum WorkNodeEnums implements Serializable {
DELIST(250, "下架"),
STOCKING_OPERATION(260, "备货作业"),
DISTRIBUTION_LOADING(270, "配送装车"),
DISTRIBUTION_ABNORMAL_LOADING(271, "异常装车"),
DISTRIBUTION_SIGN_FOR(280, "配送签收"),
DISTRIBUTION_ABNORMAL_SIGN_FOR(281, "异常签收"),
CLERK_REVIEW(290, "文员复核");
private Integer code;

10
blade-biz-common/src/main/java/org/springblade/common/constant/factorydata/FactoryDataConstants.java

@ -72,12 +72,17 @@ public abstract class FactoryDataConstants {
/**
* 我乐工厂订单
*/
String OLO_NODE_DATA_PUSH = "factory.data.queue.olo.nodeDataPush" + DEVAUTH;
String OLO_FACTORY_ORDER = "factory.data.queue.olo.factoryOrder" + DEVAUTH;
/**
* 林氏工厂订单
*/
String LINSY_NODE_DATA_PUSH = "factory.data.queue.linsy.nodeDataPush" + DEVAUTH;
String LINSY_FACTORY_ORDER = "factory.data.queue.linsy.factoryOrder" + DEVAUTH;
/**
* 曼好家工厂订单
*/
String MWH_FACTORY_ORDER = "factory.data.queue.mwh.factoryOrder" + DEVAUTH;
/**
* 金牌工厂订单
*/
@ -116,12 +121,17 @@ public abstract class FactoryDataConstants {
/**
* 我乐工厂订单
*/
String OLO_NODE_DATA_PUSH = "olo.nodeDataPush" + DEVAUTH;
String OLO_FACTORY_ORDER = "olo.factoryOrder" + DEVAUTH;
/**
* 林氏工厂订单
*/
String LINSY_NODE_DATA_PUSH = "linsy.nodeDataPush" + DEVAUTH;
String LINSY_FACTORY_ORDER = "linsy.factoryOrder" + DEVAUTH;
/**
* 曼好家工厂订单
*/
String MWH_FACTORY_ORDER = "mwh.factoryOrder" + DEVAUTH;
/**
* 金牌工厂订单
*/

4
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersaleSurveyRecordEntity.java

@ -127,5 +127,9 @@ public class AftersaleSurveyRecordEntity extends TenantEntity {
* 处理方ID
*/
private Long processorId;
/**
* 处理方名称
*/
private String processorName;
}

2
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesProcessorVO.java

@ -32,4 +32,6 @@ import lombok.EqualsAndHashCode;
public class AftersalesProcessorVO extends AftersalesProcessorEntity {
private static final long serialVersionUID = 1L;
}

3
blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/mt/dto/MtReceiveContentDTO.java

@ -24,4 +24,7 @@ public class MtReceiveContentDTO {
@JsonProperty("发货单编号")
private String invoiceOrderCode;//发货单编号
@JsonProperty("运单号")
private String waybillNumber;//运单号
}

1
blade-service-api/logpm-factory-data-api/src/main/java/com/logpm/factorydata/util/FactoryDataUtil.java

@ -24,6 +24,7 @@ public class FactoryDataUtil {
static {
factorys.put(BrandEnums.ZB.getValue(), FactoryDataConstants.Mq.RoutingKeys.ZBOM_NODE_DATA_PUSH);
factorys.put(BrandEnums.LINSY.getValue(), FactoryDataConstants.Mq.RoutingKeys.LINSY_NODE_DATA_PUSH);
factorys.put(BrandEnums.OLO.getValue(), FactoryDataConstants.Mq.RoutingKeys.OLO_NODE_DATA_PUSH);
}

20
blade-service-api/logpm-factory-data-api/src/main/java/com/logpm/factorydata/vo/PushData.java

@ -1,17 +1,11 @@
package com.logpm.factorydata.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.logpm.factorydata.enums.BrandEnums;
import com.logpm.factorydata.enums.SignForStatusEnums;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springblade.common.constant.WorkNodeEnums;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* 提送数据
@ -26,8 +20,20 @@ import java.util.List;
public class PushData implements Serializable {
/**
* 包件
* 包件
*/
private String packageCode;
/**
* 订单号
*/
private String orderCode;
/**
* 运单号
*/
private String waybillNumber;
/**
* 当前仓库名称
*/
private String warehouseName;
}

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

@ -51,4 +51,7 @@ public interface IWayBillClient {
@GetMapping(API_PREFIX + "/getByWayBillByOrderCode")
WayBillEntity getByWayBillByOrderCode(@RequestParam String orderCode);
@GetMapping(API_PREFIX + "/findAreaCodeByArriveSiteId")
String findAreaCodeByArriveSiteId(@RequestParam Integer arriveSiteId);
}

45
blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/ChangesRecordDTO.java

@ -0,0 +1,45 @@
package com.logpm.statistics.dto;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
@Data
public class ChangesRecordDTO implements Serializable {
private Long orderInfoId;//订单id
private String orderCode;//订单号
private BigDecimal pickupFee = BigDecimal.ZERO;//提货费
private BigDecimal freightFee = BigDecimal.ZERO;//干线费
private BigDecimal warehouseFee = BigDecimal.ZERO;//仓储费
private BigDecimal warehouseManageFee = BigDecimal.ZERO;//仓储管理费
private BigDecimal warehouseSortingFee = BigDecimal.ZERO;//仓储分拣费
private BigDecimal warehouseOperatingFee = BigDecimal.ZERO;//仓储操作费
private BigDecimal deliveryFee = BigDecimal.ZERO;//配送费
private BigDecimal deliveryLoadingFee = BigDecimal.ZERO;//配送装卸费
private BigDecimal deliverySortingFee = BigDecimal.ZERO;//配送分拣费
private BigDecimal deliveryUpfloorFee = BigDecimal.ZERO;//配送上楼费
private BigDecimal deliveryMoveFee = BigDecimal.ZERO;//配送平移费
private BigDecimal installFee = BigDecimal.ZERO;//安装费
private BigDecimal quotationFee = BigDecimal.ZERO;//保价费
private BigDecimal claimingValue = BigDecimal.ZERO;//申明价值
private BigDecimal otherFee = BigDecimal.ZERO;//其他费用
private BigDecimal returnFee = BigDecimal.ZERO;//回扣
private BigDecimal thirdOprationFee = BigDecimal.ZERO;//三方操作费
private String changesTimeStr;
private Long statisticsWarehouseId;
private String statisticsWarehouseName;
private List<String> changesPhotoUrls;
}

11
blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/MerchantStatisticsDTO.java

@ -3,6 +3,7 @@ package com.logpm.statistics.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
public class MerchantStatisticsDTO implements Serializable {
@ -14,4 +15,14 @@ public class MerchantStatisticsDTO implements Serializable {
private Long orderInfoId;
private Integer listType;
private String consignee;
private Integer confirmStatisticsOrder;//对账状态 0 1
private List<Long> orderInfoIds;
private Long balanceOrderId;
}

14
blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/StatisticsBalanceAbnormalDTO.java

@ -0,0 +1,14 @@
package com.logpm.statistics.dto;
import com.logpm.statistics.entity.StatisticsBalanceAbnormalEntity;
import com.logpm.statistics.entity.StatisticsBalanceAbnormalPhotoEntity;
import lombok.Data;
import java.util.List;
@Data
public class StatisticsBalanceAbnormalDTO extends StatisticsBalanceAbnormalEntity {
private List<StatisticsBalanceAbnormalPhotoEntity> abnormalPhotoEntityList;
}

14
blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/StatisticsBalanceRecordDTO.java

@ -0,0 +1,14 @@
package com.logpm.statistics.dto;
import com.logpm.statistics.entity.StatisticsBalanceRecordEntity;
import com.logpm.statistics.entity.StatisticsBalanceRecordPhotoEntity;
import lombok.Data;
import java.util.List;
@Data
public class StatisticsBalanceRecordDTO extends StatisticsBalanceRecordEntity {
private List<StatisticsBalanceRecordPhotoEntity> recordPhotoEntityList;
}

53
blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsBalanceAbnormalEntity.java

@ -0,0 +1,53 @@
package com.logpm.statistics.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.math.BigDecimal;
@Data
@TableName("logpm_statistics_balance_abnormal")
@ApiModel(value = "StatisticsBalanceAbnormal对象", description = "结算异常记录表")
@EqualsAndHashCode(callSuper = true)
public class StatisticsBalanceAbnormalEntity extends TenantEntity {
/**
* 预留1
*/
@ApiModelProperty(value = "预留1")
private String reserve1;
/**
* 预留2
*/
@ApiModelProperty(value = "预留2")
private String reserve2;
/**
* 预留3
*/
@ApiModelProperty(value = "预留3")
private String reserve3;
/**
* 预留4
*/
@ApiModelProperty(value = "预留4")
private String reserve4;
/**
* 预留5
*/
@ApiModelProperty(value = "预留5")
private String reserve5;
private Long balanceOrderInfoId;//结算单id
private Integer abnormalType; //异常类型1结算单 2运单 3订单
private String abnormalValue;//异常值
private BigDecimal abnormalFee;//异常金额
private String abnormalRemark;//异常备注
private String abnormalUserName;//异常操作人
}

46
blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsBalanceAbnormalPhotoEntity.java

@ -0,0 +1,46 @@
package com.logpm.statistics.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
@Data
@TableName("logpm_statistics_balance_abnormal_photo")
@ApiModel(value = "StatisticsBalanceAbnormalPhoto对象", description = "结算异常记录图片表")
@EqualsAndHashCode(callSuper = true)
public class StatisticsBalanceAbnormalPhotoEntity extends TenantEntity {
/**
* 预留1
*/
@ApiModelProperty(value = "预留1")
private String reserve1;
/**
* 预留2
*/
@ApiModelProperty(value = "预留2")
private String reserve2;
/**
* 预留3
*/
@ApiModelProperty(value = "预留3")
private String reserve3;
/**
* 预留4
*/
@ApiModelProperty(value = "预留4")
private String reserve4;
/**
* 预留5
*/
@ApiModelProperty(value = "预留5")
private String reserve5;
private Long abnormalId; //异常记录id
private String url;//图片地址
}

128
blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsBalanceOrderInfoEntity.java

@ -0,0 +1,128 @@
package com.logpm.statistics.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.math.BigDecimal;
import java.util.Date;
@Data
@TableName("logpm_statistics_balance_order_info")
@ApiModel(value = "StatisticsBalanceOrderInfo对象", description = "结算单表")
@EqualsAndHashCode(callSuper = true)
public class StatisticsBalanceOrderInfoEntity extends TenantEntity {
/**
* 预留1
*/
@ApiModelProperty(value = "预留1")
private String reserve1;
/**
* 预留2
*/
@ApiModelProperty(value = "预留2")
private String reserve2;
/**
* 预留3
*/
@ApiModelProperty(value = "预留3")
private String reserve3;
/**
* 预留4
*/
@ApiModelProperty(value = "预留4")
private String reserve4;
/**
* 预留5
*/
@ApiModelProperty(value = "预留5")
private String reserve5;
private String balanceOrderNo;//结算单号
private String brand;//品牌
private String waybillNo;//运单号
private String orderCode;//订单号
private String typeService;//服务类型
private String productGoods;//货物品类
private String productTypeNum;//品类数
private Integer totalCount;//总数量
private BigDecimal totalWeight;//总重量
private BigDecimal totalVolume;//总体积
private String shipper;//发货单位
private String shipperPerson;//发货人
private String shipperMobile;//发货电话
private String shipperAddress;//发货地址
private String consignee;//收货单位
private String consigneePerson;//收货人
private String consigneeMobile;//收货电话
private String consigneeAddress;//收货地址
private String departure;//发站
private String destination;//到站
private String departureWarehouseName;//发站仓
private String destinationWarehouseName;//目的仓
private String payType;//支付类型
private String payWay;//支付方式
private Integer isAftersale;//是否有售后
private BigDecimal aftersalesFee;//售后金额
private BigDecimal totalBalanceFee;//结算总金额
private BigDecimal totalFee;
private BigDecimal openFee;
private BigDecimal pickupFee;//提货费
private BigDecimal freightFee;//运费
private BigDecimal warehouseServiceFee;//仓库服务费
private BigDecimal warehouseFee;//仓储费
private BigDecimal warehouseManageFee;//仓储管理费
private BigDecimal warehouseSortingFee;//仓储分拣费
private BigDecimal warehouseOperatingFee;//仓储操作费
private BigDecimal deliveryServiceFee;//配送服务费
private BigDecimal deliveryFee;//配送费
private BigDecimal deliveryLoadingFee;//配送装卸费
private BigDecimal deliverySortingFee;//配送分拣费
private BigDecimal deliveryUpfloorFee;//配送上楼费
private BigDecimal deliveryMoveFee;//配送平移费
private BigDecimal deliveryCrossingFee;//超区费
private BigDecimal installFee;//安装费
private BigDecimal quotationFee;//保价费
private BigDecimal claimingValue;//申明价值
private BigDecimal otherFee;//其他费
private BigDecimal returnFee;//回扣
private BigDecimal thirdOprationFee;//三方操作费
private BigDecimal xPay;//现付
private BigDecimal dPay;//到付
private BigDecimal hPay;//回付
private BigDecimal yPay;//月结
private Integer balanceStatus;//0未结算 1部分结算 2已结算
private BigDecimal hasBalanceFee;//已结算金额
private BigDecimal noBalanceFee;//未结算金额
private Date balanceTime;//结算时间
private String balanceUserName;//结算人
private String balanceRemark;//结算备注
private Integer abnormalBalanceStatus;//是否有异常结算
private BigDecimal abnormalBalanceFee;//异常金额
private Date abnormalTime;//异常时间
private String abnormalUserName;//异常确认人
private String abnormalRemark;//异常备注
}

51
blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsBalanceRecordEntity.java

@ -0,0 +1,51 @@
package com.logpm.statistics.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.math.BigDecimal;
@Data
@TableName("logpm_statistics_balance_record")
@ApiModel(value = "StatisticsBalanceRecord对象", description = "结算记录表")
@EqualsAndHashCode(callSuper = true)
public class StatisticsBalanceRecordEntity extends TenantEntity {
/**
* 预留1
*/
@ApiModelProperty(value = "预留1")
private String reserve1;
/**
* 预留2
*/
@ApiModelProperty(value = "预留2")
private String reserve2;
/**
* 预留3
*/
@ApiModelProperty(value = "预留3")
private String reserve3;
/**
* 预留4
*/
@ApiModelProperty(value = "预留4")
private String reserve4;
/**
* 预留5
*/
@ApiModelProperty(value = "预留5")
private String reserve5;
private Long balanceOrderInfoId;//结算单id
private BigDecimal balanceFee;//异常金额
private String balanceRemark;//异常备注
private String balanceUserName;//异常操作人
}

46
blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsBalanceRecordPhotoEntity.java

@ -0,0 +1,46 @@
package com.logpm.statistics.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
@Data
@TableName("logpm_statistics_balance_record_photo")
@ApiModel(value = "StatisticsBalanceRecordPhoto对象", description = "结算记录图片表")
@EqualsAndHashCode(callSuper = true)
public class StatisticsBalanceRecordPhotoEntity extends TenantEntity {
/**
* 预留1
*/
@ApiModelProperty(value = "预留1")
private String reserve1;
/**
* 预留2
*/
@ApiModelProperty(value = "预留2")
private String reserve2;
/**
* 预留3
*/
@ApiModelProperty(value = "预留3")
private String reserve3;
/**
* 预留4
*/
@ApiModelProperty(value = "预留4")
private String reserve4;
/**
* 预留5
*/
@ApiModelProperty(value = "预留5")
private String reserve5;
private Long recordId; //异常记录id
private String url;//图片地址
}

47
blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsChangesPhotoEntity.java

@ -0,0 +1,47 @@
package com.logpm.statistics.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
@Data
@TableName("logpm_statistics_changes_photo")
@ApiModel(value = "StatisticsChanges对象", description = "订单异动照片表")
@EqualsAndHashCode(callSuper = true)
public class StatisticsChangesPhotoEntity extends TenantEntity {
/**
* 预留1
*/
@ApiModelProperty(value = "预留1")
private String reserve1;
/**
* 预留2
*/
@ApiModelProperty(value = "预留2")
private String reserve2;
/**
* 预留3
*/
@ApiModelProperty(value = "预留3")
private String reserve3;
/**
* 预留4
*/
@ApiModelProperty(value = "预留4")
private String reserve4;
/**
* 预留5
*/
@ApiModelProperty(value = "预留5")
private String reserve5;
private Long changesRecordId;
private String url;
private String createUserName;
}

83
blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsChangesRecordEntity.java

@ -0,0 +1,83 @@
package com.logpm.statistics.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.math.BigDecimal;
import java.util.Date;
@Data
@TableName("logpm_statistics_changes_record")
@ApiModel(value = "StatisticsChangesRecord对象", description = "订单异动记录")
@EqualsAndHashCode(callSuper = true)
public class StatisticsChangesRecordEntity extends TenantEntity {
/**
* 预留1
*/
@ApiModelProperty(value = "预留1")
private String reserve1;
/**
* 预留2
*/
@ApiModelProperty(value = "预留2")
private String reserve2;
/**
* 预留3
*/
@ApiModelProperty(value = "预留3")
private String reserve3;
/**
* 预留4
*/
@ApiModelProperty(value = "预留4")
private String reserve4;
/**
* 预留5
*/
@ApiModelProperty(value = "预留5")
private String reserve5;
private Long orderInfoId;//订单id
private String orderCode;//订单号
private BigDecimal pickupFee;//提货费
private BigDecimal freightFee;//干线费
private BigDecimal warehouseFee;//仓储费
private BigDecimal warehouseManageFee;//仓储管理费
private BigDecimal warehouseSortingFee;//仓储分拣费
private BigDecimal warehouseOperatingFee;//仓储操作费
private BigDecimal deliveryFee;//配送费
private BigDecimal deliveryLoadingFee;//配送装卸费
private BigDecimal deliverySortingFee;//配送分拣费
private BigDecimal deliveryUpfloorFee;//配送上楼费
private BigDecimal deliveryMoveFee;//配送平移费
private BigDecimal installFee;//安装费
private BigDecimal quotationFee;//保价费
private BigDecimal claimingValue;//申明价值
private BigDecimal otherFee;//其他费用
private BigDecimal returnFee;//回扣
private BigDecimal thirdOprationFee;//三方操作费
private Date changesTime;//异动时间
private String changesUserName;//异动人
private Long statisticsWarehouseId;
private String statisticsWarehouseName;
private String remark;
private String itemRecord;
private BigDecimal totalFee;
}

3
blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsDistributionPackageEntity.java

@ -8,6 +8,7 @@ import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.math.BigDecimal;
import java.util.Date;
@Data
@TableName("logpm_statistics_distribution_package")
@ -128,5 +129,5 @@ public class StatisticsDistributionPackageEntity extends TenantEntity {
private Long orderInfoId;
private Integer isSign;//是否签收 0否 1是
private Date signTime; //签收时间
}

10
blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsOrderInfoEntity.java

@ -7,6 +7,9 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.math.BigDecimal;
import java.util.Date;
@Data
@TableName("logpm_statistics_order_info")
@ApiModel(value = "StatisticsOrderInfo对象", description = "结算订单明细表")
@ -47,8 +50,13 @@ public class StatisticsOrderInfoEntity extends TenantEntity {
private Integer signStatus;// 签收状态 0未签收 1部分签收 2已签收
private Integer confirmStatisticsOrder;//0未确认 1已确认
private String confirmStatisticsUserName;//对账确认人
private Date confirmStatisticsTime;//对账确认时间
private Long waybillInfoId;//运单维度id
private Long statisticsOrderId;//结算单id
private Long balanceOrderId;//结算单id
private String balanceOrderNo;//结算单号
private BigDecimal changesFee;//异动金额
}

13
blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/StatisticsBalanceAbnormalVO.java

@ -0,0 +1,13 @@
package com.logpm.statistics.vo;
import com.logpm.statistics.entity.StatisticsBalanceAbnormalEntity;
import com.logpm.statistics.entity.StatisticsBalanceAbnormalPhotoEntity;
import lombok.Data;
import java.util.List;
@Data
public class StatisticsBalanceAbnormalVO extends StatisticsBalanceAbnormalEntity {
private List<StatisticsBalanceAbnormalPhotoEntity> abnormalPhotoEntityList;
}

8
blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/StatisticsBalanceOrderInfoVO.java

@ -0,0 +1,8 @@
package com.logpm.statistics.vo;
import com.logpm.statistics.entity.StatisticsBalanceOrderInfoEntity;
import lombok.Data;
@Data
public class StatisticsBalanceOrderInfoVO extends StatisticsBalanceOrderInfoEntity {
}

14
blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/StatisticsBalanceRecordVO.java

@ -0,0 +1,14 @@
package com.logpm.statistics.vo;
import com.logpm.statistics.entity.StatisticsBalanceRecordEntity;
import com.logpm.statistics.entity.StatisticsBalanceRecordPhotoEntity;
import lombok.Data;
import java.util.List;
@Data
public class StatisticsBalanceRecordVO extends StatisticsBalanceRecordEntity {
private List<StatisticsBalanceRecordPhotoEntity> recordPhotoEntityList;
}

15
blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/StatisticsChangesRecordVO.java

@ -0,0 +1,15 @@
package com.logpm.statistics.vo;
import com.logpm.statistics.entity.StatisticsChangesPhotoEntity;
import com.logpm.statistics.entity.StatisticsChangesRecordEntity;
import lombok.Data;
import java.util.List;
@Data
public class StatisticsChangesRecordVO extends StatisticsChangesRecordEntity {
private List<StatisticsChangesPhotoEntity> changesPhotoEntityList;
}

138
blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/StatisticsOrderInfoVO.java

@ -0,0 +1,138 @@
package com.logpm.statistics.vo;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class StatisticsOrderInfoVO implements Serializable {
private Long orderInfoId;
private String brand;//品牌
private String waybillNo;//运单号
private String orderNo;//订单号
private String typeService;//商家服务类型
private String shipper;//发货单位
private String shipperPerson;//发货人
private String shipperMobile;//发货电话
private String shipperAddress;//发货地址
private String consignee;//收货单位
private String consigneePerson;//收货人
private String consigneeMobile;//收货电话
private String consigneeAddress;//收货地址
private String waybillStatus;//运单状态
private Integer signStatus;//订单签收状态
private Integer isCheck;//运单是否审核
private Date openTime;//开单时间
private String goodsName;//物料品类
private String departure;//发站
private String destination;//到站
private String departureWarehouseName;//发站仓
private String destinationWarehouseName;//目的仓
private String deliveryMethod;//配送方式
private String customerTrain;//客户车次号
private String receiptStatus;//回单状态
private String waybillRemark;//运单备注
private String statisticsFang;
private String payType;//支付类型
private String payWay;//支付方式
private String storeBusiness;
private Integer confirmStatisticsOrder;//0未确认 1已确认
private String confirmStatisticsUserName;//对账确认人
private Date confirmStatisticsTime;//对账确认时间
private Integer isEdit;
private String goodsTypeNum;
private Integer productTypeNum;
private Integer totalcount;//订单数量
private BigDecimal totalWeight;//订单重量
private BigDecimal totalVolume;//订单体积
private BigDecimal totalFee;//总费用
private BigDecimal openFee;//开单费
//干线
private BigDecimal pickupFee;//开单提货费
private BigDecimal realPickupFee;//实际提货费
private BigDecimal freightFee;//开单运费
private BigDecimal realFreightFee;//实际运费
private BigDecimal installFee;//开单安装费
private BigDecimal realInstallFee;//实际安装费
private BigDecimal quotationFee;//保价费
private BigDecimal realQuotationFee;//实际保价费
private BigDecimal claimingValue;//开单申明价值
private BigDecimal realClaimingValue;//实际申明价值
private BigDecimal otherFee;//开单其他费
private BigDecimal realOtherFee;//实际其他费
private BigDecimal returnFee;//开单回扣
private BigDecimal realReturnFee;//实际回扣
private BigDecimal thirdOprationFee;//开单三方操作费
private BigDecimal realThirdOprationFee;//实际三方操作费
private BigDecimal xPay;//开单现付
private BigDecimal realXPay;//实际现付
private BigDecimal dPay;//开单到付
private BigDecimal realDPay;//实际到付
private BigDecimal hPay;//开单回付
private BigDecimal realHPay;//实际回付
private BigDecimal yPay;//开单月结
private BigDecimal realYPay;//实际月结
private Date incomingTime;//入库时间
private Date outingTime;//出库时间
private String warehouseFeeInterval;
private BigDecimal warehouseServiceFee;//开单仓库服务费
private BigDecimal realWarehouseServiceFee;//实际仓库服务费
private BigDecimal warehouseFee;//开单仓储费
private BigDecimal realWarehouseFee;//实际仓储费
private BigDecimal warehouseManageFee;//开单仓储管理费
private BigDecimal realWarehouseManageFee;//实际仓储管理费
private BigDecimal warehouseSortingFee;//开单仓储分拣费
private BigDecimal realWarehouseSortingFee;//实际仓储分拣费
private BigDecimal warehouseOperatingFee;//开单仓储操作费
private BigDecimal realWarehouseOperatingFee;//实际仓储操作费
//配送
private BigDecimal deliveryServiceFee;//开单配送服务费
private BigDecimal realDeliveryServiceFee;//实际配送服务费
private BigDecimal deliveryFee;//开单配送费
private BigDecimal realDeliveryFee;//实际配送费
private BigDecimal deliveryLoadingFee;//配送装卸费
private BigDecimal realDeliveryLoadingFee;//实际配送装卸费
private BigDecimal deliverySortingFee;//配送分拣费
private BigDecimal realDeliverySortingFee;//实际配送分拣费
private BigDecimal deliveryUpfloorFee;//开单配送上楼费
private BigDecimal realDeliveryUpfloorFee;//实际配送上楼费
private BigDecimal deliveryMoveFee;//开单配送平移费
private BigDecimal realDeliveryMoveFee;//实际平移费
private BigDecimal deliveryDistance;//开单配送公里数
private BigDecimal realDeliveryDistance;//实际配送公里数
private BigDecimal deliveryCrossingFee;//开单超区费
private BigDecimal realDeliveryCrossingFee;//实际超区费
// private String isAftersales;
// private BigDecimal aftersalesFee;
private BigDecimal totalStatementFee;//对账总金额
private String statementStatus;
private BigDecimal hasStatementFee;
private String statementCreateUser;
private Integer isChanges;//是否异动0否 1是
private BigDecimal changesFee;//异动金额
private String changesItems;//异动条目
private String changesRemark;//异动备注
private Date changesTime;//最晚一条
private Integer signNum;
private Date signTime;//最晚一条
private String statisticsStatus;//结算状态
private BigDecimal totalStatisticsFee;//结算总金额
private BigDecimal hasStatisticsFee;//已结算金额
private Integer isAbnormalStatistics;//是否异常结算 0否 1是
private BigDecimal abnormalFee;//异常金额
}

41
blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/StatisticsWaybillInfoVO.java

@ -10,7 +10,9 @@ import java.util.Date;
public class StatisticsWaybillInfoVO extends StatisticsWaybillInfoEntity {
private String brand;
private String waybillNo;
private String orderNo;
private String typeService;
private String shipper;
private String shipperPerson;
private String shipperMobile;
@ -30,22 +32,6 @@ public class StatisticsWaybillInfoVO extends StatisticsWaybillInfoEntity {
private String statisticsFang;
private String payType;
private String payWay;
private String isAftersales;
private BigDecimal aftersalesFee;
private BigDecimal totalStatementFee;
private String statementStatus;
private BigDecimal hasStatementFee;
private String statementCreateUser;
private Integer isChanges;
private BigDecimal changesFee;
private String changesItems;
private String changesRemark;
private String changesTime;//最晚一条
private Integer signNum;
private Date signTime;//最晚一条
private String statisticsStatus;//结算状态
// private String statisticsStatus;//结算状态
private String storeBusiness;
private String waybillStatus;
private Integer isEdit;
@ -57,6 +43,9 @@ public class StatisticsWaybillInfoVO extends StatisticsWaybillInfoEntity {
private Integer totalcount;
private BigDecimal totalWeight;
private BigDecimal totalVolume;
private BigDecimal totalFee;
private BigDecimal openFee;
private BigDecimal pickupFee;
@ -114,4 +103,24 @@ public class StatisticsWaybillInfoVO extends StatisticsWaybillInfoEntity {
private BigDecimal realDeliveryCrossingFee;
private String isAftersales;
private BigDecimal aftersalesFee;
private BigDecimal totalStatementFee;
private String statementStatus;
private BigDecimal hasStatementFee;
private String statementCreateUser;
private Integer isChanges;
private BigDecimal changesFee;
private String changesItems;
private String changesRemark;
private String changesTime;//最晚一条
private Integer signNum;
private Date signTime;//最晚一条
private String statisticsStatus;//结算状态
private BigDecimal totalStatisticsFee;//结算总金额
private BigDecimal hasStatisticsFee;//已结算金额
private Integer isAbnormalStatistics;//是否异常结算 0否 1是
private BigDecimal abnormalFee;//异常金额
}

2
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/LoadCarsDTO.java

@ -23,6 +23,8 @@ public class LoadCarsDTO implements Serializable {
private Integer type;
private String startDate;
private String endDate;
private Date startTime;
private Date endTime;
private Integer pageNum;
private Integer pageSize;

3
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineAdvanceDetailEntity.java

@ -8,6 +8,7 @@ import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.math.BigDecimal;
import java.util.Date;
@Data
@TableName("logpm_trunkline_advance_detail")
@ -198,5 +199,7 @@ public class TrunklineAdvanceDetailEntity extends TenantEntity {
private String carNumber;
@ApiModelProperty(name = "货主")
private String goodsMan;
@ApiModelProperty(name = "入库时间")
private Date incomingTime;
}

3
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineCarsLoadScanEntity.java

@ -109,6 +109,9 @@ public class TrunklineCarsLoadScanEntity extends TenantEntity {
@ApiModelProperty(name = "是否补录 0否 1是",notes = "")
private Integer isSupple ;
@ApiModelProperty(name = "签收人名称",notes = "")
private String signUserName;
/** 签收时间 */
@ApiModelProperty(name = "签收时间",notes = "")
private Date signTime;

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

@ -0,0 +1,21 @@
package com.logpm.trunkline.feign;
import com.alibaba.fastjson.JSONObject;
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.RequestParam;
import java.util.List;
@FeignClient(
value = ModuleNameConstant.APPLICATION_TRUNKLINE_NAME
)
public interface ITrunklinePackageTrackLogClient {
String API_PREFIX = "trunklinePackageTrackLog/client";
@PostMapping(API_PREFIX+"/addBatchPackageTrackLog")
void addPackageTrackLog(@RequestParam List<JSONObject> addPackageTrackLogList, @RequestParam List<String> orderPackageCodes, @RequestParam Integer workNode);
}

1
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/OpenOrderVO.java

@ -55,6 +55,7 @@ public class OpenOrderVO implements Serializable {
private List<DictBiz> transportTypeList;//运输方式
private String defaultPayWay;
private String defaultDeliveryWay;//默认送货方式
private String openOrderDate;//开单时间
private String openOrderUserName;//开单人

4
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/SignOrderDetailVO.java

@ -3,6 +3,7 @@ package com.logpm.trunkline.vo;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class SignOrderDetailVO implements Serializable {
@ -21,6 +22,9 @@ public class SignOrderDetailVO implements Serializable {
private Integer type;
private Integer num;
private Integer unloadNum;
private String signUserName;
private Date signTime;
private Date unloadTime;
private String remark;
private Long signOrderId;

4
blade-service-api/logpm-warehouse-api/pom.xml

@ -14,6 +14,10 @@
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-starter-excel</artifactId>
</dependency>
</dependencies>
<parent>

191
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/ExportWarehouseWaybillVO.java

@ -0,0 +1,191 @@
package com.logpm.warehouse.vo;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class ExportWarehouseWaybillVO implements Serializable {
@ExcelProperty(value = "运单号")
private String waybillNo;
@ExcelProperty(value = "订单号")
private String orderNo;
@ExcelProperty(value = "发站仓")
private String departureWarehouseName;
@ExcelProperty(value = "目的仓")
private String destinationWarehouseName;
@ExcelProperty(value = "客户车次")
private String customerTrain;
@ExcelProperty(value = "品牌")
private String brand;
@ExcelProperty(value = "发货单位")
private String shipper;
@ExcelProperty(value = "发货人")
private String shipperName;
@ExcelProperty(value = "发货方手机号")
private String shipperMobile;
@ExcelProperty(value = "发货方地址")
private String shipperAddress;
@ExcelProperty(value = "收货单位")
private String consignee;
@ExcelProperty(value = "收货人")
private String consigneeName;
@ExcelProperty(value = "收货方手机号")
private String consigneeMobile;
@ExcelProperty(value = "收货方地址")
private String consigneeAddress;
@ExcelProperty(value = "到站")
private String destination;
@ExcelProperty(value = "货物名称")
private String goodsName;
@ExcelProperty(value = "按件分摊")
private BigDecimal costPiece;
@ExcelProperty(value = "按比列分摊")
private BigDecimal costZhang;
@ExcelProperty(value = "成本分摊件数")
private Integer costNum;
@ExcelProperty(value = "总件数")
private Integer totalCount;
@ExcelProperty(value = "总重量")
private BigDecimal totalWeight;
@ExcelProperty(value = "总体积")
private BigDecimal totalVolume;
@ExcelProperty(value = "运费")
private BigDecimal totalFreight;
@ExcelProperty(value = "送货费")
private BigDecimal deliveryFee;
@ExcelProperty(value = "提货费")
private BigDecimal pickupFee;
@ExcelProperty(value = "仓库管理费")
private BigDecimal warehouseManagementFee;
@ExcelProperty(value = "仓储费")
private BigDecimal storageFee;
@ExcelProperty(value = "装卸费")
private BigDecimal handlingFee;
@ExcelProperty(value = "安装费")
private BigDecimal installFee;
@ExcelProperty(value = "回扣")
private BigDecimal rebate;
@ExcelProperty(value = "支付方式")
private String payType;
@ExcelProperty(value = "付款方式")
private String payWay;
@ExcelProperty(value = "现付")
private BigDecimal xPay;
@ExcelProperty(value = "到付")
private BigDecimal dPay;
@ExcelProperty(value = "回付")
private BigDecimal hPay;
@ExcelProperty(value = "月结")
private BigDecimal yPay;
@ExcelProperty(value = "三方操作费")
private BigDecimal thirdOperationFee;
@ExcelProperty(value = "送货方式")
private String deliveryWay;
@ExcelProperty(value = "紧急度")
private String urgency;
@ExcelProperty(value = "回单数")
private Integer receiptNum;
@ExcelProperty(value = "运输方式")
private String transportType;
@ExcelProperty(value = "经办人")
private String agent;
@ExcelProperty(value = "创建时间")
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
@ExcelProperty(value = "制单时间")
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date documentMakingTime;
@ExcelIgnore
private Integer pickupCompleteOrNot;
@ExcelProperty(value = "提货是否整车")
private String pickupCompleteOrNotStr;
@ExcelIgnore
private Integer trunklineCompleteOrNot;
@ExcelProperty(value = "干线是否整车")
private String trunklineCompleteOrNotStr;
@ExcelProperty(value = "运单状态")
private String waybillStatus;
@ExcelIgnore
private Integer freezeStatus;
@ExcelProperty(value = "是否冻结")
private String freezeStatusStr;
@ExcelProperty(value = "冻结人")
private String freezeUserName;
@ExcelProperty(value = "冻结时间")
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date freezeTime;
@ExcelIgnore
private Integer abolishStatus;
@ExcelProperty(value = "是否作废")
private String abolishStatusStr;
@ExcelProperty(value = "作废人")
private String abolishUserName;
@ExcelProperty(value = "作废时间")
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date abolishTime;
}

10
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java

@ -19,6 +19,7 @@ package com.logpm.aftersales.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.logpm.aftersales.dto.AftersalesWorkOrderDTO;
import com.logpm.aftersales.dto.AftersalesWorkOrderListExcelDTO;
import com.logpm.aftersales.entity.AftersaleSurveyRecordEntity;
import com.logpm.aftersales.entity.AftersalesAppealEntity;
import com.logpm.aftersales.entity.AftersalesSettlementEntity;
@ -719,6 +720,15 @@ public class AftersalesWorkOrderController extends BladeController {
ExcelUtil.export(response, "异常工单数据" + DateUtil.time(), "异常工单数据", list, AftersalesWorkOrderExcel.class);
}
@GetMapping("/exportAftersalesWorkOrderList")
@ApiOperationSupport(order = 9)
@ApiOperation(value = "导出数据", notes = "传入aftersalesWorkOrder")
public void exportAftersalesWorkOrderList(HttpServletResponse response) {
AftersalesWorkOrderListExcelDTO aftersalesWorkOrderListExcelDTO = aftersalesWorkOrderService.exportAftersalesWorkOrderList();
// ExcelUtil.export(response, "异常工单数据" + DateUtil.time(), "异常工单数据", list, AftersalesWorkOrderExcel.class);
}
/**
* 导入 批量修改 钉钉流程号审核人审核日期财务理赔入账日期操作人
*/

4
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/dto/AftersalesAppealDTO.java

@ -61,6 +61,10 @@ public class AftersalesAppealDTO extends AftersalesAppealEntity {
* 标识 1 仓库 2 总部客服
*/
private String identifying;
/**
* 标识 1 仓库 2 总部客服
*/
private Long createUserId;
}

43
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/dto/AftersalesWorkOrderListExcelDTO.java

@ -0,0 +1,43 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.aftersales.dto;
import com.logpm.aftersales.entity.*;
import com.logpm.aftersales.excel.AftersalesWorkOrderExcel;
import com.logpm.aftersales.vo.AftersalesAbnormalPackageVO;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.List;
/**
* 客服异常工单 数据传输对象实体类
*
* @author BladeX
* @since 2023-11-17
*/
@Data
public class AftersalesWorkOrderListExcelDTO implements Serializable {
private static final long serialVersionUID = 1L;
private List<AftersalesWorkOrderExcel> aftersalesWorkOrderExcels;
}

4
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesAppealMapper.xml

@ -57,7 +57,9 @@
LEFT JOIN logpm_aftersales_completion_record lacr on laa.work_order_id = lacr.work_order_id
LEFT JOIN logpm_aftersales_work_order lawo ON lawo.id = lacr.work_order_id
<where> laa.is_deleted = 0
<if test="param.warehouseId != null and param.warehouseId != '' "> and lacr.warehouse_id = #{param.warehouseId } </if>
<if test="param.warehouseId != null and param.warehouseId != '' ">
and (lacr.warehouse_id = #{param.warehouseId } or laa.create_user = #{param.createUserId})
</if>
<if test="param.appealPeopleName != null and param.appealPeopleName != ''">and laa.appeal_people_name = #{param.appealPeopleName}</if>
<if test="param.claimant != null and param.claimant != ''">and laa.claimant = #{param.claimant}</if>
<if test="param.workOrderNumber != null and param.workOrderNumber != ''">and lawo.work_order_number = #{param.workOrderNumber}</if>

7
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.java

@ -101,4 +101,11 @@ public interface AftersalesWorkOrderMapper extends BaseMapper<AftersalesWorkOrde
@Param("workOrderType")int workOrderType, @Param("discoveryNode")int discoveryNode);
IPage<AftersalesSettlementEntity> getListSettlementNew(IPage<Object> page,@Param("param") AftersalesSettlementEntity aftersalesSettlementEntity);
List<AftersalesWorkOrderExcel> selectAllAftersalesWorkOrderList(@Param("warehouseIds")List<Long> warehouseListIds);
List<AftersalesWorkOrderExcel> selectWaitAftersalesWorkOrderList(@Param("warehouseIds")List<Long> warehouseListIds);
}

119
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml

@ -52,6 +52,9 @@
</resultMap>
<!--查询完整的异常工单信息-->
<select id="pageListOwn" resultType="com.logpm.aftersales.entity.AftersalesWorkOrderEntity">
SELECT DISTINCT
lawo.id,
lawo.work_order_type,
@ -60,8 +63,8 @@
laap.waybill_number,
lawo.order_code,
lawo.train_number,
GROUP_CONCAT(laap.`first` separator ',') as `first`,
GROUP_CONCAT(laap.secondary separator ',') as secondary,
GROUP_CONCAT(DISTINCT laap.`first` separator ',') as `first`,
GROUP_CONCAT(DISTINCT laap.secondary separator ',') as secondary,
group_concat( DISTINCT laap.brand_name SEPARATOR ',' ) AS brandName,
lawo.vehicle_route,
lawo.deliver_goods_time,
@ -492,6 +495,118 @@
</where>
</select>
<select id="selectAllAftersalesWorkOrderList"
resultType="com.logpm.aftersales.excel.AftersalesWorkOrderExcel">
SELECT DISTINCT
lawo.id,
lawo.work_order_type,
lawo.discovery_node,
lawo.work_order_number,
lawo.order_code,
lawo.train_number,
GROUP_CONCAT(DISTINCT laap.waybill_number separator ',') as waybillNumber,
GROUP_CONCAT(DISTINCT laap.`first` separator ',') as `first`,
GROUP_CONCAT(DISTINCT laap.secondary separator ',') as secondary,
group_concat( DISTINCT laap.brand_name SEPARATOR ',' ) AS brandName,
lawo.vehicle_route,
lawo.deliver_goods_time,
lawo.discovery_time,
lawo.warehousing_time,
lawo.waybill_mall,
lawo.remarks,
lawo.delivery_time,
lawo.delivery_driver,
lawo.work_order_status,
lawo.problem_description,
lawo.responsible_person,
lawo.processed_by,
lawo.create_time,
lawo.over_time,
lawo.reviewed_by,
lawo.audit_time,
lawo.entry_time,
lawo.operator,
lawo.person_responsible,
lawo.process_number,
lawo.customer_service_name customerServiceName,
lawo.warehouse_id warehouseId,
lawo.customer_service_id customerServiceId
FROM
logpm_aftersales_work_order lawo
LEFT JOIN logpm_aftersales_processor lap ON lawo.id = lap.work_order_id
AND lap.types_of = '2'
AND lap.conditions IN ( 1, 2 )
LEFT JOIN logpm_aftersales_completion_record lacr ON lacr.work_order_id = lawo.id
AND lacr.is_deleted = '0'
left join logpm_aftersales_abnormal_package laap on lawo.id = laap.work_order_id
<where>
<if test="warehouseIds != null">
lawo.warehouse_id in
<foreach collection="warehouseIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
group by lawo.id
ORDER BY lawo.create_time DESC
</select>
<select id="selectWaitAftersalesWorkOrderList"
resultType="com.logpm.aftersales.excel.AftersalesWorkOrderExcel">
SELECT DISTINCT
law.id,
law.work_order_type,
law.initiation_identification,
law.discovery_node,
law.work_order_number,
law.waybill_number,
law.order_code,
law.train_number,
GROUP_CONCAT(DISTINCT laap.waybill_number separator ',') as waybillNumber,
GROUP_CONCAT(DISTINCT laap.`first` separator ',') as `first`,
GROUP_CONCAT(DISTINCT laap.secondary separator ',') as secondary,
group_concat( DISTINCT laap.brand_name SEPARATOR ',' ) AS brandName,
law.FIRST,
law.secondary,
law.vehicle_route,
law.deliver_goods_time,
law.discovery_time,
law.warehousing_time,
law.waybill_mall,
law.remarks,
law.delivery_time,
law.delivery_driver,
law.work_order_status,
law.customer_service_id,
law.customer_service_name,
law.waybill_mall_id,
law.over_time,
law.problem_description,
law.warehouse_id,
law.person_responsible,
law.process_number,
law.reviewed_by,
law.audit_time,
law.entry_time,
law.operator,
law.brand_name
FROM
logpm_aftersales_processor lap
LEFT JOIN logpm_aftersales_work_order law ON lap.work_order_id = law.id
LEFT JOIN logpm_aftersales_completion_record lacr ON lacr.work_order_id = law.id
AND lacr.is_deleted = '0'
left join logpm_aftersales_abnormal_package laap on law.id = laap.work_order_id
<where>
lap.conditions != '3' and lap.is_deleted = 0 and law.id is not null and lap.processing_status in ('1','3') and lap.types_of = '2'
<if test="warehouseIds != null">
AND law.warehouse_id in
<foreach collection="warehouseIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
group by lawo.id
ORDER BY lawo.create_time DESC
</select>
<update id="updateFinanceTime">

5
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/IAftersalesWorkOrderService.java

@ -18,6 +18,7 @@ package com.logpm.aftersales.service;
import com.logpm.aftersales.dto.AftersalesPackageScanDTO;
import com.logpm.aftersales.dto.AftersalesWorkOrderDTO;
import com.logpm.aftersales.dto.AftersalesWorkOrderListExcelDTO;
import com.logpm.aftersales.entity.AftersalesAppealEntity;
import com.logpm.aftersales.entity.AftersalesSettlementEntity;
import com.logpm.aftersales.entity.AftersalesWorkOrderEntity;
@ -295,4 +296,8 @@ public interface IAftersalesWorkOrderService extends BaseService<AftersalesWorkO
* @param packageFinish
*/
void updateWorkOrderPackagFinish(Long warehouseId, String orderPackageCode, Integer packageFinish);
AftersalesWorkOrderListExcelDTO exportAftersalesWorkOrderList();
}

2
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesAppealServiceImpl.java

@ -163,7 +163,9 @@ public class AftersalesAppealServiceImpl extends BaseServiceImpl<AftersalesAppea
if(ObjectUtils.isNotNull(myCurrentWarehouse)){
aftersalesAppeal.put("warehouse_id",myCurrentWarehouse.getId());
}
Long userId = AuthUtil.getUserId();
AftersalesAppealDTO aftersalesAppealDTO = JSONObject.parseObject(JSONObject.toJSONString(aftersalesAppeal), AftersalesAppealDTO.class);
aftersalesAppealDTO.setCreateUserId(userId);
IPage<AftersalesAppealVO> iPage = baseMapper.getListAppeal(page,aftersalesAppealDTO);
iPage.getRecords().forEach( i ->{
i.setWorkOrderTypeName(DictBizCache.getValue(DictBizConstant.PC_WORK_ORDER,i.getWorkOrderType()));

26
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java

@ -56,6 +56,7 @@ import org.springblade.system.cache.DictBizCache;
import org.springblade.system.entity.DictBiz;
import org.springblade.system.entity.User;
import org.springblade.system.feign.ISysClient;
import org.springblade.system.feign.IUserClient;
import org.springblade.system.feign.IUserSearchClient;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -101,6 +102,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
private final AftersalesAppealMapper aftersalesAppealService;
private final ISysClient sysClient;
private final IUserClient userClient;
private final AftersalesCustomerMallMapper aftersalesCustomerMallMapper;
private final IUserSearchClient userSearchClient;
@ -328,6 +330,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
aftersalesWorkOrder.setCreateTime(new Date());
aftersalesWorkOrder.setCreateDept(Long.valueOf(user.getDeptId()));
aftersalesWorkOrder.setIsDeleted(0);
aftersalesWorkOrder.setWaybillNumber(aftersalesWorkOrder.getWaybillNumber());
aftersalesWorkOrder.setStatus(1);
if (ObjectUtils.isNull(aftersalesWorkOrder.getWorkOrderNumber())) {
aftersalesWorkOrder.setWorkOrderNumber(getWorkOrderNumber(myCurrentWarehouse.getWarehouseCode(), aftersalesWorkOrder.getWorkOrderType()));
@ -587,6 +590,8 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
String collect = deptNames.getData().stream().collect(Collectors.joining(","));
surveyRecordDTO.setAddDepartment(collect);
}
surveyRecordDTO.setProcessorId(user.getUserId());
surveyRecordDTO.setProcessorName(user.getNickName());
return surveyRecordDTO;
}
@ -1540,12 +1545,13 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
surveyRecordEntity.setProcessingResults(surveyRecordEntity.getContent());
} else {
log.info("客服回复!!!{}", user.getUserName());
surveyRecordEntity.setProcessorId(user.getUserId());
R<String> deptName = sysClient.getDeptName(Long.valueOf(user.getDeptId()));
surveyRecordEntity.setAddDepartment(deptName.getData());
surveyRecordEntity.setProcessingResults(surveyRecordEntity.getContent());
}
//添加回复信息
surveyRecordEntity.setProcessorId(user.getUserId());
surveyRecordEntity.setProcessorName(user.getNickName());
surveyRecordEntity.setDifference("1");
surveyRecordEntity.setTypesOf("1");
surveyRecordEntity.setAddPeople(user.getUserName());
@ -2323,5 +2329,23 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
}
@Override
public AftersalesWorkOrderListExcelDTO exportAftersalesWorkOrderList() {
List<BasicdataWarehouseEntity> warehouseList = warehouseClient.getMyWarehouseList();
List<Long> warehouseListIds = null;
if (!warehouseList.isEmpty()){
warehouseListIds = warehouseList.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList());
}
AftersalesWorkOrderListExcelDTO aftersalesWorkOrderListExcelDTO = new AftersalesWorkOrderListExcelDTO();
List<AftersalesWorkOrderExcel> allAftersalesWorkOrderExcels = baseMapper.selectAllAftersalesWorkOrderList(warehouseListIds);
if (!allAftersalesWorkOrderExcels.isEmpty()) {
aftersalesWorkOrderListExcelDTO.setAftersalesWorkOrderExcels(allAftersalesWorkOrderExcels);
}
List<AftersalesWorkOrderExcel> waitAftersalesWorkOrderExcels = baseMapper.selectWaitAftersalesWorkOrderList(warehouseListIds);
return null;
}
}

40
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataCodeServiceImpl.java

@ -85,12 +85,52 @@ public class BasicdataCodeServiceImpl implements IBasicdataCodeService {
case CodeNumConstant.TRUNKLINE_LOAD_SIGN:
code = generateTrunklineLoadSignCode(type,warehouseCode,orderCode);
break;
case CodeNumConstant.BALANCE_ORDER:
code = generateBalanceOrderCode(type,warehouseCode,orderCode);
break;
default:
log.info("##################getCodeByType: 暂不支持的编码类型 type={}", CodeDesEnum.getMes(type));
}
return code;
}
private String generateBalanceOrderCode(Integer type, String warehouseCode, String orderCode) {
if(!"BALANCE_ORDER".equals(warehouseCode)){
log.warn("#########generateBalanceOrderCode: 仓库编码有误 warehouseCode={}",warehouseCode);
return null;
}
Calendar calendar = Calendar.getInstance();
//获取年份
Integer year = calendar.get(Calendar.YEAR);
// 获取月份(注意月份从0开始计数)
Integer month = calendar.get(Calendar.MONTH) + 1;
BasicdataCodeRecordEntity basicdataCodeRecordEntity = basicdataCodeRecordService.findEntityByCodeTypeAndWarehouseCodeAndYearAndMonth(CodeNumConstant.PACKAGE,warehouseCode,year+"",month+"");
if(Objects.isNull(basicdataCodeRecordEntity)){
basicdataCodeRecordEntity = new BasicdataCodeRecordEntity();
basicdataCodeRecordEntity.setCodeType(CodeNumConstant.PACKAGE);
basicdataCodeRecordEntity.setWarehouseName("全仓");
basicdataCodeRecordEntity.setWarehouseCode(warehouseCode);
basicdataCodeRecordEntity.setYear(year+"");
basicdataCodeRecordEntity.setMonth(month+"");
basicdataCodeRecordEntity.setNum(0);
basicdataCodeRecordService.save(basicdataCodeRecordEntity);
}
Integer oldNum = basicdataCodeRecordEntity.getNum();
oldNum = oldNum + 1;
String packageCode = "JSD" + year + CommonUtil.geFourNumber(month.longValue(),2) + CommonUtil.geFourNumber(oldNum.longValue(),6);
basicdataCodeRecordEntity.setNum(oldNum);
basicdataCodeRecordService.updateById(basicdataCodeRecordEntity);
return packageCode;
}
@Override
public List<String> getBatchPackageCodeByType(String warehouseCode, String orderCode, Integer num) {
if(!StringUtil.hasLength(warehouseCode)){

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml

@ -561,7 +561,7 @@
SELECT DISTINCT
ldr.id id,
ldr.consignee consignee,
COALESCE ( lds.loaded_number + lds.loadedin_number, 0 ) loadingNub,
<!-- COALESCE ( lds.loaded_number + lds.loadedin_number, 0 ) loadingNub,-->
COALESCE ( ldr.reservation_num + ldr.reservation_stock_list_num, 0 ) reservationNum,
(
SELECT COALESCE

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml

@ -810,7 +810,7 @@
<where>
lds.id = #{param.stockupId}
</where>
GROUP BY ldsa.id,ldsa.id,ldbs.bill_lading_id,lds.stockup_status,lds.type_service,ldsi.reservation_id
GROUP BY ldsa.id,ldsa.id,ldbs.bill_lading_id,lds.stockup_status,lds.type_service
</select>

8
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.xml

@ -455,9 +455,6 @@
(select GROUP_CONCAT(DISTINCT ldpl.material_name )
from logpm_distribution_parcel_list ldpl
where ldpl.material_name is not null and ldpl.stock_article_id = ldbs.stock_article_id) materialName,
(select IFNULL(sum(lds.stock_quantity),0)
from logpm_distribution_stock lds
where lds.stock_article = ldbs.stock_article_id ) preparedQuantity ,
(select COALESCE(GROUP_CONCAT(DISTINCT lwtg.tray_code SEPARATOR ','), '')
from logpm_distribution_parcel_list ldpl
LEFT JOIN logpm_warehouse_tray_goods lwtg on lwtg.association_id = ldpl.id and lwtg.association_type = '3'
@ -466,12 +463,13 @@
from logpm_distribution_parcel_list ldpl
LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id = ldpl.id and lwug.association_type = '3'
where ldpl.stock_article_id = ldbs.stock_article_id) goodsAllocation,
ldsa.service_number serviceNumber,ldsa.waybill_number waybillNumber,ldsa.train_number trainNumber,ldsa.send_warehouse_name sendWarehouseName
ldsa.service_number serviceNumber,ldsa.waybill_number waybillNumber,ldsa.train_number trainNumber,ldsa.send_warehouse_name sendWarehouseName,
IFNULL(SUM(lds.stock_quantity),0) AS preparedQuantity
from
logpm_distrilbution_bill_lading AS ldbl
LEFT JOIN logpm_distrilbution_bill_stock ldbs ON ldbs.bill_lading_id = ldbl.id
LEFT JOIN logpm_distribution_stock_article ldsa on ldbs.stock_article_id = ldsa.id
LEFT JOIN logpm_distribution_stock lds on lds.stock_article = ldbs.stock_article_id
LEFT JOIN logpm_distribution_stock lds on lds.stock_article = ldbs.stock_article_id AND ldbl.id = lds.bill_lading_id
WHERE
ldbs.is_deleted = 0 and ldbs.bill_lading_id = #{id} and ldbs.order_status in (1,3)
</select>

112
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java

@ -20,10 +20,59 @@ import com.logpm.distribution.dto.DistributionStockArticleDTO;
import com.logpm.distribution.dto.app.DistrilbutionloadingscanDTO;
import com.logpm.distribution.dto.app.StockupDTO;
import com.logpm.distribution.dto.app.StockupZeroDTO;
import com.logpm.distribution.entity.*;
import com.logpm.distribution.mapper.*;
import com.logpm.distribution.service.*;
import com.logpm.distribution.vo.*;
import com.logpm.distribution.entity.DisStockListDetailEntity;
import com.logpm.distribution.entity.DistributionBillLadingScanEntity;
import com.logpm.distribution.entity.DistributionDeliveryDetailsEntity;
import com.logpm.distribution.entity.DistributionDeliveryListEntity;
import com.logpm.distribution.entity.DistributionLoadscanEntity;
import com.logpm.distribution.entity.DistributionLoadscaninvnEntity;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.entity.DistributionParcelNumberEntity;
import com.logpm.distribution.entity.DistributionReservationEntity;
import com.logpm.distribution.entity.DistributionReservationPackageEntity;
import com.logpm.distribution.entity.DistributionReservationStockarticleEntity;
import com.logpm.distribution.entity.DistributionReservationStocklistEntity;
import com.logpm.distribution.entity.DistributionReservationZeroPackageEntity;
import com.logpm.distribution.entity.DistributionSignforEntity;
import com.logpm.distribution.entity.DistributionStockArticleEntity;
import com.logpm.distribution.entity.DistributionStockEntity;
import com.logpm.distribution.entity.DistributionStockListEntity;
import com.logpm.distribution.entity.DistributionStockupEntity;
import com.logpm.distribution.entity.DistributionStockupInfoEntity;
import com.logpm.distribution.entity.DistrilbutionBillLadingEntity;
import com.logpm.distribution.entity.DistrilbutionBillPackageEntity;
import com.logpm.distribution.entity.DistrilbutionBillStockEntity;
import com.logpm.distribution.mapper.DistributionBillLadingScanMapper;
import com.logpm.distribution.mapper.DistributionDeliveryDetailsMapper;
import com.logpm.distribution.mapper.DistributionDeliveryListMapper;
import com.logpm.distribution.mapper.DistributionLoadscanMapper;
import com.logpm.distribution.mapper.DistributionLoadscaninvnMapper;
import com.logpm.distribution.mapper.DistributionParcelListMapper;
import com.logpm.distribution.mapper.DistributionReservationMapper;
import com.logpm.distribution.mapper.DistributionReservationPackageMapper;
import com.logpm.distribution.mapper.DistributionReservationStockarticleMapper;
import com.logpm.distribution.mapper.DistributionReservationStocklistMapper;
import com.logpm.distribution.mapper.DistributionSignforMapper;
import com.logpm.distribution.mapper.DistributionStockListMapper;
import com.logpm.distribution.mapper.DistributionStockMapper;
import com.logpm.distribution.mapper.DistributionStockupInfoMapper;
import com.logpm.distribution.mapper.DistributionStockupMapper;
import com.logpm.distribution.mapper.DistrilbutionBillLadingMapper;
import com.logpm.distribution.service.IDisStockListDetailService;
import com.logpm.distribution.service.IDistributionAsyncService;
import com.logpm.distribution.service.IDistributionDeliveryDetailsService;
import com.logpm.distribution.service.IDistributionParcelNumberService;
import com.logpm.distribution.service.IDistributionReservationStockarticleService;
import com.logpm.distribution.service.IDistributionReservationStocklistService;
import com.logpm.distribution.service.IDistributionReservationZeroPackageService;
import com.logpm.distribution.service.IDistributionStockArticleService;
import com.logpm.distribution.service.IDistrilbutionBillPackageService;
import com.logpm.distribution.service.IDistrilbutionBillStockService;
import com.logpm.distribution.vo.DistributionParcelNumberVO;
import com.logpm.distribution.vo.DistributionSignPrintVO;
import com.logpm.distribution.vo.DistributionStockPackageVO;
import com.logpm.distribution.vo.DistributionStockupSelfVO;
import com.logpm.distribution.vo.DistrilbutionBillStockVO;
import com.logpm.factory.comfac.dto.OrderStatusDTO;
import com.logpm.factory.mt.dto.MtReceiveContentDTO;
import com.logpm.factory.mt.dto.MtReceiveDTO;
@ -33,12 +82,17 @@ import com.logpm.factory.oupai.feign.IOuPaiFactoryClinet;
import com.logpm.factorydata.enums.BrandEnums;
import com.logpm.factorydata.util.FactoryDataMessageSender;
import com.logpm.factorydata.vo.NodePushMsg;
import com.logpm.factorydata.vo.PushData;
import com.logpm.trunkline.dto.AddWaybillTrackDTO;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
import com.logpm.trunkline.entity.TrunklineWaybillOrderEntity;
import com.logpm.trunkline.entity.TrunklineWaybillPackageEntity;
import com.logpm.trunkline.feign.*;
import com.logpm.trunkline.feign.ITrunklineAdvanceClient;
import com.logpm.trunkline.feign.ITrunklineAdvanceDetailClient;
import com.logpm.trunkline.feign.ITrunklineWaybillOrderClient;
import com.logpm.trunkline.feign.ITrunklineWaybillPackageClient;
import com.logpm.trunkline.feign.ITrunklineWaybillTrackClient;
import com.logpm.trunkline.vo.TrunklineAdvanceDetailVO;
import com.logpm.warehouse.entity.WarehouseWayBillDetail;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
@ -66,7 +120,14 @@ import org.springblade.common.constant.orderpackage.OrderPackageLoadingStatusCon
import org.springblade.common.constant.orderpackage.OrderPackageReservationStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageStockupStatusConstant;
import org.springblade.common.constant.reservation.*;
import org.springblade.common.constant.reservation.ReservationInventoryLoadingStatusConstant;
import org.springblade.common.constant.reservation.ReservationInventorySigningStatusConstant;
import org.springblade.common.constant.reservation.ReservationInventoryStatusConstant;
import org.springblade.common.constant.reservation.ReservationLoadingStatusConstant;
import org.springblade.common.constant.reservation.ReservationOrderStatusConstant;
import org.springblade.common.constant.reservation.ReservationPackageStatusConstant;
import org.springblade.common.constant.reservation.ReservationSigningStatusConstant;
import org.springblade.common.constant.reservation.ReservationStockupStatusConstant;
import org.springblade.common.constant.signing.SignforStatusConstant;
import org.springblade.common.constant.stockup.StockupStatusConstant;
import org.springblade.common.constant.stockup.StockupTypeConstant;
@ -84,7 +145,14 @@ import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Transactional;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
@ -1476,7 +1544,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
@Transactional(rollbackFor = Exception.class)
@LogpmAsync("asyncExecutor")
public void sendReviewFactory(Long signingId, String warehouseName, Long warehouseId) {
String brands = "梦天,欧派,志邦,皮阿诺";//可追加
String brands = "梦天,欧派,志邦,皮阿诺,我乐";//可追加
log.info(">>>>>>>>>>> 签收推送 对象 {}", "signingId:=" + signingId + "warehouseName:=" + warehouseName + "warehouseId:=" + warehouseId);
//查询签收信息
DistributionSignforEntity distributionSignforEntity = distributionSignforMapper.selectById(signingId);
@ -1501,7 +1569,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
//存在订单
List<Long> orderIds = distributionReservationStockarticleEntities.stream().filter(f -> f.getIsZero().equals(IsOrNoConstant.no.getValue())).map(DistributionReservationStockarticleEntity::getStockArticleId).collect(Collectors.toList());
if (ObjectUtils.isNotNull(orderIds) && !orderIds.isEmpty()){
if (ObjectUtils.isNotNull(orderIds) && !orderIds.isEmpty()) {
log.info(">>>brand 进入 orderIds {} ", orderIds);
List<DistributionStockArticleEntity> distributionStockArticleEntities = distributionStockArticleService.listByIds(orderIds);
@ -1623,6 +1691,28 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
}
}
}
if (Func.isNotEmpty(brand.get("我乐"))) {
List<MtReceiveContentDTO> zb = brand.get("我乐");
List<Object> contents = new ArrayList<>();
if (CollUtil.isNotEmpty(zb)) {
for (MtReceiveContentDTO mtReceiveContentDTO : zb) {
PushData pushData = PushData.builder()
.packageCode(mtReceiveContentDTO.getUnitNo())
.orderCode(mtReceiveContentDTO.getOrderCode())
.warehouseName(warehouseName)
.waybillNumber(mtReceiveContentDTO.getWaybillNumber()).build();
contents.add(pushData);
}
}
NodePushMsg msg = new NodePushMsg();
msg.setNode(WorkNodeEnums.CLERK_REVIEW);
msg.setBrand(BrandEnums.OLO);
msg.setOperator(distributionSignforEntity.getDeliveryDriverName());
msg.setOperatorTime(new Date());
msg.setContent(contents);
log.info("推送工厂数据:{}", JSONUtil.toJsonStr(msg));
factoryDataMessageSender.sendNodeDataByBrand(msg);
}
//....工厂
} catch (Exception e) {
@ -1769,7 +1859,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
//统计已装车数量
WarehouseWaybillEntity byWaybillNo = waybillClient.findByWaybillNo(k);
AddWaybillTrackDTO addWaybillTrackDTO = new AddWaybillTrackDTO();
if(ObjectUtils.isNotNull(byWaybillNo)){
if (ObjectUtils.isNotNull(byWaybillNo)) {
addWaybillTrackDTO.setWaybillId(byWaybillNo.getId());
addWaybillTrackDTO.setWaybillNo(byWaybillNo.getWaybillNo());
}
@ -2078,6 +2168,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
mtReceiveContentDTO.setUnitNo(distributionParcelListEntity.getOrderPackageCode());//
mtReceiveContentDTO.setOperateDate(signingTime);//操作时间
mtReceiveContentDTO.setInvoiceOrderCode(deliveryCode);//发货编号
mtReceiveContentDTO.setWaybillNumber(distributionParcelListEntity.getWaybillNumber());
mtReceiveContentDTOS.add(mtReceiveContentDTO);
}
}
@ -2834,7 +2925,6 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
}
return null;
}
@ChangeAsync()
@Override
public void saveOtherDataBaseNew(String tenantId,List<DistributionBusinessPreOrderEntity> dataResult, String mallName) {

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

@ -16,7 +16,9 @@
*/
package com.logpm.distribution.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -47,6 +49,11 @@ import com.logpm.distribution.vo.app.DistributionAppParcelListVO;
import com.logpm.distribution.vo.app.DistributionAppReservationVO;
import com.logpm.distribution.vo.print.PrintPreviewVO;
import com.logpm.distribution.wrapper.*;
import com.logpm.trunkline.feign.ITrunklinePackageTrackLogClient;
import com.logpm.factorydata.enums.BrandEnums;
import com.logpm.factorydata.util.FactoryDataMessageSender;
import com.logpm.factorydata.vo.NodePushMsg;
import com.logpm.factorydata.vo.PushData;
import com.logpm.warehouse.entity.WarehouseTrayGoodsEntity;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.feign.*;
@ -61,6 +68,7 @@ import org.springblade.common.constant.Inventory.InventorySigningStatusConstant;
import org.springblade.common.constant.Inventory.InventoryStockUpStatusConstant;
import org.springblade.common.constant.ModuleNameConstant;
import org.springblade.common.constant.RabbitConstant;
import org.springblade.common.constant.WorkNodeEnums;
import org.springblade.common.constant.common.IsOrNoConstant;
import org.springblade.common.constant.delivery.DeliveryLoadingStatusConstant;
import org.springblade.common.constant.delivery.DeliveryStatusConstant;
@ -232,6 +240,12 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
@Autowired
private IWarehouseUpdownStockUpAreaClient warehouseUpdownStockUpAreaClient;
@Autowired
private ITrunklinePackageTrackLogClient trunklinePackageTrackLogClient;
@Autowired
private FactoryDataMessageSender factoryDataMessageSender;
// private final IWarehouseRetentionScanClient warehouseRetentionScanClient;
// @Lazy
@ -600,6 +614,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
// distributionAsyncService.changeOrderSignforStatus(distrilbutionloadingscanDTO.getBarcode());
List<Long> packageLockIds = new ArrayList<>();
List<JSONObject> jsonObjects = new ArrayList<>();
List<JSONObject> aaa = new ArrayList<>();
List<String> orderPackageCodes = new ArrayList<>();
DistributionDeliverySelfEntity distributionDeliverySelfEntity = new DistributionDeliverySelfEntity();
if ("1".equals(distributionDeliveryListEntity.getKind())) {
@ -614,6 +630,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
DistributionDeliveryTripartiteEntity distributionDeliveryTripartiteEntity = distributionDeliveryTripartiteMapper.selectById(distrilbutionloadingscanDTO.getLoadingId());
BeanUtils.copyProperties(distributionDeliveryTripartiteEntity, distributionDeliverySelfEntity);
}
List<DistributionParcelListEntity> pushList = new ArrayList<>();
if (distrilbutionloadingscanDTO.getType() == 1) {
List<DisStockListDetailEntity> list = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda()
.eq(DisStockListDetailEntity::getStockPackageCode, distrilbutionloadingscanDTO.getBarcode())
@ -724,9 +741,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
//更新签收表的装车数量
Integer j = distributionSignforMapper.updateloadByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub());
//进行解托操作
Map<String,Object> info = new HashMap<>();
info.put("orderPackageCode",parcelListEntity.getOrderPackageCode());
@ -756,8 +771,26 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
.setHeader("x-delay", 3000);
return message;
});
String content = "包件在"+myCurrentWarehouse.getName()+"由"+loadscanEntity.getScanUser()+"扫描装车,配送车次号:"+distributionDeliveryListEntity.getTrainNumber()+"预约任务号:"+reservationEntity.getReservationCode();
JSONObject trunklinePackageTrackLog= new JSONObject();
trunklinePackageTrackLog.put("tenantId",loadscanEntity.getTenantId());
trunklinePackageTrackLog.put("createTime",loadscanEntity.getCreateTime());
trunklinePackageTrackLog.put("createUser",loadscanEntity.getCreateUser());
trunklinePackageTrackLog.put("updateUser",loadscanEntity.getUpdateUser());
trunklinePackageTrackLog.put("updateTime",loadscanEntity.getUpdateTime());
trunklinePackageTrackLog.put("isDeleted",loadscanEntity.getIsDeleted());
trunklinePackageTrackLog.put("status",loadscanEntity.getStatus());
trunklinePackageTrackLog.put("createDept",loadscanEntity.getCreateDept());
trunklinePackageTrackLog.put("orderPackageCode",loadscanEntity.getOrderPackageCode());
trunklinePackageTrackLog.put("warehouseId",loadscanEntity.getWarehouseId()==null?myCurrentWarehouse.getId():loadscanEntity.getWarehouseId());
trunklinePackageTrackLog.put("warehouseId",loadscanEntity.getWarehouseName()==null?myCurrentWarehouse.getName():loadscanEntity.getWarehouseName());
trunklinePackageTrackLog.put("workNode",WorkNodeEnums.DISTRIBUTION_LOADING.getCode());
trunklinePackageTrackLog.put("content",content);
trunklinePackageTrackLog.put("operator",loadscanEntity.getScanUser());
aaa.add(trunklinePackageTrackLog);
orderPackageCodes.add(loadscanEntity.getOrderPackageCode());
pushList.add(parcelListEntity);
//extracteOrderPackageStatus(distrilbutionloadingscanDTO, parcelListEntity, myCurrentWarehouse, reservationEntity);
@ -857,9 +890,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
log.error("#################货物下架错误:{}", distrilbutionloadingscanDTO.getBarcode());
// return Resp.scanFail("装车失败", "装车失败");
}
DistributionReservationEntity reservationEntity = distributionReservationService.getById(distrilbutionloadingscanDTO.getReservationId());
List<DistributionLoadscanEntity> reservationLoadscanEntities = new ArrayList<>();
List<String> orderCodes = new ArrayList<>();
List<String> orderPackageCodes = new ArrayList<>();
for (DistributionParcelListEntity parcelListEntity : parcelListEntities) {
log.info("#########!!!!!!!!!!!!!!!!!--------- 88888888888 parcelListEntities={}", parcelListEntities);
if (parcelListEntity.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())) {
@ -912,6 +945,26 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue());
distributionParcelListService.updateById(parcelListEntity);
packageLockIds.add(loadscanEntity.getPackageId());
String content = "包件在"+myCurrentWarehouse.getName()+"由"+loadscanEntity.getScanUser()+"扫描托盘:"+loadscanEntity.getTrayNo()+"装车,配送车次号:"+distributionDeliveryListEntity.getTrainNumber()+"预约任务号:"+reservationEntity.getReservationCode();
JSONObject trunklinePackageTrackLog= new JSONObject();
trunklinePackageTrackLog.put("tenantId",loadscanEntity.getTenantId());
trunklinePackageTrackLog.put("createTime",loadscanEntity.getCreateTime());
trunklinePackageTrackLog.put("createUser",loadscanEntity.getCreateUser());
trunklinePackageTrackLog.put("updateUser",loadscanEntity.getUpdateUser());
trunklinePackageTrackLog.put("updateTime",loadscanEntity.getUpdateTime());
trunklinePackageTrackLog.put("isDeleted",loadscanEntity.getIsDeleted());
trunklinePackageTrackLog.put("status",loadscanEntity.getStatus());
trunklinePackageTrackLog.put("createDept",loadscanEntity.getCreateDept());
trunklinePackageTrackLog.put("orderPackageCode",loadscanEntity.getOrderPackageCode());
trunklinePackageTrackLog.put("warehouseId",loadscanEntity.getWarehouseId()==null?myCurrentWarehouse.getId():loadscanEntity.getWarehouseId());
trunklinePackageTrackLog.put("warehouseId",loadscanEntity.getWarehouseName()==null?myCurrentWarehouse.getName():loadscanEntity.getWarehouseName());
trunklinePackageTrackLog.put("workNode",WorkNodeEnums.DISTRIBUTION_LOADING.getCode());
trunklinePackageTrackLog.put("content",content);
trunklinePackageTrackLog.put("operator",loadscanEntity.getScanUser());
aaa.add(trunklinePackageTrackLog);
orderPackageCodes.add(loadscanEntity.getOrderPackageCode());
pushList.add(parcelListEntity);
}
}
JSONObject jsonObject = new JSONObject();
@ -955,6 +1008,25 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
return Resp.scanFail("查询托盘货物失败", "查询托盘货物失败");
}
}
if(CollUtil.isNotEmpty(pushList)){
for (DistributionParcelListEntity parcelListEntity : pushList) {
List<Object> contents = new ArrayList<>();
PushData pushData = PushData.builder()
.packageCode(parcelListEntity.getOrderPackageCode())
.orderCode(parcelListEntity.getOrderCode())
.warehouseName(myCurrentWarehouse.getName())
.waybillNumber(parcelListEntity.getWaybillNumber()).build();
contents.add(pushData);
NodePushMsg msg = new NodePushMsg();
msg.setNode(WorkNodeEnums.DISTRIBUTION_LOADING);
msg.setBrand(BrandEnums.getByValue(parcelListEntity.getBrandName()));
msg.setOperator(AuthUtil.getNickName());
msg.setOperatorTime(new Date());
msg.setContent(contents);
log.info("推送工厂数据:{}", JSONUtil.toJsonStr(msg));
factoryDataMessageSender.sendNodeDataByBrand(msg);
}
}
//添加缓存
if (!packageLockIds.isEmpty()){
List<Long> a = bladeRedis.get("warehouseId:" + myCurrentWarehouse.getId() + "trainNumber:" + distributionDeliveryListEntity.getTrainNumber() + "orderPackageCode:");
@ -976,6 +1048,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
warehouseUpdownStockUpAreaClient.downStockUpShelf(jsonObjects);
//查询已装车件数
// String str = getLoadingMsg(distrilbutionloadingscanDTO);
trunklinePackageTrackLogClient.addPackageTrackLog(aaa,orderPackageCodes,WorkNodeEnums.DISTRIBUTION_LOADING.getCode());
Integer carLaodNum = getCarLaodNum(distrilbutionloadingscanDTO.getDeliveryId());
return Resp.scanSuccessWithData("装车成功", carLaodNum + "件", carLaodNum);
@ -5298,6 +5371,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
.eq(DistributionParcelListEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcode())
.eq(DistributionParcelListEntity::getWarehouseId, myCurrentWarehouse.getId())
);
List<String> orderPackageCodes = new ArrayList<>();
List<JSONObject> aaa = new ArrayList<>();
if (Func.isNotEmpty(parcelListEntities) && parcelListEntities.size() == 1) {
DistributionParcelListEntity parcelListEntity = parcelListEntities.get(0);
if (OrderPackageLoadingStatusConstant.yizhuangche.getValue().equals(parcelListEntity.getOrderPackageLoadingStatus())) {
@ -5330,6 +5405,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if (Func.isNotEmpty(loadscanAbnormalEntityList) && loadscanAbnormalEntityList.size() > 1) {
return Resp.scanFail("操作失败", "重复添加");
}
String now = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
BladeUser user = AuthUtil.getUser();
DistributionLoadscanEntity loadscanEntity = new DistributionLoadscanEntity();
@ -5400,6 +5476,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
loadscanEntity.setScanStatus(LoadingStatusConstant.saomiao.getValue());
loadscanEntity.setScanType("1");
loadscanEntity.setOneClick(1);
loadscanEntity.setAbnormalNote("异常装车");
loadscanEntity.setPackageId(parcelListEntity.getId());
loadscanEntity.setOrderPackageCode(parcelListEntity.getOrderPackageCode());
loadscanEntity.setPackageNub(parcelListEntity.getQuantity());
@ -5412,6 +5489,27 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
loadscanEntity.setLoadingId(distrilbutionloadingscanDTO.getLoadingId());
loadscanEntity.setIsAbnormalLoading(2);
distributionLoadscanService.save(loadscanEntity);
orderPackageCodes.add(loadscanEntity.getOrderPackageCode());
String content = "包件在"+myCurrentWarehouse.getName()+"由"+loadscanEntity.getScanUser()+"扫描异常装车,配送车次号:"+deliveryListEntity.getTrainNumber()+"预约任务号:"+reservationEntity.getReservationCode();
JSONObject trunklinePackageTrackLog= new JSONObject();
trunklinePackageTrackLog.put("tenantId",loadscanEntity.getTenantId());
trunklinePackageTrackLog.put("createTime",loadscanEntity.getCreateTime());
trunklinePackageTrackLog.put("createUser",loadscanEntity.getCreateUser());
trunklinePackageTrackLog.put("updateUser",loadscanEntity.getUpdateUser());
trunklinePackageTrackLog.put("updateTime",loadscanEntity.getUpdateTime());
trunklinePackageTrackLog.put("isDeleted",loadscanEntity.getIsDeleted());
trunklinePackageTrackLog.put("status",loadscanEntity.getStatus());
trunklinePackageTrackLog.put("createDept",loadscanEntity.getCreateDept());
trunklinePackageTrackLog.put("orderPackageCode",loadscanEntity.getOrderPackageCode());
trunklinePackageTrackLog.put("warehouseId",loadscanEntity.getWarehouseId()==null?myCurrentWarehouse.getId():loadscanEntity.getWarehouseId());
trunklinePackageTrackLog.put("warehouseId",loadscanEntity.getWarehouseName()==null?myCurrentWarehouse.getName():loadscanEntity.getWarehouseName());
trunklinePackageTrackLog.put("workNode", WorkNodeEnums.DISTRIBUTION_SIGN_FOR.getCode());
trunklinePackageTrackLog.put("content",content);
trunklinePackageTrackLog.put("operator",loadscanEntity.getScanUser());
aaa.add(trunklinePackageTrackLog);
orderPackageCodes.add(loadscanEntity.getOrderPackageCode());
List<JSONObject> jsonObjects = new ArrayList<>();
JSONObject jsonObject = new JSONObject();
jsonObject.put("code",loadscanEntity.getOrderPackageCode());
@ -5445,6 +5543,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
signforEntity.setIsHaveAbnormalPackage(2);
distributionSignforService.updateById(signforEntity);
}
} else {
log.error("#################出现相同的包件信息:{}", parcelListEntities);
return Resp.scanFail("操作失败", "服务器正忙...");
@ -5475,6 +5575,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
}
trunklinePackageTrackLogClient.addPackageTrackLog(aaa,orderPackageCodes,WorkNodeEnums.DISTRIBUTION_ABNORMAL_SIGN_FOR.getCode());
return Resp.scanSuccess("操作成功", "异常" + abnormalTotal + "件");
}

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

@ -49,6 +49,7 @@ import com.logpm.oldproject.dto.SignPushDataUnitDTO;
import com.logpm.oldproject.entity.WarehouseEntity;
import com.logpm.oldproject.feign.IOldSignPushClient;
import com.logpm.oldproject.feign.IWarehouseClient;
import com.logpm.trunkline.feign.ITrunklinePackageTrackLogClient;
import com.logpm.warehouse.feign.IWarehouseUpdownStockUpAreaClient;
import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient;
import lombok.extern.slf4j.Slf4j;
@ -59,6 +60,7 @@ import org.springblade.common.constant.Inventory.InventoryLoadingStatusConstant;
import org.springblade.common.constant.Inventory.InventorySigningStatusConstant;
import org.springblade.common.constant.RabbitConstant;
import org.springblade.common.constant.RedisKeyConstant;
import org.springblade.common.constant.WorkNodeEnums;
import org.springblade.common.constant.billLading.BillLadingStatusConstant;
import org.springblade.common.constant.common.IsOrNoConstant;
import org.springblade.common.constant.delivery.DeliveryLoadingStatusConstant;
@ -230,6 +232,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
@Autowired
private IWarehouseUpdownStockUpAreaClient warehouseUpdownStockUpAreaClient;
@Autowired
private ITrunklinePackageTrackLogClient trunklinePackageTrackLogClient;
@Override
public IPage<DistributionSignforVO> selectDistributionSignforPage(IPage<DistributionSignforVO> page, DistributionSignforVO distributionSignfor) {
@ -2428,6 +2433,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
return Resp.scanFail("此码不是订制品", "此码不是订制品");
}
List<String> orderPackageCodes = new ArrayList<>();
List<JSONObject> aaa = new ArrayList<>();
List<DistributionParcelListEntity> parcelListEntityList = distributionReservationMapper.selectPackageListByReservationId(distrilbutionloadingscanDTO.getReservationId());
//查询该客户是否存在该包件信息
List<DistributionParcelListEntity> collect = parcelListEntityList.stream().filter(p -> p.getOrderPackageCode().equals(distrilbutionloadingscanDTO.getBarcode())).collect(Collectors.toList());
@ -2483,6 +2489,24 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//下架解托
warehouseUpdownTypeClient.downPackageOrDelTray(loadscanEntity.getOrderPackageCode(), myCurrentWarehouse.getId(), "签收下架解托");
//维护订单状态
String content = "包件在"+myCurrentWarehouse.getName()+"由"+loadscanEntity.getScanUser()+"扫描签收,装车方式:扫描装车,配送车次号:"+deliveryListEntity.getTrainNumber()+"预约任务号:"+distributionReservationEntity.getReservationCode();
JSONObject trunklinePackageTrackLog= new JSONObject();
trunklinePackageTrackLog.put("tenantId",loadscanEntity.getTenantId());
trunklinePackageTrackLog.put("createTime",loadscanEntity.getCreateTime());
trunklinePackageTrackLog.put("createUser",loadscanEntity.getCreateUser());
trunklinePackageTrackLog.put("updateUser",loadscanEntity.getUpdateUser());
trunklinePackageTrackLog.put("updateTime",loadscanEntity.getUpdateTime());
trunklinePackageTrackLog.put("isDeleted",loadscanEntity.getIsDeleted());
trunklinePackageTrackLog.put("status",loadscanEntity.getStatus());
trunklinePackageTrackLog.put("createDept",loadscanEntity.getCreateDept());
trunklinePackageTrackLog.put("orderPackageCode",loadscanEntity.getOrderPackageCode());
trunklinePackageTrackLog.put("warehouseId",loadscanEntity.getWarehouseId()==null?myCurrentWarehouse.getId():loadscanEntity.getWarehouseId());
trunklinePackageTrackLog.put("warehouseId",loadscanEntity.getWarehouseName()==null?myCurrentWarehouse.getName():loadscanEntity.getWarehouseName());
trunklinePackageTrackLog.put("workNode", WorkNodeEnums.DISTRIBUTION_SIGN_FOR.getCode());
trunklinePackageTrackLog.put("content",content);
trunklinePackageTrackLog.put("operator",loadscanEntity.getScanUser());
aaa.add(trunklinePackageTrackLog);
orderPackageCodes.add(loadscanEntity.getOrderPackageCode());
} else {
//这里装车的数据需要进行补录
// DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListMapper.selectById(distrilbutionloadingscanDTO.getDeliveryId());
@ -2553,6 +2577,28 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//包件解托下架
warehouseUpdownTypeClient.downPackageOrDelTray(collect.get(0).getOrderPackageCode(), myCurrentWarehouse.getId(), "签收下架解托");
packageLockIds.add(distributionLoadscanEntity.getPackageId());
String content = "包件在"+myCurrentWarehouse.getName()+"由"+loadscanEntity.getScanUser()+"扫描签收,装车方式:补录装车,配送车次号:"+deliveryListEntity.getTrainNumber()+"预约任务号:"+distributionReservationEntity.getReservationCode();
JSONObject trunklinePackageTrackLog= new JSONObject();
trunklinePackageTrackLog.put("tenantId",distributionLoadscanEntity.getTenantId());
trunklinePackageTrackLog.put("createTime",distributionLoadscanEntity.getCreateTime());
trunklinePackageTrackLog.put("createUser",distributionLoadscanEntity.getCreateUser());
trunklinePackageTrackLog.put("updateUser",distributionLoadscanEntity.getUpdateUser());
trunklinePackageTrackLog.put("updateTime",distributionLoadscanEntity.getUpdateTime());
trunklinePackageTrackLog.put("isDeleted",distributionLoadscanEntity.getIsDeleted());
trunklinePackageTrackLog.put("status",distributionLoadscanEntity.getStatus());
trunklinePackageTrackLog.put("createDept",distributionLoadscanEntity.getCreateDept());
trunklinePackageTrackLog.put("orderPackageCode",distributionLoadscanEntity.getOrderPackageCode());
trunklinePackageTrackLog.put("warehouseId",distributionLoadscanEntity.getWarehouseId()==null?myCurrentWarehouse.getId():loadscanEntity.getWarehouseId());
trunklinePackageTrackLog.put("warehouseId",distributionLoadscanEntity.getWarehouseName()==null?myCurrentWarehouse.getName():loadscanEntity.getWarehouseName());
trunklinePackageTrackLog.put("workNode", WorkNodeEnums.DISTRIBUTION_SIGN_FOR.getCode());
trunklinePackageTrackLog.put("content",content);
trunklinePackageTrackLog.put("operator",loadscanEntity.getScanUser());
aaa.add(trunklinePackageTrackLog);
orderPackageCodes.add(loadscanEntity.getOrderPackageCode());
}
//修改包件状态为装车、签收
DistributionParcelListEntity updatePackage = collect.get(0);
@ -2637,6 +2683,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionReservationService.maintenanceReservationInfo(distrilbutionloadingscanDTO.getReservationId());
//维护配送任务
distributionDeliveryListService.maintenanceDeliveryInfo(distrilbutionloadingscanDTO.getDeliveryId());
trunklinePackageTrackLogClient.addPackageTrackLog(aaa,orderPackageCodes,WorkNodeEnums.DISTRIBUTION_SIGN_FOR.getCode());
return Resp.scanSuccessWithData("签收成功", str, orderPackageCodes);
} catch (Exception e) {
log.error(">>>>> 签收异常报错", e);
@ -3091,6 +3139,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
return R.fail(403, "配送错误!!!");
}
List<Long> packageLockIds = new ArrayList<>();
List<String> orderPackageCodes = new ArrayList<>();
List<JSONObject> aaa = new ArrayList<>();
if (Func.isNotEmpty(parcelListEntityList) && parcelListEntityList.size() == 1) {
DistributionParcelListEntity parcelListEntity = parcelListEntityList.get(0);
if (parcelListEntity.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())) {
@ -3151,6 +3201,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
return Resp.scanFail("重复操作!!", "重复操作");
}
}
String content = "包件在"+myCurrentWarehouse.getName()+"由"+loadscanEntity.getScanUser()+"扫描异常签收,装车方式:补录装车,配送车次号:"+distributionDeliveryListEntity.getTrainNumber()+"预约任务号:"+reservationEntity.getReservationCode();
JSONObject trunklinePackageTrackLog= new JSONObject();
switch (reservationEntity.getDeliveryType()) {
case "1":
//商配
@ -3223,12 +3275,31 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionLoadscanService.save(distributionLoadscanEntity);
Integer j = distributionSignforMapper.updateSignforByReservationId(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
} else {
content = "包件在"+myCurrentWarehouse.getName()+"由"+loadscanEntity.getScanUser()+"扫描异常签收,装车方式:扫描装车,配送车次号:"+distributionDeliveryListEntity.getTrainNumber()+"预约任务号:"+reservationEntity.getReservationCode();
distributionLoadscanService.updateById(distributionLoadscanEntity);
distributionSignforMapper.updateSignforNum(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
}
trunklinePackageTrackLog.put("tenantId",distributionLoadscanEntity.getTenantId());
trunklinePackageTrackLog.put("createTime",distributionLoadscanEntity.getCreateTime());
trunklinePackageTrackLog.put("createUser",distributionLoadscanEntity.getCreateUser());
trunklinePackageTrackLog.put("updateUser",distributionLoadscanEntity.getUpdateUser());
trunklinePackageTrackLog.put("updateTime",distributionLoadscanEntity.getUpdateTime());
trunklinePackageTrackLog.put("isDeleted",distributionLoadscanEntity.getIsDeleted());
trunklinePackageTrackLog.put("status",distributionLoadscanEntity.getStatus());
trunklinePackageTrackLog.put("createDept",distributionLoadscanEntity.getCreateDept());
trunklinePackageTrackLog.put("orderPackageCode",distributionLoadscanEntity.getOrderPackageCode());
trunklinePackageTrackLog.put("warehouseId",distributionLoadscanEntity.getWarehouseId()==null?myCurrentWarehouse.getId():distributionLoadscanEntity.getWarehouseId());
trunklinePackageTrackLog.put("warehouseId",distributionLoadscanEntity.getWarehouseName()==null?myCurrentWarehouse.getName():distributionLoadscanEntity.getWarehouseName());
trunklinePackageTrackLog.put("workNode", WorkNodeEnums.DISTRIBUTION_SIGN_FOR.getCode());
trunklinePackageTrackLog.put("content",content);
trunklinePackageTrackLog.put("operator",distributionLoadscanEntity.getScanUser());
aaa.add(trunklinePackageTrackLog);
orderPackageCodes.add(loadscanEntity.getOrderPackageCode());
} else {
return Resp.scanFail("操作失败", "不属于该客户");
}
break;
case "2":
//市配
@ -3286,6 +3357,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
if (Func.isEmpty(loadscanEntity)) {
distributionLoadscanService.save(distributionLoadscanEntity);
} else {
content = "包件在"+myCurrentWarehouse.getName()+"由"+loadscanEntity.getScanUser()+"扫描异常签收,装车方式:扫描装车,配送车次号:"+distributionDeliveryListEntity.getTrainNumber()+"预约任务号:"+reservationEntity.getReservationCode();
distributionLoadscanService.updateById(distributionLoadscanEntity);
}
Integer j = distributionSignforMapper.updateSignforNum(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
@ -3293,6 +3365,24 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
//修改包件装车、签收状态
packageLockIds.add(distributionLoadscanEntity.getPackageId());
trunklinePackageTrackLog.put("tenantId",distributionLoadscanEntity.getTenantId());
trunklinePackageTrackLog.put("createTime",distributionLoadscanEntity.getCreateTime());
trunklinePackageTrackLog.put("createUser",distributionLoadscanEntity.getCreateUser());
trunklinePackageTrackLog.put("updateUser",distributionLoadscanEntity.getUpdateUser());
trunklinePackageTrackLog.put("updateTime",distributionLoadscanEntity.getUpdateTime());
trunklinePackageTrackLog.put("isDeleted",distributionLoadscanEntity.getIsDeleted());
trunklinePackageTrackLog.put("status",distributionLoadscanEntity.getStatus());
trunklinePackageTrackLog.put("createDept",distributionLoadscanEntity.getCreateDept());
trunklinePackageTrackLog.put("orderPackageCode",distributionLoadscanEntity.getOrderPackageCode());
trunklinePackageTrackLog.put("warehouseId",distributionLoadscanEntity.getWarehouseId()==null?myCurrentWarehouse.getId():distributionLoadscanEntity.getWarehouseId());
trunklinePackageTrackLog.put("warehouseId",distributionLoadscanEntity.getWarehouseName()==null?myCurrentWarehouse.getName():distributionLoadscanEntity.getWarehouseName());
trunklinePackageTrackLog.put("workNode", WorkNodeEnums.DISTRIBUTION_SIGN_FOR.getCode());
trunklinePackageTrackLog.put("content",content);
trunklinePackageTrackLog.put("operator",distributionLoadscanEntity.getScanUser());
aaa.add(trunklinePackageTrackLog);
orderPackageCodes.add(loadscanEntity.getOrderPackageCode());
} else {
return Resp.scanFail("操作失败", "不属于该客户");
}
@ -3304,6 +3394,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionParcelListService.updateById(parcelListEntity);
//维护订单信息
distributionStockArticleService.maintenanceOrderInfo(parcelListEntity.getOrderCode(), parcelListEntity.getWarehouseId());
//构建异常签收
break;
}
//查询一次是否进行了异常装车,如果没有进行异常装车数据进行审核
@ -3340,6 +3431,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionParcelListMapper.updateOrderPackageCodeById(parcelListEntity.getId(), OrderPackageStatusConstant.yiqianshou.getValue());
//还需要维护包件状态
distributionAsyncService.maintenanceOrderStatus(parcelListEntity.getOrderCode(), parcelListEntity.getWarehouseId());
trunklinePackageTrackLogClient.addPackageTrackLog(aaa,orderPackageCodes,WorkNodeEnums.DISTRIBUTION_ABNORMAL_SIGN_FOR.getCode());
} else {
log.error("############出现相同的包件码:{}", distrilbutionloadingscanDTO.getBarcode());
return Resp.scanFail("操作失败", "包件信息有误");

10
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java

@ -53,6 +53,7 @@ import com.logpm.distribution.wrapper.DistributionStockArticleWrapper;
import com.logpm.factorydata.enums.BrandEnums;
import com.logpm.factorydata.util.FactoryDataMessageSender;
import com.logpm.factorydata.vo.NodePushMsg;
import com.logpm.factorydata.vo.PushData;
import com.logpm.oldproject.dto.SignPushDataContactDTO;
import com.logpm.oldproject.dto.SignPushDataDTO;
import com.logpm.oldproject.dto.SignPushDataUnitDTO;
@ -3512,9 +3513,12 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
List<Object> contents = new ArrayList<>();
if (CollUtil.isNotEmpty(value)) {
for (DistributionParcelListEntity distributionParcelListEntity : value) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("packageCode", distributionParcelListEntity.getOrderPackageCode());
contents.add(jsonObject);
PushData pushData = PushData.builder()
.packageCode(distributionParcelListEntity.getOrderPackageCode())
.orderCode(distributionParcelListEntity.getOrderCode())
.warehouseName(myCurrentWarehouse.getName())
.waybillNumber(distributionParcelListEntity.getWaybillNumber()).build();
contents.add(pushData);
}
}
NodePushMsg msg = new NodePushMsg();

14
blade-service/logpm-factory-data/logpm-factory-data-mwh/Dockerfile

@ -0,0 +1,14 @@
FROM bladex/alpine-java:openjdk8-openj9_cn_slim
MAINTAINER h5u@163.com
RUN mkdir -p /logpm/logpm-factory-data-mwh
WORKDIR /logpm/logpm-factory-data-mwh
EXPOSE 18960
ADD ./target/logpm-factory-data-mwh.jar ./app.jar
ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar","-Xms128m","-Xmx512m", "app.jar"]
CMD ["--spring.profiles.active=test"]

93
blade-service/logpm-factory-data/logpm-factory-data-mwh/pom.xml

@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><parent><artifactId>logpm-factory-data</artifactId><groupId>org.springblade</groupId><version>3.2.0.RELEASE</version></parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.logpm</groupId>
<artifactId>logpm-factory-data-mwh</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-core-boot</artifactId>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-core-auto</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>logpm-factory-data-api</artifactId>
<version>3.2.0.RELEASE</version>
</dependency>
<dependency>
<groupId>com.xuxueli</groupId>
<artifactId>xxl-job-core</artifactId>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-starter-swagger</artifactId>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>logpm-trunkline-api</artifactId>
<version>3.2.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>logpm-factory-data-base-api</artifactId>
<version>${bladex.project.version}</version>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-starter-oss</artifactId>
</dependency>
<dependency>
<groupId>io.minio</groupId>
<artifactId>minio</artifactId>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-resource-api</artifactId>
<version>3.2.0.RELEASE</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<configuration>
<username>${docker.username}</username>
<password>${docker.password}</password>
<repository>${docker.registry.url}/${docker.namespace}/${project.artifactId}</repository>
<tag>${project.version}</tag>
<useMavenSettingsForAuth>true</useMavenSettingsForAuth>
<buildArgs>
<JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
</buildArgs>
<skip>false</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

20
blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/FactoryDataMwhApplication.java

@ -0,0 +1,20 @@
package com.logpm.factorydata;
import org.springblade.common.constant.ModuleNameConstant;
import org.springblade.core.cloud.client.BladeCloudApplication;
import org.springblade.core.launch.BladeApplication;
/**
* 曼好家工厂数据启动类
*
* @author zhaoqiaobo
* @create 2024-4-26
*/
@BladeCloudApplication
public class FactoryDataMwhApplication {
public static void main(String[] args) {
BladeApplication.run(ModuleNameConstant.LOGPM_FACTORY_DATA_MWH_NAME, FactoryDataMwhApplication.class, args);
}
}

51
blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/aspect/AsyncAnnotationAspect.java

@ -0,0 +1,51 @@
package com.logpm.factorydata.mwh.aspect;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.reflect.MethodSignature;
import org.springblade.common.annotations.LogpmAsync;
import org.springblade.core.secure.utils.AuthUtil;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import java.lang.reflect.Method;
@Aspect
@Component
@Slf4j
@Order(-1)
public class AsyncAnnotationAspect {
/**
* 定义一个切点匹配所有带有@LogpmAsync("asyncExecutor")注解的方法
* 注意实际上Spring Framework自带对@LogpmAsync("asyncExecutor")的处理直接这样配置可能会导致预期之外的行为
*/
@Around("@annotation(org.springblade.common.annotations.LogpmAsync)")
public Object logAroundAsyncMethods(ProceedingJoinPoint joinPoint) throws Throwable {
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
Method method = signature.getMethod();
LogpmAsync myAsync = method.getAnnotation(LogpmAsync.class);
String annotationValue = myAsync.value();
log.info(">>>>>>>>>>>>>>>>>> annotationValue={}",annotationValue);
log.info("@LogpmAsync注解的值为asyncExecutor,进行数据源切换 ");
// 在方法执行前的操作
String tenantId = AuthUtil.getTenantId();
log.info(">> tenandId {} ",tenantId);
DynamicDataSourceContextHolder.push(tenantId);
// 执行原方法
Object result = joinPoint.proceed();
// 在方法执行后的操作
DynamicDataSourceContextHolder.poll();
return result;
}
}

48
blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/aspect/RabbitAnnotationAspect.java

@ -0,0 +1,48 @@
package com.logpm.factorydata.mwh.aspect;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springblade.core.secure.utils.AuthUtil;
import org.springframework.stereotype.Component;
@Aspect
@Component
@Slf4j
public class RabbitAnnotationAspect {
/**
* 该方法为一个切面用于对标记了@RabbitListener注解的方法进行增强主要增加了日志记录和数据源上下文处理的功能
*
* @param joinPoint 切面的连接点表示当前被拦截的方法
* @return 返回被拦截方法的执行结果
* @throws Throwable 如果执行过程中发生异常则抛出
*/
@Around("@annotation(org.springframework.amqp.rabbit.annotation.RabbitListener)")
public Object rabbitMethods(ProceedingJoinPoint joinPoint) throws Throwable {
// 在方法执行前,获取当前租户ID并设置到数据源上下文中
String tenantId = AuthUtil.getTenantId();
DynamicDataSourceContextHolder.push(tenantId);
// 执行原方法
Object result = joinPoint.proceed();
// 在方法执行后,从数据源上下文中移除租户ID
DynamicDataSourceContextHolder.poll();
return result;
}
@Around("@annotation(org.springframework.amqp.rabbit.annotation.RabbitHandler)")
public Object rabbitHandlerMethods(ProceedingJoinPoint joinPoint) throws Throwable {
// 在方法执行前,获取当前租户ID并设置到数据源上下文中
String tenantId = AuthUtil.getTenantId();
DynamicDataSourceContextHolder.push(tenantId);
// 执行原方法
Object result = joinPoint.proceed();
// 在方法执行后,从数据源上下文中移除租户ID
DynamicDataSourceContextHolder.poll();
return result;
}
}

161
blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/config/CustomMessageConverter.java

@ -0,0 +1,161 @@
package com.logpm.factorydata.mwh.config;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.utils.ThreadLocalUtil;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessageProperties;
import org.springframework.amqp.support.converter.AllowedListDeserializingMessageConverter;
import org.springframework.amqp.support.converter.MessageConversionException;
import org.springframework.amqp.utils.SerializationUtils;
import org.springframework.beans.factory.BeanClassLoaderAware;
import org.springframework.http.HttpHeaders;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.remoting.rmi.CodebaseAwareObjectInputStream;
import org.springframework.stereotype.Component;
import org.springframework.util.ClassUtils;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.ObjectStreamClass;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.List;
import java.util.Map;
/**
* @author zhaoqiaobo
* @create 2024-05-08
*/
@Component
public class CustomMessageConverter extends AllowedListDeserializingMessageConverter implements BeanClassLoaderAware {
private volatile String defaultCharset = "UTF-8";
private ClassLoader beanClassLoader = ClassUtils.getDefaultClassLoader();
private String codebaseUrl;
@Deprecated
public void setCodebaseUrl(String codebaseUrl) {
this.codebaseUrl = codebaseUrl;
}
@Override
public Object fromMessage(Message message) throws MessageConversionException {
Object content = null;
MessageProperties properties = message.getMessageProperties();
if (properties != null) {
String contentType = properties.getContentType();
if (contentType != null && contentType.startsWith("text")) {
String encoding = properties.getContentEncoding();
if (encoding == null) {
encoding = "UTF-8";
}
try {
content = new String(message.getBody(), encoding);
} catch (UnsupportedEncodingException var8) {
throw new MessageConversionException("failed to convert text-based Message content", var8);
}
} else if (contentType != null && contentType.equals("application/x-java-serialized-object")) {
try {
content = SerializationUtils.deserialize(this.createObjectInputStream(new ByteArrayInputStream(message.getBody()), this.codebaseUrl));
} catch (IllegalArgumentException | IllegalStateException | IOException var7) {
throw new MessageConversionException("failed to convert serialized Message content", var7);
}
}
}
Map<String, Object> headers = properties.getHeaders();
HttpHeaders httpHeaders = new HttpHeaders();
for (Map.Entry<String, Object> entry : headers.entrySet()) {
if (StrUtil.equals("Blade-Auth", entry.getKey())
|| StrUtil.equals("Authorization", entry.getKey())
|| StrUtil.equals("blade-auth", entry.getKey())
|| StrUtil.equals("authorization", entry.getKey())) {
List value = (List) entry.getValue();
for (Object o : value) {
httpHeaders.add(entry.getKey(), String.valueOf(o));
}
}
}
ThreadLocalUtil.put("bladeContext", httpHeaders);
Object bladeUser = headers.get("bladeUser");
MockHttpServletRequest request = new MockHttpServletRequest();
BladeUser bladeUser1 = JSONUtil.toBean(bladeUser.toString(), BladeUser.class);
request.setAttribute("_BLADE_USER_REQUEST_ATTR_", bladeUser1);
RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(request));
if (content == null) {
content = message.getBody();
}
return content;
}
@Override
protected Message createMessage(Object object, MessageProperties messageProperties) throws MessageConversionException {
byte[] bytes = null;
if (object instanceof byte[]) {
bytes = (byte[]) object;
messageProperties.setContentType("application/octet-stream");
} else if (object instanceof String) {
try {
bytes = ((String) object).getBytes(this.defaultCharset);
} catch (UnsupportedEncodingException var6) {
throw new MessageConversionException("failed to convert to Message content", var6);
}
messageProperties.setContentType("text/plain");
messageProperties.setContentEncoding(this.defaultCharset);
} else if (object instanceof Serializable) {
try {
bytes = SerializationUtils.serialize(object);
} catch (IllegalArgumentException var5) {
throw new MessageConversionException("failed to convert to serialized Message content", var5);
}
messageProperties.setContentType("application/x-java-serialized-object");
}
HttpHeaders headers = (HttpHeaders) ThreadLocalUtil.get("bladeContext");
if (headers != null && !headers.isEmpty()) {
headers.forEach((key, values) -> {
values.forEach((value) -> {
messageProperties.setHeader(key, new String[]{value});
});
});
}
BladeUser user = AuthUtil.getUser();
BladeUser bladeUser = new BladeUser();
bladeUser.setTenantId(user.getTenantId());
bladeUser.setUserId(user.getUserId());
bladeUser.setAccount(user.getAccount());
bladeUser.setRoleId(user.getRoleId());
messageProperties.setHeader("bladeUser", JSONUtil.toJsonStr(bladeUser));
if (bytes != null) {
messageProperties.setContentLength((long) bytes.length);
return new Message(bytes, messageProperties);
} else {
throw new IllegalArgumentException(this.getClass().getSimpleName() + " only supports String, byte[] and Serializable payloads, received: " + object.getClass().getName());
}
}
@Override
public void setBeanClassLoader(ClassLoader classLoader) {
this.beanClassLoader = beanClassLoader;
}
protected ObjectInputStream createObjectInputStream(InputStream is, String codebaseUrl) throws IOException {
return new CodebaseAwareObjectInputStream(is, this.beanClassLoader, codebaseUrl) {
@Override
protected Class<?> resolveClass(ObjectStreamClass classDesc) throws IOException, ClassNotFoundException {
Class<?> clazz = super.resolveClass(classDesc);
CustomMessageConverter.this.checkAllowedList(clazz);
return clazz;
}
};
}
}

79
blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/config/ExecutorConfig.java

@ -0,0 +1,79 @@
package com.logpm.factorydata.mwh.config;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.MDC;
import org.springblade.core.tool.utils.ThreadLocalUtil;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.task.TaskDecorator;
import org.springframework.http.HttpHeaders;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import javax.annotation.Nonnull;
import java.util.Map;
import java.util.concurrent.Executor;
import java.util.concurrent.ThreadPoolExecutor;
@Configuration
@Slf4j
@EnableAsync
public class ExecutorConfig {
@Bean
public Executor asyncExecutor() {
log.info("start async executor");
ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor();
// 配置核心线程数
threadPoolTaskExecutor.setCorePoolSize(10);
// 配置最大线程数
threadPoolTaskExecutor.setMaxPoolSize(20);
// 配置队列大小
threadPoolTaskExecutor.setQueueCapacity(50);
// 配置线程池中线程的名称前缀
threadPoolTaskExecutor.setThreadNamePrefix("ASYNC_THREAD_");
// HelloWorldServiceImpl rejection-policy: 当pool已经达到max size时,如何处理新任务:
// CallerRunsPolicy: 不在新线程中执行任务,而是由调用者所在的线程来执行;
// AbortPolicy: 拒绝执行新任务,并抛出RejectedExecutionException异常;
// DiscardPolicy:丢弃当前将要加入队列的任务;
// DiscardOldestPolicy:丢弃任务队列中最旧的任务;
threadPoolTaskExecutor.setRejectedExecutionHandler(
new ThreadPoolExecutor.CallerRunsPolicy()
);
threadPoolTaskExecutor.setTaskDecorator(new ContextCopyingDecorator());
threadPoolTaskExecutor.initialize();
return threadPoolTaskExecutor;
}
static class ContextCopyingDecorator implements TaskDecorator {
@Nonnull
@Override
public Runnable decorate(@Nonnull Runnable runnable) {
RequestAttributes context = RequestContextHolder.currentRequestAttributes();
HttpHeaders headers = (HttpHeaders) ThreadLocalUtil.get("bladeContext");
Map<String, String> mdcMap = MDC.getCopyOfContextMap();
return () -> {
try {
ThreadLocalUtil.put("bladeContext", headers);
if (mdcMap != null && !mdcMap.isEmpty()) {
MDC.setContextMap(mdcMap);
}
RequestContextHolder.setRequestAttributes(context);
runnable.run();
} finally {
RequestContextHolder.resetRequestAttributes();
if (mdcMap != null) {
mdcMap.clear();
}
ThreadLocalUtil.clear();
MDC.clear();
}
};
}
}
}

40
blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/config/FactoryDataConfiguration.java

@ -0,0 +1,40 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.factorydata.mwh.config;
import com.logpm.factorydata.mwh.pros.FactoryDataProperties;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
/**
* 配置feignmybatis包名properties
*
* @author chaos
*/
@Configuration(proxyBeanMethods = false)
@ComponentScan({"org.springblade", "com.logpm"})
@EnableFeignClients({"org.springblade", "com.logpm"})
@MapperScan({"org.springblade.**.mapper.**", "com.logpm.**.mapper.**"})
@EnableConfigurationProperties(FactoryDataProperties.class)
public class FactoryDataConfiguration {
}

32
blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/config/InterceptorAdapterConfig.java

@ -0,0 +1,32 @@
package com.logpm.factorydata.mwh.config;
import com.logpm.factorydata.mwh.interceptor.FactoryAccountsInterceptor;
import com.logpm.factorydata.mwh.interceptor.LocalServerLoginAccountsInterceptor;
import com.logpm.factorydata.mwh.service.IFactoryTokenService;
import lombok.AllArgsConstructor;
import org.springblade.core.redis.cache.BladeRedis;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
@AllArgsConstructor
public class InterceptorAdapterConfig implements WebMvcConfigurer {
private final IFactoryTokenService factoryTokenService;
private final BladeRedis redis;
private final Environment environment;
@Override
public void addInterceptors(InterceptorRegistry interceptorRegistry) {
// interceptorRegistry.addInterceptor(new FactoryAccountsInterceptor(factoryTokenService))
// .addPathPatterns("/**").order(1);
interceptorRegistry.addInterceptor(new LocalServerLoginAccountsInterceptor(redis, environment))
.addPathPatterns("/**").order(2);
}
}

17
blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/config/RabbitConfig.java

@ -0,0 +1,17 @@
package com.logpm.factorydata.mwh.config;
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class RabbitConfig {
@Bean
public RabbitTemplate rabbitTemplate(ConnectionFactory factory, CustomMessageConverter converter) {
RabbitTemplate template = new RabbitTemplate(factory);
template.setMessageConverter(converter);
return template;
}
}

53
blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/controller/OrderController.java

@ -0,0 +1,53 @@
package com.logpm.factorydata.mwh.controller;
import cn.hutool.json.JSONUtil;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.factorydata.mwh.service.FactoryOrderLogService;
import com.logpm.factorydata.mwh.vo.DeliveryNoteVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.PatchMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
/**
* 工厂订单 前端控制器
*
* @author zhaoqiaobo
* @create 2024-03-21 19:27
*/
@Slf4j
@RestController
@RequestMapping("/factory/order/v1")
@AllArgsConstructor
@Api(value = "工厂订单", tags = "工厂订单")
public class OrderController {
private final FactoryOrderLogService service;
@ResponseBody
@PostMapping
@ApiOperationSupport(order = 1)
@ApiOperation(value = "工厂订单", notes = "工厂订单")
public R order(@RequestBody DeliveryNoteVO vo) {
log.info("接收工厂订单:{} ", JSONUtil.toJsonStr(vo));
String res = "";
try {
res = service.order(vo);
} catch (Exception e) {
log.error("工厂订单异常:{} ", e);
return R.success("服务器异常");
}
return R.success(res);
}
}

169
blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/entity/DeliveryNoteEntity.java

@ -0,0 +1,169 @@
package com.logpm.factorydata.mwh.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
/**
* 送货单 实体类
*
* @author zhaoqiaobo
* @create 2024-04-26
*/
@Data
@TableName("mwh_delivery_note")
@EqualsAndHashCode(callSuper = true)
public class DeliveryNoteEntity extends BaseEntity {
@ApiModelProperty("日志id")
private String logId;
/**
* 客户编码
*/
private String storeCode;
/**
* 客户编码
*/
private String storeName;
/**
* 客户编码
*/
private String userId;
/**
* 客户名称
*/
private String userName;
/**
* 订单来源编码
*/
private String sources;
/**
* 订单来源名称
*/
private String sourceName;
/**
* 公司编码
*/
private String companyCode;
/**
* 公司名称
*/
private String companyName;
/**
* 服务平台编码
*/
private String siteCode;
/**
* 服务平台编码
*/
private String siteName;
/**
* 交割单号/服务号
*/
private String orderNo;
/**
* 订单号
*/
private String orderSelfNum;
/**
* 计划总数量
*/
private String totalQuantity;
/**
* 计划总数量
*/
private String totalWeight;
/**
* 计划总体积
*/
private String totalCapacity;
/**
* 订单类型编码
*/
private String orderType;
/**
* 订单类型名称
*/
private String orderTypeName;
/**
* 服务类型编码
*/
private String serviceType;
/**
* 服务类型名称
*/
private String serviceTypeName;
/**
* 详细地址
*/
private String senderAddress;
/**
* 发货人城市
*/
private String senderCity;
/**
* 发货人联系方式
*/
private String senderMobile;
/**
* 发货工厂名称
*/
private String senderName;
/**
* 发货人省份
*/
private String senderProvince;
/**
* 发货人区县
*/
private String senderArea;
/**
* 收货人详细地址
*/
private String receiverAddress;
/**
* 收货人区县
*/
private String receiverArea;
/**
* 收货人城市
*/
private String receiverCity;
/**
* 收货人联系方式
*/
private String receiverMobile;
/**
* 加盟商
*/
private String receiverName;
/**
* 收货人
*/
private String consigneeName;
/**
* 收货人省份
*/
private String receiverProvince;
/**
* 业务实体
*/
private String remark1;
@ApiModelProperty(value = "预留1", notes = "")
private String reserve1;
@ApiModelProperty(value = "预留2", notes = "")
private String reserve2;
@ApiModelProperty(value = "预留3", notes = "")
private String reserve3;
@ApiModelProperty(value = "预留4", notes = "")
private String reserve4;
@ApiModelProperty(value = "预留5", notes = "")
private String reserve5;
}

58
blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/entity/FactoryOrderLogEntity.java

@ -0,0 +1,58 @@
package com.logpm.factorydata.mwh.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
@Data
@TableName("mwh_factory_log")
@ApiModel(value = "接收工厂订单日志", description = "接收工厂订单日志")
@EqualsAndHashCode(callSuper = true)
public class FactoryOrderLogEntity extends BaseEntity {
/**
* 预留1
*/
@ApiModelProperty(name = "预留1", notes = "")
private String reserve1;
/**
* 预留2
*/
@ApiModelProperty(name = "预留2", notes = "")
private String reserve2;
/**
* 预留3
*/
@ApiModelProperty(name = "预留3", notes = "")
private String reserve3;
/**
* 预留4
*/
@ApiModelProperty(name = "预留4", notes = "")
private String reserve4;
/**
* 预留5
*/
@ApiModelProperty(name = "预留5", notes = "")
private String reserve5;
/**
* 日志文件存放地址
*/
@ApiModelProperty(name = "日志文件存放地址", notes = "")
private String logUrl;
/**
* 数据类型 1.入库数据
*/
@ApiModelProperty(name = "数据类型 1.入库数据", notes = "")
private Integer type;
/**
* 解析状态 0 未解析 1 解析失败 2 已解析
*/
@ApiModelProperty(name = "解析状态 0 未解析 1 解析失败 2 已解析", notes = "")
private Integer saxStatus;
}

32
blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/entity/FactoryToken.java

@ -0,0 +1,32 @@
package com.logpm.factorydata.mwh.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springblade.core.mp.base.BaseEntity;
import java.util.Date;
@Data
@TableName("factory_token")
@ApiModel(value = "FactoryToken对象", description = "工厂账户token")
public class FactoryToken extends BaseEntity {
@ApiModelProperty("token")
private String token;
@ApiModelProperty("token摘要")
private String tokenAbst;
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty("过期时间")
private Date expireTime;
@ApiModelProperty("企业id")
private String corpid;
}

64
blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/entity/PackageInfoEntity.java

@ -0,0 +1,64 @@
package com.logpm.factorydata.mwh.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
/**
* 装箱包信息
*
* @author zhaoqiaobo
* @create 2024-04-26
*/
@Data
@TableName("mwh_package_info")
@ApiModel(value = "包件信息", description = "包件信息")
@EqualsAndHashCode(callSuper = true)
public class PackageInfoEntity extends BaseEntity {
@ApiModelProperty(value = "日志id")
private String logId;
@ApiModelProperty(value = "发货单id")
private String deliveryNoteId;
/**
* 批次/色号订单编号
*/
private String color;
/**
* 商品状态默认为Y -良品
*/
private String skuStatus;
/**
* 客户编码
*/
private String storeCode;
/**
* 客户简称
*/
private String storeName;
/**
* 包件编码
*/
private String code;
/**
* 包件名称
*/
private String name;
@ApiModelProperty(value = "预留1", notes = "")
private String reserve1;
@ApiModelProperty(value = "预留2", notes = "")
private String reserve2;
@ApiModelProperty(value = "预留3", notes = "")
private String reserve3;
@ApiModelProperty(value = "预留4", notes = "")
private String reserve4;
@ApiModelProperty(value = "预留5", notes = "")
private String reserve5;
}

28
blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/enums/FactoryNodeEnums.java

@ -0,0 +1,28 @@
package com.logpm.factorydata.mwh.enums;
import lombok.Getter;
import org.springblade.common.model.IDict;
/**
* 工厂节点枚举
*
* @author zhaoqiaobo
* @create 2024-03-20 15:19
*/
@Getter
public enum FactoryNodeEnums implements IDict<Integer> {
/**
* 已交接
*/
INITIAL_WAREHOUSE_ENTRY(20, "Deliveried"),
/**
* 收货完成
*/
END_WAREHOUSE_UNLOADING(170, "Received");
FactoryNodeEnums(Integer code, String text) {
init(code, text);
}
}

62
blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/enums/NodeMappingEnums.java

@ -0,0 +1,62 @@
package com.logpm.factorydata.mwh.enums;
import cn.hutool.core.util.ObjectUtil;
import lombok.Getter;
import org.springblade.common.constant.WorkNodeEnums;
/**
* 系统和工厂节点映射枚举
*
* @author zhaoqiaobo
* @create 2024-03-20 15:19
*/
@Getter
public enum NodeMappingEnums {
/**
* 已交接
*/
INITIAL_WAREHOUSE_ENTRY(FactoryNodeEnums.INITIAL_WAREHOUSE_ENTRY, WorkNodeEnums.INITIAL_WAREHOUSE_ENTRY, 1),
/**
* 收货完成
*/
END_WAREHOUSE_UNLOADING(FactoryNodeEnums.END_WAREHOUSE_UNLOADING, WorkNodeEnums.END_WAREHOUSE_UNLOADING, 1);
/**
* 系统作业节点
*/
private WorkNodeEnums workNodeEnums;
/**
* 工厂作业节点
*/
private FactoryNodeEnums factoryNodeEnums;
/**
* 状态码
* 存在我们系统同一个作业节点对应工厂多个节点的情况通过状态码区分
*/
private Integer status;
NodeMappingEnums(FactoryNodeEnums factoryNodeEnums, WorkNodeEnums workNodeEnums, Integer status) {
this.workNodeEnums = workNodeEnums;
this.factoryNodeEnums = factoryNodeEnums;
this.status = status;
}
public static FactoryNodeEnums getFactoryByNodeAndStatus(WorkNodeEnums workNodeEnums) {
return getFactoryByNodeAndStatus(workNodeEnums, 1);
}
public static FactoryNodeEnums getFactoryByNodeAndStatus(WorkNodeEnums workNodeEnums, Integer status) {
NodeMappingEnums[] values = values();
for (NodeMappingEnums value : values) {
WorkNodeEnums workNodeEnums1 = value.getWorkNodeEnums();
Integer status1 = value.getStatus();
FactoryNodeEnums factoryNodeEnums = value.getFactoryNodeEnums();
if (ObjectUtil.equal(workNodeEnums1, workNodeEnums) && ObjectUtil.equal(status1, status)) {
return factoryNodeEnums;
}
}
return null;
}
}

34
blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/enums/NodeNeedEnums.java

@ -0,0 +1,34 @@
package com.logpm.factorydata.mwh.enums;
import lombok.Getter;
import java.io.Serializable;
/**
* 作业节点枚举
*
* @author zhaoqiaobo
* @create 2024-03-20 15:19
*/
@Getter
public enum NodeNeedEnums implements Serializable {
/**
* 始发仓入库
*/
INITIAL_WAREHOUSE_ENTRY(20, "始发仓入库"),
/**
* 末端仓卸车确认
*/
END_WAREHOUSE_UNLOADING(170, "末端仓卸车确认"),
;
private Integer code;
private String value;
NodeNeedEnums(Integer code, String value) {
this.code = code;
this.value = value;
}
}

87
blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/interceptor/FactoryAccountsInterceptor.java

@ -0,0 +1,87 @@
package com.logpm.factorydata.mwh.interceptor;
import com.alibaba.fastjson.JSONObject;
import com.logpm.factorydata.mwh.service.IFactoryTokenService;
import com.logpm.factorydata.mwh.wrapper.RequestWrapper;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
@Log4j2
@AllArgsConstructor
public class FactoryAccountsInterceptor implements HandlerInterceptor {
private final IFactoryTokenService factoryTokenService;
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws CustomerException {
try {
RequestWrapper myRequestWrapper = new RequestWrapper(request);
String body = myRequestWrapper.getBody();
JSONObject jsonObject = JSONObject.parseObject(body);
//获取头中参数
String token = request.getHeader("Authorization");
String corpId = request.getHeader("corpid");
if(StringUtil.isBlank(corpId)){
corpId = jsonObject.getString("corpid");
}
if(!StringUtil.hasLength(token)){
returnJson(response,JSONObject.toJSONString(R.fail(401,"认证不通过,token有误")));
return false;
}
if(!StringUtil.hasLength(corpId)){
returnJson(response,JSONObject.toJSONString(R.fail(401,"认证不通过,corpId有误")));
return false;
}
log.info("##########preHandle: token={}",token);
//验证token
boolean b = factoryTokenService.verifyToken(token,corpId);
if(!b){
returnJson(response,JSONObject.toJSONString(R.fail(401,"认证不通过,token不存在或已过期")));
return false;
}
return true;
} catch (Exception e) {
returnJson(response,JSONObject.toJSONString(R.fail(500,"服务异常,请联系管理员")));
return false;
}
}
private void returnJson(HttpServletResponse response, String json) {
PrintWriter writer = null;
response.setCharacterEncoding("UTF-8");
response.setContentType("application/json");
try {
writer = response.getWriter();
writer.print(json);
} catch (IOException e) {
System.out.println(e.getMessage());
} finally {
if (writer != null){
writer.close();
}
}
}
@Override
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {
HandlerInterceptor.super.postHandle(request, response, handler, modelAndView);
}
@Override
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
HandlerInterceptor.super.afterCompletion(request, response, handler, ex);
}
}

100
blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/interceptor/LocalServerLoginAccountsInterceptor.java

@ -0,0 +1,100 @@
package com.logpm.factorydata.mwh.interceptor;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import com.alibaba.fastjson.JSONObject;
import com.logpm.factorydata.mwh.wrapper.CustomHttpServletRequestWrapper;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.cache.CacheNames;
import org.springblade.common.constant.LauncherConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.ThreadLocalUtil;
import org.springframework.core.env.Environment;
import org.springframework.http.HttpHeaders;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
@Log4j2
@AllArgsConstructor
public class LocalServerLoginAccountsInterceptor extends HandlerInterceptorAdapter {
private final BladeRedis bladeRedis;
private final Environment environment;
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws CustomerException {
try {
CustomHttpServletRequestWrapper wrappedRequest = new CustomHttpServletRequestWrapper(request);
String account ="shujutongbu";
JSONObject data =bladeRedis.get(CacheNames.LOCAL_SERVER_USER+account);
if(Objects.isNull(data)){
String url = "http://"+ LauncherConstant.loginAddr(Objects.requireNonNull(environment.getActiveProfiles()[0]))+"/blade-auth/oauth/token";
HttpRequest urlRequest = HttpRequest.post(url);
urlRequest.header("Authorization", "Basic c2FiZXI6c2FiZXJfc2VjcmV0");
urlRequest.header("Tenant-Id", "627683");
Map<String, Object> params = new HashMap<>();
params.put("grant_type", "local_server");
params.put("scope", "all");
params.put("username", account);
params.put("tenantId", "627683");
HttpResponse execute = urlRequest.form(params).execute();
String body = execute.body();
data = JSONObject.parseObject(body);
bladeRedis.setEx(CacheNames.LOCAL_SERVER_USER+account,data,3200L);
}
// 修改或添加header
// 发送登录请求
log.info("##########preHandle: request={}", request);
wrappedRequest.addHeader("Blade-Auth", "bearer "+data.getString("access_token"));
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.add("Blade-Auth","bearer "+data.get("access_token") );
httpHeaders.add( "Authorization", "Basic c2FiZXI6c2FiZXJfc2VjcmV0");
ThreadLocalUtil.put("bladeContext", httpHeaders);
// 用包装后的request替换原始request
request = wrappedRequest;
RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(request));
return true;
} catch (Exception e) {
returnJson(response, JSONObject.toJSONString(R.fail(500, "服务异常,请联系管理员")));
return false;
}
}
private void returnJson(HttpServletResponse response, String json) {
PrintWriter writer = null;
response.setCharacterEncoding("UTF-8");
response.setContentType("application/json");
try {
writer = response.getWriter();
writer.print(json);
} catch (IOException e) {
System.out.println(e.getMessage());
} finally {
if (writer != null) {
writer.close();
}
}
}
}

60
blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/launcher/FactoryDataBaseLauncherServiceImpl.java

@ -0,0 +1,60 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.factorydata.mwh.launcher;
import org.springblade.core.auto.service.AutoService;
import org.springblade.core.launch.constant.NacosConstant;
import org.springblade.core.launch.service.LauncherService;
import org.springblade.core.launch.utils.PropsUtil;
import org.springframework.boot.builder.SpringApplicationBuilder;
import java.util.Properties;
/**
* 启动参数拓展
*
* @author Chill
*/
@AutoService(LauncherService.class)
public class FactoryDataBaseLauncherServiceImpl implements LauncherService {
@Override
public void launcher(SpringApplicationBuilder builder, String appName, String profile, boolean isLocalDev) {
Properties props = System.getProperties();
// 开启多数据源
PropsUtil.setProperty(props, "spring.datasource.dynamic.enabled", "true");
// 指定注册配置信息
PropsUtil.setProperty(props, "spring.cloud.nacos.config.extension-configs[0].data-id", NacosConstant.dataId(appName, profile));
PropsUtil.setProperty(props, "spring.cloud.nacos.config.extension-configs[0].group", NacosConstant.NACOS_CONFIG_GROUP);
PropsUtil.setProperty(props, "spring.cloud.nacos.config.extension-configs[0].refresh", NacosConstant.NACOS_CONFIG_REFRESH);
// 指定注册IP
// PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.ip", "127.0.0.1");
// 指定注册端口
// PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.port", "8200");
// 自定义命名空间
// PropsUtil.setProperty(props, "spring.cloud.nacos.config.namespace", LauncherConstant.NACOS_NAMESPACE);
// PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.namespace", LauncherConstant.NACOS_NAMESPACE);
// 自定义分组
// PropsUtil.setProperty(props, "spring.cloud.nacos.config.group", NacosConstant.NACOS_CONFIG_GROUP);
// PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.group", NacosConstant.NACOS_CONFIG_GROUP);
}
@Override
public int getOrder() {
return 20;
}
}

16
blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/mapper/DeliveryNoteMapper.java

@ -0,0 +1,16 @@
package com.logpm.factorydata.mwh.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.factorydata.mwh.entity.DeliveryNoteEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 发货单 mapper
*
* @author zqb
* @since 2024-03-26
*/
@Mapper
public interface DeliveryNoteMapper extends BaseMapper<DeliveryNoteEntity> {
}

5
blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/mapper/FactoryNodeOrderMapper.xml

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.logpm.factorydata.mwh.mapper.DeliveryNoteMapper">
</mapper>

16
blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/mapper/FactoryOrderLogMapper.java

@ -0,0 +1,16 @@
package com.logpm.factorydata.mwh.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.factorydata.mwh.entity.FactoryOrderLogEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 工厂订单日志 mapper
*
* @author zqb
* @since 2024-03-26
*/
@Mapper
public interface FactoryOrderLogMapper extends BaseMapper<FactoryOrderLogEntity> {
}

5
blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/mapper/FactoryOrderLogMapper.xml

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.logpm.factorydata.mwh.mapper.FactoryOrderLogMapper">
</mapper>

31
blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/mapper/FactoryTokenMapper.java

@ -0,0 +1,31 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.factorydata.mwh.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.factorydata.mwh.entity.FactoryToken;
/**
* 工厂账号接口日志 Mapper 接口
*
* @author zhy
* @since 2023-03-28
*/
public interface FactoryTokenMapper extends BaseMapper<FactoryToken> {
}

20
blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/mapper/FactoryTokenMapper.xml

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.logpm.factorydata.mwh.mapper.FactoryTokenMapper">
<!-- 通用查询映射结果 -->
<!-- <resultMap id="orderLogResultMap" type="com.logpm.factory.snm.entity.FactoryOrder">-->
<!-- <result column="id" property="id"/>-->
<!-- <result column="req_args" property="reqArgs"/>-->
<!-- <result column="res_body" property="resBody"/>-->
<!-- <result column="type" property="type"/>-->
<!-- <result column="create_user" property="createUser"/>-->
<!-- <result column="create_time" property="createTime"/>-->
<!-- <result column="update_user" property="updateUser"/>-->
<!-- <result column="update_time" property="updateTime"/>-->
<!-- <result column="status" property="status"/>-->
<!-- <result column="is_deleted" property="isDeleted"/>-->
<!-- <result column="create_dept" property="createDept"/>-->
<!-- </resultMap>-->
</mapper>

16
blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/mapper/PackageInfoMapper.java

@ -0,0 +1,16 @@
package com.logpm.factorydata.mwh.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.factorydata.mwh.entity.PackageInfoEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 装箱包信息 mapper
*
* @author zqb
* @since 2024-03-26
*/
@Mapper
public interface PackageInfoMapper extends BaseMapper<PackageInfoEntity> {
}

5
blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/mapper/PackageInfoMapper.xml

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.logpm.factorydata.mwh.mapper.PackageInfoMapper">
</mapper>

143
blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/mq/FactoryOrderListener.java

@ -0,0 +1,143 @@
package com.logpm.factorydata.mwh.mq;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.CharsetUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.core.util.URLUtil;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONConfig;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.factorydata.enums.SaxStatusEnums;
import com.logpm.factorydata.mwh.entity.DeliveryNoteEntity;
import com.logpm.factorydata.mwh.entity.FactoryOrderLogEntity;
import com.logpm.factorydata.mwh.entity.PackageInfoEntity;
import com.logpm.factorydata.mwh.service.DeliveryNoteService;
import com.logpm.factorydata.mwh.service.FactoryOrderLogService;
import com.logpm.factorydata.mwh.service.PackageInfoService;
import com.logpm.factorydata.mwh.vo.DeliveryNoteVO;
import com.logpm.factorydata.mwh.vo.PackageInfoVO;
import com.logpm.factorydata.mwh.vo.ReceiverVO;
import com.logpm.factorydata.mwh.vo.SenderVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.factorydata.FactoryDataConstants;
import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
/**
* 监听订单数据
*
* @author zhaoqiaobo
* @create 2024-03-18
*/
@Slf4j
@Component
@AllArgsConstructor
public class FactoryOrderListener {
private final DeliveryNoteService deliveryNoteService;
private final FactoryOrderLogService logService;
private final PackageInfoService packageInfoService;
@RabbitListener(bindings = @QueueBinding(
value = @Queue(name = FactoryDataConstants.Mq.Queues.MWH_FACTORY_ORDER),
exchange = @Exchange(name = FactoryDataConstants.Mq.Exchanges.FACTORY_ORDER, type = ExchangeTypes.TOPIC),
key = FactoryDataConstants.Mq.RoutingKeys.MWH_FACTORY_ORDER
))
@Transactional(rollbackFor = Exception.class)
public void factoryOrder(String msg) {
log.info("处理曼好家订单:{}", msg);
if (StrUtil.isEmpty(msg)) {
log.error("消息内容为空");
return;
}
FactoryOrderLogEntity logEntity = JSONUtil.toBean(msg, FactoryOrderLogEntity.class);
if (ObjectUtil.isEmpty(logEntity)) {
log.error("消息内容为空");
return;
}
// 去 minio 下载文件到本地,然后解析文件内容为实体对象
DeliveryNoteVO vo = null;
Long logId = logEntity.getId();
String logUrl = logEntity.getLogUrl();
if (StrUtil.isNotEmpty(logUrl)) {
List<String> res = new ArrayList<>();
FileUtil.readLines(URLUtil.url(logUrl), CharsetUtil.CHARSET_UTF_8, res);
if (CollUtil.isNotEmpty(res)) {
String content = res.get(0);
if (StrUtil.isNotEmpty(content)) {
JSONConfig config = new JSONConfig();
config.setIgnoreCase(Boolean.TRUE);
vo = JSONUtil.toBean(content, DeliveryNoteVO.class);
}
}
}
if (ObjectUtil.isEmpty(vo)) {
log.error("消息内容为空");
return;
}
// 1 解析数据保存入库
// 订单号唯一
String orderSelfNum = vo.getOrderSelfNum();
List<DeliveryNoteEntity> list = deliveryNoteService.list(Wrappers.<DeliveryNoteEntity>lambdaQuery()
.eq(DeliveryNoteEntity::getOrderSelfNum, orderSelfNum));
if (CollUtil.isNotEmpty(list)) {
log.error("订单号{} 数据已经处理过了, logId: {}", orderSelfNum, logId);
return;
}
DeliveryNoteEntity deliveryNoteEntity = new DeliveryNoteEntity();
BeanUtil.copyProperties(vo, deliveryNoteEntity);
ReceiverVO receiver = vo.getReceiver();
if(ObjectUtil.isNotEmpty(receiver)){
BeanUtil.copyProperties(receiver, deliveryNoteEntity);
}
SenderVO senderVO = vo.getSender();
if(ObjectUtil.isNotEmpty(senderVO)){
BeanUtil.copyProperties(senderVO, deliveryNoteEntity);
}
deliveryNoteEntity.setLogId(ObjectUtil.isNotEmpty(logId) ? logId.toString() : null);
deliveryNoteService.save(deliveryNoteEntity);
List<PackageInfoVO> orderInfos = vo.getItems();
if (CollUtil.isNotEmpty(orderInfos)) {
List<PackageInfoEntity> infoEntities = new ArrayList<>();
for (PackageInfoVO orderInfo : orderInfos) {
String attributes = orderInfo.getAttributes();
JSONArray objects = new JSONArray(attributes);
for (Object object : objects) {
PackageInfoEntity orderInfoEntity = new PackageInfoEntity();
BeanUtil.copyProperties(orderInfo, orderInfoEntity);
JSONObject object1 = (JSONObject) object;
String code = object1.getStr("code");
String name = object1.getStr("name");
orderInfoEntity.setCode(code);
orderInfoEntity.setName(name);
orderInfoEntity.setLogId(ObjectUtil.isNotEmpty(logId) ? logId.toString() : null);
orderInfoEntity.setDeliveryNoteId(deliveryNoteEntity.getId().toString());
infoEntities.add(orderInfoEntity);
}
}
packageInfoService.saveBatch(infoEntities);
}
// 2 构建暂存单,发送 mq 消息
FactoryOrderLogEntity logEntity1 = new FactoryOrderLogEntity();
logEntity1.setSaxStatus(SaxStatusEnums.SUCCESS.getCode());
logEntity1.setId(logId);
logService.saveOrUpdate(logEntity1);
// 处理暂存单
deliveryNoteService.buildAdvance(vo);
}
}

20
blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/pros/FactoryDataProperties.java

@ -0,0 +1,20 @@
package com.logpm.factorydata.mwh.pros;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
/**
* FactoryProperties
*
* @author pref
*/
@Data
@ConfigurationProperties(prefix = "logpm")
public class FactoryDataProperties {
/**
* 名称
*/
private String name;
}

18
blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/service/DeliveryNoteService.java

@ -0,0 +1,18 @@
package com.logpm.factorydata.mwh.service;
import com.logpm.factorydata.mwh.entity.DeliveryNoteEntity;
import com.logpm.factorydata.mwh.vo.DeliveryNoteVO;
import org.springblade.core.mp.base.BaseService;
/**
* 索菲亚发货单 服务类
*
* @Author zqb
* @Date 2024/4/26
**/
public interface DeliveryNoteService extends BaseService<DeliveryNoteEntity> {
void buildAdvance(DeliveryNoteVO entities);
}

17
blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/service/FactoryOrderLogService.java

@ -0,0 +1,17 @@
package com.logpm.factorydata.mwh.service;
import com.logpm.factorydata.mwh.entity.FactoryOrderLogEntity;
import com.logpm.factorydata.mwh.vo.DeliveryNoteVO;
import org.springblade.core.mp.base.BaseService;
/**
* 工厂订单日志 服务类
*
* @Author zqb
* @Date 2024/4/26
**/
public interface FactoryOrderLogService extends BaseService<FactoryOrderLogEntity> {
String order(DeliveryNoteVO vo);
}

15
blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/service/IFactoryTokenService.java

@ -0,0 +1,15 @@
package com.logpm.factorydata.mwh.service;
import com.logpm.factorydata.mwh.entity.FactoryToken;
import org.springblade.core.mp.base.BaseService;
import java.security.NoSuchAlgorithmException;
/**
* 工厂推送数据接口
*/
public interface IFactoryTokenService extends BaseService<FactoryToken> {
boolean verifyToken(String token, String corpId) throws NoSuchAlgorithmException;
}

14
blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/service/PackageInfoService.java

@ -0,0 +1,14 @@
package com.logpm.factorydata.mwh.service;
import com.logpm.factorydata.mwh.entity.PackageInfoEntity;
import org.springblade.core.mp.base.BaseService;
/**
* 装箱包信息 服务类
*
* @Author zqb
* @Date 2024/4/26
**/
public interface PackageInfoService extends BaseService<PackageInfoEntity> {
}

178
blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/service/impl/DeliveryNoteServiceImpl.java

@ -0,0 +1,178 @@
package com.logpm.factorydata.mwh.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.logpm.factorydata.base.feign.IFactoryDataBaseClient;
import com.logpm.factorydata.base.vo.FactoryWarehouseBindVO;
import com.logpm.factorydata.enums.BrandEnums;
import com.logpm.factorydata.feign.IFactoryDataClient;
import com.logpm.factorydata.mwh.entity.DeliveryNoteEntity;
import com.logpm.factorydata.mwh.entity.PackageInfoEntity;
import com.logpm.factorydata.mwh.mapper.DeliveryNoteMapper;
import com.logpm.factorydata.mwh.service.DeliveryNoteService;
import com.logpm.factorydata.mwh.vo.DeliveryNoteVO;
import com.logpm.factorydata.mwh.vo.PackageInfoVO;
import com.logpm.factorydata.mwh.vo.SenderVO;
import com.logpm.factorydata.vo.SendMsg;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.annotations.LogpmAsync;
import org.springblade.common.constant.HttpConstants;
import org.springblade.common.constant.factorydata.FactoryDataConstants;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.api.R;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
/**
* 发货单 业务实现类
*
* @Author zqb
* @Date 2024/4/26
**/
@Slf4j
@Service
@AllArgsConstructor
public class DeliveryNoteServiceImpl extends BaseServiceImpl<DeliveryNoteMapper, DeliveryNoteEntity> implements DeliveryNoteService {
private final IFactoryDataBaseClient baseClient;
private final IFactoryDataClient factoryDataClient;
@Override
@LogpmAsync("asyncExecutor")
public void buildAdvance(DeliveryNoteVO vo) {
// 新起线程构建暂存单发送mq
Long startWarehouseId = null;
String startWarehouseName = null;
String tenantId = null;
// 获取工厂基地绑定的始发仓信息
R<FactoryWarehouseBindVO> warehouseByBrandAndSiteName = baseClient.getWarehouseByBrandAndSiteName(BrandEnums.MHJ.getValue(), BrandEnums.MHJ.getValue());
if (ObjectUtil.equal(HttpConstants.HTTP.HTTP_RESOURCE_CODE.SUCCESS_CODE, warehouseByBrandAndSiteName.getCode())) {
FactoryWarehouseBindVO data = warehouseByBrandAndSiteName.getData();
if (ObjectUtil.isNotNull(data)) {
startWarehouseId = data.getWarehouseId();
startWarehouseName = data.getWarehouseName();
tenantId = data.getTenantId();
}
}
List<PackageInfoVO> packages = vo.getItems();
// 组装暂存单数据
List<JSONObject> advances = new ArrayList<>();
TrunklineAdvanceEntity advanceEntity = new TrunklineAdvanceEntity();
advanceEntity.setTenantId(tenantId);
advanceEntity.setStatus(0);
advanceEntity.setIsDeleted(0);
advanceEntity.setHasPackage(CollUtil.isNotEmpty(packages) ? 1 : 0);
advanceEntity.setOrderType(vo.getOrderTypeName());
advanceEntity.setBrand(BrandEnums.MHJ.getValue());
advanceEntity.setSiteName("");
advanceEntity.setArea("");
advanceEntity.setTotalNum(StrUtil.isNotEmpty(vo.getTotalQuantity()) ? Convert.toInt(vo.getTotalQuantity()) : 0);
advanceEntity.setPackCode("");
advanceEntity.setWarehouseId(startWarehouseId);
advanceEntity.setWarehouseName(startWarehouseName);
advanceEntity.setIsGcp(0);
advanceEntity.setSystemType("线上");
advanceEntity.setMatingType("1");
advanceEntity.setWaybillStatus("0");
advanceEntity.setWaybillNo("");
advanceEntity.setFreezeStatus("0");
advanceEntity.setPackName("");
advanceEntity.setCarrierName("汇通");
SenderVO sender = vo.getSender();
if(ObjectUtil.isNotNull(sender)){
advanceEntity.setSenderName(vo.getSender().getSenderName());
advanceEntity.setSenderPhone(vo.getSender().getSenderMobile());
advanceEntity.setSenderAddress(vo.getSender().getSenderAddress());
}
advanceEntity.setTrainNumber("");
advanceEntity.setSenderFactory(BrandEnums.MHJ.getValue());
advanceEntity.setOrderCode(vo.getOrderSelfNum());
advanceEntity.setDealerCode(vo.getSiteCode());
advanceEntity.setDealerName(vo.getSiteName());
advanceEntity.setStoreCode(vo.getSiteCode());
advanceEntity.setStoreName(vo.getSiteName());
advanceEntity.setServiceNum(vo.getOrderNo());
if(ObjectUtil.isNotNull(vo.getReceiver())){
advanceEntity.setCustomerName(vo.getReceiver().getReceiverName());
advanceEntity.setCustomerPhone(vo.getReceiver().getReceiverMobile());
advanceEntity.setCustomerAddress(vo.getReceiver().getReceiverAddress());
}
List<JSONObject> packageList = new ArrayList<>();
if(CollUtil.isNotEmpty(packages)){
for (PackageInfoVO orderPackageDTO : packages) {
String attributes = orderPackageDTO.getAttributes();
JSONArray objects = new JSONArray(attributes);
for (Object object : objects) {
JSONObject object1 = (JSONObject) object;
String code = object1.getStr("code");
String name = object1.getStr("name");
// 封装包件
TrunklineAdvanceDetailEntity advanceDetailEntity = new TrunklineAdvanceDetailEntity();
advanceDetailEntity.setWarehouseId(startWarehouseId);
advanceDetailEntity.setWarehouseName(startWarehouseName);
advanceDetailEntity.setOrderCode(vo.getOrderSelfNum());
advanceDetailEntity.setBrand(BrandEnums.MHJ.getValue());
advanceDetailEntity.setSystemType("线上");
advanceDetailEntity.setFirstPackName(name);
//二级品类名称
advanceDetailEntity.setSecondPackName(name);
//三级品类名称
advanceDetailEntity.setThirdPackName(name);
advanceDetailEntity.setMaterialName("");
advanceDetailEntity.setSiteName("");
advanceDetailEntity.setSiteCode("");
advanceDetailEntity.setQuantity(1);
advanceDetailEntity.setOrderPackageCode(code);
advanceDetailEntity.setTrainNumber("");
advanceDetailEntity.setServiceNum(vo.getOrderNo());
advanceDetailEntity.setWaybillNo("");
advanceDetailEntity.setPackageStatus("0");
advanceDetailEntity.setWeight(BigDecimal.ZERO);
advanceDetailEntity.setVolume(BigDecimal.ZERO);
// advanceDetailEntity.setChargeType(0);
advanceDetailEntity.setSupple("");
advanceDetailEntity.setManifest("");
advanceDetailEntity.setReturnNum("");
advanceDetailEntity.setSendDateStr(DateUtil.formatLocalDateTime(LocalDateTime.now()));
advanceDetailEntity.setCarNumber("");
advanceDetailEntity.setGoodsMan("");
advanceDetailEntity.setTenantId(tenantId);
advanceDetailEntity.setStatus(0);
advanceDetailEntity.setIsDeleted(0);
JSONObject entries = JSONUtil.parseObj(advanceDetailEntity);
packageList.add(entries);
}
}
}
// 转成json对象,然后将包件明细放到detail中
JSONObject entries = JSONUtil.parseObj(advanceEntity);
entries.set("details", JSONUtil.toJsonStr(packageList));
advances.add(entries);
// 将组装好的暂存单发送到 MQ ,由暂存单服务统一消费SendMsg.
if (CollUtil.isNotEmpty(advances)) {
for (JSONObject advance : advances) {
SendMsg sendMsg = SendMsg.builder().exchange(FactoryDataConstants.Mq.Exchanges.ADVANCE_ORDER)
.routingKey(FactoryDataConstants.Mq.RoutingKeys.ADVANCE_ORDER).message(JSONUtil.toJsonStr(advance)).build();
factoryDataClient.sendMessage(sendMsg);
}
}
}
}

110
blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/service/impl/FactoryOrderLogServiceImpl.java

@ -0,0 +1,110 @@
package com.logpm.factorydata.mwh.service.impl;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONUtil;
import com.logpm.factorydata.enums.SaxStatusEnums;
import com.logpm.factorydata.feign.IFactoryDataClient;
import com.logpm.factorydata.mwh.entity.FactoryOrderLogEntity;
import com.logpm.factorydata.mwh.mapper.FactoryOrderLogMapper;
import com.logpm.factorydata.mwh.service.FactoryOrderLogService;
import com.logpm.factorydata.mwh.vo.DeliveryNoteVO;
import com.logpm.factorydata.vo.SendMsg;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.io.IOUtils;
import org.jetbrains.annotations.NotNull;
import org.springblade.common.constant.factorydata.FactoryDataConstants;
import org.springblade.common.utils.FileLogsUtil;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.oss.model.BladeFile;
import org.springblade.core.tool.api.R;
import org.springblade.resource.feign.IOssClient;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import java.io.File;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.file.Files;
/**
* 工厂订单日志 业务实现类
*
* @Author zqb
* @Date 2024/4/26
**/
@Slf4j
@Service
@AllArgsConstructor
public class FactoryOrderLogServiceImpl extends BaseServiceImpl<FactoryOrderLogMapper, FactoryOrderLogEntity> implements FactoryOrderLogService {
private final IFactoryDataClient factoryDataClient;
private final IOssClient ossClient;
@Override
public String order(DeliveryNoteVO vo) {
// 1 上传数据到 minio 获取到地址
String url = uploadFile(JSONUtil.toJsonStr(vo));
// 2 保存地址到数据库
FactoryOrderLogEntity logEntity = new FactoryOrderLogEntity();
logEntity.setType(1);
logEntity.setSaxStatus(SaxStatusEnums.NOMAL.getCode());
logEntity.setLogUrl(url);
this.save(logEntity);
// 3 将消息发送给 mq,解析保存
SendMsg build = SendMsg.builder().exchange(FactoryDataConstants.Mq.Exchanges.FACTORY_ORDER)
.routingKey(FactoryDataConstants.Mq.RoutingKeys.MWH_FACTORY_ORDER)
.message(JSONUtil.toJsonStr(logEntity)).build();
factoryDataClient.sendMessage(build);
return "成功";
}
private String uploadFile(String body) {
//文本内容和保存为本地文件 并上传
String logPath = FileLogsUtil.saveFileLogs(body);
log.info(">>> 文件路径 {}", logPath);
MultipartFile multi = getMultipartFile(logPath);
//上传到服务器
R r = ossClient.fileUpload(multi, "mwh-order-logs");
if (r.isSuccess()) {
BladeFile data = (BladeFile) r.getData();
// 删除本地文件
FileUtil.del(logPath);
return data.getLink();
}
return null;
}
@NotNull
private MultipartFile getMultipartFile(String logPath) {
File file = new File(logPath);
// File 转 MultipartFile
FileItem item = new DiskFileItemFactory().createItem("file"
, MediaType.MULTIPART_FORM_DATA_VALUE
, true
, file.getName());
try (
InputStream input = Files.newInputStream(file.toPath());
OutputStream os = item.getOutputStream()) {
// 流转移
IOUtils.copy(input, os);
} catch (Exception e) {
throw new IllegalArgumentException("Invalid file: " + e, e);
}
return new CommonsMultipartFile(item);
}
}

62
blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/service/impl/FactoryTokenServiceImpl.java

@ -0,0 +1,62 @@
package com.logpm.factorydata.mwh.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.logpm.factorydata.mwh.entity.FactoryToken;
import com.logpm.factorydata.mwh.mapper.FactoryTokenMapper;
import com.logpm.factorydata.mwh.service.IFactoryTokenService;
import lombok.AllArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.redis.cache.BladeRedis;
import org.springframework.stereotype.Service;
import java.security.NoSuchAlgorithmException;
import java.util.Objects;
@AllArgsConstructor
@Service
public class FactoryTokenServiceImpl extends BaseServiceImpl<FactoryTokenMapper, FactoryToken> implements IFactoryTokenService {
private static final Logger logger = LoggerFactory.getLogger(FactoryTokenServiceImpl.class);
private final BladeRedis bladeRedis;
@Override
public boolean verifyToken(String token, String corpId) throws NoSuchAlgorithmException {
logger.info("#########verifyToken: 验证token开始");
//先生成token摘要
// String tokenAbst = MD5Utils.md5Hex(token.getBytes(StandardCharsets.UTF_8));
//编写查询条件
String key = "corpId:" + corpId;
FactoryToken factoryToken = bladeRedis.get(key);
if (Objects.isNull(factoryToken)) {
QueryWrapper<FactoryToken> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("token", token);
factoryToken = baseMapper.selectOne(queryWrapper);
}
if (Objects.isNull(factoryToken)) {
logger.error("#########verifyToken: token1验证不通过 token={},corpid={}", token, corpId);
return false;
}
logger.info("#########verifyToken: 验证token 传入token {} 验证token {}", token, factoryToken.getToken());
if (!factoryToken.getToken().equals(token)) {
logger.error("#########verifyToken: token2验证不通过 token={},corpid={}", token, corpId);
return false;
}
Long expireTimeLong = factoryToken.getExpireTime().getTime();
Long now = System.currentTimeMillis();
//判断是否过期
if (now > expireTimeLong) {
logger.error("#########verifyToken: token验证不通过 已过期 token={},corpId={}", token, corpId);
return false;
}
return true;
}
}

22
blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/service/impl/PackageInfoServiceImpl.java

@ -0,0 +1,22 @@
package com.logpm.factorydata.mwh.service.impl;
import com.logpm.factorydata.mwh.entity.PackageInfoEntity;
import com.logpm.factorydata.mwh.mapper.PackageInfoMapper;
import com.logpm.factorydata.mwh.service.PackageInfoService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
/**
* 装箱包信息 业务实现类
*
* @Author zqb
* @Date 2024/4/26
**/
@Slf4j
@Service
@AllArgsConstructor
public class PackageInfoServiceImpl extends BaseServiceImpl<PackageInfoMapper, PackageInfoEntity> implements PackageInfoService {
}

93
blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/vo/DeliveryNoteVO.java

@ -0,0 +1,93 @@
package com.logpm.factorydata.mwh.vo;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.logpm.factorydata.mwh.entity.DeliveryNoteEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 送货单 实体类
*
* @author zhaoqiaobo
* @create 2024-04-26
*/
@Data
@ApiModel(value = "曼好家发运信息", description = "曼好家发运信息")
public class DeliveryNoteVO implements Serializable {
@JsonProperty("StoreCode")
@ApiModelProperty(value = "客户编码")
private String storeCode;
@JsonProperty("StoreName")
@ApiModelProperty(value = "客户简称")
private String storeName;
@JsonProperty("UserId")
@ApiModelProperty(value = "客户编码(100)")
private String userId;
@JsonProperty("UserName")
@ApiModelProperty(value = "客户名称(汇通)")
private String userName;
@JsonProperty("Sources")
@ApiModelProperty(value = "订单来源编码。例:品牌名称 (MWH)")
private String sources;
@JsonProperty("SourceName")
@ApiModelProperty(value = "订单来源名称。例:品牌名称 (曼好家)")
private String sourceName;
@JsonProperty("CompanyCode")
@ApiModelProperty(value = "公司编码")
private String companyCode;
@JsonProperty("CompanyName")
@ApiModelProperty(value = "公司名称")
private String companyName;
@JsonProperty("SiteCode")
@ApiModelProperty(value = "服务平台编码")
private String siteCode;
@JsonProperty("SiteName")
@ApiModelProperty(value = "服务平台编码")
private String siteName;
@JsonProperty("OrderNo")
@ApiModelProperty(value = "交割单号/服务号")
private String orderNo;
@JsonProperty("OrderSelfNum")
@ApiModelProperty(value = "订单号")
private String orderSelfNum;
@JsonProperty("TotalQuantity")
@ApiModelProperty(value = "计划总数量")
private String totalQuantity;
@JsonProperty("TotalWeight")
@ApiModelProperty(value = "计划总数量")
private String totalWeight;
@JsonProperty("TotalCapacity")
@ApiModelProperty(value = "计划总体积")
private String totalCapacity;
@JsonProperty("OrderType")
@ApiModelProperty(value = "订单类型编码:测试环境传“RI”")
private String orderType;
@JsonProperty("OrderTypeName")
@ApiModelProperty(value = "订单类型名称:测试环境传“采购入库单”")
private String orderTypeName;
@JsonProperty("ServiceType")
@ApiModelProperty(value = "服务类型编码:测试环境传“00”")
private String serviceType;
@JsonProperty("ServiceTypeName")
@ApiModelProperty(value = "服务类型名称:测试环境传“入库”")
private String serviceTypeName;
@JsonProperty("remark1")
@ApiModelProperty(value = "业务实体")
private String remark1;
@ApiModelProperty("包件列表")
@JsonProperty("Items")
private List<PackageInfoVO> items;
@ApiModelProperty("发货人")
@JsonProperty("Sender")
private SenderVO sender;
@ApiModelProperty("发货人")
@JsonProperty("Receiver")
private ReceiverVO receiver;
}

38
blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/vo/PackageInfoVO.java

@ -0,0 +1,38 @@
package com.logpm.factorydata.mwh.vo;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.logpm.factorydata.mwh.entity.PackageInfoEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
/**
* 装箱包信息
*
* @author zhaoqiaobo
* @create 2024-04-26
*/
@Data
@ApiModel(value = "装箱包信息", description = "装箱包信息")
public class PackageInfoVO implements Serializable {
@JsonProperty("Color")
@ApiModelProperty(value = "批次/色号:订单编号")
private String color;
@JsonProperty("SkuStatus")
@ApiModelProperty(value = "商品状态:默认为Y -良品")
private String skuStatus;
@JsonProperty("StoreCode")
@ApiModelProperty(value = "客户编码")
private String storeCode;
@JsonProperty("StoreName")
@ApiModelProperty(value = "客户简称")
private String storeName;
@JsonProperty("Attributes")
@ApiModelProperty(value = "包件明细")
private String attributes;
}

43
blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/vo/ReceiverVO.java

@ -0,0 +1,43 @@
package com.logpm.factorydata.mwh.vo;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.logpm.factorydata.mwh.entity.DeliveryNoteEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* 收货人
*
* @author zhaoqiaobo
* @create 2024-04-26
*/
@Data
@ApiModel(value = "曼好家订单收货人", description = "曼好家订单收货人")
public class ReceiverVO implements Serializable {
@JsonProperty("ReceiverAddress")
@ApiModelProperty(value = "收货人详细地址")
private String receiverAddress;
@JsonProperty("ReceiverArea")
@ApiModelProperty(value = "收货人区县")
private String receiverArea;
@JsonProperty("ReceiverCity")
@ApiModelProperty(value = "收货人城市")
private String receiverCity;
@JsonProperty("ReceiverMobile")
@ApiModelProperty(value = "收货人联系方式")
private String receiverMobile;
@JsonProperty("ReceiverName")
@ApiModelProperty(value = "加盟商")
private String receiverName;
@JsonProperty("ConsigneeName")
@ApiModelProperty(value = "收货人")
private String consigneeName;
@JsonProperty("ReceiverProvince")
@ApiModelProperty(value = "收货人省份")
private String receiverProvince;
}

41
blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/vo/SenderVO.java

@ -0,0 +1,41 @@
package com.logpm.factorydata.mwh.vo;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.logpm.factorydata.mwh.entity.DeliveryNoteEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 发货人
*
* @author zhaoqiaobo
* @create 2024-04-26
*/
@Data
@ApiModel(value = "曼好家订单发货人", description = "曼好家订单发货人")
public class SenderVO implements Serializable {
@JsonProperty("SenderAddress")
@ApiModelProperty(value = "发货人详细地址")
private String senderAddress;
@JsonProperty("SenderCity")
@ApiModelProperty(value = "发货人城市")
private String senderCity;
@JsonProperty("SenderMobile")
@ApiModelProperty(value = "发货人联系方式")
private String senderMobile;
@JsonProperty("SenderName")
@ApiModelProperty(value = "发货工厂名称")
private String senderName;
@JsonProperty("SenderProvince")
@ApiModelProperty(value = "发货人省份")
private String senderProvince;
@JsonProperty("SenderArea")
@ApiModelProperty(value = "发货人区县")
private String senderArea;
}

38
blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/wrapper/CustomHttpServletRequestWrapper.java

@ -0,0 +1,38 @@
package com.logpm.factorydata.mwh.wrapper;
import org.springframework.http.HttpHeaders;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import java.util.Collections;
import java.util.Enumeration;
import java.util.List;
public class CustomHttpServletRequestWrapper extends HttpServletRequestWrapper {
private final HttpHeaders headers;
public CustomHttpServletRequestWrapper(HttpServletRequest request) {
super(request);
headers = new HttpHeaders();
}
@Override
public String getHeader(String name) {
String headerValue = headers.getFirst(name);
return headerValue != null ? headerValue : super.getHeader(name);
}
@Override
public Enumeration<String> getHeaderNames() {
List<String> names = Collections.list(super.getHeaderNames());
headers.forEach((key, value) -> names.add(key));
return Collections.enumeration(names);
}
// 其他需要覆盖的方法...
public void addHeader(String name, String value) {
headers.add(name, value);
}
}

75
blade-service/logpm-factory-data/logpm-factory-data-mwh/src/main/java/com/logpm/factorydata/mwh/wrapper/RequestWrapper.java

@ -0,0 +1,75 @@
package com.logpm.factorydata.mwh.wrapper;
import javax.servlet.ReadListener;
import javax.servlet.ServletInputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
public class RequestWrapper extends HttpServletRequestWrapper {
private final String body;
public RequestWrapper(HttpServletRequest request) throws IOException {
super(request);
StringBuilder stringBuilder = new StringBuilder();
BufferedReader bufferedReader = null;
try {
InputStream inputStream = request.getInputStream();
if (inputStream != null) {
bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
char[] charBuffer = new char[128];
int bytesRead = -1;
while ((bytesRead = bufferedReader.read(charBuffer)) > 0) {
stringBuilder.append(charBuffer, 0, bytesRead);
}
} else {
stringBuilder.append("");
}
} catch (IOException ex) {
throw ex;
} finally {
if (bufferedReader != null) {
try {
bufferedReader.close();
} catch (IOException ex) {
throw ex;
}
}
}
body = stringBuilder.toString();
}
@Override
public ServletInputStream getInputStream() throws IOException {
final ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(body.getBytes());
ServletInputStream servletInputStream = new ServletInputStream() {
@Override
public boolean isFinished() {
return false;
}
@Override
public boolean isReady() {
return false;
}
@Override
public void setReadListener(ReadListener readListener) {}
@Override
public int read() throws IOException {
return byteArrayInputStream.read();
}
};
return servletInputStream;
}
@Override
public BufferedReader getReader() throws IOException {
return new BufferedReader(new InputStreamReader(this.getInputStream()));
}
public String getBody() {
return this.body;
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save