Przeglądaj źródła

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

wangxx 3 tygodni temu
rodzic
commit
4109addec4

+ 108 - 1
airport-ledger/src/main/java/com/sundot/airport/ledger/domain/LedgerServicePatrol.java

@@ -77,6 +77,54 @@ public class LedgerServicePatrol extends BaseEntity {
77
     @Excel(name = "同步标志(0=未同步;1=已同步)")
77
     @Excel(name = "同步标志(0=未同步;1=已同步)")
78
     private String syncFlag;
78
     private String syncFlag;
79
 
79
 
80
+    // ========== 新增字段 ==========
81
+    @Excel(name = "工作点")
82
+    private String channelNo;
83
+
84
+    @Excel(name = "岗位")
85
+    private String position;
86
+
87
+    @Excel(name = "问题层级")
88
+    private String problemLevel;
89
+
90
+    @Excel(name = "队室服务联络人")
91
+    private String serviceContactPerson;
92
+
93
+    @Excel(name = "服务推送队室负责人")
94
+    private String servicePushLeader;
95
+
96
+    @Excel(name = "整改情况")
97
+    private String rectificationStatus;
98
+
99
+    @Excel(name = "佐证材料")
100
+    private String evidenceMaterial;
101
+
102
+    @Excel(name = "发送至相关人员")
103
+    private String sendToRelevant;
104
+
105
+    @Excel(name = "本月内发生问题次数")
106
+    private Integer monthlyProblemCount;
107
+
108
+    @Excel(name = "检查人员")
109
+    private String checkPersonnel;
110
+
111
+    @Excel(name = "分管服务经理")
112
+    private String manageServiceManager;
113
+
114
+    @Excel(name = "队室内勤")
115
+    private String teamInternalDuty;
116
+
117
+    @Excel(name = "队室负责人")
118
+    private String teamLeader;
119
+
120
+    // ========== ID字段 ==========
121
+    private Long inspectedId;
122
+    private Long deptId;
123
+    private Long teamId;
124
+    private Long groupId;
125
+    private Long positionId;
126
+    private Long areaId;
127
+
80
     public Long getId() { return id; }
128
     public Long getId() { return id; }
81
     public void setId(Long id) { this.id = id; }
129
     public void setId(Long id) { this.id = id; }
82
 
130
 
@@ -136,4 +184,63 @@ public class LedgerServicePatrol extends BaseEntity {
136
 
184
 
137
     public String getSyncFlag() { return syncFlag; }
185
     public String getSyncFlag() { return syncFlag; }
138
     public void setSyncFlag(String syncFlag) { this.syncFlag = syncFlag; }
186
     public void setSyncFlag(String syncFlag) { this.syncFlag = syncFlag; }
139
-}
187
+
188
+    // ========== 新增字段的getter/setter ==========
189
+    public String getChannelNo() { return channelNo; }
190
+    public void setChannelNo(String channelNo) { this.channelNo = channelNo; }
191
+
192
+    public String getPosition() { return position; }
193
+    public void setPosition(String position) { this.position = position; }
194
+
195
+    public String getProblemLevel() { return problemLevel; }
196
+    public void setProblemLevel(String problemLevel) { this.problemLevel = problemLevel; }
197
+
198
+    public String getServiceContactPerson() { return serviceContactPerson; }
199
+    public void setServiceContactPerson(String serviceContactPerson) { this.serviceContactPerson = serviceContactPerson; }
200
+
201
+    public String getServicePushLeader() { return servicePushLeader; }
202
+    public void setServicePushLeader(String servicePushLeader) { this.servicePushLeader = servicePushLeader; }
203
+
204
+    public String getRectificationStatus() { return rectificationStatus; }
205
+    public void setRectificationStatus(String rectificationStatus) { this.rectificationStatus = rectificationStatus; }
206
+
207
+    public String getEvidenceMaterial() { return evidenceMaterial; }
208
+    public void setEvidenceMaterial(String evidenceMaterial) { this.evidenceMaterial = evidenceMaterial; }
209
+
210
+    public String getSendToRelevant() { return sendToRelevant; }
211
+    public void setSendToRelevant(String sendToRelevant) { this.sendToRelevant = sendToRelevant; }
212
+
213
+    public Integer getMonthlyProblemCount() { return monthlyProblemCount; }
214
+    public void setMonthlyProblemCount(Integer monthlyProblemCount) { this.monthlyProblemCount = monthlyProblemCount; }
215
+
216
+    public String getCheckPersonnel() { return checkPersonnel; }
217
+    public void setCheckPersonnel(String checkPersonnel) { this.checkPersonnel = checkPersonnel; }
218
+
219
+    public String getManageServiceManager() { return manageServiceManager; }
220
+    public void setManageServiceManager(String manageServiceManager) { this.manageServiceManager = manageServiceManager; }
221
+
222
+    public String getTeamInternalDuty() { return teamInternalDuty; }
223
+    public void setTeamInternalDuty(String teamInternalDuty) { this.teamInternalDuty = teamInternalDuty; }
224
+
225
+    public String getTeamLeader() { return teamLeader; }
226
+    public void setTeamLeader(String teamLeader) { this.teamLeader = teamLeader; }
227
+
228
+    // ========== ID字段的getter/setter ==========
229
+    public Long getInspectedId() { return inspectedId; }
230
+    public void setInspectedId(Long inspectedId) { this.inspectedId = inspectedId; }
231
+
232
+    public Long getDeptId() { return deptId; }
233
+    public void setDeptId(Long deptId) { this.deptId = deptId; }
234
+
235
+    public Long getTeamId() { return teamId; }
236
+    public void setTeamId(Long teamId) { this.teamId = teamId; }
237
+
238
+    public Long getGroupId() { return groupId; }
239
+    public void setGroupId(Long groupId) { this.groupId = groupId; }
240
+
241
+    public Long getPositionId() { return positionId; }
242
+    public void setPositionId(Long positionId) { this.positionId = positionId; }
243
+
244
+    public Long getAreaId() { return areaId; }
245
+    public void setAreaId(Long areaId) { this.areaId = areaId; }
246
+}

+ 65 - 11
airport-ledger/src/main/java/com/sundot/airport/ledger/service/impl/LedgerCombinedImportServiceImpl.java

@@ -413,22 +413,76 @@ public class LedgerCombinedImportServiceImpl implements ILedgerCombinedImportSer
413
     }
413
     }
414
 
414
 
415
     /** 4. 服务巡查 → ledger_service_patrol
415
     /** 4. 服务巡查 → ledger_service_patrol
416
-     * R2: 时间(0) 区域(1) 工作点(2) 岗位(3) 责任人(4) 问题描述(5)
417
-     *     问题类型(6) 整改措施(7) 班组(8) ... 附件(12) ... 检查人员(17)
416
+     * 导入顺序:时间(0) 区域(1) 工作点(2) 岗位(3) 责任人(4) 问题描述(5)
417
+     *          问题类型(6) 整改措施(7) 班组(8) 问题层级(9) 队室服务联络人(10)
418
+     *          服务推送队室负责人(11) 附件(12) 整改情况(13) 佐证材料(14)
419
+     *          发送至相关人员(15) 本月内发生问题次数(16) 检查人员(17)
420
+     *          分管服务经理(18) 队室内勤(19) 队室负责人(20)
418
      */
421
      */
419
     private int doServicePatrol(Sheet sheet, String batchNo, String username) {
422
     private int doServicePatrol(Sheet sheet, String batchNo, String username) {
420
         List<LedgerServicePatrol> list = new ArrayList<>();
423
         List<LedgerServicePatrol> list = new ArrayList<>();
421
         for (Object[] c : dataRows(sheet, 2)) {
424
         for (Object[] c : dataRows(sheet, 2)) {
422
             LedgerServicePatrol o = new LedgerServicePatrol();
425
             LedgerServicePatrol o = new LedgerServicePatrol();
423
-            o.setRecordDate(date(c, 0));
424
-            o.setLocation(str(c, 1));
425
-            o.setInspectedName(str(c, 4));
426
-            o.setProblemDesc(str(c, 5));
427
-            o.setServiceType(str(c, 6));
428
-            o.setResultHandling(str(c, 7));
429
-            o.setTeamName(str(c, 8));
430
-            o.setEvidenceFile(str(c, 12));
431
-            o.setInspectorName(str(c, 17));
426
+            
427
+            // 按照新的导入顺序映射字段
428
+            o.setRecordDate(date(c, 0));              // 时间
429
+            o.setLocation(str(c, 1));                 // 区域
430
+            o.setChannelNo(str(c, 2));                // 工作点
431
+            String positionName = str(c, 3);          // 岗位
432
+            o.setPosition(positionName);
433
+            String inspectedName = str(c, 4);         // 责任人
434
+            o.setInspectedName(inspectedName);
435
+            o.setProblemDesc(str(c, 5));              // 问题描述
436
+            o.setServiceType(str(c, 6));              // 问题类型
437
+            o.setResultHandling(str(c, 7));           // 整改措施
438
+            o.setTeamName(str(c, 8));                 // 班组
439
+            o.setProblemLevel(str(c, 9));             // 问题层级
440
+            o.setServiceContactPerson(str(c, 10));    // 队室服务联络人
441
+            o.setServicePushLeader(str(c, 11));       // 服务推送队室负责人
442
+            o.setEvidenceFile(str(c, 12));            // 附件
443
+            o.setRectificationStatus(str(c, 13));     // 整改情况
444
+            o.setEvidenceMaterial(str(c, 14));        // 佐证材料
445
+            o.setSendToRelevant(str(c, 15));          // 发送至相关人员
446
+            o.setMonthlyProblemCount(integer(c, 16)); // 本月内发生问题次数
447
+            o.setCheckPersonnel(str(c, 17));          // 检查人员
448
+            o.setManageServiceManager(str(c, 18));    // 分管服务经理
449
+            o.setTeamInternalDuty(str(c, 19));        // 队室内勤
450
+            o.setTeamLeader(str(c, 20));              // 队室负责人
451
+            
452
+            // 根据责任人名称查找组织ID和名称
453
+            if (inspectedName != null && !inspectedName.trim().isEmpty()) {
454
+                Map<String, Object> orgInfo = resolveOrgInfoByNameWithCache(inspectedName);
455
+                if (!orgInfo.isEmpty()) {
456
+                    o.setInspectedId((Long) orgInfo.get("userId"));
457
+                    o.setDeptId((Long) orgInfo.get("deptId"));
458
+                    o.setDeptName((String) orgInfo.get("deptName"));
459
+                    o.setTeamId((Long) orgInfo.get("teamId"));
460
+                    o.setTeamName((String) orgInfo.get("teamName"));
461
+                    o.setGroupId((Long) orgInfo.get("groupId"));
462
+                    o.setGroupName((String) orgInfo.get("groupName"));
463
+                }
464
+            }
465
+            
466
+            // 根据岗位和区域查找对应ID
467
+            if (importCache != null) {
468
+                // 岗位ID
469
+                if (positionName != null && !positionName.trim().isEmpty()) {
470
+                    Long positionId = importCache.getPositionIdByName(positionName.trim());
471
+                    if (positionId != null) {
472
+                        o.setPositionId(positionId);
473
+                    }
474
+                }
475
+                
476
+                // 区域ID
477
+                String areaName = o.getLocation();
478
+                if (areaName != null && !areaName.trim().isEmpty()) {
479
+                    Long areaId = importCache.getAreaIdByName(areaName.trim());
480
+                    if (areaId != null) {
481
+                        o.setAreaId(areaId);
482
+                    }
483
+                }
484
+            }
485
+            
432
             o.setImportBatch(batchNo);
486
             o.setImportBatch(batchNo);
433
             o.setSourceType("1");
487
             o.setSourceType("1");
434
             o.setCreateBy(username);
488
             o.setCreateBy(username);

+ 1 - 1
airport-ledger/src/main/java/com/sundot/airport/ledger/service/impl/LedgerSyncServiceImpl.java

@@ -388,7 +388,7 @@ public class LedgerSyncServiceImpl implements ILedgerSyncService {
388
             String src = "service_patrol:" + row.getId();
388
             String src = "service_patrol:" + row.getId();
389
             if (existsBySrc(src)) { skip++; continue; }
389
             if (existsBySrc(src)) { skip++; continue; }
390
             if (!hasName(row.getInspectedName())) { skip++; continue; }
390
             if (!hasName(row.getInspectedName())) { skip++; continue; }
391
-            String level = row.getServiceType() != null ? row.getServiceType() : "";
391
+            String level = row.getProblemLevel() != null ? row.getProblemLevel() : "";
392
             long l3Id; BigDecimal defaultSv;
392
             long l3Id; BigDecimal defaultSv;
393
             if (level.contains("航站楼")) { l3Id = IND_SVCPATROL_L3_TERMINAL; defaultSv = BigDecimal.valueOf(-1.20); }
393
             if (level.contains("航站楼")) { l3Id = IND_SVCPATROL_L3_TERMINAL; defaultSv = BigDecimal.valueOf(-1.20); }
394
             else if (level.contains("站层级") || level.contains("站级")) { l3Id = IND_SVCPATROL_L3_STATION; defaultSv = NEG_ONE; }
394
             else if (level.contains("站层级") || level.contains("站级")) { l3Id = IND_SVCPATROL_L3_STATION; defaultSv = NEG_ONE; }

+ 28 - 4
airport-ledger/src/main/resources/mapper/ledger/LedgerServicePatrolMapper.xml

@@ -21,15 +21,39 @@
21
         <result property="evidenceFile" column="evidence_file" />
21
         <result property="evidenceFile" column="evidence_file" />
22
         <result property="remark" column="remark" />
22
         <result property="remark" column="remark" />
23
         <result property="importBatch" column="import_batch" />
23
         <result property="importBatch" column="import_batch" />
24
-        <result property="sourceType" column="source_type" />        <result property="createBy"   column="create_by"   />
24
+        <result property="sourceType" column="source_type" />
25
+        <result property="createBy" column="create_by" />
25
         <result property="createTime" column="create_time" />
26
         <result property="createTime" column="create_time" />
26
-        <result property="updateBy"   column="update_by"   />
27
+        <result property="updateBy" column="update_by" />
27
         <result property="updateTime" column="update_time" />
28
         <result property="updateTime" column="update_time" />
28
         <result property="syncFlag" column="sync_flag" />
29
         <result property="syncFlag" column="sync_flag" />
30
+        <!-- 新增字段 -->
31
+        <result property="channelNo" column="channel_no" />
32
+        <result property="position" column="position" />
33
+        <result property="problemLevel" column="problem_level" />
34
+        <result property="serviceContactPerson" column="service_contact_person" />
35
+        <result property="servicePushLeader" column="service_push_leader" />
36
+        <result property="rectificationStatus" column="rectification_status" />
37
+        <result property="evidenceMaterial" column="evidence_material" />
38
+        <result property="sendToRelevant" column="send_to_relevant" />
39
+        <result property="monthlyProblemCount" column="monthly_problem_count" />
40
+        <result property="checkPersonnel" column="check_personnel" />
41
+        <result property="manageServiceManager" column="manage_service_manager" />
42
+        <result property="teamInternalDuty" column="team_internal_duty" />
43
+        <result property="teamLeader" column="team_leader" />
44
+        <!-- ID字段 -->
45
+        <result property="inspectedId" column="inspected_id" />
46
+        <result property="deptId" column="dept_id" />
47
+        <result property="teamId" column="team_id" />
48
+        <result property="groupId" column="group_id" />
49
+        <result property="positionId" column="position_id" />
50
+        <result property="areaId" column="area_id" />
29
     </resultMap>
51
     </resultMap>
30
 
52
 
31
     <sql id="selectVo">
53
     <sql id="selectVo">
32
-        SELECT id, record_date,dept_name,team_name,group_name,inspector_name,inspected_name,service_type,problem_desc,location,result_handling,deduct_score,add_score,score_dimension,score_indicator,evidence_file,remark,import_batch,source_type, create_by, create_time, update_by, update_time, sync_flag
54
+        SELECT id, record_date, dept_name, team_name, group_name, inspector_name, inspected_name, service_type, problem_desc, location, result_handling, deduct_score, add_score, score_dimension, score_indicator, evidence_file, remark, import_batch, source_type, create_by, create_time, update_by, update_time, sync_flag,
55
+               channel_no, position, problem_level, service_contact_person, service_push_leader, rectification_status, evidence_material, send_to_relevant, monthly_problem_count, check_personnel, manage_service_manager, team_internal_duty, team_leader,
56
+               inspected_id, dept_id, team_id, group_id, position_id, area_id
33
         FROM ledger_service_patrol
57
         FROM ledger_service_patrol
34
         WHERE del_flag = '0'
58
         WHERE del_flag = '0'
35
     </sql>
59
     </sql>
@@ -54,4 +78,4 @@
54
         set sync_flag = '1'
78
         set sync_flag = '1'
55
         where sync_flag = '0'
79
         where sync_flag = '0'
56
     </update>
80
     </update>
57
-</mapper>
81
+</mapper>