Przeglądaj źródła

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

wangxx 3 tygodni temu
rodzic
commit
fd3a488676

+ 33 - 1
airport-ledger/src/main/java/com/sundot/airport/ledger/domain/LedgerExamScore.java

@@ -36,6 +36,14 @@ public class LedgerExamScore extends BaseEntity {
36 36
     @Excel(name = "用户名称")
37 37
     private String personName;
38 38
 
39
+    private Long personId;
40
+
41
+    private Long deptId;
42
+
43
+    private Long teamId;
44
+
45
+    private Long groupId;
46
+
39 47
     @Excel(name = "类别")
40 48
     private String examCategory;
41 49
 
@@ -48,6 +56,12 @@ public class LedgerExamScore extends BaseEntity {
48 56
     @Excel(name = "图像成绩")
49 57
     private BigDecimal imageScore;
50 58
 
59
+    @Excel(name = "分类")
60
+    private String classification;
61
+
62
+    @Excel(name = "队室教员")
63
+    private String teamInstructor;
64
+
51 65
     @Excel(name = "备注")
52 66
     private String remark;
53 67
 
@@ -89,9 +103,27 @@ public class LedgerExamScore extends BaseEntity {
89 103
     public BigDecimal getImageScore() { return imageScore; }
90 104
     public void setImageScore(BigDecimal imageScore) { this.imageScore = imageScore; }
91 105
 
106
+    public String getClassification() { return classification; }
107
+    public void setClassification(String classification) { this.classification = classification; }
108
+
109
+    public String getTeamInstructor() { return teamInstructor; }
110
+    public void setTeamInstructor(String teamInstructor) { this.teamInstructor = teamInstructor; }
111
+
92 112
     public String getRemark() { return remark; }
93 113
     public void setRemark(String remark) { this.remark = remark; }
94 114
 
115
+    public Long getPersonId() { return personId; }
116
+    public void setPersonId(Long personId) { this.personId = personId; }
117
+
118
+    public Long getDeptId() { return deptId; }
119
+    public void setDeptId(Long deptId) { this.deptId = deptId; }
120
+
121
+    public Long getTeamId() { return teamId; }
122
+    public void setTeamId(Long teamId) { this.teamId = teamId; }
123
+
124
+    public Long getGroupId() { return groupId; }
125
+    public void setGroupId(Long groupId) { this.groupId = groupId; }
126
+
95 127
     public String getImportBatch() { return importBatch; }
96 128
     public void setImportBatch(String importBatch) { this.importBatch = importBatch; }
97 129
 
@@ -100,4 +132,4 @@ public class LedgerExamScore extends BaseEntity {
100 132
 
101 133
     public String getSyncFlag() { return syncFlag; }
102 134
     public void setSyncFlag(String syncFlag) { this.syncFlag = syncFlag; }
103
-}
135
+}

+ 28 - 8
airport-ledger/src/main/java/com/sundot/airport/ledger/service/impl/LedgerCombinedImportServiceImpl.java

@@ -777,19 +777,39 @@ public class LedgerCombinedImportServiceImpl implements ILedgerCombinedImportSer
777 777
     }
778 778
 
779 779
     /** 11. 成绩收集 → ledger_exam_score
780
-     * R2: 类别(0) 期数(1) 考试人员(2) 理论成绩(3) 图像成绩(4) 班组(5) 分类(6) 备注(7)
780
+     * R2: 类别(0) 期数(1) 考试人员(2) 理论成绩(3) 图像成绩(4) 班组(5) 分类(6) 备注(7) 队室教员(8)
781 781
      */
782 782
     private int doExamScore(Sheet sheet, String batchNo, String username) {
783 783
         List<LedgerExamScore> list = new ArrayList<>();
784 784
         for (Object[] c : dataRows(sheet, 2)) {
785 785
             LedgerExamScore o = new LedgerExamScore();
786
-            o.setExamCategory(str(c, 0));
787
-            o.setExamPeriod(str(c, 1));
788
-            o.setPersonName(str(c, 2));
789
-            o.setTheoryScore(decimal(c, 3));
790
-            o.setImageScore(decimal(c, 4));
791
-            o.setTeamName(str(c, 5));
792
-            o.setRemark(str(c, 7));
786
+            
787
+            // 按导入顺序映射字段
788
+            o.setExamCategory(str(c, 0));         // 类别
789
+            o.setExamPeriod(str(c, 1));           // 期数
790
+            String personName = str(c, 2);        // 考试人员
791
+            o.setPersonName(personName);
792
+            o.setTheoryScore(decimal(c, 3));      // 理论成绩
793
+            o.setImageScore(decimal(c, 4));       // 图像成绩
794
+            o.setTeamName(str(c, 5));             // 班组
795
+            o.setClassification(str(c, 6));       // 分类
796
+            o.setRemark(str(c, 7));               // 备注(补考分数)
797
+            o.setTeamInstructor(str(c, 8));       // 队室教员
798
+            
799
+            // 根据考试人员名称查找组织信息和ID
800
+            if (personName != null && !personName.trim().isEmpty()) {
801
+                Map<String, Object> orgInfo = resolveOrgInfoByNameWithCache(personName);
802
+                if (!orgInfo.isEmpty()) {
803
+                    o.setPersonId((Long) orgInfo.get("userId"));
804
+                    o.setDeptId((Long) orgInfo.get("deptId"));
805
+                    o.setDeptName((String) orgInfo.get("deptName"));
806
+                    o.setTeamId((Long) orgInfo.get("teamId"));
807
+                    o.setTeamName((String) orgInfo.get("teamName"));
808
+                    o.setGroupId((Long) orgInfo.get("groupId"));
809
+                    o.setGroupName((String) orgInfo.get("groupName"));
810
+                }
811
+            }
812
+            
793 813
             o.setImportBatch(batchNo);
794 814
             o.setSourceType("1");
795 815
             o.setCreateBy(username);

+ 11 - 4
airport-ledger/src/main/resources/mapper/ledger/LedgerExamScoreMapper.xml

@@ -9,21 +9,28 @@
9 9
         <result property="teamName" column="team_name" />
10 10
         <result property="groupName" column="group_name" />
11 11
         <result property="personName" column="person_name" />
12
+        <result property="personId" column="person_id" />
13
+        <result property="deptId" column="dept_id" />
14
+        <result property="teamId" column="team_id" />
15
+        <result property="groupId" column="group_id" />
12 16
         <result property="examCategory" column="exam_category" />
13 17
         <result property="examPeriod" column="exam_period" />
14 18
         <result property="theoryScore" column="theory_score" />
15 19
         <result property="imageScore"  column="image_score"  />
20
+        <result property="classification" column="classification" />
21
+        <result property="teamInstructor" column="team_instructor" />
16 22
         <result property="remark" column="remark" />
17 23
         <result property="importBatch" column="import_batch" />
18
-        <result property="sourceType" column="source_type" />        <result property="createBy"   column="create_by"   />
24
+        <result property="sourceType" column="source_type" />
25
+        <result property="syncFlag" column="sync_flag" />
26
+        <result property="createBy"   column="create_by"   />
19 27
         <result property="createTime" column="create_time" />
20 28
         <result property="updateBy"   column="update_by"   />
21 29
         <result property="updateTime" column="update_time" />
22
-        <result property="syncFlag" column="sync_flag" />
23 30
     </resultMap>
24 31
 
25 32
     <sql id="selectVo">
26
-        SELECT id, exam_date, dept_name, team_name, group_name, person_name, exam_category, exam_period, theory_score, image_score, remark, import_batch, source_type, create_by, create_time, update_by, update_time, sync_flag
33
+        SELECT id, exam_date, dept_name, team_name, group_name, person_name, person_id, dept_id, team_id, group_id, exam_category, exam_period, theory_score, image_score, classification, team_instructor, remark, import_batch, source_type, sync_flag, create_by, create_time, update_by, update_time
27 34
         FROM ledger_exam_score
28 35
         WHERE del_flag = '0'
29 36
     </sql>
@@ -47,4 +54,4 @@
47 54
         set sync_flag = '1'
48 55
         where sync_flag = '0'
49 56
     </update>
50
-</mapper>
57
+</mapper>