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

ledger_leave_special字段删除和调整、相关代码调整、一键导入功能导入模版调整调整

wangxx недель назад: 2
Родитель
Сommit
252261ef1e

+ 2 - 2
airport-admin/src/main/java/com/sundot/airport/web/controller/ledger/LedgerTemplateController.java

@@ -81,7 +81,7 @@ public class LedgerTemplateController extends BaseController {
81 81
         hm.put("securityTest", 2);
82 82
         cm.put("securityTest", new String[]{
83 83
             "开展时间","测试区域","测试通道","测试人员","测试项目","被测试人员","被测试岗位",
84
-            "测试物品","图片或视频","是否通过","层级","整改措施","","整改材料"
84
+            "测试物品","图片或视频","是否通过","层级","整改措施","整改材料"
85 85
         });
86 86
 
87 87
         // 7. 通道过检率 (横向月份列, 2行表头)
@@ -145,7 +145,7 @@ public class LedgerTemplateController extends BaseController {
145 145
         nm.put("leaveSpecial", "请、休假记录表(特殊)");
146 146
         hm.put("leaveSpecial", 2);
147 147
         cm.put("leaveSpecial", new String[]{
148
-            "姓名","班组","时间(起)","时间(止)","休假类别","天数/时长"
148
+            "姓名","时间(起)","时间(止)","休假类别","天数/时长"
149 149
         });
150 150
 
151 151
         // 15. 锦旗及感谢信 (7列)

+ 22 - 3
airport-ledger/src/main/java/com/sundot/airport/ledger/domain/LedgerLeaveSpecial.java

@@ -11,7 +11,7 @@ import com.sundot.airport.common.annotation.Excel;
11 11
 import com.sundot.airport.common.core.domain.BaseEntity;
12 12
 
13 13
 /**
14
- * 请休假记录(特殊)对象(页面录入)ledger_leave_special
14
+ * 请休假记录(特殊)对象 ledger_leave_special
15 15
  */
16 16
 @TableName("ledger_leave_special")
17 17
 public class LedgerLeaveSpecial extends BaseEntity {
@@ -23,9 +23,16 @@ public class LedgerLeaveSpecial extends BaseEntity {
23 23
     @Excel(name = "部门名称")
24 24
     private String deptName;
25 25
 
26
-    @Excel(name = "队室/班组")
26
+    private Long deptId;
27
+
27 28
     private String teamName;
28 29
 
30
+    private Long teamId;
31
+
32
+    private String groupName;
33
+
34
+    private Long groupId;
35
+
29 36
     @Excel(name = "姓名")
30 37
     private String personName;
31 38
 
@@ -65,9 +72,21 @@ public class LedgerLeaveSpecial extends BaseEntity {
65 72
     public String getDeptName() { return deptName; }
66 73
     public void setDeptName(String deptName) { this.deptName = deptName; }
67 74
 
75
+    public Long getDeptId() { return deptId; }
76
+    public void setDeptId(Long deptId) { this.deptId = deptId; }
77
+
68 78
     public String getTeamName() { return teamName; }
69 79
     public void setTeamName(String teamName) { this.teamName = teamName; }
70 80
 
81
+    public Long getTeamId() { return teamId; }
82
+    public void setTeamId(Long teamId) { this.teamId = teamId; }
83
+
84
+    public String getGroupName() { return groupName; }
85
+    public void setGroupName(String groupName) { this.groupName = groupName; }
86
+
87
+    public Long getGroupId() { return groupId; }
88
+    public void setGroupId(Long groupId) { this.groupId = groupId; }
89
+
71 90
     public String getPersonName() { return personName; }
72 91
     public void setPersonName(String personName) { this.personName = personName; }
73 92
 
@@ -100,4 +119,4 @@ public class LedgerLeaveSpecial extends BaseEntity {
100 119
 
101 120
     public String getSyncFlag() { return syncFlag; }
102 121
     public void setSyncFlag(String syncFlag) { this.syncFlag = syncFlag; }
103
-}
122
+}

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

@@ -489,7 +489,7 @@ public class LedgerCombinedImportServiceImpl implements ILedgerCombinedImportSer
489 489
     /** 6. 安保测试记录表(部门)→ ledger_security_test
490 490
      * 导入顺序:开展时间(0) 测试区域(1) 测试通道(2) 测试人员(3) 测试项目(4)
491 491
      *          被测试人员(5) 被测试岗位(6) 测试物品(7) 图片或视频(8) 是否通过(9)
492
-     *          层级(10) 整改措施(11) (12空) 整改材料(13)
492
+     *          层级(10) 整改措施(11) 整改材料(12)
493 493
      */
494 494
     private int doSecurityTest(Sheet sheet, String batchNo, String username) {
495 495
         List<LedgerSecurityTest> list = new ArrayList<>();
@@ -509,7 +509,7 @@ public class LedgerCombinedImportServiceImpl implements ILedgerCombinedImportSer
509 509
             o.setProblemDesc(str(c, 9));        // 是否通过
510 510
             o.setTestLevel(str(c, 10));          // 层级
511 511
             o.setResultHandling(str(c, 11));    // 整改措施
512
-            o.setReviewMaterial(str(c, 13));    // 整改材料
512
+            o.setReviewMaterial(str(c, 12));    // 整改材料
513 513
 
514 514
             // 使用缓存查找组织信息(根据被测人名称)
515 515
             if (testedName != null && !testedName.trim().isEmpty()) {
@@ -891,19 +891,34 @@ public class LedgerCombinedImportServiceImpl implements ILedgerCombinedImportSer
891 891
 //    }
892 892
 
893 893
     /** 14. 请、休假记录表(特殊)→ ledger_leave_special
894
-     * R2: 姓名(0) 班组(1) 时间(起)(2) 时间(止)(3) 休假类别(4) 天数/时长(5)
894
+     * R2: 姓名(0) 时间(起)(1) 时间(止)(2) 休假类别(3) 天数/时长(4)
895 895
      * 天数/时长列可能是纯数字(天)或"X小时"格式;小时值按8小时/天换算成天数
896 896
      */
897 897
     private int doLeaveSpecial(Sheet sheet, String batchNo, String username) {
898 898
         List<LedgerLeaveSpecial> list = new ArrayList<>();
899 899
         for (Object[] c : dataRows(sheet, 2)) {
900 900
             LedgerLeaveSpecial o = new LedgerLeaveSpecial();
901
-            o.setPersonName(str(c, 0));
902
-            o.setTeamName(str(c, 1));
903
-            o.setLeaveType(str(c, 4));
904
-            o.setStartDate(date(c, 2));
905
-            o.setEndDate(date(c, 3));
906
-            o.setDays(hoursOrDays(c, 5));
901
+            String personName = str(c, 0);
902
+            o.setPersonName(personName);
903
+            o.setStartDate(date(c, 1));
904
+            o.setEndDate(date(c, 2));
905
+            o.setLeaveType(str(c, 3));
906
+            o.setDays(hoursOrDays(c, 4));
907
+
908
+            // 根据姓名查找组织信息
909
+            if (personName != null && !personName.trim().isEmpty()) {
910
+                Map<String, Object> orgInfo = resolveOrgInfoByNameWithCache(personName);
911
+                if (!orgInfo.isEmpty()) {
912
+                    o.setPersonUserId((Long) orgInfo.get("userId"));
913
+                    o.setDeptId((Long) orgInfo.get("deptId"));
914
+                    o.setDeptName((String) orgInfo.get("deptName"));
915
+                    o.setTeamId((Long) orgInfo.get("teamId"));
916
+                    o.setTeamName((String) orgInfo.get("teamName"));
917
+                    o.setGroupId((Long) orgInfo.get("groupId"));
918
+                    o.setGroupName((String) orgInfo.get("groupName"));
919
+                }
920
+            }
921
+
907 922
             o.setImportBatch(batchNo);
908 923
             o.setSourceType("1");
909 924
             o.setCreateBy(username);

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

@@ -5,7 +5,11 @@
5 5
     <resultMap id="BaseResultMap" type="com.sundot.airport.ledger.domain.LedgerLeaveSpecial">
6 6
         <id property="id" column="id" />
7 7
         <result property="deptName" column="dept_name" />
8
+        <result property="deptId" column="dept_id" />
8 9
         <result property="teamName" column="team_name" />
10
+        <result property="teamId" column="team_id" />
11
+        <result property="groupName" column="group_name" />
12
+        <result property="groupId" column="group_id" />
9 13
         <result property="personName" column="person_name" />
10 14
         <result property="personUserId" column="person_user_id" />
11 15
         <result property="leaveType" column="leave_type" />
@@ -24,7 +28,10 @@
24 28
     </resultMap>
25 29
 
26 30
     <sql id="selectVo">
27
-        SELECT id, dept_name,team_name,person_name,person_user_id,leave_type,start_date,end_date,days,deduct_score,remark, import_batch, source_type, create_by, create_time, update_by, update_time, sync_flag
31
+        SELECT id, dept_name, dept_id, team_name, team_id, group_name, group_id,
32
+               person_name, person_user_id, leave_type, start_date, end_date, days,
33
+               deduct_score, remark,
34
+               import_batch, source_type, create_by, create_time, update_by, update_time, sync_flag
28 35
         FROM ledger_leave_special
29 36
         WHERE del_flag = '0'
30 37
     </sql>
@@ -36,10 +43,10 @@
36 43
         <if test="personName != null and personName != ''">AND person_name LIKE CONCAT('%', #{personName}, '%')</if>
37 44
         <if test="syncFlag != null and syncFlag != ''">AND sync_flag = #{syncFlag}</if>
38 45
         <if test="params != null and params.beginTime != null and params.beginTime != ''">
39
-            AND (record_date &gt;= #{params.beginTime} OR approve_date &gt;= #{params.beginTime} OR exam_date &gt;= #{params.beginTime})
46
+            AND record_date &gt;= #{params.beginTime}
40 47
         </if>
41 48
         <if test="params != null and params.endTime != null and params.endTime != ''">
42
-            AND (record_date &lt;= #{params.endTime} OR approve_date &lt;= #{params.endTime} OR exam_date &lt;= #{params.endTime})
49
+            AND record_date &lt;= #{params.endTime}
43 50
         </if>
44 51
         ORDER BY id DESC
45 52
     </select>
@@ -49,4 +56,4 @@
49 56
         set sync_flag = '1'
50 57
         where sync_flag = '0'
51 58
     </update>
52
-</mapper>
59
+</mapper>