Browse Source

1.对销售合同进行完善测试,并不断修改代码2.已完成对销售合同的初步测试,1条合同数据已能正常导入测试表

胡北宽 4 months ago
parent
commit
e5269b87c0

+ 4
- 1
src/main/java/com/example/backend/entity/common/CustCtrl.java View File

@@ -474,7 +474,7 @@ public class CustCtrl {
474 474
 
475 475
     //部门编码
476 476
     @TableField(exist = false)
477
-    private String deptCdoe;
477
+    private String deptCode;
478 478
 
479 479
     //费用代码
480 480
     @TableField(exist = false)
@@ -494,4 +494,7 @@ public class CustCtrl {
494 494
 
495 495
 
496 496
 
497
+
498
+
499
+
497 500
 }

+ 2
- 1
src/main/java/com/example/backend/entity/contract/ContractErrorLogEntity.java View File

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.*;
4 4
 import lombok.Data;
5 5
 
6 6
 import java.time.LocalDateTime;
7
+import java.util.Date;
7 8
 
8 9
 /**
9 10
  * 合同错误日志表
@@ -26,5 +27,5 @@ public class ContractErrorLogEntity {
26 27
 
27 28
     // 创建时间
28 29
     @TableField("CREATE_DATE")
29
-    private LocalDateTime createDate;
30
+    private Date createDate;
30 31
 }

+ 1
- 1
src/main/java/com/example/backend/entity/contract/SalesCollectMethodEntity.java View File

@@ -11,7 +11,7 @@ import java.time.LocalDateTime;
11 11
  * 销售合同收款计划
12 12
  */
13 13
 @Data
14
-@TableName("SGGMIIP.salesCollectMethod")
14
+@TableName("SGGMINFT.salesCollectMethod")
15 15
 public class SalesCollectMethodEntity {
16 16
 
17 17
     // 主键ID

+ 3
- 70
src/main/java/com/example/backend/excel/ExpSvcRateExcelDTO.java View File

@@ -4,7 +4,6 @@ import com.alibaba.excel.annotation.ExcelProperty;
4 4
 import lombok.Data;
5 5
 
6 6
 import java.math.BigDecimal;
7
-import java.time.LocalDateTime;
8 7
 
9 8
 /**
10 9
  * 费用费率表
@@ -12,8 +11,8 @@ import java.time.LocalDateTime;
12 11
 @Data
13 12
 public class ExpSvcRateExcelDTO {
14 13
 
15
-    @ExcelProperty("主键ID")
16
-    private Long id;
14
+    @ExcelProperty("销售合同号")
15
+    private String fno;
17 16
 
18 17
     @ExcelProperty("款项类型")
19 18
     private String paymentType;
@@ -24,75 +23,9 @@ public class ExpSvcRateExcelDTO {
24 23
     @ExcelProperty("结束天数")
25 24
     private BigDecimal endDays;
26 25
 
27
-    @ExcelProperty("年化费率")
26
+    @ExcelProperty("年化费率%")
28 27
     private BigDecimal annualRate;
29 28
 
30 29
     @ExcelProperty("起步天数")
31 30
     private BigDecimal minDays;
32
-
33
-    @ExcelProperty("流程实例id")
34
-    private String processInstanceId;
35
-
36
-    @ExcelProperty("业务id")
37
-    private Long fmodalid;
38
-
39
-    @ExcelProperty("数据来源id")
40
-    private Long sourceid;
41
-
42
-    @ExcelProperty("数据来源表")
43
-    private String sourcetable;
44
-
45
-    @ExcelProperty("创建账号")
46
-    private String createBy;
47
-
48
-    @ExcelProperty("创建时间")
49
-    private LocalDateTime createTime;
50
-
51
-    @ExcelProperty("创建人")
52
-    private String createByName;
53
-
54
-    @ExcelProperty("更新账号")
55
-    private String updateBy;
56
-
57
-    @ExcelProperty("更新时间")
58
-    private LocalDateTime updateTime;
59
-
60
-    @ExcelProperty("更新人")
61
-    private String updateByName;
62
-
63
-    @ExcelProperty("单据状态")
64
-    private String placed;
65
-
66
-    @ExcelProperty("图片")
67
-    private String imgIds;
68
-
69
-    @ExcelProperty("调取次数")
70
-    private Integer inc;
71
-
72
-    @ExcelProperty("关联id")
73
-    private Long rid;
74
-
75
-    @ExcelProperty("归档状态")
76
-    private String fsaved;
77
-
78
-    @ExcelProperty("模版名称")
79
-    private String sysTemplateName;
80
-
81
-    @ExcelProperty("是否删除")
82
-    private Integer delFlag;
83
-
84
-    @ExcelProperty("行号")
85
-    private Integer line;
86
-
87
-    @ExcelProperty("部门名称")
88
-    private String deptName;
89
-
90
-    @ExcelProperty("部门代码")
91
-    private String deptId;
92
-
93
-    @ExcelProperty("当前版本号")
94
-    private Integer curChangeVer;
95
-
96
-    @ExcelProperty("销售合同号")
97
-    private String fno;
98 31
 }

+ 12
- 105
src/main/java/com/example/backend/excel/FeeDtlExcelDTO.java View File

@@ -4,7 +4,6 @@ import com.alibaba.excel.annotation.ExcelProperty;
4 4
 import lombok.Data;
5 5
 
6 6
 import java.math.BigDecimal;
7
-import java.time.LocalDateTime;
8 7
 
9 8
 /**
10 9
  * 费用明细表
@@ -12,123 +11,31 @@ import java.time.LocalDateTime;
12 11
 @Data
13 12
 public class FeeDtlExcelDTO {
14 13
 
15
-    @ExcelProperty("主键ID")
16
-    private Long id;
17
-
18
-    @ExcelProperty("预估费用代码")
19
-    private String feeCd;
14
+    @ExcelProperty("销售合同号")
15
+    private String fno;
20 16
 
21 17
     @ExcelProperty("费用名称")
22 18
     private String feeNm;
23 19
 
24
-    @ExcelProperty("币种")
25
-    private String curcy;
26
-
27
-    @ExcelProperty("汇率")
28
-    private BigDecimal rate;
29
-
30
-    @ExcelProperty("费用金额")
31
-    private BigDecimal feeAmt;
20
+    @ExcelProperty("费用税率%")
21
+    private BigDecimal taxRate;
32 22
 
33 23
     @ExcelProperty("费用描述")
34 24
     private String feeDesc;
35 25
 
36
-    @ExcelProperty("备注")
37
-    private String remark;
38
-
39
-    @ExcelProperty("费用单价")
40
-    private BigDecimal feePrice;
41
-
42
-    @ExcelProperty("计费方式")
43
-    private String chargeMode;
44
-
45
-    @ExcelProperty("行号")
46
-    private BigDecimal line;
47
-
48
-    @ExcelProperty("流程实例id")
49
-    private String processInstanceId;
50
-
51
-    @ExcelProperty("业务id")
52
-    private Long fmodalid;
53
-
54
-    @ExcelProperty("数据来源id")
55
-    private Long sourceid;
56
-
57
-    @ExcelProperty("数据来源表")
58
-    private String sourcetable;
59
-
60
-    @ExcelProperty("创建账号")
61
-    private String createBy;
62
-
63
-    @ExcelProperty("创建时间")
64
-    private LocalDateTime createTime;
65
-
66
-    @ExcelProperty("创建人")
67
-    private String createByName;
68
-
69
-    @ExcelProperty("更新账号")
70
-    private String updateBy;
71
-
72
-    @ExcelProperty("更新时间")
73
-    private LocalDateTime updateTime;
74
-
75
-    @ExcelProperty("更新人")
76
-    private String updateByName;
77
-
78
-    @ExcelProperty("单据状态")
79
-    private String placed;
80
-
81
-    @ExcelProperty("图片")
82
-    private String imgIds;
83
-
84
-    @ExcelProperty("调取次数")
85
-    private Integer inc;
86
-
87
-    @ExcelProperty("关联id")
88
-    private Long rid;
89
-
90
-    @ExcelProperty("归档状态")
91
-    private String fsaved;
92
-
93
-    @ExcelProperty("模版名称")
94
-    private String sysTemplateName;
95
-
96
-    @ExcelProperty("是否删除")
97
-    private Integer delFlag;
98
-
99
-    @ExcelProperty("费用金额(不含税)")
100
-    private BigDecimal ntFeeAmt;
101
-
102
-    @ExcelProperty("费用承担方")
103
-    private String feePayer;
104
-
105
-    @ExcelProperty("销售合同号")
106
-    private String fno;
107
-
108
-    @ExcelProperty("部门名称")
109
-    private String deptName;
26
+    @ExcelProperty("币别")
27
+    private String curcy;
110 28
 
111
-    @ExcelProperty("部门代码")
112
-    private String deptId;
29
+    @ExcelProperty("费用金额")
30
+    private BigDecimal feeAmt;
113 31
 
114 32
     @ExcelProperty("费用分摊类型")
115 33
     private String allocationCategory;
116 34
 
117
-    @ExcelProperty("费用金额CNY")
118
-    private BigDecimal feeAmtCny;
119
-
120
-    @ExcelProperty("当前版本号")
121
-    private Integer curChangeVer;
122
-
123
-    @ExcelProperty("美元汇率")
124
-    private BigDecimal rateUsd;
125
-
126
-    @ExcelProperty("费用税率%")
127
-    private BigDecimal taxRate;
35
+    @ExcelProperty("备注")
36
+    private String remark;
128 37
 
129
-    @ExcelProperty("大类代码")
130
-    private String cateCode;
38
+    private String feeCd;
131 39
 
132
-    @ExcelProperty("大类名称")
133
-    private String cateName;
40
+    private BigDecimal rate ;
134 41
 }

+ 17
- 102
src/main/java/com/example/backend/excel/RCenterDtlExcelDTO.java View File

@@ -4,7 +4,6 @@ import com.alibaba.excel.annotation.ExcelProperty;
4 4
 import lombok.Data;
5 5
 
6 6
 import java.math.BigDecimal;
7
-import java.time.LocalDateTime;
8 7
 
9 8
 /**
10 9
  * 责任中心明细表
@@ -12,120 +11,36 @@ import java.time.LocalDateTime;
12 11
 @Data
13 12
 public class RCenterDtlExcelDTO {
14 13
 
15
-    @ExcelProperty("主键ID")
16
-    private Long id;
17
-
18
-    @ExcelProperty("行号")
19
-    private BigDecimal line;
20
-
21
-    @ExcelProperty("责任中心代码")
22
-    private String respCtrCode;
23
-
24
-    @ExcelProperty("责任中心名称")
25
-    private String respCtrName;
26
-
27
-    @ExcelProperty("金额考核占比%")
28
-    private BigDecimal assessRatio;
29
-
30
-    @ExcelProperty("占比金额")
31
-    private BigDecimal assessAmt;
32
-
33
-    @ExcelProperty("流程实例id")
34
-    private String processInstanceId;
35
-
36 14
     @ExcelProperty("销售合同号")
37 15
     private String fno;
38 16
 
39
-    @ExcelProperty("单据日期")
40
-    private LocalDateTime fdate;
41
-
42
-    @ExcelProperty("单据状态")
43
-    private String placed;
44
-
45
-    @ExcelProperty("业务id")
46
-    private Long fmodalid;
47
-
48
-    @ExcelProperty("数据来源id")
49
-    private Long sourceid;
50
-
51
-    @ExcelProperty("数据来源表")
52
-    private String sourcetable;
53
-
54
-    @ExcelProperty("图片")
55
-    private String imgIds;
56
-
57
-    @ExcelProperty("调取次数")
58
-    private Integer inc;
59
-
60
-    @ExcelProperty("关联id")
61
-    private Long rid;
62
-
63
-    @ExcelProperty("归档状态")
64
-    private String fsaved;
65
-
66
-    @ExcelProperty("备注")
67
-    private String remark;
68
-
69
-    @ExcelProperty("模版名称")
70
-    private String sysTemplateName;
71
-
72
-    @ExcelProperty("是否删除")
73
-    private Integer delFlag;
74
-
75
-    @ExcelProperty("制单人代码")
76
-    private String createBy;
77
-
78
-    @ExcelProperty("创建时间")
79
-    private LocalDateTime createTime;
80
-
81
-    @ExcelProperty("创建人")
82
-    private String createByName;
83
-
84
-    @ExcelProperty("更新账号")
85
-    private String updateBy;
86
-
87
-    @ExcelProperty("更新时间")
88
-    private LocalDateTime updateTime;
89
-
90
-    @ExcelProperty("更新人")
91
-    private String updateByName;
92
-
93
-    @ExcelProperty("制单人部门名称")
94
-    private String deptName;
95
-
96
-    @ExcelProperty("制单人部门代码")
97
-    private String deptId;
17
+    @ExcelProperty("公司代码")
18
+    private String institutionId;
98 19
 
99
-    @ExcelProperty("当前版本号")
100
-    private Integer curChangeVer;
20
+    @ExcelProperty("公司名称")
21
+    private String institutionNm;
101 22
 
102 23
     @ExcelProperty("利润考核占比%")
103 24
     private BigDecimal assessQtyRate;
104 25
 
105
-    @ExcelProperty("人员代码")
106
-    private String personid;
107
-
108
-    @ExcelProperty("人员名称")
109
-    private String personname;
26
+    @ExcelProperty("金额考核占比%")
27
+    private BigDecimal assessRatio;
110 28
 
111
-    @ExcelProperty("部门代码")
112
-    private String personDeptId;
29
+    @ExcelProperty("制单人代码")
30
+    private String createBy;
113 31
 
114
-    @ExcelProperty("部门名称")
32
+    @ExcelProperty(index =7)
115 33
     private String personDeptNm;
34
+    @ExcelProperty(index =8)
116 35
 
117
-    @ExcelProperty("公司代码")
118
-    private String institutionId;
119
-
120
-    @ExcelProperty("公司名称")
121
-    private String institutionNm;
36
+    private String personDeptId;
37
+    @ExcelProperty(index =9)
122 38
 
123
-    @ExcelProperty("保供合同一键三联id")
124
-    private Long oneClickSourceid;
39
+    private String deptId;
40
+    @ExcelProperty(index =10)
125 41
 
126
-    @ExcelProperty("保供合同一键三联类型")
127
-    private String oneClickSourcetype;
42
+    private String deptName;
43
+    @ExcelProperty(index =11)
128 44
 
129
-    @ExcelProperty("来源类型")
130
-    private String sourcetype;
45
+    private String createByName;
131 46
 }

+ 12
- 87
src/main/java/com/example/backend/excel/SalesCollectExcelDTO.java View File

@@ -12,111 +12,36 @@ import java.time.LocalDateTime;
12 12
 @Data
13 13
 public class SalesCollectExcelDTO {
14 14
 
15
-    @ExcelProperty("主键ID")
16
-    private Long id;
17
-
18
-    @ExcelProperty("计划发生日期")
19
-    private LocalDateTime planDt;
20
-
21
-    @ExcelProperty("款项类别")
22
-    private String paymentType;
23
-
24
-    @ExcelProperty("款项比例")
25
-    private BigDecimal paymentRatio;
26
-
27
-    @ExcelProperty("付款方式")
28
-    private String payMode;
29
-
30
-    @ExcelProperty("备注")
31
-    private String clauseRemark;
32
-
33
-    @ExcelProperty("流程实例id")
34
-    private String processInstanceId;
35 15
 
36 16
     @ExcelProperty("销售合同号")
37 17
     private String fno;
38 18
 
39
-    @ExcelProperty("单据日期")
40
-    private LocalDateTime fdate;
41
-
42
-    @ExcelProperty("单据状态")
43
-    private String placed;
19
+    @ExcelProperty("账期")
20
+    private Integer payDays;
44 21
 
45
-    @ExcelProperty("业务id")
46
-    private Long fmodalid;
22
+    @ExcelProperty("收款方式")
23
+    private String payMode;
47 24
 
48
-    @ExcelProperty("数据来源id")
49
-    private Long sourceid;
50 25
 
51
-    @ExcelProperty("数据来源表")
52
-    private String sourcetable;
26
+    @ExcelProperty("款项比例%")
27
+    private BigDecimal paymentRatio;
53 28
 
54
-    @ExcelProperty("图片")
55
-    private String imgIds;
29
+    @ExcelProperty("款项类别")
30
+    private String paymentType;
56 31
 
57
-    @ExcelProperty("调取次数")
58
-    private Integer inc;
32
+    @ExcelProperty("收款收证银行名称")
33
+    private String ourBankNm;
59 34
 
60
-    @ExcelProperty("关联id")
61
-    private Long rid;
35
+    @ExcelProperty("收款收证银行账户")
36
+    private String ourBankAcct;
62 37
 
63
-    @ExcelProperty("归档状态")
64
-    private String fsaved;
65 38
 
66 39
     @ExcelProperty("备注")
67 40
     private String remark;
68 41
 
69
-    @ExcelProperty("模版名称")
70
-    private String sysTemplateName;
71
-
72
-    @ExcelProperty("是否删除")
73
-    private Integer delFlag;
74
-
75
-    @ExcelProperty("制单人部门代码")
76
-    private String deptId;
77
-
78
-    @ExcelProperty("制单人部门名称")
79
-    private String deptName;
80
-
81
-    @ExcelProperty("创建账号")
82
-    private String createBy;
83
-
84
-    @ExcelProperty("创建时间")
85
-    private LocalDateTime createTime;
86
-
87
-    @ExcelProperty("创建人")
88
-    private String createByName;
89
-
90
-    @ExcelProperty("更新账号")
91
-    private String updateBy;
92
-
93
-    @ExcelProperty("更新时间")
94
-    private LocalDateTime updateTime;
95 42
 
96
-    @ExcelProperty("更新人")
97
-    private String updateByName;
98 43
 
99
-    @ExcelProperty("当前版本号")
100
-    private Integer curChangeVer;
101
-
102
-    @ExcelProperty("金额")
103
-    private BigDecimal paymentAmt;
104
-
105
-    @ExcelProperty("账期")
106
-    private Integer payDays;
107
-
108
-    @ExcelProperty("收款收证银行名称")
109
-    private String ourBankNm;
110
-
111
-    @ExcelProperty("收款收证银行账户")
112
-    private String ourBankAcct;
113 44
 
114
-    @ExcelProperty("来源类型")
115
-    private String sourcetype;
116 45
 
117
-    @ExcelProperty("保供合同一键三联id")
118
-    private Long oneClickSourceid;
119 46
 
120
-    @ExcelProperty("保供合同一键三联类型")
121
-    private String oneClickSourcetype;
122 47
 }

+ 105
- 120
src/main/java/com/example/backend/excel/SalesContractExcelDTO.java View File

@@ -2,180 +2,165 @@ package com.example.backend.excel;
2 2
 import com.alibaba.excel.annotation.ExcelProperty;
3 3
 import lombok.Data;
4 4
 
5
+import java.math.BigDecimal;
6
+import java.util.Date;
7
+
5 8
 /**
6 9
  * 销售合同主表 - 跳过标题列
7 10
  */
8 11
 @Data
9 12
 public class SalesContractExcelDTO {
10 13
 
11
-    @ExcelProperty(index = 1)
12
-    private String sono; // 销售合同号
13
-
14
-    @ExcelProperty(index = 2)
15
-    private String createBy; // 制单人代码
16
-
17
-    @ExcelProperty(index = 3)
18
-    private String createByName; // 制单人名称
19
-
20
-    @ExcelProperty(index = 4)
21
-    private String serviceType; // 业务类型
22
-
23
-    @ExcelProperty(index = 5)
24
-    private String bizType; // 合同类型
25
-
26
-    @ExcelProperty(index = 6)
27
-    private String bizProductType; // 合同产品类型
28
-
29
-    @ExcelProperty(index = 7)
30
-    private String contrExecCd; // 合同执行人代码
14
+    @ExcelProperty("销售合同号")
15
+    private String sono;
31 16
 
32
-    @ExcelProperty(index = 8)
33
-    private String contrExecNm; // 合同执行人名称
17
+    @ExcelProperty("制单人代码")
18
+    private String createBy;
34 19
 
35
-    @ExcelProperty(index = 9)
36
-    private String ctName; // 客户名称
20
+    @ExcelProperty("制单人名称")
21
+    private String createByName;
37 22
 
38
-    @ExcelProperty(index = 10)
39
-    private String ctNo; // 客户代码
23
+    @ExcelProperty("业务类型")
24
+    private String serviceType;
40 25
 
41
-    @ExcelProperty(index = 11)
42
-    private String ctContNm; // 客户联系人名称
26
+    @ExcelProperty("合同类型")
27
+    private String bizType;
43 28
 
44
-    @ExcelProperty(index = 12)
45
-    private String ctBankName; // 客户开户银行
29
+    @ExcelProperty("合同产品类型")
30
+    private String bizProductType;
46 31
 
47
-    @ExcelProperty(index = 13)
48
-    private String ctBankAcct; // 客户银行账户
32
+    @ExcelProperty("合同执行人代码")
33
+    private String contrExecCd;
49 34
 
50
-    @ExcelProperty(index = 14)
51
-    private String ctOrderNo; // 客户合同号
35
+    @ExcelProperty("合同执行人名称")
36
+    private String contrExecNm;
52 37
 
53
-    @ExcelProperty(index = 15)
54
-    private String curcy; // 币别
38
+    @ExcelProperty("客户名称")
39
+    private String ctName;
55 40
 
56
-    @ExcelProperty(index = 16)
57
-    private String estArrDt; // 最迟集港日期
41
+    @ExcelProperty("客户联系人名称")
42
+    private String ctContNm;
58 43
 
59
-    @ExcelProperty(index = 17)
60
-    private String estLoadDt; // 最迟装运日期
44
+    @ExcelProperty("客户开户银行")
45
+    private String ctBankName;
61 46
 
62
-    @ExcelProperty(index = 18)
63
-    private String outstandingDay; // 预计客商占款天数
47
+    @ExcelProperty("客户银行账户")
48
+    private String ctBankAcct;
64 49
 
65
-    @ExcelProperty(index = 19)
66
-    private String fours; // 我方编号 ← 新增
50
+    @ExcelProperty("客户合同号")
51
+    private String ctOrderNo;
67 52
 
68
-    @ExcelProperty(index = 20)
69
-    private String foursname; // 我方名称
53
+    @ExcelProperty("币别")
54
+    private String curcy;
70 55
 
71
-    @ExcelProperty(index = 21)
72
-    private String ourBankAcct; // 我方银行账号
56
+    @ExcelProperty("最迟集港日期")
57
+    private Date estArrDt;
73 58
 
74
-    @ExcelProperty(index = 22)
75
-    private String ourBankNm; // 我方开户银行
59
+    @ExcelProperty("最迟装运日期")
60
+    private Date estLoadDt;
76 61
 
77
-    @ExcelProperty(index = 23)
78
-    private String ifClearBottom; // 是否清底
62
+    @ExcelProperty("预计客商占款天数")
63
+    private Integer outstandingDay;
79 64
 
80
-    @ExcelProperty(index = 24)
81
-    private String ifLongTerm; // 是否长协
65
+    @ExcelProperty("我方名称")
66
+    private String foursname;
82 67
 
83
-    @ExcelProperty(index = 25)
84
-    private String longTermContract; // 长协合同号
68
+    @ExcelProperty("我方银行账号")
69
+    private String ourBankAcct;
85 70
 
86
-    @ExcelProperty(index = 26)
87
-    private String lPort; // 装运港
71
+    @ExcelProperty("我方开户银行")
72
+    private String ourBankNm;
88 73
 
89
-    @ExcelProperty(index = 27)
90
-    private String lPortCtry; // 装运国 ← 新增
74
+    @ExcelProperty("是否清底")
75
+    private String ifClearBottom;
91 76
 
92
-    @ExcelProperty(index = 28)
93
-    private String dPort; // 目的港
77
+    @ExcelProperty("是否长协")
78
+    private String ifLongTerm;
94 79
 
95
-    @ExcelProperty(index = 29)
96
-    private String dPortCtry; // 目的国 ← 新增
80
+    @ExcelProperty("长协合同号")
81
+    private String longTermContract;
97 82
 
98
-    @ExcelProperty(index = 30)
99
-    private String qtyOver; // 数量溢装%
83
+    @ExcelProperty("装运港")
84
+    private String lPort;
100 85
 
101
-    @ExcelProperty(index = 31)
102
-    private String qtyShort; // 数量短装%
86
+    @ExcelProperty("目的港")
87
+    private String dPort;
103 88
 
104
-    @ExcelProperty(index = 32)
105
-    private String amtOver; // 金额溢装%
89
+    @ExcelProperty("数量溢装%")
90
+    private BigDecimal qtyOver;
106 91
 
107
-    @ExcelProperty(index = 33)
108
-    private String amtShort; // 金额短装%
92
+    @ExcelProperty("数量短装%")
93
+    private BigDecimal qtyShort;
109 94
 
110
-    @ExcelProperty(index = 34)
111
-    private String insuranceType; // 保险种类
95
+    @ExcelProperty("金额溢装%")
96
+    private BigDecimal amtOver;
112 97
 
113
-    @ExcelProperty(index = 35)
114
-    private String insuranceAmt; // 保险费率%
98
+    @ExcelProperty("金额短装%")
99
+    private BigDecimal amtShort;
115 100
 
116
-    @ExcelProperty(index = 36)
117
-    private String rate; // 折人民币汇率 ← 新增
101
+    @ExcelProperty("保险种类")
102
+    private String insuranceType;
118 103
 
119
-    @ExcelProperty(index = 37)
120
-    private String rateUs; // 执行美元汇率 ← 新增
104
+    @ExcelProperty("保险费率%")
105
+    private BigDecimal insuranceAmt;
121 106
 
122
-    @ExcelProperty(index = 38)
123
-    private String signLoc; // 签约地点
107
+    @ExcelProperty("签约地点")
108
+    private String signLoc;
124 109
 
125
-    @ExcelProperty(index = 39)
126
-    private String terms; // 价格条款
110
+    @ExcelProperty("价格条款")
111
+    private String terms;
127 112
 
128
-    @ExcelProperty(index = 40)
129
-    private String loadUnloadTerms; // 装卸条款
113
+    @ExcelProperty("装卸条款")
114
+    private String loadUnloadTerms;
130 115
 
131
-    @ExcelProperty(index = 41)
132
-    private String delivLoc; // 交货地点
116
+    @ExcelProperty("交货地点")
117
+    private String delivLoc;
133 118
 
134
-    @ExcelProperty(index = 42)
135
-    private String delivMtd; // 交货方式
119
+    @ExcelProperty("交货方式")
120
+    private String delivMtd;
136 121
 
137
-    @ExcelProperty(index = 43)
138
-    private String tranWay; // 运输方式
122
+    @ExcelProperty("运输方式")
123
+    private String tranWay;
139 124
 
140
-    @ExcelProperty(index = 44)
141
-    private String whetherChartering; // 是否租船
125
+    @ExcelProperty("是否租船")
126
+    private String whetherChartering;
142 127
 
143
-    @ExcelProperty(index = 45)
144
-    private String chnShipName; // 中文船名
128
+    @ExcelProperty("中文船名")
129
+    private String chnShipName;
145 130
 
146
-    @ExcelProperty(index = 46)
147
-    private String engShipName; // 英文船名
131
+    @ExcelProperty("英文船名")
132
+    private String engShipName;
148 133
 
149
-    @ExcelProperty(index = 47)
150
-    private String agentNo; // 代理采购协议号
134
+    @ExcelProperty("代理采购协议号")
135
+    private String agentNo;
151 136
 
152
-    @ExcelProperty(index = 48)
153
-    private String agentNoSo; // 代理销售协议号
137
+    @ExcelProperty("代理销售协议号")
138
+    private String agentNoSo;
154 139
 
155
-    @ExcelProperty(index = 49)
156
-    private String commContrNo; // 佣金合同号
140
+    @ExcelProperty("佣金合同号")
141
+    private String commContrNo;
157 142
 
158
-    @ExcelProperty(index = 50)
159
-    private String sDelivDt; // 销售交货日期
143
+    @ExcelProperty("销售交货日期")
144
+    private Date sDelivDt;
160 145
 
161
-    @ExcelProperty(index = 51)
162
-    private String ifWeighedSalesQty; // 是否过磅数量结算
146
+    @ExcelProperty("是否过磅数量结算")
147
+    private String ifWeighedSalesQty;
163 148
 
164
-    @ExcelProperty(index = 52)
165
-    private String settIndex; // 结算指标
149
+    @ExcelProperty("结算指标")
150
+    private String settIndex;
166 151
 
167
-    @ExcelProperty(index = 53)
168
-    private String ifBatch; // 是否允许分批
152
+    @ExcelProperty("是否允许分批")
153
+    private String ifBatch;
169 154
 
170
-    @ExcelProperty(index = 54)
171
-    private String ifTransfer; // 是否允许转运
155
+    @ExcelProperty("是否允许转运")
156
+    private String ifTransfer;
172 157
 
173
-    @ExcelProperty(index = 55)
174
-    private String contrDesc; // 合同描述
158
+    @ExcelProperty("合同描述")
159
+    private String contrDesc;
175 160
 
176
-    @ExcelProperty(index = 56)
177
-    private String remark; // 备注信息
161
+    @ExcelProperty("备注信息")
162
+    private String remark;
178 163
 
179
-    @ExcelProperty(index = 57)
180
-    private String pono; // 采购合同号
164
+    @ExcelProperty("采购合同号")
165
+    private String pono;
181 166
 }

+ 48
- 295
src/main/java/com/example/backend/excel/SalesDtlExcelDTO.java View File

@@ -4,46 +4,36 @@ import com.alibaba.excel.annotation.ExcelProperty;
4 4
 import lombok.Data;
5 5
 
6 6
 import java.math.BigDecimal;
7
-import java.time.LocalDateTime;
8 7
 
9 8
 /**
10
- * 销售合同产品明细 销售批次表从表
9
+ * 销售合同产品明细
11 10
  */
12 11
 @Data
13 12
 public class SalesDtlExcelDTO {
14 13
 
15
-    @ExcelProperty("主键ID")
16
-    private Long id;
17
-
18
-    @ExcelProperty("行号")
19
-    private BigDecimal line;
20
-
21
-    @ExcelProperty("销售合同主键")
22
-    private Long rrid;
14
+    @ExcelProperty("销售合同号")
15
+    private String fno;
23 16
 
24 17
     @ExcelProperty("商品编号")
25 18
     private String itemno;
26 19
 
27
-    @ExcelProperty("中文品名")
28
-    private String sdesc;
20
+    @ExcelProperty("采购币种")
21
+    private String curcyPo;
29 22
 
30
-    @ExcelProperty("英文品名")
31
-    private String edesc;
23
+    @ExcelProperty("增值税率%")
24
+    private BigDecimal inTaxRate;
32 25
 
33
-    @ExcelProperty("规格描述")
34
-    private String spec;
26
+    @ExcelProperty("含铁量%")
27
+    private BigDecimal ironCont;
35 28
 
36 29
     @ExcelProperty("水分%")
37 30
     private BigDecimal moisture;
38 31
 
39
-    @ExcelProperty("含铁量%")
40
-    private BigDecimal ironCont;
41
-
42
-    @ExcelProperty("湿吨数量")
43
-    private BigDecimal wetTonQty;
32
+    @ExcelProperty("煤焦计价水%")
33
+    private BigDecimal coalMoisture;
44 34
 
45
-    @ExcelProperty("干吨数量")
46
-    private BigDecimal dryTonQty;
35
+    @ExcelProperty("采购单价")
36
+    private BigDecimal poprice;
47 37
 
48 38
     @ExcelProperty("计价方式")
49 39
     private String priceMtd;
@@ -51,248 +41,41 @@ public class SalesDtlExcelDTO {
51 41
     @ExcelProperty("数量")
52 42
     private BigDecimal qty;
53 43
 
54
-    @ExcelProperty("销售单价")
55
-    private BigDecimal soPrice;
56
-
57
-    @ExcelProperty("不含税单价")
58
-    private BigDecimal ntSoPrice;
59
-
60
-    @ExcelProperty("单位")
61
-    private String ut;
62
-
63
-    @ExcelProperty("原币金额")
64
-    private BigDecimal soAmt;
65
-
66
-    @ExcelProperty("未税金额")
67
-    private BigDecimal ntSoAmt;
68
-
69
-    @ExcelProperty("税额")
70
-    private BigDecimal taxAmt;
71
-
72
-    @ExcelProperty("本币金额")
73
-    private BigDecimal localAmt;
74
-
75
-    @ExcelProperty("美元金额")
76
-    private BigDecimal usdAmt;
77
-
78
-    @ExcelProperty("海关编码")
79
-    private String hsCode;
80
-
81
-    @ExcelProperty("海关中文名称")
82
-    private String hsNameCn;
83
-
84
-    @ExcelProperty("海关英文名称")
85
-    private String hsNameEn;
86
-
87
-    @ExcelProperty("关税税率%")
88
-    private BigDecimal dutyRate;
89
-
90
-    @ExcelProperty("进项税率%")
91
-    private BigDecimal inTaxRate;
44
+    @ExcelProperty("采购汇率")
45
+    private BigDecimal ratePo;
92 46
 
93 47
     @ExcelProperty("退税率 %")
94 48
     private BigDecimal reTaxRate;
95 49
 
96
-    @ExcelProperty("销项税率%")
97
-    private BigDecimal outTaxRate;
98
-
99
-    @ExcelProperty("备注")
100
-    private String remark;
101
-
102
-    @ExcelProperty("流程实例id")
103
-    private String processInstanceId;
104
-
105
-    @ExcelProperty("销售合同号")
106
-    private String fno;
107
-
108
-    @ExcelProperty("单据日期")
109
-    private LocalDateTime fdate;
110
-
111
-    @ExcelProperty("单据状态")
112
-    private String placed;
113
-
114
-    @ExcelProperty("业务id")
115
-    private Long fmodalid;
116
-
117
-    @ExcelProperty("数据来源id")
118
-    private Long sourceid;
119
-
120
-    @ExcelProperty("数据来源表")
121
-    private String sourcetable;
122
-
123
-    @ExcelProperty("图片")
124
-    private String imgIds;
125
-
126
-    @ExcelProperty("调取次数")
127
-    private Integer inc;
128
-
129
-    @ExcelProperty("关联id")
130
-    private Long rid;
131
-
132
-    @ExcelProperty("归档状态")
133
-    private String fsaved;
134
-
135
-    @ExcelProperty("模版名称")
136
-    private String sysTemplateName;
137
-
138
-    @ExcelProperty("是否删除")
139
-    private Integer delFlag;
140
-
141
-    @ExcelProperty("制单人部门代码")
142
-    private String deptId;
143
-
144
-    @ExcelProperty("制单人部门名称")
145
-    private String deptName;
146
-
147
-    @ExcelProperty("创建账号")
148
-    private String createBy;
149
-
150
-    @ExcelProperty("创建时间")
151
-    private LocalDateTime createTime;
152
-
153
-    @ExcelProperty("创建人")
154
-    private String createByName;
155
-
156
-    @ExcelProperty("更新账号")
157
-    private String updateBy;
158
-
159
-    @ExcelProperty("更新时间")
160
-    private LocalDateTime updateTime;
161
-
162
-    @ExcelProperty("更新人")
163
-    private String updateByName;
164
-
165
-    @ExcelProperty("合同批次号")
166
-    private String batchNo;
167
-
168
-    @ExcelProperty("合同号")
169
-    private String sono;
170
-
171
-    @ExcelProperty("供应商代码")
172
-    private String supCode;
173
-
174
-    @ExcelProperty("供应商名称")
175
-    private String supName;
176
-
177
-    @ExcelProperty("未税金额")
178
-    private BigDecimal ntPoAmt;
179
-
180
-    @ExcelProperty("未税单价")
181
-    private BigDecimal ntPoPrice;
182
-
183
-    @ExcelProperty("采购单价")
184
-    private BigDecimal poprice;
185
-
186
-    @ExcelProperty("采购金额")
187
-    private BigDecimal poamt;
188
-
189 50
     @ExcelProperty("资源号")
190 51
     private String resourceNo;
191 52
 
192
-    @ExcelProperty("采购合同号")
193
-    private String pono;
194
-
195
-    @ExcelProperty("客户订单号")
196
-    private String ctOrderNo;
197
-
198
-    @ExcelProperty("客户代码")
199
-    private String ctNo;
200
-
201
-    @ExcelProperty("客户名称")
202
-    private String ctName;
203
-
204
-    @ExcelProperty("采购币种")
205
-    private String curcyPo;
206
-
207
-    @ExcelProperty("采购汇率")
208
-    private BigDecimal ratePo;
209
-
210
-    @ExcelProperty("业务账套")
211
-    private String acctSet;
212
-
213
-    @ExcelProperty("人民币含税金额")
214
-    private BigDecimal cnypoam;
215
-
216
-    @ExcelProperty("美元含税金额")
217
-    private BigDecimal usdpoamt;
218
-
219
-    @ExcelProperty("销售币种")
220
-    private String curcySo;
221
-
222
-    @ExcelProperty("销售汇率")
223
-    private BigDecimal rateSo;
224
-
225
-    @ExcelProperty("销售美元汇率")
226
-    private String rateUsdSo;
227
-
228
-    @ExcelProperty("人民币含税金额")
229
-    private BigDecimal cnysoamt;
230
-
231
-    @ExcelProperty("美元含税金额")
232
-    private BigDecimal usdsoamt;
233
-
234
-    @ExcelProperty("采购产品ID")
235
-    private Long poid;
236
-
237
-    @ExcelProperty("销售产品ID")
238
-    private Long soid;
239
-
240
-    @ExcelProperty("商品大类")
241
-    private String typeName;
242
-
243
-    @ExcelProperty("销售产品分摊费用合计CNY")
244
-    private BigDecimal soShareFeeCny;
245
-
246
-    @ExcelProperty("销售产品单位分摊费用CNY")
247
-    private BigDecimal soUnitFeeCny;
248
-
249
-    @ExcelProperty("采购产品分摊费用合计CNY")
250
-    private BigDecimal poShareFeeCny;
251
-
252
-    @ExcelProperty("采购产品单位分摊费用CNY")
253
-    private BigDecimal poUnitFeeCny;
254
-
255
-    @ExcelProperty("当前版本号")
256
-    private Integer curChangeVer;
257
-
258
-    @ExcelProperty("来源单号")
259
-    private String sourceno;
260
-
261
-    @ExcelProperty("装运港")
262
-    private String lPort;
263
-
264
-    @ExcelProperty("目的港")
265
-    private String dPort;
266
-
267
-    @ExcelProperty("中文规格描述")
268
-    private String specCn;
269
-
270
-    @ExcelProperty("牌号")
271
-    private String brand;
53
+    @ExcelProperty("钢厂资源号")
54
+    private String smrNo;
272 55
 
273
-    @ExcelProperty("")
274
-    private BigDecimal fnum1;
56
+    @ExcelProperty("批次号")
57
+    private String batchNo;
275 58
 
276
-    @ExcelProperty("")
277
-    private BigDecimal fnum2;
59
+    @ExcelProperty("QP描述")
60
+    private String qpDesc;
278 61
 
279
-    @ExcelProperty("")
280
-    private BigDecimal fnum3;
62
+    @ExcelProperty("规格描述")
63
+    private String spec;
281 64
 
282 65
     @ExcelProperty("件数")
283 66
     private BigDecimal qua;
284 67
 
285
-    @ExcelProperty("单重")
286
-    private BigDecimal snw;
68
+    @ExcelProperty("销售单价")
69
+    private BigDecimal soPrice;
287 70
 
288
-    @ExcelProperty("卷重范围")
289
-    private String ftype1;
71
+    @ExcelProperty("长")
72
+    private BigDecimal fnum3;
290 73
 
291 74
     @ExcelProperty("米重")
292 75
     private BigDecimal fnum4;
293 76
 
294
-    @ExcelProperty("直径")
295
-    private BigDecimal fnum5;
77
+    @ExcelProperty("捆数")
78
+    private BigDecimal fnum8;
296 79
 
297 80
     @ExcelProperty("捆单重")
298 81
     private BigDecimal fnum6;
@@ -300,72 +83,42 @@ public class SalesDtlExcelDTO {
300 83
     @ExcelProperty("捆支数")
301 84
     private BigDecimal fnum7;
302 85
 
303
-    @ExcelProperty("H型钢规格")
304
-    private String ftype2;
305
-
306
-    @ExcelProperty("规格描述")
307
-    private String ftype3;
308
-
309
-    @ExcelProperty("计重方式")
310
-    private String ftype4;
311
-
312 86
     @ExcelProperty("色标")
313 87
     private String ftype5;
314 88
 
315
-    @ExcelProperty("捆数")
316
-    private BigDecimal fnum8;
317
-
318
-    @ExcelProperty("数值预留字段2")
319
-    private BigDecimal fnum9;
320
-
321
-    @ExcelProperty("文本预留字段1")
322
-    private String ftype6;
323
-
324 89
     @ExcelProperty("螺纹规格库")
325 90
     private String ftype7;
326 91
 
327
-    @ExcelProperty("煤焦计价水%")
328
-    private BigDecimal coalMoisture;
92
+    @ExcelProperty("计重方式")
93
+    private String ftype4;
329 94
 
330
-    @ExcelProperty("钢厂资源号")
331
-    private String smrNo;
95
+    @ExcelProperty("净重")
96
+    private BigDecimal fnw;
332 97
 
333 98
     @ExcelProperty("毛重")
334 99
     private BigDecimal fgw;
335 100
 
336
-    @ExcelProperty("净重")
337
-    private BigDecimal fnw;
101
+    @ExcelProperty("税额")
102
+    private BigDecimal taxAmt;
338 103
 
339
-    @ExcelProperty("钢材产品判断字段")
340
-    private String ifgc;
104
+    @ExcelProperty("单位")
105
+    private String ut;
341 106
 
342 107
     @ExcelProperty("装运港")
343
-    private String sourcetype;
344
-
345
-    @ExcelProperty("装运港代码")
346
-    private String lpno;
347
-
348
-    @ExcelProperty("目的港代码")
349
-    private String dpno;
350
-
351
-    @ExcelProperty("保供合同一键三联ID")
352
-    private Long oneClickSourceid;
353
-
354
-    @ExcelProperty("保供合同一键三联类型")
355
-    private String oneClickSourcetype;
108
+    private String lPort;
356 109
 
357
-    @ExcelProperty("采购计价方式")
358
-    private String priceMtdPo;
110
+    @ExcelProperty("目的港")
111
+    private String dPort;
359 112
 
360
-    @ExcelProperty("出口关税税率%")
361
-    private BigDecimal eDutyRate;
113
+    @ExcelProperty("海关编码")
114
+    private String hsCode;
362 115
 
363
-    @ExcelProperty("计价数量")
364
-    private BigDecimal priceQty;
116
+    @ExcelProperty("海关中文名称")
117
+    private String hsNameCn;
365 118
 
366
-    @ExcelProperty("数量占比")
367
-    private BigDecimal qtyRate;
119
+    @ExcelProperty("海关英文名称")
120
+    private String hsNameEn;
368 121
 
369
-    @ExcelProperty("金额占比")
370
-    private BigDecimal amtRate;
122
+    @ExcelProperty("备注")
123
+    private String remark;
371 124
 }

+ 7
- 0
src/main/java/com/example/backend/mapper/contract/SalesDtlMapper.java View File

@@ -3,7 +3,11 @@ package com.example.backend.mapper.contract;
3 3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 4
 import com.example.backend.entity.contract.SalesContractEntity;
5 5
 import com.example.backend.entity.contract.SalesDtlEntity;
6
+import org.apache.ibatis.annotations.Delete;
6 7
 import org.apache.ibatis.annotations.Mapper;
8
+import org.apache.ibatis.annotations.Param;
9
+
10
+import java.util.List;
7 11
 
8 12
 /**
9 13
  * 销售合同主表Mapper
@@ -11,4 +15,7 @@ import org.apache.ibatis.annotations.Mapper;
11 15
 @Mapper
12 16
 public interface SalesDtlMapper extends BaseMapper<SalesDtlEntity> {
13 17
 
18
+
19
+
20
+
14 21
 }

+ 56
- 40
src/main/java/com/example/backend/service/contract/impl/SalesContractServiceImpl.java View File

@@ -76,20 +76,36 @@ public class SalesContractServiceImpl implements SalesContractService {
76 76
                             SalesContractExcelDTO dto = mainDataList.get(i);
77 77
                             SalesContractEntity entity = new SalesContractEntity();
78 78
                             BeanUtils.copyProperties(dto, entity);
79
+                            //删除已经存在的合同
80
+                            if(!StringUtils.isEmpty(entity.getSono())) {
81
+                                List<Long> idList = salesContractMapper.selectList(new QueryWrapper<SalesContractEntity>()
82
+                                                .select("id")
83
+                                                .eq("sono", entity.getSono()))
84
+                                        .stream()
85
+                                        .map(SalesContractEntity::getId)
86
+                                        .collect(Collectors.toList());
87
+                                salesContractMapper.deleteBatchIds(idList);
88
+                                salesDtlMapper.delete(new QueryWrapper<SalesDtlEntity>().in("rid", idList));
89
+                                salesCollectMethodMapper.delete(new QueryWrapper<SalesCollectMethodEntity>().in("rid", idList));
90
+                                rCenterDtlMapper.delete(new QueryWrapper<RCenterDtlEntity>().in("rid", idList));
91
+                                feeDtlMapper.delete(new QueryWrapper<FeeDtlEntity>().in("rid", idList));
92
+                                expSvcRateMapper.delete(new QueryWrapper<ExpSvcRateEntity>().in("rid", idList));
93
+                            }
94
+
79 95
                             entity.setCreateTime(new Date());
80 96
 
81 97
                             // === 日期字段转换 ===
82
-                            entity.setEstArrDt(DateUtils.parseToDate(dto.getEstArrDt()));
83
-                            entity.setEstLoadDt(DateUtils.parseToDate(dto.getEstLoadDt()));
84
-                            entity.setSDelivDt(DateUtils.parseToDate(dto.getSDelivDt()));
98
+//                            entity.setEstArrDt(DateUtils.parseToDate(dto.getEstArrDt()));
99
+//                            entity.setEstLoadDt(DateUtils.parseToDate(dto.getEstLoadDt()));
100
+//                            entity.setSDelivDt(DateUtils.parseToDate(dto.getSDelivDt()));
85 101
 
86 102
                             // === 数值字段转换 ===
87
-                            entity.setOutstandingDay(NumberUtils.parseToInteger(dto.getOutstandingDay()));
88
-                            entity.setQtyOver(NumberUtils.parseToBigDecimal(dto.getQtyOver()));
89
-                            entity.setQtyShort(NumberUtils.parseToBigDecimal(dto.getQtyShort()));
90
-                            entity.setAmtOver(NumberUtils.parseToBigDecimal(dto.getAmtOver()));
91
-                            entity.setAmtShort(NumberUtils.parseToBigDecimal(dto.getAmtShort()));
92
-                            entity.setInsuranceAmt(NumberUtils.parseToBigDecimal(dto.getInsuranceAmt()));
103
+//                            entity.setOutstandingDay(NumberUtils.parseToInteger(dto.getOutstandingDay()));
104
+//                            entity.setQtyOver(NumberUtils.parseToBigDecimal(dto.getQtyOver()));
105
+//                            entity.setQtyShort(NumberUtils.parseToBigDecimal(dto.getQtyShort()));
106
+//                            entity.setAmtOver(NumberUtils.parseToBigDecimal(dto.getAmtOver()));
107
+//                            entity.setAmtShort(NumberUtils.parseToBigDecimal(dto.getAmtShort()));
108
+//                            entity.setInsuranceAmt(NumberUtils.parseToBigDecimal(dto.getInsuranceAmt()));
93 109
 
94 110
                             // 记录当前处理的行号,用于错误提示
95 111
                             int currentRow = i + 1; // Excel行号从1开始
@@ -180,10 +196,10 @@ public class SalesContractServiceImpl implements SalesContractService {
180 196
                                 errors.add("主表(Sheet1) 第 " + currentRow + " 行:客户名称有误!");
181 197
                                 currentRowValid = false;
182 198
                             }
183
-                            if (ctNameList != null && !ctNameList.isEmpty()&& !"2".equals(ctNameList.get(0).getPlaced())) {
184
-                                errors.add("主表(Sheet1) 第 " + currentRow + " 行:客户名称没有审批通过!");
185
-                                currentRowValid = false;
186
-                            }
199
+//                            if (ctNameList != null && !ctNameList.isEmpty()&& !"2".equals(ctNameList.get(0).getPlaced())) {
200
+//                                errors.add("主表(Sheet1) 第 " + currentRow + " 行:客户名称没有审批通过!");
201
+//                                currentRowValid = false;
202
+//                            }
187 203
                             ctName = entity.getCtName();
188 204
 
189 205
                             if (ctNameList != null && ctNameList.get(0).getFno().isEmpty()) {
@@ -244,10 +260,7 @@ public class SalesContractServiceImpl implements SalesContractService {
244 260
                                     currentRowValid = false;
245 261
                                 }
246 262
                             }
247
-                            if(StringUtils.isEmpty(entity.getFours())){
248
-                                errors.add("主表(Sheet1) 第 " + currentRow + " 行:我方编号不能为空!");
249
-                                currentRowValid = false;
250
-                            }
263
+
251 264
 
252 265
                             if (StringUtils.isEmpty(entity.getFoursname())) {
253 266
                                 errors.add("主表(Sheet1) 第 " + currentRow + " 行:我方名称不能为空!");
@@ -471,9 +484,6 @@ public class SalesContractServiceImpl implements SalesContractService {
471 484
                             if (StringUtils.isEmpty(entity.getUt())) {
472 485
                                 errors.add("产品明细(Sheet2) 第 " + currentRow + " 行:单位不能为空");
473 486
                             }
474
-                            if (StringUtils.isEmpty(entity.getSdesc())) {
475
-                                errors.add("产品明细(Sheet2) 第 " + currentRow + " 行:中文品名不能为空");
476
-                            }
477 487
 
478 488
                             List<CustCtrl> itemnoList = custCtrlMapper.selectByItemno(entity.getItemno(), bizProductType);
479 489
                             if (itemnoList == null || itemnoList.isEmpty()) {
@@ -485,7 +495,10 @@ public class SalesContractServiceImpl implements SalesContractService {
485 495
                             }
486 496
 
487 497
                             if (itemnoList != null && !Objects.isNull(itemnoList.get(0).getInTaxRate())) {
488
-                                if (!Objects.equals(entity.getInTaxRate(), itemnoList.get(0).getInTaxRate())) {
498
+                                BigDecimal taxRate1 = entity.getInTaxRate();
499
+                                BigDecimal taxRate2 = itemnoList.get(0).getInTaxRate();
500
+
501
+                                if (taxRate1 != null && taxRate2 != null && taxRate1.compareTo(taxRate2) != 0) {
489 502
                                     errors.add("产品明细(Sheet2) 第 " + currentRow + " 行:输入的增值税率与匹配增值税率不一致!");
490 503
                                 }
491 504
                             }
@@ -509,9 +522,7 @@ public class SalesContractServiceImpl implements SalesContractService {
509 522
                             }
510 523
 
511 524
                             if (itemnoList != null && !itemnoList.get(0).getSdesc().isEmpty()) {
512
-                                if (!entity.getSdesc().equals(itemnoList.get(0).getSdesc())) {
513
-                                    errors.add("产品明细(Sheet2) 第 " + currentRow + " 行:输入的中文品名与匹配到的中文品名不一致!");
514
-                                }
525
+                                entity.setSdesc(itemnoList.get(0).getSdesc());
515 526
                             }
516 527
 
517 528
                             if (itemnoList != null && !itemnoList.get(0).getEdesc().isEmpty()) {
@@ -538,7 +549,7 @@ public class SalesContractServiceImpl implements SalesContractService {
538 549
                             }
539 550
 
540 551
                             if (curcyList != null && !curcyList.isEmpty() && !Objects.isNull(curcyList.get(0).getRate()) && !Objects.isNull(entity.getRatePo())) {
541
-                                if (Objects.equals(entity.getRatePo(), curcyList.get(0).getRate())) {
552
+                                if (entity.getRatePo().compareTo(curcyList.get(0).getRate())!=0) {
542 553
                                     errors.add("产品明细(Sheet2) 第 " + currentRow + " 行:采购汇率和匹配到的采购汇率不符!");
543 554
                                 }
544 555
                             }
@@ -584,14 +595,13 @@ public class SalesContractServiceImpl implements SalesContractService {
584 595
                             }
585 596
 
586 597
                             if ("钢产品".equals(bizProductType)) {
587
-                                if (StringUtils.isEmpty(entity.getBrand())) {
598
+
599
+                                List<CustCtrl> itemnoList1 = custCtrlMapper.selectByItemno(entity.getItemno(), bizProductType);
600
+                                if (itemnoList1 != null && !itemnoList1.isEmpty() && itemnoList1.get(0).getBrand().isEmpty()) {
588 601
                                     errors.add("产品明细(Sheet2) 第 " + currentRow + " 行:合同产品类型为钢产品时,牌号不能为空!");
589 602
                                 }
590
-                                List<CustCtrl> itemnoList1 = custCtrlMapper.selectByItemno(entity.getItemno(), bizProductType);
591 603
                                 if (itemnoList1 != null && !itemnoList1.isEmpty() && !itemnoList1.get(0).getBrand().isEmpty()) {
592
-                                    if (!entity.getBrand().equals(itemnoList1.get(0).getBrand())) {
593
-                                        errors.add("产品明细(Sheet2) 第 " + currentRow + " 行:输入的牌号与匹配到的牌号不一致!");
594
-                                    }
604
+                                    entity.setBrand(itemnoList1.get(0).getBrand());
595 605
                                 }
596 606
 
597 607
                                 if (StringUtils.isEmpty(entity.getFtype3())) {
@@ -604,7 +614,7 @@ public class SalesContractServiceImpl implements SalesContractService {
604 614
                                 }
605 615
                                 if (ftype3List != null && !ftype3List.isEmpty() && !Objects.isNull(ftype3List.get(0).getFnum4())
606 616
                                         && !Objects.isNull(entity.getFnum4())) {
607
-                                    if (!Objects.equals(entity.getFnum4(), ftype3List.get(0).getFnum4())) {
617
+                                    if (entity.getFnum4().compareTo(ftype3List.get(0).getFnum4())!=0) {
608 618
                                         errors.add("产品明细(Sheet2) 第 " + currentRow + " 行:输入的米重与匹配到的米重不一致!");
609 619
                                     }
610 620
                                 }
@@ -795,12 +805,12 @@ public class SalesContractServiceImpl implements SalesContractService {
795 805
                             errors.add("责任中心(Sheet4) 第 " + currentRow + " 行:部门名称有误!");
796 806
                         }
797 807
 
798
-                        if (personDeptNmList != null && !personDeptNmList.isEmpty() && personDeptNmList.get(0).getDeptCdoe().isEmpty()) {
808
+                        if (personDeptNmList != null && !personDeptNmList.isEmpty() && personDeptNmList.get(0).getDeptCode().isEmpty()) {
799 809
                             errors.add("责任中心(Sheet4) 第 " + currentRow + " 行:匹配到的部门编码为空");
800 810
                         }
801 811
 
802
-                        if (personDeptNmList != null && !personDeptNmList.isEmpty() && !personDeptNmList.get(0).getDeptCdoe().isEmpty()) {
803
-                            dto.setPersonDeptId(personDeptNmList.get(0).getDeptCdoe());
812
+                        if (personDeptNmList != null && !personDeptNmList.isEmpty() && !personDeptNmList.get(0).getDeptCode().isEmpty()) {
813
+                            dto.setPersonDeptId(personDeptNmList.get(0).getDeptCode());
804 814
                         }
805 815
 
806 816
                         if (personDeptNmList != null && !personDeptNmList.isEmpty() && StringUtils.isEmpty(dto.getInstitutionNm())
@@ -823,11 +833,11 @@ public class SalesContractServiceImpl implements SalesContractService {
823 833
                                 errors.add("责任中心(Sheet4) 第 " + currentRow + " 行:制单人代码有误!");
824 834
                             }
825 835
 
826
-                            if (createByList != null && !createByList.isEmpty() && createByList.get(0).getDeptCode().isEmpty()) {
836
+                            if (createByList != null && !createByList.isEmpty() && createByList.get(0).getId().isEmpty()) {
827 837
                                 errors.add("责任中心(Sheet4) 第 " + currentRow + " 行:制单人代码查到的制单人部门编码为空!");
828 838
                             }
829 839
 
830
-                            if (createByList != null && !createByList.isEmpty() && !createByList.get(0).getDeptCode().isEmpty()) {
840
+                            if (createByList != null && !createByList.isEmpty() && !createByList.get(0).getId().isEmpty()) {
831 841
                                 dto.setDeptId(createByList.get(0).getDeptCode());
832 842
                             }
833 843
 
@@ -972,10 +982,16 @@ public class SalesContractServiceImpl implements SalesContractService {
972 982
         // ==========  最终检查所有错误,如果有 → 回滚事务并返回统一信息 ==========
973 983
         if (!errors.isEmpty()) {
974 984
 
975
-            // 保存到错误日志表
976
-            ContractErrorLogEntity log = new ContractErrorLogEntity();
977
-            log.setErrorLog(String.join("\n", errors));
978
-            contractErrorLogMapper.insert(log);
985
+            try {
986
+                // 先保存错误日志
987
+                ContractErrorLogEntity log = new ContractErrorLogEntity();
988
+                log.setErrorLog(String.join("\n", errors));
989
+                log.setCreateDate(new Date());
990
+                contractErrorLogMapper.insert(log);
991
+            } catch (Exception logException) {
992
+                // 日志保存失败也不影响主流程
993
+                System.err.println("保存错误日志失败: " + logException.getMessage());
994
+            }
979 995
 
980 996
             // 抛异常,触发事务回滚
981 997
             throw new RuntimeException("Excel 导入出现以下错误:\n" + String.join("\n", errors));

+ 2
- 2
src/main/resources/mapper/CustCtrlMapper.xml View File

@@ -130,8 +130,8 @@
130 130
         SELECT
131 131
             t.fno,
132 132
             t.cpny,
133
-            t.deptname,
134
-            t.deptcode
133
+            t.deptname as deptName,
134
+            t.deptcode as deptCode
135 135
         FROM (
136 136
                  SELECT DISTINCT
137 137
                      c.fno,

+ 1
- 1
src/main/resources/mapper/SysUserMapper.xml View File

@@ -36,7 +36,7 @@
36 36
 
37 37
     </select>
38 38
     <select id="selectByCreateBy" resultType="com.example.backend.entity.common.SysUser">
39
-        select a.DEPT_CODE, a.DEPT_NAME,c.user_desc,c.USER_CODE
39
+        select a.id,a.dept_code, a.DEPT_NAME,c.user_desc,c.USER_CODE
40 40
         from SGGMIIP.SYS_DEPARTMENT a
41 41
                  join SGGMIIP.SYS_USER_DEPARTMENT b on a.id = b.DEPT_ID
42 42
                  join SGGMIIP.SYS_USER c on b.USER_ID = c.id

Loading…
Cancel
Save