Browse Source

1.新建销售Mapper文件和exceL解析类 2.新建销售exceL解析方法

胡北宽 10 months ago
parent
commit
36a06657a4

+ 58
- 0
src/main/java/com/example/backend/excel/ExcelUtils.java View File

@@ -124,6 +124,7 @@ public class ExcelUtils {
124 124
         return listener.getDataList();
125 125
     }
126 126
 
127
+
127 128
     /**
128 129
      * 读取其他条款sheet
129 130
      */
@@ -135,6 +136,63 @@ public class ExcelUtils {
135 136
         return listener.getDataList();
136 137
     }
137 138
 
139
+
140
+    /**
141
+     *读取合同产品明细sheet
142
+     */
143
+    public static List<SalesDtlExcelDTO> readSalesDtlSheet(MultipartFile file) throws IOException {
144
+        SimpleDataListener<SalesDtlExcelDTO> listener = new SimpleDataListener<SalesDtlExcelDTO>();
145
+        EasyExcel.read(file.getInputStream(), SalesDtlExcelDTO.class, listener)
146
+                .sheet(5) // 第六个sheet
147
+                .doRead();
148
+        return listener.getDataList();
149
+    }
150
+
151
+    /**
152
+     *读取收款计划sheet
153
+     */
154
+    public static List<SalesCollectExcelDTO> readSalesCollectSheet(MultipartFile file) throws IOException {
155
+        SimpleDataListener<SalesCollectExcelDTO> listener = new SimpleDataListener<SalesCollectExcelDTO>();
156
+        EasyExcel.read(file.getInputStream(), SalesCollectExcelDTO.class, listener)
157
+                .sheet(5) // 第六个sheet
158
+                .doRead();
159
+        return listener.getDataList();
160
+    }
161
+
162
+
163
+    /**
164
+     *读取责任中心sheet
165
+     */
166
+    public static List<RCenterDtlExcelDTO> readRCenterDtlSheet(MultipartFile file) throws IOException {
167
+        SimpleDataListener<RCenterDtlExcelDTO> listener = new SimpleDataListener<RCenterDtlExcelDTO>();
168
+        EasyExcel.read(file.getInputStream(), RCenterDtlExcelDTO.class, listener)
169
+                .sheet(5) // 第六个sheet
170
+                .doRead();
171
+        return listener.getDataList();
172
+    }
173
+
174
+    /**
175
+     *读取费用明细sheet
176
+     */
177
+    public static List<FeeDtlExcelDTO> readFeelDtlSheet(MultipartFile file) throws IOException {
178
+        SimpleDataListener<FeeDtlExcelDTO> listener = new SimpleDataListener<FeeDtlExcelDTO>();
179
+        EasyExcel.read(file.getInputStream(), FeeDtlExcelDTO.class, listener)
180
+                .sheet(5) // 第六个sheet
181
+                .doRead();
182
+        return listener.getDataList();
183
+    }
184
+
185
+    /**
186
+     *读取服务费率sheet
187
+     */
188
+    public static List<ExpSvcRateExcelDTO> readExpSvcRateSheet(MultipartFile file) throws IOException {
189
+        SimpleDataListener<ExpSvcRateExcelDTO> listener = new SimpleDataListener<ExpSvcRateExcelDTO>();
190
+        EasyExcel.read(file.getInputStream(), ExpSvcRateExcelDTO.class, listener)
191
+                .sheet(5) // 第六个sheet
192
+                .doRead();
193
+        return listener.getDataList();
194
+    }
195
+
138 196
     /**
139 197
      * 简单的数据监听器
140 198
      */

+ 95
- 0
src/main/java/com/example/backend/excel/ExpSvcRateExcelDTO.java View File

@@ -0,0 +1,95 @@
1
+package com.example.backend.excel;
2
+
3
+import com.alibaba.excel.annotation.ExcelProperty;
4
+import lombok.Data;
5
+
6
+import java.math.BigDecimal;
7
+import java.time.LocalDateTime;
8
+
9
+/**
10
+ * 费用费率表
11
+ */
12
+@Data
13
+public class ExpSvcRateExcelDTO {
14
+
15
+    @ExcelProperty("主键ID")
16
+    private Long id;
17
+
18
+    @ExcelProperty("款项类型")
19
+    private String paymentType;
20
+
21
+    @ExcelProperty("开始天数")
22
+    private BigDecimal startDays;
23
+
24
+    @ExcelProperty("结束天数")
25
+    private BigDecimal endDays;
26
+
27
+    @ExcelProperty("年化费率")
28
+    private BigDecimal annualRate;
29
+
30
+    @ExcelProperty("起步天数")
31
+    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
+}

+ 134
- 0
src/main/java/com/example/backend/excel/FeeDtlExcelDTO.java View File

@@ -0,0 +1,134 @@
1
+package com.example.backend.excel;
2
+
3
+import com.alibaba.excel.annotation.ExcelProperty;
4
+import lombok.Data;
5
+
6
+import java.math.BigDecimal;
7
+import java.time.LocalDateTime;
8
+
9
+/**
10
+ * 费用明细表
11
+ */
12
+@Data
13
+public class FeeDtlExcelDTO {
14
+
15
+    @ExcelProperty("主键ID")
16
+    private Long id;
17
+
18
+    @ExcelProperty("预估费用代码")
19
+    private String feeCd;
20
+
21
+    @ExcelProperty("预估费用名称")
22
+    private String feeNm;
23
+
24
+    @ExcelProperty("币种")
25
+    private String curcy;
26
+
27
+    @ExcelProperty("汇率")
28
+    private BigDecimal rate;
29
+
30
+    @ExcelProperty("费用金额(含税)")
31
+    private BigDecimal feeAmt;
32
+
33
+    @ExcelProperty("费用描述")
34
+    private String feeDesc;
35
+
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;
110
+
111
+    @ExcelProperty("部门代码")
112
+    private String deptId;
113
+
114
+    @ExcelProperty("费用分摊类型")
115
+    private String allocationCategory;
116
+
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;
128
+
129
+    @ExcelProperty("大类代码")
130
+    private String cateCode;
131
+
132
+    @ExcelProperty("大类名称")
133
+    private String cateName;
134
+}

+ 131
- 0
src/main/java/com/example/backend/excel/RCenterDtlExcelDTO.java View File

@@ -0,0 +1,131 @@
1
+package com.example.backend.excel;
2
+
3
+import com.alibaba.excel.annotation.ExcelProperty;
4
+import lombok.Data;
5
+
6
+import java.math.BigDecimal;
7
+import java.time.LocalDateTime;
8
+
9
+/**
10
+ * 责任中心明细表
11
+ */
12
+@Data
13
+public class RCenterDtlExcelDTO {
14
+
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
+    @ExcelProperty("单据号")
37
+    private String fno;
38
+
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;
98
+
99
+    @ExcelProperty("当前版本号")
100
+    private Integer curChangeVer;
101
+
102
+    @ExcelProperty("利润占比")
103
+    private BigDecimal assessQtyRate;
104
+
105
+    @ExcelProperty("人员代码")
106
+    private String personid;
107
+
108
+    @ExcelProperty("人员名称")
109
+    private String personname;
110
+
111
+    @ExcelProperty("人员部门代码")
112
+    private String personDeptId;
113
+
114
+    @ExcelProperty("人员部门名称")
115
+    private String personDeptNm;
116
+
117
+    @ExcelProperty("人员公司代码")
118
+    private String institutionId;
119
+
120
+    @ExcelProperty("人员公司名称")
121
+    private String institutionNm;
122
+
123
+    @ExcelProperty("保供合同一键三联id")
124
+    private Long oneClickSourceid;
125
+
126
+    @ExcelProperty("保供合同一键三联类型")
127
+    private String oneClickSourcetype;
128
+
129
+    @ExcelProperty("来源类型")
130
+    private String sourcetype;
131
+}

+ 122
- 0
src/main/java/com/example/backend/excel/SalesCollectExcelDTO.java View File

@@ -0,0 +1,122 @@
1
+package com.example.backend.excel;
2
+
3
+import com.alibaba.excel.annotation.ExcelProperty;
4
+import lombok.Data;
5
+
6
+import java.math.BigDecimal;
7
+import java.time.LocalDateTime;
8
+
9
+/**
10
+ * 销售合同收款方式
11
+ */
12
+@Data
13
+public class SalesCollectExcelDTO {
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
+
36
+    @ExcelProperty("单据号")
37
+    private String fno;
38
+
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 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
+
96
+    @ExcelProperty("更新人")
97
+    private String updateByName;
98
+
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
+
114
+    @ExcelProperty("来源类型")
115
+    private String sourcetype;
116
+
117
+    @ExcelProperty("保供合同一键三联id")
118
+    private Long oneClickSourceid;
119
+
120
+    @ExcelProperty("保供合同一键三联类型")
121
+    private String oneClickSourcetype;
122
+}

+ 621
- 15
src/main/java/com/example/backend/excel/SalesContractExcelDTO.java View File

@@ -1,38 +1,644 @@
1 1
 package com.example.backend.excel;
2 2
 
3 3
 import com.alibaba.excel.annotation.ExcelProperty;
4
-import com.alibaba.excel.annotation.format.DateTimeFormat;
5 4
 import lombok.Data;
6 5
 
7 6
 import java.math.BigDecimal;
8
-import java.util.Date;
7
+import java.time.LocalDateTime;
9 8
 
10 9
 /**
11
- * 销售合同Excel导入DTO
10
+ * 销售合同主表
12 11
  */
13 12
 @Data
14 13
 public class SalesContractExcelDTO {
15 14
 
16
-    @ExcelProperty("合同编号")
17
-    private String contractCode;
15
+    @ExcelProperty("主键ID")
16
+    private Long id;
18 17
 
19
-    @ExcelProperty("客户名称")
20
-    private String customerName;
18
+    @ExcelProperty("单据号码")
19
+    private String fno;
20
+
21
+    @ExcelProperty("单据日期")
22
+    private LocalDateTime fdate;
23
+
24
+    @ExcelProperty("销售合同号")
25
+    private String sono;
26
+
27
+    @ExcelProperty("客户订单号")
28
+    private String ctOrderNo;
29
+
30
+    @ExcelProperty("业务类型")
31
+    private String bizType;
32
+
33
+    @ExcelProperty("业务账套")
34
+    private String acctSet;
35
+
36
+    @ExcelProperty("条款类型")
37
+    private String clauseType;
38
+
39
+    @ExcelProperty("签约日期")
40
+    private LocalDateTime signDate;
41
+
42
+    @ExcelProperty("代理协议号")
43
+    private String agentNo;
44
+
45
+    @ExcelProperty("佣金合同号")
46
+    private String commContrNo;
47
+
48
+    @ExcelProperty("合同起始有效期")
49
+    private LocalDateTime contrStart;
50
+
51
+    @ExcelProperty("合同截止有效期")
52
+    private LocalDateTime contrEnd;
53
+
54
+    @ExcelProperty("销售交货日期")
55
+    private LocalDateTime sDelivDt;
56
+
57
+    @ExcelProperty("合同描述")
58
+    private String contrDesc;
59
+
60
+    @ExcelProperty("我方代码")
61
+    private String fours;
62
+
63
+    @ExcelProperty("我方名称")
64
+    private String foursname;
65
+
66
+    @ExcelProperty("我方开户银行")
67
+    private String ourBankNm;
68
+
69
+    @ExcelProperty("我方银行账号")
70
+    private String ourBankAcct;
21 71
 
22 72
     @ExcelProperty("客户代码")
23
-    private String customerCode;
73
+    private String ctNo;
74
+
75
+    @ExcelProperty("客户名称")
76
+    private String ctName;
77
+
78
+    @ExcelProperty("客户开户银行")
79
+    private String ctBankName;
80
+
81
+    @ExcelProperty("客户银行账户")
82
+    private String ctBankAcct;
83
+
84
+    @ExcelProperty("客户联系人名称")
85
+    private String ctContNm;
86
+
87
+    @ExcelProperty("币别")
88
+    private String curcy;
89
+
90
+    @ExcelProperty("汇率")
91
+    private BigDecimal rate;
92
+
93
+    @ExcelProperty("原币总金额")
94
+    private BigDecimal totalAmt;
95
+
96
+    @ExcelProperty("人民币总金额")
97
+    private BigDecimal totalCnyAmt;
98
+
99
+    @ExcelProperty("美元总金额")
100
+    private BigDecimal totalUsdAmt;
101
+
102
+    @ExcelProperty("总数量")
103
+    private BigDecimal totalQty;
104
+
105
+    @ExcelProperty("放货仓库代码")
106
+    private String stockno;
107
+
108
+    @ExcelProperty("放货仓库名称")
109
+    private String stockname;
110
+
111
+    @ExcelProperty("预估毛利率")
112
+    private BigDecimal estGrossMR;
113
+
114
+    @ExcelProperty("预估毛利金额")
115
+    private BigDecimal estGrossMA;
116
+
117
+    @ExcelProperty("预估成本总金额")
118
+    private BigDecimal estTotCost;
119
+
120
+    @ExcelProperty("预估费用总金额")
121
+    private BigDecimal estTotFee;
122
+
123
+    @ExcelProperty("预估回款周期")
124
+    private BigDecimal estPayCycle;
125
+
126
+    @ExcelProperty("预估资金成本")
127
+    private BigDecimal estFundCost;
128
+
129
+    @ExcelProperty("价格条款")
130
+    private String terms;
131
+
132
+    @ExcelProperty("签约地点")
133
+    private String signLoc;
134
+
135
+    @ExcelProperty("交货地点")
136
+    private String delivLoc;
137
+
138
+    @ExcelProperty("装运港")
139
+    private String lPort;
140
+
141
+    @ExcelProperty("目的港")
142
+    private String dPort;
143
+
144
+    @ExcelProperty("贸易国别")
145
+    private String trdCtry;
146
+
147
+    @ExcelProperty("收款方式")
148
+    private String rcptMtd;
149
+
150
+    @ExcelProperty("运输方式")
151
+    private String tranWay;
152
+
153
+    @ExcelProperty("价格说明")
154
+    private String priceDesc;
155
+
156
+    @ExcelProperty("计价公式")
157
+    private String priceForm;
158
+
159
+    @ExcelProperty("数量溢装")
160
+    private BigDecimal qtyOver;
161
+
162
+    @ExcelProperty("数量短装")
163
+    private BigDecimal qtyShort;
164
+
165
+    @ExcelProperty("金额溢装")
166
+    private BigDecimal amtOver;
167
+
168
+    @ExcelProperty("金额短装")
169
+    private BigDecimal amtShort;
170
+
171
+    @ExcelProperty("预收款比例")
172
+    private BigDecimal prepayRatio;
173
+
174
+    @ExcelProperty("预收款金额")
175
+    private BigDecimal prepayAmt;
176
+
177
+    @ExcelProperty("产地")
178
+    private String origin;
179
+
180
+    @ExcelProperty("结算指标")
181
+    private String settIndex;
182
+
183
+    @ExcelProperty("客户履约保证金支付日期")
184
+    private LocalDateTime ctPerfPayDt;
185
+
186
+    @ExcelProperty("客户履约保证金比例")
187
+    private BigDecimal ctPerfRatio;
188
+
189
+    @ExcelProperty("合同完结付款日期")
190
+    private LocalDateTime contrFinalPayDt;
191
+
192
+    @ExcelProperty("合同违约金比例")
193
+    private BigDecimal contrPenaltyRatio;
194
+
195
+    @ExcelProperty("提货期限")
196
+    private BigDecimal pickDueDays;
197
+
198
+    @ExcelProperty("开票天数")
199
+    private BigDecimal invDays;
200
+
201
+    @ExcelProperty("责任中心")
202
+    private String respCtrName;
203
+
204
+    @ExcelProperty("考核占比")
205
+    private BigDecimal assessRatio;
206
+
207
+    @ExcelProperty("占比金额")
208
+    private BigDecimal assessAmt;
209
+
210
+    @ExcelProperty("代理费计费方式")
211
+    private String billingMode;
212
+
213
+    @ExcelProperty("代理费计费比例/单价")
214
+    private BigDecimal billingRate;
215
+
216
+    @ExcelProperty("代理费计费金额")
217
+    private BigDecimal billingAmount;
218
+
219
+    @ExcelProperty("是否租船")
220
+    private String whetherChartering;
221
+
222
+    @ExcelProperty("合同执行人代码")
223
+    private String contrExecCd;
224
+
225
+    @ExcelProperty("合同执行人名称")
226
+    private String contrExecNm;
227
+
228
+    @ExcelProperty("合同名称")
229
+    private String contractName;
230
+
231
+    @ExcelProperty("合同标的")
232
+    private String contractSubjectMatter;
233
+
234
+    @ExcelProperty("合同大类")
235
+    private String bpoTypeS;
236
+
237
+    @ExcelProperty("合同细类")
238
+    private String bpoTypeT;
239
+
240
+    @ExcelProperty("是否法务格式合同")
241
+    private String ifLegalCheckFormat;
242
+
243
+    @ExcelProperty("是否经过法审")
244
+    private String ifLegalCheck;
245
+
246
+    @ExcelProperty("是否多次结算")
247
+    private String ifPayMultiple;
248
+
249
+    @ExcelProperty("是否阳光采购")
250
+    private String ifSunPurchase;
251
+
252
+    @ExcelProperty("未阳光采购理由")
253
+    private String sunPurInfo;
254
+
255
+    @ExcelProperty("未阳光采购理由(自定义)")
256
+    private String sunPurInfoCus;
257
+
258
+    @ExcelProperty("是否招投标")
259
+    private String ifBidding;
260
+
261
+    @ExcelProperty("是否集团外贸")
262
+    private String ifForeignTrade;
263
+
264
+    @ExcelProperty("变更说明")
265
+    private String changeDesc;
266
+
267
+    @ExcelProperty("合同变更人")
268
+    private String changePeople;
269
+
270
+    @ExcelProperty("合同变更日期")
271
+    private LocalDateTime changeDate;
272
+
273
+    @ExcelProperty("变更协议号")
274
+    private String changeAgreementNo;
275
+
276
+    @ExcelProperty("变更前合同版本号")
277
+    private String beforeChangeVer;
278
+
279
+    @ExcelProperty("保证金比例")
280
+    private BigDecimal ctmarginRatio;
281
+
282
+    @ExcelProperty("保证金金额")
283
+    private BigDecimal ctmarginAmount;
284
+
285
+    @ExcelProperty("中文船名")
286
+    private String chnShipName;
287
+
288
+    @ExcelProperty("英文船名")
289
+    private String engShipName;
290
+
291
+    @ExcelProperty("流程实例id")
292
+    private String processInstanceId;
293
+
294
+    @ExcelProperty("单据状态")
295
+    private String placed;
296
+
297
+    @ExcelProperty("业务id")
298
+    private Long fmodalid;
299
+
300
+    @ExcelProperty("数据来源id")
301
+    private Long sourceid;
302
+
303
+    @ExcelProperty("数据来源表")
304
+    private String sourcetable;
305
+
306
+    @ExcelProperty("图片")
307
+    private String imgIds;
308
+
309
+    @ExcelProperty("调取次数")
310
+    private Integer inc;
311
+
312
+    @ExcelProperty("关联id")
313
+    private Long rid;
314
+
315
+    @ExcelProperty("归档状态")
316
+    private String fsaved;
317
+
318
+    @ExcelProperty("备注")
319
+    private String remark;
320
+
321
+    @ExcelProperty("模版名称")
322
+    private String sysTemplateName;
24 323
 
25
-    @ExcelProperty("合同金额")
26
-    private BigDecimal contractAmount;
324
+    @ExcelProperty("是否删除")
325
+    private Integer delFlag;
326
+
327
+    @ExcelProperty("制单人部门代码")
328
+    private String deptId;
329
+
330
+    @ExcelProperty("制单人部门名称")
331
+    private String deptName;
332
+
333
+    @ExcelProperty("创建账号")
334
+    private String createBy;
335
+
336
+    @ExcelProperty("创建时间")
337
+    private LocalDateTime createTime;
338
+
339
+    @ExcelProperty("创建人")
340
+    private String createByName;
341
+
342
+    @ExcelProperty("更新账号")
343
+    private String updateBy;
344
+
345
+    @ExcelProperty("更新时间")
346
+    private LocalDateTime updateTime;
347
+
348
+    @ExcelProperty("更新人")
349
+    private String updateByName;
350
+
351
+    @ExcelProperty("贸易方式")
352
+    private String tradeway;
353
+
354
+    @ExcelProperty("美元汇率")
355
+    private BigDecimal rateUsd;
356
+
357
+    @ExcelProperty("付款方式")
358
+    private String payment;
359
+
360
+    @ExcelProperty("预估资金利息")
361
+    private BigDecimal estFundInt;
362
+
363
+    @ExcelProperty("计费单价")
364
+    private BigDecimal billPrice;
365
+
366
+    @ExcelProperty("计费方式")
367
+    private String billMode;
368
+
369
+    @ExcelProperty("计费比例")
370
+    private BigDecimal billRate;
371
+
372
+    @ExcelProperty("计费金额")
373
+    private BigDecimal billAmt;
374
+
375
+    @ExcelProperty("变更次数")
376
+    private Integer fchno;
377
+
378
+    @ExcelProperty("IMP同步PLMS接口状态")
379
+    private String impToPLMSStatus;
380
+
381
+    @ExcelProperty("IMP同步PLMS接口数据状态")
382
+    private String impToPLMSFlag;
383
+
384
+    @ExcelProperty("首款质量依据")
385
+    private String firstQmGt;
386
+
387
+    @ExcelProperty("尾款质量依据")
388
+    private String endQmGist;
389
+
390
+    @ExcelProperty("结算方式")
391
+    private String settlementMethod;
392
+
393
+    @ExcelProperty("品种大类")
394
+    private String materialClass;
27 395
 
28 396
     @ExcelProperty("签约日期")
29
-    @DateTimeFormat("yyyy-MM-dd")
30
-    private Date signingDate;
397
+    private LocalDateTime signDt;
398
+
399
+    @ExcelProperty("合同生效日期")
400
+    private LocalDateTime validDate;
401
+
402
+    @ExcelProperty("合同执行人机构代码")
403
+    private String contrExecCdInstitutionId;
404
+
405
+    @ExcelProperty("合同执行人机构名称")
406
+    private String contrExecCdInstitutionNm;
407
+
408
+    @ExcelProperty("合同执行人部门代码")
409
+    private String contrExecCdDeptId;
410
+
411
+    @ExcelProperty("合同执行人部门名称")
412
+    private String contrExecCdDeptNm;
413
+
414
+    @ExcelProperty("IMP同步PLMS接口来源系统代码")
415
+    private String sysid;
416
+
417
+    @ExcelProperty("IMP同步PLMS接口账套代码")
418
+    private String bookId;
419
+
420
+    @ExcelProperty("IMP同步PLMS接口PLMS组织ID")
421
+    private String orgId;
422
+
423
+    @ExcelProperty("赊销预付标识")
424
+    private String ifpayAdvanceSellCredit;
425
+
426
+    @ExcelProperty("业务类型")
427
+    private String serviceType;
428
+
429
+    @ExcelProperty("审批摘要")
430
+    private String reviewAbstract;
431
+
432
+    @ExcelProperty("是否清底")
433
+    private String ifClearBottom;
434
+
435
+    @ExcelProperty("关闭状态")
436
+    private String fclosed;
437
+
438
+    @ExcelProperty("当前版本号")
439
+    private Integer curChangeVer;
440
+
441
+    @ExcelProperty("变更标识")
442
+    private Integer curChangeFlag;
443
+
444
+    @ExcelProperty("变更原因")
445
+    private String curChangeReason;
446
+
447
+    @ExcelProperty("变更时间")
448
+    private LocalDateTime curChangeTime;
449
+
450
+    @ExcelProperty("变更人")
451
+    private String curChangeUser;
452
+
453
+    @ExcelProperty("合同产品类型")
454
+    private String bizProductType;
455
+
456
+    @ExcelProperty("PLMS合同大类")
457
+    private String contractType;
458
+
459
+    @ExcelProperty("是否赊销")
460
+    private String ifSellCredit;
461
+
462
+    @ExcelProperty("预付白名单")
463
+    private String ifpayAdvanceWhitelist;
464
+
465
+    @ExcelProperty("装卸条款")
466
+    private String loadUnloadTerms;
467
+
468
+    @ExcelProperty("赊销白名单")
469
+    private String ifSellCreditWhitelist;
470
+
471
+    @ExcelProperty("装运港编号")
472
+    private String lpno;
473
+
474
+    @ExcelProperty("目的港编号")
475
+    private String dpno;
476
+
477
+    @ExcelProperty("长协合同号")
478
+    private String longTermContract;
479
+
480
+    @ExcelProperty("是否长协")
481
+    private String ifLongTerm;
482
+
483
+    @ExcelProperty("是否确认")
484
+    private Integer isConfirm;
485
+
486
+    @ExcelProperty("交货方式")
487
+    private String delivMtd;
488
+
489
+    @ExcelProperty("保险种类")
490
+    private String insuranceType;
491
+
492
+    @ExcelProperty("保险金额")
493
+    private BigDecimal insuranceAmt;
494
+
495
+    @ExcelProperty("是否借壳")
496
+    private String ifShell;
497
+
498
+    @ExcelProperty("借壳单位")
499
+    private String shellCompany;
500
+
501
+    @ExcelProperty("是否分批")
502
+    private String ifBatch;
503
+
504
+    @ExcelProperty("是否转运")
505
+    private String ifTransfer;
506
+
507
+    @ExcelProperty("钢材产品判断字段")
508
+    private String ifgc;
509
+
510
+    @ExcelProperty("执行美元汇率")
511
+    private BigDecimal rateUs;
512
+
513
+    @ExcelProperty("最迟装运日期")
514
+    private LocalDateTime estLoadDt;
515
+
516
+    @ExcelProperty("最迟集港日期")
517
+    private LocalDateTime estArrDt;
518
+
519
+    @ExcelProperty("合同借壳评审人")
520
+    private String reviewer;
521
+
522
+    @ExcelProperty("来源类型")
523
+    private String sourceType;
524
+
525
+    @ExcelProperty("来源类型")
526
+    private String sourceno;
527
+
528
+    @ExcelProperty("平均单价")
529
+    private BigDecimal avePrice;
530
+
531
+    @ExcelProperty("提交审批日期")
532
+    private LocalDateTime submissionDate;
533
+
534
+    @ExcelProperty("审批生效日期")
535
+    private LocalDateTime appEffectiveDate;
536
+
537
+    @ExcelProperty("保供合同一键三联类型")
538
+    private String oneClickSourcetype;
539
+
540
+    @ExcelProperty("保供合同一键三联id")
541
+    private Long oneClickSourceid;
542
+
543
+    @ExcelProperty("海外公司名称")
544
+    private String overSeasName;
545
+
546
+    @ExcelProperty("海外公司代码")
547
+    private String overSeasNo;
548
+
549
+    @ExcelProperty("装运国")
550
+    private String lPortCtry;
551
+
552
+    @ExcelProperty("目的国")
553
+    private String dPortCtry;
554
+
555
+    @ExcelProperty("托管")
556
+    private String rptg;
557
+
558
+    @ExcelProperty("合同不含税总金额")
559
+    private BigDecimal totalNtAmt;
560
+
561
+    @ExcelProperty("项目计划书单号")
562
+    private String ppRefNo;
563
+
564
+    @ExcelProperty("是否过磅数量结算")
565
+    private String ifWeighedSalesQty;
566
+
567
+    @ExcelProperty("限价类别")
568
+    private String limitType;
569
+
570
+    @ExcelProperty("电子合同标识")
571
+    private String electronicsFlag;
572
+
573
+    @ExcelProperty("合同文本类别")
574
+    private String contractTextType;
31 575
 
32 576
     @ExcelProperty("合同状态")
33 577
     private String contractStatus;
34 578
 
35
-    @ExcelProperty("备注")
36
-    private String remark;
579
+    @ExcelProperty("合同大类")
580
+    private String contractType2;
581
+
582
+    @ExcelProperty("单价类别")
583
+    private String unitPriceType;
584
+
585
+    @ExcelProperty("增值税率")
586
+    private BigDecimal inTaxRate;
587
+
588
+    @ExcelProperty("是否含税标记")
589
+    private String iftax;
590
+
591
+    @ExcelProperty("PLMS合同id")
592
+    private String plmscontractId;
593
+
594
+    @ExcelProperty("PLMS合同编号")
595
+    private String plmscontractCode;
596
+
597
+    @ExcelProperty("是否指数合同")
598
+    private String contractIndexFlag;
599
+
600
+    @ExcelProperty("备用字段1")
601
+    private String extCol1;
602
+
603
+    @ExcelProperty("计量单位代码")
604
+    private String measureUnitCode;
605
+
606
+    @ExcelProperty("采购合同号")
607
+    private String pono;
608
+
609
+    @ExcelProperty("销售合同信用销售比例")
610
+    private BigDecimal prepayTrustRatio;
611
+
612
+    @ExcelProperty("销售合同信用销售金额")
613
+    private BigDecimal prepayTrustAmt;
614
+
615
+    @ExcelProperty("代理销售协议号")
616
+    private String agentNoSo;
617
+
618
+    @ExcelProperty("印花税金额")
619
+    private BigDecimal stampTaxAmt;
620
+
621
+    @ExcelProperty("合同取消状态")
622
+    private String fclosedType;
623
+
624
+    @ExcelProperty("产品名称")
625
+    private String mpsdesc;
626
+
627
+    @ExcelProperty("未结天数")
628
+    private Integer outstandingDay;
629
+
630
+    @ExcelProperty("未结金额")
631
+    private BigDecimal outstandingamt;
632
+
633
+    @ExcelProperty("我方英文名称")
634
+    private String foursnamee;
635
+
636
+    @ExcelProperty("客户英文名称")
637
+    private String ctnamee;
638
+
639
+    @ExcelProperty("未税平均单价")
640
+    private BigDecimal avgNtprice;
37 641
 
38
-}
642
+    @ExcelProperty("英文品名")
643
+    private String edesc;
644
+}

+ 371
- 0
src/main/java/com/example/backend/excel/SalesDtlExcelDTO.java View File

@@ -0,0 +1,371 @@
1
+package com.example.backend.excel;
2
+
3
+import com.alibaba.excel.annotation.ExcelProperty;
4
+import lombok.Data;
5
+
6
+import java.math.BigDecimal;
7
+import java.time.LocalDateTime;
8
+
9
+/**
10
+ * 销售合同产品明细 销售批次表从表
11
+ */
12
+@Data
13
+public class SalesDtlExcelDTO {
14
+
15
+    @ExcelProperty("主键ID")
16
+    private Long id;
17
+
18
+    @ExcelProperty("行号")
19
+    private BigDecimal line;
20
+
21
+    @ExcelProperty("销售合同主键")
22
+    private Long rrid;
23
+
24
+    @ExcelProperty("商品编号")
25
+    private String itemno;
26
+
27
+    @ExcelProperty("中文品名")
28
+    private String sdesc;
29
+
30
+    @ExcelProperty("英文品名")
31
+    private String edesc;
32
+
33
+    @ExcelProperty("规格描述")
34
+    private String spec;
35
+
36
+    @ExcelProperty("水分")
37
+    private BigDecimal moisture;
38
+
39
+    @ExcelProperty("含铁量")
40
+    private BigDecimal ironCont;
41
+
42
+    @ExcelProperty("湿吨数量")
43
+    private BigDecimal wetTonQty;
44
+
45
+    @ExcelProperty("干吨数量")
46
+    private BigDecimal dryTonQty;
47
+
48
+    @ExcelProperty("计价方式")
49
+    private String priceMtd;
50
+
51
+    @ExcelProperty("数量")
52
+    private BigDecimal qty;
53
+
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;
92
+
93
+    @ExcelProperty("退税率%")
94
+    private BigDecimal reTaxRate;
95
+
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
+    @ExcelProperty("资源号")
190
+    private String resourceNo;
191
+
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;
272
+
273
+    @ExcelProperty("厚")
274
+    private BigDecimal fnum1;
275
+
276
+    @ExcelProperty("宽")
277
+    private BigDecimal fnum2;
278
+
279
+    @ExcelProperty("长")
280
+    private BigDecimal fnum3;
281
+
282
+    @ExcelProperty("件数")
283
+    private BigDecimal qua;
284
+
285
+    @ExcelProperty("单重")
286
+    private BigDecimal snw;
287
+
288
+    @ExcelProperty("卷重范围")
289
+    private String ftype1;
290
+
291
+    @ExcelProperty("米重")
292
+    private BigDecimal fnum4;
293
+
294
+    @ExcelProperty("直径")
295
+    private BigDecimal fnum5;
296
+
297
+    @ExcelProperty("捆单重")
298
+    private BigDecimal fnum6;
299
+
300
+    @ExcelProperty("捆支数")
301
+    private BigDecimal fnum7;
302
+
303
+    @ExcelProperty("H型钢规格")
304
+    private String ftype2;
305
+
306
+    @ExcelProperty("规格")
307
+    private String ftype3;
308
+
309
+    @ExcelProperty("计重方式")
310
+    private String ftype4;
311
+
312
+    @ExcelProperty("色标")
313
+    private String ftype5;
314
+
315
+    @ExcelProperty("数值预留字段1")
316
+    private BigDecimal fnum8;
317
+
318
+    @ExcelProperty("数值预留字段2")
319
+    private BigDecimal fnum9;
320
+
321
+    @ExcelProperty("文本预留字段1")
322
+    private String ftype6;
323
+
324
+    @ExcelProperty("文本预留字段2")
325
+    private String ftype7;
326
+
327
+    @ExcelProperty("煤焦标准水分")
328
+    private BigDecimal coalMoisture;
329
+
330
+    @ExcelProperty("钢厂资源号")
331
+    private String smrNo;
332
+
333
+    @ExcelProperty("毛重")
334
+    private BigDecimal fgw;
335
+
336
+    @ExcelProperty("净重")
337
+    private BigDecimal fnw;
338
+
339
+    @ExcelProperty("钢材产品判断字段")
340
+    private String ifgc;
341
+
342
+    @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;
356
+
357
+    @ExcelProperty("采购计价方式")
358
+    private String priceMtdPo;
359
+
360
+    @ExcelProperty("出口关税税率%")
361
+    private BigDecimal eDutyRate;
362
+
363
+    @ExcelProperty("计价数量")
364
+    private BigDecimal priceQty;
365
+
366
+    @ExcelProperty("数量占比")
367
+    private BigDecimal qtyRate;
368
+
369
+    @ExcelProperty("金额占比")
370
+    private BigDecimal amtRate;
371
+}

+ 14
- 0
src/main/java/com/example/backend/mapper/contract/ContractErrorLogMapper.java View File

@@ -0,0 +1,14 @@
1
+package com.example.backend.mapper.contract;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.example.backend.entity.contract.ContractErrorLogEntity;
5
+import com.example.backend.entity.contract.ExpSvcRateEntity;
6
+import org.apache.ibatis.annotations.Mapper;
7
+
8
+/**
9
+ * 销售合同主表Mapper
10
+ */
11
+@Mapper
12
+public interface ContractErrorLogMapper extends BaseMapper<ContractErrorLogEntity> {
13
+
14
+}

+ 14
- 0
src/main/java/com/example/backend/mapper/contract/ExpSvcRateMapper.java View File

@@ -0,0 +1,14 @@
1
+package com.example.backend.mapper.contract;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.example.backend.entity.contract.ExpSvcRateEntity;
5
+import com.example.backend.entity.contract.FeeDtlEntity;
6
+import org.apache.ibatis.annotations.Mapper;
7
+
8
+/**
9
+ * 销售合同主表Mapper
10
+ */
11
+@Mapper
12
+public interface ExpSvcRateMapper extends BaseMapper<ExpSvcRateEntity> {
13
+
14
+}

+ 14
- 0
src/main/java/com/example/backend/mapper/contract/FeeDtlMapper.java View File

@@ -0,0 +1,14 @@
1
+package com.example.backend.mapper.contract;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.example.backend.entity.contract.FeeDtlEntity;
5
+import com.example.backend.entity.contract.SalesDtlEntity;
6
+import org.apache.ibatis.annotations.Mapper;
7
+
8
+/**
9
+ * 销售合同主表Mapper
10
+ */
11
+@Mapper
12
+public interface FeeDtlMapper extends BaseMapper<FeeDtlEntity> {
13
+
14
+}

+ 14
- 0
src/main/java/com/example/backend/mapper/contract/RCenterDtlMapper.java View File

@@ -0,0 +1,14 @@
1
+package com.example.backend.mapper.contract;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.example.backend.entity.contract.RCenterDtlEntity;
5
+import com.example.backend.entity.contract.SalesDtlEntity;
6
+import org.apache.ibatis.annotations.Mapper;
7
+
8
+/**
9
+ * 销售合同主表Mapper
10
+ */
11
+@Mapper
12
+public interface RCenterDtlMapper extends BaseMapper<RCenterDtlEntity> {
13
+
14
+}

+ 14
- 0
src/main/java/com/example/backend/mapper/contract/SalesCollectMethodMapper.java View File

@@ -0,0 +1,14 @@
1
+package com.example.backend.mapper.contract;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.example.backend.entity.contract.SalesCollectMethodEntity;
5
+import com.example.backend.entity.contract.SalesDtlEntity;
6
+import org.apache.ibatis.annotations.Mapper;
7
+
8
+/**
9
+ * 销售合同主表Mapper
10
+ */
11
+@Mapper
12
+public interface SalesCollectMethodMapper extends BaseMapper<SalesCollectMethodEntity> {
13
+
14
+}

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

@@ -0,0 +1,14 @@
1
+package com.example.backend.mapper.contract;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.example.backend.entity.contract.SalesContractEntity;
5
+import com.example.backend.entity.contract.SalesDtlEntity;
6
+import org.apache.ibatis.annotations.Mapper;
7
+
8
+/**
9
+ * 销售合同主表Mapper
10
+ */
11
+@Mapper
12
+public interface SalesDtlMapper extends BaseMapper<SalesDtlEntity> {
13
+
14
+}

+ 6
- 6
src/main/java/com/example/backend/service/contract/SalesContractService.java View File

@@ -27,11 +27,11 @@ public interface SalesContractService {
27 27
      * @param terms 其他条款
28 28
      * @return 保存结果
29 29
      */
30
-    boolean saveContractWithDetails(SalesContractEntity contract,
31
-                                    List<?> products,
32
-                                    List<?> deliveries,
33
-                                    List<?> payments,
34
-                                    List<?> qualities,
35
-                                    List<?> terms);
30
+//    boolean saveContractWithDetails(SalesContractEntity contract,
31
+//                                    List<?> products,
32
+//                                    List<?> deliveries,
33
+//                                    List<?> payments,
34
+//                                    List<?> qualities,
35
+//                                    List<?> terms);
36 36
 
37 37
 }

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

@@ -12,183 +12,152 @@ import org.springframework.web.multipart.MultipartFile;
12 12
 
13 13
 import java.util.ArrayList;
14 14
 import java.util.List;
15
-import java.util.Map;
16 15
 
17
-/**
18
- * 销售合同服务实现类
19
- */
20 16
 @Service
21 17
 public class SalesContractServiceImpl implements SalesContractService {
22 18
 
23 19
     @Autowired
24 20
     private SalesContractMapper salesContractMapper;
25
-
26 21
     @Autowired
27
-    private ContractProductMapper contractProductMapper;
28
-
22
+    private SalesDtlMapper salesDtlMapper;
29 23
     @Autowired
30
-    private ContractDeliveryMapper contractDeliveryMapper;
31
-
24
+    private SalesCollectMethodMapper salesCollectMethodMapper;
32 25
     @Autowired
33
-    private ContractPaymentMapper contractPaymentMapper;
34
-
26
+    private RCenterDtlMapper rCenterDtlMapper;
35 27
     @Autowired
36
-    private ContractQualityMapper contractQualityMapper;
37
-
28
+    private FeeDtlMapper feeDtlMapper;
29
+    @Autowired
30
+    private ExpSvcRateMapper expSvcRateMapper;
38 31
     @Autowired
39
-    private ContractTermMapper contractTermMapper;
32
+    private ContractErrorLogMapper contractErrorLogMapper;
40 33
 
41 34
     @Override
42 35
     @Transactional(rollbackFor = Exception.class)
43 36
     public boolean importExcel(MultipartFile file) {
44
-        try {
45
-            // 读取每个sheet页的第三行数据
46
-            Map<String, Object> thirdRowData = ExcelUtils.readExcelThirdRow(file);
47
-            
48
-            // 读取主表数据(第一个sheet)
49
-            List<SalesContractExcelDTO> mainDataList = ExcelUtils.readMainSheet(file);
50
-            if (mainDataList.isEmpty()) {
51
-                return false;
52
-            }
53
-            
54
-            // 获取第三行数据(索引为2)
55
-            SalesContractExcelDTO mainData = mainDataList.size() >= 3 ? mainDataList.get(2) : mainDataList.get(0);
56
-            
57
-            // 转换为主表实体
58
-            SalesContractEntity contract = new SalesContractEntity();
59
-            BeanUtils.copyProperties(mainData, contract);
60
-            
61
-            // 读取产品明细(第二个sheet)
62
-            List<ContractProductExcelDTO> productDTOList = ExcelUtils.readProductSheet(file);
63
-            List<ContractProduct> products = new ArrayList<>();
64
-            if (!productDTOList.isEmpty()) {
65
-                ContractProductExcelDTO productDTO = productDTOList.size() >= 3 ? productDTOList.get(2) : productDTOList.get(0);
66
-                ContractProduct product = new ContractProduct();
67
-                BeanUtils.copyProperties(productDTO, product);
68
-                products.add(product);
69
-            }
70
-            
71
-            // 读取交货明细(第三个sheet)
72
-            List<ContractDeliveryExcelDTO> deliveryDTOList = ExcelUtils.readDeliverySheet(file);
73
-            List<ContractDelivery> deliveries = new ArrayList<>();
74
-            if (!deliveryDTOList.isEmpty()) {
75
-                ContractDeliveryExcelDTO deliveryDTO = deliveryDTOList.size() >= 3 ? deliveryDTOList.get(2) : deliveryDTOList.get(0);
76
-                ContractDelivery delivery = new ContractDelivery();
77
-                BeanUtils.copyProperties(deliveryDTO, delivery);
78
-                deliveries.add(delivery);
79
-            }
80
-            
81
-            // 读取付款明细(第四个sheet)
82
-            List<ContractPaymentExcelDTO> paymentDTOList = ExcelUtils.readPaymentSheet(file);
83
-            List<ContractPayment> payments = new ArrayList<>();
84
-            if (!paymentDTOList.isEmpty()) {
85
-                ContractPaymentExcelDTO paymentDTO = paymentDTOList.size() >= 3 ? paymentDTOList.get(2) : paymentDTOList.get(0);
86
-                ContractPayment payment = new ContractPayment();
87
-                BeanUtils.copyProperties(paymentDTO, payment);
88
-                payments.add(payment);
89
-            }
90
-            
91
-            // 读取质量保证明细(第五个sheet)
92
-            List<ContractQualityExcelDTO> qualityDTOList = ExcelUtils.readQualitySheet(file);
93
-            List<ContractQuality> qualities = new ArrayList<>();
94
-            if (!qualityDTOList.isEmpty()) {
95
-                ContractQualityExcelDTO qualityDTO = qualityDTOList.size() >= 3 ? qualityDTOList.get(2) : qualityDTOList.get(0);
96
-                ContractQuality quality = new ContractQuality();
97
-                BeanUtils.copyProperties(qualityDTO, quality);
98
-                qualities.add(quality);
99
-            }
100
-            
101
-            // 读取其他条款(第六个sheet)
102
-            List<ContractTermExcelDTO> termDTOList = ExcelUtils.readTermSheet(file);
103
-            List<ContractTerm> terms = new ArrayList<>();
104
-            if (!termDTOList.isEmpty()) {
105
-                ContractTermExcelDTO termDTO = termDTOList.size() >= 3 ? termDTOList.get(2) : termDTOList.get(0);
106
-                ContractTerm term = new ContractTerm();
107
-                BeanUtils.copyProperties(termDTO, term);
108
-                terms.add(term);
109
-            }
110
-            
111
-            // 调用保存方法
112
-            return saveContractWithDetails(contract, products, deliveries, payments, qualities, terms);
113
-        } catch (Exception e) {
114
-            e.printStackTrace();
115
-            return false;
116
-        }
117
-    }
118 37
 
119
-    @Override
120
-    @Transactional(rollbackFor = Exception.class)
121
-    public boolean saveContractWithDetails(SalesContractEntity contract,
122
-                                           List<?> products,
123
-                                           List<?> deliveries,
124
-                                           List<?> payments,
125
-                                           List<?> qualities,
126
-                                           List<?> terms) {
38
+        List<String> errors = new ArrayList<>();  // 用来记录所有错误
39
+
40
+        Long contractId = null;
41
+
127 42
         try {
128
-            // 保存主表
129
-            salesContractMapper.insert(contract);
130
-            Long contractId = contract.getContractId();
131
-
132
-            // 保存产品明细
133
-            if (products != null) {
134
-                for (Object obj : products) {
135
-                    if (obj instanceof ContractProduct) {
136
-                        ContractProduct product = (ContractProduct) obj;
137
-                        product.setContractId(contractId);
138
-                        contractProductMapper.insert(product);
43
+            // ================= 1️⃣ 主表 =================
44
+            try {
45
+                List<SalesContractExcelDTO> mainDataList = ExcelUtils.readMainSheet(file);
46
+                if (mainDataList.isEmpty()) {
47
+                    errors.add("主表(Sheet1) 数据为空");
48
+                } else {
49
+                    SalesContractExcelDTO dto = mainDataList.size() >= 3 ? mainDataList.get(2) : mainDataList.get(0);
50
+                    SalesContractEntity entity = new SalesContractEntity();
51
+                    BeanUtils.copyProperties(dto, entity);
52
+
53
+                    salesContractMapper.insert(entity);
54
+                    contractId = entity.getId();
55
+                    if (contractId == null) {
56
+                        errors.add("主表ID生成失败(contractId 为 null)");
139 57
                     }
140 58
                 }
59
+            } catch (Exception e) {
60
+                errors.add("主表(Sheet1) 导入失败:" + e.getMessage());
141 61
             }
142 62
 
143
-            // 保存交货明细
144
-            if (deliveries != null) {
145
-                for (Object obj : deliveries) {
146
-                    if (obj instanceof ContractDelivery) {
147
-                        ContractDelivery delivery = (ContractDelivery) obj;
148
-                        delivery.setContractId(contractId);
149
-                        contractDeliveryMapper.insert(delivery);
150
-                    }
63
+
64
+            // 如果主表ID 都没生成,后面也插不了,但不能中断,要继续执行
65
+            final Long cid = contractId;
66
+
67
+
68
+            // ================= 2️⃣ 产品明细 =================
69
+            try {
70
+                List<SalesDtlExcelDTO> list = ExcelUtils.readSalesDtlSheet(file);
71
+                if (!list.isEmpty() && cid != null) {
72
+                    SalesDtlExcelDTO dto = list.size() >= 3 ? list.get(2) : list.get(0);
73
+                    SalesDtlEntity entity = new SalesDtlEntity();
74
+                    BeanUtils.copyProperties(dto, entity);
75
+
76
+                    salesDtlMapper.insert(entity);
151 77
                 }
78
+            } catch (Exception e) {
79
+                errors.add("产品明细(Sheet2) 导入失败:" + e.getMessage());
152 80
             }
153 81
 
154
-            // 保存付款明细
155
-            if (payments != null) {
156
-                for (Object obj : payments) {
157
-                    if (obj instanceof ContractPayment) {
158
-                        ContractPayment payment = (ContractPayment) obj;
159
-                        payment.setContractId(contractId);
160
-                        contractPaymentMapper.insert(payment);
161
-                    }
82
+
83
+            // ================= 3️⃣ 收款计划 =================
84
+            try {
85
+                List<SalesCollectExcelDTO> list = ExcelUtils.readSalesCollectSheet(file);
86
+                if (!list.isEmpty() && cid != null) {
87
+                    SalesCollectExcelDTO dto = list.size() >= 3 ? list.get(2) : list.get(0);
88
+                    SalesCollectMethodEntity entity = new SalesCollectMethodEntity();
89
+                    BeanUtils.copyProperties(dto, entity);
90
+//                    entity.setContractId(cid);
91
+                    salesCollectMethodMapper.insert(entity);
162 92
                 }
93
+            } catch (Exception e) {
94
+                errors.add("收款计划(Sheet3) 导入失败:" + e.getMessage());
163 95
             }
164 96
 
165
-            // 保存质量保证明细
166
-            if (qualities != null) {
167
-                for (Object obj : qualities) {
168
-                    if (obj instanceof ContractQuality) {
169
-                        ContractQuality quality = (ContractQuality) obj;
170
-                        quality.setContractId(contractId);
171
-                        contractQualityMapper.insert(quality);
172
-                    }
97
+
98
+            // ================= 4️⃣ 责任中心 =================
99
+            try {
100
+                List<RCenterDtlExcelDTO> list = ExcelUtils.readRCenterDtlSheet(file);
101
+                if (!list.isEmpty() && cid != null) {
102
+                    RCenterDtlExcelDTO dto = list.size() >= 3 ? list.get(2) : list.get(0);
103
+                    RCenterDtlEntity entity = new RCenterDtlEntity();
104
+                    BeanUtils.copyProperties(dto, entity);
105
+//                    entity.setContractId(cid);
106
+                    rCenterDtlMapper.insert(entity);
173 107
                 }
108
+            } catch (Exception e) {
109
+                errors.add("责任中心(Sheet4) 导入失败:" + e.getMessage());
174 110
             }
175 111
 
176
-            // 保存其他条款
177
-            if (terms != null) {
178
-                for (Object obj : terms) {
179
-                    if (obj instanceof ContractTerm) {
180
-                        ContractTerm term = (ContractTerm) obj;
181
-                        term.setContractId(contractId);
182
-                        contractTermMapper.insert(term);
183
-                    }
112
+
113
+            // ================= 5️⃣ 费用明细 =================
114
+            try {
115
+                List<FeeDtlExcelDTO> list = ExcelUtils.readFeelDtlSheet(file);
116
+                if (!list.isEmpty() && cid != null) {
117
+                    FeeDtlExcelDTO dto = list.size() >= 3 ? list.get(2) : list.get(0);
118
+                    FeeDtlEntity entity = new FeeDtlEntity();
119
+                    BeanUtils.copyProperties(dto, entity);
120
+//                    entity.setContractId(cid);
121
+                    feeDtlMapper.insert(entity);
184 122
                 }
123
+            } catch (Exception e) {
124
+                errors.add("费用明细(Sheet5) 导入失败:" + e.getMessage());
185 125
             }
186 126
 
187
-            return true;
127
+
128
+            // ================= 6️⃣ 服务费率 =================
129
+            try {
130
+                List<ExpSvcRateExcelDTO> list = ExcelUtils.readExpSvcRateSheet(file);
131
+                if (!list.isEmpty() && cid != null) {
132
+                    ExpSvcRateExcelDTO dto = list.size() >= 3 ? list.get(2) : list.get(0);
133
+                    ExpSvcRateEntity entity = new ExpSvcRateEntity();
134
+                    BeanUtils.copyProperties(dto, entity);
135
+//                    entity.setContractId(cid);
136
+                    expSvcRateMapper.insert(entity);
137
+                }
138
+            } catch (Exception e) {
139
+                errors.add("服务费率(Sheet6) 导入失败:" + e.getMessage());
140
+            }
141
+
142
+
188 143
         } catch (Exception e) {
189
-            e.printStackTrace();
190
-            throw new RuntimeException("保存合同失败", e);
144
+            // 兜底异常
145
+            errors.add("系统异常:" + e.getMessage());
191 146
         }
192
-    }
193 147
 
148
+
149
+        // ========== ❗ 最终检查所有错误,如果有 → 回滚事务并返回统一信息 ==========
150
+        if (!errors.isEmpty()) {
151
+
152
+            // 保存到错误日志表
153
+            ContractErrorLogEntity log = new ContractErrorLogEntity();
154
+            log.setErrorLog(String.join("\n", errors));
155
+            contractErrorLogMapper.insert(log);
156
+
157
+            // ❗抛异常,触发事务回滚
158
+            throw new RuntimeException("Excel 导入出现以下错误:\n" + String.join("\n", errors));
159
+        }
160
+
161
+        return true;
162
+    }
194 163
 }

Loading…
Cancel
Save