11816 1 dzień temu
rodzic
commit
0a9f88b853

+ 56
- 56
src/main/java/com/example/backend/pAndSExe/util/PsExeExcelUtil.java Wyświetl plik

218
         List<String> errorLogList = new ArrayList<>();
218
         List<String> errorLogList = new ArrayList<>();
219
 
219
 
220
         // 1. 校验采购合同号
220
         // 1. 校验采购合同号
221
-        if (dto.getPfno() == null || dto.getPfno().trim().isEmpty()) {
221
+        if (dto.getPfno() == null || dto.getPfno().isEmpty()) {
222
             errorLogList.add("采购合同号为空");
222
             errorLogList.add("采购合同号为空");
223
         } else {
223
         } else {
224
             String pfno = dto.getPfno().trim();
224
             String pfno = dto.getPfno().trim();
245
         }else errorLogList.add("商品信息为空");
245
         }else errorLogList.add("商品信息为空");
246
 
246
 
247
         // 2. 校验其他字段
247
         // 2. 校验其他字段
248
-        if (dto.getStockname() == null || dto.getStockname().trim().isEmpty()) {
248
+        if (dto.getStockname() == null || dto.getStockname().isEmpty()) {
249
             errorLogList.add("仓库名称为空");
249
             errorLogList.add("仓库名称为空");
250
         }else {
250
         }else {
251
             String s = trimField(dto.getStockname());
251
             String s = trimField(dto.getStockname());
265
             }
265
             }
266
         }
266
         }
267
 
267
 
268
-        if (dto.getCreateBy() == null || dto.getCreateBy().trim().isEmpty()) {
268
+        if (dto.getCreateBy() == null || dto.getCreateBy().isEmpty()) {
269
             errorLogList.add("制单人为空");
269
             errorLogList.add("制单人为空");
270
         }
270
         }
271
-        if (dto.getUt() == null || dto.getUt().trim().isEmpty()) {
271
+        if (dto.getUt() == null || dto.getUt().isEmpty()) {
272
             errorLogList.add("单位为空");
272
             errorLogList.add("单位为空");
273
         }
273
         }
274
 
274
 
276
             errorLogList.add("单位不在下拉框中");
276
             errorLogList.add("单位不在下拉框中");
277
         }
277
         }
278
         String bizProductType=infExe1Mapper.selectBizProductTypeByPfno(dto.getPfno());
278
         String bizProductType=infExe1Mapper.selectBizProductTypeByPfno(dto.getPfno());
279
-        if (bizProductType == null || bizProductType.trim().isEmpty()) {
279
+        if (bizProductType == null || bizProductType.isEmpty()) {
280
             errorLogList.add("合同业务产品类型为空");
280
             errorLogList.add("合同业务产品类型为空");
281
         }else if (bizProductType.equals("钢产品")){
281
         }else if (bizProductType.equals("钢产品")){
282
-            if (dto.getFtype3() == null || dto.getFtype3().trim().isEmpty()) {
282
+            if (dto.getFtype3() == null || dto.getFtype3().isEmpty()) {
283
                 errorLogList.add("钢产品规格为空");
283
                 errorLogList.add("钢产品规格为空");
284
             }
284
             }
285
-            if (dto.getFtype4() == null || dto.getFtype4().trim().isEmpty()) {
285
+            if (dto.getFtype4() == null || dto.getFtype4().isEmpty()) {
286
                 errorLogList.add("钢产品计重方式为空");
286
                 errorLogList.add("钢产品计重方式为空");
287
             }else if (!Shujvzidian.jizhongfangshi.contains(dto.getFtype4().trim())){
287
             }else if (!Shujvzidian.jizhongfangshi.contains(dto.getFtype4().trim())){
288
                 errorLogList.add("钢产品计重方式不在下拉框中");
288
                 errorLogList.add("钢产品计重方式不在下拉框中");
289
             }
289
             }
290
-            /*if (dto.getSMRNo()==null || dto.getSMRNo().trim().isEmpty()) {
290
+            /*if (dto.getSMRNo()==null || dto.getSMRNo().isEmpty()) {
291
                 errorLogList.add("钢产品钢厂资源号为空");
291
                 errorLogList.add("钢产品钢厂资源号为空");
292
             }*/
292
             }*/
293
         }else if(bizProductType.equals("铁矿石")){
293
         }else if(bizProductType.equals("铁矿石")){
414
         List<String> errorLogList = new ArrayList<>();
414
         List<String> errorLogList = new ArrayList<>();
415
 
415
 
416
         // 1. 校验销售合同号(替换原采购合同号校验)
416
         // 1. 校验销售合同号(替换原采购合同号校验)
417
-        if (dto.getSfno() == null || dto.getSfno().trim().isEmpty()) {
417
+        if (dto.getSfno() == null || dto.getSfno().isEmpty()) {
418
             errorLogList.add("销售合同号为空");
418
             errorLogList.add("销售合同号为空");
419
         } else {
419
         } else {
420
             String sfno = dto.getSfno().trim();
420
             String sfno = dto.getSfno().trim();
441
         }else errorLogList.add("商品信息为空");
441
         }else errorLogList.add("商品信息为空");
442
 
442
 
443
         // 2. 其他基础字段非空校验(与InfExe1一致)
443
         // 2. 其他基础字段非空校验(与InfExe1一致)
444
-        if (dto.getStockname() == null || dto.getStockname().trim().isEmpty()) {
444
+        if (dto.getStockname() == null || dto.getStockname().isEmpty()) {
445
             errorLogList.add("仓库名称为空");
445
             errorLogList.add("仓库名称为空");
446
         }
446
         }
447
         else {
447
         else {
461
                 }*/
461
                 }*/
462
             }
462
             }
463
         }
463
         }
464
-        if (dto.getUt() == null || dto.getUt().trim().isEmpty()) {
464
+        if (dto.getUt() == null || dto.getUt().isEmpty()) {
465
             errorLogList.add("单位为空");
465
             errorLogList.add("单位为空");
466
         }
466
         }
467
         else if (!Shujvzidian.danwei.contains(dto.getUt().trim())){
467
         else if (!Shujvzidian.danwei.contains(dto.getUt().trim())){
468
             errorLogList.add("单位不在下拉框中");
468
             errorLogList.add("单位不在下拉框中");
469
         }
469
         }
470
-        if (dto.getCreateBy() == null || dto.getCreateBy().trim().isEmpty()) {
470
+        if (dto.getCreateBy() == null || dto.getCreateBy().isEmpty()) {
471
             errorLogList.add("制单人为空");
471
             errorLogList.add("制单人为空");
472
         }
472
         }
473
         String bizProductType=infExe1Mapper.selectBizProductTypeBySfno(dto.getSfno());
473
         String bizProductType=infExe1Mapper.selectBizProductTypeBySfno(dto.getSfno());
474
-        if (bizProductType == null || bizProductType.trim().isEmpty()) {
474
+        if (bizProductType == null || bizProductType.isEmpty()) {
475
             errorLogList.add("合同业务产品类型为空");
475
             errorLogList.add("合同业务产品类型为空");
476
         }else if (bizProductType.equals("钢产品")){
476
         }else if (bizProductType.equals("钢产品")){
477
-            if (dto.getFtype3() == null || dto.getFtype3().trim().isEmpty()) {
477
+            if (dto.getFtype3() == null || dto.getFtype3().isEmpty()) {
478
                 errorLogList.add("钢产品规格为空");
478
                 errorLogList.add("钢产品规格为空");
479
             }
479
             }
480
-            if (dto.getFtype4() == null || dto.getFtype4().trim().isEmpty()) {
480
+            if (dto.getFtype4() == null || dto.getFtype4().isEmpty()) {
481
                 errorLogList.add("钢产品计重方式为空");
481
                 errorLogList.add("钢产品计重方式为空");
482
             }else if (!Shujvzidian.jizhongfangshi.contains(dto.getFtype4().trim())){
482
             }else if (!Shujvzidian.jizhongfangshi.contains(dto.getFtype4().trim())){
483
                 errorLogList.add("钢产品计重方式不在下拉框中");
483
                 errorLogList.add("钢产品计重方式不在下拉框中");
484
             }
484
             }
485
-            /*if (dto.getSMRNo()==null || dto.getSMRNo().trim().isEmpty()) {
485
+            /*if (dto.getSMRNo()==null || dto.getSMRNo().isEmpty()) {
486
                 errorLogList.add("钢产品钢厂资源号为空");
486
                 errorLogList.add("钢产品钢厂资源号为空");
487
             }*/
487
             }*/
488
         }else if(bizProductType.equals("铁矿石")){
488
         }else if(bizProductType.equals("铁矿石")){
610
 
610
 
611
         // 2. 逐字段非空校验(仿照Sheet1的校验逻辑)
611
         // 2. 逐字段非空校验(仿照Sheet1的校验逻辑)
612
         // 采购合同号:非空 + 合同存在校验
612
         // 采购合同号:非空 + 合同存在校验
613
-        if (dto.getPfno() == null || dto.getPfno().trim().isEmpty()) {
613
+        if (dto.getPfno() == null || dto.getPfno().isEmpty()) {
614
             errorLogList.add("采购合同号为空");
614
             errorLogList.add("采购合同号为空");
615
         } else {
615
         } else {
616
             String pfno = dto.getPfno().trim();
616
             String pfno = dto.getPfno().trim();
622
         }
622
         }
623
 
623
 
624
         // 收款/受益人信息:非空校验
624
         // 收款/受益人信息:非空校验
625
-        if (dto.getCombinedPaymentInfo() == null || dto.getCombinedPaymentInfo().trim().isEmpty()) {
625
+        if (dto.getCombinedPaymentInfo() == null || dto.getCombinedPaymentInfo().isEmpty()) {
626
             errorLogList.add("收款/受益人名称+银行名称+银行账号为空");
626
             errorLogList.add("收款/受益人名称+银行名称+银行账号为空");
627
         }else {
627
         }else {
628
             String[] strings = splitCombinedField(dto.getCombinedPaymentInfo());
628
             String[] strings = splitCombinedField(dto.getCombinedPaymentInfo());
643
 
643
 
644
 
644
 
645
         // 付款类型:非空校验
645
         // 付款类型:非空校验
646
-        if (dto.getPayType() == null || dto.getPayType().trim().isEmpty()) {
646
+        if (dto.getPayType() == null || dto.getPayType().isEmpty()) {
647
             errorLogList.add("付款类型为空");
647
             errorLogList.add("付款类型为空");
648
         }else if (!Shujvzidian.fukuanleixing.contains(dto.getPayType().trim())){
648
         }else if (!Shujvzidian.fukuanleixing.contains(dto.getPayType().trim())){
649
             errorLogList.add("付款类型不在下拉框中");
649
             errorLogList.add("付款类型不在下拉框中");
650
         }
650
         }
651
 
651
 
652
         // 付款方式:非空校验
652
         // 付款方式:非空校验
653
-        if (dto.getPayment() == null || dto.getPayment().trim().isEmpty()) {
653
+        if (dto.getPayment() == null || dto.getPayment().isEmpty()) {
654
             errorLogList.add("付款方式为空");
654
             errorLogList.add("付款方式为空");
655
         }else if (!Shujvzidian.fukuanfangshi.contains(dto.getPayment().trim())){
655
         }else if (!Shujvzidian.fukuanfangshi.contains(dto.getPayment().trim())){
656
             errorLogList.add("付款方式不在下拉框中");
656
             errorLogList.add("付款方式不在下拉框中");
662
         }
662
         }
663
 
663
 
664
         // 币别:非空校验
664
         // 币别:非空校验
665
-        if (dto.getCurcy() == null || dto.getCurcy().trim().isEmpty()) {
665
+        if (dto.getCurcy() == null || dto.getCurcy().isEmpty()) {
666
             errorLogList.add("币别为空");
666
             errorLogList.add("币别为空");
667
         }else if (!Shujvzidian.bibie.contains(dto.getCurcy().trim())){
667
         }else if (!Shujvzidian.bibie.contains(dto.getCurcy().trim())){
668
             errorLogList.add("币别不在下拉框中");
668
             errorLogList.add("币别不在下拉框中");
669
         }
669
         }
670
-        if (dto.getCreateBy() == null || dto.getCreateBy().trim().isEmpty()) {
670
+        if (dto.getCreateBy() == null || dto.getCreateBy().isEmpty()) {
671
             errorLogList.add("制单人为空");
671
             errorLogList.add("制单人为空");
672
         }
672
         }
673
 
673
 
725
 
725
 
726
         // 2. 逐字段非空+业务规则校验(核心:仿照Exe3的校验逻辑,适配Exe4字段)
726
         // 2. 逐字段非空+业务规则校验(核心:仿照Exe3的校验逻辑,适配Exe4字段)
727
         // 付款类型:非空校验
727
         // 付款类型:非空校验
728
-        if (dto.getPayType() == null || dto.getPayType().trim().isEmpty()) {
728
+        if (dto.getPayType() == null || dto.getPayType().isEmpty()) {
729
             errorLogList.add("付款类型为空");
729
             errorLogList.add("付款类型为空");
730
         }
730
         }
731
 
731
 
732
         // 业务类别:非空校验
732
         // 业务类别:非空校验
733
-        if (dto.getExpNode() == null || dto.getExpNode().trim().isEmpty()) {
733
+        if (dto.getExpNode() == null || dto.getExpNode().isEmpty()) {
734
             errorLogList.add("业务类别为空");
734
             errorLogList.add("业务类别为空");
735
         }else if (!Shujvzidian.yewuleibie.contains(dto.getExpNode().trim())) {
735
         }else if (!Shujvzidian.yewuleibie.contains(dto.getExpNode().trim())) {
736
             errorLogList.add("业务类别不在下拉框中");
736
             errorLogList.add("业务类别不在下拉框中");
760
         }
760
         }
761
 
761
 
762
         // 收款人组合信息:非空校验(Exe3的combinedPaymentInfo逻辑复用)
762
         // 收款人组合信息:非空校验(Exe3的combinedPaymentInfo逻辑复用)
763
-        if (dto.getCombinedSuppInfo() == null || dto.getCombinedSuppInfo().trim().isEmpty()) {
763
+        if (dto.getCombinedSuppInfo() == null || dto.getCombinedSuppInfo().isEmpty()) {
764
             errorLogList.add("收款人名称+收款人银行+银行账号为空");
764
             errorLogList.add("收款人名称+收款人银行+银行账号为空");
765
         }
765
         }
766
         else {
766
         else {
781
         }
781
         }
782
 
782
 
783
         // 付款方式:非空校验(和Exe3一致)
783
         // 付款方式:非空校验(和Exe3一致)
784
-        if (dto.getPayment() == null || dto.getPayment().trim().isEmpty()) {
784
+        if (dto.getPayment() == null || dto.getPayment().isEmpty()) {
785
             errorLogList.add("付款方式为空");
785
             errorLogList.add("付款方式为空");
786
         }else if (!Shujvzidian.fukuanfangshi.contains(dto.getPayment().trim())) {
786
         }else if (!Shujvzidian.fukuanfangshi.contains(dto.getPayment().trim())) {
787
             errorLogList.add("付款方式不在下拉框中");
787
             errorLogList.add("付款方式不在下拉框中");
788
         }
788
         }
789
-        if (dto.getCreateBy() == null || dto.getCreateBy().trim().isEmpty()) {
789
+        if (dto.getCreateBy() == null || dto.getCreateBy().isEmpty()) {
790
             errorLogList.add("制单人为空");
790
             errorLogList.add("制单人为空");
791
         }
791
         }
792
 
792
 
793
         // 费用名称:非空校验(Exe4特有字段)
793
         // 费用名称:非空校验(Exe4特有字段)
794
-        if (dto.getFeeNm() == null || dto.getFeeNm().trim().isEmpty()) {
794
+        if (dto.getFeeNm() == null || dto.getFeeNm().isEmpty()) {
795
             errorLogList.add("费用名称为空");
795
             errorLogList.add("费用名称为空");
796
         }else if (!Shujvzidian.feiyongmingcheng.contains(dto.getFeeNm().trim())) {
796
         }else if (!Shujvzidian.feiyongmingcheng.contains(dto.getFeeNm().trim())) {
797
             errorLogList.add("费用名称不在下拉框中");
797
             errorLogList.add("费用名称不在下拉框中");
803
         }
803
         }
804
 
804
 
805
         // 币别:非空校验(和Exe3一致)
805
         // 币别:非空校验(和Exe3一致)
806
-        if (dto.getCurcy() == null || dto.getCurcy().trim().isEmpty()) {
806
+        if (dto.getCurcy() == null || dto.getCurcy().isEmpty()) {
807
             errorLogList.add("币别为空");
807
             errorLogList.add("币别为空");
808
         }else if (!Shujvzidian.bibie.contains(dto.getCurcy().trim())) {
808
         }else if (!Shujvzidian.bibie.contains(dto.getCurcy().trim())) {
809
             errorLogList.add("币别不在下拉框中");
809
             errorLogList.add("币别不在下拉框中");
891
         }
891
         }
892
 
892
 
893
         // 基础字段非空校验
893
         // 基础字段非空校验
894
-        if (dto.getTaxInvType() == null || dto.getTaxInvType().trim().isEmpty()) {
894
+        if (dto.getTaxInvType() == null || dto.getTaxInvType().isEmpty()) {
895
             errorLogList.add("发票类型为空");
895
             errorLogList.add("发票类型为空");
896
         }else if(!Shujvzidian.fapiaozhonglei.contains(dto.getTaxInvType().trim())){
896
         }else if(!Shujvzidian.fapiaozhonglei.contains(dto.getTaxInvType().trim())){
897
             errorLogList.add("发票种类不在选项中");
897
             errorLogList.add("发票种类不在选项中");
898
         }else if(dto.getTaxInvType().trim().contains("海关")){
898
         }else if(dto.getTaxInvType().trim().contains("海关")){
899
             errorLogList.add("海关发票需要联系管理员");
899
             errorLogList.add("海关发票需要联系管理员");
900
         }
900
         }
901
-        if (dto.getTaxInvNo() == null || dto.getTaxInvNo().trim().isEmpty()) {
901
+        if (dto.getTaxInvNo() == null || dto.getTaxInvNo().isEmpty()) {
902
             errorLogList.add("发票号码为空");
902
             errorLogList.add("发票号码为空");
903
         }
903
         }
904
-        if (dto.getExpNode() == null || dto.getExpNode().trim().isEmpty()) {
904
+        if (dto.getExpNode() == null || dto.getExpNode().isEmpty()) {
905
             errorLogList.add("业务类别为空");
905
             errorLogList.add("业务类别为空");
906
         }else if (!Shujvzidian.yewuleibie.contains(dto.getExpNode().trim())) {
906
         }else if (!Shujvzidian.yewuleibie.contains(dto.getExpNode().trim())) {
907
             errorLogList.add("业务类别不在下拉框中");
907
             errorLogList.add("业务类别不在下拉框中");
908
         }
908
         }
909
-        if (dto.getCateName() == null || dto.getCateName().trim().isEmpty()) {
909
+        if (dto.getCateName() == null || dto.getCateName().isEmpty()) {
910
             errorLogList.add("类别名称为空");
910
             errorLogList.add("类别名称为空");
911
         }
911
         }
912
-        if (dto.getUt() == null || dto.getUt().trim().isEmpty()) {
912
+        if (dto.getUt() == null || dto.getUt().isEmpty()) {
913
             errorLogList.add("单位为空");
913
             errorLogList.add("单位为空");
914
         }
914
         }
915
         else if (!Shujvzidian.danwei.contains(dto.getUt().trim())){
915
         else if (!Shujvzidian.danwei.contains(dto.getUt().trim())){
916
             errorLogList.add("单位不在下拉框中");
916
             errorLogList.add("单位不在下拉框中");
917
         }
917
         }
918
-        if (dto.getFeeNm() == null || dto.getFeeNm().trim().isEmpty()) {
918
+        if (dto.getFeeNm() == null || dto.getFeeNm().isEmpty()) {
919
             errorLogList.add("费用名称为空");
919
             errorLogList.add("费用名称为空");
920
         }
920
         }
921
-        if (dto.getCurcypo() == null || dto.getCurcypo().trim().isEmpty()) {
921
+        if (dto.getCurcypo() == null || dto.getCurcypo().isEmpty()) {
922
             errorLogList.add("币别为空");
922
             errorLogList.add("币别为空");
923
         }
923
         }
924
 
924
 
1018
             }
1018
             }
1019
         }
1019
         }
1020
 
1020
 
1021
-        if (dto.getTaxInvNo()==null || dto.getTaxInvNo().trim().isEmpty()) {
1021
+        if (dto.getTaxInvNo()==null || dto.getTaxInvNo().isEmpty()) {
1022
             errorLogList.add("税票号码为空");
1022
             errorLogList.add("税票号码为空");
1023
         }
1023
         }
1024
 
1024
 
1025
         // 基础字段非空校验
1025
         // 基础字段非空校验
1026
-        if (dto.getTaxInvType() == null || dto.getTaxInvType().trim().isEmpty()) {
1026
+        if (dto.getTaxInvType() == null || dto.getTaxInvType().isEmpty()) {
1027
             errorLogList.add("发票类型为空");
1027
             errorLogList.add("发票类型为空");
1028
         }
1028
         }
1029
         else if(!Shujvzidian.fapiaozhonglei.contains(dto.getTaxInvType().trim())){
1029
         else if(!Shujvzidian.fapiaozhonglei.contains(dto.getTaxInvType().trim())){
1038
         if (dto.getPoamt() == null) {
1038
         if (dto.getPoamt() == null) {
1039
             errorLogList.add("含税金额为空");
1039
             errorLogList.add("含税金额为空");
1040
         }
1040
         }
1041
-        if (dto.getTaxInvNo() == null || dto.getTaxInvNo().trim().isEmpty()) {
1041
+        if (dto.getTaxInvNo() == null || dto.getTaxInvNo().isEmpty()) {
1042
             errorLogList.add("发票号码为空");
1042
             errorLogList.add("发票号码为空");
1043
         }
1043
         }
1044
 
1044
 
1057
                 }
1057
                 }
1058
             }
1058
             }
1059
         }else errorLogList.add("商品编码+中文品名+牌号为空");
1059
         }else errorLogList.add("商品编码+中文品名+牌号为空");
1060
-        if (dto.getUt() == null || dto.getUt().trim().isEmpty()) {
1060
+        if (dto.getUt() == null || dto.getUt().isEmpty()) {
1061
             errorLogList.add("单位为空");
1061
             errorLogList.add("单位为空");
1062
         }
1062
         }
1063
         else if (!Shujvzidian.danwei.contains(dto.getUt().trim())){
1063
         else if (!Shujvzidian.danwei.contains(dto.getUt().trim())){
1064
             errorLogList.add("单位不在下拉框中");
1064
             errorLogList.add("单位不在下拉框中");
1065
         }
1065
         }
1066
-        if (dto.getCurcypo() == null || dto.getCurcypo().trim().isEmpty()) {
1066
+        if (dto.getCurcypo() == null || dto.getCurcypo().isEmpty()) {
1067
             errorLogList.add("币别为空");
1067
             errorLogList.add("币别为空");
1068
         }
1068
         }
1069
 
1069
 
1171
         }
1171
         }
1172
 
1172
 
1173
         // 信用证号:非空校验
1173
         // 信用证号:非空校验
1174
-        if (dto.getLcno() == null || dto.getLcno().trim().isEmpty()) {
1174
+        if (dto.getLcno() == null || dto.getLcno().isEmpty()) {
1175
             errorLogList.add("信用证号为空");
1175
             errorLogList.add("信用证号为空");
1176
         }
1176
         }
1177
 
1177
 
1178
         // 币别:非空校验
1178
         // 币别:非空校验
1179
-        if (dto.getCurcy() == null || dto.getCurcy().trim().isEmpty()) {
1179
+        if (dto.getCurcy() == null || dto.getCurcy().isEmpty()) {
1180
             errorLogList.add("币别为空");
1180
             errorLogList.add("币别为空");
1181
         }
1181
         }
1182
 
1182
 
1183
         //
1183
         //
1184
-        if (dto.getFdate() == null || dto.getCurcy().trim().isEmpty()) {
1184
+        if (dto.getFdate() == null || dto.getCurcy().isEmpty()) {
1185
             errorLogList.add("到单日期为空");
1185
             errorLogList.add("到单日期为空");
1186
         }
1186
         }
1187
         //
1187
         //
1188
-        if (dto.getFkdate() == null || dto.getCurcy().trim().isEmpty()) {
1188
+        if (dto.getFkdate() == null || dto.getCurcy().isEmpty()) {
1189
             errorLogList.add("承兑日期为空");
1189
             errorLogList.add("承兑日期为空");
1190
         }
1190
         }
1191
         //
1191
         //
1192
-        if (dto.getYjfkdate() == null || dto.getCurcy().trim().isEmpty()) {
1192
+        if (dto.getYjfkdate() == null || dto.getCurcy().isEmpty()) {
1193
             errorLogList.add("付款日期为空");
1193
             errorLogList.add("付款日期为空");
1194
         }
1194
         }
1195
-        if (dto.getIssuingBankName() == null || dto.getCurcy().trim().isEmpty()) {
1195
+        if (dto.getIssuingBankName() == null || dto.getCurcy().isEmpty()) {
1196
             errorLogList.add("开证银行名称为空");
1196
             errorLogList.add("开证银行名称为空");
1197
         }
1197
         }
1198
 
1198
 
1712
             errorLogList.add("客户信息(名称+银行+账号+合同名)为空");
1712
             errorLogList.add("客户信息(名称+银行+账号+合同名)为空");
1713
         } else {
1713
         } else {
1714
             // 拆分规则:按【|】分隔(优先),无则按【;】,最后按【,】/空格,最多拆4段
1714
             // 拆分规则:按【|】分隔(优先),无则按【;】,最后按【,】/空格,最多拆4段
1715
-            String[] ctArr = ctInfo.split("[|;,\\s]+", 4);
1715
+            String[] ctArr = ctInfo.split("[|;,\\s,]+", 4);
1716
             if (ctArr.length >= 1) ctName = ctArr[0];
1716
             if (ctArr.length >= 1) ctName = ctArr[0];
1717
             if (ctArr.length >= 2) ctInvoiceBankName = ctArr[1];
1717
             if (ctArr.length >= 2) ctInvoiceBankName = ctArr[1];
1718
             if (ctArr.length >= 3) ctInvoiceBankAcct = ctArr[2];
1718
             if (ctArr.length >= 3) ctInvoiceBankAcct = ctArr[2];
1761
             errorLogList.add("物料信息(编码+描述+品牌)为空");
1761
             errorLogList.add("物料信息(编码+描述+品牌)为空");
1762
         } else {
1762
         } else {
1763
             // 拆分规则:按【|】分隔(优先),无则按【-】,最后按空格/逗号,最多拆3段
1763
             // 拆分规则:按【|】分隔(优先),无则按【-】,最后按空格/逗号,最多拆3段
1764
-            String[] itemArr = itemInfo.split("[|\\-,\\s]+", 3);
1764
+            String[] itemArr = itemInfo.split("[|\\-,,\\s]+", 3);
1765
             if (itemArr.length >= 1) itemno = itemArr[0];
1765
             if (itemArr.length >= 1) itemno = itemArr[0];
1766
             if (itemArr.length >= 2) sdesc = itemArr[1];
1766
             if (itemArr.length >= 2) sdesc = itemArr[1];
1767
             if (itemArr.length >= 3) brand = itemArr[2];
1767
             if (itemArr.length >= 3) brand = itemArr[2];
1871
         return entity;
1871
         return entity;
1872
     }
1872
     }
1873
     /*private   InfExe3 convertToInfExe4(InfExe3ExcelDTO dto) {
1873
     /*private   InfExe3 convertToInfExe4(InfExe3ExcelDTO dto) {
1874
-        if (dto.getPfno() == null || dto.getPfno().trim().isEmpty()) {
1874
+        if (dto.getPfno() == null || dto.getPfno().isEmpty()) {
1875
             System.err.println("InfExe3:采购合同号为空,过滤该条数据:" + dto);
1875
             System.err.println("InfExe3:采购合同号为空,过滤该条数据:" + dto);
1876
             return null;
1876
             return null;
1877
         }
1877
         }
1901
     }
1901
     }
1902
 
1902
 
1903
     private   InfExe5 convertToInfExe5(InfExe5ExcelDTO dto) {
1903
     private   InfExe5 convertToInfExe5(InfExe5ExcelDTO dto) {
1904
-        if ((dto.getPayType() == null || dto.getPayType().trim().isEmpty())
1905
-                && (dto.getYewuleibie() == null || dto.getYewuleibie().trim().isEmpty())) {
1904
+        if ((dto.getPayType() == null || dto.getPayType().isEmpty())
1905
+                && (dto.getYewuleibie() == null || dto.getYewuleibie().isEmpty())) {
1906
             System.err.println("InfExe5:付款类型和业务类别均为空,过滤该条数据:" + dto);
1906
             System.err.println("InfExe5:付款类型和业务类别均为空,过滤该条数据:" + dto);
1907
             return null;
1907
             return null;
1908
         }
1908
         }
1942
      * 【修正3】删除ctNo字段赋值(DTO中无该字段)
1942
      * 【修正3】删除ctNo字段赋值(DTO中无该字段)
1943
      *//*
1943
      *//*
1944
     private   InfExe6 convertToInfExe6(InfExe6ExcelDTO dto) {
1944
     private   InfExe6 convertToInfExe6(InfExe6ExcelDTO dto) {
1945
-        if (dto.getSfno() == null || dto.getSfno().trim().isEmpty()) {
1945
+        if (dto.getSfno() == null || dto.getSfno().isEmpty()) {
1946
             System.err.println("InfExe6:销售合同号为空,过滤该条数据:" + dto);
1946
             System.err.println("InfExe6:销售合同号为空,过滤该条数据:" + dto);
1947
             return null;
1947
             return null;
1948
         }
1948
         }
1974
     }
1974
     }
1975
 
1975
 
1976
     private   InfExe7 convertToInfExe7(InfExe7ExcelDTO dto) {
1976
     private   InfExe7 convertToInfExe7(InfExe7ExcelDTO dto) {
1977
-        if (dto.getSfno() == null || dto.getSfno().trim().isEmpty()) {
1977
+        if (dto.getSfno() == null || dto.getSfno().isEmpty()) {
1978
             System.err.println("InfExe7:销售合同号为空,过滤该条数据:" + dto);
1978
             System.err.println("InfExe7:销售合同号为空,过滤该条数据:" + dto);
1979
             return null;
1979
             return null;
1980
         }
1980
         }
2012
      * 多值列拆分(支持多种分隔符)
2012
      * 多值列拆分(支持多种分隔符)
2013
      */
2013
      */
2014
     private   String[] splitCombinedField(String combinedField) {
2014
     private   String[] splitCombinedField(String combinedField) {
2015
-        if (combinedField == null || combinedField.trim().isEmpty()) {
2015
+        if (combinedField == null || combinedField.isEmpty()) {
2016
             return new String[0];
2016
             return new String[0];
2017
         }
2017
         }
2018
         return combinedField.trim().split("[,,、;;]");
2018
         return combinedField.trim().split("[,,、;;]");
2044
      * 字符串转Date(支持多格式,适配JDK8)
2044
      * 字符串转Date(支持多格式,适配JDK8)
2045
      */
2045
      */
2046
     private   Date parseDate(String dateStr) {
2046
     private   Date parseDate(String dateStr) {
2047
-        if (dateStr == null || dateStr.trim().isEmpty()) {
2047
+        if (dateStr == null || dateStr.isEmpty()) {
2048
             return null;
2048
             return null;
2049
         }
2049
         }
2050
         String trimDate = dateStr.trim();
2050
         String trimDate = dateStr.trim();

Ładowanie…
Anuluj
Zapisz