Explorar el Código

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

wangxx hace 4 semanas
padre
commit
0e83739af2

+ 90 - 1
airport-ledger/src/main/java/com/sundot/airport/ledger/domain/LedgerSecurityTest.java

@@ -24,24 +24,44 @@ public class LedgerSecurityTest extends BaseEntity {
24 24
     @Excel(name = "测试日期", width = 20, dateFormat = "yyyy-MM-dd")
25 25
     private Date recordDate;
26 26
 
27
+    @Excel(name = "测试区域")
28
+    private String region;
29
+
30
+    @Excel(name = "测试通道")
31
+    private String channel;
32
+
27 33
     @Excel(name = "部门名称")
28 34
     private String deptName;
29 35
 
36
+    private Long deptId;
37
+
30 38
     @Excel(name = "队室/班组")
31 39
     private String teamName;
32 40
 
41
+    private Long teamId;
42
+
33 43
     @Excel(name = "小组")
34 44
     private String groupName;
35 45
 
46
+    private Long groupId;
47
+
48
+    private Long areaId;
49
+
36 50
     @Excel(name = "测试人")
37 51
     private String testerName;
38 52
 
53
+    private Long testerId;
54
+
39 55
     @Excel(name = "被测人")
40 56
     private String testedName;
41 57
 
42
-    @Excel(name = "测试类型")
58
+    private Long testedId;
59
+
60
+    @Excel(name = "被测试岗位")
43 61
     private String testType;
44 62
 
63
+    private Long positionId;
64
+
45 65
     @Excel(name = "测试项目")
46 66
     private String testItem;
47 67
 
@@ -54,6 +74,27 @@ public class LedgerSecurityTest extends BaseEntity {
54 74
     @Excel(name = "处理结果")
55 75
     private String resultHandling;
56 76
 
77
+    @Excel(name = "复查地点及时间")
78
+    private String reviewLocationTime;
79
+
80
+    @Excel(name = "整改材料")
81
+    private String reviewMaterial;
82
+
83
+    @Excel(name = "推送队室质控员")
84
+    private String pushTeamQc;
85
+
86
+    @Excel(name = "推送质控队长")
87
+    private String pushQcCaptain;
88
+
89
+    @Excel(name = "队室内勤")
90
+    private String teamInternalDuty;
91
+
92
+    @Excel(name = "点击推送至相关人员")
93
+    private String pushToRelevant;
94
+
95
+    @Excel(name = "队室负责人")
96
+    private String teamLeader;
97
+
57 98
     @Excel(name = "扣分")
58 99
     private BigDecimal deductScore;
59 100
 
@@ -136,4 +177,52 @@ public class LedgerSecurityTest extends BaseEntity {
136 177
 
137 178
     public String getSourceType() { return sourceType; }
138 179
     public void setSourceType(String sourceType) { this.sourceType = sourceType; }
180
+
181
+    public String getRegion() { return region; }
182
+    public void setRegion(String region) { this.region = region; }
183
+
184
+    public String getChannel() { return channel; }
185
+    public void setChannel(String channel) { this.channel = channel; }
186
+
187
+    public Long getDeptId() { return deptId; }
188
+    public void setDeptId(Long deptId) { this.deptId = deptId; }
189
+
190
+    public Long getTeamId() { return teamId; }
191
+    public void setTeamId(Long teamId) { this.teamId = teamId; }
192
+
193
+    public Long getGroupId() { return groupId; }
194
+    public void setGroupId(Long groupId) { this.groupId = groupId; }
195
+
196
+    public Long getAreaId() { return areaId; }
197
+    public void setAreaId(Long areaId) { this.areaId = areaId; }
198
+
199
+    public Long getTesterId() { return testerId; }
200
+    public void setTesterId(Long testerId) { this.testerId = testerId; }
201
+
202
+    public Long getTestedId() { return testedId; }
203
+    public void setTestedId(Long testedId) { this.testedId = testedId; }
204
+
205
+    public Long getPositionId() { return positionId; }
206
+    public void setPositionId(Long positionId) { this.positionId = positionId; }
207
+
208
+    public String getReviewLocationTime() { return reviewLocationTime; }
209
+    public void setReviewLocationTime(String reviewLocationTime) { this.reviewLocationTime = reviewLocationTime; }
210
+
211
+    public String getReviewMaterial() { return reviewMaterial; }
212
+    public void setReviewMaterial(String reviewMaterial) { this.reviewMaterial = reviewMaterial; }
213
+
214
+    public String getPushTeamQc() { return pushTeamQc; }
215
+    public void setPushTeamQc(String pushTeamQc) { this.pushTeamQc = pushTeamQc; }
216
+
217
+    public String getPushQcCaptain() { return pushQcCaptain; }
218
+    public void setPushQcCaptain(String pushQcCaptain) { this.pushQcCaptain = pushQcCaptain; }
219
+
220
+    public String getTeamInternalDuty() { return teamInternalDuty; }
221
+    public void setTeamInternalDuty(String teamInternalDuty) { this.teamInternalDuty = teamInternalDuty; }
222
+
223
+    public String getPushToRelevant() { return pushToRelevant; }
224
+    public void setPushToRelevant(String pushToRelevant) { this.pushToRelevant = pushToRelevant; }
225
+
226
+    public String getTeamLeader() { return teamLeader; }
227
+    public void setTeamLeader(String teamLeader) { this.teamLeader = teamLeader; }
139 228
 }

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

@@ -302,28 +302,99 @@ public class LedgerCombinedImportServiceImpl implements ILedgerCombinedImportSer
302 302
     }
303 303
 
304 304
     /** 6. 安保测试记录表(部门)→ ledger_security_test
305
-     * R2: 时间(0) 区域→deptName(1) 通道→groupName(2) 测试项目(3) 被测人员(4) 被测岗位→testType(5)
306
-     *     测试物品→problemDesc(6) 图片→evidenceFile(7) 是否通过→testResult(8) 层级→scoreIndicator(9)
307
-     *     整改措施→resultHandling(10) 扣分(11) 整改材料→remark(12) 班组(13)
305
+     * 导入顺序:开展时间(0) 测试区域(1) 测试通道(2) 测试项目(3) 被测试人员(4) 被测试岗位(5)
306
+     *          测试物品(6) 开展项目图片或视频(7) 是否通过(8) 层级(9) 整改措施(10)
307
+     *          复查地点及时间(11) 整改材料(12) 班组(13) 推送队室质控员(14) 推送质控队长(15)
308
+     *          队室内勤(16) 点击推送至相关人员(17) 队室负责人(18)
308 309
      */
309 310
     private int doSecurityTest(Sheet sheet, String batchNo, String username) {
310 311
         List<LedgerSecurityTest> list = new ArrayList<>();
311 312
         for (Object[] c : dataRows(sheet, 2)) {
312 313
             LedgerSecurityTest o = new LedgerSecurityTest();
313
-            o.setRecordDate(date(c, 0));
314
-            o.setDeptName(str(c, 1));
315
-            o.setGroupName(str(c, 2));
316
-            o.setTestItem(str(c, 3));
317
-            o.setTestedName(str(c, 4));
314
+            
315
+            // 按照新的导入顺序映射字段
316
+            o.setRecordDate(date(c, 0));  // 开展时间
317
+            o.setRegion(str(c, 1));       // 测试区域
318
+            o.setChannel(str(c, 2));      // 测试通道
319
+            o.setTestItem(str(c, 3));     // 测试项目
320
+            
321
+            // 被测试人员
322
+            String testedName = str(c, 4);
323
+            o.setTestedName(testedName);
324
+            
325
+            // 被测试岗位
318 326
             o.setTestType(str(c, 5));
327
+            
328
+            // 测试物品→problemDesc
319 329
             o.setProblemDesc(str(c, 6));
330
+            
331
+            // 开展项目图片或视频→evidenceFile
320 332
             o.setEvidenceFile(str(c, 7));
333
+            
334
+            // 是否通过→testResult
321 335
             o.setTestResult(str(c, 8));
336
+            
337
+            // 层级→scoreIndicator
322 338
             o.setScoreIndicator(str(c, 9));
339
+            
340
+            // 整改措施→resultHandling
323 341
             o.setResultHandling(str(c, 10));
324
-            o.setDeductScore(decimal(c, 11));
325
-            o.setRemark(str(c, 12));
326
-            o.setTeamName(str(c, 13));
342
+            
343
+            // 复查地点及时间
344
+            o.setReviewLocationTime(str(c, 11));
345
+            
346
+            // 整改材料
347
+            o.setReviewMaterial(str(c, 12));
348
+            
349
+            // 班组→teamName
350
+            String teamName = str(c, 13);
351
+            o.setTeamName(teamName);
352
+            
353
+            // 推送队室质控员
354
+            o.setPushTeamQc(str(c, 14));
355
+            
356
+            // 推送质控队长
357
+            o.setPushQcCaptain(str(c, 15));
358
+            
359
+            // 队室内勤
360
+            o.setTeamInternalDuty(str(c, 16));
361
+            
362
+            // 点击推送至相关人员
363
+            o.setPushToRelevant(str(c, 17));
364
+            
365
+            // 队室负责人
366
+            o.setTeamLeader(str(c, 18));
367
+            
368
+            // 使用缓存查找组织信息(根据被测人名称)
369
+            if (testedName != null && !testedName.trim().isEmpty()) {
370
+                Map<String, Long> orgInfo = resolveOrgInfoByNameWithCache(testedName);
371
+                if (!orgInfo.isEmpty()) {
372
+                    o.setTestedId(orgInfo.get("userId"));
373
+                    o.setDeptId(orgInfo.get("deptId"));
374
+                    o.setTeamId(orgInfo.get("teamId"));
375
+                    o.setGroupId(orgInfo.get("groupId"));
376
+                }
377
+            }
378
+            
379
+            // 根据岗位名称和区域名称查找ID
380
+            if (importCache != null) {
381
+                String positionName = str(c, 5);  // 被测试岗位
382
+                if (positionName != null && !positionName.trim().isEmpty()) {
383
+                    Long positionId = importCache.getPositionIdByName(positionName.trim());
384
+                    if (positionId != null) {
385
+                        o.setPositionId(positionId);
386
+                    }
387
+                }
388
+                
389
+                String areaName = str(c, 1);  // 测试区域
390
+                if (areaName != null && !areaName.trim().isEmpty()) {
391
+                    Long areaId = importCache.getAreaIdByName(areaName.trim());
392
+                    if (areaId != null) {
393
+                        o.setAreaId(areaId);
394
+                    }
395
+                }
396
+            }
397
+            
327 398
             o.setImportBatch(batchNo);
328 399
             o.setSourceType("1");
329 400
             o.setCreateBy(username);

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

@@ -234,7 +234,8 @@ public class LedgerSyncServiceImpl implements ILedgerSyncService {
234 234
             if (existsBySrc(src)) { skip++; continue; }
235 235
             if (!"未通过".equals(row.getTestResult())) { skip++; continue; }
236 236
             if (!hasName(row.getTestedName())) { skip++; continue; }
237
-            String level = row.getTestType() != null ? row.getTestType() : "";
237
+            // 取层级字段(scoreIndicator),而不是testType
238
+            String level = row.getScoreIndicator() != null ? row.getScoreIndicator() : "";
238 239
             long l3Id;
239 240
             if (level.contains("局方")) { l3Id = IND_SECTEST_L3_GOV; }
240 241
             else if (level.contains("公司")) { l3Id = IND_SECTEST_L3_CORP; }

+ 23 - 2
airport-ledger/src/main/resources/mapper/ledger/LedgerSecurityTestMapper.xml

@@ -5,16 +5,32 @@
5 5
     <resultMap id="BaseResultMap" type="com.sundot.airport.ledger.domain.LedgerSecurityTest">
6 6
         <id property="id" column="id" />
7 7
         <result property="recordDate" column="record_date" />
8
+        <result property="region" column="region" />
9
+        <result property="channel" column="channel" />
8 10
         <result property="deptName" column="dept_name" />
11
+        <result property="deptId" column="dept_id" />
9 12
         <result property="teamName" column="team_name" />
13
+        <result property="teamId" column="team_id" />
10 14
         <result property="groupName" column="group_name" />
15
+        <result property="groupId" column="group_id" />
16
+        <result property="areaId" column="area_id" />
11 17
         <result property="testerName" column="tester_name" />
18
+        <result property="testerId" column="tester_id" />
12 19
         <result property="testedName" column="tested_name" />
20
+        <result property="testedId" column="tested_id" />
13 21
         <result property="testType" column="test_type" />
22
+        <result property="positionId" column="position_id" />
14 23
         <result property="testItem" column="test_item" />
15 24
         <result property="testResult" column="test_result" />
16 25
         <result property="problemDesc" column="problem_desc" />
17 26
         <result property="resultHandling" column="result_handling" />
27
+        <result property="reviewLocationTime" column="review_location_time" />
28
+        <result property="reviewMaterial" column="review_material" />
29
+        <result property="pushTeamQc" column="push_team_qc" />
30
+        <result property="pushQcCaptain" column="push_qc_captain" />
31
+        <result property="teamInternalDuty" column="team_internal_duty" />
32
+        <result property="pushToRelevant" column="push_to_relevant" />
33
+        <result property="teamLeader" column="team_leader" />
18 34
         <result property="deductScore" column="deduct_score" />
19 35
         <result property="addScore" column="add_score" />
20 36
         <result property="scoreDimension" column="score_dimension" />
@@ -22,14 +38,19 @@
22 38
         <result property="evidenceFile" column="evidence_file" />
23 39
         <result property="remark" column="remark" />
24 40
         <result property="importBatch" column="import_batch" />
25
-        <result property="sourceType" column="source_type" />        <result property="createBy"   column="create_by"   />
41
+        <result property="sourceType" column="source_type" />
42
+        <result property="createBy"   column="create_by"   />
26 43
         <result property="createTime" column="create_time" />
27 44
         <result property="updateBy"   column="update_by"   />
28 45
         <result property="updateTime" column="update_time" />
29 46
     </resultMap>
30 47
 
31 48
     <sql id="selectVo">
32
-        SELECT id, record_date,dept_name,team_name,group_name,tester_name,tested_name,test_type,test_item,test_result,problem_desc,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
49
+        SELECT id, record_date, region, channel, dept_name, dept_id, team_name, team_id, group_name, group_id, area_id,
50
+               tester_name, tester_id, tested_name, tested_id, test_type, position_id, test_item, test_result,
51
+               problem_desc, result_handling, review_location_time, review_material, push_team_qc, push_qc_captain,
52
+               team_internal_duty, push_to_relevant, team_leader, deduct_score, add_score, score_dimension,
53
+               score_indicator, evidence_file, remark, import_batch, source_type, create_by, create_time, update_by, update_time
33 54
         FROM ledger_security_test
34 55
         WHERE del_flag = '0'
35 56
     </sql>