Browse Source

Merge remote-tracking branch 'origin/pre-production'

master
zhenghaoyu 2 months ago
parent
commit
30696b5a66
  1. 7
      blade-biz-common/src/main/java/org/springblade/common/constant/factorydata/FactoryDataConstants.java
  2. 6
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesProcessingMoneyEntity.java
  3. 7
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesWorkOrderEntity.java
  4. 49
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderAllPageVO.java
  5. 28
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderAppealPageVO.java
  6. 64
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderCompensationPageVO.java
  7. 64
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderCompletePageVO.java
  8. 76
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderEndPageVO.java
  9. 65
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderExaminePageVO.java
  10. 65
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderInterventionPageVO.java
  11. 44
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderProcessPageVO.java
  12. 44
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderReplyPageVO.java
  13. 26
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderTimeOutPageVO.java
  14. 42
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/apicontroller/AftersalesWorkOrderAppController.java
  15. 77
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java
  16. 4
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/dto/AftersalesWorkOrderQueryDTO.java
  17. 190
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderAllExcel.java
  18. 56
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderAppealExcel.java
  19. 166
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderCompensationExcel.java
  20. 166
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderCompleteExcel.java
  21. 232
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderEndExcel.java
  22. 172
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderExamineExcel.java
  23. 172
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderInterventionExcel.java
  24. 159
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderProcessExcel.java
  25. 159
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderReplyExcel.java
  26. 58
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderTimeOutExcel.java
  27. 2
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/jobhandler/AftersalesXxlJob.java
  28. 135
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.java
  29. 3568
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml
  30. 43
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/IAftersalesWorkOrderService.java
  31. 1202
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java
  32. 5
      blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/impl/LogpmDataSearchServiceImpl.java
  33. 59
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionSignforAppController.java
  34. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml
  35. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java
  36. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml
  37. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml
  38. 19
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/ReportListener.java
  39. 48
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java
  40. 44
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  41. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  42. 118
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  43. 35
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java
  44. 24
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java
  45. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java
  46. 37
      blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/config/InterceptorAdapterConfig.java
  47. 41
      blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/controller/OrderController.java
  48. 88
      blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/entity/JpFactoryOrderEntity.java
  49. 72
      blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/entity/JpFactoryPackageEntity.java
  50. 64
      blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/entity/JpFactoryShipmentEntity.java
  51. 136
      blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/interceptor/FactoryAccountsInterceptor.java
  52. 39
      blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/interceptor/LocalServerLoginAccountsInterceptor.java
  53. 16
      blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/mapper/JpFactoryOrderMapper.java
  54. 5
      blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/mapper/JpFactoryOrderMapper.xml
  55. 16
      blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/mapper/JpFactoryPackageMapper.java
  56. 5
      blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/mapper/JpFactoryPackageMapper.xml
  57. 21
      blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/mapper/JpFactoryShipmentMapper.java
  58. 16
      blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/mapper/JpFactoryShipmentMapper.xml
  59. 275
      blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/mq/FactoryOrderListener.java
  60. 6
      blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/pros/JinPaiProperties.java
  61. 3
      blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/DeliveryNoteService.java
  62. 14
      blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/JpFactoryOrderService.java
  63. 14
      blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/JpFactoryPackageService.java
  64. 19
      blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/JpFactoryShipmentService.java
  65. 14
      blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/MqWorkerService.java
  66. 157
      blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/impl/DeliveryNoteServiceImpl.java
  67. 22
      blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/impl/JpFactoryOrderServiceImpl.java
  68. 22
      blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/impl/JpFactoryPackageServiceImpl.java
  69. 137
      blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/impl/JpFactoryShipmentServiceImpl.java
  70. 356
      blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/impl/MqWorkerServiceImpl.java
  71. 28
      blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/vo/FactoryAuthVO.java
  72. 27
      blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/vo/FactoryOrderDataVO.java
  73. 25
      blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/vo/JpFactoryOrderVO.java
  74. 21
      blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/vo/JpFactoryPackageVO.java
  75. 25
      blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/vo/JpFactoryShipmentVO.java
  76. 2
      blade-service/logpm-report/src/main/java/com/logpm/report/job/LargeScreenQueryXxlJob.java
  77. 10
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.xml
  78. 9
      blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportTimeServiceImpl.java
  79. 6
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BillingDataServiceImpl.java
  80. 2
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BinLocationServiceImpl.java
  81. 2
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BusinessRationServiceImpl.java
  82. 2
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/CarsLoadDataServiceImpl.java
  83. 2
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/DeliveryDataServiceImpl.java
  84. 2
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/MapWarehouseServiceImpl.java
  85. 2
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/NodeDataServiceImpl.java
  86. 2
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/TrunkDataServiceImpl.java
  87. 3
      blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportOrderAllTimeVO.java
  88. 3
      blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportPackgeStartTimeVO.java
  89. 12
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/WaybillCheckListener.java
  90. 20
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mq/AdvanceOrderListener.java
  91. 1
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IAdvanceOrderMqService.java
  92. 138
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/AdvanceOrderMqServiceImpl.java
  93. 8
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java
  94. 4
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java
  95. 66
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java
  96. 3
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml

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

@ -59,6 +59,10 @@ public abstract class FactoryDataConstants {
* 工厂数据转暂存单
*/
String ADVANCE_ORDER_OUPAI = "factory.data.queue.advanceOrder.oupai" + DEVAUTH;
/**
* 工厂数据转暂存单
*/
String ADVANCE_ORDER_JP = "factory.data.queue.advanceOrder.jp" + DEVAUTH;
/**
* 志邦作业节点数据推送
@ -90,6 +94,7 @@ public abstract class FactoryDataConstants {
*/
String JP_NODE_DATA_PUSH = "factory.data.queue.jp.nodeDataPush" + DEVAUTH;
String JP_FACTORY_ORDER = "factory.data.queue.jp.factoryOrder" + DEVAUTH;
String JP_FACTORY_SHIPMENT = "factory.data.queue.jp.factoryShipment" + DEVAUTH;
/**
* 皮阿诺作业节点数据推送
*/
@ -112,6 +117,7 @@ public abstract class FactoryDataConstants {
* 工厂数据转暂存单
*/
String ADVANCE_ORDER = "advanceOrder" + DEVAUTH;
String ADVANCE_ORDER_JP = "advanceOrder.jp" + DEVAUTH;
/**
* 志邦作业节点数据推送
*/
@ -142,6 +148,7 @@ public abstract class FactoryDataConstants {
*/
String JP_NODE_DATA_PUSH = "jp.nodeDataPush" + DEVAUTH;
String JP_FACTORY_ORDER = "jp.factoryOrder" + DEVAUTH;
String JP_FACTORY_SHIPMENT = "jp.factoryShipment" + DEVAUTH;
/**
* 皮阿诺作业节点数据推送
*/

6
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesProcessingMoneyEntity.java

@ -103,6 +103,12 @@ public class AftersalesProcessingMoneyEntity extends TenantEntity {
*/
@ApiModelProperty(value = "支付单位")
private String paymentUnit;
/**
* 工单Id
*/
@ApiModelProperty(value = "工单Id")
private Long workOrderId;
/**
* 类型
*/

7
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesWorkOrderEntity.java

@ -244,6 +244,13 @@ public class AftersalesWorkOrderEntity extends TenantEntity {
@ApiModelProperty(value = "审核时间")
@JsonFormat(locale = "zh",timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
private Date auditTime;
/**
* 审核时间
*/
@ApiModelProperty(value = "审核时间")
@JsonFormat(locale = "zh",timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
private Date commitTime;
/**
* 财务入账时间
*/

49
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderAllPageVO.java

@ -0,0 +1,49 @@
package com.logpm.aftersales.vo;
import com.logpm.aftersales.entity.AftersaleSurveyRecordEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class AftersalesWorkOrderAllPageVO implements Serializable {
private static final long serialVersionUID = 1L;
private Long id;
private String workOrderType;
private String workOrderTypeName;
private String discoveryNode;
private String discoveryNodeName;
private String warehouseName;
private String workOrderNumber;
private String waybillNumber;
private String orderCode;
private String packageCode;
private String brandName;
private String waybillMall;
private String first;
private String secondary;
private String thirdProduct;
private String workOrderStatus;
private String workOrderStatusName;
private String processedBy;
private String responsiblePerson;
private Date createTime;
private Date endCreateTime;
private Date updateTime;
private String resultType;
private BigDecimal money;
private String warehouseServiceName;
private String headquartersName;
private String overTime;
private String isAppeal;
private String appealStatus;
private String appealStatusName;
private String processNumber;
private Date entryTime;
private String entryMonthTime;
}

28
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderAppealPageVO.java

@ -0,0 +1,28 @@
package com.logpm.aftersales.vo;
import com.logpm.aftersales.entity.AftersaleSurveyRecordEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class AftersalesWorkOrderAppealPageVO implements Serializable {
private static final long serialVersionUID = 1L;
private Long id;
private Long workOrderId;
private String workOrderNumber;
private String workOrderStatus;
private String workOrderType;
private String warehouseName;
private String waybillNumber;
private String orderCode;
private String discoveryNode;
private String workOrderTypeName;
private String discoveryNodeName;
private String appealStatus;
private String appealStatusName;
}

64
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderCompensationPageVO.java

@ -0,0 +1,64 @@
/*
* 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.vo;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* 客服异常工单 视图实体类
*
* @author BladeX
* @since 2023-11-17
*/
@Data
public class AftersalesWorkOrderCompensationPageVO {
private Long id;
private String workOrderType;
private String discoveryNode;
private String workOrderStatus;
private String workOrderTypeName;
private String discoveryNodeName;
private String warehouseName;
private String workOrderNumber;
private String waybillNumber;
private String orderCode;
private String packageCode;
private String brandName;
private String waybillMall;
private String first;
private String secondary;
private String thirdProduct;
private String workOrderStatusName;
private String processedBy;
private String responsiblePerson;
private Date createTime;
private Date updateTime;
private String resultType;
private BigDecimal money;
private String warehouseServiceName;
private String headquartersName;
private String businessName;
private String personResponsibleName;
private BigDecimal responsibilityRatio;
private String content;
}

64
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderCompletePageVO.java

@ -0,0 +1,64 @@
/*
* 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.vo;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* 客服异常工单 视图实体类
*
* @author BladeX
* @since 2023-11-17
*/
@Data
public class AftersalesWorkOrderCompletePageVO {
private Long id;
private String workOrderType;
private String discoveryNode;
private String workOrderStatus;
private String workOrderTypeName;
private String discoveryNodeName;
private String warehouseName;
private String workOrderNumber;
private String waybillNumber;
private String orderCode;
private String packageCode;
private String brandName;
private String waybillMall;
private String first;
private String secondary;
private String thirdProduct;
private String workOrderStatusName;
private String processedBy;
private String responsiblePerson;
private Date createTime;
private Date commitTime;
private String resultType;
private BigDecimal money;
private String warehouseServiceName;
private String headquartersName;
private String businessName;
private String personResponsibleName;
private BigDecimal responsibilityRatio;
private String content;
}

76
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderEndPageVO.java

@ -0,0 +1,76 @@
/*
* 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.vo;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* 客服异常工单 视图实体类
*
* @author BladeX
* @since 2023-11-17
*/
@Data
public class AftersalesWorkOrderEndPageVO {
private Long id;
private String workOrderType;
private String discoveryNode;
private String workOrderStatus;
private String workOrderTypeName;
private String discoveryNodeName;
private String warehouseName;
private String workOrderNumber;
private String waybillNumber;
private String orderCode;
private String packageCode;
private String brandName;
private String waybillMall;
private String first;
private String secondary;
private String thirdProduct;
private String workOrderStatusName;
private String processedBy;
private String responsiblePerson;
private Date createTime;
private Date commitTime;
private Date arbitrationTime;
private Date auditTime;
private String resultType;
private BigDecimal money;
private String warehouseServiceName;
private String headquartersName;
private String indemnitorInfo;
private BigDecimal indemnitorMoney;
private String responsibleInfo;
private BigDecimal responsibleMoney;
private String businessName;
private String personResponsibleName;
private BigDecimal responsibilityRatio;
private String reasonArbitration;
private String isAppeal;
private String appealStatus;
private String appealStatusName;
private String processNumber;
private Date entryTime;
private String entryMonthTime;
}

65
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderExaminePageVO.java

@ -0,0 +1,65 @@
/*
* 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.vo;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* 客服异常工单 视图实体类
*
* @author BladeX
* @since 2023-11-17
*/
@Data
public class AftersalesWorkOrderExaminePageVO {
private Long id;
private String workOrderType;
private String discoveryNode;
private String workOrderStatus;
private String workOrderTypeName;
private String discoveryNodeName;
private String warehouseName;
private String workOrderNumber;
private String waybillNumber;
private String orderCode;
private String packageCode;
private String brandName;
private String waybillMall;
private String first;
private String secondary;
private String thirdProduct;
private String workOrderStatusName;
private String processedBy;
private String responsiblePerson;
private Date createTime;
private Date commitTime;
private Date overTime;
private String resultType;
private BigDecimal money;
private String warehouseServiceName;
private String headquartersName;
private String businessName;
private String personResponsibleName;
private BigDecimal responsibilityRatio;
private String content;
}

65
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderInterventionPageVO.java

@ -0,0 +1,65 @@
/*
* 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.vo;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* 客服异常工单 视图实体类
*
* @author BladeX
* @since 2023-11-17
*/
@Data
public class AftersalesWorkOrderInterventionPageVO {
private Long id;
private String workOrderType;
private String discoveryNode;
private String workOrderStatus;
private String workOrderTypeName;
private String discoveryNodeName;
private String warehouseName;
private String workOrderNumber;
private String waybillNumber;
private String orderCode;
private String packageCode;
private String brandName;
private String waybillMall;
private String first;
private String secondary;
private String thirdProduct;
private String workOrderStatusName;
private String processedBy;
private String responsiblePerson;
private Date createTime;
private Date endCreateTime;
private Date updateTime;
private String resultType;
private BigDecimal money;
private String warehouseServiceName;
private String businessName;
private String personResponsibleName;
private BigDecimal responsibilityRatio;
private String content;
private String isTimedOut;
}

44
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderProcessPageVO.java

@ -0,0 +1,44 @@
package com.logpm.aftersales.vo;
import com.logpm.aftersales.entity.AftersaleSurveyRecordEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class AftersalesWorkOrderProcessPageVO implements Serializable {
private static final long serialVersionUID = 1L;
private Long id;
private String workOrderType;
private String workOrderTypeName;
private String discoveryNode;
private String discoveryNodeName;
private String warehouseName;
private String workOrderNumber;
private String waybillNumber;
private String orderCode;
private String packageCode;
private String brandName;
private String waybillMall;
private String first;
private String secondary;
private String thirdProduct;
private String workOrderStatus;
private String workOrderStatusName;
private String processedBy;
private String responsiblePerson;
private Date createTime;
private Date endCreateTime;
private Date updateTime;
private String resultType;
private String warehouseServiceName;
private String businessName;
private String personResponsibleName;
private String responsibilityRatio;
private String content;
}

44
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderReplyPageVO.java

@ -0,0 +1,44 @@
package com.logpm.aftersales.vo;
import com.logpm.aftersales.entity.AftersaleSurveyRecordEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class AftersalesWorkOrderReplyPageVO implements Serializable {
private static final long serialVersionUID = 1L;
private Long id;
private String workOrderType;
private String workOrderTypeName;
private String discoveryNode;
private String discoveryNodeName;
private String warehouseName;
private String workOrderNumber;
private String waybillNumber;
private String orderCode;
private String packageCode;
private String brandName;
private String waybillMall;
private String first;
private String secondary;
private String thirdProduct;
private String workOrderStatus;
private String workOrderStatusName;
private String processedBy;
private String responsiblePerson;
private Date createTime;
private Date endCreateTime;
private Date updateTime;
private String isTimedOut;
private String warehouseServiceName;
private String businessName;
private String personResponsibleName;
private String responsibilityRatio;
private String content;
}

26
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderTimeOutPageVO.java

@ -0,0 +1,26 @@
package com.logpm.aftersales.vo;
import com.logpm.aftersales.entity.AftersaleSurveyRecordEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class AftersalesWorkOrderTimeOutPageVO implements Serializable {
private static final long serialVersionUID = 1L;
private Long id;
private Long workOrderId;
private String workOrderNumber;
private String workOrderType;
private String workOrderTypeName;
private String discoveryNode;
private String discoveryNodeName;
private BigDecimal money;
private String timeout;
private String processedBy;
private String remarks;
}

42
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/apicontroller/AftersalesWorkOrderAppController.java

@ -22,27 +22,27 @@ public class AftersalesWorkOrderAppController {
private final IAftersalesWorkOrderService aftersalesWorkOrderService;
@PostMapping("/addWorkOrder")
public R addWorkOrder(@RequestBody AftersalesWorkOrderDTO aftersalesWorkOrderDTO){
aftersalesWorkOrderDTO.setInitiationIdentification("PDA");
return R.data(aftersalesWorkOrderService.addWorkOrder(aftersalesWorkOrderDTO));
}
@PostMapping("/aftersalesPackageScan")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "工单包件扫描", notes = "传入aftersalesAppeal")
public R<List<AftersalesAbnormalPackageVO>> aftersalesPackageScan(@RequestBody AftersalesPackageScanDTO aftersalesPackageScanDTO){
return R.data(aftersalesWorkOrderService.aftersalesPackageScan(aftersalesPackageScanDTO));
}
@PostMapping("/saveAfterSalesOrder")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "PDA保存异常工单", notes = "传入aftersalesAppeal")
public R saveAfterSalesOrder(@RequestBody AftersalesWorkOrderDTO aftersalesWorkOrderDTO){
return aftersalesWorkOrderService.saveAfterSalesOrder(aftersalesWorkOrderDTO);
}
// @PostMapping("/addWorkOrder")
// public R addWorkOrder(@RequestBody AftersalesWorkOrderDTO aftersalesWorkOrderDTO){
// aftersalesWorkOrderDTO.setInitiationIdentification("PDA");
// return R.data(aftersalesWorkOrderService.addWorkOrder(aftersalesWorkOrderDTO));
// }
// @PostMapping("/aftersalesPackageScan")
// @ApiOperationSupport(order = 1)
// @ApiOperation(value = "工单包件扫描", notes = "传入aftersalesAppeal")
// public R<List<AftersalesAbnormalPackageVO>> aftersalesPackageScan(@RequestBody AftersalesPackageScanDTO aftersalesPackageScanDTO){
// return R.data(aftersalesWorkOrderService.aftersalesPackageScan(aftersalesPackageScanDTO));
// }
// @PostMapping("/saveAfterSalesOrder")
// @ApiOperationSupport(order = 1)
// @ApiOperation(value = "PDA保存异常工单", notes = "传入aftersalesAppeal")
// public R saveAfterSalesOrder(@RequestBody AftersalesWorkOrderDTO aftersalesWorkOrderDTO){
// return aftersalesWorkOrderService.saveAfterSalesOrder(aftersalesWorkOrderDTO);
// }

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

@ -41,6 +41,7 @@ import com.logpm.aftersales.service.IAftersalesCompletionRecipientService;
import com.logpm.aftersales.service.IAftersalesCompletionRecordService;
import com.logpm.aftersales.service.IAftersalesPersonResponsibleService;
import com.logpm.aftersales.service.IAftersalesWorkOrderService;
import com.logpm.aftersales.vo.AftersalesPersonResponsibleVO;
import com.logpm.aftersales.vo.AftersalesWorkOrderVO;
import com.logpm.aftersales.wrapper.AftersalesWorkOrderWrapper;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
@ -160,21 +161,7 @@ public class AftersalesWorkOrderController extends BladeController {
}
/**
* 客服异常工单 查询异常工单完整数据集合
*/
@PostMapping("/pageAllList")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "查询异常工单完整数据集合", notes = "传入aftersalesWorkOrder")
public R ageAllList(@ApiIgnore @RequestBody AftersalesWorkOrderQueryDTO workOrderQueryDTO, Query query) {
try {
R r = aftersalesWorkOrderService.ageAllList(workOrderQueryDTO, Condition.getPage(query));
return r;
} catch (Exception e) {
log.error("工单查询系统异常》》》{}", e.getMessage());
return R.fail("系统异常!");
}
}
@ -297,7 +284,7 @@ public class AftersalesWorkOrderController extends BladeController {
if (ObjectUtils.isNull(aftersalesWorkOrderDTO.getSurveyRecordDTO().getContent())) {
throw new ServiceException("内容不能为空!!");
}
return R.status(aftersalesWorkOrderService.savaSurveyRecord(aftersalesWorkOrderDTO));
return aftersalesWorkOrderService.savaSurveyRecord(aftersalesWorkOrderDTO);
} catch (ServiceException s) {
return R.fail(s.getMessage());
} catch (Exception e) {
@ -676,7 +663,6 @@ public class AftersalesWorkOrderController extends BladeController {
log.error("填写钉钉流程号异常》》{}", e.getMessage());
return R.fail("系统异常!!!");
}
}
/**
@ -695,14 +681,13 @@ public class AftersalesWorkOrderController extends BladeController {
}
try {
aftersalesWorkOrder.setInitiationIdentification("PC");
return R.status(aftersalesWorkOrderService.saveOrUpdateOwn(aftersalesWorkOrder));
return aftersalesWorkOrderService.saveOrUpdateOwn(aftersalesWorkOrder);
} catch (ServiceException s) {
return R.fail(s.getMessage());
} catch (Exception e) {
log.error("工单提交异常》》》{}", e.getMessage());
return R.fail(e.getMessage());
}
}
@ -1413,6 +1398,26 @@ public class AftersalesWorkOrderController extends BladeController {
return R.success("操作成功");
}
/**
* 修改内部责任信息
*/
@PostMapping("/updatePersonResponsible")
@ApiOperationSupport(order = 13)
@ApiOperation(value = "写入财务入账时间", notes = "传入aftersalesWorkOrder")
public R updatePersonResponsible(@Valid @RequestBody AftersalesWorkOrderVO aftersalesWorkOrderVO) {
if (Objects.isNull(aftersalesWorkOrderVO.getPersonResponsibleVOS())){
return R.fail("参数缺失,请联系管理员");
}
if (Objects.isNull(aftersalesWorkOrderVO.getId())){
return R.fail("参数缺失,请联系管理员");
}
List<AftersalesPersonResponsibleVO> personResponsibleVOS = aftersalesWorkOrderVO.getPersonResponsibleVOS();
Long id = aftersalesWorkOrderVO.getId();
return aftersalesWorkOrderService.updatePersonResponsible(id, personResponsibleVOS);
}
/**
* 写入财务入账时间
*/
@ -1431,4 +1436,38 @@ public class AftersalesWorkOrderController extends BladeController {
}
/**
* 客服异常工单 查询异常工单完整数据集合
*/
@PostMapping("/newPage")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "查询", notes = "传入aftersalesWorkOrder")
public R newPage(@ApiIgnore @RequestBody AftersalesWorkOrderQueryDTO workOrderQueryDTO, Query query,@RequestParam Integer pageType) {
try {
R r = aftersalesWorkOrderService.newPage(workOrderQueryDTO,query,pageType);
return r;
} catch (Exception e) {
log.error("工单查询系统异常》》》{}", e.getMessage());
return R.fail("系统异常!");
}
}
/**
* 客服异常工单 查询异常工单完整数据集合
*/
@PostMapping("/newExport")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "查询", notes = "传入aftersalesWorkOrder")
public void newExport(@ApiIgnore @RequestBody AftersalesWorkOrderQueryDTO workOrderQueryDTO, Query query,@RequestParam Integer pageType,HttpServletResponse response) {
try {
aftersalesWorkOrderService.newExport(workOrderQueryDTO,query,pageType,response);
} catch (Exception e) {
log.error("工单查询系统异常》》》{}", e.getMessage());
}
}
}

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

@ -36,6 +36,9 @@ public class AftersalesWorkOrderQueryDTO extends AftersalesWorkOrderEntity {
private String workOrderType;
private String discoveryNode;
private String resultType;
private String businessName;
private String personResponsibleName;
private String workOrderNumber;
private String waybillNumber;
private String orderCode;
@ -46,6 +49,7 @@ public class AftersalesWorkOrderQueryDTO extends AftersalesWorkOrderEntity {
private String workOrderStatus;
private String processedBy;
private String ceator;
private String exportIds;
private Date startCreateTime;
private Date endCreateTime;
private Date createTime;

190
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderAllExcel.java

@ -0,0 +1,190 @@
package com.logpm.aftersales.excel;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
@ColumnWidth(25)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class AftersalesWorkOrderAllExcel implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 异常类型
*/
@ColumnWidth(20)
@ExcelProperty("异常类型")
private String workOrderTypeName;
/**
* 发现节点
*/
@ColumnWidth(20)
@ExcelProperty("发现节点")
private String discoveryNodeName;
/**
* 工单创建仓
*/
@ColumnWidth(20)
@ExcelProperty("工单创建仓")
private String warehouseName;
/**
* 异常工单号
*/
@ColumnWidth(20)
@ExcelProperty("异常工单号")
private String workOrderNumber;
/**
* 运单号
*/
@ColumnWidth(20)
@ExcelProperty("运单号")
private String waybillNumber;
/**
* 订单自编号
*/
@ColumnWidth(20)
@ExcelProperty("订单自编号")
private String orderCode;
/**
* 包条码
*/
@ColumnWidth(20)
@ExcelProperty("包条码")
private String packageCode;
/**
* 品牌
*/
@ColumnWidth(20)
@ExcelProperty("品牌")
private String brandName;
/**
* 商场名称
*/
@ColumnWidth(20)
@ExcelProperty("商场名称")
private String waybillMall;
/**
* 一级品
*/
@ColumnWidth(20)
@ExcelProperty("一级品")
private String first;
/**
* 二级品
*/
@ColumnWidth(20)
@ExcelProperty("二级品")
private String secondary;
/**
* 三级品
*/
@ColumnWidth(20)
@ExcelProperty("三级品")
private String thirdProduct;
/**
* 工单状态
*/
@ColumnWidth(20)
@ExcelProperty("工单状态")
private String workOrderStatusName;
/**
* 工单处理方
*/
@ColumnWidth(20)
@ExcelProperty("工单处理方")
private String processedBy;
/**
* 责任方
*/
@ColumnWidth(20)
@ExcelProperty("责任方")
private String responsiblePerson;
/**
* 工单创建时间
*/
@ColumnWidth(20)
@ExcelProperty("工单创建时间")
private Date createTime;
/**
* 最晚处理时间
*/
@ColumnWidth(20)
@ExcelProperty("最晚处理时间")
private Date endCreateTime;
/**
* 最新操作时间
*/
@ColumnWidth(20)
@ExcelProperty("最新操作时间")
private Date updateTime;
/**
* 处理结果
*/
@ColumnWidth(20)
@ExcelProperty("处理结果")
private String resultType;
/**
* 处理结果
*/
@ColumnWidth(20)
@ExcelProperty("处理结果--理赔金额")
private BigDecimal money;
/**
* 营业部处理客服
*/
@ColumnWidth(20)
@ExcelProperty("营业部处理客服")
private String warehouseServiceName;
/**
* 总部处理客服
*/
@ColumnWidth(20)
@ExcelProperty("总部处理客服")
private String headquartersName;
/**
* 完结时间
*/
@ColumnWidth(20)
@ExcelProperty("完结时间")
private String overTime;
/**
* 是否申诉
*/
@ColumnWidth(20)
@ExcelProperty("是否申诉")
private String isAppeal;
/**
* 申诉状态
*/
@ColumnWidth(20)
@ExcelProperty("申诉状态")
private String appealStatusName;
/**
* 钉钉号
*/
@ColumnWidth(20)
@ExcelProperty("钉钉号")
private String processNumber;
/**
* 财务入账时间
*/
@ColumnWidth(20)
@ExcelProperty("财务入账时间")
private Date entryTime;
/**
* 财务入账月份
*/
@ColumnWidth(20)
@ExcelProperty("财务入账月份")
private Date entryMonthTime;
}

56
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderAppealExcel.java

@ -0,0 +1,56 @@
package com.logpm.aftersales.excel;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
@ColumnWidth(25)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class AftersalesWorkOrderAppealExcel implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 异常工单号
*/
@ColumnWidth(20)
@ExcelProperty("异常工单号")
private String workOrderNumber;
/**
* 异常类型
*/
@ColumnWidth(20)
@ExcelProperty("异常类型")
private String workOrderTypeName;
/**
* 发现节点
*/
@ColumnWidth(20)
@ExcelProperty("发现节点")
private String discoveryNodeName;
/**
* 运单号
*/
@ColumnWidth(20)
@ExcelProperty("运单号")
private String waybillNumber;
/**
* 订单自编号
*/
@ColumnWidth(20)
@ExcelProperty("订单自编号")
private String orderCode;
/**
* 订单自编号
*/
@ColumnWidth(20)
@ExcelProperty("申诉状态")
private String appealStatusName;
}

166
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderCompensationExcel.java

@ -0,0 +1,166 @@
package com.logpm.aftersales.excel;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class AftersalesWorkOrderCompensationExcel implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 异常类型
*/
@ColumnWidth(20)
@ExcelProperty("异常类型")
private String workOrderTypeName;
/**
* 发现节点
*/
@ColumnWidth(20)
@ExcelProperty("发现节点")
private String discoveryNodeName;
/**
* 工单创建仓
*/
@ColumnWidth(20)
@ExcelProperty("工单创建仓")
private String warehouseName;
/**
* 异常工单号
*/
@ColumnWidth(20)
@ExcelProperty("异常工单号")
private String workOrderNumber;
/**
* 运单号
*/
@ColumnWidth(20)
@ExcelProperty("运单号")
private String waybillNumber;
/**
* 订单自编号
*/
@ColumnWidth(20)
@ExcelProperty("订单自编号")
private String orderCode;
/**
* 包条码
*/
@ColumnWidth(20)
@ExcelProperty("包条码")
private String packageCode;
/**
* 品牌
*/
@ColumnWidth(20)
@ExcelProperty("品牌")
private String brandName;
/**
* 商场名称
*/
@ColumnWidth(20)
@ExcelProperty("商场名称")
private String waybillMall;
/**
* 一级品
*/
@ColumnWidth(20)
@ExcelProperty("一级品")
private String first;
/**
* 二级品
*/
@ColumnWidth(20)
@ExcelProperty("二级品")
private String secondary;
/**
* 三级品
*/
@ColumnWidth(20)
@ExcelProperty("三级品")
private String thirdProduct;
/**
* 工单状态
*/
@ColumnWidth(20)
@ExcelProperty("工单状态")
private String workOrderStatusName;
/**
* 工单处理方
*/
@ColumnWidth(20)
@ExcelProperty("工单处理方")
private String processedBy;
/**
* 责任方
*/
@ColumnWidth(20)
@ExcelProperty("责任方")
private String responsiblePerson;
/**
* 工单创建时间
*/
@ColumnWidth(20)
@ExcelProperty("工单创建时间")
private Date createTime;
/**
* 最新操作时间
*/
@ColumnWidth(20)
@ExcelProperty("最新操作时间")
private Date updateTime;
/**
* 处理结果
*/
@ColumnWidth(20)
@ExcelProperty("处理结果")
private String resultType;
/**
* 处理结果
*/
@ColumnWidth(20)
@ExcelProperty("处理结果--理赔金额")
private BigDecimal money;
/**
* 营业部处理客服
*/
@ColumnWidth(20)
@ExcelProperty("营业部处理客服")
private String warehouseServiceName;
/**
* 总部处理客服
*/
@ColumnWidth(20)
@ExcelProperty("总部处理客服")
private String headquartersName;
/**
* 内部责任方
*/
@ColumnWidth(20)
@ExcelProperty("内部责任方")
private String businessName;
/**
* 内部责任人
*/
@ColumnWidth(20)
@ExcelProperty("内部责任人")
private String personResponsibleName;
/**
* 内部责任人
*/
@ColumnWidth(20)
@ExcelProperty("金额/占比")
private String responsibilityRatio;
/**
* 最新回复内容
*/
@ColumnWidth(20)
@ExcelProperty("最新回复内容")
private String content;
}

166
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderCompleteExcel.java

@ -0,0 +1,166 @@
package com.logpm.aftersales.excel;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class AftersalesWorkOrderCompleteExcel implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 异常类型
*/
@ColumnWidth(20)
@ExcelProperty("异常类型")
private String workOrderTypeName;
/**
* 发现节点
*/
@ColumnWidth(20)
@ExcelProperty("发现节点")
private String discoveryNodeName;
/**
* 工单创建仓
*/
@ColumnWidth(20)
@ExcelProperty("工单创建仓")
private String warehouseName;
/**
* 异常工单号
*/
@ColumnWidth(20)
@ExcelProperty("异常工单号")
private String workOrderNumber;
/**
* 运单号
*/
@ColumnWidth(20)
@ExcelProperty("运单号")
private String waybillNumber;
/**
* 订单自编号
*/
@ColumnWidth(20)
@ExcelProperty("订单自编号")
private String orderCode;
/**
* 包条码
*/
@ColumnWidth(20)
@ExcelProperty("包条码")
private String packageCode;
/**
* 品牌
*/
@ColumnWidth(20)
@ExcelProperty("品牌")
private String brandName;
/**
* 商场名称
*/
@ColumnWidth(20)
@ExcelProperty("商场名称")
private String waybillMall;
/**
* 一级品
*/
@ColumnWidth(20)
@ExcelProperty("一级品")
private String first;
/**
* 二级品
*/
@ColumnWidth(20)
@ExcelProperty("二级品")
private String secondary;
/**
* 三级品
*/
@ColumnWidth(20)
@ExcelProperty("三级品")
private String thirdProduct;
/**
* 工单状态
*/
@ColumnWidth(20)
@ExcelProperty("工单状态")
private String workOrderStatusName;
/**
* 工单处理方
*/
@ColumnWidth(20)
@ExcelProperty("工单处理方")
private String processedBy;
/**
* 责任方
*/
@ColumnWidth(20)
@ExcelProperty("责任方")
private String responsiblePerson;
/**
* 工单创建时间
*/
@ColumnWidth(20)
@ExcelProperty("工单创建时间")
private Date createTime;
/**
* 工单提交时间
*/
@ColumnWidth(20)
@ExcelProperty("工单提交时间")
private Date commitTime;
/**
* 处理结果
*/
@ColumnWidth(20)
@ExcelProperty("处理结果")
private String resultType;
/**
* 处理结果
*/
@ColumnWidth(20)
@ExcelProperty("处理结果--理赔金额")
private BigDecimal money;
/**
* 营业部处理客服
*/
@ColumnWidth(20)
@ExcelProperty("营业部处理客服")
private String warehouseServiceName;
/**
* 总部处理客服
*/
@ColumnWidth(20)
@ExcelProperty("总部处理客服")
private String headquartersName;
/**
* 内部责任方
*/
@ColumnWidth(20)
@ExcelProperty("内部责任方")
private String businessName;
/**
* 内部责任人
*/
@ColumnWidth(20)
@ExcelProperty("内部责任人")
private String personResponsibleName;
/**
* 金额/占比
*/
@ColumnWidth(20)
@ExcelProperty("金额/占比")
private String responsibilityRatio;
/**
* 最新回复内容
*/
@ColumnWidth(20)
@ExcelProperty("最新回复内容")
private String content;
}

232
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderEndExcel.java

@ -0,0 +1,232 @@
package com.logpm.aftersales.excel;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class AftersalesWorkOrderEndExcel implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 异常类型
*/
@ColumnWidth(20)
@ExcelProperty("异常类型")
private String workOrderTypeName;
/**
* 发现节点
*/
@ColumnWidth(20)
@ExcelProperty("发现节点")
private String discoveryNodeName;
/**
* 工单创建仓
*/
@ColumnWidth(20)
@ExcelProperty("工单创建仓")
private String warehouseName;
/**
* 异常工单号
*/
@ColumnWidth(20)
@ExcelProperty("异常工单号")
private String workOrderNumber;
/**
* 运单号
*/
@ColumnWidth(20)
@ExcelProperty("运单号")
private String waybillNumber;
/**
* 订单自编号
*/
@ColumnWidth(20)
@ExcelProperty("订单自编号")
private String orderCode;
/**
* 包条码
*/
@ColumnWidth(20)
@ExcelProperty("包条码")
private String packageCode;
/**
* 品牌
*/
@ColumnWidth(20)
@ExcelProperty("品牌")
private String brandName;
/**
* 商场名称
*/
@ColumnWidth(20)
@ExcelProperty("商场名称")
private String waybillMall;
/**
* 一级品
*/
@ColumnWidth(20)
@ExcelProperty("一级品")
private String first;
/**
* 二级品
*/
@ColumnWidth(20)
@ExcelProperty("二级品")
private String secondary;
/**
* 三级品
*/
@ColumnWidth(20)
@ExcelProperty("三级品")
private String thirdProduct;
/**
* 工单状态
*/
@ColumnWidth(20)
@ExcelProperty("工单状态")
private String workOrderStatusName;
/**
* 工单处理方
*/
@ColumnWidth(20)
@ExcelProperty("工单处理方")
private String processedBy;
/**
* 责任方
*/
@ColumnWidth(20)
@ExcelProperty("责任方")
private String responsiblePerson;
/**
* 工单创建时间
*/
@ColumnWidth(20)
@ExcelProperty("工单创建时间")
private Date createTime;
/**
* 工单提交时间
*/
@ColumnWidth(20)
@ExcelProperty("工单提交时间")
private Date commitTime;
/**
* 工单提交时间
*/
@ColumnWidth(20)
@ExcelProperty("工单仲裁时间")
private Date arbitrationTime;
/**
* 工单提交时间
*/
@ColumnWidth(20)
@ExcelProperty("审核时间")
private Date auditTime;
/**
* 处理结果
*/
@ColumnWidth(20)
@ExcelProperty("处理结果")
private String resultType;
/**
* 处理结果
*/
@ColumnWidth(20)
@ExcelProperty("处理结果--理赔金额")
private BigDecimal money;
/**
* 营业部处理客服
*/
@ColumnWidth(20)
@ExcelProperty("营业部处理客服")
private String warehouseServiceName;
/**
* 总部处理客服
*/
@ColumnWidth(20)
@ExcelProperty("总部处理客服")
private String headquartersName;
/**
* 赔款方信息
*/
@ColumnWidth(20)
@ExcelProperty("赔款方信息")
private String indemnitorInfo;
/**
* 赔款方总金额
*/
@ColumnWidth(20)
@ExcelProperty("赔款方总金额")
private BigDecimal indemnitorMoney;
/**
* 受款方信息
*/
@ColumnWidth(20)
@ExcelProperty("受款方信息")
private String responsibleInfo;
/**
* 受款方总金额
*/
@ColumnWidth(20)
@ExcelProperty("受款方总金额")
private BigDecimal responsibleMoney;
/**
* 内部责任方
*/
@ColumnWidth(20)
@ExcelProperty("内部责任方")
private String businessName;
/**
* 内部责任人
*/
@ColumnWidth(20)
@ExcelProperty("内部责任人")
private String personResponsibleName;
/**
* 金额/占比
*/
@ColumnWidth(20)
@ExcelProperty("金额/占比")
private String responsibilityRatio;
/**
* 内部责任人
*/
@ColumnWidth(20)
@ExcelProperty("仲裁原因")
private String reasonArbitration;
/**
* 是否申诉
*/
@ColumnWidth(20)
@ExcelProperty("是否申诉")
private String isAppeal;
/**
* 是否申诉
*/
@ColumnWidth(20)
@ExcelProperty("申诉状态")
private String appealStatusName;
/**
* 钉钉号
*/
@ColumnWidth(20)
@ExcelProperty("钉钉号")
private String processNumber;
/**
* 财务入账时间
*/
@ColumnWidth(20)
@ExcelProperty("财务入账时间")
private Date entryTime;
/**
* 财务入账月份
*/
@ColumnWidth(20)
@ExcelProperty("财务入账月份")
private Date entryMonthTime;
}

172
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderExamineExcel.java

@ -0,0 +1,172 @@
package com.logpm.aftersales.excel;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class AftersalesWorkOrderExamineExcel implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 异常类型
*/
@ColumnWidth(20)
@ExcelProperty("异常类型")
private String workOrderTypeName;
/**
* 发现节点
*/
@ColumnWidth(20)
@ExcelProperty("发现节点")
private String discoveryNodeName;
/**
* 工单创建仓
*/
@ColumnWidth(20)
@ExcelProperty("工单创建仓")
private String warehouseName;
/**
* 异常工单号
*/
@ColumnWidth(20)
@ExcelProperty("异常工单号")
private String workOrderNumber;
/**
* 运单号
*/
@ColumnWidth(20)
@ExcelProperty("运单号")
private String waybillNumber;
/**
* 订单自编号
*/
@ColumnWidth(20)
@ExcelProperty("订单自编号")
private String orderCode;
/**
* 包条码
*/
@ColumnWidth(20)
@ExcelProperty("包条码")
private String packageCode;
/**
* 品牌
*/
@ColumnWidth(20)
@ExcelProperty("品牌")
private String brandName;
/**
* 商场名称
*/
@ColumnWidth(20)
@ExcelProperty("商场名称")
private String waybillMall;
/**
* 一级品
*/
@ColumnWidth(20)
@ExcelProperty("一级品")
private String first;
/**
* 二级品
*/
@ColumnWidth(20)
@ExcelProperty("二级品")
private String secondary;
/**
* 三级品
*/
@ColumnWidth(20)
@ExcelProperty("三级品")
private String thirdProduct;
/**
* 工单状态
*/
@ColumnWidth(20)
@ExcelProperty("工单状态")
private String workOrderStatusName;
/**
* 工单处理方
*/
@ColumnWidth(20)
@ExcelProperty("工单处理方")
private String processedBy;
/**
* 责任方
*/
@ColumnWidth(20)
@ExcelProperty("责任方")
private String responsiblePerson;
/**
* 工单创建时间
*/
@ColumnWidth(20)
@ExcelProperty("工单创建时间")
private Date createTime;
/**
* 工单提交时间
*/
@ColumnWidth(20)
@ExcelProperty("工单提交时间")
private Date commitTime;
/**
* 完结时间
*/
@ColumnWidth(20)
@ExcelProperty("完结时间")
private Date overTime;
/**
* 处理结果
*/
@ColumnWidth(20)
@ExcelProperty("处理结果")
private String resultType;
/**
* 处理结果
*/
@ColumnWidth(20)
@ExcelProperty("处理结果--理赔金额")
private BigDecimal money;
/**
* 营业部处理客服
*/
@ColumnWidth(20)
@ExcelProperty("营业部处理客服")
private String warehouseServiceName;
/**
* 总部处理客服
*/
@ColumnWidth(20)
@ExcelProperty("总部处理客服")
private String headquartersName;
/**
* 内部责任方
*/
@ColumnWidth(20)
@ExcelProperty("内部责任方")
private String businessName;
/**
* 内部责任人
*/
@ColumnWidth(20)
@ExcelProperty("内部责任人")
private String personResponsibleName;
/**
* 内部责任人
*/
@ColumnWidth(20)
@ExcelProperty("金额/占比")
private String responsibilityRatio;
/**
* 最新回复内容
*/
@ColumnWidth(20)
@ExcelProperty("最新回复内容")
private String content;
}

172
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderInterventionExcel.java

@ -0,0 +1,172 @@
package com.logpm.aftersales.excel;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class AftersalesWorkOrderInterventionExcel implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 异常类型
*/
@ColumnWidth(20)
@ExcelProperty("异常类型")
private String workOrderTypeName;
/**
* 发现节点
*/
@ColumnWidth(20)
@ExcelProperty("发现节点")
private String discoveryNodeName;
/**
* 工单创建仓
*/
@ColumnWidth(20)
@ExcelProperty("工单创建仓")
private String warehouseName;
/**
* 异常工单号
*/
@ColumnWidth(20)
@ExcelProperty("异常工单号")
private String workOrderNumber;
/**
* 运单号
*/
@ColumnWidth(20)
@ExcelProperty("运单号")
private String waybillNumber;
/**
* 订单自编号
*/
@ColumnWidth(20)
@ExcelProperty("订单自编号")
private String orderCode;
/**
* 包条码
*/
@ColumnWidth(20)
@ExcelProperty("包条码")
private String packageCode;
/**
* 品牌
*/
@ColumnWidth(20)
@ExcelProperty("品牌")
private String brandName;
/**
* 商场名称
*/
@ColumnWidth(20)
@ExcelProperty("商场名称")
private String waybillMall;
/**
* 一级品
*/
@ColumnWidth(20)
@ExcelProperty("一级品")
private String first;
/**
* 二级品
*/
@ColumnWidth(20)
@ExcelProperty("二级品")
private String secondary;
/**
* 三级品
*/
@ColumnWidth(20)
@ExcelProperty("三级品")
private String thirdProduct;
/**
* 工单状态
*/
@ColumnWidth(20)
@ExcelProperty("工单状态")
private String workOrderStatusName;
/**
* 工单处理方
*/
@ColumnWidth(20)
@ExcelProperty("工单处理方")
private String processedBy;
/**
* 责任方
*/
@ColumnWidth(20)
@ExcelProperty("责任方")
private String responsiblePerson;
/**
* 工单创建时间
*/
@ColumnWidth(20)
@ExcelProperty("工单创建时间")
private Date createTime;
/**
* 最晚处理时间
*/
@ColumnWidth(20)
@ExcelProperty("最晚处理时间")
private Date endCreateTime;
/**
* 最新操作时间
*/
@ColumnWidth(20)
@ExcelProperty("最新操作时间")
private Date updateTime;
/**
* 处理结果
*/
@ColumnWidth(20)
@ExcelProperty("处理结果")
private String resultType;
/**
* 处理结果
*/
@ColumnWidth(20)
@ExcelProperty("处理结果--理赔金额")
private BigDecimal money;
/**
* 营业部处理客服
*/
@ColumnWidth(20)
@ExcelProperty("营业部处理客服")
private String warehouseServiceName;
/**
* 内部责任方
*/
@ColumnWidth(20)
@ExcelProperty("内部责任方")
private String businessName;
/**
* 内部责任人
*/
@ColumnWidth(20)
@ExcelProperty("内部责任人")
private String personResponsibleName;
/**
* 内部责任人
*/
@ColumnWidth(20)
@ExcelProperty("金额/占比")
private String responsibilityRatio;
/**
* 最新回复内容
*/
@ColumnWidth(20)
@ExcelProperty("最新回复内容")
private String content;
/**
* 最新回复内容
*/
@ColumnWidth(20)
@ExcelProperty("是否超时")
private String isTimedOut;
}

159
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderProcessExcel.java

@ -0,0 +1,159 @@
package com.logpm.aftersales.excel;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class AftersalesWorkOrderProcessExcel implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 异常类型
*/
@ColumnWidth(20)
@ExcelProperty("异常类型")
private String workOrderTypeName;
/**
* 发现节点
*/
@ColumnWidth(20)
@ExcelProperty("发现节点")
private String discoveryNodeName;
/**
* 工单创建仓
*/
@ColumnWidth(20)
@ExcelProperty("工单创建仓")
private String warehouseName;
/**
* 异常工单号
*/
@ColumnWidth(20)
@ExcelProperty("异常工单号")
private String workOrderNumber;
/**
* 运单号
*/
@ColumnWidth(20)
@ExcelProperty("运单号")
private String waybillNumber;
/**
* 订单自编号
*/
@ColumnWidth(20)
@ExcelProperty("订单自编号")
private String orderCode;
/**
* 包条码
*/
@ColumnWidth(20)
@ExcelProperty("包条码")
private String packageCode;
/**
* 品牌
*/
@ColumnWidth(20)
@ExcelProperty("品牌")
private String brandName;
/**
* 商场名称
*/
@ColumnWidth(20)
@ExcelProperty("商场名称")
private String waybillMall;
/**
* 一级品
*/
@ColumnWidth(20)
@ExcelProperty("一级品")
private String first;
/**
* 二级品
*/
@ColumnWidth(20)
@ExcelProperty("二级品")
private String secondary;
/**
* 三级品
*/
@ColumnWidth(20)
@ExcelProperty("三级品")
private String thirdProduct;
/**
* 工单状态
*/
@ColumnWidth(20)
@ExcelProperty("工单状态")
private String workOrderStatusName;
/**
* 工单处理方
*/
@ColumnWidth(20)
@ExcelProperty("工单处理方")
private String processedBy;
/**
* 责任方
*/
@ColumnWidth(20)
@ExcelProperty("责任方")
private String responsiblePerson;
/**
* 工单创建时间
*/
@ColumnWidth(20)
@ExcelProperty("工单创建时间")
private Date createTime;
/**
* 最晚处理时间
*/
@ColumnWidth(20)
@ExcelProperty("最晚处理时间")
private Date endCreateTime;
/**
* 最新操作时间
*/
@ColumnWidth(20)
@ExcelProperty("最新操作时间")
private Date updateTime;
/**
* 处理结果
*/
@ColumnWidth(20)
@ExcelProperty("处理结果")
private String resultType;
/**
* 营业部处理客服
*/
@ColumnWidth(20)
@ExcelProperty("营业部处理客服")
private String warehouseServiceName;
/**
* 内部责任方
*/
@ColumnWidth(20)
@ExcelProperty("内部责任方")
private String businessName;
/**
* 内部责任人
*/
@ColumnWidth(20)
@ExcelProperty("内部责任人")
private String personResponsibleName;
/**
* 内部责任人
*/
@ColumnWidth(20)
@ExcelProperty("金额/占比")
private String responsibilityRatio;
/**
* 最新回复内容
*/
@ColumnWidth(20)
@ExcelProperty("最新回复内容")
private String content;
}

159
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderReplyExcel.java

@ -0,0 +1,159 @@
package com.logpm.aftersales.excel;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class AftersalesWorkOrderReplyExcel implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 异常类型
*/
@ColumnWidth(20)
@ExcelProperty("异常类型")
private String workOrderTypeName;
/**
* 发现节点
*/
@ColumnWidth(20)
@ExcelProperty("发现节点")
private String discoveryNodeName;
/**
* 工单创建仓
*/
@ColumnWidth(20)
@ExcelProperty("工单创建仓")
private String warehouseName;
/**
* 异常工单号
*/
@ColumnWidth(20)
@ExcelProperty("异常工单号")
private String workOrderNumber;
/**
* 运单号
*/
@ColumnWidth(20)
@ExcelProperty("运单号")
private String waybillNumber;
/**
* 订单自编号
*/
@ColumnWidth(20)
@ExcelProperty("订单自编号")
private String orderCode;
/**
* 包条码
*/
@ColumnWidth(20)
@ExcelProperty("包条码")
private String packageCode;
/**
* 品牌
*/
@ColumnWidth(20)
@ExcelProperty("品牌")
private String brandName;
/**
* 商场名称
*/
@ColumnWidth(20)
@ExcelProperty("商场名称")
private String waybillMall;
/**
* 一级品
*/
@ColumnWidth(20)
@ExcelProperty("一级品")
private String first;
/**
* 二级品
*/
@ColumnWidth(20)
@ExcelProperty("二级品")
private String secondary;
/**
* 三级品
*/
@ColumnWidth(20)
@ExcelProperty("三级品")
private String thirdProduct;
/**
* 工单状态
*/
@ColumnWidth(20)
@ExcelProperty("工单状态")
private String workOrderStatusName;
/**
* 工单处理方
*/
@ColumnWidth(20)
@ExcelProperty("工单处理方")
private String processedBy;
/**
* 责任方
*/
@ColumnWidth(20)
@ExcelProperty("责任方")
private String responsiblePerson;
/**
* 工单创建时间
*/
@ColumnWidth(20)
@ExcelProperty("工单创建时间")
private Date createTime;
/**
* 最晚处理时间
*/
@ColumnWidth(20)
@ExcelProperty("最晚处理时间")
private Date endCreateTime;
/**
* 最新操作时间
*/
@ColumnWidth(20)
@ExcelProperty("最新操作时间")
private Date updateTime;;
/**
* 是否超时
*/
@ColumnWidth(20)
@ExcelProperty("是否超时")
private String isTimedOut;
/**
* 营业部处理客服
*/
@ColumnWidth(20)
@ExcelProperty("营业部处理客服")
private String warehouseServiceName;
/**
* 内部责任方
*/
@ColumnWidth(20)
@ExcelProperty("内部责任方")
private String businessName;
/**
* 内部责任人
*/
@ColumnWidth(20)
@ExcelProperty("内部责任人")
private String personResponsibleName;
/**
* 金额/占比
*/
@ColumnWidth(20)
@ExcelProperty("金额/占比")
private String responsibilityRatio;
/**
* 最新回复内容
*/
@ColumnWidth(20)
@ExcelProperty("最新回复内容")
private String content;
}

58
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderTimeOutExcel.java

@ -0,0 +1,58 @@
package com.logpm.aftersales.excel;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class AftersalesWorkOrderTimeOutExcel implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 异常工单号
*/
@ColumnWidth(20)
@ExcelProperty("异常工单号")
private String workOrderNumber;
/**
* 异常类型
*/
@ColumnWidth(20)
@ExcelProperty("异常类型")
private String workOrderTypeName;
/**
* 发现节点
*/
@ColumnWidth(20)
@ExcelProperty("发现节点")
private String discoveryNodeName;
/**
* 金额
*/
@ColumnWidth(20)
@ExcelProperty("金额")
private BigDecimal money;
/**
* 超时时间
*/
@ColumnWidth(20)
@ExcelProperty("超时时间")
private String timeout;
/**
* 处理方
*/
@ColumnWidth(20)
@ExcelProperty("处理方")
private String processedBy;
/**
* 备注
*/
@ColumnWidth(20)
@ExcelProperty("备注")
private String remarks;
}

2
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/jobhandler/AftersalesXxlJob.java

@ -75,7 +75,7 @@ public class AftersalesXxlJob {
@XxlJob("overTimeAfterSales")
public ReturnT<String> overTimeAfterSales(String param) throws Exception {
logger.info("修改预账单工单是否可以申述>>>>>>>>{}", param);
aftersalesWorkOrderService.overTimeAfterSales();
aftersalesWorkOrderService.overTimeAfterSales(param);
return ReturnT.SUCCESS;
}

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

@ -21,17 +21,14 @@ import com.logpm.aftersales.dto.AftersalesWorkOrderQueryDTO;
import com.logpm.aftersales.entity.AftersalesProcessorEntity;
import com.logpm.aftersales.entity.AftersalesSettlementEntity;
import com.logpm.aftersales.entity.AftersalesWorkOrderEntity;
import com.logpm.aftersales.vo.AftersalesAbnormalPackageVO;
import com.logpm.aftersales.vo.AftersalesWorkOrderVO;
import com.logpm.aftersales.excel.AftersalesWorkOrderExcel;
import com.logpm.aftersales.excel.*;
import com.logpm.aftersales.vo.*;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 客服异常工单 Mapper 接口
@ -133,14 +130,136 @@ public interface AftersalesWorkOrderMapper extends BaseMapper<AftersalesWorkOrde
* 查询所有的
* @return
*/
List<AftersalesProcessorEntity> overTimeAfterSalesList();
List<AftersalesProcessorEntity> overTimeAfterSalesList(@Param("timeout") String timeout);
/**
* 工单查询列表
* 查询工单全部列表
* @param page
* @param workOrderQueryDTO
* @return
*/
IPage<AftersalesWorkOrderAllPageVO> selectAllWorkOrderPage(IPage<AftersalesWorkOrderAllPageVO> page, @Param("param") AftersalesWorkOrderQueryDTO workOrderQueryDTO,@Param("warehouseIds") List<Long> warehouseIds);
IPage<AftersalesWorkOrderReplyPageVO> selectReplyWorkOrderPage(IPage<AftersalesWorkOrderReplyPageVO> page2,@Param("param") AftersalesWorkOrderQueryDTO workOrderQueryDTO,@Param("warehouseIds") List<Long> warehouseIds);
/**
* 查询处理中工单
* @param page3
* @param workOrderQueryDTO
* @param warehouseIds
* @return
*/
IPage<AftersalesWorkOrderProcessPageVO> selectProcessWorkOrderPage(IPage<AftersalesWorkOrderProcessPageVO> page3,@Param("param") AftersalesWorkOrderQueryDTO workOrderQueryDTO,@Param("warehouseIds") List<Long> warehouseIds,@Param("isWait") Integer isWait);
/**
* 查询理赔金未出
* @param page5
* @param workOrderQueryDTO
* @param warehouseIds
* @return
*/
IPage<AftersalesWorkOrderCompensationPageVO> selectCompensationWorkOrderPage(IPage<AftersalesWorkOrderCompensationPageVO> page5,@Param("param") AftersalesWorkOrderQueryDTO workOrderQueryDTO,@Param("warehouseIds") List<Long> warehouseIds);
IPage<AftersalesWorkOrderCompletePageVO> selectCompleteWorkOrderPage(IPage<AftersalesWorkOrderCompletePageVO> page6,@Param("param") AftersalesWorkOrderQueryDTO workOrderQueryDTO,@Param("warehouseIds") List<Long> warehouseIds);
/**
* 查询客服介入列表
* @param page7
* @param workOrderQueryDTO
* @param warehouseIds
* @return
*/
IPage<AftersalesWorkOrderInterventionPageVO> selectInterventioWorkOrderPage(IPage<AftersalesWorkOrderInterventionPageVO> page7,@Param("param") AftersalesWorkOrderQueryDTO workOrderQueryDTO,@Param("warehouseIds")List<Long> warehouseIds);
IPage<AftersalesWorkOrderExaminePageVO> selectExamineWorkOrderPage(IPage<AftersalesWorkOrderExaminePageVO> page7,@Param("param") AftersalesWorkOrderQueryDTO workOrderQueryDTO,@Param("warehouseIds") List<Long> warehouseIds);
IPage<AftersalesWorkOrderEndPageVO> selectEndWorkOrderPage(IPage<AftersalesWorkOrderEndPageVO> page8,@Param("param") AftersalesWorkOrderQueryDTO workOrderQueryDTO,@Param("warehouseIds") List<Long> warehouseIds);
IPage<AftersalesWorkOrderAppealPageVO> selectAppealWorkOrderPage(IPage<AftersalesWorkOrderAppealPageVO> page9, @Param("param")AftersalesWorkOrderQueryDTO workOrderQueryDTO,@Param("warehouseIds") List<Long> warehouseIds);
IPage<AftersalesWorkOrderTimeOutPageVO> selectTimeOutWorkOrderPage(IPage<AftersalesWorkOrderTimeOutPageVO> page10,@Param("param") AftersalesWorkOrderQueryDTO workOrderQueryDTO,@Param("warehouseIds") List<Long> warehouseIds);
/**
* 查询所有列表导出数据
* @param workOrderQueryDTO
* @param warehouseIds
* @return
*/
List<AftersalesWorkOrderAllExcel> selectAllWorkOrderExcelData(@Param("param")AftersalesWorkOrderQueryDTO workOrderQueryDTO,@Param("warehouseIds") List<Long> warehouseIds);
/**
* 待回复导出
* @param workOrderQueryDTO
* @param warehouseIds
* @return
*/
List<AftersalesWorkOrderReplyExcel> selectReplyWorkOrderExcelData(@Param("param")AftersalesWorkOrderQueryDTO workOrderQueryDTO,@Param("warehouseIds") List<Long> warehouseIds);
/**
* 查询待处理和处理中的导出数据
* @param workOrderQueryDTO
* @param warehouseIds
* @param i
* @return
*/
List<AftersalesWorkOrderProcessExcel> selectProcessWorkOrderExcelData(@Param("param")AftersalesWorkOrderQueryDTO workOrderQueryDTO,@Param("warehouseIds") List<Long> warehouseIds,@Param("isWait") int isWait);
/**
* 查询理赔金未出导出数据
* @param workOrderQueryDTO
* @param warehouseIds
* @return
*/
List<AftersalesWorkOrderCompensationExcel> selectCompensationWorkOrderExcelData(@Param("param")AftersalesWorkOrderQueryDTO workOrderQueryDTO,@Param("warehouseIds") List<Long> warehouseIds);
/**
* 处理完毕导出数据
* @param workOrderQueryDTO
* @param warehouseIds
* @return
*/
List<AftersalesWorkOrderCompleteExcel> selectCompleteWorkOrderExcelData(@Param("param")AftersalesWorkOrderQueryDTO workOrderQueryDTO,@Param("warehouseIds") List<Long> warehouseIds);
/**
* 查询待审核导出数据
* @param workOrderQueryDTO
* @param warehouseIds
* @return
*/
List<AftersalesWorkOrderExamineExcel> selectExamineWorkOrderExcelData(@Param("param")AftersalesWorkOrderQueryDTO workOrderQueryDTO, @Param("warehouseIds")List<Long> warehouseIds);
/**
* 查询完结导出数据
* @param workOrderQueryDTO
* @param warehouseIds
* @return
*/
List<AftersalesWorkOrderEndExcel> selectEndWorkOrderExcelData(@Param("param")AftersalesWorkOrderQueryDTO workOrderQueryDTO,@Param("warehouseIds") List<Long> warehouseIds);
/**
* 查询申述列表导出数据
* @param workOrderQueryDTO
* @param warehouseIds
* @return
*/
List<AftersalesWorkOrderAppealExcel> selectAppealWorkOrderExcelData(@Param("param")AftersalesWorkOrderQueryDTO workOrderQueryDTO,@Param("warehouseIds") List<Long> warehouseIds);
/**
* 查询超时导出数据
* @param workOrderQueryDTO
* @param warehouseIds
* @return
*/
List<AftersalesWorkOrderTimeOutExcel> selectTimeOutWorkOrderExcelData(@Param("param")AftersalesWorkOrderQueryDTO workOrderQueryDTO,@Param("warehouseIds") List<Long> warehouseIds);
/**
* 客服介入导出
* @param workOrderQueryDTO
* @param warehouseIds
* @return
*/
IPage<AftersalesWorkOrderVO> pageAllList(IPage<AftersalesWorkOrderVO> page,@Param("param") AftersalesWorkOrderQueryDTO workOrderQueryDTO,@Param("warehouseId") List<Long> warehouseIds);
List<AftersalesWorkOrderInterventionExcel> selectInterventioWorkOrderExcelDta(@Param("param")AftersalesWorkOrderQueryDTO workOrderQueryDTO,@Param("warehouseIds") List<Long> warehouseIds);
}

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

File diff suppressed because it is too large Load Diff

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

@ -24,15 +24,18 @@ import com.logpm.aftersales.entity.AftersalesAppealEntity;
import com.logpm.aftersales.entity.AftersalesSettlementEntity;
import com.logpm.aftersales.entity.AftersalesWorkOrderEntity;
import com.logpm.aftersales.vo.AftersalesAbnormalPackageVO;
import com.logpm.aftersales.vo.AftersalesPersonResponsibleVO;
import com.logpm.aftersales.vo.AftersalesWorkOrderVO;
import com.logpm.aftersales.excel.AftersalesWorkOrderExcel;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.tool.api.R;
import org.springblade.system.entity.User;
import javax.servlet.http.HttpServletResponse;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -66,9 +69,9 @@ public interface IAftersalesWorkOrderService extends BaseService<AftersalesWorkO
* @param aftersalesWorkOrder
* @return
*/
boolean saveOrUpdateOwn(AftersalesWorkOrderDTO aftersalesWorkOrder);
R saveOrUpdateOwn(AftersalesWorkOrderDTO aftersalesWorkOrder);
boolean extractedSaveAndUpdate(AftersalesWorkOrderDTO aftersalesWorkOrder, BladeUser user, BasicdataWarehouseEntity myCurrentWarehouse);
R extractedSaveAndUpdate(AftersalesWorkOrderDTO aftersalesWorkOrder, BladeUser user, BasicdataWarehouseEntity myCurrentWarehouse);
/**
* 查询待处理的异常工单数据
@ -127,13 +130,7 @@ public interface IAftersalesWorkOrderService extends BaseService<AftersalesWorkO
*/
R getUpdateWorkList(AftersalesWorkOrderDTO aftersalesWorkOrder);
/**
* API 添加工单记录
*
* @param aftersalesWorkOrderDTO
* @return
*/
Boolean addWorkOrder(AftersalesWorkOrderDTO aftersalesWorkOrderDTO);
/**
*导入 批量修改 钉钉流程号审核人审核日期财务理赔入账日期操作人
@ -155,12 +152,6 @@ public interface IAftersalesWorkOrderService extends BaseService<AftersalesWorkO
* @return
*/
/**
* PDA保存异常工单
* @param aftersalesWorkOrderDTO
* @return
*/
R saveAfterSalesOrder(AftersalesWorkOrderDTO aftersalesWorkOrderDTO);
/**
* 查询客服信息
@ -193,7 +184,7 @@ public interface IAftersalesWorkOrderService extends BaseService<AftersalesWorkO
* @param aftersalesWorkOrderDTO
* @return
*/
boolean savaSurveyRecord(AftersalesWorkOrderDTO aftersalesWorkOrderDTO);
R savaSurveyRecord(AftersalesWorkOrderDTO aftersalesWorkOrderDTO);
/**
* 营业部提交异常工单处理结果
@ -324,13 +315,27 @@ public interface IAftersalesWorkOrderService extends BaseService<AftersalesWorkO
/**
* 处理工单超时
*/
void overTimeAfterSales();
void overTimeAfterSales(String param);
/**
* 查询全部工单信息
* @param workOrderQueryDTO
* @param page
* @param query
* @return
*/
R ageAllList(AftersalesWorkOrderQueryDTO workOrderQueryDTO, IPage<AftersalesWorkOrderVO> page);
R newPage(AftersalesWorkOrderQueryDTO workOrderQueryDTO, Query query,Integer pageType);
/**
* 导出
* @param workOrderQueryDTO
* @param query
* @param pageType
* @param response
*/
void newExport(AftersalesWorkOrderQueryDTO workOrderQueryDTO, Query query, Integer pageType, HttpServletResponse response);
R updatePersonResponsible(Long id, List<AftersalesPersonResponsibleVO> personResponsibleVOS);
}

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

File diff suppressed because it is too large Load Diff

5
blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/impl/LogpmDataSearchServiceImpl.java

@ -221,10 +221,11 @@ public class LogpmDataSearchServiceImpl implements ILogpmDataSearchService {
}
}
if(!nodeInfoVOList.isEmpty()){
nodeInfoVOList.sort(Comparator.comparing(NodeInfoVO::getOperateTime).reversed());
}
//对nodeInfoVOList集合中的作业时间 按照 时间倒序排序
nodeInfoVOList.sort(Comparator.comparing(NodeInfoVO::getOperateTime).reversed());
result.setNodeInfoVOList(nodeInfoVOList);
// 配送签收

59
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionSignforAppController.java

@ -53,6 +53,7 @@ public class DistributionSignforAppController {
private final IBasicdataWarehouseClient warehouseClient;
/**
* 签收管理 列表
*/
@ -209,6 +210,22 @@ public class DistributionSignforAppController {
public R newSignfor(@Valid @RequestBody DistrilbutionAppsignforDTO distrilbutionloadingscanDTO) {
try {
R r = distributionSignforService.newSignfor(distrilbutionloadingscanDTO);
if(r.getData()!=null){
String orderPackageCodes = null;
List<String> packageCodes= (List<String>) r.getData();
for (String packageCode : packageCodes) {
if (StringUtils.isBlank(orderPackageCodes)) {
orderPackageCodes = packageCode;
} else {
orderPackageCodes = orderPackageCodes + "," + packageCode;
}
}
// 执行下架解托盘代码
String remark="签收下架解托";
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
updownTypeClient.downPackageOrDelTray(orderPackageCodes, myCurrentWarehouse.getId(), remark);
}
return r;
} catch (CustomerException e) {
log.error("#############signfor:签收报错", e);
@ -305,27 +322,27 @@ public class DistributionSignforAppController {
public R oneclick(@Valid @RequestBody DistributionSignforDTO distributionSignfor) {
distributionSignfor.setIsClerk(false);
R r = distributionSignforService.oneclickPDA(distributionSignfor);
// List<String> packageCodes = (List<String>) r.getData();
// try {
// String orderPackageCodes = null;
// for (String packageCode : packageCodes) {
// if (StringUtils.isBlank(orderPackageCodes)) {
// orderPackageCodes = packageCode;
// } else {
// orderPackageCodes = orderPackageCodes + "," + packageCode;
// }
// }
// log.info("##############oneclick: 开始执行下架:{}", packageCodes);
//
// BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
// if(orderPackageCodes!=null){
// updownTypeClient.downPackageOrDelTray(orderPackageCodes, myCurrentWarehouse.getId(), "司机一键签收下架解托");
// }
// log.info("##############oneclick: 结束执行下架:{}", packageCodes);
//
// } catch (Exception e) {
// log.warn("##############oneclick: 更新包件下架状态失败 packageCodes={}", packageCodes);
// }
List<String> packageCodes = (List<String>) r.getData();
try {
String orderPackageCodes = null;
for (String packageCode : packageCodes) {
if (StringUtils.isBlank(orderPackageCodes)) {
orderPackageCodes = packageCode;
} else {
orderPackageCodes = orderPackageCodes + "," + packageCode;
}
}
log.info("##############oneclick: 开始执行下架:{}", packageCodes);
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(orderPackageCodes!=null){
updownTypeClient.downPackageOrDelTray(orderPackageCodes, myCurrentWarehouse.getId(), "司机一键签收下架解托");
}
log.info("##############oneclick: 结束执行下架:{}", packageCodes);
} catch (Exception e) {
log.warn("##############oneclick: 更新包件下架状态失败 packageCodes={}", packageCodes);
}
return r;
}

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

@ -512,6 +512,7 @@
left join logpm_distribution_reservation_stocklist ldrs on ldrs.reservation_id = ldr.id and ldrs.is_deleted = 0
where ldr.id = #{reservationId}
and ldr.is_deleted = 0
and ldr.reservation_status != 40
<!-- 取消对库存品的限制 and ldrs.stocklist_id = #{stockListId}-->
</select>
<select id="getDeliverReservationInfo" resultType="com.logpm.distribution.dto.DistributionReservationDTO">
@ -755,6 +756,12 @@
<if test="param.waybillNumber !=null and param.waybillNumber != ''">
and ldpl.waybill_number like concat('%',#{param.waybillNumber},'%')
</if>
<if test="param.orderPackageStockupStatus!=null">
and ldpl.order_package_stockup_status = #{param.orderPackageStockupStatus}
</if>
<if test="param.orderPackageGroundingStatus!=null">
and ldpl.order_package_grounding_status = #{param.orderPackageGroundingStatus}
</if>
<if test="param.serviceNumber !=null and param.serviceNumber != ''">
and ldpl.service_number like concat('%',#{param.serviceNumber},'%')
</if>

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

@ -479,8 +479,9 @@ public interface DistributionSignforMapper extends BaseMapper<DistributionSignfo
/**
* 自动维护签收表装车和签收数量
* @param reservationId
* @param user 如不是签收 不传入user
*/
void autoDpdateSignfor(@Param("reservationId")Long reservationId);
void autoDpdateSignfor(@Param("reservationId")Long reservationId,@Param("user") BladeUser user);
/**
* 查询签收数量

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml

@ -109,6 +109,10 @@
UPDATE logpm_distribution_signfor AS lds
SET lds.loaded_number = ( SELECT IFNULL( sum( loaded_nub ), 0 ) FROM logpm_distribution_loadscan WHERE reservation_id = lds.reservation_id AND scan_status != 1 AND is_deleted = 0 ),
lds.loadedin_number = ( SELECT IFNULL( sum( package_nub ), 0 ) FROM logpm_distribution_loadscaninvn WHERE reservation_id = lds.reservation_id AND scan_status != 1 AND is_deleted = 0 ),
<if test="user!=null">
lds.signee_name=#{user.nickName},
lds.signee_id=#{user.userId},
</if>
lds.received_quantity = (
SELECT
IFNULL( sum( received_quantity ), 0 )

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

@ -1412,7 +1412,7 @@
AND ldrs.stock_article_status != 2
) AS orderNum,
SUM(ldr.reservation_num + ldr.reservation_stock_list_num) AS planNum,
(SELECT IFNULL(SUM(ldss.stock_quantity),0) FROM logpm_distribution_stock AS ldss WHERE ldss.is_deleted = 0 AND ldss.stockup_id = lds.id) AS scanNum,
(SELECT IFNULL(SUM(ldss.stock_quantity),0) FROM logpm_distribution_stock AS ldss WHERE ldss.is_deleted = 0 AND ldss.stockup_id = lds.id AND ldss.cancel_status != 1) AS scanNum,
IFNULL(SUM(ldr.reservation_stock_list_num),0) AS inventoryNum
FROM
logpm_distribution_stockup AS lds
@ -1655,6 +1655,7 @@
logpm_distribution_stock AS ldss
WHERE
ldss.is_deleted = 0
ldss.cancel_status != 1
AND ldss.reservation_id = ldbl.id
) AS scanNum,
(

19
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/ReportListener.java

@ -1,8 +1,9 @@
package com.logpm.distribution.receiver.report;
import cn.hutool.core.collection.CollUtil;
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.distribution.pros.DistributionProperties;
import com.logpm.distribution.service.IQualityDeliverService;
@ -534,9 +535,11 @@ public class ReportListener {
public void orderExpenseDispatchDetailFinal(String msg, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long tag) {
log.info("生成订单总成本报表: {}", msg);
try {
JSONArray objects = JSONUtil.parseArray(msg);
if(CollUtil.isNotEmpty(objects)){
qualityDeliverService.orderExpenseDispatchDetailFinal(objects);
JSONObject objects = JSONUtil.parseObj(msg);
if(ObjectUtil.isNotEmpty(objects)){
JSONArray jas = new JSONArray();
jas.add(objects);
qualityDeliverService.orderExpenseDispatchDetailFinal(jas);
}
} catch (Exception e) {
e.printStackTrace();
@ -557,9 +560,11 @@ public class ReportListener {
public void expenseWarehouseOrder(String msg, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long tag) {
log.info("生成仓储订单总成本报表: {}", msg);
try {
JSONArray objects = JSONUtil.parseArray(msg);
if(CollUtil.isNotEmpty(objects)){
qualityDeliverService.expenseWarehouseOrder(objects);
JSONObject objects = JSONUtil.parseObj(msg);
if(ObjectUtil.isNotEmpty(objects)){
JSONArray jas = new JSONArray();
jas.add(objects);
qualityDeliverService.expenseWarehouseOrder(jas);
}
} catch (Exception e) {
e.printStackTrace();

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

@ -376,33 +376,45 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
private void checkReservationAndDeliveryLoadingStatus(Long deliveryId, Long reservationId) {
//判断客户是否完成装车
DistributionReservationEntity distributionReservationEntity = distributionReservationMapper.selectById(reservationId);
if(Func.isEmpty(distributionReservationEntity)){
log.error("##########查询客户配送对象为null");
return ;
}
DistributionReservationEntity updateReservation =new DistributionReservationEntity();
updateReservation.setId(distributionReservationEntity.getId());
int reservationPackageTotal = distributionReservationEntity.getReservationNum() + distributionReservationEntity.getReservationStockListNum();
if (reservationPackageTotal != 0) {
DistributionLoadingNumDTO reservationLoadingNum = distributionReservationMapper.selectReservationLoadingNum(distributionReservationEntity.getId());
if (Func.isNotEmpty(reservationLoadingNum)) {
int reservationLoadingQuantity = reservationLoadingNum.getPackageLoadingQuantity() + reservationLoadingNum.getInventoryLoadingQuantity();
if (reservationLoadingQuantity == reservationPackageTotal) {
distributionReservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.yizhuangche.getValue());
updateReservation.setLoadingStatus(ReservationLoadingStatusConstant.yizhuangche.getValue());
} else {
distributionReservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.bufenzhuangche.getValue());
updateReservation.setLoadingStatus(ReservationLoadingStatusConstant.bufenzhuangche.getValue());
}
distributionReservationMapper.updateById(distributionReservationEntity);
distributionReservationMapper.updateById(updateReservation);
}
} else {
log.error("##########查询客户配送数量为0");
}
DistributionDeliveryListEntity distributionDeliveryListEntity = distributionDeliveryListMapper.selectById(deliveryId);
if(distributionDeliveryListEntity==null){
return ;
}
DistributionDeliveryListEntity update = new DistributionDeliveryListEntity();
update.setId(distributionDeliveryListEntity.getId());
int deliveryPackageTotal = distributionDeliveryListEntity.getDeliveryNumber();
if (deliveryPackageTotal != 0) {
DistributionLoadingNumDTO deliveryLoadingNum = distributionDeliveryListMapper.selectDeliveryLoadingNum(distributionDeliveryListEntity.getId());
if (Func.isNotEmpty(deliveryLoadingNum)) {
int deliveryLoadingQuantity = deliveryLoadingNum.getPackageLoadingQuantity() + deliveryLoadingNum.getInventoryLoadingQuantity();
if (deliveryPackageTotal == deliveryLoadingQuantity) {
distributionDeliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.yizhuangche.getValue());
update.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.yizhuangche.getValue());
} else {
distributionDeliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.bunfenzhuangche.getValue());
update.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.bunfenzhuangche.getValue());
}
distributionDeliveryListMapper.updateById(distributionDeliveryListEntity);
distributionDeliveryListMapper.updateById(update);
}
} else {
log.error("##########查询客户配送数量为0");
@ -764,6 +776,12 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
return;
}
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(parcelNumberEntity.getStockArticleId());
if(Func.isEmpty(stockArticleEntity)){
log.error("#################stockArticleEntity参数错误:{}", stockArticleEntity);
return ;
}
DistributionStockArticleEntity updateById = new DistributionStockArticleEntity();
updateById.setId(stockArticleEntity.getId());
if (Func.equals(stockArticleEntity.getIsZero(), IsOrNoConstant.no.getValue())) {
log.error("#################查询订单异常,订单ID为:{}", parcelNumberEntity.getStockArticleId());
return;
@ -776,12 +794,14 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
}
parcelNumberEntities.forEach(p -> {
DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(p.getParcelListId());
DistributionParcelListEntity update = new DistributionParcelListEntity();
update.setId(parcelListEntity.getId());
if (Objects.equals(p.getOutboundQuantity(), p.getQuantity())) {
parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue());
update.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue());
} else {
parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.weizhuancghe.getValue());
update.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.weizhuancghe.getValue());
}
distributionParcelListService.updateById(parcelListEntity);
distributionParcelListService.updateById(update);
});
List<DistributionParcelListEntity> parcelListEntityList = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda()
.eq(DistributionParcelListEntity::getStockArticleId, stockArticleEntity.getId()));
@ -791,14 +811,14 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
}
int outboundQuantity = parcelNumberEntities.stream().mapToInt(DistributionParcelNumberEntity::getOutboundQuantity).sum();
if (outboundQuantity > 0 && outboundQuantity < stockArticleEntity.getTotalNumber()) {
stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenchuku.getValue());
stockArticleEntity.setDeliveryQuantity( outboundQuantity);
updateById.setOrderStatus(OrderStatusConstant.bufenchuku.getValue());
updateById.setDeliveryQuantity( outboundQuantity);
}
if (stockArticleEntity.getTotalNumber() == outboundQuantity) {
stockArticleEntity.setOrderStatus(OrderStatusConstant.chuku.getValue());
stockArticleEntity.setDeliveryQuantity(outboundQuantity);
updateById.setOrderStatus(OrderStatusConstant.chuku.getValue());
updateById.setDeliveryQuantity(outboundQuantity);
}
distributionStockArticleService.updateById(stockArticleEntity);
distributionStockArticleService.updateById(updateById);
//维护预约客户和配送任务装车状态
checkReservationAndDeliveryLoadingStatus(deliveryId, reservationId);
}

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

@ -106,6 +106,7 @@ import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.system.cache.DictBizCache;
import org.springblade.system.entity.User;
import org.springblade.system.feign.IDictBizClient;
@ -1611,6 +1612,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
String content = "包件在" + myCurrentWarehouse.getName() + "由" + loadscanEntity.getScanUser() + "一键装车,配送车次号:" + distributionDeliveryListEntity.getTrainNumber() + "预约任务号:" + reservationEntity.getReservationCode();
JSONObject trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_LOADING.getCode());
logList.add(trunklinePackageTrackLog);
//进行解托下架
warehouseUpdownTypeClient.downPackageOrDelTray(parcelListEntity.getOrderPackageCode(),myCurrentWarehouse.getId(),"一件装车解托下架");
}
}
break;
@ -3718,6 +3721,14 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
// distributionNodeWorkService.planDelivery(deliveryListEntity, AuthUtil.getUser(), BizOperationEnums.MODIFY);
NodeFanoutMsg<DistributionTaskVO> nodeFanoutMsg = buildNodeFanoutMsgForPlan(deliveryListEntity, AuthUtil.getUser(), BizOperationEnums.MODIFY);
DistributionTaskVO main = nodeFanoutMsg.getMain();
List<ReservationVO> reservationVOList = main.getReservationVOList();
if (CollUtil.isNotEmpty(reservationVOList)) {
for (ReservationVO reservationVO : reservationVOList) {
NodeFanoutMsg<ReservationVO> msgByReservation = buildNodeFanoutMsgByReservation(reservationVO,BizOperationEnums.MODIFY,myCurrentWarehouse);
distributionNodeWorkService.planReservation(msgByReservation,AuthUtil.getUser());
}
}
distributionNodeWorkService.planDelivery(nodeFanoutMsg, AuthUtil.getUser());
trunklinePackageTrackLogClient.addPackageTrackLog(logs);
@ -3725,6 +3736,19 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
public NodeFanoutMsg<ReservationVO> buildNodeFanoutMsgByReservation(ReservationVO reservationVO, BizOperationEnums bizOperation,BasicdataWarehouseEntity warehouse) {
NodeFanoutMsg<ReservationVO> nodeFanoutMsg = new NodeFanoutMsg<>();
nodeFanoutMsg.setNode(WorkNodeEnums.PLANNED_RESERVATION);
nodeFanoutMsg.setBizOperation(bizOperation);
nodeFanoutMsg.setOperator(AuthUtil.getNickName());
nodeFanoutMsg.setOperatorTime(new Date());
nodeFanoutMsg.setWarehouse(warehouse.getName());
nodeFanoutMsg.setWarehouseId(warehouse.getId());
nodeFanoutMsg.setTenantId(AuthUtil.getTenantId());
nodeFanoutMsg.setMain(reservationVO);
return nodeFanoutMsg;
}
@Override
public NodeFanoutMsg<DistributionTaskVO> buildNodeFanoutMsgForPlan(DistributionDeliveryListEntity distributionDeliveryListEntity, BladeUser user, BizOperationEnums bizOperation) {
@ -8985,7 +9009,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//更新装车时间
distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
//更新签收表的装车数量
distributionSignforMapper.updateloadByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub());
// distributionSignforMapper.updateloadByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub());
//进行解托操作
Map<String, Object> info = new HashMap<>();
info.put("orderPackageCode", parcelListEntity.getOrderPackageCode());
@ -8995,7 +9019,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
//检查是否存在有装车异常,进行处理
// distributionSignforService.maintenanceSignfor(reservationId);
distributionSignforMapper.autoDpdateSignfor(reservationId);
distributionSignforMapper.autoDpdateSignfor(reservationId,null);
String content = "包件在" + myCurrentWarehouse.getName() + "由" + loadscanEntity.getScanUser() + "扫描装车,配送车次号:" + deliveryListEntity.getTrainNumber() + "预约任务号:" + reservationEntity.getReservationCode();
JSONObject packageLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_LOADING.getCode());
packageLogs.add(packageLog);
@ -9156,7 +9180,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//更新装车时间
distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
//更新签收表的装车数量
distributionSignforMapper.updateloadByReservationId(distrilbutionloadingscanDTO.getDeliveryId(), distrilbutionloadingscanDTO.getReservationId(), parcelListDTO.getLoadingNum());
// distributionSignforMapper.updateloadByReservationId(distrilbutionloadingscanDTO.getDeliveryId(), distrilbutionloadingscanDTO.getReservationId(), parcelListDTO.getLoadingNum());
}
} else {
log.error("#######################查询预约零担品类信息错误,reservationID:{}", distrilbutionloadingscanDTO.getReservationId());
@ -9165,7 +9189,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
log.error("#######################查询预约订单信息错误,reservationID:{}", distrilbutionloadingscanDTO.getReservationId());
}
// distributionSignforService.maintenanceSignfor(distrilbutionloadingscanDTO.getReservationId());
distributionSignforMapper.autoDpdateSignfor(distrilbutionloadingscanDTO.getReservationId());
distributionSignforMapper.autoDpdateSignfor(distrilbutionloadingscanDTO.getReservationId(),null);
}
break;
@ -10150,10 +10174,14 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
// Integer j = distributionSignforMapper.updateloadByReservationId(zeroLoadscanEntity.getDeliveryId(), zeroLoadscanEntity.getReservationId(), zeroLoadscanEntity.getPackageNub());
//维护零担品类的数量
DistributionParcelNumberEntity parcelNumberEntity = zeroPackageMap.get(parcelNumberDTO.getParcelListId());
parcelNumberEntity.setOutboundQuantity(parcelNumberEntity.getOutboundQuantity() + parcelNumberDTO.getLoadingNum());
parcelNumberEntity.setDeliveryQuantity(parcelNumberEntity.getDeliveryQuantity() - parcelNumberDTO.getLoadingNum());
parcelNumberEntity.setHandQuantity(parcelNumberEntity.getHandQuantity() - parcelNumberDTO.getLoadingNum());
distributionParcelNumberService.updateById(parcelNumberEntity);
DistributionParcelNumberEntity update = new DistributionParcelNumberEntity();
update.setId(parcelNumberEntity.getId());
update.setOutboundQuantity(parcelNumberEntity.getOutboundQuantity() + parcelNumberDTO.getLoadingNum());
update.setDeliveryQuantity(parcelNumberEntity.getDeliveryQuantity() - parcelNumberDTO.getLoadingNum());
update.setHandQuantity(parcelNumberEntity.getHandQuantity() - parcelNumberDTO.getLoadingNum());
distributionParcelNumberService.updateById(update);
distributionAsyncService.checkZeroStockArticleLoadingStatus(parcelNumberEntity, zeroLoadscanEntity.getDeliveryId(), zeroLoadscanEntity.getReservationId());
}

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java

@ -3919,6 +3919,10 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
if (signingNum == 0) {
updateEntity.setSigningStatus(ReservationSigningStatusConstant.daiqianshou.getValue());
}
if(signingNum.equals(reservationEntity.getReservationNum())){
updateEntity.setSigningStatus(ReservationSigningStatusConstant.yiqianshou.getValue());
}
if (stockUpStatus) {
updateEntity.setStockStatus(ReservationStockupStatusConstant.yibeihuo.getValue());

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

@ -1182,6 +1182,10 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
DistributionSignforEntity signforEntity = this.getOne(Wrappers.<DistributionSignforEntity>query().lambda()
.eq(DistributionSignforEntity::getReservationId, reservationId)
);
DistributionSignforEntity update = new DistributionSignforEntity();
update.setId(signforEntity.getId());
if (Func.isEmpty(signforEntity)) {
log.error("维护签收异常是否存在异常包件失败");
return;
@ -1193,9 +1197,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//查看当前客户是否都已经完成审核
boolean flag = loadscanAbnormalEntityList.stream().allMatch(p -> p.getAuditingStatus().equals(LoadingAbnormalAuditingStatusConstant.yishenhe.getValue()));
if (flag) {
signforEntity.setIsHaveAbnormalPackage(1);
update.setIsHaveAbnormalPackage(1);
} else {
signforEntity.setIsHaveAbnormalPackage(2);
update.setIsHaveAbnormalPackage(2);
}
}
//统计客户装车数
@ -1208,8 +1212,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
.eq(DistributionLoadscaninvnEntity::getReservationId, signforEntity.getReservationId())
.ne(DistributionLoadscaninvnEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()))
.intValue();
signforEntity.setLoadedNumber(lad);
signforEntity.setLoadedinNumber(nad);
update.setLoadedNumber(lad);
update.setLoadedinNumber(nad);
//统计客户签收数
Integer lsad = distributionLoadscanMapper.selectCount(new QueryWrapper<DistributionLoadscanEntity>().lambda()
.eq(DistributionLoadscanEntity::getReservationId, signforEntity.getReservationId())
@ -1219,9 +1223,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
.eq(DistributionLoadscaninvnEntity::getReservationId, signforEntity.getReservationId())
.eq(DistributionLoadscaninvnEntity::getSignforState, LoadScanSigningStatusConstant.yiqianshou.getValue())
.ne(DistributionLoadscaninvnEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())).intValue();
signforEntity.setReceivedQuantity(lsad);
signforEntity.setReceivedinQuantity(nsad);
this.updateById(signforEntity);
update.setReceivedQuantity(lsad);
update.setReceivedinQuantity(nsad);
this.updateById(update);
}
@Override
@ -3005,9 +3009,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//更新签收人
Integer m = distributionSignforMapper.updateSignUser(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), AuthUtil.getUser());
//下架解托
if (StringUtils.isNotBlank(loadscanEntity.getOrderPackageCode())) {
warehouseUpdownTypeClient.downPackageOrDelTray(loadscanEntity.getOrderPackageCode(), myCurrentWarehouse.getId(), "签收下架解托");
}
// if (StringUtils.isNotBlank(loadscanEntity.getOrderPackageCode())) {
// warehouseUpdownTypeClient.downPackageOrDelTray(loadscanEntity.getOrderPackageCode(), myCurrentWarehouse.getId(), "签收下架解托");
// }
//维护订单状态
String content = "包件在" + myCurrentWarehouse.getName() + "由" + AuthUtil.getNickName() + "扫描签收,装车方式:扫描装车,配送车次号:" + deliveryListEntity.getTrainNumber() + "预约任务号:" + distributionReservationEntity.getReservationCode();
JSONObject trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_SIGN_FOR.getCode(), deliveryListEntity.getId().toString(), parcelListEntity.getWarehouseEntryTimeEnd());
@ -3535,7 +3539,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
packageLockIds.add(distributionLoadscanEntity.getPackageId());
pushDatas.add(distributionLoadscanEntity);
//更新签收人
Integer m = distributionSignforMapper.updateSignUser(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), AuthUtil.getUser());
// Integer m = distributionSignforMapper.updateSignUser(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), AuthUtil.getUser());
if (StringUtils.isNotBlank(distributionLoadscanEntity.getOrderPackageCode())) {
//下架解托
warehouseUpdownTypeClient.downPackageOrDelTray(distributionLoadscanEntity.getOrderPackageCode(), myCurrentWarehouse.getId(), "签收下架解托");
@ -3614,7 +3618,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
jsonObject.put("num", 1);
jsonObject.put("remark", "文员签收下架");
jsonObjects.add(jsonObject);
Integer m = distributionSignforMapper.updateSignUser(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), AuthUtil.getUser());
// Integer m = distributionSignforMapper.updateSignUser(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), AuthUtil.getUser());
//包件解托下架
content = "包件在" + myCurrentWarehouse.getName() + "由" + AuthUtil.getNickName() + "后台签收,装车方式:补录装车,配送车次号:" + deliveryListEntity.getTrainNumber() + "预约任务号:" + distributionReservationEntity.getReservationCode();
try {
@ -3634,7 +3638,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
sendNodeWorkDataBroadcast(parcelListEntity, distributionReservationEntity, distributionLoadscanEntity.getSigningTime(), myCurrentWarehouse);
//收集包件
orderpackages.add(updatePackage.getOrderPackageCode());
distributionSignforMapper.autoDpdateSignfor(distributionReservationEntity.getId());
} else {
//一个客户下出现重复包条码
log.error("############出现重复包条码:{}", collect);
@ -3664,9 +3668,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionReservationService.maintenanceReservationInfo(distrilbutionloadingscanDTO.getReservationId());
//维护配送任务
distributionDeliveryListService.maintenanceDeliveryInfo(distrilbutionloadingscanDTO.getDeliveryId());
//维护签收异常状态
this.maintenanceSignfor(distrilbutionloadingscanDTO.getReservationId());
// //维护签收异常状态
// this.maintenanceSignfor(distrilbutionloadingscanDTO.getReservationId());
distributionSignforMapper.autoDpdateSignfor(distributionReservationEntity.getId(),AuthUtil.getUser());
// 推送作业节点
// 作业节点数据推送
@ -3676,7 +3680,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
return R.data(orderpackages, "签收成功");
} catch (Exception e) {
e.printStackTrace();
LogError logError = new LogError();
logError.setMessage(e.getMessage());
logClient.saveErrorLog(logError);
@ -4110,7 +4113,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
}
distributionSignforMapper.autoDpdateSignfor(signforEntity.getReservationId());
distributionSignforMapper.autoDpdateSignfor(signforEntity.getReservationId(),user);
// 作业节点数据推送
NodeFanoutMsg<org.springblade.common.model.DistributionSignforVO> nodeFanoutMsg = buildDistributionSignforVO(distributionDeliveryListEntity, reservationEntity, pushList, OperatModeConstant.SCAN, signforTime);
@ -6054,6 +6057,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//distributionAsyncService.sendFactory(parcelListEntity, loadscanEntity.getSigningTime(), reservationEntity.getId(), reservationEntity.getReservationCode(), myCurrentWarehouse.getName(), user.getNickName());
sendNodeWorkDataBroadcast(parcelListEntity, reservationEntity, loadscanEntity.getSigningTime(), myCurrentWarehouse);
} else {
loadscanEntities.setMsg("司机一键签收数据补录");
if (!loadscanEntities.getSignforState().equals(LoadScanSigningStatusConstant.yiqianshou.getValue())) {
//已经进行过装车 这里不需要进行订制品订单在库数量扣减
@ -6066,7 +6071,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
loadscanEntities.setSigningUserId(user.getUserId());
loadscanEntities.setReceivedQuantity(parcelListEntity.getQuantity());
loadscanEntities.setSigningTime(signingTime);
distributionLoadscanService.updateById(loadscanEntities);
DistributionLoadscanEntity update = getDistributionLoadscanEntity(loadscanEntities);
distributionLoadscanService.updateById(update);
distributionLoadscanEntityLists.add(loadscanEntities);
packageLockIds.add(loadscanEntities.getPackageId());
content = "包件在" + myCurrentWarehouse.getName() + "由" + loadscanEntities.getSigningUser() + "司机批量签收,装车方式:补录装车,配送车次号:" + distributionDeliveryListEntity.getTrainNumber() + "预约任务号:" + reservationEntity.getReservationCode();
@ -6086,16 +6093,16 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
if (Func.isNotEmpty(packageIds)) {
distributionAsyncService.handlPakcage(packageIds, myCurrentWarehouse.getId());
}
if (Func.isNotEmpty(packageCodes)) {
// if (Func.isNotEmpty(packageCodes)) {
//批量下架
String collected = packageCodes.stream().distinct().collect(Collectors.joining(","));
log.info(method + "司机批量签收进行包件下架:{}", collected);
Map<String, Object> map = new HashMap<>();
map.put("orderPackageCode", collected);
map.put("warehouseId", myCurrentWarehouse.getId());
warehouseUpdownTypeClient.downDeliveryPackage(map);
trunklinePackageTrackLogClient.addPackageTrackLog(aaa);
}
// String collected = packageCodes.stream().distinct().collect(Collectors.joining(","));
// log.info(method + "司机批量签收进行包件下架:{}", collected);
// Map<String, Object> map = new HashMap<>();
// map.put("orderPackageCode", collected);
// map.put("warehouseId", myCurrentWarehouse.getId());
// warehouseUpdownTypeClient.downDeliveryPackage(map);
// trunklinePackageTrackLogClient.addPackageTrackLog(aaa);
// }
}
//维护客户信息状态
// reservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.yizhuangche.getValue());
@ -6123,10 +6130,10 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//更新装车时间
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distributionDeliveryListEntity.getId());
//更新装车人
Integer m = distributionSignforMapper.updateSignUser(distributionDeliveryListEntity.getId(), distributionSignfor.getReservationId(), AuthUtil.getUser());
// Integer m = distributionSignforMapper.updateSignUser(distributionDeliveryListEntity.getId(), distributionSignfor.getReservationId(), AuthUtil.getUser());
//维护配送任务状态
distributionDeliveryListService.maintenanceDeliveryInfo(distributionDeliveryListEntity.getId());
distributionSignforMapper.autoDpdateSignfor(distributionSignforEntity.getReservationId());
distributionSignforMapper.autoDpdateSignfor(distributionSignforEntity.getReservationId(),user);
//批量维护订单信息
if (Func.isNotEmpty(orderCodes)) {
String orderCode = orderCodes.stream().distinct().collect(Collectors.joining(","));
@ -6151,7 +6158,24 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
NodeFanoutMsg<org.springblade.common.model.DistributionSignforVO> nodeFanoutMsg = buildNodeFanoutMsgByOneClick(distributionDeliveryListEntity, reservationEntity, distributionLoadscaninvnEntityLists, distributionLoadscanEntityLists);
distributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
Integer num = baseMapper.signforNum(distributionSignforEntity.getReservationId());
return Resp.scanSuccess(num + "件", num + "件");
return Resp.scanSuccessWithData(num + "件", num + "件",packageCodes);
}
@NotNull
private static DistributionLoadscanEntity getDistributionLoadscanEntity(DistributionLoadscanEntity loadscanEntities) {
DistributionLoadscanEntity update = new DistributionLoadscanEntity();
update.setId(loadscanEntities.getId());
update.setSignforState(loadscanEntities.getSignforState());
update.setReceivedQuantity(loadscanEntities.getReceivedQuantity());
update.setOneClick(loadscanEntities.getOneClick());
update.setOneQclick(loadscanEntities.getOneQclick());
update.setSignforType(loadscanEntities.getSignforType());
update.setSigningUser(loadscanEntities.getSigningUser());
update.setSigningUserId(loadscanEntities.getSigningUserId());
update.setReceivedQuantity(loadscanEntities.getReceivedQuantity());
update.setSigningTime(loadscanEntities.getSigningTime());
update.setMsg(loadscanEntities.getMsg());
return update;
}
private DistributionDeliverySelfEntity getDriver(DistributionDeliveryListEntity distributionDeliveryListEntity, BladeUser user,boolean isDriverFlag) {
@ -8080,6 +8104,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
BladeUser user = AuthUtil.getUser();
List<Long> packageLockIds = new ArrayList<>();
List<String> orderCodes = new ArrayList<>();
// 签收下架的包条码
List<String> orderPackageCodesByUnTray = new ArrayList<>();
List<DistributionLoadscanEntity> pushList = new ArrayList<>();
List<DistributionLoadscaninvnEntity> pushInventoryList = new ArrayList<>();
//配置项
@ -8087,10 +8113,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
if (Objects.isNull(distributionDeliverySelfEntity)){
return Resp.scanFail("查询司机信息错误!!!", "查询司机信息错误!!!");
}
if (Objects.isNull(distributionDeliverySelfEntity)) {
return Resp.scanFail("当前操作人无此包件签收权限!!!", "当前操作人无此包件签收权限!!!");
}
switch (type) {
switch (type) {
case 1:
if (Func.isEmpty(distrilbutionloadingscanDTO.getBarcode())) {
log.error(method + "Barcode参数缺失");
@ -8152,7 +8175,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionLoadscanEntity = updateSignDistributionLoadscanEntity(loadscanEntity, user, parcelListEntity);
distributionLoadscanService.updateById(distributionLoadscanEntity);
updataSignforeExtracted(distributionLoadscanEntity.getDeliveryId(),distributionLoadscanEntity.getReservationId(),distributionLoadscanEntity.getPackageNub(), user);
// updataSignforeExtracted(distributionLoadscanEntity.getDeliveryId(),distributionLoadscanEntity.getReservationId(),distributionLoadscanEntity.getPackageNub(), user);
//维护订单状态
@ -8177,7 +8200,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
// //更新签收人
// distributionSignforMapper.updateSignUser(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), AuthUtil.getUser());
updataSignforeExtracted(distributionLoadscanEntity.getDeliveryId(),distributionLoadscanEntity.getReservationId(),distributionLoadscanEntity.getPackageNub(), user);
// updataSignforeExtracted(distributionLoadscanEntity.getDeliveryId(),distributionLoadscanEntity.getReservationId(),distributionLoadscanEntity.getPackageNub(), user);
String content = "包件在" + myCurrentWarehouse.getName() + "由" + distributionLoadscanEntity.getSigningUser() + "扫描签收,装车方式:补录装车,配送车次号:" + deliveryListEntity.getTrainNumber() + "预约任务号:" + reservationEntity.getReservationCode();
JSONObject trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_SIGN_FOR.getCode(), deliveryListEntity.getId().toString(), parcelListEntity.getWarehouseEntryTimeEnd());
@ -8190,10 +8213,13 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
log.info("------------------orderPackageCodes={}",orderPackageCodes);
log.info("------------------warehouseId={}",warehouseId);
log.info("------------------remark={}",remark);
warehouseUpdownTypeClient.downPackageOrDelTray(orderPackageCodes, warehouseId, remark);
orderPackageCodesByUnTray.add(orderPackageCodes);
// 该方法已移动到外部进行执行
// warehouseUpdownTypeClient.downPackageOrDelTray(orderPackageCodes, warehouseId, remark);
pushList.add(distributionLoadscanEntity);
packageLockIds.add(parcelListEntity.getId());
DistributionParcelListEntity updateE= new DistributionParcelListEntity();
updateE.setId(parcelListEntity.getId());
updateE.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue());
@ -8397,7 +8423,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
deliveryQuantity = deliveryQuantity - loadscanEntity.getLoadedNub();
distributionLoadscanService.save(loadscanEntity);
//维护签收数量
distributionSignforMapper.updateSignforNum(deliveryId, reservationId, loadscanEntity.getReceivedQuantity());
// distributionSignforMapper.updateSignforNum(deliveryId, reservationId, loadscanEntity.getReceivedQuantity());
pushList.add(loadscanEntity);
JSONObject jsonObject = new JSONObject();
jsonObject.put("code", zeroParcelListEntity.getOrderCode());
@ -8475,7 +8501,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
// distributionSignforMapper.updatesignforByinvn(loadscaninvnEntity.getDeliveryId(), loadscaninvnEntity.getReservationId(), loadscaninvnEntity.getPackageNub());
// distributionSignforMapper.updateSignUser(loadscaninvnEntity.getDeliveryId(), loadscaninvnEntity.getReservationId(), user);
updataSignforeExtracted(loadscaninvnEntity.getDeliveryId(),loadscaninvnEntity.getReservationId(),loadscaninvnEntity.getPackageNub(),user);
// updataSignforeExtracted(loadscaninvnEntity.getDeliveryId(),loadscaninvnEntity.getReservationId(),loadscaninvnEntity.getPackageNub(),user);
} else {
//存在配置要求必须装车才能进行签收
@ -8528,9 +8554,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionLoadscaninvnService.save(distributionLoadscaninvnEntity);
pushInventoryList.add(distributionLoadscaninvnEntity);
//更新装车数量
Integer j = distributionSignforMapper.updateLoadAndsignforByinvn(distributionLoadscaninvnEntity.getDeliveryId(), distributionLoadscaninvnEntity.getReservationId(), distributionLoadscaninvnEntity.getPackageNub());
// Integer j = distributionSignforMapper.updateLoadAndsignforByinvn(distributionLoadscaninvnEntity.getDeliveryId(), distributionLoadscaninvnEntity.getReservationId(), distributionLoadscaninvnEntity.getPackageNub());
//更新签收人
Integer i = distributionSignforMapper.updateSignUser(distributionLoadscaninvnEntity.getDeliveryId(), distributionLoadscaninvnEntity.getReservationId(), AuthUtil.getUser());
// Integer i = distributionSignforMapper.updateSignUser(distributionLoadscaninvnEntity.getDeliveryId(), distributionLoadscaninvnEntity.getReservationId(), AuthUtil.getUser());
//扣减库存
distributionStockListMapper.deductionQuantityStock(distributionLoadscaninvnEntity.getInventoryId(), distributionLoadscaninvnEntity.getLoadedNub());
packageLockIds.add(distributionLoadscaninvnEntity.getInventoryPackageId());
@ -8557,7 +8583,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
if (!packageLockIds.isEmpty()) {
List<Long> a = bladeRedis.get("warehouseId:" + myCurrentWarehouse.getId() + ":trainNumber:" + deliveryListEntity.getTrainNumber() + ":orderPackageCode:" + packageLockIds);
if (Func.isNotEmpty(a)) {
boolean flag = a.stream().anyMatch(any -> packageLockIds.contains(any));
boolean flag = a.stream().anyMatch(packageLockIds::contains);
if (flag) {
//正在操作,请稍后重试
throw new CustomerException("该包件正在被操作,请稍后再试!!!");
@ -8584,11 +8610,13 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
String collect = orderCodes.stream().distinct().collect(Collectors.joining(","));
distributionStockArticleService.maintenanceOrderInfo(collect, myCurrentWarehouse.getId());
}
distributionSignforMapper.autoDpdateSignfor(distrilbutionloadingscanDTO.getReservationId());
distributionSignforMapper.autoDpdateSignfor(distrilbutionloadingscanDTO.getReservationId(),user);
// String str = checkSignNum(distrilbutionloadingscanDTO);
Integer integer = distributionSignforMapper.signforNum(distrilbutionloadingscanDTO.getReservationId());
return Resp.scanSuccess(integer + "件", integer + "件");
return Resp.scanSuccessWithData(integer + "件", integer + "件",orderPackageCodesByUnTray);
}
/**

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

@ -2017,11 +2017,12 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
for (String s : split) {
//查询订单
DistributionStockArticleEntity stockArticleEntity = this.findStockArticleByOrderCodeAndWarehouseId(s, warehouseId);
DistributionStockArticleEntity t = new DistributionStockArticleEntity();
if (Func.isEmpty(stockArticleEntity)) {
log.error(method + "订单不存在orderCode:{}", s);
throw new CustomerException("订单不存在");
}
DistributionStockArticleEntity t = new DistributionStockArticleEntity();
t.setId(stockArticleEntity.getId());
if (IsOrNoConstant.no.getValue().equals(stockArticleEntity.getIsZero())) {
//查询包件列表
List<DistributionParcelListEntity> parcelListEntities = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda()
@ -2141,46 +2142,46 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
log.info("############维护零担数量TotalNumber:{}", stockArticleEntity.getTotalNumber());
if (stockArticleEntity.getTotalNumber() == loadingQuantity) {
//此时的出库和总数一致,该零担此时全部进行出库
stockArticleEntity.setOrderStatus(OrderStatusConstant.chuku.getValue());
t.setOrderStatus(OrderStatusConstant.chuku.getValue());
} else if (stockArticleEntity.getTotalNumber() > loadingQuantity) {
stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenchuku.getValue());
t.setOrderStatus(OrderStatusConstant.bufenchuku.getValue());
} else {
stockArticleEntity.setOrderStatus(OrderStatusConstant.ruku.getValue());
t.setOrderStatus(OrderStatusConstant.ruku.getValue());
}
if ((loadingQuantity + deliveryQuantity) == 0) {
if (stockArticleEntity.getTotalNumber() == inWarehouseQuantity) {
stockArticleEntity.setOrderStatus(OrderStatusConstant.ruku.getValue());
stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.daiyuyue.getValue());
t.setOrderStatus(OrderStatusConstant.ruku.getValue());
t.setReservationStatus(OrderReservationStatusConstant.daiyuyue.getValue());
} else if (inWarehouseQuantity > 0) {
stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenruku.getValue());
t.setOrderStatus(OrderStatusConstant.bufenruku.getValue());
}
} else {
if ((loadingQuantity + deliveryQuantity) == stockArticleEntity.getTotalNumber()) {
//无在库数量则无法进行预约
stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue());
t.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue());
} else if ((loadingQuantity + deliveryQuantity) > 0) {
stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.bufenyuyue.getValue());
t.setReservationStatus(OrderReservationStatusConstant.bufenyuyue.getValue());
}
}
if (signingQuantity == 0) {
stockArticleEntity.setOrderStatus(OrderStatusConstant.ruku.getValue());
t.setOrderStatus(OrderStatusConstant.ruku.getValue());
} else {
if (stockArticleEntity.getTotalNumber() == signingQuantity) {
stockArticleEntity.setOrderStatus(OrderStatusConstant.qianshou.getValue());
t.setOrderStatus(OrderStatusConstant.qianshou.getValue());
} else if (stockArticleEntity.getTotalNumber() > signingQuantity) {
stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenqianshou.getValue());
t.setOrderStatus(OrderStatusConstant.bufenqianshou.getValue());
}
}
//维护订单的在库件数
stockArticleEntity.setHandQuantity(inWarehouseQuantity);
t.setHandQuantity(inWarehouseQuantity);
//维护订单的配送件数
stockArticleEntity.setDeliveryQuantity(loadingQuantity);
stockArticleEntity.setSigninQuantity(signingQuantity);
t.setDeliveryQuantity(loadingQuantity);
t.setSigninQuantity(signingQuantity);
if (inWarehouseQuantity > 0) {
stockArticleEntity.setGenre(1);
t.setGenre(1);
}
this.updateById(stockArticleEntity);
this.updateById(t);
}
}

24
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java

@ -5633,22 +5633,18 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
.eq(DistributionStockEntity::getStockupId, stockupId)
.eq(DistributionStockEntity::getCancelStatus, Integer.parseInt(IsOrNoConstant.no.getValue()))
);
if (!packageEntityList.stream().allMatch(a-> Objects.isNull(a))) {
if (!packageEntityList.stream().allMatch(Objects::isNull)) {
//订制品
if (!packageEntityList.isEmpty() && packageEntityList.size() > 0) {
packageFlag = packageEntityList.stream().allMatch(a->OrderPackageStockupStatusConstant.yibeihu.getValue().equals(a.getOrderPackageStockupStatus()));
}else {
packageFlag = true;
}
}
packageFlag = packageEntityList.stream().allMatch(a -> OrderPackageStockupStatusConstant.yibeihu.getValue().equals(a.getOrderPackageStockupStatus()));
}
//库存品
if (!inventoryList.isEmpty() && inventoryList.size() > 0) {
if (!inventoryList.isEmpty()) {
inventoryFlag = inventoryList.stream().allMatch(b -> InventoryStockUpStatusConstant.yibeihuo.getValue().equals(b.getStockStatus()));
}else {
inventoryFlag = true;
}
//零担
if (!zeroEntityList.isEmpty() && zeroEntityList.size() > 0) {
if (!zeroEntityList.isEmpty()) {
//零担核对备货数量是否完成
int planNum = zeroEntityList.stream().mapToInt(DistributionReservationZeroPackageEntity::getQuantity).sum();
List<Long> orderId = zeroEntityList.stream().map(DistributionReservationZeroPackageEntity::getStockArticleId).distinct().collect(Collectors.toList());
@ -5989,6 +5985,16 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
}
if (!updateData.isEmpty()) {
distributionStockService.updateBatchById(updateData);
boolean anyMatch = false;
updateData.stream().anyMatch(a -> "1".equals(a.getType()));
if (anyMatch) {
List<Long> packageIds = updateData.stream().filter(a -> "1".equals(a.getType())).map(DistributionStockEntity::getParcelListId).collect(Collectors.toList());
distributionParcelListService.update(Wrappers.<DistributionParcelListEntity>update().lambda()
.in(DistributionParcelListEntity::getId,packageIds)
.set(DistributionParcelListEntity::getOrderPackageStockupStatus,OrderPackageStockupStatusConstant.daibeihuo.getValue())
);
}
}
}

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

@ -1412,6 +1412,9 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
log.error(method + "查询自提错误:{}", distrilbutionBillLading.getId());
return R.fail("请联系管理员处理");
}
if (BillLadingStatusConstant.yiqianshou.getValue().equals(billLadingEntity.getConditions())) {
return R.fail("当前自提单已完成复核");
}
//查询选择包件是否存在有效数据
List<Long> list = Func.toLongList(distrilbutionBillLading.getPackageIds());

37
blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/config/InterceptorAdapterConfig.java

@ -2,34 +2,49 @@ package com.logpm.factorydata.jinpai.config;
import com.logpm.factorydata.jinpai.interceptor.FactoryAccountsInterceptor;
import com.logpm.factorydata.jinpai.interceptor.LocalServerLoginAccountsInterceptor;
import com.logpm.factorydata.jinpai.pros.JinPaiProperties;
import com.logpm.factorydata.jinpai.service.IFactoryTokenService;
import lombok.AllArgsConstructor;
import com.logpm.factorydata.jinpai.service.JpFactoryShipmentService;
import org.springblade.common.component.MockLoginService;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.redis.lock.RedisLockClient;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;
import org.springframework.core.env.Environment;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import javax.annotation.Resource;
@Configuration
@AllArgsConstructor
public class InterceptorAdapterConfig implements WebMvcConfigurer {
private final IFactoryTokenService factoryTokenService;
@Resource
private IFactoryTokenService factoryTokenService;
private final BladeRedis redis;
@Resource
private BladeRedis redis;
private final Environment environment;
private final RedisLockClient redisLockClient;
private final MockLoginService mockLoginService;
@Resource
private Environment environment;
@Resource
private RedisLockClient redisLockClient;
@Resource
private MockLoginService mockLoginService;
@Lazy
@Resource
private JpFactoryShipmentService jpFactoryShipmentService;
@Resource
private JinPaiProperties jinPaiProperties;
@Override
public void addInterceptors(InterceptorRegistry interceptorRegistry) {
// interceptorRegistry.addInterceptor(new FactoryAccountsInterceptor(factoryTokenService))
// .addPathPatterns("/**").order(1);
interceptorRegistry.addInterceptor(new LocalServerLoginAccountsInterceptor(redis, environment,redisLockClient,mockLoginService))
.addPathPatterns("/**").order(2);
interceptorRegistry.addInterceptor(new FactoryAccountsInterceptor(redis, environment, redisLockClient, mockLoginService, jinPaiProperties, jpFactoryShipmentService))
.addPathPatterns("/order/v1").order(3);
interceptorRegistry.addInterceptor(new LocalServerLoginAccountsInterceptor(redis, environment, redisLockClient, mockLoginService, jinPaiProperties, jpFactoryShipmentService))
.addPathPatterns("/**")
.excludePathPatterns("/order/v1")
.order(2);
}
}

41
blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/controller/OrderController.java

@ -1,11 +1,16 @@
package com.logpm.factorydata.jinpai.controller;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.factorydata.jinpai.pros.JinPaiProperties;
import com.logpm.factorydata.jinpai.service.DeliveryNoteService;
import com.logpm.factorydata.jinpai.service.JpFactoryShipmentService;
import com.logpm.factorydata.jinpai.vo.DeliveryNoteVO;
import com.logpm.factorydata.jinpai.vo.FactoryOrderDataVO;
import com.logpm.factorydata.jinpai.vo.JpFactoryShipmentVO;
import com.logpm.factorydata.jinpai.vo.OrderInfoVO;
import com.logpm.factorydata.jinpai.vo.PackageInfoVO;
import com.logpm.factorydata.jinpai.vo.PushOrderVO;
@ -14,12 +19,14 @@ import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.api.R;
import org.springframework.context.annotation.Lazy;
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 javax.annotation.Resource;
import java.util.List;
import java.util.Map;
@ -36,9 +43,16 @@ import java.util.Map;
@Api(value = "工厂订单", tags = "工厂订单")
public class OrderController {
private final DeliveryNoteService service;
@Resource
@Lazy
private DeliveryNoteService service;
private final JinPaiProperties jinPaiProperties;
@Lazy
@Resource
private JpFactoryShipmentService shipmentService;
@Resource
private JinPaiProperties jinPaiProperties;
@ResponseBody
@PostMapping
@ -109,4 +123,27 @@ public class OrderController {
return R.success(res);
}
@ResponseBody
@PostMapping("/v1")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "金牌-工厂订单", notes = "金牌-工厂订单")
public R orderV1(@RequestBody FactoryOrderDataVO vo) {
String jsonStr = JSONUtil.toJsonStr(vo);
log.info("接收金牌工厂订单:{} ", jsonStr);
String res = "";
try {
String params = vo.getParams();
if(StrUtil.isNotEmpty(params)){
JpFactoryShipmentVO bean = JSONUtil.toBean(params, JpFactoryShipmentVO.class);
if (ObjectUtil.isNotEmpty(bean)) {
res = shipmentService.shipment(bean);
}
}
} catch (Exception e) {
log.error("金牌工厂订单异常:{} ", e);
return R.fail("服务器异常");
}
return R.success(res);
}
}

88
blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/entity/JpFactoryOrderEntity.java

@ -0,0 +1,88 @@
package com.logpm.factorydata.jinpai.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;
/**
* 金牌工厂订单 实体类
*
* @author zhaoqiaobo
* @create 2024-04-26
*/
@Data
@TableName("jp_factory_order")
@ApiModel(value = "金牌工厂订单", description = "金牌工厂订单")
@EqualsAndHashCode(callSuper = true)
public class JpFactoryOrderEntity extends BaseEntity {
@ApiModelProperty(name = "日志id")
private String logId;
@ApiModelProperty(name = "发货单id")
private Long shipmentId;
@ApiModelProperty(name = "订单号")
private String orderCode;
@ApiModelProperty(name = "交割单号/服务号")
private String serviceNum;
@ApiModelProperty(name = "服务类型")
private String serverType;
@ApiModelProperty(name = "结算方式")
private String settlementType;
@ApiModelProperty(name = "是否补件")
private String supplement;
@ApiModelProperty(name = "发运方式")
private String shipVia;
@ApiModelProperty(name = "订单总件数")
private Integer totalQuantity;
@ApiModelProperty(name = "商场名称")
private String mallName;
@ApiModelProperty(name = "商场编码")
private String mallCode;
@ApiModelProperty(name = "商场电话")
private String mallMobile;
@ApiModelProperty(name = "商场地址")
private String mallAddress;
@ApiModelProperty(name = "商场收货人")
private String mallConsignee;
@ApiModelProperty(name = "商场收货人电话")
private String mallConsigneeMobile;
@ApiModelProperty(name = "门店名称")
private String storeName;
@ApiModelProperty(name = "门店编码")
private String storeCode;
@ApiModelProperty(name = "门店电话")
private String storeMobile;
@ApiModelProperty(name = "门店地址")
private String storeAddress;
@ApiModelProperty(name = "门店收货人")
private String storeConsignee;
@ApiModelProperty(name = "门店收货人电话")
private String storeConsigneeMobile;
@ApiModelProperty(name = "终端收货人")
private String receiverName;
@ApiModelProperty(name = "终端收货人电话")
private String receiverMobile;
@ApiModelProperty(name = "终端收货人地址")
private String receiverAddress;
@ApiModelProperty(name = "备注")
private String remark;
@ApiModelProperty(name = "是否确认")
private Boolean checked;
@ApiModelProperty(name = "租户")
private String tenantCode;
@ApiModelProperty(name = "预留1", notes = "")
private String reserve1;
@ApiModelProperty(name = "预留2", notes = "")
private String reserve2;
@ApiModelProperty(name = "预留3", notes = "")
private String reserve3;
@ApiModelProperty(name = "预留4", notes = "")
private String reserve4;
@ApiModelProperty(name = "预留5", notes = "")
private String reserve5;
}

72
blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/entity/JpFactoryPackageEntity.java

@ -0,0 +1,72 @@
package com.logpm.factorydata.jinpai.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("jp_factory_package")
@ApiModel(value = "金牌工厂包件", description = "金牌工厂包件")
@EqualsAndHashCode(callSuper = true)
public class JpFactoryPackageEntity extends BaseEntity {
@ApiModelProperty(name = "日志id")
private String logId;
@ApiModelProperty(name = "订单id")
private Long orderId;
@ApiModelProperty(name = "是否合包")
@JsonProperty("isConsolidation")
private String consolidation;
@ApiModelProperty(name = "合包码")
private String consolidationCode;
@ApiModelProperty(name = "包件码")
private String unitNo;
@ApiModelProperty(name = "产品编号")
private String productCode;
@ApiModelProperty(name = "产品名称")
private String productName;
@ApiModelProperty(name = "件数")
private Integer quantity;
@ApiModelProperty(name = "体积")
private Double volume;
@ApiModelProperty(name = "重量")
private Double weight;
@ApiModelProperty(name = "一级品类名称")
private String firstPackName;
@ApiModelProperty(name = "一级品类编码")
private String firstPackCode;
@ApiModelProperty(name = "二级品类名称")
private String secondPackName;
@ApiModelProperty(name = "二级品类编码")
private String secondPackCode;
@ApiModelProperty(name = "三级品类名称")
private String thirdPackName;
@ApiModelProperty(name = "三级品类编码")
private String thirdPackCode;
@ApiModelProperty(name = "是否确认")
private Boolean checked;
@ApiModelProperty(name = "租户")
private String tenantCode;
@ApiModelProperty(name = "预留1", notes = "")
private String reserve1;
@ApiModelProperty(name = "预留2", notes = "")
private String reserve2;
@ApiModelProperty(name = "预留3", notes = "")
private String reserve3;
@ApiModelProperty(name = "预留4", notes = "")
private String reserve4;
@ApiModelProperty(name = "预留5", notes = "")
private String reserve5;
}

64
blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/entity/JpFactoryShipmentEntity.java

@ -0,0 +1,64 @@
package com.logpm.factorydata.jinpai.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;
/**
* 金牌工厂发货单 实体类
*
* @author zhaoqiaobo
* @create 2024-04-26
*/
@Data
@TableName("jp_factory_shipment")
@ApiModel(value = "金牌工厂发货单", description = "金牌工厂发货单")
@EqualsAndHashCode(callSuper = true)
public class JpFactoryShipmentEntity extends BaseEntity {
@ApiModelProperty(name = "日志id")
private String logId;
@ApiModelProperty(name = "发货单号")
private String shipmentId;
@ApiModelProperty(name = "物流公司编码")
private String carrierCode;
@ApiModelProperty(name = "物流公司名称")
private String carrierName;
@ApiModelProperty(name = "发货基地")
private String shipmentHub;
@ApiModelProperty(name = "计划发车时间")
private String planStartTime;
@ApiModelProperty(name = "计划到达时间")
private String planEndTime;
@ApiModelProperty(name = "司机")
private String driverName;
@ApiModelProperty(name = "司机电话")
private String driverMobile;
@ApiModelProperty(name = "车牌")
private String carNumber;
@ApiModelProperty(name = "发货人名称")
private String senderName;
@ApiModelProperty(name = "发货人电话")
private String senderMobile;
@ApiModelProperty(name = "发货人地址")
private String senderAddress;
@ApiModelProperty(name = "是否确认")
private Boolean checked;
@ApiModelProperty(name = "租户")
private String tenantCode;
@ApiModelProperty(name = "预留1", notes = "")
private String reserve1;
@ApiModelProperty(name = "预留2", notes = "")
private String reserve2;
@ApiModelProperty(name = "预留3", notes = "")
private String reserve3;
@ApiModelProperty(name = "预留4", notes = "")
private String reserve4;
@ApiModelProperty(name = "预留5", notes = "")
private String reserve5;
}

136
blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/interceptor/FactoryAccountsInterceptor.java

@ -1,59 +1,149 @@
package com.logpm.factorydata.jinpai.interceptor;
import cn.hutool.core.codec.Base64;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.digest.MD5;
import com.alibaba.fastjson.JSONObject;
import com.logpm.factorydata.jinpai.pros.JinPaiProperties;
import com.logpm.factorydata.jinpai.service.JpFactoryShipmentService;
import com.logpm.factorydata.jinpai.vo.FactoryAuthVO;
import com.logpm.factorydata.jinpai.wrapper.RequestWrapper;
import com.logpm.factorydata.jinpai.service.IFactoryTokenService;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.cache.CacheNames;
import org.springblade.common.component.MockLoginService;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.wrapper.CustomHttpServletRequestWrapper;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.redis.lock.LockType;
import org.springblade.core.redis.lock.RedisLockClient;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.core.tool.utils.ThreadLocalUtil;
import org.springframework.context.annotation.Lazy;
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.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.time.Instant;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
@Log4j2
@AllArgsConstructor
@NoArgsConstructor
public class FactoryAccountsInterceptor implements HandlerInterceptor {
private final IFactoryTokenService factoryTokenService;
@Resource
private BladeRedis bladeRedis;
@Resource
private Environment environment;
@Resource
private RedisLockClient redisLockClient;
@Resource
private MockLoginService mockLoginService;
@Resource
private JinPaiProperties jinPaiProperties;
@Resource
@Lazy
private JpFactoryShipmentService jpFactoryShipmentService;
public FactoryAccountsInterceptor(BladeRedis redis, Environment environment, RedisLockClient redisLockClient, MockLoginService mockLoginService, JinPaiProperties suoFeiYaProperties, JpFactoryShipmentService deliveryNoteService) {
this.bladeRedis = redis;
this.environment = environment;
this.redisLockClient = redisLockClient;
this.mockLoginService = mockLoginService;
this.jinPaiProperties = suoFeiYaProperties;
this.jpFactoryShipmentService = deliveryNoteService;
}
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws CustomerException {
try {
log.info("##########preHandle: 认证开始--------------");
RequestWrapper myRequestWrapper = new RequestWrapper(request);
String body = myRequestWrapper.getBody();
log.info("##########preHandle: body={}", body);
JSONObject jsonObject = JSONObject.parseObject(body);
//获取头中参数
String token = request.getHeader("Authorization");
String corpId = request.getHeader("corpid");
if(StringUtil.isBlank(corpId)){
corpId = jsonObject.getString("corpid");
// 获取头中参数
String companyCode = jsonObject.getString("companyCode");
String params = jsonObject.getString("params");
String sign = jsonObject.getString("digest");
Long authTime = jsonObject.getLong("timestamp");
if (ObjectUtil.isEmpty(authTime)) {
log.info("##########preHandle: 时间戳不能为空");
returnJson(response, JSONObject.toJSONString(R.fail("时间戳不能为空")));
return false;
}
if(!StringUtil.hasLength(token)){
returnJson(response,JSONObject.toJSONString(R.fail(203,"认证不通过,token有误")));
log.info("##########preHandle: authTime={},sign={},companyCodeH={}", authTime, sign, companyCode);
long secondTimestamp = Instant.now().getEpochSecond();
// 验证时间 不能大于5秒
if (secondTimestamp - authTime > jinPaiProperties.getAuthTime()) {
log.info("##########preHandle: 时间戳过期");
returnJson(response, JSONObject.toJSONString(R.fail("认证不通过,时间戳过期")));
return false;
}
if(!StringUtil.hasLength(corpId)){
returnJson(response,JSONObject.toJSONString(R.fail(203,"认证不通过,corpId有误")));
// 验证签名
String auth = jinPaiProperties.getAuth();
String md5Hex = Base64.encode(MD5.create().digestHex(params + auth + authTime)).toUpperCase();
log.info("##########preHandle: md5Hex={}", md5Hex);
if (!StrUtil.equals(md5Hex, sign)) {
log.info("##########preHandle: 签名不正确");
returnJson(response, JSONObject.toJSONString(R.fail("认证不通过,签名不正确")));
return false;
}
log.info("##########preHandle: token={}",token);
//验证token
boolean b = factoryTokenService.verifyToken(token,corpId);
if(!b){
returnJson(response,JSONObject.toJSONString(R.fail(203,"认证不通过,token不存在或已过期")));
String account = "shujutongbu";
String tenantId = "627683";
String authorizationHeader = "bG9jYWw6bG9jYWxfc2VjcmV0";
if (StringUtil.isNotBlank(companyCode)) {
FactoryAuthVO authVO = jpFactoryShipmentService.findFactoryAuth(companyCode);
if (ObjectUtil.isNotEmpty(authVO)) {
account = authVO.getLoginAccount();
tenantId = authVO.getTenantCode();
authorizationHeader = authVO.getAuthorizationHeader();
org.springblade.common.wrapper.CustomHttpServletRequestWrapper wrappedRequest = new CustomHttpServletRequestWrapper(request);
String key = CacheNames.LOCAL_SERVER_USER + tenantId + ":" + account;
String lockKey = key + ":lock";
JSONObject data = bladeRedis.get(key);
if (Objects.isNull(data)) {
boolean flag = redisLockClient.tryLock(lockKey, LockType.FAIR, 5000, 10000, TimeUnit.MILLISECONDS);
if (flag) {
data = bladeRedis.get(key);
if (Objects.isNull(data)) {
data = mockLoginService.mockToken(tenantId, account);
bladeRedis.setEx(key, data, 2591990L);
redisLockClient.unLock(lockKey, LockType.FAIR);
}
}
}
// 发送登录请求
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 " + authorizationHeader);
ThreadLocalUtil.put("bladeContext", httpHeaders);
// 用包装后的request替换原始request
request = wrappedRequest;
RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(request));
return true;
}
} else {
returnJson(response, JSONObject.toJSONString(R.fail("缺少参数 companyCode")));
return false;
}
return true;
return false;
} catch (Exception e) {
returnJson(response,JSONObject.toJSONString(R.fail(500,"服务异常,请联系管理员")));
e.printStackTrace();
returnJson(response, JSONObject.toJSONString(R.fail("服务异常,请联系管理员")));
return false;
}
}
@ -69,7 +159,7 @@ public class FactoryAccountsInterceptor implements HandlerInterceptor {
} catch (IOException e) {
System.out.println(e.getMessage());
} finally {
if (writer != null){
if (writer != null) {
writer.close();
}
}

39
blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/interceptor/LocalServerLoginAccountsInterceptor.java

@ -1,13 +1,12 @@
package com.logpm.factorydata.jinpai.interceptor;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import com.alibaba.fastjson.JSONObject;
import lombok.AllArgsConstructor;
import com.logpm.factorydata.jinpai.pros.JinPaiProperties;
import com.logpm.factorydata.jinpai.service.JpFactoryShipmentService;
import lombok.NoArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.cache.CacheNames;
import org.springblade.common.component.MockLoginService;
import org.springblade.common.constant.LauncherConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.wrapper.CustomHttpServletRequestWrapper;
import org.springblade.core.redis.cache.BladeRedis;
@ -15,29 +14,47 @@ import org.springblade.core.redis.lock.LockType;
import org.springblade.core.redis.lock.RedisLockClient;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.ThreadLocalUtil;
import org.springframework.context.annotation.Lazy;
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.annotation.Resource;
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;
import java.util.concurrent.TimeUnit;
@Log4j2
@AllArgsConstructor
@NoArgsConstructor
public class LocalServerLoginAccountsInterceptor extends HandlerInterceptorAdapter {
private final BladeRedis bladeRedis;
private final Environment environment;
private final RedisLockClient redisLockClient;
private final MockLoginService mockLoginService;
@Resource
private BladeRedis bladeRedis;
@Resource
private Environment environment;
@Resource
private RedisLockClient redisLockClient;
@Resource
private MockLoginService mockLoginService;
@Resource
private JinPaiProperties jinPaiProperties;
@Lazy
@Resource
private JpFactoryShipmentService jpFactoryShipmentService;
public LocalServerLoginAccountsInterceptor(BladeRedis redis, Environment environment, RedisLockClient redisLockClient, MockLoginService mockLoginService, JinPaiProperties suoFeiYaProperties, JpFactoryShipmentService deliveryNoteService) {
this.bladeRedis = redis;
this.environment = environment;
this.redisLockClient = redisLockClient;
this.mockLoginService = mockLoginService;
this.jinPaiProperties = suoFeiYaProperties;
this.jpFactoryShipmentService = deliveryNoteService;
}
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws CustomerException {

16
blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/mapper/JpFactoryOrderMapper.java

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

5
blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/mapper/JpFactoryOrderMapper.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.jinpai.mapper.JpFactoryOrderMapper">
</mapper>

16
blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/mapper/JpFactoryPackageMapper.java

@ -0,0 +1,16 @@
package com.logpm.factorydata.jinpai.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.factorydata.jinpai.entity.JpFactoryPackageEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 金牌工厂包件 mapper
*
* @author zqb
* @since 2024-03-26
*/
@Mapper
public interface JpFactoryPackageMapper extends BaseMapper<JpFactoryPackageEntity> {
}

5
blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/mapper/JpFactoryPackageMapper.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.jinpai.mapper.JpFactoryPackageMapper">
</mapper>

21
blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/mapper/JpFactoryShipmentMapper.java

@ -0,0 +1,21 @@
package com.logpm.factorydata.jinpai.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.factorydata.jinpai.entity.JpFactoryShipmentEntity;
import com.logpm.factorydata.jinpai.vo.FactoryAuthVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 金牌工厂发货单 mapper
*
* @author zqb
* @since 2024-03-26
*/
@Mapper
public interface JpFactoryShipmentMapper extends BaseMapper<JpFactoryShipmentEntity> {
List<FactoryAuthVO> findFactoryAuth(@Param("companyCode") String companyCode);
}

16
blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/mapper/JpFactoryShipmentMapper.xml

@ -0,0 +1,16 @@
<?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.jinpai.mapper.JpFactoryShipmentMapper">
<select id="findFactoryAuth" resultType="com.logpm.factorydata.jinpai.vo.FactoryAuthVO">
select
logistics_code,
app_key,
tenant_code,
login_account,
authorization_header
from jp_factory_auth
where
company_code = #{companyCode}
</select>
</mapper>

275
blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/mq/FactoryOrderListener.java

@ -1,53 +1,20 @@
package com.logpm.factorydata.jinpai.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.JSONUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.factorydata.base.feign.IFactoryDataBaseClient;
import com.logpm.factorydata.enums.SaxStatusEnums;
import com.logpm.factorydata.feign.IFactoryDataClient;
import com.logpm.factorydata.jinpai.entity.DeliveryNoteEntity;
import com.logpm.factorydata.jinpai.entity.FactoryOrderLogEntity;
import com.logpm.factorydata.jinpai.entity.OrderInfoEntity;
import com.logpm.factorydata.jinpai.entity.PackageInfoEntity;
import com.logpm.factorydata.jinpai.entity.PushOrderDetailEntity;
import com.logpm.factorydata.jinpai.entity.PushOrderEntity;
import com.logpm.factorydata.jinpai.enums.DimensionEnums;
import com.logpm.factorydata.jinpai.service.DeliveryNoteService;
import com.logpm.factorydata.jinpai.service.FactoryOrderLogService;
import com.logpm.factorydata.jinpai.service.OrderInfoService;
import com.logpm.factorydata.jinpai.service.PackageInfoService;
import com.logpm.factorydata.jinpai.service.PushOrderDetailService;
import com.logpm.factorydata.jinpai.service.PushOrderService;
import com.logpm.factorydata.jinpai.vo.DeliveryNoteVO;
import com.logpm.factorydata.jinpai.vo.OrderInfoVO;
import com.logpm.factorydata.jinpai.vo.PackageCategoryVO;
import com.logpm.factorydata.jinpai.vo.PackageInfoVO;
import com.logpm.factorydata.jinpai.vo.PushOrderDetailVO;
import com.logpm.factorydata.jinpai.vo.PushOrderVO;
import com.logpm.factorydata.jinpai.service.MqWorkerService;
import com.rabbitmq.client.Channel;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.factorydata.FactoryDataConstants;
import org.springblade.core.redis.cache.BladeRedis;
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.amqp.support.AmqpHeaders;
import org.springframework.messaging.handler.annotation.Header;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.io.IOException;
/**
* 监听索菲亚订单数据
@ -60,216 +27,46 @@ import java.util.Map;
@AllArgsConstructor
public class FactoryOrderListener {
private final PushOrderService pushOrderService;
private final PushOrderDetailService pushOrderDetailService;
private final DeliveryNoteService deliveryNoteService;
private final OrderInfoService orderInfoService;
private final PackageInfoService packageInfoService;
private final FactoryOrderLogService logService;
private final BladeRedis bladeRedis;
private final IFactoryDataBaseClient baseClient;
private final IFactoryDataClient factoryDataClient;
private final MqWorkerService mqWorkerService;
@RabbitListener(bindings = @QueueBinding(
value = @Queue(name = FactoryDataConstants.Mq.Queues.JP_FACTORY_ORDER),
value = @Queue(name = FactoryDataConstants.Mq.Queues.JP_FACTORY_SHIPMENT),
exchange = @Exchange(name = FactoryDataConstants.Mq.Exchanges.FACTORY_ORDER, type = ExchangeTypes.TOPIC),
key = FactoryDataConstants.Mq.RoutingKeys.JP_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;
key = FactoryDataConstants.Mq.RoutingKeys.JP_FACTORY_SHIPMENT
), ackMode = "MANUAL")
public void factoryShipment(String msg, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long tag) {
log.info("处理金牌工厂订单:{}", msg);
try {
mqWorkerService.factoryShipment(msg);
} catch (Exception e) {
e.printStackTrace();
log.error("处理金牌工厂订单失败: {}", e.getMessage());
}
// 去 minio 下载文件到本地,然后解析文件内容为实体对象
List<DeliveryNoteVO> deliveryNoteVOS = null;
List<OrderInfoVO> orderInfoVOS = null;
List<PackageInfoVO> packageInfoVOS = null;
PushOrderVO pushOrderVO = null;
Long logId = logEntity.getId();
String logUrl = logEntity.getLogUrl();
// 1 订单 2 订单明细 3 包件
Integer dimension = logEntity.getDimension();
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)) {
// 拉取的数据
if (ObjectUtil.equal(logEntity.getType(), 1)) {
if (ObjectUtil.equal(dimension, DimensionEnums.ORDER.getCode())) {
deliveryNoteVOS = new JSONArray(content).toList(DeliveryNoteVO.class);
}
if (ObjectUtil.equal(dimension, DimensionEnums.ORDER_DETAIL.getCode())) {
orderInfoVOS = new JSONArray(content).toList(OrderInfoVO.class);
}
if (ObjectUtil.equal(dimension, DimensionEnums.PACKAGE.getCode())) {
packageInfoVOS = new JSONArray(content).toList(PackageInfoVO.class);
}
} else if (ObjectUtil.equal(logEntity.getType(), 2)) {
// 推送的数据
pushOrderVO = JSONUtil.toBean(content, PushOrderVO.class);
}
}
}
try {
channel.basicAck(tag, false);
} catch (IOException e) {
throw new RuntimeException(e);
}
if (ObjectUtil.equal(logEntity.getType(), 1)) {
pullData(deliveryNoteVOS, orderInfoVOS, packageInfoVOS, logEntity);
} else if (ObjectUtil.equal(logEntity.getType(), 2)) {
pushData(pushOrderVO, logEntity);
}
}
private void pushData(PushOrderVO vo, FactoryOrderLogEntity logEntity) {
if (ObjectUtil.isNotEmpty(vo)) {
// 1 解析数据保存入库
// 装车单号唯一
Long logId = logEntity.getId();
String truckNo = vo.getTransportNo();
List<PushOrderEntity> list = pushOrderService.list(Wrappers.<PushOrderEntity>lambdaQuery().eq(PushOrderEntity::getTransportNo, truckNo));
if (CollUtil.isNotEmpty(list)) {
log.error("装车单号{} 数据已经处理过了, logId: {}", truckNo, logId);
return;
}
vo.setLogId(ObjectUtil.isNotEmpty(logId) ? logId.toString() : null);
pushOrderService.save(vo);
List<PushOrderDetailVO> orderInfos = vo.getItems();
if (CollUtil.isNotEmpty(orderInfos)) {
List<PushOrderDetailEntity> infoEntities = new ArrayList<>();
for (PushOrderDetailVO orderInfo : orderInfos) {
PushOrderDetailEntity orderInfoEntity = new PushOrderDetailEntity();
BeanUtil.copyProperties(orderInfo, orderInfoEntity);
orderInfoEntity.setLogId(ObjectUtil.isNotEmpty(logId) ? logId.toString() : null);
orderInfoEntity.setOrderId(vo.getId().toString());
List<String> boxCodes = orderInfo.getBoxCodes();
if (CollUtil.isNotEmpty(boxCodes)) {
orderInfoEntity.setBoxCodeList(JSONUtil.toJsonStr(boxCodes));
}
List<PackageCategoryVO> boxDetails = orderInfo.getBoxDetails();
if (CollUtil.isNotEmpty(boxDetails)) {
orderInfoEntity.setBoxDetailList(JSONUtil.toJsonStr(boxDetails));
}
infoEntities.add(orderInfoEntity);
}
pushOrderDetailService.saveBatch(infoEntities);
}
// 2 构建暂存单,发送 mq 消息
FactoryOrderLogEntity logEntity1 = new FactoryOrderLogEntity();
logEntity1.setSaxStatus(SaxStatusEnums.SUCCESS.getCode());
logEntity1.setId(logId);
logService.saveOrUpdate(logEntity1);
// 处理暂存单
deliveryNoteService.buildAdvance(vo);
}
}
private void pullData(List<DeliveryNoteVO> deliveryNoteVOS, List<OrderInfoVO> orderInfoVOS, List<PackageInfoVO> packageInfoVOS, FactoryOrderLogEntity logEntity) {
if (CollUtil.isNotEmpty(deliveryNoteVOS)) {
List<DeliveryNoteEntity> entities = new ArrayList<>();
List<String> orderCodes = new ArrayList<>();
for (DeliveryNoteVO deliveryNoteVO : deliveryNoteVOS) {
orderCodes.add(deliveryNoteVO.getOrderId());
}
List<DeliveryNoteEntity> list = deliveryNoteService.list(Wrappers.<DeliveryNoteEntity>lambdaQuery()
.in(DeliveryNoteEntity::getOrderId, orderCodes));
Map<String, String> map = new HashMap<>();
if (CollUtil.isNotEmpty(list)) {
// 将list中的数据封装到map中
list.forEach(item -> {
map.put(item.getOrderId(), item.getOrderId());
});
}
for (DeliveryNoteVO deliveryNoteVO : deliveryNoteVOS) {
if (map.containsKey(deliveryNoteVO.getOrderId())) {
log.error("订单号:{},已推送过了", deliveryNoteVO.getOrderId());
continue;
}
DeliveryNoteEntity deliveryNoteEntity = new DeliveryNoteEntity();
BeanUtil.copyProperties(deliveryNoteVO, deliveryNoteEntity);
deliveryNoteEntity.setLogId(ObjectUtil.isNotEmpty(logEntity.getId()) ? logEntity.getId().toString() : null);
entities.add(deliveryNoteEntity);
}
if (CollUtil.isNotEmpty(entities)) {
deliveryNoteService.saveBatch(entities);
}
}
if (CollUtil.isNotEmpty(orderInfoVOS)) {
List<OrderInfoEntity> entities = new ArrayList<>();
List<String> orderCodes = new ArrayList<>();
for (OrderInfoVO orderInfoVO : orderInfoVOS) {
orderCodes.add(orderInfoVO.getOrderId());
}
List<OrderInfoEntity> list = orderInfoService.list(Wrappers.<OrderInfoEntity>lambdaQuery()
.in(OrderInfoEntity::getOmsExtOrderNo, orderCodes));
Map<String, String> map = new HashMap<>();
if (CollUtil.isNotEmpty(list)) {
// 将list中的数据封装到map中
list.forEach(item -> {
map.put(item.getOmsExtOrderNo(), item.getOmsExtOrderNo());
});
}
for (OrderInfoVO vo : orderInfoVOS) {
if (map.containsKey(vo.getOmsExtOrderNo())) {
log.error("DD单号:{},已推送过了", vo.getOmsExtOrderNo());
continue;
}
OrderInfoEntity deliveryNoteEntity = new OrderInfoEntity();
BeanUtil.copyProperties(vo, deliveryNoteEntity);
deliveryNoteEntity.setLogId(ObjectUtil.isNotEmpty(logEntity.getId()) ? logEntity.getId().toString() : null);
entities.add(deliveryNoteEntity);
}
if (CollUtil.isNotEmpty(entities)) {
orderInfoService.saveBatch(entities);
}
@RabbitListener(bindings = @QueueBinding(
value = @Queue(name = FactoryDataConstants.Mq.Queues.JP_FACTORY_ORDER),
exchange = @Exchange(name = FactoryDataConstants.Mq.Exchanges.FACTORY_ORDER, type = ExchangeTypes.TOPIC),
key = FactoryDataConstants.Mq.RoutingKeys.JP_FACTORY_ORDER
), ackMode = "MANUAL")
public void factoryOrder(String msg, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long tag) {
log.info("处理金牌订单:{}", msg);
try {
mqWorkerService.factoryOrder(msg);
} catch (Exception e) {
e.printStackTrace();
log.error("处理金牌订单失败: {}", e.getMessage());
}
if (CollUtil.isNotEmpty(packageInfoVOS)) {
List<PackageInfoEntity> entities = new ArrayList<>();
List<String> orderCodes = new ArrayList<>();
List<String> packageCodes = new ArrayList<>();
for (PackageInfoVO orderInfoVO : packageInfoVOS) {
orderCodes.add(orderInfoVO.getOmsExtOrderNo());
packageCodes.add(orderInfoVO.getExtBoxCode());
}
List<PackageInfoEntity> list = packageInfoService.list(Wrappers.<PackageInfoEntity>lambdaQuery()
.in(PackageInfoEntity::getOmsExtOrderNo, orderCodes)
.in(PackageInfoEntity::getExtBoxCode, packageCodes)
);
Map<String, String> map = new HashMap<>();
if (CollUtil.isNotEmpty(list)) {
// 将list中的数据封装到map中
list.forEach(item -> {
map.put(item.getOmsExtOrderNo() + item.getExtBoxCode(), item.getOmsExtOrderNo());
});
}
for (PackageInfoVO vo : packageInfoVOS) {
if (map.containsKey(vo.getOmsExtOrderNo() + vo.getExtBoxCode())) {
log.error("DD单号:{} + 箱码:{},已推送过了", vo.getOmsExtOrderNo(), vo.getExtBoxCode());
continue;
}
PackageInfoEntity entity = new PackageInfoEntity();
BeanUtil.copyProperties(vo, entity);
entity.setLogId(ObjectUtil.isNotEmpty(logEntity.getId()) ? logEntity.getId().toString() : null);
entities.add(entity);
}
if (CollUtil.isNotEmpty(entities)) {
packageInfoService.saveBatch(entities);
}
try {
channel.basicAck(tag, false);
} catch (IOException e) {
throw new RuntimeException(e);
}
// 处理暂存单 通过定时任务扫描的方式判定是否齐套 然后创建暂存单
FactoryOrderLogEntity logEntity1 = new FactoryOrderLogEntity();
logEntity1.setSaxStatus(SaxStatusEnums.SUCCESS.getCode());
logEntity1.setId(logEntity.getId());
logService.saveOrUpdate(logEntity1);
}
}

6
blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/pros/JinPaiProperties.java

@ -69,4 +69,10 @@ public class JinPaiProperties {
private Map<String,String> warehouse;
/** auth过期时间 */
private Long authTime = 30000L;
/** key */
private String auth;
}

3
blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/DeliveryNoteService.java

@ -4,6 +4,7 @@ import com.logpm.factorydata.jinpai.entity.DeliveryNoteEntity;
import com.logpm.factorydata.jinpai.entity.OrderInfoEntity;
import com.logpm.factorydata.jinpai.entity.PackageInfoEntity;
import com.logpm.factorydata.jinpai.vo.DeliveryNoteVO;
import com.logpm.factorydata.jinpai.vo.JpFactoryShipmentVO;
import com.logpm.factorydata.jinpai.vo.OrderInfoVO;
import com.logpm.factorydata.jinpai.vo.PackageInfoVO;
import com.logpm.factorydata.jinpai.vo.PushOrderVO;
@ -34,4 +35,6 @@ public interface DeliveryNoteService extends BaseService<DeliveryNoteEntity> {
void buildAdvance(PushOrderVO vo);
void buildAdvancePull(Map<String, List<PackageInfoEntity>> packageInfoEntityMap, Map<String, DeliveryNoteEntity> deliveryNoteEntityMap, Map<String, OrderInfoEntity> orderInfoEntityMap);
void buildFactoryAdvance(JpFactoryShipmentVO vo);
}

14
blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/JpFactoryOrderService.java

@ -0,0 +1,14 @@
package com.logpm.factorydata.jinpai.service;
import com.logpm.factorydata.jinpai.entity.JpFactoryOrderEntity;
import org.springblade.core.mp.base.BaseService;
/**
* 金牌工厂订单 服务类
*
* @Author zqb
* @Date 2024/4/26
**/
public interface JpFactoryOrderService extends BaseService<JpFactoryOrderEntity> {
}

14
blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/JpFactoryPackageService.java

@ -0,0 +1,14 @@
package com.logpm.factorydata.jinpai.service;
import com.logpm.factorydata.jinpai.entity.JpFactoryPackageEntity;
import org.springblade.core.mp.base.BaseService;
/**
* 金牌工厂包件 服务类
*
* @Author zqb
* @Date 2024/4/26
**/
public interface JpFactoryPackageService extends BaseService<JpFactoryPackageEntity> {
}

19
blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/JpFactoryShipmentService.java

@ -0,0 +1,19 @@
package com.logpm.factorydata.jinpai.service;
import com.logpm.factorydata.jinpai.entity.JpFactoryShipmentEntity;
import com.logpm.factorydata.jinpai.vo.FactoryAuthVO;
import com.logpm.factorydata.jinpai.vo.JpFactoryShipmentVO;
import org.springblade.core.mp.base.BaseService;
/**
* 金牌工厂发货单 服务类
*
* @Author zqb
* @Date 2024/4/26
**/
public interface JpFactoryShipmentService extends BaseService<JpFactoryShipmentEntity> {
FactoryAuthVO findFactoryAuth(String companyCode);
String shipment(JpFactoryShipmentVO bean);
}

14
blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/MqWorkerService.java

@ -0,0 +1,14 @@
package com.logpm.factorydata.jinpai.service;
/**
* 消息队列工作类 服务类
*
* @Author zqb
* @Date 2024/4/26
**/
public interface MqWorkerService {
void factoryShipment(String msg);
void factoryOrder(String msg);
}

157
blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/impl/DeliveryNoteServiceImpl.java

@ -24,6 +24,9 @@ import com.logpm.factorydata.jinpai.mapper.DeliveryNoteMapper;
import com.logpm.factorydata.jinpai.service.DeliveryNoteService;
import com.logpm.factorydata.jinpai.service.FactoryOrderLogService;
import com.logpm.factorydata.jinpai.vo.DeliveryNoteVO;
import com.logpm.factorydata.jinpai.vo.JpFactoryOrderVO;
import com.logpm.factorydata.jinpai.vo.JpFactoryPackageVO;
import com.logpm.factorydata.jinpai.vo.JpFactoryShipmentVO;
import com.logpm.factorydata.jinpai.vo.OrderInfoVO;
import com.logpm.factorydata.jinpai.vo.PackageCategoryVO;
import com.logpm.factorydata.jinpai.vo.PackageInfoVO;
@ -33,7 +36,6 @@ import com.logpm.factorydata.jinpai.vo.ThirdPlWarehouseMappingVO;
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.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
@ -54,6 +56,7 @@ import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import javax.annotation.Resource;
import java.io.File;
import java.io.InputStream;
import java.io.OutputStream;
@ -74,14 +77,16 @@ import java.util.Map;
**/
@Slf4j
@Service
@AllArgsConstructor
public class DeliveryNoteServiceImpl extends BaseServiceImpl<DeliveryNoteMapper, DeliveryNoteEntity> implements DeliveryNoteService {
private final IFactoryDataClient factoryDataClient;
private final FactoryOrderLogService factoryOrderLogService;
private final IOssClient ossClient;
private final IFactoryDataBaseClient baseClient;
@Resource
private IFactoryDataClient factoryDataClient;
@Resource
private FactoryOrderLogService factoryOrderLogService;
@Resource
private IOssClient ossClient;
@Resource
private IFactoryDataBaseClient baseClient;
@Override
public String order(List<DeliveryNoteVO> vo) {
@ -165,7 +170,7 @@ public class DeliveryNoteServiceImpl extends BaseServiceImpl<DeliveryNoteMapper,
@LogpmAsync("asyncExecutor")
@Override
public void buildAdvance(PushOrderVO vo) {
// 新起线程构建暂存单发送mq
// 新起线程构建暂存单发送mq
Long startWarehouseId = null;
String startWarehouseName = null;
String tenantId = null;
@ -253,9 +258,9 @@ public class DeliveryNoteServiceImpl extends BaseServiceImpl<DeliveryNoteMapper,
volume = new BigDecimal(goodsVolume);
}
// 如果有数量没有包条码,则生成系统包条
if(CollUtil.isEmpty(boxCodes)){
if (CollUtil.isEmpty(boxCodes)) {
for (int i = 0; i < Convert.toInt(orderInfoVO.getGoodsNumber()); i++) {
boxCodes.add(orderInfoVO.getCustomItemNo() + "-" + (i+1));
boxCodes.add(orderInfoVO.getCustomItemNo() + "-" + (i + 1));
}
}
int size = boxCodes.size();
@ -524,6 +529,138 @@ public class DeliveryNoteServiceImpl extends BaseServiceImpl<DeliveryNoteMapper,
}
}
@Override
@LogpmAsync("asyncExecutor")
public void buildFactoryAdvance(JpFactoryShipmentVO vo) {
// 新起线程构建暂存单发送mq
Long startWarehouseId = null;
String startWarehouseName = null;
String tenantId = null;
// 获取工厂基地绑定的始发仓信息
List<JpFactoryOrderVO> details = vo.getOrderList();
if (CollUtil.isEmpty(details)) {
return;
}
R<FactoryWarehouseBindVO> warehouseByBrandAndSiteName = baseClient.getWarehouseByBrandAndSiteName(BrandEnums.JP.getValue(), vo.getShipmentHub());
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();
}
}
Map<String, List<PackageInfoVO>> advanceMap = new HashMap<>();
// 一个dd单号 一个暂存单
// 组装暂存单数据
List<JSONObject> advances = new ArrayList<>();
for (JpFactoryOrderVO orderInfoVO : details) {
List<JSONObject> packageList = new ArrayList<>();
TrunklineAdvanceEntity advanceEntity = new TrunklineAdvanceEntity();
Boolean checked = vo.getChecked();
if (checked) {
advanceEntity.setReserve2("1");
} else {
advanceEntity.setReserve2("0");
}
advanceEntity.setTenantId(tenantId);
advanceEntity.setStatus(0);
advanceEntity.setIsDeleted(0);
advanceEntity.setHasPackage(1);
advanceEntity.setOrderType("");
advanceEntity.setBrand(BrandEnums.JP.getValue());
advanceEntity.setSiteName(vo.getShipmentHub());
advanceEntity.setArea("");
advanceEntity.setTotalNum(CollUtil.isNotEmpty(orderInfoVO.getPackageList()) ? orderInfoVO.getPackageList().size() : 0);
advanceEntity.setPackName("");
advanceEntity.setPackCode("");
advanceEntity.setWarehouseId(startWarehouseId);
advanceEntity.setWarehouseName(startWarehouseName);
advanceEntity.setIsGcp(0);
advanceEntity.setCarrierName("");
advanceEntity.setSystemType("线上");
advanceEntity.setMatingType("1");
advanceEntity.setSenderName("");
advanceEntity.setSenderPhone("");
advanceEntity.setSenderAddress("");
advanceEntity.setWaybillStatus("0");
advanceEntity.setWaybillNo("");
advanceEntity.setTrainNumber(vo.getShipmentId());
advanceEntity.setFreezeStatus("0");
advanceEntity.setOrderCode(orderInfoVO.getOrderCode());
advanceEntity.setServiceNum(orderInfoVO.getServiceNum());
advanceEntity.setSenderFactory("金牌");
// 门店是商场
// advanceEntity.setDealerCode(orderInfoVO.getShopCode());
advanceEntity.setDealerName(orderInfoVO.getMallName());
// advanceEntity.setStoreCode(orderInfoVO.getShopCode());
advanceEntity.setStoreName(orderInfoVO.getStoreName());
// 安装是客户
advanceEntity.setCustomerName(orderInfoVO.getReceiverName());
advanceEntity.setCustomerPhone(orderInfoVO.getReceiverMobile());
advanceEntity.setCustomerAddress(orderInfoVO.getReceiverAddress());
// 收货人就是商场收货人
advanceEntity.setConsigneePerson(orderInfoVO.getMallConsignee());
advanceEntity.setConsigneeMobile(orderInfoVO.getMallConsigneeMobile());
advanceEntity.setConsigneeAddress(orderInfoVO.getMallAddress());
// 封装包件品类信息
for (JpFactoryPackageVO packageInfoVO : orderInfoVO.getPackageList()) {
// 封装包件
TrunklineAdvanceDetailEntity advanceDetailEntity = new TrunklineAdvanceDetailEntity();
advanceDetailEntity.setWarehouseId(startWarehouseId);
advanceDetailEntity.setWarehouseName(startWarehouseName);
advanceDetailEntity.setOrderCode(orderInfoVO.getOrderCode());
advanceDetailEntity.setBrand(BrandEnums.JP.getValue());
advanceDetailEntity.setSystemType("线上");
// 获取映射品类信息
advanceDetailEntity.setFirstPackName(packageInfoVO.getFirstPackName());
advanceDetailEntity.setFirstPackCode(packageInfoVO.getFirstPackCode());
advanceDetailEntity.setSecondPackName(packageInfoVO.getSecondPackName());
advanceDetailEntity.setSecondPackCode(packageInfoVO.getSecondPackCode());
advanceDetailEntity.setThirdPackName(packageInfoVO.getThirdPackName());
advanceDetailEntity.setThirdPackCode(packageInfoVO.getThirdPackCode());
advanceDetailEntity.setSiteName(vo.getShipmentHub());
advanceDetailEntity.setSiteCode("");
advanceDetailEntity.setQuantity(1);
advanceDetailEntity.setOrderPackageCode(packageInfoVO.getUnitNo());
advanceDetailEntity.setTrainNumber(vo.getShipmentId());
advanceDetailEntity.setServiceNum(orderInfoVO.getServiceNum());
advanceDetailEntity.setWaybillNo("");
advanceDetailEntity.setPackageStatus("0");
advanceDetailEntity.setWeight(NumberUtil.toBigDecimal(packageInfoVO.getWeight()));
advanceDetailEntity.setVolume(NumberUtil.toBigDecimal(packageInfoVO.getVolume()));
// 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_JP).message(JSONUtil.toJsonStr(advance)).build();
factoryDataClient.sendMessage(sendMsg);
}
}
}
private String uploadFile(String body) {
// 文本内容和保存为本地文件 并上传
String logPath = FileLogsUtil.saveFileLogs(body);

22
blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/impl/JpFactoryOrderServiceImpl.java

@ -0,0 +1,22 @@
package com.logpm.factorydata.jinpai.service.impl;
import com.logpm.factorydata.jinpai.entity.JpFactoryOrderEntity;
import com.logpm.factorydata.jinpai.mapper.JpFactoryOrderMapper;
import com.logpm.factorydata.jinpai.service.JpFactoryOrderService;
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 JpFactoryOrderServiceImpl extends BaseServiceImpl<JpFactoryOrderMapper, JpFactoryOrderEntity> implements JpFactoryOrderService {
}

22
blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/impl/JpFactoryPackageServiceImpl.java

@ -0,0 +1,22 @@
package com.logpm.factorydata.jinpai.service.impl;
import com.logpm.factorydata.jinpai.entity.JpFactoryPackageEntity;
import com.logpm.factorydata.jinpai.mapper.JpFactoryPackageMapper;
import com.logpm.factorydata.jinpai.service.JpFactoryPackageService;
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 JpFactoryPackageServiceImpl extends BaseServiceImpl<JpFactoryPackageMapper, JpFactoryPackageEntity> implements JpFactoryPackageService {
}

137
blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/impl/JpFactoryShipmentServiceImpl.java

@ -0,0 +1,137 @@
package com.logpm.factorydata.jinpai.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.logpm.factorydata.enums.SaxStatusEnums;
import com.logpm.factorydata.feign.IFactoryDataClient;
import com.logpm.factorydata.jinpai.entity.FactoryOrderLogEntity;
import com.logpm.factorydata.jinpai.entity.JpFactoryShipmentEntity;
import com.logpm.factorydata.jinpai.mapper.JpFactoryShipmentMapper;
import com.logpm.factorydata.jinpai.service.FactoryOrderLogService;
import com.logpm.factorydata.jinpai.service.JpFactoryShipmentService;
import com.logpm.factorydata.jinpai.vo.FactoryAuthVO;
import com.logpm.factorydata.jinpai.vo.JpFactoryShipmentVO;
import com.logpm.factorydata.vo.SendMsg;
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.mp.base.BaseServiceImpl;
import org.springblade.core.oss.model.BladeFile;
import org.springblade.core.redis.cache.BladeRedis;
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 javax.annotation.Resource;
import java.io.File;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.file.Files;
import java.time.Duration;
import java.util.List;
/**
* 金牌工厂发货单 业务实现类
*
* @Author zqb
* @Date 2024/4/26
**/
@Slf4j
@Service
public class JpFactoryShipmentServiceImpl extends BaseServiceImpl<JpFactoryShipmentMapper, JpFactoryShipmentEntity> implements JpFactoryShipmentService {
@Resource
private BladeRedis bladeRedis;
@Resource
private IOssClient ossClient;
@Resource
private IFactoryDataClient factoryDataClient;
@Resource
private FactoryOrderLogService factoryOrderLogService;
@Override
public FactoryAuthVO findFactoryAuth(String companyCode) {
// redis 缓存数据 缓存时间 1天
if (StrUtil.isNotBlank(companyCode)) {
String key = "factory-data:jinpai:" + companyCode;
String json = bladeRedis.get(key);
if (StrUtil.isNotBlank(json)) {
return JSONUtil.toBean(json, FactoryAuthVO.class);
} else {
List<FactoryAuthVO> factoryAuth = baseMapper.findFactoryAuth(companyCode);
if(CollUtil.isNotEmpty(factoryAuth)){
FactoryAuthVO authVO = factoryAuth.get(0);
bladeRedis.setEx(key, JSONUtil.toJsonStr(authVO), Duration.ofDays(1));
return authVO;
}
}
}
return null;
}
@Override
public String shipment(JpFactoryShipmentVO vo) {
// 1 上传数据到 minio 获取到地址
String url = uploadFile(JSONUtil.toJsonStr(vo));
// 2 保存地址到数据库
FactoryOrderLogEntity logEntity = new FactoryOrderLogEntity();
logEntity.setType(2);
logEntity.setSaxStatus(SaxStatusEnums.NOMAL.getCode());
logEntity.setLogUrl(url);
factoryOrderLogService.save(logEntity);
// 3 将消息发送给 mq,解析保存
SendMsg build = SendMsg.builder().exchange(FactoryDataConstants.Mq.Exchanges.FACTORY_ORDER)
.routingKey(FactoryDataConstants.Mq.RoutingKeys.JP_FACTORY_SHIPMENT).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, "jp-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);
}
}

356
blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/impl/MqWorkerServiceImpl.java

@ -0,0 +1,356 @@
package com.logpm.factorydata.jinpai.service.impl;
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.JSONUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.factorydata.enums.SaxStatusEnums;
import com.logpm.factorydata.jinpai.entity.DeliveryNoteEntity;
import com.logpm.factorydata.jinpai.entity.FactoryOrderLogEntity;
import com.logpm.factorydata.jinpai.entity.JpFactoryOrderEntity;
import com.logpm.factorydata.jinpai.entity.JpFactoryPackageEntity;
import com.logpm.factorydata.jinpai.entity.JpFactoryShipmentEntity;
import com.logpm.factorydata.jinpai.entity.OrderInfoEntity;
import com.logpm.factorydata.jinpai.entity.PackageInfoEntity;
import com.logpm.factorydata.jinpai.entity.PushOrderDetailEntity;
import com.logpm.factorydata.jinpai.entity.PushOrderEntity;
import com.logpm.factorydata.jinpai.enums.DimensionEnums;
import com.logpm.factorydata.jinpai.service.DeliveryNoteService;
import com.logpm.factorydata.jinpai.service.FactoryOrderLogService;
import com.logpm.factorydata.jinpai.service.JpFactoryOrderService;
import com.logpm.factorydata.jinpai.service.JpFactoryPackageService;
import com.logpm.factorydata.jinpai.service.JpFactoryShipmentService;
import com.logpm.factorydata.jinpai.service.MqWorkerService;
import com.logpm.factorydata.jinpai.service.OrderInfoService;
import com.logpm.factorydata.jinpai.service.PackageInfoService;
import com.logpm.factorydata.jinpai.service.PushOrderDetailService;
import com.logpm.factorydata.jinpai.service.PushOrderService;
import com.logpm.factorydata.jinpai.vo.DeliveryNoteVO;
import com.logpm.factorydata.jinpai.vo.JpFactoryOrderVO;
import com.logpm.factorydata.jinpai.vo.JpFactoryPackageVO;
import com.logpm.factorydata.jinpai.vo.JpFactoryShipmentVO;
import com.logpm.factorydata.jinpai.vo.OrderInfoVO;
import com.logpm.factorydata.jinpai.vo.PackageCategoryVO;
import com.logpm.factorydata.jinpai.vo.PackageInfoVO;
import com.logpm.factorydata.jinpai.vo.PushOrderDetailVO;
import com.logpm.factorydata.jinpai.vo.PushOrderVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.secure.utils.AuthUtil;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 消息队列工作类 业务实现类
*
* @Author zqb
* @Date 2024/4/26
**/
@Slf4j
@Service
@AllArgsConstructor
public class MqWorkerServiceImpl implements MqWorkerService {
private final PushOrderService pushOrderService;
private final PushOrderDetailService pushOrderDetailService;
private final DeliveryNoteService deliveryNoteService;
private final OrderInfoService orderInfoService;
private final PackageInfoService packageInfoService;
private final FactoryOrderLogService logService;
private final JpFactoryShipmentService jpFactoryShipmentService;
private final JpFactoryOrderService jpFactoryOrderService;
private final JpFactoryPackageService jpFactoryPackageService;
@Override
@Transactional(rollbackFor = Exception.class)
public void factoryShipment(String msg) {
if (StrUtil.isEmpty(msg)) {
log.error("消息内容为空");
return;
}
FactoryOrderLogEntity logEntity = JSONUtil.toBean(msg, FactoryOrderLogEntity.class);
if (ObjectUtil.isEmpty(logEntity)) {
log.error("消息内容为空");
return;
}
// 去 minio 下载文件到本地,然后解析文件内容为实体对象
JpFactoryShipmentVO pushOrderVO = null;
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)) {
pushOrderVO = JSONUtil.toBean(content, JpFactoryShipmentVO.class);
}
}
}
shipmentData(pushOrderVO, logEntity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void factoryOrder(String msg) {
if (StrUtil.isEmpty(msg)) {
log.error("消息内容为空");
return;
}
FactoryOrderLogEntity logEntity = JSONUtil.toBean(msg, FactoryOrderLogEntity.class);
if (ObjectUtil.isEmpty(logEntity)) {
log.error("消息内容为空");
return;
}
// 去 minio 下载文件到本地,然后解析文件内容为实体对象
List<DeliveryNoteVO> deliveryNoteVOS = null;
List<OrderInfoVO> orderInfoVOS = null;
List<PackageInfoVO> packageInfoVOS = null;
PushOrderVO pushOrderVO = null;
Long logId = logEntity.getId();
String logUrl = logEntity.getLogUrl();
// 1 订单 2 订单明细 3 包件
Integer dimension = logEntity.getDimension();
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)) {
// 拉取的数据
if (ObjectUtil.equal(logEntity.getType(), 1)) {
if (ObjectUtil.equal(dimension, DimensionEnums.ORDER.getCode())) {
deliveryNoteVOS = new JSONArray(content).toList(DeliveryNoteVO.class);
}
if (ObjectUtil.equal(dimension, DimensionEnums.ORDER_DETAIL.getCode())) {
orderInfoVOS = new JSONArray(content).toList(OrderInfoVO.class);
}
if (ObjectUtil.equal(dimension, DimensionEnums.PACKAGE.getCode())) {
packageInfoVOS = new JSONArray(content).toList(PackageInfoVO.class);
}
} else if (ObjectUtil.equal(logEntity.getType(), 2)) {
// 推送的数据
pushOrderVO = JSONUtil.toBean(content, PushOrderVO.class);
}
}
}
}
if (ObjectUtil.equal(logEntity.getType(), 1)) {
pullData(deliveryNoteVOS, orderInfoVOS, packageInfoVOS, logEntity);
} else if (ObjectUtil.equal(logEntity.getType(), 2)) {
pushData(pushOrderVO, logEntity);
}
}
private void shipmentData(JpFactoryShipmentVO vo, FactoryOrderLogEntity logEntity) {
if (ObjectUtil.isNotEmpty(vo)) {
// 1 解析数据保存入库
// 装车单号唯一
Long logId = logEntity.getId();
String truckNo = vo.getShipmentId();
if (StrUtil.isEmpty(truckNo)) {
return;
}
List<JpFactoryShipmentEntity> list = jpFactoryShipmentService.list(Wrappers.<JpFactoryShipmentEntity>lambdaQuery().eq(JpFactoryShipmentEntity::getShipmentId, truckNo));
Boolean checked = Boolean.FALSE;
if (CollUtil.isNotEmpty(list)) {
if (list.size() > 1) {
return;
}
checked = Boolean.TRUE;
}
vo.setChecked(checked);
vo.setLogId(ObjectUtil.isNotEmpty(logId) ? logId.toString() : null);
vo.setTenantCode(AuthUtil.getTenantId());
jpFactoryShipmentService.save(vo);
List<JpFactoryOrderVO> orderVOS = vo.getOrderList();
if (CollUtil.isNotEmpty(orderVOS)) {
List<JpFactoryPackageEntity> packageEntities = new ArrayList<>();
for (JpFactoryOrderVO orderVO : orderVOS) {
JpFactoryOrderEntity orderEntity = new JpFactoryOrderEntity();
BeanUtil.copyProperties(orderVO, orderEntity);
orderEntity.setLogId(ObjectUtil.isNotEmpty(logId) ? logId.toString() : null);
orderEntity.setShipmentId(vo.getId());
orderEntity.setChecked(checked);
orderEntity.setTenantCode(AuthUtil.getTenantId());
jpFactoryOrderService.save(orderEntity);
List<JpFactoryPackageVO> packageList = orderVO.getPackageList();
if (CollUtil.isNotEmpty(packageList)) {
for (JpFactoryPackageVO jpFactoryPackageVO : packageList) {
JpFactoryPackageEntity packageEntity = new JpFactoryPackageEntity();
BeanUtil.copyProperties(jpFactoryPackageVO, packageEntity);
packageEntity.setLogId(ObjectUtil.isNotEmpty(logId) ? logId.toString() : null);
packageEntity.setOrderId(orderEntity.getId());
packageEntity.setChecked(checked);
packageEntity.setTenantCode(AuthUtil.getTenantId());
packageEntities.add(packageEntity);
}
}
}
if (CollUtil.isNotEmpty(packageEntities)) {
jpFactoryPackageService.saveBatch(packageEntities);
}
}
// 2 构建暂存单,发送 mq 消息
FactoryOrderLogEntity logEntity1 = new FactoryOrderLogEntity();
logEntity1.setSaxStatus(SaxStatusEnums.SUCCESS.getCode());
logEntity1.setId(logId);
logService.saveOrUpdate(logEntity1);
// 处理暂存单
deliveryNoteService.buildFactoryAdvance(vo);
}
}
private void pushData(PushOrderVO vo, FactoryOrderLogEntity logEntity) {
if (ObjectUtil.isNotEmpty(vo)) {
// 1 解析数据保存入库
// 装车单号唯一
Long logId = logEntity.getId();
String truckNo = vo.getTransportNo();
List<PushOrderEntity> list = pushOrderService.list(Wrappers.<PushOrderEntity>lambdaQuery().eq(PushOrderEntity::getTransportNo, truckNo));
if (CollUtil.isNotEmpty(list)) {
log.error("装车单号{} 数据已经处理过了, logId: {}", truckNo, logId);
return;
}
vo.setLogId(ObjectUtil.isNotEmpty(logId) ? logId.toString() : null);
pushOrderService.save(vo);
List<PushOrderDetailVO> orderInfos = vo.getItems();
if (CollUtil.isNotEmpty(orderInfos)) {
List<PushOrderDetailEntity> infoEntities = new ArrayList<>();
for (PushOrderDetailVO orderInfo : orderInfos) {
PushOrderDetailEntity orderInfoEntity = new PushOrderDetailEntity();
BeanUtil.copyProperties(orderInfo, orderInfoEntity);
orderInfoEntity.setLogId(ObjectUtil.isNotEmpty(logId) ? logId.toString() : null);
orderInfoEntity.setOrderId(vo.getId().toString());
List<String> boxCodes = orderInfo.getBoxCodes();
if (CollUtil.isNotEmpty(boxCodes)) {
orderInfoEntity.setBoxCodeList(JSONUtil.toJsonStr(boxCodes));
}
List<PackageCategoryVO> boxDetails = orderInfo.getBoxDetails();
if (CollUtil.isNotEmpty(boxDetails)) {
orderInfoEntity.setBoxDetailList(JSONUtil.toJsonStr(boxDetails));
}
infoEntities.add(orderInfoEntity);
}
pushOrderDetailService.saveBatch(infoEntities);
}
// 2 构建暂存单,发送 mq 消息
FactoryOrderLogEntity logEntity1 = new FactoryOrderLogEntity();
logEntity1.setSaxStatus(SaxStatusEnums.SUCCESS.getCode());
logEntity1.setId(logId);
logService.saveOrUpdate(logEntity1);
// 处理暂存单
deliveryNoteService.buildAdvance(vo);
}
}
private void pullData(List<DeliveryNoteVO> deliveryNoteVOS, List<OrderInfoVO> orderInfoVOS, List<PackageInfoVO> packageInfoVOS, FactoryOrderLogEntity logEntity) {
if (CollUtil.isNotEmpty(deliveryNoteVOS)) {
List<DeliveryNoteEntity> entities = new ArrayList<>();
List<String> orderCodes = new ArrayList<>();
for (DeliveryNoteVO deliveryNoteVO : deliveryNoteVOS) {
orderCodes.add(deliveryNoteVO.getOrderId());
}
List<DeliveryNoteEntity> list = deliveryNoteService.list(Wrappers.<DeliveryNoteEntity>lambdaQuery()
.in(DeliveryNoteEntity::getOrderId, orderCodes));
Map<String, String> map = new HashMap<>();
if (CollUtil.isNotEmpty(list)) {
// 将list中的数据封装到map中
list.forEach(item -> {
map.put(item.getOrderId(), item.getOrderId());
});
}
for (DeliveryNoteVO deliveryNoteVO : deliveryNoteVOS) {
if (map.containsKey(deliveryNoteVO.getOrderId())) {
log.error("订单号:{},已推送过了", deliveryNoteVO.getOrderId());
continue;
}
DeliveryNoteEntity deliveryNoteEntity = new DeliveryNoteEntity();
BeanUtil.copyProperties(deliveryNoteVO, deliveryNoteEntity);
deliveryNoteEntity.setLogId(ObjectUtil.isNotEmpty(logEntity.getId()) ? logEntity.getId().toString() : null);
entities.add(deliveryNoteEntity);
}
if (CollUtil.isNotEmpty(entities)) {
deliveryNoteService.saveBatch(entities);
}
}
if (CollUtil.isNotEmpty(orderInfoVOS)) {
List<OrderInfoEntity> entities = new ArrayList<>();
List<String> orderCodes = new ArrayList<>();
for (OrderInfoVO orderInfoVO : orderInfoVOS) {
orderCodes.add(orderInfoVO.getOrderId());
}
List<OrderInfoEntity> list = orderInfoService.list(Wrappers.<OrderInfoEntity>lambdaQuery()
.in(OrderInfoEntity::getOmsExtOrderNo, orderCodes));
Map<String, String> map = new HashMap<>();
if (CollUtil.isNotEmpty(list)) {
// 将list中的数据封装到map中
list.forEach(item -> {
map.put(item.getOmsExtOrderNo(), item.getOmsExtOrderNo());
});
}
for (OrderInfoVO vo : orderInfoVOS) {
if (map.containsKey(vo.getOmsExtOrderNo())) {
log.error("DD单号:{},已推送过了", vo.getOmsExtOrderNo());
continue;
}
OrderInfoEntity deliveryNoteEntity = new OrderInfoEntity();
BeanUtil.copyProperties(vo, deliveryNoteEntity);
deliveryNoteEntity.setLogId(ObjectUtil.isNotEmpty(logEntity.getId()) ? logEntity.getId().toString() : null);
entities.add(deliveryNoteEntity);
}
if (CollUtil.isNotEmpty(entities)) {
orderInfoService.saveBatch(entities);
}
}
if (CollUtil.isNotEmpty(packageInfoVOS)) {
List<PackageInfoEntity> entities = new ArrayList<>();
List<String> orderCodes = new ArrayList<>();
List<String> packageCodes = new ArrayList<>();
for (PackageInfoVO orderInfoVO : packageInfoVOS) {
orderCodes.add(orderInfoVO.getOmsExtOrderNo());
packageCodes.add(orderInfoVO.getExtBoxCode());
}
List<PackageInfoEntity> list = packageInfoService.list(Wrappers.<PackageInfoEntity>lambdaQuery()
.in(PackageInfoEntity::getOmsExtOrderNo, orderCodes)
.in(PackageInfoEntity::getExtBoxCode, packageCodes)
);
Map<String, String> map = new HashMap<>();
if (CollUtil.isNotEmpty(list)) {
// 将list中的数据封装到map中
list.forEach(item -> {
map.put(item.getOmsExtOrderNo() + item.getExtBoxCode(), item.getOmsExtOrderNo());
});
}
for (PackageInfoVO vo : packageInfoVOS) {
if (map.containsKey(vo.getOmsExtOrderNo() + vo.getExtBoxCode())) {
log.error("DD单号:{} + 箱码:{},已推送过了", vo.getOmsExtOrderNo(), vo.getExtBoxCode());
continue;
}
PackageInfoEntity entity = new PackageInfoEntity();
BeanUtil.copyProperties(vo, entity);
entity.setLogId(ObjectUtil.isNotEmpty(logEntity.getId()) ? logEntity.getId().toString() : null);
entities.add(entity);
}
if (CollUtil.isNotEmpty(entities)) {
packageInfoService.saveBatch(entities);
}
}
// 处理暂存单 通过定时任务扫描的方式判定是否齐套 然后创建暂存单
FactoryOrderLogEntity logEntity1 = new FactoryOrderLogEntity();
logEntity1.setSaxStatus(SaxStatusEnums.SUCCESS.getCode());
logEntity1.setId(logEntity.getId());
logService.saveOrUpdate(logEntity1);
}
}

28
blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/vo/FactoryAuthVO.java

@ -0,0 +1,28 @@
package com.logpm.factorydata.jinpai.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 物流商认证
*
* @author zhaoqiaobo
* @create 2024-04-26
*/
@Data
public class FactoryAuthVO {
@ApiModelProperty(name = "物流编码")
private String logisticsCode;
@ApiModelProperty(name = "秘钥")
private String appKey;
@ApiModelProperty(name = "物流公司")
private String companyCode;
@ApiModelProperty(name = "租户")
private String tenantCode;
@ApiModelProperty(name = "登录账号")
private String loginAccount;
@ApiModelProperty(name = "Authorization头")
private String authorizationHeader;
}

27
blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/vo/FactoryOrderDataVO.java

@ -0,0 +1,27 @@
package com.logpm.factorydata.jinpai.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 送货单 实体类
*
* @author zhaoqiaobo
* @create 2024-04-26
*/
@Data
@ApiModel(value = "发货单", description = "发货单")
public class FactoryOrderDataVO {
@ApiModelProperty("加密后的密文")
private String digest;
@ApiModelProperty("时间戳 毫秒")
private Long timestamp;
@ApiModelProperty("公司编码")
private String companyCode;
@ApiModelProperty("订单信息")
private String params;
}

25
blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/vo/JpFactoryOrderVO.java

@ -0,0 +1,25 @@
package com.logpm.factorydata.jinpai.vo;
import com.logpm.factorydata.jinpai.entity.JpFactoryOrderEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
/**
* 送货单 实体类
*
* @author zhaoqiaobo
* @create 2024-04-26
*/
@Data
@ApiModel(value = "发货单", description = "发货单")
@EqualsAndHashCode(callSuper = true)
public class JpFactoryOrderVO extends JpFactoryOrderEntity {
@ApiModelProperty(name = "包件明细")
private List<JpFactoryPackageVO> packageList;
}

21
blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/vo/JpFactoryPackageVO.java

@ -0,0 +1,21 @@
package com.logpm.factorydata.jinpai.vo;
import com.logpm.factorydata.jinpai.entity.JpFactoryPackageEntity;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 送货单 实体类
*
* @author zhaoqiaobo
* @create 2024-04-26
*/
@Data
@ApiModel(value = "发货单", description = "发货单")
@EqualsAndHashCode(callSuper = true)
public class JpFactoryPackageVO extends JpFactoryPackageEntity {
}

25
blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/vo/JpFactoryShipmentVO.java

@ -0,0 +1,25 @@
package com.logpm.factorydata.jinpai.vo;
import com.logpm.factorydata.jinpai.entity.JpFactoryShipmentEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
/**
* 送货单 实体类
*
* @author zhaoqiaobo
* @create 2024-04-26
*/
@Data
@ApiModel(value = "发货单", description = "发货单")
@EqualsAndHashCode(callSuper = true)
public class JpFactoryShipmentVO extends JpFactoryShipmentEntity {
@ApiModelProperty(name = "订单明细")
private List<JpFactoryOrderVO> orderList;
}

2
blade-service/logpm-report/src/main/java/com/logpm/report/job/LargeScreenQueryXxlJob.java

@ -38,7 +38,7 @@ public class LargeScreenQueryXxlJob {
/**
* 数据查询
*/
@XxlJob("largeScreenexExcute")
// @XxlJob("largeScreenexExcute")
public ReturnT<String> largeScreenexExcute(String param) {
XxlJobQueryVO xxlJobQueryVO = new XxlJobQueryVO();
xxlJobQueryVO.setMapWarehouse(mapWarehouseService.list());

10
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.xml

@ -234,7 +234,7 @@
count(lta.id)-count(ltcls.id) noOutNum,
sum(if( ltcls.id is null and now() &lt;= DATE_ADD( lta.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0)) noOutOverNum,
sum(if(ltcll.start_date &lt;= DATE_ADD( lta.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0)) onTimeNum,
IFNULL(round(sum(if(ltcll.start_date &lt;= DATE_ADD( lta.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0))/count(ltcls.id)*100,2),'0.00') onTimeRate,
IFNULL(round(sum(if(ltcll.start_date &lt;= DATE_ADD( lta.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0))/count(lta.id)*100,2),'0.00') onTimeRate,
round(sum(TIMESTAMPDIFF(SECOND, lta.create_time, ltcll.start_date))/count(ltcls.id)/3600,1) avgTime
from logpm_trunkline_advance_detail lta
left join logpm_warehouse_waybill lww on lww.id = lta.waybill_id
@ -1328,6 +1328,7 @@
lww.consignee consignee,
lww.departure_warehouse_name departureWarehouseName,
lww.destination_warehouse_name destinationWarehouseName,
IFNULL(lqd.delivery_type,lww.service_type) serviceType,
GROUP_CONCAT(DISTINCT ltad.train_number) trainNumber,
GROUP_CONCAT(DISTINCT ltcls.load_code) loadingLoadCode,
GROUP_CONCAT(DISTINCT ltclsm.load_code) unloadLoadCode,
@ -1423,6 +1424,7 @@
lww.consignee,
lww.departure_warehouse_name,
lww.destination_warehouse_name,
lqd.delivery_type,lww.service_type,
oat.day_time
<trim prefix="HAVING" prefixOverrides="AND">
<if test="param.trainNumber != null and param.trainNumber !='' ">
@ -1446,6 +1448,11 @@
lww.consignee consignee,
lww.departure_warehouse_name departureWarehouseName,
lww.destination_warehouse_name destinationWarehouseName,
CASE WHEN IFNULL(lqd.delivery_type,lww.service_type)=1 THEN '商配'
WHEN IFNULL(lqd.delivery_type,lww.service_type)=2 THEN '市配'
WHEN IFNULL(lqd.delivery_type,lww.service_type)=3 THEN '自提'
WHEN IFNULL(lqd.delivery_type,lww.service_type)=4 THEN '三方中转'
ELSE '未知' END serviceType,
GROUP_CONCAT(DISTINCT ltad.train_number) trainNumber,
GROUP_CONCAT(DISTINCT ltcls.load_code) loadingLoadCode,
GROUP_CONCAT(DISTINCT ltclsm.load_code) unloadLoadCode,
@ -1541,6 +1548,7 @@
lww.consignee,
lww.departure_warehouse_name,
lww.destination_warehouse_name,
lqd.delivery_type,lww.service_type,
oat.day_time
<trim prefix="HAVING" prefixOverrides="AND">
<if test="param.trainNumber != null and param.trainNumber !='' ">

9
blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportTimeServiceImpl.java

@ -158,7 +158,11 @@ public class ReportTimeServiceImpl implements IReportTimeService {
}
IPage<ReportPackgeStartTimeVO> iPage = reportTimeMapper.packageStartTimePage(page,reportTimeDTO);
List<ReportPackgeStartTimeVO> records = iPage.getRecords();
records.forEach(reportPackgeStartTimeVO -> {
reportPackgeStartTimeVO.setHoursTime(reportTimeDTO.getHoursTime());
});
iPage.setRecords(records);
return R.data(iPage);
}
@ -181,6 +185,9 @@ public class ReportTimeServiceImpl implements IReportTimeService {
}
List<ReportPackgeStartTimeVO> list = reportTimeMapper.packageStartTimeExport(reportTimeDTO);
list.forEach(reportPackgeStartTimeVO -> {
reportPackgeStartTimeVO.setHoursTime(reportTimeDTO.getHoursTime());
});
//导出ls
ExcelUtil.export(response, "订制品发运时效报表导出", "订制品发运时效报表导出", list, ReportPackgeStartTimeVO.class);

6
blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BillingDataServiceImpl.java

@ -34,7 +34,7 @@ public class BillingDataServiceImpl implements IBillingDataService {
@Override
public BillingDataVO getBillingData() {
LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.<LargeScreenDataEntity>lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime));
LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.<LargeScreenDataEntity>lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime).last("LIMIT 1"));
XxlJobQueryVO init = JSON.parseObject(largeScreenDataEntity.getData(), XxlJobQueryVO.class);
@ -43,7 +43,7 @@ public class BillingDataServiceImpl implements IBillingDataService {
@Override
public List<WarehouseBillingDataVO> getWarehouseBillingData() {
LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.<LargeScreenDataEntity>lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime));
LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.<LargeScreenDataEntity>lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime).last("LIMIT 1"));
XxlJobQueryVO init = JSON.parseObject(largeScreenDataEntity.getData(), XxlJobQueryVO.class);
@ -58,7 +58,7 @@ public class BillingDataServiceImpl implements IBillingDataService {
@Override
public List<MonthBillingDataVO> getMonthBillingData() {
LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.<LargeScreenDataEntity>lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime));
LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.<LargeScreenDataEntity>lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime).last("LIMIT 1"));
if (largeScreenDataEntity == null) {
return new ArrayList<>();

2
blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BinLocationServiceImpl.java

@ -21,7 +21,7 @@ public class BinLocationServiceImpl implements IBinLocationService {
public BinLocationDataVO getBinLocationData() {
LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.<LargeScreenDataEntity>lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime));
LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.<LargeScreenDataEntity>lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime).last("LIMIT 1"));
if (largeScreenDataEntity == null) {
return new BinLocationDataVO();

2
blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BusinessRationServiceImpl.java

@ -24,7 +24,7 @@ public class BusinessRationServiceImpl implements IBusinessRationService {
@Override
public BusinessRatioDataVO getBusinessRatioData() {
LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.<LargeScreenDataEntity>lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime));
LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.<LargeScreenDataEntity>lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime).last("LIMIT 1"));
if (largeScreenDataEntity == null) {
return new BusinessRatioDataVO();
}

2
blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/CarsLoadDataServiceImpl.java

@ -34,7 +34,7 @@ public class CarsLoadDataServiceImpl implements ICarsLoadDataService {
@Override
public List<CareerLineDataVO> getCareerLineData(Integer isDelivery) {
LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.<LargeScreenDataEntity>lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime));
LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.<LargeScreenDataEntity>lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime).last("LIMIT 1"));
if (largeScreenDataEntity == null) {
return new ArrayList<>();

2
blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/DeliveryDataServiceImpl.java

@ -24,7 +24,7 @@ public class DeliveryDataServiceImpl implements IDeliveryDataService {
@Override
public DeliveryDataVO getDeliveryAllData(Integer isYear) {
LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.<LargeScreenDataEntity>lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime));
LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.<LargeScreenDataEntity>lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime).last("LIMIT 1"));
if (largeScreenDataEntity == null) {
return new DeliveryDataVO();

2
blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/MapWarehouseServiceImpl.java

@ -31,7 +31,7 @@ public class MapWarehouseServiceImpl implements IMapWarehouseService {
@Override
public List<MapWarehouseVO> list() {
LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.<LargeScreenDataEntity>lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime));
LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.<LargeScreenDataEntity>lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime).last("LIMIT 1"));
if (largeScreenDataEntity == null) {
return new ArrayList<>();

2
blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/NodeDataServiceImpl.java

@ -21,7 +21,7 @@ public class NodeDataServiceImpl implements INodeDataService {
@Override
public NodeDataVO getNodeData() {
LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.<LargeScreenDataEntity>lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime));
LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.<LargeScreenDataEntity>lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime).last("LIMIT 1"));
if (largeScreenDataEntity == null) {
return new NodeDataVO();

2
blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/TrunkDataServiceImpl.java

@ -25,7 +25,7 @@ public class TrunkDataServiceImpl implements ITrunkDataService {
@Override
public TrunkDataVO getTrunkData() {
LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.<LargeScreenDataEntity>lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime));
LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.<LargeScreenDataEntity>lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime).last("LIMIT 1"));
if (largeScreenDataEntity == null) {
return new TrunkDataVO();

3
blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportOrderAllTimeVO.java

@ -34,6 +34,9 @@ public class ReportOrderAllTimeVO implements Serializable {
@ExcelProperty(value = "目的仓")
private String destinationWarehouseName;
@ExcelProperty(value = "订单类型")
private String serviceType;
@ExcelProperty(value = "客户车次号")
private String trainNumber;

3
blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportPackgeStartTimeVO.java

@ -39,5 +39,8 @@ public class ReportPackgeStartTimeVO implements Serializable {
@ExcelProperty(value = "平均发运时效")
private String avgTime;
@ExcelProperty(value = "标准时效")
private Integer hoursTime;
}

12
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/WaybillCheckListener.java

@ -310,6 +310,7 @@ public class WaybillCheckListener {
trunklinePackageEntity.setThirdOperationPrice(thirdOperationPrice.multiply(new BigDecimal(num)));
BigDecimal systemFreightPrice = wayBillDetail.getFreightPrice();
BigDecimal price = wayBillDetail.getPrice();
BigDecimal systemPickupPrice = wayBillDetail.getPickupPrice();
@ -320,20 +321,23 @@ public class WaybillCheckListener {
Integer systemWarehouseChargeType = wayBillDetail.getSystemWarehouseChargeType();
Integer systemDeliveryChargeType = wayBillDetail.getSystemDeliveryChargeType();
trunklinePackageEntity.setFreightChargeType(chargeType);
trunklinePackageEntity.setSystemFreightChargeType(systemChargeType);
if (systemChargeType == 1) {
trunklinePackageEntity.setSystemFreightPrice(systemFreightPrice.multiply(new BigDecimal(num)));
} else if (systemChargeType == 2) {
trunklinePackageEntity.setSystemFreightPrice(systemFreightPrice.multiply(trunklinePackageEntity.getWeight()));
trunklinePackageEntity.setSystemFreightPrice(systemFreightPrice.multiply(weight));
} else if (systemChargeType == 3) {
trunklinePackageEntity.setSystemFreightPrice(systemFreightPrice.multiply(trunklinePackageEntity.getVolume()));
trunklinePackageEntity.setSystemFreightPrice(systemFreightPrice.multiply(volume));
}
if (chargeType == 1) {
trunklinePackageEntity.setFreightPrice(price.multiply(new BigDecimal(num)));
} else if (chargeType == 2) {
trunklinePackageEntity.setFreightPrice(price.multiply(trunklinePackageEntity.getWeight()));
trunklinePackageEntity.setFreightPrice(price.multiply(weight));
} else if (chargeType == 3) {
trunklinePackageEntity.setFreightPrice(price.multiply(trunklinePackageEntity.getVolume()));
trunklinePackageEntity.setFreightPrice(price.multiply(volume));
}
if (systemPickupChargeType == 1) {

20
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mq/AdvanceOrderListener.java

@ -49,6 +49,26 @@ public class AdvanceOrderListener {
throw new RuntimeException(e);
}
}
@RabbitListener(bindings = @QueueBinding(
value = @Queue(name = FactoryDataConstants.Mq.Queues.ADVANCE_ORDER_JP),
exchange = @Exchange(name = FactoryDataConstants.Mq.Exchanges.ADVANCE_ORDER, type = ExchangeTypes.TOPIC),
key = FactoryDataConstants.Mq.RoutingKeys.ADVANCE_ORDER_JP
), ackMode = "MANUAL")
public void advanceOrderJp(String msg, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long tag) {
// 新增暂存单
log.info("收到金牌工厂数据暂存单消息:{}", msg);
try {
advanceOrderMqService.advanceOrderJp(msg);
} catch (Exception e) {
e.printStackTrace();
log.error("收到金牌工厂数据暂存单消息失败: {}", e.getMessage());
}
try {
channel.basicAck(tag, false);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
@RabbitListener(bindings = @QueueBinding(
value = @Queue(name = FactoryDataConstants.Mq.Queues.ADVANCE_ORDER_OUPAI),

1
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IAdvanceOrderMqService.java

@ -3,6 +3,7 @@ package com.logpm.trunkline.service;
public interface IAdvanceOrderMqService {
void advanceOrder(String msg);
void advanceOrderJp(String msg);
void advanceOrderOuPai(String msg);
}

138
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/AdvanceOrderMqServiceImpl.java

@ -175,6 +175,144 @@ public class AdvanceOrderMqServiceImpl implements IAdvanceOrderMqService {
}
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void advanceOrderJp(String msg) {
if (StrUtil.isNotBlank(msg)) {
JSONObject entries = JSONUtil.parseObj(msg);
JSONArray details = entries.getJSONArray("details");
TrunklineAdvanceEntity advanceEntity = JSONUtil.toBean(entries, TrunklineAdvanceEntity.class);
LambdaQueryWrapper<TrunklineAdvanceEntity> eq = Wrappers.<TrunklineAdvanceEntity>lambdaQuery()
.eq(TrunklineAdvanceEntity::getOrderCode, advanceEntity.getOrderCode());
if (StrUtil.isNotEmpty(advanceEntity.getTrainNumber())) {
eq.eq(TrunklineAdvanceEntity::getTrainNumber, advanceEntity.getTrainNumber());
}
// 暂存单 订单自编号 + 车次号 唯一
List<TrunklineAdvanceEntity> advanceEntities = advanceService.list(eq);
// 暂存单存在 并且未开单 则将新数据添加到原来的暂存单上
// 如果已开单则新增暂存单
if (CollUtil.isNotEmpty(advanceEntities) && ObjectUtil.equal(advanceEntity.getWaybillStatus(), "0")) {
TrunklineAdvanceEntity entity = advanceEntities.get(0);
if (ObjectUtil.isNotEmpty(entity)) {
advanceEntity.setId(entity.getId());
// advanceEntity.setTotalNum(entity.getTotalNum() + advanceEntity.getTotalNum());
}
}
Set<String> packageCodeSet = new HashSet<>();
if (CollUtil.isNotEmpty(details)) {
// 使用HashSet代替ArrayList以优化内存使用和检查重复值
Set<String> orderPackageCodes = new HashSet<>();
details.forEach(detail -> {
try {
// 更具描述性的变量命名
JSONObject jsonObject = JSONUtil.parseObj(detail);
TrunklineAdvanceDetailEntity entity = JSONUtil.toBean(jsonObject, TrunklineAdvanceDetailEntity.class);
// 检查转换后的实体不为null,且其orderPackageCode非null
if (!ObjectUtil.isAllEmpty(entity, entity.getOrderPackageCode())) {
orderPackageCodes.add(entity.getOrderPackageCode());
}
} catch (Exception e) {
// 异常处理,可根据实际情况记录日志或进行其他处理
log.error("暂存单转换时发生异常: " + detail + ",异常:" + e.getMessage());
}
});
// 查询数据库,校验订单包件编码是否重复
if (CollUtil.isNotEmpty(orderPackageCodes)) {
Map<String, String> packageCodeByCodes = advanceDetailService.findPackageCodeByCodes(orderPackageCodes);
if (CollUtil.isNotEmpty(packageCodeByCodes)) {
packageCodeSet.addAll(packageCodeByCodes.keySet());
}
}
}
if (ObjectUtil.isNotNull(advanceEntity)) {
String orderCode = advanceEntity.getOrderCode();
if (StrUtil.isNotEmpty(orderCode) && orderCode.contains("遗")) {
advanceEntity.setLegacyStatus("1");
}
// 暂存单不存在则新增,暂存单存在则将暂存单明细往原暂存单中添加
if (ObjectUtil.isEmpty(advanceEntity.getId())) {
advanceEntity.setCreateUserName(AuthUtil.getNickName());
advanceService.save(advanceEntity);
} else {
advanceEntity.setWaybillStatus(null);
advanceEntity.setWaybillNo(null);
advanceService.updateById(advanceEntity);
// 查询出当前暂存单明细
List<TrunklineAdvanceDetailEntity> advanceDetailEntityList = advanceDetailService.list(Wrappers.<TrunklineAdvanceDetailEntity>lambdaQuery()
.eq(TrunklineAdvanceDetailEntity::getAdvanceId, advanceEntity.getId()));
// 如果 packageCodeSet 不存在 则删除
if (CollUtil.isNotEmpty(advanceDetailEntityList)) {
advanceDetailEntityList.forEach(advanceDetailEntity -> {
if (!packageCodeSet.contains(advanceDetailEntity.getOrderPackageCode())) {
advanceDetailService.removeById(advanceDetailEntity.getId());
}
});
}
}
}
if (ObjectUtil.isNotEmpty(advanceEntity) && CollUtil.isNotEmpty(details)) {
List<TrunklineAdvanceDetailEntity> advanceDetailEntityList = new ArrayList<>();
List<TrunklineDetailProductEntity> detailProductEntityList = new ArrayList<>();
for (Object detailObj : details) {
JSONObject detail = JSONUtil.parseObj(detailObj);
TrunklineAdvanceDetailEntity advanceDetailEntity = JSONUtil.toBean(detail, TrunklineAdvanceDetailEntity.class);
if (ObjectUtil.isNotNull(advanceDetailEntity)) {
if (CollUtil.isNotEmpty(packageCodeSet) && packageCodeSet.contains(advanceDetailEntity.getOrderPackageCode())) {
// 金牌如果是重复包条,则单独处理
if (ObjectUtil.equal(advanceEntity.getBrand(), BrandEnums.JP.getValue())) {
// 金牌按DD单号+包条确定唯一值
List<TrunklineAdvanceDetailEntity> list = advanceDetailService.list(Wrappers.<TrunklineAdvanceDetailEntity>lambdaQuery()
.eq(TrunklineAdvanceDetailEntity::getOrderPackageCode, advanceDetailEntity.getOrderPackageCode())
.eq(TrunklineAdvanceDetailEntity::getOrderCode, advanceEntity.getOrderCode())
);
if (CollUtil.isNotEmpty(list)) {
// 订单+包件重复则不处理这条数据
log.error("金牌,订单+包条码重复,订单:{},包条码:{}", advanceEntity.getOrderCode(), advanceDetailEntity.getOrderPackageCode());
continue;
} else {
// 包件码重复,订单+包件不重复,设置预留字段1 为 1
advanceDetailEntity.setReserve1("1");
}
} else {
log.error("非金牌,包条码重复,包条码:{}", advanceDetailEntity.getOrderPackageCode());
continue;
}
}
advanceDetailEntity.setAdvanceId(advanceEntity.getId());
// 设置发货时间为当前时间
if (StrUtil.isEmpty(advanceDetailEntity.getSendDateStr())) {
advanceDetailEntity.setSendDateStr(DateUtil.today());
}
advanceDetailEntityList.add(advanceDetailEntity);
JSONArray items = detail.getJSONArray("items");
if (CollUtil.isNotEmpty(items)) {
for (Object itemObj : items) {
JSONObject item = JSONUtil.parseObj(itemObj);
TrunklineDetailProductEntity detailProductEntity = JSONUtil.toBean(item, TrunklineDetailProductEntity.class);
if (ObjectUtil.isNotNull(detailProductEntity)) {
detailProductEntityList.add(detailProductEntity);
}
}
}
}
}
advanceDetailService.saveBatch(advanceDetailEntityList);
// 发送入库包件处理无数据装车数据
trunklineCarsLoadService.sendRabbitMessageLoadScanData(JSONUtil.toJsonStr(advanceEntity));
detailProductService.saveBatch(detailProductEntityList);
// 发送报表数据广播
Long warehouseId = advanceEntity.getWarehouseId();
String warehouseName = advanceEntity.getWarehouseName();
String dealerCode = advanceEntity.getDealerCode();
String dealerName = advanceEntity.getDealerName();
advanceDetailService.sendReportBasicdataFanout(AuthUtil.getNickName(), AuthUtil.getUserId(), warehouseId, warehouseName, new Date(), advanceDetailEntityList, dealerCode, dealerName);
}
}
}
@Override
@Transactional(rollbackFor = Exception.class)

8
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java

@ -289,9 +289,11 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService {
trunklineCostShareRecordEntity.setLoadingWarehouseId(warehouseId);
trunklineCostShareRecordEntity.setLoadingWarehouseName(warehouseName);
trunklineCostShareRecordEntity.setPlanUnloadWarehouseId(finalNodeId);
BasicdataWarehouseEntity finalWarehouse = warehouseClient.getEntityWarehouseId(finalNodeId);
if (!Objects.isNull(finalWarehouse)) {
trunklineCostShareRecordEntity.setPlanUnloadWarehouseName(finalWarehouse.getName());
if(Objects.isNull(finalNodeId)){
BasicdataWarehouseEntity finalWarehouse = warehouseClient.getEntityWarehouseId(finalNodeId);
if (!Objects.isNull(finalWarehouse)) {
trunklineCostShareRecordEntity.setPlanUnloadWarehouseName(finalWarehouse.getName());
}
}
trunklineCostShareRecordEntity.setRealUnloadWarehouseId(unloadNodeId);
trunklineCostShareRecordEntity.setRealUnloadWarehouseName(unloadNodeName);

4
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java

@ -1155,7 +1155,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
warehouseWayBillDetail.setSubtotalDeliveryFee(waybillDetailDTO.getSubtotalDeliveryFee());
warehouseWayBillDetail.setPickupPrice(waybillDetailDTO.getPickupPrice());
warehouseWayBillDetail.setFreightPrice(waybillDetailDTO.getFreightPrice());
warehouseWayBillDetail.setSystemChargeType(waybillDetailDTO.getSystemChargeType());
warehouseWayBillDetail.setSystemChargeType(waybillDetailDTO.getChargeType());
warehouseWayBillDetail.setSystemDeliveryChargeType(waybillDetailDTO.getSystemDeliveryChargeType());
warehouseWayBillDetail.setSystemPickupChargeType(waybillDetailDTO.getSystemPickupChargeType());
warehouseWayBillDetail.setSystemWarehouseChargeType(waybillDetailDTO.getSystemWarehouseChargeType());
@ -5620,7 +5620,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
warehouseWayBillDetail.setSubtotalFreight(waybillDetailDTO.getSubtotalFreight());
warehouseWayBillDetail.setPickupPrice(waybillDetailDTO.getPickupPrice());
warehouseWayBillDetail.setFreightPrice(waybillDetailDTO.getFreightPrice());
warehouseWayBillDetail.setSystemChargeType(waybillDetailDTO.getSystemChargeType());
warehouseWayBillDetail.setSystemChargeType(waybillDetailDTO.getChargeType());
warehouseWayBillDetail.setSystemDeliveryChargeType(waybillDetailDTO.getSystemDeliveryChargeType());
warehouseWayBillDetail.setSystemPickupChargeType(waybillDetailDTO.getSystemPickupChargeType());
warehouseWayBillDetail.setSystemWarehouseChargeType(waybillDetailDTO.getSystemWarehouseChargeType());

66
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java

@ -884,42 +884,48 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
}
} else {
Long clientId = basicdataTripartiteMallClient.getClientIdByNameAndBrand(dealerName, advanceEntity.getBrand());
BasicdataClientEntity basicdataClientEntity = basicdataClientClient.findEntityById(clientId);
if (!Objects.isNull(basicdataClientEntity)) {
String clientType = basicdataClientEntity.getClientType();
if ("5".equals(clientType)) {
stockArticleEntity.setStoreId(basicdataClientEntity.getId());
stockArticleEntity.setStoreCode(basicdataClientEntity.getClientCode());
stockArticleEntity.setStoreName(basicdataClientEntity.getClientName());
//查询门店的父级商场
Long pid = basicdataClientEntity.getPid();
BasicdataClientEntity pidEntity = basicdataClientClient.findEntityById(pid);
if (!Objects.isNull(pidEntity)) {
String pidEntityClientType = pidEntity.getClientType();
if ("2".equals(pidEntityClientType)) {
//商城
stockArticleEntity.setMallId(pidEntity.getId());
stockArticleEntity.setMallName(pidEntity.getClientName());
stockArticleEntity.setMallCode(pidEntity.getClientCode());
BasicdataStoreBusinessEntity basicdataStoreBusinessEntity = basicdataStoreBusinessClient.findByClientIdAndTypeService(pidEntity.getId(), 3);
if (!Objects.isNull(basicdataStoreBusinessEntity)) {
stockArticleEntity.setTypeService(basicdataStoreBusinessEntity.getMold());
if(!Objects.isNull(clientId)){
BasicdataClientEntity basicdataClientEntity = basicdataClientClient.findEntityById(clientId);
if (!Objects.isNull(basicdataClientEntity)) {
String clientType = basicdataClientEntity.getClientType();
if ("5".equals(clientType)) {
stockArticleEntity.setStoreId(basicdataClientEntity.getId());
stockArticleEntity.setStoreCode(basicdataClientEntity.getClientCode());
stockArticleEntity.setStoreName(basicdataClientEntity.getClientName());
//查询门店的父级商场
Long pid = basicdataClientEntity.getPid();
if(!Objects.isNull(pid)){
BasicdataClientEntity pidEntity = basicdataClientClient.findEntityById(pid);
if (!Objects.isNull(pidEntity)) {
String pidEntityClientType = pidEntity.getClientType();
if ("2".equals(pidEntityClientType)) {
//商城
stockArticleEntity.setMallId(pidEntity.getId());
stockArticleEntity.setMallName(pidEntity.getClientName());
stockArticleEntity.setMallCode(pidEntity.getClientCode());
BasicdataStoreBusinessEntity basicdataStoreBusinessEntity = basicdataStoreBusinessClient.findByClientIdAndTypeService(pidEntity.getId(), 3);
if (!Objects.isNull(basicdataStoreBusinessEntity)) {
stockArticleEntity.setTypeService(basicdataStoreBusinessEntity.getMold());
}
}
}
}
}
} else if ("2".equals(clientType)) {
//商城
stockArticleEntity.setMallId(basicdataClientEntity.getId());
stockArticleEntity.setMallName(basicdataClientEntity.getClientName());
stockArticleEntity.setMallCode(basicdataClientEntity.getClientCode());
BasicdataStoreBusinessEntity basicdataStoreBusinessEntity = basicdataStoreBusinessClient.findByClientIdAndTypeService(basicdataClientEntity.getId(), 3);
if (!Objects.isNull(basicdataStoreBusinessEntity)) {
stockArticleEntity.setTypeService(basicdataStoreBusinessEntity.getMold());
} else if ("2".equals(clientType)) {
//商城
stockArticleEntity.setMallId(basicdataClientEntity.getId());
stockArticleEntity.setMallName(basicdataClientEntity.getClientName());
stockArticleEntity.setMallCode(basicdataClientEntity.getClientCode());
BasicdataStoreBusinessEntity basicdataStoreBusinessEntity = basicdataStoreBusinessClient.findByClientIdAndTypeService(basicdataClientEntity.getId(), 3);
if (!Objects.isNull(basicdataStoreBusinessEntity)) {
stockArticleEntity.setTypeService(basicdataStoreBusinessEntity.getMold());
}
}
}
}
}
stockArticleEntity.setCustomerName(advanceEntity.getCustomerName());
stockArticleEntity.setCustomerTelephone(advanceEntity.getCustomerPhone());

3
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml

@ -671,6 +671,9 @@
<if test="param.payStatus != null">
and lww.pay_status = #{param.payStatus}
</if>
<if test="param.signUserName != null">
and lww.sign_user_name = #{param.signUserName}
</if>
<if test="param.settlementStatus != null">
and lww.settlement_status = #{param.settlementStatus}
</if>

Loading…
Cancel
Save