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

ledger_realtime_interception表新增字段和导入功能字段数据新增

wangxx пре 4 недеља
родитељ
комит
1536a1604a

+ 162 - 0
airport-ledger/src/main/java/com/sundot/airport/ledger/domain/LedgerRealtimeInterception.java

@@ -30,15 +30,33 @@ public class LedgerRealtimeInterception extends BaseEntity {
30 30
     @Excel(name = "部门名称")
31 31
     private String deptName;
32 32
 
33
+    private Long deptId;
34
+
33 35
     @Excel(name = "队室/班组")
34 36
     private String teamName;
35 37
 
38
+    private Long teamId;
39
+
36 40
     @Excel(name = "小组")
37 41
     private String groupName;
38 42
 
43
+    private Long groupId;
44
+
45
+    private Long areaId;
46
+
47
+    @Excel(name = "区域")
48
+    private String location;
49
+
50
+    @Excel(name = "岗位")
51
+    private String position;
52
+
53
+    private Long positionId;
54
+
39 55
     @Excel(name = "查获人")
40 56
     private String inspectorName;
41 57
 
58
+    private Long inspectorId;
59
+
42 60
     @Excel(name = "通道号")
43 61
     private String channelNo;
44 62
 
@@ -69,6 +87,66 @@ public class LedgerRealtimeInterception extends BaseEntity {
69 87
     @Excel(name = "处理结果")
70 88
     private String resultHandling;
71 89
 
90
+    @Excel(name = "问题类型")
91
+    private String problemType;
92
+
93
+    @Excel(name = "整改措施")
94
+    private String rectificationMeasures;
95
+
96
+    @Excel(name = "问题层级")
97
+    private String problemLevel;
98
+
99
+    @Excel(name = "附件")
100
+    private String attachment;
101
+
102
+    @Excel(name = "问题类别")
103
+    private String problemCategory;
104
+
105
+    @Excel(name = "个人复盘")
106
+    private String personalReview;
107
+
108
+    @Excel(name = "队室复盘")
109
+    private String teamReview;
110
+
111
+    @Excel(name = "队室质控员")
112
+    private String qualityOfficer;
113
+
114
+    @Excel(name = "质控推送队室负责人")
115
+    private String qualityPushLeader;
116
+
117
+    @Excel(name = "开机年限")
118
+    private String operationYears;
119
+
120
+    @Excel(name = "责任人开机年龄")
121
+    private String responsibleOperationAge;
122
+
123
+    @Excel(name = "发送至相关人员")
124
+    private String sendToRelevant;
125
+
126
+    @Excel(name = "本月内发生问题次数")
127
+    private Integer monthlyProblemCount;
128
+
129
+    @Excel(name = "上月质控问题发生次数")
130
+    private Integer lastMonthProblemCount;
131
+
132
+    @Excel(name = "实时图像漏检难易度")
133
+    private String imageMissDifficulty;
134
+
135
+    @Excel(name = "检查人员")
136
+    private String checkPersonnel;
137
+
138
+    @Excel(name = "部门培训教员")
139
+    private String deptTrainingInstructor;
140
+
141
+    @Excel(name = "分管质控经理")
142
+    private String manageQcManager;
143
+
144
+    @Excel(name = "队室内勤")
145
+    private String teamInternalDuty;
146
+
147
+    @Excel(name = "队室负责人")
148
+    private String teamLeader;
149
+
72 150
     @Excel(name = "扣分")
73 151
     private BigDecimal deductScore;
74 152
 
@@ -104,15 +182,39 @@ public class LedgerRealtimeInterception extends BaseEntity {
104 182
     public String getDeptName() { return deptName; }
105 183
     public void setDeptName(String deptName) { this.deptName = deptName; }
106 184
 
185
+    public Long getDeptId() { return deptId; }
186
+    public void setDeptId(Long deptId) { this.deptId = deptId; }
187
+
107 188
     public String getTeamName() { return teamName; }
108 189
     public void setTeamName(String teamName) { this.teamName = teamName; }
109 190
 
191
+    public Long getTeamId() { return teamId; }
192
+    public void setTeamId(Long teamId) { this.teamId = teamId; }
193
+
110 194
     public String getGroupName() { return groupName; }
111 195
     public void setGroupName(String groupName) { this.groupName = groupName; }
112 196
 
197
+    public Long getGroupId() { return groupId; }
198
+    public void setGroupId(Long groupId) { this.groupId = groupId; }
199
+
200
+    public Long getAreaId() { return areaId; }
201
+    public void setAreaId(Long areaId) { this.areaId = areaId; }
202
+
203
+    public String getLocation() { return location; }
204
+    public void setLocation(String location) { this.location = location; }
205
+
206
+    public String getPosition() { return position; }
207
+    public void setPosition(String position) { this.position = position; }
208
+
209
+    public Long getPositionId() { return positionId; }
210
+    public void setPositionId(Long positionId) { this.positionId = positionId; }
211
+
113 212
     public String getInspectorName() { return inspectorName; }
114 213
     public void setInspectorName(String inspectorName) { this.inspectorName = inspectorName; }
115 214
 
215
+    public Long getInspectorId() { return inspectorId; }
216
+    public void setInspectorId(Long inspectorId) { this.inspectorId = inspectorId; }
217
+
116 218
     public String getChannelNo() { return channelNo; }
117 219
     public void setChannelNo(String channelNo) { this.channelNo = channelNo; }
118 220
 
@@ -143,6 +245,66 @@ public class LedgerRealtimeInterception extends BaseEntity {
143 245
     public String getResultHandling() { return resultHandling; }
144 246
     public void setResultHandling(String resultHandling) { this.resultHandling = resultHandling; }
145 247
 
248
+    public String getProblemType() { return problemType; }
249
+    public void setProblemType(String problemType) { this.problemType = problemType; }
250
+
251
+    public String getRectificationMeasures() { return rectificationMeasures; }
252
+    public void setRectificationMeasures(String rectificationMeasures) { this.rectificationMeasures = rectificationMeasures; }
253
+
254
+    public String getProblemLevel() { return problemLevel; }
255
+    public void setProblemLevel(String problemLevel) { this.problemLevel = problemLevel; }
256
+
257
+    public String getAttachment() { return attachment; }
258
+    public void setAttachment(String attachment) { this.attachment = attachment; }
259
+
260
+    public String getProblemCategory() { return problemCategory; }
261
+    public void setProblemCategory(String problemCategory) { this.problemCategory = problemCategory; }
262
+
263
+    public String getPersonalReview() { return personalReview; }
264
+    public void setPersonalReview(String personalReview) { this.personalReview = personalReview; }
265
+
266
+    public String getTeamReview() { return teamReview; }
267
+    public void setTeamReview(String teamReview) { this.teamReview = teamReview; }
268
+
269
+    public String getQualityOfficer() { return qualityOfficer; }
270
+    public void setQualityOfficer(String qualityOfficer) { this.qualityOfficer = qualityOfficer; }
271
+
272
+    public String getQualityPushLeader() { return qualityPushLeader; }
273
+    public void setQualityPushLeader(String qualityPushLeader) { this.qualityPushLeader = qualityPushLeader; }
274
+
275
+    public String getOperationYears() { return operationYears; }
276
+    public void setOperationYears(String operationYears) { this.operationYears = operationYears; }
277
+
278
+    public String getResponsibleOperationAge() { return responsibleOperationAge; }
279
+    public void setResponsibleOperationAge(String responsibleOperationAge) { this.responsibleOperationAge = responsibleOperationAge; }
280
+
281
+    public String getSendToRelevant() { return sendToRelevant; }
282
+    public void setSendToRelevant(String sendToRelevant) { this.sendToRelevant = sendToRelevant; }
283
+
284
+    public Integer getMonthlyProblemCount() { return monthlyProblemCount; }
285
+    public void setMonthlyProblemCount(Integer monthlyProblemCount) { this.monthlyProblemCount = monthlyProblemCount; }
286
+
287
+    public Integer getLastMonthProblemCount() { return lastMonthProblemCount; }
288
+    public void setLastMonthProblemCount(Integer lastMonthProblemCount) { this.lastMonthProblemCount = lastMonthProblemCount; }
289
+
290
+    public String getImageMissDifficulty() { return imageMissDifficulty; }
291
+    public void setImageMissDifficulty(String imageMissDifficulty) { this.imageMissDifficulty = imageMissDifficulty; }
292
+
293
+    public String getCheckPersonnel() { return checkPersonnel; }
294
+    public void setCheckPersonnel(String checkPersonnel) { this.checkPersonnel = checkPersonnel; }
295
+
296
+    public String getDeptTrainingInstructor() { return deptTrainingInstructor; }
297
+    public void setDeptTrainingInstructor(String deptTrainingInstructor) { this.deptTrainingInstructor = deptTrainingInstructor; }
298
+
299
+    public String getManageQcManager() { return manageQcManager; }
300
+    public void setManageQcManager(String manageQcManager) { this.manageQcManager = manageQcManager; }
301
+
302
+    public String getTeamInternalDuty() { return teamInternalDuty; }
303
+    public void setTeamInternalDuty(String teamInternalDuty) { this.teamInternalDuty = teamInternalDuty; }
304
+
305
+    public String getTeamLeader() { return teamLeader; }
306
+    public void setTeamLeader(String teamLeader) { this.teamLeader = teamLeader; }
307
+
146 308
     public BigDecimal getDeductScore() { return deductScore; }
147 309
     public void setDeductScore(BigDecimal deductScore) { this.deductScore = deductScore; }
148 310
 

+ 68 - 14
airport-ledger/src/main/java/com/sundot/airport/ledger/service/impl/LedgerCombinedImportServiceImpl.java

@@ -272,25 +272,79 @@ public class LedgerCombinedImportServiceImpl implements ILedgerCombinedImportSer
272 272
     }
273 273
 
274 274
     /** 3. 部门实时质控拦截情况记录表 → ledger_realtime_interception
275
-     * R2: 时间(0) 区域(1) 工作点(2) 岗位(3) 责任人(4) 拦截物品(5)
276
-     *     个数(6) 问题类型(7) 整改措施(8) 问题层级(9) 班组(10)
277
-     *     附件(11) 问题类别(12)
275
+     * 导入顺序:时间(0) 区域(1) 工作点(2) 岗位(3) 责任人(4) 实时质控拦截物品(5) 个数(6)
276
+     *          问题类型(7) 整改措施(8) 问题层级(9) 班组(10) 附件(11) 问题类别(12)
277
+     *          个人复盘(13) 队室复盘(14) 队室质控员(15) 质控推送队室负责人(16)
278
+     *          开机年限(17) 责任人开机年龄(18) 发送至相关人员(19) 本月内发生问题次数(20)
279
+     *          上月质控问题发生次数(21) 实时图像漏检难易度(22) 检查人员(23) 部门培训教员(24)
280
+     *          分管质控经理(25) 队室内勤(26) 备注(27) 队室负责人(28)
278 281
      */
279 282
     private int doRealtimeInterception(Sheet sheet, String batchNo, String username) {
280 283
         List<LedgerRealtimeInterception> list = new ArrayList<>();
281 284
         for (Object[] c : dataRows(sheet, 2)) {
282 285
             LedgerRealtimeInterception o = new LedgerRealtimeInterception();
283
-            o.setRecordDate(date(c, 0));
284
-            o.setRecordTime(timeStr(c, 0));
285
-            o.setChannelNo(str(c, 2));
286
-            o.setInspectorName(str(c, 4));
287
-            o.setItemName(str(c, 5));
288
-            o.setItemQuantity(integer(c, 6));
289
-            o.setItemCategory(str(c, 7));
290
-            o.setHandlingMethod(str(c, 8));
291
-            o.setTeamName(str(c, 10));
292
-            o.setEvidenceFile(str(c, 11));
293
-            o.setRemark(str(c, 12));
286
+            
287
+            // 按照新的导入顺序映射字段
288
+            o.setRecordDate(date(c, 0));        // 时间
289
+            o.setLocation(str(c, 1));           // 区域
290
+            o.setPosition(str(c, 3));           // 岗位
291
+            o.setChannelNo(str(c, 2));          // 工作点
292
+            String inspectorName = str(c, 4);   // 责任人
293
+            o.setItemName(str(c, 5));           // 实时质控拦截物品
294
+            o.setItemQuantity(integer(c, 6));   // 个数
295
+            o.setProblemType(str(c, 7));        // 问题类型
296
+            o.setRectificationMeasures(str(c, 8)); // 整改措施
297
+            o.setProblemLevel(str(c, 9));       // 问题层级
298
+            o.setTeamName(str(c, 10));          // 班组
299
+            o.setAttachment(str(c, 11));        // 附件
300
+            o.setProblemCategory(str(c, 12));   // 问题类别
301
+            o.setPersonalReview(str(c, 13));    // 个人复盘
302
+            o.setTeamReview(str(c, 14));        // 队室复盘
303
+            o.setQualityOfficer(str(c, 15));    // 队室质控员
304
+            o.setQualityPushLeader(str(c, 16)); // 质控推送队室负责人
305
+            o.setOperationYears(str(c, 17));    // 开机年限
306
+            o.setResponsibleOperationAge(str(c, 18)); // 责任人开机年龄
307
+            o.setSendToRelevant(str(c, 19));    // 发送至相关人员
308
+            o.setMonthlyProblemCount(integer(c, 20)); // 本月内发生问题次数
309
+            o.setLastMonthProblemCount(integer(c, 21)); // 上月质控问题发生次数
310
+            o.setImageMissDifficulty(str(c, 22)); // 实时图像漏检难易度
311
+            o.setCheckPersonnel(str(c, 23));    // 检查人员
312
+            o.setDeptTrainingInstructor(str(c, 24)); // 部门培训教员
313
+            o.setManageQcManager(str(c, 25));   // 分管质控经理
314
+            o.setTeamInternalDuty(str(c, 26));  // 队室内勤
315
+            o.setRemark(str(c, 27));            // 备注
316
+            o.setTeamLeader(str(c, 28));        // 队室负责人
317
+            
318
+            // 根据责任人名称查找组织ID
319
+            if (inspectorName != null && !inspectorName.trim().isEmpty()) {
320
+                Map<String, Long> orgInfo = resolveOrgInfoByNameWithCache(inspectorName);
321
+                if (!orgInfo.isEmpty()) {
322
+                    o.setInspectorId(orgInfo.get("userId"));
323
+                    o.setDeptId(orgInfo.get("deptId"));
324
+                    o.setTeamId(orgInfo.get("teamId"));
325
+                    o.setGroupId(orgInfo.get("groupId"));
326
+                }
327
+            }
328
+            
329
+            // 根据岗位和区域查找对应ID
330
+            if (importCache != null) {
331
+                String positionName = str(c, 3);  // 岗位
332
+                if (positionName != null && !positionName.trim().isEmpty()) {
333
+                    Long positionId = importCache.getPositionIdByName(positionName.trim());
334
+                    if (positionId != null) {
335
+                        o.setPositionId(positionId);
336
+                    }
337
+                }
338
+                
339
+                String areaName = str(c, 1);  // 区域
340
+                if (areaName != null && !areaName.trim().isEmpty()) {
341
+                    Long areaId = importCache.getAreaIdByName(areaName.trim());
342
+                    if (areaId != null) {
343
+                        o.setAreaId(areaId);
344
+                    }
345
+                }
346
+            }
347
+            
294 348
             o.setImportBatch(batchNo);
295 349
             o.setSourceType("1");
296 350
             o.setCreateBy(username);

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

@@ -210,9 +210,21 @@ public class LedgerSyncServiceImpl implements ILedgerSyncService {
210 210
             String src = "realtime_interception:" + row.getId();
211 211
             if (existsBySrc(src)) { skip++; continue; }
212 212
             if (!hasName(row.getInspectorName())) { skip++; continue; }
213
-            // 实时拦截台账无层级字段,按实际deductScore计分;L3指标默认站层级
214
-            BigDecimal sv = row.getDeductScore() != null ? row.getDeductScore().negate() : NEG_ONE;
215
-            ScoreIndicator lv3 = getIndicator(IND_INTERCEPT_L3_STATION);
213
+            // 取【问题层级】字段,站层级扣1分,部门层级扣0.8分,其它层级跳过
214
+            String level = row.getProblemLevel() != null ? row.getProblemLevel() : "";
215
+            long l3Id; BigDecimal sv;
216
+            if (level.contains("站层级")) {
217
+                l3Id = IND_INTERCEPT_L3_STATION;
218
+                sv = row.getDeductScore() != null ? row.getDeductScore().negate() : NEG_ONE;
219
+            } else if (level.contains("部门层级")) {
220
+                l3Id = IND_INTERCEPT_L3_DEPT;
221
+                sv = row.getDeductScore() != null ? row.getDeductScore().negate() : NEG_08;
222
+            } else {
223
+                // todo其它层级暂时跳过
224
+                skip++;
225
+                continue;
226
+            }
227
+            ScoreIndicator lv3 = getIndicator(l3Id);
216 228
             ScoreEvent e = buildEvent(dimId, lv2, lv3, row.getInspectorName(),
217 229
                     row.getTeamName(), row.getRecordDate(),
218 230
                     row.getChannelNo(), sv, ZERO,

+ 42 - 3
airport-ledger/src/main/resources/mapper/ledger/LedgerRealtimeInterceptionMapper.xml

@@ -5,10 +5,19 @@
5 5
     <resultMap id="BaseResultMap" type="com.sundot.airport.ledger.domain.LedgerRealtimeInterception">
6 6
         <id property="id" column="id" />
7 7
         <result property="recordDate" column="record_date" />
8
+        <result property="recordTime" column="record_time" />
8 9
         <result property="deptName" column="dept_name" />
10
+        <result property="deptId" column="dept_id" />
9 11
         <result property="teamName" column="team_name" />
12
+        <result property="teamId" column="team_id" />
10 13
         <result property="groupName" column="group_name" />
14
+        <result property="groupId" column="group_id" />
15
+        <result property="areaId" column="area_id" />
16
+        <result property="location" column="location" />
17
+        <result property="position" column="position" />
18
+        <result property="positionId" column="position_id" />
11 19
         <result property="inspectorName" column="inspector_name" />
20
+        <result property="inspectorId" column="inspector_id" />
12 21
         <result property="channelNo" column="channel_no" />
13 22
         <result property="passengerName" column="passenger_name" />
14 23
         <result property="idCardNo" column="id_card_no" />
@@ -19,21 +28,51 @@
19 28
         <result property="itemWeight" column="item_weight" />
20 29
         <result property="handlingMethod" column="handling_method" />
21 30
         <result property="resultHandling" column="result_handling" />
31
+        <result property="problemType" column="problem_type" />
32
+        <result property="rectificationMeasures" column="rectification_measures" />
33
+        <result property="problemLevel" column="problem_level" />
34
+        <result property="attachment" column="attachment" />
35
+        <result property="problemCategory" column="problem_category" />
36
+        <result property="personalReview" column="personal_review" />
37
+        <result property="teamReview" column="team_review" />
38
+        <result property="qualityOfficer" column="quality_officer" />
39
+        <result property="qualityPushLeader" column="quality_push_leader" />
40
+        <result property="operationYears" column="operation_years" />
41
+        <result property="responsibleOperationAge" column="responsible_operation_age" />
42
+        <result property="sendToRelevant" column="send_to_relevant" />
43
+        <result property="monthlyProblemCount" column="monthly_problem_count" />
44
+        <result property="lastMonthProblemCount" column="last_month_problem_count" />
45
+        <result property="imageMissDifficulty" column="image_miss_difficulty" />
46
+        <result property="checkPersonnel" column="check_personnel" />
47
+        <result property="deptTrainingInstructor" column="dept_training_instructor" />
48
+        <result property="manageQcManager" column="manage_qc_manager" />
49
+        <result property="teamInternalDuty" column="team_internal_duty" />
50
+        <result property="remark" column="remark" />
51
+        <result property="teamLeader" column="team_leader" />
22 52
         <result property="deductScore" column="deduct_score" />
23 53
         <result property="addScore" column="add_score" />
24 54
         <result property="scoreDimension" column="score_dimension" />
25 55
         <result property="scoreIndicator" column="score_indicator" />
26 56
         <result property="evidenceFile" column="evidence_file" />
27
-        <result property="remark" column="remark" />
28 57
         <result property="importBatch" column="import_batch" />
29
-        <result property="sourceType" column="source_type" />        <result property="createBy"   column="create_by"   />
58
+        <result property="sourceType" column="source_type" />
59
+        <result property="createBy"   column="create_by"   />
30 60
         <result property="createTime" column="create_time" />
31 61
         <result property="updateBy"   column="update_by"   />
32 62
         <result property="updateTime" column="update_time" />
33 63
     </resultMap>
34 64
 
35 65
     <sql id="selectVo">
36
-        SELECT id, record_date,dept_name,team_name,group_name,inspector_name,channel_no,passenger_name,id_card_no,flight_no,item_category,item_name,item_quantity,item_weight,handling_method,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
66
+        SELECT id, record_date, record_time, dept_name, dept_id, team_name, team_id, group_name, group_id, area_id,
67
+               location, position, position_id,
68
+               inspector_name, inspector_id, channel_no, passenger_name, id_card_no, flight_no, item_category, item_name,
69
+               item_quantity, item_weight, handling_method, result_handling, problem_type, rectification_measures,
70
+               problem_level, attachment, problem_category, personal_review, team_review, quality_officer,
71
+               quality_push_leader, operation_years, responsible_operation_age, send_to_relevant,
72
+               monthly_problem_count, last_month_problem_count, image_miss_difficulty, check_personnel,
73
+               dept_training_instructor, manage_qc_manager, team_internal_duty, remark, team_leader,
74
+               deduct_score, add_score, score_dimension, score_indicator, evidence_file, import_batch, source_type,
75
+               create_by, create_time, update_by, update_time
37 76
         FROM ledger_realtime_interception
38 77
         WHERE del_flag = '0'
39 78
     </sql>