From d7bf82b159c6245e450546d78641d427d72ef3bf Mon Sep 17 00:00:00 2001 From: b2894lxlx <517289602@qq.com> Date: Fri, 16 Oct 2026 00:56:54 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E6=96=B0=E5=A2=9E=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E7=BB=93=E7=AE=97=E5=8D=95=EF=BC=8C=E5=B9=B6=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E8=BF=90=E5=8D=95=E8=B6=85=E7=AE=A1=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E4=B8=8E=E8=AE=A1=E9=87=8F=E5=8D=95=E4=BD=8D?= =?UTF-8?q?=E8=BD=AF=E5=88=A0=E6=81=A2=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- .gitignore | 2 + .../dto/SettlementImportBatchRequest.java | 107 ++ .../pojo/dto/SettlementImportVoidRequest.java | 51 + .../pojo/entity/SettlementImportBatch.java | 115 ++ .../transport/pojo/entity/Waybill.java | 3 + .../pojo/vo/SettlementImportBatchVO.java | 69 + .../system/mapper/MeasurementUnitMapper.java | 20 + .../system/mapper/MeasurementUnitMapper.xml | 28 + .../impl/MeasurementUnitServiceImpl.java | 32 + .../SettlementImportController.java | 147 +++ .../excel/SettlementImportFeeReader.java | 379 ++++++ .../excel/SettlementImportTemplateExcel.java | 121 ++ .../mapper/CustomerArchiveMapper.xml | 3 +- .../mapper/SettlementImportBatchMapper.java | 50 + .../IReceivablePayableDetailService.java | 15 + .../ISettlementImportBatchService.java | 69 + .../impl/ContractManageServiceImpl.java | 6 +- .../ReceivablePayableDetailServiceImpl.java | 180 +++ .../SettlementImportBatchServiceImpl.java | 1144 +++++++++++++++++ .../service/impl/WaybillServiceImpl.java | 19 +- ...lade_customer_archive_kingdee_20260917.sql | 14 +- ...ustomer_archive_sync_menu_fix_20261015.sql | 22 + ...blade_settlement_import_batch_20261015.sql | 60 + 23 files changed, 2639 insertions(+), 17 deletions(-) create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/dto/SettlementImportBatchRequest.java create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/dto/SettlementImportVoidRequest.java create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/SettlementImportBatch.java create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/SettlementImportBatchVO.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/controller/SettlementImportController.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/excel/SettlementImportFeeReader.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/excel/SettlementImportTemplateExcel.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/mapper/SettlementImportBatchMapper.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/service/ISettlementImportBatchService.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/SettlementImportBatchServiceImpl.java create mode 100644 doc/sql/transport/blade_customer_archive_sync_menu_fix_20261015.sql create mode 100644 doc/sql/transport/blade_settlement_import_batch_20261015.sql diff --git a/.gitignore b/.gitignore index b3add6d9..679f73ec 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,5 @@ Thumbs.db /.codex-work/ .serena/ .workbuddy/ +/data/ +/output/ diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/dto/SettlementImportBatchRequest.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/dto/SettlementImportBatchRequest.java new file mode 100644 index 00000000..2834e4cb --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/dto/SettlementImportBatchRequest.java @@ -0,0 +1,107 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.pojo.dto; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.util.List; +import java.util.Map; + +/** + * 导入结算单请求(列表筛选 + 确认/草稿入参) + * + * @author Chill + */ +@Data +@Schema(description = "导入结算单请求") +public class SettlementImportBatchRequest implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + @Schema(description = "主键") + private Long id; + + @Schema(description = "批次号") + private String batchNo; + + @Schema(description = "项目ID") + private Long projectId; + + @Schema(description = "项目名称") + private String projectName; + + @Schema(description = "结算类型 receivable/payable") + private String settlementType; + + @Schema(description = "结算单类型 formal/pre,应收仅 formal") + private String settlementBillType; + + @Schema(description = "客户合同ID") + private Long customerContractId; + + @Schema(description = "客户合同名称") + private String customerContractName; + + @Schema(description = "客户名称") + private String customerName; + + @Schema(description = "承运商合同ID") + private Long carrierContractId; + + @Schema(description = "承运商合同名称") + private String carrierContractName; + + @Schema(description = "承运商名称") + private String carrierName; + + @Schema(description = "运单模式:new=新运单,history=历史运单") + private String waybillMode; + + @Schema(description = "导入状态") + private String importStatus; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "动态费用列名") + private List feeItemNames; + + @Schema(description = "导入明细行") + private List> rows; + + @Schema(description = "分批追加") + private Boolean append; + + @Schema(description = "列表筛选:项目名称") + private String projectNameLike; + + @Schema(description = "列表筛选:创建人") + private Long createUser; +} diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/dto/SettlementImportVoidRequest.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/dto/SettlementImportVoidRequest.java new file mode 100644 index 00000000..bb330c14 --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/dto/SettlementImportVoidRequest.java @@ -0,0 +1,51 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.pojo.dto; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; + +/** + * 导入结算单作废请求 + * + * @author Chill + */ +@Data +@Schema(description = "导入结算单作废请求") +public class SettlementImportVoidRequest implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + @Schema(description = "批次主键") + private Long id; + + @Schema(description = "作废原因") + private String reason; +} diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/SettlementImportBatch.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/SettlementImportBatch.java new file mode 100644 index 00000000..88a3bcd4 --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/SettlementImportBatch.java @@ -0,0 +1,115 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.pojo.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.tenant.mp.TenantEntity; + +import java.io.Serial; + +/** + * 导入结算单批次 + * + * @author Chill + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("blade_settlement_import_batch") +@Schema(description = "导入结算单批次") +public class SettlementImportBatch extends TenantEntity { + + @Serial + private static final long serialVersionUID = 1L; + + @Schema(description = "批次号") + private String batchNo; + + @Schema(description = "项目ID") + private Long projectId; + + @Schema(description = "项目名称") + private String projectName; + + @Schema(description = "结算类型 receivable/payable") + private String settlementType; + + @Schema(description = "结算单类型 formal/pre") + private String settlementBillType; + + @Schema(description = "客户合同ID") + private Long customerContractId; + + @Schema(description = "客户合同名称") + private String customerContractName; + + @Schema(description = "客户名称") + private String customerName; + + @Schema(description = "承运商合同ID") + private Long carrierContractId; + + @Schema(description = "承运商合同名称") + private String carrierContractName; + + @Schema(description = "承运商名称") + private String carrierName; + + @Schema(description = "运单模式 new") + private String waybillMode; + + @Schema(description = "导入状态 draft/completed/voided") + private String importStatus; + + @Schema(description = "运单数量") + private Integer waybillCount; + + @Schema(description = "明细数量") + private Integer detailCount; + + @Schema(description = "正式结算单ID") + private Long formalSettlementId; + + @Schema(description = "正式结算单号") + private String formalSettlementNo; + + @Schema(description = "预结算单ID") + private Long preSettlementId; + + @Schema(description = "预结算单号") + private String preSettlementNo; + + @Schema(description = "动态费用列名JSON") + private String feeItemNamesJson; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "关联运单导入批次ID") + private Long waybillImportBatchId; +} diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/Waybill.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/Waybill.java index d79f1502..a3157095 100644 --- a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/Waybill.java +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/entity/Waybill.java @@ -249,6 +249,9 @@ public class Waybill extends TenantEntity { @Schema(description = "导入批次ID") private Long importBatchId; + @Schema(description = "导入结算单批次ID") + private Long settlementImportBatchId; + @Schema(description = "关联单号") private String relationNo; diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/SettlementImportBatchVO.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/SettlementImportBatchVO.java new file mode 100644 index 00000000..3f856a62 --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/SettlementImportBatchVO.java @@ -0,0 +1,69 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.pojo.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.transport.pojo.entity.SettlementImportBatch; + +import java.io.Serial; +import java.util.List; + +/** + * 导入结算单批次视图 + * + * @author Chill + */ +@Data +@EqualsAndHashCode(callSuper = true) +@Schema(description = "导入结算单批次视图") +public class SettlementImportBatchVO extends SettlementImportBatch { + + @Serial + private static final long serialVersionUID = 1L; + + @Schema(description = "创建人姓名") + private String createUserName; + + @Schema(description = "更新人姓名") + private String updateUserName; + + @Schema(description = "导入状态显示名") + private String importStatusName; + + @Schema(description = "结算类型显示名") + private String settlementTypeName; + + @Schema(description = "结算单类型显示名") + private String settlementBillTypeName; + + @Schema(description = "运单模式显示名") + private String waybillModeName; + + @Schema(description = "动态费用列名") + private List feeItemNames; +} diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/mapper/MeasurementUnitMapper.java b/blade-service/blade-system/src/main/java/org/springblade/system/mapper/MeasurementUnitMapper.java index e4b98971..940bb5bb 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/mapper/MeasurementUnitMapper.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/mapper/MeasurementUnitMapper.java @@ -34,6 +34,26 @@ import java.util.List; */ public interface MeasurementUnitMapper extends BaseMapper { + /** + * 按编码查询计量单位(包含逻辑删除记录,用于新增恢复)。 + */ + MeasurementUnit selectByUnitCodeIncludingDeleted(@Param("unitCode") String unitCode); + + /** + * 按名称查询计量单位(包含逻辑删除记录,用于新增恢复)。 + */ + MeasurementUnit selectByUnitNameIncludingDeleted(@Param("unitName") String unitName); + + /** + * 恢复逻辑删除计量单位。 + */ + int restoreById(@Param("id") Long id); + + /** + * 释放已软删除记录占用的单位名称,避免唯一索引冲突。 + */ + int releaseUnitName(@Param("id") Long id, @Param("unitName") String unitName); + /** * 自定义分页 * diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/mapper/MeasurementUnitMapper.xml b/blade-service/blade-system/src/main/java/org/springblade/system/mapper/MeasurementUnitMapper.xml index 10fbb903..4f0bd97d 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/mapper/MeasurementUnitMapper.xml +++ b/blade-service/blade-system/src/main/java/org/springblade/system/mapper/MeasurementUnitMapper.xml @@ -19,6 +19,34 @@ + + + + + + UPDATE blade_measurement_unit + SET is_deleted = 0 + WHERE id = #{id} + AND is_deleted = 1 + + + + UPDATE blade_measurement_unit + SET unit_name = #{unitName} + WHERE id = #{id} + AND is_deleted = 1 + +