mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2025-12-29 16:05:31 +08:00
3.2.0-beta,重构很大:升级springboot2.6.6、spring-cloud-alibaba 2021.1、mybatisplus3.5.1、代码规范部分重构
This commit is contained in:
@ -22,19 +22,27 @@ public class JeecgOneToMainUtil {
|
||||
public static void main(String[] args) {
|
||||
//第一步:设置主表配置
|
||||
MainTableVo mainTable = new MainTableVo();
|
||||
mainTable.setTableName("jeecg_order_main");//表名
|
||||
mainTable.setEntityName("GuiTestOrderMain"); //实体名
|
||||
mainTable.setEntityPackage("gui"); //包名
|
||||
mainTable.setFtlDescription("GUI订单管理"); //描述
|
||||
//表名
|
||||
mainTable.setTableName("jeecg_order_main");
|
||||
//实体名
|
||||
mainTable.setEntityName("GuiTestOrderMain");
|
||||
//包名
|
||||
mainTable.setEntityPackage("gui");
|
||||
//描述
|
||||
mainTable.setFtlDescription("GUI订单管理");
|
||||
|
||||
//第二步:设置子表集合配置
|
||||
List<SubTableVo> subTables = new ArrayList<SubTableVo>();
|
||||
//[1].子表一
|
||||
SubTableVo po = new SubTableVo();
|
||||
po.setTableName("jeecg_order_customer");//表名
|
||||
po.setEntityName("GuiTestOrderCustom"); //实体名
|
||||
po.setEntityPackage("gui"); //包名
|
||||
po.setFtlDescription("客户明细"); //描述
|
||||
//表名
|
||||
po.setTableName("jeecg_order_customer");
|
||||
//实体名
|
||||
po.setEntityName("GuiTestOrderCustom");
|
||||
//包名
|
||||
po.setEntityPackage("gui");
|
||||
//描述
|
||||
po.setFtlDescription("客户明细");
|
||||
//子表外键参数配置
|
||||
/*说明:
|
||||
* a) 子表引用主表主键ID作为外键,外键字段必须以_ID结尾;
|
||||
@ -45,10 +53,14 @@ public class JeecgOneToMainUtil {
|
||||
subTables.add(po);
|
||||
//[2].子表二
|
||||
SubTableVo po2 = new SubTableVo();
|
||||
po2.setTableName("jeecg_order_ticket"); //表名
|
||||
po2.setEntityName("GuiTestOrderTicket"); //实体名
|
||||
po2.setEntityPackage("gui"); //包名
|
||||
po2.setFtlDescription("产品明细"); //描述
|
||||
//表名
|
||||
po2.setTableName("jeecg_order_ticket");
|
||||
//实体名
|
||||
po2.setEntityName("GuiTestOrderTicket");
|
||||
//包名
|
||||
po2.setEntityPackage("gui");
|
||||
//描述
|
||||
po2.setFtlDescription("产品明细");
|
||||
//子表外键参数配置
|
||||
/*说明:
|
||||
* a) 子表引用主表主键ID作为外键,外键字段必须以_ID结尾;
|
||||
|
||||
@ -1,19 +1,14 @@
|
||||
package org.jeecg;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.catalina.Context;
|
||||
import org.apache.tomcat.util.scan.StandardJarScanner;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
//import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
|
||||
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.core.env.Environment;
|
||||
|
||||
import java.net.InetAddress;
|
||||
@ -21,6 +16,7 @@ import java.net.UnknownHostException;
|
||||
|
||||
/**
|
||||
* 单体启动类(采用此类启动为单体模式)
|
||||
* 提醒: 需要集成mogodb请删除 exclude={MongoAutoConfiguration.class}
|
||||
*/
|
||||
@Slf4j
|
||||
@SpringBootApplication
|
||||
|
||||
@ -43,7 +43,7 @@ public class CodeGenerateDbConfig {
|
||||
}
|
||||
}
|
||||
CodegenDatasourceConfig.initDbConfig(driverClassName,url, username, password);
|
||||
log.info(" 代码生成器数据库连接,使用application.yml的DB配置 ###################");
|
||||
log.info(" Init CodeGenerate Config [ Get Db Config From application.yml ] ");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
package org.jeecg.config.jimureport;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
import org.jeecg.common.system.util.JwtUtil;
|
||||
import org.jeecg.common.system.vo.SysUserCacheInfo;
|
||||
import org.jeecg.common.util.RedisUtil;
|
||||
import org.jeecg.common.util.TokenUtils;
|
||||
import org.jeecg.modules.jmreport.api.JmReportTokenServiceI;
|
||||
import org.jeecg.modules.system.service.impl.SysBaseApiImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Component;
|
||||
@ -19,6 +19,7 @@ import java.util.Map;
|
||||
* 自定义积木报表鉴权(如果不进行自定义,则所有请求不做权限控制)
|
||||
* * 1.自定义获取登录token
|
||||
* * 2.自定义获取登录用户
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
|
||||
|
||||
@ -26,7 +27,7 @@ import java.util.Map;
|
||||
@Component
|
||||
public class JimuReportTokenService implements JmReportTokenServiceI {
|
||||
@Autowired
|
||||
private ISysBaseAPI sysBaseAPI;
|
||||
private SysBaseApiImpl sysBaseApi;
|
||||
@Autowired
|
||||
@Lazy
|
||||
private RedisUtil redisUtil;
|
||||
@ -43,17 +44,17 @@ public class JimuReportTokenService implements JmReportTokenServiceI {
|
||||
|
||||
@Override
|
||||
public Boolean verifyToken(String token) {
|
||||
return TokenUtils.verifyToken(token, sysBaseAPI, redisUtil);
|
||||
return TokenUtils.verifyToken(token, sysBaseApi, redisUtil);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getUserInfo(String token) {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
Map<String, Object> map = new HashMap(5);
|
||||
String username = JwtUtil.getUsername(token);
|
||||
//此处通过token只能拿到一个信息 用户账号 后面的就是根据账号获取其他信息 查询数据或是走redis 用户根据自身业务可自定义
|
||||
SysUserCacheInfo userInfo = null;
|
||||
try {
|
||||
userInfo = sysBaseAPI.getCacheUser(username);
|
||||
userInfo = sysBaseApi.getCacheUser(username);
|
||||
} catch (Exception e) {
|
||||
log.error("获取用户信息异常:"+ e.getMessage());
|
||||
return map;
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
package org.jeecg.modules.api.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.api.dto.OnlineAuthDTO;
|
||||
import org.jeecg.common.api.dto.message.*;
|
||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
import org.jeecg.common.system.vo.*;
|
||||
import org.jeecg.modules.system.service.ISysUserService;
|
||||
import org.jeecg.modules.system.service.impl.SysBaseApiImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@ -16,14 +17,15 @@ import java.util.Set;
|
||||
|
||||
/**
|
||||
* 服务化 system模块 对外接口请求类
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/sys/api")
|
||||
public class SystemAPIController {
|
||||
|
||||
@Autowired
|
||||
private ISysBaseAPI sysBaseAPI;
|
||||
|
||||
private SysBaseApiImpl sysBaseApi;
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
@ -34,7 +36,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@PostMapping("/sendSysAnnouncement")
|
||||
public void sendSysAnnouncement(@RequestBody MessageDTO message){
|
||||
sysBaseAPI.sendSysAnnouncement(message);
|
||||
sysBaseApi.sendSysAnnouncement(message);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -43,7 +45,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@PostMapping("/sendBusAnnouncement")
|
||||
public void sendBusAnnouncement(@RequestBody BusMessageDTO message){
|
||||
sysBaseAPI.sendBusAnnouncement(message);
|
||||
sysBaseApi.sendBusAnnouncement(message);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -52,7 +54,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@PostMapping("/sendTemplateAnnouncement")
|
||||
public void sendTemplateAnnouncement(@RequestBody TemplateMessageDTO message){
|
||||
sysBaseAPI.sendTemplateAnnouncement(message);
|
||||
sysBaseApi.sendTemplateAnnouncement(message);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -61,7 +63,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@PostMapping("/sendBusTemplateAnnouncement")
|
||||
public void sendBusTemplateAnnouncement(@RequestBody BusTemplateMessageDTO message){
|
||||
sysBaseAPI.sendBusTemplateAnnouncement(message);
|
||||
sysBaseApi.sendBusTemplateAnnouncement(message);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -71,7 +73,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@PostMapping("/parseTemplateByCode")
|
||||
public String parseTemplateByCode(@RequestBody TemplateDTO templateDTO){
|
||||
return sysBaseAPI.parseTemplateByCode(templateDTO);
|
||||
return sysBaseApi.parseTemplateByCode(templateDTO);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -79,7 +81,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@GetMapping("/updateSysAnnounReadFlag")
|
||||
public void updateSysAnnounReadFlag(@RequestParam("busType") String busType, @RequestParam("busId")String busId){
|
||||
sysBaseAPI.updateSysAnnounReadFlag(busType, busId);
|
||||
sysBaseApi.updateSysAnnounReadFlag(busType, busId);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -89,7 +91,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@GetMapping("/getUserByName")
|
||||
public LoginUser getUserByName(@RequestParam("username") String username){
|
||||
return sysBaseAPI.getUserByName(username);
|
||||
return sysBaseApi.getUserByName(username);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -99,7 +101,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@GetMapping("/getUserById")
|
||||
LoginUser getUserById(@RequestParam("id") String id){
|
||||
return sysBaseAPI.getUserById(id);
|
||||
return sysBaseApi.getUserById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -109,7 +111,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@GetMapping("/getRolesByUsername")
|
||||
List<String> getRolesByUsername(@RequestParam("username") String username){
|
||||
return sysBaseAPI.getRolesByUsername(username);
|
||||
return sysBaseApi.getRolesByUsername(username);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -119,7 +121,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@GetMapping("/getDepartIdsByUsername")
|
||||
List<String> getDepartIdsByUsername(@RequestParam("username") String username){
|
||||
return sysBaseAPI.getDepartIdsByUsername(username);
|
||||
return sysBaseApi.getDepartIdsByUsername(username);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -129,7 +131,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@GetMapping("/getDepartNamesByUsername")
|
||||
List<String> getDepartNamesByUsername(@RequestParam("username") String username){
|
||||
return sysBaseAPI.getDepartNamesByUsername(username);
|
||||
return sysBaseApi.getDepartNamesByUsername(username);
|
||||
}
|
||||
|
||||
|
||||
@ -140,7 +142,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@GetMapping("/queryDictItemsByCode")
|
||||
List<DictModel> queryDictItemsByCode(@RequestParam("code") String code){
|
||||
return sysBaseAPI.queryDictItemsByCode(code);
|
||||
return sysBaseApi.queryDictItemsByCode(code);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -150,23 +152,31 @@ public class SystemAPIController {
|
||||
*/
|
||||
@GetMapping("/queryEnableDictItemsByCode")
|
||||
List<DictModel> queryEnableDictItemsByCode(@RequestParam("code") String code){
|
||||
return sysBaseAPI.queryEnableDictItemsByCode(code);
|
||||
return sysBaseApi.queryEnableDictItemsByCode(code);
|
||||
}
|
||||
|
||||
|
||||
/** 查询所有的父级字典,按照create_time排序 */
|
||||
@GetMapping("/queryAllDict")
|
||||
List<DictModel> queryAllDict(){
|
||||
return sysBaseAPI.queryAllDict();
|
||||
// try{
|
||||
// //睡10秒,gateway网关5秒超时,会触发熔断降级操作
|
||||
// Thread.sleep(10000);
|
||||
// }catch (Exception e){
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
|
||||
log.info("--我是jeecg-system服务节点,微服务接口queryAllDict被调用--");
|
||||
return sysBaseApi.queryAllDict();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有分类字典
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/queryAllDSysCategory")
|
||||
List<SysCategoryModel> queryAllDSysCategory(){
|
||||
return sysBaseAPI.queryAllDSysCategory();
|
||||
@GetMapping("/queryAllSysCategory")
|
||||
List<SysCategoryModel> queryAllSysCategory(){
|
||||
return sysBaseApi.queryAllSysCategory();
|
||||
}
|
||||
|
||||
|
||||
@ -176,7 +186,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@GetMapping("/queryAllDepartBackDictModel")
|
||||
List<DictModel> queryAllDepartBackDictModel(){
|
||||
return sysBaseAPI.queryAllDepartBackDictModel();
|
||||
return sysBaseApi.queryAllDepartBackDictModel();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -187,9 +197,9 @@ public class SystemAPIController {
|
||||
@GetMapping("/queryAllRole")
|
||||
public List<ComboModel> queryAllRole(@RequestParam(name = "roleIds",required = false)String[] roleIds){
|
||||
if(roleIds==null || roleIds.length==0){
|
||||
return sysBaseAPI.queryAllRole();
|
||||
return sysBaseApi.queryAllRole();
|
||||
}else{
|
||||
return sysBaseAPI.queryAllRole(roleIds);
|
||||
return sysBaseApi.queryAllRole(roleIds);
|
||||
}
|
||||
}
|
||||
|
||||
@ -200,7 +210,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@GetMapping("/getRoleIdsByUsername")
|
||||
public List<String> getRoleIdsByUsername(@RequestParam("username")String username){
|
||||
return sysBaseAPI.getRoleIdsByUsername(username);
|
||||
return sysBaseApi.getRoleIdsByUsername(username);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -210,7 +220,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@GetMapping("/getDepartIdsByOrgCode")
|
||||
public String getDepartIdsByOrgCode(@RequestParam("orgCode")String orgCode){
|
||||
return sysBaseAPI.getDepartIdsByOrgCode(orgCode);
|
||||
return sysBaseApi.getDepartIdsByOrgCode(orgCode);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -219,7 +229,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@GetMapping("/getAllSysDepart")
|
||||
public List<SysDepartModel> getAllSysDepart(){
|
||||
return sysBaseAPI.getAllSysDepart();
|
||||
return sysBaseApi.getAllSysDepart();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -230,7 +240,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@GetMapping("/getDynamicDbSourceById")
|
||||
DynamicDataSourceModel getDynamicDbSourceById(@RequestParam("dbSourceId")String dbSourceId){
|
||||
return sysBaseAPI.getDynamicDbSourceById(dbSourceId);
|
||||
return sysBaseApi.getDynamicDbSourceById(dbSourceId);
|
||||
}
|
||||
|
||||
|
||||
@ -242,7 +252,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@GetMapping("/getDeptHeadByDepId")
|
||||
public List<String> getDeptHeadByDepId(@RequestParam("deptId") String deptId){
|
||||
return sysBaseAPI.getDeptHeadByDepId(deptId);
|
||||
return sysBaseApi.getDeptHeadByDepId(deptId);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -252,7 +262,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@GetMapping("/getParentDepartId")
|
||||
public DictModel getParentDepartId(@RequestParam("departId")String departId){
|
||||
return sysBaseAPI.getParentDepartId(departId);
|
||||
return sysBaseApi.getParentDepartId(departId);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -263,7 +273,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@GetMapping("/getDynamicDbSourceByCode")
|
||||
public DynamicDataSourceModel getDynamicDbSourceByCode(@RequestParam("dbSourceCode") String dbSourceCode){
|
||||
return sysBaseAPI.getDynamicDbSourceByCode(dbSourceCode);
|
||||
return sysBaseApi.getDynamicDbSourceByCode(dbSourceCode);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -273,7 +283,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@GetMapping("/sendWebSocketMsg")
|
||||
public void sendWebSocketMsg(String[] userIds, String cmd){
|
||||
sysBaseAPI.sendWebSocketMsg(userIds, cmd);
|
||||
sysBaseApi.sendWebSocketMsg(userIds, cmd);
|
||||
}
|
||||
|
||||
|
||||
@ -284,7 +294,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@GetMapping("/queryAllUserByIds")
|
||||
public List<LoginUser> queryAllUserByIds(@RequestParam("userIds") String[] userIds){
|
||||
return sysBaseAPI.queryAllUserByIds(userIds);
|
||||
return sysBaseApi.queryAllUserByIds(userIds);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -293,7 +303,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@GetMapping("/queryAllUserBackCombo")
|
||||
public List<ComboModel> queryAllUserBackCombo(){
|
||||
return sysBaseAPI.queryAllUserBackCombo();
|
||||
return sysBaseApi.queryAllUserBackCombo();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -302,7 +312,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@GetMapping("/queryAllUser")
|
||||
public JSONObject queryAllUser(@RequestParam(name="userIds",required=false)String userIds, @RequestParam(name="pageNo",required=false) Integer pageNo,@RequestParam(name="pageSize",required=false) int pageSize){
|
||||
return sysBaseAPI.queryAllUser(userIds, pageNo, pageSize);
|
||||
return sysBaseApi.queryAllUser(userIds, pageNo, pageSize);
|
||||
}
|
||||
|
||||
|
||||
@ -315,7 +325,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@GetMapping("/meetingSignWebsocket")
|
||||
public void meetingSignWebsocket(@RequestParam("userId")String userId){
|
||||
sysBaseAPI.meetingSignWebsocket(userId);
|
||||
sysBaseApi.meetingSignWebsocket(userId);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -325,7 +335,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@GetMapping("/queryUserByNames")
|
||||
public List<LoginUser> queryUserByNames(@RequestParam("userNames")String[] userNames){
|
||||
return sysBaseAPI.queryUserByNames(userNames);
|
||||
return sysBaseApi.queryUserByNames(userNames);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -335,7 +345,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@GetMapping("/getUserRoleSet")
|
||||
public Set<String> getUserRoleSet(@RequestParam("username")String username){
|
||||
return sysBaseAPI.getUserRoleSet(username);
|
||||
return sysBaseApi.getUserRoleSet(username);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -345,7 +355,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@GetMapping("/getUserPermissionSet")
|
||||
public Set<String> getUserPermissionSet(@RequestParam("username") String username){
|
||||
return sysBaseAPI.getUserPermissionSet(username);
|
||||
return sysBaseApi.getUserPermissionSet(username);
|
||||
}
|
||||
|
||||
//-----
|
||||
@ -357,7 +367,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@PostMapping("/hasOnlineAuth")
|
||||
public boolean hasOnlineAuth(@RequestBody OnlineAuthDTO onlineAuthDTO){
|
||||
return sysBaseAPI.hasOnlineAuth(onlineAuthDTO);
|
||||
return sysBaseApi.hasOnlineAuth(onlineAuthDTO);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -386,7 +396,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@GetMapping("/selectAllById")
|
||||
public SysDepartModel selectAllById(@RequestParam("id") String id){
|
||||
return sysBaseAPI.selectAllById(id);
|
||||
return sysBaseApi.selectAllById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -396,7 +406,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@GetMapping("/queryDeptUsersByUserId")
|
||||
public List<String> queryDeptUsersByUserId(@RequestParam("userId") String userId){
|
||||
return sysBaseAPI.queryDeptUsersByUserId(userId);
|
||||
return sysBaseApi.queryDeptUsersByUserId(userId);
|
||||
}
|
||||
|
||||
|
||||
@ -406,7 +416,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@GetMapping("/queryPermissionDataRule")
|
||||
public List<SysPermissionDataRuleModel> queryPermissionDataRule(@RequestParam("component") String component, @RequestParam("requestPath")String requestPath, @RequestParam("username") String username){
|
||||
return sysBaseAPI.queryPermissionDataRule(component, requestPath, username);
|
||||
return sysBaseApi.queryPermissionDataRule(component, requestPath, username);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -416,7 +426,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@GetMapping("/getCacheUser")
|
||||
public SysUserCacheInfo getCacheUser(@RequestParam("username") String username){
|
||||
return sysBaseAPI.getCacheUser(username);
|
||||
return sysBaseApi.getCacheUser(username);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -427,7 +437,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@GetMapping("/translateDict")
|
||||
public String translateDict(@RequestParam("code") String code, @RequestParam("key") String key){
|
||||
return sysBaseAPI.translateDict(code, key);
|
||||
return sysBaseApi.translateDict(code, key);
|
||||
}
|
||||
|
||||
|
||||
@ -438,7 +448,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@RequestMapping("/queryUsersByUsernames")
|
||||
List<JSONObject> queryUsersByUsernames(@RequestParam("usernames") String usernames){
|
||||
return this.sysBaseAPI.queryUsersByUsernames(usernames);
|
||||
return this.sysBaseApi.queryUsersByUsernames(usernames);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -448,7 +458,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@RequestMapping("/queryUsersByIds")
|
||||
List<JSONObject> queryUsersByIds(@RequestParam("ids") String ids){
|
||||
return this.sysBaseAPI.queryUsersByIds(ids);
|
||||
return this.sysBaseApi.queryUsersByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -458,7 +468,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@GetMapping("/queryDepartsByOrgcodes")
|
||||
List<JSONObject> queryDepartsByOrgcodes(@RequestParam("orgCodes") String orgCodes){
|
||||
return this.sysBaseAPI.queryDepartsByOrgcodes(orgCodes);
|
||||
return this.sysBaseApi.queryDepartsByOrgcodes(orgCodes);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -468,7 +478,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@GetMapping("/queryDepartsByIds")
|
||||
List<JSONObject> queryDepartsByIds(@RequestParam("ids") String ids){
|
||||
return this.sysBaseAPI.queryDepartsByIds(ids);
|
||||
return this.sysBaseApi.queryDepartsByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -479,7 +489,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@GetMapping("/sendEmailMsg")
|
||||
public void sendEmailMsg(@RequestParam("email")String email,@RequestParam("title")String title,@RequestParam("content")String content){
|
||||
this.sysBaseAPI.sendEmailMsg(email,title,content);
|
||||
this.sysBaseApi.sendEmailMsg(email,title,content);
|
||||
};
|
||||
/**
|
||||
* 41 获取公司下级部门和公司下所有用户信息
|
||||
@ -487,7 +497,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@GetMapping("/getDeptUserByOrgCode")
|
||||
List<Map> getDeptUserByOrgCode(@RequestParam("orgCode")String orgCode){
|
||||
return this.sysBaseAPI.getDeptUserByOrgCode(orgCode);
|
||||
return this.sysBaseApi.getDeptUserByOrgCode(orgCode);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -498,7 +508,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@GetMapping("/loadCategoryDictItem")
|
||||
public List<String> loadCategoryDictItem(@RequestParam("ids") String ids) {
|
||||
return sysBaseAPI.loadCategoryDictItem(ids);
|
||||
return sysBaseApi.loadCategoryDictItem(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -510,7 +520,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@GetMapping("/loadDictItem")
|
||||
public List<String> loadDictItem(@RequestParam("dictCode") String dictCode, @RequestParam("keys") String keys) {
|
||||
return sysBaseAPI.loadDictItem(dictCode, keys);
|
||||
return sysBaseApi.loadDictItem(dictCode, keys);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -522,7 +532,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@GetMapping("/getDictItems")
|
||||
public List<DictModel> getDictItems(@RequestParam("dictCode") String dictCode) {
|
||||
return sysBaseAPI.getDictItems(dictCode);
|
||||
return sysBaseApi.getDictItems(dictCode);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -533,7 +543,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@RequestMapping("/getManyDictItems")
|
||||
public Map<String, List<DictModel>> getManyDictItems(@RequestParam("dictCodeList") List<String> dictCodeList) {
|
||||
return sysBaseAPI.getManyDictItems(dictCodeList);
|
||||
return sysBaseApi.getManyDictItems(dictCodeList);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -546,7 +556,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@GetMapping("/loadDictItemByKeyword")
|
||||
public List<DictModel> loadDictItemByKeyword(@RequestParam("dictCode") String dictCode, @RequestParam("keyword") String keyword, @RequestParam(value = "pageSize", required = false) Integer pageSize) {
|
||||
return sysBaseAPI.loadDictItemByKeyword(dictCode, keyword, pageSize);
|
||||
return sysBaseApi.loadDictItemByKeyword(dictCode, keyword, pageSize);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -557,7 +567,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@GetMapping("/translateManyDict")
|
||||
public Map<String, List<DictModel>> translateManyDict(@RequestParam("dictCodes") String dictCodes, @RequestParam("keys") String keys){
|
||||
return this.sysBaseAPI.translateManyDict(dictCodes, keys);
|
||||
return this.sysBaseApi.translateManyDict(dictCodes, keys);
|
||||
}
|
||||
|
||||
|
||||
@ -570,7 +580,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@GetMapping("/queryTableDictItemsByCode")
|
||||
List<DictModel> queryTableDictItemsByCode(@RequestParam("table") String table, @RequestParam("text") String text, @RequestParam("code") String code){
|
||||
return sysBaseAPI.queryTableDictItemsByCode(table, text, code);
|
||||
return sysBaseApi.queryTableDictItemsByCode(table, text, code);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -583,7 +593,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@GetMapping("/queryFilterTableDictInfo")
|
||||
List<DictModel> queryFilterTableDictInfo(@RequestParam("table") String table, @RequestParam("text") String text, @RequestParam("code") String code, @RequestParam("filterSql") String filterSql){
|
||||
return sysBaseAPI.queryFilterTableDictInfo(table, text, code, filterSql);
|
||||
return sysBaseApi.queryFilterTableDictInfo(table, text, code, filterSql);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -598,7 +608,7 @@ public class SystemAPIController {
|
||||
@Deprecated
|
||||
@GetMapping("/queryTableDictByKeys")
|
||||
public List<String> queryTableDictByKeys(@RequestParam("table") String table, @RequestParam("text") String text, @RequestParam("code") String code, @RequestParam("keyArray") String[] keyArray){
|
||||
return sysBaseAPI.queryTableDictByKeys(table, text, code, keyArray);
|
||||
return sysBaseApi.queryTableDictByKeys(table, text, code, keyArray);
|
||||
}
|
||||
|
||||
|
||||
@ -612,7 +622,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@GetMapping("/translateDictFromTable")
|
||||
public String translateDictFromTable(@RequestParam("table") String table, @RequestParam("text") String text, @RequestParam("code") String code, @RequestParam("key") String key){
|
||||
return sysBaseAPI.translateDictFromTable(table, text, code, key);
|
||||
return sysBaseApi.translateDictFromTable(table, text, code, key);
|
||||
}
|
||||
|
||||
|
||||
@ -628,7 +638,7 @@ public class SystemAPIController {
|
||||
*/
|
||||
@GetMapping("/translateDictFromTableByKeys")
|
||||
public List<DictModel> translateDictFromTableByKeys(@RequestParam("table") String table, @RequestParam("text") String text, @RequestParam("code") String code, @RequestParam("keys") String keys) {
|
||||
return this.sysBaseAPI.translateDictFromTableByKeys(table, text, code, keys);
|
||||
return this.sysBaseApi.translateDictFromTableByKeys(table, text, code, keys);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -16,6 +16,10 @@ import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClients;
|
||||
|
||||
/**
|
||||
* @Description: CASServiceUtil
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
public class CASServiceUtil {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
@ -25,7 +25,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 解析cas,ST验证后的xml
|
||||
*
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@Slf4j
|
||||
public final class XmlUtils {
|
||||
@ -39,7 +39,7 @@ public final class XmlUtils {
|
||||
*/
|
||||
public static Document newDocument(final String xml) {
|
||||
final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||
final Map<String, Boolean> features = new HashMap<String, Boolean>();
|
||||
final Map<String, Boolean> features = new HashMap(5);
|
||||
features.put(XMLConstants.FEATURE_SECURE_PROCESSING, true);
|
||||
features.put("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
|
||||
for (final Map.Entry<String, Boolean> entry : features.entrySet()) {
|
||||
@ -94,13 +94,15 @@ public final class XmlUtils {
|
||||
|
||||
private StringBuilder buffer = new StringBuilder();
|
||||
|
||||
@Override
|
||||
public void startElement(final String uri, final String localName, final String qName,
|
||||
final Attributes attributes) throws SAXException {
|
||||
final Attributes attributes) throws SAXException {
|
||||
if (localName.equals(element)) {
|
||||
this.foundElement = true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endElement(final String uri, final String localName, final String qName) throws SAXException {
|
||||
if (localName.equals(element)) {
|
||||
this.foundElement = false;
|
||||
@ -109,6 +111,7 @@ public final class XmlUtils {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void characters(char[] ch, int start, int length) throws SAXException {
|
||||
if (this.foundElement) {
|
||||
this.buffer.append(ch, start, length);
|
||||
@ -145,19 +148,22 @@ public final class XmlUtils {
|
||||
|
||||
private boolean foundElement = false;
|
||||
|
||||
@Override
|
||||
public void startElement(final String uri, final String localName, final String qName,
|
||||
final Attributes attributes) throws SAXException {
|
||||
final Attributes attributes) throws SAXException {
|
||||
if (localName.equals(element)) {
|
||||
this.foundElement = true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endElement(final String uri, final String localName, final String qName) throws SAXException {
|
||||
if (localName.equals(element)) {
|
||||
this.foundElement = false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void characters(char[] ch, int start, int length) throws SAXException {
|
||||
if (this.foundElement) {
|
||||
builder.append(ch, start, length);
|
||||
@ -208,7 +214,7 @@ public final class XmlUtils {
|
||||
|
||||
@Override
|
||||
public void startDocument() throws SAXException {
|
||||
this.attributes = new HashMap<String, Object>();
|
||||
this.attributes = new HashMap(5);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -6,18 +6,30 @@ import lombok.Data;
|
||||
|
||||
/**
|
||||
* 发送消息实体
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@Data
|
||||
public class MsgParams implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
/*消息类型*/
|
||||
/**
|
||||
* 消息类型
|
||||
*/
|
||||
private String msgType;
|
||||
/*消息接收方*/
|
||||
|
||||
/**
|
||||
* 消息接收方
|
||||
*/
|
||||
private String receiver;
|
||||
/*消息模板码*/
|
||||
|
||||
/**
|
||||
* 消息模板码
|
||||
*/
|
||||
private String templateCode;
|
||||
/*测试数据*/
|
||||
|
||||
/**
|
||||
* 测试数据
|
||||
*/
|
||||
private String testData;
|
||||
|
||||
}
|
||||
|
||||
@ -1,6 +1,16 @@
|
||||
package org.jeecg.modules.message.handle;
|
||||
|
||||
/**
|
||||
* @Description: 发送信息接口
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
public interface ISendMsgHandle {
|
||||
|
||||
/**
|
||||
* 发送信息
|
||||
* @param es_receiver 发送人
|
||||
* @param es_title 标题
|
||||
* @param es_content 内容
|
||||
*/
|
||||
void SendMsg(String es_receiver, String es_title, String es_content);
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ package org.jeecg.modules.message.handle.enums;
|
||||
|
||||
/**
|
||||
* 推送状态枚举
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
public enum SendMsgStatusEnum {
|
||||
|
||||
|
||||
@ -4,13 +4,26 @@ import org.jeecg.common.util.oConvertUtils;
|
||||
|
||||
/**
|
||||
* 发送消息类型枚举
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
public enum SendMsgTypeEnum {
|
||||
|
||||
//推送方式:1短信 2邮件 3微信
|
||||
/**
|
||||
* 短信
|
||||
*/
|
||||
SMS("1", "org.jeecg.modules.message.handle.impl.SmsSendMsgHandle"),
|
||||
/**
|
||||
* 邮件
|
||||
*/
|
||||
EMAIL("2", "org.jeecg.modules.message.handle.impl.EmailSendMsgHandle"),
|
||||
WX("3","org.jeecg.modules.message.handle.impl.WxSendMsgHandle");
|
||||
/**
|
||||
* 微信
|
||||
*/
|
||||
WX("3","org.jeecg.modules.message.handle.impl.WxSendMsgHandle"),
|
||||
/**
|
||||
* 系统消息
|
||||
*/
|
||||
SYSTEM_MESSAGE("4","org.jeecg.modules.message.handle.impl.SystemSendMsgHandle");
|
||||
|
||||
private String type;
|
||||
|
||||
|
||||
@ -11,6 +11,10 @@ import org.springframework.mail.javamail.MimeMessageHelper;
|
||||
import javax.mail.MessagingException;
|
||||
import javax.mail.internet.MimeMessage;
|
||||
|
||||
/**
|
||||
* @Description: 邮箱发送信息
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
public class EmailSendMsgHandle implements ISendMsgHandle {
|
||||
static String emailFrom;
|
||||
|
||||
|
||||
@ -3,6 +3,10 @@ package org.jeecg.modules.message.handle.impl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.modules.message.handle.ISendMsgHandle;
|
||||
|
||||
/**
|
||||
* @Description: 短信发送
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@Slf4j
|
||||
public class SmsSendMsgHandle implements ISendMsgHandle {
|
||||
|
||||
|
||||
@ -0,0 +1,28 @@
|
||||
package org.jeecg.modules.message.handle.impl;
|
||||
|
||||
import org.jeecg.common.api.dto.message.MessageDTO;
|
||||
import org.jeecg.common.exception.JeecgBootException;
|
||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.message.handle.ISendMsgHandle;
|
||||
|
||||
/**
|
||||
* @Description: 发送系统消息
|
||||
* @Author: wangshuai
|
||||
* @Date: 2022年3月22日 18:48:20
|
||||
*/
|
||||
public class SystemSendMsgHandle implements ISendMsgHandle {
|
||||
|
||||
public static final String FROM_USER="system";
|
||||
|
||||
@Override
|
||||
public void SendMsg(String es_receiver, String es_title, String es_content) {
|
||||
if(oConvertUtils.isEmpty(es_receiver)){
|
||||
throw new JeecgBootException("被发送人不能为空");
|
||||
}
|
||||
ISysBaseAPI sysBaseAPI = SpringContextUtils.getBean(ISysBaseAPI.class);
|
||||
MessageDTO messageDTO = new MessageDTO(FROM_USER,es_receiver,es_title,es_content);
|
||||
sysBaseAPI.sendSysAnnouncement(messageDTO);
|
||||
}
|
||||
}
|
||||
@ -2,6 +2,11 @@ package org.jeecg.modules.message.handle.impl;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.modules.message.handle.ISendMsgHandle;
|
||||
|
||||
/**
|
||||
* @Description: 发微信消息模板
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@Slf4j
|
||||
public class WxSendMsgHandle implements ISendMsgHandle {
|
||||
|
||||
|
||||
@ -19,6 +19,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 发送消息任务
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
|
||||
@Slf4j
|
||||
@ -48,16 +49,24 @@ public class SendMsgJob implements Job {
|
||||
sendMsgHandle = (ISendMsgHandle) Class.forName(SendMsgTypeEnum.SMS.getImplClass()).newInstance();
|
||||
} else if (sysMessage.getEsType().equals(SendMsgTypeEnum.WX.getType())) {
|
||||
sendMsgHandle = (ISendMsgHandle) Class.forName(SendMsgTypeEnum.WX.getImplClass()).newInstance();
|
||||
} else if(sysMessage.getEsType().equals(SendMsgTypeEnum.SYSTEM_MESSAGE.getType())){
|
||||
//update-begin---author:wangshuai ---date:20220323 for:[issues/I4X698]根据模板发送系统消息,发送失败------------
|
||||
sendMsgHandle = (ISendMsgHandle) Class.forName(SendMsgTypeEnum.SYSTEM_MESSAGE.getImplClass()).newInstance();
|
||||
//update-end---author:wangshuai ---date:20220323 for:[issues/I4X698]根据模板发送系统消息,发送失败------------
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(),e);
|
||||
}
|
||||
Integer sendNum = sysMessage.getEsSendNum();
|
||||
try {
|
||||
sendMsgHandle.SendMsg(sysMessage.getEsReceiver(), sysMessage.getEsTitle(),
|
||||
sysMessage.getEsContent().toString());
|
||||
// 发送消息成功
|
||||
sysMessage.setEsSendStatus(SendMsgStatusEnum.SUCCESS.getCode());
|
||||
//update-begin---author:wangshuai ---date:20220323 for:[issues/I4X698]模板管理发送消息出现NullPointerException 錯誤------------
|
||||
if(null != sendMsgHandle){
|
||||
sendMsgHandle.SendMsg(sysMessage.getEsReceiver(), sysMessage.getEsTitle(),
|
||||
sysMessage.getEsContent().toString());
|
||||
//发送消息成功
|
||||
sysMessage.setEsSendStatus(SendMsgStatusEnum.SUCCESS.getCode());
|
||||
}
|
||||
//update-end---author:wangshuai ---date:20220323 for:[issues/I4X698]模板管理发送消息出现NullPointerException 錯誤------------
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
// 发送消息出现异常
|
||||
|
||||
@ -13,6 +13,12 @@ import java.util.List;
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface SysMessageTemplateMapper extends BaseMapper<SysMessageTemplate> {
|
||||
|
||||
/**
|
||||
* 通过模板CODE查询消息模板
|
||||
* @param code 模板CODE
|
||||
* @return List<SysMessageTemplate>
|
||||
*/
|
||||
@Select("SELECT * FROM SYS_SMS_TEMPLATE WHERE TEMPLATE_CODE = #{code}")
|
||||
List<SysMessageTemplate> selectByCode(String code);
|
||||
}
|
||||
|
||||
@ -12,5 +12,11 @@ import org.jeecg.modules.message.entity.SysMessageTemplate;
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ISysMessageTemplateService extends JeecgService<SysMessageTemplate> {
|
||||
|
||||
/**
|
||||
* 通过模板CODE查询消息模板
|
||||
* @param code 模板CODE
|
||||
* @return
|
||||
*/
|
||||
List<SysMessageTemplate> selectByCode(String code);
|
||||
}
|
||||
|
||||
@ -21,6 +21,7 @@ import java.util.Map;
|
||||
|
||||
/**
|
||||
* 消息生成工具
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
|
||||
@Component
|
||||
|
||||
@ -4,16 +4,17 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.base.BaseMap;
|
||||
import org.jeecg.common.constant.CommonSendStatus;
|
||||
import org.jeecg.common.modules.redis.listener.JeecgRedisListerer;
|
||||
import org.jeecg.common.modules.redis.listener.JeecgRedisListener;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 监听消息(采用redis发布订阅方式发送消息)
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class SocketHandler implements JeecgRedisListerer {
|
||||
public class SocketHandler implements JeecgRedisListener {
|
||||
|
||||
@Autowired
|
||||
private WebSocket webSocket;
|
||||
|
||||
@ -10,6 +10,10 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
/**
|
||||
* @Description: TestSocketController
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/sys/socketTest")
|
||||
public class TestSocketController {
|
||||
|
||||
@ -2,6 +2,7 @@ package org.jeecg.modules.message.websocket;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.CopyOnWriteArraySet;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@ -28,11 +29,14 @@ import lombok.extern.slf4j.Slf4j;
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
@ServerEndpoint("/websocket/{userId}") //此注解相当于设置访问URL
|
||||
@ServerEndpoint("/websocket/{userId}")
|
||||
public class WebSocket {
|
||||
|
||||
private Session session;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private String userId;
|
||||
|
||||
private static final String REDIS_TOPIC_NAME = "socketHandler";
|
||||
@ -44,12 +48,15 @@ public class WebSocket {
|
||||
* 缓存 webSocket连接到单机服务class中(整体方案支持集群)
|
||||
*/
|
||||
private static CopyOnWriteArraySet<WebSocket> webSockets = new CopyOnWriteArraySet<>();
|
||||
private static Map<String, Session> sessionPool = new HashMap<String, Session>();
|
||||
|
||||
/**
|
||||
* 线程安全Map
|
||||
*/
|
||||
private static ConcurrentHashMap<String, Session> sessionPool = new ConcurrentHashMap<>();
|
||||
|
||||
@OnOpen
|
||||
public void onOpen(Session session, @PathParam(value = "userId") String userId) {
|
||||
try {
|
||||
//TODO 通过header中获取token,进行check
|
||||
this.session = session;
|
||||
this.userId = userId;
|
||||
webSockets.add(this);
|
||||
@ -113,9 +120,11 @@ public class WebSocket {
|
||||
obj.put(WebsocketConst.MSG_CMD, WebsocketConst.CMD_CHECK);
|
||||
//消息内容
|
||||
obj.put(WebsocketConst.MSG_TXT, "心跳响应");
|
||||
//update-begin-author:taoyan date:20220308 for: 消息通知长连接启动心跳机制,后端代码小bug #3473
|
||||
for (WebSocket webSocket : webSockets) {
|
||||
webSocket.pushMessage(message);
|
||||
webSocket.pushMessage(obj.toJSONString());
|
||||
}
|
||||
//update-end-author:taoyan date:20220308 for: 消息通知长连接启动心跳机制,后端代码小bug #3473
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -19,6 +19,10 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: ActuatorRedisController
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/sys/actuator/redis")
|
||||
@ -100,7 +104,7 @@ public class ActuatorRedisController {
|
||||
if(fs[i].getTotalSpace()==0) {
|
||||
continue;
|
||||
}
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
Map<String,Object> map = new HashMap(5);
|
||||
map.put("name", fsv.getSystemDisplayName(fs[i]));
|
||||
map.put("max", fs[i].getTotalSpace());
|
||||
map.put("rest", fs[i].getFreeSpace());
|
||||
|
||||
@ -3,9 +3,13 @@ package org.jeecg.modules.monitor.domain;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: redis信息
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
public class RedisInfo {
|
||||
|
||||
private static Map<String, String> map = new HashMap<>();
|
||||
private static Map<String, String> map = new HashMap(5);
|
||||
|
||||
static {
|
||||
map.put("redis_version", "Redis 服务器版本");
|
||||
|
||||
@ -2,6 +2,7 @@ package org.jeecg.modules.monitor.exception;
|
||||
|
||||
/**
|
||||
* Redis 连接异常
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
public class RedisConnectException extends Exception {
|
||||
|
||||
|
||||
@ -8,12 +8,17 @@ import com.alibaba.fastjson.JSONArray;
|
||||
import org.jeecg.modules.monitor.domain.RedisInfo;
|
||||
import org.jeecg.modules.monitor.exception.RedisConnectException;
|
||||
|
||||
/**
|
||||
* @Description: redis信息service接口
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
public interface RedisService {
|
||||
|
||||
/**
|
||||
* 获取 redis 的详细信息
|
||||
*
|
||||
* @return List
|
||||
* @throws RedisConnectException
|
||||
*/
|
||||
List<RedisInfo> getRedisInfo() throws RedisConnectException;
|
||||
|
||||
@ -21,6 +26,7 @@ public interface RedisService {
|
||||
* 获取 redis key 数量
|
||||
*
|
||||
* @return Map
|
||||
* @throws RedisConnectException
|
||||
*/
|
||||
Map<String, Object> getKeysSize() throws RedisConnectException;
|
||||
|
||||
@ -28,12 +34,14 @@ public interface RedisService {
|
||||
* 获取 redis 内存信息
|
||||
*
|
||||
* @return Map
|
||||
* @throws RedisConnectException
|
||||
*/
|
||||
Map<String, Object> getMemoryInfo() throws RedisConnectException;
|
||||
/**
|
||||
* 获取 报表需要个redis信息
|
||||
*
|
||||
* @param type
|
||||
* @return Map
|
||||
* @throws RedisConnectException
|
||||
*/
|
||||
Map<String, JSONArray> getMapForReport(String type) throws RedisConnectException ;
|
||||
}
|
||||
|
||||
@ -54,11 +54,11 @@ public class RedisServiceImpl implements RedisService {
|
||||
@Override
|
||||
public Map<String, Object> getKeysSize() throws RedisConnectException {
|
||||
Long dbSize = redisConnectionFactory.getConnection().dbSize();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
Map<String, Object> map = new HashMap(5);
|
||||
map.put("create_time", System.currentTimeMillis());
|
||||
map.put("dbSize", dbSize);
|
||||
|
||||
log.info("--getKeysSize--: " + map.toString());
|
||||
log.debug("--getKeysSize--: " + map.toString());
|
||||
return map;
|
||||
}
|
||||
|
||||
@ -69,12 +69,12 @@ public class RedisServiceImpl implements RedisService {
|
||||
for (Map.Entry<Object, Object> entry : info.entrySet()) {
|
||||
String key = oConvertUtils.getString(entry.getKey());
|
||||
if ("used_memory".equals(key)) {
|
||||
map = new HashMap<>();
|
||||
map = new HashMap(5);
|
||||
map.put("used_memory", entry.getValue());
|
||||
map.put("create_time", System.currentTimeMillis());
|
||||
}
|
||||
}
|
||||
log.info("--getMemoryInfo--: " + map.toString());
|
||||
log.debug("--getMemoryInfo--: " + map.toString());
|
||||
return map;
|
||||
}
|
||||
|
||||
@ -86,7 +86,7 @@ public class RedisServiceImpl implements RedisService {
|
||||
*/
|
||||
@Override
|
||||
public Map<String, JSONArray> getMapForReport(String type) throws RedisConnectException {
|
||||
Map<String,JSONArray> mapJson=new HashMap<String, JSONArray> ();
|
||||
Map<String,JSONArray> mapJson=new HashMap(5);
|
||||
JSONArray json = new JSONArray();
|
||||
if("3".equals(type)){
|
||||
List<RedisInfo> redisInfo = getRedisInfo();
|
||||
|
||||
@ -5,8 +5,33 @@ import com.alibaba.fastjson.JSONArray;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: NgAlainService接口
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
public interface NgAlainService {
|
||||
/**
|
||||
* 菜单
|
||||
* @param id
|
||||
* @return JSONArray
|
||||
* @throws Exception
|
||||
*/
|
||||
public JSONArray getMenu(String id) throws Exception;
|
||||
|
||||
/**
|
||||
* jeecg菜单
|
||||
* @param id
|
||||
* @return JSONArray
|
||||
* @throws Exception
|
||||
*/
|
||||
public JSONArray getJeecgMenu(String id) throws Exception;
|
||||
|
||||
/**
|
||||
* 获取字典值
|
||||
* @param table
|
||||
* @param key
|
||||
* @param value
|
||||
* @return List<Map<String, String>>
|
||||
*/
|
||||
public List<Map<String, String>> getDictByTable(String table, String key, String value);
|
||||
}
|
||||
|
||||
@ -15,6 +15,10 @@ import java.util.Base64;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: NgAlainServiceImpl 实现类
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@Service("ngAlainService")
|
||||
public class NgAlainServiceImpl implements NgAlainService {
|
||||
@Autowired
|
||||
|
||||
@ -20,6 +20,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 云存储示例 DEMO
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@Slf4j
|
||||
@Controller
|
||||
|
||||
@ -7,6 +7,10 @@ import lombok.experimental.Accessors;
|
||||
import org.jeecg.common.system.base.entity.JeecgEntity;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
/**
|
||||
* @Description: oss云存储实体类
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@Data
|
||||
@TableName("oss_file")
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
|
||||
@ -3,6 +3,10 @@ package org.jeecg.modules.oss.mapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.jeecg.modules.oss.entity.OSSFile;
|
||||
|
||||
/**
|
||||
* @Description: oss云存储Mapper
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
public interface OSSFileMapper extends BaseMapper<OSSFile> {
|
||||
|
||||
}
|
||||
|
||||
@ -6,10 +6,24 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.oss.entity.OSSFile;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* @Description: OOS云存储service接口
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
public interface IOSSFileService extends IService<OSSFile> {
|
||||
|
||||
/**
|
||||
* oss文件上传
|
||||
* @param multipartFile
|
||||
* @throws IOException
|
||||
*/
|
||||
void upload(MultipartFile multipartFile) throws IOException;
|
||||
|
||||
/**
|
||||
* oss文件删除
|
||||
* @param ossFile OSSFile对象
|
||||
* @return
|
||||
*/
|
||||
boolean delete(OSSFile ossFile);
|
||||
|
||||
}
|
||||
|
||||
@ -11,6 +11,10 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* @Description: OSS云存储实现类
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@Service("ossFileService")
|
||||
public class OSSFileServiceImpl extends ServiceImpl<OSSFileMapper, OSSFile> implements IOSSFileService {
|
||||
|
||||
|
||||
@ -228,7 +228,8 @@ public class QuartzJobController {
|
||||
List<String> errorMessage = new ArrayList<>();
|
||||
int successLines = 0, errorLines = 0;
|
||||
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
|
||||
MultipartFile file = entity.getValue();// 获取上传文件对象
|
||||
// 获取上传文件对象
|
||||
MultipartFile file = entity.getValue();
|
||||
ImportParams params = new ImportParams();
|
||||
params.setTitleRows(2);
|
||||
params.setHeadRows(1);
|
||||
|
||||
@ -15,6 +15,11 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
*/
|
||||
public interface QuartzJobMapper extends BaseMapper<QuartzJob> {
|
||||
|
||||
/**
|
||||
* 根据jobClassName查询
|
||||
* @param jobClassName 任务类名
|
||||
* @return
|
||||
*/
|
||||
public List<QuartzJob> findByJobClassName(@Param("jobClassName") String jobClassName);
|
||||
|
||||
}
|
||||
|
||||
@ -15,19 +15,46 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
*/
|
||||
public interface IQuartzJobService extends IService<QuartzJob> {
|
||||
|
||||
/**
|
||||
* 通过类名寻找定时任务
|
||||
* @param jobClassName 类名
|
||||
* @return List<QuartzJob>
|
||||
*/
|
||||
List<QuartzJob> findByJobClassName(String jobClassName);
|
||||
|
||||
/**
|
||||
* 保存定时任务
|
||||
* @param quartzJob
|
||||
* @return boolean
|
||||
*/
|
||||
boolean saveAndScheduleJob(QuartzJob quartzJob);
|
||||
|
||||
/**
|
||||
* 编辑定时任务
|
||||
* @param quartzJob
|
||||
* @return boolean
|
||||
* @throws SchedulerException
|
||||
*/
|
||||
boolean editAndScheduleJob(QuartzJob quartzJob) throws SchedulerException;
|
||||
|
||||
/**
|
||||
* 删除定时任务
|
||||
* @param quartzJob
|
||||
* @return boolean
|
||||
*/
|
||||
boolean deleteAndStopJob(QuartzJob quartzJob);
|
||||
|
||||
/**
|
||||
* 恢复定时任务
|
||||
* @param quartzJob
|
||||
* @return
|
||||
*/
|
||||
boolean resumeJob(QuartzJob quartzJob);
|
||||
|
||||
/**
|
||||
* 执行定时任务
|
||||
* @param quartzJob
|
||||
* @throws Exception
|
||||
*/
|
||||
void execute(QuartzJob quartzJob) throws Exception;
|
||||
|
||||
|
||||
@ -11,7 +11,6 @@ import org.jeecg.common.util.CommonUtils;
|
||||
import org.jeecg.common.util.RestUtil;
|
||||
import org.jeecg.common.util.TokenUtils;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpMethod;
|
||||
@ -42,9 +41,6 @@ import java.net.URLDecoder;
|
||||
@RequestMapping("/sys/common")
|
||||
public class CommonController {
|
||||
|
||||
@Autowired
|
||||
private ISysBaseAPI sysBaseAPI;
|
||||
|
||||
@Value(value = "${jeecg.path.upload}")
|
||||
private String uploadpath;
|
||||
|
||||
@ -81,7 +77,8 @@ public class CommonController {
|
||||
}
|
||||
|
||||
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
||||
MultipartFile file = multipartRequest.getFile("file");// 获取上传文件对象
|
||||
// 获取上传文件对象
|
||||
MultipartFile file = multipartRequest.getFile("file");
|
||||
if(oConvertUtils.isEmpty(bizPath)){
|
||||
if(CommonConstant.UPLOAD_TYPE_OSS.equals(uploadType)){
|
||||
//未指定目录,则用阿里云默认目录 upload
|
||||
@ -135,9 +132,11 @@ public class CommonController {
|
||||
String fileName = null;
|
||||
File file = new File(ctxPath + File.separator + bizPath + File.separator );
|
||||
if (!file.exists()) {
|
||||
file.mkdirs();// 创建文件根目录
|
||||
// 创建文件根目录
|
||||
file.mkdirs();
|
||||
}
|
||||
String orgName = mf.getOriginalFilename();// 获取文件名
|
||||
// 获取文件名
|
||||
String orgName = mf.getOriginalFilename();
|
||||
orgName = CommonUtils.getFileName(orgName);
|
||||
if(orgName.indexOf(".")!=-1){
|
||||
fileName = orgName.substring(0, orgName.lastIndexOf(".")) + "_" + System.currentTimeMillis() + orgName.substring(orgName.lastIndexOf("."));
|
||||
@ -228,7 +227,8 @@ public class CommonController {
|
||||
response.setStatus(404);
|
||||
throw new RuntimeException("文件["+imgPath+"]不存在..");
|
||||
}
|
||||
response.setContentType("application/force-download");// 设置强制下载不打开
|
||||
// 设置强制下载不打开
|
||||
response.setContentType("application/force-download");
|
||||
response.addHeader("Content-Disposition", "attachment;fileName=" + new String(file.getName().getBytes("UTF-8"),"iso-8859-1"));
|
||||
inputStream = new BufferedInputStream(new FileInputStream(filePath));
|
||||
outputStream = response.getOutputStream();
|
||||
|
||||
@ -4,9 +4,11 @@ import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.constant.SymbolConstant;
|
||||
import org.jeecg.common.util.SqlInjectionUtil;
|
||||
import org.jeecg.modules.system.mapper.SysDictMapper;
|
||||
import org.jeecg.modules.system.model.DuplicateCheckVo;
|
||||
import org.jeecg.modules.system.security.DictQueryBlackListHandler;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
@ -32,6 +34,9 @@ public class DuplicateCheckController {
|
||||
@Autowired
|
||||
SysDictMapper sysDictMapper;
|
||||
|
||||
@Autowired
|
||||
DictQueryBlackListHandler dictQueryBlackListHandler;
|
||||
|
||||
/**
|
||||
* 校验数据是否在系统中是否存在
|
||||
*
|
||||
@ -55,6 +60,12 @@ public class DuplicateCheckController {
|
||||
rs.setMessage("数据为空,不作处理!");
|
||||
return rs;
|
||||
}
|
||||
//update-begin-author:taoyan date:20220329 for: VUEN-223【安全漏洞】当前被攻击的接口
|
||||
String checkSql = duplicateCheckVo.getTableName() + SymbolConstant.COMMA + duplicateCheckVo.getFieldName() + SymbolConstant.COMMA;
|
||||
if(!dictQueryBlackListHandler.isPass(checkSql)){
|
||||
return Result.error(dictQueryBlackListHandler.getError());
|
||||
}
|
||||
//update-end-author:taoyan date:20220329 for: VUEN-223【安全漏洞】当前被攻击的接口
|
||||
// update-end-author:taoyan date:20211227 for: JTC-25 【online报表】oracle 操作问题 录入弹框啥都不填直接保存 ①编码不是应该提示必填么?②报错也应该是具体文字提示,不是后台错误日志
|
||||
if (StringUtils.isNotBlank(duplicateCheckVo.getDataId())) {
|
||||
// [2].编辑页面校验
|
||||
|
||||
@ -12,7 +12,6 @@ import org.apache.shiro.SecurityUtils;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.constant.CacheConstant;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
import org.jeecg.common.system.util.JwtUtil;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.jeecg.common.util.*;
|
||||
@ -23,6 +22,7 @@ import org.jeecg.modules.system.entity.SysTenant;
|
||||
import org.jeecg.modules.system.entity.SysUser;
|
||||
import org.jeecg.modules.system.model.SysLoginModel;
|
||||
import org.jeecg.modules.system.service.*;
|
||||
import org.jeecg.modules.system.service.impl.SysBaseApiImpl;
|
||||
import org.jeecg.modules.system.util.RandImageUtil;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -45,7 +45,7 @@ public class LoginController {
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
@Autowired
|
||||
private ISysBaseAPI sysBaseAPI;
|
||||
private SysBaseApiImpl sysBaseApi;
|
||||
@Autowired
|
||||
private ISysLogService logService;
|
||||
@Autowired
|
||||
@ -77,7 +77,7 @@ public class LoginController {
|
||||
return result;
|
||||
}
|
||||
String lowerCaseCaptcha = captcha.toLowerCase();
|
||||
String realKey = MD5Util.MD5Encode(lowerCaseCaptcha+sysLoginModel.getCheckKey(), "utf-8");
|
||||
String realKey = Md5Util.md5Encode(lowerCaseCaptcha+sysLoginModel.getCheckKey(), "utf-8");
|
||||
Object checkCode = redisUtil.get(realKey);
|
||||
//当进入登录页时,有一定几率出现验证码错误 #1714
|
||||
if(checkCode==null || !checkCode.toString().equals(lowerCaseCaptcha)) {
|
||||
@ -129,11 +129,8 @@ public class LoginController {
|
||||
if(oConvertUtils.isNotEmpty(username)) {
|
||||
// 根据用户名查询用户信息
|
||||
SysUser sysUser = sysUserService.getUserByName(username);
|
||||
//用户登录信息
|
||||
Result<JSONObject> resultObj=userInfo(sysUser, result);
|
||||
JSONObject jsonObject=resultObj.getResult();
|
||||
JSONObject obj=new JSONObject();
|
||||
obj.put("userInfo",jsonObject.get("userInfo"));
|
||||
obj.put("userInfo",sysUser);
|
||||
obj.put("sysAllDictItems", sysDictService.queryAllDictItems());
|
||||
result.setResult(obj);
|
||||
result.success("");
|
||||
@ -156,7 +153,7 @@ public class LoginController {
|
||||
return Result.error("退出登录失败!");
|
||||
}
|
||||
String username = JwtUtil.getUsername(token);
|
||||
LoginUser sysUser = sysBaseAPI.getUserByName(username);
|
||||
LoginUser sysUser = sysBaseApi.getUserByName(username);
|
||||
if(sysUser!=null) {
|
||||
//update-begin--Author:wangshuai Date:20200714 for:登出日志没有记录人员
|
||||
baseCommonService.addLog("用户名: "+sysUser.getRealname()+",退出成功!", CommonConstant.LOG_TYPE_1, null,sysUser);
|
||||
@ -436,7 +433,7 @@ public class LoginController {
|
||||
@GetMapping(value = "/getEncryptedString")
|
||||
public Result<Map<String,String>> getEncryptedString(){
|
||||
Result<Map<String,String>> result = new Result<Map<String,String>>();
|
||||
Map<String,String> map = new HashMap<String,String>();
|
||||
Map<String,String> map = new HashMap(5);
|
||||
map.put("key", EncryptedString.key);
|
||||
map.put("iv",EncryptedString.iv);
|
||||
result.setResult(map);
|
||||
@ -450,7 +447,7 @@ public class LoginController {
|
||||
*/
|
||||
@ApiOperation("获取验证码")
|
||||
@GetMapping(value = "/randomImage/{key}")
|
||||
public Result<String> randomImage(HttpServletResponse response,@PathVariable String key){
|
||||
public Result<String> randomImage(HttpServletResponse response,@PathVariable("key") String key){
|
||||
Result<String> res = new Result<String>();
|
||||
try {
|
||||
//生成验证码
|
||||
@ -459,7 +456,7 @@ public class LoginController {
|
||||
|
||||
//存到redis中
|
||||
String lowerCaseCode = code.toLowerCase();
|
||||
String realKey = MD5Util.MD5Encode(lowerCaseCode+key, "utf-8");
|
||||
String realKey = Md5Util.md5Encode(lowerCaseCode+key, "utf-8");
|
||||
log.info("获取验证码,Redis checkCode = {},key = {}", code, key);
|
||||
redisUtil.set(realKey, lowerCaseCode, 60);
|
||||
|
||||
@ -548,7 +545,7 @@ public class LoginController {
|
||||
return Result.error("验证码无效");
|
||||
}
|
||||
String lowerCaseCaptcha = captcha.toLowerCase();
|
||||
String realKey = MD5Util.MD5Encode(lowerCaseCaptcha+checkKey, "utf-8");
|
||||
String realKey = Md5Util.md5Encode(lowerCaseCaptcha+checkKey, "utf-8");
|
||||
Object checkCode = redisUtil.get(realKey);
|
||||
if(checkCode==null || !checkCode.equals(lowerCaseCaptcha)) {
|
||||
return Result.error("验证码错误");
|
||||
@ -593,7 +590,7 @@ public class LoginController {
|
||||
@GetMapping("/getQrcodeToken")
|
||||
public Result getQrcodeToken(@RequestParam String qrcodeId) {
|
||||
Object token = redisUtil.get(CommonConstant.LOGIN_QRCODE_TOKEN + qrcodeId);
|
||||
Map result = new HashMap();
|
||||
Map result = new HashMap(5);
|
||||
Object qrcodeIdExpire = redisUtil.get(CommonConstant.LOGIN_QRCODE + qrcodeId);
|
||||
if (oConvertUtils.isEmpty(qrcodeIdExpire)) {
|
||||
//二维码过期通知前台刷新
|
||||
|
||||
@ -13,7 +13,6 @@ import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.constant.CommonSendStatus;
|
||||
import org.jeecg.common.constant.WebsocketConst;
|
||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.util.JwtUtil;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
@ -25,6 +24,7 @@ import org.jeecg.modules.system.entity.SysAnnouncement;
|
||||
import org.jeecg.modules.system.entity.SysAnnouncementSend;
|
||||
import org.jeecg.modules.system.service.ISysAnnouncementSendService;
|
||||
import org.jeecg.modules.system.service.ISysAnnouncementService;
|
||||
import org.jeecg.modules.system.service.impl.SysBaseApiImpl;
|
||||
import org.jeecg.modules.system.service.impl.ThirdAppDingtalkServiceImpl;
|
||||
import org.jeecg.modules.system.service.impl.ThirdAppWechatEnterpriseServiceImpl;
|
||||
import org.jeecg.modules.system.util.XSSUtils;
|
||||
@ -74,7 +74,7 @@ public class SysAnnouncementController {
|
||||
@Autowired
|
||||
ThirdAppDingtalkServiceImpl dingtalkService;
|
||||
@Autowired
|
||||
private ISysBaseAPI sysBaseAPI;
|
||||
private SysBaseApiImpl sysBaseApi;
|
||||
@Autowired
|
||||
@Lazy
|
||||
private RedisUtil redisUtil;
|
||||
@ -129,7 +129,8 @@ public class SysAnnouncementController {
|
||||
sysAnnouncement.setTitile(title);
|
||||
// update-end-author:liusq date:20210804 for:标题处理xss攻击的问题
|
||||
sysAnnouncement.setDelFlag(CommonConstant.DEL_FLAG_0.toString());
|
||||
sysAnnouncement.setSendStatus(CommonSendStatus.UNPUBLISHED_STATUS_0);//未发布
|
||||
//未发布
|
||||
sysAnnouncement.setSendStatus(CommonSendStatus.UNPUBLISHED_STATUS_0);
|
||||
sysAnnouncementService.saveAnnouncement(sysAnnouncement);
|
||||
result.success("添加成功!");
|
||||
} catch (Exception e) {
|
||||
@ -239,7 +240,8 @@ public class SysAnnouncementController {
|
||||
if(sysAnnouncement==null) {
|
||||
result.error500("未找到对应实体");
|
||||
}else {
|
||||
sysAnnouncement.setSendStatus(CommonSendStatus.PUBLISHED_STATUS_1);//发布中
|
||||
//发布中
|
||||
sysAnnouncement.setSendStatus(CommonSendStatus.PUBLISHED_STATUS_1);
|
||||
sysAnnouncement.setSendTime(new Date());
|
||||
String currentUserName = JwtUtil.getUserNameByToken(request);
|
||||
sysAnnouncement.setSender(currentUserName);
|
||||
@ -295,7 +297,8 @@ public class SysAnnouncementController {
|
||||
if(sysAnnouncement==null) {
|
||||
result.error500("未找到对应实体");
|
||||
}else {
|
||||
sysAnnouncement.setSendStatus(CommonSendStatus.REVOKE_STATUS_2);//撤销发布
|
||||
//撤销发布
|
||||
sysAnnouncement.setSendStatus(CommonSendStatus.REVOKE_STATUS_2);
|
||||
sysAnnouncement.setCancelTime(new Date());
|
||||
boolean ok = sysAnnouncementService.updateById(sysAnnouncement);
|
||||
if(ok) {
|
||||
@ -324,10 +327,14 @@ public class SysAnnouncementController {
|
||||
String userId = sysUser.getId();
|
||||
// 1.将系统消息补充到用户通告阅读标记表中
|
||||
LambdaQueryWrapper<SysAnnouncement> querySaWrapper = new LambdaQueryWrapper<SysAnnouncement>();
|
||||
querySaWrapper.eq(SysAnnouncement::getMsgType,CommonConstant.MSG_TYPE_ALL); // 全部人员
|
||||
querySaWrapper.eq(SysAnnouncement::getDelFlag,CommonConstant.DEL_FLAG_0.toString()); // 未删除
|
||||
querySaWrapper.eq(SysAnnouncement::getSendStatus, CommonConstant.HAS_SEND); //已发布
|
||||
querySaWrapper.ge(SysAnnouncement::getEndTime, sysUser.getCreateTime()); //新注册用户不看结束通知
|
||||
//全部人员
|
||||
querySaWrapper.eq(SysAnnouncement::getMsgType,CommonConstant.MSG_TYPE_ALL);
|
||||
//未删除
|
||||
querySaWrapper.eq(SysAnnouncement::getDelFlag,CommonConstant.DEL_FLAG_0.toString());
|
||||
//已发布
|
||||
querySaWrapper.eq(SysAnnouncement::getSendStatus, CommonConstant.HAS_SEND);
|
||||
//新注册用户不看结束通知
|
||||
querySaWrapper.ge(SysAnnouncement::getEndTime, sysUser.getCreateTime());
|
||||
//update-begin--Author:liusq Date:20210108 for:[JT-424] 【开源issue】bug处理--------------------
|
||||
querySaWrapper.notInSql(SysAnnouncement::getId,"select annt_id from sys_announcement_send where user_id='"+userId+"'");
|
||||
//update-begin--Author:liusq Date:20210108 for: [JT-424] 【开源issue】bug处理--------------------
|
||||
@ -354,10 +361,12 @@ public class SysAnnouncementController {
|
||||
}
|
||||
// 2.查询用户未读的系统消息
|
||||
Page<SysAnnouncement> anntMsgList = new Page<SysAnnouncement>(0, pageSize);
|
||||
anntMsgList = sysAnnouncementService.querySysCementPageByUserId(anntMsgList,userId,"1");//通知公告消息
|
||||
//通知公告消息
|
||||
anntMsgList = sysAnnouncementService.querySysCementPageByUserId(anntMsgList,userId,"1");
|
||||
Page<SysAnnouncement> sysMsgList = new Page<SysAnnouncement>(0, pageSize);
|
||||
sysMsgList = sysAnnouncementService.querySysCementPageByUserId(sysMsgList,userId,"2");//系统消息
|
||||
Map<String,Object> sysMsgMap = new HashMap<String, Object>();
|
||||
//系统消息
|
||||
sysMsgList = sysAnnouncementService.querySysCementPageByUserId(sysMsgList,userId,"2");
|
||||
Map<String,Object> sysMsgMap = new HashMap(5);
|
||||
sysMsgMap.put("sysMsgList", sysMsgList.getRecords());
|
||||
sysMsgMap.put("sysMsgTotal", sysMsgList.getTotal());
|
||||
sysMsgMap.put("anntMsgList", anntMsgList.getRecords());
|
||||
@ -402,7 +411,8 @@ public class SysAnnouncementController {
|
||||
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
||||
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
|
||||
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
|
||||
MultipartFile file = entity.getValue();// 获取上传文件对象
|
||||
// 获取上传文件对象
|
||||
MultipartFile file = entity.getValue();
|
||||
ImportParams params = new ImportParams();
|
||||
params.setTitleRows(2);
|
||||
params.setHeadRows(1);
|
||||
@ -481,7 +491,7 @@ public class SysAnnouncementController {
|
||||
boolean tokenOK = false;
|
||||
try {
|
||||
// 验证Token有效性
|
||||
tokenOK = TokenUtils.verifyToken(request, sysBaseAPI, redisUtil);
|
||||
tokenOK = TokenUtils.verifyToken(request, sysBaseApi, redisUtil);
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
// 判断是否传递了Token,并且Token有效,如果传了就不做查看限制,直接返回
|
||||
|
||||
@ -230,7 +230,8 @@ public class SysCategoryController {
|
||||
List<String> errorMessage = new ArrayList<>();
|
||||
int successLines = 0, errorLines = 0;
|
||||
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
|
||||
MultipartFile file = entity.getValue();// 获取上传文件对象
|
||||
// 获取上传文件对象
|
||||
MultipartFile file = entity.getValue();
|
||||
ImportParams params = new ImportParams();
|
||||
params.setTitleRows(2);
|
||||
params.setHeadRows(1);
|
||||
|
||||
@ -22,6 +22,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* @Description: 系统数据日志
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/sys/dataLog")
|
||||
@Slf4j
|
||||
|
||||
@ -379,14 +379,15 @@ public class SysDepartController {
|
||||
List<SysDepart> listSysDeparts = null;
|
||||
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
|
||||
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
|
||||
MultipartFile file = entity.getValue();// 获取上传文件对象
|
||||
// 获取上传文件对象
|
||||
MultipartFile file = entity.getValue();
|
||||
ImportParams params = new ImportParams();
|
||||
params.setTitleRows(2);
|
||||
params.setHeadRows(1);
|
||||
params.setNeedSave(true);
|
||||
try {
|
||||
// orgCode编码长度
|
||||
int codeLength = YouBianCodeUtil.zhanweiLength;
|
||||
int codeLength = YouBianCodeUtil.ZHANWEI_LENGTH;
|
||||
listSysDeparts = ExcelImportUtil.importExcel(file.getInputStream(), SysDepart.class, params);
|
||||
//按长度排序
|
||||
Collections.sort(listSysDeparts, new Comparator<SysDepart>() {
|
||||
@ -476,7 +477,7 @@ public class SysDepartController {
|
||||
public Result<Map<String,Object>> queryTreeByKeyWord(@RequestParam(name = "keyWord", required = false) String keyWord) {
|
||||
Result<Map<String,Object>> result = new Result<>();
|
||||
try {
|
||||
Map<String,Object> map=new HashMap<String,Object>();
|
||||
Map<String,Object> map=new HashMap(5);
|
||||
List<SysDepartTreeModel> list = sysDepartService.queryTreeByKeyWord(keyWord);
|
||||
//根据keyWord获取用户信息
|
||||
LambdaQueryWrapper<SysUser> queryUser = new LambdaQueryWrapper<SysUser>();
|
||||
|
||||
@ -2,16 +2,20 @@ package org.jeecg.modules.system.controller;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.base.service.BaseCommonService;
|
||||
import org.jeecg.modules.system.entity.SysDepartPermission;
|
||||
import org.jeecg.modules.system.entity.SysDepartRolePermission;
|
||||
import org.jeecg.modules.system.entity.SysPermission;
|
||||
@ -56,6 +60,9 @@ public class SysDepartPermissionController extends JeecgController<SysDepartPerm
|
||||
@Autowired
|
||||
private ISysDepartRolePermissionService sysDepartRolePermissionService;
|
||||
|
||||
@Autowired
|
||||
private BaseCommonService baseCommonService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
@ -174,7 +181,7 @@ public class SysDepartPermissionController extends JeecgController<SysDepartPerm
|
||||
if(list==null || list.size()==0) {
|
||||
return Result.error("未找到权限配置信息");
|
||||
}else {
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
Map<String,Object> map = new HashMap(5);
|
||||
map.put("datarule", list);
|
||||
LambdaQueryWrapper<SysDepartPermission> query = new LambdaQueryWrapper<SysDepartPermission>()
|
||||
.eq(SysDepartPermission::getPermissionId, permissionId)
|
||||
@ -253,7 +260,11 @@ public class SysDepartPermissionController extends JeecgController<SysDepartPerm
|
||||
String lastPermissionIds = json.getString("lastpermissionIds");
|
||||
this.sysDepartRolePermissionService.saveDeptRolePermission(roleId, permissionIds, lastPermissionIds);
|
||||
result.success("保存成功!");
|
||||
log.info("======部门角色授权成功=====耗时:" + (System.currentTimeMillis() - start) + "毫秒");
|
||||
//update-begin---author:wangshuai ---date:20220316 for:[VUEN-234]部门角色授权添加敏感日志------------
|
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
baseCommonService.addLog("修改部门角色ID:"+roleId+"的权限配置,操作人: " +loginUser.getUsername() ,CommonConstant.LOG_TYPE_2, 2);
|
||||
//update-end---author:wangshuai ---date:20220316 for:[VUEN-234]部门角色授权添加敏感日志------------
|
||||
log.info("======部门角色授权成功=====耗时:" + (System.currentTimeMillis() - start) + "毫秒");
|
||||
} catch (Exception e) {
|
||||
result.error500("授权失败!");
|
||||
log.error(e.getMessage(), e);
|
||||
@ -282,9 +293,11 @@ public class SysDepartPermissionController extends JeecgController<SysDepartPerm
|
||||
}
|
||||
List<TreeModel> treeList = new ArrayList<>();
|
||||
getTreeModelList(treeList, list, null);
|
||||
Map<String,Object> resMap = new HashMap<String,Object>();
|
||||
resMap.put("treeList", treeList); //全部树节点数据
|
||||
resMap.put("ids", ids);//全部树ids
|
||||
Map<String,Object> resMap = new HashMap(5);
|
||||
//全部树节点数据
|
||||
resMap.put("treeList", treeList);
|
||||
//全部树ids
|
||||
resMap.put("ids", ids);
|
||||
result.setResult(resMap);
|
||||
result.setSuccess(true);
|
||||
} catch (Exception e) {
|
||||
|
||||
@ -2,6 +2,7 @@ package org.jeecg.modules.system.controller;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@ -15,6 +16,7 @@ import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.base.service.BaseCommonService;
|
||||
import org.jeecg.modules.system.entity.*;
|
||||
import org.jeecg.modules.system.service.*;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
@ -54,7 +56,10 @@ public class SysDepartRoleController extends JeecgController<SysDepartRole, ISys
|
||||
|
||||
@Autowired
|
||||
private ISysDepartService sysDepartService;
|
||||
|
||||
|
||||
@Autowired
|
||||
private BaseCommonService baseCommonService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
@ -190,7 +195,11 @@ public class SysDepartRoleController extends JeecgController<SysDepartRole, ISys
|
||||
String oldRoleId = json.getString("oldRoleId");
|
||||
String userId = json.getString("userId");
|
||||
departRoleUserService.deptRoleUserAdd(userId,newRoleId,oldRoleId);
|
||||
return Result.ok("添加成功!");
|
||||
//update-begin---author:wangshuai ---date:20220316 for:[VUEN-234]部门角色分配添加敏感日志------------
|
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
baseCommonService.addLog("给部门用户ID:"+userId+"分配角色,操作人: " +loginUser.getUsername() ,CommonConstant.LOG_TYPE_2, 2);
|
||||
//update-end---author:wangshuai ---date:20220316 for:[VUEN-234]部门角色分配添加敏感日志------------
|
||||
return Result.ok("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
@ -224,7 +233,7 @@ public class SysDepartRoleController extends JeecgController<SysDepartRole, ISys
|
||||
if(list==null || list.size()==0) {
|
||||
return Result.error("未找到权限配置信息");
|
||||
}else {
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
Map<String,Object> map = new HashMap(5);
|
||||
map.put("datarule", list);
|
||||
LambdaQueryWrapper<SysDepartRolePermission> query = new LambdaQueryWrapper<SysDepartRolePermission>()
|
||||
.eq(SysDepartRolePermission::getPermissionId, permissionId)
|
||||
|
||||
@ -23,6 +23,7 @@ import org.jeecg.modules.system.entity.SysDict;
|
||||
import org.jeecg.modules.system.entity.SysDictItem;
|
||||
import org.jeecg.modules.system.model.SysDictTree;
|
||||
import org.jeecg.modules.system.model.TreeSelectModel;
|
||||
import org.jeecg.modules.system.security.DictQueryBlackListHandler;
|
||||
import org.jeecg.modules.system.service.ISysDictItemService;
|
||||
import org.jeecg.modules.system.service.ISysDictService;
|
||||
import org.jeecg.modules.system.vo.SysDictPage;
|
||||
@ -64,6 +65,8 @@ public class SysDictController {
|
||||
private ISysDictItemService sysDictItemService;
|
||||
@Autowired
|
||||
public RedisTemplate<String, Object> redisTemplate;
|
||||
@Autowired
|
||||
private DictQueryBlackListHandler dictQueryBlackListHandler;
|
||||
|
||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||
public Result<IPage<SysDict>> queryPageList(SysDict sysDict,@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@ -118,7 +121,7 @@ public class SysDictController {
|
||||
*/
|
||||
@RequestMapping(value = "/queryAllDictItems", method = RequestMethod.GET)
|
||||
public Result<?> queryAllDictItems(HttpServletRequest request) {
|
||||
Map<String, List<DictModel>> res = new HashMap<String, List<DictModel>>();
|
||||
Map<String, List<DictModel>> res = new HashMap(5);
|
||||
res = sysDictService.queryAllDictItems();
|
||||
return Result.ok(res);
|
||||
}
|
||||
@ -153,9 +156,14 @@ public class SysDictController {
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/getDictItems/{dictCode}", method = RequestMethod.GET)
|
||||
public Result<List<DictModel>> getDictItems(@PathVariable String dictCode, @RequestParam(value = "sign",required = false) String sign,HttpServletRequest request) {
|
||||
public Result<List<DictModel>> getDictItems(@PathVariable("dictCode") String dictCode, @RequestParam(value = "sign",required = false) String sign,HttpServletRequest request) {
|
||||
log.info(" dictCode : "+ dictCode);
|
||||
Result<List<DictModel>> result = new Result<List<DictModel>>();
|
||||
//update-begin-author:taoyan date:20220317 for: VUEN-222【安全机制】字典接口、online报表、online图表等接口,加一些安全机制
|
||||
if(!dictQueryBlackListHandler.isPass(dictCode)){
|
||||
return result.error500(dictQueryBlackListHandler.getError());
|
||||
}
|
||||
//update-end-author:taoyan date:20220317 for: VUEN-222【安全机制】字典接口、online报表、online图表等接口,加一些安全机制
|
||||
try {
|
||||
List<DictModel> ls = sysDictService.getDictItems(dictCode);
|
||||
if (ls == null) {
|
||||
@ -181,12 +189,17 @@ public class SysDictController {
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/loadDict/{dictCode}", method = RequestMethod.GET)
|
||||
public Result<List<DictModel>> loadDict(@PathVariable String dictCode,
|
||||
@RequestParam(name="keyword") String keyword,
|
||||
public Result<List<DictModel>> loadDict(@PathVariable("dictCode") String dictCode,
|
||||
@RequestParam(name="keyword",required = false) String keyword,
|
||||
@RequestParam(value = "sign",required = false) String sign,
|
||||
@RequestParam(value = "pageSize", required = false) Integer pageSize) {
|
||||
log.info(" 加载字典表数据,加载关键字: "+ keyword);
|
||||
Result<List<DictModel>> result = new Result<List<DictModel>>();
|
||||
//update-begin-author:taoyan date:20220317 for: VUEN-222【安全机制】字典接口、online报表、online图表等接口,加一些安全机制
|
||||
if(!dictQueryBlackListHandler.isPass(dictCode)){
|
||||
return result.error500(dictQueryBlackListHandler.getError());
|
||||
}
|
||||
//update-end-author:taoyan date:20220317 for: VUEN-222【安全机制】字典接口、online报表、online图表等接口,加一些安全机制
|
||||
try {
|
||||
List<DictModel> ls = sysDictService.loadDict(dictCode, keyword, pageSize);
|
||||
if (ls == null) {
|
||||
@ -215,7 +228,7 @@ public class SysDictController {
|
||||
*/
|
||||
@RequestMapping(value = "/loadDictOrderByValue/{dictCode}", method = RequestMethod.GET)
|
||||
public Result<List<DictModel>> loadDictOrderByValue(
|
||||
@PathVariable String dictCode,
|
||||
@PathVariable("dictCode") String dictCode,
|
||||
@RequestParam(name = "keyword") String keyword,
|
||||
@RequestParam(value = "sign", required = false) String sign,
|
||||
@RequestParam(value = "pageSize", required = false) Integer pageSize) {
|
||||
@ -256,8 +269,13 @@ public class SysDictController {
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/loadDictItem/{dictCode}", method = RequestMethod.GET)
|
||||
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) {
|
||||
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) {
|
||||
Result<List<String>> result = new Result<>();
|
||||
//update-begin-author:taoyan date:20220317 for: VUEN-222【安全机制】字典接口、online报表、online图表等接口,加一些安全机制
|
||||
if(!dictQueryBlackListHandler.isPass(dictCode)){
|
||||
return result.error500(dictQueryBlackListHandler.getError());
|
||||
}
|
||||
//update-end-author:taoyan date:20220317 for: VUEN-222【安全机制】字典接口、online报表、online图表等接口,加一些安全机制
|
||||
try {
|
||||
if(dictCode.indexOf(",")!=-1) {
|
||||
String[] params = dictCode.split(",");
|
||||
@ -488,7 +506,8 @@ public class SysDictController {
|
||||
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
||||
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
|
||||
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
|
||||
MultipartFile file = entity.getValue();// 获取上传文件对象
|
||||
// 获取上传文件对象
|
||||
MultipartFile file = entity.getValue();
|
||||
ImportParams params = new ImportParams();
|
||||
params.setTitleRows(2);
|
||||
params.setHeadRows(2);
|
||||
@ -568,7 +587,7 @@ public class SysDictController {
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/deletePhysic/{id}", method = RequestMethod.DELETE)
|
||||
public Result<?> deletePhysic(@PathVariable String id) {
|
||||
public Result<?> deletePhysic(@PathVariable("id") String id) {
|
||||
try {
|
||||
sysDictService.deleteOneDictPhysically(id);
|
||||
return Result.ok("删除成功!");
|
||||
@ -584,7 +603,7 @@ public class SysDictController {
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/back/{id}", method = RequestMethod.PUT)
|
||||
public Result<?> back(@PathVariable String id) {
|
||||
public Result<?> back(@PathVariable("id") String id) {
|
||||
try {
|
||||
sysDictService.updateDictDelFlag(0,id);
|
||||
return Result.ok("操作成功!");
|
||||
|
||||
@ -7,6 +7,7 @@ import java.util.Date;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresRoles;
|
||||
@ -38,6 +39,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
* @Author zhangweijian
|
||||
* @since 2018-12-28
|
||||
*/
|
||||
@Api(tags = "数据字典")
|
||||
@RestController
|
||||
@RequestMapping("/sys/dictItem")
|
||||
@Slf4j
|
||||
@ -161,7 +163,7 @@ public class SysDictItemController {
|
||||
@RequestMapping(value = "/dictItemCheck", method = RequestMethod.GET)
|
||||
@ApiOperation("字典重复校验接口")
|
||||
public Result<Object> doDictItemCheck(SysDictItem sysDictItem, HttpServletRequest request) {
|
||||
int num = 0;
|
||||
Long num = Long.valueOf(0);
|
||||
LambdaQueryWrapper<SysDictItem> queryWrapper = new LambdaQueryWrapper<SysDictItem>();
|
||||
queryWrapper.eq(SysDictItem::getItemValue,sysDictItem.getItemValue());
|
||||
queryWrapper.eq(SysDictItem::getDictId,sysDictItem.getDictId());
|
||||
|
||||
@ -12,9 +12,10 @@ import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.constant.enums.RoleIndexConfigEnum;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.jeecg.common.util.MD5Util;
|
||||
import org.jeecg.common.util.Md5Util;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.config.JeeccgBaseConfig;
|
||||
import org.jeecg.modules.base.service.BaseCommonService;
|
||||
import org.jeecg.modules.system.entity.*;
|
||||
import org.jeecg.modules.system.model.SysPermissionTree;
|
||||
import org.jeecg.modules.system.model.TreeModel;
|
||||
@ -23,6 +24,7 @@ import org.jeecg.modules.system.util.PermissionDataUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@ -57,6 +59,12 @@ public class SysPermissionController {
|
||||
@Autowired
|
||||
private JeeccgBaseConfig jeeccgBaseConfig;
|
||||
|
||||
@Autowired
|
||||
private BaseCommonService baseCommonService;
|
||||
|
||||
@Autowired
|
||||
private ISysRoleIndexService sysRoleIndexService;
|
||||
|
||||
/**
|
||||
* 加载数据节点
|
||||
*
|
||||
@ -156,7 +164,7 @@ public class SysPermissionController {
|
||||
query.eq(SysPermission::getDelFlag, CommonConstant.DEL_FLAG_0);
|
||||
query.orderByAsc(SysPermission::getSortNo);
|
||||
List<SysPermission> list = sysPermissionService.list(query);
|
||||
Map<String, List<SysPermissionTree>> listMap = new HashMap<>();
|
||||
Map<String, List<SysPermissionTree>> listMap = new HashMap(5);
|
||||
for (SysPermission item : list) {
|
||||
String pid = item.getParentId();
|
||||
if (parentIdList.contains(pid)) {
|
||||
@ -204,7 +212,7 @@ public class SysPermissionController {
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/getUserPermissionByToken", method = RequestMethod.GET)
|
||||
public Result<?> getUserPermissionByToken() {
|
||||
public Result<?> getUserPermissionByToken(HttpServletRequest request) {
|
||||
Result<JSONObject> result = new Result<JSONObject>();
|
||||
try {
|
||||
//直接获取当前用户不适用前端token
|
||||
@ -411,8 +419,10 @@ public class SysPermissionController {
|
||||
getTreeModelList(treeList, list, null);
|
||||
|
||||
Map<String, Object> resMap = new HashMap<String, Object>();
|
||||
resMap.put("treeList", treeList); // 全部树节点数据
|
||||
resMap.put("ids", ids);// 全部树ids
|
||||
// 全部树节点数据
|
||||
resMap.put("treeList", treeList);
|
||||
// 全部树ids
|
||||
resMap.put("ids", ids);
|
||||
result.setResult(resMap);
|
||||
result.setSuccess(true);
|
||||
} catch (Exception e) {
|
||||
@ -477,6 +487,10 @@ public class SysPermissionController {
|
||||
String permissionIds = json.getString("permissionIds");
|
||||
String lastPermissionIds = json.getString("lastpermissionIds");
|
||||
this.sysRolePermissionService.saveRolePermission(roleId, permissionIds, lastPermissionIds);
|
||||
//update-begin---author:wangshuai ---date:20220316 for:[VUEN-234]用户管理角色授权添加敏感日志------------
|
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
baseCommonService.addLog("修改角色ID: "+roleId+" 的权限配置,操作人: " +loginUser.getUsername() ,CommonConstant.LOG_TYPE_2, 2);
|
||||
//update-end---author:wangshuai ---date:20220316 for:[VUEN-234]用户管理角色授权添加敏感日志------------
|
||||
result.success("保存成功!");
|
||||
log.info("======角色授权成功=====耗时:" + (System.currentTimeMillis() - start) + "毫秒");
|
||||
} catch (Exception e) {
|
||||
@ -654,13 +668,15 @@ public class SysPermissionController {
|
||||
} else if (permission.getMenuType().equals(CommonConstant.MENU_TYPE_0) || permission.getMenuType().equals(CommonConstant.MENU_TYPE_1)) {
|
||||
json.put("id", permission.getId());
|
||||
if (permission.isRoute()) {
|
||||
json.put("route", "1");// 表示生成路由
|
||||
//表示生成路由
|
||||
json.put("route", "1");
|
||||
} else {
|
||||
json.put("route", "0");// 表示不生成路由
|
||||
//表示不生成路由
|
||||
json.put("route", "0");
|
||||
}
|
||||
|
||||
if (isWWWHttpUrl(permission.getUrl())) {
|
||||
json.put("path", MD5Util.MD5Encode(permission.getUrl(), "utf-8"));
|
||||
json.put("path", Md5Util.md5Encode(permission.getUrl(), "utf-8"));
|
||||
} else {
|
||||
json.put("path", permission.getUrl());
|
||||
}
|
||||
|
||||
@ -234,7 +234,8 @@ public class SysPositionController {
|
||||
List<String> errorMessage = new ArrayList<>();
|
||||
int successLines = 0, errorLines = 0;
|
||||
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
|
||||
MultipartFile file = entity.getValue();// 获取上传文件对象
|
||||
// 获取上传文件对象
|
||||
MultipartFile file = entity.getValue();
|
||||
ImportParams params = new ImportParams();
|
||||
params.setTitleRows(2);
|
||||
params.setHeadRows(1);
|
||||
|
||||
@ -214,7 +214,8 @@ public class SysRoleController {
|
||||
@RequestMapping(value = "/checkRoleCode", method = RequestMethod.GET)
|
||||
public Result<Boolean> checkUsername(String id,String roleCode) {
|
||||
Result<Boolean> result = new Result<>();
|
||||
result.setResult(true);//如果此参数为false则程序发生异常
|
||||
//如果此参数为false则程序发生异常
|
||||
result.setResult(true);
|
||||
log.info("--验证角色编码是否唯一---id:"+id+"--roleCode:"+roleCode);
|
||||
try {
|
||||
SysRole role = null;
|
||||
@ -277,7 +278,8 @@ public class SysRoleController {
|
||||
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
||||
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
|
||||
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
|
||||
MultipartFile file = entity.getValue();// 获取上传文件对象
|
||||
// 获取上传文件对象
|
||||
MultipartFile file = entity.getValue();
|
||||
ImportParams params = new ImportParams();
|
||||
params.setTitleRows(2);
|
||||
params.setHeadRows(1);
|
||||
@ -307,7 +309,7 @@ public class SysRoleController {
|
||||
if(list==null || list.size()==0) {
|
||||
return Result.error("未找到权限配置信息");
|
||||
}else {
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
Map<String,Object> map = new HashMap(5);
|
||||
map.put("datarule", list);
|
||||
LambdaQueryWrapper<SysRolePermission> query = new LambdaQueryWrapper<SysRolePermission>()
|
||||
.eq(SysRolePermission::getPermissionId, permissionId)
|
||||
@ -375,9 +377,11 @@ public class SysRoleController {
|
||||
}
|
||||
List<TreeModel> treeList = new ArrayList<>();
|
||||
getTreeModelList(treeList, list, null);
|
||||
Map<String,Object> resMap = new HashMap<String,Object>();
|
||||
resMap.put("treeList", treeList); //全部树节点数据
|
||||
resMap.put("ids", ids);//全部树ids
|
||||
Map<String,Object> resMap = new HashMap(5);
|
||||
//全部树节点数据
|
||||
resMap.put("treeList", treeList);
|
||||
//全部树ids
|
||||
resMap.put("ids", ids);
|
||||
result.setResult(resMap);
|
||||
result.setSuccess(true);
|
||||
} catch (Exception e) {
|
||||
|
||||
@ -0,0 +1,168 @@
|
||||
package org.jeecg.modules.system.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.modules.system.entity.SysRoleIndex;
|
||||
import org.jeecg.modules.system.service.ISysRoleIndexService;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
/**
|
||||
* @Description: 角色首页配置
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2022-03-25
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "角色首页配置")
|
||||
@RestController
|
||||
@RequestMapping("/sys/sysRoleIndex")
|
||||
public class SysRoleIndexController extends JeecgController<SysRoleIndex, ISysRoleIndexService> {
|
||||
@Autowired
|
||||
private ISysRoleIndexService sysRoleIndexService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param sysRoleIndex
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "角色首页配置-分页列表查询")
|
||||
@ApiOperation(value = "角色首页配置-分页列表查询", notes = "角色首页配置-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<?> queryPageList(SysRoleIndex sysRoleIndex,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<SysRoleIndex> queryWrapper = QueryGenerator.initQueryWrapper(sysRoleIndex, req.getParameterMap());
|
||||
Page<SysRoleIndex> page = new Page<SysRoleIndex>(pageNo, pageSize);
|
||||
IPage<SysRoleIndex> pageList = sysRoleIndexService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param sysRoleIndex
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "角色首页配置-添加")
|
||||
@ApiOperation(value = "角色首页配置-添加", notes = "角色首页配置-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@RequestBody SysRoleIndex sysRoleIndex) {
|
||||
sysRoleIndexService.save(sysRoleIndex);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param sysRoleIndex
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "角色首页配置-编辑")
|
||||
@ApiOperation(value = "角色首页配置-编辑", notes = "角色首页配置-编辑")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<?> edit(@RequestBody SysRoleIndex sysRoleIndex) {
|
||||
sysRoleIndexService.updateById(sysRoleIndex);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "角色首页配置-通过id删除")
|
||||
@ApiOperation(value = "角色首页配置-通过id删除", notes = "角色首页配置-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
sysRoleIndexService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "角色首页配置-批量删除")
|
||||
@ApiOperation(value = "角色首页配置-批量删除", notes = "角色首页配置-批量删除")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
this.sysRoleIndexService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "角色首页配置-通过id查询")
|
||||
@ApiOperation(value = "角色首页配置-通过id查询", notes = "角色首页配置-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<?> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
SysRoleIndex sysRoleIndex = sysRoleIndexService.getById(id);
|
||||
return Result.OK(sysRoleIndex);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param sysRoleIndex
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, SysRoleIndex sysRoleIndex) {
|
||||
return super.exportXls(request, sysRoleIndex, SysRoleIndex.class, "角色首页配置");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, SysRoleIndex.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过code查询
|
||||
*
|
||||
* @param roleCode
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "角色首页配置-通过code查询")
|
||||
@ApiOperation(value = "角色首页配置-通过code查询", notes = "角色首页配置-通过code查询")
|
||||
@GetMapping(value = "/queryByCode")
|
||||
public Result<?> queryByCode(@RequestParam(name = "roleCode", required = true) String roleCode) {
|
||||
SysRoleIndex sysRoleIndex = sysRoleIndexService.getOne(new LambdaQueryWrapper<SysRoleIndex>().eq(SysRoleIndex::getRoleCode, roleCode));
|
||||
return Result.OK(sysRoleIndex);
|
||||
}
|
||||
}
|
||||
@ -22,6 +22,7 @@ import java.util.*;
|
||||
|
||||
/**
|
||||
* 租户配置信息
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@ -134,7 +135,7 @@ public class SysTenantController {
|
||||
// 过滤掉已被引用的租户
|
||||
List<Integer> idList = new ArrayList<>();
|
||||
for (String id : ls) {
|
||||
int userCount = sysTenantService.countUserLinkTenant(id);
|
||||
Long userCount = sysTenantService.countUserLinkTenant(id);
|
||||
if (userCount == 0) {
|
||||
idList.add(Integer.parseInt(id));
|
||||
}
|
||||
@ -200,7 +201,7 @@ public class SysTenantController {
|
||||
try {
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
String tenantIds = sysUser.getRelTenantIds();
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
Map<String,Object> map = new HashMap(5);
|
||||
if (oConvertUtils.isNotEmpty(tenantIds)) {
|
||||
List<Integer> tenantIdList = new ArrayList<>();
|
||||
for(String id: tenantIds.split(",")){
|
||||
|
||||
@ -19,6 +19,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* minio文件上传示例
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@ -45,8 +46,10 @@ public class SysUploadController {
|
||||
bizPath = "";
|
||||
}
|
||||
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
||||
MultipartFile file = multipartRequest.getFile("file");// 获取上传文件对象
|
||||
String orgName = file.getOriginalFilename();// 获取文件名
|
||||
// 获取上传文件对象
|
||||
MultipartFile file = multipartRequest.getFile("file");
|
||||
// 获取文件名
|
||||
String orgName = file.getOriginalFilename();
|
||||
orgName = CommonUtils.getFileName(orgName);
|
||||
String file_url = MinioUtil.upload(file,bizPath);
|
||||
if(oConvertUtils.isEmpty(file_url)){
|
||||
|
||||
@ -236,7 +236,8 @@ public class SysUserAgentController {
|
||||
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
||||
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
|
||||
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
|
||||
MultipartFile file = entity.getValue();// 获取上传文件对象
|
||||
// 获取上传文件对象
|
||||
MultipartFile file = entity.getValue();
|
||||
ImportParams params = new ImportParams();
|
||||
params.setTitleRows(2);
|
||||
params.setHeadRows(1);
|
||||
|
||||
@ -42,7 +42,6 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
@ -61,9 +60,7 @@ import java.util.stream.Collectors;
|
||||
@RestController
|
||||
@RequestMapping("/sys/user")
|
||||
public class SysUserController {
|
||||
@Autowired
|
||||
private ISysBaseAPI sysBaseAPI;
|
||||
|
||||
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
@ -91,7 +88,7 @@ public class SysUserController {
|
||||
@Value("${jeecg.path.upload}")
|
||||
private String upLoadPath;
|
||||
|
||||
@Resource
|
||||
@Autowired
|
||||
private BaseCommonService baseCommonService;
|
||||
|
||||
/**
|
||||
@ -117,7 +114,13 @@ public class SysUserController {
|
||||
query.eq(SysUserDepart::getDepId,departId);
|
||||
List<SysUserDepart> list = sysUserDepartService.list(query);
|
||||
List<String> userIds = list.stream().map(SysUserDepart::getUserId).collect(Collectors.toList());
|
||||
queryWrapper.in("id",userIds);
|
||||
//update-begin---author:wangshuai ---date:20220322 for:[issues/I4XTYB]查询用户时,当部门id 下没有分配用户时接口报错------------
|
||||
if(oConvertUtils.listIsNotEmpty(userIds)){
|
||||
queryWrapper.in("id",userIds);
|
||||
}else{
|
||||
return Result.OK();
|
||||
}
|
||||
//update-end---author:wangshuai ---date:20220322 for:[issues/I4XTYB]查询用户时,当部门id 下没有分配用户时接口报错------------
|
||||
}
|
||||
//用户ID
|
||||
String code = req.getParameter("code");
|
||||
@ -173,6 +176,7 @@ public class SysUserController {
|
||||
user.setDelFlag(CommonConstant.DEL_FLAG_0);
|
||||
// 保存用户走一个service 保证事务
|
||||
sysUserService.saveUser(user, selectedRoles, selectedDeparts);
|
||||
baseCommonService.addLog("添加用户,username: " +user.getUsername() ,CommonConstant.LOG_TYPE_2, 2);
|
||||
result.success("添加成功!");
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
@ -188,7 +192,7 @@ public class SysUserController {
|
||||
Result<SysUser> result = new Result<SysUser>();
|
||||
try {
|
||||
SysUser sysUser = sysUserService.getById(jsonObject.getString("id"));
|
||||
baseCommonService.addLog("编辑用户,id: " +jsonObject.getString("id") ,CommonConstant.LOG_TYPE_2, 2);
|
||||
baseCommonService.addLog("编辑用户,username: " +sysUser.getUsername() ,CommonConstant.LOG_TYPE_2, 2);
|
||||
if(sysUser==null) {
|
||||
result.error500("未找到对应实体");
|
||||
}else {
|
||||
@ -336,6 +340,10 @@ public class SysUserController {
|
||||
return Result.error("用户不存在!");
|
||||
}
|
||||
sysUser.setId(u.getId());
|
||||
//update-begin---author:wangshuai ---date:20220316 for:[VUEN-234]修改密码添加敏感日志------------
|
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
baseCommonService.addLog("修改用户 "+sysUser.getUsername()+" 的密码,操作人: " +loginUser.getUsername() ,CommonConstant.LOG_TYPE_2, 2);
|
||||
//update-end---author:wangshuai ---date:20220316 for:[VUEN-234]修改密码添加敏感日志------------
|
||||
return sysUserService.changePassword(sysUser);
|
||||
}
|
||||
|
||||
@ -586,6 +594,10 @@ public class SysUserController {
|
||||
if(user==null) {
|
||||
return Result.error("用户不存在!");
|
||||
}
|
||||
//update-begin---author:wangshuai ---date:20220316 for:[VUEN-234]修改密码添加敏感日志------------
|
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
baseCommonService.addLog("修改密码,username: " +loginUser.getUsername() ,CommonConstant.LOG_TYPE_2, 2);
|
||||
//update-end---author:wangshuai ---date:20220316 for:[VUEN-234]修改密码添加敏感日志------------
|
||||
return sysUserService.resetPassword(username,oldpassword,password,confirmpassword);
|
||||
}
|
||||
|
||||
@ -882,7 +894,7 @@ public class SysUserController {
|
||||
try {
|
||||
LoginUser sysUser = (LoginUser)SecurityUtils.getSubject().getPrincipal();
|
||||
List<SysDepart> list = this.sysDepartService.queryUserDeparts(sysUser.getId());
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
Map<String,Object> map = new HashMap(5);
|
||||
map.put("list", list);
|
||||
map.put("orgCode", sysUser.getOrgCode());
|
||||
result.setSuccess(true);
|
||||
@ -1030,7 +1042,7 @@ public class SysUserController {
|
||||
LambdaQueryWrapper<SysUser> query = new LambdaQueryWrapper<>();
|
||||
query.eq(SysUser::getPhone,phone);
|
||||
SysUser user = sysUserService.getOne(query);
|
||||
Map<String,String> map = new HashMap<>();
|
||||
Map<String,String> map = new HashMap(5);
|
||||
map.put("smscode",smscode);
|
||||
map.put("username",user.getUsername());
|
||||
result.setResult(map);
|
||||
@ -1076,6 +1088,9 @@ public class SysUserController {
|
||||
String passwordEncode = PasswordUtil.encrypt(sysUser.getUsername(), password, salt);
|
||||
sysUser.setPassword(passwordEncode);
|
||||
this.sysUserService.updateById(sysUser);
|
||||
//update-begin---author:wangshuai ---date:20220316 for:[VUEN-234]密码重置添加敏感日志------------
|
||||
baseCommonService.addLog("重置 "+username+" 的密码,操作人: " +sysUser.getUsername() ,CommonConstant.LOG_TYPE_2, 2);
|
||||
//update-end---author:wangshuai ---date:20220316 for:[VUEN-234]密码重置添加敏感日志------------
|
||||
result.setSuccess(true);
|
||||
result.setMessage("密码重置完成!");
|
||||
return result;
|
||||
@ -1297,7 +1312,7 @@ public class SysUserController {
|
||||
@GetMapping("/queryChildrenByUsername")
|
||||
public Result queryChildrenByUsername(@RequestParam("userId") String userId) {
|
||||
//获取用户信息
|
||||
Map<String,Object> map=new HashMap<String,Object>();
|
||||
Map<String,Object> map=new HashMap(5);
|
||||
SysUser sysUser = sysUserService.getById(userId);
|
||||
String username = sysUser.getUsername();
|
||||
Integer identity = sysUser.getUserIdentity();
|
||||
|
||||
@ -7,13 +7,13 @@ import org.apache.shiro.SecurityUtils;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.constant.CacheConstant;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
import org.jeecg.common.system.util.JwtUtil;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.jeecg.common.util.RedisUtil;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.base.service.BaseCommonService;
|
||||
import org.jeecg.modules.system.service.ISysUserService;
|
||||
import org.jeecg.modules.system.service.impl.SysBaseApiImpl;
|
||||
import org.jeecg.modules.system.vo.SysUserOnlineVO;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -39,15 +39,12 @@ public class SysUserOnlineController {
|
||||
|
||||
@Autowired
|
||||
private RedisUtil redisUtil;
|
||||
|
||||
@Autowired
|
||||
public RedisTemplate redisTemplate;
|
||||
|
||||
@Autowired
|
||||
public ISysUserService userService;
|
||||
|
||||
@Autowired
|
||||
private ISysBaseAPI sysBaseAPI;
|
||||
private SysBaseApiImpl sysBaseApi;
|
||||
|
||||
@Resource
|
||||
private BaseCommonService baseCommonService;
|
||||
@ -63,7 +60,7 @@ public class SysUserOnlineController {
|
||||
SysUserOnlineVO online = new SysUserOnlineVO();
|
||||
online.setToken(token);
|
||||
//TODO 改成一次性查询
|
||||
LoginUser loginUser = sysBaseAPI.getUserByName(JwtUtil.getUsername(token));
|
||||
LoginUser loginUser = sysBaseApi.getUserByName(JwtUtil.getUsername(token));
|
||||
if (loginUser != null) {
|
||||
//update-begin---author:wangshuai ---date:20220104 for:[JTC-382]在线用户查询无效------------
|
||||
//验证用户名是否与传过来的用户名相同
|
||||
@ -113,7 +110,7 @@ public class SysUserOnlineController {
|
||||
return Result.error("退出登录失败!");
|
||||
}
|
||||
String username = JwtUtil.getUsername(online.getToken());
|
||||
LoginUser sysUser = sysBaseAPI.getUserByName(username);
|
||||
LoginUser sysUser = sysBaseApi.getUserByName(username);
|
||||
if(sysUser!=null) {
|
||||
baseCommonService.addLog("强制: "+sysUser.getRealname()+"退出成功!", CommonConstant.LOG_TYPE_1, null,sysUser);
|
||||
log.info(" 强制 "+sysUser.getRealname()+"退出成功! ");
|
||||
|
||||
@ -19,6 +19,7 @@ import java.util.Map;
|
||||
|
||||
/**
|
||||
* 第三方App对接
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController("thirdAppController")
|
||||
@ -38,7 +39,7 @@ public class ThirdAppController {
|
||||
*/
|
||||
@GetMapping("/getEnabledType")
|
||||
public Result getEnabledType() {
|
||||
Map<String, Boolean> enabledMap = new HashMap<>();
|
||||
Map<String, Boolean> enabledMap = new HashMap(5);
|
||||
enabledMap.put("wechatEnterprise", thirdAppConfig.isWechatEnterpriseEnabled());
|
||||
enabledMap.put("dingtalk", thirdAppConfig.isDingtalkEnabled());
|
||||
return Result.OK(enabledMap);
|
||||
|
||||
@ -198,10 +198,17 @@ public class ThirdLoginController {
|
||||
String token = JwtUtil.sign(user.getUsername(), user.getPassword());
|
||||
redisUtil.set(CommonConstant.PREFIX_USER_TOKEN + token, token);
|
||||
// 设置超时时间
|
||||
redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, JwtUtil.EXPIRE_TIME / 1000);
|
||||
redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, JwtUtil.EXPIRE_TIME * 2 / 1000);
|
||||
return token;
|
||||
}
|
||||
|
||||
/**
|
||||
* 第三方登录回调接口
|
||||
* @param token
|
||||
* @param thirdType
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@RequestMapping(value = "/getLoginUser/{token}/{thirdType}", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
@ -251,20 +258,21 @@ public class ThirdLoginController {
|
||||
Result<String> result = new Result<String>();
|
||||
String phone = jsonObject.getString("mobile");
|
||||
String thirdUserUuid = jsonObject.getString("thirdUserUuid");
|
||||
// 校验验证码
|
||||
String captcha = jsonObject.getString("captcha");
|
||||
Object captchaCache = redisUtil.get(phone);
|
||||
if (oConvertUtils.isEmpty(captcha) || !captcha.equals(captchaCache)) {
|
||||
result.setMessage("验证码错误");
|
||||
result.setSuccess(false);
|
||||
return result;
|
||||
}
|
||||
//校验用户有效性
|
||||
SysUser sysUser = sysUserService.getUserByPhone(phone);
|
||||
if(sysUser != null){
|
||||
// 存在用户,直接绑定
|
||||
sysThirdAccountService.updateThirdUserId(sysUser,thirdUserUuid);
|
||||
}else{
|
||||
// 不存在手机号,创建用户
|
||||
String smscode = jsonObject.getString("captcha");
|
||||
Object code = redisUtil.get(phone);
|
||||
if (!smscode.equals(code)) {
|
||||
result.setMessage("手机验证码错误");
|
||||
result.setSuccess(false);
|
||||
return result;
|
||||
}
|
||||
//创建用户
|
||||
sysUser = sysThirdAccountService.createUser(phone,thirdUserUuid);
|
||||
}
|
||||
String token = saveToken(sysUser);
|
||||
|
||||
@ -13,6 +13,10 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @Description: 系统数据日志
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@ -20,17 +24,52 @@ public class SysDataLog implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id; //id'
|
||||
private String createBy; //创建人登录名称
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 创建人登录名称
|
||||
*/
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建日期
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime; //创建日期
|
||||
private String updateBy; //更新人登录名称
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新人登录名称
|
||||
*/
|
||||
private String updateBy;
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime; //更新日期
|
||||
private String dataTable; //表名
|
||||
private String dataId; //数据ID
|
||||
private String dataContent; //数据内容
|
||||
private String dataVersion; //版本号
|
||||
|
||||
/**
|
||||
* 更新日期
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 表名
|
||||
*/
|
||||
private String dataTable;
|
||||
|
||||
/**
|
||||
* 数据ID
|
||||
*/
|
||||
private String dataId;
|
||||
|
||||
/**
|
||||
* 数据内容
|
||||
*/
|
||||
private String dataContent;
|
||||
|
||||
/**
|
||||
* 版本号
|
||||
*/
|
||||
private String dataVersion;
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package org.jeecg.modules.system.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
@ -85,6 +86,15 @@ public class SysDepart implements Serializable {
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
//update-begin---author:wangshuai ---date:20200308 for:[JTC-119]在部门管理菜单下设置部门负责人,新增字段负责人ids和旧的负责人ids
|
||||
/**部门负责人的ids*/
|
||||
@TableField(exist = false)
|
||||
private String directorUserIds;
|
||||
/**旧的部门负责人的ids(用于比较删除和新增)*/
|
||||
@TableField(exist = false)
|
||||
private String oldDirectorUserIds;
|
||||
//update-end---author:wangshuai ---date:20200308 for:[JTC-119]新增字段负责人ids和旧的负责人ids
|
||||
|
||||
/**
|
||||
* 重写equals方法
|
||||
|
||||
@ -0,0 +1,75 @@
|
||||
package org.jeecg.modules.system.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
/**
|
||||
* @Description: 角色首页配置
|
||||
* @Author: liusq
|
||||
* @Date: 2022-03-25
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("sys_role_index")
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="sys_role_index对象", description="角色首页配置")
|
||||
public class SysRoleIndex {
|
||||
|
||||
/**id*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private java.lang.String id;
|
||||
/**角色编码*/
|
||||
@Excel(name = "角色编码", width = 15)
|
||||
@ApiModelProperty(value = "角色编码")
|
||||
private java.lang.String roleCode;
|
||||
/**路由地址*/
|
||||
@Excel(name = "路由地址", width = 15)
|
||||
@ApiModelProperty(value = "路由地址")
|
||||
private java.lang.String url;
|
||||
/**优先级*/
|
||||
@Excel(name = "优先级", width = 15)
|
||||
@ApiModelProperty(value = "优先级")
|
||||
private java.lang.Integer priority;
|
||||
/**路由地址*/
|
||||
@Excel(name = "状态", width = 15)
|
||||
@ApiModelProperty(value = "状态")
|
||||
private java.lang.String status;
|
||||
/**创建人登录名称*/
|
||||
@Excel(name = "创建人登录名称", width = 15)
|
||||
@ApiModelProperty(value = "创建人登录名称")
|
||||
private java.lang.String createBy;
|
||||
/**创建日期*/
|
||||
@Excel(name = "创建日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private java.util.Date createTime;
|
||||
/**更新人登录名称*/
|
||||
@Excel(name = "更新人登录名称", width = 15)
|
||||
@ApiModelProperty(value = "更新人登录名称")
|
||||
private java.lang.String updateBy;
|
||||
/**更新日期*/
|
||||
@Excel(name = "更新日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新日期")
|
||||
private java.util.Date updateTime;
|
||||
/**所属部门*/
|
||||
@Excel(name = "所属部门", width = 15)
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private java.lang.String sysOrgCode;
|
||||
}
|
||||
@ -11,6 +11,7 @@ import java.util.Date;
|
||||
|
||||
/**
|
||||
* 租户信息
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@Data
|
||||
@TableName("sys_tenant")
|
||||
|
||||
@ -7,6 +7,11 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Description: 用户部门
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@Data
|
||||
@TableName("sys_user_depart")
|
||||
public class SysUserDepart implements Serializable {
|
||||
|
||||
@ -16,7 +16,13 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
*/
|
||||
public interface SysAnnouncementMapper extends BaseMapper<SysAnnouncement> {
|
||||
|
||||
|
||||
/**
|
||||
* 通过消息类型和用户id获取系统通告
|
||||
* @param page
|
||||
* @param userId 用户id
|
||||
* @param msgCategory 消息类型
|
||||
* @return
|
||||
*/
|
||||
List<SysAnnouncement> querySysCementListByUserId(Page<SysAnnouncement> page, @Param("userId")String userId,@Param("msgCategory")String msgCategory);
|
||||
|
||||
}
|
||||
|
||||
@ -17,13 +17,17 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
*/
|
||||
public interface SysAnnouncementSendMapper extends BaseMapper<SysAnnouncementSend> {
|
||||
|
||||
/**
|
||||
* 通过用户id查询 用户通告阅读标记表
|
||||
* @param userId 用户id
|
||||
* @return
|
||||
*/
|
||||
public List<String> queryByUserId(@Param("userId") String userId);
|
||||
|
||||
/**
|
||||
* @功能:获取我的消息
|
||||
* 获取我的消息
|
||||
* @param announcementSendModel
|
||||
* @param pageSize
|
||||
* @param pageNo
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
public List<AnnouncementSendModel> getMyAnnouncementSendList(Page<AnnouncementSendModel> page,@Param("announcementSendModel") AnnouncementSendModel announcementSendModel);
|
||||
|
||||
@ -19,12 +19,18 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
public interface SysCategoryMapper extends BaseMapper<SysCategory> {
|
||||
|
||||
/**
|
||||
* 根据父级ID查询树节点数据
|
||||
* 根据父级ID查询树节点数据
|
||||
* @param pid
|
||||
* @param query
|
||||
* @return
|
||||
*/
|
||||
public List<TreeSelectModel> queryListByPid(@Param("pid") String pid,@Param("query") Map<String, String> query);
|
||||
|
||||
/**
|
||||
* 通过code查询分类字典表
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
@Select("SELECT ID FROM sys_category WHERE CODE = #{code,jdbcType=VARCHAR}")
|
||||
public String queryIdByCode(@Param("code") String code);
|
||||
|
||||
|
||||
@ -5,6 +5,10 @@ import org.jeecg.modules.system.entity.SysDataLog;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 系统数据日志Mapper接口
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
public interface SysDataLogMapper extends BaseMapper<SysDataLog>{
|
||||
/**
|
||||
* 通过表名及数据Id获取最大版本
|
||||
|
||||
@ -21,6 +21,8 @@ public interface SysDepartMapper extends BaseMapper<SysDepart> {
|
||||
|
||||
/**
|
||||
* 根据用户ID查询部门集合
|
||||
* @param userId 用户id
|
||||
* @return List<SysDepart>
|
||||
*/
|
||||
public List<SysDepart> queryUserDeparts(@Param("userId") String userId);
|
||||
|
||||
@ -32,9 +34,19 @@ public interface SysDepartMapper extends BaseMapper<SysDepart> {
|
||||
*/
|
||||
public List<SysDepart> queryDepartsByUsername(@Param("username") String username);
|
||||
|
||||
/**
|
||||
* 通过部门编码获取部门id
|
||||
* @param orgCode 部门编码
|
||||
* @return String
|
||||
*/
|
||||
@Select("select id from sys_depart where org_code=#{orgCode}")
|
||||
public String queryDepartIdByOrgCode(@Param("orgCode") String orgCode);
|
||||
|
||||
/**
|
||||
* 通过部门id 查询部门id,父id
|
||||
* @param departId 部门id
|
||||
* @return
|
||||
*/
|
||||
@Select("select id,parent_id from sys_depart where id=#{departId}")
|
||||
public SysDepart getParentDepartId(@Param("departId") String departId);
|
||||
|
||||
@ -52,6 +64,11 @@ public interface SysDepartMapper extends BaseMapper<SysDepart> {
|
||||
*/
|
||||
List<String> getSubDepIdsByOrgCodes(@org.apache.ibatis.annotations.Param("orgCodes") String[] orgCodes);
|
||||
|
||||
/**
|
||||
* 根据parent_id查询下级部门
|
||||
* @param parentId 父id
|
||||
* @return List<SysDepart>
|
||||
*/
|
||||
List<SysDepart> queryTreeListByPid(@Param("parentId") String parentId);
|
||||
/**
|
||||
* 根据id下级部门数量
|
||||
|
||||
@ -15,6 +15,12 @@ import java.util.List;
|
||||
* @since 2018-12-28
|
||||
*/
|
||||
public interface SysDictItemMapper extends BaseMapper<SysDictItem> {
|
||||
|
||||
/**
|
||||
* 通过字典id查询字典项
|
||||
* @param mainId 字典id
|
||||
* @return
|
||||
*/
|
||||
@Select("SELECT * FROM sys_dict_item WHERE DICT_ID = #{mainId} order by sort_order asc, item_value asc")
|
||||
public List<SysDictItem> selectItemsByMainId(String mainId);
|
||||
}
|
||||
|
||||
@ -27,14 +27,26 @@ import java.util.Map;
|
||||
public interface SysDictMapper extends BaseMapper<SysDict> {
|
||||
|
||||
/**
|
||||
* 重复检查SQL
|
||||
* 重复检查SQL
|
||||
* @param duplicateCheckVo
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
public Long duplicateCheckCountSql(DuplicateCheckVo duplicateCheckVo);
|
||||
|
||||
/**
|
||||
* 重复校验 sql语句
|
||||
* @param duplicateCheckVo
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
public Long duplicateCheckCountSqlNoDataId(DuplicateCheckVo duplicateCheckVo);
|
||||
|
||||
|
||||
/**
|
||||
* 通过字典code获取字典数据
|
||||
* @param code 字典code
|
||||
* @return List<DictModel>
|
||||
*/
|
||||
public List<DictModel> queryDictItemsByCode(@Param("code") String code);
|
||||
|
||||
/**
|
||||
@ -53,16 +65,44 @@ public interface SysDictMapper extends BaseMapper<SysDict> {
|
||||
*/
|
||||
public List<DictModelMany> queryDictItemsByCodeList(@Param("dictCodeList") List<String> dictCodeList);
|
||||
|
||||
/**
|
||||
* 通过查询指定table的 text code 获取字典
|
||||
* @param table
|
||||
* @param text
|
||||
* @param code
|
||||
* @return List<DictModel>
|
||||
*/
|
||||
@Deprecated
|
||||
public List<DictModel> queryTableDictItemsByCode(@Param("table") String table,@Param("text") String text,@Param("code") String code);
|
||||
|
||||
/**
|
||||
* 通过查询指定table的 text code 获取字典(指定查询条件)
|
||||
* @param table
|
||||
* @param text
|
||||
* @param code
|
||||
* @param filterSql
|
||||
* @return List<DictModel>
|
||||
*/
|
||||
@Deprecated
|
||||
public List<DictModel> queryTableDictItemsByCodeAndFilter(@Param("table") String table,@Param("text") String text,@Param("code") String code,@Param("filterSql") String filterSql);
|
||||
|
||||
/**
|
||||
* 通过查询指定table的 text code 获取字典
|
||||
* @param table
|
||||
* @param key
|
||||
* @param value
|
||||
* @return List<Map<String,String>>
|
||||
*/
|
||||
@Deprecated
|
||||
@Select("select ${key} as \"label\",${value} as \"value\" from ${table}")
|
||||
public List<Map<String,String>> getDictByTableNgAlain(@Param("table") String table, @Param("key") String key, @Param("value") String value);
|
||||
|
||||
/**
|
||||
* 通过字典code获取字典数据
|
||||
* @param code
|
||||
* @param key
|
||||
* @return
|
||||
*/
|
||||
public String queryDictTextByKey(@Param("code") String code,@Param("key") String key);
|
||||
|
||||
/**
|
||||
@ -73,6 +113,14 @@ public interface SysDictMapper extends BaseMapper<SysDict> {
|
||||
*/
|
||||
List<DictModelMany> queryManyDictByKeys(@Param("dictCodeList") List<String> dictCodeList, @Param("keys") List<String> keys);
|
||||
|
||||
/**
|
||||
* 通过查询指定table的 text code key 获取字典值
|
||||
* @param table
|
||||
* @param text
|
||||
* @param code
|
||||
* @param key
|
||||
* @return String
|
||||
*/
|
||||
@Deprecated
|
||||
public String queryTableDictTextByKey(@Param("table") String table,@Param("text") String text,@Param("code") String code,@Param("key") String key);
|
||||
|
||||
@ -88,6 +136,14 @@ public interface SysDictMapper extends BaseMapper<SysDict> {
|
||||
@Deprecated
|
||||
List<DictModel> queryTableDictTextByKeys(@Param("table") String table, @Param("text") String text, @Param("code") String code, @Param("keys") List<String> keys);
|
||||
|
||||
/**
|
||||
* 通过查询指定table的 text code key 获取字典值,包含value
|
||||
* @param table
|
||||
* @param text
|
||||
* @param code
|
||||
* @param keyArray
|
||||
* @return List<DictModel>
|
||||
*/
|
||||
@Deprecated
|
||||
public List<DictModel> queryTableDictByKeys(@Param("table") String table, @Param("text") String text, @Param("code") String code, @Param("keyArray") String[] keyArray);
|
||||
|
||||
@ -133,6 +189,8 @@ public interface SysDictMapper extends BaseMapper<SysDict> {
|
||||
* @param code
|
||||
* @param pid
|
||||
* @param hasChildField
|
||||
* @param query
|
||||
* @param pidField
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
|
||||
@ -20,7 +20,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
public interface SysLogMapper extends BaseMapper<SysLog> {
|
||||
|
||||
/**
|
||||
* @功能:清空所有日志记录
|
||||
* 清空所有日志记录
|
||||
*/
|
||||
public void removeAll();
|
||||
|
||||
@ -34,14 +34,16 @@ public interface SysLogMapper extends BaseMapper<SysLog> {
|
||||
//update-begin--Author:zhangweijian Date:20190428 for:传入开始时间,结束时间参数
|
||||
/**
|
||||
* 获取系统今日访问次数
|
||||
*
|
||||
* @param dayStart 开始时间
|
||||
* @param dayEnd 结束时间
|
||||
* @return Long
|
||||
*/
|
||||
Long findTodayVisitCount(@Param("dayStart") Date dayStart, @Param("dayEnd") Date dayEnd);
|
||||
|
||||
/**
|
||||
* 获取系统今日访问 IP数
|
||||
*
|
||||
* @param dayStart 开始时间
|
||||
* @param dayEnd 结束时间
|
||||
* @return Long
|
||||
*/
|
||||
Long findTodayIp(@Param("dayStart") Date dayStart, @Param("dayEnd") Date dayEnd);
|
||||
@ -51,6 +53,7 @@ public interface SysLogMapper extends BaseMapper<SysLog> {
|
||||
* 首页:根据时间统计访问数量/ip数量
|
||||
* @param dayStart
|
||||
* @param dayEnd
|
||||
* @param dbType
|
||||
* @return
|
||||
*/
|
||||
List<Map<String,Object>> findVisitCount(@Param("dayStart") Date dayStart, @Param("dayEnd") Date dayEnd, @Param("dbType") String dbType);
|
||||
|
||||
@ -27,18 +27,24 @@ public interface SysPermissionMapper extends BaseMapper<SysPermission> {
|
||||
public List<TreeModel> queryListByParentId(@Param("parentId") String parentId);
|
||||
|
||||
/**
|
||||
* 根据用户查询用户权限
|
||||
* 根据用户查询用户权限
|
||||
* @param username 用户账户名称
|
||||
* @return List<SysPermission>
|
||||
*/
|
||||
public List<SysPermission> queryByUser(@Param("username") String username);
|
||||
|
||||
/**
|
||||
* 修改菜单状态字段: 是否子节点
|
||||
* 修改菜单状态字段: 是否子节点
|
||||
* @param id 菜单id
|
||||
* @param leaf 叶子节点
|
||||
* @return int
|
||||
*/
|
||||
@Update("update sys_permission set is_leaf=#{leaf} where id = #{id}")
|
||||
public int setMenuLeaf(@Param("id") String id,@Param("leaf") int leaf);
|
||||
|
||||
/**
|
||||
* 获取模糊匹配规则的数据权限URL
|
||||
* 获取模糊匹配规则的数据权限URL
|
||||
* @return List<String>
|
||||
*/
|
||||
@Select("SELECT url FROM sys_permission WHERE del_flag = 0 and menu_type = 2 and url like '%*%'")
|
||||
public List<String> queryPermissionUrlWithStar();
|
||||
|
||||
@ -0,0 +1,17 @@
|
||||
package org.jeecg.modules.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.jeecg.modules.system.entity.SysRoleIndex;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 角色首页配置
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2022-03-25
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface SysRoleIndexMapper extends BaseMapper<SysRoleIndex> {
|
||||
|
||||
}
|
||||
@ -18,18 +18,19 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
public interface SysRoleMapper extends BaseMapper<SysRole> {
|
||||
|
||||
/**
|
||||
* @Description: 删除角色与用户关系
|
||||
* @Author scott
|
||||
* @Date 2019/12/13 16:12
|
||||
* @Description: 删除角色与用户关系
|
||||
*/
|
||||
@Delete("delete from sys_user_role where role_id = #{roleId}")
|
||||
void deleteRoleUserRelation(@Param("roleId") String roleId);
|
||||
|
||||
|
||||
/**
|
||||
* @Author scott
|
||||
* @Date 2019/12/13 16:12
|
||||
* @Description: 删除角色与权限关系
|
||||
* @Author scott
|
||||
* @param roleId
|
||||
* @Date 2019/12/13 16:12
|
||||
*/
|
||||
@Delete("delete from sys_role_permission where role_id = #{roleId}")
|
||||
void deleteRolePermissionRelation(@Param("roleId") String roleId);
|
||||
|
||||
@ -3,6 +3,10 @@ package org.jeecg.modules.system.mapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.jeecg.modules.system.entity.SysTenant;
|
||||
|
||||
/**
|
||||
* @Description: 租户mapper接口
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
public interface SysTenantMapper extends BaseMapper<SysTenant> {
|
||||
|
||||
}
|
||||
|
||||
@ -8,8 +8,17 @@ import org.jeecg.modules.system.entity.SysUser;
|
||||
import org.jeecg.modules.system.entity.SysUserDepart;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 用户部门mapper接口
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
public interface SysUserDepartMapper extends BaseMapper<SysUserDepart>{
|
||||
|
||||
|
||||
/**
|
||||
* 通过用户id查询部门用户
|
||||
* @param userId 用户id
|
||||
* @return List<SysUserDepart>
|
||||
*/
|
||||
List<SysUserDepart> getUserDepartByUid(@Param("userId") String userId);
|
||||
|
||||
/**
|
||||
|
||||
@ -32,6 +32,7 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
|
||||
* 根据部门Id查询用户信息
|
||||
* @param page
|
||||
* @param departId
|
||||
* @param username 用户登录账户
|
||||
* @return
|
||||
*/
|
||||
IPage<SysUser> getUserByDepId(Page page, @Param("departId") String departId, @Param("username") String username);
|
||||
@ -47,6 +48,7 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
|
||||
* 根据部门Ids,查询部门下用户信息
|
||||
* @param page
|
||||
* @param departIds
|
||||
* @param username 用户登录账户
|
||||
* @return
|
||||
*/
|
||||
IPage<SysUser> getUserByDepIds(Page page, @Param("departIds") List<String> departIds, @Param("username") String username);
|
||||
@ -54,7 +56,8 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
|
||||
/**
|
||||
* 根据角色Id查询用户信息
|
||||
* @param page
|
||||
* @param
|
||||
* @param roleId 角色id
|
||||
* @param username 用户登录账户
|
||||
* @return
|
||||
*/
|
||||
IPage<SysUser> getUserByRoleId(Page page, @Param("roleId") String roleId, @Param("username") String username);
|
||||
@ -62,7 +65,7 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
|
||||
/**
|
||||
* 根据用户名设置部门ID
|
||||
* @param username
|
||||
* @param departId
|
||||
* @param orgCode
|
||||
*/
|
||||
void updateUserDepart(@Param("username") String username,@Param("orgCode") String orgCode);
|
||||
|
||||
@ -102,41 +105,55 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
|
||||
Integer getUserByOrgCodeTotal(@Param("orgCode") String orgCode, @Param("userParams") SysUser userParams);
|
||||
|
||||
/**
|
||||
* 批量删除角色与用户关系
|
||||
* @Author scott
|
||||
* @Date 2019/12/13 16:10
|
||||
* @Description: 批量删除角色与用户关系
|
||||
* @param roleIdArray
|
||||
*/
|
||||
void deleteBathRoleUserRelation(@Param("roleIdArray") String[] roleIdArray);
|
||||
|
||||
/**
|
||||
* 批量删除角色与权限关系
|
||||
* @Author scott
|
||||
* @Date 2019/12/13 16:10
|
||||
* @Description: 批量删除角色与权限关系
|
||||
* @param roleIdArray
|
||||
*/
|
||||
void deleteBathRolePermissionRelation(@Param("roleIdArray") String[] roleIdArray);
|
||||
|
||||
/**
|
||||
* 查询被逻辑删除的用户
|
||||
* @param wrapper
|
||||
* @return List<SysUser>
|
||||
*/
|
||||
List<SysUser> selectLogicDeleted(@Param(Constants.WRAPPER) Wrapper<SysUser> wrapper);
|
||||
|
||||
/**
|
||||
* 还原被逻辑删除的用户
|
||||
* @param userIds 用户id
|
||||
* @param entity
|
||||
* @return int
|
||||
*/
|
||||
int revertLogicDeleted(@Param("userIds") String userIds, @Param("entity") SysUser entity);
|
||||
|
||||
/**
|
||||
* 彻底删除被逻辑删除的用户
|
||||
* @param userIds 多个用户id
|
||||
* @return int
|
||||
*/
|
||||
int deleteLogicDeleted(@Param("userIds") String userIds);
|
||||
|
||||
/** 更新空字符串为null【此写法有sql注入风险,禁止随便用】 */
|
||||
/**
|
||||
* 更新空字符串为null【此写法有sql注入风险,禁止随便用】
|
||||
* @param fieldName
|
||||
* @return int
|
||||
*/
|
||||
@Deprecated
|
||||
int updateNullByEmptyString(@Param("fieldName") String fieldName);
|
||||
|
||||
/**
|
||||
* 根据部门Ids,查询部门下用户信息
|
||||
* @param departIds
|
||||
* @param username 用户账户名称
|
||||
* @return
|
||||
*/
|
||||
List<SysUser> queryByDepIds(@Param("departIds")List<String> departIds,@Param("username") String username);
|
||||
|
||||
@ -16,9 +16,19 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
*/
|
||||
public interface SysUserRoleMapper extends BaseMapper<SysUserRole> {
|
||||
|
||||
/**
|
||||
* 通过用户账号查询角色集合
|
||||
* @param username 用户账号名称
|
||||
* @return List<String>
|
||||
*/
|
||||
@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}))")
|
||||
List<String> getRoleByUserName(@Param("username") String username);
|
||||
|
||||
/**
|
||||
* 通过用户账号查询角色Id集合
|
||||
* @param username 用户账号名称
|
||||
* @return List<String>
|
||||
*/
|
||||
@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}))")
|
||||
List<String> getRoleIdByUserName(@Param("username") String username);
|
||||
|
||||
|
||||
@ -160,7 +160,8 @@
|
||||
select ${query.text} as "text",${query.code} as "value" from ${query.table}
|
||||
where 1 = 1
|
||||
<if test="query.keyword != null and query.keyword != ''">
|
||||
and (${query.text} like '%${query.keyword}%' or ${query.code} like '%${query.keyword}%')
|
||||
<bind name="bindKeyword" value="'%'+query.keyword+'%'"/>
|
||||
and (${query.text} like #{bindKeyword} or ${query.code} like #{bindKeyword})
|
||||
</if>
|
||||
<if test="query.codeValue != null and query.codeValue != ''">
|
||||
and ${query.code} = #{query.codeValue}
|
||||
|
||||
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.jeecg.modules.system.mapper.SysRoleIndexMapper">
|
||||
|
||||
</mapper>
|
||||
@ -12,7 +12,8 @@
|
||||
select a.* from sys_user a
|
||||
join sys_user_depart b on b.user_id = a.id
|
||||
join sys_depart c on b.dep_id = c.id
|
||||
where a.del_flag = 0 and c.org_code like '${orgCode}%'
|
||||
<bind name="bindOrgCode" value="orgCode+'%'"/>
|
||||
where a.del_flag = 0 and c.org_code like #{bindOrgCode}
|
||||
<if test="realname!=null and realname!=''">
|
||||
<!-- update by sunjianlei 20220119【#3348】SQL injection exists in /sys/user/queryUserByDepId; -->
|
||||
<bind name="bindRealname" value="'%'+realname+'%'"/>
|
||||
@ -25,7 +26,8 @@
|
||||
select a.*, c.depart_name as org_code_txt from sys_user a
|
||||
join sys_user_depart b on b.user_id = a.id
|
||||
join sys_depart c on b.dep_id = c.id
|
||||
where a.del_flag = 0 and a.status = 1 and c.org_code like '${orgCode}%'
|
||||
<bind name="bindOrgCode" value="orgCode+'%'"/>
|
||||
where a.del_flag = 0 and a.status = 1 and c.org_code like #{bindOrgCode}
|
||||
<if test="username!=null and username!=''">
|
||||
<bind name="bindUsername" value="'%'+username+'%'"/>
|
||||
and a.username like #{bindUsername}
|
||||
|
||||
@ -68,7 +68,13 @@
|
||||
INNER JOIN sys_user_depart ON sys_user_depart.dep_id = sys_depart.id
|
||||
INNER JOIN sys_user ON sys_user.id = sys_user_depart.user_id
|
||||
WHERE
|
||||
sys_user.del_flag = 0 AND sys_depart.org_code LIKE '${orgCode}%'
|
||||
<if test="orgCode == null">
|
||||
<bind name="bindOrgCode" value="'%'"/>
|
||||
</if>
|
||||
<if test="orgCode != null">
|
||||
<bind name="bindOrgCode" value="orgCode+'%'"/>
|
||||
</if>
|
||||
sys_user.del_flag = 0 AND sys_depart.org_code LIKE #{bindOrgCode}
|
||||
|
||||
<if test="userParams != null">
|
||||
<if test="userParams.realname != null and userParams.realname != ''">
|
||||
|
||||
@ -19,13 +19,19 @@ public class DepartIdModel implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
// 主键ID
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
private String key;
|
||||
|
||||
// 主键ID
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
private String value;
|
||||
|
||||
// 部门名称
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
private String title;
|
||||
|
||||
List<DepartIdModel> children = new ArrayList<>();
|
||||
|
||||
@ -75,6 +75,11 @@ public class SysDepartTreeModel implements Serializable{
|
||||
|
||||
private Date updateTime;
|
||||
|
||||
//update-begin---author:wangshuai ---date:20200308 for:[JTC-119]在部门管理菜单下设置部门负责人,新增字段部门负责人ids
|
||||
/**部门负责人ids*/
|
||||
private String directorUserIds;
|
||||
//update-end---author:wangshuai ---date:20200308 for:[JTC-119]在部门管理菜单下设置部门负责人,新增字段部门负责人ids
|
||||
|
||||
private List<SysDepartTreeModel> children = new ArrayList<>();
|
||||
|
||||
|
||||
@ -107,6 +112,7 @@ public class SysDepartTreeModel implements Serializable{
|
||||
this.createTime = sysDepart.getCreateTime();
|
||||
this.updateBy = sysDepart.getUpdateBy();
|
||||
this.updateTime = sysDepart.getUpdateTime();
|
||||
this.directorUserIds = sysDepart.getDirectorUserIds();
|
||||
}
|
||||
|
||||
public boolean getIsLeaf() {
|
||||
@ -332,6 +338,14 @@ public class SysDepartTreeModel implements Serializable{
|
||||
|
||||
public SysDepartTreeModel() { }
|
||||
|
||||
public String getDirectorUserIds() {
|
||||
return directorUserIds;
|
||||
}
|
||||
|
||||
public void setDirectorUserIds(String directorUserIds) {
|
||||
this.directorUserIds = directorUserIds;
|
||||
}
|
||||
|
||||
/**
|
||||
* 重写equals方法
|
||||
*/
|
||||
@ -365,6 +379,7 @@ public class SysDepartTreeModel implements Serializable{
|
||||
Objects.equals(createTime, model.createTime) &&
|
||||
Objects.equals(updateBy, model.updateBy) &&
|
||||
Objects.equals(updateTime, model.updateTime) &&
|
||||
Objects.equals(directorUserIds, model.directorUserIds) &&
|
||||
Objects.equals(children, model.children);
|
||||
}
|
||||
|
||||
@ -377,7 +392,7 @@ public class SysDepartTreeModel implements Serializable{
|
||||
return Objects.hash(id, parentId, departName, departNameEn, departNameAbbr,
|
||||
departOrder, description, orgCategory, orgType, orgCode, mobile, fax, address,
|
||||
memo, status, delFlag, qywxIdentifier, createBy, createTime, updateBy, updateTime,
|
||||
children);
|
||||
children,directorUserIds);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -6,6 +6,10 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
import org.jeecg.modules.system.entity.SysPermission;
|
||||
|
||||
/**
|
||||
* @Description: 菜单树,封装树结构
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
public class SysPermissionTree implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ -6,6 +6,7 @@ import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 第三方登录 信息存储
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@Data
|
||||
public class ThirdLoginModel implements Serializable {
|
||||
|
||||
@ -10,6 +10,7 @@ import org.jeecg.modules.system.entity.SysPermission;
|
||||
|
||||
/**
|
||||
* 树形列表用到
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
public class TreeModel implements Serializable {
|
||||
|
||||
@ -102,7 +103,7 @@ public class TreeModel implements Serializable {
|
||||
this.parentId = parentId;
|
||||
this.ruleFlag=ruleFlag;
|
||||
this.slotTitle = slotTitle;
|
||||
Map<String,String> map = new HashMap<String,String>();
|
||||
Map<String,String> map = new HashMap(5);
|
||||
map.put("title", "hasDatarule");
|
||||
this.scopedSlots = map;
|
||||
this.isLeaf = isLeaf;
|
||||
|
||||
@ -5,6 +5,7 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* 树形下拉框
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
public class TreeSelectModel implements Serializable {
|
||||
|
||||
|
||||
@ -31,11 +31,15 @@ public class CategoryCodeRule implements IFillRuleHandler {
|
||||
|
||||
if (formData != null && formData.size() > 0) {
|
||||
Object obj = formData.get("pid");
|
||||
if (oConvertUtils.isNotEmpty(obj)) categoryPid = obj.toString();
|
||||
if (oConvertUtils.isNotEmpty(obj)) {
|
||||
categoryPid = obj.toString();
|
||||
}
|
||||
} else {
|
||||
if (params != null) {
|
||||
Object obj = params.get("pid");
|
||||
if (oConvertUtils.isNotEmpty(obj)) categoryPid = obj.toString();
|
||||
if (oConvertUtils.isNotEmpty(obj)) {
|
||||
categoryPid = obj.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -38,11 +38,15 @@ public class OrgCodeRule implements IFillRuleHandler {
|
||||
String parentId = null;
|
||||
if (formData != null && formData.size() > 0) {
|
||||
Object obj = formData.get("parentId");
|
||||
if (obj != null) parentId = obj.toString();
|
||||
if (obj != null) {
|
||||
parentId = obj.toString();
|
||||
}
|
||||
} else {
|
||||
if (params != null) {
|
||||
Object obj = params.get("parentId");
|
||||
if (obj != null) parentId = obj.toString();
|
||||
if (obj != null) {
|
||||
parentId = obj.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,56 @@
|
||||
package org.jeecg.modules.system.security;
|
||||
|
||||
import org.jeecg.common.constant.SymbolConstant;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.common.util.security.AbstractQueryBlackListHandler;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 字典组件 执行sql前校验 只校验表字典
|
||||
* dictCodeString格式如:
|
||||
* table,text,code
|
||||
* table where xxx,text,code
|
||||
* table,text,code, where xxx
|
||||
*
|
||||
* @Author taoYan
|
||||
* @Date 2022/3/23 21:10
|
||||
**/
|
||||
@Component("dictQueryBlackListHandler")
|
||||
public class DictQueryBlackListHandler extends AbstractQueryBlackListHandler {
|
||||
|
||||
@Override
|
||||
protected List<QueryTable> getQueryTableInfo(String dictCodeString) {
|
||||
if (dictCodeString != null && dictCodeString.indexOf(SymbolConstant.COMMA) > 0) {
|
||||
String[] arr = dictCodeString.split(SymbolConstant.COMMA);
|
||||
if (arr.length != 3 && arr.length != 4) {
|
||||
return null;
|
||||
}
|
||||
String tableName = getTableName(arr[0]);
|
||||
QueryTable table = new QueryTable(tableName, "");
|
||||
// 无论什么场景 第二、三个元素一定是表的字段,直接add
|
||||
table.addField(arr[1].trim());
|
||||
if (oConvertUtils.isNotEmpty(arr[2].trim())) {
|
||||
table.addField(arr[2].trim());
|
||||
}
|
||||
List<QueryTable> list = new ArrayList<>();
|
||||
list.add(table);
|
||||
return list;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 取where前面的为:table name
|
||||
*
|
||||
* @param str
|
||||
* @return
|
||||
*/
|
||||
private String getTableName(String str) {
|
||||
String[] arr = str.split("\\s+(?i)where\\s+");
|
||||
return arr[0];
|
||||
}
|
||||
|
||||
}
|
||||
@ -16,11 +16,17 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
*/
|
||||
public interface ISysAnnouncementSendService extends IService<SysAnnouncementSend> {
|
||||
|
||||
/**
|
||||
* 通过用户id查询用户通告阅读标记
|
||||
* @param userId 用户id
|
||||
* @return
|
||||
*/
|
||||
public List<String> queryByUserId(String userId);
|
||||
|
||||
/**
|
||||
* @功能:获取我的消息
|
||||
* 获取我的消息
|
||||
* @param announcementSendModel
|
||||
* @param page 当前页数
|
||||
* @return
|
||||
*/
|
||||
public Page<AnnouncementSendModel> getMyAnnouncementSendPage(Page<AnnouncementSendModel> page,AnnouncementSendModel announcementSendModel);
|
||||
|
||||
@ -13,12 +13,33 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
*/
|
||||
public interface ISysAnnouncementService extends IService<SysAnnouncement> {
|
||||
|
||||
/**
|
||||
* 保存系统通告
|
||||
* @param sysAnnouncement
|
||||
*/
|
||||
public void saveAnnouncement(SysAnnouncement sysAnnouncement);
|
||||
|
||||
/**
|
||||
* 修改系统通告
|
||||
* @param sysAnnouncement
|
||||
* @return
|
||||
*/
|
||||
public boolean upDateAnnouncement(SysAnnouncement sysAnnouncement);
|
||||
|
||||
/**
|
||||
* 保存系统通告
|
||||
* @param title 标题
|
||||
* @param msgContent 信息内容
|
||||
*/
|
||||
public void saveSysAnnouncement(String title, String msgContent);
|
||||
|
||||
/**
|
||||
* 分页查询系统通告
|
||||
* @param page 当前页数
|
||||
* @param userId 用户id
|
||||
* @param msgCategory 消息类型
|
||||
* @return Page<SysAnnouncement>
|
||||
*/
|
||||
public Page<SysAnnouncement> querySysCementPageByUserId(Page<SysAnnouncement> page,String userId,String msgCategory);
|
||||
|
||||
|
||||
|
||||
@ -19,14 +19,23 @@ public interface ISysCategoryService extends IService<SysCategory> {
|
||||
/**根节点父ID的值*/
|
||||
public static final String ROOT_PID_VALUE = "0";
|
||||
|
||||
/**
|
||||
* 添加分类字典
|
||||
* @param sysCategory
|
||||
*/
|
||||
void addSysCategory(SysCategory sysCategory);
|
||||
|
||||
|
||||
/**
|
||||
* 修改分类字典
|
||||
* @param sysCategory
|
||||
*/
|
||||
void updateSysCategory(SysCategory sysCategory);
|
||||
|
||||
/**
|
||||
* 根据父级编码加载分类字典的数据
|
||||
* 根据父级编码加载分类字典的数据
|
||||
* @param pcode
|
||||
* @return
|
||||
* @throws JeecgBootException
|
||||
*/
|
||||
public List<TreeSelectModel> queryListByCode(String pcode) throws JeecgBootException;
|
||||
|
||||
|
||||
@ -4,6 +4,10 @@ import org.jeecg.modules.system.entity.SysDataLog;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: 数据日志service接口
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
public interface ISysDataLogService extends IService<SysDataLog> {
|
||||
|
||||
/**
|
||||
|
||||
@ -23,7 +23,8 @@ public interface ISysDepartPermissionService extends IService<SysDepartPermissio
|
||||
|
||||
/**
|
||||
* 根据部门id,菜单id获取数据规则
|
||||
* @param permissionId
|
||||
* @param permissionId 菜单id
|
||||
* @param departId 部门id
|
||||
* @return
|
||||
*/
|
||||
List<SysPermissionDataRule> getPermRuleListByDeptIdAndPermId(String departId,String permissionId);
|
||||
|
||||
@ -13,6 +13,12 @@ import java.util.List;
|
||||
*/
|
||||
public interface ISysDepartRoleUserService extends IService<SysDepartRoleUser> {
|
||||
|
||||
/**
|
||||
* 添加用户与部门关联
|
||||
* @param userId 用户id
|
||||
* @param newRoleId 新的角色id
|
||||
* @param oldRoleId 旧的角色id
|
||||
*/
|
||||
void deptRoleUserAdd(String userId,String newRoleId,String oldRoleId);
|
||||
|
||||
/**
|
||||
|
||||
@ -19,6 +19,7 @@ public interface ISysDepartService extends IService<SysDepart>{
|
||||
|
||||
/**
|
||||
* 查询我的部门信息,并分节点进行显示
|
||||
* @param departIds 部门id
|
||||
* @return
|
||||
*/
|
||||
List<SysDepartTreeModel> queryMyDeptTreeList(String departIds);
|
||||
@ -32,6 +33,7 @@ public interface ISysDepartService extends IService<SysDepart>{
|
||||
|
||||
/**
|
||||
* 查询所有部门信息,并分节点进行显示
|
||||
* @param ids 多个部门id
|
||||
* @return
|
||||
*/
|
||||
List<SysDepartTreeModel> queryTreeList(String ids);
|
||||
@ -45,12 +47,14 @@ public interface ISysDepartService extends IService<SysDepart>{
|
||||
/**
|
||||
* 保存部门数据
|
||||
* @param sysDepart
|
||||
* @param username 用户名
|
||||
*/
|
||||
void saveDepartData(SysDepart sysDepart,String username);
|
||||
|
||||
/**
|
||||
* 更新depart数据
|
||||
* @param sysDepart
|
||||
* @param username 用户名
|
||||
* @return
|
||||
*/
|
||||
Boolean updateDepartDataById(SysDepart sysDepart,String username);
|
||||
@ -65,6 +69,8 @@ public interface ISysDepartService extends IService<SysDepart>{
|
||||
/**
|
||||
* 根据关键字搜索相关的部门数据
|
||||
* @param keyWord
|
||||
* @param myDeptSearch
|
||||
* @param departIds 多个部门id
|
||||
* @return
|
||||
*/
|
||||
List<SysDepartTreeModel> searchByKeyWord(String keyWord,String myDeptSearch,String departIds);
|
||||
@ -93,7 +99,7 @@ public interface ISysDepartService extends IService<SysDepart>{
|
||||
|
||||
/**
|
||||
* 根据部门id批量删除并删除其可能存在的子级部门
|
||||
* @param id
|
||||
* @param ids 多个部门id
|
||||
* @return
|
||||
*/
|
||||
void deleteBatchWithChildren(List<String> ids);
|
||||
@ -107,16 +113,20 @@ public interface ISysDepartService extends IService<SysDepart>{
|
||||
|
||||
/**
|
||||
* 获取我的部门下级所有部门IDS
|
||||
* @param departIds 多个部门id
|
||||
* @return
|
||||
*/
|
||||
List<String> getMySubDepIdsByDepId(String departIds);
|
||||
/**
|
||||
* 根据关键字获取部门信息(通讯录)
|
||||
* @param keyWord 搜索词
|
||||
* @return
|
||||
*/
|
||||
List<SysDepartTreeModel> queryTreeByKeyWord(String keyWord);
|
||||
/**
|
||||
* 获取我的部门下级所有部门
|
||||
* @param parentId 父id
|
||||
* @param ids 多个部门id
|
||||
* @return
|
||||
*/
|
||||
List<SysDepartTreeModel> queryTreeListByPid(String parentId,String ids);
|
||||
@ -125,6 +135,7 @@ public interface ISysDepartService extends IService<SysDepart>{
|
||||
* 获取某个部门的所有父级部门的ID
|
||||
*
|
||||
* @param departId 根据departId查
|
||||
* @return JSONObject
|
||||
*/
|
||||
JSONObject queryAllParentIdByDepartId(String departId);
|
||||
|
||||
@ -132,15 +143,18 @@ public interface ISysDepartService extends IService<SysDepart>{
|
||||
* 获取某个部门的所有父级部门的ID
|
||||
*
|
||||
* @param orgCode 根据orgCode查
|
||||
* @return JSONObject
|
||||
*/
|
||||
JSONObject queryAllParentIdByOrgCode(String orgCode);
|
||||
/**
|
||||
* 获取公司信息
|
||||
* @param orgCode 部门编码
|
||||
* @return
|
||||
*/
|
||||
SysDepart queryCompByOrgCode(String orgCode);
|
||||
/**
|
||||
* 获取下级部门
|
||||
* @param pid
|
||||
* @return
|
||||
*/
|
||||
List<SysDepart> queryDeptByPid(String pid);
|
||||
|
||||
@ -14,5 +14,11 @@ import java.util.List;
|
||||
* @since 2018-12-28
|
||||
*/
|
||||
public interface ISysDictItemService extends IService<SysDictItem> {
|
||||
|
||||
/**
|
||||
* 通过字典id查询字典项
|
||||
* @param mainId 字典id
|
||||
* @return
|
||||
*/
|
||||
public List<SysDictItem> selectItemsByMainId(String mainId);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user