11816 3 месяцев назад
Родитель
Сommit
e20ebe9ec6

+ 4
- 0
src/main/java/com/example/backend/pAndSExe/mapper/MdkcctrlMapper.java Просмотреть файл

8
 import org.apache.ibatis.annotations.Param;
8
 import org.apache.ibatis.annotations.Param;
9
 import org.apache.ibatis.annotations.Select;
9
 import org.apache.ibatis.annotations.Select;
10
 
10
 
11
+import java.util.List;
12
+
11
 
13
 
12
 /**
14
 /**
13
  * 业务主表MDKCCTRL Mapper
15
  * 业务主表MDKCCTRL Mapper
39
     @Select("select USER_DESC from SGGMIIP.sys_user where USER_CODE = #{createBy};")
41
     @Select("select USER_DESC from SGGMIIP.sys_user where USER_CODE = #{createBy};")
40
     String selectCreateByName(String createBy);
42
     String selectCreateByName(String createBy);
41
 
43
 
44
+    @Select("select * from SGGMIIP.mdkcctrl where pono =#{fno} where del_flag != '1' ")
45
+    List<Mdkcctrl> selectByPono(String fno);
42
 }
46
 }

+ 25
- 0
src/main/java/com/example/backend/pAndSExe/mapper/ShangpinkuMapper.java Просмотреть файл

1
+package com.example.backend.pAndSExe.mapper;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.example.backend.pAndSExe.model.Shangpinku;
5
+import org.apache.ibatis.annotations.Mapper;
6
+import org.apache.ibatis.annotations.Select;
7
+
8
+@Mapper
9
+public interface ShangpinkuMapper extends BaseMapper<Shangpinku> {
10
+
11
+    @Select("select b.type_name2,\n" +
12
+            "        a.itemno,\n" +
13
+            "        a.sdesc,\n" +
14
+            "        a.brand\n" +
15
+            "        from SGGMIIP.invitem a\n" +
16
+            "        left join (select fno, type_name type_name2\n" +
17
+            "        from SGGMIIP.product_category\n" +
18
+            "        where nvl(del_flag, 0) != 1\n" +
19
+            "        and level = 0\n" +
20
+            "        and parent_id = 0) b on SUBSTR(a.itemno, 1, 2) = b.fno\n" +
21
+            "        where ifnull(a.del_flag, 0) != 1\n" +
22
+            "        and a.itemno = #{itemno}")
23
+    Shangpinku selectByItemno(String itemno);
24
+
25
+}

+ 428
- 27
src/main/java/com/example/backend/pAndSExe/model/PurStlProdDtl.java Просмотреть файл

6
 import com.baomidou.mybatisplus.annotation.TableName;
6
 import com.baomidou.mybatisplus.annotation.TableName;
7
 import lombok.Data;
7
 import lombok.Data;
8
 import java.math.BigDecimal;
8
 import java.math.BigDecimal;
9
+import java.util.Date;
9
 
10
 
10
 /**
11
 /**
11
  * 费用发票结算子表(SGGMIIP.purStlProdDtl)
12
  * 费用发票结算子表(SGGMIIP.purStlProdDtl)
13
 @Data
14
 @Data
14
 @TableName("SGGMIIP.purStlProdDtl") // 数据库表名
15
 @TableName("SGGMIIP.purStlProdDtl") // 数据库表名
15
 public class PurStlProdDtl {
16
 public class PurStlProdDtl {
16
-    /** 雪花ID(19位数字,适配达梦BIGINT) */
17
+    /** 主键ID(雪花ID,19位数字) */
17
     @TableId(type = IdType.ASSIGN_ID)
18
     @TableId(type = IdType.ASSIGN_ID)
18
     private Long id;
19
     private Long id;
19
 
20
 
21
     @TableField("rid")
22
     @TableField("rid")
22
     private Long rid;
23
     private Long rid;
23
 
24
 
24
-    /** 发票号码 */
25
-    @TableField("taxInvNo")
26
-    private String taxInvNo;
25
+    // ========== 基础商品信息 ==========
26
+    /** 商品编号 */
27
+    @TableField("itemno")
28
+    private String itemno;
29
+
30
+    /** 中文品名 */
31
+    @TableField("sdesc")
32
+    private String sdesc;
33
+
34
+    /** 英文品名 */
35
+    @TableField("edesc")
36
+    private String edesc;
27
 
37
 
28
-    /** 数量 */
38
+    /** 规格 */
39
+    @TableField("spec")
40
+    private String spec;
41
+
42
+    /** 水分(精度18,6) */
43
+    @TableField("moisture")
44
+    private BigDecimal moisture;
45
+
46
+    /** 湿吨数量(精度18,6) */
47
+    @TableField("wetTonQty")
48
+    private BigDecimal wetTonQty;
49
+
50
+    /** 干吨数量(精度18,6) */
51
+    @TableField("dryTonQty")
52
+    private BigDecimal dryTonQty;
53
+
54
+    /** 数量(精度18,6) */
29
     @TableField("qty")
55
     @TableField("qty")
30
     private BigDecimal qty;
56
     private BigDecimal qty;
31
 
57
 
33
     @TableField("ut")
59
     @TableField("ut")
34
     private String ut;
60
     private String ut;
35
 
61
 
36
-    /** 无税单价 */
37
-    @TableField("ntPoPrice")
38
-    private BigDecimal ntPoPrice;
62
+    /** 海关编码 */
63
+    @TableField("hsCode")
64
+    private String hsCode;
39
 
65
 
40
-    /** 无税金额 */
41
-    @TableField("ntPoAmt")
42
-    private BigDecimal ntPoAmt;
66
+    /** 海关中文名称 */
67
+    @TableField("hsNameCn")
68
+    private String hsNameCn;
43
 
69
 
44
-    /** 税率 */
70
+    /** 海关英文名称 */
71
+    @TableField("hsNameEn")
72
+    private String hsNameEn;
73
+
74
+    // ========== 税率相关 ==========
75
+    /** 关税 %(精度18,6) */
76
+    @TableField("dutyRate")
77
+    private BigDecimal dutyRate;
78
+
79
+    /** 进项税 %(精度18,6) */
45
     @TableField("inTaxRate")
80
     @TableField("inTaxRate")
46
     private BigDecimal inTaxRate;
81
     private BigDecimal inTaxRate;
47
 
82
 
83
+    /** 退税率 %(精度18,6) */
84
+    @TableField("reTaxRate")
85
+    private BigDecimal reTaxRate;
86
+
87
+    /** 销项税 %(精度18,6) */
88
+    @TableField("outTaxRate")
89
+    private BigDecimal outTaxRate;
90
+
91
+    // ========== 基础单据信息 ==========
92
+    /** 备注 */
93
+    @TableField("remark")
94
+    private String remark;
95
+
96
+    /** 行号(精度18,0) */
97
+    @TableField("line")
98
+    private BigDecimal line;
99
+
100
+    /** 流程实例id */
101
+    @TableField("process_instance_id")
102
+    private String processInstanceId;
103
+
104
+    /** 业务id */
105
+    @TableField("fmodalid")
106
+    private Long fmodalid;
107
+
108
+    /** 数据来源id */
109
+    @TableField("sourceid")
110
+    private Long sourceid;
111
+
112
+    /** 数据来源表 */
113
+    @TableField("sourcetable")
114
+    private String sourcetable;
115
+
116
+    /** 税票号码 */
117
+    @TableField("taxInvNo")
118
+    private String taxInvNo;
119
+
48
     /** 费用名称 */
120
     /** 费用名称 */
49
     @TableField("feeNm")
121
     @TableField("feeNm")
50
     private String feeNm;
122
     private String feeNm;
51
 
123
 
52
-    /** 币别 */
124
+    /** 采购币种 */
53
     @TableField("curcypo")
125
     @TableField("curcypo")
54
     private String curcypo;
126
     private String curcypo;
55
-    /** 物料编码(进项发票新增) */
56
-    @TableField("itemno")
57
-    private String itemno;
58
 
127
 
59
-    /** 物料描述(进项发票新增) */
60
-    @TableField("sdesc")
61
-    private String sdesc;
128
+    /** 金额(精度18,6) */
129
+    @TableField("poamt")
130
+    private BigDecimal poamt;
62
 
131
 
63
-    /** 品牌(进项发票新增) */
64
-    @TableField("brand")
65
-    private String brand;
132
+    /** 单价(精度18,6) */
133
+    @TableField("poprice")
134
+    private BigDecimal poprice;
66
 
135
 
67
-    /** 税额(进项发票新增) */
136
+    /** 税额 */
68
     @TableField("taxAmt")
137
     @TableField("taxAmt")
69
     private BigDecimal taxAmt;
138
     private BigDecimal taxAmt;
70
 
139
 
71
-    @TableField("poamt")
72
-    private BigDecimal poamt;
140
+    /** 未税金额 */
141
+    @TableField("ntPoAmt")
142
+    private BigDecimal ntPoAmt;
73
 
143
 
74
-    @TableField("poprice")
75
-    private BigDecimal poprice;
144
+    /** 未税单价 */
145
+    @TableField("ntPoPrice")
146
+    private BigDecimal ntPoPrice;
147
+
148
+    /** 牌号 */
149
+    @TableField("brand")
150
+    private String brand;
151
+
152
+    // ========== 公共审计字段 ==========
153
+    /** 创建账号 */
154
+    @TableField("create_by")
155
+    private String createBy;
156
+
157
+    /** 创建时间 */
158
+    @TableField("create_time")
159
+    private Date createTime;
160
+
161
+    /** 创建人 */
162
+    @TableField("create_by_name")
163
+    private String createByName;
164
+
165
+    /** 更新账号 */
166
+    @TableField("update_by")
167
+    private String updateBy;
168
+
169
+    /** 更新时间 */
170
+    @TableField("update_time")
171
+    private Date updateTime;
172
+
173
+    /** 更新人 */
174
+    @TableField("update_by_name")
175
+    private String updateByName;
176
+
177
+    /** 单据状态 */
178
+    @TableField("placed")
179
+    private String placed;
180
+
181
+    /** 图片 */
182
+    @TableField("img_ids")
183
+    private String imgIds;
184
+
185
+    /** 调取次数 */
186
+    @TableField("inc")
187
+    private Integer inc;
188
+
189
+    /** 归档状态 0-未归档,1-已归档 */
190
+    @TableField("fsaved")
191
+    private String fsaved;
192
+
193
+    /** 模版名称 */
194
+    @TableField("sys_template_name")
195
+    private String sysTemplateName;
196
+
197
+    /** 是否删除(0-未删除,1-已删除) */
198
+    @TableField("del_flag")
199
+    private Integer delFlag;
200
+
201
+    // ========== 扩展业务字段 ==========
202
+    /** 计价方式 */
203
+    @TableField("priceMtd")
204
+    private String priceMtd;
205
+
206
+    /** 销售合同号 */
207
+    @TableField("sono")
208
+    private String sono;
209
+
210
+    /** 单据号 */
211
+    @TableField("fno")
212
+    private String fno;
213
+
214
+    /** 单据日期 */
215
+    @TableField("fdate")
216
+    private Date fdate;
217
+
218
+    /** 采购订单号 */
219
+    @TableField("poOrderNo")
220
+    private String poOrderNo;
221
+
222
+    /** 含铁量 */
223
+    @TableField("ironCont")
224
+    private BigDecimal ironCont;
225
+
226
+    /** 资源号 */
227
+    @TableField("resourceNo")
228
+    private String resourceNo;
229
+
230
+    /** 采购合同号 */
231
+    @TableField("pono")
232
+    private String pono;
233
+
234
+    /** 部门名称 */
235
+    @TableField("dept_name")
236
+    private String deptName;
237
+
238
+    /** 部门ID */
239
+    @TableField("dept_id")
240
+    private String deptId;
241
+
242
+    /** 采购汇率(精度18,6) */
243
+    @TableField("ratepo")
244
+    private BigDecimal ratepo;
245
+
246
+    /** 采购美元汇率(精度18,6) */
247
+    @TableField("rateusdpo")
248
+    private BigDecimal rateusdpo;
249
+
250
+    /** 含税人民币金额(精度18,6) */
251
+    @TableField("cnypoamt")
252
+    private BigDecimal cnypoamt;
253
+
254
+    /** 含税美元金额(精度18,6) */
255
+    @TableField("usdpoamt")
256
+    private BigDecimal usdpoamt;
257
+
258
+    /** 业务账套 */
259
+    @TableField("acctSet")
260
+    private String acctSet;
261
+
262
+    /** 采购产品ID */
263
+    @TableField("poid")
264
+    private Long poid;
265
+
266
+    /** 费用代码 */
267
+    @TableField("feeCd")
268
+    private String feeCd;
269
+
270
+    /** 对接系统采购订单唯一键 */
271
+    @TableField("poOrderSourceId")
272
+    private Long poOrderSourceId;
273
+
274
+    /** 对接系统采购订单编号 */
275
+    @TableField("poOrderSourceCode")
276
+    private String poOrderSourceCode;
277
+
278
+    /** 附件类型 */
279
+    @TableField("fileTypeCode")
280
+    private String fileTypeCode;
281
+
282
+    /** 装运港 */
283
+    @TableField("lPort")
284
+    private String lPort;
285
+
286
+    /** 目的港 */
287
+    @TableField("dPort")
288
+    private String dPort;
289
+
290
+    /** 中文规格描述 */
291
+    @TableField("spec_cn")
292
+    private String specCn;
293
+
294
+    /** 厚(精度18,6) */
295
+    @TableField("fnum1")
296
+    private BigDecimal fnum1;
297
+
298
+    /** 宽(精度18,6) */
299
+    @TableField("fnum2")
300
+    private BigDecimal fnum2;
301
+
302
+    /** 长(精度18,6) */
303
+    @TableField("fnum3")
304
+    private BigDecimal fnum3;
305
+
306
+    /** 件数(精度18,6) */
307
+    @TableField("qua")
308
+    private BigDecimal qua;
309
+
310
+    /** 单重(精度18,6) */
311
+    @TableField("snw")
312
+    private BigDecimal snw;
313
+
314
+    /** 卷重范围 */
315
+    @TableField("ftype1")
316
+    private String ftype1;
317
+
318
+    /** 米重(精度18,6) */
319
+    @TableField("fnum4")
320
+    private BigDecimal fnum4;
321
+
322
+    /** 直径(精度18,6) */
323
+    @TableField("fnum5")
324
+    private BigDecimal fnum5;
325
+
326
+    /** 捆单重(精度18,6) */
327
+    @TableField("fnum6")
328
+    private BigDecimal fnum6;
329
+
330
+    /** 捆支数(精度18,6) */
331
+    @TableField("fnum7")
332
+    private BigDecimal fnum7;
333
+
334
+    /** H型钢规格 */
335
+    @TableField("ftype2")
336
+    private String ftype2;
337
+
338
+    /** 规格 */
339
+    @TableField("ftype3")
340
+    private String ftype3;
341
+
342
+    /** 计重方式 */
343
+    @TableField("ftype4")
344
+    private String ftype4;
345
+
346
+    /** 色标 */
347
+    @TableField("ftype5")
348
+    private String ftype5;
349
+
350
+    /** 数值预留字段1(精度18,6) */
351
+    @TableField("fnum8")
352
+    private BigDecimal fnum8;
353
+
354
+    /** 数值预留字段2(精度18,6) */
355
+    @TableField("fnum9")
356
+    private BigDecimal fnum9;
357
+
358
+    /** 文本预留字段1 */
359
+    @TableField("ftype6")
360
+    private String ftype6;
361
+
362
+    /** 文本预留字段2 */
363
+    @TableField("ftype7")
364
+    private String ftype7;
365
+
366
+    /** 煤焦标准水分(精度18,6) */
367
+    @TableField("coalMoisture")
368
+    private BigDecimal coalMoisture;
369
+
370
+    /** 钢厂资源号 */
371
+    @TableField("SMRNo")
372
+    private String smrNo;
373
+
374
+    /** 出口关税税率%(精度18,6) */
375
+    @TableField("eDutyRate")
376
+    private BigDecimal eDutyRate;
377
+
378
+    /** 溢价金额(精度18,6) */
379
+    @TableField("premiumAmt")
380
+    private BigDecimal premiumAmt;
381
+
382
+    /** 总货值(精度18,6) */
383
+    @TableField("totalGoodsValue")
384
+    private BigDecimal totalGoodsValue;
385
+
386
+    /** 费用节点 */
387
+    @TableField("expNode")
388
+    private String expNode;
389
+
390
+    /** 其他合同号 */
391
+    @TableField("otasno")
392
+    private String otasno;
393
+
394
+    /** 入库单号 */
395
+    @TableField("rkno")
396
+    private String rkno;
397
+
398
+    /** 预付款冲销金额(精度18,6) */
399
+    @TableField("prepayWriteOff")
400
+    private BigDecimal prepayWriteOff;
401
+
402
+    /** 应付金额(精度18,6) */
403
+    @TableField("restFeeAmt")
404
+    private BigDecimal restFeeAmt;
405
+
406
+    /** 仓库名称 */
407
+    @TableField("stockname")
408
+    private String stockname;
409
+
410
+    /** 仓库代码 */
411
+    @TableField("stockno")
412
+    private String stockno;
413
+
414
+    /** 结算费用 */
415
+    @TableField("settlementFee")
416
+    private String settlementFee;
417
+
418
+    /** 费用分摊类型 */
419
+    @TableField("allocationCategory")
420
+    private String allocationCategory;
421
+
422
+    /** 销售订单号 */
423
+    @TableField("soOrderNo")
424
+    private String soOrderNo;
425
+
426
+    /** 待暂估冲销金额(精度18,6) */
427
+    @TableField("chargeStockPoamt")
428
+    private BigDecimal chargeStockPoamt;
429
+
430
+    /** 发票金额(精度18,6) */
431
+    @TableField("invGoodsAmt")
432
+    private BigDecimal invGoodsAmt;
433
+
434
+    /** 发票分摊金额(精度18,6) */
435
+    @TableField("invCostAmt")
436
+    private BigDecimal invCostAmt;
437
+
438
+    /** 货值暂估金额(精度18,6) */
439
+    @TableField("provInAmt")
440
+    private BigDecimal provInAmt;
441
+
442
+    /** 业务类型 */
443
+    @TableField("serviceType")
444
+    private String serviceType;
445
+
446
+    /** 合同类型 */
447
+    @TableField("bizType")
448
+    private String bizType;
449
+
450
+    /** 合同产品类型 */
451
+    @TableField("bizProductType")
452
+    private String bizProductType;
453
+
454
+    /** 销售产品ID */
455
+    @TableField("soid")
456
+    private Long soid;
457
+
458
+    /** IMC销售订单子项号 */
459
+    @TableField("IMCORDER_NUM")
460
+    private String imcorderNum;
461
+
462
+    /** 调整税额(精度18,6) */
463
+    @TableField("tztaxamt")
464
+    private BigDecimal tztaxamt;
76
 
465
 
466
+    /** 入库数量(精度18,6) */
467
+    @TableField("rkqty")
468
+    private BigDecimal rkqty;
77
 
469
 
470
+    /** 其他合同来源合同名称 */
471
+    @TableField("otasnoTable")
472
+    private String otasnoTable;
78
 
473
 
474
+    /** 其他合同来源表名 */
475
+    @TableField("otasnoType")
476
+    private String otasnoType;
79
 
477
 
478
+    /** IECid */
479
+    @TableField("iecid")
480
+    private String iecid;
80
 }
481
 }

+ 13
- 13
src/main/java/com/example/backend/pAndSExe/model/PurchaseOrder.java Просмотреть файл

7
 import lombok.Data;
7
 import lombok.Data;
8
 
8
 
9
 import java.math.BigDecimal;
9
 import java.math.BigDecimal;
10
-import java.time.LocalDateTime;
10
+import java.util.Date;
11
 
11
 
12
 /**
12
 /**
13
  * 采购订单主表:SGGMIIP.purchaseOrder
13
  * 采购订单主表:SGGMIIP.purchaseOrder
25
 
25
 
26
     /** 单据日期 */
26
     /** 单据日期 */
27
     @TableField(value = "fdate")
27
     @TableField(value = "fdate")
28
-    private LocalDateTime fdate;
28
+    private Date fdate;
29
 
29
 
30
     /** 采购合同号(长文本) */
30
     /** 采购合同号(长文本) */
31
     @TableField(value = "pono")
31
     @TableField(value = "pono")
45
 
45
 
46
     /** 合同起始有效期 */
46
     /** 合同起始有效期 */
47
     @TableField(value = "contrStart")
47
     @TableField(value = "contrStart")
48
-    private LocalDateTime contrStart;
48
+    private Date contrStart;
49
 
49
 
50
     /** 合同截止有效期 */
50
     /** 合同截止有效期 */
51
     @TableField(value = "contrEnd")
51
     @TableField(value = "contrEnd")
52
-    private LocalDateTime contrEnd;
52
+    private Date contrEnd;
53
 
53
 
54
     /** 合同描述 */
54
     /** 合同描述 */
55
     @TableField(value = "contrDesc")
55
     @TableField(value = "contrDesc")
137
 
137
 
138
     /** 签约日期 */
138
     /** 签约日期 */
139
     @TableField(value = "signDt")
139
     @TableField(value = "signDt")
140
-    private LocalDateTime signDt;
140
+    private Date signDt;
141
 
141
 
142
     /** 代理协议号 */
142
     /** 代理协议号 */
143
     @TableField(value = "agentNo")
143
     @TableField(value = "agentNo")
153
 
153
 
154
     /** 预计装港日期 */
154
     /** 预计装港日期 */
155
     @TableField(value = "estLoadDt")
155
     @TableField(value = "estLoadDt")
156
-    private LocalDateTime estLoadDt;
156
+    private Date estLoadDt;
157
 
157
 
158
     /** 预计到港日期 */
158
     /** 预计到港日期 */
159
     @TableField(value = "estArrDt")
159
     @TableField(value = "estArrDt")
160
-    private LocalDateTime estArrDt;
160
+    private Date estArrDt;
161
 
161
 
162
     /** 数量溢装 */
162
     /** 数量溢装 */
163
     @TableField(value = "qtyOver")
163
     @TableField(value = "qtyOver")
177
 
177
 
178
     /** 采购交货日期 */
178
     /** 采购交货日期 */
179
     @TableField(value = "delivDt")
179
     @TableField(value = "delivDt")
180
-    private LocalDateTime delivDt;
180
+    private Date delivDt;
181
 
181
 
182
     /** 价格说明 */
182
     /** 价格说明 */
183
     @TableField(value = "priceDesc")
183
     @TableField(value = "priceDesc")
249
 
249
 
250
     /** 提货截至时间 */
250
     /** 提货截至时间 */
251
     @TableField(value = "pickDueTime")
251
     @TableField(value = "pickDueTime")
252
-    private LocalDateTime pickDueTime;
252
+    private Date pickDueTime;
253
 
253
 
254
     /** 结算指标 */
254
     /** 结算指标 */
255
     @TableField(value = "settIndex")
255
     @TableField(value = "settIndex")
329
 
329
 
330
     /** 创建时间 */
330
     /** 创建时间 */
331
     @TableField(value = "create_time")
331
     @TableField(value = "create_time")
332
-    private LocalDateTime createTime;
332
+    private Date createTime;
333
 
333
 
334
     /** 创建人 */
334
     /** 创建人 */
335
     @TableField(value = "create_by_name")
335
     @TableField(value = "create_by_name")
341
 
341
 
342
     /** 更新时间 */
342
     /** 更新时间 */
343
     @TableField(value = "update_time")
343
     @TableField(value = "update_time")
344
-    private LocalDateTime updateTime;
344
+    private Date updateTime;
345
 
345
 
346
     /** 更新人 */
346
     /** 更新人 */
347
     @TableField(value = "update_by_name")
347
     @TableField(value = "update_by_name")
481
 
481
 
482
     /** 提交审批日期 */
482
     /** 提交审批日期 */
483
     @TableField(value = "submissionDate")
483
     @TableField(value = "submissionDate")
484
-    private LocalDateTime submissionDate;
484
+    private Date submissionDate;
485
 
485
 
486
     /** 审批生效日期 */
486
     /** 审批生效日期 */
487
     @TableField(value = "appEffectiveDate")
487
     @TableField(value = "appEffectiveDate")
488
-    private LocalDateTime appEffectiveDate;
488
+    private Date appEffectiveDate;
489
 
489
 
490
     /** 合同状态(IMP同步PLMS) */
490
     /** 合同状态(IMP同步PLMS) */
491
     @TableField(value = "impToPLMSStatusforpo")
491
     @TableField(value = "impToPLMSStatusforpo")

+ 52
- 0
src/main/java/com/example/backend/pAndSExe/model/Shangpinku.java Просмотреть файл

1
+package com.example.backend.pAndSExe.model;
2
+
3
+import com.baomidou.mybatisplus.annotation.TableField;
4
+import com.baomidou.mybatisplus.annotation.TableName;
5
+import lombok.Data;
6
+
7
+import java.util.Date;
8
+
9
+/**
10
+ * 商品库实体类
11
+ */
12
+@Data
13
+// @TableName("shangpinku")
14
+public class Shangpinku {
15
+    /**
16
+     * 主键
17
+     */
18
+    private Long id;
19
+
20
+    /**
21
+     * 商品编号
22
+     */
23
+    @TableField("itemno")
24
+    private String itemno;
25
+
26
+    /**
27
+     * 中文品名
28
+     */
29
+    @TableField("sdesc")
30
+    private String sdesc;
31
+
32
+    /**
33
+     * 牌号
34
+     */
35
+    @TableField("brand")
36
+    private String brand;
37
+
38
+    /**
39
+     * 状态:0-有效,1-无效
40
+     */
41
+    private String status;
42
+
43
+    /**
44
+     * 创建时间
45
+     */
46
+    private Date createTime;
47
+
48
+    /**
49
+     * 更新时间
50
+     */
51
+    private Date updateTime;
52
+}

+ 74
- 16
src/main/java/com/example/backend/pAndSExe/service/impl/JinxiangInvoiceSettleServiceImpl.java Просмотреть файл

72
                 settle.setExpanseReportId(inf.getExpanseReportId());
72
                 settle.setExpanseReportId(inf.getExpanseReportId());
73
                 settle.setCreateBy(inf.getCreateBy());
73
                 settle.setCreateBy(inf.getCreateBy());
74
                 settle.setReceiptNo(inf.getReceiptNo());
74
                 settle.setReceiptNo(inf.getReceiptNo());
75
-                settle.setFmodalid(13L);
76
                 String s = mdkcctrlMapper.selectCreateByName(inf.getCreateBy());
75
                 String s = mdkcctrlMapper.selectCreateByName(inf.getCreateBy());
77
                 settle.setCreateByName(s);
76
                 settle.setCreateByName(s);
78
                 settle.setCreateTime(new Date());
77
                 settle.setCreateTime(new Date());
79
                 settle.setUpdateTime(new Date());
78
                 settle.setUpdateTime(new Date());
79
+                if (purchasecontract.getBiztype().equals("内贸采购")) {
80
+                    settle.setFmodalid(13L);
80
 
81
 
81
-                settle.setFours(purchaseOrder.getFours());
82
 
82
 
83
-                settle.setFoursname(purchaseOrder.getFoursname());
83
+                    settle.setFours(purchaseOrder.getFours());
84
 
84
 
85
-                settle.setSupCode(purchaseOrder.getSupCode());
85
+                    settle.setFoursname(purchaseOrder.getFoursname());
86
 
86
 
87
-                settle.setSupName(purchaseOrder.getSupName());
87
+                    settle.setSupCode(purchaseOrder.getSupCode());
88
 
88
 
89
-                settle.setSignLoc(purchaseOrder.getSignLoc());
89
+                    settle.setSupName(purchaseOrder.getSupName());
90
 
90
 
91
-                settle.setBizType(purchaseOrder.getBizType());
91
+                    settle.setSignLoc(purchaseOrder.getSignLoc());
92
 
92
 
93
-                settle.setOurBankAcct(purchaseOrder.getOurBankAcct());
93
+                    settle.setBizType(purchaseOrder.getBizType());
94
 
94
 
95
-                settle.setOurBankNm(purchaseOrder.getOurBankNm());
95
+                    settle.setOurBankAcct(purchaseOrder.getOurBankAcct());
96
 
96
 
97
-                settle.setServiceType(purchaseOrder.getServiceType());
97
+                    settle.setOurBankNm(purchaseOrder.getOurBankNm());
98
 
98
 
99
-                settle.setBizProductType(purchaseOrder.getBizProductType());
99
+                    settle.setServiceType(purchaseOrder.getServiceType());
100
 
100
 
101
-                settle.setSupAcc(purchasecontract.getSupacc());
102
-                settle.setSupBank(purchasecontract.getSupbank());
103
-                settle.setSupContact(purchasecontract.getSupcontact());
104
-                settle.setTrdCtry(purchasecontract.getTrdctry());
101
+                    settle.setBizProductType(purchaseOrder.getBizProductType());
102
+
103
+                    settle.setSupAcc(purchasecontract.getSupacc());
104
+                    settle.setSupBank(purchasecontract.getSupbank());
105
+                    settle.setSupContact(purchasecontract.getSupcontact());
106
+                    settle.setTrdCtry(purchasecontract.getTrdctry());
107
+                }
108
+                else {
109
+                    settle.setFmodalid(37L);
110
+                    settle.setFours(purchaseOrder.getFours());
111
+                    settle.setFoursname(purchaseOrder.getFoursname());
112
+                    settle.setSupCode(purchaseOrder.getSupCode());
113
+                    settle.setSupName(purchaseOrder.getSupName());
114
+
115
+
116
+                    settle.setCurcy(purchaseOrder.getCurcy());
117
+                    settle.setRate(purchaseOrder.getRate());
118
+                    settle.setTerms(purchaseOrder.getTerms());
119
+
120
+
121
+                    settle.setSignLoc(purchaseOrder.getSignLoc());
122
+                    settle.setLPort(purchaseOrder.getLPort());
123
+                    settle.setDPort(purchaseOrder.getDPort());
124
+
125
+
126
+                    settle.setPayment(purchaseOrder.getPayment());
127
+                    settle.setQtyOver(purchaseOrder.getQtyOver());
128
+                    settle.setQtyShort(purchaseOrder.getQtyShort());
129
+                    settle.setAmtOver(purchaseOrder.getAmtOver());
130
+                    settle.setAmtShort(purchaseOrder.getAmtShort());
131
+
132
+
133
+                    settle.setAcctSet(purchaseOrder.getAcctSet());
134
+                    settle.setBizType(purchaseOrder.getBizType());
135
+
136
+
137
+                    settle.setContrExecCd(purchaseOrder.getContrExecCd());
138
+                    settle.setContrExecNm(purchaseOrder.getContrExecNm());
139
+                    settle.setEstArrDt(purchaseOrder.getEstArrDt());
140
+                    settle.setEstLoadDt(purchaseOrder.getEstLoadDt());
141
+
142
+
143
+                    settle.setOurBankAcct(purchaseOrder.getOurBankAcct());
144
+                    settle.setOurBankNm(purchaseOrder.getOurBankNm());
145
+
146
+
147
+                    settle.setRespCtrCode(purchaseOrder.getRespCtrCode());
148
+                    settle.setRespCtrName(purchaseOrder.getRespCtrName());
149
+
150
+                    settle.setSupAcc(purchasecontract.getSupacc());
151
+                    settle.setSupBank(purchasecontract.getSupbank());
152
+                    settle.setTrdCtry(purchasecontract.getTrdctry());
153
+                }
105
 
154
 
106
 
155
 
107
 
156
 
130
                 dtl.setTaxAmt(inf.getTaxAmt());     // 映射中间表税额
179
                 dtl.setTaxAmt(inf.getTaxAmt());     // 映射中间表税额
131
                 dtl.setPoprice(inf.getPoprice()); // 映射中间表含税单价
180
                 dtl.setPoprice(inf.getPoprice()); // 映射中间表含税单价
132
                 dtl.setPoamt(inf.getPoamt());       // 映射中间表含税金额
181
                 dtl.setPoamt(inf.getPoamt());       // 映射中间表含税金额
182
+                dtl.setPono(purchasecontract.getFno());
183
+                dtl.setPoOrderNo(purchasecontract.getFno());
184
+
185
+                if (purchasecontract.getBiztype().equals("内贸采购")) {
186
+                    List<Mdkcctrl> mdkcctrlList=mdkcctrlMapper.selectByPono(purchasecontract.getFno());
187
+                }
188
+
189
+
190
+
133
 
191
 
134
 
192
 
135
-                purStlProdDtlMapper.insertJinxiangPurStlProdDtl(dtl);
193
+                purStlProdDtlMapper.insert(dtl);
136
 
194
 
137
                 // 更新中间表状态为已导入
195
                 // 更新中间表状态为已导入
138
                 //todo
196
                 //todo

+ 3
- 0
src/main/java/com/example/backend/pAndSExe/service/impl/PayServiceImpl.java Просмотреть файл

125
                 dtl.setServiceType(purchaseOrder.getServiceType());
125
                 dtl.setServiceType(purchaseOrder.getServiceType());
126
                 String sdesc =purchasecontractMapper.selectSdesc(purchasecontract.getId());
126
                 String sdesc =purchasecontractMapper.selectSdesc(purchasecontract.getId());
127
                 dtl.setSdesc(sdesc);
127
                 dtl.setSdesc(sdesc);
128
+                dtl.setPono(purchasecontract.getPono());
129
+                dtl.setFno(exe3.getFno());
130
+                dtl.setPoOrderNo(purchaseOrder.getFno());
128
 
131
 
129
 
132
 
130
 
133
 

+ 4
- 1
src/main/java/com/example/backend/pAndSExe/service/impl/StockServiceImpl.java Просмотреть файл

102
                         ctrl.setBizType(purchaseOrder.getBizType());
102
                         ctrl.setBizType(purchaseOrder.getBizType());
103
                         ctrl.setBizProductType(purchaseOrder.getBizProductType());
103
                         ctrl.setBizProductType(purchaseOrder.getBizProductType());
104
 
104
 
105
-
106
                     }
105
                     }
107
                 }else if (exe1.getFmodalid()==24){
106
                 }else if (exe1.getFmodalid()==24){
108
                      salesOrder = salesorderMapper.selectBySalesContract(exe1.getSfno());
107
                      salesOrder = salesorderMapper.selectBySalesContract(exe1.getSfno());
147
                 dtl.setQty(exe1.getQty());           // 对应inf_exe1.qty
146
                 dtl.setQty(exe1.getQty());           // 对应inf_exe1.qty
148
                 dtl.setPono(exe1.getPfno());         // 对应inf_exe1.pfno
147
                 dtl.setPono(exe1.getPfno());         // 对应inf_exe1.pfno
149
                 dtl.setSono(exe1.getSfno());         // 对应inf_exe1.sfno
148
                 dtl.setSono(exe1.getSfno());         // 对应inf_exe1.sfno
149
+                dtl.setSoOrderNo(exe1.getSfno());
150
+                dtl.setPoOrderNo(exe1.getPfno());
150
                 dtl.setFmodalid(Long.valueOf(exe1.getFmodalid())); // 对应inf_exe1.fmodalid
151
                 dtl.setFmodalid(Long.valueOf(exe1.getFmodalid())); // 对应inf_exe1.fmodalid
151
                 dtl.setItemno(exe1.getItemno());     // 对应inf_exe1.itemno
152
                 dtl.setItemno(exe1.getItemno());     // 对应inf_exe1.itemno
152
                 dtl.setSdesc(exe1.getSdesc());       // 对应inf_exe1.sdesc
153
                 dtl.setSdesc(exe1.getSdesc());       // 对应inf_exe1.sdesc
178
                             dtl.setSupName(purchaseOrder.getSupName());
179
                             dtl.setSupName(purchaseOrder.getSupName());
179
                             dtl.setPoOrderNo(purchaseOrder.getFno());
180
                             dtl.setPoOrderNo(purchaseOrder.getFno());
180
                         }
181
                         }
182
+                        dtl.setPoOrderNo(purchasecontract.getFno());
181
                         dtl.setAcctSet(pOrderDtl.getAcctSet());
183
                         dtl.setAcctSet(pOrderDtl.getAcctSet());
182
                         Long poid =purchaseorderMapper.selectPoid(purchasecontract.getId());
184
                         Long poid =purchaseorderMapper.selectPoid(purchasecontract.getId());
183
                         dtl.setPoid(poid);
185
                         dtl.setPoid(poid);
193
                         }
195
                         }
194
                         dtl.setCreateAcc(exe1.getCreateBy());
196
                         dtl.setCreateAcc(exe1.getCreateBy());
195
 
197
 
198
+
196
                     }
199
                     }
197
                 }else if (exe1.getFmodalid()==24){
200
                 }else if (exe1.getFmodalid()==24){
198
                     String id =mdkcctrlMapper.selectBySno(exe1.getSfno());
201
                     String id =mdkcctrlMapper.selectBySno(exe1.getSfno());

+ 140
- 8
src/main/java/com/example/backend/pAndSExe/util/PsExeExcelUtil.java Просмотреть файл

7
 import com.example.backend.pAndSExe.dto.*;
7
 import com.example.backend.pAndSExe.dto.*;
8
 import com.example.backend.pAndSExe.mapper.InfExe1AmountMapper;
8
 import com.example.backend.pAndSExe.mapper.InfExe1AmountMapper;
9
 import com.example.backend.pAndSExe.mapper.InfExe1Mapper;
9
 import com.example.backend.pAndSExe.mapper.InfExe1Mapper;
10
+import com.example.backend.pAndSExe.mapper.ShangpinkuMapper;
10
 import com.example.backend.pAndSExe.model.*;
11
 import com.example.backend.pAndSExe.model.*;
12
+import com.sun.corba.se.spi.activation.BadServerDefinition;
11
 import org.apache.commons.math3.genetics.GeneticAlgorithm;
13
 import org.apache.commons.math3.genetics.GeneticAlgorithm;
12
 import org.springframework.beans.factory.annotation.Autowired;
14
 import org.springframework.beans.factory.annotation.Autowired;
13
 import org.springframework.stereotype.Component;
15
 import org.springframework.stereotype.Component;
40
     @Autowired
42
     @Autowired
41
     private InfExe1AmountMapper infExe1AmountMapper;
43
     private InfExe1AmountMapper infExe1AmountMapper;
42
 
44
 
45
+    @Autowired
46
+    private ShangpinkuMapper shangpinkuMapper;
47
+
43
 
48
 
44
     // 日期格式化器
49
     // 日期格式化器
45
     private   final String[] DATE_FORMATS = {"yyyy-MM-dd", "yyyy.MM.dd", "yyyy/MM/dd"};
50
     private   final String[] DATE_FORMATS = {"yyyy-MM-dd", "yyyy.MM.dd", "yyyy/MM/dd"};
217
                 errorLogList.add("采购合同号不存在");
222
                 errorLogList.add("采购合同号不存在");
218
             }
223
             }
219
         }
224
         }
225
+        if (dto.getItemnoSdescBrand() != null&& !dto.getItemnoSdescBrand().isEmpty()) {
226
+            String[] itemFields = splitCombinedField(dto.getItemnoSdescBrand());
227
+            if (itemFields.length < 3) {
228
+                errorLogList.add("商品信息格式错误");
229
+            }else {
230
+                Shangpinku shangpinku = shangpinkuMapper.selectByItemno(itemFields[0].trim());
231
+                if(shangpinku==null){
232
+                    errorLogList.add("商品信息不存在");
233
+                }else {
234
+                    if (!shangpinku.getSdesc().equals(itemFields[1].trim())){
235
+                        errorLogList.add("商品名称不匹配");
236
+                    }
237
+                }
238
+            }
239
+        }else errorLogList.add("商品信息为空");
220
 
240
 
221
         // 2. 校验其他字段
241
         // 2. 校验其他字段
222
         if (dto.getStockname() == null || dto.getStockname().trim().isEmpty()) {
242
         if (dto.getStockname() == null || dto.getStockname().trim().isEmpty()) {
245
         if (dto.getUt() == null || dto.getUt().trim().isEmpty()) {
265
         if (dto.getUt() == null || dto.getUt().trim().isEmpty()) {
246
             errorLogList.add("单位为空");
266
             errorLogList.add("单位为空");
247
         }
267
         }
268
+
269
+        else if (!Shujvzidian.danwei.contains(dto.getUt().trim())){
270
+            errorLogList.add("单位不在字典中");
271
+        }
248
         String bizProductType=infExe1Mapper.selectBizProductTypeByPfno(dto.getPfno());
272
         String bizProductType=infExe1Mapper.selectBizProductTypeByPfno(dto.getPfno());
249
         if (bizProductType == null || bizProductType.trim().isEmpty()) {
273
         if (bizProductType == null || bizProductType.trim().isEmpty()) {
250
             errorLogList.add("合同业务产品类型为空");
274
             errorLogList.add("合同业务产品类型为空");
276
                 errorLogList.add("煤炭计价方式为空");
300
                 errorLogList.add("煤炭计价方式为空");
277
             }
301
             }
278
         }
302
         }
303
+        if (dto.getPoprice()==null){
304
+            errorLogList.add("采购单价含税为空");
305
+        }
306
+        if (dto.getNtPoPrice()==null){
307
+            errorLogList.add("采购单价不含税为空");
308
+        }
309
+        if (dto.getSoamt()==null){
310
+            errorLogList.add("金额含税为空");
311
+        }
312
+        if (dto.getNtPoAmt()==null){
313
+            errorLogList.add("金额不含税为空");
314
+        }
279
 
315
 
280
 
316
 
281
         // 3. 构建errorLog字符串(多错误用分号分隔)
317
         // 3. 构建errorLog字符串(多错误用分号分隔)
376
                 errorLogList.add("销售合同号不存在");
412
                 errorLogList.add("销售合同号不存在");
377
             }
413
             }
378
         }
414
         }
415
+        if (dto.getItemnoSdescBrand() != null&& !dto.getItemnoSdescBrand().isEmpty()) {
416
+            String[] itemFields = splitCombinedField(dto.getItemnoSdescBrand());
417
+            if (itemFields.length < 3) {
418
+                errorLogList.add("商品信息格式错误");
419
+            }else {
420
+                Shangpinku shangpinku = shangpinkuMapper.selectByItemno(itemFields[0].trim());
421
+                if(shangpinku==null){
422
+                    errorLogList.add("商品信息不存在");
423
+                }else {
424
+                    if (!shangpinku.getSdesc().equals(itemFields[1].trim())){
425
+                        errorLogList.add("商品名称不匹配");
426
+                    }
427
+                }
428
+            }
429
+        }else errorLogList.add("商品信息为空");
379
 
430
 
380
         // 2. 其他基础字段非空校验(与InfExe1一致)
431
         // 2. 其他基础字段非空校验(与InfExe1一致)
381
         if (dto.getStockname() == null || dto.getStockname().trim().isEmpty()) {
432
         if (dto.getStockname() == null || dto.getStockname().trim().isEmpty()) {
401
         if (dto.getUt() == null || dto.getUt().trim().isEmpty()) {
452
         if (dto.getUt() == null || dto.getUt().trim().isEmpty()) {
402
             errorLogList.add("单位为空");
453
             errorLogList.add("单位为空");
403
         }
454
         }
455
+        else if (!Shujvzidian.danwei.contains(dto.getUt().trim())){
456
+            errorLogList.add("单位不在字典中");
457
+        }
404
         if (dto.getCreateBy() == null || dto.getCreateBy().trim().isEmpty()) {
458
         if (dto.getCreateBy() == null || dto.getCreateBy().trim().isEmpty()) {
405
             errorLogList.add("制单人为空");
459
             errorLogList.add("制单人为空");
406
         }
460
         }
435
                 errorLogList.add("煤炭计价方式为空");
489
                 errorLogList.add("煤炭计价方式为空");
436
             }
490
             }
437
         }
491
         }
492
+        if (dto.getSoprice()==null){
493
+            errorLogList.add("采购单价含税为空");
494
+        }
495
+        if (dto.getNtPoPrice()==null){
496
+            errorLogList.add("采购单价不含税为空");
497
+        }
498
+        if (dto.getSoamt()==null){
499
+            errorLogList.add("金额含税为空");
500
+        }
501
+        if (dto.getNtPoAmt()==null){
502
+            errorLogList.add("金额不含税为空");
503
+        }
438
 
504
 
439
 
505
 
440
         // 3. 构建errorLog字符串(多错误用分号分隔)
506
         // 3. 构建errorLog字符串(多错误用分号分隔)
778
         // 基础字段非空校验
844
         // 基础字段非空校验
779
         if (dto.getTaxInvType() == null || dto.getTaxInvType().trim().isEmpty()) {
845
         if (dto.getTaxInvType() == null || dto.getTaxInvType().trim().isEmpty()) {
780
             errorLogList.add("发票类型为空");
846
             errorLogList.add("发票类型为空");
847
+        }else if(!Shujvzidian.fapiaozhonglei.contains(dto.getTaxInvType().trim())){
848
+            errorLogList.add("发票种类不在选项中");
849
+        }else if(dto.getTaxInvType().trim().contains("海关")){
850
+            errorLogList.add("海关发票需要联系管理员");
781
         }
851
         }
782
         if (dto.getTaxInvNo() == null || dto.getTaxInvNo().trim().isEmpty()) {
852
         if (dto.getTaxInvNo() == null || dto.getTaxInvNo().trim().isEmpty()) {
783
             errorLogList.add("发票号码为空");
853
             errorLogList.add("发票号码为空");
791
         if (dto.getUt() == null || dto.getUt().trim().isEmpty()) {
861
         if (dto.getUt() == null || dto.getUt().trim().isEmpty()) {
792
             errorLogList.add("单位为空");
862
             errorLogList.add("单位为空");
793
         }
863
         }
864
+        else if (!Shujvzidian.danwei.contains(dto.getUt().trim())){
865
+            errorLogList.add("单位不在字典中");
866
+        }
794
         if (dto.getFeeNm() == null || dto.getFeeNm().trim().isEmpty()) {
867
         if (dto.getFeeNm() == null || dto.getFeeNm().trim().isEmpty()) {
795
             errorLogList.add("费用名称为空");
868
             errorLogList.add("费用名称为空");
796
         }
869
         }
902
         if (dto.getTaxInvType() == null || dto.getTaxInvType().trim().isEmpty()) {
975
         if (dto.getTaxInvType() == null || dto.getTaxInvType().trim().isEmpty()) {
903
             errorLogList.add("发票类型为空");
976
             errorLogList.add("发票类型为空");
904
         }
977
         }
978
+        else if(!Shujvzidian.fapiaozhonglei.contains(dto.getTaxInvType().trim())){
979
+            errorLogList.add("发票种类不在选项中");
980
+        }else if(dto.getTaxInvType().trim().contains("海关")){
981
+            errorLogList.add("海关发票需要联系管理员");
982
+        }
905
         if (dto.getPoPrice() == null) {
983
         if (dto.getPoPrice() == null) {
906
             errorLogList.add("含税单价为空");
984
             errorLogList.add("含税单价为空");
907
         }
985
         }
912
         if (dto.getTaxInvNo() == null || dto.getTaxInvNo().trim().isEmpty()) {
990
         if (dto.getTaxInvNo() == null || dto.getTaxInvNo().trim().isEmpty()) {
913
             errorLogList.add("发票号码为空");
991
             errorLogList.add("发票号码为空");
914
         }
992
         }
915
-        if (dto.getItemnoSdescBrand() == null || dto.getItemnoSdescBrand().trim().isEmpty()) {
916
-            errorLogList.add("商品编码+中文品名+牌号为空");
917
-        }
993
+
994
+        if (dto.getItemnoSdescBrand() != null&& !dto.getItemnoSdescBrand().isEmpty()) {
995
+            String[] itemFields = splitCombinedField(dto.getItemnoSdescBrand());
996
+            if (itemFields.length < 3) {
997
+                errorLogList.add("商品信息格式错误");
998
+            }else {
999
+                Shangpinku shangpinku = shangpinkuMapper.selectByItemno(itemFields[0].trim());
1000
+                if(shangpinku==null){
1001
+                    errorLogList.add("商品信息不存在");
1002
+                }else {
1003
+                    if (!shangpinku.getSdesc().equals(itemFields[1].trim())){
1004
+                        errorLogList.add("商品名称不匹配");
1005
+                    }
1006
+                }
1007
+            }
1008
+        }else errorLogList.add("商品编码+中文品名+牌号为空");
918
         if (dto.getUt() == null || dto.getUt().trim().isEmpty()) {
1009
         if (dto.getUt() == null || dto.getUt().trim().isEmpty()) {
919
             errorLogList.add("单位为空");
1010
             errorLogList.add("单位为空");
920
         }
1011
         }
1012
+        else if (!Shujvzidian.danwei.contains(dto.getUt().trim())){
1013
+            errorLogList.add("单位不在字典中");
1014
+        }
921
         if (dto.getCurcypo() == null || dto.getCurcypo().trim().isEmpty()) {
1015
         if (dto.getCurcypo() == null || dto.getCurcypo().trim().isEmpty()) {
922
             errorLogList.add("币别为空");
1016
             errorLogList.add("币别为空");
923
         }
1017
         }
1238
         String invoiceSort = trimField(dto.getInvoiceSort());
1332
         String invoiceSort = trimField(dto.getInvoiceSort());
1239
         if (invoiceSort.isEmpty()) {
1333
         if (invoiceSort.isEmpty()) {
1240
             errorLogList.add("发票种类为空");
1334
             errorLogList.add("发票种类为空");
1335
+        }else if(!Shujvzidian.fapiaozhonglei.contains(invoiceSort)){
1336
+            errorLogList.add("发票种类不在选项中");
1241
         }
1337
         }
1242
 
1338
 
1339
+
1243
         // -------------------- 客户信息合并列拆分(ctName/ctInvoiceBankName/ctInvoiceBankAcct/ctContNm) --------------------
1340
         // -------------------- 客户信息合并列拆分(ctName/ctInvoiceBankName/ctInvoiceBankAcct/ctContNm) --------------------
1244
         String ctInfo = trimField(dto.getCtInfo());
1341
         String ctInfo = trimField(dto.getCtInfo());
1245
         String ctName = "";
1342
         String ctName = "";
1265
             }
1362
             }
1266
         }
1363
         }
1267
 
1364
 
1365
+        if (dto.getItemInfo() != null&& !dto.getItemInfo().isEmpty()) {
1366
+            String[] itemFields = splitCombinedField(dto.getItemInfo());
1367
+            if (itemFields.length < 3) {
1368
+                errorLogList.add("商品信息格式错误");
1369
+            }else {
1370
+                Shangpinku shangpinku = shangpinkuMapper.selectByItemno(itemFields[0].trim());
1371
+                if(shangpinku==null){
1372
+                    errorLogList.add("商品信息不存在");
1373
+                }else {
1374
+                    if (!shangpinku.getSdesc().equals(itemFields[1].trim())){
1375
+                        errorLogList.add("商品名称不匹配");
1376
+                    }
1377
+                }
1378
+            }
1379
+        }else errorLogList.add("商品信息为空");
1380
+
1268
         // -------------------- 物料信息合并列拆分(itemno/sdesc/brand) --------------------
1381
         // -------------------- 物料信息合并列拆分(itemno/sdesc/brand) --------------------
1269
         String itemInfo = trimField(dto.getItemInfo());
1382
         String itemInfo = trimField(dto.getItemInfo());
1270
         String itemno = "";
1383
         String itemno = "";
1279
             if (itemArr.length >= 2) sdesc = itemArr[1];
1392
             if (itemArr.length >= 2) sdesc = itemArr[1];
1280
             if (itemArr.length >= 3) brand = itemArr[2];
1393
             if (itemArr.length >= 3) brand = itemArr[2];
1281
             // 核心字段校验:物料编码不能为空
1394
             // 核心字段校验:物料编码不能为空
1282
-            if (itemno.isEmpty()) {
1395
+           /* if (itemno.isEmpty()) {
1283
                 errorLogList.add("物料编码解析失败,原始值:" + itemInfo);
1396
                 errorLogList.add("物料编码解析失败,原始值:" + itemInfo);
1284
-            }
1397
+            }*/
1285
         }
1398
         }
1286
 
1399
 
1287
         // -------------------- 单位校验 --------------------
1400
         // -------------------- 单位校验 --------------------
1288
         String ut = trimField(dto.getUt());
1401
         String ut = trimField(dto.getUt());
1289
         if (ut.isEmpty()) {
1402
         if (ut.isEmpty()) {
1290
             errorLogList.add("单位为空");
1403
             errorLogList.add("单位为空");
1404
+        }else if (!Shujvzidian.danwei.contains(ut)){
1405
+            errorLogList.add("单位不在字典中");
1291
         }
1406
         }
1292
 
1407
 
1408
+
1293
         String createBy = trimField(dto.getCreateBy());
1409
         String createBy = trimField(dto.getCreateBy());
1294
         if (createBy.isEmpty()) {
1410
         if (createBy.isEmpty()) {
1295
             errorLogList.add("制单人为空");
1411
             errorLogList.add("制单人为空");
1512
         if (invoiceSort.isEmpty()) {
1628
         if (invoiceSort.isEmpty()) {
1513
             errorLogList.add("发票种类为空");
1629
             errorLogList.add("发票种类为空");
1514
         }
1630
         }
1631
+        else if(!Shujvzidian.fapiaozhonglei.contains(invoiceSort)){
1632
+            errorLogList.add("发票种类不在选项中");
1633
+        }
1515
 
1634
 
1516
         // -------------------- 客户信息合并列拆分(ctName/ctInvoiceBankName/ctInvoiceBankAcct/ctContNm) --------------------
1635
         // -------------------- 客户信息合并列拆分(ctName/ctInvoiceBankName/ctInvoiceBankAcct/ctContNm) --------------------
1517
         String ctInfo = trimField(dto.getCtInfo());
1636
         String ctInfo = trimField(dto.getCtInfo());
1534
             }
1653
             }
1535
         }
1654
         }
1536
 
1655
 
1656
+        if (dto.getItemInfo() != null&& !dto.getItemInfo().isEmpty()) {
1657
+            String[] itemFields = splitCombinedField(dto.getItemInfo());
1658
+            if (itemFields.length < 3) {
1659
+                errorLogList.add("商品信息格式错误");
1660
+            }else {
1661
+                Shangpinku shangpinku = shangpinkuMapper.selectByItemno(itemFields[0].trim());
1662
+                if(shangpinku==null){
1663
+                    errorLogList.add("商品信息不存在");
1664
+                }else {
1665
+                    if (!shangpinku.getSdesc().equals(itemFields[1].trim())){
1666
+                        errorLogList.add("商品名称不匹配");
1667
+                    }
1668
+                }
1669
+            }
1670
+        }else errorLogList.add("商品信息为空");
1671
+
1537
         // -------------------- 物料信息合并列拆分(itemno/sdesc/brand) --------------------
1672
         // -------------------- 物料信息合并列拆分(itemno/sdesc/brand) --------------------
1538
         String itemInfo = trimField(dto.getItemInfo());
1673
         String itemInfo = trimField(dto.getItemInfo());
1539
         String itemno = "";
1674
         String itemno = "";
1548
             if (itemArr.length >= 2) sdesc = itemArr[1];
1683
             if (itemArr.length >= 2) sdesc = itemArr[1];
1549
             if (itemArr.length >= 3) brand = itemArr[2];
1684
             if (itemArr.length >= 3) brand = itemArr[2];
1550
             // 核心字段校验:物料编码不能为空
1685
             // 核心字段校验:物料编码不能为空
1551
-            if (itemno.isEmpty()) {
1552
-                errorLogList.add("物料编码解析失败,原始值:" + itemInfo);
1553
-            }
1554
         }
1686
         }
1555
 
1687
 
1556
         // -------------------- 单位校验 --------------------
1688
         // -------------------- 单位校验 --------------------

+ 11
- 0
src/main/java/com/example/backend/pAndSExe/util/Shujvzidian.java Просмотреть файл

1
+package com.example.backend.pAndSExe.util;
2
+
3
+public class Shujvzidian {
4
+    public static String danwei ="湿吨干吨辆架套个头块张件支枝根条筒长吨卷副片组份幅双对棵株井米盘平方米面节千克克盆万个具百副百支百把百个百片刀疋公担扇百枝千只千块千盒千枝千个亿支亿个万套千张万张千伏安千瓦千瓦时千升英尺吨立方米短吨司马担司马斤斤磅担英担短担两市担盎司克拉市尺码英寸寸升毫升英加仑美加仑立方英尺数量单位立方尺税务登记证平方码平方英尺平方尺英制马力公制马力令箱批罐桶扎包箩打筐罗匹册本发枚捆袋粒盒合瓶千支万双万粒千粒千米千英尺厘米部层床顶把只樘盏艘座其它";
5
+    public static String fapiaozhonglei="增值税专用发票增值税普通发票全电增值税普通发票全电增值税专用发票其他发票全电增值税专用发票其他发票海关增值税完税证明海关关税完税证明";
6
+
7
+
8
+
9
+
10
+}
11
+

Загрузка…
Отмена
Сохранить