张涛 1 gadu atpakaļ
vecāks
revīzija
5249be8e74
18 mainītis faili ar 351 papildinājumiem un 235 dzēšanām
  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 Parādīt failu

@@ -12,6 +12,7 @@ import com.lyg.common.util.StringUtil;
12 12
 import com.lyg.framework.accesslimit.AccessLimit;
13 13
 import com.lyg.framework.log.OpLog;
14 14
 import com.lyg.system.controller.BaseController;
15
+import com.lyg.system.entity.SysUser;
15 16
 import io.swagger.annotations.Api;
16 17
 import io.swagger.annotations.ApiOperation;
17 18
 import io.swagger.annotations.ApiParam;
@@ -66,18 +67,19 @@ public class TaIncompatibleController extends BaseController {
66 67
     @GetMapping("/taIncompatible")
67 68
     public SaResult list(@ApiParam("页码") @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
68 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 74
                          @ApiParam("正序排列") @RequestParam(value = "sortAsc", required = false) String sortAsc,
74 75
                          @ApiParam("倒序排列") @RequestParam(value = "sortDesc", defaultValue = "create_date") String sortDesc) throws Exception {
75 76
 
77
+
76 78
         IPage<TaIncompatible> pg = new Page<>(pageNum, pageSize);
77 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 83
         queryWrapper.orderByAsc(StringUtil.isNotEmpty(sortAsc), StringUtil.humpToLine(sortAsc));
82 84
         queryWrapper.orderByDesc(StringUtil.isNotEmpty(sortDesc), StringUtil.humpToLine(sortDesc));
83 85
         IPage<TaIncompatible> result = taIncompatibleService.page(pg, queryWrapper);

+ 46
- 39
application/src/main/java/com/lyg/application/controller/TaMandatoryLeaveController.java Parādīt failu

@@ -10,7 +10,6 @@ import com.lyg.common.util.StringUtil;
10 10
 import com.lyg.framework.accesslimit.AccessLimit;
11 11
 import com.lyg.framework.log.OpLog;
12 12
 import com.lyg.system.controller.BaseController;
13
-import com.lyg.system.entity.SysOrg;
14 13
 import com.lyg.system.mapper.SysOrgMapper;
15 14
 import io.swagger.annotations.Api;
16 15
 import io.swagger.annotations.ApiOperation;
@@ -19,8 +18,9 @@ import org.springframework.beans.factory.annotation.Autowired;
19 18
 import org.springframework.validation.annotation.Validated;
20 19
 import org.springframework.web.bind.annotation.*;
21 20
 
22
- /**
21
+/**
23 22
  * 强制休假表;(ta_mandatory_leave)表控制层
23
+ *
24 24
  * @author : http://njyunzhi.com
25 25
  * @date : 2024-3-6
26 26
  */
@@ -28,15 +28,15 @@ import org.springframework.web.bind.annotation.*;
28 28
 @RestController
29 29
 @RequestMapping("/")
30 30
 public class TaMandatoryLeaveController extends BaseController {
31
-    
31
+
32 32
     @Autowired
33 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 41
      * @param id 主键
42 42
      * @return 实例对象
@@ -46,13 +46,19 @@ public class TaMandatoryLeaveController extends BaseController {
46 46
     @ApiOperation("通过ID查询单条数据")
47 47
     @GetMapping("/taMandatoryLeave/{id}")
48 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 62
      * @param pageSize 每页条数
57 63
      * @return 查询结果
58 64
      */
@@ -60,39 +66,40 @@ public class TaMandatoryLeaveController extends BaseController {
60 66
     @AccessLimit()
61 67
     @ApiOperation("分页查询")
62 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 80
                          @ApiParam("正序排列") @RequestParam(value = "sortAsc", defaultValue = "create_date") String sortAsc,
75 81
                          @ApiParam("倒序排列") @RequestParam(value = "sortDesc", required = false) String sortDesc
76 82
     ) throws Exception {
77
-        
83
+
78 84
         IPage<TaMandatoryLeave> pg = new Page<>(pageNum, pageSize);
79 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 95
         queryWrapper.orderByAsc(StringUtil.isNotEmpty(sortAsc), StringUtil.humpToLine(sortAsc));
89 96
         queryWrapper.orderByDesc(StringUtil.isNotEmpty(sortDesc), StringUtil.humpToLine(sortDesc));
90 97
         IPage<TaMandatoryLeave> result = taMandatoryLeaveService.page(pg, queryWrapper);
91
-        
98
+
92 99
         return SaResult.data(result);
93 100
     }
94
-    
95
-    /** 
101
+
102
+    /**
96 103
      * 新增数据
97 104
      *
98 105
      * @param taMandatoryLeave 实例对象
@@ -106,8 +113,8 @@ public class TaMandatoryLeaveController extends BaseController {
106 113
         taMandatoryLeaveService.save(taMandatoryLeave);
107 114
         return SaResult.data(taMandatoryLeave);
108 115
     }
109
-    
110
-    /** 
116
+
117
+    /**
111 118
      * 更新数据
112 119
      *
113 120
      * @param taMandatoryLeave 实例对象
@@ -118,12 +125,12 @@ public class TaMandatoryLeaveController extends BaseController {
118 125
     @ApiOperation("更新数据")
119 126
     @PutMapping("/taMandatoryLeave/{id}")
120 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 129
         taMandatoryLeaveService.updateById(taMandatoryLeave);
123 130
         return SaResult.data(taMandatoryLeave);
124 131
     }
125
-    
126
-    /** 
132
+
133
+    /**
127 134
      * 通过主键删除数据
128 135
      *
129 136
      * @param id 主键
@@ -133,7 +140,7 @@ public class TaMandatoryLeaveController extends BaseController {
133 140
     @AccessLimit()
134 141
     @ApiOperation("通过主键删除数据")
135 142
     @DeleteMapping("/taMandatoryLeave/{id}")
136
-    public SaResult deleteById(@ApiParam("对象ID") @PathVariable String id){
143
+    public SaResult deleteById(@ApiParam("对象ID") @PathVariable String id) {
137 144
         taMandatoryLeaveService.removeById(id);
138 145
         return SaResult.data("success");
139 146
     }

+ 9
- 1
application/src/main/java/com/lyg/application/controller/TaMessageController.java Parādīt failu

@@ -42,7 +42,14 @@ public class TaMessageController extends BaseController {
42 42
     @ApiOperation("通过ID查询单条数据")
43 43
     @GetMapping("/taMessage/{id}")
44 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,6 +70,7 @@ public class TaMessageController extends BaseController {
63 70
 
64 71
         IPage<TaMessage> pg = new Page<>(pageNum, pageSize);
65 72
         QueryWrapper<TaMessage> queryWrapper = new QueryWrapper<>();
73
+        queryWrapper.eq(StringUtil.isNotEmpty(checkAuth()), "CREATE_USER", checkAuth());
66 74
         queryWrapper.orderByAsc(StringUtil.isNotEmpty(sortAsc), StringUtil.humpToLine(sortAsc));
67 75
         queryWrapper.orderByDesc(StringUtil.isNotEmpty(sortDesc), StringUtil.humpToLine(sortDesc));
68 76
         IPage<TaMessage> result = taMessageService.page(pg, queryWrapper);

+ 10
- 1
application/src/main/java/com/lyg/application/controller/TaRotationController.java Parādīt failu

@@ -50,7 +50,15 @@ public class TaRotationController extends BaseController {
50 50
     @ApiOperation("通过ID查询单条数据")
51 51
     @GetMapping("/taRotation/{id}")
52 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,6 +90,7 @@ public class TaRotationController extends BaseController {
82 90
 
83 91
         IPage<TaRotation> pg = new Page<>(pageNum, pageSize);
84 92
         QueryWrapper<TaRotation> queryWrapper = new QueryWrapper<>();
93
+        queryWrapper.eq(StringUtil.isNotEmpty(checkAuth()), "CREATE_USER", checkAuth());
85 94
         queryWrapper.like(StringUtil.isNotEmpty(headOfficeOrg), "head_office_org", headOfficeOrg);
86 95
         queryWrapper.eq(StringUtil.isNotEmpty(employeeNum), "employee_num", employeeNum);
87 96
         queryWrapper.like(StringUtil.isNotEmpty(employeeName), "employee_name", employeeName);

+ 35
- 27
application/src/main/java/com/lyg/application/controller/TaSendingController.java Parādīt failu

@@ -4,23 +4,22 @@ 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.TaSending;
8
+import com.lyg.application.service.TaSendingService;
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.TaSending;
20
-import com.lyg.application.service.TaSendingService;
21 19
 
22
- /**
20
+/**
23 21
  * 发送消息;(ta_sending)表控制层
22
+ *
24 23
  * @author : http://njyunzhi.com
25 24
  * @date : 2024-3-14
26 25
  */
@@ -28,12 +27,12 @@ import com.lyg.application.service.TaSendingService;
28 27
 @RestController
29 28
 @RequestMapping("/")
30 29
 public class TaSendingController extends BaseController {
31
-    
30
+
32 31
     @Autowired
33 32
     private TaSendingService taSendingService;
34
-    
35
-    /** 
36
-     * 通过ID查询单条数据 
33
+
34
+    /**
35
+     * 通过ID查询单条数据
37 36
      *
38 37
      * @param id 主键
39 38
      * @return 实例对象
@@ -43,13 +42,21 @@ public class TaSendingController extends BaseController {
43 42
     @ApiOperation("通过ID查询单条数据")
44 43
     @GetMapping("/taSending/{id}")
45 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 60
      * @param pageSize 每页条数
54 61
      * @return 查询结果
55 62
      */
@@ -57,20 +64,21 @@ public class TaSendingController extends BaseController {
57 64
     @AccessLimit()
58 65
     @ApiOperation("分页查询")
59 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 71
         IPage<TaSending> pg = new Page<>(pageNum, pageSize);
65 72
         QueryWrapper<TaSending> queryWrapper = new QueryWrapper<>();
73
+        queryWrapper.eq(StringUtil.isNotEmpty(checkAuth()), "RECIPIENT_ID", checkAuth());
66 74
         queryWrapper.orderByAsc(StringUtil.isNotEmpty(sortAsc), StringUtil.humpToLine(sortAsc));
67 75
         queryWrapper.orderByDesc(StringUtil.isNotEmpty(sortDesc), StringUtil.humpToLine(sortDesc));
68 76
         IPage<TaSending> result = taSendingService.page(pg, queryWrapper);
69
-        
77
+
70 78
         return SaResult.data(result);
71 79
     }
72
-    
73
-    /** 
80
+
81
+    /**
74 82
      * 新增数据
75 83
      *
76 84
      * @param taSending 实例对象
@@ -84,8 +92,8 @@ public class TaSendingController extends BaseController {
84 92
         taSendingService.save(taSending);
85 93
         return SaResult.data(taSending);
86 94
     }
87
-    
88
-    /** 
95
+
96
+    /**
89 97
      * 更新数据
90 98
      *
91 99
      * @param taSending 实例对象
@@ -96,13 +104,13 @@ public class TaSendingController extends BaseController {
96 104
     @ApiOperation("更新数据")
97 105
     @PutMapping("/taSending/{id}")
98 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 108
         taSending.setSendingId(id);
101 109
         taSendingService.updateById(taSending);
102 110
         return SaResult.data(taSending);
103 111
     }
104
-    
105
-    /** 
112
+
113
+    /**
106 114
      * 通过主键删除数据
107 115
      *
108 116
      * @param id 主键
@@ -112,7 +120,7 @@ public class TaSendingController extends BaseController {
112 120
     @AccessLimit()
113 121
     @ApiOperation("通过主键删除数据")
114 122
     @DeleteMapping("/taSending/{id}")
115
-    public SaResult deleteById(@ApiParam("对象ID") @PathVariable String id){
123
+    public SaResult deleteById(@ApiParam("对象ID") @PathVariable String id) {
116 124
         taSendingService.removeById(id);
117 125
         return SaResult.data("success");
118 126
     }

+ 10
- 18
application/src/main/java/com/lyg/application/controller/UploadController.java Parādīt failu

@@ -2,12 +2,10 @@ package com.lyg.application.controller;
2 2
 
3 3
 import cn.dev33.satoken.util.SaResult;
4 4
 import com.alibaba.excel.EasyExcel;
5
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
6 5
 import com.lyg.application.Listener.TaMandatoryLeaveListener;
7 6
 import com.lyg.application.Listener.TaRotationListener;
8 7
 import com.lyg.application.entity.TaMandatoryLeave;
9 8
 import com.lyg.application.entity.TaRotation;
10
-import com.lyg.application.mapper.TaRotationMapper;
11 9
 import com.lyg.application.service.TaMandatoryLeaveService;
12 10
 import com.lyg.application.service.TaRotationService;
13 11
 import com.lyg.application.service.impl.TaMandatoryLeaveServiceImpl;
@@ -18,6 +16,8 @@ import io.swagger.annotations.Api;
18 16
 import io.swagger.annotations.ApiOperation;
19 17
 import io.swagger.annotations.ApiParam;
20 18
 import org.springframework.beans.factory.annotation.Autowired;
19
+import org.springframework.beans.factory.annotation.Value;
20
+import org.springframework.scheduling.annotation.Scheduled;
21 21
 import org.springframework.web.bind.annotation.*;
22 22
 import org.springframework.web.multipart.MultipartFile;
23 23
 
@@ -39,20 +39,19 @@ import java.util.List;
39 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 46
     @Autowired
43 47
     private TaRotationService taRotationService;
44
-
45
-
46
-
47 48
     @Autowired
48 49
     private TaRotationServiceImpl taRotationServiceImpl;
49 50
     @Autowired
50 51
     private TaMandatoryLeaveService taMandatoryLeaveService;
51
-
52 52
     @Autowired
53 53
     private TaMandatoryLeaveServiceImpl taMandatoryLeaveServiceImpl;
54 54
 
55
-
56 55
     @AccessLimit()
57 56
     @ApiOperation("上传文件")
58 57
     @PostMapping("/upload/taRotation")
@@ -119,21 +118,14 @@ public class UploadController extends BaseController {
119 118
     }
120 119
 
121 120
 
121
+
122 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 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 Parādīt failu

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

+ 28
- 0
application/src/main/java/com/lyg/application/job/MandatoryJobTime.java Parādīt failu

@@ -0,0 +1,28 @@
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 Parādīt failu

@@ -0,0 +1,33 @@
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 Parādīt failu

@@ -1,16 +1,21 @@
1 1
 package com.lyg.application.mapper;
2 2
 
3 3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.lyg.application.entity.TaRotation;
4 5
 import org.apache.ibatis.annotations.Mapper;
5 6
 import org.apache.ibatis.annotations.Param;
6 7
 import com.lyg.application.entity.TaMandatoryLeave;
7 8
 
8
- /**
9
+import java.time.LocalDate;
10
+import java.util.List;
11
+
12
+/**
9 13
  * 强制休假表;(ta_mandatory_leave)表数据库访问层
10 14
  * @author : http://njyunzhi.com
11 15
  * @date : 2024-3-6
12 16
  */
13 17
 @Mapper
14 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 Parādīt failu

@@ -1,98 +0,0 @@
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 Parādīt failu

@@ -15,4 +15,6 @@ import java.util.List;
15 15
 public interface TaMandatoryLeaveService extends IBaseService<TaMandatoryLeave> {
16 16
  TaMandatoryLeave handleEntity(TaMandatoryLeave entity, Integer index) throws Exception;
17 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 Parādīt failu

@@ -1,13 +1,22 @@
1 1
 package com.lyg.application.service.impl;
2 2
 
3 3
 import com.lyg.application.entity.TaMandatoryLeave;
4
+import com.lyg.application.entity.TaMessage;
5
+import com.lyg.application.entity.TaSending;
4 6
 import com.lyg.application.mapper.TaMandatoryLeaveMapper;
7
+import com.lyg.application.mapper.TaMessageMapper;
8
+import com.lyg.application.mapper.TaSendingMapper;
5 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 13
 import com.lyg.system.mapper.SysPositionMapper;
14
+import com.lyg.system.mapper.SysUserMapper;
7 15
 import com.lyg.system.service.SysOrgService;
8 16
 import com.lyg.system.service.SysPositionService;
9 17
 import com.lyg.system.service.impl.BaseServiceImpl;
10 18
 import org.springframework.beans.factory.annotation.Autowired;
19
+import org.springframework.beans.factory.annotation.Value;
11 20
 import org.springframework.stereotype.Service;
12 21
 
13 22
 import java.time.LocalDate;
@@ -23,12 +32,22 @@ import java.util.List;
23 32
 @Service
24 33
 public class TaMandatoryLeaveServiceImpl extends BaseServiceImpl<TaMandatoryLeaveMapper, TaMandatoryLeave> implements TaMandatoryLeaveService {
25 34
     private final List<String> errorMessages = new ArrayList<>();
35
+    @Value("${yz.holidayTmp}")
36
+    String holidayTmp;
26 37
     @Autowired
27 38
     private SysOrgService sysOrgService;
28 39
     @Autowired
29 40
     private SysPositionService sysPositionService;
30 41
     @Autowired
31 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 52
     @Override
34 53
     public TaMandatoryLeave handleEntity(TaMandatoryLeave entity, Integer index) throws Exception {
@@ -85,8 +104,65 @@ public class TaMandatoryLeaveServiceImpl extends BaseServiceImpl<TaMandatoryLeav
85 104
         }
86 105
     }
87 106
 
107
+
88 108
     public List<String> getErrorMessages() {
89 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 Parādīt failu

@@ -6,6 +6,7 @@ import com.lyg.application.entity.TaSending;
6 6
 import com.lyg.application.mapper.TaMessageMapper;
7 7
 import com.lyg.application.mapper.TaRotationMapper;
8 8
 import com.lyg.application.mapper.TaSendingMapper;
9
+import com.lyg.application.service.TaMessageService;
9 10
 import com.lyg.application.service.TaRotationService;
10 11
 import com.lyg.application.util.Rule;
11 12
 import com.lyg.common.util.StringUtil;
@@ -17,6 +18,7 @@ import com.lyg.system.service.SysPositionService;
17 18
 import com.lyg.system.service.SysUserService;
18 19
 import com.lyg.system.service.impl.BaseServiceImpl;
19 20
 import org.springframework.beans.factory.annotation.Autowired;
21
+import org.springframework.beans.factory.annotation.Value;
20 22
 import org.springframework.stereotype.Service;
21 23
 
22 24
 import java.time.LocalDate;
@@ -36,6 +38,10 @@ public class TaRotationServiceImpl extends BaseServiceImpl<TaRotationMapper, TaR
36 38
     private final List<Object> errorMessages = new ArrayList<>();
37 39
     @Autowired
38 40
     Rule rule;
41
+    @Value("${yz.warningTmp}")
42
+    String warningTmp;
43
+    @Value("${yz.promptTmp}")
44
+    String promptTmp;
39 45
     @Autowired
40 46
     private SysOrgService sysOrgService;
41 47
     @Autowired
@@ -45,8 +51,9 @@ public class TaRotationServiceImpl extends BaseServiceImpl<TaRotationMapper, TaR
45 51
     @Autowired
46 52
     private TaMessageMapper taMessageMapper;
47 53
     @Autowired
54
+    private TaMessageService taMessageService;
55
+    @Autowired
48 56
     private TaSendingMapper taSendingMapper;
49
-
50 57
     @Autowired
51 58
     private SysUserService sysUserService;
52 59
     @Autowired
@@ -134,53 +141,56 @@ public class TaRotationServiceImpl extends BaseServiceImpl<TaRotationMapper, TaR
134 141
     @Override
135 142
     public void selectGetWaring() {
136 143
         LocalDate localDate = LocalDate.now();
137
-
144
+        Integer numI = 3;
145
+        Integer nameI = 8;
138 146
 //预警 消息
139 147
         List<TaRotation> earlyWaringList = baseMapper.waring(localDate);
148
+
140 149
         if (earlyWaringList.size() != 0) {
141 150
             for (TaRotation item : earlyWaringList) {
142 151
                 TaMessage taMessage = new TaMessage();
143 152
                 String uuid = StringUtil.UUID();
144 153
                 taMessage.setMessageId(uuid);
145 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 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 172
         List<TaRotation> earlyPromptList = baseMapper.prompt(localDate);
173
+
175 174
         if (earlyPromptList.size() != 0) {
176 175
             for (TaRotation item : earlyPromptList) {
177 176
                 TaMessage taMessage = new TaMessage();
177
+                String uuid = StringUtil.UUID();
178
+                taMessage.setMessageId(uuid);
178 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 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,6 +198,27 @@ public class TaRotationServiceImpl extends BaseServiceImpl<TaRotationMapper, TaR
188 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 223
     public List<Object> getErrorMessages() {
193 224
         return errorMessages;

+ 4
- 1
application/src/main/resources/application.yml Parādīt failu

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

+ 11
- 1
application/src/main/resources/mapper/TaMandatoryLeaveMapper.xml Parādīt failu

@@ -2,5 +2,15 @@
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.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 16
 </mapper>

+ 7
- 3
application/src/main/resources/mapper/TaRotationMapper.xml Parādīt failu

@@ -23,11 +23,15 @@
23 23
     </select>
24 24
     <select id="waring" resultType="com.lyg.application.entity.TaRotation">
25 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 29
     </select>
28 30
     <select id="prompt" resultType="com.lyg.application.entity.TaRotation">
29 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 36
     </select>
33 37
 </mapper>

+ 5
- 9
system/src/main/java/com/lyg/system/controller/BaseController.java Parādīt failu

@@ -1,6 +1,7 @@
1 1
 package com.lyg.system.controller;
2 2
 
3 3
 import cn.dev33.satoken.stp.StpUtil;
4
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4 5
 import com.lyg.common.Constants;
5 6
 import com.lyg.common.util.StringUtil;
6 7
 import com.lyg.system.entity.SysUser;
@@ -31,17 +32,12 @@ public class BaseController {
31 32
      */
32 33
 
33 34
     @SneakyThrows
34
-    public void checkAuth() {
35
+    public String checkAuth() {
35 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
     /**