张涛 1 年之前
父節點
當前提交
5249be8e74
共有 18 個檔案被更改,包括 351 行新增235 行删除
  1. 8
    6
      application/src/main/java/com/lyg/application/controller/TaIncompatibleController.java
  2. 46
    39
      application/src/main/java/com/lyg/application/controller/TaMandatoryLeaveController.java
  3. 9
    1
      application/src/main/java/com/lyg/application/controller/TaMessageController.java
  4. 10
    1
      application/src/main/java/com/lyg/application/controller/TaRotationController.java
  5. 35
    27
      application/src/main/java/com/lyg/application/controller/TaSendingController.java
  6. 10
    18
      application/src/main/java/com/lyg/application/controller/UploadController.java
  7. 1
    1
      application/src/main/java/com/lyg/application/entity/TaMessage.java
  8. 28
    0
      application/src/main/java/com/lyg/application/job/MandatoryJobTime.java
  9. 33
    0
      application/src/main/java/com/lyg/application/job/TotationJobTime.java
  10. 8
    3
      application/src/main/java/com/lyg/application/mapper/TaMandatoryLeaveMapper.java
  11. 0
    98
      application/src/main/java/com/lyg/application/schedule/TaskSchedule.java
  12. 2
    0
      application/src/main/java/com/lyg/application/service/TaMandatoryLeaveService.java
  13. 76
    0
      application/src/main/java/com/lyg/application/service/impl/TaMandatoryLeaveServiceImpl.java
  14. 58
    27
      application/src/main/java/com/lyg/application/service/impl/TaRotationServiceImpl.java
  15. 4
    1
      application/src/main/resources/application.yml
  16. 11
    1
      application/src/main/resources/mapper/TaMandatoryLeaveMapper.xml
  17. 7
    3
      application/src/main/resources/mapper/TaRotationMapper.xml
  18. 5
    9
      system/src/main/java/com/lyg/system/controller/BaseController.java

+ 8
- 6
application/src/main/java/com/lyg/application/controller/TaIncompatibleController.java 查看文件

12
 import com.lyg.framework.accesslimit.AccessLimit;
12
 import com.lyg.framework.accesslimit.AccessLimit;
13
 import com.lyg.framework.log.OpLog;
13
 import com.lyg.framework.log.OpLog;
14
 import com.lyg.system.controller.BaseController;
14
 import com.lyg.system.controller.BaseController;
15
+import com.lyg.system.entity.SysUser;
15
 import io.swagger.annotations.Api;
16
 import io.swagger.annotations.Api;
16
 import io.swagger.annotations.ApiOperation;
17
 import io.swagger.annotations.ApiOperation;
17
 import io.swagger.annotations.ApiParam;
18
 import io.swagger.annotations.ApiParam;
66
     @GetMapping("/taIncompatible")
67
     @GetMapping("/taIncompatible")
67
     public SaResult list(@ApiParam("页码") @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
68
     public SaResult list(@ApiParam("页码") @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
68
                          @ApiParam("单页数据量") @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
69
                          @ApiParam("单页数据量") @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
69
-                         @ApiParam("原岗位") @RequestParam(value ="primaryPost", required = false) String primaryPost,
70
-                         @ApiParam("目标岗位") @RequestParam(value ="targetPost", required = false) String targetPost,
71
-                         @ApiParam("规则") @RequestParam(value ="rule", required = false) String rule,
70
+                         @ApiParam("原岗位") @RequestParam(value = "primaryPost", required = false) String primaryPost,
71
+                         @ApiParam("目标岗位") @RequestParam(value = "targetPost", required = false) String targetPost,
72
+                         @ApiParam("规则") @RequestParam(value = "rule", required = false) String rule,
72
 
73
 
73
                          @ApiParam("正序排列") @RequestParam(value = "sortAsc", required = false) String sortAsc,
74
                          @ApiParam("正序排列") @RequestParam(value = "sortAsc", required = false) String sortAsc,
74
                          @ApiParam("倒序排列") @RequestParam(value = "sortDesc", defaultValue = "create_date") String sortDesc) throws Exception {
75
                          @ApiParam("倒序排列") @RequestParam(value = "sortDesc", defaultValue = "create_date") String sortDesc) throws Exception {
75
 
76
 
77
+
76
         IPage<TaIncompatible> pg = new Page<>(pageNum, pageSize);
78
         IPage<TaIncompatible> pg = new Page<>(pageNum, pageSize);
77
         QueryWrapper<TaIncompatible> queryWrapper = new QueryWrapper<>();
79
         QueryWrapper<TaIncompatible> queryWrapper = new QueryWrapper<>();
78
-        queryWrapper.eq(StringUtil.isNotEmpty(primaryPost),"primary_post",primaryPost);
79
-        queryWrapper.eq(StringUtil.isNotEmpty(targetPost),"target_post",targetPost);
80
-        queryWrapper.eq(StringUtil.isNotEmpty(rule),"rule",rule);
80
+        queryWrapper.eq(StringUtil.isNotEmpty(primaryPost), "primary_post", primaryPost);
81
+        queryWrapper.eq(StringUtil.isNotEmpty(targetPost), "target_post", targetPost);
82
+        queryWrapper.eq(StringUtil.isNotEmpty(rule), "rule", rule);
81
         queryWrapper.orderByAsc(StringUtil.isNotEmpty(sortAsc), StringUtil.humpToLine(sortAsc));
83
         queryWrapper.orderByAsc(StringUtil.isNotEmpty(sortAsc), StringUtil.humpToLine(sortAsc));
82
         queryWrapper.orderByDesc(StringUtil.isNotEmpty(sortDesc), StringUtil.humpToLine(sortDesc));
84
         queryWrapper.orderByDesc(StringUtil.isNotEmpty(sortDesc), StringUtil.humpToLine(sortDesc));
83
         IPage<TaIncompatible> result = taIncompatibleService.page(pg, queryWrapper);
85
         IPage<TaIncompatible> result = taIncompatibleService.page(pg, queryWrapper);

+ 46
- 39
application/src/main/java/com/lyg/application/controller/TaMandatoryLeaveController.java 查看文件

10
 import com.lyg.framework.accesslimit.AccessLimit;
10
 import com.lyg.framework.accesslimit.AccessLimit;
11
 import com.lyg.framework.log.OpLog;
11
 import com.lyg.framework.log.OpLog;
12
 import com.lyg.system.controller.BaseController;
12
 import com.lyg.system.controller.BaseController;
13
-import com.lyg.system.entity.SysOrg;
14
 import com.lyg.system.mapper.SysOrgMapper;
13
 import com.lyg.system.mapper.SysOrgMapper;
15
 import io.swagger.annotations.Api;
14
 import io.swagger.annotations.Api;
16
 import io.swagger.annotations.ApiOperation;
15
 import io.swagger.annotations.ApiOperation;
19
 import org.springframework.validation.annotation.Validated;
18
 import org.springframework.validation.annotation.Validated;
20
 import org.springframework.web.bind.annotation.*;
19
 import org.springframework.web.bind.annotation.*;
21
 
20
 
22
- /**
21
+/**
23
  * 强制休假表;(ta_mandatory_leave)表控制层
22
  * 强制休假表;(ta_mandatory_leave)表控制层
23
+ *
24
  * @author : http://njyunzhi.com
24
  * @author : http://njyunzhi.com
25
  * @date : 2024-3-6
25
  * @date : 2024-3-6
26
  */
26
  */
28
 @RestController
28
 @RestController
29
 @RequestMapping("/")
29
 @RequestMapping("/")
30
 public class TaMandatoryLeaveController extends BaseController {
30
 public class TaMandatoryLeaveController extends BaseController {
31
-    
31
+
32
     @Autowired
32
     @Autowired
33
     private TaMandatoryLeaveService taMandatoryLeaveService;
33
     private TaMandatoryLeaveService taMandatoryLeaveService;
34
-     @Autowired
35
-     private SysOrgMapper sysOrgMapper;
34
+    @Autowired
35
+    private SysOrgMapper sysOrgMapper;
36
 
36
 
37
 
37
 
38
-     /**
39
-     * 通过ID查询单条数据 
38
+    /**
39
+     * 通过ID查询单条数据
40
      *
40
      *
41
      * @param id 主键
41
      * @param id 主键
42
      * @return 实例对象
42
      * @return 实例对象
46
     @ApiOperation("通过ID查询单条数据")
46
     @ApiOperation("通过ID查询单条数据")
47
     @GetMapping("/taMandatoryLeave/{id}")
47
     @GetMapping("/taMandatoryLeave/{id}")
48
     public SaResult queryById(@ApiParam("对象ID") @PathVariable String id) throws Exception {
48
     public SaResult queryById(@ApiParam("对象ID") @PathVariable String id) throws Exception {
49
-        return SaResult.data(taMandatoryLeaveService.getById(id));
49
+        TaMandatoryLeave taMandatoryLeave = taMandatoryLeaveService.getById(id);
50
+        Boolean b = checkAuth() == null || checkAuth() == taMandatoryLeave.getCreateUser();
51
+
52
+        if (b) {
53
+            return SaResult.data(taMandatoryLeaveService.getById(id));
54
+        }
55
+        return SaResult.error("无权限");
50
     }
56
     }
51
-    
52
-    /** 
57
+
58
+    /**
53
      * 分页查询
59
      * 分页查询
54
      *
60
      *
55
-     * @param pageNum 当前页码
61
+     * @param pageNum  当前页码
56
      * @param pageSize 每页条数
62
      * @param pageSize 每页条数
57
      * @return 查询结果
63
      * @return 查询结果
58
      */
64
      */
60
     @AccessLimit()
66
     @AccessLimit()
61
     @ApiOperation("分页查询")
67
     @ApiOperation("分页查询")
62
     @GetMapping("/taMandatoryLeave")
68
     @GetMapping("/taMandatoryLeave")
63
-    public SaResult list(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
64
-                            @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
65
-                         @ApiParam("总行部门/一级分行") @RequestParam(value ="headOfficeOrg",required = false) String headOfficeOrg,
66
-                         @ApiParam("员工工号") @RequestParam(value ="employeeNum",required = false) String employeeNum,
67
-                         @ApiParam("员工姓名") @RequestParam(value ="employeeName",required = false) String employeeName,
68
-                         @ApiParam("所在单位机构号") @RequestParam(value ="orgNum",required = false) String orgNum,
69
-                         @ApiParam("所在单位名称") @RequestParam(value ="orgName",required = false) String orgName,
70
-                         @ApiParam("对应机构层次") @RequestParam(value ="counterInstitutionsLevel",required = false) String counterInstitutionsLevel,
71
-                         @ApiParam("对应重要岗位") @RequestParam(value ="counterImpPost",required = false) String counterImpPost,
72
-                         @ApiParam("对应总行条线") @RequestParam(value ="counterHeadOfficeLine",required = false) String counterHeadOfficeLine,
69
+    public SaResult list(@ApiParam("页码") @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
70
+                         @ApiParam("单页数据量") @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
71
+                         @ApiParam("总行部门/一级分行") @RequestParam(value = "headOfficeOrg", required = false) String headOfficeOrg,
72
+                         @ApiParam("员工工号") @RequestParam(value = "employeeNum", required = false) String employeeNum,
73
+                         @ApiParam("员工姓名") @RequestParam(value = "employeeName", required = false) String employeeName,
74
+                         @ApiParam("所在单位机构号") @RequestParam(value = "orgNum", required = false) String orgNum,
75
+                         @ApiParam("所在单位名称") @RequestParam(value = "orgName", required = false) String orgName,
76
+                         @ApiParam("对应机构层次") @RequestParam(value = "counterInstitutionsLevel", required = false) String counterInstitutionsLevel,
77
+                         @ApiParam("对应重要岗位") @RequestParam(value = "counterImpPost", required = false) String counterImpPost,
78
+                         @ApiParam("对应总行条线") @RequestParam(value = "counterHeadOfficeLine", required = false) String counterHeadOfficeLine,
73
 
79
 
74
                          @ApiParam("正序排列") @RequestParam(value = "sortAsc", defaultValue = "create_date") String sortAsc,
80
                          @ApiParam("正序排列") @RequestParam(value = "sortAsc", defaultValue = "create_date") String sortAsc,
75
                          @ApiParam("倒序排列") @RequestParam(value = "sortDesc", required = false) String sortDesc
81
                          @ApiParam("倒序排列") @RequestParam(value = "sortDesc", required = false) String sortDesc
76
     ) throws Exception {
82
     ) throws Exception {
77
-        
83
+
78
         IPage<TaMandatoryLeave> pg = new Page<>(pageNum, pageSize);
84
         IPage<TaMandatoryLeave> pg = new Page<>(pageNum, pageSize);
79
         QueryWrapper<TaMandatoryLeave> queryWrapper = new QueryWrapper<>();
85
         QueryWrapper<TaMandatoryLeave> queryWrapper = new QueryWrapper<>();
80
-        queryWrapper.like(StringUtil.isNotEmpty(headOfficeOrg),"head_office_org",headOfficeOrg);
81
-        queryWrapper.eq(StringUtil.isNotEmpty(employeeNum),"employee_num",employeeNum);
82
-        queryWrapper.like(StringUtil.isNotEmpty(employeeName),"employee_name",employeeName);
83
-        queryWrapper.eq(StringUtil.isNotEmpty(orgNum),"org_num",orgNum);
84
-        queryWrapper.like(StringUtil.isNotEmpty(orgName),"org_name",orgName);
85
-        queryWrapper.like(StringUtil.isNotEmpty(counterInstitutionsLevel),"counter_institutions_level",counterInstitutionsLevel);
86
-        queryWrapper.like(StringUtil.isNotEmpty(counterImpPost),"counter_imp_post",counterImpPost);
87
-        queryWrapper.like(StringUtil.isNotEmpty(counterHeadOfficeLine),"counter_head_office_line",counterHeadOfficeLine);
86
+        queryWrapper.eq(StringUtil.isNotEmpty(checkAuth()), "CREATE_USER", checkAuth());
87
+        queryWrapper.like(StringUtil.isNotEmpty(headOfficeOrg), "head_office_org", headOfficeOrg);
88
+        queryWrapper.eq(StringUtil.isNotEmpty(employeeNum), "employee_num", employeeNum);
89
+        queryWrapper.like(StringUtil.isNotEmpty(employeeName), "employee_name", employeeName);
90
+        queryWrapper.eq(StringUtil.isNotEmpty(orgNum), "org_num", orgNum);
91
+        queryWrapper.like(StringUtil.isNotEmpty(orgName), "org_name", orgName);
92
+        queryWrapper.like(StringUtil.isNotEmpty(counterInstitutionsLevel), "counter_institutions_level", counterInstitutionsLevel);
93
+        queryWrapper.like(StringUtil.isNotEmpty(counterImpPost), "counter_imp_post", counterImpPost);
94
+        queryWrapper.like(StringUtil.isNotEmpty(counterHeadOfficeLine), "counter_head_office_line", counterHeadOfficeLine);
88
         queryWrapper.orderByAsc(StringUtil.isNotEmpty(sortAsc), StringUtil.humpToLine(sortAsc));
95
         queryWrapper.orderByAsc(StringUtil.isNotEmpty(sortAsc), StringUtil.humpToLine(sortAsc));
89
         queryWrapper.orderByDesc(StringUtil.isNotEmpty(sortDesc), StringUtil.humpToLine(sortDesc));
96
         queryWrapper.orderByDesc(StringUtil.isNotEmpty(sortDesc), StringUtil.humpToLine(sortDesc));
90
         IPage<TaMandatoryLeave> result = taMandatoryLeaveService.page(pg, queryWrapper);
97
         IPage<TaMandatoryLeave> result = taMandatoryLeaveService.page(pg, queryWrapper);
91
-        
98
+
92
         return SaResult.data(result);
99
         return SaResult.data(result);
93
     }
100
     }
94
-    
95
-    /** 
101
+
102
+    /**
96
      * 新增数据
103
      * 新增数据
97
      *
104
      *
98
      * @param taMandatoryLeave 实例对象
105
      * @param taMandatoryLeave 实例对象
106
         taMandatoryLeaveService.save(taMandatoryLeave);
113
         taMandatoryLeaveService.save(taMandatoryLeave);
107
         return SaResult.data(taMandatoryLeave);
114
         return SaResult.data(taMandatoryLeave);
108
     }
115
     }
109
-    
110
-    /** 
116
+
117
+    /**
111
      * 更新数据
118
      * 更新数据
112
      *
119
      *
113
      * @param taMandatoryLeave 实例对象
120
      * @param taMandatoryLeave 实例对象
118
     @ApiOperation("更新数据")
125
     @ApiOperation("更新数据")
119
     @PutMapping("/taMandatoryLeave/{id}")
126
     @PutMapping("/taMandatoryLeave/{id}")
120
     public SaResult edit(@ApiParam("对象实体") @Validated @RequestBody TaMandatoryLeave taMandatoryLeave,
127
     public SaResult edit(@ApiParam("对象实体") @Validated @RequestBody TaMandatoryLeave taMandatoryLeave,
121
-                            @ApiParam("对象ID") @PathVariable String id ) throws Exception {
128
+                         @ApiParam("对象ID") @PathVariable String id) throws Exception {
122
         taMandatoryLeaveService.updateById(taMandatoryLeave);
129
         taMandatoryLeaveService.updateById(taMandatoryLeave);
123
         return SaResult.data(taMandatoryLeave);
130
         return SaResult.data(taMandatoryLeave);
124
     }
131
     }
125
-    
126
-    /** 
132
+
133
+    /**
127
      * 通过主键删除数据
134
      * 通过主键删除数据
128
      *
135
      *
129
      * @param id 主键
136
      * @param id 主键
133
     @AccessLimit()
140
     @AccessLimit()
134
     @ApiOperation("通过主键删除数据")
141
     @ApiOperation("通过主键删除数据")
135
     @DeleteMapping("/taMandatoryLeave/{id}")
142
     @DeleteMapping("/taMandatoryLeave/{id}")
136
-    public SaResult deleteById(@ApiParam("对象ID") @PathVariable String id){
143
+    public SaResult deleteById(@ApiParam("对象ID") @PathVariable String id) {
137
         taMandatoryLeaveService.removeById(id);
144
         taMandatoryLeaveService.removeById(id);
138
         return SaResult.data("success");
145
         return SaResult.data("success");
139
     }
146
     }

+ 9
- 1
application/src/main/java/com/lyg/application/controller/TaMessageController.java 查看文件

42
     @ApiOperation("通过ID查询单条数据")
42
     @ApiOperation("通过ID查询单条数据")
43
     @GetMapping("/taMessage/{id}")
43
     @GetMapping("/taMessage/{id}")
44
     public SaResult queryById(@ApiParam("对象ID") @PathVariable String id) throws Exception {
44
     public SaResult queryById(@ApiParam("对象ID") @PathVariable String id) throws Exception {
45
-        return SaResult.data(taMessageService.getById(id));
45
+        TaMessage taMessage = taMessageService.getById(id);
46
+
47
+        Boolean b = checkAuth() == null || checkAuth() == taMessage.getCreateUser();
48
+
49
+        if (b) {
50
+            SaResult.data(taMessageService.getById(id));
51
+        }
52
+        return SaResult.error("无权限");
46
     }
53
     }
47
 
54
 
48
     /**
55
     /**
63
 
70
 
64
         IPage<TaMessage> pg = new Page<>(pageNum, pageSize);
71
         IPage<TaMessage> pg = new Page<>(pageNum, pageSize);
65
         QueryWrapper<TaMessage> queryWrapper = new QueryWrapper<>();
72
         QueryWrapper<TaMessage> queryWrapper = new QueryWrapper<>();
73
+        queryWrapper.eq(StringUtil.isNotEmpty(checkAuth()), "CREATE_USER", checkAuth());
66
         queryWrapper.orderByAsc(StringUtil.isNotEmpty(sortAsc), StringUtil.humpToLine(sortAsc));
74
         queryWrapper.orderByAsc(StringUtil.isNotEmpty(sortAsc), StringUtil.humpToLine(sortAsc));
67
         queryWrapper.orderByDesc(StringUtil.isNotEmpty(sortDesc), StringUtil.humpToLine(sortDesc));
75
         queryWrapper.orderByDesc(StringUtil.isNotEmpty(sortDesc), StringUtil.humpToLine(sortDesc));
68
         IPage<TaMessage> result = taMessageService.page(pg, queryWrapper);
76
         IPage<TaMessage> result = taMessageService.page(pg, queryWrapper);

+ 10
- 1
application/src/main/java/com/lyg/application/controller/TaRotationController.java 查看文件

50
     @ApiOperation("通过ID查询单条数据")
50
     @ApiOperation("通过ID查询单条数据")
51
     @GetMapping("/taRotation/{id}")
51
     @GetMapping("/taRotation/{id}")
52
     public SaResult queryById(@ApiParam("对象ID") @PathVariable String id) throws Exception {
52
     public SaResult queryById(@ApiParam("对象ID") @PathVariable String id) throws Exception {
53
-        return SaResult.data(taRotationService.getById(id));
53
+
54
+        TaRotation taRotation = taRotationService.getById(id);
55
+
56
+        Boolean b = checkAuth() == null || checkAuth() == taRotation.getCreateUser();
57
+        if (b) {
58
+           return SaResult.data(taRotationService.getById(id));
59
+        }
60
+        return SaResult.error("无权限");
61
+
54
     }
62
     }
55
 
63
 
56
     /**
64
     /**
82
 
90
 
83
         IPage<TaRotation> pg = new Page<>(pageNum, pageSize);
91
         IPage<TaRotation> pg = new Page<>(pageNum, pageSize);
84
         QueryWrapper<TaRotation> queryWrapper = new QueryWrapper<>();
92
         QueryWrapper<TaRotation> queryWrapper = new QueryWrapper<>();
93
+        queryWrapper.eq(StringUtil.isNotEmpty(checkAuth()), "CREATE_USER", checkAuth());
85
         queryWrapper.like(StringUtil.isNotEmpty(headOfficeOrg), "head_office_org", headOfficeOrg);
94
         queryWrapper.like(StringUtil.isNotEmpty(headOfficeOrg), "head_office_org", headOfficeOrg);
86
         queryWrapper.eq(StringUtil.isNotEmpty(employeeNum), "employee_num", employeeNum);
95
         queryWrapper.eq(StringUtil.isNotEmpty(employeeNum), "employee_num", employeeNum);
87
         queryWrapper.like(StringUtil.isNotEmpty(employeeName), "employee_name", employeeName);
96
         queryWrapper.like(StringUtil.isNotEmpty(employeeName), "employee_name", employeeName);

+ 35
- 27
application/src/main/java/com/lyg/application/controller/TaSendingController.java 查看文件

4
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
5
 import com.baomidou.mybatisplus.core.metadata.IPage;
5
 import com.baomidou.mybatisplus.core.metadata.IPage;
6
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.TaSending;
8
+import com.lyg.application.service.TaSendingService;
9
 import com.lyg.common.util.StringUtil;
9
 import com.lyg.common.util.StringUtil;
10
+import com.lyg.framework.accesslimit.AccessLimit;
10
 import com.lyg.framework.log.OpLog;
11
 import com.lyg.framework.log.OpLog;
11
 import com.lyg.system.controller.BaseController;
12
 import com.lyg.system.controller.BaseController;
12
-import com.lyg.framework.accesslimit.AccessLimit;
13
 import io.swagger.annotations.Api;
13
 import io.swagger.annotations.Api;
14
 import io.swagger.annotations.ApiOperation;
14
 import io.swagger.annotations.ApiOperation;
15
 import io.swagger.annotations.ApiParam;
15
 import io.swagger.annotations.ApiParam;
16
 import org.springframework.beans.factory.annotation.Autowired;
16
 import org.springframework.beans.factory.annotation.Autowired;
17
 import org.springframework.validation.annotation.Validated;
17
 import org.springframework.validation.annotation.Validated;
18
 import org.springframework.web.bind.annotation.*;
18
 import org.springframework.web.bind.annotation.*;
19
-import com.lyg.application.entity.TaSending;
20
-import com.lyg.application.service.TaSendingService;
21
 
19
 
22
- /**
20
+/**
23
  * 发送消息;(ta_sending)表控制层
21
  * 发送消息;(ta_sending)表控制层
22
+ *
24
  * @author : http://njyunzhi.com
23
  * @author : http://njyunzhi.com
25
  * @date : 2024-3-14
24
  * @date : 2024-3-14
26
  */
25
  */
28
 @RestController
27
 @RestController
29
 @RequestMapping("/")
28
 @RequestMapping("/")
30
 public class TaSendingController extends BaseController {
29
 public class TaSendingController extends BaseController {
31
-    
30
+
32
     @Autowired
31
     @Autowired
33
     private TaSendingService taSendingService;
32
     private TaSendingService taSendingService;
34
-    
35
-    /** 
36
-     * 通过ID查询单条数据 
33
+
34
+    /**
35
+     * 通过ID查询单条数据
37
      *
36
      *
38
      * @param id 主键
37
      * @param id 主键
39
      * @return 实例对象
38
      * @return 实例对象
43
     @ApiOperation("通过ID查询单条数据")
42
     @ApiOperation("通过ID查询单条数据")
44
     @GetMapping("/taSending/{id}")
43
     @GetMapping("/taSending/{id}")
45
     public SaResult queryById(@ApiParam("对象ID") @PathVariable String id) throws Exception {
44
     public SaResult queryById(@ApiParam("对象ID") @PathVariable String id) throws Exception {
46
-        return SaResult.data(taSendingService.getById(id));
45
+        TaSending taSending = taSendingService.getById(id);
46
+
47
+        Boolean b = checkAuth() == null || checkAuth() == taSending.getCreateUser();
48
+        if (b) {
49
+            SaResult.data(taSendingService.getById(id));
50
+        }
51
+        return SaResult.error("无权限");
52
+
53
+
47
     }
54
     }
48
-    
49
-    /** 
55
+
56
+    /**
50
      * 分页查询
57
      * 分页查询
51
      *
58
      *
52
-     * @param pageNum 当前页码
59
+     * @param pageNum  当前页码
53
      * @param pageSize 每页条数
60
      * @param pageSize 每页条数
54
      * @return 查询结果
61
      * @return 查询结果
55
      */
62
      */
57
     @AccessLimit()
64
     @AccessLimit()
58
     @ApiOperation("分页查询")
65
     @ApiOperation("分页查询")
59
     @GetMapping("/taSending")
66
     @GetMapping("/taSending")
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 = "create_date") String sortDesc) throws Exception {
67
+    public SaResult list(@ApiParam("页码") @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
68
+                         @ApiParam("单页数据量") @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
69
+                         @ApiParam("正序排列") @RequestParam(value = "sortAsc", required = false) String sortAsc,
70
+                         @ApiParam("倒序排列") @RequestParam(value = "sortDesc", defaultValue = "create_date") String sortDesc) throws Exception {
64
         IPage<TaSending> pg = new Page<>(pageNum, pageSize);
71
         IPage<TaSending> pg = new Page<>(pageNum, pageSize);
65
         QueryWrapper<TaSending> queryWrapper = new QueryWrapper<>();
72
         QueryWrapper<TaSending> queryWrapper = new QueryWrapper<>();
73
+        queryWrapper.eq(StringUtil.isNotEmpty(checkAuth()), "RECIPIENT_ID", checkAuth());
66
         queryWrapper.orderByAsc(StringUtil.isNotEmpty(sortAsc), StringUtil.humpToLine(sortAsc));
74
         queryWrapper.orderByAsc(StringUtil.isNotEmpty(sortAsc), StringUtil.humpToLine(sortAsc));
67
         queryWrapper.orderByDesc(StringUtil.isNotEmpty(sortDesc), StringUtil.humpToLine(sortDesc));
75
         queryWrapper.orderByDesc(StringUtil.isNotEmpty(sortDesc), StringUtil.humpToLine(sortDesc));
68
         IPage<TaSending> result = taSendingService.page(pg, queryWrapper);
76
         IPage<TaSending> result = taSendingService.page(pg, queryWrapper);
69
-        
77
+
70
         return SaResult.data(result);
78
         return SaResult.data(result);
71
     }
79
     }
72
-    
73
-    /** 
80
+
81
+    /**
74
      * 新增数据
82
      * 新增数据
75
      *
83
      *
76
      * @param taSending 实例对象
84
      * @param taSending 实例对象
84
         taSendingService.save(taSending);
92
         taSendingService.save(taSending);
85
         return SaResult.data(taSending);
93
         return SaResult.data(taSending);
86
     }
94
     }
87
-    
88
-    /** 
95
+
96
+    /**
89
      * 更新数据
97
      * 更新数据
90
      *
98
      *
91
      * @param taSending 实例对象
99
      * @param taSending 实例对象
96
     @ApiOperation("更新数据")
104
     @ApiOperation("更新数据")
97
     @PutMapping("/taSending/{id}")
105
     @PutMapping("/taSending/{id}")
98
     public SaResult edit(@ApiParam("对象实体") @Validated @RequestBody TaSending taSending,
106
     public SaResult edit(@ApiParam("对象实体") @Validated @RequestBody TaSending taSending,
99
-                            @ApiParam("对象ID") @PathVariable String id ) throws Exception {
107
+                         @ApiParam("对象ID") @PathVariable String id) throws Exception {
100
         taSending.setSendingId(id);
108
         taSending.setSendingId(id);
101
         taSendingService.updateById(taSending);
109
         taSendingService.updateById(taSending);
102
         return SaResult.data(taSending);
110
         return SaResult.data(taSending);
103
     }
111
     }
104
-    
105
-    /** 
112
+
113
+    /**
106
      * 通过主键删除数据
114
      * 通过主键删除数据
107
      *
115
      *
108
      * @param id 主键
116
      * @param id 主键
112
     @AccessLimit()
120
     @AccessLimit()
113
     @ApiOperation("通过主键删除数据")
121
     @ApiOperation("通过主键删除数据")
114
     @DeleteMapping("/taSending/{id}")
122
     @DeleteMapping("/taSending/{id}")
115
-    public SaResult deleteById(@ApiParam("对象ID") @PathVariable String id){
123
+    public SaResult deleteById(@ApiParam("对象ID") @PathVariable String id) {
116
         taSendingService.removeById(id);
124
         taSendingService.removeById(id);
117
         return SaResult.data("success");
125
         return SaResult.data("success");
118
     }
126
     }

+ 10
- 18
application/src/main/java/com/lyg/application/controller/UploadController.java 查看文件

2
 
2
 
3
 import cn.dev33.satoken.util.SaResult;
3
 import cn.dev33.satoken.util.SaResult;
4
 import com.alibaba.excel.EasyExcel;
4
 import com.alibaba.excel.EasyExcel;
5
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
6
 import com.lyg.application.Listener.TaMandatoryLeaveListener;
5
 import com.lyg.application.Listener.TaMandatoryLeaveListener;
7
 import com.lyg.application.Listener.TaRotationListener;
6
 import com.lyg.application.Listener.TaRotationListener;
8
 import com.lyg.application.entity.TaMandatoryLeave;
7
 import com.lyg.application.entity.TaMandatoryLeave;
9
 import com.lyg.application.entity.TaRotation;
8
 import com.lyg.application.entity.TaRotation;
10
-import com.lyg.application.mapper.TaRotationMapper;
11
 import com.lyg.application.service.TaMandatoryLeaveService;
9
 import com.lyg.application.service.TaMandatoryLeaveService;
12
 import com.lyg.application.service.TaRotationService;
10
 import com.lyg.application.service.TaRotationService;
13
 import com.lyg.application.service.impl.TaMandatoryLeaveServiceImpl;
11
 import com.lyg.application.service.impl.TaMandatoryLeaveServiceImpl;
18
 import io.swagger.annotations.ApiOperation;
16
 import io.swagger.annotations.ApiOperation;
19
 import io.swagger.annotations.ApiParam;
17
 import io.swagger.annotations.ApiParam;
20
 import org.springframework.beans.factory.annotation.Autowired;
18
 import org.springframework.beans.factory.annotation.Autowired;
19
+import org.springframework.beans.factory.annotation.Value;
20
+import org.springframework.scheduling.annotation.Scheduled;
21
 import org.springframework.web.bind.annotation.*;
21
 import org.springframework.web.bind.annotation.*;
22
 import org.springframework.web.multipart.MultipartFile;
22
 import org.springframework.web.multipart.MultipartFile;
23
 
23
 
39
 public class UploadController extends BaseController {
39
 public class UploadController extends BaseController {
40
 
40
 
41
 
41
 
42
+    @Value("${yz.warningTmp}")
43
+    String warning;
44
+    @Value("${yz.promptTmp}")
45
+    String prompt;
42
     @Autowired
46
     @Autowired
43
     private TaRotationService taRotationService;
47
     private TaRotationService taRotationService;
44
-
45
-
46
-
47
     @Autowired
48
     @Autowired
48
     private TaRotationServiceImpl taRotationServiceImpl;
49
     private TaRotationServiceImpl taRotationServiceImpl;
49
     @Autowired
50
     @Autowired
50
     private TaMandatoryLeaveService taMandatoryLeaveService;
51
     private TaMandatoryLeaveService taMandatoryLeaveService;
51
-
52
     @Autowired
52
     @Autowired
53
     private TaMandatoryLeaveServiceImpl taMandatoryLeaveServiceImpl;
53
     private TaMandatoryLeaveServiceImpl taMandatoryLeaveServiceImpl;
54
 
54
 
55
-
56
     @AccessLimit()
55
     @AccessLimit()
57
     @ApiOperation("上传文件")
56
     @ApiOperation("上传文件")
58
     @PostMapping("/upload/taRotation")
57
     @PostMapping("/upload/taRotation")
119
     }
118
     }
120
 
119
 
121
 
120
 
121
+
122
     @AccessLimit()
122
     @AccessLimit()
123
-    @ApiOperation("提示/预警")
124
-//    @Scheduled(cron = "0 45 2 1 1,4,7,10 ?")
125
-    @GetMapping("/prompt/warning")
126
-    public SaResult promptWarning() throws Exception {
123
+    @Scheduled(cron = "0 0 8 * * *")
124
+    @GetMapping("/as/holiday")
125
+    public void promptWarning() throws Exception {
127
 
126
 
128
         taRotationService.selectGetWaring();
127
         taRotationService.selectGetWaring();
129
 
128
 
130
-
131
-
132
-
133
-        return SaResult.data("");
134
-
135
-
136
     }
129
     }
137
 
130
 
138
-
139
 }
131
 }

+ 1
- 1
application/src/main/java/com/lyg/application/entity/TaMessage.java 查看文件

40
     private String remark ;
40
     private String remark ;
41
 
41
 
42
     @ApiModelProperty(name = "预警 waring  提示 prompt",notes = "预警 超过轮岗截止日期  提示提前一个月提醒")
42
     @ApiModelProperty(name = "预警 waring  提示 prompt",notes = "预警 超过轮岗截止日期  提示提前一个月提醒")
43
-    private String waringStatus ;
43
+    private String waringType ;
44
 
44
 
45
     @ApiModelProperty(name = "状态 1正常 0不正常",notes = "")
45
     @ApiModelProperty(name = "状态 1正常 0不正常",notes = "")
46
     private Integer status ;
46
     private Integer status ;

+ 28
- 0
application/src/main/java/com/lyg/application/job/MandatoryJobTime.java 查看文件

1
+package com.lyg.application.job;
2
+
3
+
4
+import com.lyg.application.service.TaMandatoryLeaveService;
5
+import com.lyg.application.service.TaRotationService;
6
+import com.lyg.framework.accesslimit.AccessLimit;
7
+import org.springframework.beans.factory.annotation.Autowired;
8
+import org.springframework.scheduling.annotation.Scheduled;
9
+import org.springframework.stereotype.Component;
10
+
11
+@Component
12
+public class MandatoryJobTime {
13
+
14
+    @Autowired
15
+    private TaMandatoryLeaveService taMandatoryLeaveService;
16
+
17
+    /**
18
+     *  定时提醒   每年12月20号8点
19
+     * @throws Exception
20
+     */
21
+    @AccessLimit()
22
+    @Scheduled(cron = "0 0 8 20 12 *")
23
+    public void promptWarning() throws Exception {
24
+        taMandatoryLeaveService.selectGetPrompt();
25
+    }
26
+
27
+
28
+}

+ 33
- 0
application/src/main/java/com/lyg/application/job/TotationJobTime.java 查看文件

1
+package com.lyg.application.job;
2
+
3
+
4
+import com.lyg.application.service.TaRotationService;
5
+import com.lyg.framework.accesslimit.AccessLimit;
6
+import org.springframework.beans.factory.annotation.Autowired;
7
+import org.springframework.scheduling.annotation.Scheduled;
8
+import org.springframework.stereotype.Component;
9
+import org.springframework.web.bind.annotation.GetMapping;
10
+
11
+@Component
12
+public class TotationJobTime {
13
+
14
+    @Autowired
15
+    private TaRotationService taRotationService;
16
+
17
+
18
+    /**
19
+     * 每天8点执行一次
20
+     * @return
21
+     * @throws Exception
22
+     */
23
+
24
+    @AccessLimit()
25
+    @Scheduled(cron = "0 0 8 * * *")
26
+    public void promptWarning() throws Exception {
27
+
28
+        taRotationService.selectGetWaring();
29
+
30
+    }
31
+
32
+
33
+}

+ 8
- 3
application/src/main/java/com/lyg/application/mapper/TaMandatoryLeaveMapper.java 查看文件

1
 package com.lyg.application.mapper;
1
 package com.lyg.application.mapper;
2
 
2
 
3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.lyg.application.entity.TaRotation;
4
 import org.apache.ibatis.annotations.Mapper;
5
 import org.apache.ibatis.annotations.Mapper;
5
 import org.apache.ibatis.annotations.Param;
6
 import org.apache.ibatis.annotations.Param;
6
 import com.lyg.application.entity.TaMandatoryLeave;
7
 import com.lyg.application.entity.TaMandatoryLeave;
7
 
8
 
8
- /**
9
+import java.time.LocalDate;
10
+import java.util.List;
11
+
12
+/**
9
  * 强制休假表;(ta_mandatory_leave)表数据库访问层
13
  * 强制休假表;(ta_mandatory_leave)表数据库访问层
10
  * @author : http://njyunzhi.com
14
  * @author : http://njyunzhi.com
11
  * @date : 2024-3-6
15
  * @date : 2024-3-6
12
  */
16
  */
13
 @Mapper
17
 @Mapper
14
 public interface TaMandatoryLeaveMapper  extends BaseMapper<TaMandatoryLeave>{
18
 public interface TaMandatoryLeaveMapper  extends BaseMapper<TaMandatoryLeave>{
15
-    
16
-}
19
+
20
+     List<TaMandatoryLeave> prompt(@Param("localDate") LocalDate localDate);
21
+ }

+ 0
- 98
application/src/main/java/com/lyg/application/schedule/TaskSchedule.java 查看文件

1
-package com.lyg.application.schedule;
2
-
3
-import com.lyg.application.service.TaRotationService;
4
-import org.springframework.beans.factory.annotation.Autowired;
5
-import org.springframework.scheduling.annotation.Scheduled;
6
-import org.springframework.stereotype.Component;
7
-
8
-
9
-@Component
10
-public class TaskSchedule {
11
-
12
-    @Autowired
13
-    TaRotationService taRotationService;
14
-
15
-    @Scheduled(cron = "0 14 18 * * ?")
16
-    public void lockOver() {
17
-        System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!");
18
-
19
-    }
20
-
21
-//    /**
22
-//     * 每天晚上 11 点 50 执行
23
-//     * 锁定任务, 并设置为过期
24
-//     */
25
-//    @Scheduled(cron = "0 50 23 * * ?")
26
-//    public void lockOver() {
27
-//        try {
28
-//            taTaskService.lockTask();
29
-//        } catch (Exception e) {
30
-//            e.printStackTrace();
31
-//        }
32
-//    }
33
-//
34
-//    /**
35
-//     * 每天凌晨 1:00 执行
36
-//     */
37
-//    @Scheduled(cron = "0 0 1 * * ?")
38
-//    public void daily() {
39
-//        try {
40
-//            String batchId = TaskUtil.getDailyBatchId();
41
-//            taTaskService.syncTask(batchId, FrequencyEnum.BEFORE_WORK.getValue());
42
-//        } catch (Exception e) {
43
-//            e.printStackTrace();
44
-//        }
45
-//        try {
46
-//            String batchId = TaskUtil.getDailyBatchId();
47
-//            taTaskService.syncTask(batchId, FrequencyEnum.AT_WORK.getValue());
48
-//        } catch (Exception e) {
49
-//            e.printStackTrace();
50
-//        }
51
-//        try {
52
-//            String batchId = TaskUtil.getDailyBatchId();
53
-//            taTaskService.syncTask(batchId, FrequencyEnum.AFTER_WORK.getValue());
54
-//        } catch (Exception e) {
55
-//            e.printStackTrace();
56
-//        }
57
-//    }
58
-//
59
-//    /**
60
-//     * 每周一凌晨 2:00 执行
61
-//     */
62
-//    @Scheduled(cron = "0 0 2 * * MON")
63
-//    public void weekly() {
64
-//        try {
65
-//            String batchId = TaskUtil.getWeeklyBatchId();
66
-//            taTaskService.syncTask(batchId, FrequencyEnum.WEEKLY.getValue());
67
-//        } catch (Exception e) {
68
-//            e.printStackTrace();
69
-//        }
70
-//    }
71
-//
72
-//    /**
73
-//     * 每月1号凌晨 2:30 执行
74
-//     */
75
-//    @Scheduled(cron = "0 30 2 1 * ?")
76
-//    public void monthly() {
77
-//        try {
78
-//            String batchId = TaskUtil.getMonthlyBatchId();
79
-//            taTaskService.syncTask(batchId, FrequencyEnum.MONTHLY.getValue());
80
-//        } catch (Exception e) {
81
-//            e.printStackTrace();
82
-//        }
83
-//    }
84
-//
85
-//
86
-//    /**
87
-//     * 每季度第一个月 1号凌晨 2:45 执行
88
-//     */
89
-//    @Scheduled(cron = "0 45 2 1 1,4,7,10 ?")
90
-//    public void quarterly() {
91
-//        try {
92
-//            String batchId = TaskUtil.getQuarterlyBatchId();
93
-//            taTaskService.syncTask(batchId, FrequencyEnum.QUARTERLY.getValue());
94
-//        } catch (Exception e) {
95
-//            e.printStackTrace();
96
-//        }
97
-//    }
98
-}

+ 2
- 0
application/src/main/java/com/lyg/application/service/TaMandatoryLeaveService.java 查看文件

15
 public interface TaMandatoryLeaveService extends IBaseService<TaMandatoryLeave> {
15
 public interface TaMandatoryLeaveService extends IBaseService<TaMandatoryLeave> {
16
  TaMandatoryLeave handleEntity(TaMandatoryLeave entity, Integer index) throws Exception;
16
  TaMandatoryLeave handleEntity(TaMandatoryLeave entity, Integer index) throws Exception;
17
  void saveEntityBatch(List<TaMandatoryLeave> entityList);
17
  void saveEntityBatch(List<TaMandatoryLeave> entityList);
18
+
19
+    void selectGetPrompt();
18
 }
20
 }

+ 76
- 0
application/src/main/java/com/lyg/application/service/impl/TaMandatoryLeaveServiceImpl.java 查看文件

1
 package com.lyg.application.service.impl;
1
 package com.lyg.application.service.impl;
2
 
2
 
3
 import com.lyg.application.entity.TaMandatoryLeave;
3
 import com.lyg.application.entity.TaMandatoryLeave;
4
+import com.lyg.application.entity.TaMessage;
5
+import com.lyg.application.entity.TaSending;
4
 import com.lyg.application.mapper.TaMandatoryLeaveMapper;
6
 import com.lyg.application.mapper.TaMandatoryLeaveMapper;
7
+import com.lyg.application.mapper.TaMessageMapper;
8
+import com.lyg.application.mapper.TaSendingMapper;
5
 import com.lyg.application.service.TaMandatoryLeaveService;
9
 import com.lyg.application.service.TaMandatoryLeaveService;
10
+import com.lyg.application.service.TaMessageService;
11
+import com.lyg.common.util.StringUtil;
12
+import com.lyg.system.entity.SysUser;
6
 import com.lyg.system.mapper.SysPositionMapper;
13
 import com.lyg.system.mapper.SysPositionMapper;
14
+import com.lyg.system.mapper.SysUserMapper;
7
 import com.lyg.system.service.SysOrgService;
15
 import com.lyg.system.service.SysOrgService;
8
 import com.lyg.system.service.SysPositionService;
16
 import com.lyg.system.service.SysPositionService;
9
 import com.lyg.system.service.impl.BaseServiceImpl;
17
 import com.lyg.system.service.impl.BaseServiceImpl;
10
 import org.springframework.beans.factory.annotation.Autowired;
18
 import org.springframework.beans.factory.annotation.Autowired;
19
+import org.springframework.beans.factory.annotation.Value;
11
 import org.springframework.stereotype.Service;
20
 import org.springframework.stereotype.Service;
12
 
21
 
13
 import java.time.LocalDate;
22
 import java.time.LocalDate;
23
 @Service
32
 @Service
24
 public class TaMandatoryLeaveServiceImpl extends BaseServiceImpl<TaMandatoryLeaveMapper, TaMandatoryLeave> implements TaMandatoryLeaveService {
33
 public class TaMandatoryLeaveServiceImpl extends BaseServiceImpl<TaMandatoryLeaveMapper, TaMandatoryLeave> implements TaMandatoryLeaveService {
25
     private final List<String> errorMessages = new ArrayList<>();
34
     private final List<String> errorMessages = new ArrayList<>();
35
+    @Value("${yz.holidayTmp}")
36
+    String holidayTmp;
26
     @Autowired
37
     @Autowired
27
     private SysOrgService sysOrgService;
38
     private SysOrgService sysOrgService;
28
     @Autowired
39
     @Autowired
29
     private SysPositionService sysPositionService;
40
     private SysPositionService sysPositionService;
30
     @Autowired
41
     @Autowired
31
     private SysPositionMapper sysPositionMapper;
42
     private SysPositionMapper sysPositionMapper;
43
+    @Autowired
44
+    private TaMessageService taMessageService;
45
+    @Autowired
46
+    private TaMessageMapper taMessageMapper;
47
+    @Autowired
48
+    private TaSendingMapper taSendingMapper;
49
+    @Autowired
50
+    private SysUserMapper sysUserMapper;
32
 
51
 
33
     @Override
52
     @Override
34
     public TaMandatoryLeave handleEntity(TaMandatoryLeave entity, Integer index) throws Exception {
53
     public TaMandatoryLeave handleEntity(TaMandatoryLeave entity, Integer index) throws Exception {
85
         }
104
         }
86
     }
105
     }
87
 
106
 
107
+
88
     public List<String> getErrorMessages() {
108
     public List<String> getErrorMessages() {
89
         return errorMessages;
109
         return errorMessages;
90
 
110
 
91
     }
111
     }
112
+
113
+    @Override
114
+    public void selectGetPrompt() {
115
+        LocalDate localDate = LocalDate.now();
116
+
117
+        List<TaMandatoryLeave> promptList = baseMapper.prompt(localDate);
118
+        Integer numI = 3;
119
+        Integer nameI = 8;
120
+
121
+        if (promptList.size() != 0) {
122
+            for (TaMandatoryLeave item : promptList) {
123
+                TaMessage taMessage = new TaMessage();
124
+                String uuid = StringUtil.UUID();
125
+                taMessage.setMessageId(uuid);
126
+                taMessage.setSourceId(item.getLeaveId());
127
+                StringBuilder sb = new StringBuilder(holidayTmp);
128
+                sb.insert(numI, item.getEmployeeNum());
129
+                Integer i = item.getEmployeeNum().length() + nameI;
130
+                sb.insert(i, item.getEmployeeName());
131
+                taMessage.setContentSent(sb.toString());
132
+                taMessage.setSourceName("taMandatoryLeave");
133
+                taMessage.setWaringType("prompt");
134
+
135
+
136
+                Long count = taMessageService.countBy("source_id", item.getLeaveId(), true);
137
+                if (count == 0) {
138
+                    taMessageMapper.insert(taMessage);
139
+                    insertIntoTaSending(item.getCreateUser(), uuid);
140
+                }
141
+
142
+            }
143
+        }
144
+
145
+
146
+    }
147
+
148
+    public void insertIntoTaSending(String createUser, String uuid) {
149
+
150
+        //                item.getCreateUser()  就是新增这个数据的人
151
+        //现在需要去重 创建人和管理员  是一个人只能往  Tasending插入一条数据否则是两条数据
152
+        SysUser sysUserAdmin = sysUserMapper.getAdmin(createUser);
153
+//                如果为空 就不是管理员创建的;
154
+        List<String> userIdList = new ArrayList<>();
155
+
156
+        if (sysUserAdmin == null) {
157
+            userIdList.add(createUser);
158
+        }
159
+        userIdList = sysUserMapper.allAdmin();
160
+        for (String it : userIdList) {
161
+            TaSending taSending = new TaSending();
162
+            taSending.setMessageId(uuid);
163
+            taSending.setRecipientId(it);
164
+            taSendingMapper.insert(taSending);
165
+        }
166
+
167
+    }
92
 }
168
 }

+ 58
- 27
application/src/main/java/com/lyg/application/service/impl/TaRotationServiceImpl.java 查看文件

6
 import com.lyg.application.mapper.TaMessageMapper;
6
 import com.lyg.application.mapper.TaMessageMapper;
7
 import com.lyg.application.mapper.TaRotationMapper;
7
 import com.lyg.application.mapper.TaRotationMapper;
8
 import com.lyg.application.mapper.TaSendingMapper;
8
 import com.lyg.application.mapper.TaSendingMapper;
9
+import com.lyg.application.service.TaMessageService;
9
 import com.lyg.application.service.TaRotationService;
10
 import com.lyg.application.service.TaRotationService;
10
 import com.lyg.application.util.Rule;
11
 import com.lyg.application.util.Rule;
11
 import com.lyg.common.util.StringUtil;
12
 import com.lyg.common.util.StringUtil;
17
 import com.lyg.system.service.SysUserService;
18
 import com.lyg.system.service.SysUserService;
18
 import com.lyg.system.service.impl.BaseServiceImpl;
19
 import com.lyg.system.service.impl.BaseServiceImpl;
19
 import org.springframework.beans.factory.annotation.Autowired;
20
 import org.springframework.beans.factory.annotation.Autowired;
21
+import org.springframework.beans.factory.annotation.Value;
20
 import org.springframework.stereotype.Service;
22
 import org.springframework.stereotype.Service;
21
 
23
 
22
 import java.time.LocalDate;
24
 import java.time.LocalDate;
36
     private final List<Object> errorMessages = new ArrayList<>();
38
     private final List<Object> errorMessages = new ArrayList<>();
37
     @Autowired
39
     @Autowired
38
     Rule rule;
40
     Rule rule;
41
+    @Value("${yz.warningTmp}")
42
+    String warningTmp;
43
+    @Value("${yz.promptTmp}")
44
+    String promptTmp;
39
     @Autowired
45
     @Autowired
40
     private SysOrgService sysOrgService;
46
     private SysOrgService sysOrgService;
41
     @Autowired
47
     @Autowired
45
     @Autowired
51
     @Autowired
46
     private TaMessageMapper taMessageMapper;
52
     private TaMessageMapper taMessageMapper;
47
     @Autowired
53
     @Autowired
54
+    private TaMessageService taMessageService;
55
+    @Autowired
48
     private TaSendingMapper taSendingMapper;
56
     private TaSendingMapper taSendingMapper;
49
-
50
     @Autowired
57
     @Autowired
51
     private SysUserService sysUserService;
58
     private SysUserService sysUserService;
52
     @Autowired
59
     @Autowired
134
     @Override
141
     @Override
135
     public void selectGetWaring() {
142
     public void selectGetWaring() {
136
         LocalDate localDate = LocalDate.now();
143
         LocalDate localDate = LocalDate.now();
137
-
144
+        Integer numI = 3;
145
+        Integer nameI = 8;
138
 //预警 消息
146
 //预警 消息
139
         List<TaRotation> earlyWaringList = baseMapper.waring(localDate);
147
         List<TaRotation> earlyWaringList = baseMapper.waring(localDate);
148
+
140
         if (earlyWaringList.size() != 0) {
149
         if (earlyWaringList.size() != 0) {
141
             for (TaRotation item : earlyWaringList) {
150
             for (TaRotation item : earlyWaringList) {
142
                 TaMessage taMessage = new TaMessage();
151
                 TaMessage taMessage = new TaMessage();
143
                 String uuid = StringUtil.UUID();
152
                 String uuid = StringUtil.UUID();
144
                 taMessage.setMessageId(uuid);
153
                 taMessage.setMessageId(uuid);
145
                 taMessage.setSourceId(item.getRotationId());
154
                 taMessage.setSourceId(item.getRotationId());
146
-                String contentSent = "工号:" + item.getEmployeeNum() + ", 名字:" + item.getEmployeeName() + ", 业务条线:" + item.getCounterHeadOfficeLine() + ", 超过轮岗截止日期, 请及时处理";
147
-                taMessage.setContentSent(contentSent);
155
+                StringBuilder sb = new StringBuilder(warningTmp);
156
+                sb.insert(numI, item.getEmployeeNum());
157
+                Integer i = item.getEmployeeNum().length() + nameI;
158
+                sb.insert(i, item.getEmployeeName());
159
+                taMessage.setContentSent(sb.toString());
148
                 taMessage.setSourceName("taRotation");
160
                 taMessage.setSourceName("taRotation");
149
-                taMessage.setWaringStatus("waring");
150
-                taMessageMapper.insert(taMessage);
151
-
152
-
153
-//                item.getCreateUser()  就是新增这个数据的人
154
-                //现在需要去重 创建人和管理员  是一个人只能往  Tasending插入一条数据否则是两条数据
155
-                SysUser sysUserAdmin = sysUserMapper.getAdmin(item.getCreateUser());
156
-//                如果为空 就不是管理员创建的;
157
-                List<String> userIdList = new ArrayList<>();
161
+                taMessage.setWaringType("waring");
158
 
162
 
159
-                if (sysUserAdmin == null) {
160
-                    userIdList = sysUserMapper.allAdmin();
161
-                    userIdList.add(sysUserAdmin.getUserId());
162
-                }
163
-                for (String it : userIdList) {
164
-                    TaSending taSending = new TaSending();
165
-                    taSending.setMessageId(uuid);
166
-                    taSending.setRecipientId(it);
167
-                    taSendingMapper.insert(taSending);
163
+                Long count = taMessageService.countBy("source_id", item.getRotationId(), true);
164
+                if (count == 0) {
165
+                    taMessageMapper.insert(taMessage);
166
+                    insertIntoTaSending(item.getCreateUser(), uuid);
168
                 }
167
                 }
169
 
168
 
170
-
171
             }
169
             }
172
         }
170
         }
173
 //提示消息
171
 //提示消息
174
         List<TaRotation> earlyPromptList = baseMapper.prompt(localDate);
172
         List<TaRotation> earlyPromptList = baseMapper.prompt(localDate);
173
+
175
         if (earlyPromptList.size() != 0) {
174
         if (earlyPromptList.size() != 0) {
176
             for (TaRotation item : earlyPromptList) {
175
             for (TaRotation item : earlyPromptList) {
177
                 TaMessage taMessage = new TaMessage();
176
                 TaMessage taMessage = new TaMessage();
177
+                String uuid = StringUtil.UUID();
178
+                taMessage.setMessageId(uuid);
178
                 taMessage.setSourceId(item.getRotationId());
179
                 taMessage.setSourceId(item.getRotationId());
179
-                String contentSent = "工号:" + item.getEmployeeNum() + ", 名字:" + item.getEmployeeName() + ", 业务条线:" + item.getCounterHeadOfficeLine() + ",即将轮岗, 请及时处理";
180
-                taMessage.setContentSent(contentSent);
180
+                StringBuilder sb = new StringBuilder(promptTmp);
181
+                sb.insert(numI, item.getEmployeeNum());
182
+                Integer i = item.getEmployeeNum().length() + nameI;
183
+                sb.insert(i, item.getEmployeeName());
184
+                taMessage.setContentSent(sb.toString());
181
                 taMessage.setSourceName("taRotation");
185
                 taMessage.setSourceName("taRotation");
182
-                taMessage.setWaringStatus("prompt");
183
-                taMessageMapper.insert(taMessage);
186
+                taMessage.setWaringType("prompt");
187
+
188
+                Long count = taMessageService.countBy("source_id", item.getRotationId(), true);
189
+                if (count == 0) {
190
+                    taMessageMapper.insert(taMessage);
191
+                    insertIntoTaSending(item.getCreateUser(), uuid);
192
+                }
193
+
184
             }
194
             }
185
         }
195
         }
186
 
196
 
188
         return;
198
         return;
189
     }
199
     }
190
 
200
 
201
+    public void insertIntoTaSending(String createUser, String uuid) {
202
+
203
+        //                item.getCreateUser()  就是新增这个数据的人
204
+        //现在需要去重 创建人和管理员  是一个人只能往  Tasending插入一条数据否则是两条数据
205
+        SysUser sysUserAdmin = sysUserMapper.getAdmin(createUser);
206
+//                如果为空 就不是管理员创建的;
207
+        List<String> userIdList = new ArrayList<>();
208
+
209
+        if (sysUserAdmin == null) {
210
+            userIdList.add(createUser);
211
+        }
212
+        userIdList = sysUserMapper.allAdmin();
213
+
214
+        for (String it : userIdList) {
215
+            TaSending taSending = new TaSending();
216
+            taSending.setMessageId(uuid);
217
+            taSending.setRecipientId(it);
218
+            taSendingMapper.insert(taSending);
219
+        }
220
+
221
+    }
191
 
222
 
192
     public List<Object> getErrorMessages() {
223
     public List<Object> getErrorMessages() {
193
         return errorMessages;
224
         return errorMessages;

+ 4
- 1
application/src/main/resources/application.yml 查看文件

48
 
48
 
49
 ###
49
 ###
50
 yz:
50
 yz:
51
-  appid: maintenance
51
+  appid: job_warning
52
+  warningTmp: 工号:, 名字:, 超过轮岗截止日期, 请及时处理
53
+  promptTmp: 工号:, 名字:, 即将轮岗, 请及时处理
54
+  holidayTmp: 工号:, 名字:, 还未休假, 请及时处理
52
   upload:
55
   upload:
53
     path: E:\work\public-upload
56
     path: E:\work\public-upload
54
   sso:
57
   sso:

+ 11
- 1
application/src/main/resources/mapper/TaMandatoryLeaveMapper.xml 查看文件

2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
 
3
 
4
 <mapper namespace="com.lyg.application.mapper.TaMandatoryLeaveMapper">
4
 <mapper namespace="com.lyg.application.mapper.TaMandatoryLeaveMapper">
5
-    
5
+
6
+    <select id="prompt" resultType="com.lyg.application.entity.TaMandatoryLeave">
7
+        SELECT
8
+        *
9
+        FROM
10
+        TA_MANDATORY_LEAVE l
11
+        WHERE
12
+        l.DELETED = 0
13
+        AND l.START_TIME_VACATION IS NULL
14
+        AND l.VACATION_DEADLINE IS NULL
15
+    </select>
6
 </mapper>
16
 </mapper>

+ 7
- 3
application/src/main/resources/mapper/TaRotationMapper.xml 查看文件

23
     </select>
23
     </select>
24
     <select id="waring" resultType="com.lyg.application.entity.TaRotation">
24
     <select id="waring" resultType="com.lyg.application.entity.TaRotation">
25
         SELECT * FROM TA_ROTATION r
25
         SELECT * FROM TA_ROTATION r
26
-        WHERE r.rotation_deadline &lt; #{localDate}
26
+        WHERE r.rotation_deadline &lt;  #{localDate}
27
+        ORDER BY
28
+        r.ROTATION_DEADLINE DESC
27
     </select>
29
     </select>
28
     <select id="prompt" resultType="com.lyg.application.entity.TaRotation">
30
     <select id="prompt" resultType="com.lyg.application.entity.TaRotation">
29
         SELECT * FROM TA_ROTATION r
31
         SELECT * FROM TA_ROTATION r
30
-        WHERE r.rotation_deadline>=ADD_MONTHS(#{localDate} , -1)
31
-        AND r.rotation_deadline &lt; #{localDate}
32
+        WHERE r.rotation_deadline&lt;= ADD_MONTHS(#{localDate},+1)
33
+        AND r.rotation_deadline &gt;= #{localDate}
34
+        ORDER BY
35
+        r.ROTATION_DEADLINE DESC
32
     </select>
36
     </select>
33
 </mapper>
37
 </mapper>

+ 5
- 9
system/src/main/java/com/lyg/system/controller/BaseController.java 查看文件

1
 package com.lyg.system.controller;
1
 package com.lyg.system.controller;
2
 
2
 
3
 import cn.dev33.satoken.stp.StpUtil;
3
 import cn.dev33.satoken.stp.StpUtil;
4
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
 import com.lyg.common.Constants;
5
 import com.lyg.common.Constants;
5
 import com.lyg.common.util.StringUtil;
6
 import com.lyg.common.util.StringUtil;
6
 import com.lyg.system.entity.SysUser;
7
 import com.lyg.system.entity.SysUser;
31
      */
32
      */
32
 
33
 
33
     @SneakyThrows
34
     @SneakyThrows
34
-    public void checkAuth() {
35
+    public String checkAuth() {
35
         SysUser sysUser = currentUser();
36
         SysUser sysUser = currentUser();
36
-        Integer isAdmin = sysUser.getIsAdmin();
37
-        if (isAdmin.equals(1)) {
38
-            //是超级管理员
39
-
40
-        } else {
41
-//            不是管理员
42
-            String userId = sysUser.getUserId();
37
+        if (sysUser.getIsAdmin() != 1) {
38
+            return sysUser.getUserId();
43
         }
39
         }
44
-
40
+        return null;
45
     }
41
     }
46
 
42
 
47
     /**
43
     /**