Sfoglia il codice sorgente

ledger_banner_letter表字段修复、相关代码修改、导入逻辑修改

wangxx 3 settimane fa
parent
commit
99ff5d6a62

+ 26 - 0
airport-ledger/src/main/java/com/sundot/airport/ledger/domain/LedgerBannerLetter.java

@@ -30,11 +30,22 @@ public class LedgerBannerLetter extends BaseEntity {
30 30
     @Excel(name = "队室/班组")
31 31
     private String teamName;
32 32
 
33
+    @Excel(name = "队室内勤")
34
+    private String teamInternalDuty;
35
+
36
+    private String groupName;
37
+
38
+    private Long groupId;
39
+
33 40
     @Excel(name = "姓名")
34 41
     private String personName;
35 42
 
36 43
     private Long personUserId;
37 44
 
45
+    private Long deptId;
46
+
47
+    private Long teamId;
48
+
38 49
     @Excel(name = "类型", readConverterExp = "1=锦旗,2=感谢信")
39 50
     private String type;
40 51
 
@@ -73,12 +84,27 @@ public class LedgerBannerLetter extends BaseEntity {
73 84
     public String getTeamName() { return teamName; }
74 85
     public void setTeamName(String teamName) { this.teamName = teamName; }
75 86
 
87
+    public String getTeamInternalDuty() { return teamInternalDuty; }
88
+    public void setTeamInternalDuty(String teamInternalDuty) { this.teamInternalDuty = teamInternalDuty; }
89
+
90
+    public String getGroupName() { return groupName; }
91
+    public void setGroupName(String groupName) { this.groupName = groupName; }
92
+
93
+    public Long getGroupId() { return groupId; }
94
+    public void setGroupId(Long groupId) { this.groupId = groupId; }
95
+
76 96
     public String getPersonName() { return personName; }
77 97
     public void setPersonName(String personName) { this.personName = personName; }
78 98
 
79 99
     public Long getPersonUserId() { return personUserId; }
80 100
     public void setPersonUserId(Long personUserId) { this.personUserId = personUserId; }
81 101
 
102
+    public Long getDeptId() { return deptId; }
103
+    public void setDeptId(Long deptId) { this.deptId = deptId; }
104
+
105
+    public Long getTeamId() { return teamId; }
106
+    public void setTeamId(Long teamId) { this.teamId = teamId; }
107
+
82 108
     public String getType() { return type; }
83 109
     public void setType(String type) { this.type = type; }
84 110
 

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

@@ -824,21 +824,37 @@ public class LedgerCombinedImportServiceImpl implements ILedgerCombinedImportSer
824 824
     }
825 825
 
826 826
     /** 15. 锦旗及感谢信 → ledger_banner_letter
827
-     * R2: 时间(0) 姓名(1) 内容(2) 类别(3) 图片附件(4) 班组(5) 队室内勤(6)
827
+     * R2: 时间(0) 姓名(1) 获得感谢信的具体内容(2) 类别(3) 图片附件(4) 班组(5) 队室内勤(6)
828 828
      * 类别: 锦旗→'1', 其他→'2'
829 829
      */
830 830
     private int doBannerLetter(Sheet sheet, String batchNo, String username) {
831 831
         List<LedgerBannerLetter> list = new ArrayList<>();
832 832
         for (Object[] c : dataRows(sheet, 2)) {
833 833
             LedgerBannerLetter o = new LedgerBannerLetter();
834
-            o.setRecordDate(date(c, 0));
835
-            o.setPersonName(str(c, 1));
836
-            o.setContentDesc(str(c, 2));
834
+            o.setRecordDate(date(c, 0));                        // 时间
835
+            String personName = str(c, 1);
836
+            o.setPersonName(personName);                         // 姓名
837
+            o.setContentDesc(str(c, 2));                        // 获得感谢信的具体内容
837 838
             String typeStr = str(c, 3);
838
-            o.setType("锦旗".equals(typeStr) ? "1" : "2");
839
-            o.setEvidenceFile(str(c, 4));
840
-            o.setTeamName(str(c, 5));
841
-            o.setRemark(str(c, 6));
839
+            o.setType("锦旗".equals(typeStr) ? "1" : "2");      // 类别
840
+            o.setEvidenceFile(str(c, 4));                        // 图片和附件
841
+            o.setTeamName(str(c, 5));                           // 班组
842
+            o.setTeamInternalDuty(str(c, 6));                    // 队室内勤
843
+            
844
+            // 根据姓名查找组织ID
845
+            if (personName != null && !personName.trim().isEmpty()) {
846
+                Map<String, Object> orgInfo = resolveOrgInfoByNameWithCache(personName);
847
+                if (!orgInfo.isEmpty()) {
848
+                    o.setPersonUserId((Long) orgInfo.get("userId"));
849
+                    o.setDeptId((Long) orgInfo.get("deptId"));
850
+                    o.setDeptName((String) orgInfo.get("deptName"));
851
+                    o.setTeamId((Long) orgInfo.get("teamId"));
852
+                    o.setTeamName((String) orgInfo.get("teamName"));
853
+                    o.setGroupId((Long) orgInfo.get("groupId"));
854
+                    o.setGroupName((String) orgInfo.get("groupName"));
855
+                }
856
+            }
857
+            
842 858
             o.setImportBatch(batchNo);
843 859
             o.setSourceType("1");
844 860
             o.setCreateBy(username);

+ 6 - 1
airport-ledger/src/main/resources/mapper/ledger/LedgerBannerLetterMapper.xml

@@ -7,6 +7,9 @@
7 7
         <result property="recordDate" column="record_date" />
8 8
         <result property="deptName" column="dept_name" />
9 9
         <result property="teamName" column="team_name" />
10
+        <result property="teamInternalDuty" column="team_internal_duty" />
11
+        <result property="groupName" column="group_name" />
12
+        <result property="groupId" column="group_id" />
10 13
         <result property="personName" column="person_name" />
11 14
         <result property="personUserId" column="person_user_id" />
12 15
         <result property="type" column="type" />
@@ -15,6 +18,8 @@
15 18
         <result property="addScore" column="add_score" />
16 19
         <result property="evidenceFile" column="evidence_file" />
17 20
         <result property="remark" column="remark" />
21
+        <result property="deptId" column="dept_id" />
22
+        <result property="teamId" column="team_id" />
18 23
         <result property="importBatch" column="import_batch" />
19 24
         <result property="sourceType" column="source_type" />
20 25
         <result property="createBy"   column="create_by"   />
@@ -25,7 +30,7 @@
25 30
     </resultMap>
26 31
 
27 32
     <sql id="selectVo">
28
-        SELECT id, record_date,dept_name,team_name,person_name,person_user_id,type,giver,content_desc,add_score,evidence_file,remark, import_batch, source_type, create_by, create_time, update_by, update_time, sync_flag
33
+        SELECT id, record_date,dept_name,team_name,team_internal_duty,group_name,group_id,person_name,person_user_id,type,giver,content_desc,add_score,evidence_file,remark, dept_id, team_id, import_batch, source_type, create_by, create_time, update_by, update_time, sync_flag
29 34
         FROM ledger_banner_letter
30 35
         WHERE del_flag = '0'
31 36
     </sql>