Просмотр исходного кода

ledger_channel_pass_rate表字段添加、相关代码修改、导入逻辑修改

wangxx недель назад: 3
Родитель
Сommit
e9495d8de1

+ 46 - 4
airport-ledger/src/main/java/com/sundot/airport/ledger/domain/LedgerChannelPassRate.java

@@ -30,6 +30,12 @@ public class LedgerChannelPassRate extends BaseEntity {
30
     @Excel(name = "队室/班组")
30
     @Excel(name = "队室/班组")
31
     private String teamName;
31
     private String teamName;
32
 
32
 
33
+    @Excel(name = "组长")
34
+    private String groupLeader;
35
+
36
+    @Excel(name = "队室内勤")
37
+    private String teamInternalDuty;
38
+
33
     @Excel(name = "通道号")
39
     @Excel(name = "通道号")
34
     private String channelNo;
40
     private String channelNo;
35
 
41
 
@@ -53,18 +59,30 @@ public class LedgerChannelPassRate extends BaseEntity {
53
     @Excel(name = "同步标志(0=未同步;1=已同步)")
59
     @Excel(name = "同步标志(0=未同步;1=已同步)")
54
     private String syncFlag;
60
     private String syncFlag;
55
 
61
 
62
+    // ID字段
63
+    private Long responsibleId;
64
+    private Long deptId;
65
+    private Long teamId;
66
+    private Long groupId;
67
+    private Long positionId;
68
+    private Long areaId;
69
+    private String groupName;
70
+
56
     public Long getId() { return id; }
71
     public Long getId() { return id; }
57
     public void setId(Long id) { this.id = id; }
72
     public void setId(Long id) { this.id = id; }
58
 
73
 
59
     public Date getRecordDate() { return recordDate; }
74
     public Date getRecordDate() { return recordDate; }
60
     public void setRecordDate(Date recordDate) { this.recordDate = recordDate; }
75
     public void setRecordDate(Date recordDate) { this.recordDate = recordDate; }
61
 
76
 
62
-    public String getDeptName() { return deptName; }
63
-    public void setDeptName(String deptName) { this.deptName = deptName; }
64
-
65
     public String getTeamName() { return teamName; }
77
     public String getTeamName() { return teamName; }
66
     public void setTeamName(String teamName) { this.teamName = teamName; }
78
     public void setTeamName(String teamName) { this.teamName = teamName; }
67
 
79
 
80
+    public String getGroupLeader() { return groupLeader; }
81
+    public void setGroupLeader(String groupLeader) { this.groupLeader = groupLeader; }
82
+
83
+    public String getTeamInternalDuty() { return teamInternalDuty; }
84
+    public void setTeamInternalDuty(String teamInternalDuty) { this.teamInternalDuty = teamInternalDuty; }
85
+
68
     public String getChannelNo() { return channelNo; }
86
     public String getChannelNo() { return channelNo; }
69
     public void setChannelNo(String channelNo) { this.channelNo = channelNo; }
87
     public void setChannelNo(String channelNo) { this.channelNo = channelNo; }
70
 
88
 
@@ -88,4 +106,28 @@ public class LedgerChannelPassRate extends BaseEntity {
88
 
106
 
89
     public String getSyncFlag() { return syncFlag; }
107
     public String getSyncFlag() { return syncFlag; }
90
     public void setSyncFlag(String syncFlag) { this.syncFlag = syncFlag; }
108
     public void setSyncFlag(String syncFlag) { this.syncFlag = syncFlag; }
91
-}
109
+
110
+    public Long getResponsibleId() { return responsibleId; }
111
+    public void setResponsibleId(Long responsibleId) { this.responsibleId = responsibleId; }
112
+
113
+    public Long getDeptId() { return deptId; }
114
+    public void setDeptId(Long deptId) { this.deptId = deptId; }
115
+
116
+    public Long getTeamId() { return teamId; }
117
+    public void setTeamId(Long teamId) { this.teamId = teamId; }
118
+
119
+    public Long getGroupId() { return groupId; }
120
+    public void setGroupId(Long groupId) { this.groupId = groupId; }
121
+
122
+    public Long getPositionId() { return positionId; }
123
+    public void setPositionId(Long positionId) { this.positionId = positionId; }
124
+
125
+    public Long getAreaId() { return areaId; }
126
+    public void setAreaId(Long areaId) { this.areaId = areaId; }
127
+
128
+    public String getDeptName() { return deptName; }
129
+    public void setDeptName(String deptName) { this.deptName = deptName; }
130
+
131
+    public String getGroupName() { return groupName; }
132
+    public void setGroupName(String groupName) { this.groupName = groupName; }
133
+}

+ 25 - 2
airport-ledger/src/main/java/com/sundot/airport/ledger/service/impl/LedgerCombinedImportServiceImpl.java

@@ -522,7 +522,7 @@ public class LedgerCombinedImportServiceImpl implements ILedgerCombinedImportSer
522
 
522
 
523
     /** 7. 通道过检率(pivot表)→ ledger_channel_pass_rate
523
     /** 7. 通道过检率(pivot表)→ ledger_channel_pass_rate
524
      * R1: 大标题行
524
      * R1: 大标题行
525
-     * R2: 组长(0) 班组(1) 内勤(2) 2026年1月平均过检率(3) 2026年2月...(4) ...
525
+     * R2: 组长(0) 班组(1) 队室内勤(2) 2026年1月平均过检率(3) 2026年2月...(4) ...
526
      * 每行展开为多条(每月一条)
526
      * 每行展开为多条(每月一条)
527
      */
527
      */
528
     private int doChannelPassRate(Sheet sheet, String batchNo, String username) {
528
     private int doChannelPassRate(Sheet sheet, String batchNo, String username) {
@@ -550,13 +550,24 @@ public class LedgerCombinedImportServiceImpl implements ILedgerCombinedImportSer
550
 
550
 
551
         List<LedgerChannelPassRate> list = new ArrayList<>();
551
         List<LedgerChannelPassRate> list = new ArrayList<>();
552
         for (Object[] c : dataRows(sheet, 2)) {
552
         for (Object[] c : dataRows(sheet, 2)) {
553
-            String teamName = str(c, 1);
553
+            String groupLeader = str(c, 0);      // 组长(0)
554
+            String teamName = str(c, 1);         // 班组(1)
555
+            String teamInternalDuty = str(c, 2); // 队室内勤(2)
556
+            
557
+            // 根据组长名称查找组织信息和ID
558
+            Map<String, Object> orgInfo = new HashMap<>();
559
+            if (groupLeader != null && !groupLeader.trim().isEmpty()) {
560
+                orgInfo = resolveOrgInfoByNameWithCache(groupLeader);
561
+            }
562
+            
554
             for (int[] mc : monthCols) {
563
             for (int[] mc : monthCols) {
555
                 int ci = mc[0];
564
                 int ci = mc[0];
556
                 BigDecimal rate = decimal(c, ci);
565
                 BigDecimal rate = decimal(c, ci);
557
                 if (rate == null) continue;
566
                 if (rate == null) continue;
558
                 LedgerChannelPassRate o = new LedgerChannelPassRate();
567
                 LedgerChannelPassRate o = new LedgerChannelPassRate();
568
+                o.setGroupLeader(groupLeader);
559
                 o.setTeamName(teamName);
569
                 o.setTeamName(teamName);
570
+                o.setTeamInternalDuty(teamInternalDuty);
560
                 o.setPassRate(rate);
571
                 o.setPassRate(rate);
561
                 // 用时间戳还原日期
572
                 // 用时间戳还原日期
562
                 Calendar cal = Calendar.getInstance();
573
                 Calendar cal = Calendar.getInstance();
@@ -565,6 +576,18 @@ public class LedgerCombinedImportServiceImpl implements ILedgerCombinedImportSer
565
                 o.setImportBatch(batchNo);
576
                 o.setImportBatch(batchNo);
566
                 o.setSourceType("1");
577
                 o.setSourceType("1");
567
                 o.setCreateBy(username);
578
                 o.setCreateBy(username);
579
+                
580
+                // 设置组织ID和名称
581
+                if (!orgInfo.isEmpty()) {
582
+                    o.setResponsibleId((Long) orgInfo.get("userId"));
583
+                    o.setDeptId((Long) orgInfo.get("deptId"));
584
+                    o.setDeptName((String) orgInfo.get("deptName"));
585
+                    o.setTeamId((Long) orgInfo.get("teamId"));
586
+                    o.setTeamName((String) orgInfo.get("teamName"));
587
+                    o.setGroupId((Long) orgInfo.get("groupId"));
588
+                    o.setGroupName((String) orgInfo.get("groupName"));
589
+                }
590
+                
568
                 list.add(o);
591
                 list.add(o);
569
             }
592
             }
570
         }
593
         }