diff --git a/blade-biz-common/src/main/java/org/springblade/common/constant/CodeNumConstant.java b/blade-biz-common/src/main/java/org/springblade/common/constant/CodeNumConstant.java index 45770e024..0e46c3f52 100644 --- a/blade-biz-common/src/main/java/org/springblade/common/constant/CodeNumConstant.java +++ b/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;//结算单号 } diff --git a/blade-biz-common/src/main/java/org/springblade/common/constant/WaybillStatusEnum.java b/blade-biz-common/src/main/java/org/springblade/common/constant/WaybillStatusEnum.java new file mode 100644 index 000000000..c0ca6a289 --- /dev/null +++ b/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; + } + +} diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/ChangesRecordDTO.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/ChangesRecordDTO.java new file mode 100644 index 000000000..8108be3a9 --- /dev/null +++ b/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 changesPhotoUrls; + +} diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/MerchantStatisticsDTO.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/MerchantStatisticsDTO.java index f07a72b21..d1ad2df46 100644 --- a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/MerchantStatisticsDTO.java +++ b/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 orderInfoIds; + } diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/StatisticsBalanceAbnormalDTO.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/StatisticsBalanceAbnormalDTO.java new file mode 100644 index 000000000..3e5848870 --- /dev/null +++ b/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 abnormalPhotoEntityList; + +} diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/StatisticsBalanceRecordDTO.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/StatisticsBalanceRecordDTO.java new file mode 100644 index 000000000..b693279b2 --- /dev/null +++ b/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 recordPhotoEntityList; + +} diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsBalanceAbnormalEntity.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsBalanceAbnormalEntity.java new file mode 100644 index 000000000..d96cded9e --- /dev/null +++ b/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;//异常操作人 + + +} diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsBalanceAbnormalPhotoEntity.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsBalanceAbnormalPhotoEntity.java new file mode 100644 index 000000000..46632d725 --- /dev/null +++ b/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;//图片地址 + +} diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsBalanceOrderInfoEntity.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsBalanceOrderInfoEntity.java new file mode 100644 index 000000000..eb0a05e86 --- /dev/null +++ b/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;//异常备注 + +} diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsBalanceRecordEntity.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsBalanceRecordEntity.java new file mode 100644 index 000000000..7290b84e5 --- /dev/null +++ b/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;//异常操作人 + + +} diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsBalanceRecordPhotoEntity.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsBalanceRecordPhotoEntity.java new file mode 100644 index 000000000..41e23eb95 --- /dev/null +++ b/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;//图片地址 + +} diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsChangesPhotoEntity.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsChangesPhotoEntity.java new file mode 100644 index 000000000..d0ce76255 --- /dev/null +++ b/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; + + +} diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsChangesRecordEntity.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsChangesRecordEntity.java new file mode 100644 index 000000000..f4ce2695d --- /dev/null +++ b/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; + +} diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsOrderInfoEntity.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsOrderInfoEntity.java index 1436a4dd8..276adeb64 100644 --- a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsOrderInfoEntity.java +++ b/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;//异动金额 } diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/StatisticsBalanceAbnormalVO.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/StatisticsBalanceAbnormalVO.java new file mode 100644 index 000000000..efed63751 --- /dev/null +++ b/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 abnormalPhotoEntityList; +} diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/StatisticsBalanceOrderInfoVO.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/StatisticsBalanceOrderInfoVO.java new file mode 100644 index 000000000..64b762662 --- /dev/null +++ b/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 { +} diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/StatisticsBalanceRecordVO.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/StatisticsBalanceRecordVO.java new file mode 100644 index 000000000..2eb877a28 --- /dev/null +++ b/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 recordPhotoEntityList; + +} diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/StatisticsChangesRecordVO.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/StatisticsChangesRecordVO.java new file mode 100644 index 000000000..db9bd8bb2 --- /dev/null +++ b/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 changesPhotoEntityList; + + +} diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/StatisticsOrderInfoVO.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/StatisticsOrderInfoVO.java new file mode 100644 index 000000000..c8fdaa455 --- /dev/null +++ b/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;//异常金额 + + +} diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/StatisticsWaybillInfoVO.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/StatisticsWaybillInfoVO.java index 1fa7beb73..39b241fce 100644 --- a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/StatisticsWaybillInfoVO.java +++ b/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;//异常金额 + + } diff --git a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/LoadCarsDTO.java b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/LoadCarsDTO.java index 8775e120e..9be5f4678 100644 --- a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/LoadCarsDTO.java +++ b/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; diff --git a/blade-service-api/logpm-warehouse-api/pom.xml b/blade-service-api/logpm-warehouse-api/pom.xml index aef29d830..41edf6a52 100644 --- a/blade-service-api/logpm-warehouse-api/pom.xml +++ b/blade-service-api/logpm-warehouse-api/pom.xml @@ -14,6 +14,10 @@ org.projectlombok lombok + + org.springblade + blade-starter-excel + diff --git a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/ExportWarehouseWaybillVO.java b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/ExportWarehouseWaybillVO.java new file mode 100644 index 000000000..7b091c341 --- /dev/null +++ b/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; + +} diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataCodeServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataCodeServiceImpl.java index 06ec890c2..36d29aa6c 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataCodeServiceImpl.java +++ b/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 getBatchPackageCodeByType(String warehouseCode, String orderCode, Integer num) { if(!StringUtil.hasLength(warehouseCode)){ diff --git a/blade-service/logpm-statisticsdata/pom.xml b/blade-service/logpm-statisticsdata/pom.xml index ea8762db6..2a886908a 100644 --- a/blade-service/logpm-statisticsdata/pom.xml +++ b/blade-service/logpm-statisticsdata/pom.xml @@ -47,6 +47,18 @@ 3.2.0.RELEASE compile + + org.springblade + logpm-basicdata-api + 3.2.0.RELEASE + compile + + + org.springblade + logpm-basicdata-api + 3.2.0.RELEASE + compile + diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/MerchantBalanceController.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/MerchantBalanceController.java new file mode 100644 index 000000000..bb7b88dde --- /dev/null +++ b/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 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,"系统异常"); + } + } + + +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/MerchantStatisticsController.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/MerchantStatisticsController.java index 93ecfa04f..3bf2b0c7c 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/MerchantStatisticsController.java +++ b/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 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 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 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 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,"系统异常"); } } diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/WaybillFanoutListener.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/WaybillFanoutListener.java index c958044f6..24aa3a1e5 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/WaybillFanoutListener.java +++ b/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> warehouseMap = statisticsWarehousePackageEntities.stream().collect(Collectors.groupingBy(StatisticsWarehousePackageEntity::getOrderCode)); Map> distributionMap = statisticsDistributionPackageEntities.stream().collect(Collectors.groupingBy(StatisticsDistributionPackageEntity::getOrderCode)); List 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); }); diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsBalanceAbnormalMapper.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsBalanceAbnormalMapper.java new file mode 100644 index 000000000..71d8d8512 --- /dev/null +++ b/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 { +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsBalanceAbnormalPhotoMapper.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsBalanceAbnormalPhotoMapper.java new file mode 100644 index 000000000..f707d319c --- /dev/null +++ b/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 { +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsBalanceOrderInfoMapper.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsBalanceOrderInfoMapper.java new file mode 100644 index 000000000..98201ab55 --- /dev/null +++ b/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 { + IPage pageList(IPage page, @Param("param") MerchantStatisticsDTO merchantStatisticsDTO); + +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsBalanceOrderInfoMapper.xml b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsBalanceOrderInfoMapper.xml new file mode 100644 index 000000000..da77bee20 --- /dev/null +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsBalanceOrderInfoMapper.xml @@ -0,0 +1,11 @@ + + + + + + + diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsBalanceRecordMapper.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsBalanceRecordMapper.java new file mode 100644 index 000000000..1e983a9ee --- /dev/null +++ b/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 { +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsBalanceRecordPhotoMapper.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsBalanceRecordPhotoMapper.java new file mode 100644 index 000000000..e27ed15df --- /dev/null +++ b/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 { +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsChangesPhotoMapper.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsChangesPhotoMapper.java new file mode 100644 index 000000000..918956a97 --- /dev/null +++ b/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 { +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsChangesRecordMapper.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsChangesRecordMapper.java new file mode 100644 index 000000000..7ee92cc01 --- /dev/null +++ b/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 { + BigDecimal findChangesFeeByOrderInfoId(@Param("orderInfoId") Long orderInfoId); +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsChangesRecordMapper.xml b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsChangesRecordMapper.xml new file mode 100644 index 000000000..a013a59d4 --- /dev/null +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsChangesRecordMapper.xml @@ -0,0 +1,13 @@ + + + + + + + diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.java index 29b17b8ab..813153e10 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.java +++ b/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 { + + IPage pageList(IPage page, @Param("param") MerchantStatisticsDTO merchantStatisticsDTO); + + List findStatementListByOrderInfoIds(@Param("orderInfoIds") List orderInfoIds); } diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.xml b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.xml new file mode 100644 index 000000000..8ebe0fd77 --- /dev/null +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.xml @@ -0,0 +1,236 @@ + + + + + + + + + diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsWaybillInfoMapper.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsWaybillInfoMapper.java index 2c48810fe..370f40613 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsWaybillInfoMapper.java +++ b/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 { + + + } diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsWaybillInfoMapper.xml b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsWaybillInfoMapper.xml new file mode 100644 index 000000000..ee42c63ba --- /dev/null +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsWaybillInfoMapper.xml @@ -0,0 +1,111 @@ + + + + + + + diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsBalanceAbnormalPhotoService.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsBalanceAbnormalPhotoService.java new file mode 100644 index 000000000..92177f08f --- /dev/null +++ b/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 { +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsBalanceAbnormalService.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsBalanceAbnormalService.java new file mode 100644 index 000000000..0792c98e8 --- /dev/null +++ b/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 { +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsBalanceOrderInfoService.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsBalanceOrderInfoService.java new file mode 100644 index 000000000..15bd8f331 --- /dev/null +++ b/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 { + IPage pageList(MerchantStatisticsDTO merchantStatisticsDTO); + + R addAbnormal(StatisticsBalanceAbnormalDTO balanceAbnormalDTO); + + R findAbnormalList(StatisticsBalanceAbnormalDTO balanceAbnormalDTO); + + R addBalanceRecord(StatisticsBalanceRecordDTO balanceRecordDTO); + + R findRecordList(StatisticsBalanceRecordDTO balanceRecordDTO); +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsBalanceRecordPhotoService.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsBalanceRecordPhotoService.java new file mode 100644 index 000000000..3663ff76e --- /dev/null +++ b/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 { +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsBalanceRecordService.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsBalanceRecordService.java new file mode 100644 index 000000000..5d0bc6c79 --- /dev/null +++ b/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 { +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsChangesPhotoService.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsChangesPhotoService.java new file mode 100644 index 000000000..394ada824 --- /dev/null +++ b/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 { +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsChangesRecordService.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsChangesRecordService.java new file mode 100644 index 000000000..f06118813 --- /dev/null +++ b/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 { + BigDecimal findChangesFeeByOrderInfoId(Long orderInfoId); +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsOrderInfoService.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsOrderInfoService.java index 2f9daae0c..7f025e074 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsOrderInfoService.java +++ b/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 findListByWaybillId(Long waybillId); List findListByOrderInfoIdsSet(Set orderInfoSet); + + IPage pageList(MerchantStatisticsDTO merchantStatisticsDTO); + + List findChangesRecordList(MerchantStatisticsDTO merchantStatisticsDTO); + + R addChangesRecord(ChangesRecordDTO changesRecordDTO); + + R checkBalance(MerchantStatisticsDTO merchantStatisticsDTO); } diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsWaybillInfoService.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsWaybillInfoService.java index 4b0f40e44..4b7d1d3b4 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsWaybillInfoService.java +++ b/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 { + } diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsBalanceAbnormalPhotoServiceImpl.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsBalanceAbnormalPhotoServiceImpl.java new file mode 100644 index 000000000..cce913fbd --- /dev/null +++ b/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 implements IStatisticsBalanceAbnormalPhotoService { +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsBalanceAbnormalServiceImpl.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsBalanceAbnormalServiceImpl.java new file mode 100644 index 000000000..870163e03 --- /dev/null +++ b/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 implements IStatisticsBalanceAbnormalService { +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsBalanceOrderInfoServiceImpl.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsBalanceOrderInfoServiceImpl.java new file mode 100644 index 000000000..9af13a8b6 --- /dev/null +++ b/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 implements IStatisticsBalanceOrderInfoService { + + private final IStatisticsBalanceAbnormalService balanceAbnormalService; + private final IStatisticsBalanceAbnormalPhotoService balanceAbnormalPhotoService; + private final IStatisticsBalanceRecordService balanceRecordService; + private final IStatisticsBalanceRecordPhotoService balanceRecordPhotoService; + + @Override + public IPage pageList(MerchantStatisticsDTO merchantStatisticsDTO) { + + IPage 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 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 balanceAbnormalEntityQueryWrapper = new QueryWrapper<>(); + balanceAbnormalEntityQueryWrapper.eq("balance_order_info_id",balanceOrderInfoId); + + List list = balanceAbnormalService.list(balanceAbnormalEntityQueryWrapper); + //把list中所有元素的id放到一个List集合中 + List idList= list.stream() + .map(StatisticsBalanceAbnormalEntity::getId) + .collect(Collectors.toList()); + + QueryWrapper balanceAbnormalPhotoEntityQueryWrapper = new QueryWrapper<>(); + balanceAbnormalPhotoEntityQueryWrapper.in("abnormal_id",idList); + + List abnormalPhotoEntityList = balanceAbnormalPhotoService.list(balanceAbnormalPhotoEntityQueryWrapper); + //把abnormalPhotoEntityList中所有元素按照abnormalId进行分组 + Map> 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 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 balanceAbnormalEntityQueryWrapper = new QueryWrapper<>(); + balanceAbnormalEntityQueryWrapper.eq("balance_order_info_id",balanceOrderInfoId); + + List list = balanceRecordService.list(balanceAbnormalEntityQueryWrapper); + //把list中所有元素的id放到一个List集合中 + List idList= list.stream() + .map(StatisticsBalanceRecordEntity::getId) + .collect(Collectors.toList()); + + QueryWrapper balanceRecordPhotoEntityQueryWrapper = new QueryWrapper<>(); + balanceRecordPhotoEntityQueryWrapper.in("record_id",idList); + + List recordPhotoEntityList = balanceRecordPhotoService.list(balanceRecordPhotoEntityQueryWrapper); + //把abnormalPhotoEntityList中所有元素按照abnormalId进行分组 + Map> 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); + } + + +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsBalanceRecordPhotoServiceImpl.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsBalanceRecordPhotoServiceImpl.java new file mode 100644 index 000000000..269dfaf3e --- /dev/null +++ b/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 implements IStatisticsBalanceRecordPhotoService { +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsBalanceRecordServiceImpl.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsBalanceRecordServiceImpl.java new file mode 100644 index 000000000..b1a5ebe38 --- /dev/null +++ b/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 implements IStatisticsBalanceRecordService { +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsChangesPhotoServiceImpl.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsChangesPhotoServiceImpl.java new file mode 100644 index 000000000..7d0969347 --- /dev/null +++ b/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 implements IStatisticsChangesPhotoService { +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsChangesRecordServiceImpl.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsChangesRecordServiceImpl.java new file mode 100644 index 000000000..2ab88afea --- /dev/null +++ b/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 implements IStatisticsChangesRecordService { + @Override + public BigDecimal findChangesFeeByOrderInfoId(Long orderInfoId) { + return baseMapper.findChangesFeeByOrderInfoId(orderInfoId); + } +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsOrderInfoServiceImpl.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsOrderInfoServiceImpl.java index 49fffbd4c..f01f8fbba 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsOrderInfoServiceImpl.java +++ b/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 implements IStatisticsOrderInfoService { + + private final IStatisticsChangesRecordService changesRecordService; + private final IStatisticsChangesPhotoService changesPhotoService; + private final IBasicdataCodeClient basicdataCodeClient; + private final IStatisticsBalanceOrderInfoService balanceOrderInfoService; + @Override public List findListByWaybillId(Long waybillId) { QueryWrapper queryWrapper = new QueryWrapper<>(); @@ -29,4 +58,443 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl pageList(MerchantStatisticsDTO merchantStatisticsDTO) { + + IPage page = new Page<>(); + page.setCurrent(merchantStatisticsDTO.getPageNum()); + page.setSize(merchantStatisticsDTO.getPageSize()); + + return baseMapper.pageList(page,merchantStatisticsDTO); + } + + @Override + public List findChangesRecordList(MerchantStatisticsDTO merchantStatisticsDTO) { + Long orderInfoId = merchantStatisticsDTO.getOrderInfoId(); + + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("order_info_id",orderInfoId); + + List list = changesRecordService.list(queryWrapper); + + //获取list中所有元素的id + List changesRecordIdList = list.stream().map(StatisticsChangesRecordEntity::getId).collect(Collectors.toList()); + + QueryWrapper changesPhotoEntityQueryWrapper = new QueryWrapper<>(); + changesPhotoEntityQueryWrapper.in("changes_record_id",changesRecordIdList); + + List changesPhotoEntityList = changesPhotoService.list(changesPhotoEntityQueryWrapper); + //把changesPhotoEntityList中的元素通过changesRecordId为key进行分组 + Map> groupedEntities = + changesPhotoEntityList.stream() + .collect(Collectors.groupingBy(StatisticsChangesPhotoEntity::getChangesRecordId)); + + List ls = new ArrayList<>(); + list.forEach(statisticsChangesRecordEntity -> { + StatisticsChangesRecordVO statisticsChangesRecordVO = new StatisticsChangesRecordVO(); + BeanUtil.copy(statisticsChangesRecordEntity,statisticsChangesRecordVO); + List 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 changesPhotoUrls = changesRecordDTO.getChangesPhotoUrls(); + List 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 orderInfoIds = merchantStatisticsDTO.getOrderInfoIds(); + + //查询对应订单的数据 + List list = baseMapper.findStatementListByOrderInfoIds(orderInfoIds); + + Set brands = new HashSet<>(); + Set waybillNos = new HashSet<>(); + Set orderCodes = new HashSet<>(); + Set typeServices = new HashSet<>(); + Set productGoods = new HashSet<>(); + Set shippers = new HashSet<>(); + Set shipperPersons = new HashSet<>(); + Set shipperMobiles = new HashSet<>(); + Set shipperAddresses = new HashSet<>(); + Set consignees = new HashSet<>(); + Set consigneePersons = new HashSet<>(); + Set consigneeMobiles = new HashSet<>(); + Set consigneeAddresses = new HashSet<>(); + Set departures = new HashSet<>(); + Set destinations = new HashSet<>(); + Set departureWarehouseNames = new HashSet<>(); + Set destinationWarehouseNames = new HashSet<>(); + Set payTypes = new HashSet<>(); + Set payWays = new HashSet<>(); + AtomicReference totalCount = new AtomicReference<>(0);//总数量 + + List totalWeights = new ArrayList<>();//总重量 + List totalVolumes = new ArrayList();//总体积 + List totalFees = new ArrayList(); + List openFees = new ArrayList(); + List pickupFees = new ArrayList();//提货费 + List freightFees = new ArrayList();//运费 + List warehouseServiceFees = new ArrayList();//仓库服务费 + List warehouseFees = new ArrayList();//仓储费 + List warehouseManageFees = new ArrayList();//仓储管理费 + List warehouseSortingFees = new ArrayList();//仓储分拣费 + List warehouseOperatingFees = new ArrayList();//仓储操作费 + + List deliveryServiceFees = new ArrayList();//配送服务费 + List deliveryFees = new ArrayList();//配送费 + List deliveryLoadingFees = new ArrayList();//配送装卸费 + List deliverySortingFees = new ArrayList();//配送分拣费 + List deliveryUpfloorFees = new ArrayList();//配送上楼费 + List deliveryMoveFees = new ArrayList();//配送平移费 + List deliveryCrossingFees = new ArrayList();//超区费 + + List installFees = new ArrayList();//安装费 + List quotationFees = new ArrayList();//保价费 + List claimingValues = new ArrayList();//申明价值 + List otherFees = new ArrayList();//其他费 + List returnFees = new ArrayList();//回扣 + List thirdOprationFees = new ArrayList();//三方操作费 + List xPays = new ArrayList();//现付 + List dPays = new ArrayList();//到付 + List hPays = new ArrayList();//回付 + List 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 statisticsOrderInfoEntities = baseMapper.selectList(new QueryWrapper().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(); + } + + } diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsWaybillInfoServiceImpl.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsWaybillInfoServiceImpl.java index 31777f266..92050fcad 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsWaybillInfoServiceImpl.java +++ b/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 implements IStatisticsWaybillInfoService { + } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.xml b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.xml index 6b8d462fb..f79226ad6 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.xml +++ b/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 and ltb.warehouse_id = #{param.warehouseId} diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml index 16521c510..6afe2abe9 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml +++ b/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' and ltcl.end_warehouse_ids like concat('%',#{param.warehouseId},'%') @@ -376,6 +377,12 @@ and ltcl.load_status != '0' + + and ltcl.create_time >= #{param.startTime} + + + and ltcl.create_time <= #{param.endTime} + order by ltcl.create_time desc @@ -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} - - and ltcl.create_time >= #{param.startDate} + + and ltcl.create_time >= #{param.startTime} - - and ltcl.create_time <= #{param.endDate} + + and ltcl.create_time <= #{param.endTime} and ltcl.load_status = '0' diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderAsyncServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderAsyncServiceImpl.java index ea5fd8132..eb360b6e6 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderAsyncServiceImpl.java +++ b/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 list = advanceDetailService.findAdvanceDetailVoByAdvanceIds(advanceIds); - //把list按goodsName分组,并统计一个count,转成一个map -// Map countMap = list.stream() -// .collect(Collectors.toMap(TrunklineAdvanceDetailVO::getGoodsName, TrunklineAdvanceDetailVO::getQuantity, Integer::sum)); -// countMap.keySet().forEach(goodsName -> { -// WarehouseWayBillDetail warehouseWayBillDetail = detailsMap.get(goodsName); -// -// -// -// }); - - List jsonList = new ArrayList<>(); list.forEach(advanceDetailVO -> { diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java index 5d2ebce3e..5850c1487 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java @@ -288,7 +288,7 @@ public class TrunklineAdvanceDetailServiceImpl extends BaseServiceImpl pageList = baseMapper.tripartiteTransferPageList(page, loadCarsDTO); return pageList; } @@ -2038,10 +2041,10 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl pageList = baseMapper.carsLoadPageList(page, loadCarsDTO); return R.data(pageList); @@ -5470,6 +5473,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl 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) diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.java index 4c4281d66..58aac705c 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.java +++ b/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; @@ -65,4 +66,6 @@ public interface WarehouseWaybillMapper extends BaseMapper findWaybillBilllByWaybillNos(@Param("waybillNos") List waybillNos); + + List exportWaybillList(@Param("param") WarehouseWaybillDTO waybillDTO); } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml index 066d7f059..f282851cf 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml @@ -475,5 +475,142 @@ + diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWaybillService.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWaybillService.java index 08dceafd0..41f1fe4c3 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWaybillService.java +++ b/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; @@ -77,4 +78,6 @@ public interface IWarehouseWaybillService extends BaseService pageFinanceWaybillList(WarehouseWaybillDTO waybillDTO); List findWaybillBilllByWaybillNos(List waybillNos); + + List exportWaybillList(WarehouseWaybillDTO waybillDTO); } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java index 60d509a88..fc5446e4d 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java +++ b/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; @@ -849,6 +851,35 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl 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 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 warehouseWayBillDetails, BasicPrintTemplateEntity template) throws Exception { PrintPreviewVO printPreviewVO = new PrintPreviewVO(); String html = TemplateUtil.getTemplateByUrl(template.getTemplateUrl());