Browse Source

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

dist.1.3.0
zhaoqiaobo 10 months ago
parent
commit
54a5cab8d4
  1. 1
      blade-biz-common/src/main/java/org/springblade/common/constant/CodeNumConstant.java
  2. 50
      blade-biz-common/src/main/java/org/springblade/common/constant/WaybillStatusEnum.java
  3. 43
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/ChangesRecordDTO.java
  4. 9
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/MerchantStatisticsDTO.java
  5. 14
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/StatisticsBalanceAbnormalDTO.java
  6. 14
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/StatisticsBalanceRecordDTO.java
  7. 53
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsBalanceAbnormalEntity.java
  8. 46
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsBalanceAbnormalPhotoEntity.java
  9. 128
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsBalanceOrderInfoEntity.java
  10. 51
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsBalanceRecordEntity.java
  11. 46
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsBalanceRecordPhotoEntity.java
  12. 47
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsChangesPhotoEntity.java
  13. 79
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsChangesRecordEntity.java
  14. 10
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsOrderInfoEntity.java
  15. 13
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/StatisticsBalanceAbnormalVO.java
  16. 8
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/StatisticsBalanceOrderInfoVO.java
  17. 14
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/StatisticsBalanceRecordVO.java
  18. 15
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/StatisticsChangesRecordVO.java
  19. 138
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/StatisticsOrderInfoVO.java
  20. 41
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/StatisticsWaybillInfoVO.java
  21. 2
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/LoadCarsDTO.java
  22. 4
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/feign/ITrunklineAdvanceClient.java
  23. 3
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/feign/ITrunklineAdvanceDetailClient.java
  24. 4
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/feign/ITrunklineWaybillOrderClient.java
  25. 24
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/feign/ITrunklineWaybillPackageClient.java
  26. 4
      blade-service-api/logpm-warehouse-api/pom.xml
  27. 6
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseWaybillClient.java
  28. 2
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseWaybillDetailClient.java
  29. 187
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/ExportWarehouseWaybillVO.java
  30. 4
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml
  31. 1
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java
  32. 40
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataCodeServiceImpl.java
  33. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml
  34. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.xml
  35. 165
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/BusinessPreOrderDataQueueHandler.java
  36. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAsyncService.java
  37. 265
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java
  38. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  39. 14
      blade-service/logpm-statisticsdata/Dockerfile
  40. 36
      blade-service/logpm-statisticsdata/pom.xml
  41. 159
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/MerchantBalanceController.java
  42. 123
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/MerchantStatisticsController.java
  43. 34
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/WaybillFanoutListener.java
  44. 9
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsBalanceAbnormalMapper.java
  45. 9
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsBalanceAbnormalPhotoMapper.java
  46. 15
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsBalanceOrderInfoMapper.java
  47. 11
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsBalanceOrderInfoMapper.xml
  48. 9
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsBalanceRecordMapper.java
  49. 9
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsBalanceRecordPhotoMapper.java
  50. 9
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsChangesPhotoMapper.java
  51. 13
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsChangesRecordMapper.java
  52. 13
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsChangesRecordMapper.xml
  53. 10
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.java
  54. 236
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.xml
  55. 7
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsWaybillInfoMapper.java
  56. 111
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsWaybillInfoMapper.xml
  57. 7
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsBalanceAbnormalPhotoService.java
  58. 7
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsBalanceAbnormalService.java
  59. 22
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsBalanceOrderInfoService.java
  60. 7
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsBalanceRecordPhotoService.java
  61. 7
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsBalanceRecordService.java
  62. 7
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsChangesPhotoService.java
  63. 10
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsChangesRecordService.java
  64. 14
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsOrderInfoService.java
  65. 1
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsWaybillInfoService.java
  66. 15
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsBalanceAbnormalPhotoServiceImpl.java
  67. 15
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsBalanceAbnormalServiceImpl.java
  68. 217
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsBalanceOrderInfoServiceImpl.java
  69. 15
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsBalanceRecordPhotoServiceImpl.java
  70. 15
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsBalanceRecordServiceImpl.java
  71. 15
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsChangesPhotoServiceImpl.java
  72. 21
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsChangesRecordServiceImpl.java
  73. 472
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsOrderInfoServiceImpl.java
  74. 10
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsWaybillInfoServiceImpl.java
  75. 40
      blade-service/logpm-statisticsdata/src/main/resources/application-prod.yml
  76. 44
      blade-service/logpm-statisticsdata/src/main/resources/application-test.yml
  77. 11
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklineAdvanceClient.java
  78. 8
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklineAdvanceDetailClient.java
  79. 10
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklineWaybillOrderClient.java
  80. 32
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklineWaybillPackageClient.java
  81. 1
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.xml
  82. 17
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml
  83. 12
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderAsyncServiceImpl.java
  84. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java
  85. 11
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java
  86. 25
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java
  87. 8
      blade-service/logpm-trunkline/src/main/resources/application-dev.yml
  88. 32
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseWaybillController.java
  89. 5
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseWaybillClient.java
  90. 5
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseWaybillDetailClient.java
  91. 6
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.java
  92. 148
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml
  93. 7
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWaybillService.java
  94. 42
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayGoodsLogServiceImpl.java
  95. 42
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayGoodsServiceImpl.java
  96. 26
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java
  97. 36
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -8,6 +8,8 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
@FeignClient(
value = ModuleNameConstant.APPLICATION_TRUNKLINE_NAME
)
@ -21,4 +23,6 @@ public interface ITrunklineAdvanceClient {
@GetMapping(API_PREFIX+"/findAdvanceLimitOneByOrderCode")
TrunklineAdvanceEntity findAdvanceLimitOneByOrderCode(@RequestParam String orderCode);
@PostMapping(API_PREFIX+"/findListByIds")
List<TrunklineAdvanceEntity> findListByIds(@RequestBody List<Long> collect);
}

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

@ -1,6 +1,7 @@
package com.logpm.trunkline.feign;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.vo.TrunklineAdvanceDetailVO;
import org.springblade.common.constant.ModuleNameConstant;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
@ -18,4 +19,6 @@ public interface ITrunklineAdvanceDetailClient {
@PostMapping(API_PREFIX+"/addAdvanceBatch")
void addAdvanceBatch(@RequestBody List<TrunklineAdvanceDetailEntity> advanceDetailEntities);
@PostMapping(API_PREFIX+"/findListByAdvanceIds")
List<TrunklineAdvanceDetailVO> findListByAdvanceIds(@RequestBody List<Long> collect);
}

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

@ -24,6 +24,6 @@ public interface ITrunklineWaybillOrderClient {
@PostMapping(API_PREFIX+"/addEntityReturnId")
Long addEntityReturnId(@RequestBody TrunklineWaybillOrderEntity trunklineWaybillOrderEntity);
@PostMapping(API_PREFIX+"/findListByWaybillIds")
List<TrunklineWaybillOrderEntity> findListByWaybillIds(@RequestBody List<Long> waybillIds);
}

24
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/feign/ITrunklineWaybillPackageClient.java

@ -0,0 +1,24 @@
package com.logpm.trunkline.feign;
import com.logpm.trunkline.entity.TrunklineWaybillOrderEntity;
import com.logpm.trunkline.entity.TrunklineWaybillPackageEntity;
import org.springblade.common.constant.ModuleNameConstant;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
@FeignClient(
value = ModuleNameConstant.APPLICATION_TRUNKLINE_NAME
)
public interface ITrunklineWaybillPackageClient {
String API_PREFIX = "trunklineWaybillOrderPackage/client";
@PostMapping(API_PREFIX+"/findListByWaybillIds")
List<TrunklineWaybillPackageEntity> findListByWaybillIds(@RequestBody List<Long> waybillIds);
@PostMapping(API_PREFIX+"/addEntity")
void addEntity(@RequestBody TrunklineWaybillPackageEntity trunklineWaybillPackageEntity);
}

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

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

6
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseWaybillClient.java

@ -81,6 +81,12 @@ public interface IWarehouseWaybillClient {
@PostMapping(API_PREFIX + "/findFreezeOrAbolishByWaybillNos")
List<WarehouseWaybillEntity> findFreezeOrAbolishByWaybillNos(@RequestBody List<String> waybillNos);
@PostMapping(API_PREFIX + "/findWaybillBilllByWaybillNos")
List<WarehouseWaybillEntity> findWaybillBilllByWaybillNos(@RequestBody List<String> waybillNos);
@PostMapping(API_PREFIX + "/updateWaybillFreezeStatusByWaybillIds")
void updateWaybillFreezeStatusByWaybillIds(@RequestBody List<Long> waybillIds);

2
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseWaybillDetailClient.java

@ -65,4 +65,6 @@ public interface IWarehouseWaybillDetailClient {
@PostMapping(API_PREFIX+"/addEntity")
void addEntity(@RequestBody WarehouseWayBillDetail warehouseWayBillDetail);
@PostMapping(API_PREFIX+"/findByWaybillIds")
List<WarehouseWayBillDetail> findByWaybillIds(@RequestBody List<Long> waybillIds);
}

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

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

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

@ -60,8 +60,8 @@
laap.waybill_number,
lawo.order_code,
lawo.train_number,
GROUP_CONCAT(laap.`first` separator ',') as `first`,
GROUP_CONCAT(laap.secondary separator ',') as secondary,
GROUP_CONCAT(DISTINCT laap.`first` separator ',') as `first`,
GROUP_CONCAT(DISTINCT laap.secondary separator ',') as secondary,
group_concat( DISTINCT laap.brand_name SEPARATOR ',' ) AS brandName,
lawo.vehicle_route,
lawo.deliver_goods_time,

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

@ -328,6 +328,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
aftersalesWorkOrder.setCreateTime(new Date());
aftersalesWorkOrder.setCreateDept(Long.valueOf(user.getDeptId()));
aftersalesWorkOrder.setIsDeleted(0);
aftersalesWorkOrder.setWaybillNumber(aftersalesWorkOrder.getWaybillNumber());
aftersalesWorkOrder.setStatus(1);
if (ObjectUtils.isNull(aftersalesWorkOrder.getWorkOrderNumber())) {
aftersalesWorkOrder.setWorkOrderNumber(getWorkOrderNumber(myCurrentWarehouse.getWarehouseCode(), aftersalesWorkOrder.getWorkOrderType()));

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

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

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

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

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

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

165
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/BusinessPreOrderDataQueueHandler.java

@ -4,14 +4,25 @@ import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.business.entity.DistributionBusinessPreOrderEntity;
import com.logpm.distribution.entity.DistributionDeliveryListEntity;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.entity.DistributionReservationEntity;
import com.logpm.distribution.entity.DistributionReservationPackageEntity;
import com.logpm.distribution.entity.*;
import com.logpm.distribution.service.*;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
import com.logpm.trunkline.entity.TrunklineWaybillOrderEntity;
import com.logpm.trunkline.entity.TrunklineWaybillPackageEntity;
import com.logpm.trunkline.feign.ITrunklineAdvanceClient;
import com.logpm.trunkline.feign.ITrunklineAdvanceDetailClient;
import com.logpm.trunkline.feign.ITrunklineWaybillOrderClient;
import com.logpm.trunkline.feign.ITrunklineWaybillPackageClient;
import com.logpm.trunkline.vo.TrunklineAdvanceDetailVO;
import com.logpm.warehouse.entity.WarehouseWayBillDetail;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.feign.IWarehouseWaybillClient;
import com.logpm.warehouse.feign.IWarehouseWaybillDetailClient;
import com.rabbitmq.client.Channel;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.annotations.ChangeAsync;
import org.springblade.common.constant.RabbitConstant;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil;
@ -28,6 +39,8 @@ import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.function.Function;
import java.util.stream.Collectors;
@ -43,14 +56,139 @@ public class BusinessPreOrderDataQueueHandler {
private final IDistributionParcelListService distributionParcelListService;
private final IDistributionBusinessPreOrderService distributionBusinessPreOrderService;
private final ISysClient sysClient;
private final IWarehouseWaybillClient warehouseWaybillClient;
private final IWarehouseWaybillDetailClient warehouseWaybillDetailClient;
private final ITrunklineWaybillOrderClient trunklineWaybillOrderClient;
private final ITrunklineWaybillPackageClient trunklineWaybillPackageClient;
private final ITrunklineAdvanceClient trunklineAdvanceClient;
private final ITrunklineAdvanceDetailClient trunklineAdvanceDetailClient;
private final IDistributionAsyncService distributionAsyncService;
@RabbitHandler
public void businessPreOrderDataHandler(Map map, Message message, Channel channel) {
// plantA(map);
R<List<Tenant>> tenantList = sysClient.getTenantList();
if(tenantList.isSuccess()){
List<Tenant> data = tenantList.getData();
data.forEach(tenant -> {
if(!ObjectUtil.isEmpty(tenant.getTenantType())){
if(2==tenant.getTenantType()){
String mallName = tenant.getTenantName();
extracted(map, mallName);
}
}
});
}
}
private void extracted(Map map, String mallName) {
// 查询推送包件
List<DistributionParcelListEntity> distributionParcelListEntities = allList(map, mallName);
if (ObjectUtil.isEmpty(distributionParcelListEntities)) {
return;
}
// 得到下面的包间
// 假设 orderNumber 是 DistributionParcelListEntity 类中的一个属性
List<String> uniqueOrderNumbers = distributionParcelListEntities.stream()
.map(DistributionParcelListEntity::getWaybillNumber) // 将每个实体映射到其运单号
.distinct() // 移除重复的运单号
.collect(Collectors.toList()); // 收集到一个新的列表中
// 查询运单
List<WarehouseWaybillEntity> waybillBilllByWaybillNos = warehouseWaybillClient.findWaybillBilllByWaybillNos(uniqueOrderNumbers);
// 获取运单关联的暂存单信息
List<Long> waybillIds = waybillBilllByWaybillNos.stream().map(WarehouseWaybillEntity::getId).distinct().collect(Collectors.toList());
String mallName = "";
List<WarehouseWayBillDetail> warehouseWayBillDetails = warehouseWaybillDetailClient.findByWaybillIds(waybillIds);
if(StringUtil.isBlank(mallName)){
return ;
List<TrunklineWaybillOrderEntity> trunklineWaybillOrderEntities = trunklineWaybillOrderClient.findListByWaybillIds(waybillIds);
List<TrunklineWaybillPackageEntity> trunklineWaybillPackageEntities = trunklineWaybillPackageClient.findListByWaybillIds(waybillIds);
// 暂存单ID集合
List<Long> collect = trunklineWaybillOrderEntities.stream().map(TrunklineWaybillOrderEntity::getAdvanceId).distinct().collect(Collectors.toList());
List<TrunklineAdvanceEntity> trunklineAdvanceEntities = trunklineAdvanceClient.findListByIds(collect);
// 获取暂存单明细
List<TrunklineAdvanceDetailVO> trunklineAdvanceDetailEntities = trunklineAdvanceDetailClient.findListByAdvanceIds(collect);
Tenant tenant = changeDataBase(mallName);
// saveOtherData(tenant.getTenantId(),waybillBilllByWaybillNos, trunklineAdvanceDetailEntities, trunklineAdvanceEntities, trunklineWaybillPackageEntities, trunklineWaybillOrderEntities, warehouseWayBillDetails, distributionParcelListEntities, mallName);
CompletableFuture.supplyAsync(() -> {
// saveOtherData(tenant.getTenantId(),waybillBilllByWaybillNos, trunklineAdvanceDetailEntities, trunklineAdvanceEntities, trunklineWaybillPackageEntities, trunklineWaybillOrderEntities, warehouseWayBillDetails, distributionParcelListEntities, mallName);
distributionAsyncService.saveOtherData(tenant.getTenantId(),waybillBilllByWaybillNos, trunklineAdvanceDetailEntities, trunklineAdvanceEntities, trunklineWaybillPackageEntities, trunklineWaybillOrderEntities, warehouseWayBillDetails, distributionParcelListEntities, mallName);
return null;
});
}
private List<DistributionParcelListEntity> allList(Map map, String mallName) {
List<DistributionParcelListEntity> tsss = new ArrayList<>();
if (StringUtil.isBlank(mallName)) {
return tsss;
}
Long t = (Long) map.get("messageData");
if (ObjectUtil.isEmpty(t)) {
log.info(">>>>>>>>>>>>> BusinessPreOrderDataQueueHandler 配送ID为空");
return tsss;
}
DistributionDeliveryListEntity distributionDeliveryListEntity = distributionDeliveryListService.getById(t);
if (ObjectUtil.isEmpty(distributionDeliveryListEntity)) {
log.info(">>>>>>>>>>>>> BusinessPreOrderDataQueueHandler 配送对象为null");
return tsss;
}
List<DistributionReservationEntity> list = distributionReservationService.selectListByDeliveryId(distributionDeliveryListEntity.getId());
if (ObjectUtil.isEmpty(list)) {
log.info(">>>>>>>>>>>>> BusinessPreOrderDataQueueHandler 预约列表为空");
return tsss;
}
List<DistributionBusinessPreOrderEntity> dataResult = new ArrayList<>();
for (DistributionReservationEntity distributionReservationEntity : list) {
// 判断需要进行推送商家名称
log.info(">>>>> mallName TAG {}", mallName);
log.info(">>>>> distributionReservationEntity.getMallName() TAG {}", distributionReservationEntity.getMallName());
if (mallName.equals(distributionReservationEntity.getMallName())) {
// 将当前的预约单加入到需要推送的列表
LambdaQueryWrapper<DistributionReservationPackageEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(DistributionReservationPackageEntity::getReservationId, distributionReservationEntity.getId());
queryWrapper.ne(DistributionReservationPackageEntity::getPacketBarStatus, 2);
List<DistributionReservationPackageEntity> distributionReservationPackageEntityList = distributionReservationPackageService.list(queryWrapper);
for (DistributionReservationPackageEntity distributionReservationPackageEntity : distributionReservationPackageEntityList) {
DistributionParcelListEntity byId = distributionParcelListService.getById(distributionReservationPackageEntity.getParceListId());
tsss.add(byId);
}
}
}
return tsss;
}
private void plantA(Map map) {
String mallName = "仁寿欧派大家居";
if (StringUtil.isBlank(mallName)) {
return;
}
Long t = (Long) map.get("messageData");
@ -120,6 +258,19 @@ public class BusinessPreOrderDataQueueHandler {
log.info("businessPreOrderDataHandler:{}", map);
}
private Tenant changeDataBase(String maillName) {
R<Tenant> tenantByName = sysClient.getTenantByName(maillName);
if (tenantByName.isSuccess()) {
Tenant tenant = tenantByName.getData();
if (ObjectUtil.isEmpty(tenant)) {
log.info(">>>>>>>>>>>>> saveOtherDataBaseNew 租户不存在");
return null;
}
return tenant;
}
return null;
}
public void saveOtherDataBaseNew(List<DistributionBusinessPreOrderEntity> dataResult, String maillName) {
// 查询保存的对象在商场端是否存在 && 没有入库的 都i需要删除 执行新的

8
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAsyncService.java

@ -9,7 +9,13 @@ import com.logpm.distribution.entity.DisStockListDetailEntity;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.entity.DistributionParcelNumberEntity;
import com.logpm.distribution.entity.DistributionStockArticleEntity;
import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
import com.logpm.trunkline.entity.TrunklineWaybillOrderEntity;
import com.logpm.trunkline.entity.TrunklineWaybillPackageEntity;
import com.logpm.trunkline.vo.TrunklineAdvanceDetailVO;
import com.logpm.warehouse.entity.WarehouseWarehouseEntity;
import com.logpm.warehouse.entity.WarehouseWayBillDetail;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import org.springblade.common.annotations.ChangeAsync;
import org.springblade.core.secure.BladeUser;
@ -325,4 +331,6 @@ public interface IDistributionAsyncService {
DistributionStockArticleEntity findDistributionStockArticleEntityByIdForAsync(String tenantId, Long id);
void saveOtherData(String tenantId, List<WarehouseWaybillEntity> waybillBilllByWaybillNos, List<TrunklineAdvanceDetailVO> trunklineAdvanceDetailEntities, List<TrunklineAdvanceEntity> trunklineAdvanceEntities, List<TrunklineWaybillPackageEntity> trunklineWaybillPackageEntities, List<TrunklineWaybillOrderEntity> trunklineWaybillOrderEntities, List<WarehouseWayBillDetail> warehouseWayBillDetails, List<DistributionParcelListEntity> distributionParcelListEntities, String mallName);
}

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

@ -32,10 +32,17 @@ import com.logpm.factorydata.enums.BrandEnums;
import com.logpm.factorydata.util.FactoryDataMessageSender;
import com.logpm.factorydata.vo.NodePushMsg;
import com.logpm.trunkline.dto.AddWaybillTrackDTO;
import com.logpm.trunkline.feign.ITrunklineWaybillTrackClient;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
import com.logpm.trunkline.entity.TrunklineWaybillOrderEntity;
import com.logpm.trunkline.entity.TrunklineWaybillPackageEntity;
import com.logpm.trunkline.feign.*;
import com.logpm.trunkline.vo.TrunklineAdvanceDetailVO;
import com.logpm.warehouse.entity.WarehouseWayBillDetail;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient;
import com.logpm.warehouse.feign.IWarehouseWaybillClient;
import com.logpm.warehouse.feign.IWarehouseWaybillDetailClient;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.annotations.ChangeAsync;
@ -62,8 +69,13 @@ import org.springblade.common.constant.signing.SignforStatusConstant;
import org.springblade.common.constant.stockup.StockupStatusConstant;
import org.springblade.common.constant.stockup.StockupTypeConstant;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.system.entity.Tenant;
import org.springblade.system.feign.ISysClient;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
@ -123,6 +135,21 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
private final FactoryDataMessageSender factoryDataMessageSender;
private final RabbitTemplate rabbitTemplate;
private final ITrunklineWaybillOrderClient trunklineWaybillOrderClient;
private final ITrunklineWaybillPackageClient trunklineWaybillPackageClient;
private final ITrunklineAdvanceClient trunklineAdvanceClient;
private final ITrunklineAdvanceDetailClient trunklineAdvanceDetailClient;
private final IWarehouseWaybillClient warehouseWaybillClient;
private final IWarehouseWaybillDetailClient warehouseWaybillDetailClient;
private final ISysClient sysClient;
private final BladeRedis bladeRedis;
// private final
@Override
@ -2790,5 +2817,241 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
return stockArticleEntity;
}
private Tenant changeDataBase(String maillName) {
R<Tenant> tenantByName = sysClient.getTenantByName(maillName);
if (tenantByName.isSuccess()) {
Tenant tenant = tenantByName.getData();
if (ObjectUtil.isEmpty(tenant)) {
log.info(">>>>>>>>>>>>> saveOtherDataBaseNew 租户不存在");
return null;
}
return tenant;
}
return null;
}
@ChangeAsync()
@Override
public void saveOtherData(String tenantId, List<WarehouseWaybillEntity> waybillBilllByWaybillNos, List<TrunklineAdvanceDetailVO> trunklineAdvanceDetailEntities, List<TrunklineAdvanceEntity> trunklineAdvanceEntities, List<TrunklineWaybillPackageEntity> trunklineWaybillPackageEntities, List<TrunklineWaybillOrderEntity> trunklineWaybillOrderEntities, List<WarehouseWayBillDetail> warehouseWayBillDetails, List<DistributionParcelListEntity> distributionParcelListEntities, String mallName) {
// 保存暂存单
Tenant tenant = changeDataBase(mallName);
for (TrunklineAdvanceEntity trunklineAdvanceEntity : trunklineAdvanceEntities) {
TrunklineAdvanceEntity finalTrunklineAdvanceEntity = trunklineAdvanceEntity;
List<TrunklineAdvanceDetailEntity> t = trunklineAdvanceDetailEntities.stream().filter(trunklineAdvanceDetailEntity -> trunklineAdvanceDetailEntity.getAdvanceId().equals(finalTrunklineAdvanceEntity.getId())).collect(Collectors.toList());
saveTrunklineAdvanceEntity(trunklineAdvanceEntity, mallName);
// 保存暂存子表
saveTrunklineAdvanceDetailEntity(t, trunklineAdvanceEntity, mallName);
}
List<Long> collect = trunklineAdvanceEntities.stream().map(TrunklineAdvanceEntity::getId).distinct().collect(Collectors.toList());
// 重新查询trunklineAdvanceDetail
List<TrunklineAdvanceDetailVO> listByAdvanceIds = trunklineAdvanceDetailClient.findListByAdvanceIds(collect);
// 保存运单
BasicdataWarehouseEntity basicdataWarehouseEntity = getBasicdataWarehouseEntity(mallName);
for (WarehouseWaybillEntity waybillBilllByWaybillNo : waybillBilllByWaybillNos) {
List<TrunklineWaybillOrderEntity> collect1 = trunklineWaybillOrderEntities.stream().filter(trunklineWaybillOrderEntity -> trunklineWaybillOrderEntity.getWaybillId().equals(waybillBilllByWaybillNo.getId())).collect(Collectors.toList());
List<WarehouseWayBillDetail> t = warehouseWayBillDetails.stream().filter(warehouseWayBillDetail -> warehouseWayBillDetail.getWaybillId().equals(waybillBilllByWaybillNo.getId())).collect(Collectors.toList());
// 修改运单的起始仓库 和末端仓
waybillBilllByWaybillNo.setDepartureWarehouseName(waybillBilllByWaybillNo.getDestinationWarehouseName());
waybillBilllByWaybillNo.setDepartureWarehouseId(null);
// 目的仓
if(basicdataWarehouseEntity!=null){
waybillBilllByWaybillNo.setDestinationWarehouseId(basicdataWarehouseEntity.getId());
waybillBilllByWaybillNo.setDestinationWarehouseName(basicdataWarehouseEntity.getName());
}
waybillBilllByWaybillNo.setTenantId(tenant.getTenantId());
WarehouseWaybillEntity byWaybillNo = warehouseWaybillClient.findByWaybillNo(waybillBilllByWaybillNo.getWaybillNo());
if(byWaybillNo==null){
Long l = warehouseWaybillClient.addEnntity(waybillBilllByWaybillNo);
waybillBilllByWaybillNo.setId(l);
}else{
waybillBilllByWaybillNo.setId(byWaybillNo.getId());
}
List<WarehouseWayBillDetail> byWaybillId = warehouseWaybillDetailClient.findByWaybillId(waybillBilllByWaybillNo.getId());
for (WarehouseWayBillDetail warehouseWayBillDetail : t) {
warehouseWayBillDetail.setId(null);
for (WarehouseWayBillDetail wayBillDetail : byWaybillId) {
if(wayBillDetail.getProductName().equals(warehouseWayBillDetail.getProductName())){
// 不执行
warehouseWayBillDetail.setId(wayBillDetail.getId());
break;
}
}
if(warehouseWayBillDetail.getId()==null){
warehouseWayBillDetail.setWaybillId(waybillBilllByWaybillNo.getId());
warehouseWaybillDetailClient.addEntity(warehouseWayBillDetail);
}
}
List<TrunklineWaybillOrderEntity> listByWaybillNo = trunklineWaybillOrderClient.findListByWaybillNo(waybillBilllByWaybillNo.getWaybillNo());
for (TrunklineWaybillOrderEntity trunklineWaybillOrderEntity : collect1) {
trunklineWaybillOrderEntity.setId(null);
List<TrunklineWaybillPackageEntity> collect3 = trunklineWaybillPackageEntities.stream().filter(ts -> {
return ts.getWaybillNo().equals(trunklineWaybillOrderEntity.getWaybillNo()) && ts.getAdvanceId().equals(trunklineWaybillOrderEntity.getAdvanceId());
}).collect(Collectors.toList());
trunklineWaybillOrderEntity.setWaybillId(waybillBilllByWaybillNo.getId());
trunklineWaybillOrderEntity.setTenantId(tenant.getTenantId());
Optional<TrunklineAdvanceEntity> entityWithOrderNumber1123 = trunklineAdvanceEntities.stream()
.filter(entity -> trunklineWaybillOrderEntity.getOrderCode().equals(entity.getOrderCode())) // 过滤出订单号为"1123"的实体
.findFirst(); // 获取第一个匹配的实体
if (entityWithOrderNumber1123.isPresent()) {
TrunklineAdvanceEntity foundEntity = entityWithOrderNumber1123.get();
// 使用找到的实体
trunklineWaybillOrderEntity.setAdvanceId(foundEntity.getId());
}
for (TrunklineWaybillOrderEntity waybillOrderEntity : listByWaybillNo) {
if(waybillOrderEntity.getOrderCode().equals(trunklineWaybillOrderEntity.getOrderCode())){
trunklineWaybillOrderEntity.setId(waybillOrderEntity.getId());
}
}
if(trunklineWaybillOrderEntity.getId()==null){
Long l1 = trunklineWaybillOrderClient.addEntityReturnId(trunklineWaybillOrderEntity);
trunklineWaybillOrderEntity.setId(l1);
}
List<Long> ids = Arrays.asList(waybillBilllByWaybillNo.getId());
List<TrunklineWaybillPackageEntity> listByWaybillIds = trunklineWaybillPackageClient.findListByWaybillIds(ids);
for (TrunklineWaybillPackageEntity trunklineWaybillPackageEntity : collect3) {
trunklineWaybillPackageEntity.setId(null);
trunklineWaybillPackageEntity.setWaybillId(waybillBilllByWaybillNo.getId());
trunklineWaybillPackageEntity.setTenantId(tenant.getTenantId());
trunklineWaybillPackageEntity.setAdvanceId(trunklineWaybillOrderEntity.getAdvanceId());
for (TrunklineAdvanceDetailVO listByAdvanceId : listByAdvanceIds) {
if (listByAdvanceId.getAdvanceId().equals(trunklineWaybillOrderEntity.getAdvanceId())) {
if (listByAdvanceId.getOrderPackageCode().equals(trunklineWaybillPackageEntity.getOrderPackageCode())) {
trunklineWaybillPackageEntity.setAdvanceDetailId(listByAdvanceId.getId());
}
}
}
for (TrunklineWaybillPackageEntity listByWaybillId : listByWaybillIds) {
if(listByWaybillId.getWaybillId().equals(trunklineWaybillPackageEntity.getWaybillId())){
if(listByWaybillId.getOrderPackageCode().equals(trunklineWaybillPackageEntity.getOrderPackageCode())){
trunklineWaybillPackageEntity.setId(listByWaybillId.getId());
break;
}
}
}
if(trunklineWaybillPackageEntity.getId()==null){
trunklineWaybillPackageClient.addEntity(trunklineWaybillPackageEntity);
}
}
}
}
}
private BasicdataWarehouseEntity getBasicdataWarehouseEntity(String mallName) {
String cacheName =mallName +"仓";
BasicdataWarehouseEntity basicdataWarehouseEntity = bladeRedis.get(cacheName);
if(basicdataWarehouseEntity==null){
basicdataWarehouseEntity = warehouseClient.findByName(mallName +"仓");
bladeRedis.setEx(cacheName,basicdataWarehouseEntity,60*60*24L);
}
return basicdataWarehouseEntity;
}
private void saveTrunklineAdvanceDetailEntity(List<TrunklineAdvanceDetailEntity> t, TrunklineAdvanceEntity trunklineAdvanceEntity, String mallName) {
Tenant tenant = changeDataBase(mallName);
List<Long> ids = Arrays.asList(trunklineAdvanceEntity.getId());
List<TrunklineAdvanceDetailVO> listByAdvanceIds = trunklineAdvanceDetailClient.findListByAdvanceIds(ids);
for (TrunklineAdvanceDetailEntity trunklineAdvanceDetailEntity : t) {
// 检测 保存的对象是否已经存在
for (TrunklineAdvanceDetailVO listByAdvanceId : listByAdvanceIds) {
if(listByAdvanceId.getOrderPackageCode().equals(trunklineAdvanceDetailEntity.getOrderPackageCode())){
trunklineAdvanceDetailEntity.setId(listByAdvanceId.getId());
break;
}
}
trunklineAdvanceDetailEntity.setPackageStatus("0");
trunklineAdvanceDetailEntity.setAdvanceId(trunklineAdvanceEntity.getId());
trunklineAdvanceDetailEntity.setTenantId(tenant.getTenantId());
trunklineAdvanceDetailEntity.setIncomingWarehouseId(null);
trunklineAdvanceDetailEntity.setIncomingWarehouseName(null);
BasicdataWarehouseEntity basicdataWarehouseEntity = getBasicdataWarehouseEntity(mallName);
if(basicdataWarehouseEntity!=null){
trunklineAdvanceDetailEntity.setWarehouseId(basicdataWarehouseEntity.getId());
trunklineAdvanceDetailEntity.setWarehouseName(basicdataWarehouseEntity.getName());
}
}
trunklineAdvanceDetailClient.addAdvanceBatch(t);
}
private TrunklineAdvanceEntity saveTrunklineAdvanceEntity(TrunklineAdvanceEntity trunklineAdvanceEntity, String mallName) {
Tenant tenant = changeDataBase(mallName);
// 查找商户的暂存单是否存在改制
TrunklineAdvanceEntity trunklineAdvanceEntity1 = trunklineAdvanceClient.findAdvanceLimitOneByOrderCode(trunklineAdvanceEntity.getOrderCode());
BasicdataWarehouseEntity basicdataWarehouseEntity = getBasicdataWarehouseEntity(mallName);
if (ObjectUtil.isEmpty(trunklineAdvanceEntity1)) {
// 保存对象
if(basicdataWarehouseEntity!=null){
trunklineAdvanceEntity.setWarehouseId(basicdataWarehouseEntity.getId());
trunklineAdvanceEntity.setWarehouseName(basicdataWarehouseEntity.getName());
}
trunklineAdvanceEntity.setTenantId(tenant.getTenantId());
Long l = trunklineAdvanceClient.addAdvanceReturnId(trunklineAdvanceEntity);
trunklineAdvanceEntity.setId(l);
return trunklineAdvanceEntity;
} else {
return trunklineAdvanceEntity1;
}
}
}

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

@ -724,9 +724,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
//更新签收表的装车数量
Integer j = distributionSignforMapper.updateloadByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub());
//进行解托操作
Map<String,Object> info = new HashMap<>();
info.put("orderPackageCode",parcelListEntity.getOrderPackageCode());
@ -5400,6 +5398,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
loadscanEntity.setScanStatus(LoadingStatusConstant.saomiao.getValue());
loadscanEntity.setScanType("1");
loadscanEntity.setOneClick(1);
loadscanEntity.setAbnormalNote("异常装车");
loadscanEntity.setPackageId(parcelListEntity.getId());
loadscanEntity.setOrderPackageCode(parcelListEntity.getOrderPackageCode());
loadscanEntity.setPackageNub(parcelListEntity.getQuantity());

14
blade-service/logpm-statisticsdata/Dockerfile

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

36
blade-service/logpm-statisticsdata/pom.xml

@ -12,6 +12,7 @@
<groupId>org.springblade</groupId>
<artifactId>logpm-statisticsdata</artifactId>
<name>${project.artifactId}</name>
<version>${bladex.project.version}</version>
<packaging>jar</packaging>
@ -47,7 +48,42 @@
<version>3.2.0.RELEASE</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>logpm-basicdata-api</artifactId>
<version>3.2.0.RELEASE</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>logpm-basicdata-api</artifactId>
<version>3.2.0.RELEASE</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<configuration>
<username>${docker.username}</username>
<password>${docker.password}</password>
<repository>${docker.registry.url}/${docker.namespace}/${project.artifactId}</repository>
<tag>${project.version}</tag>
<useMavenSettingsForAuth>true</useMavenSettingsForAuth>
<buildArgs>
<JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
</buildArgs>
<skip>false</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

159
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/MerchantBalanceController.java

@ -0,0 +1,159 @@
package com.logpm.statistics.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.statistics.dto.MerchantStatisticsDTO;
import com.logpm.statistics.dto.StatisticsBalanceAbnormalDTO;
import com.logpm.statistics.dto.StatisticsBalanceRecordDTO;
import com.logpm.statistics.service.IStatisticsBalanceOrderInfoService;
import com.logpm.statistics.vo.StatisticsBalanceOrderInfoVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*;
import java.util.Objects;
@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping("/merchantBalance")
@Api(value = "商户结算控制类", tags = "商户结算单接口")
public class MerchantBalanceController {
private final IStatisticsBalanceOrderInfoService balanceOrderInfoService;
@ResponseBody
@PostMapping("/pageList")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "运单维度对账单", notes = "传入merchantStatisticsDTO")
public R pageList(@RequestBody MerchantStatisticsDTO merchantStatisticsDTO) {
String method = "############pageList: ";
log.info(method+"请求参数{}",merchantStatisticsDTO);
try{
Integer listType = merchantStatisticsDTO.getListType();
if(Objects.isNull(listType)){
log.warn(method+"请选择正确的列表类型 listType={}",listType);
return R.fail(405,"请选择正确的列表类型");
}
IPage<StatisticsBalanceOrderInfoVO> pages = balanceOrderInfoService.pageList(merchantStatisticsDTO);
return R.data(pages);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常",e);
return R.fail(500,"系统异常");
}
}
@ResponseBody
@PostMapping("/addAbnormal")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "添加异常", notes = "传入balanceAbnormalDTO")
public R addAbnormal(@RequestBody StatisticsBalanceAbnormalDTO balanceAbnormalDTO) {
String method = "############addAbnormal: ";
log.info(method+"请求参数{}",balanceAbnormalDTO);
try{
Long balanceOrderInfoId = balanceAbnormalDTO.getBalanceOrderInfoId();
if(Objects.isNull(balanceOrderInfoId)){
log.warn(method+"请选择正确的结算单 balanceOrderInfoId={}",balanceOrderInfoId);
return R.fail(405,"请选择正确的结算单");
}
return balanceOrderInfoService.addAbnormal(balanceAbnormalDTO);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常",e);
return R.fail(500,"系统异常");
}
}
@ResponseBody
@PostMapping("/findAbnormalList")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "查询异常列表", notes = "传入balanceAbnormalDTO")
public R findAbnormalList(@RequestBody StatisticsBalanceAbnormalDTO balanceAbnormalDTO) {
String method = "############findAbnormalList: ";
log.info(method+"请求参数{}",balanceAbnormalDTO);
try{
Long balanceOrderInfoId = balanceAbnormalDTO.getBalanceOrderInfoId();
if(Objects.isNull(balanceOrderInfoId)){
log.warn(method+"请选择正确的结算单 balanceOrderInfoId={}",balanceOrderInfoId);
return R.fail(405,"请选择正确的结算单");
}
return balanceOrderInfoService.findAbnormalList(balanceAbnormalDTO);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常",e);
return R.fail(500,"系统异常");
}
}
@ResponseBody
@PostMapping("/addBalanceRecord")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "添加结算揭露", notes = "传入balanceRecordDTO")
public R addBalanceRecord(@RequestBody StatisticsBalanceRecordDTO balanceRecordDTO) {
String method = "############addBalanceRecord: ";
log.info(method+"请求参数{}",balanceRecordDTO);
try{
Long balanceOrderInfoId = balanceRecordDTO.getBalanceOrderInfoId();
if(Objects.isNull(balanceOrderInfoId)){
log.warn(method+"请选择正确的结算单 balanceOrderInfoId={}",balanceOrderInfoId);
return R.fail(405,"请选择正确的结算单");
}
return balanceOrderInfoService.addBalanceRecord(balanceRecordDTO);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常",e);
return R.fail(500,"系统异常");
}
}
@ResponseBody
@PostMapping("/findRecordList")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "查询异常列表", notes = "传入balanceRecordDTO")
public R findRecordList(@RequestBody StatisticsBalanceRecordDTO balanceRecordDTO) {
String method = "############findRecordList: ";
log.info(method+"请求参数{}",balanceRecordDTO);
try{
Long balanceOrderInfoId = balanceRecordDTO.getBalanceOrderInfoId();
if(Objects.isNull(balanceOrderInfoId)){
log.warn(method+"请选择正确的结算单 balanceOrderInfoId={}",balanceOrderInfoId);
return R.fail(405,"请选择正确的结算单");
}
return balanceOrderInfoService.findRecordList(balanceRecordDTO);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常",e);
return R.fail(500,"系统异常");
}
}
}

123
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/MerchantStatisticsController.java

@ -1,9 +1,12 @@
package com.logpm.statistics.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.statistics.dto.ChangesRecordDTO;
import com.logpm.statistics.dto.MerchantStatisticsDTO;
import com.logpm.statistics.service.IStatisticsOrderInfoService;
import com.logpm.statistics.service.IStatisticsWaybillInfoService;
import com.logpm.statistics.vo.StatisticsChangesRecordVO;
import com.logpm.statistics.vo.StatisticsOrderInfoVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
@ -12,35 +15,129 @@ import org.springblade.common.exception.CustomerException;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Objects;
@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping("/merchantStatistics")
@Api(value = "商户结算控制类", tags = "珊瑚结算接口")
@Api(value = "商户对账控制类", tags = "商户对账单接口")
public class MerchantStatisticsController {
private final IStatisticsOrderInfoService statisticsOrderInfoService;
private final IStatisticsWaybillInfoService statisticsWaybillInfoService;
@ResponseBody
@PostMapping("/pageToBussesList")
@PostMapping("/pageList")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "运单维度对账单", notes = "传入merchantStatisticsDTO")
public R pageList(@RequestBody MerchantStatisticsDTO merchantStatisticsDTO) {
String method = "############pageList: ";
log.info(method+"请求参数{}",merchantStatisticsDTO);
try{
Integer listType = merchantStatisticsDTO.getListType();
if(Objects.isNull(listType)){
log.warn(method+"请选择正确的列表类型 listType={}",listType);
return R.fail(405,"请选择正确的列表类型");
}
IPage<StatisticsOrderInfoVO> pages = statisticsOrderInfoService.pageList(merchantStatisticsDTO);
return R.data(pages);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常",e);
return R.fail(500,"系统异常");
}
}
@ResponseBody
@PostMapping("/findChangesRecordList")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "运单维度对账单", notes = "传入waybillDTO")
public R pageToBussesList(@RequestBody MerchantStatisticsDTO merchantStatisticsDTO) {
String method = "############pageToBussesList: ";
@ApiOperation(value = "查询订单异动记录列表", notes = "传入merchantStatisticsDTO")
public R findChangesRecordList(@RequestBody MerchantStatisticsDTO merchantStatisticsDTO) {
String method = "############findChangesRecordList: ";
log.info(method+"请求参数{}",merchantStatisticsDTO);
try{
// IPage<TrunklineBillladingVO> pages = statisticsWaybillInfoService.pageToBussesList(merchantStatisticsDTO);
//
// return R.data(pages);
return R.data(null);
Long orderInfoId = merchantStatisticsDTO.getOrderInfoId();
if(Objects.isNull(orderInfoId)){
log.warn(method+"订单id为空 orderInfoId={}",orderInfoId);
return R.fail(405,"订单id为空");
}
List<StatisticsChangesRecordVO> list = statisticsOrderInfoService.findChangesRecordList(merchantStatisticsDTO);
return R.data(list);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常",e);
return R.fail(500,"系统异常");
}
}
@ResponseBody
@PostMapping("/addChangesRecord")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "新增异动金额", notes = "传入waybillDTO")
public R addChangesRecord(@RequestBody ChangesRecordDTO changesRecordDTO) {
String method = "############addChangesRecord: ";
log.info(method+"请求参数{}",changesRecordDTO);
try{
Long orderInfoId = changesRecordDTO.getOrderInfoId();
if(Objects.isNull(orderInfoId)){
log.warn(method+"订单id为空 orderInfoId={}",orderInfoId);
return R.fail(405,"订单id为空");
}
Long statisticsWarehouseId = changesRecordDTO.getStatisticsWarehouseId();
if(Objects.isNull(statisticsWarehouseId)){
log.warn(method+"仓库id为空 statisticsWarehouseId={}",statisticsWarehouseId);
return R.fail(405,"仓库id为空");
}
return statisticsOrderInfoService.addChangesRecord(changesRecordDTO);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常",e);
return R.fail(500,"系统异常");
}
}
@ResponseBody
@PostMapping("/checkBalance")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "确认结算", notes = "传入merchantStatisticsDTO")
public R checkBalance(@RequestBody MerchantStatisticsDTO merchantStatisticsDTO) {
String method = "############checkBalance: ";
log.info(method+"请求参数{}",merchantStatisticsDTO);
try{
List<Long> orderInfoIds = merchantStatisticsDTO.getOrderInfoIds();
if(orderInfoIds.isEmpty()){
log.warn(method+"订单集合为空 orderInfoIds={}",orderInfoIds);
return R.fail(405,"订单集合为空");
}
return statisticsOrderInfoService.checkBalance(merchantStatisticsDTO);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error("############sendOrders: 系统异常",e);
return R.fail(500,"############sendOrders: 系统异常");
log.error(method+"系统异常",e);
return R.fail(500,"系统异常");
}
}

34
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/WaybillFanoutListener.java

@ -3,7 +3,10 @@ package com.logpm.statistics.listener.mq;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.logpm.statistics.entity.*;
import com.logpm.statistics.entity.StatisticsDistributionPackageEntity;
import com.logpm.statistics.entity.StatisticsOrderInfoEntity;
import com.logpm.statistics.entity.StatisticsTrunklinePackageEntity;
import com.logpm.statistics.entity.StatisticsWarehousePackageEntity;
import com.logpm.statistics.service.*;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@ -19,7 +22,6 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
@Slf4j
@ -177,17 +179,17 @@ public class WaybillFanoutListener {
}
Long waybillInfoId = null;
//生成运单维度
if(!"2".equals(typeService)){
StatisticsWaybillInfoEntity statisticsWaybillInfoEntity = new StatisticsWaybillInfoEntity();
statisticsWaybillInfoEntity.setWaybillNo(waybillNo);
statisticsWaybillInfoEntity.setWaybillId(waybillId);
statisticsWaybillInfoEntity.setTypeService(typeService);
statisticsWaybillInfoEntity.setConfirmStatisticsOrder(0);
statisticsWaybillInfoService.save(statisticsWaybillInfoEntity);
waybillInfoId = statisticsWaybillInfoEntity.getId();
}
// //生成运单维度
// if(!"2".equals(typeService)){
// StatisticsWaybillInfoEntity statisticsWaybillInfoEntity = new StatisticsWaybillInfoEntity();
// statisticsWaybillInfoEntity.setWaybillNo(waybillNo);
// statisticsWaybillInfoEntity.setWaybillId(waybillId);
// statisticsWaybillInfoEntity.setTypeService(typeService);
// statisticsWaybillInfoEntity.setConfirmStatisticsOrder(0);
// statisticsWaybillInfoService.save(statisticsWaybillInfoEntity);
// waybillInfoId = statisticsWaybillInfoEntity.getId();
// }
//把statisticsPackageInfoEntities的orderCode作为key进行分组
@ -195,7 +197,6 @@ public class WaybillFanoutListener {
Map<String, List<StatisticsWarehousePackageEntity>> warehouseMap = statisticsWarehousePackageEntities.stream().collect(Collectors.groupingBy(StatisticsWarehousePackageEntity::getOrderCode));
Map<String, List<StatisticsDistributionPackageEntity>> distributionMap = statisticsDistributionPackageEntities.stream().collect(Collectors.groupingBy(StatisticsDistributionPackageEntity::getOrderCode));
List<StatisticsOrderInfoEntity> orderInfoEntities = new ArrayList<>();
Long finalWaybillInfoId = waybillInfoId;
trunklineMap.keySet().forEach(key -> {
StatisticsOrderInfoEntity statisticsOrderInfoEntity = new StatisticsOrderInfoEntity();
@ -203,11 +204,6 @@ public class WaybillFanoutListener {
statisticsOrderInfoEntity.setWaybillNo(waybillNo);
statisticsOrderInfoEntity.setOrderCode(key);
statisticsOrderInfoEntity.setTypeService(typeService);
if(!Objects.isNull(finalWaybillInfoId)){
statisticsOrderInfoEntity.setWaybillInfoId(finalWaybillInfoId);
}
// statisticsOrderInfoEntity.setConfirmStatus(0);
orderInfoEntities.add(statisticsOrderInfoEntity);
});

9
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsBalanceAbnormalMapper.java

@ -0,0 +1,9 @@
package com.logpm.statistics.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.statistics.entity.StatisticsBalanceAbnormalEntity;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface StatisticsBalanceAbnormalMapper extends BaseMapper<StatisticsBalanceAbnormalEntity> {
}

9
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsBalanceAbnormalPhotoMapper.java

@ -0,0 +1,9 @@
package com.logpm.statistics.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.statistics.entity.StatisticsBalanceAbnormalPhotoEntity;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface StatisticsBalanceAbnormalPhotoMapper extends BaseMapper<StatisticsBalanceAbnormalPhotoEntity> {
}

15
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsBalanceOrderInfoMapper.java

@ -0,0 +1,15 @@
package com.logpm.statistics.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.statistics.dto.MerchantStatisticsDTO;
import com.logpm.statistics.entity.StatisticsBalanceOrderInfoEntity;
import com.logpm.statistics.vo.StatisticsBalanceOrderInfoVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface StatisticsBalanceOrderInfoMapper extends BaseMapper<StatisticsBalanceOrderInfoEntity> {
IPage<StatisticsBalanceOrderInfoVO> pageList(IPage<Object> page, @Param("param") MerchantStatisticsDTO merchantStatisticsDTO);
}

11
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsBalanceOrderInfoMapper.xml

@ -0,0 +1,11 @@
<?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.statistics.mapper.StatisticsBalanceOrderInfoMapper">
<select id="pageList" resultType="com.logpm.statistics.vo.StatisticsBalanceOrderInfoVO">
select *
from logpm_statistics_balance_order_info
where 1=1
</select>
</mapper>

9
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsBalanceRecordMapper.java

@ -0,0 +1,9 @@
package com.logpm.statistics.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.statistics.entity.StatisticsBalanceRecordEntity;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface StatisticsBalanceRecordMapper extends BaseMapper<StatisticsBalanceRecordEntity> {
}

9
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsBalanceRecordPhotoMapper.java

@ -0,0 +1,9 @@
package com.logpm.statistics.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.statistics.entity.StatisticsBalanceRecordPhotoEntity;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface StatisticsBalanceRecordPhotoMapper extends BaseMapper<StatisticsBalanceRecordPhotoEntity> {
}

9
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsChangesPhotoMapper.java

@ -0,0 +1,9 @@
package com.logpm.statistics.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.statistics.entity.StatisticsChangesPhotoEntity;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface StatisticsChangesPhotoMapper extends BaseMapper<StatisticsChangesPhotoEntity> {
}

13
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsChangesRecordMapper.java

@ -0,0 +1,13 @@
package com.logpm.statistics.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.statistics.entity.StatisticsChangesRecordEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
@Mapper
public interface StatisticsChangesRecordMapper extends BaseMapper<StatisticsChangesRecordEntity> {
BigDecimal findChangesFeeByOrderInfoId(@Param("orderInfoId") Long orderInfoId);
}

13
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsChangesRecordMapper.xml

@ -0,0 +1,13 @@
<?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.statistics.mapper.StatisticsChangesRecordMapper">
<select id="findChangesFeeByOrderInfoId" resultType="java.math.BigDecimal">
select sum(total_fee)
from logpm_statistics_changes_record
where order_info_id = #{orderInfoId}
</select>
</mapper>

10
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.java

@ -1,9 +1,19 @@
package com.logpm.statistics.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.statistics.dto.MerchantStatisticsDTO;
import com.logpm.statistics.entity.StatisticsOrderInfoEntity;
import com.logpm.statistics.vo.StatisticsOrderInfoVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface StatisticsOrderInfoMapper extends BaseMapper<StatisticsOrderInfoEntity> {
IPage<StatisticsOrderInfoVO> pageList(IPage<Object> page, @Param("param") MerchantStatisticsDTO merchantStatisticsDTO);
List<StatisticsOrderInfoVO> findStatementListByOrderInfoIds(@Param("orderInfoIds") List<Long> orderInfoIds);
}

236
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.xml

@ -0,0 +1,236 @@
<?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.statistics.mapper.StatisticsOrderInfoMapper">
<select id="pageList" resultType="com.logpm.statistics.vo.StatisticsOrderInfoVO">
select lsoi.id orderInfoId,
lsoi.order_code orderNo,
lsoi.waybill_no waybillNo,
lww.brand brand,
lww.shipper shipper,
lww.shipper_name shipperPerson,
lww.shipper_mobile shipperMobile,
lww.shipper_address shipperAddress,
lww.consignee consignee,
lww.consignee_name consigneePerson,
lww.consignee_mobile consigneeMobile,
lww.consignee_address consigneeAddress,
lww.waybill_status waybillStatus,
lsoi.sign_status signStatus,
lsoi.type_service typeService,
IF(lww.check_user_id is null,0,1) isCheck,
lww.create_time openTime,
lww.departure departure,
lww.destination destination,
lww.departure_warehouse_name departureWarehouseName,
lww.destination_warehouse_name destinationWarehouseName,
lww.delivery_method deliveryMethod,
lww.customer_train customerTrain,
IF(twr.waybill_id is null,0,1) receiptStatus,
lww.remark waybillRemark,
lww.pay_type payType,
lww.pay_way payWay,
lsoi.confirm_statistics_order confirmStatisticsOrder,
lsoi.confirm_statistics_user_name confirmStatisticsUserName,
lsoi.confirm_statistics_time confirmStatisticsTime,
lsoi.changes_fee changesFee,
IF(count(lscr.id)>0,1,0) isChanges,
GROUP_CONCAT(lscr.item_record) changesItems,
GROUP_CONCAT(lscr.remark) changesRemark,
MAX(lscr.create_time) changesTime,
GROUP_CONCAT(DISTINCT lstp.product_name) goodsName,
sum(lstp.total_num) totalcount,
sum(lstp.total_weight) totalWeight,
sum(lstp.total_volume) totalVolume,
sum(lstp.open_price+lswp.open_price+lsdp.open_price) openFee,
sum(lstp.total_price+lswp.total_price+lsdp.total_price) totalFee,
sum(lstp.pickup_fee) pickupFee,
sum(lstp.real_pickup_fee) realPickupFee,
sum(lstp.freight_fee) freightFee,
sum(lstp.real_freight_fee) realFreightFee,
sum(lstp.install_fee) installFee,
sum(lstp.real_install_fee) realInstallFee,
sum(lstp.quotation_fee) quotationFee,
sum(lstp.real_quotation_fee) realQuotationFee,
sum(lstp.claiming_value) claimingValue,
sum(lstp.real_claiming_value) realClaimingValue,
sum(lstp.other_fee) otherFee,
sum(lstp.real_other_fee) realOtherFee,
sum(lstp.return_fee) returnFee,
sum(lstp.real_return_fee) realReturnFee,
sum(lstp.third_opration_fee) thirdOprationFee,
sum(lstp.real_third_opration_fee) realThirdOprationFee,
sum(lstp.x_pay) xPay,
sum(lstp.real_x_pay) realXPay,
sum(lstp.d_pay) dPay,
sum(lstp.real_d_pay) realDPay,
sum(lstp.h_pay) hPay,
sum(lstp.real_h_pay) realHPay,
sum(lstp.y_pay) yPay,
sum(lstp.real_y_pay) realYPay,
min(lswp.incoming_time) incomingTime,
max(lswp.outing_time) outingTime,
sum(lswp.warehouse_service_fee) warehouseServiceFee,
sum(lswp.real_warehouse_service_fee) realWarehouseServiceFee,
sum(lswp.warehouse_fee) warehouseFee,
sum(lswp.real_warehouse_fee) realWarehouseFee,
sum(lswp.warehouse_manage_fee) warehouseManageFee,
sum(lswp.real_warehouse_manage_fee) realWarehouseManageFee,
sum(lswp.warehouse_sorting_fee) warehouseSortingFee,
sum(lswp.real_warehouse_sorting_fee) realWarehouseSortingFee,
sum(lswp.warehouse_operating_fee) warehouseOperatingFee,
sum(lswp.real_warehouse_operating_fee) realWarehouseOperatingFee,
sum(lsdp.delivery_service_fee) deliveryServiceFee,
sum(lsdp.real_delivery_service_fee) realDeliveryServiceFee,
sum(lsdp.delivery_fee) deliveryFee,
sum(lsdp.real_delivery_fee) realDeliveryFee,
sum(lsdp.delivery_loading_fee) deliveryLoadingFee,
sum(lsdp.real_delivery_loading_fee) realDeliveryLoadingFee,
sum(lsdp.delivery_sorting_fee) deliverySortingFee,
sum(lsdp.real_delivery_sorting_fee) realDeliverySortingFee,
sum(lsdp.delivery_upfloor_fee) deliveryUpfloorFee,
sum(lsdp.real_delivery_upfloor_fee) realDeliveryUpfloorFee,
sum(lsdp.delivery_move_fee) deliveryMoveFee,
sum(lsdp.real_delivery_move_fee) realDeliveryMoveFee,
max(lsdp.delivery_distance) deliveryDistance,
max(lsdp.real_delivery_distance) realDeliveryDistance,
sum(lsdp.delivery_crossing_fee) deliveryCrossingFee,
sum(lsdp.real_delivery_crossing_fee) realDeliveryCrossingFee,
sum(lstp.total_price+lswp.total_price+lsdp.total_price)+lsoi.changes_fee totalStatementFee,
sum(IF(lsdp.is_sign = 0,0,lsdp.total_num)) signNum,
max(lsdp.sign_time) signTime
from logpm_statistics_order_info lsoi
left join logpm_warehouse_waybill lww on lww.id = lsoi.waybill_id
left join (select ltwr.waybill_id from logpm_trunkline_waybill_return ltwr group by ltwr.waybill_id) twr on twr.waybill_id = lww.id
left join logpm_statistics_trunkline_package lstp on lstp.order_info_id = lsoi.id
left join logpm_statistics_warehouse_package lswp on lswp.order_info_id = lstp.order_info_id and lswp.order_package_code = lstp.order_package_code
left join logpm_statistics_distribution_package lsdp on lsdp.order_info_id = lswp.order_info_id = lsdp.order_package_code = lswp.order_package_code
left join logpm_statistics_changes_record lscr on lscr.order_info_id = lsoi.id
where 1=1
<if test="param.listType == 1">
and lsoi.type_service != '2'
</if>
<if test="param.listType == 2">
and lsoi.type_service = '2'
</if>
<if test="param.consignee != null and param.consignee != '' ">
and Locate(#{param.consignee},lww.consignee) > 0
</if>
<if test="param.confirmStatisticsOrder != null">
and lsoi.confirm_statistics_order = #{param.confirmStatisticsOrder}
</if>
group by lsoi.id
</select>
<select id="findStatementListByOrderInfoIds" resultType="com.logpm.statistics.vo.StatisticsOrderInfoVO">
select lsoi.id orderInfoId,
lsoi.order_code orderNo,
lsoi.waybill_no waybillNo,
lww.brand brand,
lww.shipper shipper,
lww.shipper_name shipperPerson,
lww.shipper_mobile shipperMobile,
lww.shipper_address shipperAddress,
lww.consignee consignee,
lww.consignee_name consigneePerson,
lww.consignee_mobile consigneeMobile,
lww.consignee_address consigneeAddress,
lww.waybill_status waybillStatus,
lsoi.sign_status signStatus,
lsoi.type_service typeService,
IF(lww.check_user_id is null,0,1) isCheck,
lww.create_time openTime,
lww.departure departure,
lww.destination destination,
lww.departure_warehouse_name departureWarehouseName,
lww.destination_warehouse_name destinationWarehouseName,
lww.delivery_method deliveryMethod,
lww.customer_train customerTrain,
IF(twr.waybill_id is null,0,1) receiptStatus,
lww.remark waybillRemark,
lww.pay_type payType,
lww.pay_way payWay,
lsoi.confirm_statistics_order confirmStatisticsOrder,
lsoi.confirm_statistics_user_name confirmStatisticsUserName,
lsoi.confirm_statistics_time confirmStatisticsTime,
lsoi.changes_fee changesFee,
IF(count(lscr.id)>0,1,0) isChanges,
GROUP_CONCAT(lscr.item_record) changesItems,
GROUP_CONCAT(lscr.remark) changesRemark,
MAX(lscr.create_time) changesTime,
GROUP_CONCAT(DISTINCT lstp.product_name) goodsName,
sum(lstp.total_num) totalcount,
sum(lstp.total_weight) totalWeight,
sum(lstp.total_volume) totalVolume,
sum(lstp.open_price+lswp.open_price+lsdp.open_price) openFee,
sum(lstp.total_price+lswp.total_price+lsdp.total_price) totalFee,
sum(lstp.pickup_fee) pickupFee,
sum(lstp.real_pickup_fee) realPickupFee,
sum(lstp.freight_fee) freightFee,
sum(lstp.real_freight_fee) realFreightFee,
sum(lstp.install_fee) installFee,
sum(lstp.real_install_fee) realInstallFee,
sum(lstp.quotation_fee) quotationFee,
sum(lstp.real_quotation_fee) realQuotationFee,
sum(lstp.claiming_value) claimingValue,
sum(lstp.real_claiming_value) realClaimingValue,
sum(lstp.other_fee) otherFee,
sum(lstp.real_other_fee) realOtherFee,
sum(lstp.return_fee) returnFee,
sum(lstp.real_return_fee) realReturnFee,
sum(lstp.third_opration_fee) thirdOprationFee,
sum(lstp.real_third_opration_fee) realThirdOprationFee,
sum(lstp.x_pay) xPay,
sum(lstp.real_x_pay) realXPay,
sum(lstp.d_pay) dPay,
sum(lstp.real_d_pay) realDPay,
sum(lstp.h_pay) hPay,
sum(lstp.real_h_pay) realHPay,
sum(lstp.y_pay) yPay,
sum(lstp.real_y_pay) realYPay,
min(lswp.incoming_time) incomingTime,
max(lswp.outing_time) outingTime,
sum(lswp.warehouse_service_fee) warehouseServiceFee,
sum(lswp.real_warehouse_service_fee) realWarehouseServiceFee,
sum(lswp.warehouse_fee) warehouseFee,
sum(lswp.real_warehouse_fee) realWarehouseFee,
sum(lswp.warehouse_manage_fee) warehouseManageFee,
sum(lswp.real_warehouse_manage_fee) realWarehouseManageFee,
sum(lswp.warehouse_sorting_fee) warehouseSortingFee,
sum(lswp.real_warehouse_sorting_fee) realWarehouseSortingFee,
sum(lswp.warehouse_operating_fee) warehouseOperatingFee,
sum(lswp.real_warehouse_operating_fee) realWarehouseOperatingFee,
sum(lsdp.delivery_service_fee) deliveryServiceFee,
sum(lsdp.real_delivery_service_fee) realDeliveryServiceFee,
sum(lsdp.delivery_fee) deliveryFee,
sum(lsdp.real_delivery_fee) realDeliveryFee,
sum(lsdp.delivery_loading_fee) deliveryLoadingFee,
sum(lsdp.real_delivery_loading_fee) realDeliveryLoadingFee,
sum(lsdp.delivery_sorting_fee) deliverySortingFee,
sum(lsdp.real_delivery_sorting_fee) realDeliverySortingFee,
sum(lsdp.delivery_upfloor_fee) deliveryUpfloorFee,
sum(lsdp.real_delivery_upfloor_fee) realDeliveryUpfloorFee,
sum(lsdp.delivery_move_fee) deliveryMoveFee,
sum(lsdp.real_delivery_move_fee) realDeliveryMoveFee,
max(lsdp.delivery_distance) deliveryDistance,
max(lsdp.real_delivery_distance) realDeliveryDistance,
sum(lsdp.delivery_crossing_fee) deliveryCrossingFee,
sum(lsdp.real_delivery_crossing_fee) realDeliveryCrossingFee,
sum(lstp.total_price+lswp.total_price+lsdp.total_price)+lsoi.changes_fee totalStatementFee,
sum(IF(lsdp.is_sign = 0,0,lsdp.total_num)) signNum,
max(lsdp.sign_time) signTime
from logpm_statistics_order_info lsoi
left join logpm_warehouse_waybill lww on lww.id = lsoi.waybill_id
left join (select ltwr.waybill_id from logpm_trunkline_waybill_return ltwr group by ltwr.waybill_id) twr on twr.waybill_id = lww.id
left join logpm_statistics_trunkline_package lstp on lstp.order_info_id = lsoi.id
left join logpm_statistics_warehouse_package lswp on lswp.order_info_id = lstp.order_info_id and lswp.order_package_code = lstp.order_package_code
left join logpm_statistics_distribution_package lsdp on lsdp.order_info_id = lswp.order_info_id = lsdp.order_package_code = lswp.order_package_code
left join logpm_statistics_changes_record lscr on lscr.order_info_id = lsoi.id
where 1=1
and lsoi.id in
<foreach collection="orderInfoIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
</mapper>

7
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsWaybillInfoMapper.java

@ -1,9 +1,16 @@
package com.logpm.statistics.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.statistics.dto.MerchantStatisticsDTO;
import com.logpm.statistics.entity.StatisticsWaybillInfoEntity;
import com.logpm.statistics.vo.StatisticsWaybillInfoVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface StatisticsWaybillInfoMapper extends BaseMapper<StatisticsWaybillInfoEntity> {
}

111
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsWaybillInfoMapper.xml

@ -0,0 +1,111 @@
<?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.statistics.mapper.StatisticsWaybillInfoMapper">
<select id="pageList" resultType="com.logpm.statistics.vo.StatisticsWaybillInfoVO">
select lsoi.order_code,
lsoi.waybill_no,
lww.brand,
lww.shipper,
lww.shipper_name,
lww.shipper_mobile,
lww.shipper_address,
lww.consignee,
lww.consignee_name,
lww.consignee_mobile,
lww.consignee_address,
lww.waybill_status,
lsoi.sign_status,
'',
lbsb.mold,
lww.check_user_id,
lww.create_time,
lww.goods_name,
lww.departure,
lww.destination,
lww.departure_warehouse_name,
lww.destination_warehouse_name,
lww.delivery_method,
lww.customer_train,
IF(twr.waybill_id is null,0,1),
lww.remark,
'',
lww.pay_type,
lww.pay_way,
lsoi.confirm_statistics_order,
lsoi.confirm_statistics_user_name,
lsoi.confirm_statistics_time,
GROUP_CONCAT(DISTINCT lstp.product_name),
sum(lstp.total_num),
sum(lstp.total_weight),
sum(lstp.total_volume),
sum(lstp.open_price+lswp.open_price+lsdp.open_price),
sum(lstp.total_price+lswp.total_price+lsdp.total_price),
sum(lstp.pickup_fee),
sum(lstp.real_pickup_fee),
sum(lstp.freight_fee),
sum(lstp.real_freight_fee),
sum(lstp.install_fee),
sum(lstp.real_install_fee),
sum(lstp.quotation_fee),
sum(lstp.real_quotation_fee),
sum(lstp.claiming_value),
sum(lstp.real_claiming_value),
sum(lstp.other_fee),
sum(lstp.real_other_fee),
sum(lstp.return_fee),
sum(lstp.real_return_fee),
sum(lstp.third_opration_fee),
sum(lstp.real_third_opration_fee),
sum(lstp.x_pay),
sum(lstp.real_x_pay),
sum(lstp.d_pay),
sum(lstp.real_d_pay),
sum(lstp.h_pay),
sum(lstp.real_h_pay),
sum(lstp.y_pay),
sum(lstp.real_y_pay),
min(lswp.incoming_time),
max(lswp.outing_time),
sum(lswp.warehouse_service_fee),
sum(lswp.real_warehouse_service_fee),
sum(lswp.warehouse_fee),
sum(lswp.real_warehouse_fee),
sum(lswp.warehouse_manage_fee),
sum(lswp.real_warehouse_manage_fee),
sum(lswp.warehouse_sorting_fee),
sum(lswp.real_warehouse_sorting_fee),
sum(lswp.warehouse_operating_fee),
sum(lswp.real_warehouse_operating_fee),
sum(lsdp.delivery_service_fee),
sum(lsdp.real_delivery_service_fee),
sum(lsdp.delivery_fee),
sum(lsdp.real_delivery_fee),
sum(lsdp.delivery_loading_fee),
sum(lsdp.real_delivery_loading_fee),
sum(lsdp.delivery_sorting_fee),
sum(lsdp.real_delivery_sorting_fee),
sum(lsdp.delivery_upfloor_fee),
sum(lsdp.real_delivery_upfloor_fee),
sum(lsdp.delivery_move_fee),
sum(lsdp.real_delivery_move_fee),
max(lsdp.delivery_distance),
max(lsdp.real_delivery_distance),
sum(lsdp.delivery_crossing_fee),
sum(lsdp.real_delivery_crossing_fee),
sum(lstp.total_price+lswp.total_price+lsdp.total_price)+0,
sum(IF(lsdp.is_sign = 0,0,lsdp.total_num)),
max(lsdp.sign_time)
from logpm_statistics_order_info lsoi
left join logpm_warehouse_waybill lww on lww.id = lsoi.waybill_id
left join logpm_basicdata_store_business lbsb on lbsb.client_id = lww.consignee_id and lbsb.type_service = 3
left join (select ltwr.waybill_id from logpm_trunkline_waybill_return ltwr group by ltwr.waybill_id) twr on twr.waybill_id = lww.id
left join logpm_statistics_trunkline_package lstp on lstp.order_info_id = lsoi.id
left join logpm_statistics_warehouse_package lswp on lswp.order_info_id = lstp.order_info_id and lswp.order_package_code = lstp.order_package_code
left join logpm_statistics_distribution_package lsdp on lsdp.order_info_id = lswp.order_info_id = lsdp.order_package_code = lswp.order_package_code
where 1=1
group by lsoi.order_code,
lsoi.waybill_no
</select>
</mapper>

7
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsBalanceAbnormalPhotoService.java

@ -0,0 +1,7 @@
package com.logpm.statistics.service;
import com.logpm.statistics.entity.StatisticsBalanceAbnormalPhotoEntity;
import org.springblade.core.mp.base.BaseService;
public interface IStatisticsBalanceAbnormalPhotoService extends BaseService<StatisticsBalanceAbnormalPhotoEntity> {
}

7
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsBalanceAbnormalService.java

@ -0,0 +1,7 @@
package com.logpm.statistics.service;
import com.logpm.statistics.entity.StatisticsBalanceAbnormalEntity;
import org.springblade.core.mp.base.BaseService;
public interface IStatisticsBalanceAbnormalService extends BaseService<StatisticsBalanceAbnormalEntity> {
}

22
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsBalanceOrderInfoService.java

@ -0,0 +1,22 @@
package com.logpm.statistics.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.statistics.dto.MerchantStatisticsDTO;
import com.logpm.statistics.dto.StatisticsBalanceAbnormalDTO;
import com.logpm.statistics.dto.StatisticsBalanceRecordDTO;
import com.logpm.statistics.entity.StatisticsBalanceOrderInfoEntity;
import com.logpm.statistics.vo.StatisticsBalanceOrderInfoVO;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.tool.api.R;
public interface IStatisticsBalanceOrderInfoService extends BaseService<StatisticsBalanceOrderInfoEntity> {
IPage<StatisticsBalanceOrderInfoVO> pageList(MerchantStatisticsDTO merchantStatisticsDTO);
R addAbnormal(StatisticsBalanceAbnormalDTO balanceAbnormalDTO);
R findAbnormalList(StatisticsBalanceAbnormalDTO balanceAbnormalDTO);
R addBalanceRecord(StatisticsBalanceRecordDTO balanceRecordDTO);
R findRecordList(StatisticsBalanceRecordDTO balanceRecordDTO);
}

7
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsBalanceRecordPhotoService.java

@ -0,0 +1,7 @@
package com.logpm.statistics.service;
import com.logpm.statistics.entity.StatisticsBalanceRecordPhotoEntity;
import org.springblade.core.mp.base.BaseService;
public interface IStatisticsBalanceRecordPhotoService extends BaseService<StatisticsBalanceRecordPhotoEntity> {
}

7
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsBalanceRecordService.java

@ -0,0 +1,7 @@
package com.logpm.statistics.service;
import com.logpm.statistics.entity.StatisticsBalanceRecordEntity;
import org.springblade.core.mp.base.BaseService;
public interface IStatisticsBalanceRecordService extends BaseService<StatisticsBalanceRecordEntity> {
}

7
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsChangesPhotoService.java

@ -0,0 +1,7 @@
package com.logpm.statistics.service;
import com.logpm.statistics.entity.StatisticsChangesPhotoEntity;
import org.springblade.core.mp.base.BaseService;
public interface IStatisticsChangesPhotoService extends BaseService<StatisticsChangesPhotoEntity> {
}

10
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsChangesRecordService.java

@ -0,0 +1,10 @@
package com.logpm.statistics.service;
import com.logpm.statistics.entity.StatisticsChangesRecordEntity;
import org.springblade.core.mp.base.BaseService;
import java.math.BigDecimal;
public interface IStatisticsChangesRecordService extends BaseService<StatisticsChangesRecordEntity> {
BigDecimal findChangesFeeByOrderInfoId(Long orderInfoId);
}

14
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsOrderInfoService.java

@ -1,7 +1,13 @@
package com.logpm.statistics.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.statistics.dto.ChangesRecordDTO;
import com.logpm.statistics.dto.MerchantStatisticsDTO;
import com.logpm.statistics.entity.StatisticsOrderInfoEntity;
import com.logpm.statistics.vo.StatisticsChangesRecordVO;
import com.logpm.statistics.vo.StatisticsOrderInfoVO;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.tool.api.R;
import java.util.List;
import java.util.Set;
@ -10,4 +16,12 @@ public interface IStatisticsOrderInfoService extends BaseService<StatisticsOrder
List<StatisticsOrderInfoEntity> findListByWaybillId(Long waybillId);
List<StatisticsOrderInfoEntity> findListByOrderInfoIdsSet(Set<Long> orderInfoSet);
IPage<StatisticsOrderInfoVO> pageList(MerchantStatisticsDTO merchantStatisticsDTO);
List<StatisticsChangesRecordVO> findChangesRecordList(MerchantStatisticsDTO merchantStatisticsDTO);
R addChangesRecord(ChangesRecordDTO changesRecordDTO);
R checkBalance(MerchantStatisticsDTO merchantStatisticsDTO);
}

1
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsWaybillInfoService.java

@ -4,4 +4,5 @@ import com.logpm.statistics.entity.StatisticsWaybillInfoEntity;
import org.springblade.core.mp.base.BaseService;
public interface IStatisticsWaybillInfoService extends BaseService<StatisticsWaybillInfoEntity> {
}

15
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsBalanceAbnormalPhotoServiceImpl.java

@ -0,0 +1,15 @@
package com.logpm.statistics.service.impl;
import com.logpm.statistics.entity.StatisticsBalanceAbnormalPhotoEntity;
import com.logpm.statistics.mapper.StatisticsBalanceAbnormalPhotoMapper;
import com.logpm.statistics.service.IStatisticsBalanceAbnormalPhotoService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
@Slf4j
@Service
@AllArgsConstructor
public class StatisticsBalanceAbnormalPhotoServiceImpl extends BaseServiceImpl<StatisticsBalanceAbnormalPhotoMapper, StatisticsBalanceAbnormalPhotoEntity> implements IStatisticsBalanceAbnormalPhotoService {
}

15
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsBalanceAbnormalServiceImpl.java

@ -0,0 +1,15 @@
package com.logpm.statistics.service.impl;
import com.logpm.statistics.entity.StatisticsBalanceAbnormalEntity;
import com.logpm.statistics.mapper.StatisticsBalanceAbnormalMapper;
import com.logpm.statistics.service.IStatisticsBalanceAbnormalService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
@Slf4j
@Service
@AllArgsConstructor
public class StatisticsBalanceAbnormalServiceImpl extends BaseServiceImpl<StatisticsBalanceAbnormalMapper, StatisticsBalanceAbnormalEntity> implements IStatisticsBalanceAbnormalService {
}

217
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsBalanceOrderInfoServiceImpl.java

@ -0,0 +1,217 @@
package com.logpm.statistics.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.logpm.statistics.dto.MerchantStatisticsDTO;
import com.logpm.statistics.dto.StatisticsBalanceAbnormalDTO;
import com.logpm.statistics.dto.StatisticsBalanceRecordDTO;
import com.logpm.statistics.entity.*;
import com.logpm.statistics.mapper.StatisticsBalanceOrderInfoMapper;
import com.logpm.statistics.service.*;
import com.logpm.statistics.vo.StatisticsBalanceAbnormalVO;
import com.logpm.statistics.vo.StatisticsBalanceOrderInfoVO;
import com.logpm.statistics.vo.StatisticsBalanceRecordVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
@Slf4j
@Service
@AllArgsConstructor
public class StatisticsBalanceOrderInfoServiceImpl extends BaseServiceImpl<StatisticsBalanceOrderInfoMapper, StatisticsBalanceOrderInfoEntity> implements IStatisticsBalanceOrderInfoService {
private final IStatisticsBalanceAbnormalService balanceAbnormalService;
private final IStatisticsBalanceAbnormalPhotoService balanceAbnormalPhotoService;
private final IStatisticsBalanceRecordService balanceRecordService;
private final IStatisticsBalanceRecordPhotoService balanceRecordPhotoService;
@Override
public IPage<StatisticsBalanceOrderInfoVO> pageList(MerchantStatisticsDTO merchantStatisticsDTO) {
IPage<Object> page = new Page<>();
page.setCurrent(merchantStatisticsDTO.getPageNum());
page.setSize(merchantStatisticsDTO.getPageSize());
return baseMapper.pageList(page,merchantStatisticsDTO);
}
@Transactional(rollbackFor = Exception.class)
@Override
public R addAbnormal(StatisticsBalanceAbnormalDTO balanceAbnormalDTO) {
StatisticsBalanceAbnormalEntity balanceAbnormalEntity = new StatisticsBalanceAbnormalEntity();
BeanUtil.copy(balanceAbnormalDTO,balanceAbnormalEntity);
balanceAbnormalEntity.setAbnormalUserName(AuthUtil.getNickName());
balanceAbnormalService.save(balanceAbnormalEntity);
List<StatisticsBalanceAbnormalPhotoEntity> abnormalPhotoEntityList = balanceAbnormalDTO.getAbnormalPhotoEntityList();
abnormalPhotoEntityList.forEach(abnormalPhotoEntity -> {
abnormalPhotoEntity.setAbnormalId(balanceAbnormalEntity.getId());
});
balanceAbnormalPhotoService.saveBatch(abnormalPhotoEntityList);
Long balanceOrderInfoId = balanceAbnormalEntity.getBalanceOrderInfoId();
StatisticsBalanceOrderInfoEntity balanceOrderInfoEntity = baseMapper.selectById(balanceOrderInfoId);
if(Objects.isNull(balanceOrderInfoEntity)){
log.warn("###########addAbnormal: 结算单信息不存在 balanceOrderInfoEntity={}",balanceOrderInfoEntity);
return R.fail(405,"结算单信息不存在");
}
BigDecimal totalBalanceFee = balanceOrderInfoEntity.getTotalBalanceFee();
BigDecimal hasBalanceFee = balanceOrderInfoEntity.getHasBalanceFee();
BigDecimal abnormalFee = balanceAbnormalEntity.getAbnormalFee();
BigDecimal total = totalBalanceFee.add(abnormalFee);
balanceOrderInfoEntity.setAbnormalBalanceStatus(1);
balanceOrderInfoEntity.setAbnormalBalanceFee(balanceOrderInfoEntity.getAbnormalBalanceFee().add(abnormalFee));
balanceOrderInfoEntity.setAbnormalTime(balanceAbnormalEntity.getCreateTime());
balanceOrderInfoEntity.setAbnormalUserName(balanceAbnormalEntity.getAbnormalUserName());
balanceOrderInfoEntity.setAbnormalRemark(balanceAbnormalEntity.getAbnormalRemark());
if(hasBalanceFee.compareTo(total) >= 0){
balanceOrderInfoEntity.setBalanceStatus(2);
}else{
if(hasBalanceFee.compareTo(BigDecimal.ZERO) == 0){
balanceOrderInfoEntity.setBalanceStatus(0);
}else{
balanceOrderInfoEntity.setBalanceStatus(1);
}
}
updateById(balanceOrderInfoEntity);
return R.success("添加成功");
}
@Override
public R findAbnormalList(StatisticsBalanceAbnormalDTO balanceAbnormalDTO) {
Long balanceOrderInfoId = balanceAbnormalDTO.getBalanceOrderInfoId();
QueryWrapper<StatisticsBalanceAbnormalEntity> balanceAbnormalEntityQueryWrapper = new QueryWrapper<>();
balanceAbnormalEntityQueryWrapper.eq("balance_order_info_id",balanceOrderInfoId);
List<StatisticsBalanceAbnormalEntity> list = balanceAbnormalService.list(balanceAbnormalEntityQueryWrapper);
//把list中所有元素的id放到一个List集合中
List<Long> idList= list.stream()
.map(StatisticsBalanceAbnormalEntity::getId)
.collect(Collectors.toList());
QueryWrapper<StatisticsBalanceAbnormalPhotoEntity> balanceAbnormalPhotoEntityQueryWrapper = new QueryWrapper<>();
balanceAbnormalPhotoEntityQueryWrapper.in("abnormal_id",idList);
List<StatisticsBalanceAbnormalPhotoEntity> abnormalPhotoEntityList = balanceAbnormalPhotoService.list(balanceAbnormalPhotoEntityQueryWrapper);
//把abnormalPhotoEntityList中所有元素按照abnormalId进行分组
Map<Long, List<StatisticsBalanceAbnormalPhotoEntity>> groupedPhotos = abnormalPhotoEntityList.stream()
.collect(Collectors.groupingBy(StatisticsBalanceAbnormalPhotoEntity::getAbnormalId));
list.forEach(balanceAbnormalEntity -> {
StatisticsBalanceAbnormalVO balanceAbnormalVO = new StatisticsBalanceAbnormalVO();
BeanUtil.copy(balanceAbnormalEntity,balanceAbnormalVO);
balanceAbnormalVO.setAbnormalPhotoEntityList(groupedPhotos.get(balanceAbnormalEntity.getId()));
});
return R.data(list);
}
@Transactional(rollbackFor = Exception.class)
@Override
public R addBalanceRecord(StatisticsBalanceRecordDTO balanceRecordDTO) {
StatisticsBalanceRecordEntity balanceRecordEntity = new StatisticsBalanceRecordEntity();
BeanUtil.copy(balanceRecordDTO,balanceRecordEntity);
balanceRecordEntity.setBalanceUserName(AuthUtil.getNickName());
balanceRecordService.save(balanceRecordEntity);
List<StatisticsBalanceRecordPhotoEntity> recordPhotoEntityList = balanceRecordDTO.getRecordPhotoEntityList();
recordPhotoEntityList.forEach(recordPhotoEntity -> {
recordPhotoEntity.setRecordId(balanceRecordEntity.getId());
});
balanceRecordPhotoService.saveBatch(recordPhotoEntityList);
Long balanceOrderInfoId = balanceRecordDTO.getBalanceOrderInfoId();
StatisticsBalanceOrderInfoEntity balanceOrderInfoEntity = baseMapper.selectById(balanceOrderInfoId);
if(Objects.isNull(balanceOrderInfoEntity)){
log.warn("###########addBalanceRecord: 结算单信息不存在 balanceOrderInfoEntity={}",balanceOrderInfoEntity);
return R.fail(405,"结算单信息不存在");
}
BigDecimal balanceFee = balanceRecordEntity.getBalanceFee();
BigDecimal totalBalanceFee = balanceOrderInfoEntity.getTotalBalanceFee();
BigDecimal abnormalBalanceFee = balanceOrderInfoEntity.getAbnormalBalanceFee();
BigDecimal total = totalBalanceFee.add(abnormalBalanceFee);
BigDecimal hasBalanceFee = balanceOrderInfoEntity.getHasBalanceFee();
BigDecimal newHasBalanceFee = hasBalanceFee.add(balanceFee);
if(newHasBalanceFee.compareTo(total) >= 0){
balanceOrderInfoEntity.setBalanceStatus(2);
balanceOrderInfoEntity.setNoBalanceFee(BigDecimal.ZERO);
}else{
balanceOrderInfoEntity.setBalanceStatus(1);
balanceOrderInfoEntity.setNoBalanceFee(total.subtract(newHasBalanceFee));
}
balanceOrderInfoEntity.setHasBalanceFee(newHasBalanceFee);
balanceOrderInfoEntity.setBalanceTime(balanceRecordEntity.getCreateTime());
balanceOrderInfoEntity.setBalanceUserName(balanceRecordEntity.getBalanceUserName());
balanceOrderInfoEntity.setBalanceRemark(balanceRecordEntity.getBalanceRemark());
updateById(balanceOrderInfoEntity);
return R.success("添加成功");
}
@Override
public R findRecordList(StatisticsBalanceRecordDTO balanceRecordDTO) {
Long balanceOrderInfoId = balanceRecordDTO.getBalanceOrderInfoId();
QueryWrapper<StatisticsBalanceRecordEntity> balanceAbnormalEntityQueryWrapper = new QueryWrapper<>();
balanceAbnormalEntityQueryWrapper.eq("balance_order_info_id",balanceOrderInfoId);
List<StatisticsBalanceRecordEntity> list = balanceRecordService.list(balanceAbnormalEntityQueryWrapper);
//把list中所有元素的id放到一个List集合中
List<Long> idList= list.stream()
.map(StatisticsBalanceRecordEntity::getId)
.collect(Collectors.toList());
QueryWrapper<StatisticsBalanceRecordPhotoEntity> balanceRecordPhotoEntityQueryWrapper = new QueryWrapper<>();
balanceRecordPhotoEntityQueryWrapper.in("record_id",idList);
List<StatisticsBalanceRecordPhotoEntity> recordPhotoEntityList = balanceRecordPhotoService.list(balanceRecordPhotoEntityQueryWrapper);
//把abnormalPhotoEntityList中所有元素按照abnormalId进行分组
Map<Long, List<StatisticsBalanceRecordPhotoEntity>> groupedPhotos = recordPhotoEntityList.stream()
.collect(Collectors.groupingBy(StatisticsBalanceRecordPhotoEntity::getRecordId));
list.forEach(balanceRecordEntity -> {
StatisticsBalanceRecordVO balanceRecordVO = new StatisticsBalanceRecordVO();
BeanUtil.copy(balanceRecordEntity,balanceRecordVO);
balanceRecordVO.setRecordPhotoEntityList(groupedPhotos.get(balanceRecordEntity.getId()));
balanceRecordVO.setBalanceUserName(balanceRecordEntity.getBalanceUserName());
balanceRecordVO.setBalanceRemark(balanceRecordEntity.getBalanceRemark());
});
return R.data(list);
}
}

15
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsBalanceRecordPhotoServiceImpl.java

@ -0,0 +1,15 @@
package com.logpm.statistics.service.impl;
import com.logpm.statistics.entity.StatisticsBalanceRecordPhotoEntity;
import com.logpm.statistics.mapper.StatisticsBalanceRecordPhotoMapper;
import com.logpm.statistics.service.IStatisticsBalanceRecordPhotoService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
@Slf4j
@Service
@AllArgsConstructor
public class StatisticsBalanceRecordPhotoServiceImpl extends BaseServiceImpl<StatisticsBalanceRecordPhotoMapper, StatisticsBalanceRecordPhotoEntity> implements IStatisticsBalanceRecordPhotoService {
}

15
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsBalanceRecordServiceImpl.java

@ -0,0 +1,15 @@
package com.logpm.statistics.service.impl;
import com.logpm.statistics.entity.StatisticsBalanceRecordEntity;
import com.logpm.statistics.mapper.StatisticsBalanceRecordMapper;
import com.logpm.statistics.service.IStatisticsBalanceRecordService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
@Slf4j
@Service
@AllArgsConstructor
public class StatisticsBalanceRecordServiceImpl extends BaseServiceImpl<StatisticsBalanceRecordMapper, StatisticsBalanceRecordEntity> implements IStatisticsBalanceRecordService {
}

15
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsChangesPhotoServiceImpl.java

@ -0,0 +1,15 @@
package com.logpm.statistics.service.impl;
import com.logpm.statistics.entity.StatisticsChangesPhotoEntity;
import com.logpm.statistics.mapper.StatisticsChangesPhotoMapper;
import com.logpm.statistics.service.IStatisticsChangesPhotoService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
@Slf4j
@Service
@AllArgsConstructor
public class StatisticsChangesPhotoServiceImpl extends BaseServiceImpl<StatisticsChangesPhotoMapper, StatisticsChangesPhotoEntity> implements IStatisticsChangesPhotoService {
}

21
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsChangesRecordServiceImpl.java

@ -0,0 +1,21 @@
package com.logpm.statistics.service.impl;
import com.logpm.statistics.entity.StatisticsChangesRecordEntity;
import com.logpm.statistics.mapper.StatisticsChangesRecordMapper;
import com.logpm.statistics.service.IStatisticsChangesRecordService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
@Slf4j
@Service
@AllArgsConstructor
public class StatisticsChangesRecordServiceImpl extends BaseServiceImpl<StatisticsChangesRecordMapper, StatisticsChangesRecordEntity> implements IStatisticsChangesRecordService {
@Override
public BigDecimal findChangesFeeByOrderInfoId(Long orderInfoId) {
return baseMapper.findChangesFeeByOrderInfoId(orderInfoId);
}
}

472
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsOrderInfoServiceImpl.java

@ -1,21 +1,50 @@
package com.logpm.statistics.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.logpm.basicdata.feign.IBasicdataCodeClient;
import com.logpm.statistics.dto.ChangesRecordDTO;
import com.logpm.statistics.dto.MerchantStatisticsDTO;
import com.logpm.statistics.entity.StatisticsBalanceOrderInfoEntity;
import com.logpm.statistics.entity.StatisticsChangesPhotoEntity;
import com.logpm.statistics.entity.StatisticsChangesRecordEntity;
import com.logpm.statistics.entity.StatisticsOrderInfoEntity;
import com.logpm.statistics.mapper.StatisticsOrderInfoMapper;
import com.logpm.statistics.service.IStatisticsBalanceOrderInfoService;
import com.logpm.statistics.service.IStatisticsChangesPhotoService;
import com.logpm.statistics.service.IStatisticsChangesRecordService;
import com.logpm.statistics.service.IStatisticsOrderInfoService;
import com.logpm.statistics.vo.StatisticsChangesRecordVO;
import com.logpm.statistics.vo.StatisticsOrderInfoVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.CodeNumConstant;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.system.cache.DictBizCache;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Set;
import java.math.BigDecimal;
import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
@Slf4j
@Service
@AllArgsConstructor
public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl<StatisticsOrderInfoMapper, StatisticsOrderInfoEntity> implements IStatisticsOrderInfoService {
private final IStatisticsChangesRecordService changesRecordService;
private final IStatisticsChangesPhotoService changesPhotoService;
private final IBasicdataCodeClient basicdataCodeClient;
private final IStatisticsBalanceOrderInfoService balanceOrderInfoService;
@Override
public List<StatisticsOrderInfoEntity> findListByWaybillId(Long waybillId) {
QueryWrapper<StatisticsOrderInfoEntity> queryWrapper = new QueryWrapper<>();
@ -29,4 +58,443 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl<StatisticsOr
queryWrapper.in("id",orderInfoSet);
return baseMapper.selectList(queryWrapper);
}
@Override
public IPage<StatisticsOrderInfoVO> pageList(MerchantStatisticsDTO merchantStatisticsDTO) {
IPage<Object> page = new Page<>();
page.setCurrent(merchantStatisticsDTO.getPageNum());
page.setSize(merchantStatisticsDTO.getPageSize());
return baseMapper.pageList(page,merchantStatisticsDTO);
}
@Override
public List<StatisticsChangesRecordVO> findChangesRecordList(MerchantStatisticsDTO merchantStatisticsDTO) {
Long orderInfoId = merchantStatisticsDTO.getOrderInfoId();
QueryWrapper<StatisticsChangesRecordEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("order_info_id",orderInfoId);
List<StatisticsChangesRecordEntity> list = changesRecordService.list(queryWrapper);
//获取list中所有元素的id
List<Long> changesRecordIdList = list.stream().map(StatisticsChangesRecordEntity::getId).collect(Collectors.toList());
QueryWrapper<StatisticsChangesPhotoEntity> changesPhotoEntityQueryWrapper = new QueryWrapper<>();
changesPhotoEntityQueryWrapper.in("changes_record_id",changesRecordIdList);
List<StatisticsChangesPhotoEntity> changesPhotoEntityList = changesPhotoService.list(changesPhotoEntityQueryWrapper);
//把changesPhotoEntityList中的元素通过changesRecordId为key进行分组
Map<Long, List<StatisticsChangesPhotoEntity>> groupedEntities =
changesPhotoEntityList.stream()
.collect(Collectors.groupingBy(StatisticsChangesPhotoEntity::getChangesRecordId));
List<StatisticsChangesRecordVO> ls = new ArrayList<>();
list.forEach(statisticsChangesRecordEntity -> {
StatisticsChangesRecordVO statisticsChangesRecordVO = new StatisticsChangesRecordVO();
BeanUtil.copy(statisticsChangesRecordEntity,statisticsChangesRecordVO);
List<StatisticsChangesPhotoEntity> statisticsChangesPhotoEntities = groupedEntities.get(statisticsChangesRecordEntity.getId());
statisticsChangesRecordVO.setChangesPhotoEntityList(statisticsChangesPhotoEntities);
ls.add(statisticsChangesRecordVO);
});
return ls;
}
@Override
public R addChangesRecord(ChangesRecordDTO changesRecordDTO) {
StatisticsChangesRecordEntity changesRecordEntity = new StatisticsChangesRecordEntity();
BeanUtil.copy(changesRecordDTO,changesRecordEntity);
String itemRecord = verifyValue(changesRecordEntity);
changesRecordEntity.setItemRecord(itemRecord);
changesRecordService.save(changesRecordEntity);
List<String> changesPhotoUrls = changesRecordDTO.getChangesPhotoUrls();
List<StatisticsChangesPhotoEntity> saveList = new ArrayList<>();
changesPhotoUrls.forEach(url -> {
StatisticsChangesPhotoEntity changesPhotoEntity = new StatisticsChangesPhotoEntity();
changesPhotoEntity.setUrl(url);
changesPhotoEntity.setChangesRecordId(changesRecordEntity.getId());
changesPhotoEntity.setCreateUserName(AuthUtil.getNickName());
saveList.add(changesPhotoEntity);
});
changesPhotoService.saveBatch(saveList);
//把changesRecordEntity对象中的所有BigDecimal类型属性的值求和
Long orderInfoId = changesRecordEntity.getOrderInfoId();
//重新计算订单的异动金额
updateOrderChangesFee(orderInfoId);
return R.success("新增成功");
}
@Transactional(rollbackFor = Exception.class)
@Override
public R checkBalance(MerchantStatisticsDTO merchantStatisticsDTO) {
List<Long> orderInfoIds = merchantStatisticsDTO.getOrderInfoIds();
//查询对应订单的数据
List<StatisticsOrderInfoVO> list = baseMapper.findStatementListByOrderInfoIds(orderInfoIds);
Set<String> brands = new HashSet<>();
Set<String> waybillNos = new HashSet<>();
Set<String> orderCodes = new HashSet<>();
Set<String> typeServices = new HashSet<>();
Set<String> productGoods = new HashSet<>();
Set<String> shippers = new HashSet<>();
Set<String> shipperPersons = new HashSet<>();
Set<String> shipperMobiles = new HashSet<>();
Set<String> shipperAddresses = new HashSet<>();
Set<String> consignees = new HashSet<>();
Set<String> consigneePersons = new HashSet<>();
Set<String> consigneeMobiles = new HashSet<>();
Set<String> consigneeAddresses = new HashSet<>();
Set<String> departures = new HashSet<>();
Set<String> destinations = new HashSet<>();
Set<String> departureWarehouseNames = new HashSet<>();
Set<String> destinationWarehouseNames = new HashSet<>();
Set<String> payTypes = new HashSet<>();
Set<String> payWays = new HashSet<>();
AtomicReference<Integer> totalCount = new AtomicReference<>(0);//总数量
List<BigDecimal> totalWeights = new ArrayList<>();//总重量
List<BigDecimal> totalVolumes = new ArrayList();//总体积
List<BigDecimal> totalFees = new ArrayList();
List<BigDecimal> openFees = new ArrayList();
List<BigDecimal> pickupFees = new ArrayList();//提货费
List<BigDecimal> freightFees = new ArrayList();//运费
List<BigDecimal> warehouseServiceFees = new ArrayList();//仓库服务费
List<BigDecimal> warehouseFees = new ArrayList();//仓储费
List<BigDecimal> warehouseManageFees = new ArrayList();//仓储管理费
List<BigDecimal> warehouseSortingFees = new ArrayList();//仓储分拣费
List<BigDecimal> warehouseOperatingFees = new ArrayList();//仓储操作费
List<BigDecimal> deliveryServiceFees = new ArrayList();//配送服务费
List<BigDecimal> deliveryFees = new ArrayList();//配送费
List<BigDecimal> deliveryLoadingFees = new ArrayList();//配送装卸费
List<BigDecimal> deliverySortingFees = new ArrayList();//配送分拣费
List<BigDecimal> deliveryUpfloorFees = new ArrayList();//配送上楼费
List<BigDecimal> deliveryMoveFees = new ArrayList();//配送平移费
List<BigDecimal> deliveryCrossingFees = new ArrayList();//超区费
List<BigDecimal> installFees = new ArrayList();//安装费
List<BigDecimal> quotationFees = new ArrayList();//保价费
List<BigDecimal> claimingValues = new ArrayList();//申明价值
List<BigDecimal> otherFees = new ArrayList();//其他费
List<BigDecimal> returnFees = new ArrayList();//回扣
List<BigDecimal> thirdOprationFees = new ArrayList();//三方操作费
List<BigDecimal> xPays = new ArrayList();//现付
List<BigDecimal> dPays = new ArrayList();//到付
List<BigDecimal> hPays = new ArrayList();//回付
List<BigDecimal> yPays = new ArrayList();//月结
list.forEach(statisticsOrderInfoVO -> {
brands.add(statisticsOrderInfoVO.getBrand());
waybillNos.add(statisticsOrderInfoVO.getWaybillNo());
orderCodes.add(statisticsOrderInfoVO.getOrderNo());
typeServices.add(DictBizCache.getValue(DictBizConstant.BASIC_FREIGHT_TYPE,statisticsOrderInfoVO.getTypeService()));
String goodsName = statisticsOrderInfoVO.getGoodsName();
if(goodsName.contains(",")){
String[] split = goodsName.split(",");
for (int i = 0; i < split.length; i++) {
productGoods.add(split[i]);
}
}else{
productGoods.add(goodsName);
}
shippers.add(statisticsOrderInfoVO.getShipper());
shipperPersons.add(statisticsOrderInfoVO.getShipperPerson());
shipperMobiles.add(statisticsOrderInfoVO.getShipperMobile());
shipperAddresses.add(statisticsOrderInfoVO.getShipperAddress());
consignees.add(statisticsOrderInfoVO.getConsignee());
consigneePersons.add(statisticsOrderInfoVO.getConsigneePerson());
consigneeMobiles.add(statisticsOrderInfoVO.getConsigneeMobile());
consigneeAddresses.add(statisticsOrderInfoVO.getConsigneeAddress());
departures.add(statisticsOrderInfoVO.getDeparture());
destinations.add(statisticsOrderInfoVO.getDestination());
departureWarehouseNames.add(statisticsOrderInfoVO.getDepartureWarehouseName());
destinationWarehouseNames.add(statisticsOrderInfoVO.getDestinationWarehouseName());
payTypes.add(DictBizCache.getValue(DictBizConstant.OPEN_ORDER_PAY_TYPE, statisticsOrderInfoVO.getPayType()));
payWays.add(DictBizCache.getValue(DictBizConstant.OPEN_ORDER_PAY_WAY, statisticsOrderInfoVO.getPayWay()));
totalCount.set(totalCount.get() + statisticsOrderInfoVO.getTotalcount());
totalWeights.add(statisticsOrderInfoVO.getTotalWeight());
totalVolumes.add(statisticsOrderInfoVO.getTotalVolume());
totalFees.add(statisticsOrderInfoVO.getTotalFee());
openFees.add(statisticsOrderInfoVO.getOpenFee());
pickupFees.add(statisticsOrderInfoVO.getPickupFee());
freightFees.add(statisticsOrderInfoVO.getFreightFee());
warehouseServiceFees.add(statisticsOrderInfoVO.getWarehouseServiceFee());
warehouseFees.add(statisticsOrderInfoVO.getWarehouseFee());
warehouseManageFees.add(statisticsOrderInfoVO.getWarehouseManageFee());
warehouseSortingFees.add(statisticsOrderInfoVO.getWarehouseSortingFee());
warehouseOperatingFees.add(statisticsOrderInfoVO.getWarehouseOperatingFee());
deliveryServiceFees.add(statisticsOrderInfoVO.getDeliveryServiceFee());
deliveryFees.add(statisticsOrderInfoVO.getDeliveryFee());
deliveryLoadingFees.add(statisticsOrderInfoVO.getDeliveryLoadingFee());
deliverySortingFees.add(statisticsOrderInfoVO.getDeliverySortingFee());
deliveryUpfloorFees.add(statisticsOrderInfoVO.getDeliveryUpfloorFee());
deliveryMoveFees.add(statisticsOrderInfoVO.getDeliveryMoveFee());
deliveryCrossingFees.add(statisticsOrderInfoVO.getDeliveryCrossingFee());
installFees.add(statisticsOrderInfoVO.getInstallFee());
quotationFees.add(statisticsOrderInfoVO.getQuotationFee());
claimingValues.add(statisticsOrderInfoVO.getClaimingValue());
otherFees.add(statisticsOrderInfoVO.getOtherFee());
returnFees.add(statisticsOrderInfoVO.getReturnFee());
thirdOprationFees.add(statisticsOrderInfoVO.getThirdOprationFee());
xPays.add(statisticsOrderInfoVO.getXPay());
dPays.add(statisticsOrderInfoVO.getDPay());
hPays.add(statisticsOrderInfoVO.getHPay());
yPays.add(statisticsOrderInfoVO.getYPay());
});
//对totalWeights进行求和
BigDecimal totalWeight = totalWeights.stream().reduce(BigDecimal.ZERO, BigDecimal::add);
BigDecimal totalVolume = totalVolumes.stream().reduce(BigDecimal.ZERO, BigDecimal::add);//总体积
BigDecimal totalBalanceFee = totalFees.stream().reduce(BigDecimal.ZERO, BigDecimal::add);//结算总金额 TODO 这里还需要加上售后的单子金额
BigDecimal totalFee = totalFees.stream().reduce(BigDecimal.ZERO, BigDecimal::add);
BigDecimal openFee = openFees.stream().reduce(BigDecimal.ZERO, BigDecimal::add);
BigDecimal pickupFee = pickupFees.stream().reduce(BigDecimal.ZERO, BigDecimal::add);//提货费
BigDecimal freightFee = freightFees.stream().reduce(BigDecimal.ZERO, BigDecimal::add);//运费
BigDecimal warehouseServiceFee = warehouseServiceFees.stream().reduce(BigDecimal.ZERO, BigDecimal::add);//仓库服务费
BigDecimal warehouseFee = warehouseFees.stream().reduce(BigDecimal.ZERO, BigDecimal::add);//仓储费
BigDecimal warehouseManageFee = warehouseManageFees.stream().reduce(BigDecimal.ZERO, BigDecimal::add);//仓储管理费
BigDecimal warehouseSortingFee = warehouseSortingFees.stream().reduce(BigDecimal.ZERO, BigDecimal::add);//仓储分拣费
BigDecimal warehouseOperatingFee = warehouseOperatingFees.stream().reduce(BigDecimal.ZERO, BigDecimal::add);//仓储操作费
BigDecimal deliveryServiceFee = deliveryServiceFees.stream().reduce(BigDecimal.ZERO, BigDecimal::add);//配送服务费
BigDecimal deliveryFee = deliveryFees.stream().reduce(BigDecimal.ZERO, BigDecimal::add);//配送费
BigDecimal deliveryLoadingFee = deliveryLoadingFees.stream().reduce(BigDecimal.ZERO, BigDecimal::add);//配送装卸费
BigDecimal deliverySortingFee = deliverySortingFees.stream().reduce(BigDecimal.ZERO, BigDecimal::add);//配送分拣费
BigDecimal deliveryUpfloorFee = deliveryUpfloorFees.stream().reduce(BigDecimal.ZERO, BigDecimal::add);//配送上楼费
BigDecimal deliveryMoveFee = deliveryMoveFees.stream().reduce(BigDecimal.ZERO, BigDecimal::add);//配送平移费
BigDecimal deliveryCrossingFee = deliveryCrossingFees.stream().reduce(BigDecimal.ZERO, BigDecimal::add);//超区费
BigDecimal installFee = installFees.stream().reduce(BigDecimal.ZERO, BigDecimal::add);//安装费
BigDecimal quotationFee = quotationFees.stream().reduce(BigDecimal.ZERO, BigDecimal::add);//保价费
BigDecimal claimingValue = claimingValues.stream().reduce(BigDecimal.ZERO, BigDecimal::add);//申明价值
BigDecimal otherFee = otherFees.stream().reduce(BigDecimal.ZERO, BigDecimal::add);//其他费
BigDecimal returnFee = returnFees.stream().reduce(BigDecimal.ZERO, BigDecimal::add);//回扣
BigDecimal thirdOprationFee = thirdOprationFees.stream().reduce(BigDecimal.ZERO, BigDecimal::add);//三方操作费
BigDecimal xPay = xPays.stream().reduce(BigDecimal.ZERO, BigDecimal::add);//现付
BigDecimal dPay = dPays.stream().reduce(BigDecimal.ZERO, BigDecimal::add);//到付
BigDecimal hPay = hPays.stream().reduce(BigDecimal.ZERO, BigDecimal::add);//回付
BigDecimal yPay = yPays.stream().reduce(BigDecimal.ZERO, BigDecimal::add);//月结
StatisticsBalanceOrderInfoEntity statisticsBalanceOrderInfoEntity = new StatisticsBalanceOrderInfoEntity();
String balanceOrder = basicdataCodeClient.getCodeByType(CodeNumConstant.BALANCE_ORDER, "BALANCE_ORDER", "");
statisticsBalanceOrderInfoEntity.setBalanceOrderNo(balanceOrder);
statisticsBalanceOrderInfoEntity.setBrand(String.join(",",brands));
statisticsBalanceOrderInfoEntity.setWaybillNo(String.join(",",waybillNos));
statisticsBalanceOrderInfoEntity.setOrderCode(String.join(",",orderCodes));
statisticsBalanceOrderInfoEntity.setTypeService(String.join(",",typeServices));
statisticsBalanceOrderInfoEntity.setProductGoods(String.join(",",productGoods));
statisticsBalanceOrderInfoEntity.setTotalCount(totalCount.get());
statisticsBalanceOrderInfoEntity.setTotalWeight(totalWeight);
statisticsBalanceOrderInfoEntity.setTotalVolume(totalVolume);
statisticsBalanceOrderInfoEntity.setShipper(String.join(",",shippers));
statisticsBalanceOrderInfoEntity.setShipperPerson(String.join(",",shipperPersons));
statisticsBalanceOrderInfoEntity.setShipperMobile(String.join(",",shipperMobiles));
statisticsBalanceOrderInfoEntity.setShipperAddress(String.join(",",shipperAddresses));
statisticsBalanceOrderInfoEntity.setConsignee(String.join(",",consignees));
statisticsBalanceOrderInfoEntity.setConsigneePerson(String.join(",",consigneePersons));
statisticsBalanceOrderInfoEntity.setConsigneeMobile(String.join(",",consigneeMobiles));
statisticsBalanceOrderInfoEntity.setConsigneeAddress(String.join(",",consigneeAddresses));
statisticsBalanceOrderInfoEntity.setDeparture(String.join(",",departures));
statisticsBalanceOrderInfoEntity.setDestination(String.join(",",destinations));
statisticsBalanceOrderInfoEntity.setDepartureWarehouseName(String.join(",",departureWarehouseNames));
statisticsBalanceOrderInfoEntity.setDestinationWarehouseName(String.join(",",destinationWarehouseNames));
statisticsBalanceOrderInfoEntity.setPayType(String.join(",",payTypes));
statisticsBalanceOrderInfoEntity.setPayWay(String.join(",",payWays));
statisticsBalanceOrderInfoEntity.setIsAftersale(0);
statisticsBalanceOrderInfoEntity.setAftersalesFee(BigDecimal.ZERO);
statisticsBalanceOrderInfoEntity.setTotalBalanceFee(totalBalanceFee);
statisticsBalanceOrderInfoEntity.setTotalFee(totalFee);
statisticsBalanceOrderInfoEntity.setOpenFee(openFee);
statisticsBalanceOrderInfoEntity.setPickupFee(pickupFee);
statisticsBalanceOrderInfoEntity.setFreightFee(freightFee);
statisticsBalanceOrderInfoEntity.setWarehouseServiceFee(warehouseServiceFee);
statisticsBalanceOrderInfoEntity.setWarehouseFee(warehouseFee);
statisticsBalanceOrderInfoEntity.setWarehouseManageFee(warehouseManageFee);
statisticsBalanceOrderInfoEntity.setWarehouseSortingFee(warehouseSortingFee);
statisticsBalanceOrderInfoEntity.setWarehouseOperatingFee(warehouseOperatingFee);
statisticsBalanceOrderInfoEntity.setDeliveryServiceFee(deliveryServiceFee);
statisticsBalanceOrderInfoEntity.setDeliveryFee(deliveryFee);
statisticsBalanceOrderInfoEntity.setDeliveryLoadingFee(deliveryLoadingFee);
statisticsBalanceOrderInfoEntity.setDeliverySortingFee(deliverySortingFee);
statisticsBalanceOrderInfoEntity.setDeliveryUpfloorFee(deliveryUpfloorFee);
statisticsBalanceOrderInfoEntity.setDeliveryMoveFee(deliveryMoveFee);
statisticsBalanceOrderInfoEntity.setDeliveryCrossingFee(deliveryCrossingFee);
statisticsBalanceOrderInfoEntity.setInstallFee(installFee);
statisticsBalanceOrderInfoEntity.setQuotationFee(quotationFee);
statisticsBalanceOrderInfoEntity.setClaimingValue(claimingValue);
statisticsBalanceOrderInfoEntity.setOtherFee(otherFee);
statisticsBalanceOrderInfoEntity.setReturnFee(returnFee);
statisticsBalanceOrderInfoEntity.setThirdOprationFee(thirdOprationFee);
statisticsBalanceOrderInfoEntity.setXPay(xPay);
statisticsBalanceOrderInfoEntity.setDPay(dPay);
statisticsBalanceOrderInfoEntity.setHPay(hPay);
statisticsBalanceOrderInfoEntity.setYPay(yPay);
statisticsBalanceOrderInfoEntity.setBalanceStatus(0);
statisticsBalanceOrderInfoEntity.setHasBalanceFee(BigDecimal.ZERO);
statisticsBalanceOrderInfoEntity.setNoBalanceFee(BigDecimal.ZERO);
statisticsBalanceOrderInfoEntity.setAbnormalBalanceStatus(0);
statisticsBalanceOrderInfoEntity.setAbnormalBalanceFee(BigDecimal.ZERO);
balanceOrderInfoService.save(statisticsBalanceOrderInfoEntity);
//订单的结算单号生成
List<StatisticsOrderInfoEntity> statisticsOrderInfoEntities = baseMapper.selectList(new QueryWrapper<StatisticsOrderInfoEntity>().lambda().in(StatisticsOrderInfoEntity::getId, orderInfoIds));
statisticsOrderInfoEntities.forEach(statisticsOrderInfoEntity -> {
statisticsOrderInfoEntity.setBalanceOrderNo(statisticsBalanceOrderInfoEntity.getBalanceOrderNo());
statisticsOrderInfoEntity.setBalanceOrderId(statisticsBalanceOrderInfoEntity.getId());
statisticsOrderInfoEntity.setConfirmStatisticsTime(new Date());
statisticsOrderInfoEntity.setConfirmStatisticsOrder(1);
statisticsOrderInfoEntity.setConfirmStatisticsUserName(AuthUtil.getNickName());
});
updateBatchById(statisticsOrderInfoEntities);
return R.success("确认成功");
}
private void updateOrderChangesFee(Long orderInfoId) {
StatisticsOrderInfoEntity statisticsOrderInfoEntity = baseMapper.selectById(orderInfoId);
if(Objects.isNull(statisticsOrderInfoEntity)){
log.warn("#############updateOrderChangesFee: 订单信息不存在 statisticsOrderInfoEntity={}",statisticsOrderInfoEntity);
throw new CustomerException(405,"订单信息不存在");
}
BigDecimal changesFee = changesRecordService.findChangesFeeByOrderInfoId(orderInfoId);
statisticsOrderInfoEntity.setChangesFee(changesFee);
baseMapper.updateById(statisticsOrderInfoEntity);
}
private String verifyValue(StatisticsChangesRecordEntity changesRecordEntity) {
StringBuilder stringBuilder = new StringBuilder();
BigDecimal totalFee = BigDecimal.ZERO;
BigDecimal pickupFee = changesRecordEntity.getPickupFee();
if(pickupFee.compareTo(BigDecimal.ZERO) != 0){
totalFee = totalFee.add(pickupFee);
stringBuilder.append("提货费变更").append(pickupFee.toPlainString()).append(";");
}
BigDecimal freightFee = changesRecordEntity.getFreightFee();
if(freightFee.compareTo(BigDecimal.ZERO) != 0){
totalFee = totalFee.add(freightFee);
stringBuilder.append("运费变更").append(freightFee.toPlainString()).append(";");
}
BigDecimal warehouseFee = changesRecordEntity.getWarehouseFee();
if(warehouseFee.compareTo(BigDecimal.ZERO) != 0){
totalFee = totalFee.add(warehouseFee);
stringBuilder.append("仓储费变更").append(warehouseFee.toPlainString()).append(";");
}
BigDecimal warehouseManageFee = changesRecordEntity.getWarehouseManageFee();
if(warehouseManageFee.compareTo(BigDecimal.ZERO) != 0){
totalFee = totalFee.add(warehouseManageFee);
stringBuilder.append("仓储管理费变更").append(warehouseManageFee.toPlainString()).append(";");
}
BigDecimal warehouseSortingFee = changesRecordEntity.getWarehouseSortingFee();
if(warehouseSortingFee.compareTo(BigDecimal.ZERO) != 0){
totalFee = totalFee.add(warehouseSortingFee);
stringBuilder.append("仓储分拣费变更").append(warehouseSortingFee.toPlainString()).append(";");
}
BigDecimal warehouseOperatingFee = changesRecordEntity.getWarehouseOperatingFee();
if(warehouseOperatingFee.compareTo(BigDecimal.ZERO) != 0){
totalFee = totalFee.add(warehouseOperatingFee);
stringBuilder.append("仓储操作费变更").append(warehouseOperatingFee.toPlainString()).append(";");
}
BigDecimal deliveryFee = changesRecordEntity.getDeliveryFee();
if(deliveryFee.compareTo(BigDecimal.ZERO) != 0){
totalFee = totalFee.add(deliveryFee);
stringBuilder.append("配送费变更").append(deliveryFee.toPlainString()).append(";");
}
BigDecimal deliveryLoadingFee = changesRecordEntity.getDeliveryLoadingFee();
if(deliveryLoadingFee.compareTo(BigDecimal.ZERO) != 0){
totalFee = totalFee.add(deliveryLoadingFee);
stringBuilder.append("配送装卸费变更").append(deliveryLoadingFee.toPlainString()).append(";");
}
BigDecimal deliverySortingFee = changesRecordEntity.getDeliverySortingFee();
if(deliverySortingFee.compareTo(BigDecimal.ZERO) != 0){
totalFee = totalFee.add(deliverySortingFee);
stringBuilder.append("配送分拣费变更").append(deliverySortingFee.toPlainString()).append(";");
}
BigDecimal deliveryUpfloorFee = changesRecordEntity.getDeliveryUpfloorFee();
if(deliveryUpfloorFee.compareTo(BigDecimal.ZERO) != 0){
totalFee = totalFee.add(deliveryUpfloorFee);
stringBuilder.append("配送上楼费变更").append(deliveryUpfloorFee.toPlainString()).append(";");
}
BigDecimal deliveryMoveFee = changesRecordEntity.getDeliveryMoveFee();
if(deliveryMoveFee.compareTo(BigDecimal.ZERO) != 0){
totalFee = totalFee.add(deliveryMoveFee);
stringBuilder.append("配送平移费变更").append(deliveryMoveFee.toPlainString()).append(";");
}
BigDecimal installFee = changesRecordEntity.getInstallFee();
if(installFee.compareTo(BigDecimal.ZERO) != 0){
totalFee = totalFee.add(installFee);
stringBuilder.append("安装费变更").append(installFee.toPlainString()).append(";");
}
BigDecimal quotationFee = changesRecordEntity.getQuotationFee();
if(quotationFee.compareTo(BigDecimal.ZERO) != 0){
totalFee = totalFee.add(quotationFee);
stringBuilder.append("保价费变更").append(quotationFee.toPlainString()).append(";");
}
BigDecimal claimingValue = changesRecordEntity.getClaimingValue();
if(claimingValue.compareTo(BigDecimal.ZERO) != 0){
totalFee = totalFee.add(claimingValue);
stringBuilder.append("申明价值变更").append(claimingValue.toPlainString()).append(";");
}
BigDecimal otherFee = changesRecordEntity.getOtherFee();
if(otherFee.compareTo(BigDecimal.ZERO) != 0){
totalFee = totalFee.add(otherFee);
stringBuilder.append("其他费变更").append(otherFee.toPlainString()).append(";");
}
BigDecimal returnFee = changesRecordEntity.getReturnFee();
if(returnFee.compareTo(BigDecimal.ZERO) != 0){
totalFee = totalFee.add(returnFee);
stringBuilder.append("回扣变更").append(returnFee.toPlainString()).append(";");
}
BigDecimal thirdOprationFee = changesRecordEntity.getThirdOprationFee();
if(thirdOprationFee.compareTo(BigDecimal.ZERO) != 0){
totalFee = totalFee.add(thirdOprationFee);
stringBuilder.append("第三方操作费变更").append(thirdOprationFee.toPlainString()).append(";");
}
changesRecordEntity.setTotalFee(totalFee);
return stringBuilder.toString();
}
}

10
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsWaybillInfoServiceImpl.java

@ -1,15 +1,25 @@
package com.logpm.statistics.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.logpm.statistics.dto.MerchantStatisticsDTO;
import com.logpm.statistics.entity.StatisticsChangesRecordEntity;
import com.logpm.statistics.entity.StatisticsWaybillInfoEntity;
import com.logpm.statistics.mapper.StatisticsWaybillInfoMapper;
import com.logpm.statistics.service.IStatisticsWaybillInfoService;
import com.logpm.statistics.vo.StatisticsChangesRecordVO;
import com.logpm.statistics.vo.StatisticsWaybillInfoVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
import java.util.List;
@Slf4j
@Service
@AllArgsConstructor
public class StatisticsWaybillInfoServiceImpl extends BaseServiceImpl<StatisticsWaybillInfoMapper, StatisticsWaybillInfoEntity> implements IStatisticsWaybillInfoService {
}

40
blade-service/logpm-statisticsdata/src/main/resources/application-prod.yml

@ -10,6 +10,32 @@ server:
# password: ${blade.datasource.prod.password}
spring:
#rabbitmq配置
rabbitmq:
host: 172.16.128.145
port: 5672
username: admin
password: Slwk@123654
#虚拟host 可以不设置,使用server默认host
virtual-host: /
#确认消息已发送到队列(Queue)
publisher-returns: true
publisher-confirm-type: correlated
# 手动提交消息
listener:
simple:
acknowledge-mode: auto
default-requeue-rejected: false
retry:
enabled: true # 开启消费者失败重试
initial-interval: 1000 # 初识的失败等待时长为1秒
multiplier: 1 # 失败的等待时长倍数,下次等待时长 = multiplier * last-interval
max-attempts: 3 # 最大重试次数
stateless: true # true无状态;false有状态。如果业务中包含事务,这里改为false
direct:
acknowledge-mode: manual
template:
mandatory: true
#排除DruidDataSourceAutoConfigure
autoconfigure:
exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure,com.alibaba.cloud.seata.feign.SeataFeignClientAutoConfiguration
@ -22,10 +48,10 @@ spring:
primary: master
datasource:
master:
url: ${blade.datasource.factory.master.url}
username: ${blade.datasource.factory.master.username}
password: ${blade.datasource.factory.master.password}
slave:
url: ${blade.datasource.factory.slave.url}
username: ${blade.datasource.factory.slave.username}
password: ${blade.datasource.factory.slave.password}
url: ${blade.datasource.statisticsdata.master.url}
username: ${blade.datasource.statisticsdata.master.username}
password: ${blade.datasource.statisticsdata.master.password}
627683:
url: ${blade.datasource.statisticsdata.627683.url}
username: ${blade.datasource.statisticsdata.627683.username}
password: ${blade.datasource.statisticsdata.627683.password}

44
blade-service/logpm-statisticsdata/src/main/resources/application-test.yml

@ -10,6 +10,32 @@ server:
# password: ${blade.datasource.test.password}
spring:
#rabbitmq配置
rabbitmq:
host: 192.168.2.110
port: 5672
username: admin
password: Slwk@123654
#虚拟host 可以不设置,使用server默认host
virtual-host: /
#确认消息已发送到队列(Queue)
publisher-returns: true
publisher-confirm-type: correlated
# 手动提交消息
listener:
simple:
acknowledge-mode: auto
default-requeue-rejected: false
retry:
enabled: true # 开启消费者失败重试
initial-interval: 1000 # 初识的失败等待时长为1秒
multiplier: 1 # 失败的等待时长倍数,下次等待时长 = multiplier * last-interval
max-attempts: 3 # 最大重试次数
stateless: true # true无状态;false有状态。如果业务中包含事务,这里改为false
direct:
acknowledge-mode: manual
template:
mandatory: true
#排除DruidDataSourceAutoConfigure
autoconfigure:
exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure,com.alibaba.cloud.seata.feign.SeataFeignClientAutoConfiguration
@ -22,10 +48,14 @@ spring:
primary: master
datasource:
master:
url: ${blade.datasource.factory.master.url}
username: ${blade.datasource.factory.master.username}
password: ${blade.datasource.factory.master.password}
slave:
url: ${blade.datasource.factory.slave.url}
username: ${blade.datasource.factory.slave.username}
password: ${blade.datasource.factory.slave.password}
url: ${blade.datasource.statisticsdata.master.url}
username: ${blade.datasource.statisticsdata.master.username}
password: ${blade.datasource.statisticsdata.master.password}
627683:
url: ${blade.datasource.statisticsdata.627683.url}
username: ${blade.datasource.statisticsdata.627683.username}
password: ${blade.datasource.statisticsdata.627683.password}
695224:
url: ${blade.datasource.statisticsdata.695224.url}
username: ${blade.datasource.statisticsdata.695224.username}
password: ${blade.datasource.statisticsdata.695224.password}

11
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklineAdvanceClient.java

@ -8,6 +8,8 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
@Slf4j
@ApiIgnore()
@RestController
@ -32,4 +34,13 @@ public class TrunklineAdvanceClient implements ITrunklineAdvanceClient{
.last("limit 1");
return advanceService.getOne(queryWrapper);
}
@Override
public List<TrunklineAdvanceEntity> findListByIds(List<Long> collect) {
return advanceService.findListByIds(collect);
}
}

8
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklineAdvanceDetailClient.java

@ -2,6 +2,7 @@ package com.logpm.trunkline.feign;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.service.ITrunklineAdvanceDetailService;
import com.logpm.trunkline.vo.TrunklineAdvanceDetailVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RestController;
@ -21,4 +22,11 @@ public class TrunklineAdvanceDetailClient implements ITrunklineAdvanceDetailClie
public void addAdvanceBatch(List<TrunklineAdvanceDetailEntity> advanceDetailEntities) {
advanceDetailService.saveBatch(advanceDetailEntities);
}
@Override
public List<TrunklineAdvanceDetailVO> findListByAdvanceIds(List<Long> collect) {
return advanceDetailService.findAdvanceDetailVoByAdvanceIds(collect);
}
}

10
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklineWaybillOrderClient.java

@ -1,5 +1,6 @@
package com.logpm.trunkline.feign;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.logpm.trunkline.entity.TrunklineWaybillOrderEntity;
import com.logpm.trunkline.service.ITrunklineWaybillOrderService;
@ -34,4 +35,13 @@ public class TrunklineWaybillOrderClient implements ITrunklineWaybillOrderClient
}
return trunklineWaybillOrderEntity.getId();
}
@Override
public List<TrunklineWaybillOrderEntity> findListByWaybillIds(List<Long> waybillIds) {
LambdaQueryWrapper<TrunklineWaybillOrderEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.in(TrunklineWaybillOrderEntity::getWaybillId,waybillIds);
return waybillOrderService.list(lambdaQueryWrapper);
}
}

32
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklineWaybillPackageClient.java

@ -0,0 +1,32 @@
package com.logpm.trunkline.feign;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.logpm.trunkline.entity.TrunklineWaybillPackageEntity;
import com.logpm.trunkline.service.ITrunklineWaybillPackageService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
@Slf4j
@ApiIgnore()
@RestController
@AllArgsConstructor
public class TrunklineWaybillPackageClient implements ITrunklineWaybillPackageClient{
private final ITrunklineWaybillPackageService trunklineWaybillPackageService;
@Override
public List<TrunklineWaybillPackageEntity> findListByWaybillIds(List<Long> waybillIds) {
LambdaQueryWrapper<TrunklineWaybillPackageEntity> lambdaQueryWrapper =new LambdaQueryWrapper<>();
lambdaQueryWrapper.in(TrunklineWaybillPackageEntity::getWaybillId,waybillIds);
trunklineWaybillPackageService.list(lambdaQueryWrapper);
return trunklineWaybillPackageService.list(lambdaQueryWrapper);
}
@Override
public void addEntity(TrunklineWaybillPackageEntity trunklineWaybillPackageEntity) {
trunklineWaybillPackageService.save(trunklineWaybillPackageEntity);
}
}

1
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.xml

@ -33,6 +33,7 @@
left join logpm_trunkline_billlading_line ltbl on ltbl.billlading_id = ltb.id and ltbl.is_deleted = 0
left join logpm_trunkline_billlading_waybill ltbw on ltbw.billlading_id = ltb.id and ltbw.waybill_no != '————'
where ltb.is_deleted = 0
and ltb.billlading_status != 5
<if test="param.warehouseId != null ">
and ltb.warehouse_id = #{param.warehouseId}
</if>

17
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml

@ -102,6 +102,7 @@
from logpm_trunkline_cars_load ltcl
left join logpm_trunkline_cars_load_line ltcll on ltcll.load_id = ltcl.id
where ltcl.is_deleted = 0
and ltcl.load_status != '100'
and ltcl.load_type != '4'
<if test="param.warehouseId != null" >
and ltcl.end_warehouse_ids like concat('%',#{param.warehouseId},'%')
@ -376,6 +377,12 @@
<if test="param.type != null and param.type == 2">
and ltcl.load_status != '0'
</if>
<if test="param.startTime != null">
and ltcl.create_time &gt;= #{param.startTime}
</if>
<if test="param.endTime != null">
and ltcl.create_time &lt;= #{param.endTime}
</if>
order by ltcl.create_time desc
</select>
@ -383,13 +390,13 @@
select *
from logpm_trunkline_cars_load ltcl
where ltcl.is_deleted = 0
and ltcl.load_type != '4'
and ltcl.load_type != '4'
and ltcl.start_warehouse_id = #{param.warehouseId}
<if test="param.startDate != null and param.startDate != ''">
and ltcl.create_time &gt;= #{param.startDate}
<if test="param.startTime != null ">
and ltcl.create_time &gt;= #{param.startTime}
</if>
<if test="param.endDate != null and param.endDate != ''">
and ltcl.create_time &lt;= #{param.endDate}
<if test="param.endTime != null ">
and ltcl.create_time &lt;= #{param.endTime}
</if>
<if test="param.type != null and param.type == 1">
and ltcl.load_status = '0'

12
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderAsyncServiceImpl.java

@ -342,6 +342,7 @@ public class OpenOrderAsyncServiceImpl implements IOpenOrderAsyncService {
Integer totalCount = waybillEntity.getTotalCount();
//干线价格
BigDecimal pickupFee = waybillEntity.getPickupFee();
BigDecimal pickupPrice = pickupFee.divide(new BigDecimal(totalCount), 2, RoundingMode.HALF_UP);
BigDecimal installFee = waybillEntity.getInstallFee();
@ -599,17 +600,6 @@ public class OpenOrderAsyncServiceImpl implements IOpenOrderAsyncService {
if(waybillType.equals(1)){
//订制品
List<TrunklineAdvanceDetailVO> list = advanceDetailService.findAdvanceDetailVoByAdvanceIds(advanceIds);
//把list按goodsName分组,并统计一个count,转成一个map
// Map<String, Integer> countMap = list.stream()
// .collect(Collectors.toMap(TrunklineAdvanceDetailVO::getGoodsName, TrunklineAdvanceDetailVO::getQuantity, Integer::sum));
// countMap.keySet().forEach(goodsName -> {
// WarehouseWayBillDetail warehouseWayBillDetail = detailsMap.get(goodsName);
//
//
//
// });
List<JSONObject> jsonList = new ArrayList<>();
list.forEach(advanceDetailVO -> {

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java

@ -288,7 +288,7 @@ public class TrunklineAdvanceDetailServiceImpl extends BaseServiceImpl<Trunkline
public R findOrderDetails(OrderDetailsDTO orderDetailsDTO) {
//判断orderDetailsDTO中的订单号 运单号 包件码 服务号 客户车次号至少有一个有值
if(StringUtil.isBlank(orderDetailsDTO.getOrderCode()) && StringUtil.isBlank(orderDetailsDTO.getWaybillNo()) && StringUtil.isBlank(orderDetailsDTO.getOrderPackageCode()) && StringUtil.isBlank(orderDetailsDTO.getServiceNumber()) && StringUtil.isBlank(orderDetailsDTO.getTrunklineCarsNo())){
if(!StringUtil.isBlank(orderDetailsDTO.getOrderCode()) || !StringUtil.isBlank(orderDetailsDTO.getWaybillNo()) || !StringUtil.isBlank(orderDetailsDTO.getOrderPackageCode()) || !StringUtil.isBlank(orderDetailsDTO.getServiceNumber()) || !StringUtil.isBlank(orderDetailsDTO.getTrunklineCarsNo())){
return R.fail("订单号 运单号 包件码 服务号 客户车次号至少有一个有值");
}

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

@ -123,7 +123,7 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
stockArticleEntity.setWaybillNumber(waybillNo);
stockArticleEntity.setTotalNumber(total);
stockArticleEntity.setHandQuantity(0);
stockArticleEntity.setTenantId(TenantNum.HUITONGCODE);// 对应租户ID
// stockArticleEntity.setTenantId(TenantNum.HUITONGCODE);// 对应租户ID
stockArticleEntity.setWarehouse(warehouseEntity.getName());
stockArticleEntity.setWarehouseId(warehouseId);
stockArticleEntity.setBrand(advanceEntity.getBrand());
@ -239,6 +239,7 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
parcelList.setTenantId(tenantId);
parcelList.setWarehouse(warehouseEntity.getName());
parcelList.setWarehouseId(warehouseId);
parcelList.setIsTransfer(1);
String waybillNo = advanceEntity.getWaybillNo();
if(StringUtil.isNotBlank(waybillNo)){
WarehouseWaybillEntity waybillEntity = warehouseWaybillClient.findByWaybillNo(waybillNo);
@ -247,8 +248,12 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
parcelList.setWaybillNumber(waybillEntity.getWaybillNo());
parcelList.setSendWarehouseId(waybillEntity.getDepartureWarehouseId());
parcelList.setSendWarehouseName(waybillEntity.getDepartureWarehouseName());
parcelList.setAcceptWarehouseId(waybillEntity.getDestinationWarehouseId());
Long destinationWarehouseId = waybillEntity.getDestinationWarehouseId();
parcelList.setAcceptWarehouseId(destinationWarehouseId);
parcelList.setAcceptWarehouseName(waybillEntity.getDestinationWarehouseName());
if(warehouseId.equals(destinationWarehouseId)){
parcelList.setIsTransfer(0);
}
}
}
parcelList.setConditions(1);
@ -260,7 +265,7 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
parcelList.setStockArticleId(orderId);
parcelList.setOrderCode(orderCode);
parcelList.setServiceNumber(advanceDetailEntity.getServiceNum());
parcelList.setIsTransfer(1);
parcelList.setAdvanceId(advanceId);
Long materialId = advanceDetailEntity.getMaterialId();

25
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

@ -30,7 +30,6 @@ import com.logpm.factorydata.enums.BrandEnums;
import com.logpm.factorydata.feign.IFactoryDataClient;
import com.logpm.factorydata.util.FactoryDataMessageSender;
import com.logpm.factorydata.vo.NodePushMsg;
import com.logpm.factorydata.vo.SendMsg;
import com.logpm.trunkline.bean.Resp;
import com.logpm.trunkline.dto.*;
import com.logpm.trunkline.entity.*;
@ -1697,6 +1696,10 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
page.setCurrent(loadCarsDTO.getPageNum());
page.setSize(loadCarsDTO.getPageSize());
loadCarsDTO.setStartTime(CommonUtil.getStartByDateStr(loadCarsDTO.getStartDate()));
loadCarsDTO.setEndTime(CommonUtil.getEndByDateStr(loadCarsDTO.getEndDate()));
IPage<TripartiteTransferVO> pageList = baseMapper.tripartiteTransferPageList(page, loadCarsDTO);
return pageList;
}
@ -2038,10 +2041,10 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
throw new CustomerException(400, "三方中转计划不存在");
}
String loadStatus = carsLoadEntity.getLoadStatus();
if (!"40".equals(loadStatus)) {
log.warn("#############settlementCars: 三方中转计划还未到达 loadStatus={}", loadStatus);
throw new CustomerException(400, "三方中转计划还未到达");
}
// if (!"40".equals(loadStatus)) {
// log.warn("#############settlementCars: 三方中转计划还未到达 loadStatus={}", loadStatus);
// throw new CustomerException(400, "三方中转计划还未到达");
// }
Long nowWarehouseId = carsLoadEntity.getNowWarehouseId();
if (!nowWarehouseId.equals(warehouseId)) {
log.warn("#############settlementCars: 暂未有权限进行操作 nowWarehouseId={} warehouseId={}", nowWarehouseId, warehouseId);
@ -2563,8 +2566,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Date start = CommonUtil.getStartByDateStr(loadCarsDTO.getStartDate());
Date end = CommonUtil.getStartByDateStr(loadCarsDTO.getEndDate());
loadCarsDTO.setStartDate(CommonUtil.dateToStringGeneral(start));
loadCarsDTO.setEndDate(CommonUtil.dateToStringGeneral(end));
loadCarsDTO.setStartTime(start);
loadCarsDTO.setEndTime(end);
IPage<TrunklineCarsLoadVO> pageList = baseMapper.carsLoadPageList(page, loadCarsDTO);
return R.data(pageList);
@ -5470,6 +5473,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}
Long trayId = null;
Integer isData = 0;
String trayName = null;
String trayCode = null;
String orderCode = null;
@ -5581,6 +5585,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
trunklineCarsLoadScanEntity.setUnloadTime(new Date());
trunklineCarsLoadScanService.save(trunklineCarsLoadScanEntity);
isData = 1;
loadScanId = trunklineCarsLoadScanEntity.getId();
//
@ -5686,7 +5691,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
orderCode = carsLoadScanEntity.getOrderCode();
Long loadScanId = carsLoadScanEntity.getId();
Long fromWarehouseId = carsLoadScanEntity.getFromWarehouseId();
Integer isData = carsLoadScanEntity.getIsData();
isData = carsLoadScanEntity.getIsData();
Integer isAbnormal = 0;
if (warehouseId.equals(finalNodeId)) {
carsLoadScanEntity.setUnloadAbnormal(0);
@ -5812,6 +5817,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity.setUnloadUserName(AuthUtil.getNickName());
carsLoadScanEntity.setUnloadTime(new Date());
carsLoadScanEntity.setIsData(1);
isData = 1;
trunklineCarsLoadScanService.updateById(carsLoadScanEntity);
} else {
DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByOrderPackageCodeAndStatus(orderPackageCode);
@ -5875,6 +5881,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
log.warn("#########3卸车存入日志失败");
}
if(isData == 0){
return Resp.scanFail("卸车成功","系统无数据");
}
return R.success("卸车成功");
}

8
blade-service/logpm-trunkline/src/main/resources/application-dev.yml

@ -69,12 +69,12 @@ spring:
url: ${blade.datasource.trunkline.627683.url}
username: ${blade.datasource.trunkline.627683.username}
password: ${blade.datasource.trunkline.627683.password}
703923:
703623:
druid:
#独立校验配置
validation-query: select 1
#oracle校验
#validation-query: select 1 from dual
url: ${blade.datasource.trunkline.703923.url}
username: ${blade.datasource.trunkline.703923.username}
password: ${blade.datasource.trunkline.703923.password}
url: ${blade.datasource.trunkline.703623.url}
username: ${blade.datasource.trunkline.703623.username}
password: ${blade.datasource.trunkline.703623.password}

32
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseWaybillController.java

@ -28,6 +28,7 @@ import com.logpm.warehouse.dto.WarehouseWaybillDTO;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.excel.WarehouseWaybillExcel;
import com.logpm.warehouse.service.IWarehouseWaybillService;
import com.logpm.warehouse.vo.ExportWarehouseWaybillVO;
import com.logpm.warehouse.vo.WarehouseWaybillVO;
import com.logpm.warehouse.wrapper.WarehouseWaybillWrapper;
import io.swagger.annotations.Api;
@ -260,6 +261,37 @@ public class WarehouseWaybillController extends BladeController {
}
}
@ResponseBody
@PostMapping("/exportWaybillList")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "导出运单列表", notes = "传入waybillDTO")
public void exportWaybillList(@RequestBody WarehouseWaybillDTO waybillDTO, HttpServletResponse response) {
String method = "############exportWaybillList: ";
log.info(method + "请求参数{}", waybillDTO);
try{
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
throw new CustomerException(403,"仓库信息为空");
}
waybillDTO.setWarehouseId(myCurrentWarehouse.getId());
List<ExportWarehouseWaybillVO> list = warehouseWaybillService.exportWaybillList(waybillDTO);
//导出ls
ExcelUtil.export(response, "运单列表"+myCurrentWarehouse.getName(), "运单列表", list, ExportWarehouseWaybillVO.class);
}catch (CustomerException e){
log.error(e.message,e);
throw new CustomerException(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常",e);
throw new CustomerException(500,"系统异常");
}
}
@ResponseBody
@PostMapping("/pageFinanceWaybillList")
@ApiOperationSupport(order = 1)

5
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseWaybillClient.java

@ -94,6 +94,11 @@ public class WarehouseWaybillClient implements IWarehouseWaybillClient {
return warehouseWaybillService.findFreezeOrAbolishByWaybillNos(waybillNos);
}
@Override
public List<WarehouseWaybillEntity> findWaybillBilllByWaybillNos(List<String> waybillNos) {
return warehouseWaybillService.findWaybillBilllByWaybillNos(waybillNos);
}
@Override
public void updateWaybillFreezeStatusByWaybillIds(List<Long> waybillIds) {

5
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseWaybillDetailClient.java

@ -49,4 +49,9 @@ public class WarehouseWaybillDetailClient implements IWarehouseWaybillDetailClie
public void addEntity(WarehouseWayBillDetail warehouseWayBillDetail) {
warehouseWayBillDetailService.save(warehouseWayBillDetail);
}
@Override
public List<WarehouseWayBillDetail> findByWaybillIds(List<Long> waybillIds) {
return warehouseWayBillDetailService.findByWaybillIds(waybillIds);
}
}

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

@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.warehouse.dto.WarehouseWaybillDTO;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.vo.ExportWarehouseWaybillVO;
import com.logpm.warehouse.vo.WarehouseWaybillVO;
import org.apache.ibatis.annotations.Param;
@ -62,4 +63,9 @@ public interface WarehouseWaybillMapper extends BaseMapper<WarehouseWaybillEntit
WarehouseWaybillEntity findWaybillEntityByOrderPackageCode(@Param("orderPackageCode") String orderPackageCode);
IPage<WarehouseWaybillVO> pageFinanceWaybillList(IPage<Object> page, @Param("param") WarehouseWaybillDTO waybillDTO);
List<WarehouseWaybillEntity> findWaybillBilllByWaybillNos(@Param("waybillNos") List<String> waybillNos);
List<ExportWarehouseWaybillVO> exportWaybillList(@Param("param") WarehouseWaybillDTO waybillDTO);
}

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

@ -463,6 +463,154 @@
order by lww.create_time desc
</select>
<select id="findWaybillBilllByWaybillNos" resultType="com.logpm.warehouse.entity.WarehouseWaybillEntity">
select *
from logpm_warehouse_waybill
where 1=1
and abolish_status = 0
and freeze_status = 0
and waybill_no in
<foreach collection="waybillNos" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<select id="exportWaybillList" resultType="com.logpm.warehouse.vo.ExportWarehouseWaybillVO">
select lww.*
from logpm_warehouse_waybill lww
left join (select ltwt.waybill_id,GROUP_CONCAT(DISTINCT ltwt.warehouse_id) warehouse_ids from logpm_trunkline_waybill_track ltwt group by ltwt.waybill_id) t on t.waybill_id = lww.id
where lww.is_deleted = 0
<if test="param.waybillNoList != null">
and lww.waybill_no not in
<foreach collection="param.waybillNoList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.warehouseId != null">
and Locate(#{param.warehouseId},t.warehouse_ids) > 0
</if>
<if test="param.waybillNo != null and param.waybillNo != ''">
and Locate(#{param.waybillNo},lww.waybill_no) > 0
</if>
<if test="param.orderNo != null and param.orderNo != ''">
and Locate(#{param.orderNo},lww.order_no) > 0
</if>
<if test="param.destinationWarehouseName != null and param.destinationWarehouseName != ''">
and Locate(#{param.destinationWarehouseName},lww.destination_warehouse_name) > 0
</if>
<if test="param.departureWarehouseName != null and param.departureWarehouseName != ''">
and Locate(#{param.departureWarehouseName},lww.departure_warehouse_name) > 0
</if>
<if test="param.customerTrain != null and param.customerTrain != ''">
and Locate(#{param.customerTrain},lww.customer_train) > 0
</if>
<if test="param.brand != null and param.brand != ''">
and Locate(#{param.brand},lww.brand) > 0
</if>
<if test="param.shipper != null and param.shipper != ''">
and Locate(#{param.shipper},lww.shipper) > 0
</if>
<if test="param.shipperName != null and param.shipperName != ''">
and Locate(#{param.shipperName},lww.shipper_name) > 0
</if>
<if test="param.shipperMobile != null and param.shipperMobile != ''">
and Locate(#{param.shipperMobile},lww.shipper_mobile) > 0
</if>
<if test="param.consignee != null and param.consignee != ''">
and Locate(#{param.consignee},lww.consignee) > 0
</if>
<if test="param.consigneeName != null and param.consigneeName != ''">
and Locate(#{param.consigneeName},lww.consignee_name) > 0
</if>
<if test="param.consigneeMobile != null and param.consigneeMobile != ''">
and Locate(#{param.consigneeMobile},lww.consignee_mobile) > 0
</if>
<if test="param.destination != null and param.destination != ''">
and Locate(#{param.destination},lww.destination) > 0
</if>
<if test="param.departure != null and param.departure != ''">
and Locate(#{param.departure},lww.departure) > 0
</if>
<if test="param.payType != null">
and lww.pay_type = #{param.payType}
</if>
<if test="param.payWay != null">
and lww.pay_way = #{param.payWay}
</if>
<if test="param.deliveryWay != null">
and lww.delivery_way = #{param.deliveryWay}
</if>
<if test="param.urgency != null">
and lww.urgency = #{param.urgency}
</if>
<if test="param.transportType != null">
and lww.transport_type = #{param.transportType}
</if>
<if test="param.transportType != null">
and lww.transport_type = #{param.transportType}
</if>
<if test="param.waybillStatus != null">
and lww.waybill_status = #{param.waybillStatus}
</if>
<if test="param.pickupCompleteOrNot != null">
and lww.pickup_complete_or_not = #{param.pickupCompleteOrNot}
</if>
<if test="param.trunklineCompleteOrNot != null">
and lww.trunkline_complete_or_not = #{param.trunklineCompleteOrNot}
</if>
<if test="param.documentMakingTimeStartDate != null">
and lww.document_making_time &gt;= #{param.documentMakingTimeStartDate}
</if>
<if test="param.documentMakingTimeEndDate != null">
and lww.document_making_time &lt;= #{param.documentMakingTimeEndDate}
</if>
<if test="param.createTimeStartDate != null">
and lww.create_time &gt;= #{param.createTimeStartDate}
</if>
<if test="param.createTimeEndDate != null">
and lww.create_time &lt;= #{param.createTimeEndDate}
</if>
<if test="param.agent != null and param.agent != ''">
and lww.Locate(#{param.agent},agent) > 0
</if>
<if test="param.goodsName != null and param.goodsName != ''">
and lww.Locate(#{param.goodsName},goods_name) > 0
</if>
<if test="param.freezeStatus != null">
and lww.freeze_status = #{param.freezeStatus}
</if>
<if test="param.abolishStatus != null">
and lww.abolish_status = #{param.abolishStatus}
</if>
<if test="param.remark != null and param.reamrk != ''">
and Locate(#{param.remark},lww.remark) > 0
</if>
<if test="param.consigneeAddress != null and param.consigneeAddress != ''">
and Locate(#{param.consigneeAddress},lww.consignee_address) > 0
</if>
<if test="param.totalCount != null">
and lww.total_count = #{param.totalCount}
</if>
<if test="param.totalWeight != null">
and lww.total_weight = #{param.totalWeight}
</if>
<if test="param.totalVolume != null">
and lww.total_volume = #{param.totalVolume}
</if>
<if test="param.abolishTimeStartDate != null">
and lww.abolish_time &gt;= #{param.abolishTimeStartDate}
</if>
<if test="param.abolishTimeEndDate != null">
and lww.abolish_time &lt;= #{param.abolishTimeEndDate}
</if>
<if test="param.freezeTimeStartDate != null">
and lww.freeze_time &gt;= #{param.freezeTimeStartDate}
</if>
<if test="param.freezeTimeEndDate != null">
and lww.freeze_time &lt;= #{param.freezeTimeEndDate}
</if>
order by lww.create_time desc
</select>
</mapper>

7
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWaybillService.java

@ -9,6 +9,7 @@ import com.logpm.warehouse.dto.WarehouseWaybillDTO;
import com.logpm.warehouse.dto.WaybillDTO;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.excel.WarehouseWaybillExcel;
import com.logpm.warehouse.vo.ExportWarehouseWaybillVO;
import com.logpm.warehouse.vo.WarehouseWaybillVO;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.tool.api.R;
@ -70,7 +71,13 @@ public interface IWarehouseWaybillService extends BaseService<WarehouseWaybillEn
List<WarehouseWaybillEntity> findFreezeOrAbolishByWaybillNos(List<String> waybillNos);
WarehouseWaybillEntity findWaybillEntityByOrderPackageCode(String orderPackageCode);
IPage<WarehouseWaybillVO> pageFinanceWaybillList(WarehouseWaybillDTO waybillDTO);
List<WarehouseWaybillEntity> findWaybillBilllByWaybillNos(List<String> waybillNos);
List<ExportWarehouseWaybillVO> exportWaybillList(WarehouseWaybillDTO waybillDTO);
}

42
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayGoodsLogServiceImpl.java

@ -11,6 +11,8 @@ import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.constant.TenantNum;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.utils.BeanUtil;
import org.springframework.stereotype.Service;
@ -24,9 +26,14 @@ public class WarehouseTrayGoodsLogServiceImpl extends BaseServiceImpl<WarehouseT
@Override
public void saveLogPackage(DistributionParcelListEntity parcelListEntity, WarehouseTrayTypeEntity trayTypeEntity, String bindingType, String remark, String palletizingType) {
WarehouseTrayGoodsLogEntity trayGoodsLogEntity = new WarehouseTrayGoodsLogEntity();
trayGoodsLogEntity.setCreateUser(1714696768639311873L);
trayGoodsLogEntity.setUpdateUser(1714696768639311873L);
trayGoodsLogEntity.setCreateDept(1649331096241836033L);
BladeUser user = AuthUtil.getUser();
if(user==null){
trayGoodsLogEntity.setTenantId(TenantNum.HUITONGCODE);
trayGoodsLogEntity.setCreateUser(1714696768639311873L);
trayGoodsLogEntity.setUpdateUser(1714696768639311873L);
trayGoodsLogEntity.setCreateDept(1649331096241836033L);
}
trayGoodsLogEntity.setTrayId(trayTypeEntity.getTrayId());
trayGoodsLogEntity.setTrayTypeId(trayTypeEntity.getId());
trayGoodsLogEntity.setAssociationId(parcelListEntity.getId());
@ -37,17 +44,23 @@ public class WarehouseTrayGoodsLogServiceImpl extends BaseServiceImpl<WarehouseT
trayGoodsLogEntity.setPalletizingType(palletizingType);
trayGoodsLogEntity.setNum(1);
trayGoodsLogEntity.setWarehouseId(trayTypeEntity.getWarehouseId());
trayGoodsLogEntity.setTenantId(TenantNum.HUITONGCODE);
save(trayGoodsLogEntity);
}
@Override
public void saveLogZero(DistributionStockArticleEntity stockArticleEntity, WarehouseTrayTypeEntity trayTypeEntity, Integer num, String bindingType, String remark, String palletizingType) {
WarehouseTrayGoodsLogEntity trayGoodsLogEntity = new WarehouseTrayGoodsLogEntity();
trayGoodsLogEntity.setCreateUser(1714696768639311873L);
trayGoodsLogEntity.setUpdateUser(1714696768639311873L);
trayGoodsLogEntity.setCreateDept(1649331096241836033L);
trayGoodsLogEntity.setTenantId(TenantNum.HUITONGCODE);
BladeUser user = AuthUtil.getUser();
if(user==null){
trayGoodsLogEntity.setTenantId(TenantNum.HUITONGCODE);
trayGoodsLogEntity.setCreateUser(1714696768639311873L);
trayGoodsLogEntity.setUpdateUser(1714696768639311873L);
trayGoodsLogEntity.setCreateDept(1649331096241836033L);
}
trayGoodsLogEntity.setTrayId(trayTypeEntity.getTrayId());
trayGoodsLogEntity.setTrayTypeId(trayTypeEntity.getId());
trayGoodsLogEntity.setAssociationId(stockArticleEntity.getId());
@ -64,10 +77,15 @@ public class WarehouseTrayGoodsLogServiceImpl extends BaseServiceImpl<WarehouseT
@Override
public void saveLogStock(Long materialId,Long marketId, WarehouseTrayTypeEntity trayTypeEntity,String incomingBatch,String materialCode,Integer num, String bindingType, String remark, String palletizingType) {
WarehouseTrayGoodsLogEntity trayGoodsLogEntity = new WarehouseTrayGoodsLogEntity();
trayGoodsLogEntity.setCreateUser(1714696768639311873L);
trayGoodsLogEntity.setUpdateUser(1714696768639311873L);
trayGoodsLogEntity.setCreateDept(1649331096241836033L);
trayGoodsLogEntity.setTenantId(TenantNum.HUITONGCODE);
BladeUser user = AuthUtil.getUser();
if(user==null){
trayGoodsLogEntity.setTenantId(TenantNum.HUITONGCODE);
trayGoodsLogEntity.setCreateUser(1714696768639311873L);
trayGoodsLogEntity.setUpdateUser(1714696768639311873L);
trayGoodsLogEntity.setCreateDept(1649331096241836033L);
}
trayGoodsLogEntity.setTrayId(trayTypeEntity.getTrayId());
trayGoodsLogEntity.setTrayTypeId(trayTypeEntity.getId());
trayGoodsLogEntity.setAssociationId(materialId);

42
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayGoodsServiceImpl.java

@ -17,6 +17,8 @@ import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.constant.TenantNum;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.utils.Func;
import org.springframework.stereotype.Service;
@ -50,10 +52,15 @@ public class WarehouseTrayGoodsServiceImpl extends BaseServiceImpl<WarehouseTray
saveEntityPackage(DistributionParcelListEntity parcelListEntity, WarehouseTrayTypeEntity trayTypeEntity, String isException,String bindingType,String remark,String palletizingType) {
Date date = new Date();
WarehouseTrayGoodsEntity trayGoodsEntity = new WarehouseTrayGoodsEntity();
trayGoodsEntity.setCreateUser(1714696768639311873L);
trayGoodsEntity.setUpdateUser(1714696768639311873L);
trayGoodsEntity.setCreateDept(1649331096241836033L);
trayGoodsEntity.setTenantId(TenantNum.HUITONGCODE);
BladeUser user = AuthUtil.getUser();
if(user==null){
trayGoodsEntity.setTenantId(TenantNum.HUITONGCODE);
trayGoodsEntity.setCreateUser(1714696768639311873L);
trayGoodsEntity.setUpdateUser(1714696768639311873L);
trayGoodsEntity.setCreateDept(1649331096241836033L);
}
trayGoodsEntity.setTrayId(trayTypeEntity.getTrayId());
trayGoodsEntity.setTrayTypeId(trayTypeEntity.getId());
trayGoodsEntity.setTrayCode(trayTypeEntity.getTrayCode());
@ -149,10 +156,16 @@ public class WarehouseTrayGoodsServiceImpl extends BaseServiceImpl<WarehouseTray
updateById(oldTrayGoodsEntity);
}else{
WarehouseTrayGoodsEntity trayGoodsEntity = new WarehouseTrayGoodsEntity();
trayGoodsEntity.setCreateUser(1714696768639311873L);
trayGoodsEntity.setUpdateUser(1714696768639311873L);
trayGoodsEntity.setCreateDept(1649331096241836033L);
trayGoodsEntity.setTenantId(TenantNum.HUITONGCODE);
BladeUser user = AuthUtil.getUser();
if(user==null){
trayGoodsEntity.setTenantId(TenantNum.HUITONGCODE);
trayGoodsEntity.setCreateUser(1714696768639311873L);
trayGoodsEntity.setUpdateUser(1714696768639311873L);
trayGoodsEntity.setCreateDept(1649331096241836033L);
}
trayGoodsEntity.setTrayId(trayTypeEntity.getTrayId());
trayGoodsEntity.setTrayCode(trayTypeEntity.getTrayCode());
trayGoodsEntity.setTrayTypeId(trayTypeId);
@ -218,10 +231,15 @@ public class WarehouseTrayGoodsServiceImpl extends BaseServiceImpl<WarehouseTray
@Override
public void saveEntityStock(Long materialId,Long marketId,WarehouseTrayTypeEntity trayTypeEntity,String incomingBatch,String materialCode,Integer num, String isException) {
WarehouseTrayGoodsEntity trayGoodsEntity = new WarehouseTrayGoodsEntity();
trayGoodsEntity.setCreateUser(1714696768639311873L);
trayGoodsEntity.setUpdateUser(1714696768639311873L);
trayGoodsEntity.setCreateDept(1649331096241836033L);
trayGoodsEntity.setTenantId(TenantNum.HUITONGCODE);
BladeUser user = AuthUtil.getUser();
if(user==null){
trayGoodsEntity.setTenantId(TenantNum.HUITONGCODE);
trayGoodsEntity.setCreateUser(1714696768639311873L);
trayGoodsEntity.setUpdateUser(1714696768639311873L);
trayGoodsEntity.setCreateDept(1649331096241836033L);
}
trayGoodsEntity.setTrayId(trayTypeEntity.getTrayId());
trayGoodsEntity.setTrayCode(trayTypeEntity.getTrayCode());
trayGoodsEntity.setTrayTypeId(trayTypeEntity.getId());

26
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java

@ -47,6 +47,8 @@ import org.springblade.common.exception.CustomerException;
import org.springblade.common.utils.CommonUtil;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.Func;
@ -1078,10 +1080,13 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
log.info("#########saveTrayType: 存入打托方式 trayType={},trayCode={}",trayType,trayCode);
WarehouseTrayTypeEntity trayTypeEntity = new WarehouseTrayTypeEntity();
trayTypeEntity.setTenantId(TenantNum.HUITONGCODE);
trayTypeEntity.setCreateUser(1714696768639311873L);
trayTypeEntity.setUpdateUser(1714696768639311873L);
trayTypeEntity.setCreateDept(1649331096241836033L);
BladeUser user = AuthUtil.getUser();
if(user==null){
trayTypeEntity.setTenantId(TenantNum.HUITONGCODE);
trayTypeEntity.setCreateUser(1714696768639311873L);
trayTypeEntity.setUpdateUser(1714696768639311873L);
trayTypeEntity.setCreateDept(1649331096241836033L);
}
trayTypeEntity.setTrayId(trayId);
trayTypeEntity.setTrayCode(trayCode);
trayTypeEntity.setType(PalletProductTypeConstant.OTHER);
@ -4261,10 +4266,15 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
WarehouseTrayTypeEntity trayTypeEntity = new WarehouseTrayTypeEntity();
trayTypeEntity.setCreateUser(1714696768639311873L);
trayTypeEntity.setUpdateUser(1714696768639311873L);
trayTypeEntity.setCreateDept(1649331096241836033L);
trayTypeEntity.setTenantId(TenantNum.HUITONGCODE);
BladeUser user = AuthUtil.getUser();
if(user==null){
trayTypeEntity.setCreateUser(1714696768639311873L);
trayTypeEntity.setUpdateUser(1714696768639311873L);
trayTypeEntity.setCreateDept(1649331096241836033L);
trayTypeEntity.setTenantId(TenantNum.HUITONGCODE);
}
trayTypeEntity.setTrayId(trayId);
trayTypeEntity.setTrayCode(trayCode);
trayTypeEntity.setType(PalletProductTypeConstant.STOCKDATA);

36
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java

@ -37,12 +37,14 @@ import com.logpm.warehouse.excel.WarehouseWaybillExcel;
import com.logpm.warehouse.mapper.WarehouseWaybillMapper;
import com.logpm.warehouse.service.IWarehouseWayBillDetailService;
import com.logpm.warehouse.service.IWarehouseWaybillService;
import com.logpm.warehouse.vo.ExportWarehouseWaybillVO;
import com.logpm.warehouse.vo.WarehouseWaybillVO;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.OldSystemDataPushConfig;
import org.springblade.common.constant.TenantNum;
import org.springblade.common.constant.WaybillStatusEnum;
import org.springblade.common.constant.order.*;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.utils.CommonUtil;
@ -808,6 +810,11 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl<WarehouseWaybil
return baseMapper.findWaybillEntityByOrderPackageCode(orderPackageCode);
}
@Override
public List<WarehouseWaybillEntity> findWaybillBilllByWaybillNos(List<String> waybillNos) {
return baseMapper.findWaybillBilllByWaybillNos(waybillNos);
}
@Override
public IPage<WarehouseWaybillVO> pageFinanceWaybillList(WarehouseWaybillDTO waybillDTO) {
IPage<Object> page = new Page<>();
@ -844,6 +851,35 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl<WarehouseWaybil
return pageList;
}
@Override
public List<ExportWarehouseWaybillVO> exportWaybillList(WarehouseWaybillDTO waybillDTO) {
waybillDTO.setDocumentMakingTimeStartDate(CommonUtil.getStartByDateStr(waybillDTO.getDocumentMakingTimeStartStr()));
waybillDTO.setDocumentMakingTimeEndDate(CommonUtil.getEndByDateStr(waybillDTO.getDocumentMakingTimeEndStr()));
waybillDTO.setCreateTimeStartDate(CommonUtil.getStartByDateStr(waybillDTO.getCreateTimeStartStr()));
waybillDTO.setCreateTimeEndDate(CommonUtil.getEndByDateStr(waybillDTO.getCreateTimeEndStr()));
waybillDTO.setAbolishTimeStartDate(CommonUtil.getStartByDateStr(waybillDTO.getAbolishTimeStartStr()));
waybillDTO.setAbolishTimeEndDate(CommonUtil.getEndByDateStr(waybillDTO.getAbolishTimeEndStr()));
waybillDTO.setFreezeTimeStartDate(CommonUtil.getStartByDateStr(waybillDTO.getFreezeTimeStartStr()));
waybillDTO.setFreezeTimeEndDate(CommonUtil.getEndByDateStr(waybillDTO.getFreezeTimeEndStr()));
List<ExportWarehouseWaybillVO> list = baseMapper.exportWaybillList(waybillDTO);
list.forEach(item -> {
item.setPayType(DictBizCache.getValue(DictBizConstant.OPEN_ORDER_PAY_TYPE,item.getPayType()));
item.setPayWay(DictBizCache.getValue(DictBizConstant.OPEN_ORDER_PAY_WAY,item.getPayWay()));
item.setDeliveryWay(DictBizCache.getValue(DictBizConstant.OPEN_ORDER_DELIVERY_WAY,item.getDeliveryWay()));
item.setUrgency(DictBizCache.getValue(DictBizConstant.OPEN_ORDER_URGENCY,item.getUrgency()));
item.setTransportType(DictBizCache.getValue(DictBizConstant.OPEN_ORDER_TRANSPORT_TYPE,item.getTransportType()));
item.setPickupCompleteOrNotStr(item.getPickupCompleteOrNot() == 1?"是":"否");
item.setTrunklineCompleteOrNotStr(item.getTrunklineCompleteOrNot() == 1?"是":"否");
item.setWaybillStatus(WaybillStatusEnum.getValue(item.getWaybillStatus()));
item.setFreezeStatusStr(item.getFreezeStatus() == 1?"是":"否");
item.setAbolishStatusStr(item.getAbolishStatus() == 1?"是":"否");
});
return list;
}
private PrintPreviewVO buildPrintWallet(WarehouseWaybillEntity warehouseWaybillEntity, List<WarehouseWayBillDetail> warehouseWayBillDetails, BasicPrintTemplateEntity template) throws Exception {
PrintPreviewVO printPreviewVO = new PrintPreviewVO();
String html = TemplateUtil.getTemplateByUrl(template.getTemplateUrl());

Loading…
Cancel
Save