Просмотр исходного кода

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

wangxx недель назад: 3
Родитель
Сommit
5558c37a7c

+ 27 - 1
airport-ledger/src/main/java/com/sundot/airport/ledger/domain/LedgerTerminalBonus.java

@@ -27,12 +27,23 @@ public class LedgerTerminalBonus extends BaseEntity {
27
     @Excel(name = "部门名称")
27
     @Excel(name = "部门名称")
28
     private String deptName;
28
     private String deptName;
29
 
29
 
30
+    private Long deptId;
31
+
30
     @Excel(name = "队室/班组")
32
     @Excel(name = "队室/班组")
31
     private String teamName;
33
     private String teamName;
32
 
34
 
35
+    private Long teamId;
36
+
33
     @Excel(name = "姓名")
37
     @Excel(name = "姓名")
34
     private String personName;
38
     private String personName;
35
 
39
 
40
+    private Long personId;
41
+
42
+    @Excel(name = "小组")
43
+    private String groupName;
44
+
45
+    private Long groupId;
46
+
36
     @Excel(name = "加分类型")
47
     @Excel(name = "加分类型")
37
     private String bonusType;
48
     private String bonusType;
38
 
49
 
@@ -62,12 +73,27 @@ public class LedgerTerminalBonus extends BaseEntity {
62
     public String getDeptName() { return deptName; }
73
     public String getDeptName() { return deptName; }
63
     public void setDeptName(String deptName) { this.deptName = deptName; }
74
     public void setDeptName(String deptName) { this.deptName = deptName; }
64
 
75
 
76
+    public Long getDeptId() { return deptId; }
77
+    public void setDeptId(Long deptId) { this.deptId = deptId; }
78
+
65
     public String getTeamName() { return teamName; }
79
     public String getTeamName() { return teamName; }
66
     public void setTeamName(String teamName) { this.teamName = teamName; }
80
     public void setTeamName(String teamName) { this.teamName = teamName; }
67
 
81
 
82
+    public Long getTeamId() { return teamId; }
83
+    public void setTeamId(Long teamId) { this.teamId = teamId; }
84
+
68
     public String getPersonName() { return personName; }
85
     public String getPersonName() { return personName; }
69
     public void setPersonName(String personName) { this.personName = personName; }
86
     public void setPersonName(String personName) { this.personName = personName; }
70
 
87
 
88
+    public Long getPersonId() { return personId; }
89
+    public void setPersonId(Long personId) { this.personId = personId; }
90
+
91
+    public String getGroupName() { return groupName; }
92
+    public void setGroupName(String groupName) { this.groupName = groupName; }
93
+
94
+    public Long getGroupId() { return groupId; }
95
+    public void setGroupId(Long groupId) { this.groupId = groupId; }
96
+
71
     public String getBonusType() { return bonusType; }
97
     public String getBonusType() { return bonusType; }
72
     public void setBonusType(String bonusType) { this.bonusType = bonusType; }
98
     public void setBonusType(String bonusType) { this.bonusType = bonusType; }
73
 
99
 
@@ -88,4 +114,4 @@ public class LedgerTerminalBonus extends BaseEntity {
88
 
114
 
89
     public String getSyncFlag() { return syncFlag; }
115
     public String getSyncFlag() { return syncFlag; }
90
     public void setSyncFlag(String syncFlag) { this.syncFlag = syncFlag; }
116
     public void setSyncFlag(String syncFlag) { this.syncFlag = syncFlag; }
91
-}
117
+}

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

@@ -868,13 +868,29 @@ public class LedgerCombinedImportServiceImpl implements ILedgerCombinedImportSer
868
         for (Object[] c : dataRows(sheet, 2)) {
868
         for (Object[] c : dataRows(sheet, 2)) {
869
             LedgerTerminalBonus o = new LedgerTerminalBonus();
869
             LedgerTerminalBonus o = new LedgerTerminalBonus();
870
             o.setApproveDate(date(c, 0) != null ? new java.sql.Date(date(c, 0).getTime()) : null);
870
             o.setApproveDate(date(c, 0) != null ? new java.sql.Date(date(c, 0).getTime()) : null);
871
-            o.setPersonName(str(c, 1));
871
+            String personName = str(c, 1);
872
+            o.setPersonName(personName);
872
             o.setTeamName(str(c, 2));
873
             o.setTeamName(str(c, 2));
873
             o.setAddScore(decimal(c, 3) != null ? decimal(c, 3) : BigDecimal.ZERO);
874
             o.setAddScore(decimal(c, 3) != null ? decimal(c, 3) : BigDecimal.ZERO);
874
             o.setRemark(str(c, 4));
875
             o.setRemark(str(c, 4));
875
             o.setImportBatch(batchNo);
876
             o.setImportBatch(batchNo);
876
             o.setSourceType("1");
877
             o.setSourceType("1");
877
             o.setCreateBy(username);
878
             o.setCreateBy(username);
879
+            
880
+            // 根据人员姓名查找组织ID和名称
881
+            if (personName != null && !personName.trim().isEmpty()) {
882
+                Map<String, Object> orgInfo = resolveOrgInfoByNameWithCache(personName);
883
+                if (!orgInfo.isEmpty()) {
884
+                    o.setPersonId((Long) orgInfo.get("userId"));
885
+                    o.setDeptId((Long) orgInfo.get("deptId"));
886
+                    o.setDeptName((String) orgInfo.get("deptName"));
887
+                    o.setTeamId((Long) orgInfo.get("teamId"));
888
+                    o.setTeamName((String) orgInfo.get("teamName"));
889
+                    o.setGroupId((Long) orgInfo.get("groupId"));
890
+                    o.setGroupName((String) orgInfo.get("groupName"));
891
+                }
892
+            }
893
+            
878
             list.add(o);
894
             list.add(o);
879
         }
895
         }
880
         terminalBonusService.batchInsert(list);
896
         terminalBonusService.batchInsert(list);

+ 9 - 3
airport-ledger/src/main/resources/mapper/ledger/LedgerTerminalBonusMapper.xml

@@ -6,22 +6,28 @@
6
         <id property="id" column="id" />
6
         <id property="id" column="id" />
7
         <result property="approveDate" column="approve_date" />
7
         <result property="approveDate" column="approve_date" />
8
         <result property="deptName" column="dept_name" />
8
         <result property="deptName" column="dept_name" />
9
+        <result property="deptId" column="dept_id" />
9
         <result property="teamName" column="team_name" />
10
         <result property="teamName" column="team_name" />
11
+        <result property="teamId" column="team_id" />
10
         <result property="personName" column="person_name" />
12
         <result property="personName" column="person_name" />
13
+        <result property="personId" column="person_id" />
11
         <result property="bonusType" column="bonus_type" />
14
         <result property="bonusType" column="bonus_type" />
12
         <result property="addScore" column="add_score" />
15
         <result property="addScore" column="add_score" />
13
         <result property="evidenceFile" column="evidence_file" />
16
         <result property="evidenceFile" column="evidence_file" />
14
         <result property="remark" column="remark" />
17
         <result property="remark" column="remark" />
15
         <result property="importBatch" column="import_batch" />
18
         <result property="importBatch" column="import_batch" />
16
-        <result property="sourceType" column="source_type" />        <result property="createBy"   column="create_by"   />
19
+        <result property="sourceType" column="source_type" />
20
+        <result property="createBy"   column="create_by"   />
17
         <result property="createTime" column="create_time" />
21
         <result property="createTime" column="create_time" />
18
         <result property="updateBy"   column="update_by"   />
22
         <result property="updateBy"   column="update_by"   />
19
         <result property="updateTime" column="update_time" />
23
         <result property="updateTime" column="update_time" />
20
         <result property="syncFlag" column="sync_flag" />
24
         <result property="syncFlag" column="sync_flag" />
25
+        <result property="groupName" column="group_name" />
26
+        <result property="groupId" column="group_id" />
21
     </resultMap>
27
     </resultMap>
22
 
28
 
23
     <sql id="selectVo">
29
     <sql id="selectVo">
24
-        SELECT id, approve_date,dept_name,team_name,person_name,bonus_type,add_score,evidence_file,remark,import_batch,source_type, create_by, create_time, update_by, update_time, sync_flag
30
+        SELECT id, approve_date, dept_name, dept_id, team_name, team_id, person_name, person_id, bonus_type, add_score, evidence_file, remark, import_batch, source_type, create_by, create_time, update_by, update_time, sync_flag, group_name, group_id
25
         FROM ledger_terminal_bonus
31
         FROM ledger_terminal_bonus
26
         WHERE del_flag = '0'
32
         WHERE del_flag = '0'
27
     </sql>
33
     </sql>
@@ -45,4 +51,4 @@
45
         set sync_flag = '1'
51
         set sync_flag = '1'
46
         where sync_flag = '0'
52
         where sync_flag = '0'
47
     </update>
53
     </update>
48
-</mapper>
54
+</mapper>