|
|
@@ -167,10 +167,37 @@ public class SalesContractServiceImpl implements SalesContractService {
|
|
167
|
167
|
currentContractErrors.add("主表(Sheet1) 第 " + currentRow + " 行:合同执行人代码有误!");
|
|
168
|
168
|
currentContractValid = false;
|
|
169
|
169
|
}
|
|
|
170
|
+
|
|
170
|
171
|
if (contractUserList != null && !contractUserList.isEmpty() && !contractUserList.get(0).getUserDesc().isEmpty()) {
|
|
171
|
172
|
entity.setContrExecNm(contractUserList.get(0).getUserDesc());
|
|
172
|
173
|
}
|
|
173
|
174
|
|
|
|
175
|
+ if (contractUserList != null && !contractUserList.isEmpty() && !contractUserList.get(0).getDeptId().isEmpty()) {
|
|
|
176
|
+ entity.setDeptId(contractUserList.get(0).getDeptId());
|
|
|
177
|
+ }
|
|
|
178
|
+
|
|
|
179
|
+
|
|
|
180
|
+
|
|
|
181
|
+ if (contractUserList != null && !contractUserList.isEmpty() && !contractUserList.get(0).getFno().isEmpty()) {
|
|
|
182
|
+ entity.setFno(contractUserList.get(0).getFno());
|
|
|
183
|
+ }
|
|
|
184
|
+
|
|
|
185
|
+ if (contractUserList != null && !contractUserList.isEmpty() && !contractUserList.get(0).getFourscode().isEmpty()) {
|
|
|
186
|
+ entity.setContrExecCdInstitutionId(contractUserList.get(0).getFourscode());
|
|
|
187
|
+ }
|
|
|
188
|
+
|
|
|
189
|
+ if (contractUserList != null && !contractUserList.isEmpty() && !contractUserList.get(0).getCpny().isEmpty()) {
|
|
|
190
|
+ entity.setContrExecCdInstitutionNm(contractUserList.get(0).getCpny());
|
|
|
191
|
+ }
|
|
|
192
|
+
|
|
|
193
|
+ if (contractUserList != null && !contractUserList.isEmpty() && !StringUtils.isEmpty(contractUserList.get(0).getDeptCode())) {
|
|
|
194
|
+ entity.setContrExecCdDeptId(contractUserList.get(0).getDeptCode());
|
|
|
195
|
+ }
|
|
|
196
|
+
|
|
|
197
|
+ if (contractUserList != null && !contractUserList.isEmpty() && !StringUtils.isEmpty(contractUserList.get(0).getDeptName())) {
|
|
|
198
|
+ entity.setContrExecCdDeptNm(contractUserList.get(0).getDeptName());
|
|
|
199
|
+ }
|
|
|
200
|
+
|
|
174
|
201
|
if (StringUtils.isEmpty(entity.getCtName())) {
|
|
175
|
202
|
currentContractErrors.add("主表(Sheet1) 第 " + currentRow + " 行:客户名称不能为空!");
|
|
176
|
203
|
currentContractValid = false;
|
|
|
@@ -211,6 +238,11 @@ public class SalesContractServiceImpl implements SalesContractService {
|
|
211
|
238
|
entity.setCtNo(ctNameList.get(0).getFno());
|
|
212
|
239
|
}
|
|
213
|
240
|
|
|
|
241
|
+
|
|
|
242
|
+ if (ctNameList != null && !ctNameList.isEmpty() && !ctNameList.get(0).getCtrylmbAddr().isEmpty()) {
|
|
|
243
|
+ entity.setTrdCtry(ctNameList.get(0).getCtrylmbAddr());
|
|
|
244
|
+ }
|
|
|
245
|
+
|
|
214
|
246
|
if (ctNameList != null && !ctNameList.isEmpty() && !ctNameList.get(0).getCtContNm().isEmpty()) {
|
|
215
|
247
|
entity.setCtContNm(ctNameList.get(0).getCtContNm());
|
|
216
|
248
|
}
|
|
|
@@ -227,6 +259,9 @@ public class SalesContractServiceImpl implements SalesContractService {
|
|
227
|
259
|
currentContractErrors.add("主表(Sheet1) 第 " + currentRow + " 行:币别不能为空!");
|
|
228
|
260
|
currentContractValid = false;
|
|
229
|
261
|
}
|
|
|
262
|
+ if (!StringUtils.isEmpty(entity.getCurcy())) {
|
|
|
263
|
+ entity.setCurcy(entity.getCurcy().split("-")[0]);
|
|
|
264
|
+ }
|
|
230
|
265
|
|
|
231
|
266
|
List<SysUser> curcyList = sysUserMapper.selectByCurcy(entity.getCurcy());
|
|
232
|
267
|
if (curcyList == null || curcyList.isEmpty()) {
|
|
|
@@ -249,6 +284,10 @@ public class SalesContractServiceImpl implements SalesContractService {
|
|
249
|
284
|
entity.setRateUs(curcyList.get(0).getRateUs());
|
|
250
|
285
|
}
|
|
251
|
286
|
|
|
|
287
|
+ if (curcyList != null && !curcyList.isEmpty() && !Objects.isNull(curcyList.get(0).getRateUsd())) {
|
|
|
288
|
+ entity.setRateUsd(curcyList.get(0).getRateUsd());
|
|
|
289
|
+ }
|
|
|
290
|
+
|
|
252
|
291
|
if ("出口销售".equals(entity.getBizType()) || "转口销售".equals(entity.getBizType())) {
|
|
253
|
292
|
if (entity.getEstLoadDt() == null) {
|
|
254
|
293
|
currentContractErrors.add("主表(Sheet1) 第 " + currentRow + " 行:合同类型为出口销售或转口销售时,最迟装运日期不能为空!");
|
|
|
@@ -285,6 +324,10 @@ public class SalesContractServiceImpl implements SalesContractService {
|
|
285
|
324
|
entity.setOurBankNm(foursnameList.get(0).getOurBankNm());
|
|
286
|
325
|
}
|
|
287
|
326
|
|
|
|
327
|
+ if (foursnameList != null && !foursnameList.isEmpty() && !foursnameList.get(0).getOurBankNm().isEmpty()) {
|
|
|
328
|
+ entity.setOurBankNm(foursnameList.get(0).getOurBankNm());
|
|
|
329
|
+ }
|
|
|
330
|
+
|
|
288
|
331
|
if (foursnameList != null && !foursnameList.isEmpty() && !foursnameList.get(0).getOurBankAcct().isEmpty()) {
|
|
289
|
332
|
entity.setOurBankAcct(foursnameList.get(0).getOurBankAcct());
|
|
290
|
333
|
}
|
|
|
@@ -293,10 +336,33 @@ public class SalesContractServiceImpl implements SalesContractService {
|
|
293
|
336
|
entity.setSignLoc(foursnameList.get(0).getSignLoc());
|
|
294
|
337
|
}
|
|
295
|
338
|
|
|
|
339
|
+
|
|
|
340
|
+
|
|
296
|
341
|
if (StringUtils.isEmpty(entity.getIfClearBottom())) {
|
|
297
|
342
|
entity.setIfClearBottom("否");
|
|
298
|
343
|
}
|
|
299
|
344
|
|
|
|
345
|
+
|
|
|
346
|
+ // 设置默认值
|
|
|
347
|
+ if (StringUtils.isEmpty(entity.getWhetherChartering())) {
|
|
|
348
|
+ entity.setWhetherChartering("否");
|
|
|
349
|
+ }
|
|
|
350
|
+ if (StringUtils.isEmpty(entity.getIfLongTerm())) {
|
|
|
351
|
+ entity.setIfLongTerm("否");
|
|
|
352
|
+ }
|
|
|
353
|
+ if (StringUtils.isEmpty(entity.getIfClearBottom())) {
|
|
|
354
|
+ entity.setIfClearBottom("否");
|
|
|
355
|
+ }
|
|
|
356
|
+ if (StringUtils.isEmpty(entity.getIfLegalCheck())) {
|
|
|
357
|
+ entity.setIfLegalCheck("是");
|
|
|
358
|
+ }
|
|
|
359
|
+ if (StringUtils.isEmpty(entity.getIfPayMultiple())) {
|
|
|
360
|
+ entity.setIfPayMultiple("是");
|
|
|
361
|
+ }
|
|
|
362
|
+ if (StringUtils.isEmpty(entity.getIfBidding())) {
|
|
|
363
|
+ entity.setIfBidding("是");
|
|
|
364
|
+ }
|
|
|
365
|
+
|
|
300
|
366
|
if ("铁矿石".equals(entity.getBizProductType()) || "煤炭".equals(entity.getBizProductType())) {
|
|
301
|
367
|
if (StringUtils.isEmpty(entity.getIfLongTerm())) {
|
|
302
|
368
|
currentContractErrors.add("主表(Sheet1) 第 " + currentRow + " 行:合同产品类型为铁矿石或煤炭时,是否长协不能为空");
|
|
|
@@ -381,25 +447,7 @@ public class SalesContractServiceImpl implements SalesContractService {
|
|
381
|
447
|
currentContractValid = false;
|
|
382
|
448
|
}
|
|
383
|
449
|
|
|
384
|
|
- // 设置默认值
|
|
385
|
|
- if (StringUtils.isEmpty(entity.getWhetherChartering())) {
|
|
386
|
|
- entity.setWhetherChartering("否");
|
|
387
|
|
- }
|
|
388
|
|
- if (StringUtils.isEmpty(entity.getIfLongTerm())) {
|
|
389
|
|
- entity.setIfLongTerm("否");
|
|
390
|
|
- }
|
|
391
|
|
- if (StringUtils.isEmpty(entity.getIfClearBottom())) {
|
|
392
|
|
- entity.setIfClearBottom("否");
|
|
393
|
|
- }
|
|
394
|
|
- if (StringUtils.isEmpty(entity.getIfLegalCheck())) {
|
|
395
|
|
- entity.setIfLegalCheck("是");
|
|
396
|
|
- }
|
|
397
|
|
- if (StringUtils.isEmpty(entity.getIfPayMultiple())) {
|
|
398
|
|
- entity.setIfPayMultiple("是");
|
|
399
|
|
- }
|
|
400
|
|
- if (StringUtils.isEmpty(entity.getIfBidding())) {
|
|
401
|
|
- entity.setIfBidding("是");
|
|
402
|
|
- }
|
|
|
450
|
+
|
|
403
|
451
|
|
|
404
|
452
|
// 额外校验逻辑
|
|
405
|
453
|
boolean needValidate = false;
|
|
|
@@ -551,23 +599,23 @@ public class SalesContractServiceImpl implements SalesContractService {
|
|
551
|
599
|
}
|
|
552
|
600
|
}
|
|
553
|
601
|
|
|
554
|
|
- if (StringUtils.isEmpty(entity1.getCurcyPo())) {
|
|
555
|
|
- currentContractErrors.add("产品明细(Sheet2) 合同号 " + currentSono + " 第 " + (i + 1) + " 行:采购币种不能为空!");
|
|
556
|
|
- currentContractValid = false;
|
|
557
|
|
- }
|
|
558
|
|
-
|
|
559
|
|
- List<CustCtrl> curcyList1 = custCtrlMapper.selectByCurcyPo(entity1.getCurcyPo());
|
|
560
|
|
- if (curcyList1 == null || curcyList1.isEmpty()) {
|
|
561
|
|
- currentContractErrors.add("产品明细(Sheet2) 合同号 " + currentSono + " 第 " + (i + 1) + " 行:采购币种有误!");
|
|
562
|
|
- currentContractValid = false;
|
|
563
|
|
- }
|
|
|
602
|
+// if (StringUtils.isEmpty(entity1.getCurcyPo())) {
|
|
|
603
|
+// currentContractErrors.add("产品明细(Sheet2) 合同号 " + currentSono + " 第 " + (i + 1) + " 行:采购币种不能为空!");
|
|
|
604
|
+// currentContractValid = false;
|
|
|
605
|
+// }
|
|
564
|
606
|
|
|
565
|
|
- if (curcyList1 != null && !curcyList1.isEmpty() && !Objects.isNull(curcyList1.get(0).getRate()) && !Objects.isNull(entity1.getRatePo())) {
|
|
566
|
|
- if (entity1.getRatePo().compareTo(curcyList1.get(0).getRate()) != 0) {
|
|
567
|
|
- currentContractErrors.add("产品明细(Sheet2) 合同号 " + currentSono + " 第 " + (i + 1) + " 行:采购汇率和匹配到的采购汇率不符!");
|
|
568
|
|
- currentContractValid = false;
|
|
569
|
|
- }
|
|
570
|
|
- }
|
|
|
607
|
+// List<CustCtrl> curcyList1 = custCtrlMapper.selectByCurcyPo(entity1.getCurcyPo());
|
|
|
608
|
+// if (curcyList1 == null || curcyList1.isEmpty()) {
|
|
|
609
|
+// currentContractErrors.add("产品明细(Sheet2) 合同号 " + currentSono + " 第 " + (i + 1) + " 行:采购币种有误!");
|
|
|
610
|
+// currentContractValid = false;
|
|
|
611
|
+// }
|
|
|
612
|
+//
|
|
|
613
|
+// if (curcyList1 != null && !curcyList1.isEmpty() && !Objects.isNull(curcyList1.get(0).getRate()) && !Objects.isNull(entity1.getRatePo())) {
|
|
|
614
|
+// if (entity1.getRatePo().compareTo(curcyList1.get(0).getRate()) != 0) {
|
|
|
615
|
+// currentContractErrors.add("产品明细(Sheet2) 合同号 " + currentSono + " 第 " + (i + 1) + " 行:采购汇率和匹配到的采购汇率不符!");
|
|
|
616
|
+// currentContractValid = false;
|
|
|
617
|
+// }
|
|
|
618
|
+// }
|
|
571
|
619
|
|
|
572
|
620
|
// 产品类型特定校验
|
|
573
|
621
|
if ("铁矿石".equals(bizProductType)) {
|