Преглед изворни кода

台账用户名称多个拆分

wangxx пре 1 дан
родитељ
комит
61aa5d12a2

+ 125 - 1
airport-admin/src/main/java/com/sundot/airport/web/controller/ledger/LedgerImportController.java

@@ -83,7 +83,12 @@ public class LedgerImportController extends BaseController {
83 83
         if (list == null || list.isEmpty()) {
84 84
             return AjaxResult.error("导入数据为空或解析失败,请检查Excel表头是否与模板一致");
85 85
         }
86
-        // 批量预加载组织信息
86
+        
87
+        // 如果责任人字段包含多个名称,拆分成多条记录
88
+        list = splitRowsByMultiName(list, LedgerSupervisionProblem::getInspectedName,
89
+                LedgerSupervisionProblem::setInspectedName);
90
+        
91
+        // 批量预加载组织信息(性能优化)
87 92
         orgInfoHelper.batchFillOrgAndLocationInfo(list,
88 93
                 LedgerSupervisionProblem::getInspectedName,
89 94
                 LedgerSupervisionProblem::getPosition,
@@ -162,6 +167,11 @@ public class LedgerImportController extends BaseController {
162 167
         if (list == null || list.isEmpty()) {
163 168
             return AjaxResult.error("导入数据为空或解析失败,请检查Excel表头是否与模板一致");
164 169
         }
170
+        
171
+        // 如果责任人字段包含多个名称,拆分成多条记录
172
+        list = splitRowsByMultiName(list, LedgerRealtimeInterception::getInspectorName,
173
+                LedgerRealtimeInterception::setInspectorName);
174
+        
165 175
         // 批量预加载组织信息和岗位/区域/通道
166 176
         orgInfoHelper.batchFillOrgAndLocationInfo(
167 177
                 list,
@@ -217,6 +227,11 @@ public class LedgerImportController extends BaseController {
217 227
         if (list == null || list.isEmpty()) {
218 228
             return AjaxResult.error("导入数据为空或解析失败,请检查Excel表头是否与模板一致");
219 229
         }
230
+        
231
+        // 如果被检查人字段包含多个名称,拆分成多条记录
232
+        list = splitRowsByMultiName(list, LedgerServicePatrol::getInspectedName,
233
+                LedgerServicePatrol::setInspectedName);
234
+        
220 235
         // 批量预加载组织信息和岗位/区域/通道
221 236
         orgInfoHelper.batchFillOrgAndLocationInfo(
222 237
                 list,
@@ -272,6 +287,11 @@ public class LedgerImportController extends BaseController {
272 287
         if (list == null || list.isEmpty()) {
273 288
             return AjaxResult.error("导入数据为空或解析失败,请检查Excel表头是否与模板一致");
274 289
         }
290
+        
291
+        // 如果责任人字段包含多个名称,拆分成多条记录
292
+        list = splitRowsByMultiName(list, LedgerComplaint::getResponsibleName,
293
+                LedgerComplaint::setResponsibleName);
294
+        
275 295
         // 批量预加载组织信息(性能优化)
276 296
         orgInfoHelper.batchFillOrgInfo(list, LedgerComplaint::getResponsibleName);
277 297
 
@@ -297,6 +317,11 @@ public class LedgerImportController extends BaseController {
297 317
         if (list == null || list.isEmpty()) {
298 318
             return AjaxResult.error("导入数据为空或解析失败,请检查Excel表头是否与模板一致");
299 319
         }
320
+        
321
+        // 如果被测试人员字段包含多个名称,拆分成多条记录
322
+        list = splitRowsByMultiName(list, LedgerSecurityTest::getTestedName,
323
+                LedgerSecurityTest::setTestedName);
324
+        
300 325
         // 批量预加载组织信息和岗位/区域/通道
301 326
         orgInfoHelper.batchFillOrgAndLocationInfo(
302 327
                 list,
@@ -383,6 +408,11 @@ public class LedgerImportController extends BaseController {
383 408
         if (list == null || list.isEmpty()) {
384 409
             return AjaxResult.error("导入数据为空或解析失败,请检查Excel表头是否与模板一致");
385 410
         }
411
+        
412
+        // 如果责任人字段包含多个名称,拆分成多条记录
413
+        list = splitRowsByMultiName(list, LedgerUnsafeEvent::getResponsibleName,
414
+                LedgerUnsafeEvent::setResponsibleName);
415
+        
386 416
         // 批量预加载组织信息和岗位/区域/通道
387 417
         orgInfoHelper.batchFillOrgAndLocationInfo(
388 418
                 list,
@@ -437,6 +467,11 @@ public class LedgerImportController extends BaseController {
437 467
         if (list == null || list.isEmpty()) {
438 468
             return AjaxResult.error("导入数据为空或解析失败,请检查Excel表头是否与模板一致");
439 469
         }
470
+        
471
+        // 如果检查人字段包含多个名称,拆分成多条记录
472
+        list = splitRowsByMultiName(list, LedgerSeizureStats::getInspectorName,
473
+                LedgerSeizureStats::setInspectorName);
474
+        
440 475
         // 批量预加载组织信息和岗位/区域/通道
441 476
         orgInfoHelper.batchFillOrgAndLocationInfo(
442 477
                 list,
@@ -504,6 +539,11 @@ public class LedgerImportController extends BaseController {
504 539
         if (list == null || list.isEmpty()) {
505 540
             return AjaxResult.error("导入数据为空或解析失败,请检查Excel表头是否与模板一致");
506 541
         }
542
+        
543
+        // 如果人员姓名字段包含多个名称,拆分成多条记录
544
+        list = splitRowsByMultiName(list, LedgerTerminalBonus::getPersonName,
545
+                LedgerTerminalBonus::setPersonName);
546
+        
507 547
         // 批量预加载组织信息
508 548
         orgInfoHelper.batchFillOrgInfo(list, LedgerTerminalBonus::getPersonName);
509 549
 
@@ -553,6 +593,11 @@ public class LedgerImportController extends BaseController {
553 593
         if (list == null || list.isEmpty()) {
554 594
             return AjaxResult.error("导入数据为空或解析失败,请检查Excel表头是否与模板一致");
555 595
         }
596
+        
597
+        // 如果人员姓名字段包含多个名称,拆分成多条记录
598
+        list = splitRowsByMultiName(list, LedgerExamScore::getPersonName,
599
+                LedgerExamScore::setPersonName);
600
+        
556 601
         // 批量预加载组织信息
557 602
         orgInfoHelper.batchFillOrgInfo(list, LedgerExamScore::getPersonName);
558 603
 
@@ -579,6 +624,11 @@ public class LedgerImportController extends BaseController {
579 624
         if (list == null || list.isEmpty()) {
580 625
             return AjaxResult.error("导入数据为空或解析失败,请检查Excel表头是否与模板一致");
581 626
         }
627
+        
628
+        // 如果人员姓名字段包含多个名称,拆分成多条记录
629
+        list = splitRowsByMultiName(list, LedgerRewardApproval::getPersonName,
630
+                LedgerRewardApproval::setPersonName);
631
+        
582 632
         // 批量预加载组织信息
583 633
         orgInfoHelper.batchFillOrgInfo(list, LedgerRewardApproval::getPersonName);
584 634
 
@@ -778,6 +828,11 @@ public class LedgerImportController extends BaseController {
778 828
         if (list == null || list.isEmpty()) {
779 829
             return AjaxResult.error("导入数据为空或解析失败,请检查Excel表头是否与模板一致");
780 830
         }
831
+        
832
+        // 如果人员姓名字段包含多个名称,拆分成多条记录
833
+        list = splitRowsByMultiName(list, LedgerLeaveSpecial::getPersonName,
834
+                LedgerLeaveSpecial::setPersonName);
835
+        
781 836
         // 批量预加载组织信息
782 837
         orgInfoHelper.batchFillOrgInfo(list, LedgerLeaveSpecial::getPersonName);
783 838
 
@@ -855,6 +910,11 @@ public class LedgerImportController extends BaseController {
855 910
         if (list == null || list.isEmpty()) {
856 911
             return AjaxResult.error("导入数据为空或解析失败,请检查Excel表头是否与模板一致");
857 912
         }
913
+        
914
+        // 如果人员姓名字段包含多个名称,拆分成多条记录
915
+        list = splitRowsByMultiName(list, LedgerQualificationLevel::getPersonName,
916
+                LedgerQualificationLevel::setPersonName);
917
+        
858 918
         // 批量预加载组织信息(性能优化)
859 919
         orgInfoHelper.batchFillOrgInfo(list, LedgerQualificationLevel::getPersonName);
860 920
 
@@ -920,4 +980,68 @@ public class LedgerImportController extends BaseController {
920 980
     }
921 981
 
922 982
 
983
+    /**
984
+     * 根据名称字段拆分数据行
985
+     * 如果名称字段包含多个人员(用逗号、顿号、分号等分隔),则将一条数据拆分成多条
986
+     */
987
+    private <T> List<T> splitRowsByMultiName(
988
+            List<T> sourceList,
989
+            java.util.function.Function<T, String> nameGetter,
990
+            java.util.function.BiConsumer<T, String> nameSetter) {
991
+
992
+        List<T> result = new ArrayList<>();
993
+
994
+        for (T source : sourceList) {
995
+            String nameField = nameGetter.apply(source);
996
+            List<String> names = splitNames(nameField);
997
+
998
+            if (names.size() == 1) {
999
+                // 只有一个名称,直接添加
1000
+                result.add(source);
1001
+            } else {
1002
+                // 多个名称,拆分成多条记录
1003
+                for (String name : names) {
1004
+                    try {
1005
+                        T copy = (T) source.getClass().getDeclaredConstructor().newInstance();
1006
+                        org.springframework.beans.BeanUtils.copyProperties(source, copy);
1007
+                        nameSetter.accept(copy, name);
1008
+                        result.add(copy);
1009
+                    } catch (Exception e) {
1010
+                        // 如果复制失败,使用原始对象
1011
+                        result.add(source);
1012
+                        break;
1013
+                    }
1014
+                }
1015
+            }
1016
+        }
1017
+
1018
+        return result;
1019
+    }
1020
+
1021
+    /**
1022
+     * 拆分名称字段
1023
+     */
1024
+    private List<String> splitNames(String nameField) {
1025
+        if (nameField == null || nameField.trim().isEmpty()) {
1026
+            return java.util.Collections.singletonList(nameField);
1027
+        }
1028
+
1029
+        String trimmed = nameField.trim();
1030
+
1031
+        // 支持的分隔符:中文逗号、英文逗号、中文顿号、中文分号、英文分号、竖线
1032
+        String[] names = trimmed.split("[,,、;;|]");
1033
+
1034
+        List<String> result = new ArrayList<>();
1035
+        for (String name : names) {
1036
+            String trimmedName = name.trim();
1037
+            if (!trimmedName.isEmpty()) {
1038
+                result.add(trimmedName);
1039
+            }
1040
+        }
1041
+
1042
+        // 如果没有拆分出任何名称,返回原始值
1043
+        return result.isEmpty() ? java.util.Collections.singletonList(trimmed) : result;
1044
+    }
1045
+
1046
+
923 1047
 }

+ 226 - 117
airport-ledger/src/main/java/com/sundot/airport/ledger/service/impl/LedgerCombinedImportServiceImpl.java

@@ -218,20 +218,6 @@ public class LedgerCombinedImportServiceImpl implements ILedgerCombinedImportSer
218 218
             o.setRectificationEvidence(str(c, 12)); // 整改佐证材料
219 219
             o.setInspectorName(str(c, 13));    // 巡查人员
220 220
 
221
-            // 根据责任人名称查找组织ID和名称
222
-            if (inspectedName != null && !inspectedName.trim().isEmpty()) {
223
-                Map<String, Object> orgInfo = resolveOrgInfoByNameWithCache(inspectedName);
224
-                if (!orgInfo.isEmpty()) {
225
-                    o.setInspectedId((Long) orgInfo.get("userId"));
226
-                    o.setDeptId((Long) orgInfo.get("deptId"));
227
-                    o.setDeptName((String) orgInfo.get("deptName"));
228
-                    o.setTeamId((Long) orgInfo.get("teamId"));
229
-                    o.setTeamName((String) orgInfo.get("teamName"));
230
-                    o.setGroupId((Long) orgInfo.get("groupId"));
231
-                    o.setGroupName((String) orgInfo.get("groupName"));
232
-                }
233
-            }
234
-
235 221
             // 根据岗位和区域查找对应ID
236 222
             if (importCache != null) {
237 223
                 String positionName = o.getPosition();
@@ -263,6 +249,31 @@ public class LedgerCombinedImportServiceImpl implements ILedgerCombinedImportSer
263 249
             o.setCreateBy(username);
264 250
             list.add(o);
265 251
         }
252
+        
253
+        // 如果责任人字段包含多个名称,拆分成多条记录
254
+        list = splitRowsByMultiName(
255
+            list,
256
+            LedgerSupervisionProblem::getInspectedName,
257
+            LedgerSupervisionProblem::setInspectedName,
258
+            obj -> copyObject(obj, LedgerSupervisionProblem.class)
259
+        );
260
+        
261
+        // 重新为拆分后的记录填充组织信息和ID
262
+        for (LedgerSupervisionProblem o : list) {
263
+            String inspectedName = o.getInspectedName();
264
+            if (inspectedName != null && !inspectedName.trim().isEmpty()) {
265
+                Map<String, Object> orgInfo = resolveOrgInfoByNameWithCache(inspectedName);
266
+                if (!orgInfo.isEmpty()) {
267
+                    o.setInspectedId((Long) orgInfo.get("userId"));
268
+                    o.setDeptId((Long) orgInfo.get("deptId"));
269
+                    o.setDeptName((String) orgInfo.get("deptName"));
270
+                    o.setTeamId((Long) orgInfo.get("teamId"));
271
+                    o.setTeamName((String) orgInfo.get("teamName"));
272
+                    o.setGroupId((Long) orgInfo.get("groupId"));
273
+                    o.setGroupName((String) orgInfo.get("groupName"));
274
+                }
275
+            }
276
+        }
266 277
         if (CollUtil.isNotEmpty(list)) {
267 278
             List<LedgerSupervisionProblem> existList = supervisionProblemService.selectSupervisionProblemList(new LedgerSupervisionProblem());
268 279
             List<String> repeatList = new ArrayList<>();
@@ -393,20 +404,6 @@ public class LedgerCombinedImportServiceImpl implements ILedgerCombinedImportSer
393 404
             o.setEvidenceFile(str(c, 8));         // 附件
394 405
             o.setCheckPersonnel(str(c, 9));       // 检查人员
395 406
 
396
-            // 根据责任人名称查找组织ID和名称
397
-            if (inspectorName != null && !inspectorName.trim().isEmpty()) {
398
-                Map<String, Object> orgInfo = resolveOrgInfoByNameWithCache(inspectorName);
399
-                if (!orgInfo.isEmpty()) {
400
-                    o.setInspectorId((Long) orgInfo.get("userId"));
401
-                    o.setDeptId((Long) orgInfo.get("deptId"));
402
-                    o.setDeptName((String) orgInfo.get("deptName"));
403
-                    o.setTeamId((Long) orgInfo.get("teamId"));
404
-                    o.setTeamName((String) orgInfo.get("teamName"));
405
-                    o.setGroupId((Long) orgInfo.get("groupId"));
406
-                    o.setGroupName((String) orgInfo.get("groupName"));
407
-                }
408
-            }
409
-
410 407
             // 根据岗位和区域查找对应ID
411 408
             if (importCache != null) {
412 409
                 String positionName = str(c, 3);  // 岗位
@@ -440,6 +437,31 @@ public class LedgerCombinedImportServiceImpl implements ILedgerCombinedImportSer
440 437
             o.setCreateBy(username);
441 438
             list.add(o);
442 439
         }
440
+        
441
+        // 如果责任人字段包含多个名称,拆分成多条记录
442
+        list = splitRowsByMultiName(
443
+            list,
444
+            LedgerRealtimeInterception::getInspectorName,
445
+            LedgerRealtimeInterception::setInspectorName,
446
+            obj -> copyObject(obj, LedgerRealtimeInterception.class)
447
+        );
448
+        
449
+        // 重新为拆分后的记录填充组织信息和ID
450
+        for (LedgerRealtimeInterception o : list) {
451
+            String inspectorName = o.getInspectorName();
452
+            if (inspectorName != null && !inspectorName.trim().isEmpty()) {
453
+                Map<String, Object> orgInfo = resolveOrgInfoByNameWithCache(inspectorName);
454
+                if (!orgInfo.isEmpty()) {
455
+                    o.setInspectorId((Long) orgInfo.get("userId"));
456
+                    o.setDeptId((Long) orgInfo.get("deptId"));
457
+                    o.setDeptName((String) orgInfo.get("deptName"));
458
+                    o.setTeamId((Long) orgInfo.get("teamId"));
459
+                    o.setTeamName((String) orgInfo.get("teamName"));
460
+                    o.setGroupId((Long) orgInfo.get("groupId"));
461
+                    o.setGroupName((String) orgInfo.get("groupName"));
462
+                }
463
+            }
464
+        }
443 465
         if (CollUtil.isNotEmpty(list)) {
444 466
             List<LedgerRealtimeInterception> existList = realtimeInterceptionService.selectList(new LedgerRealtimeInterception());
445 467
             List<String> repeatList = new ArrayList<>();
@@ -494,20 +516,6 @@ public class LedgerCombinedImportServiceImpl implements ILedgerCombinedImportSer
494 516
             o.setRectificationStatus(str(c, 10));     // 整改情况
495 517
             o.setEvidenceMaterial(str(c, 11));        // 佐证材料
496 518
             o.setCheckPersonnel(str(c, 12));          // 检查人员
497
-
498
-            // 根据责任人名称查找组织ID和名称
499
-            if (inspectedName != null && !inspectedName.trim().isEmpty()) {
500
-                Map<String, Object> orgInfo = resolveOrgInfoByNameWithCache(inspectedName);
501
-                if (!orgInfo.isEmpty()) {
502
-                    o.setInspectedId((Long) orgInfo.get("userId"));
503
-                    o.setDeptId((Long) orgInfo.get("deptId"));
504
-                    o.setDeptName((String) orgInfo.get("deptName"));
505
-                    o.setTeamId((Long) orgInfo.get("teamId"));
506
-                    o.setTeamName((String) orgInfo.get("teamName"));
507
-                    o.setGroupId((Long) orgInfo.get("groupId"));
508
-                    o.setGroupName((String) orgInfo.get("groupName"));
509
-                }
510
-            }
511 519
             
512 520
             // 根据岗位和区域查找对应ID
513 521
             if (importCache != null) {
@@ -542,6 +550,31 @@ public class LedgerCombinedImportServiceImpl implements ILedgerCombinedImportSer
542 550
             o.setCreateBy(username);
543 551
             list.add(o);
544 552
         }
553
+        
554
+        // 如果责任人字段包含多个名称,拆分成多条记录
555
+        list = splitRowsByMultiName(
556
+            list,
557
+            LedgerServicePatrol::getInspectedName,
558
+            LedgerServicePatrol::setInspectedName,
559
+            obj -> copyObject(obj, LedgerServicePatrol.class)
560
+        );
561
+        
562
+        // 重新为拆分后的记录填充组织信息和ID
563
+        for (LedgerServicePatrol o : list) {
564
+            String inspectedName = o.getInspectedName();
565
+            if (inspectedName != null && !inspectedName.trim().isEmpty()) {
566
+                Map<String, Object> orgInfo = resolveOrgInfoByNameWithCache(inspectedName);
567
+                if (!orgInfo.isEmpty()) {
568
+                    o.setInspectedId((Long) orgInfo.get("userId"));
569
+                    o.setDeptId((Long) orgInfo.get("deptId"));
570
+                    o.setDeptName((String) orgInfo.get("deptName"));
571
+                    o.setTeamId((Long) orgInfo.get("teamId"));
572
+                    o.setTeamName((String) orgInfo.get("teamName"));
573
+                    o.setGroupId((Long) orgInfo.get("groupId"));
574
+                    o.setGroupName((String) orgInfo.get("groupName"));
575
+                }
576
+            }
577
+        }
545 578
         if (CollUtil.isNotEmpty(list)) {
546 579
             List<LedgerServicePatrol> existList = servicePatrolService.selectList(new LedgerServicePatrol());
547 580
             List<String> repeatList = new ArrayList<>();
@@ -591,8 +624,24 @@ public class LedgerCombinedImportServiceImpl implements ILedgerCombinedImportSer
591 624
             o.setChannelSource(str(c, 7));         // 渠道来源
592 625
             o.setIsResponsible(str(c, 8));         // 是否有责
593 626
             o.setResultHandling(str(c, 9));        // 处理进度
594
-
595
-            // 根据责任人名称查找组织信息和ID
627
+            
628
+            o.setImportBatch(batchNo);
629
+            o.setSourceType("1");
630
+            o.setCreateBy(username);
631
+            list.add(o);
632
+        }
633
+        
634
+        // 如果责任人字段包含多个名称,拆分成多条记录
635
+        list = splitRowsByMultiName(
636
+            list,
637
+            LedgerComplaint::getResponsibleName,
638
+            LedgerComplaint::setResponsibleName,
639
+            obj -> copyObject(obj, LedgerComplaint.class)
640
+        );
641
+        
642
+        // 重新为拆分后的记录填充组织信息和ID
643
+        for (LedgerComplaint o : list) {
644
+            String responsibleName = o.getResponsibleName();
596 645
             if (responsibleName != null && !responsibleName.trim().isEmpty()) {
597 646
                 Map<String, Object> orgInfo = resolveOrgInfoByNameWithCache(responsibleName);
598 647
                 if (!orgInfo.isEmpty()) {
@@ -605,11 +654,6 @@ public class LedgerCombinedImportServiceImpl implements ILedgerCombinedImportSer
605 654
                     o.setGroupName((String) orgInfo.get("groupName"));
606 655
                 }
607 656
             }
608
-            
609
-            o.setImportBatch(batchNo);
610
-            o.setSourceType("1");
611
-            o.setCreateBy(username);
612
-            list.add(o);
613 657
         }
614 658
         complaintService.batchInsert(list);
615 659
         return ImportResultDto.builder().importNum(list.size()).build();
@@ -639,20 +683,6 @@ public class LedgerCombinedImportServiceImpl implements ILedgerCombinedImportSer
639 683
             o.setTestLevel(str(c, 10));          // 层级
640 684
             o.setResultHandling(str(c, 11));    // 整改措施
641 685
             o.setReviewMaterial(str(c, 12));    // 整改材料
642
-
643
-            // 使用缓存查找组织信息(根据被测人名称)
644
-            if (testedName != null && !testedName.trim().isEmpty()) {
645
-                Map<String, Object> orgInfo = resolveOrgInfoByNameWithCache(testedName);
646
-                if (!orgInfo.isEmpty()) {
647
-                    o.setTestedId((Long) orgInfo.get("userId"));
648
-                    o.setDeptId((Long) orgInfo.get("deptId"));
649
-                    o.setDeptName((String) orgInfo.get("deptName"));
650
-                    o.setTeamId((Long) orgInfo.get("teamId"));
651
-                    o.setTeamName((String) orgInfo.get("teamName"));
652
-                    o.setGroupId((Long) orgInfo.get("groupId"));
653
-                    o.setGroupName((String) orgInfo.get("groupName"));
654
-                }
655
-            }
656 686
             
657 687
             // 根据岗位名称和区域名称查找ID
658 688
             if (importCache != null) {
@@ -857,18 +887,6 @@ public class LedgerCombinedImportServiceImpl implements ILedgerCombinedImportSer
857 887
             o.setChannelNo(str(c, 8));
858 888
             o.setImage(str(c, 9));
859 889
             
860
-            // 使用缓存查找组织信息和名称
861
-            Map<String, Object> orgInfo = resolveOrgInfoByNameWithCache(responsibleName);
862
-            if (!orgInfo.isEmpty()) {
863
-                o.setResponsibleId((Long) orgInfo.get("userId"));
864
-                o.setDeptId((Long) orgInfo.get("deptId"));
865
-                o.setDeptName((String) orgInfo.get("deptName"));
866
-                o.setTeamId((Long) orgInfo.get("teamId"));
867
-                o.setTeamName((String) orgInfo.get("teamName"));
868
-                o.setGroupId((Long) orgInfo.get("groupId"));
869
-                o.setGroupName((String) orgInfo.get("groupName"));
870
-            }
871
-            
872 890
             // 根据岗位名称和区域名称查找ID
873 891
             if (importCache != null) {
874 892
                 String positionName = str(c, 7);
@@ -903,6 +921,31 @@ public class LedgerCombinedImportServiceImpl implements ILedgerCombinedImportSer
903 921
             o.setCreateBy(username);
904 922
             list.add(o);
905 923
         }
924
+        
925
+        // 如果责任人字段包含多个名称,拆分成多条记录
926
+        list = splitRowsByMultiName(
927
+            list,
928
+            LedgerUnsafeEvent::getResponsibleName,
929
+            LedgerUnsafeEvent::setResponsibleName,
930
+            obj -> copyObject(obj, LedgerUnsafeEvent.class)
931
+        );
932
+        
933
+        // 重新为拆分后的记录填充组织信息和ID
934
+        for (LedgerUnsafeEvent o : list) {
935
+            String responsibleName = o.getResponsibleName();
936
+            if (responsibleName != null && !responsibleName.trim().isEmpty()) {
937
+                Map<String, Object> orgInfo = resolveOrgInfoByNameWithCache(responsibleName);
938
+                if (!orgInfo.isEmpty()) {
939
+                    o.setResponsibleId((Long) orgInfo.get("userId"));
940
+                    o.setDeptId((Long) orgInfo.get("deptId"));
941
+                    o.setDeptName((String) orgInfo.get("deptName"));
942
+                    o.setTeamId((Long) orgInfo.get("teamId"));
943
+                    o.setTeamName((String) orgInfo.get("teamName"));
944
+                    o.setGroupId((Long) orgInfo.get("groupId"));
945
+                    o.setGroupName((String) orgInfo.get("groupName"));
946
+                }
947
+            }
948
+        }
906 949
         if (CollUtil.isNotEmpty(list)) {
907 950
             List<LedgerUnsafeEvent> existList = unsafeEventService.selectList(new LedgerUnsafeEvent());
908 951
             List<String> repeatList = new ArrayList<>();
@@ -982,20 +1025,6 @@ public class LedgerCombinedImportServiceImpl implements ILedgerCombinedImportSer
982 1025
             o.setHandlingMethod(str(c, 21));     // 处理结果
983 1026
             o.setRemark(str(c, 22));             // 备注
984 1027
 
985
-            // 使用缓存查找组织信息和名称
986
-            if (inspectorName != null && !inspectorName.trim().isEmpty()) {
987
-                Map<String, Object> orgInfo = resolveOrgInfoByNameWithCache(inspectorName);
988
-                if (!orgInfo.isEmpty()) {
989
-                    o.setInspectorId((Long) orgInfo.get("userId"));
990
-                    o.setDeptId((Long) orgInfo.get("deptId"));
991
-                    o.setDeptName((String) orgInfo.get("deptName"));
992
-                    o.setTeamId((Long) orgInfo.get("teamId"));
993
-                    o.setTeamName((String) orgInfo.get("teamName"));
994
-                    o.setGroupId((Long) orgInfo.get("groupId"));
995
-                    o.setGroupName((String) orgInfo.get("groupName"));
996
-                }
997
-            }
998
-
999 1028
             // 根据岗位名称和工作区域名称查找ID
1000 1029
             if (importCache != null) {
1001 1030
                 String positionName = str(c, 6);
@@ -1020,6 +1049,31 @@ public class LedgerCombinedImportServiceImpl implements ILedgerCombinedImportSer
1020 1049
             o.setCreateBy(username);
1021 1050
             list.add(o);
1022 1051
         }
1052
+        
1053
+        // 如果安检员字段包含多个名称,拆分成多条记录
1054
+        list = splitRowsByMultiName(
1055
+            list,
1056
+            LedgerSeizureStats::getInspectorName,
1057
+            LedgerSeizureStats::setInspectorName,
1058
+            obj -> copyObject(obj, LedgerSeizureStats.class)
1059
+        );
1060
+        
1061
+        // 重新为拆分后的记录填充组织信息和ID
1062
+        for (LedgerSeizureStats o : list) {
1063
+            String inspectorName = o.getInspectorName();
1064
+            if (inspectorName != null && !inspectorName.trim().isEmpty()) {
1065
+                Map<String, Object> orgInfo = resolveOrgInfoByNameWithCache(inspectorName);
1066
+                if (!orgInfo.isEmpty()) {
1067
+                    o.setInspectorId((Long) orgInfo.get("userId"));
1068
+                    o.setDeptId((Long) orgInfo.get("deptId"));
1069
+                    o.setDeptName((String) orgInfo.get("deptName"));
1070
+                    o.setTeamId((Long) orgInfo.get("teamId"));
1071
+                    o.setTeamName((String) orgInfo.get("teamName"));
1072
+                    o.setGroupId((Long) orgInfo.get("groupId"));
1073
+                    o.setGroupName((String) orgInfo.get("groupName"));
1074
+                }
1075
+            }
1076
+        }
1023 1077
         if (CollUtil.isNotEmpty(list)) {
1024 1078
             List<LedgerSeizureStats> existList = seizureStatsService.selectList(new LedgerSeizureStats());
1025 1079
             List<String> repeatList = new ArrayList<>();
@@ -1067,7 +1121,20 @@ public class LedgerCombinedImportServiceImpl implements ILedgerCombinedImportSer
1067 1121
             o.setSourceType("1");
1068 1122
             o.setCreateBy(username);
1069 1123
             
1070
-            // 根据人员姓名查找组织ID和名称
1124
+            list.add(o);
1125
+        }
1126
+        
1127
+        // 如果姓名字段包含多个名称,拆分成多条记录
1128
+        list = splitRowsByMultiName(
1129
+            list,
1130
+            LedgerTerminalBonus::getPersonName,
1131
+            LedgerTerminalBonus::setPersonName,
1132
+            obj -> copyObject(obj, LedgerTerminalBonus.class)
1133
+        );
1134
+        
1135
+        // 重新为拆分后的记录填充组织信息和ID
1136
+        for (LedgerTerminalBonus o : list) {
1137
+            String personName = o.getPersonName();
1071 1138
             if (personName != null && !personName.trim().isEmpty()) {
1072 1139
                 Map<String, Object> orgInfo = resolveOrgInfoByNameWithCache(personName);
1073 1140
                 if (!orgInfo.isEmpty()) {
@@ -1080,8 +1147,6 @@ public class LedgerCombinedImportServiceImpl implements ILedgerCombinedImportSer
1080 1147
                     o.setGroupName((String) orgInfo.get("groupName"));
1081 1148
                 }
1082 1149
             }
1083
-            
1084
-            list.add(o);
1085 1150
         }
1086 1151
         if (CollUtil.isNotEmpty(list)) {
1087 1152
             List<LedgerTerminalBonus> existList = terminalBonusService.selectList(new LedgerTerminalBonus());
@@ -1126,7 +1191,23 @@ public class LedgerCombinedImportServiceImpl implements ILedgerCombinedImportSer
1126 1191
             o.setTheoryScore(decimal(c, 3));
1127 1192
             o.setImageScore(decimal(c, 4));
1128 1193
 
1129
-            // 根据姓名查找组织信息
1194
+            o.setImportBatch(batchNo);
1195
+            o.setSourceType("1");
1196
+            o.setCreateBy(username);
1197
+            list.add(o);
1198
+        }
1199
+        
1200
+        // 如果考试人员字段包含多个名称,拆分成多条记录
1201
+        list = splitRowsByMultiName(
1202
+            list,
1203
+            LedgerExamScore::getPersonName,
1204
+            LedgerExamScore::setPersonName,
1205
+            obj -> copyObject(obj, LedgerExamScore.class)
1206
+        );
1207
+        
1208
+        // 重新为拆分后的记录填充组织信息和ID
1209
+        for (LedgerExamScore o : list) {
1210
+            String personName = o.getPersonName();
1130 1211
             if (personName != null && !personName.trim().isEmpty()) {
1131 1212
                 Map<String, Object> orgInfo = resolveOrgInfoByNameWithCache(personName);
1132 1213
                 if (!orgInfo.isEmpty()) {
@@ -1139,11 +1220,6 @@ public class LedgerCombinedImportServiceImpl implements ILedgerCombinedImportSer
1139 1220
                     o.setGroupName((String) orgInfo.get("groupName"));
1140 1221
                 }
1141 1222
             }
1142
-
1143
-            o.setImportBatch(batchNo);
1144
-            o.setSourceType("1");
1145
-            o.setCreateBy(username);
1146
-            list.add(o);
1147 1223
         }
1148 1224
         examScoreService.batchInsert(list);
1149 1225
         return ImportResultDto.builder().importNum(list.size()).build();
@@ -1167,8 +1243,24 @@ public class LedgerCombinedImportServiceImpl implements ILedgerCombinedImportSer
1167 1243
             o.setRewardReason(str(c, 5));         // 主要事由简述
1168 1244
             o.setDisposalResult(str(c, 6));       // 处置结果
1169 1245
             o.setProofMaterial(str(c, 7));        // 证明材料
1170
-
1171
-            // 根据姓名查找组织ID和名称
1246
+            
1247
+            o.setImportBatch(batchNo);
1248
+            o.setSourceType("1");
1249
+            o.setCreateBy(username);
1250
+            list.add(o);
1251
+        }
1252
+        
1253
+        // 如果姓名字段包含多个名称,拆分成多条记录
1254
+        list = splitRowsByMultiName(
1255
+            list,
1256
+            LedgerRewardApproval::getPersonName,
1257
+            LedgerRewardApproval::setPersonName,
1258
+            obj -> copyObject(obj, LedgerRewardApproval.class)
1259
+        );
1260
+        
1261
+        // 重新为拆分后的记录填充组织信息和ID
1262
+        for (LedgerRewardApproval o : list) {
1263
+            String personName = o.getPersonName();
1172 1264
             if (personName != null && !personName.trim().isEmpty()) {
1173 1265
                 Map<String, Object> orgInfo = resolveOrgInfoByNameWithCache(personName);
1174 1266
                 if (!orgInfo.isEmpty()) {
@@ -1179,11 +1271,6 @@ public class LedgerCombinedImportServiceImpl implements ILedgerCombinedImportSer
1179 1271
                     o.setTeamName((String) orgInfo.get("teamName"));
1180 1272
                 }
1181 1273
             }
1182
-            
1183
-            o.setImportBatch(batchNo);
1184
-            o.setSourceType("1");
1185
-            o.setCreateBy(username);
1186
-            list.add(o);
1187 1274
         }
1188 1275
         if (CollUtil.isNotEmpty(list)) {
1189 1276
             List<LedgerRewardApproval> existList = rewardApprovalService.selectList(new LedgerRewardApproval());
@@ -1252,7 +1339,23 @@ public class LedgerCombinedImportServiceImpl implements ILedgerCombinedImportSer
1252 1339
             o.setLeaveType(str(c, 3));
1253 1340
             o.setDays(hoursOrDays(c, 4));
1254 1341
 
1255
-            // 根据姓名查找组织信息
1342
+            o.setImportBatch(batchNo);
1343
+            o.setSourceType("1");
1344
+            o.setCreateBy(username);
1345
+            list.add(o);
1346
+        }
1347
+        
1348
+        // 如果姓名字段包含多个名称,拆分成多条记录
1349
+        list = splitRowsByMultiName(
1350
+            list,
1351
+            LedgerLeaveSpecial::getPersonName,
1352
+            LedgerLeaveSpecial::setPersonName,
1353
+            obj -> copyObject(obj, LedgerLeaveSpecial.class)
1354
+        );
1355
+        
1356
+        // 重新为拆分后的记录填充组织信息和ID
1357
+        for (LedgerLeaveSpecial o : list) {
1358
+            String personName = o.getPersonName();
1256 1359
             if (personName != null && !personName.trim().isEmpty()) {
1257 1360
                 Map<String, Object> orgInfo = resolveOrgInfoByNameWithCache(personName);
1258 1361
                 if (!orgInfo.isEmpty()) {
@@ -1265,11 +1368,6 @@ public class LedgerCombinedImportServiceImpl implements ILedgerCombinedImportSer
1265 1368
                     o.setGroupName((String) orgInfo.get("groupName"));
1266 1369
                 }
1267 1370
             }
1268
-
1269
-            o.setImportBatch(batchNo);
1270
-            o.setSourceType("1");
1271
-            o.setCreateBy(username);
1272
-            list.add(o);
1273 1371
         }
1274 1372
         if (CollUtil.isNotEmpty(list)) {
1275 1373
             List<LedgerLeaveSpecial> existList = leaveSpecialService.selectList(new LedgerLeaveSpecial());
@@ -1993,7 +2091,23 @@ public class LedgerCombinedImportServiceImpl implements ILedgerCombinedImportSer
1993 2091
             o.setLevelFourTime(date(c, 4));     // 四级发证时间
1994 2092
             o.setLevelFiveTime(date(c, 5));     // 五级发证时间
1995 2093
 
1996
-            // 根据姓名查找组织ID和名称
2094
+            o.setImportBatch(batchNo);
2095
+            o.setSourceType("1");
2096
+            o.setCreateBy(username);
2097
+            list.add(o);
2098
+        }
2099
+        
2100
+        // 如果姓名字段包含多个名称,拆分成多条记录
2101
+        list = splitRowsByMultiName(
2102
+            list,
2103
+            LedgerQualificationLevel::getPersonName,
2104
+            LedgerQualificationLevel::setPersonName,
2105
+            obj -> copyObject(obj, LedgerQualificationLevel.class)
2106
+        );
2107
+        
2108
+        // 重新为拆分后的记录填充组织信息和ID
2109
+        for (LedgerQualificationLevel o : list) {
2110
+            String personName = o.getPersonName();
1997 2111
             if (personName != null && !personName.trim().isEmpty()) {
1998 2112
                 Map<String, Object> orgInfo = resolveOrgInfoByNameWithCache(personName);
1999 2113
                 if (!orgInfo.isEmpty()) {
@@ -2006,11 +2120,6 @@ public class LedgerCombinedImportServiceImpl implements ILedgerCombinedImportSer
2006 2120
                     o.setGroupName((String) orgInfo.get("groupName"));
2007 2121
                 }
2008 2122
             }
2009
-
2010
-            o.setImportBatch(batchNo);
2011
-            o.setSourceType("1");
2012
-            o.setCreateBy(username);
2013
-            list.add(o);
2014 2123
         }
2015 2124
         if (CollUtil.isNotEmpty(list)) {
2016 2125
             List<LedgerQualificationLevel> existList = qualificationLevelService.selectQueryList(new LedgerQualificationLevel());