Commit a73f62e53f208682af879d4ffefaf9f87ae554c1

Authored by zhangdaiscott
1 parent 690949c2

【3.2.0 版本发布】 升级springboot2.6.6、mybatis-plus3.5.1、代码规范化调整

Showing 145 changed files with 1936 additions and 526 deletions

Too many changes to show.

To preserve performance only 100 of 145 files are displayed.

jeecg-boot/jeecg-boot-module-system/Dockerfile
... ... @@ -11,6 +11,6 @@ WORKDIR /jeecg-boot
11 11 EXPOSE 8080
12 12  
13 13 ADD ./src/main/resources/jeecg ./config/jeecg
14   -ADD ./target/jeecg-boot-module-system-3.1.0.jar ./
  14 +ADD ./target/jeecg-boot-module-system-3.2.0.jar ./
15 15  
16   -CMD sleep 60;java -Djava.security.egd=file:/dev/./urandom -jar jeecg-boot-module-system-3.1.0.jar
17 16 \ No newline at end of file
  17 +CMD sleep 60;java -Djava.security.egd=file:/dev/./urandom -jar jeecg-boot-module-system-3.2.0.jar
18 18 \ No newline at end of file
... ...
jeecg-boot/jeecg-boot-module-system/pom.xml
... ... @@ -4,7 +4,7 @@
4 4 <parent>
5 5 <groupId>org.jeecgframework.boot</groupId>
6 6 <artifactId>jeecg-boot-parent</artifactId>
7   - <version>3.1.0</version>
  7 + <version>3.2.0</version>
8 8 </parent>
9 9 <modelVersion>4.0.0</modelVersion>
10 10  
... ... @@ -34,35 +34,23 @@
34 34 <groupId>org.jeecgframework.boot</groupId>
35 35 <artifactId>jeecg-system-local-api</artifactId>
36 36 </dependency>
37   - <!-- jeewx api -->
  37 + <!-- 企业微信/钉钉 api -->
38 38 <dependency>
39 39 <groupId>org.jeecgframework</groupId>
40 40 <artifactId>jeewx-api</artifactId>
41   - <version>1.4.7</version>
42   - <exclusions>
43   - <exclusion>
44   - <artifactId>commons-beanutils</artifactId>
45   - <groupId>commons-beanutils</groupId>
46   - </exclusion>
47   - <exclusion>
48   - <artifactId>commons-lang</artifactId>
49   - <groupId>commons-lang</groupId>
50   - </exclusion>
51   - </exclusions>
52 41 </dependency>
53 42 <!-- 积木报表 -->
54 43 <dependency>
55 44 <groupId>org.jeecgframework.jimureport</groupId>
56 45 <artifactId>jimureport-spring-boot-starter</artifactId>
57   - <version>1.4.4-beta</version>
  46 + <version>1.5.0-beta</version>
58 47 </dependency>
59 48  
60   -
61   - <!-- DEMO 示例模块【微服务启动请注释掉】 -->
  49 + <!-- DEMO 示例模块 -->
62 50 <dependency>
63 51 <groupId>org.jeecgframework.boot</groupId>
64 52 <artifactId>jeecg-boot-module-demo</artifactId>
65   - <version>3.1.0</version>
  53 + <version>${jeecgboot.version}</version>
66 54 </dependency>
67 55  
68 56 </dependencies>
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/JeecgOneToMainUtil.java
... ... @@ -22,19 +22,27 @@ public class JeecgOneToMainUtil {
22 22 public static void main(String[] args) {
23 23 //第一步:设置主表配置
24 24 MainTableVo mainTable = new MainTableVo();
25   - mainTable.setTableName("jeecg_order_main");//表名
26   - mainTable.setEntityName("GuiTestOrderMain"); //实体名
27   - mainTable.setEntityPackage("gui"); //包名
28   - mainTable.setFtlDescription("GUI订单管理"); //描述
  25 + //表名
  26 + mainTable.setTableName("jeecg_order_main");
  27 + //实体名
  28 + mainTable.setEntityName("GuiTestOrderMain");
  29 + //包名
  30 + mainTable.setEntityPackage("gui");
  31 + //描述
  32 + mainTable.setFtlDescription("GUI订单管理");
29 33  
30 34 //第二步:设置子表集合配置
31 35 List<SubTableVo> subTables = new ArrayList<SubTableVo>();
32 36 //[1].子表一
33 37 SubTableVo po = new SubTableVo();
34   - po.setTableName("jeecg_order_customer");//表名
35   - po.setEntityName("GuiTestOrderCustom"); //实体名
36   - po.setEntityPackage("gui"); //包名
37   - po.setFtlDescription("客户明细"); //描述
  38 + //表名
  39 + po.setTableName("jeecg_order_customer");
  40 + //实体名
  41 + po.setEntityName("GuiTestOrderCustom");
  42 + //包名
  43 + po.setEntityPackage("gui");
  44 + //描述
  45 + po.setFtlDescription("客户明细");
38 46 //子表外键参数配置
39 47 /*说明:
40 48 * a) 子表引用主表主键ID作为外键,外键字段必须以_ID结尾;
... ... @@ -45,10 +53,14 @@ public class JeecgOneToMainUtil {
45 53 subTables.add(po);
46 54 //[2].子表二
47 55 SubTableVo po2 = new SubTableVo();
48   - po2.setTableName("jeecg_order_ticket"); //表名
49   - po2.setEntityName("GuiTestOrderTicket"); //实体名
50   - po2.setEntityPackage("gui"); //包名
51   - po2.setFtlDescription("产品明细"); //描述
  56 + //表名
  57 + po2.setTableName("jeecg_order_ticket");
  58 + //实体名
  59 + po2.setEntityName("GuiTestOrderTicket");
  60 + //包名
  61 + po2.setEntityPackage("gui");
  62 + //描述
  63 + po2.setFtlDescription("产品明细");
52 64 //子表外键参数配置
53 65 /*说明:
54 66 * a) 子表引用主表主键ID作为外键,外键字段必须以_ID结尾;
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/JeecgSystemApplication.java
1 1 package org.jeecg;
2 2  
3 3 import lombok.extern.slf4j.Slf4j;
4   -import org.apache.catalina.Context;
5   -import org.apache.tomcat.util.scan.StandardJarScanner;
6 4 import org.jeecg.common.util.oConvertUtils;
7 5 import org.springframework.boot.SpringApplication;
8   -//import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
9 6 import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
10 7 import org.springframework.boot.autoconfigure.SpringBootApplication;
11 8 import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration;
12 9 import org.springframework.boot.builder.SpringApplicationBuilder;
13   -import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
14 10 import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
15 11 import org.springframework.context.ConfigurableApplicationContext;
16   -import org.springframework.context.annotation.Bean;
17 12 import org.springframework.core.env.Environment;
18 13  
19 14 import java.net.InetAddress;
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/config/init/CodeGenerateDbConfig.java
... ... @@ -43,7 +43,7 @@ public class CodeGenerateDbConfig {
43 43 }
44 44 }
45 45 CodegenDatasourceConfig.initDbConfig(driverClassName,url, username, password);
46   - log.info(" 代码生成器数据库连接,使用application.yml的DB配置 ###################");
  46 + log.info(" Init CodeGenerate Config [ Get Db Config From application.yml ] ");
47 47 }
48 48 return null;
49 49 }
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/config/jimureport/JimuReportTokenService.java
1 1 package org.jeecg.config.jimureport;
2 2  
3 3 import lombok.extern.slf4j.Slf4j;
4   -import org.jeecg.common.system.api.ISysBaseAPI;
5 4 import org.jeecg.common.system.util.JwtUtil;
6 5 import org.jeecg.common.system.vo.SysUserCacheInfo;
7 6 import org.jeecg.common.util.RedisUtil;
8 7 import org.jeecg.common.util.TokenUtils;
9 8 import org.jeecg.modules.jmreport.api.JmReportTokenServiceI;
  9 +import org.jeecg.modules.system.service.impl.SysBaseApiImpl;
10 10 import org.springframework.beans.factory.annotation.Autowired;
11 11 import org.springframework.context.annotation.Lazy;
12 12 import org.springframework.stereotype.Component;
... ... @@ -19,6 +19,7 @@ import java.util.Map;
19 19 * 自定义积木报表鉴权(如果不进行自定义,则所有请求不做权限控制)
20 20 * * 1.自定义获取登录token
21 21 * * 2.自定义获取登录用户
  22 + * @author: jeecg-boot
22 23 */
23 24  
24 25  
... ... @@ -26,7 +27,7 @@ import java.util.Map;
26 27 @Component
27 28 public class JimuReportTokenService implements JmReportTokenServiceI {
28 29 @Autowired
29   - private ISysBaseAPI sysBaseAPI;
  30 + private SysBaseApiImpl sysBaseApi;
30 31 @Autowired
31 32 @Lazy
32 33 private RedisUtil redisUtil;
... ... @@ -43,17 +44,17 @@ public class JimuReportTokenService implements JmReportTokenServiceI {
43 44  
44 45 @Override
45 46 public Boolean verifyToken(String token) {
46   - return TokenUtils.verifyToken(token, sysBaseAPI, redisUtil);
  47 + return TokenUtils.verifyToken(token, sysBaseApi, redisUtil);
47 48 }
48 49  
49 50 @Override
50 51 public Map<String, Object> getUserInfo(String token) {
51   - Map<String, Object> map = new HashMap<String, Object>();
  52 + Map<String, Object> map = new HashMap(5);
52 53 String username = JwtUtil.getUsername(token);
53 54 //此处通过token只能拿到一个信息 用户账号 后面的就是根据账号获取其他信息 查询数据或是走redis 用户根据自身业务可自定义
54 55 SysUserCacheInfo userInfo = null;
55 56 try {
56   - userInfo = sysBaseAPI.getCacheUser(username);
  57 + userInfo = sysBaseApi.getCacheUser(username);
57 58 } catch (Exception e) {
58 59 log.error("获取用户信息异常:"+ e.getMessage());
59 60 return map;
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/controller/SystemAPIController.java
1 1 package org.jeecg.modules.api.controller;
2 2  
3 3 import com.alibaba.fastjson.JSONObject;
  4 +import lombok.extern.slf4j.Slf4j;
4 5 import org.jeecg.common.api.dto.OnlineAuthDTO;
5 6 import org.jeecg.common.api.dto.message.*;
6   -import org.jeecg.common.system.api.ISysBaseAPI;
7 7 import org.jeecg.common.system.vo.*;
8 8 import org.jeecg.modules.system.service.ISysUserService;
  9 +import org.jeecg.modules.system.service.impl.SysBaseApiImpl;
9 10 import org.springframework.beans.factory.annotation.Autowired;
10 11 import org.springframework.web.bind.annotation.*;
11 12  
... ... @@ -16,14 +17,15 @@ import java.util.Set;
16 17  
17 18 /**
18 19 * 服务化 system模块 对外接口请求类
  20 + * @author: jeecg-boot
19 21 */
  22 +@Slf4j
20 23 @RestController
21 24 @RequestMapping("/sys/api")
22 25 public class SystemAPIController {
23 26  
24 27 @Autowired
25   - private ISysBaseAPI sysBaseAPI;
26   -
  28 + private SysBaseApiImpl sysBaseApi;
27 29 @Autowired
28 30 private ISysUserService sysUserService;
29 31  
... ... @@ -34,7 +36,7 @@ public class SystemAPIController {
34 36 */
35 37 @PostMapping("/sendSysAnnouncement")
36 38 public void sendSysAnnouncement(@RequestBody MessageDTO message){
37   - sysBaseAPI.sendSysAnnouncement(message);
  39 + sysBaseApi.sendSysAnnouncement(message);
38 40 }
39 41  
40 42 /**
... ... @@ -43,7 +45,7 @@ public class SystemAPIController {
43 45 */
44 46 @PostMapping("/sendBusAnnouncement")
45 47 public void sendBusAnnouncement(@RequestBody BusMessageDTO message){
46   - sysBaseAPI.sendBusAnnouncement(message);
  48 + sysBaseApi.sendBusAnnouncement(message);
47 49 }
48 50  
49 51 /**
... ... @@ -52,7 +54,7 @@ public class SystemAPIController {
52 54 */
53 55 @PostMapping("/sendTemplateAnnouncement")
54 56 public void sendTemplateAnnouncement(@RequestBody TemplateMessageDTO message){
55   - sysBaseAPI.sendTemplateAnnouncement(message);
  57 + sysBaseApi.sendTemplateAnnouncement(message);
56 58 }
57 59  
58 60 /**
... ... @@ -61,7 +63,7 @@ public class SystemAPIController {
61 63 */
62 64 @PostMapping("/sendBusTemplateAnnouncement")
63 65 public void sendBusTemplateAnnouncement(@RequestBody BusTemplateMessageDTO message){
64   - sysBaseAPI.sendBusTemplateAnnouncement(message);
  66 + sysBaseApi.sendBusTemplateAnnouncement(message);
65 67 }
66 68  
67 69 /**
... ... @@ -71,7 +73,7 @@ public class SystemAPIController {
71 73 */
72 74 @PostMapping("/parseTemplateByCode")
73 75 public String parseTemplateByCode(@RequestBody TemplateDTO templateDTO){
74   - return sysBaseAPI.parseTemplateByCode(templateDTO);
  76 + return sysBaseApi.parseTemplateByCode(templateDTO);
75 77 }
76 78  
77 79 /**
... ... @@ -79,7 +81,7 @@ public class SystemAPIController {
79 81 */
80 82 @GetMapping("/updateSysAnnounReadFlag")
81 83 public void updateSysAnnounReadFlag(@RequestParam("busType") String busType, @RequestParam("busId")String busId){
82   - sysBaseAPI.updateSysAnnounReadFlag(busType, busId);
  84 + sysBaseApi.updateSysAnnounReadFlag(busType, busId);
83 85 }
84 86  
85 87 /**
... ... @@ -89,7 +91,7 @@ public class SystemAPIController {
89 91 */
90 92 @GetMapping("/getUserByName")
91 93 public LoginUser getUserByName(@RequestParam("username") String username){
92   - return sysBaseAPI.getUserByName(username);
  94 + return sysBaseApi.getUserByName(username);
93 95 }
94 96  
95 97 /**
... ... @@ -99,7 +101,7 @@ public class SystemAPIController {
99 101 */
100 102 @GetMapping("/getUserById")
101 103 LoginUser getUserById(@RequestParam("id") String id){
102   - return sysBaseAPI.getUserById(id);
  104 + return sysBaseApi.getUserById(id);
103 105 }
104 106  
105 107 /**
... ... @@ -109,7 +111,7 @@ public class SystemAPIController {
109 111 */
110 112 @GetMapping("/getRolesByUsername")
111 113 List<String> getRolesByUsername(@RequestParam("username") String username){
112   - return sysBaseAPI.getRolesByUsername(username);
  114 + return sysBaseApi.getRolesByUsername(username);
113 115 }
114 116  
115 117 /**
... ... @@ -119,7 +121,7 @@ public class SystemAPIController {
119 121 */
120 122 @GetMapping("/getDepartIdsByUsername")
121 123 List<String> getDepartIdsByUsername(@RequestParam("username") String username){
122   - return sysBaseAPI.getDepartIdsByUsername(username);
  124 + return sysBaseApi.getDepartIdsByUsername(username);
123 125 }
124 126  
125 127 /**
... ... @@ -129,7 +131,7 @@ public class SystemAPIController {
129 131 */
130 132 @GetMapping("/getDepartNamesByUsername")
131 133 List<String> getDepartNamesByUsername(@RequestParam("username") String username){
132   - return sysBaseAPI.getDepartNamesByUsername(username);
  134 + return sysBaseApi.getDepartNamesByUsername(username);
133 135 }
134 136  
135 137  
... ... @@ -140,7 +142,7 @@ public class SystemAPIController {
140 142 */
141 143 @GetMapping("/queryDictItemsByCode")
142 144 List<DictModel> queryDictItemsByCode(@RequestParam("code") String code){
143   - return sysBaseAPI.queryDictItemsByCode(code);
  145 + return sysBaseApi.queryDictItemsByCode(code);
144 146 }
145 147  
146 148 /**
... ... @@ -150,23 +152,31 @@ public class SystemAPIController {
150 152 */
151 153 @GetMapping("/queryEnableDictItemsByCode")
152 154 List<DictModel> queryEnableDictItemsByCode(@RequestParam("code") String code){
153   - return sysBaseAPI.queryEnableDictItemsByCode(code);
  155 + return sysBaseApi.queryEnableDictItemsByCode(code);
154 156 }
155 157  
156 158  
157 159 /** 查询所有的父级字典,按照create_time排序 */
158 160 @GetMapping("/queryAllDict")
159 161 List<DictModel> queryAllDict(){
160   - return sysBaseAPI.queryAllDict();
  162 +// try{
  163 +// //睡10秒,gateway网关5秒超时,会触发熔断降级操作
  164 +// Thread.sleep(10000);
  165 +// }catch (Exception e){
  166 +// e.printStackTrace();
  167 +// }
  168 +
  169 + log.info("--微服务接口被调用--");
  170 + return sysBaseApi.queryAllDict();
161 171 }
162 172  
163 173 /**
164 174 * 查询所有分类字典
165 175 * @return
166 176 */
167   - @GetMapping("/queryAllDSysCategory")
168   - List<SysCategoryModel> queryAllDSysCategory(){
169   - return sysBaseAPI.queryAllDSysCategory();
  177 + @GetMapping("/queryAllSysCategory")
  178 + List<SysCategoryModel> queryAllSysCategory(){
  179 + return sysBaseApi.queryAllSysCategory();
170 180 }
171 181  
172 182  
... ... @@ -176,7 +186,7 @@ public class SystemAPIController {
176 186 */
177 187 @GetMapping("/queryAllDepartBackDictModel")
178 188 List<DictModel> queryAllDepartBackDictModel(){
179   - return sysBaseAPI.queryAllDepartBackDictModel();
  189 + return sysBaseApi.queryAllDepartBackDictModel();
180 190 }
181 191  
182 192 /**
... ... @@ -187,9 +197,9 @@ public class SystemAPIController {
187 197 @GetMapping("/queryAllRole")
188 198 public List<ComboModel> queryAllRole(@RequestParam(name = "roleIds",required = false)String[] roleIds){
189 199 if(roleIds==null || roleIds.length==0){
190   - return sysBaseAPI.queryAllRole();
  200 + return sysBaseApi.queryAllRole();
191 201 }else{
192   - return sysBaseAPI.queryAllRole(roleIds);
  202 + return sysBaseApi.queryAllRole(roleIds);
193 203 }
194 204 }
195 205  
... ... @@ -200,7 +210,7 @@ public class SystemAPIController {
200 210 */
201 211 @GetMapping("/getRoleIdsByUsername")
202 212 public List<String> getRoleIdsByUsername(@RequestParam("username")String username){
203   - return sysBaseAPI.getRoleIdsByUsername(username);
  213 + return sysBaseApi.getRoleIdsByUsername(username);
204 214 }
205 215  
206 216 /**
... ... @@ -210,7 +220,7 @@ public class SystemAPIController {
210 220 */
211 221 @GetMapping("/getDepartIdsByOrgCode")
212 222 public String getDepartIdsByOrgCode(@RequestParam("orgCode")String orgCode){
213   - return sysBaseAPI.getDepartIdsByOrgCode(orgCode);
  223 + return sysBaseApi.getDepartIdsByOrgCode(orgCode);
214 224 }
215 225  
216 226 /**
... ... @@ -219,7 +229,7 @@ public class SystemAPIController {
219 229 */
220 230 @GetMapping("/getAllSysDepart")
221 231 public List<SysDepartModel> getAllSysDepart(){
222   - return sysBaseAPI.getAllSysDepart();
  232 + return sysBaseApi.getAllSysDepart();
223 233 }
224 234  
225 235 /**
... ... @@ -230,7 +240,7 @@ public class SystemAPIController {
230 240 */
231 241 @GetMapping("/getDynamicDbSourceById")
232 242 DynamicDataSourceModel getDynamicDbSourceById(@RequestParam("dbSourceId")String dbSourceId){
233   - return sysBaseAPI.getDynamicDbSourceById(dbSourceId);
  243 + return sysBaseApi.getDynamicDbSourceById(dbSourceId);
234 244 }
235 245  
236 246  
... ... @@ -242,7 +252,7 @@ public class SystemAPIController {
242 252 */
243 253 @GetMapping("/getDeptHeadByDepId")
244 254 public List<String> getDeptHeadByDepId(@RequestParam("deptId") String deptId){
245   - return sysBaseAPI.getDeptHeadByDepId(deptId);
  255 + return sysBaseApi.getDeptHeadByDepId(deptId);
246 256 }
247 257  
248 258 /**
... ... @@ -252,7 +262,7 @@ public class SystemAPIController {
252 262 */
253 263 @GetMapping("/getParentDepartId")
254 264 public DictModel getParentDepartId(@RequestParam("departId")String departId){
255   - return sysBaseAPI.getParentDepartId(departId);
  265 + return sysBaseApi.getParentDepartId(departId);
256 266 }
257 267  
258 268 /**
... ... @@ -263,7 +273,7 @@ public class SystemAPIController {
263 273 */
264 274 @GetMapping("/getDynamicDbSourceByCode")
265 275 public DynamicDataSourceModel getDynamicDbSourceByCode(@RequestParam("dbSourceCode") String dbSourceCode){
266   - return sysBaseAPI.getDynamicDbSourceByCode(dbSourceCode);
  276 + return sysBaseApi.getDynamicDbSourceByCode(dbSourceCode);
267 277 }
268 278  
269 279 /**
... ... @@ -273,7 +283,7 @@ public class SystemAPIController {
273 283 */
274 284 @GetMapping("/sendWebSocketMsg")
275 285 public void sendWebSocketMsg(String[] userIds, String cmd){
276   - sysBaseAPI.sendWebSocketMsg(userIds, cmd);
  286 + sysBaseApi.sendWebSocketMsg(userIds, cmd);
277 287 }
278 288  
279 289  
... ... @@ -284,7 +294,7 @@ public class SystemAPIController {
284 294 */
285 295 @GetMapping("/queryAllUserByIds")
286 296 public List<LoginUser> queryAllUserByIds(@RequestParam("userIds") String[] userIds){
287   - return sysBaseAPI.queryAllUserByIds(userIds);
  297 + return sysBaseApi.queryAllUserByIds(userIds);
288 298 }
289 299  
290 300 /**
... ... @@ -293,7 +303,7 @@ public class SystemAPIController {
293 303 */
294 304 @GetMapping("/queryAllUserBackCombo")
295 305 public List<ComboModel> queryAllUserBackCombo(){
296   - return sysBaseAPI.queryAllUserBackCombo();
  306 + return sysBaseApi.queryAllUserBackCombo();
297 307 }
298 308  
299 309 /**
... ... @@ -302,7 +312,7 @@ public class SystemAPIController {
302 312 */
303 313 @GetMapping("/queryAllUser")
304 314 public JSONObject queryAllUser(@RequestParam(name="userIds",required=false)String userIds, @RequestParam(name="pageNo",required=false) Integer pageNo,@RequestParam(name="pageSize",required=false) int pageSize){
305   - return sysBaseAPI.queryAllUser(userIds, pageNo, pageSize);
  315 + return sysBaseApi.queryAllUser(userIds, pageNo, pageSize);
306 316 }
307 317  
308 318  
... ... @@ -315,7 +325,7 @@ public class SystemAPIController {
315 325 */
316 326 @GetMapping("/meetingSignWebsocket")
317 327 public void meetingSignWebsocket(@RequestParam("userId")String userId){
318   - sysBaseAPI.meetingSignWebsocket(userId);
  328 + sysBaseApi.meetingSignWebsocket(userId);
319 329 }
320 330  
321 331 /**
... ... @@ -325,7 +335,7 @@ public class SystemAPIController {
325 335 */
326 336 @GetMapping("/queryUserByNames")
327 337 public List<LoginUser> queryUserByNames(@RequestParam("userNames")String[] userNames){
328   - return sysBaseAPI.queryUserByNames(userNames);
  338 + return sysBaseApi.queryUserByNames(userNames);
329 339 }
330 340  
331 341 /**
... ... @@ -335,7 +345,7 @@ public class SystemAPIController {
335 345 */
336 346 @GetMapping("/getUserRoleSet")
337 347 public Set<String> getUserRoleSet(@RequestParam("username")String username){
338   - return sysBaseAPI.getUserRoleSet(username);
  348 + return sysBaseApi.getUserRoleSet(username);
339 349 }
340 350  
341 351 /**
... ... @@ -345,7 +355,7 @@ public class SystemAPIController {
345 355 */
346 356 @GetMapping("/getUserPermissionSet")
347 357 public Set<String> getUserPermissionSet(@RequestParam("username") String username){
348   - return sysBaseAPI.getUserPermissionSet(username);
  358 + return sysBaseApi.getUserPermissionSet(username);
349 359 }
350 360  
351 361 //-----
... ... @@ -357,7 +367,7 @@ public class SystemAPIController {
357 367 */
358 368 @PostMapping("/hasOnlineAuth")
359 369 public boolean hasOnlineAuth(@RequestBody OnlineAuthDTO onlineAuthDTO){
360   - return sysBaseAPI.hasOnlineAuth(onlineAuthDTO);
  370 + return sysBaseApi.hasOnlineAuth(onlineAuthDTO);
361 371 }
362 372  
363 373 /**
... ... @@ -386,7 +396,7 @@ public class SystemAPIController {
386 396 */
387 397 @GetMapping("/selectAllById")
388 398 public SysDepartModel selectAllById(@RequestParam("id") String id){
389   - return sysBaseAPI.selectAllById(id);
  399 + return sysBaseApi.selectAllById(id);
390 400 }
391 401  
392 402 /**
... ... @@ -396,7 +406,7 @@ public class SystemAPIController {
396 406 */
397 407 @GetMapping("/queryDeptUsersByUserId")
398 408 public List<String> queryDeptUsersByUserId(@RequestParam("userId") String userId){
399   - return sysBaseAPI.queryDeptUsersByUserId(userId);
  409 + return sysBaseApi.queryDeptUsersByUserId(userId);
400 410 }
401 411  
402 412  
... ... @@ -406,7 +416,7 @@ public class SystemAPIController {
406 416 */
407 417 @GetMapping("/queryPermissionDataRule")
408 418 public List<SysPermissionDataRuleModel> queryPermissionDataRule(@RequestParam("component") String component, @RequestParam("requestPath")String requestPath, @RequestParam("username") String username){
409   - return sysBaseAPI.queryPermissionDataRule(component, requestPath, username);
  419 + return sysBaseApi.queryPermissionDataRule(component, requestPath, username);
410 420 }
411 421  
412 422 /**
... ... @@ -416,7 +426,7 @@ public class SystemAPIController {
416 426 */
417 427 @GetMapping("/getCacheUser")
418 428 public SysUserCacheInfo getCacheUser(@RequestParam("username") String username){
419   - return sysBaseAPI.getCacheUser(username);
  429 + return sysBaseApi.getCacheUser(username);
420 430 }
421 431  
422 432 /**
... ... @@ -427,7 +437,7 @@ public class SystemAPIController {
427 437 */
428 438 @GetMapping("/translateDict")
429 439 public String translateDict(@RequestParam("code") String code, @RequestParam("key") String key){
430   - return sysBaseAPI.translateDict(code, key);
  440 + return sysBaseApi.translateDict(code, key);
431 441 }
432 442  
433 443  
... ... @@ -438,7 +448,7 @@ public class SystemAPIController {
438 448 */
439 449 @RequestMapping("/queryUsersByUsernames")
440 450 List<JSONObject> queryUsersByUsernames(@RequestParam("usernames") String usernames){
441   - return this.sysBaseAPI.queryUsersByUsernames(usernames);
  451 + return this.sysBaseApi.queryUsersByUsernames(usernames);
442 452 }
443 453  
444 454 /**
... ... @@ -448,7 +458,7 @@ public class SystemAPIController {
448 458 */
449 459 @RequestMapping("/queryUsersByIds")
450 460 List<JSONObject> queryUsersByIds(@RequestParam("ids") String ids){
451   - return this.sysBaseAPI.queryUsersByIds(ids);
  461 + return this.sysBaseApi.queryUsersByIds(ids);
452 462 }
453 463  
454 464 /**
... ... @@ -458,7 +468,7 @@ public class SystemAPIController {
458 468 */
459 469 @GetMapping("/queryDepartsByOrgcodes")
460 470 List<JSONObject> queryDepartsByOrgcodes(@RequestParam("orgCodes") String orgCodes){
461   - return this.sysBaseAPI.queryDepartsByOrgcodes(orgCodes);
  471 + return this.sysBaseApi.queryDepartsByOrgcodes(orgCodes);
462 472 }
463 473  
464 474 /**
... ... @@ -468,7 +478,7 @@ public class SystemAPIController {
468 478 */
469 479 @GetMapping("/queryDepartsByIds")
470 480 List<JSONObject> queryDepartsByIds(@RequestParam("ids") String ids){
471   - return this.sysBaseAPI.queryDepartsByIds(ids);
  481 + return this.sysBaseApi.queryDepartsByIds(ids);
472 482 }
473 483  
474 484 /**
... ... @@ -479,7 +489,7 @@ public class SystemAPIController {
479 489 */
480 490 @GetMapping("/sendEmailMsg")
481 491 public void sendEmailMsg(@RequestParam("email")String email,@RequestParam("title")String title,@RequestParam("content")String content){
482   - this.sysBaseAPI.sendEmailMsg(email,title,content);
  492 + this.sysBaseApi.sendEmailMsg(email,title,content);
483 493 };
484 494 /**
485 495 * 41 获取公司下级部门和公司下所有用户信息
... ... @@ -487,7 +497,7 @@ public class SystemAPIController {
487 497 */
488 498 @GetMapping("/getDeptUserByOrgCode")
489 499 List<Map> getDeptUserByOrgCode(@RequestParam("orgCode")String orgCode){
490   - return this.sysBaseAPI.getDeptUserByOrgCode(orgCode);
  500 + return this.sysBaseApi.getDeptUserByOrgCode(orgCode);
491 501 }
492 502  
493 503 /**
... ... @@ -498,7 +508,7 @@ public class SystemAPIController {
498 508 */
499 509 @GetMapping("/loadCategoryDictItem")
500 510 public List<String> loadCategoryDictItem(@RequestParam("ids") String ids) {
501   - return sysBaseAPI.loadCategoryDictItem(ids);
  511 + return sysBaseApi.loadCategoryDictItem(ids);
502 512 }
503 513  
504 514 /**
... ... @@ -510,7 +520,7 @@ public class SystemAPIController {
510 520 */
511 521 @GetMapping("/loadDictItem")
512 522 public List<String> loadDictItem(@RequestParam("dictCode") String dictCode, @RequestParam("keys") String keys) {
513   - return sysBaseAPI.loadDictItem(dictCode, keys);
  523 + return sysBaseApi.loadDictItem(dictCode, keys);
514 524 }
515 525  
516 526 /**
... ... @@ -522,7 +532,7 @@ public class SystemAPIController {
522 532 */
523 533 @GetMapping("/getDictItems")
524 534 public List<DictModel> getDictItems(@RequestParam("dictCode") String dictCode) {
525   - return sysBaseAPI.getDictItems(dictCode);
  535 + return sysBaseApi.getDictItems(dictCode);
526 536 }
527 537  
528 538 /**
... ... @@ -533,7 +543,7 @@ public class SystemAPIController {
533 543 */
534 544 @RequestMapping("/getManyDictItems")
535 545 public Map<String, List<DictModel>> getManyDictItems(@RequestParam("dictCodeList") List<String> dictCodeList) {
536   - return sysBaseAPI.getManyDictItems(dictCodeList);
  546 + return sysBaseApi.getManyDictItems(dictCodeList);
537 547 }
538 548  
539 549 /**
... ... @@ -546,7 +556,7 @@ public class SystemAPIController {
546 556 */
547 557 @GetMapping("/loadDictItemByKeyword")
548 558 public List<DictModel> loadDictItemByKeyword(@RequestParam("dictCode") String dictCode, @RequestParam("keyword") String keyword, @RequestParam(value = "pageSize", required = false) Integer pageSize) {
549   - return sysBaseAPI.loadDictItemByKeyword(dictCode, keyword, pageSize);
  559 + return sysBaseApi.loadDictItemByKeyword(dictCode, keyword, pageSize);
550 560 }
551 561  
552 562 /**
... ... @@ -557,7 +567,7 @@ public class SystemAPIController {
557 567 */
558 568 @GetMapping("/translateManyDict")
559 569 public Map<String, List<DictModel>> translateManyDict(@RequestParam("dictCodes") String dictCodes, @RequestParam("keys") String keys){
560   - return this.sysBaseAPI.translateManyDict(dictCodes, keys);
  570 + return this.sysBaseApi.translateManyDict(dictCodes, keys);
561 571 }
562 572  
563 573  
... ... @@ -570,7 +580,7 @@ public class SystemAPIController {
570 580 */
571 581 @GetMapping("/queryTableDictItemsByCode")
572 582 List<DictModel> queryTableDictItemsByCode(@RequestParam("table") String table, @RequestParam("text") String text, @RequestParam("code") String code){
573   - return sysBaseAPI.queryTableDictItemsByCode(table, text, code);
  583 + return sysBaseApi.queryTableDictItemsByCode(table, text, code);
574 584 }
575 585  
576 586 /**
... ... @@ -583,7 +593,7 @@ public class SystemAPIController {
583 593 */
584 594 @GetMapping("/queryFilterTableDictInfo")
585 595 List<DictModel> queryFilterTableDictInfo(@RequestParam("table") String table, @RequestParam("text") String text, @RequestParam("code") String code, @RequestParam("filterSql") String filterSql){
586   - return sysBaseAPI.queryFilterTableDictInfo(table, text, code, filterSql);
  596 + return sysBaseApi.queryFilterTableDictInfo(table, text, code, filterSql);
587 597 }
588 598  
589 599 /**
... ... @@ -598,7 +608,7 @@ public class SystemAPIController {
598 608 @Deprecated
599 609 @GetMapping("/queryTableDictByKeys")
600 610 public List<String> queryTableDictByKeys(@RequestParam("table") String table, @RequestParam("text") String text, @RequestParam("code") String code, @RequestParam("keyArray") String[] keyArray){
601   - return sysBaseAPI.queryTableDictByKeys(table, text, code, keyArray);
  611 + return sysBaseApi.queryTableDictByKeys(table, text, code, keyArray);
602 612 }
603 613  
604 614  
... ... @@ -612,7 +622,7 @@ public class SystemAPIController {
612 622 */
613 623 @GetMapping("/translateDictFromTable")
614 624 public String translateDictFromTable(@RequestParam("table") String table, @RequestParam("text") String text, @RequestParam("code") String code, @RequestParam("key") String key){
615   - return sysBaseAPI.translateDictFromTable(table, text, code, key);
  625 + return sysBaseApi.translateDictFromTable(table, text, code, key);
616 626 }
617 627  
618 628  
... ... @@ -628,7 +638,7 @@ public class SystemAPIController {
628 638 */
629 639 @GetMapping("/translateDictFromTableByKeys")
630 640 public List<DictModel> translateDictFromTableByKeys(@RequestParam("table") String table, @RequestParam("text") String text, @RequestParam("code") String code, @RequestParam("keys") String keys) {
631   - return this.sysBaseAPI.translateDictFromTableByKeys(table, text, code, keys);
  641 + return this.sysBaseApi.translateDictFromTableByKeys(table, text, code, keys);
632 642 }
633 643  
634 644 }
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/cas/util/CASServiceUtil.java
... ... @@ -16,6 +16,10 @@ import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
16 16 import org.apache.http.impl.client.CloseableHttpClient;
17 17 import org.apache.http.impl.client.HttpClients;
18 18  
  19 +/**
  20 + * @Description: CASServiceUtil
  21 + * @author: jeecg-boot
  22 + */
19 23 public class CASServiceUtil {
20 24  
21 25 public static void main(String[] args) {
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/cas/util/XmlUtils.java
... ... @@ -25,7 +25,7 @@ import lombok.extern.slf4j.Slf4j;
25 25  
26 26 /**
27 27 * 解析cas,ST验证后的xml
28   - *
  28 + * @author: jeecg-boot
29 29 */
30 30 @Slf4j
31 31 public final class XmlUtils {
... ... @@ -39,7 +39,7 @@ public final class XmlUtils {
39 39 */
40 40 public static Document newDocument(final String xml) {
41 41 final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
42   - final Map<String, Boolean> features = new HashMap<String, Boolean>();
  42 + final Map<String, Boolean> features = new HashMap(5);
43 43 features.put(XMLConstants.FEATURE_SECURE_PROCESSING, true);
44 44 features.put("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
45 45 for (final Map.Entry<String, Boolean> entry : features.entrySet()) {
... ... @@ -94,13 +94,15 @@ public final class XmlUtils {
94 94  
95 95 private StringBuilder buffer = new StringBuilder();
96 96  
  97 + @Override
97 98 public void startElement(final String uri, final String localName, final String qName,
98   - final Attributes attributes) throws SAXException {
  99 + final Attributes attributes) throws SAXException {
99 100 if (localName.equals(element)) {
100 101 this.foundElement = true;
101 102 }
102 103 }
103 104  
  105 + @Override
104 106 public void endElement(final String uri, final String localName, final String qName) throws SAXException {
105 107 if (localName.equals(element)) {
106 108 this.foundElement = false;
... ... @@ -109,6 +111,7 @@ public final class XmlUtils {
109 111 }
110 112 }
111 113  
  114 + @Override
112 115 public void characters(char[] ch, int start, int length) throws SAXException {
113 116 if (this.foundElement) {
114 117 this.buffer.append(ch, start, length);
... ... @@ -145,19 +148,22 @@ public final class XmlUtils {
145 148  
146 149 private boolean foundElement = false;
147 150  
  151 + @Override
148 152 public void startElement(final String uri, final String localName, final String qName,
149   - final Attributes attributes) throws SAXException {
  153 + final Attributes attributes) throws SAXException {
150 154 if (localName.equals(element)) {
151 155 this.foundElement = true;
152 156 }
153 157 }
154 158  
  159 + @Override
155 160 public void endElement(final String uri, final String localName, final String qName) throws SAXException {
156 161 if (localName.equals(element)) {
157 162 this.foundElement = false;
158 163 }
159 164 }
160 165  
  166 + @Override
161 167 public void characters(char[] ch, int start, int length) throws SAXException {
162 168 if (this.foundElement) {
163 169 builder.append(ch, start, length);
... ... @@ -208,7 +214,7 @@ public final class XmlUtils {
208 214  
209 215 @Override
210 216 public void startDocument() throws SAXException {
211   - this.attributes = new HashMap<String, Object>();
  217 + this.attributes = new HashMap(5);
212 218 }
213 219  
214 220 @Override
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/message/entity/MsgParams.java
... ... @@ -6,18 +6,30 @@ import lombok.Data;
6 6  
7 7 /**
8 8 * 发送消息实体
  9 + * @author: jeecg-boot
9 10 */
10 11 @Data
11 12 public class MsgParams implements Serializable {
12 13  
13 14 private static final long serialVersionUID = 1L;
14   - /*消息类型*/
  15 + /**
  16 + * 消息类型
  17 + */
15 18 private String msgType;
16   - /*消息接收方*/
  19 +
  20 + /**
  21 + * 消息接收方
  22 + */
17 23 private String receiver;
18   - /*消息模板码*/
  24 +
  25 + /**
  26 + * 消息模板码
  27 + */
19 28 private String templateCode;
20   - /*测试数据*/
  29 +
  30 + /**
  31 + * 测试数据
  32 + */
21 33 private String testData;
22 34  
23 35 }
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/message/handle/ISendMsgHandle.java
1 1 package org.jeecg.modules.message.handle;
2 2  
  3 +/**
  4 + * @Description: 发送信息接口
  5 + * @author: jeecg-boot
  6 + */
3 7 public interface ISendMsgHandle {
4 8  
  9 + /**
  10 + * 发送信息
  11 + * @param es_receiver 发送人
  12 + * @param es_title 标题
  13 + * @param es_content 内容
  14 + */
5 15 void SendMsg(String es_receiver, String es_title, String es_content);
6 16 }
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/message/handle/enums/SendMsgStatusEnum.java
... ... @@ -2,6 +2,7 @@ package org.jeecg.modules.message.handle.enums;
2 2  
3 3 /**
4 4 * 推送状态枚举
  5 + * @author: jeecg-boot
5 6 */
6 7 public enum SendMsgStatusEnum {
7 8  
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/message/handle/enums/SendMsgTypeEnum.java
... ... @@ -4,13 +4,26 @@ import org.jeecg.common.util.oConvertUtils;
4 4  
5 5 /**
6 6 * 发送消息类型枚举
  7 + * @author: jeecg-boot
7 8 */
8 9 public enum SendMsgTypeEnum {
9 10  
10   -//推送方式:1短信 2邮件 3微信
  11 + /**
  12 + * 短信
  13 + */
11 14 SMS("1", "org.jeecg.modules.message.handle.impl.SmsSendMsgHandle"),
  15 + /**
  16 + * 邮件
  17 + */
12 18 EMAIL("2", "org.jeecg.modules.message.handle.impl.EmailSendMsgHandle"),
13   - WX("3","org.jeecg.modules.message.handle.impl.WxSendMsgHandle");
  19 + /**
  20 + * 微信
  21 + */
  22 + WX("3","org.jeecg.modules.message.handle.impl.WxSendMsgHandle"),
  23 + /**
  24 + * 系统消息
  25 + */
  26 + SYSTEM_MESSAGE("4","org.jeecg.modules.message.handle.impl.SystemSendMsgHandle");
14 27  
15 28 private String type;
16 29  
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/message/handle/impl/EmailSendMsgHandle.java
... ... @@ -11,6 +11,10 @@ import org.springframework.mail.javamail.MimeMessageHelper;
11 11 import javax.mail.MessagingException;
12 12 import javax.mail.internet.MimeMessage;
13 13  
  14 +/**
  15 + * @Description: 邮箱发送信息
  16 + * @author: jeecg-boot
  17 + */
14 18 public class EmailSendMsgHandle implements ISendMsgHandle {
15 19 static String emailFrom;
16 20  
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/message/handle/impl/SmsSendMsgHandle.java
... ... @@ -3,6 +3,10 @@ package org.jeecg.modules.message.handle.impl;
3 3 import lombok.extern.slf4j.Slf4j;
4 4 import org.jeecg.modules.message.handle.ISendMsgHandle;
5 5  
  6 +/**
  7 + * @Description: 短信发送
  8 + * @author: jeecg-boot
  9 + */
6 10 @Slf4j
7 11 public class SmsSendMsgHandle implements ISendMsgHandle {
8 12  
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/message/handle/impl/SystemSendMsgHandle.java 0 → 100644
  1 +package org.jeecg.modules.message.handle.impl;
  2 +
  3 +import org.jeecg.common.api.dto.message.MessageDTO;
  4 +import org.jeecg.common.exception.JeecgBootException;
  5 +import org.jeecg.common.system.api.ISysBaseAPI;
  6 +import org.jeecg.common.util.SpringContextUtils;
  7 +import org.jeecg.common.util.oConvertUtils;
  8 +import org.jeecg.modules.message.handle.ISendMsgHandle;
  9 +
  10 +/**
  11 +* @Description: 发送系统消息
  12 +* @Author: wangshuai
  13 +* @Date: 2022年3月22日 18:48:20
  14 +*/
  15 +public class SystemSendMsgHandle implements ISendMsgHandle {
  16 +
  17 + public static final String FROM_USER="system";
  18 +
  19 + @Override
  20 + public void SendMsg(String es_receiver, String es_title, String es_content) {
  21 + if(oConvertUtils.isEmpty(es_receiver)){
  22 + throw new JeecgBootException("被发送人不能为空");
  23 + }
  24 + ISysBaseAPI sysBaseAPI = SpringContextUtils.getBean(ISysBaseAPI.class);
  25 + MessageDTO messageDTO = new MessageDTO(FROM_USER,es_receiver,es_title,es_content);
  26 + sysBaseAPI.sendSysAnnouncement(messageDTO);
  27 + }
  28 +}
0 29 \ No newline at end of file
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/message/handle/impl/WxSendMsgHandle.java
... ... @@ -2,6 +2,11 @@ package org.jeecg.modules.message.handle.impl;
2 2  
3 3 import lombok.extern.slf4j.Slf4j;
4 4 import org.jeecg.modules.message.handle.ISendMsgHandle;
  5 +
  6 +/**
  7 + * @Description: 发微信消息模板
  8 + * @author: jeecg-boot
  9 + */
5 10 @Slf4j
6 11 public class WxSendMsgHandle implements ISendMsgHandle {
7 12  
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/message/job/SendMsgJob.java
... ... @@ -19,6 +19,7 @@ import lombok.extern.slf4j.Slf4j;
19 19  
20 20 /**
21 21 * 发送消息任务
  22 + * @author: jeecg-boot
22 23 */
23 24  
24 25 @Slf4j
... ... @@ -48,16 +49,24 @@ public class SendMsgJob implements Job {
48 49 sendMsgHandle = (ISendMsgHandle) Class.forName(SendMsgTypeEnum.SMS.getImplClass()).newInstance();
49 50 } else if (sysMessage.getEsType().equals(SendMsgTypeEnum.WX.getType())) {
50 51 sendMsgHandle = (ISendMsgHandle) Class.forName(SendMsgTypeEnum.WX.getImplClass()).newInstance();
  52 + } else if(sysMessage.getEsType().equals(SendMsgTypeEnum.SYSTEM_MESSAGE.getType())){
  53 + //update-begin---author:wangshuai ---date:20220323 for:[issues/I4X698]根据模板发送系统消息,发送失败------------
  54 + sendMsgHandle = (ISendMsgHandle) Class.forName(SendMsgTypeEnum.SYSTEM_MESSAGE.getImplClass()).newInstance();
  55 + //update-end---author:wangshuai ---date:20220323 for:[issues/I4X698]根据模板发送系统消息,发送失败------------
51 56 }
52 57 } catch (Exception e) {
53 58 log.error(e.getMessage(),e);
54 59 }
55 60 Integer sendNum = sysMessage.getEsSendNum();
56 61 try {
57   - sendMsgHandle.SendMsg(sysMessage.getEsReceiver(), sysMessage.getEsTitle(),
58   - sysMessage.getEsContent().toString());
59   - // 发送消息成功
60   - sysMessage.setEsSendStatus(SendMsgStatusEnum.SUCCESS.getCode());
  62 + //update-begin---author:wangshuai ---date:20220323 for:[issues/I4X698]模板管理发送消息出现NullPointerException 錯誤------------
  63 + if(null != sendMsgHandle){
  64 + sendMsgHandle.SendMsg(sysMessage.getEsReceiver(), sysMessage.getEsTitle(),
  65 + sysMessage.getEsContent().toString());
  66 + //发送消息成功
  67 + sysMessage.setEsSendStatus(SendMsgStatusEnum.SUCCESS.getCode());
  68 + }
  69 + //update-end---author:wangshuai ---date:20220323 for:[issues/I4X698]模板管理发送消息出现NullPointerException 錯誤------------
61 70 } catch (Exception e) {
62 71 e.printStackTrace();
63 72 // 发送消息出现异常
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/message/mapper/SysMessageTemplateMapper.java
... ... @@ -13,6 +13,12 @@ import java.util.List;
13 13 * @Version: V1.0
14 14 */
15 15 public interface SysMessageTemplateMapper extends BaseMapper<SysMessageTemplate> {
  16 +
  17 + /**
  18 + * 通过模板CODE查询消息模板
  19 + * @param code 模板CODE
  20 + * @return List<SysMessageTemplate>
  21 + */
16 22 @Select("SELECT * FROM SYS_SMS_TEMPLATE WHERE TEMPLATE_CODE = #{code}")
17 23 List<SysMessageTemplate> selectByCode(String code);
18 24 }
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/message/service/ISysMessageTemplateService.java
... ... @@ -12,5 +12,11 @@ import org.jeecg.modules.message.entity.SysMessageTemplate;
12 12 * @Version: V1.0
13 13 */
14 14 public interface ISysMessageTemplateService extends JeecgService<SysMessageTemplate> {
  15 +
  16 + /**
  17 + * 通过模板CODE查询消息模板
  18 + * @param code 模板CODE
  19 + * @return
  20 + */
15 21 List<SysMessageTemplate> selectByCode(String code);
16 22 }
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/message/util/PushMsgUtil.java
... ... @@ -21,6 +21,7 @@ import java.util.Map;
21 21  
22 22 /**
23 23 * 消息生成工具
  24 + * @author: jeecg-boot
24 25 */
25 26  
26 27 @Component
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/message/websocket/SocketHandler.java
... ... @@ -4,16 +4,17 @@ import cn.hutool.core.util.ObjectUtil;
4 4 import lombok.extern.slf4j.Slf4j;
5 5 import org.jeecg.common.base.BaseMap;
6 6 import org.jeecg.common.constant.CommonSendStatus;
7   -import org.jeecg.common.modules.redis.listener.JeecgRedisListerer;
  7 +import org.jeecg.common.modules.redis.listener.JeecgRedisListener;
8 8 import org.springframework.beans.factory.annotation.Autowired;
9 9 import org.springframework.stereotype.Component;
10 10  
11 11 /**
12 12 * 监听消息(采用redis发布订阅方式发送消息)
  13 + * @author: jeecg-boot
13 14 */
14 15 @Slf4j
15 16 @Component
16   -public class SocketHandler implements JeecgRedisListerer {
  17 +public class SocketHandler implements JeecgRedisListener {
17 18  
18 19 @Autowired
19 20 private WebSocket webSocket;
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/message/websocket/TestSocketController.java
... ... @@ -10,6 +10,10 @@ import org.springframework.web.bind.annotation.RestController;
10 10  
11 11 import com.alibaba.fastjson.JSONObject;
12 12  
  13 +/**
  14 + * @Description: TestSocketController
  15 + * @author: jeecg-boot
  16 + */
13 17 @RestController
14 18 @RequestMapping("/sys/socketTest")
15 19 public class TestSocketController {
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/message/websocket/WebSocket.java
... ... @@ -2,6 +2,7 @@ package org.jeecg.modules.message.websocket;
2 2  
3 3 import java.util.HashMap;
4 4 import java.util.Map;
  5 +import java.util.concurrent.ConcurrentHashMap;
5 6 import java.util.concurrent.CopyOnWriteArraySet;
6 7  
7 8 import javax.annotation.Resource;
... ... @@ -28,11 +29,14 @@ import lombok.extern.slf4j.Slf4j;
28 29 */
29 30 @Component
30 31 @Slf4j
31   -@ServerEndpoint("/websocket/{userId}") //此注解相当于设置访问URL
  32 +@ServerEndpoint("/websocket/{userId}")
32 33 public class WebSocket {
33 34  
34 35 private Session session;
35 36  
  37 + /**
  38 + * 用户ID
  39 + */
36 40 private String userId;
37 41  
38 42 private static final String REDIS_TOPIC_NAME = "socketHandler";
... ... @@ -44,12 +48,15 @@ public class WebSocket {
44 48 * 缓存 webSocket连接到单机服务class中(整体方案支持集群)
45 49 */
46 50 private static CopyOnWriteArraySet<WebSocket> webSockets = new CopyOnWriteArraySet<>();
47   - private static Map<String, Session> sessionPool = new HashMap<String, Session>();
48   -
  51 + /**
  52 + * 线程安全Map
  53 + */
  54 + private static ConcurrentHashMap<String, Session> sessionPool = new ConcurrentHashMap<>();
49 55  
50 56 @OnOpen
51 57 public void onOpen(Session session, @PathParam(value = "userId") String userId) {
52 58 try {
  59 + //TODO 通过header中获取token,进行check
53 60 this.session = session;
54 61 this.userId = userId;
55 62 webSockets.add(this);
... ... @@ -113,9 +120,11 @@ public class WebSocket {
113 120 obj.put(WebsocketConst.MSG_CMD, WebsocketConst.CMD_CHECK);
114 121 //消息内容
115 122 obj.put(WebsocketConst.MSG_TXT, "心跳响应");
  123 + //update-begin-author:taoyan date:20220308 for: 消息通知长连接启动心跳机制,后端代码小bug #3473
116 124 for (WebSocket webSocket : webSockets) {
117   - webSocket.pushMessage(message);
  125 + webSocket.pushMessage(obj.toJSONString());
118 126 }
  127 + //update-end-author:taoyan date:20220308 for: 消息通知长连接启动心跳机制,后端代码小bug #3473
119 128 }
120 129  
121 130 /**
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/monitor/controller/ActuatorRedisController.java
... ... @@ -19,6 +19,10 @@ import java.util.HashMap;
19 19 import java.util.List;
20 20 import java.util.Map;
21 21  
  22 +/**
  23 + * @Description: ActuatorRedisController
  24 + * @author: jeecg-boot
  25 + */
22 26 @Slf4j
23 27 @RestController
24 28 @RequestMapping("/sys/actuator/redis")
... ... @@ -100,7 +104,7 @@ public class ActuatorRedisController {
100 104 if(fs[i].getTotalSpace()==0) {
101 105 continue;
102 106 }
103   - Map<String,Object> map = new HashMap<>();
  107 + Map<String,Object> map = new HashMap(5);
104 108 map.put("name", fsv.getSystemDisplayName(fs[i]));
105 109 map.put("max", fs[i].getTotalSpace());
106 110 map.put("rest", fs[i].getFreeSpace());
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/monitor/domain/RedisInfo.java
... ... @@ -3,9 +3,13 @@ package org.jeecg.modules.monitor.domain;
3 3 import java.util.HashMap;
4 4 import java.util.Map;
5 5  
  6 +/**
  7 + * @Description: redis信息
  8 + * @author: jeecg-boot
  9 + */
6 10 public class RedisInfo {
7 11  
8   - private static Map<String, String> map = new HashMap<>();
  12 + private static Map<String, String> map = new HashMap(5);
9 13  
10 14 static {
11 15 map.put("redis_version", "Redis 服务器版本");
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/monitor/exception/RedisConnectException.java
... ... @@ -2,6 +2,7 @@ package org.jeecg.modules.monitor.exception;
2 2  
3 3 /**
4 4 * Redis 连接异常
  5 + * @author: jeecg-boot
5 6 */
6 7 public class RedisConnectException extends Exception {
7 8  
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/monitor/service/RedisService.java
... ... @@ -8,12 +8,17 @@ import com.alibaba.fastjson.JSONArray;
8 8 import org.jeecg.modules.monitor.domain.RedisInfo;
9 9 import org.jeecg.modules.monitor.exception.RedisConnectException;
10 10  
  11 +/**
  12 + * @Description: redis信息service接口
  13 + * @author: jeecg-boot
  14 + */
11 15 public interface RedisService {
12 16  
13 17 /**
14 18 * 获取 redis 的详细信息
15 19 *
16 20 * @return List
  21 + * @throws RedisConnectException
17 22 */
18 23 List<RedisInfo> getRedisInfo() throws RedisConnectException;
19 24  
... ... @@ -21,6 +26,7 @@ public interface RedisService {
21 26 * 获取 redis key 数量
22 27 *
23 28 * @return Map
  29 + * @throws RedisConnectException
24 30 */
25 31 Map<String, Object> getKeysSize() throws RedisConnectException;
26 32  
... ... @@ -28,12 +34,14 @@ public interface RedisService {
28 34 * 获取 redis 内存信息
29 35 *
30 36 * @return Map
  37 + * @throws RedisConnectException
31 38 */
32 39 Map<String, Object> getMemoryInfo() throws RedisConnectException;
33 40 /**
34 41 * 获取 报表需要个redis信息
35   - *
  42 + * @param type
36 43 * @return Map
  44 + * @throws RedisConnectException
37 45 */
38 46 Map<String, JSONArray> getMapForReport(String type) throws RedisConnectException ;
39 47 }
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/monitor/service/impl/RedisServiceImpl.java
... ... @@ -54,11 +54,11 @@ public class RedisServiceImpl implements RedisService {
54 54 @Override
55 55 public Map<String, Object> getKeysSize() throws RedisConnectException {
56 56 Long dbSize = redisConnectionFactory.getConnection().dbSize();
57   - Map<String, Object> map = new HashMap<>();
  57 + Map<String, Object> map = new HashMap(5);
58 58 map.put("create_time", System.currentTimeMillis());
59 59 map.put("dbSize", dbSize);
60 60  
61   - log.info("--getKeysSize--: " + map.toString());
  61 + log.debug("--getKeysSize--: " + map.toString());
62 62 return map;
63 63 }
64 64  
... ... @@ -69,12 +69,12 @@ public class RedisServiceImpl implements RedisService {
69 69 for (Map.Entry<Object, Object> entry : info.entrySet()) {
70 70 String key = oConvertUtils.getString(entry.getKey());
71 71 if ("used_memory".equals(key)) {
72   - map = new HashMap<>();
  72 + map = new HashMap(5);
73 73 map.put("used_memory", entry.getValue());
74 74 map.put("create_time", System.currentTimeMillis());
75 75 }
76 76 }
77   - log.info("--getMemoryInfo--: " + map.toString());
  77 + log.debug("--getMemoryInfo--: " + map.toString());
78 78 return map;
79 79 }
80 80  
... ... @@ -86,7 +86,7 @@ public class RedisServiceImpl implements RedisService {
86 86 */
87 87 @Override
88 88 public Map<String, JSONArray> getMapForReport(String type) throws RedisConnectException {
89   - Map<String,JSONArray> mapJson=new HashMap<String, JSONArray> ();
  89 + Map<String,JSONArray> mapJson=new HashMap(5);
90 90 JSONArray json = new JSONArray();
91 91 if("3".equals(type)){
92 92 List<RedisInfo> redisInfo = getRedisInfo();
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/ngalain/service/NgAlainService.java
... ... @@ -5,8 +5,33 @@ import com.alibaba.fastjson.JSONArray;
5 5 import java.util.List;
6 6 import java.util.Map;
7 7  
  8 +/**
  9 + * @Description: NgAlainService接口
  10 + * @author: jeecg-boot
  11 + */
8 12 public interface NgAlainService {
  13 + /**
  14 + * 菜单
  15 + * @param id
  16 + * @return JSONArray
  17 + * @throws Exception
  18 + */
9 19 public JSONArray getMenu(String id) throws Exception;
  20 +
  21 + /**
  22 + * jeecg菜单
  23 + * @param id
  24 + * @return JSONArray
  25 + * @throws Exception
  26 + */
10 27 public JSONArray getJeecgMenu(String id) throws Exception;
  28 +
  29 + /**
  30 + * 获取字典值
  31 + * @param table
  32 + * @param key
  33 + * @param value
  34 + * @return List<Map<String, String>>
  35 + */
11 36 public List<Map<String, String>> getDictByTable(String table, String key, String value);
12 37 }
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/ngalain/service/impl/NgAlainServiceImpl.java
... ... @@ -15,6 +15,10 @@ import java.util.Base64;
15 15 import java.util.List;
16 16 import java.util.Map;
17 17  
  18 +/**
  19 + * @Description: NgAlainServiceImpl 实现类
  20 + * @author: jeecg-boot
  21 + */
18 22 @Service("ngAlainService")
19 23 public class NgAlainServiceImpl implements NgAlainService {
20 24 @Autowired
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oss/controller/OSSFileController.java
... ... @@ -20,6 +20,7 @@ import lombok.extern.slf4j.Slf4j;
20 20  
21 21 /**
22 22 * 云存储示例 DEMO
  23 + * @author: jeecg-boot
23 24 */
24 25 @Slf4j
25 26 @Controller
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oss/entity/OSSFile.java
... ... @@ -7,6 +7,10 @@ import lombok.experimental.Accessors;
7 7 import org.jeecg.common.system.base.entity.JeecgEntity;
8 8 import org.jeecgframework.poi.excel.annotation.Excel;
9 9  
  10 +/**
  11 + * @Description: oss云存储实体类
  12 + * @author: jeecg-boot
  13 + */
10 14 @Data
11 15 @TableName("oss_file")
12 16 @EqualsAndHashCode(callSuper = false)
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oss/mapper/OSSFileMapper.java
... ... @@ -3,6 +3,10 @@ package org.jeecg.modules.oss.mapper;
3 3 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 4 import org.jeecg.modules.oss.entity.OSSFile;
5 5  
  6 +/**
  7 + * @Description: oss云存储Mapper
  8 + * @author: jeecg-boot
  9 + */
6 10 public interface OSSFileMapper extends BaseMapper<OSSFile> {
7 11  
8 12 }
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oss/service/IOSSFileService.java
... ... @@ -6,10 +6,24 @@ import com.baomidou.mybatisplus.extension.service.IService;
6 6 import org.jeecg.modules.oss.entity.OSSFile;
7 7 import org.springframework.web.multipart.MultipartFile;
8 8  
  9 +/**
  10 + * @Description: OOS云存储service接口
  11 + * @author: jeecg-boot
  12 + */
9 13 public interface IOSSFileService extends IService<OSSFile> {
10 14  
  15 + /**
  16 + * oss文件上传
  17 + * @param multipartFile
  18 + * @throws IOException
  19 + */
11 20 void upload(MultipartFile multipartFile) throws IOException;
12 21  
  22 + /**
  23 + * oss文件删除
  24 + * @param ossFile OSSFile对象
  25 + * @return
  26 + */
13 27 boolean delete(OSSFile ossFile);
14 28  
15 29 }
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oss/service/impl/OSSFileServiceImpl.java
... ... @@ -11,6 +11,10 @@ import org.springframework.web.multipart.MultipartFile;
11 11  
12 12 import java.io.IOException;
13 13  
  14 +/**
  15 + * @Description: OSS云存储实现类
  16 + * @author: jeecg-boot
  17 + */
14 18 @Service("ossFileService")
15 19 public class OSSFileServiceImpl extends ServiceImpl<OSSFileMapper, OSSFile> implements IOSSFileService {
16 20  
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/quartz/controller/QuartzJobController.java
... ... @@ -228,7 +228,8 @@ public class QuartzJobController {
228 228 List<String> errorMessage = new ArrayList<>();
229 229 int successLines = 0, errorLines = 0;
230 230 for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
231   - MultipartFile file = entity.getValue();// 获取上传文件对象
  231 + // 获取上传文件对象
  232 + MultipartFile file = entity.getValue();
232 233 ImportParams params = new ImportParams();
233 234 params.setTitleRows(2);
234 235 params.setHeadRows(1);
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/quartz/mapper/QuartzJobMapper.java
... ... @@ -15,6 +15,11 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
15 15 */
16 16 public interface QuartzJobMapper extends BaseMapper<QuartzJob> {
17 17  
  18 + /**
  19 + * 根据jobClassName查询
  20 + * @param jobClassName 任务类名
  21 + * @return
  22 + */
18 23 public List<QuartzJob> findByJobClassName(@Param("jobClassName") String jobClassName);
19 24  
20 25 }
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/quartz/service/IQuartzJobService.java
... ... @@ -15,19 +15,46 @@ import com.baomidou.mybatisplus.extension.service.IService;
15 15 */
16 16 public interface IQuartzJobService extends IService<QuartzJob> {
17 17  
  18 + /**
  19 + * 通过类名寻找定时任务
  20 + * @param jobClassName 类名
  21 + * @return List<QuartzJob>
  22 + */
18 23 List<QuartzJob> findByJobClassName(String jobClassName);
19 24  
  25 + /**
  26 + * 保存定时任务
  27 + * @param quartzJob
  28 + * @return boolean
  29 + */
20 30 boolean saveAndScheduleJob(QuartzJob quartzJob);
21 31  
  32 + /**
  33 + * 编辑定时任务
  34 + * @param quartzJob
  35 + * @return boolean
  36 + * @throws SchedulerException
  37 + */
22 38 boolean editAndScheduleJob(QuartzJob quartzJob) throws SchedulerException;
23 39  
  40 + /**
  41 + * 删除定时任务
  42 + * @param quartzJob
  43 + * @return boolean
  44 + */
24 45 boolean deleteAndStopJob(QuartzJob quartzJob);
25 46  
  47 + /**
  48 + * 恢复定时任务
  49 + * @param quartzJob
  50 + * @return
  51 + */
26 52 boolean resumeJob(QuartzJob quartzJob);
27 53  
28 54 /**
29 55 * 执行定时任务
30 56 * @param quartzJob
  57 + * @throws Exception
31 58 */
32 59 void execute(QuartzJob quartzJob) throws Exception;
33 60  
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/CommonController.java
... ... @@ -11,7 +11,6 @@ import org.jeecg.common.util.CommonUtils;
11 11 import org.jeecg.common.util.RestUtil;
12 12 import org.jeecg.common.util.TokenUtils;
13 13 import org.jeecg.common.util.oConvertUtils;
14   -import org.springframework.beans.factory.annotation.Autowired;
15 14 import org.springframework.beans.factory.annotation.Value;
16 15 import org.springframework.http.HttpHeaders;
17 16 import org.springframework.http.HttpMethod;
... ... @@ -42,9 +41,6 @@ import java.net.URLDecoder;
42 41 @RequestMapping("/sys/common")
43 42 public class CommonController {
44 43  
45   - @Autowired
46   - private ISysBaseAPI sysBaseAPI;
47   -
48 44 @Value(value = "${jeecg.path.upload}")
49 45 private String uploadpath;
50 46  
... ... @@ -81,7 +77,8 @@ public class CommonController {
81 77 }
82 78  
83 79 MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
84   - MultipartFile file = multipartRequest.getFile("file");// 获取上传文件对象
  80 + // 获取上传文件对象
  81 + MultipartFile file = multipartRequest.getFile("file");
85 82 if(oConvertUtils.isEmpty(bizPath)){
86 83 if(CommonConstant.UPLOAD_TYPE_OSS.equals(uploadType)){
87 84 //未指定目录,则用阿里云默认目录 upload
... ... @@ -135,9 +132,11 @@ public class CommonController {
135 132 String fileName = null;
136 133 File file = new File(ctxPath + File.separator + bizPath + File.separator );
137 134 if (!file.exists()) {
138   - file.mkdirs();// 创建文件根目录
  135 + // 创建文件根目录
  136 + file.mkdirs();
139 137 }
140   - String orgName = mf.getOriginalFilename();// 获取文件名
  138 + // 获取文件名
  139 + String orgName = mf.getOriginalFilename();
141 140 orgName = CommonUtils.getFileName(orgName);
142 141 if(orgName.indexOf(".")!=-1){
143 142 fileName = orgName.substring(0, orgName.lastIndexOf(".")) + "_" + System.currentTimeMillis() + orgName.substring(orgName.lastIndexOf("."));
... ... @@ -228,7 +227,8 @@ public class CommonController {
228 227 response.setStatus(404);
229 228 throw new RuntimeException("文件["+imgPath+"]不存在..");
230 229 }
231   - response.setContentType("application/force-download");// 设置强制下载不打开
  230 + // 设置强制下载不打开
  231 + response.setContentType("application/force-download");
232 232 response.addHeader("Content-Disposition", "attachment;fileName=" + new String(file.getName().getBytes("UTF-8"),"iso-8859-1"));
233 233 inputStream = new BufferedInputStream(new FileInputStream(filePath));
234 234 outputStream = response.getOutputStream();
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/DuplicateCheckController.java
... ... @@ -4,9 +4,11 @@ import javax.servlet.http.HttpServletRequest;
4 4  
5 5 import org.apache.commons.lang.StringUtils;
6 6 import org.jeecg.common.api.vo.Result;
  7 +import org.jeecg.common.constant.SymbolConstant;
7 8 import org.jeecg.common.util.SqlInjectionUtil;
8 9 import org.jeecg.modules.system.mapper.SysDictMapper;
9 10 import org.jeecg.modules.system.model.DuplicateCheckVo;
  11 +import org.jeecg.modules.system.security.DictQueryBlackListHandler;
10 12 import org.springframework.beans.factory.annotation.Autowired;
11 13 import org.springframework.web.bind.annotation.RequestMapping;
12 14 import org.springframework.web.bind.annotation.RequestMethod;
... ... @@ -32,6 +34,9 @@ public class DuplicateCheckController {
32 34 @Autowired
33 35 SysDictMapper sysDictMapper;
34 36  
  37 + @Autowired
  38 + DictQueryBlackListHandler dictQueryBlackListHandler;
  39 +
35 40 /**
36 41 * 校验数据是否在系统中是否存在
37 42 *
... ... @@ -55,6 +60,12 @@ public class DuplicateCheckController {
55 60 rs.setMessage("数据为空,不作处理!");
56 61 return rs;
57 62 }
  63 + //update-begin-author:taoyan date:20220329 for: VUEN-223【安全漏洞】当前被攻击的接口
  64 + String checkSql = duplicateCheckVo.getTableName() + SymbolConstant.COMMA + duplicateCheckVo.getFieldName() + SymbolConstant.COMMA;
  65 + if(!dictQueryBlackListHandler.isPass(checkSql)){
  66 + return Result.error(dictQueryBlackListHandler.getError());
  67 + }
  68 + //update-end-author:taoyan date:20220329 for: VUEN-223【安全漏洞】当前被攻击的接口
58 69 // update-end-author:taoyan date:20211227 for: JTC-25 【online报表】oracle 操作问题 录入弹框啥都不填直接保存 ①编码不是应该提示必填么?②报错也应该是具体文字提示,不是后台错误日志
59 70 if (StringUtils.isNotBlank(duplicateCheckVo.getDataId())) {
60 71 // [2].编辑页面校验
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/LoginController.java
... ... @@ -12,7 +12,6 @@ import org.apache.shiro.SecurityUtils;
12 12 import org.jeecg.common.api.vo.Result;
13 13 import org.jeecg.common.constant.CacheConstant;
14 14 import org.jeecg.common.constant.CommonConstant;
15   -import org.jeecg.common.system.api.ISysBaseAPI;
16 15 import org.jeecg.common.system.util.JwtUtil;
17 16 import org.jeecg.common.system.vo.LoginUser;
18 17 import org.jeecg.common.util.*;
... ... @@ -23,6 +22,7 @@ import org.jeecg.modules.system.entity.SysTenant;
23 22 import org.jeecg.modules.system.entity.SysUser;
24 23 import org.jeecg.modules.system.model.SysLoginModel;
25 24 import org.jeecg.modules.system.service.*;
  25 +import org.jeecg.modules.system.service.impl.SysBaseApiImpl;
26 26 import org.jeecg.modules.system.util.RandImageUtil;
27 27 import org.springframework.beans.BeanUtils;
28 28 import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -45,7 +45,7 @@ public class LoginController {
45 45 @Autowired
46 46 private ISysUserService sysUserService;
47 47 @Autowired
48   - private ISysBaseAPI sysBaseAPI;
  48 + private SysBaseApiImpl sysBaseApi;
49 49 @Autowired
50 50 private ISysLogService logService;
51 51 @Autowired
... ... @@ -77,7 +77,7 @@ public class LoginController {
77 77 return result;
78 78 }
79 79 String lowerCaseCaptcha = captcha.toLowerCase();
80   - String realKey = MD5Util.MD5Encode(lowerCaseCaptcha+sysLoginModel.getCheckKey(), "utf-8");
  80 + String realKey = Md5Util.md5Encode(lowerCaseCaptcha+sysLoginModel.getCheckKey(), "utf-8");
81 81 Object checkCode = redisUtil.get(realKey);
82 82 //当进入登录页时,有一定几率出现验证码错误 #1714
83 83 if(checkCode==null || !checkCode.toString().equals(lowerCaseCaptcha)) {
... ... @@ -129,11 +129,8 @@ public class LoginController {
129 129 if(oConvertUtils.isNotEmpty(username)) {
130 130 // 根据用户名查询用户信息
131 131 SysUser sysUser = sysUserService.getUserByName(username);
132   - //用户登录信息
133   - Result<JSONObject> resultObj=userInfo(sysUser, result);
134   - JSONObject jsonObject=resultObj.getResult();
135 132 JSONObject obj=new JSONObject();
136   - obj.put("userInfo",jsonObject.get("userInfo"));
  133 + obj.put("userInfo",sysUser);
137 134 obj.put("sysAllDictItems", sysDictService.queryAllDictItems());
138 135 result.setResult(obj);
139 136 result.success("");
... ... @@ -156,7 +153,7 @@ public class LoginController {
156 153 return Result.error("退出登录失败!");
157 154 }
158 155 String username = JwtUtil.getUsername(token);
159   - LoginUser sysUser = sysBaseAPI.getUserByName(username);
  156 + LoginUser sysUser = sysBaseApi.getUserByName(username);
160 157 if(sysUser!=null) {
161 158 //update-begin--Author:wangshuai Date:20200714 for:登出日志没有记录人员
162 159 baseCommonService.addLog("用户名: "+sysUser.getRealname()+",退出成功!", CommonConstant.LOG_TYPE_1, null,sysUser);
... ... @@ -436,7 +433,7 @@ public class LoginController {
436 433 @GetMapping(value = "/getEncryptedString")
437 434 public Result<Map<String,String>> getEncryptedString(){
438 435 Result<Map<String,String>> result = new Result<Map<String,String>>();
439   - Map<String,String> map = new HashMap<String,String>();
  436 + Map<String,String> map = new HashMap(5);
440 437 map.put("key", EncryptedString.key);
441 438 map.put("iv",EncryptedString.iv);
442 439 result.setResult(map);
... ... @@ -450,7 +447,7 @@ public class LoginController {
450 447 */
451 448 @ApiOperation("获取验证码")
452 449 @GetMapping(value = "/randomImage/{key}")
453   - public Result<String> randomImage(HttpServletResponse response,@PathVariable String key){
  450 + public Result<String> randomImage(HttpServletResponse response,@PathVariable("key") String key){
454 451 Result<String> res = new Result<String>();
455 452 try {
456 453 //生成验证码
... ... @@ -459,7 +456,7 @@ public class LoginController {
459 456  
460 457 //存到redis中
461 458 String lowerCaseCode = code.toLowerCase();
462   - String realKey = MD5Util.MD5Encode(lowerCaseCode+key, "utf-8");
  459 + String realKey = Md5Util.md5Encode(lowerCaseCode+key, "utf-8");
463 460 log.info("获取验证码,Redis checkCode = {},key = {}", code, key);
464 461 redisUtil.set(realKey, lowerCaseCode, 60);
465 462  
... ... @@ -548,7 +545,7 @@ public class LoginController {
548 545 return Result.error("验证码无效");
549 546 }
550 547 String lowerCaseCaptcha = captcha.toLowerCase();
551   - String realKey = MD5Util.MD5Encode(lowerCaseCaptcha+checkKey, "utf-8");
  548 + String realKey = Md5Util.md5Encode(lowerCaseCaptcha+checkKey, "utf-8");
552 549 Object checkCode = redisUtil.get(realKey);
553 550 if(checkCode==null || !checkCode.equals(lowerCaseCaptcha)) {
554 551 return Result.error("验证码错误");
... ... @@ -593,7 +590,7 @@ public class LoginController {
593 590 @GetMapping("/getQrcodeToken")
594 591 public Result getQrcodeToken(@RequestParam String qrcodeId) {
595 592 Object token = redisUtil.get(CommonConstant.LOGIN_QRCODE_TOKEN + qrcodeId);
596   - Map result = new HashMap();
  593 + Map result = new HashMap(5);
597 594 Object qrcodeIdExpire = redisUtil.get(CommonConstant.LOGIN_QRCODE + qrcodeId);
598 595 if (oConvertUtils.isEmpty(qrcodeIdExpire)) {
599 596 //二维码过期通知前台刷新
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysAnnouncementController.java
... ... @@ -13,7 +13,6 @@ import org.jeecg.common.api.vo.Result;
13 13 import org.jeecg.common.constant.CommonConstant;
14 14 import org.jeecg.common.constant.CommonSendStatus;
15 15 import org.jeecg.common.constant.WebsocketConst;
16   -import org.jeecg.common.system.api.ISysBaseAPI;
17 16 import org.jeecg.common.system.query.QueryGenerator;
18 17 import org.jeecg.common.system.util.JwtUtil;
19 18 import org.jeecg.common.system.vo.LoginUser;
... ... @@ -25,6 +24,7 @@ import org.jeecg.modules.system.entity.SysAnnouncement;
25 24 import org.jeecg.modules.system.entity.SysAnnouncementSend;
26 25 import org.jeecg.modules.system.service.ISysAnnouncementSendService;
27 26 import org.jeecg.modules.system.service.ISysAnnouncementService;
  27 +import org.jeecg.modules.system.service.impl.SysBaseApiImpl;
28 28 import org.jeecg.modules.system.service.impl.ThirdAppDingtalkServiceImpl;
29 29 import org.jeecg.modules.system.service.impl.ThirdAppWechatEnterpriseServiceImpl;
30 30 import org.jeecg.modules.system.util.XSSUtils;
... ... @@ -74,7 +74,7 @@ public class SysAnnouncementController {
74 74 @Autowired
75 75 ThirdAppDingtalkServiceImpl dingtalkService;
76 76 @Autowired
77   - private ISysBaseAPI sysBaseAPI;
  77 + private SysBaseApiImpl sysBaseApi;
78 78 @Autowired
79 79 @Lazy
80 80 private RedisUtil redisUtil;
... ... @@ -129,7 +129,8 @@ public class SysAnnouncementController {
129 129 sysAnnouncement.setTitile(title);
130 130 // update-end-author:liusq date:20210804 for:标题处理xss攻击的问题
131 131 sysAnnouncement.setDelFlag(CommonConstant.DEL_FLAG_0.toString());
132   - sysAnnouncement.setSendStatus(CommonSendStatus.UNPUBLISHED_STATUS_0);//未发布
  132 + //未发布
  133 + sysAnnouncement.setSendStatus(CommonSendStatus.UNPUBLISHED_STATUS_0);
133 134 sysAnnouncementService.saveAnnouncement(sysAnnouncement);
134 135 result.success("添加成功!");
135 136 } catch (Exception e) {
... ... @@ -239,7 +240,8 @@ public class SysAnnouncementController {
239 240 if(sysAnnouncement==null) {
240 241 result.error500("未找到对应实体");
241 242 }else {
242   - sysAnnouncement.setSendStatus(CommonSendStatus.PUBLISHED_STATUS_1);//发布中
  243 + //发布中
  244 + sysAnnouncement.setSendStatus(CommonSendStatus.PUBLISHED_STATUS_1);
243 245 sysAnnouncement.setSendTime(new Date());
244 246 String currentUserName = JwtUtil.getUserNameByToken(request);
245 247 sysAnnouncement.setSender(currentUserName);
... ... @@ -295,7 +297,8 @@ public class SysAnnouncementController {
295 297 if(sysAnnouncement==null) {
296 298 result.error500("未找到对应实体");
297 299 }else {
298   - sysAnnouncement.setSendStatus(CommonSendStatus.REVOKE_STATUS_2);//撤销发布
  300 + //撤销发布
  301 + sysAnnouncement.setSendStatus(CommonSendStatus.REVOKE_STATUS_2);
299 302 sysAnnouncement.setCancelTime(new Date());
300 303 boolean ok = sysAnnouncementService.updateById(sysAnnouncement);
301 304 if(ok) {
... ... @@ -324,10 +327,14 @@ public class SysAnnouncementController {
324 327 String userId = sysUser.getId();
325 328 // 1.将系统消息补充到用户通告阅读标记表中
326 329 LambdaQueryWrapper<SysAnnouncement> querySaWrapper = new LambdaQueryWrapper<SysAnnouncement>();
327   - querySaWrapper.eq(SysAnnouncement::getMsgType,CommonConstant.MSG_TYPE_ALL); // 全部人员
328   - querySaWrapper.eq(SysAnnouncement::getDelFlag,CommonConstant.DEL_FLAG_0.toString()); // 未删除
329   - querySaWrapper.eq(SysAnnouncement::getSendStatus, CommonConstant.HAS_SEND); //已发布
330   - querySaWrapper.ge(SysAnnouncement::getEndTime, sysUser.getCreateTime()); //新注册用户不看结束通知
  330 + //全部人员
  331 + querySaWrapper.eq(SysAnnouncement::getMsgType,CommonConstant.MSG_TYPE_ALL);
  332 + //未删除
  333 + querySaWrapper.eq(SysAnnouncement::getDelFlag,CommonConstant.DEL_FLAG_0.toString());
  334 + //已发布
  335 + querySaWrapper.eq(SysAnnouncement::getSendStatus, CommonConstant.HAS_SEND);
  336 + //新注册用户不看结束通知
  337 + querySaWrapper.ge(SysAnnouncement::getEndTime, sysUser.getCreateTime());
331 338 //update-begin--Author:liusq Date:20210108 for:[JT-424] 【开源issue】bug处理--------------------
332 339 querySaWrapper.notInSql(SysAnnouncement::getId,"select annt_id from sys_announcement_send where user_id='"+userId+"'");
333 340 //update-begin--Author:liusq Date:20210108 for: [JT-424] 【开源issue】bug处理--------------------
... ... @@ -354,10 +361,12 @@ public class SysAnnouncementController {
354 361 }
355 362 // 2.查询用户未读的系统消息
356 363 Page<SysAnnouncement> anntMsgList = new Page<SysAnnouncement>(0, pageSize);
357   - anntMsgList = sysAnnouncementService.querySysCementPageByUserId(anntMsgList,userId,"1");//通知公告消息
  364 + //通知公告消息
  365 + anntMsgList = sysAnnouncementService.querySysCementPageByUserId(anntMsgList,userId,"1");
358 366 Page<SysAnnouncement> sysMsgList = new Page<SysAnnouncement>(0, pageSize);
359   - sysMsgList = sysAnnouncementService.querySysCementPageByUserId(sysMsgList,userId,"2");//系统消息
360   - Map<String,Object> sysMsgMap = new HashMap<String, Object>();
  367 + //系统消息
  368 + sysMsgList = sysAnnouncementService.querySysCementPageByUserId(sysMsgList,userId,"2");
  369 + Map<String,Object> sysMsgMap = new HashMap(5);
361 370 sysMsgMap.put("sysMsgList", sysMsgList.getRecords());
362 371 sysMsgMap.put("sysMsgTotal", sysMsgList.getTotal());
363 372 sysMsgMap.put("anntMsgList", anntMsgList.getRecords());
... ... @@ -402,7 +411,8 @@ public class SysAnnouncementController {
402 411 MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
403 412 Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
404 413 for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
405   - MultipartFile file = entity.getValue();// 获取上传文件对象
  414 + // 获取上传文件对象
  415 + MultipartFile file = entity.getValue();
406 416 ImportParams params = new ImportParams();
407 417 params.setTitleRows(2);
408 418 params.setHeadRows(1);
... ... @@ -481,7 +491,7 @@ public class SysAnnouncementController {
481 491 boolean tokenOK = false;
482 492 try {
483 493 // 验证Token有效性
484   - tokenOK = TokenUtils.verifyToken(request, sysBaseAPI, redisUtil);
  494 + tokenOK = TokenUtils.verifyToken(request, sysBaseApi, redisUtil);
485 495 } catch (Exception ignored) {
486 496 }
487 497 // 判断是否传递了Token,并且Token有效,如果传了就不做查看限制,直接返回
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysCategoryController.java
... ... @@ -230,7 +230,8 @@ public class SysCategoryController {
230 230 List<String> errorMessage = new ArrayList<>();
231 231 int successLines = 0, errorLines = 0;
232 232 for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
233   - MultipartFile file = entity.getValue();// 获取上传文件对象
  233 + // 获取上传文件对象
  234 + MultipartFile file = entity.getValue();
234 235 ImportParams params = new ImportParams();
235 236 params.setTitleRows(2);
236 237 params.setHeadRows(1);
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysDataLogController.java
... ... @@ -22,6 +22,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
22 22  
23 23 import lombok.extern.slf4j.Slf4j;
24 24  
  25 +/**
  26 + * @Description: 系统数据日志
  27 + * @author: jeecg-boot
  28 + */
25 29 @RestController
26 30 @RequestMapping("/sys/dataLog")
27 31 @Slf4j
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysDataSourceController.java
... ... @@ -58,7 +58,7 @@ public class SysDataSourceController extends JeecgController&lt;SysDataSource, ISys
58 58 */
59 59 @AutoLog(value = "多数据源管理-分页列表查询")
60 60 @ApiOperation(value = "多数据源管理-分页列表查询", notes = "多数据源管理-分页列表查询")
61   - //@RequiresRoles("admin")
  61 + @RequiresRoles("admin")
62 62 @GetMapping(value = "/list")
63 63 public Result<?> queryPageList(
64 64 SysDataSource sysDataSource,
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysDepartController.java
... ... @@ -171,7 +171,7 @@ public class SysDepartController {
171 171 * @param sysDepart
172 172 * @return
173 173 */
174   - //@RequiresRoles({"admin"})
  174 + @RequiresRoles({"admin"})
175 175 @RequestMapping(value = "/add", method = RequestMethod.POST)
176 176 @CacheEvict(value= {CacheConstant.SYS_DEPARTS_CACHE,CacheConstant.SYS_DEPART_IDS_CACHE}, allEntries=true)
177 177 public Result<SysDepart> add(@RequestBody SysDepart sysDepart, HttpServletRequest request) {
... ... @@ -197,7 +197,7 @@ public class SysDepartController {
197 197 * @param sysDepart
198 198 * @return
199 199 */
200   - //@RequiresRoles({"admin"})
  200 + @RequiresRoles({"admin"})
201 201 @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
202 202 @CacheEvict(value= {CacheConstant.SYS_DEPARTS_CACHE,CacheConstant.SYS_DEPART_IDS_CACHE}, allEntries=true)
203 203 public Result<SysDepart> edit(@RequestBody SysDepart sysDepart, HttpServletRequest request) {
... ... @@ -225,7 +225,7 @@ public class SysDepartController {
225 225 * @param id
226 226 * @return
227 227 */
228   - //@RequiresRoles({"admin"})
  228 + @RequiresRoles({"admin"})
229 229 @RequestMapping(value = "/delete", method = RequestMethod.DELETE)
230 230 @CacheEvict(value= {CacheConstant.SYS_DEPARTS_CACHE,CacheConstant.SYS_DEPART_IDS_CACHE}, allEntries=true)
231 231 public Result<SysDepart> delete(@RequestParam(name="id",required=true) String id) {
... ... @@ -253,7 +253,7 @@ public class SysDepartController {
253 253 * @param ids
254 254 * @return
255 255 */
256   - //@RequiresRoles({"admin"})
  256 + @RequiresRoles({"admin"})
257 257 @RequestMapping(value = "/deleteBatch", method = RequestMethod.DELETE)
258 258 @CacheEvict(value= {CacheConstant.SYS_DEPARTS_CACHE,CacheConstant.SYS_DEPART_IDS_CACHE}, allEntries=true)
259 259 public Result<SysDepart> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
... ... @@ -370,7 +370,7 @@ public class SysDepartController {
370 370 * @param response
371 371 * @return
372 372 */
373   - //@RequiresRoles({"admin"})
  373 + @RequiresRoles({"admin"})
374 374 @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
375 375 @CacheEvict(value= {CacheConstant.SYS_DEPARTS_CACHE,CacheConstant.SYS_DEPART_IDS_CACHE}, allEntries=true)
376 376 public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
... ... @@ -379,14 +379,15 @@ public class SysDepartController {
379 379 List<SysDepart> listSysDeparts = null;
380 380 Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
381 381 for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
382   - MultipartFile file = entity.getValue();// 获取上传文件对象
  382 + // 获取上传文件对象
  383 + MultipartFile file = entity.getValue();
383 384 ImportParams params = new ImportParams();
384 385 params.setTitleRows(2);
385 386 params.setHeadRows(1);
386 387 params.setNeedSave(true);
387 388 try {
388 389 // orgCode编码长度
389   - int codeLength = YouBianCodeUtil.zhanweiLength;
  390 + int codeLength = YouBianCodeUtil.ZHANWEI_LENGTH;
390 391 listSysDeparts = ExcelImportUtil.importExcel(file.getInputStream(), SysDepart.class, params);
391 392 //按长度排序
392 393 Collections.sort(listSysDeparts, new Comparator<SysDepart>() {
... ... @@ -476,7 +477,7 @@ public class SysDepartController {
476 477 public Result<Map<String,Object>> queryTreeByKeyWord(@RequestParam(name = "keyWord", required = false) String keyWord) {
477 478 Result<Map<String,Object>> result = new Result<>();
478 479 try {
479   - Map<String,Object> map=new HashMap<String,Object>();
  480 + Map<String,Object> map=new HashMap(5);
480 481 List<SysDepartTreeModel> list = sysDepartService.queryTreeByKeyWord(keyWord);
481 482 //根据keyWord获取用户信息
482 483 LambdaQueryWrapper<SysUser> queryUser = new LambdaQueryWrapper<SysUser>();
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysDepartPermissionController.java
... ... @@ -2,16 +2,20 @@ package org.jeecg.modules.system.controller;
2 2  
3 3 import java.util.*;
4 4 import java.util.stream.Collectors;
  5 +import javax.annotation.Resource;
5 6 import javax.servlet.http.HttpServletRequest;
6 7 import javax.servlet.http.HttpServletResponse;
7 8  
8 9 import com.alibaba.fastjson.JSONObject;
9 10 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  11 +import org.apache.shiro.SecurityUtils;
10 12 import org.jeecg.common.api.vo.Result;
11 13 import org.jeecg.common.constant.CommonConstant;
12 14 import org.jeecg.common.system.query.QueryGenerator;
13 15 import org.jeecg.common.aspect.annotation.AutoLog;
  16 +import org.jeecg.common.system.vo.LoginUser;
14 17 import org.jeecg.common.util.oConvertUtils;
  18 +import org.jeecg.modules.base.service.BaseCommonService;
15 19 import org.jeecg.modules.system.entity.SysDepartPermission;
16 20 import org.jeecg.modules.system.entity.SysDepartRolePermission;
17 21 import org.jeecg.modules.system.entity.SysPermission;
... ... @@ -56,6 +60,9 @@ public class SysDepartPermissionController extends JeecgController&lt;SysDepartPerm
56 60 @Autowired
57 61 private ISysDepartRolePermissionService sysDepartRolePermissionService;
58 62  
  63 + @Autowired
  64 + private BaseCommonService baseCommonService;
  65 +
59 66 /**
60 67 * 分页列表查询
61 68 *
... ... @@ -174,7 +181,7 @@ public class SysDepartPermissionController extends JeecgController&lt;SysDepartPerm
174 181 if(list==null || list.size()==0) {
175 182 return Result.error("未找到权限配置信息");
176 183 }else {
177   - Map<String,Object> map = new HashMap<>();
  184 + Map<String,Object> map = new HashMap(5);
178 185 map.put("datarule", list);
179 186 LambdaQueryWrapper<SysDepartPermission> query = new LambdaQueryWrapper<SysDepartPermission>()
180 187 .eq(SysDepartPermission::getPermissionId, permissionId)
... ... @@ -253,7 +260,11 @@ public class SysDepartPermissionController extends JeecgController&lt;SysDepartPerm
253 260 String lastPermissionIds = json.getString("lastpermissionIds");
254 261 this.sysDepartRolePermissionService.saveDeptRolePermission(roleId, permissionIds, lastPermissionIds);
255 262 result.success("保存成功!");
256   - log.info("======部门角色授权成功=====耗时:" + (System.currentTimeMillis() - start) + "毫秒");
  263 + //update-begin---author:wangshuai ---date:20220316 for:[VUEN-234]部门角色授权添加敏感日志------------
  264 + LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
  265 + baseCommonService.addLog("修改部门角色ID:"+roleId+"的权限配置,操作人: " +loginUser.getUsername() ,CommonConstant.LOG_TYPE_2, 2);
  266 + //update-end---author:wangshuai ---date:20220316 for:[VUEN-234]部门角色授权添加敏感日志------------
  267 + log.info("======部门角色授权成功=====耗时:" + (System.currentTimeMillis() - start) + "毫秒");
257 268 } catch (Exception e) {
258 269 result.error500("授权失败!");
259 270 log.error(e.getMessage(), e);
... ... @@ -282,9 +293,11 @@ public class SysDepartPermissionController extends JeecgController&lt;SysDepartPerm
282 293 }
283 294 List<TreeModel> treeList = new ArrayList<>();
284 295 getTreeModelList(treeList, list, null);
285   - Map<String,Object> resMap = new HashMap<String,Object>();
286   - resMap.put("treeList", treeList); //全部树节点数据
287   - resMap.put("ids", ids);//全部树ids
  296 + Map<String,Object> resMap = new HashMap(5);
  297 + //全部树节点数据
  298 + resMap.put("treeList", treeList);
  299 + //全部树ids
  300 + resMap.put("ids", ids);
288 301 result.setResult(resMap);
289 302 result.setSuccess(true);
290 303 } catch (Exception e) {
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysDepartRoleController.java
... ... @@ -2,6 +2,7 @@ package org.jeecg.modules.system.controller;
2 2  
3 3 import java.util.*;
4 4 import java.util.stream.Collectors;
  5 +import javax.annotation.Resource;
5 6 import javax.servlet.http.HttpServletRequest;
6 7 import javax.servlet.http.HttpServletResponse;
7 8  
... ... @@ -15,6 +16,7 @@ import org.jeecg.common.system.query.QueryGenerator;
15 16 import org.jeecg.common.aspect.annotation.AutoLog;
16 17 import org.jeecg.common.system.vo.LoginUser;
17 18 import org.jeecg.common.util.oConvertUtils;
  19 +import org.jeecg.modules.base.service.BaseCommonService;
18 20 import org.jeecg.modules.system.entity.*;
19 21 import org.jeecg.modules.system.service.*;
20 22 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
... ... @@ -54,7 +56,10 @@ public class SysDepartRoleController extends JeecgController&lt;SysDepartRole, ISys
54 56  
55 57 @Autowired
56 58 private ISysDepartService sysDepartService;
57   -
  59 +
  60 + @Autowired
  61 + private BaseCommonService baseCommonService;
  62 +
58 63 /**
59 64 * 分页列表查询
60 65 *
... ... @@ -98,7 +103,7 @@ public class SysDepartRoleController extends JeecgController&lt;SysDepartRole, ISys
98 103 * @param sysDepartRole
99 104 * @return
100 105 */
101   - //@RequiresRoles({"admin"})
  106 + @RequiresRoles({"admin"})
102 107 @ApiOperation(value="部门角色-添加", notes="部门角色-添加")
103 108 @PostMapping(value = "/add")
104 109 public Result<?> add(@RequestBody SysDepartRole sysDepartRole) {
... ... @@ -112,7 +117,7 @@ public class SysDepartRoleController extends JeecgController&lt;SysDepartRole, ISys
112 117 * @param sysDepartRole
113 118 * @return
114 119 */
115   - //@RequiresRoles({"admin"})
  120 + @RequiresRoles({"admin"})
116 121 @ApiOperation(value="部门角色-编辑", notes="部门角色-编辑")
117 122 @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
118 123 public Result<?> edit(@RequestBody SysDepartRole sysDepartRole) {
... ... @@ -126,7 +131,7 @@ public class SysDepartRoleController extends JeecgController&lt;SysDepartRole, ISys
126 131 * @param id
127 132 * @return
128 133 */
129   - //@RequiresRoles({"admin"})
  134 + @RequiresRoles({"admin"})
130 135 @AutoLog(value = "部门角色-通过id删除")
131 136 @ApiOperation(value="部门角色-通过id删除", notes="部门角色-通过id删除")
132 137 @DeleteMapping(value = "/delete")
... ... @@ -141,7 +146,7 @@ public class SysDepartRoleController extends JeecgController&lt;SysDepartRole, ISys
141 146 * @param ids
142 147 * @return
143 148 */
144   - //@RequiresRoles({"admin"})
  149 + @RequiresRoles({"admin"})
145 150 @AutoLog(value = "部门角色-批量删除")
146 151 @ApiOperation(value="部门角色-批量删除", notes="部门角色-批量删除")
147 152 @DeleteMapping(value = "/deleteBatch")
... ... @@ -183,14 +188,18 @@ public class SysDepartRoleController extends JeecgController&lt;SysDepartRole, ISys
183 188 * @param json
184 189 * @return
185 190 */
186   - //@RequiresRoles({"admin"})
  191 + @RequiresRoles({"admin"})
187 192 @RequestMapping(value = "/deptRoleUserAdd", method = RequestMethod.POST)
188 193 public Result<?> deptRoleAdd(@RequestBody JSONObject json) {
189 194 String newRoleId = json.getString("newRoleId");
190 195 String oldRoleId = json.getString("oldRoleId");
191 196 String userId = json.getString("userId");
192 197 departRoleUserService.deptRoleUserAdd(userId,newRoleId,oldRoleId);
193   - return Result.ok("添加成功!");
  198 + //update-begin---author:wangshuai ---date:20220316 for:[VUEN-234]部门角色分配添加敏感日志------------
  199 + LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
  200 + baseCommonService.addLog("给部门用户ID:"+userId+"分配角色,操作人: " +loginUser.getUsername() ,CommonConstant.LOG_TYPE_2, 2);
  201 + //update-end---author:wangshuai ---date:20220316 for:[VUEN-234]部门角色分配添加敏感日志------------
  202 + return Result.ok("添加成功!");
194 203 }
195 204  
196 205 /**
... ... @@ -224,7 +233,7 @@ public class SysDepartRoleController extends JeecgController&lt;SysDepartRole, ISys
224 233 if(list==null || list.size()==0) {
225 234 return Result.error("未找到权限配置信息");
226 235 }else {
227   - Map<String,Object> map = new HashMap<>();
  236 + Map<String,Object> map = new HashMap(5);
228 237 map.put("datarule", list);
229 238 LambdaQueryWrapper<SysDepartRolePermission> query = new LambdaQueryWrapper<SysDepartRolePermission>()
230 239 .eq(SysDepartRolePermission::getPermissionId, permissionId)
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysDictController.java
... ... @@ -23,6 +23,7 @@ import org.jeecg.modules.system.entity.SysDict;
23 23 import org.jeecg.modules.system.entity.SysDictItem;
24 24 import org.jeecg.modules.system.model.SysDictTree;
25 25 import org.jeecg.modules.system.model.TreeSelectModel;
  26 +import org.jeecg.modules.system.security.DictQueryBlackListHandler;
26 27 import org.jeecg.modules.system.service.ISysDictItemService;
27 28 import org.jeecg.modules.system.service.ISysDictService;
28 29 import org.jeecg.modules.system.vo.SysDictPage;
... ... @@ -64,6 +65,8 @@ public class SysDictController {
64 65 private ISysDictItemService sysDictItemService;
65 66 @Autowired
66 67 public RedisTemplate<String, Object> redisTemplate;
  68 + @Autowired
  69 + private DictQueryBlackListHandler dictQueryBlackListHandler;
67 70  
68 71 @RequestMapping(value = "/list", method = RequestMethod.GET)
69 72 public Result<IPage<SysDict>> queryPageList(SysDict sysDict,@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
... ... @@ -118,7 +121,7 @@ public class SysDictController {
118 121 */
119 122 @RequestMapping(value = "/queryAllDictItems", method = RequestMethod.GET)
120 123 public Result<?> queryAllDictItems(HttpServletRequest request) {
121   - Map<String, List<DictModel>> res = new HashMap<String, List<DictModel>>();
  124 + Map<String, List<DictModel>> res = new HashMap(5);
122 125 res = sysDictService.queryAllDictItems();
123 126 return Result.ok(res);
124 127 }
... ... @@ -153,9 +156,14 @@ public class SysDictController {
153 156 * @return
154 157 */
155 158 @RequestMapping(value = "/getDictItems/{dictCode}", method = RequestMethod.GET)
156   - public Result<List<DictModel>> getDictItems(@PathVariable String dictCode, @RequestParam(value = "sign",required = false) String sign,HttpServletRequest request) {
  159 + public Result<List<DictModel>> getDictItems(@PathVariable("dictCode") String dictCode, @RequestParam(value = "sign",required = false) String sign,HttpServletRequest request) {
157 160 log.info(" dictCode : "+ dictCode);
158 161 Result<List<DictModel>> result = new Result<List<DictModel>>();
  162 + //update-begin-author:taoyan date:20220317 for: VUEN-222【安全机制】字典接口、online报表、online图表等接口,加一些安全机制
  163 + if(!dictQueryBlackListHandler.isPass(dictCode)){
  164 + return result.error500(dictQueryBlackListHandler.getError());
  165 + }
  166 + //update-end-author:taoyan date:20220317 for: VUEN-222【安全机制】字典接口、online报表、online图表等接口,加一些安全机制
159 167 try {
160 168 List<DictModel> ls = sysDictService.getDictItems(dictCode);
161 169 if (ls == null) {
... ... @@ -181,12 +189,17 @@ public class SysDictController {
181 189 * @return
182 190 */
183 191 @RequestMapping(value = "/loadDict/{dictCode}", method = RequestMethod.GET)
184   - public Result<List<DictModel>> loadDict(@PathVariable String dictCode,
185   - @RequestParam(name="keyword") String keyword,
  192 + public Result<List<DictModel>> loadDict(@PathVariable("dictCode") String dictCode,
  193 + @RequestParam(name="keyword",required = false) String keyword,
186 194 @RequestParam(value = "sign",required = false) String sign,
187 195 @RequestParam(value = "pageSize", required = false) Integer pageSize) {
188 196 log.info(" 加载字典表数据,加载关键字: "+ keyword);
189 197 Result<List<DictModel>> result = new Result<List<DictModel>>();
  198 + //update-begin-author:taoyan date:20220317 for: VUEN-222【安全机制】字典接口、online报表、online图表等接口,加一些安全机制
  199 + if(!dictQueryBlackListHandler.isPass(dictCode)){
  200 + return result.error500(dictQueryBlackListHandler.getError());
  201 + }
  202 + //update-end-author:taoyan date:20220317 for: VUEN-222【安全机制】字典接口、online报表、online图表等接口,加一些安全机制
190 203 try {
191 204 List<DictModel> ls = sysDictService.loadDict(dictCode, keyword, pageSize);
192 205 if (ls == null) {
... ... @@ -215,7 +228,7 @@ public class SysDictController {
215 228 */
216 229 @RequestMapping(value = "/loadDictOrderByValue/{dictCode}", method = RequestMethod.GET)
217 230 public Result<List<DictModel>> loadDictOrderByValue(
218   - @PathVariable String dictCode,
  231 + @PathVariable("dictCode") String dictCode,
219 232 @RequestParam(name = "keyword") String keyword,
220 233 @RequestParam(value = "sign", required = false) String sign,
221 234 @RequestParam(value = "pageSize", required = false) Integer pageSize) {
... ... @@ -256,8 +269,13 @@ public class SysDictController {
256 269 * @return
257 270 */
258 271 @RequestMapping(value = "/loadDictItem/{dictCode}", method = RequestMethod.GET)
259   - public Result<List<String>> loadDictItem(@PathVariable String dictCode,@RequestParam(name="key") String keys, @RequestParam(value = "sign",required = false) String sign,@RequestParam(value = "delNotExist",required = false,defaultValue = "true") boolean delNotExist,HttpServletRequest request) {
  272 + public Result<List<String>> loadDictItem(@PathVariable("dictCode") String dictCode,@RequestParam(name="key") String keys, @RequestParam(value = "sign",required = false) String sign,@RequestParam(value = "delNotExist",required = false,defaultValue = "true") boolean delNotExist,HttpServletRequest request) {
260 273 Result<List<String>> result = new Result<>();
  274 + //update-begin-author:taoyan date:20220317 for: VUEN-222【安全机制】字典接口、online报表、online图表等接口,加一些安全机制
  275 + if(!dictQueryBlackListHandler.isPass(dictCode)){
  276 + return result.error500(dictQueryBlackListHandler.getError());
  277 + }
  278 + //update-end-author:taoyan date:20220317 for: VUEN-222【安全机制】字典接口、online报表、online图表等接口,加一些安全机制
261 279 try {
262 280 if(dictCode.indexOf(",")!=-1) {
263 281 String[] params = dictCode.split(",");
... ... @@ -337,7 +355,7 @@ public class SysDictController {
337 355 * @param sysDict
338 356 * @return
339 357 */
340   - //@RequiresRoles({"admin"})
  358 + @RequiresRoles({"admin"})
341 359 @RequestMapping(value = "/add", method = RequestMethod.POST)
342 360 public Result<SysDict> add(@RequestBody SysDict sysDict) {
343 361 Result<SysDict> result = new Result<SysDict>();
... ... @@ -358,7 +376,7 @@ public class SysDictController {
358 376 * @param sysDict
359 377 * @return
360 378 */
361   - //@RequiresRoles({"admin"})
  379 + @RequiresRoles({"admin"})
362 380 @RequestMapping(value = "/edit", method = { RequestMethod.PUT,RequestMethod.POST })
363 381 public Result<SysDict> edit(@RequestBody SysDict sysDict) {
364 382 Result<SysDict> result = new Result<SysDict>();
... ... @@ -380,7 +398,7 @@ public class SysDictController {
380 398 * @param id
381 399 * @return
382 400 */
383   - //@RequiresRoles({"admin"})
  401 + @RequiresRoles({"admin"})
384 402 @RequestMapping(value = "/delete", method = RequestMethod.DELETE)
385 403 @CacheEvict(value={CacheConstant.SYS_DICT_CACHE, CacheConstant.SYS_ENABLE_DICT_CACHE}, allEntries=true)
386 404 public Result<SysDict> delete(@RequestParam(name="id",required=true) String id) {
... ... @@ -399,7 +417,7 @@ public class SysDictController {
399 417 * @param ids
400 418 * @return
401 419 */
402   - //@RequiresRoles({"admin"})
  420 + @RequiresRoles({"admin"})
403 421 @RequestMapping(value = "/deleteBatch", method = RequestMethod.DELETE)
404 422 @CacheEvict(value= {CacheConstant.SYS_DICT_CACHE, CacheConstant.SYS_ENABLE_DICT_CACHE}, allEntries=true)
405 423 public Result<SysDict> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
... ... @@ -482,13 +500,14 @@ public class SysDictController {
482 500 * @param
483 501 * @return
484 502 */
485   - //@RequiresRoles({"admin"})
  503 + @RequiresRoles({"admin"})
486 504 @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
487 505 public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
488 506 MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
489 507 Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
490 508 for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
491   - MultipartFile file = entity.getValue();// 获取上传文件对象
  509 + // 获取上传文件对象
  510 + MultipartFile file = entity.getValue();
492 511 ImportParams params = new ImportParams();
493 512 params.setTitleRows(2);
494 513 params.setHeadRows(2);
... ... @@ -568,7 +587,7 @@ public class SysDictController {
568 587 * @return
569 588 */
570 589 @RequestMapping(value = "/deletePhysic/{id}", method = RequestMethod.DELETE)
571   - public Result<?> deletePhysic(@PathVariable String id) {
  590 + public Result<?> deletePhysic(@PathVariable("id") String id) {
572 591 try {
573 592 sysDictService.deleteOneDictPhysically(id);
574 593 return Result.ok("删除成功!");
... ... @@ -584,7 +603,7 @@ public class SysDictController {
584 603 * @return
585 604 */
586 605 @RequestMapping(value = "/back/{id}", method = RequestMethod.PUT)
587   - public Result<?> back(@PathVariable String id) {
  606 + public Result<?> back(@PathVariable("id") String id) {
588 607 try {
589 608 sysDictService.updateDictDelFlag(0,id);
590 609 return Result.ok("操作成功!");
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysDictItemController.java
... ... @@ -7,6 +7,7 @@ import java.util.Date;
7 7 import javax.servlet.http.HttpServletRequest;
8 8  
9 9 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  10 +import io.swagger.annotations.Api;
10 11 import io.swagger.annotations.ApiOperation;
11 12 import org.apache.commons.lang.StringUtils;
12 13 import org.apache.shiro.authz.annotation.RequiresRoles;
... ... @@ -38,6 +39,7 @@ import lombok.extern.slf4j.Slf4j;
38 39 * @Author zhangweijian
39 40 * @since 2018-12-28
40 41 */
  42 +@Api(tags = "数据字典")
41 43 @RestController
42 44 @RequestMapping("/sys/dictItem")
43 45 @Slf4j
... ... @@ -71,7 +73,7 @@ public class SysDictItemController {
71 73 * @功能:新增
72 74 * @return
73 75 */
74   - //@RequiresRoles({"admin"})
  76 + @RequiresRoles({"admin"})
75 77 @RequestMapping(value = "/add", method = RequestMethod.POST)
76 78 @CacheEvict(value= {CacheConstant.SYS_DICT_CACHE, CacheConstant.SYS_ENABLE_DICT_CACHE}, allEntries=true)
77 79 public Result<SysDictItem> add(@RequestBody SysDictItem sysDictItem) {
... ... @@ -92,7 +94,7 @@ public class SysDictItemController {
92 94 * @param sysDictItem
93 95 * @return
94 96 */
95   - //@RequiresRoles({"admin"})
  97 + @RequiresRoles({"admin"})
96 98 @RequestMapping(value = "/edit", method = { RequestMethod.PUT,RequestMethod.POST })
97 99 @CacheEvict(value={CacheConstant.SYS_DICT_CACHE, CacheConstant.SYS_ENABLE_DICT_CACHE}, allEntries=true)
98 100 public Result<SysDictItem> edit(@RequestBody SysDictItem sysDictItem) {
... ... @@ -116,7 +118,7 @@ public class SysDictItemController {
116 118 * @param id
117 119 * @return
118 120 */
119   - //@RequiresRoles({"admin"})
  121 + @RequiresRoles({"admin"})
120 122 @RequestMapping(value = "/delete", method = RequestMethod.DELETE)
121 123 @CacheEvict(value={CacheConstant.SYS_DICT_CACHE, CacheConstant.SYS_ENABLE_DICT_CACHE}, allEntries=true)
122 124 public Result<SysDictItem> delete(@RequestParam(name="id",required=true) String id) {
... ... @@ -138,7 +140,7 @@ public class SysDictItemController {
138 140 * @param ids
139 141 * @return
140 142 */
141   - //@RequiresRoles({"admin"})
  143 + @RequiresRoles({"admin"})
142 144 @RequestMapping(value = "/deleteBatch", method = RequestMethod.DELETE)
143 145 @CacheEvict(value={CacheConstant.SYS_DICT_CACHE, CacheConstant.SYS_ENABLE_DICT_CACHE}, allEntries=true)
144 146 public Result<SysDictItem> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
... ... @@ -161,7 +163,7 @@ public class SysDictItemController {
161 163 @RequestMapping(value = "/dictItemCheck", method = RequestMethod.GET)
162 164 @ApiOperation("字典重复校验接口")
163 165 public Result<Object> doDictItemCheck(SysDictItem sysDictItem, HttpServletRequest request) {
164   - int num = 0;
  166 + Long num = Long.valueOf(0);
165 167 LambdaQueryWrapper<SysDictItem> queryWrapper = new LambdaQueryWrapper<SysDictItem>();
166 168 queryWrapper.eq(SysDictItem::getItemValue,sysDictItem.getItemValue());
167 169 queryWrapper.eq(SysDictItem::getDictId,sysDictItem.getDictId());
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysGatewayRouteController.java
... ... @@ -67,7 +67,7 @@ public class SysGatewayRouteController extends JeecgController&lt;SysGatewayRoute,
67 67 * @param id
68 68 * @return
69 69 */
70   - //@RequiresRoles({"admin"})
  70 + @RequiresRoles({"admin"})
71 71 @RequestMapping(value = "/delete", method = RequestMethod.DELETE)
72 72 public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
73 73 sysGatewayRouteService.deleteById(id);
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysPermissionController.java
... ... @@ -12,9 +12,10 @@ import org.jeecg.common.api.vo.Result;
12 12 import org.jeecg.common.constant.CommonConstant;
13 13 import org.jeecg.common.constant.enums.RoleIndexConfigEnum;
14 14 import org.jeecg.common.system.vo.LoginUser;
15   -import org.jeecg.common.util.MD5Util;
  15 +import org.jeecg.common.util.Md5Util;
16 16 import org.jeecg.common.util.oConvertUtils;
17 17 import org.jeecg.config.JeeccgBaseConfig;
  18 +import org.jeecg.modules.base.service.BaseCommonService;
18 19 import org.jeecg.modules.system.entity.*;
19 20 import org.jeecg.modules.system.model.SysPermissionTree;
20 21 import org.jeecg.modules.system.model.TreeModel;
... ... @@ -23,6 +24,7 @@ import org.jeecg.modules.system.util.PermissionDataUtil;
23 24 import org.springframework.beans.factory.annotation.Autowired;
24 25 import org.springframework.web.bind.annotation.*;
25 26  
  27 +import javax.servlet.http.HttpServletRequest;
26 28 import java.util.*;
27 29 import java.util.stream.Collectors;
28 30  
... ... @@ -57,6 +59,12 @@ public class SysPermissionController {
57 59 @Autowired
58 60 private JeeccgBaseConfig jeeccgBaseConfig;
59 61  
  62 + @Autowired
  63 + private BaseCommonService baseCommonService;
  64 +
  65 + @Autowired
  66 + private ISysRoleIndexService sysRoleIndexService;
  67 +
60 68 /**
61 69 * 加载数据节点
62 70 *
... ... @@ -156,7 +164,7 @@ public class SysPermissionController {
156 164 query.eq(SysPermission::getDelFlag, CommonConstant.DEL_FLAG_0);
157 165 query.orderByAsc(SysPermission::getSortNo);
158 166 List<SysPermission> list = sysPermissionService.list(query);
159   - Map<String, List<SysPermissionTree>> listMap = new HashMap<>();
  167 + Map<String, List<SysPermissionTree>> listMap = new HashMap(5);
160 168 for (SysPermission item : list) {
161 169 String pid = item.getParentId();
162 170 if (parentIdList.contains(pid)) {
... ... @@ -204,7 +212,7 @@ public class SysPermissionController {
204 212 * @return
205 213 */
206 214 @RequestMapping(value = "/getUserPermissionByToken", method = RequestMethod.GET)
207   - public Result<?> getUserPermissionByToken() {
  215 + public Result<?> getUserPermissionByToken(HttpServletRequest request) {
208 216 Result<JSONObject> result = new Result<JSONObject>();
209 217 try {
210 218 //直接获取当前用户不适用前端token
... ... @@ -311,7 +319,7 @@ public class SysPermissionController {
311 319 * @param permission
312 320 * @return
313 321 */
314   - //@RequiresRoles({ "admin" })
  322 + @RequiresRoles({ "admin" })
315 323 @RequestMapping(value = "/add", method = RequestMethod.POST)
316 324 public Result<SysPermission> add(@RequestBody SysPermission permission) {
317 325 Result<SysPermission> result = new Result<SysPermission>();
... ... @@ -331,7 +339,7 @@ public class SysPermissionController {
331 339 * @param permission
332 340 * @return
333 341 */
334   - //@RequiresRoles({ "admin" })
  342 + @RequiresRoles({ "admin" })
335 343 @RequestMapping(value = "/edit", method = { RequestMethod.PUT, RequestMethod.POST })
336 344 public Result<SysPermission> edit(@RequestBody SysPermission permission) {
337 345 Result<SysPermission> result = new Result<>();
... ... @@ -351,7 +359,7 @@ public class SysPermissionController {
351 359 * @param id
352 360 * @return
353 361 */
354   - //@RequiresRoles({ "admin" })
  362 + @RequiresRoles({ "admin" })
355 363 @RequestMapping(value = "/delete", method = RequestMethod.DELETE)
356 364 public Result<SysPermission> delete(@RequestParam(name = "id", required = true) String id) {
357 365 Result<SysPermission> result = new Result<>();
... ... @@ -370,7 +378,7 @@ public class SysPermissionController {
370 378 * @param ids
371 379 * @return
372 380 */
373   - //@RequiresRoles({ "admin" })
  381 + @RequiresRoles({ "admin" })
374 382 @RequestMapping(value = "/deleteBatch", method = RequestMethod.DELETE)
375 383 public Result<SysPermission> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
376 384 Result<SysPermission> result = new Result<>();
... ... @@ -411,8 +419,10 @@ public class SysPermissionController {
411 419 getTreeModelList(treeList, list, null);
412 420  
413 421 Map<String, Object> resMap = new HashMap<String, Object>();
414   - resMap.put("treeList", treeList); // 全部树节点数据
415   - resMap.put("ids", ids);// 全部树ids
  422 + // 全部树节点数据
  423 + resMap.put("treeList", treeList);
  424 + // 全部树ids
  425 + resMap.put("ids", ids);
416 426 result.setResult(resMap);
417 427 result.setSuccess(true);
418 428 } catch (Exception e) {
... ... @@ -468,7 +478,7 @@ public class SysPermissionController {
468 478 * @return
469 479 */
470 480 @RequestMapping(value = "/saveRolePermission", method = RequestMethod.POST)
471   - //@RequiresRoles({ "admin" })
  481 + @RequiresRoles({ "admin" })
472 482 public Result<String> saveRolePermission(@RequestBody JSONObject json) {
473 483 long start = System.currentTimeMillis();
474 484 Result<String> result = new Result<>();
... ... @@ -477,6 +487,10 @@ public class SysPermissionController {
477 487 String permissionIds = json.getString("permissionIds");
478 488 String lastPermissionIds = json.getString("lastpermissionIds");
479 489 this.sysRolePermissionService.saveRolePermission(roleId, permissionIds, lastPermissionIds);
  490 + //update-begin---author:wangshuai ---date:20220316 for:[VUEN-234]用户管理角色授权添加敏感日志------------
  491 + LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
  492 + baseCommonService.addLog("修改角色ID: "+roleId+" 的权限配置,操作人: " +loginUser.getUsername() ,CommonConstant.LOG_TYPE_2, 2);
  493 + //update-end---author:wangshuai ---date:20220316 for:[VUEN-234]用户管理角色授权添加敏感日志------------
480 494 result.success("保存成功!");
481 495 log.info("======角色授权成功=====耗时:" + (System.currentTimeMillis() - start) + "毫秒");
482 496 } catch (Exception e) {
... ... @@ -654,13 +668,15 @@ public class SysPermissionController {
654 668 } else if (permission.getMenuType().equals(CommonConstant.MENU_TYPE_0) || permission.getMenuType().equals(CommonConstant.MENU_TYPE_1)) {
655 669 json.put("id", permission.getId());
656 670 if (permission.isRoute()) {
657   - json.put("route", "1");// 表示生成路由
  671 + //表示生成路由
  672 + json.put("route", "1");
658 673 } else {
659   - json.put("route", "0");// 表示不生成路由
  674 + //表示不生成路由
  675 + json.put("route", "0");
660 676 }
661 677  
662 678 if (isWWWHttpUrl(permission.getUrl())) {
663   - json.put("path", MD5Util.MD5Encode(permission.getUrl(), "utf-8"));
  679 + json.put("path", Md5Util.md5Encode(permission.getUrl(), "utf-8"));
664 680 } else {
665 681 json.put("path", permission.getUrl());
666 682 }
... ... @@ -789,7 +805,7 @@ public class SysPermissionController {
789 805 * @param sysPermissionDataRule
790 806 * @return
791 807 */
792   - //@RequiresRoles({ "admin" })
  808 + @RequiresRoles({ "admin" })
793 809 @RequestMapping(value = "/addPermissionRule", method = RequestMethod.POST)
794 810 public Result<SysPermissionDataRule> addPermissionRule(@RequestBody SysPermissionDataRule sysPermissionDataRule) {
795 811 Result<SysPermissionDataRule> result = new Result<SysPermissionDataRule>();
... ... @@ -804,7 +820,7 @@ public class SysPermissionController {
804 820 return result;
805 821 }
806 822  
807   - //@RequiresRoles({ "admin" })
  823 + @RequiresRoles({ "admin" })
808 824 @RequestMapping(value = "/editPermissionRule", method = { RequestMethod.PUT, RequestMethod.POST })
809 825 public Result<SysPermissionDataRule> editPermissionRule(@RequestBody SysPermissionDataRule sysPermissionDataRule) {
810 826 Result<SysPermissionDataRule> result = new Result<SysPermissionDataRule>();
... ... @@ -824,7 +840,7 @@ public class SysPermissionController {
824 840 * @param id
825 841 * @return
826 842 */
827   - //@RequiresRoles({ "admin" })
  843 + @RequiresRoles({ "admin" })
828 844 @RequestMapping(value = "/deletePermissionRule", method = RequestMethod.DELETE)
829 845 public Result<SysPermissionDataRule> deletePermissionRule(@RequestParam(name = "id", required = true) String id) {
830 846 Result<SysPermissionDataRule> result = new Result<SysPermissionDataRule>();
... ... @@ -881,7 +897,7 @@ public class SysPermissionController {
881 897 * @return
882 898 */
883 899 @RequestMapping(value = "/saveDepartPermission", method = RequestMethod.POST)
884   - //@RequiresRoles({ "admin" })
  900 + @RequiresRoles({ "admin" })
885 901 public Result<String> saveDepartPermission(@RequestBody JSONObject json) {
886 902 long start = System.currentTimeMillis();
887 903 Result<String> result = new Result<>();
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysPositionController.java
... ... @@ -234,7 +234,8 @@ public class SysPositionController {
234 234 List<String> errorMessage = new ArrayList<>();
235 235 int successLines = 0, errorLines = 0;
236 236 for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
237   - MultipartFile file = entity.getValue();// 获取上传文件对象
  237 + // 获取上传文件对象
  238 + MultipartFile file = entity.getValue();
238 239 ImportParams params = new ImportParams();
239 240 params.setTitleRows(2);
240 241 params.setHeadRows(1);
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysRoleController.java
... ... @@ -109,7 +109,7 @@ public class SysRoleController {
109 109 * @return
110 110 */
111 111 @RequestMapping(value = "/add", method = RequestMethod.POST)
112   - //@RequiresRoles({"admin"})
  112 + @RequiresRoles({"admin"})
113 113 public Result<SysRole> add(@RequestBody SysRole role) {
114 114 Result<SysRole> result = new Result<SysRole>();
115 115 try {
... ... @@ -128,7 +128,7 @@ public class SysRoleController {
128 128 * @param role
129 129 * @return
130 130 */
131   - //@RequiresRoles({"admin"})
  131 + @RequiresRoles({"admin"})
132 132 @RequestMapping(value = "/edit",method = {RequestMethod.PUT,RequestMethod.POST})
133 133 public Result<SysRole> edit(@RequestBody SysRole role) {
134 134 Result<SysRole> result = new Result<SysRole>();
... ... @@ -152,7 +152,7 @@ public class SysRoleController {
152 152 * @param id
153 153 * @return
154 154 */
155   - //@RequiresRoles({"admin"})
  155 + @RequiresRoles({"admin"})
156 156 @RequestMapping(value = "/delete", method = RequestMethod.DELETE)
157 157 public Result<?> delete(@RequestParam(name="id",required=true) String id) {
158 158 sysRoleService.deleteRole(id);
... ... @@ -164,7 +164,7 @@ public class SysRoleController {
164 164 * @param ids
165 165 * @return
166 166 */
167   - //@RequiresRoles({"admin"})
  167 + @RequiresRoles({"admin"})
168 168 @RequestMapping(value = "/deleteBatch", method = RequestMethod.DELETE)
169 169 public Result<SysRole> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
170 170 Result<SysRole> result = new Result<SysRole>();
... ... @@ -214,7 +214,8 @@ public class SysRoleController {
214 214 @RequestMapping(value = "/checkRoleCode", method = RequestMethod.GET)
215 215 public Result<Boolean> checkUsername(String id,String roleCode) {
216 216 Result<Boolean> result = new Result<>();
217   - result.setResult(true);//如果此参数为false则程序发生异常
  217 + //如果此参数为false则程序发生异常
  218 + result.setResult(true);
218 219 log.info("--验证角色编码是否唯一---id:"+id+"--roleCode:"+roleCode);
219 220 try {
220 221 SysRole role = null;
... ... @@ -277,7 +278,8 @@ public class SysRoleController {
277 278 MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
278 279 Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
279 280 for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
280   - MultipartFile file = entity.getValue();// 获取上传文件对象
  281 + // 获取上传文件对象
  282 + MultipartFile file = entity.getValue();
281 283 ImportParams params = new ImportParams();
282 284 params.setTitleRows(2);
283 285 params.setHeadRows(1);
... ... @@ -307,7 +309,7 @@ public class SysRoleController {
307 309 if(list==null || list.size()==0) {
308 310 return Result.error("未找到权限配置信息");
309 311 }else {
310   - Map<String,Object> map = new HashMap<>();
  312 + Map<String,Object> map = new HashMap(5);
311 313 map.put("datarule", list);
312 314 LambdaQueryWrapper<SysRolePermission> query = new LambdaQueryWrapper<SysRolePermission>()
313 315 .eq(SysRolePermission::getPermissionId, permissionId)
... ... @@ -375,9 +377,11 @@ public class SysRoleController {
375 377 }
376 378 List<TreeModel> treeList = new ArrayList<>();
377 379 getTreeModelList(treeList, list, null);
378   - Map<String,Object> resMap = new HashMap<String,Object>();
379   - resMap.put("treeList", treeList); //全部树节点数据
380   - resMap.put("ids", ids);//全部树ids
  380 + Map<String,Object> resMap = new HashMap(5);
  381 + //全部树节点数据
  382 + resMap.put("treeList", treeList);
  383 + //全部树ids
  384 + resMap.put("ids", ids);
381 385 result.setResult(resMap);
382 386 result.setSuccess(true);
383 387 } catch (Exception e) {
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysRoleIndexController.java 0 → 100644
  1 +package org.jeecg.modules.system.controller;
  2 +
  3 +import java.util.Arrays;
  4 +import javax.servlet.http.HttpServletRequest;
  5 +import javax.servlet.http.HttpServletResponse;
  6 +
  7 +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  8 +import org.jeecg.common.api.vo.Result;
  9 +import org.jeecg.common.system.query.QueryGenerator;
  10 +import org.jeecg.common.aspect.annotation.AutoLog;
  11 +import org.jeecg.modules.system.entity.SysRoleIndex;
  12 +import org.jeecg.modules.system.service.ISysRoleIndexService;
  13 +
  14 +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
  15 +import com.baomidou.mybatisplus.core.metadata.IPage;
  16 +import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
  17 +import lombok.extern.slf4j.Slf4j;
  18 +import org.jeecg.common.system.base.controller.JeecgController;
  19 +
  20 +import org.springframework.beans.factory.annotation.Autowired;
  21 +import org.springframework.web.bind.annotation.*;
  22 +import org.springframework.web.servlet.ModelAndView;
  23 +import io.swagger.annotations.Api;
  24 +import io.swagger.annotations.ApiOperation;
  25 +
  26 +/**
  27 + * @Description: 角色首页配置
  28 + * @Author: jeecg-boot
  29 + * @Date: 2022-03-25
  30 + * @Version: V1.0
  31 + */
  32 +@Slf4j
  33 +@Api(tags = "角色首页配置")
  34 +@RestController
  35 +@RequestMapping("/sys/sysRoleIndex")
  36 +public class SysRoleIndexController extends JeecgController<SysRoleIndex, ISysRoleIndexService> {
  37 + @Autowired
  38 + private ISysRoleIndexService sysRoleIndexService;
  39 +
  40 + /**
  41 + * 分页列表查询
  42 + *
  43 + * @param sysRoleIndex
  44 + * @param pageNo
  45 + * @param pageSize
  46 + * @param req
  47 + * @return
  48 + */
  49 + @AutoLog(value = "角色首页配置-分页列表查询")
  50 + @ApiOperation(value = "角色首页配置-分页列表查询", notes = "角色首页配置-分页列表查询")
  51 + @GetMapping(value = "/list")
  52 + public Result<?> queryPageList(SysRoleIndex sysRoleIndex,
  53 + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
  54 + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
  55 + HttpServletRequest req) {
  56 + QueryWrapper<SysRoleIndex> queryWrapper = QueryGenerator.initQueryWrapper(sysRoleIndex, req.getParameterMap());
  57 + Page<SysRoleIndex> page = new Page<SysRoleIndex>(pageNo, pageSize);
  58 + IPage<SysRoleIndex> pageList = sysRoleIndexService.page(page, queryWrapper);
  59 + return Result.OK(pageList);
  60 + }
  61 +
  62 + /**
  63 + * 添加
  64 + *
  65 + * @param sysRoleIndex
  66 + * @return
  67 + */
  68 + @AutoLog(value = "角色首页配置-添加")
  69 + @ApiOperation(value = "角色首页配置-添加", notes = "角色首页配置-添加")
  70 + @PostMapping(value = "/add")
  71 + public Result<?> add(@RequestBody SysRoleIndex sysRoleIndex) {
  72 + sysRoleIndexService.save(sysRoleIndex);
  73 + return Result.OK("添加成功!");
  74 + }
  75 +
  76 + /**
  77 + * 编辑
  78 + *
  79 + * @param sysRoleIndex
  80 + * @return
  81 + */
  82 + @AutoLog(value = "角色首页配置-编辑")
  83 + @ApiOperation(value = "角色首页配置-编辑", notes = "角色首页配置-编辑")
  84 + @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
  85 + public Result<?> edit(@RequestBody SysRoleIndex sysRoleIndex) {
  86 + sysRoleIndexService.updateById(sysRoleIndex);
  87 + return Result.OK("编辑成功!");
  88 + }
  89 +
  90 + /**
  91 + * 通过id删除
  92 + *
  93 + * @param id
  94 + * @return
  95 + */
  96 + @AutoLog(value = "角色首页配置-通过id删除")
  97 + @ApiOperation(value = "角色首页配置-通过id删除", notes = "角色首页配置-通过id删除")
  98 + @DeleteMapping(value = "/delete")
  99 + public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
  100 + sysRoleIndexService.removeById(id);
  101 + return Result.OK("删除成功!");
  102 + }
  103 +
  104 + /**
  105 + * 批量删除
  106 + *
  107 + * @param ids
  108 + * @return
  109 + */
  110 + @AutoLog(value = "角色首页配置-批量删除")
  111 + @ApiOperation(value = "角色首页配置-批量删除", notes = "角色首页配置-批量删除")
  112 + @DeleteMapping(value = "/deleteBatch")
  113 + public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
  114 + this.sysRoleIndexService.removeByIds(Arrays.asList(ids.split(",")));
  115 + return Result.OK("批量删除成功!");
  116 + }
  117 +
  118 + /**
  119 + * 通过id查询
  120 + *
  121 + * @param id
  122 + * @return
  123 + */
  124 + @AutoLog(value = "角色首页配置-通过id查询")
  125 + @ApiOperation(value = "角色首页配置-通过id查询", notes = "角色首页配置-通过id查询")
  126 + @GetMapping(value = "/queryById")
  127 + public Result<?> queryById(@RequestParam(name = "id", required = true) String id) {
  128 + SysRoleIndex sysRoleIndex = sysRoleIndexService.getById(id);
  129 + return Result.OK(sysRoleIndex);
  130 + }
  131 +
  132 + /**
  133 + * 导出excel
  134 + *
  135 + * @param request
  136 + * @param sysRoleIndex
  137 + */
  138 + @RequestMapping(value = "/exportXls")
  139 + public ModelAndView exportXls(HttpServletRequest request, SysRoleIndex sysRoleIndex) {
  140 + return super.exportXls(request, sysRoleIndex, SysRoleIndex.class, "角色首页配置");
  141 + }
  142 +
  143 + /**
  144 + * 通过excel导入数据
  145 + *
  146 + * @param request
  147 + * @param response
  148 + * @return
  149 + */
  150 + @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
  151 + public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
  152 + return super.importExcel(request, response, SysRoleIndex.class);
  153 + }
  154 +
  155 + /**
  156 + * 通过code查询
  157 + *
  158 + * @param roleCode
  159 + * @return
  160 + */
  161 + @AutoLog(value = "角色首页配置-通过code查询")
  162 + @ApiOperation(value = "角色首页配置-通过code查询", notes = "角色首页配置-通过code查询")
  163 + @GetMapping(value = "/queryByCode")
  164 + public Result<?> queryByCode(@RequestParam(name = "roleCode", required = true) String roleCode) {
  165 + SysRoleIndex sysRoleIndex = sysRoleIndexService.getOne(new LambdaQueryWrapper<SysRoleIndex>().eq(SysRoleIndex::getRoleCode, roleCode));
  166 + return Result.OK(sysRoleIndex);
  167 + }
  168 +}
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysTenantController.java
... ... @@ -22,6 +22,7 @@ import java.util.*;
22 22  
23 23 /**
24 24 * 租户配置信息
  25 + * @author: jeecg-boot
25 26 */
26 27 @Slf4j
27 28 @RestController
... ... @@ -134,7 +135,7 @@ public class SysTenantController {
134 135 // 过滤掉已被引用的租户
135 136 List<Integer> idList = new ArrayList<>();
136 137 for (String id : ls) {
137   - int userCount = sysTenantService.countUserLinkTenant(id);
  138 + Long userCount = sysTenantService.countUserLinkTenant(id);
138 139 if (userCount == 0) {
139 140 idList.add(Integer.parseInt(id));
140 141 }
... ... @@ -200,7 +201,7 @@ public class SysTenantController {
200 201 try {
201 202 LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
202 203 String tenantIds = sysUser.getRelTenantIds();
203   - Map<String,Object> map = new HashMap<String,Object>();
  204 + Map<String,Object> map = new HashMap(5);
204 205 if (oConvertUtils.isNotEmpty(tenantIds)) {
205 206 List<Integer> tenantIdList = new ArrayList<>();
206 207 for(String id: tenantIds.split(",")){
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysUploadController.java
... ... @@ -19,6 +19,7 @@ import javax.servlet.http.HttpServletRequest;
19 19  
20 20 /**
21 21 * minio文件上传示例
  22 + * @author: jeecg-boot
22 23 */
23 24 @Slf4j
24 25 @RestController
... ... @@ -45,8 +46,10 @@ public class SysUploadController {
45 46 bizPath = "";
46 47 }
47 48 MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
48   - MultipartFile file = multipartRequest.getFile("file");// 获取上传文件对象
49   - String orgName = file.getOriginalFilename();// 获取文件名
  49 + // 获取上传文件对象
  50 + MultipartFile file = multipartRequest.getFile("file");
  51 + // 获取文件名
  52 + String orgName = file.getOriginalFilename();
50 53 orgName = CommonUtils.getFileName(orgName);
51 54 String file_url = MinioUtil.upload(file,bizPath);
52 55 if(oConvertUtils.isEmpty(file_url)){
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysUserAgentController.java
... ... @@ -236,7 +236,8 @@ public class SysUserAgentController {
236 236 MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
237 237 Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
238 238 for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
239   - MultipartFile file = entity.getValue();// 获取上传文件对象
  239 + // 获取上传文件对象
  240 + MultipartFile file = entity.getValue();
240 241 ImportParams params = new ImportParams();
241 242 params.setTitleRows(2);
242 243 params.setHeadRows(1);
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysUserController.java
... ... @@ -42,7 +42,6 @@ import org.springframework.web.multipart.MultipartFile;
42 42 import org.springframework.web.multipart.MultipartHttpServletRequest;
43 43 import org.springframework.web.servlet.ModelAndView;
44 44  
45   -import javax.annotation.Resource;
46 45 import javax.servlet.http.HttpServletRequest;
47 46 import javax.servlet.http.HttpServletResponse;
48 47 import java.io.IOException;
... ... @@ -61,9 +60,7 @@ import java.util.stream.Collectors;
61 60 @RestController
62 61 @RequestMapping("/sys/user")
63 62 public class SysUserController {
64   - @Autowired
65   - private ISysBaseAPI sysBaseAPI;
66   -
  63 +
67 64 @Autowired
68 65 private ISysUserService sysUserService;
69 66  
... ... @@ -91,7 +88,7 @@ public class SysUserController {
91 88 @Value("${jeecg.path.upload}")
92 89 private String upLoadPath;
93 90  
94   - @Resource
  91 + @Autowired
95 92 private BaseCommonService baseCommonService;
96 93  
97 94 /**
... ... @@ -117,7 +114,13 @@ public class SysUserController {
117 114 query.eq(SysUserDepart::getDepId,departId);
118 115 List<SysUserDepart> list = sysUserDepartService.list(query);
119 116 List<String> userIds = list.stream().map(SysUserDepart::getUserId).collect(Collectors.toList());
120   - queryWrapper.in("id",userIds);
  117 + //update-begin---author:wangshuai ---date:20220322 for:[issues/I4XTYB]查询用户时,当部门id 下没有分配用户时接口报错------------
  118 + if(oConvertUtils.listIsNotEmpty(userIds)){
  119 + queryWrapper.in("id",userIds);
  120 + }else{
  121 + return Result.OK();
  122 + }
  123 + //update-end---author:wangshuai ---date:20220322 for:[issues/I4XTYB]查询用户时,当部门id 下没有分配用户时接口报错------------
121 124 }
122 125 //用户ID
123 126 String code = req.getParameter("code");
... ... @@ -155,8 +158,8 @@ public class SysUserController {
155 158 return result;
156 159 }
157 160  
158   - //@RequiresRoles({"admin"})
159   - //@RequiresPermissions("user:add")
  161 + @RequiresRoles({"admin"})
  162 + @RequiresPermissions("user:add")
160 163 @RequestMapping(value = "/add", method = RequestMethod.POST)
161 164 public Result<SysUser> add(@RequestBody JSONObject jsonObject) {
162 165 Result<SysUser> result = new Result<SysUser>();
... ... @@ -173,6 +176,7 @@ public class SysUserController {
173 176 user.setDelFlag(CommonConstant.DEL_FLAG_0);
174 177 // 保存用户走一个service 保证事务
175 178 sysUserService.saveUser(user, selectedRoles, selectedDeparts);
  179 + baseCommonService.addLog("添加用户,username: " +user.getUsername() ,CommonConstant.LOG_TYPE_2, 2);
176 180 result.success("添加成功!");
177 181 } catch (Exception e) {
178 182 log.error(e.getMessage(), e);
... ... @@ -181,14 +185,14 @@ public class SysUserController {
181 185 return result;
182 186 }
183 187  
184   - //@RequiresRoles({"admin"})
185   - //@RequiresPermissions("user:edit")
  188 + @RequiresRoles({"admin"})
  189 + @RequiresPermissions("user:edit")
186 190 @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
187 191 public Result<SysUser> edit(@RequestBody JSONObject jsonObject) {
188 192 Result<SysUser> result = new Result<SysUser>();
189 193 try {
190 194 SysUser sysUser = sysUserService.getById(jsonObject.getString("id"));
191   - baseCommonService.addLog("编辑用户,id: " +jsonObject.getString("id") ,CommonConstant.LOG_TYPE_2, 2);
  195 + baseCommonService.addLog("编辑用户,username: " +sysUser.getUsername() ,CommonConstant.LOG_TYPE_2, 2);
192 196 if(sysUser==null) {
193 197 result.error500("未找到对应实体");
194 198 }else {
... ... @@ -216,7 +220,7 @@ public class SysUserController {
216 220 /**
217 221 * 删除用户
218 222 */
219   - //@RequiresRoles({"admin"})
  223 + @RequiresRoles({"admin"})
220 224 @RequestMapping(value = "/delete", method = RequestMethod.DELETE)
221 225 public Result<?> delete(@RequestParam(name="id",required=true) String id) {
222 226 baseCommonService.addLog("删除用户,id: " +id ,CommonConstant.LOG_TYPE_2, 3);
... ... @@ -227,7 +231,7 @@ public class SysUserController {
227 231 /**
228 232 * 批量删除用户
229 233 */
230   - //@RequiresRoles({"admin"})
  234 + @RequiresRoles({"admin"})
231 235 @RequestMapping(value = "/deleteBatch", method = RequestMethod.DELETE)
232 236 public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
233 237 baseCommonService.addLog("批量删除用户, ids: " +ids ,CommonConstant.LOG_TYPE_2, 3);
... ... @@ -240,7 +244,7 @@ public class SysUserController {
240 244 * @param jsonObject
241 245 * @return
242 246 */
243   - //@RequiresRoles({"admin"})
  247 + @RequiresRoles({"admin"})
244 248 @RequestMapping(value = "/frozenBatch", method = RequestMethod.PUT)
245 249 public Result<SysUser> frozenBatch(@RequestBody JSONObject jsonObject) {
246 250 Result<SysUser> result = new Result<SysUser>();
... ... @@ -328,7 +332,7 @@ public class SysUserController {
328 332 /**
329 333 * 修改密码
330 334 */
331   - //@RequiresRoles({"admin"})
  335 + @RequiresRoles({"admin"})
332 336 @RequestMapping(value = "/changePassword", method = RequestMethod.PUT)
333 337 public Result<?> changePassword(@RequestBody SysUser sysUser) {
334 338 SysUser u = this.sysUserService.getOne(new LambdaQueryWrapper<SysUser>().eq(SysUser::getUsername, sysUser.getUsername()));
... ... @@ -336,6 +340,10 @@ public class SysUserController {
336 340 return Result.error("用户不存在!");
337 341 }
338 342 sysUser.setId(u.getId());
  343 + //update-begin---author:wangshuai ---date:20220316 for:[VUEN-234]修改密码添加敏感日志------------
  344 + LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
  345 + baseCommonService.addLog("修改用户 "+sysUser.getUsername()+" 的密码,操作人: " +loginUser.getUsername() ,CommonConstant.LOG_TYPE_2, 2);
  346 + //update-end---author:wangshuai ---date:20220316 for:[VUEN-234]修改密码添加敏感日志------------
339 347 return sysUserService.changePassword(sysUser);
340 348 }
341 349  
... ... @@ -474,8 +482,8 @@ public class SysUserController {
474 482 * @param response
475 483 * @return
476 484 */
477   - //@RequiresRoles({"admin"})
478   - //@RequiresPermissions("user:import")
  485 + @RequiresRoles({"admin"})
  486 + @RequiresPermissions("user:import")
479 487 @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
480 488 public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response)throws IOException {
481 489 MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
... ... @@ -571,7 +579,7 @@ public class SysUserController {
571 579 /**
572 580 * 首页用户重置密码
573 581 */
574   - //@RequiresRoles({"admin"})
  582 + @RequiresRoles({"admin"})
575 583 @RequestMapping(value = "/updatePassword", method = RequestMethod.PUT)
576 584 public Result<?> updatePassword(@RequestBody JSONObject json) {
577 585 String username = json.getString("username");
... ... @@ -586,6 +594,10 @@ public class SysUserController {
586 594 if(user==null) {
587 595 return Result.error("用户不存在!");
588 596 }
  597 + //update-begin---author:wangshuai ---date:20220316 for:[VUEN-234]修改密码添加敏感日志------------
  598 + LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
  599 + baseCommonService.addLog("修改密码,username: " +loginUser.getUsername() ,CommonConstant.LOG_TYPE_2, 2);
  600 + //update-end---author:wangshuai ---date:20220316 for:[VUEN-234]修改密码添加敏感日志------------
589 601 return sysUserService.resetPassword(username,oldpassword,password,confirmpassword);
590 602 }
591 603  
... ... @@ -608,7 +620,7 @@ public class SysUserController {
608 620 * @param
609 621 * @return
610 622 */
611   - //@RequiresRoles({"admin"})
  623 + @RequiresRoles({"admin"})
612 624 @RequestMapping(value = "/addSysUserRole", method = RequestMethod.POST)
613 625 public Result<String> addSysUserRole(@RequestBody SysUserRoleVO sysUserRoleVO) {
614 626 Result<String> result = new Result<String>();
... ... @@ -639,7 +651,7 @@ public class SysUserController {
639 651 * @param
640 652 * @return
641 653 */
642   - //@RequiresRoles({"admin"})
  654 + @RequiresRoles({"admin"})
643 655 @RequestMapping(value = "/deleteUserRole", method = RequestMethod.DELETE)
644 656 public Result<SysUserRole> deleteUserRole(@RequestParam(name="roleId") String roleId,
645 657 @RequestParam(name="userId",required=true) String userId
... ... @@ -663,7 +675,7 @@ public class SysUserController {
663 675 * @param
664 676 * @return
665 677 */
666   - //@RequiresRoles({"admin"})
  678 + @RequiresRoles({"admin"})
667 679 @RequestMapping(value = "/deleteUserRoleBatch", method = RequestMethod.DELETE)
668 680 public Result<SysUserRole> deleteUserRoleBatch(
669 681 @RequestParam(name="roleId") String roleId,
... ... @@ -790,7 +802,7 @@ public class SysUserController {
790 802 /**
791 803 * 给指定部门添加对应的用户
792 804 */
793   - //@RequiresRoles({"admin"})
  805 + @RequiresRoles({"admin"})
794 806 @RequestMapping(value = "/editSysDepartWithUser", method = RequestMethod.POST)
795 807 public Result<String> editSysDepartWithUser(@RequestBody SysDepartUsersVO sysDepartUsersVO) {
796 808 Result<String> result = new Result<String>();
... ... @@ -819,7 +831,7 @@ public class SysUserController {
819 831 /**
820 832 * 删除指定机构的用户关系
821 833 */
822   - //@RequiresRoles({"admin"})
  834 + @RequiresRoles({"admin"})
823 835 @RequestMapping(value = "/deleteUserInDepart", method = RequestMethod.DELETE)
824 836 public Result<SysUserDepart> deleteUserInDepart(@RequestParam(name="depId") String depId,
825 837 @RequestParam(name="userId",required=true) String userId
... ... @@ -851,7 +863,7 @@ public class SysUserController {
851 863 /**
852 864 * 批量删除指定机构的用户关系
853 865 */
854   - //@RequiresRoles({"admin"})
  866 + @RequiresRoles({"admin"})
855 867 @RequestMapping(value = "/deleteUserInDepartBatch", method = RequestMethod.DELETE)
856 868 public Result<SysUserDepart> deleteUserInDepartBatch(
857 869 @RequestParam(name="depId") String depId,
... ... @@ -882,7 +894,7 @@ public class SysUserController {
882 894 try {
883 895 LoginUser sysUser = (LoginUser)SecurityUtils.getSubject().getPrincipal();
884 896 List<SysDepart> list = this.sysDepartService.queryUserDeparts(sysUser.getId());
885   - Map<String,Object> map = new HashMap<String,Object>();
  897 + Map<String,Object> map = new HashMap(5);
886 898 map.put("list", list);
887 899 map.put("orgCode", sysUser.getOrgCode());
888 900 result.setSuccess(true);
... ... @@ -1030,7 +1042,7 @@ public class SysUserController {
1030 1042 LambdaQueryWrapper<SysUser> query = new LambdaQueryWrapper<>();
1031 1043 query.eq(SysUser::getPhone,phone);
1032 1044 SysUser user = sysUserService.getOne(query);
1033   - Map<String,String> map = new HashMap<>();
  1045 + Map<String,String> map = new HashMap(5);
1034 1046 map.put("smscode",smscode);
1035 1047 map.put("username",user.getUsername());
1036 1048 result.setResult(map);
... ... @@ -1076,6 +1088,9 @@ public class SysUserController {
1076 1088 String passwordEncode = PasswordUtil.encrypt(sysUser.getUsername(), password, salt);
1077 1089 sysUser.setPassword(passwordEncode);
1078 1090 this.sysUserService.updateById(sysUser);
  1091 + //update-begin---author:wangshuai ---date:20220316 for:[VUEN-234]密码重置添加敏感日志------------
  1092 + baseCommonService.addLog("重置 "+username+" 的密码,操作人: " +sysUser.getUsername() ,CommonConstant.LOG_TYPE_2, 2);
  1093 + //update-end---author:wangshuai ---date:20220316 for:[VUEN-234]密码重置添加敏感日志------------
1079 1094 result.setSuccess(true);
1080 1095 result.setMessage("密码重置完成!");
1081 1096 return result;
... ... @@ -1200,7 +1215,7 @@ public class SysUserController {
1200 1215 * @param userIds 被删除的用户ID,多个id用半角逗号分割
1201 1216 * @return
1202 1217 */
1203   - //@RequiresRoles({"admin"})
  1218 + @RequiresRoles({"admin"})
1204 1219 @RequestMapping(value = "/deleteRecycleBin", method = RequestMethod.DELETE)
1205 1220 public Result deleteRecycleBin(@RequestParam("userIds") String userIds) {
1206 1221 if (StringUtils.isNotBlank(userIds)) {
... ... @@ -1297,7 +1312,7 @@ public class SysUserController {
1297 1312 @GetMapping("/queryChildrenByUsername")
1298 1313 public Result queryChildrenByUsername(@RequestParam("userId") String userId) {
1299 1314 //获取用户信息
1300   - Map<String,Object> map=new HashMap<String,Object>();
  1315 + Map<String,Object> map=new HashMap(5);
1301 1316 SysUser sysUser = sysUserService.getById(userId);
1302 1317 String username = sysUser.getUsername();
1303 1318 Integer identity = sysUser.getUserIdentity();
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysUserOnlineController.java
... ... @@ -7,13 +7,13 @@ import org.apache.shiro.SecurityUtils;
7 7 import org.jeecg.common.api.vo.Result;
8 8 import org.jeecg.common.constant.CacheConstant;
9 9 import org.jeecg.common.constant.CommonConstant;
10   -import org.jeecg.common.system.api.ISysBaseAPI;
11 10 import org.jeecg.common.system.util.JwtUtil;
12 11 import org.jeecg.common.system.vo.LoginUser;
13 12 import org.jeecg.common.util.RedisUtil;
14 13 import org.jeecg.common.util.oConvertUtils;
15 14 import org.jeecg.modules.base.service.BaseCommonService;
16 15 import org.jeecg.modules.system.service.ISysUserService;
  16 +import org.jeecg.modules.system.service.impl.SysBaseApiImpl;
17 17 import org.jeecg.modules.system.vo.SysUserOnlineVO;
18 18 import org.springframework.beans.BeanUtils;
19 19 import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -39,15 +39,12 @@ public class SysUserOnlineController {
39 39  
40 40 @Autowired
41 41 private RedisUtil redisUtil;
42   -
43 42 @Autowired
44 43 public RedisTemplate redisTemplate;
45   -
46 44 @Autowired
47 45 public ISysUserService userService;
48   -
49 46 @Autowired
50   - private ISysBaseAPI sysBaseAPI;
  47 + private SysBaseApiImpl sysBaseApi;
51 48  
52 49 @Resource
53 50 private BaseCommonService baseCommonService;
... ... @@ -63,7 +60,7 @@ public class SysUserOnlineController {
63 60 SysUserOnlineVO online = new SysUserOnlineVO();
64 61 online.setToken(token);
65 62 //TODO 改成一次性查询
66   - LoginUser loginUser = sysBaseAPI.getUserByName(JwtUtil.getUsername(token));
  63 + LoginUser loginUser = sysBaseApi.getUserByName(JwtUtil.getUsername(token));
67 64 if (loginUser != null) {
68 65 //update-begin---author:wangshuai ---date:20220104 for:[JTC-382]在线用户查询无效------------
69 66 //验证用户名是否与传过来的用户名相同
... ... @@ -113,7 +110,7 @@ public class SysUserOnlineController {
113 110 return Result.error("退出登录失败!");
114 111 }
115 112 String username = JwtUtil.getUsername(online.getToken());
116   - LoginUser sysUser = sysBaseAPI.getUserByName(username);
  113 + LoginUser sysUser = sysBaseApi.getUserByName(username);
117 114 if(sysUser!=null) {
118 115 baseCommonService.addLog("强制: "+sysUser.getRealname()+"退出成功!", CommonConstant.LOG_TYPE_1, null,sysUser);
119 116 log.info(" 强制 "+sysUser.getRealname()+"退出成功! ");
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/ThirdAppController.java
... ... @@ -19,6 +19,7 @@ import java.util.Map;
19 19  
20 20 /**
21 21 * 第三方App对接
  22 + * @author: jeecg-boot
22 23 */
23 24 @Slf4j
24 25 @RestController("thirdAppController")
... ... @@ -38,7 +39,7 @@ public class ThirdAppController {
38 39 */
39 40 @GetMapping("/getEnabledType")
40 41 public Result getEnabledType() {
41   - Map<String, Boolean> enabledMap = new HashMap<>();
  42 + Map<String, Boolean> enabledMap = new HashMap(5);
42 43 enabledMap.put("wechatEnterprise", thirdAppConfig.isWechatEnterpriseEnabled());
43 44 enabledMap.put("dingtalk", thirdAppConfig.isDingtalkEnabled());
44 45 return Result.OK(enabledMap);
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/ThirdLoginController.java
... ... @@ -198,10 +198,17 @@ public class ThirdLoginController {
198 198 String token = JwtUtil.sign(user.getUsername(), user.getPassword());
199 199 redisUtil.set(CommonConstant.PREFIX_USER_TOKEN + token, token);
200 200 // 设置超时时间
201   - redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, JwtUtil.EXPIRE_TIME / 1000);
  201 + redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, JwtUtil.EXPIRE_TIME * 2 / 1000);
202 202 return token;
203 203 }
204 204  
  205 + /**
  206 + * 第三方登录回调接口
  207 + * @param token
  208 + * @param thirdType
  209 + * @return
  210 + * @throws Exception
  211 + */
205 212 @SuppressWarnings("unchecked")
206 213 @RequestMapping(value = "/getLoginUser/{token}/{thirdType}", method = RequestMethod.GET)
207 214 @ResponseBody
... ... @@ -251,20 +258,21 @@ public class ThirdLoginController {
251 258 Result<String> result = new Result<String>();
252 259 String phone = jsonObject.getString("mobile");
253 260 String thirdUserUuid = jsonObject.getString("thirdUserUuid");
  261 + // 校验验证码
  262 + String captcha = jsonObject.getString("captcha");
  263 + Object captchaCache = redisUtil.get(phone);
  264 + if (oConvertUtils.isEmpty(captcha) || !captcha.equals(captchaCache)) {
  265 + result.setMessage("验证码错误");
  266 + result.setSuccess(false);
  267 + return result;
  268 + }
254 269 //校验用户有效性
255 270 SysUser sysUser = sysUserService.getUserByPhone(phone);
256 271 if(sysUser != null){
  272 + // 存在用户,直接绑定
257 273 sysThirdAccountService.updateThirdUserId(sysUser,thirdUserUuid);
258 274 }else{
259 275 // 不存在手机号,创建用户
260   - String smscode = jsonObject.getString("captcha");
261   - Object code = redisUtil.get(phone);
262   - if (!smscode.equals(code)) {
263   - result.setMessage("手机验证码错误");
264   - result.setSuccess(false);
265   - return result;
266   - }
267   - //创建用户
268 276 sysUser = sysThirdAccountService.createUser(phone,thirdUserUuid);
269 277 }
270 278 String token = saveToken(sysUser);
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/entity/SysDataLog.java
... ... @@ -13,6 +13,10 @@ import lombok.Data;
13 13 import lombok.EqualsAndHashCode;
14 14 import lombok.experimental.Accessors;
15 15  
  16 +/**
  17 + * @Description: 系统数据日志
  18 + * @author: jeecg-boot
  19 + */
16 20 @Data
17 21 @EqualsAndHashCode(callSuper = false)
18 22 @Accessors(chain = true)
... ... @@ -20,17 +24,52 @@ public class SysDataLog implements Serializable {
20 24 private static final long serialVersionUID = 1L;
21 25  
22 26 @TableId(type = IdType.ASSIGN_ID)
23   - private String id; //id'
24   - private String createBy; //创建人登录名称
  27 + /**
  28 + * id
  29 + */
  30 + private String id;
  31 +
  32 + /**
  33 + * 创建人登录名称
  34 + */
  35 + private String createBy;
  36 +
  37 + /**
  38 + * 创建日期
  39 + */
25 40 @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
26 41 @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
27   - private Date createTime; //创建日期
28   - private String updateBy; //更新人登录名称
  42 + private Date createTime;
  43 +
  44 + /**
  45 + * 更新人登录名称
  46 + */
  47 + private String updateBy;
29 48 @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
30 49 @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
31   - private Date updateTime; //更新日期
32   - private String dataTable; //表名
33   - private String dataId; //数据ID
34   - private String dataContent; //数据内容
35   - private String dataVersion; //版本号
  50 +
  51 + /**
  52 + * 更新日期
  53 + */
  54 + private Date updateTime;
  55 +
  56 + /**
  57 + * 表名
  58 + */
  59 + private String dataTable;
  60 +
  61 + /**
  62 + * 数据ID
  63 + */
  64 + private String dataId;
  65 +
  66 + /**
  67 + * 数据内容
  68 + */
  69 + private String dataContent;
  70 +
  71 + /**
  72 + * 版本号
  73 + */
  74 + private String dataVersion;
36 75 }
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/entity/SysDepart.java
1 1 package org.jeecg.modules.system.entity;
2 2  
3 3 import com.baomidou.mybatisplus.annotation.IdType;
  4 +import com.baomidou.mybatisplus.annotation.TableField;
4 5 import com.baomidou.mybatisplus.annotation.TableId;
5 6 import com.baomidou.mybatisplus.annotation.TableName;
6 7 import com.fasterxml.jackson.annotation.JsonFormat;
... ... @@ -85,6 +86,15 @@ public class SysDepart implements Serializable {
85 86 @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
86 87 @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
87 88 private Date updateTime;
  89 +
  90 + //update-begin---author:wangshuai ---date:20200308 for:[JTC-119]在部门管理菜单下设置部门负责人,新增字段负责人ids和旧的负责人ids
  91 + /**部门负责人的ids*/
  92 + @TableField(exist = false)
  93 + private String directorUserIds;
  94 + /**旧的部门负责人的ids(用于比较删除和新增)*/
  95 + @TableField(exist = false)
  96 + private String oldDirectorUserIds;
  97 + //update-end---author:wangshuai ---date:20200308 for:[JTC-119]新增字段负责人ids和旧的负责人ids
88 98  
89 99 /**
90 100 * 重写equals方法
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/entity/SysRoleIndex.java 0 → 100644
  1 +package org.jeecg.modules.system.entity;
  2 +
  3 +import java.io.Serializable;
  4 +import java.util.Date;
  5 +import com.baomidou.mybatisplus.annotation.IdType;
  6 +import com.baomidou.mybatisplus.annotation.TableId;
  7 +import com.baomidou.mybatisplus.annotation.TableName;
  8 +import com.baomidou.mybatisplus.annotation.TableField;
  9 +import io.swagger.annotations.ApiModel;
  10 +import io.swagger.annotations.ApiModelProperty;
  11 +import lombok.Data;
  12 +import lombok.EqualsAndHashCode;
  13 +import lombok.experimental.Accessors;
  14 +import com.fasterxml.jackson.annotation.JsonFormat;
  15 +import org.springframework.format.annotation.DateTimeFormat;
  16 +import org.jeecgframework.poi.excel.annotation.Excel;
  17 +
  18 +/**
  19 + * @Description: 角色首页配置
  20 + * @Author: liusq
  21 + * @Date: 2022-03-25
  22 + * @Version: V1.0
  23 + */
  24 +@Data
  25 +@TableName("sys_role_index")
  26 +@EqualsAndHashCode(callSuper = false)
  27 +@Accessors(chain = true)
  28 +@ApiModel(value="sys_role_index对象", description="角色首页配置")
  29 +public class SysRoleIndex {
  30 +
  31 + /**id*/
  32 + @TableId(type = IdType.ASSIGN_ID)
  33 + @ApiModelProperty(value = "id")
  34 + private java.lang.String id;
  35 + /**角色编码*/
  36 + @Excel(name = "角色编码", width = 15)
  37 + @ApiModelProperty(value = "角色编码")
  38 + private java.lang.String roleCode;
  39 + /**路由地址*/
  40 + @Excel(name = "路由地址", width = 15)
  41 + @ApiModelProperty(value = "路由地址")
  42 + private java.lang.String url;
  43 + /**优先级*/
  44 + @Excel(name = "优先级", width = 15)
  45 + @ApiModelProperty(value = "优先级")
  46 + private java.lang.Integer priority;
  47 + /**路由地址*/
  48 + @Excel(name = "状态", width = 15)
  49 + @ApiModelProperty(value = "状态")
  50 + private java.lang.String status;
  51 + /**创建人登录名称*/
  52 + @Excel(name = "创建人登录名称", width = 15)
  53 + @ApiModelProperty(value = "创建人登录名称")
  54 + private java.lang.String createBy;
  55 + /**创建日期*/
  56 + @Excel(name = "创建日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
  57 + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
  58 + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
  59 + @ApiModelProperty(value = "创建日期")
  60 + private java.util.Date createTime;
  61 + /**更新人登录名称*/
  62 + @Excel(name = "更新人登录名称", width = 15)
  63 + @ApiModelProperty(value = "更新人登录名称")
  64 + private java.lang.String updateBy;
  65 + /**更新日期*/
  66 + @Excel(name = "更新日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
  67 + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
  68 + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
  69 + @ApiModelProperty(value = "更新日期")
  70 + private java.util.Date updateTime;
  71 + /**所属部门*/
  72 + @Excel(name = "所属部门", width = 15)
  73 + @ApiModelProperty(value = "所属部门")
  74 + private java.lang.String sysOrgCode;
  75 +}
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/entity/SysTenant.java
... ... @@ -11,6 +11,7 @@ import java.util.Date;
11 11  
12 12 /**
13 13 * 租户信息
  14 + * @author: jeecg-boot
14 15 */
15 16 @Data
16 17 @TableName("sys_tenant")
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/entity/SysUserDepart.java
... ... @@ -7,6 +7,11 @@ import com.baomidou.mybatisplus.annotation.TableId;
7 7 import com.baomidou.mybatisplus.annotation.TableName;
8 8  
9 9 import lombok.Data;
  10 +
  11 +/**
  12 + * @Description: 用户部门
  13 + * @author: jeecg-boot
  14 + */
10 15 @Data
11 16 @TableName("sys_user_depart")
12 17 public class SysUserDepart implements Serializable {
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/SysAnnouncementMapper.java
... ... @@ -16,7 +16,13 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
16 16 */
17 17 public interface SysAnnouncementMapper extends BaseMapper<SysAnnouncement> {
18 18  
19   -
  19 + /**
  20 + * 通过消息类型和用户id获取系统通告
  21 + * @param page
  22 + * @param userId 用户id
  23 + * @param msgCategory 消息类型
  24 + * @return
  25 + */
20 26 List<SysAnnouncement> querySysCementListByUserId(Page<SysAnnouncement> page, @Param("userId")String userId,@Param("msgCategory")String msgCategory);
21 27  
22 28 }
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/SysAnnouncementSendMapper.java
... ... @@ -17,13 +17,17 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
17 17 */
18 18 public interface SysAnnouncementSendMapper extends BaseMapper<SysAnnouncementSend> {
19 19  
  20 + /**
  21 + * 通过用户id查询 用户通告阅读标记表
  22 + * @param userId 用户id
  23 + * @return
  24 + */
20 25 public List<String> queryByUserId(@Param("userId") String userId);
21 26  
22 27 /**
23   - * @功能:获取我的消息
  28 + * 获取我的消息
24 29 * @param announcementSendModel
25   - * @param pageSize
26   - * @param pageNo
  30 + * @param page
27 31 * @return
28 32 */
29 33 public List<AnnouncementSendModel> getMyAnnouncementSendList(Page<AnnouncementSendModel> page,@Param("announcementSendModel") AnnouncementSendModel announcementSendModel);
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/SysCategoryMapper.java
... ... @@ -19,12 +19,18 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
19 19 public interface SysCategoryMapper extends BaseMapper<SysCategory> {
20 20  
21 21 /**
22   - * 根据父级ID查询树节点数据
  22 + * 根据父级ID查询树节点数据
23 23 * @param pid
  24 + * @param query
24 25 * @return
25 26 */
26 27 public List<TreeSelectModel> queryListByPid(@Param("pid") String pid,@Param("query") Map<String, String> query);
27 28  
  29 + /**
  30 + * 通过code查询分类字典表
  31 + * @param code
  32 + * @return
  33 + */
28 34 @Select("SELECT ID FROM sys_category WHERE CODE = #{code,jdbcType=VARCHAR}")
29 35 public String queryIdByCode(@Param("code") String code);
30 36  
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/SysDataLogMapper.java
... ... @@ -5,6 +5,10 @@ import org.jeecg.modules.system.entity.SysDataLog;
5 5  
6 6 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
7 7  
  8 +/**
  9 + * @Description: 系统数据日志Mapper接口
  10 + * @author: jeecg-boot
  11 + */
8 12 public interface SysDataLogMapper extends BaseMapper<SysDataLog>{
9 13 /**
10 14 * 通过表名及数据Id获取最大版本
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/SysDepartMapper.java
... ... @@ -21,6 +21,8 @@ public interface SysDepartMapper extends BaseMapper&lt;SysDepart&gt; {
21 21  
22 22 /**
23 23 * 根据用户ID查询部门集合
  24 + * @param userId 用户id
  25 + * @return List<SysDepart>
24 26 */
25 27 public List<SysDepart> queryUserDeparts(@Param("userId") String userId);
26 28  
... ... @@ -32,9 +34,19 @@ public interface SysDepartMapper extends BaseMapper&lt;SysDepart&gt; {
32 34 */
33 35 public List<SysDepart> queryDepartsByUsername(@Param("username") String username);
34 36  
  37 + /**
  38 + * 通过部门编码获取部门id
  39 + * @param orgCode 部门编码
  40 + * @return String
  41 + */
35 42 @Select("select id from sys_depart where org_code=#{orgCode}")
36 43 public String queryDepartIdByOrgCode(@Param("orgCode") String orgCode);
37 44  
  45 + /**
  46 + * 通过部门id 查询部门id,父id
  47 + * @param departId 部门id
  48 + * @return
  49 + */
38 50 @Select("select id,parent_id from sys_depart where id=#{departId}")
39 51 public SysDepart getParentDepartId(@Param("departId") String departId);
40 52  
... ... @@ -52,6 +64,11 @@ public interface SysDepartMapper extends BaseMapper&lt;SysDepart&gt; {
52 64 */
53 65 List<String> getSubDepIdsByOrgCodes(@org.apache.ibatis.annotations.Param("orgCodes") String[] orgCodes);
54 66  
  67 + /**
  68 + * 根据parent_id查询下级部门
  69 + * @param parentId 父id
  70 + * @return List<SysDepart>
  71 + */
55 72 List<SysDepart> queryTreeListByPid(@Param("parentId") String parentId);
56 73 /**
57 74 * 根据id下级部门数量
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/SysDictItemMapper.java
... ... @@ -15,6 +15,12 @@ import java.util.List;
15 15 * @since 2018-12-28
16 16 */
17 17 public interface SysDictItemMapper extends BaseMapper<SysDictItem> {
  18 +
  19 + /**
  20 + * 通过字典id查询字典项
  21 + * @param mainId 字典id
  22 + * @return
  23 + */
18 24 @Select("SELECT * FROM sys_dict_item WHERE DICT_ID = #{mainId} order by sort_order asc, item_value asc")
19 25 public List<SysDictItem> selectItemsByMainId(String mainId);
20 26 }
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/SysDictMapper.java
... ... @@ -27,14 +27,26 @@ import java.util.Map;
27 27 public interface SysDictMapper extends BaseMapper<SysDict> {
28 28  
29 29 /**
30   - * 重复检查SQL
  30 + * 重复检查SQL
  31 + * @param duplicateCheckVo
31 32 * @return
32 33 */
33 34 @Deprecated
34 35 public Long duplicateCheckCountSql(DuplicateCheckVo duplicateCheckVo);
  36 +
  37 + /**
  38 + * 重复校验 sql语句
  39 + * @param duplicateCheckVo
  40 + * @return
  41 + */
35 42 @Deprecated
36 43 public Long duplicateCheckCountSqlNoDataId(DuplicateCheckVo duplicateCheckVo);
37   -
  44 +
  45 + /**
  46 + * 通过字典code获取字典数据
  47 + * @param code 字典code
  48 + * @return List<DictModel>
  49 + */
38 50 public List<DictModel> queryDictItemsByCode(@Param("code") String code);
39 51  
40 52 /**
... ... @@ -53,16 +65,44 @@ public interface SysDictMapper extends BaseMapper&lt;SysDict&gt; {
53 65 */
54 66 public List<DictModelMany> queryDictItemsByCodeList(@Param("dictCodeList") List<String> dictCodeList);
55 67  
  68 + /**
  69 + * 通过查询指定table的 text code 获取字典
  70 + * @param table
  71 + * @param text
  72 + * @param code
  73 + * @return List<DictModel>
  74 + */
56 75 @Deprecated
57 76 public List<DictModel> queryTableDictItemsByCode(@Param("table") String table,@Param("text") String text,@Param("code") String code);
58 77  
  78 + /**
  79 + * 通过查询指定table的 text code 获取字典(指定查询条件)
  80 + * @param table
  81 + * @param text
  82 + * @param code
  83 + * @param filterSql
  84 + * @return List<DictModel>
  85 + */
59 86 @Deprecated
60 87 public List<DictModel> queryTableDictItemsByCodeAndFilter(@Param("table") String table,@Param("text") String text,@Param("code") String code,@Param("filterSql") String filterSql);
61 88  
  89 + /**
  90 + * 通过查询指定table的 text code 获取字典
  91 + * @param table
  92 + * @param key
  93 + * @param value
  94 + * @return List<Map<String,String>>
  95 + */
62 96 @Deprecated
63 97 @Select("select ${key} as \"label\",${value} as \"value\" from ${table}")
64 98 public List<Map<String,String>> getDictByTableNgAlain(@Param("table") String table, @Param("key") String key, @Param("value") String value);
65 99  
  100 + /**
  101 + * 通过字典code获取字典数据
  102 + * @param code
  103 + * @param key
  104 + * @return
  105 + */
66 106 public String queryDictTextByKey(@Param("code") String code,@Param("key") String key);
67 107  
68 108 /**
... ... @@ -73,6 +113,14 @@ public interface SysDictMapper extends BaseMapper&lt;SysDict&gt; {
73 113 */
74 114 List<DictModelMany> queryManyDictByKeys(@Param("dictCodeList") List<String> dictCodeList, @Param("keys") List<String> keys);
75 115  
  116 + /**
  117 + * 通过查询指定table的 text code key 获取字典值
  118 + * @param table
  119 + * @param text
  120 + * @param code
  121 + * @param key
  122 + * @return String
  123 + */
76 124 @Deprecated
77 125 public String queryTableDictTextByKey(@Param("table") String table,@Param("text") String text,@Param("code") String code,@Param("key") String key);
78 126  
... ... @@ -88,6 +136,14 @@ public interface SysDictMapper extends BaseMapper&lt;SysDict&gt; {
88 136 @Deprecated
89 137 List<DictModel> queryTableDictTextByKeys(@Param("table") String table, @Param("text") String text, @Param("code") String code, @Param("keys") List<String> keys);
90 138  
  139 + /**
  140 + * 通过查询指定table的 text code key 获取字典值,包含value
  141 + * @param table
  142 + * @param text
  143 + * @param code
  144 + * @param keyArray
  145 + * @return List<DictModel>
  146 + */
91 147 @Deprecated
92 148 public List<DictModel> queryTableDictByKeys(@Param("table") String table, @Param("text") String text, @Param("code") String code, @Param("keyArray") String[] keyArray);
93 149  
... ... @@ -133,6 +189,8 @@ public interface SysDictMapper extends BaseMapper&lt;SysDict&gt; {
133 189 * @param code
134 190 * @param pid
135 191 * @param hasChildField
  192 + * @param query
  193 + * @param pidField
136 194 * @return
137 195 */
138 196 @Deprecated
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/SysLogMapper.java
... ... @@ -20,7 +20,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
20 20 public interface SysLogMapper extends BaseMapper<SysLog> {
21 21  
22 22 /**
23   - * @功能:清空所有日志记录
  23 + * 清空所有日志记录
24 24 */
25 25 public void removeAll();
26 26  
... ... @@ -34,14 +34,16 @@ public interface SysLogMapper extends BaseMapper&lt;SysLog&gt; {
34 34 //update-begin--Author:zhangweijian Date:20190428 for:传入开始时间,结束时间参数
35 35 /**
36 36 * 获取系统今日访问次数
37   - *
  37 + * @param dayStart 开始时间
  38 + * @param dayEnd 结束时间
38 39 * @return Long
39 40 */
40 41 Long findTodayVisitCount(@Param("dayStart") Date dayStart, @Param("dayEnd") Date dayEnd);
41 42  
42 43 /**
43 44 * 获取系统今日访问 IP数
44   - *
  45 + * @param dayStart 开始时间
  46 + * @param dayEnd 结束时间
45 47 * @return Long
46 48 */
47 49 Long findTodayIp(@Param("dayStart") Date dayStart, @Param("dayEnd") Date dayEnd);
... ... @@ -51,6 +53,7 @@ public interface SysLogMapper extends BaseMapper&lt;SysLog&gt; {
51 53 * 首页:根据时间统计访问数量/ip数量
52 54 * @param dayStart
53 55 * @param dayEnd
  56 + * @param dbType
54 57 * @return
55 58 */
56 59 List<Map<String,Object>> findVisitCount(@Param("dayStart") Date dayStart, @Param("dayEnd") Date dayEnd, @Param("dbType") String dbType);
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/SysPermissionMapper.java
... ... @@ -27,18 +27,24 @@ public interface SysPermissionMapper extends BaseMapper&lt;SysPermission&gt; {
27 27 public List<TreeModel> queryListByParentId(@Param("parentId") String parentId);
28 28  
29 29 /**
30   - * 根据用户查询用户权限
  30 + * 根据用户查询用户权限
  31 + * @param username 用户账户名称
  32 + * @return List<SysPermission>
31 33 */
32 34 public List<SysPermission> queryByUser(@Param("username") String username);
33 35  
34 36 /**
35   - * 修改菜单状态字段: 是否子节点
  37 + * 修改菜单状态字段: 是否子节点
  38 + * @param id 菜单id
  39 + * @param leaf 叶子节点
  40 + * @return int
36 41 */
37 42 @Update("update sys_permission set is_leaf=#{leaf} where id = #{id}")
38 43 public int setMenuLeaf(@Param("id") String id,@Param("leaf") int leaf);
39 44  
40 45 /**
41   - * 获取模糊匹配规则的数据权限URL
  46 + * 获取模糊匹配规则的数据权限URL
  47 + * @return List<String>
42 48 */
43 49 @Select("SELECT url FROM sys_permission WHERE del_flag = 0 and menu_type = 2 and url like '%*%'")
44 50 public List<String> queryPermissionUrlWithStar();
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/SysRoleIndexMapper.java 0 → 100644
  1 +package org.jeecg.modules.system.mapper;
  2 +
  3 +import java.util.List;
  4 +
  5 +import org.apache.ibatis.annotations.Param;
  6 +import org.jeecg.modules.system.entity.SysRoleIndex;
  7 +import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  8 +
  9 +/**
  10 + * @Description: 角色首页配置
  11 + * @Author: jeecg-boot
  12 + * @Date: 2022-03-25
  13 + * @Version: V1.0
  14 + */
  15 +public interface SysRoleIndexMapper extends BaseMapper<SysRoleIndex> {
  16 +
  17 +}
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/SysRoleMapper.java
... ... @@ -18,18 +18,19 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
18 18 public interface SysRoleMapper extends BaseMapper<SysRole> {
19 19  
20 20 /**
  21 + * @Description: 删除角色与用户关系
21 22 * @Author scott
22 23 * @Date 2019/12/13 16:12
23   - * @Description: 删除角色与用户关系
24 24 */
25 25 @Delete("delete from sys_user_role where role_id = #{roleId}")
26 26 void deleteRoleUserRelation(@Param("roleId") String roleId);
27 27  
28 28  
29 29 /**
  30 + * @Description: 删除角色与权限关系
30 31 * @Author scott
  32 + * @param roleId
31 33 * @Date 2019/12/13 16:12
32   - * @Description: 删除角色与权限关系
33 34 */
34 35 @Delete("delete from sys_role_permission where role_id = #{roleId}")
35 36 void deleteRolePermissionRelation(@Param("roleId") String roleId);
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/SysTenantMapper.java
... ... @@ -3,6 +3,10 @@ package org.jeecg.modules.system.mapper;
3 3 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 4 import org.jeecg.modules.system.entity.SysTenant;
5 5  
  6 +/**
  7 + * @Description: 租户mapper接口
  8 + * @author: jeecg-boot
  9 + */
6 10 public interface SysTenantMapper extends BaseMapper<SysTenant> {
7 11  
8 12 }
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/SysUserDepartMapper.java
... ... @@ -8,8 +8,17 @@ import org.jeecg.modules.system.entity.SysUser;
8 8 import org.jeecg.modules.system.entity.SysUserDepart;
9 9 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
10 10  
  11 +/**
  12 + * @Description: 用户部门mapper接口
  13 + * @author: jeecg-boot
  14 + */
11 15 public interface SysUserDepartMapper extends BaseMapper<SysUserDepart>{
12   -
  16 +
  17 + /**
  18 + * 通过用户id查询部门用户
  19 + * @param userId 用户id
  20 + * @return List<SysUserDepart>
  21 + */
13 22 List<SysUserDepart> getUserDepartByUid(@Param("userId") String userId);
14 23  
15 24 /**
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/SysUserMapper.java
... ... @@ -32,6 +32,7 @@ public interface SysUserMapper extends BaseMapper&lt;SysUser&gt; {
32 32 * 根据部门Id查询用户信息
33 33 * @param page
34 34 * @param departId
  35 + * @param username 用户登录账户
35 36 * @return
36 37 */
37 38 IPage<SysUser> getUserByDepId(Page page, @Param("departId") String departId, @Param("username") String username);
... ... @@ -47,6 +48,7 @@ public interface SysUserMapper extends BaseMapper&lt;SysUser&gt; {
47 48 * 根据部门Ids,查询部门下用户信息
48 49 * @param page
49 50 * @param departIds
  51 + * @param username 用户登录账户
50 52 * @return
51 53 */
52 54 IPage<SysUser> getUserByDepIds(Page page, @Param("departIds") List<String> departIds, @Param("username") String username);
... ... @@ -54,7 +56,8 @@ public interface SysUserMapper extends BaseMapper&lt;SysUser&gt; {
54 56 /**
55 57 * 根据角色Id查询用户信息
56 58 * @param page
57   - * @param
  59 + * @param roleId 角色id
  60 + * @param username 用户登录账户
58 61 * @return
59 62 */
60 63 IPage<SysUser> getUserByRoleId(Page page, @Param("roleId") String roleId, @Param("username") String username);
... ... @@ -62,7 +65,7 @@ public interface SysUserMapper extends BaseMapper&lt;SysUser&gt; {
62 65 /**
63 66 * 根据用户名设置部门ID
64 67 * @param username
65   - * @param departId
  68 + * @param orgCode
66 69 */
67 70 void updateUserDepart(@Param("username") String username,@Param("orgCode") String orgCode);
68 71  
... ... @@ -102,41 +105,55 @@ public interface SysUserMapper extends BaseMapper&lt;SysUser&gt; {
102 105 Integer getUserByOrgCodeTotal(@Param("orgCode") String orgCode, @Param("userParams") SysUser userParams);
103 106  
104 107 /**
  108 + * 批量删除角色与用户关系
105 109 * @Author scott
106 110 * @Date 2019/12/13 16:10
107   - * @Description: 批量删除角色与用户关系
  111 + * @param roleIdArray
108 112 */
109 113 void deleteBathRoleUserRelation(@Param("roleIdArray") String[] roleIdArray);
110 114  
111 115 /**
  116 + * 批量删除角色与权限关系
112 117 * @Author scott
113 118 * @Date 2019/12/13 16:10
114   - * @Description: 批量删除角色与权限关系
  119 + * @param roleIdArray
115 120 */
116 121 void deleteBathRolePermissionRelation(@Param("roleIdArray") String[] roleIdArray);
117 122  
118 123 /**
119 124 * 查询被逻辑删除的用户
  125 + * @param wrapper
  126 + * @return List<SysUser>
120 127 */
121 128 List<SysUser> selectLogicDeleted(@Param(Constants.WRAPPER) Wrapper<SysUser> wrapper);
122 129  
123 130 /**
124 131 * 还原被逻辑删除的用户
  132 + * @param userIds 用户id
  133 + * @param entity
  134 + * @return int
125 135 */
126 136 int revertLogicDeleted(@Param("userIds") String userIds, @Param("entity") SysUser entity);
127 137  
128 138 /**
129 139 * 彻底删除被逻辑删除的用户
  140 + * @param userIds 多个用户id
  141 + * @return int
130 142 */
131 143 int deleteLogicDeleted(@Param("userIds") String userIds);
132 144  
133   - /** 更新空字符串为null【此写法有sql注入风险,禁止随便用】 */
  145 + /**
  146 + * 更新空字符串为null【此写法有sql注入风险,禁止随便用】
  147 + * @param fieldName
  148 + * @return int
  149 + */
134 150 @Deprecated
135 151 int updateNullByEmptyString(@Param("fieldName") String fieldName);
136 152  
137 153 /**
138 154 * 根据部门Ids,查询部门下用户信息
139 155 * @param departIds
  156 + * @param username 用户账户名称
140 157 * @return
141 158 */
142 159 List<SysUser> queryByDepIds(@Param("departIds")List<String> departIds,@Param("username") String username);
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/SysUserRoleMapper.java
... ... @@ -16,9 +16,19 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
16 16 */
17 17 public interface SysUserRoleMapper extends BaseMapper<SysUserRole> {
18 18  
  19 + /**
  20 + * 通过用户账号查询角色集合
  21 + * @param username 用户账号名称
  22 + * @return List<String>
  23 + */
19 24 @Select("select role_code from sys_role where id in (select role_id from sys_user_role where user_id = (select id from sys_user where username=#{username}))")
20 25 List<String> getRoleByUserName(@Param("username") String username);
21 26  
  27 + /**
  28 + * 通过用户账号查询角色Id集合
  29 + * @param username 用户账号名称
  30 + * @return List<String>
  31 + */
22 32 @Select("select id from sys_role where id in (select role_id from sys_user_role where user_id = (select id from sys_user where username=#{username}))")
23 33 List<String> getRoleIdByUserName(@Param("username") String username);
24 34  
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/xml/SysDictMapper.xml
... ... @@ -160,7 +160,8 @@
160 160 select ${query.text} as "text",${query.code} as "value" from ${query.table}
161 161 where 1 = 1
162 162 <if test="query.keyword != null and query.keyword != ''">
163   - and (${query.text} like '%${query.keyword}%' or ${query.code} like '%${query.keyword}%')
  163 + <bind name="bindKeyword" value="'%'+query.keyword+'%'"/>
  164 + and (${query.text} like #{bindKeyword} or ${query.code} like #{bindKeyword})
164 165 </if>
165 166 <if test="query.codeValue != null and query.codeValue != ''">
166 167 and ${query.code} = #{query.codeValue}
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/xml/SysRoleIndexMapper.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3 +<mapper namespace="org.jeecg.modules.system.mapper.SysRoleIndexMapper">
  4 +
  5 +</mapper>
0 6 \ No newline at end of file
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/xml/SysUserDepartMapper.xml
... ... @@ -12,7 +12,8 @@
12 12 select a.* from sys_user a
13 13 join sys_user_depart b on b.user_id = a.id
14 14 join sys_depart c on b.dep_id = c.id
15   - where a.del_flag = 0 and c.org_code like '${orgCode}%'
  15 + <bind name="bindOrgCode" value="orgCode+'%'"/>
  16 + where a.del_flag = 0 and c.org_code like #{bindOrgCode}
16 17 <if test="realname!=null and realname!=''">
17 18 <!-- update by sunjianlei 20220119【#3348】SQL injection exists in /sys/user/queryUserByDepId; -->
18 19 <bind name="bindRealname" value="'%'+realname+'%'"/>
... ... @@ -25,7 +26,8 @@
25 26 select a.*, c.depart_name as org_code_txt from sys_user a
26 27 join sys_user_depart b on b.user_id = a.id
27 28 join sys_depart c on b.dep_id = c.id
28   - where a.del_flag = 0 and a.status = 1 and c.org_code like '${orgCode}%'
  29 + <bind name="bindOrgCode" value="orgCode+'%'"/>
  30 + where a.del_flag = 0 and a.status = 1 and c.org_code like #{bindOrgCode}
29 31 <if test="username!=null and username!=''">
30 32 <bind name="bindUsername" value="'%'+username+'%'"/>
31 33 and a.username like #{bindUsername}
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/xml/SysUserMapper.xml
... ... @@ -68,7 +68,13 @@
68 68 INNER JOIN sys_user_depart ON sys_user_depart.dep_id = sys_depart.id
69 69 INNER JOIN sys_user ON sys_user.id = sys_user_depart.user_id
70 70 WHERE
71   - sys_user.del_flag = 0 AND sys_depart.org_code LIKE '${orgCode}%'
  71 + <if test="orgCode == null">
  72 + <bind name="bindOrgCode" value="'%'"/>
  73 + </if>
  74 + <if test="orgCode != null">
  75 + <bind name="bindOrgCode" value="orgCode+'%'"/>
  76 + </if>
  77 + sys_user.del_flag = 0 AND sys_depart.org_code LIKE #{bindOrgCode}
72 78  
73 79 <if test="userParams != null">
74 80 <if test="userParams.realname != null and userParams.realname != ''">
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/model/DepartIdModel.java
... ... @@ -19,13 +19,19 @@ public class DepartIdModel implements Serializable {
19 19  
20 20 private static final long serialVersionUID = 1L;
21 21  
22   - // 主键ID
  22 + /**
  23 + * 主键ID
  24 + */
23 25 private String key;
24 26  
25   - // 主键ID
  27 + /**
  28 + * 主键ID
  29 + */
26 30 private String value;
27 31  
28   - // 部门名称
  32 + /**
  33 + * 部门名称
  34 + */
29 35 private String title;
30 36  
31 37 List<DepartIdModel> children = new ArrayList<>();
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/model/SysDepartTreeModel.java
... ... @@ -75,6 +75,11 @@ public class SysDepartTreeModel implements Serializable{
75 75  
76 76 private Date updateTime;
77 77  
  78 + //update-begin---author:wangshuai ---date:20200308 for:[JTC-119]在部门管理菜单下设置部门负责人,新增字段部门负责人ids
  79 + /**部门负责人ids*/
  80 + private String directorUserIds;
  81 + //update-end---author:wangshuai ---date:20200308 for:[JTC-119]在部门管理菜单下设置部门负责人,新增字段部门负责人ids
  82 +
78 83 private List<SysDepartTreeModel> children = new ArrayList<>();
79 84  
80 85  
... ... @@ -107,6 +112,7 @@ public class SysDepartTreeModel implements Serializable{
107 112 this.createTime = sysDepart.getCreateTime();
108 113 this.updateBy = sysDepart.getUpdateBy();
109 114 this.updateTime = sysDepart.getUpdateTime();
  115 + this.directorUserIds = sysDepart.getDirectorUserIds();
110 116 }
111 117  
112 118 public boolean getIsLeaf() {
... ... @@ -332,6 +338,14 @@ public class SysDepartTreeModel implements Serializable{
332 338  
333 339 public SysDepartTreeModel() { }
334 340  
  341 + public String getDirectorUserIds() {
  342 + return directorUserIds;
  343 + }
  344 +
  345 + public void setDirectorUserIds(String directorUserIds) {
  346 + this.directorUserIds = directorUserIds;
  347 + }
  348 +
335 349 /**
336 350 * 重写equals方法
337 351 */
... ... @@ -365,6 +379,7 @@ public class SysDepartTreeModel implements Serializable{
365 379 Objects.equals(createTime, model.createTime) &&
366 380 Objects.equals(updateBy, model.updateBy) &&
367 381 Objects.equals(updateTime, model.updateTime) &&
  382 + Objects.equals(directorUserIds, model.directorUserIds) &&
368 383 Objects.equals(children, model.children);
369 384 }
370 385  
... ... @@ -377,7 +392,7 @@ public class SysDepartTreeModel implements Serializable{
377 392 return Objects.hash(id, parentId, departName, departNameEn, departNameAbbr,
378 393 departOrder, description, orgCategory, orgType, orgCode, mobile, fax, address,
379 394 memo, status, delFlag, qywxIdentifier, createBy, createTime, updateBy, updateTime,
380   - children);
  395 + children,directorUserIds);
381 396 }
382 397  
383 398 }
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/model/SysPermissionTree.java
... ... @@ -6,6 +6,10 @@ import java.util.Date;
6 6 import java.util.List;
7 7 import org.jeecg.modules.system.entity.SysPermission;
8 8  
  9 +/**
  10 + * @Description: 菜单树,封装树结构
  11 + * @author: jeecg-boot
  12 + */
9 13 public class SysPermissionTree implements Serializable {
10 14  
11 15 private static final long serialVersionUID = 1L;
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/model/ThirdLoginModel.java
... ... @@ -6,6 +6,7 @@ import java.io.Serializable;
6 6  
7 7 /**
8 8 * 第三方登录 信息存储
  9 + * @author: jeecg-boot
9 10 */
10 11 @Data
11 12 public class ThirdLoginModel implements Serializable {
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/model/TreeModel.java
... ... @@ -10,6 +10,7 @@ import org.jeecg.modules.system.entity.SysPermission;
10 10  
11 11 /**
12 12 * 树形列表用到
  13 + * @author: jeecg-boot
13 14 */
14 15 public class TreeModel implements Serializable {
15 16  
... ... @@ -102,7 +103,7 @@ public class TreeModel implements Serializable {
102 103 this.parentId = parentId;
103 104 this.ruleFlag=ruleFlag;
104 105 this.slotTitle = slotTitle;
105   - Map<String,String> map = new HashMap<String,String>();
  106 + Map<String,String> map = new HashMap(5);
106 107 map.put("title", "hasDatarule");
107 108 this.scopedSlots = map;
108 109 this.isLeaf = isLeaf;
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/model/TreeSelectModel.java
... ... @@ -5,6 +5,7 @@ import java.util.List;
5 5  
6 6 /**
7 7 * 树形下拉框
  8 + * @author: jeecg-boot
8 9 */
9 10 public class TreeSelectModel implements Serializable {
10 11  
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/rule/CategoryCodeRule.java
... ... @@ -31,11 +31,15 @@ public class CategoryCodeRule implements IFillRuleHandler {
31 31  
32 32 if (formData != null && formData.size() > 0) {
33 33 Object obj = formData.get("pid");
34   - if (oConvertUtils.isNotEmpty(obj)) categoryPid = obj.toString();
  34 + if (oConvertUtils.isNotEmpty(obj)) {
  35 + categoryPid = obj.toString();
  36 + }
35 37 } else {
36 38 if (params != null) {
37 39 Object obj = params.get("pid");
38   - if (oConvertUtils.isNotEmpty(obj)) categoryPid = obj.toString();
  40 + if (oConvertUtils.isNotEmpty(obj)) {
  41 + categoryPid = obj.toString();
  42 + }
39 43 }
40 44 }
41 45  
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/rule/OrgCodeRule.java
... ... @@ -38,11 +38,15 @@ public class OrgCodeRule implements IFillRuleHandler {
38 38 String parentId = null;
39 39 if (formData != null && formData.size() > 0) {
40 40 Object obj = formData.get("parentId");
41   - if (obj != null) parentId = obj.toString();
  41 + if (obj != null) {
  42 + parentId = obj.toString();
  43 + }
42 44 } else {
43 45 if (params != null) {
44 46 Object obj = params.get("parentId");
45   - if (obj != null) parentId = obj.toString();
  47 + if (obj != null) {
  48 + parentId = obj.toString();
  49 + }
46 50 }
47 51 }
48 52  
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/security/DictQueryBlackListHandler.java 0 → 100644
  1 +package org.jeecg.modules.system.security;
  2 +
  3 +import org.jeecg.common.constant.SymbolConstant;
  4 +import org.jeecg.common.util.oConvertUtils;
  5 +import org.jeecg.common.util.security.AbstractQueryBlackListHandler;
  6 +import org.springframework.stereotype.Component;
  7 +
  8 +import java.util.ArrayList;
  9 +import java.util.List;
  10 +
  11 +/**
  12 + * 字典组件 执行sql前校验 只校验表字典
  13 + * dictCodeString格式如:
  14 + * table,text,code
  15 + * table where xxx,text,code
  16 + * table,text,code, where xxx
  17 + *
  18 + * @Author taoYan
  19 + * @Date 2022/3/23 21:10
  20 + **/
  21 +@Component("dictQueryBlackListHandler")
  22 +public class DictQueryBlackListHandler extends AbstractQueryBlackListHandler {
  23 +
  24 + @Override
  25 + protected List<QueryTable> getQueryTableInfo(String dictCodeString) {
  26 + if (dictCodeString != null && dictCodeString.indexOf(SymbolConstant.COMMA) > 0) {
  27 + String[] arr = dictCodeString.split(SymbolConstant.COMMA);
  28 + if (arr.length != 3 && arr.length != 4) {
  29 + return null;
  30 + }
  31 + String tableName = getTableName(arr[0]);
  32 + QueryTable table = new QueryTable(tableName, "");
  33 + // 无论什么场景 第二、三个元素一定是表的字段,直接add
  34 + table.addField(arr[1].trim());
  35 + if (oConvertUtils.isNotEmpty(arr[2].trim())) {
  36 + table.addField(arr[2].trim());
  37 + }
  38 + List<QueryTable> list = new ArrayList<>();
  39 + list.add(table);
  40 + return list;
  41 + }
  42 + return null;
  43 + }
  44 +
  45 + /**
  46 + * 取where前面的为:table name
  47 + *
  48 + * @param str
  49 + * @return
  50 + */
  51 + private String getTableName(String str) {
  52 + String[] arr = str.split("\\s+(?i)where\\s+");
  53 + return arr[0];
  54 + }
  55 +
  56 +}
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/ISysAnnouncementSendService.java
... ... @@ -16,11 +16,17 @@ import com.baomidou.mybatisplus.extension.service.IService;
16 16 */
17 17 public interface ISysAnnouncementSendService extends IService<SysAnnouncementSend> {
18 18  
  19 + /**
  20 + * 通过用户id查询用户通告阅读标记
  21 + * @param userId 用户id
  22 + * @return
  23 + */
19 24 public List<String> queryByUserId(String userId);
20 25  
21 26 /**
22   - * @功能:获取我的消息
  27 + * 获取我的消息
23 28 * @param announcementSendModel
  29 + * @param page 当前页数
24 30 * @return
25 31 */
26 32 public Page<AnnouncementSendModel> getMyAnnouncementSendPage(Page<AnnouncementSendModel> page,AnnouncementSendModel announcementSendModel);
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/ISysAnnouncementService.java
... ... @@ -13,12 +13,33 @@ import com.baomidou.mybatisplus.extension.service.IService;
13 13 */
14 14 public interface ISysAnnouncementService extends IService<SysAnnouncement> {
15 15  
  16 + /**
  17 + * 保存系统通告
  18 + * @param sysAnnouncement
  19 + */
16 20 public void saveAnnouncement(SysAnnouncement sysAnnouncement);
17 21  
  22 + /**
  23 + * 修改系统通告
  24 + * @param sysAnnouncement
  25 + * @return
  26 + */
18 27 public boolean upDateAnnouncement(SysAnnouncement sysAnnouncement);
19 28  
  29 + /**
  30 + * 保存系统通告
  31 + * @param title 标题
  32 + * @param msgContent 信息内容
  33 + */
20 34 public void saveSysAnnouncement(String title, String msgContent);
21 35  
  36 + /**
  37 + * 分页查询系统通告
  38 + * @param page 当前页数
  39 + * @param userId 用户id
  40 + * @param msgCategory 消息类型
  41 + * @return Page<SysAnnouncement>
  42 + */
22 43 public Page<SysAnnouncement> querySysCementPageByUserId(Page<SysAnnouncement> page,String userId,String msgCategory);
23 44  
24 45  
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/ISysCategoryService.java
... ... @@ -19,14 +19,23 @@ public interface ISysCategoryService extends IService&lt;SysCategory&gt; {
19 19 /**根节点父ID的值*/
20 20 public static final String ROOT_PID_VALUE = "0";
21 21  
  22 + /**
  23 + * 添加分类字典
  24 + * @param sysCategory
  25 + */
22 26 void addSysCategory(SysCategory sysCategory);
23   -
  27 +
  28 + /**
  29 + * 修改分类字典
  30 + * @param sysCategory
  31 + */
24 32 void updateSysCategory(SysCategory sysCategory);
25 33  
26 34 /**
27   - * 根据父级编码加载分类字典的数据
  35 + * 根据父级编码加载分类字典的数据
28 36 * @param pcode
29 37 * @return
  38 + * @throws JeecgBootException
30 39 */
31 40 public List<TreeSelectModel> queryListByCode(String pcode) throws JeecgBootException;
32 41  
... ...
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/ISysDataLogService.java
... ... @@ -4,6 +4,10 @@ import org.jeecg.modules.system.entity.SysDataLog;
4 4  
5 5 import com.baomidou.mybatisplus.extension.service.IService;
6 6  
  7 +/**
  8 + * @Description: 数据日志service接口
  9 + * @author: jeecg-boot
  10 + */
7 11 public interface ISysDataLogService extends IService<SysDataLog> {
8 12  
9 13 /**
... ...