张涛 1 ano atrás
pai
commit
569a965756
35 arquivos alterados com 999 adições e 698 exclusões
  1. 86
    27
      application/src/main/java/com/lyg/application/controller/TaIncompatibleController.java
  2. 23
    7
      application/src/main/java/com/lyg/application/controller/TaMandatoryLeaveController.java
  3. 22
    2
      application/src/main/java/com/lyg/application/controller/TaRotationController.java
  4. 114
    134
      application/src/main/java/com/lyg/application/controller/UploadController.java
  5. 10
    0
      application/src/main/java/com/lyg/application/dao/EntityHandler.java
  6. 63
    85
      application/src/main/java/com/lyg/application/dao/UploadDataListener.java
  7. 0
    62
      application/src/main/java/com/lyg/application/dao/UploadDataListenerManage.java
  8. 0
    32
      application/src/main/java/com/lyg/application/dto/CustomerExcelDTO.java
  9. 0
    35
      application/src/main/java/com/lyg/application/dto/CustomerManageExcelDTO.java
  10. 1
    1
      application/src/main/java/com/lyg/application/entity/TaIncompatible.java
  11. 58
    35
      application/src/main/java/com/lyg/application/entity/TaMandatoryLeave.java
  12. 146
    107
      application/src/main/java/com/lyg/application/entity/TaRotation.java
  13. 9
    2
      application/src/main/java/com/lyg/application/mapper/TaIncompatibleMapper.java
  14. 9
    2
      application/src/main/java/com/lyg/application/service/TaIncompatibleService.java
  15. 10
    3
      application/src/main/java/com/lyg/application/service/TaRotationService.java
  16. 36
    5
      application/src/main/java/com/lyg/application/service/impl/TaIncompatibleServiceImpl.java
  17. 70
    6
      application/src/main/java/com/lyg/application/service/impl/TaMandatoryLeaveServiceImpl.java
  18. 84
    7
      application/src/main/java/com/lyg/application/service/impl/TaRotationServiceImpl.java
  19. 33
    0
      application/src/main/java/com/lyg/application/util/IncompatibleRule.java
  20. 3
    0
      application/src/main/resources/application.yml
  21. 22
    1
      application/src/main/resources/mapper/TaIncompatibleMapper.xml
  22. 0
    36
      common/src/main/java/com/lyg/common/util/excel/DownloadExcel.java
  23. 76
    0
      common/src/main/java/com/lyg/common/util/excel/LocalDateConverter.java
  24. 3
    0
      common/src/main/java/com/lyg/common/util/excel/LocalDateTimeConverter.java
  25. 7
    2
      system/src/main/java/com/lyg/system/controller/SysOrgController.java
  26. 32
    31
      system/src/main/java/com/lyg/system/controller/SysPositionController.java
  27. 28
    33
      system/src/main/java/com/lyg/system/entity/SysPosition.java
  28. 21
    24
      system/src/main/java/com/lyg/system/entity/SysUser.java
  29. 4
    0
      system/src/main/java/com/lyg/system/mapper/SysOrgMapper.java
  30. 6
    5
      system/src/main/java/com/lyg/system/mapper/SysPositionMapper.java
  31. 6
    5
      system/src/main/java/com/lyg/system/service/SysPositionService.java
  32. 4
    3
      system/src/main/java/com/lyg/system/service/impl/SysOrgServiceImpl.java
  33. 6
    5
      system/src/main/java/com/lyg/system/service/impl/SysPositionServiceImpl.java
  34. 6
    0
      system/src/main/resources/mapper/SysOrgMapper.xml
  35. 1
    1
      system/src/main/resources/mapper/SysPositionMapper.xml

+ 86
- 27
application/src/main/java/com/lyg/application/controller/TaIncompatibleController.java Ver arquivo

@@ -4,23 +4,26 @@ import cn.dev33.satoken.util.SaResult;
4 4
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
5 5
 import com.baomidou.mybatisplus.core.metadata.IPage;
6 6
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
7
-import java.util.List;
8
-import com.lyg.common.Constants;
7
+import com.lyg.application.entity.TaIncompatible;
8
+import com.lyg.application.service.TaIncompatibleService;
9 9
 import com.lyg.common.util.StringUtil;
10
+import com.lyg.framework.accesslimit.AccessLimit;
10 11
 import com.lyg.framework.log.OpLog;
11 12
 import com.lyg.system.controller.BaseController;
12
-import com.lyg.framework.accesslimit.AccessLimit;
13 13
 import io.swagger.annotations.Api;
14 14
 import io.swagger.annotations.ApiOperation;
15 15
 import io.swagger.annotations.ApiParam;
16 16
 import org.springframework.beans.factory.annotation.Autowired;
17 17
 import org.springframework.validation.annotation.Validated;
18 18
 import org.springframework.web.bind.annotation.*;
19
-import com.lyg.application.entity.TaIncompatible;
20
-import com.lyg.application.service.TaIncompatibleService;
21 19
 
22
- /**
20
+import java.util.Hashtable;
21
+import java.util.List;
22
+import java.util.Map;
23
+
24
+/**
23 25
  * 不相容;(ta_incompatible)表控制层
26
+ *
24 27
  * @author : http://njyunzhi.com
25 28
  * @date : 2024-3-6
26 29
  */
@@ -28,12 +31,13 @@ import com.lyg.application.service.TaIncompatibleService;
28 31
 @RestController
29 32
 @RequestMapping("/")
30 33
 public class TaIncompatibleController extends BaseController {
31
-    
34
+
32 35
     @Autowired
33 36
     private TaIncompatibleService taIncompatibleService;
34
-    
35
-    /** 
36
-     * 通过ID查询单条数据 
37
+
38
+
39
+    /**
40
+     * 通过ID查询单条数据
37 41
      *
38 42
      * @param id 主键
39 43
      * @return 实例对象
@@ -45,11 +49,11 @@ public class TaIncompatibleController extends BaseController {
45 49
     public SaResult queryById(@ApiParam("对象ID") @PathVariable String id) throws Exception {
46 50
         return SaResult.data(taIncompatibleService.getById(id));
47 51
     }
48
-    
49
-    /** 
52
+
53
+    /**
50 54
      * 分页查询
51 55
      *
52
-     * @param pageNum 当前页码
56
+     * @param pageNum  当前页码
53 57
      * @param pageSize 每页条数
54 58
      * @return 查询结果
55 59
      */
@@ -57,21 +61,24 @@ public class TaIncompatibleController extends BaseController {
57 61
     @AccessLimit()
58 62
     @ApiOperation("分页查询")
59 63
     @GetMapping("/taIncompatible")
60
-    public SaResult list(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
61
-                            @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
62
-                            @ApiParam("正序排列") @RequestParam(value ="sortAsc", required = false) String sortAsc,
63
-                         @ApiParam("倒序排列") @RequestParam(value ="sortDesc", defaultValue = "created_date") String sortDesc) throws Exception {
64
-        
64
+    public SaResult list(@ApiParam("页码") @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
65
+                         @ApiParam("单页数据量") @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
66
+//                         @ApiParam("原岗位") @RequestParam(value ="primaryPost", required = false) String primaryPost,
67
+//                         @ApiParam("目标岗位") @RequestParam(value ="targetPost", required = false) String targetPost,
68
+
69
+                         @ApiParam("正序排列") @RequestParam(value = "sortAsc", required = false) String sortAsc,
70
+                         @ApiParam("倒序排列") @RequestParam(value = "sortDesc", defaultValue = "create_date") String sortDesc) throws Exception {
71
+
65 72
         IPage<TaIncompatible> pg = new Page<>(pageNum, pageSize);
66 73
         QueryWrapper<TaIncompatible> queryWrapper = new QueryWrapper<>();
67 74
         queryWrapper.orderByAsc(StringUtil.isNotEmpty(sortAsc), StringUtil.humpToLine(sortAsc));
68 75
         queryWrapper.orderByDesc(StringUtil.isNotEmpty(sortDesc), StringUtil.humpToLine(sortDesc));
69 76
         IPage<TaIncompatible> result = taIncompatibleService.page(pg, queryWrapper);
70
-        
77
+
71 78
         return SaResult.data(result);
72 79
     }
73
-    
74
-    /** 
80
+
81
+    /**
75 82
      * 新增数据
76 83
      *
77 84
      * @param taIncompatible 实例对象
@@ -85,8 +92,8 @@ public class TaIncompatibleController extends BaseController {
85 92
         taIncompatibleService.save(taIncompatible);
86 93
         return SaResult.data(taIncompatible);
87 94
     }
88
-    
89
-    /** 
95
+
96
+    /**
90 97
      * 更新数据
91 98
      *
92 99
      * @param taIncompatible 实例对象
@@ -97,13 +104,13 @@ public class TaIncompatibleController extends BaseController {
97 104
     @ApiOperation("更新数据")
98 105
     @PutMapping("/taIncompatible/{id}")
99 106
     public SaResult edit(@ApiParam("对象实体") @Validated @RequestBody TaIncompatible taIncompatible,
100
-                            @ApiParam("对象ID") @PathVariable String id ) throws Exception {
107
+                         @ApiParam("对象ID") @PathVariable String id) throws Exception {
101 108
         taIncompatible.setIncompatibleId(id);
102 109
         taIncompatibleService.updateById(taIncompatible);
103 110
         return SaResult.data(taIncompatible);
104 111
     }
105
-    
106
-    /** 
112
+
113
+    /**
107 114
      * 通过主键删除数据
108 115
      *
109 116
      * @param id 主键
@@ -113,8 +120,60 @@ public class TaIncompatibleController extends BaseController {
113 120
     @AccessLimit()
114 121
     @ApiOperation("通过主键删除数据")
115 122
     @DeleteMapping("/taIncompatible/{id}")
116
-    public SaResult deleteById(@ApiParam("对象ID") @PathVariable String id){
123
+    public SaResult deleteById(@ApiParam("对象ID") @PathVariable String id) {
117 124
         taIncompatibleService.removeById(id);
118 125
         return SaResult.data("success");
119 126
     }
127
+
128
+
129
+    /**
130
+     * 分页查询
131
+     *
132
+     * @return 查询结果
133
+     */
134
+    @OpLog(module = "不相容规则查询", action = "")
135
+    @AccessLimit()
136
+    @ApiOperation("不相容规则查询")
137
+    @GetMapping("/taIncompatible/rule")
138
+    public SaResult listRule(
139
+            @ApiParam("当前时间") @RequestParam(value = "newTime", required = false) String newTime,
140
+            @ApiParam("原机构/网点") @RequestParam(value = "orgCode", required = false) String oldOrgCode,
141
+            @ApiParam("原岗位") @RequestParam(value = "primaryPost", required = false) String primaryPost,
142
+            @ApiParam("目标机构/网点") @RequestParam(value = "orgCode", required = false) String newOrgCode,
143
+            @ApiParam("目标岗位") @RequestParam(value = "targetPost", required = false) String targetPost) throws Exception {
144
+
145
+
146
+        Map<String, String> params = new Hashtable<>();
147
+        params.put("oldOrgCode", oldOrgCode);
148
+        params.put("newOrgCode", newOrgCode);
149
+        params.put("primaryPost", primaryPost);
150
+        params.put("targetPost", targetPost);
151
+        if (oldOrgCode != null && newOrgCode != null && primaryPost != null && targetPost != null && newTime != null) {
152
+
153
+            //普通规则
154
+            if (oldOrgCode.equals(newOrgCode)) {
155
+                List<TaIncompatible> taIncompatibleList = taIncompatibleService.getRegularRules(primaryPost, targetPost);
156
+
157
+                if (taIncompatibleList.size() == 0) {
158
+                   return SaResult.data("普通规则:根据不相容设置这两个岗位是相容的");
159
+                } else {
160
+                    return SaResult.data(taIncompatibleList);
161
+                }
162
+
163
+            } else {
164
+//三个月规则
165
+
166
+
167
+                taIncompatibleService.getMonthRules(params);
168
+
169
+
170
+            }
171
+        } else {
172
+            return SaResult.error("请输入岗位或机构号");
173
+        }
174
+
175
+        return null;
176
+    }
177
+
178
+
120 179
 }

+ 23
- 7
application/src/main/java/com/lyg/application/controller/TaMandatoryLeaveController.java Ver arquivo

@@ -4,20 +4,18 @@ import cn.dev33.satoken.util.SaResult;
4 4
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
5 5
 import com.baomidou.mybatisplus.core.metadata.IPage;
6 6
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
7
-import java.util.List;
8
-import com.lyg.common.Constants;
7
+import com.lyg.application.entity.TaMandatoryLeave;
8
+import com.lyg.application.service.TaMandatoryLeaveService;
9 9
 import com.lyg.common.util.StringUtil;
10
+import com.lyg.framework.accesslimit.AccessLimit;
10 11
 import com.lyg.framework.log.OpLog;
11 12
 import com.lyg.system.controller.BaseController;
12
-import com.lyg.framework.accesslimit.AccessLimit;
13 13
 import io.swagger.annotations.Api;
14 14
 import io.swagger.annotations.ApiOperation;
15 15
 import io.swagger.annotations.ApiParam;
16 16
 import org.springframework.beans.factory.annotation.Autowired;
17 17
 import org.springframework.validation.annotation.Validated;
18 18
 import org.springframework.web.bind.annotation.*;
19
-import com.lyg.application.entity.TaMandatoryLeave;
20
-import com.lyg.application.service.TaMandatoryLeaveService;
21 19
 
22 20
  /**
23 21
  * 强制休假表;(ta_mandatory_leave)表控制层
@@ -59,11 +57,29 @@ public class TaMandatoryLeaveController extends BaseController {
59 57
     @GetMapping("/taMandatoryLeave")
60 58
     public SaResult list(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
61 59
                             @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
62
-                            @ApiParam("正序排列") @RequestParam(value ="sortAsc", required = false) String sortAsc,
63
-                         @ApiParam("倒序排列") @RequestParam(value ="sortDesc", defaultValue = "created_date") String sortDesc) throws Exception {
60
+                         @ApiParam("总行部门/一级分行") @RequestParam(value ="headOfficeOrg",required = false) String headOfficeOrg,
61
+                         @ApiParam("员工工号") @RequestParam(value ="employeeNum",required = false) String employeeNum,
62
+                         @ApiParam("员工姓名") @RequestParam(value ="employeeName",required = false) String employeeName,
63
+                         @ApiParam("所在单位机构号") @RequestParam(value ="orgNum",required = false) String orgNum,
64
+                         @ApiParam("所在单位名称") @RequestParam(value ="orgName",required = false) String orgName,
65
+                         @ApiParam("对应机构层次") @RequestParam(value ="counterInstitutionsLevel",required = false) String counterInstitutionsLevel,
66
+                         @ApiParam("对应重要岗位") @RequestParam(value ="counterImpPost",required = false) String counterImpPost,
67
+                         @ApiParam("对应总行条线") @RequestParam(value ="counterHeadOfficeLine",required = false) String counterHeadOfficeLine,
68
+
69
+                         @ApiParam("正序排列") @RequestParam(value = "sortAsc", defaultValue = "create_date") String sortAsc,
70
+                         @ApiParam("倒序排列") @RequestParam(value = "sortDesc", required = false) String sortDesc
71
+    ) throws Exception {
64 72
         
65 73
         IPage<TaMandatoryLeave> pg = new Page<>(pageNum, pageSize);
66 74
         QueryWrapper<TaMandatoryLeave> queryWrapper = new QueryWrapper<>();
75
+        queryWrapper.like(StringUtil.isNotEmpty(headOfficeOrg),"head_office_org",headOfficeOrg);
76
+        queryWrapper.eq(StringUtil.isNotEmpty(employeeNum),"employee_num",employeeNum);
77
+        queryWrapper.like(StringUtil.isNotEmpty(employeeName),"employee_name",employeeName);
78
+        queryWrapper.eq(StringUtil.isNotEmpty(orgNum),"org_num",orgNum);
79
+        queryWrapper.like(StringUtil.isNotEmpty(orgName),"org_name",orgName);
80
+        queryWrapper.like(StringUtil.isNotEmpty(counterInstitutionsLevel),"counter_institutions_level",counterInstitutionsLevel);
81
+        queryWrapper.like(StringUtil.isNotEmpty(counterImpPost),"counter_imp_post",counterImpPost);
82
+        queryWrapper.like(StringUtil.isNotEmpty(counterHeadOfficeLine),"counter_head_office_line",counterHeadOfficeLine);
67 83
         queryWrapper.orderByAsc(StringUtil.isNotEmpty(sortAsc), StringUtil.humpToLine(sortAsc));
68 84
         queryWrapper.orderByDesc(StringUtil.isNotEmpty(sortDesc), StringUtil.humpToLine(sortDesc));
69 85
         IPage<TaMandatoryLeave> result = taMandatoryLeaveService.page(pg, queryWrapper);

+ 22
- 2
application/src/main/java/com/lyg/application/controller/TaRotationController.java Ver arquivo

@@ -59,11 +59,31 @@ public class TaRotationController extends BaseController {
59 59
     @GetMapping("/taRotation")
60 60
     public SaResult list(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
61 61
                             @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
62
-                            @ApiParam("正序排列") @RequestParam(value ="sortAsc", required = false) String sortAsc,
63
-                         @ApiParam("倒序排列") @RequestParam(value ="sortDesc", defaultValue = "created_date") String sortDesc) throws Exception {
62
+                         @ApiParam("总行部门/一级分行") @RequestParam(value ="headOfficeOrg",required = false) String headOfficeOrg,
63
+                         @ApiParam("员工工号") @RequestParam(value ="employeeNum",required = false) String employeeNum,
64
+                         @ApiParam("员工姓名") @RequestParam(value ="employeeName",required = false) String employeeName,
65
+                         @ApiParam("具体单位机构号") @RequestParam(value ="specificOrgNum",required = false) String specificOrgNum,
66
+                         @ApiParam("所在单位具体名称") @RequestParam(value ="specificOrgName",required = false) String specificOrgName,
67
+                         @ApiParam("对应机构层次") @RequestParam(value ="counterInstitutionsLevel",required = false) String counterInstitutionsLevel,
68
+                         @ApiParam("对应重要岗位") @RequestParam(value ="counterImpPositions",required = false) String counterImpPositions,
69
+                         @ApiParam("对应总行条线") @RequestParam(value ="counterHeadOfficeLine",required = false) String counterHeadOfficeLine,
70
+
71
+
72
+                         @ApiParam("正序排列") @RequestParam(value ="sortAsc", defaultValue = "create_date") String sortAsc,
73
+                         @ApiParam("倒序排列") @RequestParam(value ="sortDesc",required = false) String sortDesc
74
+    ) throws Exception {
64 75
         
65 76
         IPage<TaRotation> pg = new Page<>(pageNum, pageSize);
66 77
         QueryWrapper<TaRotation> queryWrapper = new QueryWrapper<>();
78
+        queryWrapper.like(StringUtil.isNotEmpty(headOfficeOrg),"head_office_org",headOfficeOrg);
79
+        queryWrapper.eq(StringUtil.isNotEmpty(employeeNum),"employee_num",employeeNum);
80
+        queryWrapper.like(StringUtil.isNotEmpty(employeeName),"employee_name",employeeName);
81
+        queryWrapper.eq(StringUtil.isNotEmpty(specificOrgNum),"specific_org_num",specificOrgNum);
82
+        queryWrapper.like(StringUtil.isNotEmpty(specificOrgName),"specific_org_name",specificOrgName);
83
+        queryWrapper.like(StringUtil.isNotEmpty(counterInstitutionsLevel),"counter_institutions_level",counterInstitutionsLevel);
84
+        queryWrapper.like(StringUtil.isNotEmpty(counterImpPositions),"counter_imp_positions",counterImpPositions);
85
+        queryWrapper.like(StringUtil.isNotEmpty(counterHeadOfficeLine),"counter_head_office_line",counterHeadOfficeLine);
86
+
67 87
         queryWrapper.orderByAsc(StringUtil.isNotEmpty(sortAsc), StringUtil.humpToLine(sortAsc));
68 88
         queryWrapper.orderByDesc(StringUtil.isNotEmpty(sortDesc), StringUtil.humpToLine(sortDesc));
69 89
         IPage<TaRotation> result = taRotationService.page(pg, queryWrapper);

+ 114
- 134
application/src/main/java/com/lyg/application/controller/UploadController.java Ver arquivo

@@ -1,134 +1,114 @@
1
-//package com.lyg.application.controller;
2
-//
3
-//import cn.dev33.satoken.util.SaResult;
4
-//import com.alibaba.excel.EasyExcel;
5
-//import com.lyg.application.dao.UploadDataListener;
6
-//import com.lyg.application.dao.UploadDataListenerManage;
7
-//import com.lyg.application.dto.CustomerExcelDTO;
8
-//import com.lyg.application.dto.CustomerManageExcelDTO;
9
-//import com.lyg.application.service.CustomerBirthdayManageService;
10
-//import com.lyg.application.service.CustomerBirthdayService;
11
-//import com.lyg.framework.accesslimit.AccessLimit;
12
-//import com.lyg.framework.log.OpLog;
13
-//import com.lyg.system.controller.BaseController;
14
-//import io.swagger.annotations.Api;
15
-//import io.swagger.annotations.ApiOperation;
16
-//import io.swagger.annotations.ApiParam;
17
-//import lombok.SneakyThrows;
18
-//import org.springframework.beans.factory.annotation.Autowired;
19
-//import org.springframework.transaction.annotation.Transactional;
20
-//import org.springframework.web.bind.annotation.*;
21
-//import org.springframework.web.multipart.MultipartFile;
22
-//
23
-//import javax.servlet.http.HttpServletResponse;
24
-//import java.io.File;
25
-//import java.io.IOException;
26
-//import java.io.InputStream;
27
-//import java.util.HashMap;
28
-//import java.util.Map;
29
-//
30
-//
31
-///**
32
-// * 客户生日维护经理表;(客户生日维护经理表)表控制层
33
-// *
34
-// * @author : http://njyunzhi.com
35
-// * @date : 2024-1-29
36
-// */
37
-//@Api(tags = "上传")
38
-//@RestController
39
-//@RequestMapping("/")
40
-//@ResponseBody
41
-//public class UploadController extends BaseController {
42
-//
43
-//
44
-//    @Autowired
45
-//    private CustomerBirthdayService customerBirthdayService;
46
-//    @Autowired
47
-//    private CustomerBirthdayManageService customerBirthdayManageService;
48
-////    @Autowired
49
-////    private CustomerBirthDAO customerBirthDAO;
50
-////
51
-////
52
-////    @Autowired
53
-////    private CustomerBirthManageDAO customerBirthManageDAO;
54
-//
55
-//
56
-//    @AccessLimit()
57
-//    @ApiOperation("上传文件")
58
-//    @PostMapping("/upload")
59
-//    public SaResult upload(@ApiParam("文件") @RequestParam("file") MultipartFile file) throws IOException {
60
-//        if (file.isEmpty()) {//检查文件是否为空
61
-//            throw new IllegalArgumentException("文件不能为空");
62
-//
63
-//        }
64
-//        try {
65
-//            InputStream inputStream = file.getInputStream();
66
-//            EasyExcel.read(inputStream, CustomerExcelDTO.class, new UploadDataListener(customerBirthdayService)).sheet(0).doReadSync();
67
-//            return SaResult.data("操作成功");
68
-//        } catch (Exception e) {
69
-//            e.printStackTrace();
70
-//            return SaResult.error("读取文件失败: " + e.getMessage());
71
-//        }
72
-//
73
-//
74
-//    }
75
-//
76
-//
77
-//    @AccessLimit()
78
-//    @ApiOperation("上传文件")
79
-//    @PostMapping("/uploadManage")
80
-//
81
-//    public SaResult uploadManage(@ApiParam("文件") @RequestParam("file") MultipartFile file) throws IOException {
82
-//        if (file.isEmpty()) {//检查文件是否为空
83
-//            new Exception("文件不能为空");
84
-//        }
85
-//        try {
86
-//            EasyExcel.read(file.getInputStream(), CustomerManageExcelDTO.class, new UploadDataListenerManage(customerBirthdayManageService)).sheet().doRead();
87
-//            return SaResult.data("操作成功");
88
-//        } catch (Exception e) {
89
-//            e.printStackTrace();
90
-//            return SaResult.error("读取文件失败: " + e.getMessage());
91
-//        }
92
-//
93
-//    }
94
-//
95
-//
96
-//    @OpLog(module = "CustomerBirthday", action = "客户生日表模板下载")
97
-//    @AccessLimit()
98
-//    @ApiOperation("CustomerBirthday")
99
-//    @GetMapping(value = "/downloadBirth")
100
-//    public SaResult downloadBirth(HttpServletResponse response) throws IOException {
101
-//        Map<String, Object> params = new HashMap<>();
102
-//        String fileName = "CustomerBirthday.xlsx";
103
-//
104
-//        File file = new File("application/src/main/resources/" + fileName);
105
-//
106
-//        params.put("fileName", fileName);
107
-//        params.put("file", file);
108
-//        return SaResult.data(params);
109
-//
110
-//
111
-//    }
112
-//
113
-//    @OpLog(module = "客户生日维护经理表", action = "客户生日维护经理表模板下载")
114
-//    @AccessLimit()
115
-//    @ApiOperation("客户生日维护经理表")
116
-//    @GetMapping(value = "/downloadBirManage")
117
-//    public SaResult downloadBirManage(HttpServletResponse response) {
118
-////        Map<String, Object> params = new HashMap<>();
119
-////
120
-////        String fileName = "/客户生日维护经理表.xlsx";
121
-////        File file = null;
122
-////        try {
123
-////            file = DownloadExcel.download(response, fileName);
124
-////
125
-////        } catch (Exception e) {
126
-////            e.printStackTrace();
127
-////        }
128
-////        params.put("fileName", fileName);
129
-////        params.put("file", file);
130
-//        return SaResult.data("");
131
-//    }
132
-//
133
-//
134
-//}
1
+package com.lyg.application.controller;
2
+
3
+import cn.dev33.satoken.util.SaResult;
4
+import com.alibaba.excel.EasyExcel;
5
+import com.lyg.application.dao.UploadDataListener;
6
+import com.lyg.application.entity.TaMandatoryLeave;
7
+import com.lyg.application.entity.TaRotation;
8
+import com.lyg.application.service.TaRotationService;
9
+import com.lyg.application.service.impl.TaMandatoryLeaveServiceImpl;
10
+import com.lyg.application.service.impl.TaRotationServiceImpl;
11
+import com.lyg.framework.accesslimit.AccessLimit;
12
+import com.lyg.system.controller.BaseController;
13
+import io.swagger.annotations.Api;
14
+import io.swagger.annotations.ApiOperation;
15
+import io.swagger.annotations.ApiParam;
16
+import org.springframework.beans.factory.annotation.Autowired;
17
+import org.springframework.web.bind.annotation.*;
18
+import org.springframework.web.multipart.MultipartFile;
19
+
20
+import java.io.IOException;
21
+import java.io.InputStream;
22
+import java.util.List;
23
+
24
+
25
+/**
26
+ * 客户生日维护经理表;(客户生日维护经理表)表控制层
27
+ *
28
+ * @author : http://njyunzhi.com
29
+ * @date : 2024-1-29
30
+ */
31
+@Api(tags = "上传")
32
+@RestController
33
+@RequestMapping("/")
34
+@ResponseBody
35
+public class UploadController extends BaseController {
36
+
37
+
38
+    @Autowired
39
+    private TaRotationService taRotationService;
40
+
41
+    @Autowired
42
+    private TaRotationServiceImpl taRotationServiceImpl;
43
+
44
+    @Autowired
45
+    private TaMandatoryLeaveServiceImpl taMandatoryLeaveServiceImpl;
46
+
47
+
48
+    @AccessLimit()
49
+    @ApiOperation("上传文件")
50
+    @PostMapping("/upload/taRotation")
51
+    public SaResult upload(@ApiParam("文件") @RequestParam("file") MultipartFile file) throws IOException {
52
+        if (file.isEmpty()) {//检查文件是否为空
53
+            throw new IllegalArgumentException("文件不能为空");
54
+
55
+        }
56
+        try {
57
+
58
+            InputStream inputStream = file.getInputStream();
59
+            UploadDataListener<TaRotation> uploadDataListener = new UploadDataListener<>(taRotationServiceImpl);
60
+            EasyExcel.read(inputStream, TaRotation.class, uploadDataListener).sheet().headRowNumber(4).doRead();
61
+
62
+            List<String> errorMessages = taRotationServiceImpl.getErrorMessages();
63
+            StringBuilder errorMessageBuilder = new StringBuilder();
64
+
65
+            for (String errorMessage : errorMessages) {
66
+                errorMessageBuilder.append(errorMessage).append("\n");
67
+            }
68
+
69
+            errorMessages.clear();
70
+            return SaResult.data("读取文件失败:" + errorMessageBuilder);
71
+
72
+
73
+        } catch (Exception e) {
74
+            e.printStackTrace();
75
+            return SaResult.error("读取文件失败: " + e.getMessage());
76
+        }
77
+
78
+    }
79
+
80
+
81
+    @AccessLimit()
82
+    @ApiOperation("上传文件")
83
+    @PostMapping("/upload/taMandatoryLeave")
84
+    public SaResult uploadLeave(@ApiParam("文件") @RequestParam("file") MultipartFile file) throws IOException {
85
+        if (file.isEmpty()) {//检查文件是否为空
86
+            throw new IllegalArgumentException("文件不能为空");
87
+
88
+        }
89
+        try {
90
+
91
+            InputStream inputStream = file.getInputStream();
92
+            UploadDataListener<TaMandatoryLeave> uploadDataListener = new UploadDataListener<>(taMandatoryLeaveServiceImpl);
93
+            EasyExcel.read(inputStream, TaMandatoryLeave.class, uploadDataListener).sheet().headRowNumber(4).doRead();
94
+
95
+            List<String> errorMessages = taMandatoryLeaveServiceImpl.getErrorMessages();
96
+            StringBuilder errorMessageBuilder = new StringBuilder();
97
+
98
+            for (String errorMessage : errorMessages) {
99
+                errorMessageBuilder.append(errorMessage).append("\n");
100
+            }
101
+
102
+            errorMessages.clear();
103
+            return SaResult.data("读取文件失败:" + errorMessageBuilder);
104
+
105
+
106
+        } catch (Exception e) {
107
+            e.printStackTrace();
108
+            return SaResult.error("读取文件失败: " + e.getMessage());
109
+        }
110
+
111
+    }
112
+
113
+
114
+}

+ 10
- 0
application/src/main/java/com/lyg/application/dao/EntityHandler.java Ver arquivo

@@ -0,0 +1,10 @@
1
+package com.lyg.application.dao;
2
+
3
+import com.lyg.application.entity.TaRotation;
4
+
5
+import java.util.List;
6
+
7
+public interface EntityHandler<T> {
8
+    T handleEntity(T entity,Integer index) throws Exception;
9
+    void saveEntityBatch(List<T> entityList);
10
+}

+ 63
- 85
application/src/main/java/com/lyg/application/dao/UploadDataListener.java Ver arquivo

@@ -1,87 +1,65 @@
1
-//package com.lyg.application.dao;
2
-//
3
-//import com.alibaba.excel.context.AnalysisContext;
4
-//import com.alibaba.excel.read.listener.ReadListener;
5
-//import com.lyg.application.dto.CustomerExcelDTO;
6
-//import com.lyg.application.service.CustomerBirthdayService;
7
-//import lombok.extern.slf4j.Slf4j;
8
-//import org.springframework.transaction.annotation.Transactional;
9
-//import org.springframework.transaction.interceptor.TransactionAspectSupport;
10
-//
11
-//import java.time.LocalDate;
12
-//import java.time.format.DateTimeFormatter;
13
-//import java.time.format.DateTimeParseException;
14
-//import java.time.temporal.ChronoField;
15
-//import java.util.ArrayList;
16
-//import java.util.List;
17
-//
18
-//@Slf4j
19
-//public class UploadDataListener implements ReadListener<CustomerExcelDTO> {
20
-//
21
-//
22
-//    private static final int BATCH_COUNT = 10;
23
-//    private final List<CustomerExcelDTO> dataList = new ArrayList<>();
24
-//
25
-//
26
-//    private final CustomerBirthdayService customerBirthdayService;
27
-//
28
-//
29
-//    public UploadDataListener(CustomerBirthdayService customerBirthdayService) {
30
-//        this.customerBirthdayService = customerBirthdayService;
1
+package com.lyg.application.dao;
2
+
3
+import com.alibaba.excel.context.AnalysisContext;
4
+import com.alibaba.excel.read.listener.ReadListener;
5
+import lombok.SneakyThrows;
6
+import lombok.extern.slf4j.Slf4j;
7
+
8
+import java.util.ArrayList;
9
+import java.util.List;
10
+
11
+@Slf4j
12
+public class UploadDataListener<T> implements ReadListener<T> {
13
+
14
+
15
+    private static final int BATCH_COUNT = 10;
16
+    final List<String> errorMessages = new ArrayList<>();
17
+    private final List<T> dataList = new ArrayList<>();
18
+    private final EntityHandler<T> entityHandler;
19
+
20
+    public UploadDataListener(EntityHandler<T> entityHandler) {
21
+        this.entityHandler = entityHandler;
22
+    }
23
+
24
+    @SneakyThrows
25
+    @Override
26
+    public void invoke(T data, AnalysisContext context) {
27
+        log.info("解析到一条数据: {}", data);
28
+        if (data == null) {
29
+            throw new RuntimeException("excel读取失败");
30
+        }
31
+        Integer index = context.readRowHolder().getRowIndex() + 1;
32
+
33
+        T processedData = entityHandler.handleEntity(data, index);
34
+        if (processedData != null) {
35
+            dataList.add(processedData);
36
+            if (dataList.size() >= BATCH_COUNT) {
37
+                saveData();
38
+            }
39
+        }
40
+
41
+
42
+    }
43
+
44
+    @Override
45
+    public void doAfterAllAnalysed(AnalysisContext context) {
46
+        saveData();
47
+        log.info("所有数据解析完成!");
48
+    }
49
+//    public List<String> getErrorMessages() {
50
+//        return errorMessages;
31 51
 //    }
32
-//
33
-//    @Override
34
-//    public void invoke(CustomerExcelDTO data, AnalysisContext context) {
35
-//        log.info("解析到一条数据:{}", data);
36
-//        if (data == null) {
37
-//            throw new RuntimeException("excel读取失败");
38
-//        }
39
-//        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
40
-//        String dateString = data.getBirth();
41
-////        try {
42
-//            LocalDate date = LocalDate.parse(dateString, formatter);
43
-//            // 检查日期是否有效
44
-//            int month = date.get(ChronoField.MONTH_OF_YEAR);
45
-//            int day = date.get(ChronoField.DAY_OF_MONTH);
46
-//            if (month < 1 || month > 12 || day < 1 || day > date.lengthOfMonth()) {
47
-////            log.error("日期错误: {}", dateString);
48
-//                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
49
-//                throw new RuntimeException("日期错误");
50
-//            }
51
-//
52
-//            if (data.getIdNum() == null||data.getName() == null||data.getCustId() == null||data.getBirth() == null) {
53
-//                throw new RuntimeException("请输入完整信息!");
54
-//            }
55
-////            if () {
56
-////                throw new RuntimeException("请输入姓名!");
57
-////            }
58
-////            if () {
59
-////                throw new RuntimeException("请输入客户号!");
60
-////            }
61
-////
62
-////            if (data.getBirth() == null) {
63
-////                throw new RuntimeException("请输入出生日期!");
64
-////            }
65
-//            dataList.add(data);
66
-//            saveData();
67
-////        } catch (DateTimeParseException e) {
68
-////            // 日期格式错误,抛出异常
69
-////            throw new RuntimeException("解析错误");
70
-////        }
52
+
53
+//    public List<T> getDataList() {
54
+//        return dataList;
71 55
 //    }
72
-//
73
-//    @Override
74
-////    @Transactional(rollbackFor = Exception.class)
75
-//    public void doAfterAllAnalysed(AnalysisContext context) {
76
-//        saveData();
77
-//        log.info("所有数据解析完成!");
78
-//    }
79
-//
80
-//    //    @Transactional(rollbackFor = Exception.class)
81
-//    public void saveData() {
82
-//        if (!dataList.isEmpty()) {
83
-//            customerBirthdayService.saveBatch(dataList);
84
-//            dataList.clear();
85
-//        }
86
-//    }
87
-//}
56
+
57
+    public void saveData() {
58
+        log.info("正在读取 {} 条数据", dataList.size());
59
+//        log.info("错误信息列表: {}", errorMessages);
60
+        if (!dataList.isEmpty()) { // 只有当数据列表不为空且没有错误信息时才保存数据
61
+            entityHandler.saveEntityBatch(dataList);
62
+            dataList.clear();
63
+        }
64
+    }
65
+}

+ 0
- 62
application/src/main/java/com/lyg/application/dao/UploadDataListenerManage.java Ver arquivo

@@ -1,62 +0,0 @@
1
-//package com.lyg.application.dao;
2
-//
3
-//import com.alibaba.excel.context.AnalysisContext;
4
-//import com.alibaba.excel.read.listener.ReadListener;
5
-//import com.lyg.application.dto.CustomerManageExcelDTO;
6
-//import com.lyg.application.service.CustomerBirthdayManageService;
7
-//import lombok.extern.slf4j.Slf4j;
8
-//import org.springframework.transaction.annotation.Transactional;
9
-//import org.springframework.transaction.interceptor.TransactionAspectSupport;
10
-//
11
-//import java.time.format.DateTimeParseException;
12
-//import java.util.ArrayList;
13
-//import java.util.List;
14
-//
15
-//@Slf4j
16
-//public class UploadDataListenerManage implements ReadListener<CustomerManageExcelDTO> {
17
-//
18
-//    private static final int BATCH_COUNT = 10;
19
-//    private final List<CustomerManageExcelDTO> dataList = new ArrayList<>();
20
-//
21
-//    //
22
-//    private final CustomerBirthdayManageService customerBirthdayManageService;
23
-//
24
-//    public UploadDataListenerManage(CustomerBirthdayManageService customerBirthdayManageService) {
25
-//        this.customerBirthdayManageService = customerBirthdayManageService;
26
-//    }
27
-//
28
-//    @Override
29
-//    public void invoke(CustomerManageExcelDTO data, AnalysisContext context) {
30
-////
31
-//        log.info("解析到一条数据:{}", data);
32
-//        if (data == null) {
33
-//            throw new RuntimeException("excel读取失败");
34
-//        }
35
-//
36
-//            if (data.getPhoneNo() == null||data.getName() == null) {
37
-//                throw new RuntimeException("请输入完整信息!");
38
-//            }
39
-//
40
-//            dataList.add(data);
41
-////            saveData();
42
-////        } catch (DateTimeParseException e) {
43
-////            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
44
-////            throw new RuntimeException("数据异常");
45
-////        }
46
-//
47
-//    }
48
-//
49
-//
50
-//    @Override
51
-//    public void doAfterAllAnalysed(AnalysisContext context) {
52
-//        saveData();
53
-//        log.info("所有数据解析完成!");
54
-//    }
55
-//
56
-//    public void saveData() {
57
-//        if (!dataList.isEmpty()) {
58
-//            customerBirthdayManageService.saveBatchManage(dataList);
59
-//            dataList.clear();
60
-//        }
61
-//    }
62
-//}

+ 0
- 32
application/src/main/java/com/lyg/application/dto/CustomerExcelDTO.java Ver arquivo

@@ -1,32 +0,0 @@
1
-//package com.lyg.application.dto;
2
-//
3
-//
4
-//import com.alibaba.excel.annotation.ExcelProperty;
5
-//import io.swagger.annotations.ApiModelProperty;
6
-//import lombok.Data;
7
-//import org.springframework.stereotype.Repository;
8
-//
9
-//@Data
10
-//@Repository
11
-//
12
-//public class CustomerExcelDTO  {
13
-//
14
-//    @ApiModelProperty(name = "客户号", notes = "")
15
-////    @TableId(value = "cust_id", type = IdType.ASSIGN_UUID)
16
-//    private String custId;
17
-//    @ExcelProperty(value = "姓名", index = 1)
18
-//    private String name;
19
-//
20
-//    @ExcelProperty(value = "身份证号", index = 2)
21
-//    private String idNum;
22
-//
23
-//    @ExcelProperty(value = "归属机构号", index = 3)
24
-//    private String brNo;
25
-//
26
-//    @ExcelProperty(value = "生日", index = 4)
27
-//    private String birth;
28
-//
29
-//    @ExcelProperty(value = "客户标志位辅助匹配客户经理", index = 5)
30
-//    private Integer custClass;
31
-//
32
-//}

+ 0
- 35
application/src/main/java/com/lyg/application/dto/CustomerManageExcelDTO.java Ver arquivo

@@ -1,35 +0,0 @@
1
-//package com.lyg.application.dto;
2
-//
3
-//
4
-//import com.alibaba.excel.annotation.ExcelProperty;
5
-//import io.swagger.annotations.ApiModelProperty;
6
-//import lombok.Data;
7
-//import org.springframework.stereotype.Repository;
8
-//
9
-//import javax.validation.constraints.NotBlank;
10
-//
11
-//@Data
12
-//@Repository
13
-//public class CustomerManageExcelDTO {
14
-//
15
-//
16
-//    @ExcelProperty(value = "归属机构", index = 0)
17
-//    @ApiModelProperty(name = "归属机构", notes = "")
18
-//    private String brNo;
19
-//
20
-//
21
-//    @ExcelProperty(value = "员工姓名", index = 1)
22
-//    @NotBlank(message = "员工姓名")
23
-//    @ApiModelProperty(name = "员工姓名", notes = "")
24
-//    private String name;
25
-//
26
-//    @ExcelProperty(value = "员工手机号", index = 2)
27
-//    @ApiModelProperty(name = "员工手机号", notes = "")
28
-//    private Integer phoneNo;
29
-//
30
-//    @ExcelProperty(value = "客户标志位辅助匹配客户经理", index = 3)
31
-//    @ApiModelProperty(name = "客户标志位辅助匹配客户经理", notes = "")
32
-//    private Integer custClass;
33
-//
34
-//
35
-//}

+ 1
- 1
application/src/main/java/com/lyg/application/entity/TaIncompatible.java Ver arquivo

@@ -32,7 +32,7 @@ public class TaIncompatible implements Serializable,Cloneable{
32 32
     @ApiModelProperty(name = "目标岗位",notes = "")
33 33
     private String targetPost ;
34 34
 
35
-    @ApiModelProperty(name = "规则",notes = "")
35
+    @ApiModelProperty(name = "规则 普通规则 regularRules,三个月规则 monthRules",notes = "")
36 36
     private String rule ;
37 37
 
38 38
     @ApiModelProperty(name = "状态",notes = "")

+ 58
- 35
application/src/main/java/com/lyg/application/entity/TaMandatoryLeave.java Ver arquivo

@@ -1,9 +1,13 @@
1 1
 package com.lyg.application.entity;
2 2
 
3
+import com.alibaba.excel.annotation.ExcelProperty;
4
+import com.alibaba.excel.annotation.format.DateTimeFormat;
5
+import com.lyg.common.util.excel.LocalDateConverter;
3 6
 import io.swagger.annotations.ApiModel;
4 7
 import io.swagger.annotations.ApiModelProperty;
5 8
 import com.baomidou.mybatisplus.annotation.*;
6 9
 import java.io.Serializable;
10
+import java.time.LocalDate;
7 11
 import java.time.LocalDateTime;
8 12
 import lombok.Data;
9 13
 import lombok.EqualsAndHashCode;
@@ -17,7 +21,7 @@ import javax.validation.constraints.NotBlank;
17 21
  */
18 22
 @Data
19 23
 @EqualsAndHashCode(callSuper = false)
20
-@Accessors(chain = true)
24
+@Accessors(chain = false)
21 25
 @ApiModel(value = "强制休假表",description = "")
22 26
 @TableName("ta_mandatory_leave")
23 27
 public class TaMandatoryLeave implements Serializable,Cloneable{
@@ -25,57 +29,76 @@ public class TaMandatoryLeave implements Serializable,Cloneable{
25 29
     @ApiModelProperty(name = "轮岗Id",notes = "")
26 30
     @TableId(value = "leave_id", type = IdType.ASSIGN_UUID)
27 31
     private String leaveId ;
28
-    
29
-    @ApiModelProperty(name = "总行部门/一级分行",notes = "")
32
+
33
+     @ExcelProperty(index = 1)
34
+     @ApiModelProperty(name = "总行部门/一级分行",notes = "")
30 35
     private String headOfficeOrg ;
31
-    
32
-    @ApiModelProperty(name = "员工工号",notes = "")
36
+
37
+     @ExcelProperty(index = 2)
38
+     @ApiModelProperty(name = "员工工号",notes = "")
33 39
     private String employeeNum ;
34
-    
35
-    @NotBlank(message = "员工姓名不能为空")
40
+
41
+     @ExcelProperty(index = 3)
42
+     @NotBlank(message = "员工姓名不能为空")
36 43
     @ApiModelProperty(name = "员工姓名",notes = "")
37 44
     private String employeeName ;
38
-    
39
-    @ApiModelProperty(name = "所在单位机构号",notes = "")
45
+
46
+     @ExcelProperty(index = 4)
47
+     @ApiModelProperty(name = "所在单位机构号",notes = "")
40 48
     private String orgNum ;
41
-    
42
-    @NotBlank(message = "所在单位名称不能为空")
49
+
50
+     @ExcelProperty(index = 5)
51
+     @NotBlank(message = "所在单位名称不能为空")
43 52
     @ApiModelProperty(name = "所在单位名称",notes = "")
44 53
     private String orgName ;
45
-    
46
-    @ApiModelProperty(name = "对应机构层次",notes = "")
54
+
55
+     @ExcelProperty(index = 6)
56
+     @ApiModelProperty(name = "对应机构层次",notes = "")
47 57
     private String counterInstitutionsLevel ;
48
-    
49
-    @ApiModelProperty(name = "当前职位",notes = "")
58
+
59
+     @ExcelProperty(index = 7)
60
+     @ApiModelProperty(name = "当前职位",notes = "")
50 61
     private String currentPosition ;
51
-    
52
-    @ApiModelProperty(name = "对应重要岗位",notes = "")
62
+
63
+     @ExcelProperty(index = 8)
64
+     @ApiModelProperty(name = "对应重要岗位",notes = "")
53 65
     private String counterImpPost ;
54
-    
55
-    @ApiModelProperty(name = "对应总行条线",notes = "")
66
+
67
+     @ExcelProperty(index = 9)
68
+     @ApiModelProperty(name = "对应总行条线",notes = "")
56 69
     private String counterHeadOfficeLine ;
57
-    
58
-    @ApiModelProperty(name = "休假起始时间 格式:年/月/日",notes = "")
59
-    private LocalDateTime startTimeVacation ;
60
-    
61
-    @ApiModelProperty(name = "休假截止时间 格式:年/月/日",notes = "")
62
-    private LocalDateTime vacationDeadline ;
63
-    
64
-    @ApiModelProperty(name = "已强制休假天数(工作日)",notes = "")
70
+
71
+     @ExcelProperty(index = 10, converter = LocalDateConverter.class)
72
+//     @DateTimeFormat("yyyy/MM/dd")
73
+     @ApiModelProperty(name = "休假起始时间 格式:年/月/日",notes = "")
74
+    private LocalDate startTimeVacation ;
75
+
76
+     @ExcelProperty(index = 11, converter = LocalDateConverter.class)
77
+//     @DateTimeFormat("yyyy/MM/dd")
78
+     @ApiModelProperty(name = "休假截止时间 格式:年/月/日",notes = "")
79
+    private LocalDate vacationDeadline ;
80
+
81
+     @ExcelProperty(index = 12)
82
+     @ApiModelProperty(name = "已强制休假天数(工作日)",notes = "")
65 83
     private Integer mandatoryVacationDay ;
66
-    
67
-    @ApiModelProperty(name = "开展离岗检查/代职检查情况",notes = "")
84
+
85
+     @ExcelProperty(index = 13)
86
+     @ApiModelProperty(name = "开展离岗检查/代职检查情况",notes = "")
68 87
     private String depSbtDepartureCheck ;
69
-    
88
+
89
+     @ExcelProperty(index = 14)
70 90
     @ApiModelProperty(name = "备注",notes = "")
71 91
     private String remark ;
72
-    
73
-    @ApiModelProperty(name = "立查立改(是/否)",notes = "")
92
+
93
+     @ExcelProperty(index = 15)
94
+     @ApiModelProperty(name = "立查立改(是/否)",notes = "")
74 95
     private String checkChange ;
75
-    
76
-    @ApiModelProperty(name = "自查自纠 (是/否)",notes = "")
96
+
97
+     @ExcelProperty(index = 16)
98
+     @ApiModelProperty(name = "自查自纠 (是/否)",notes = "")
77 99
     private String checkCorrect ;
78
-    
100
+
101
+    @ExcelProperty(index = 0)
79 102
     @ApiModelProperty(name = "序号",notes = "")
80 103
     private String sort ;
81 104
     

+ 146
- 107
application/src/main/java/com/lyg/application/entity/TaRotation.java Ver arquivo

@@ -1,133 +1,172 @@
1 1
 package com.lyg.application.entity;
2 2
 
3
+import com.alibaba.excel.annotation.ExcelProperty;
4
+import com.baomidou.mybatisplus.annotation.*;
5
+import com.lyg.common.util.excel.LocalDateConverter;
3 6
 import io.swagger.annotations.ApiModel;
4 7
 import io.swagger.annotations.ApiModelProperty;
5
-import com.baomidou.mybatisplus.annotation.*;
6
-import java.io.Serializable;
7
-import java.time.LocalDateTime;
8 8
 import lombok.Data;
9 9
 import lombok.EqualsAndHashCode;
10 10
 import lombok.experimental.Accessors;
11
+
11 12
 import javax.validation.constraints.NotBlank;
13
+import java.io.Serializable;
14
+import java.time.LocalDate;
15
+import java.time.LocalDateTime;
12 16
 
13
- /**
17
+/**
14 18
  * 轮岗列表;
19
+ *
15 20
  * @author : http://www.chiner.pro
16 21
  * @date : 2024-3-6
17 22
  */
18 23
 @Data
19 24
 @EqualsAndHashCode(callSuper = false)
20
-@Accessors(chain = true)
21
-@ApiModel(value = "轮岗列表",description = "")
25
+@Accessors(chain = false)
26
+@ApiModel(value = "轮岗列表", description = "")
22 27
 @TableName("ta_rotation")
23
-public class TaRotation implements Serializable,Cloneable{
24
-    
25
-    @ApiModelProperty(name = "轮岗Id",notes = "")
28
+public class TaRotation implements Serializable, Cloneable {
29
+
30
+    @ApiModelProperty(name = "轮岗Id", notes = "")
26 31
     @TableId(value = "rotation_id", type = IdType.ASSIGN_UUID)
27
-    private String rotationId ;
28
-    
29
-    @ApiModelProperty(name = "总行部门/一级分行",notes = "")
30
-    private String headOfficeOrg ;
31
-    
32
-    @ApiModelProperty(name = "员工工号",notes = "")
33
-    private String employeeNum ;
34
-    
32
+    private String rotationId;
33
+
34
+    @ExcelProperty(index = 0)
35
+    @ApiModelProperty(name = "序号", notes = "")
36
+    private String sort;
37
+
38
+    @ExcelProperty(index = 1)
39
+    @NotBlank(message = "总行部门不能为空")
40
+    @ApiModelProperty(name = "总行部门/一级分行", notes = "")
41
+    private String headOfficeOrg;
42
+
43
+    @ExcelProperty(index = 2)
44
+    @NotBlank(message = "员工工号不能为空")
45
+    @ApiModelProperty(name = "员工工号", notes = "")
46
+    private String employeeNum;
47
+
48
+    @ExcelProperty(index = 3)
35 49
     @NotBlank(message = "员工姓名不能为空")
36
-    @ApiModelProperty(name = "员工姓名",notes = "")
37
-    private String employeeName ;
38
-    
39
-    @ApiModelProperty(name = "具体单位机构号",notes = "")
40
-    private String specificOrgNum ;
41
-    
50
+    @ApiModelProperty(name = "员工姓名", notes = "")
51
+    private String employeeName;
52
+
53
+    @ExcelProperty(index = 4)
54
+    @NotBlank(message = "单位机构号不能为空")
55
+    @ApiModelProperty(name = "具体单位机构号", notes = "")
56
+    private String specificOrgNum;
57
+
58
+    @ExcelProperty(index = 5)
42 59
     @NotBlank(message = "所在单位具体名称不能为空")
43
-    @ApiModelProperty(name = "所在单位具体名称",notes = "")
44
-    private String specificOrgName ;
45
-    
46
-    @ApiModelProperty(name = "对应机构层次",notes = "")
47
-    private String counterInstitutionsLevel ;
48
-    
49
-    @ApiModelProperty(name = "当前职位",notes = "")
50
-    private String currentPosition ;
51
-    
52
-    @ApiModelProperty(name = "对应重要岗位",notes = "")
53
-    private String counterImpPositions ;
54
-    
55
-    @ApiModelProperty(name = "对应总行条线",notes = "")
56
-    private String counterHeadOfficeLine ;
57
-    
58
-    @ApiModelProperty(name = "从事相应重要岗位时间 格式:年/月/日",notes = "")
59
-    private LocalDateTime durationOfEmployment ;
60
-    
61
-    @ApiModelProperty(name = "轮岗周期要求(年)",notes = "")
62
-    private Integer rotationCycle ;
63
-    
64
-    @ApiModelProperty(name = "轮岗截止日期",notes = "")
65
-    private LocalDateTime rotationDeadline ;
66
-    
67
-    @ApiModelProperty(name = "对应轮岗方式",notes = "")
68
-    private String counterRotationMethod ;
69
-    
70
-    @ApiModelProperty(name = "轮岗后单位机构号",notes = "")
71
-    private String orgNumJobRotation ;
72
-    
73
-    @NotBlank(message = "轮岗后单位具体名称不能为空")
74
-    @ApiModelProperty(name = "轮岗后单位具体名称",notes = "")
75
-    private String specificNameOrgRotation ;
76
-    
77
-    @ApiModelProperty(name = "轮岗后职位",notes = "")
78
-    private String jobRotationPost ;
79
-    
80
-    @ApiModelProperty(name = "轮岗后对应重要岗位",notes = "")
81
-    private String counterImpPostRotation ;
82
-    
83
-    @ApiModelProperty(name = "轮岗后对应总行条线",notes = "")
84
-    private String counterOfficeLineRotation ;
85
-    
86
-    @ApiModelProperty(name = "轮岗执行时间 格式:年/月/",notes = "")
87
-    private LocalDateTime rotationExeTime ;
88
-    
89
-    @ApiModelProperty(name = "备注",notes = "")
90
-    private String remark ;
91
-    
92
-    @ApiModelProperty(name = "立查立改(是/否)",notes = "")
93
-    private String checkChange ;
94
-    
95
-    @ApiModelProperty(name = "是否问责",notes = "")
96
-    private String accountability ;
97
-    
98
-    @ApiModelProperty(name = "事实确认书编号",notes = "")
99
-    private String factConfirmationNum ;
100
-    
101
-    @ApiModelProperty(name = "自查自纠 (是/否)",notes = "")
102
-    private String checkCorrect ;
103
-    
104
-    @ApiModelProperty(name = "计划轮岗日期",notes = "")
105
-    private LocalDateTime planRotationDate ;
106
-    
107
-    @ApiModelProperty(name = "序号",notes = "")
108
-    private String sort ;
109
-    
110
-    @ApiModelProperty(name = "状态",notes = "")
111
-    private Integer status ;
112
-    
113
-    @ApiModelProperty(name = "创建人",notes = "")
60
+    @ApiModelProperty(name = "所在单位具体名称", notes = "")
61
+    private String specificOrgName;
62
+
63
+    @ExcelProperty(index = 6)
64
+    @ApiModelProperty(name = "对应机构层次", notes = "")
65
+    private String counterInstitutionsLevel;
66
+
67
+    @ExcelProperty(index = 7)
68
+    @ApiModelProperty(name = "当前职位", notes = "")
69
+    private String currentPosition;
70
+
71
+    @ExcelProperty(index = 8)
72
+    @ApiModelProperty(name = "对应重要岗位", notes = "")
73
+    private String counterImpPositions;
74
+
75
+    @ExcelProperty(index = 9)
76
+    @ApiModelProperty(name = "对应总行条线", notes = "")
77
+    private String counterHeadOfficeLine;
78
+
79
+    //    @DateTimeFormat("yyyy/MM/dd")
80
+    @ExcelProperty(index = 10, converter = LocalDateConverter.class)
81
+    @ApiModelProperty(name = "从事相应重要岗位时间 格式:年/月/日", notes = "")
82
+    private LocalDate durationOfEmployment;
83
+
84
+    @ExcelProperty(index = 11)
85
+    @ApiModelProperty(name = "轮岗周期要求(年)", notes = "")
86
+    private Integer rotationCycle;
87
+
88
+    //    @DateTimeFormat("yyyy/MM/dd")
89
+    @ExcelProperty(index = 12, converter = LocalDateConverter.class)
90
+    @ApiModelProperty(name = "轮岗截止日期", notes = "")
91
+    private LocalDate rotationDeadline;
92
+
93
+    @ExcelProperty(index = 13)
94
+    @ApiModelProperty(name = "对应轮岗方式", notes = "")
95
+    private String counterRotationMethod;
96
+
97
+    @ExcelProperty(index = 14)
98
+    @ApiModelProperty(name = "轮岗后单位机构号", notes = "")
99
+    private String orgNumJobRotation;
100
+
101
+    @ExcelProperty(index = 15)
102
+//    @NotBlank(message = "轮岗后单位具体名称不能为空")
103
+    @ApiModelProperty(name = "轮岗后单位具体名称", notes = "")
104
+    private String specificNameOrgRotation;
105
+
106
+    @ExcelProperty(index = 16)
107
+    @ApiModelProperty(name = "轮岗后职位", notes = "")
108
+    private String jobRotationPost;
109
+
110
+    @ExcelProperty(index = 17)
111
+    @ApiModelProperty(name = "轮岗后对应重要岗位", notes = "")
112
+    private String counterImpPostRotation;
113
+
114
+    @ExcelProperty(index = 18)
115
+    @ApiModelProperty(name = "轮岗后对应总行条线", notes = "")
116
+    private String counterOfficeLineRotation;
117
+
118
+    //    @DateTimeFormat("yyyy/MM/dd")
119
+    @ExcelProperty(index = 19, converter = LocalDateConverter.class)
120
+    @ApiModelProperty(name = "轮岗执行时间 格式:年/月/日", notes = "")
121
+    private LocalDate rotationExeTime;
122
+
123
+    @ExcelProperty(index = 20)
124
+    @ApiModelProperty(name = "备注", notes = "")
125
+    private String remark;
126
+
127
+    @ExcelProperty(index = 21)
128
+    @ApiModelProperty(name = "立查立改(是/否)", notes = "")
129
+    private String checkChange;
130
+
131
+    @ExcelProperty(index = 22)
132
+    @ApiModelProperty(name = "是否问责", notes = "")
133
+    private String accountability;
134
+
135
+    @ExcelProperty(index = 23)
136
+    @ApiModelProperty(name = "事实确认书编号", notes = "")
137
+    private String factConfirmationNum;
138
+
139
+    @ExcelProperty(index = 24)
140
+    @ApiModelProperty(name = "自查自纠(是/否)", notes = "")
141
+    private String checkCorrect;
142
+
143
+    //    @DateTimeFormat("yyyy/MM/dd")
144
+    @ExcelProperty(index = 25, converter = LocalDateConverter.class)
145
+    @ApiModelProperty(name = "计划轮岗日期", notes = "")
146
+    private LocalDate planRotationDate;
147
+
148
+
149
+    @ApiModelProperty(name = "状态", notes = "")
150
+    private Integer status;
151
+
152
+    @ApiModelProperty(name = "创建人", notes = "")
114 153
     @TableField(fill = FieldFill.INSERT)
115
-    private String createUser ;
116
-    
117
-    @ApiModelProperty(name = "创建时间",notes = "")
154
+    private String createUser;
155
+
156
+    @ApiModelProperty(name = "创建时间", notes = "")
118 157
     @TableField(fill = FieldFill.INSERT)
119
-    private LocalDateTime createDate ;
120
-    
121
-    @ApiModelProperty(name = "更新人",notes = "")
158
+    private LocalDateTime createDate;
159
+
160
+    @ApiModelProperty(name = "更新人", notes = "")
122 161
     @TableField(fill = FieldFill.INSERT_UPDATE)
123
-    private String updateUser ;
124
-    
125
-    @ApiModelProperty(name = "更新时间",notes = "")
162
+    private String updateUser;
163
+
164
+    @ApiModelProperty(name = "更新时间", notes = "")
126 165
     @TableField(fill = FieldFill.INSERT_UPDATE)
127
-    private LocalDateTime updateDate ;
128
-    
129
-    @ApiModelProperty(name = "删除标志",notes = "1删除")
166
+    private LocalDateTime updateDate;
167
+
168
+    @ApiModelProperty(name = "删除标志", notes = "1删除")
130 169
     @TableField(fill = FieldFill.INSERT)
131
-    private Integer deleted ;
170
+    private Integer deleted;
132 171
 
133 172
 }

+ 9
- 2
application/src/main/java/com/lyg/application/mapper/TaIncompatibleMapper.java Ver arquivo

@@ -5,12 +5,19 @@ import org.apache.ibatis.annotations.Mapper;
5 5
 import org.apache.ibatis.annotations.Param;
6 6
 import com.lyg.application.entity.TaIncompatible;
7 7
 
8
- /**
8
+import java.util.List;
9
+
10
+/**
9 11
  * 不相容;(ta_incompatible)表数据库访问层
10 12
  * @author : http://njyunzhi.com
11 13
  * @date : 2024-3-6
12 14
  */
13 15
 @Mapper
14 16
 public interface TaIncompatibleMapper  extends BaseMapper<TaIncompatible>{
15
-    
17
+
18
+     List<TaIncompatible> getRegularRules(@Param("oldOrgName") String oldOrgName, @Param("newOrgName") String newOrgName);
19
+
20
+    List<String> getMonthRulesPrimary(@Param("primaryPost") String primaryPost);
21
+
22
+    List<String> getMonthRulesTarget(@Param("targetPost") String targetPost);
16 23
 }

+ 9
- 2
application/src/main/java/com/lyg/application/service/TaIncompatibleService.java Ver arquivo

@@ -4,11 +4,18 @@ import com.baomidou.mybatisplus.extension.service.IService;
4 4
 import com.lyg.application.entity.TaIncompatible;
5 5
 import com.lyg.system.service.IBaseService;
6 6
 
7
- /**
7
+import java.util.List;
8
+import java.util.Map;
9
+
10
+/**
8 11
  * 不相容;(ta_incompatible)表服务接口
9 12
  * @author : http://njyunzhi.com
10 13
  * @date : 2024-3-6
11 14
  */
12 15
 public interface TaIncompatibleService extends IBaseService<TaIncompatible> {
13
-    
16
+
17
+
18
+    List<TaIncompatible> getRegularRules(String primaryPost, String targetPost);
19
+
20
+    void getMonthRules(Map<String, String> params);
14 21
 }

+ 10
- 3
application/src/main/java/com/lyg/application/service/TaRotationService.java Ver arquivo

@@ -1,14 +1,21 @@
1 1
 package com.lyg.application.service;
2 2
 
3
-import com.baomidou.mybatisplus.extension.service.IService;
4 3
 import com.lyg.application.entity.TaRotation;
5 4
 import com.lyg.system.service.IBaseService;
5
+import org.apache.poi.ss.formula.functions.T;
6 6
 
7
- /**
7
+import java.util.List;
8
+
9
+/**
8 10
  * 轮岗列表;(ta_rotation)表服务接口
11
+ *
9 12
  * @author : http://njyunzhi.com
10 13
  * @date : 2024-3-6
11 14
  */
12 15
 public interface TaRotationService extends IBaseService<TaRotation> {
13
-    
16
+
17
+//
18
+//    void handleEntity(List<T> entityList) throws Exception;
19
+//
20
+//    void saveEntityBatch(List<T> entityList);
14 21
 }

+ 36
- 5
application/src/main/java/com/lyg/application/service/impl/TaIncompatibleServiceImpl.java Ver arquivo

@@ -1,18 +1,49 @@
1 1
 package com.lyg.application.service.impl;
2 2
 
3
-import com.lyg.system.service.impl.BaseServiceImpl;
4
-import org.springframework.beans.factory.annotation.Autowired;
5
-import org.springframework.stereotype.Service;
6 3
 import com.lyg.application.entity.TaIncompatible;
7 4
 import com.lyg.application.mapper.TaIncompatibleMapper;
8 5
 import com.lyg.application.service.TaIncompatibleService;
6
+import com.lyg.application.util.IncompatibleRule;
7
+import com.lyg.system.service.impl.BaseServiceImpl;
8
+import lombok.SneakyThrows;
9
+import org.springframework.beans.factory.annotation.Autowired;
10
+import org.springframework.stereotype.Service;
11
+
12
+import java.util.ArrayList;
13
+import java.util.List;
14
+import java.util.Map;
9 15
 
10
- /**
16
+/**
11 17
  * 不相容;(ta_incompatible)表服务实现类
18
+ *
12 19
  * @author : http://www.chiner.pro
13 20
  * @date : 2024-3-6
14 21
  */
15 22
 @Service
16 23
 public class TaIncompatibleServiceImpl extends BaseServiceImpl<TaIncompatibleMapper, TaIncompatible> implements TaIncompatibleService {
17
-    
24
+    @Autowired
25
+    private IncompatibleRule incompatibleRule;
26
+
27
+//    @Override
28
+//    public List<TaIncompatible> selectRule(String oldOrgName, String newOrgName) {
29
+//        return baseMapper.selectRule(oldOrgName, newOrgName);
30
+//    }
31
+
32
+
33
+    @SneakyThrows
34
+    @Override
35
+    public List<TaIncompatible> getRegularRules(String oldOrgName, String newOrgName) {
36
+        return baseMapper.getRegularRules(oldOrgName, newOrgName);
37
+
38
+    }
39
+
40
+    @Override
41
+    public void getMonthRules(Map<String, String> params) {
42
+        String primaryPost=params.get("primaryPost");
43
+        String targetPost=params.get("targetPost");
44
+        List<String> oldPostList = baseMapper.getMonthRulesPrimary(primaryPost);//原来岗位+不容岗位
45
+        List<String> newPostList = baseMapper.getMonthRulesTarget(targetPost);//目标岗位+不容岗位
46
+
47
+
48
+    }
18 49
 }

+ 70
- 6
application/src/main/java/com/lyg/application/service/impl/TaMandatoryLeaveServiceImpl.java Ver arquivo

@@ -1,18 +1,82 @@
1 1
 package com.lyg.application.service.impl;
2 2
 
3
-import com.lyg.system.service.impl.BaseServiceImpl;
4
-import org.springframework.beans.factory.annotation.Autowired;
5
-import org.springframework.stereotype.Service;
3
+import com.lyg.application.dao.EntityHandler;
6 4
 import com.lyg.application.entity.TaMandatoryLeave;
7 5
 import com.lyg.application.mapper.TaMandatoryLeaveMapper;
8 6
 import com.lyg.application.service.TaMandatoryLeaveService;
7
+import com.lyg.system.service.SysOrgService;
8
+import com.lyg.system.service.SysPositionService;
9
+import com.lyg.system.service.impl.BaseServiceImpl;
10
+import org.springframework.beans.factory.annotation.Autowired;
11
+import org.springframework.stereotype.Service;
12
+
13
+import java.time.LocalDate;
14
+import java.util.ArrayList;
15
+import java.util.List;
9 16
 
10
- /**
17
+/**
11 18
  * 强制休假表;(ta_mandatory_leave)表服务实现类
19
+ *
12 20
  * @author : http://www.chiner.pro
13 21
  * @date : 2024-3-6
14 22
  */
15 23
 @Service
16
-public class TaMandatoryLeaveServiceImpl extends BaseServiceImpl<TaMandatoryLeaveMapper, TaMandatoryLeave> implements TaMandatoryLeaveService {
17
-    
24
+public class TaMandatoryLeaveServiceImpl extends BaseServiceImpl<TaMandatoryLeaveMapper, TaMandatoryLeave> implements TaMandatoryLeaveService, EntityHandler<TaMandatoryLeave> {
25
+    private final List<String> errorMessages = new ArrayList<>();
26
+    @Autowired
27
+    private SysOrgService sysOrgService;
28
+    @Autowired
29
+    private SysPositionService sysPositionService;
30
+
31
+    @Override
32
+    public TaMandatoryLeave handleEntity(TaMandatoryLeave entity, Integer index) throws Exception {
33
+//校验验证
34
+        System.out.println("******************************entity**************************************");
35
+        System.out.println(entity);
36
+
37
+        String orgCode = entity.getOrgNum();//单位机构号
38
+        String orgName = entity.getOrgName().replaceAll("\n", "");//单位机构名
39
+        String counterImpPost = entity.getCounterImpPost().replaceAll("\n", "");//岗位名
40
+        LocalDate durationOfEmployment = entity.getStartTimeVacation();
41
+        LocalDate vacationDeadline = entity.getVacationDeadline();
42
+
43
+        Long count = sysOrgService.countBy("org_id", orgCode, true);
44
+        if (count == 0 || orgCode.isEmpty()) {
45
+            errorMessages.add("第 " + index + " 行处理发生错误: " + "没有此机构号 " + orgCode);
46
+        }
47
+
48
+        count = sysOrgService.countBy("name", orgName, true);
49
+        if (count == 0 || orgName.isEmpty()) {
50
+            errorMessages.add("第 " + index + " 行处理发生错误: " + "没有此机构名字 " + orgName);
51
+        }
52
+
53
+        count = sysPositionService.countBy("name", counterImpPost, true);
54
+        if (count == 0) {
55
+            errorMessages.add("第 " + index + " 行处理发生错误: " + "没有此岗位 " + counterImpPost);
56
+        }
57
+
58
+        if (durationOfEmployment == null) {
59
+            errorMessages.add("第 " + index + " 行时间错误:休假起始时间为 " + durationOfEmployment);
60
+        }
61
+        if (vacationDeadline == null) {
62
+            errorMessages.add("第 " + index + " 行时间错误:休假截止时间为 " + vacationDeadline);
63
+        }
64
+
65
+        return entity;
66
+    }
67
+
68
+    @Override
69
+    public void saveEntityBatch(List<TaMandatoryLeave> entityList) {
70
+        // 实现逻辑:保存批量实体
71
+        System.out.println("******************************entityList**************************************");
72
+        System.out.println(entityList);
73
+        for (TaMandatoryLeave taMandatoryLeave : entityList) {
74
+            baseMapper.insert(taMandatoryLeave);
75
+        }
76
+    }
77
+
78
+    public List<String> getErrorMessages() {
79
+        return errorMessages;
80
+
81
+    }
18 82
 }

+ 84
- 7
application/src/main/java/com/lyg/application/service/impl/TaRotationServiceImpl.java Ver arquivo

@@ -1,18 +1,95 @@
1 1
 package com.lyg.application.service.impl;
2 2
 
3
-import com.lyg.system.service.impl.BaseServiceImpl;
4
-import org.springframework.beans.factory.annotation.Autowired;
5
-import org.springframework.stereotype.Service;
3
+import com.lyg.application.dao.EntityHandler;
6 4
 import com.lyg.application.entity.TaRotation;
7 5
 import com.lyg.application.mapper.TaRotationMapper;
8 6
 import com.lyg.application.service.TaRotationService;
7
+import com.lyg.system.service.SysOrgService;
8
+import com.lyg.system.service.SysPositionService;
9
+import com.lyg.system.service.impl.BaseServiceImpl;
10
+import org.springframework.beans.factory.annotation.Autowired;
11
+import org.springframework.stereotype.Service;
9 12
 
10
- /**
13
+import java.time.LocalDate;
14
+import java.util.ArrayList;
15
+import java.util.List;
16
+
17
+/**
11 18
  * 轮岗列表;(ta_rotation)表服务实现类
19
+ *
12 20
  * @author : http://www.chiner.pro
13 21
  * @date : 2024-3-6
14 22
  */
15 23
 @Service
16
-public class TaRotationServiceImpl extends BaseServiceImpl<TaRotationMapper, TaRotation> implements TaRotationService {
17
-    
18
-}
24
+
25
+public class TaRotationServiceImpl extends BaseServiceImpl<TaRotationMapper, TaRotation> implements TaRotationService, EntityHandler<TaRotation> {
26
+
27
+    private final List<String> errorMessages = new ArrayList<>();
28
+    @Autowired
29
+    private SysOrgService sysOrgService;
30
+    @Autowired
31
+    private SysPositionService sysPositionService;
32
+
33
+    @Override
34
+    public TaRotation handleEntity(TaRotation entity, Integer index) throws Exception {
35
+//校验验证
36
+        System.out.println("******************************entity**************************************");
37
+        System.out.println(entity);
38
+
39
+        String orgCode = entity.getSpecificOrgNum();//单位机构号
40
+        String orgName = entity.getSpecificOrgName().replaceAll("\n", "");//单位机构名
41
+        String rotationName = entity.getCounterImpPositions().replaceAll("\n", "");//岗位名
42
+        LocalDate durationOfEmployment = entity.getDurationOfEmployment();
43
+        LocalDate rotationExeTime = entity.getRotationExeTime();
44
+        LocalDate rotationDeadline = entity.getRotationDeadline();
45
+        LocalDate planRotationDate = entity.getPlanRotationDate();
46
+
47
+        Long count = sysOrgService.countBy("org_id", orgCode, true);
48
+        if (count == 0||orgCode.isEmpty()) {
49
+            errorMessages.add("第 " + index + " 行处理发生错误: " + "没有此机构号 " + orgCode);
50
+        }
51
+
52
+        count = sysOrgService.countBy("name", orgName, true);
53
+        if (count == 0||orgName.isEmpty()) {
54
+            errorMessages.add("第 " + index + " 行处理发生错误: " + "没有此机构名字 " + orgName);
55
+        }
56
+
57
+        count = sysPositionService.countBy("name", rotationName, true);
58
+        if (count == 0||rotationName.isEmpty()) {
59
+            errorMessages.add("第 " + index + " 行处理发生错误: " + "没有此岗位 " + rotationName);
60
+        }
61
+
62
+        if (durationOfEmployment == null) {
63
+            errorMessages.add("第 " + index + " 行时间错误:从事相应重要岗位时间为 " + durationOfEmployment);
64
+        }
65
+        if (rotationExeTime == null) {
66
+            errorMessages.add("第 " + index + " 行时间错误:轮岗截止日期为 " + rotationExeTime);
67
+        }
68
+        if (rotationDeadline == null) {
69
+            errorMessages.add("第 " + index + " 行时间错误:轮岗执行时间 " + rotationDeadline);
70
+        }
71
+        if (planRotationDate == null) {
72
+            errorMessages.add("第 " + index + " 行时间错误:计划轮岗日期 " + planRotationDate);
73
+        }
74
+        return entity;
75
+    }
76
+
77
+    //    @Transactional(rollbackFor = Exception.class)
78
+    @Override
79
+    public void saveEntityBatch(List<TaRotation> entityList) {
80
+        // 实现逻辑:保存批量实体
81
+        System.out.println("******************************entityList**************************************");
82
+        System.out.println(entityList);
83
+        for (TaRotation taRotation : entityList) {
84
+            baseMapper.insert(taRotation);
85
+        }
86
+    }
87
+
88
+
89
+    public List<String> getErrorMessages() {
90
+
91
+            return errorMessages;
92
+
93
+    }
94
+}
95
+

+ 33
- 0
application/src/main/java/com/lyg/application/util/IncompatibleRule.java Ver arquivo

@@ -0,0 +1,33 @@
1
+package com.lyg.application.util;
2
+
3
+
4
+import com.lyg.application.entity.TaIncompatible;
5
+import com.lyg.application.service.TaIncompatibleService;
6
+import org.springframework.beans.factory.annotation.Autowired;
7
+import org.springframework.stereotype.Component;
8
+
9
+import java.util.List;
10
+
11
+@Component
12
+public class IncompatibleRule {
13
+
14
+
15
+    /**
16
+     * 三个月规则 不同网点下轮岗 (注意录入规则)
17
+     *
18
+     * @throws Exception
19
+     */
20
+    public void timeRule(String newOrgCOde, String oldOrgCOde, String oldOrgName, String newOrgName) throws Exception {
21
+        // 时间(三 个月)  网点号   岗位名
22
+    }
23
+
24
+//    /**
25
+//     * 普通规则  同网点下轮岗 (注意录入规则)
26
+//     *
27
+//     * @throws Exception
28
+//     */
29
+//    public List<TaIncompatible>  ordinaryRule(String oldOrgName, String newOrgName) throws Exception {
30
+//
31
+////        return
32
+//    }
33
+}

+ 3
- 0
application/src/main/resources/application.yml Ver arquivo

@@ -12,6 +12,9 @@ logging:
12 12
 
13 13
 
14 14
 spring:
15
+  jackson:
16
+    date-format: yyyy-MM-dd HH:mm:ss
17
+    time-zone: GMT+8
15 18
   datasource:
16 19
     url: jdbc:oracle:thin:@192.168.89.10:1521:orcl
17 20
     username: job_waring

+ 22
- 1
application/src/main/resources/mapper/TaIncompatibleMapper.xml Ver arquivo

@@ -2,5 +2,26 @@
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 3
 
4 4
 <mapper namespace="com.lyg.application.mapper.TaIncompatibleMapper">
5
-    
5
+    <select id="getRegularRules" resultType="com.lyg.application.entity.TaIncompatible">
6
+        SELECT
7
+        *
8
+        FROM
9
+        TA_INCOMPATIBLE i
10
+        WHERE
11
+        i.PRIMARY_POST=#{oldOrgName} AND i.TARGET_POST=#{newOrgName}
12
+        AND i.DELETED=0 AND i.Rule='regularRules'
13
+    </select>
14
+
15
+    <select id="getMonthRulesPrimary" resultType="java.lang.String">
16
+        SELECT * FROM TA_INCOMPATIBLE i
17
+        WHERE
18
+        i.PRIMARY_POST=#{primaryPost}
19
+        and
20
+        i.DELETED=0
21
+        and
22
+        i.RULE='monthRules'
23
+    </select>
24
+
25
+
26
+    <select id="getMonthRulesTarget" resultType="java.lang.String"></select>
6 27
 </mapper>

+ 0
- 36
common/src/main/java/com/lyg/common/util/excel/DownloadExcel.java Ver arquivo

@@ -1,36 +0,0 @@
1
-//package com.lyg.common.util.excel;
2
-//
3
-//
4
-//import com.alibaba.excel.EasyExcel;
5
-//import org.springframework.core.io.ClassPathResource;
6
-//import org.springframework.util.ResourceUtils;
7
-//
8
-//import javax.servlet.http.HttpServletResponse;
9
-//import java.io.*;
10
-//import java.net.URLEncoder;
11
-//
12
-//public class DownloadExcel {
13
-//
14
-//    public static File download(HttpServletResponse response, String fileName) throws Exception {
15
-//
16
-//        try {
17
-//
18
-//////            ClassPathResource classPathResource = new ClassPathResource(fileName);
19
-////            File file = ResourceUtils.getFile("classpath:"+fileName);
20
-////
21
-////            return file;
22
-//
23
-//            response.setContentType("application/vnd.ms-excel");
24
-//            response.setCharacterEncoding("utf-8");
25
-//            // 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系
26
-////            String fileName = URLEncoder.encode("测试", "UTF-8");
27
-//            response.setHeader("Content-disposition", "attachment;filename=" + fileName );
28
-//            EasyExcel.write(response.getOutputStream(), DownloadData.class).sheet("模板").doWrite(data());
29
-//        } catch (Exception e) {
30
-//            throw new Exception("下载模版失败!!!" + e.getMessage());
31
-//        }
32
-//
33
-//    }
34
-//
35
-//
36
-//}

+ 76
- 0
common/src/main/java/com/lyg/common/util/excel/LocalDateConverter.java Ver arquivo

@@ -0,0 +1,76 @@
1
+package com.lyg.common.util.excel;
2
+
3
+import com.alibaba.excel.converters.Converter;
4
+import com.alibaba.excel.enums.CellDataTypeEnum;
5
+import com.alibaba.excel.metadata.GlobalConfiguration;
6
+import com.alibaba.excel.metadata.data.ReadCellData;
7
+import com.alibaba.excel.metadata.data.WriteCellData;
8
+import com.alibaba.excel.metadata.property.ExcelContentProperty;
9
+import org.apache.poi.ss.usermodel.DateUtil;
10
+import org.springframework.stereotype.Component;
11
+
12
+import java.text.SimpleDateFormat;
13
+import java.time.LocalDate;
14
+import java.time.ZoneId;
15
+import java.time.format.DateTimeFormatter;
16
+import java.util.Date;
17
+
18
+@Component
19
+public class LocalDateConverter implements Converter<LocalDate> {
20
+    @Override
21
+    public Class supportJavaTypeKey() {
22
+        return LocalDate.class;
23
+    }
24
+
25
+    @Override
26
+    public CellDataTypeEnum supportExcelTypeKey() {
27
+        return CellDataTypeEnum.STRING;
28
+    }
29
+
30
+        @Override
31
+    public LocalDate convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
32
+        if(null==cellData) {
33
+            return null;
34
+        }
35
+        LocalDate result=null;
36
+        if(cellData.getType()==CellDataTypeEnum.NUMBER) {
37
+            if (contentProperty == null || contentProperty.getDateTimeFormatProperty() == null) {
38
+                Date date= DateUtil.getJavaDate(cellData.getNumberValue().doubleValue(),
39
+                        globalConfiguration.getUse1904windowing(), null);
40
+                result =date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
41
+            } else {
42
+                Date date=  DateUtil.getJavaDate(cellData.getNumberValue().doubleValue(),
43
+                        contentProperty.getDateTimeFormatProperty().getUse1904windowing(), null);
44
+                result =date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
45
+            }
46
+        }
47
+        if(cellData.getType()==CellDataTypeEnum.STRING) {
48
+            String value=cellData.getStringValue();
49
+            if(value.contains("-")) {
50
+                try {
51
+                    result= LocalDate.parse(cellData.getStringValue());
52
+                } catch (Exception e) {
53
+                    e.printStackTrace();
54
+                }
55
+            }
56
+            else if(value.contains("/")) {
57
+                try {
58
+                    result = LocalDate.parse(value, DateTimeFormatter.ofPattern("yyyy/MM/dd"));
59
+
60
+                } catch (Exception e) {
61
+                    e.printStackTrace();
62
+                }
63
+            }
64
+        }
65
+        return result;
66
+    }
67
+
68
+
69
+
70
+    @Override
71
+    public WriteCellData<?> convertToExcelData(LocalDate value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
72
+        if (null == value) return null;
73
+        return new WriteCellData<>(value.format(DateTimeFormatter.ofPattern("yyyy/MM/dd")));
74
+    }
75
+
76
+}

+ 3
- 0
common/src/main/java/com/lyg/common/util/excel/LocalDateTimeConverter.java Ver arquivo

@@ -36,4 +36,7 @@ public class LocalDateTimeConverter implements Converter<LocalDateTime> {
36 36
 
37 37
         return new WriteCellData(val);
38 38
     }
39
+
40
+
41
+
39 42
 }

+ 7
- 2
system/src/main/java/com/lyg/system/controller/SysOrgController.java Ver arquivo

@@ -6,9 +6,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
6 6
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
7 7
 import com.lyg.common.Constants;
8 8
 import com.lyg.common.util.StringUtil;
9
+import com.lyg.framework.log.OpLog;
9 10
 import com.lyg.system.entity.SysOrg;
10 11
 import com.lyg.system.entity.SysUser;
11
-import com.lyg.framework.log.OpLog;
12 12
 import com.lyg.system.service.SysOrgService;
13 13
 import io.swagger.annotations.Api;
14 14
 import io.swagger.annotations.ApiOperation;
@@ -59,7 +59,7 @@ public class SysOrgController extends BaseController {
59 59
 
60 60
         IPage<SysOrg> pg = new Page<>(pageNum, pageSize);
61 61
         QueryWrapper<SysOrg> queryWrapper = new QueryWrapper<>();
62
-        queryWrapper.like(!StringUtil.isEmpty(name),"name", name);
62
+        queryWrapper.like(!StringUtil.isEmpty(name), "name", name);
63 63
         queryWrapper.gt("status", Constants.STATUS_DELETE);
64 64
         queryWrapper.orderByDesc("sort_no");
65 65
         IPage<SysOrg> result = sysOrgService.page(pg, queryWrapper);
@@ -89,6 +89,11 @@ public class SysOrgController extends BaseController {
89 89
         if (count > 0) {
90 90
             return SaResult.error("机构名称重复");
91 91
         }
92
+        count = sysOrgService.countBy("org_id", sysOrg.getOrgCode(), true);
93
+        if (count > 0) {
94
+            return SaResult.error("机构号重复");
95
+        }
96
+
92 97
 
93 98
         SysUser user = currentUser();
94 99
 

+ 32
- 31
system/src/main/java/com/lyg/system/controller/SysPositionController.java Ver arquivo

@@ -4,21 +4,25 @@ import cn.dev33.satoken.util.SaResult;
4 4
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
5 5
 import com.baomidou.mybatisplus.core.metadata.IPage;
6 6
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
7
+import java.util.List;
7 8
 import com.lyg.common.Constants;
8 9
 import com.lyg.common.util.StringUtil;
9
-import com.lyg.system.entity.SysPosition;
10 10
 import com.lyg.framework.log.OpLog;
11
-import com.lyg.system.service.SysPositionService;
11
+import com.lyg.system.controller.BaseController;
12
+import com.lyg.framework.accesslimit.AccessLimit;
12 13
 import io.swagger.annotations.Api;
13 14
 import io.swagger.annotations.ApiOperation;
14 15
 import io.swagger.annotations.ApiParam;
15 16
 import org.springframework.beans.factory.annotation.Autowired;
17
+import org.springframework.validation.annotation.Validated;
16 18
 import org.springframework.web.bind.annotation.*;
19
+import com.lyg.system.entity.SysPosition;
20
+import com.lyg.system.service.SysPositionService;
17 21
 
18
-/**
22
+ /**
19 23
  * 岗位表;(sys_position)表控制层
20 24
  * @author : http://njyunzhi.com
21
- * @date : 2023-1-27
25
+ * @date : 2024-3-6
22 26
  */
23 27
 @Api(tags = "岗位表对象功能接口")
24 28
 @RestController
@@ -26,8 +30,7 @@ import org.springframework.web.bind.annotation.*;
26 30
 public class SysPositionController extends BaseController {
27 31
     
28 32
     @Autowired
29
-    public SysPositionService sysPositionService;
30
-
33
+    private SysPositionService sysPositionService;
31 34
     
32 35
     /** 
33 36
      * 通过ID查询单条数据 
@@ -35,7 +38,8 @@ public class SysPositionController extends BaseController {
35 38
      * @param id 主键
36 39
      * @return 实例对象
37 40
      */
38
-    @OpLog(module = "岗位管理", action = "查询详情")
41
+    @OpLog(module = "岗位表", action = "查询单条数据", desc = "ID:{{#id}}")
42
+    @AccessLimit()
39 43
     @ApiOperation("通过ID查询单条数据")
40 44
     @GetMapping("/sysPosition/{id}")
41 45
     public SaResult queryById(@ApiParam("对象ID") @PathVariable String id) throws Exception {
@@ -49,20 +53,22 @@ public class SysPositionController extends BaseController {
49 53
      * @param pageSize 每页条数
50 54
      * @return 查询结果
51 55
      */
52
-    @OpLog(module = "岗位管理", action = "查询列表")
56
+    @OpLog(module = "岗位表", action = "分页列表查询")
57
+    @AccessLimit()
53 58
     @ApiOperation("分页查询")
54 59
     @GetMapping("/sysPosition")
55 60
     public SaResult list(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
56
-                         @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
57
-                         @ApiParam("机构") @RequestParam(value ="orgId", required = false) String orgId,
58
-                         @ApiParam("名称") @RequestParam(value ="name", required = false) String name) throws Exception {
61
+                            @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
62
+                         @ApiParam("岗位名字") @RequestParam(value ="name", required = false) String name,
59 63
 
64
+                         @ApiParam("正序排列") @RequestParam(value ="sortAsc", required = false) String sortAsc,
65
+                         @ApiParam("倒序排列") @RequestParam(value ="sortDesc", defaultValue = "create_date") String sortDesc) throws Exception {
66
+        
60 67
         IPage<SysPosition> pg = new Page<>(pageNum, pageSize);
61 68
         QueryWrapper<SysPosition> queryWrapper = new QueryWrapper<>();
62
-        queryWrapper.eq(!StringUtil.isEmpty(orgId), "org_id", orgId);
63
-        queryWrapper.like(!StringUtil.isEmpty(name), "name", name);
64
-        queryWrapper.gt("status", Constants.STATUS_DELETE);
65
-        queryWrapper.orderByDesc("create_date");
69
+        queryWrapper.like(StringUtil.isNotEmpty(name),"name",name);
70
+        queryWrapper.orderByAsc(StringUtil.isNotEmpty(sortAsc), StringUtil.humpToLine(sortAsc));
71
+        queryWrapper.orderByDesc(StringUtil.isNotEmpty(sortDesc), StringUtil.humpToLine(sortDesc));
66 72
         IPage<SysPosition> result = sysPositionService.page(pg, queryWrapper);
67 73
         
68 74
         return SaResult.data(result);
@@ -74,16 +80,13 @@ public class SysPositionController extends BaseController {
74 80
      * @param sysPosition 实例对象
75 81
      * @return 实例对象
76 82
      */
77
-    @OpLog(module = "岗位管理", action = "新增数据")
83
+    @OpLog(module = "岗位表", action = "新增数据")
84
+    @AccessLimit()
78 85
     @ApiOperation("新增数据")
79 86
     @PostMapping("/sysPosition")
80
-    public SaResult add(@ApiParam("对象实体") @RequestBody SysPosition sysPosition) throws Exception {
81
-        if (StringUtil.isEmpty(sysPosition.getOrgId())) {
82
-            return SaResult.error("未设置所属部门");
83
-        }
84
-
87
+    public SaResult add(@ApiParam("对象实体") @Validated @RequestBody SysPosition sysPosition) throws Exception {
85 88
         sysPositionService.save(sysPosition);
86
-        return SaResult.data(sysPositionService.getById(sysPosition.getPositionId()));
89
+        return SaResult.data(sysPosition);
87 90
     }
88 91
     
89 92
     /** 
@@ -92,15 +95,12 @@ public class SysPositionController extends BaseController {
92 95
      * @param sysPosition 实例对象
93 96
      * @return 实例对象
94 97
      */
95
-    @OpLog(module = "岗位管理", action = "更新数据")
98
+    @OpLog(module = "岗位表", action = "更新数据")
99
+    @AccessLimit()
96 100
     @ApiOperation("更新数据")
97 101
     @PutMapping("/sysPosition/{id}")
98
-    public SaResult edit(@ApiParam("对象实体") @RequestBody SysPosition sysPosition,
102
+    public SaResult edit(@ApiParam("对象实体") @Validated @RequestBody SysPosition sysPosition,
99 103
                             @ApiParam("对象ID") @PathVariable String id ) throws Exception {
100
-        if (StringUtil.isEmpty(sysPosition.getOrgId())) {
101
-            return SaResult.error("未设置所属部门");
102
-        }
103
-
104 104
         sysPosition.setPositionId(id);
105 105
         sysPositionService.updateById(sysPosition);
106 106
         return SaResult.data(sysPosition);
@@ -112,11 +112,12 @@ public class SysPositionController extends BaseController {
112 112
      * @param id 主键
113 113
      * @return 是否成功
114 114
      */
115
-    @OpLog(module = "岗位管理", action = "删除数据")
115
+    @OpLog(module = "岗位表", action = "删除数据", desc = "ID:{{#id}}")
116
+    @AccessLimit()
116 117
     @ApiOperation("通过主键删除数据")
117 118
     @DeleteMapping("/sysPosition/{id}")
118 119
     public SaResult deleteById(@ApiParam("对象ID") @PathVariable String id){
119
-        sysPositionService.removeLogicById(id);
120
-        return SaResult.ok("success");
120
+        sysPositionService.removeById(id);
121
+        return SaResult.data("success");
121 122
     }
122 123
 }

+ 28
- 33
system/src/main/java/com/lyg/system/entity/SysPosition.java Ver arquivo

@@ -1,54 +1,49 @@
1 1
 package com.lyg.system.entity;
2 2
 
3
-import com.baomidou.mybatisplus.annotation.*;
4 3
 import io.swagger.annotations.ApiModel;
5 4
 import io.swagger.annotations.ApiModelProperty;
5
+import com.baomidou.mybatisplus.annotation.*;
6
+import java.io.Serializable;
7
+import java.time.LocalDateTime;
6 8
 import lombok.Data;
7 9
 import lombok.EqualsAndHashCode;
8 10
 import lombok.experimental.Accessors;
9
-
10
-import java.io.Serializable;
11
-import java.time.LocalDateTime;
11
+import javax.validation.constraints.NotBlank;
12 12
 
13 13
 /**
14 14
  * 岗位表;
15
- *
16 15
  * @author : http://www.chiner.pro
17
- * @date : 2023-1-27
16
+ * @date : 2024-3-6
18 17
  */
19 18
 @Data
20 19
 @EqualsAndHashCode(callSuper = false)
21 20
 @Accessors(chain = true)
22
-@ApiModel(value = "岗位表", description = "")
21
+@ApiModel(value = "岗位表",description = "")
23 22
 @TableName("sys_position")
24
-public class SysPosition implements Serializable, Cloneable {
25
-    /**
26
-     * 岗位ID
27
-     */
28
-    @ApiModelProperty(name = "岗位ID", notes = "")
23
+public class SysPosition implements Serializable,Cloneable{
24
+
25
+    @ApiModelProperty(name = "岗位ID",notes = "")
29 26
     @TableId(value = "position_id", type = IdType.ASSIGN_UUID)
30
-    private String positionId;
31
-    /**
32
-     * 岗位名称
33
-     */
34
-    @ApiModelProperty(name = "岗位名称", notes = "")
35
-    private String name;
36
-    /**
37
-     * 所属单位
38
-     */
39
-    @ApiModelProperty(name = "所属单位", notes = "")
40
-    private String orgId;
41
-    /**
42
-     * 排序
43
-     */
44
-    @ApiModelProperty(name = "排序", notes = "")
45
-    private Integer sortNum;
46
-    /**
47
-     * 状态
48
-     */
49
-    @ApiModelProperty(name = "状态", notes = "")
50
-    private Integer status;
27
+    private String positionId ;
28
+
29
+    @ApiModelProperty(name = "岗位编码",notes = "")
30
+    private String positionCode ;
31
+
32
+    @NotBlank(message = "岗位名称不能为空")
33
+    @ApiModelProperty(name = "岗位名称",notes = "")
34
+    private String name ;
35
+
36
+    @ApiModelProperty(name = "标准码",notes = "")
37
+    private String standCode ;
38
+
39
+    @ApiModelProperty(name = "所属机构",notes = "")
40
+    private String orgId ;
41
+
42
+    @ApiModelProperty(name = "排序",notes = "")
43
+    private Integer sortNum ;
51 44
 
45
+    @ApiModelProperty(name = "状态",notes = "")
46
+    private Integer status ;
52 47
 
53 48
     @ApiModelProperty(name = "创建人",notes = "")
54 49
     @TableField(fill = FieldFill.INSERT)

+ 21
- 24
system/src/main/java/com/lyg/system/entity/SysUser.java Ver arquivo

@@ -23,6 +23,12 @@ import java.util.List;
23 23
 @ApiModel(value = "用户表", description = "")
24 24
 @TableName("sys_user")
25 25
 public class SysUser implements Serializable, Cloneable {
26
+    @ApiModelProperty(name = "角色列表", notes = "")
27
+    @TableField(exist = false)
28
+    List<SysRole> rolesList;
29
+    @ApiModelProperty(name = "菜单列表", notes = "")
30
+    @TableField(exist = false)
31
+    List<SysMenu> menuList;
26 32
     /**
27 33
      * 用户ID
28 34
      */
@@ -44,6 +50,11 @@ public class SysUser implements Serializable, Cloneable {
44 50
      */
45 51
     @ApiModelProperty(name = "手机", notes = "")
46 52
     private String phone;
53
+    /**
54
+     * 是否管理员 0否,1是
55
+     */
56
+    @ApiModelProperty(name = "是否管理员 0否,1是", notes = "")
57
+    private Integer isAdmin;
47 58
     /**
48 59
      * 行信ID
49 60
      */
@@ -64,33 +75,19 @@ public class SysUser implements Serializable, Cloneable {
64 75
      */
65 76
     @ApiModelProperty(name = "状态", notes = "")
66 77
     private Integer status;
67
-
68
-
69
-    @ApiModelProperty(name = "创建人",notes = "")
78
+    @ApiModelProperty(name = "创建人", notes = "")
70 79
     @TableField(fill = FieldFill.INSERT)
71
-    private String createUser ;
72
-
73
-    @ApiModelProperty(name = "创建时间",notes = "")
80
+    private String createUser;
81
+    @ApiModelProperty(name = "创建时间", notes = "")
74 82
     @TableField(fill = FieldFill.INSERT)
75
-    private LocalDateTime createDate ;
76
-
77
-    @ApiModelProperty(name = "更新人",notes = "")
83
+    private LocalDateTime createDate;
84
+    @ApiModelProperty(name = "更新人", notes = "")
78 85
     @TableField(fill = FieldFill.INSERT_UPDATE)
79
-    private String updateUser ;
80
-
81
-    @ApiModelProperty(name = "更新时间",notes = "")
86
+    private String updateUser;
87
+    @ApiModelProperty(name = "更新时间", notes = "")
82 88
     @TableField(fill = FieldFill.INSERT_UPDATE)
83
-    private LocalDateTime updateDate ;
84
-
85
-    @ApiModelProperty(name = "删除标志",notes = "1删除")
89
+    private LocalDateTime updateDate;
90
+    @ApiModelProperty(name = "删除标志", notes = "1删除")
86 91
     @TableField(fill = FieldFill.INSERT)
87
-    private Integer deleted ;
88
-
89
-    @ApiModelProperty(name = "角色列表", notes = "")
90
-    @TableField(exist = false)
91
-    List<SysRole> rolesList;
92
-
93
-    @ApiModelProperty(name = "菜单列表", notes = "")
94
-    @TableField(exist = false)
95
-    List<SysMenu> menuList;
92
+    private Integer deleted;
96 93
 }

+ 4
- 0
system/src/main/java/com/lyg/system/mapper/SysOrgMapper.java Ver arquivo

@@ -16,9 +16,13 @@ import java.util.List;
16 16
 @Mapper
17 17
 public interface SysOrgMapper extends BaseMapper<SysOrg> {
18 18
 
19
+
20
+    List<SysOrg> getSelectList();
21
+
19 22
     List<SysOrg> getListByUser(@Param("userId") String userId);
20 23
 
21 24
     String getMaxCode(@Param("parentId") String parentId);
22 25
 
23 26
     long changeOrgCode(@Param("from") String from, @Param("to") String to);
27
+
24 28
 }

+ 6
- 5
system/src/main/java/com/lyg/system/mapper/SysPositionMapper.java Ver arquivo

@@ -1,15 +1,16 @@
1 1
 package com.lyg.system.mapper;
2 2
 
3 3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
-import com.lyg.system.entity.SysPosition;
5 4
 import org.apache.ibatis.annotations.Mapper;
5
+import org.apache.ibatis.annotations.Param;
6
+import com.lyg.system.entity.SysPosition;
6 7
 
7
-/**
8
+ /**
8 9
  * 岗位表;(sys_position)表数据库访问层
9 10
  * @author : http://njyunzhi.com
10
- * @date : 2023-1-27
11
+ * @date : 2024-3-6
11 12
  */
12 13
 @Mapper
13
-public interface SysPositionMapper  extends BaseMapper<SysPosition> {
14
-
14
+public interface SysPositionMapper  extends BaseMapper<SysPosition>{
15
+    
15 16
 }

+ 6
- 5
system/src/main/java/com/lyg/system/service/SysPositionService.java Ver arquivo

@@ -1,13 +1,14 @@
1 1
 package com.lyg.system.service;
2 2
 
3
+import com.baomidou.mybatisplus.extension.service.IService;
3 4
 import com.lyg.system.entity.SysPosition;
5
+import com.lyg.system.service.IBaseService;
4 6
 
5
-
6
-/**
7
+ /**
7 8
  * 岗位表;(sys_position)表服务接口
8 9
  * @author : http://njyunzhi.com
9
- * @date : 2023-1-27
10
+ * @date : 2024-3-6
10 11
  */
11 12
 public interface SysPositionService extends IBaseService<SysPosition> {
12
-
13
- }
13
+    
14
+}

+ 4
- 3
system/src/main/java/com/lyg/system/service/impl/SysOrgServiceImpl.java Ver arquivo

@@ -30,9 +30,10 @@ public class SysOrgServiceImpl extends BaseServiceImpl<SysOrgMapper, SysOrg> imp
30 30
 
31 31
     @Override
32 32
     public void createNew(SysOrg sysOrg, SysUser user) {
33
-        long maxCode = getMaxCode(sysOrg.getParentId());
34
-        sysOrg.setOrgCode(String.valueOf(maxCode + 1));
35
-        sysOrg.setOrgId(null);
33
+//        long maxCode = getMaxCode(sysOrg.getParentId());
34
+//        sysOrg.setOrgCode(String.valueOf(maxCode + 1));
35
+        sysOrg.setOrgCode(sysOrg.getOrgCode());
36
+        sysOrg.setOrgId(sysOrg.getOrgCode());
36 37
         sysOrg.setStatus(Constants.STATUS_NORMAL);
37 38
 //        sysOrg.setCreateUser(user.getUserId());
38 39
 //        sysOrg.setCreateDate(LocalDateTime.now());

+ 6
- 5
system/src/main/java/com/lyg/system/service/impl/SysPositionServiceImpl.java Ver arquivo

@@ -1,17 +1,18 @@
1 1
 package com.lyg.system.service.impl;
2 2
 
3
+import com.lyg.system.service.impl.BaseServiceImpl;
4
+import org.springframework.beans.factory.annotation.Autowired;
5
+import org.springframework.stereotype.Service;
3 6
 import com.lyg.system.entity.SysPosition;
4 7
 import com.lyg.system.mapper.SysPositionMapper;
5 8
 import com.lyg.system.service.SysPositionService;
6
-import org.springframework.stereotype.Service;
7 9
 
8
-/**
10
+ /**
9 11
  * 岗位表;(sys_position)表服务实现类
10
- *
11 12
  * @author : http://www.chiner.pro
12
- * @date : 2023-1-27
13
+ * @date : 2024-3-6
13 14
  */
14 15
 @Service
15 16
 public class SysPositionServiceImpl extends BaseServiceImpl<SysPositionMapper, SysPosition> implements SysPositionService {
16
-
17
+    
17 18
 }

+ 6
- 0
system/src/main/resources/mapper/SysOrgMapper.xml Ver arquivo

@@ -28,4 +28,10 @@
28 28
             t.parent_id = #{parentId}
29 29
           AND t.status &gt; - 1
30 30
     </select>
31
+    <select id="getSelectList" resultType="com.lyg.system.entity.SysOrg">
32
+        SELECT
33
+        *
34
+        FROM
35
+        sys_org
36
+    </select>
31 37
 </mapper>

+ 1
- 1
system/src/main/resources/mapper/SysPositionMapper.xml Ver arquivo

@@ -2,5 +2,5 @@
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 3
 
4 4
 <mapper namespace="com.lyg.system.mapper.SysPositionMapper">
5
-
5
+    
6 6
 </mapper>