|
|
@@ -74,7 +74,7 @@ public class PurchaseContractServiceImpl implements PurchaseContractService {
|
|
74
|
74
|
List<ContractErrorMsg> contractErrorMsgs = check_program(excel_main, excel_dtl, excel_pay, excel_RCecent);
|
|
75
|
75
|
|
|
76
|
76
|
// 保存错误信息到数据库
|
|
77
|
|
- saveErrorMessages(contractErrorMsgs);
|
|
|
77
|
+ //saveErrorMessages(contractErrorMsgs);
|
|
78
|
78
|
|
|
79
|
79
|
// 第三步:保存通过校验的数据
|
|
80
|
80
|
boolean saveSuccess = saveSuccesscontract(purchaseContracts, pCcontractDtls, pCcontractPayments, pCcontractRCenterDtls);
|
|
|
@@ -495,12 +495,13 @@ public class PurchaseContractServiceImpl implements PurchaseContractService {
|
|
495
|
495
|
setErrorAndAddToList(contractError, errorMsg, errorMsgList);
|
|
496
|
496
|
|
|
497
|
497
|
// 如果校验通过,将数据添加到存储列表
|
|
498
|
|
- if (errorMsg.length() == 0) {
|
|
499
|
|
- addValidatedData(mainItem, dtlByPono.get(currentPono),
|
|
500
|
|
- payByPono.get(currentPono), rcentByPono.get(currentPono),
|
|
501
|
|
- createuserByList ,ZhixingUserByList ,wofangNameList ,GongYingNameList ,
|
|
502
|
|
- curcyList ,lPortList ,dPortList );
|
|
503
|
|
- }
|
|
|
498
|
+ addValidatedData(mainItem, dtlByPono.get(currentPono),
|
|
|
499
|
+ payByPono.get(currentPono), rcentByPono.get(currentPono),
|
|
|
500
|
+ createuserByList ,ZhixingUserByList ,wofangNameList ,GongYingNameList ,
|
|
|
501
|
+ curcyList ,lPortList ,dPortList );
|
|
|
502
|
+// if (errorMsg.length() == 0) {
|
|
|
503
|
+//
|
|
|
504
|
+// }
|
|
504
|
505
|
}
|
|
505
|
506
|
}
|
|
506
|
507
|
|
|
|
@@ -532,20 +533,29 @@ public class PurchaseContractServiceImpl implements PurchaseContractService {
|
|
532
|
533
|
contract.setSignPlace(wofangNameList.get(0).getSignLoc());
|
|
533
|
534
|
|
|
534
|
535
|
//根据查询到的“供应商信息”结果填入数据
|
|
535
|
|
- contract.setSupCode(GongYingNameList.get(0).getFno());
|
|
536
|
|
- contract.setSupName(GongYingNameList.get(0).getCpny());
|
|
537
|
|
- contract.setSupBank(GongYingNameList.get(0).getCtBankName());
|
|
538
|
|
- contract.setSupAcc(GongYingNameList.get(0).getCtBankAcct());
|
|
539
|
|
- contract.setSupContact(GongYingNameList.get(0).getCtContNm());
|
|
540
|
|
- contract.setTradeCntry(GongYingNameList.get(0).getCtrylmbAddr());
|
|
|
536
|
+ if(GongYingNameList != null && !GongYingNameList.isEmpty()){
|
|
|
537
|
+ contract.setSupCode(GongYingNameList.get(0).getFno());
|
|
|
538
|
+ contract.setSupName(GongYingNameList.get(0).getCpny());
|
|
|
539
|
+ contract.setSupBank(GongYingNameList.get(0).getCtBankName());
|
|
|
540
|
+ contract.setSupAcc(GongYingNameList.get(0).getCtBankAcct());
|
|
|
541
|
+ contract.setSupContact(GongYingNameList.get(0).getCtContNm());
|
|
|
542
|
+ contract.setTradeCntry(GongYingNameList.get(0).getCtrylmbAddr());
|
|
|
543
|
+ }
|
|
|
544
|
+
|
|
541
|
545
|
|
|
542
|
546
|
//根据查询到的“币别”信息填入数据
|
|
543
|
|
- contract.setCurcy(curcyList.get(0).getFname());
|
|
544
|
|
- contract.setRate(curcyList.get(0).getRate());
|
|
545
|
|
- contract.setRateUs(curcyList.get(0).getRateUs());
|
|
|
547
|
+ if(curcyList != null && !curcyList.isEmpty()){
|
|
|
548
|
+ contract.setCurcy(curcyList.get(0).getFname());
|
|
|
549
|
+ contract.setRate(curcyList.get(0).getRate());
|
|
|
550
|
+ contract.setRateUs(curcyList.get(0).getRateUs());
|
|
|
551
|
+ }
|
|
|
552
|
+
|
|
546
|
553
|
//根据查询到的“执行人”信息填入数据
|
|
547
|
|
- contract.setContrExecNm(ZhixingUserByList.get(0).getUserCode());
|
|
548
|
|
- contract.setContrExecNm(ZhixingUserByList.get(0).getUserDesc());
|
|
|
554
|
+ if(ZhixingUserByList != null && !ZhixingUserByList.isEmpty()){
|
|
|
555
|
+ contract.setContrExecNm(ZhixingUserByList.get(0).getUserCode());
|
|
|
556
|
+ contract.setContrExecNm(ZhixingUserByList.get(0).getUserDesc());
|
|
|
557
|
+ }
|
|
|
558
|
+
|
|
549
|
559
|
|
|
550
|
560
|
contract.setCreateBy(createuserByList.get(0).getUserCode());
|
|
551
|
561
|
contract.setCreateByName(createuserByList.get(0).getUserDesc());
|
|
|
@@ -563,7 +573,12 @@ public class PurchaseContractServiceImpl implements PurchaseContractService {
|
|
563
|
573
|
contract.setContrEnd(calendar.getTime());
|
|
564
|
574
|
contract.setCurcy(mainItem.getCurcy());
|
|
565
|
575
|
contract.setFundOccupyFlg("否");
|
|
566
|
|
- contract.setEstLoadDt(mainItem.getEstLoadDt());
|
|
|
576
|
+ /*if (mainItem.getEstLoadDt() != null ){
|
|
|
577
|
+ contract.setEstLoadDt(mainItem.getEstLoadDt());
|
|
|
578
|
+ }else {
|
|
|
579
|
+ contract.setEstLoadDt(new Date());
|
|
|
580
|
+ }*/
|
|
|
581
|
+
|
|
567
|
582
|
contract.setContrExecCd(mainItem.getContrExecCd());
|
|
568
|
583
|
contract.setWhetherChartering("否");
|
|
569
|
584
|
|
|
|
@@ -571,13 +586,19 @@ public class PurchaseContractServiceImpl implements PurchaseContractService {
|
|
571
|
586
|
contract.setIfBatch("否");
|
|
572
|
587
|
contract.setIfTransfer("否");
|
|
573
|
588
|
//装港信息写入
|
|
574
|
|
- contract.setLoadPort(lPortList.get(0).getPortName());
|
|
575
|
|
- contract.setLportCtry(lPortList.get(0).getCountryCnNm());
|
|
576
|
|
- contract.setLpno(lPortList.get(0).getFno());
|
|
|
589
|
+ if (lPortList != null && !lPortList.isEmpty() ) {
|
|
|
590
|
+ contract.setLoadPort(lPortList.get(0).getPortName());
|
|
|
591
|
+ contract.setLportCtry(lPortList.get(0).getCountryCnNm());
|
|
|
592
|
+ contract.setLpno(lPortList.get(0).getFno());
|
|
|
593
|
+ }
|
|
|
594
|
+
|
|
577
|
595
|
//目的港写入
|
|
578
|
|
- contract.setDestPort(dPortList.get(0).getPortName());
|
|
579
|
|
- contract.setDPortCtry(dPortList.get(0).getCountryCnNm());
|
|
580
|
|
- contract.setDpno(dPortList.get(0).getFno());
|
|
|
596
|
+ if (dPortList != null && !dPortList.isEmpty() ) {
|
|
|
597
|
+ contract.setDestPort(dPortList.get(0).getPortName());
|
|
|
598
|
+ contract.setDPortCtry(dPortList.get(0).getCountryCnNm());
|
|
|
599
|
+ contract.setDpno(dPortList.get(0).getFno());
|
|
|
600
|
+ }
|
|
|
601
|
+
|
|
581
|
602
|
|
|
582
|
603
|
contract.setIfPayMultiple("否");
|
|
583
|
604
|
contract.setTransMode(mainItem.getTranWay());
|
|
|
@@ -600,9 +621,12 @@ public class PurchaseContractServiceImpl implements PurchaseContractService {
|
|
600
|
621
|
List<CustCtrl> itemnoList = custCtrlMapper.selectByItemno(dtlDto.getItemno(), mainItem.getBizProductType());
|
|
601
|
622
|
PCcontractDtl dtl = new PCcontractDtl();
|
|
602
|
623
|
dtl.setPono(mainItem.getPono());
|
|
603
|
|
- dtl.setItemno(itemnoList.get(0).getItemno());
|
|
604
|
|
- dtl.setSdesc(itemnoList.get(0).getSdesc());
|
|
605
|
|
- dtl.setBrand(itemnoList.get(0).getBrand());
|
|
|
624
|
+ if (itemnoList != null && !itemnoList.isEmpty()){
|
|
|
625
|
+ dtl.setItemno(itemnoList.get(0).getItemno());
|
|
|
626
|
+ dtl.setSdesc(itemnoList.get(0).getSdesc());
|
|
|
627
|
+ dtl.setBrand(itemnoList.get(0).getBrand());
|
|
|
628
|
+ }
|
|
|
629
|
+
|
|
606
|
630
|
dtl.setFtype3(dtlDto.getSpec());
|
|
607
|
631
|
dtl.setUt(dtlDto.getUt());
|
|
608
|
632
|
dtl.setQty(dtlDto.getQty());
|
|
|
@@ -725,6 +749,8 @@ public class PurchaseContractServiceImpl implements PurchaseContractService {
|
|
725
|
749
|
List<PCcontractRCenterDtl> pCcontractRCenterDtls) {
|
|
726
|
750
|
try {
|
|
727
|
751
|
for (int i = 0; i < purchaseContracts.size(); i++) {
|
|
|
752
|
+
|
|
|
753
|
+
|
|
728
|
754
|
PurchaseContract mainContract = purchaseContracts.get(i);
|
|
729
|
755
|
|
|
730
|
756
|
// 保存主表
|