张涛 1 year ago
parent
commit
dc5dc27446

+ 1
- 1
application/src/main/java/com/lyg/application/controller/UploadController.java View File

124
     @GetMapping("/as/holiday")
124
     @GetMapping("/as/holiday")
125
     public void promptWarning() throws Exception {
125
     public void promptWarning() throws Exception {
126
 
126
 
127
-        taRotationService.selectGetWaring();
127
+//        taRotationService.selectGetWaring();
128
 //        taMandatoryLeaveService.selectGetPrompt();
128
 //        taMandatoryLeaveService.selectGetPrompt();
129
 
129
 
130
     }
130
     }

+ 0
- 52
application/src/main/java/com/lyg/application/service/impl/TaRotationServiceImpl.java View File

144
 
144
 
145
     @Override
145
     @Override
146
     public void selectGetWaring() {
146
     public void selectGetWaring() {
147
-//
148
-////预警 消息
149
-//        List<TaRotation> earlyWaringList = baseMapper.waring(localDate);
150
-//
151
-//        if (!earlyWaringList.isEmpty()) {
152
-//            for (TaRotation item : earlyWaringList) {
153
-//                TaMessage taMessage = new TaMessage();
154
-//                String uuid = StringUtil.UUID();
155
-//                taMessage.setMessageId(uuid);
156
-//                taMessage.setSourceId(item.getRotationId());
157
-//                StringBuilder sb = new StringBuilder(warningTmp);
158
-//                sb.insert(Constants.numI, item.getEmployeeNum());
159
-//                Integer i = item.getEmployeeNum().length() + Constants.nameI;
160
-//                sb.insert(i, item.getEmployeeName());
161
-//                taMessage.setContentSent(sb.toString());
162
-//                taMessage.setSourceName("taRotation");
163
-//                taMessage.setWaringType("waring");
164
-//
165
-//                Long count = taMessageService.countBy("source_id", item.getRotationId(), true);
166
-//                if (count == 0) {
167
-//                    taMessageMapper.insert(taMessage);
168
-//                    insertIntoTaSending(item.getCreateUser(), uuid);
169
-//                }
170
-//
171
-//            }
172
-//        }
173
-////提示消息
174
-//        List<TaRotation> earlyPromptList = baseMapper.prompt(localDate);
175
-//
176
-//        if (earlyPromptList.size() != 0) {
177
-//            for (TaRotation item : earlyPromptList) {
178
-//                TaMessage taMessage = new TaMessage();
179
-//                String uuid = StringUtil.UUID();
180
-//                taMessage.setMessageId(uuid);
181
-//                taMessage.setSourceId(item.getRotationId());
182
-//                StringBuilder sb = new StringBuilder(promptTmp);
183
-//                sb.insert(Constants.numI, item.getEmployeeNum());
184
-//                Integer i = item.getEmployeeNum().length() + Constants.nameI;
185
-//                sb.insert(i, item.getEmployeeName());
186
-//                taMessage.setContentSent(sb.toString());
187
-//                taMessage.setSourceName("taRotation");
188
-//                taMessage.setWaringType("prompt");
189
-//
190
-//                Long count = taMessageService.countBy("source_id", item.getRotationId(), true);
191
-//                if (count == 0) {
192
-//                    taMessageMapper.insert(taMessage);
193
-//                    insertIntoTaSending(item.getCreateUser(), uuid);
194
-//                }
195
-//
196
-//            }
197
-//        }
198
 
147
 
199
-//        return;
200
         LocalDate localDate = LocalDate.now();
148
         LocalDate localDate = LocalDate.now();
201
 
149
 
202
         // 预警消息处理
150
         // 预警消息处理

+ 1
- 3
application/src/main/java/com/lyg/application/util/Rule.java View File

51
             if (!result.isEmpty()) {
51
             if (!result.isEmpty()) {
52
                 isRulesCompatible = result.stream()
52
                 isRulesCompatible = result.stream()
53
                         .allMatch(error -> error.getRules() != null && error.getRules().contains(COMPATIBLE_TEXT));
53
                         .allMatch(error -> error.getRules() != null && error.getRules().contains(COMPATIBLE_TEXT));
54
-
55
-
56
             }
54
             }
57
 
55
 
58
-            String message = (isRulesCompatible  ? "相容" : "相容";
56
+            String message = (isRulesCompatible  ? "相容" : "相容");
59
 
57
 
60
 
58
 
61
                 int statusCode = 200; // HTTP状态码
59
                 int statusCode = 200; // HTTP状态码

+ 3
- 1
application/src/main/resources/mapper/TaRotationMapper.xml View File

10
         AND r.specific_org_num != r.org_num_job_rotation
10
         AND r.specific_org_num != r.org_num_job_rotation
11
         AND r.specific_org_num=#{params.oldOrgCode}
11
         AND r.specific_org_num=#{params.oldOrgCode}
12
         AND r.org_num_job_rotation=#{params.newOrgCode}
12
         AND r.org_num_job_rotation=#{params.newOrgCode}
13
-        AND r.rotation_exe_time &lt;=#{newDate}
13
+        AND r.rotation_exe_time &gt;=#{newDate}
14
         AND r.counter_imp_positions IN
14
         AND r.counter_imp_positions IN
15
         <foreach item="item" index="index" collection="orgList" open="(" separator="," close=")">
15
         <foreach item="item" index="index" collection="orgList" open="(" separator="," close=")">
16
             #{item}
16
             #{item}
20
         <foreach item="item" index="index" collection="targetList" open="(" separator="," close=")">
20
         <foreach item="item" index="index" collection="targetList" open="(" separator="," close=")">
21
             #{item}
21
             #{item}
22
         </foreach>
22
         </foreach>
23
+        And r.counter_imp_positions != r.counter_imp_post_rotation
24
+
23
     </select>
25
     </select>
24
     <select id="waring" resultType="com.lyg.application.entity.TaRotation">
26
     <select id="waring" resultType="com.lyg.application.entity.TaRotation">
25
         SELECT * FROM TA_ROTATION r
27
         SELECT * FROM TA_ROTATION r

+ 2
- 2
system/src/main/java/com/lyg/system/controller/BaseController.java View File

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;
5
 import com.lyg.common.Constants;
4
 import com.lyg.common.Constants;
6
 import com.lyg.common.util.StringUtil;
5
 import com.lyg.common.util.StringUtil;
7
 import com.lyg.system.entity.SysUser;
6
 import com.lyg.system.entity.SysUser;
34
     @SneakyThrows
33
     @SneakyThrows
35
     public String checkAuth() {
34
     public String checkAuth() {
36
         SysUser sysUser = currentUser();
35
         SysUser sysUser = currentUser();
37
-        if (sysUser.getIsAdmin() != 1) {
36
+        Integer isAdmin = sysUser.getIsAdmin();
37
+        if (isAdmin != 1 || isAdmin == null) {
38
             return sysUser.getUserId();
38
             return sysUser.getUserId();
39
         }
39
         }
40
         return null;
40
         return null;