浏览代码

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

wangxx 3 周之前
父节点
当前提交
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 30
     @Excel(name = "队室/班组")
31 31
     private String teamName;
32 32
 
33
+    @Excel(name = "组长")
34
+    private String groupLeader;
35
+
36
+    @Excel(name = "队室内勤")
37
+    private String teamInternalDuty;
38
+
33 39
     @Excel(name = "通道号")
34 40
     private String channelNo;
35 41
 
@@ -53,18 +59,30 @@ public class LedgerChannelPassRate extends BaseEntity {
53 59
     @Excel(name = "同步标志(0=未同步;1=已同步)")
54 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 71
     public Long getId() { return id; }
57 72
     public void setId(Long id) { this.id = id; }
58 73
 
59 74
     public Date getRecordDate() { return recordDate; }
60 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 77
     public String getTeamName() { return teamName; }
66 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 86
     public String getChannelNo() { return channelNo; }
69 87
     public void setChannelNo(String channelNo) { this.channelNo = channelNo; }
70 88
 
@@ -88,4 +106,28 @@ public class LedgerChannelPassRate extends BaseEntity {
88 106
 
89 107
     public String getSyncFlag() { return syncFlag; }
90 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 523
     /** 7. 通道过检率(pivot表)→ ledger_channel_pass_rate
524 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 528
     private int doChannelPassRate(Sheet sheet, String batchNo, String username) {
@@ -550,13 +550,24 @@ public class LedgerCombinedImportServiceImpl implements ILedgerCombinedImportSer
550 550
 
551 551
         List<LedgerChannelPassRate> list = new ArrayList<>();
552 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 563
             for (int[] mc : monthCols) {
555 564
                 int ci = mc[0];
556 565
                 BigDecimal rate = decimal(c, ci);
557 566
                 if (rate == null) continue;
558 567
                 LedgerChannelPassRate o = new LedgerChannelPassRate();
568
+                o.setGroupLeader(groupLeader);
559 569
                 o.setTeamName(teamName);
570
+                o.setTeamInternalDuty(teamInternalDuty);
560 571
                 o.setPassRate(rate);
561 572
                 // 用时间戳还原日期
562 573
                 Calendar cal = Calendar.getInstance();
@@ -565,6 +576,18 @@ public class LedgerCombinedImportServiceImpl implements ILedgerCombinedImportSer
565 576
                 o.setImportBatch(batchNo);
566 577
                 o.setSourceType("1");
567 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 591
                 list.add(o);
569 592
             }
570 593
         }