ソースを参照

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

wangxx 3 週間 前
コミット
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 27
     @Excel(name = "部门名称")
28 28
     private String deptName;
29 29
 
30
+    private Long deptId;
31
+
30 32
     @Excel(name = "队室/班组")
31 33
     private String teamName;
32 34
 
35
+    private Long teamId;
36
+
33 37
     @Excel(name = "姓名")
34 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 47
     @Excel(name = "加分类型")
37 48
     private String bonusType;
38 49
 
@@ -62,12 +73,27 @@ public class LedgerTerminalBonus extends BaseEntity {
62 73
     public String getDeptName() { return deptName; }
63 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 79
     public String getTeamName() { return teamName; }
66 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 85
     public String getPersonName() { return personName; }
69 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 97
     public String getBonusType() { return bonusType; }
72 98
     public void setBonusType(String bonusType) { this.bonusType = bonusType; }
73 99
 
@@ -88,4 +114,4 @@ public class LedgerTerminalBonus extends BaseEntity {
88 114
 
89 115
     public String getSyncFlag() { return syncFlag; }
90 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 868
         for (Object[] c : dataRows(sheet, 2)) {
869 869
             LedgerTerminalBonus o = new LedgerTerminalBonus();
870 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 873
             o.setTeamName(str(c, 2));
873 874
             o.setAddScore(decimal(c, 3) != null ? decimal(c, 3) : BigDecimal.ZERO);
874 875
             o.setRemark(str(c, 4));
875 876
             o.setImportBatch(batchNo);
876 877
             o.setSourceType("1");
877 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 894
             list.add(o);
879 895
         }
880 896
         terminalBonusService.batchInsert(list);

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

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