mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2026-01-01 01:25:28 +08:00
JeecgBoot低代码平台 3.0版本发布—新里程牌开始,迎接VUE3版本到来!!
This commit is contained in:
@ -1,17 +1,12 @@
|
||||
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.SpringBootApplication;
|
||||
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;
|
||||
|
||||
@ -80,8 +80,12 @@ public class WebSocket {
|
||||
Session session = sessionPool.get(userId);
|
||||
if (session != null && session.isOpen()) {
|
||||
try {
|
||||
log.info("【websocket消息】 单点消息:" + message);
|
||||
session.getAsyncRemote().sendText(message);
|
||||
//update-begin-author:taoyan date:20211012 for: websocket报错 https://gitee.com/jeecg/jeecg-boot/issues/I4C0MU
|
||||
synchronized (session){
|
||||
log.info("【websocket消息】 单点消息:" + message);
|
||||
session.getBasicRemote().sendText(message);
|
||||
}
|
||||
//update-end-author:taoyan date:20211012 for: websocket报错 https://gitee.com/jeecg/jeecg-boot/issues/I4C0MU
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@ -2,10 +2,6 @@ package org.jeecg.modules.oss.controller;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
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.apache.shiro.authz.annotation.RequiresRoles;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
@ -13,14 +9,18 @@ import org.jeecg.modules.oss.entity.OSSFile;
|
||||
import org.jeecg.modules.oss.service.IOSSFileService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 云存储示例 DEMO
|
||||
*/
|
||||
@Slf4j
|
||||
@Controller
|
||||
@RequestMapping("/sys/oss/file")
|
||||
|
||||
@ -89,7 +89,7 @@ public class QuartzJobController {
|
||||
* @return
|
||||
*/
|
||||
//@RequiresRoles("admin")
|
||||
@RequestMapping(value = "/edit", method = RequestMethod.PUT)
|
||||
@RequestMapping(value = "/edit", method ={RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<?> eidt(@RequestBody QuartzJob quartzJob) {
|
||||
try {
|
||||
quartzJobService.editAndScheduleJob(quartzJob);
|
||||
@ -228,8 +228,13 @@ public class QuartzJobController {
|
||||
params.setHeadRows(1);
|
||||
params.setNeedSave(true);
|
||||
try {
|
||||
List<Object> listQuartzJobs = ExcelImportUtil.importExcel(file.getInputStream(), QuartzJob.class, params);
|
||||
List<QuartzJob> listQuartzJobs = ExcelImportUtil.importExcel(file.getInputStream(), QuartzJob.class, params);
|
||||
//add-begin-author:taoyan date:20210909 for:导入定时任务,并不会被启动和调度,需要手动点击启动,才会加入调度任务中 #2986
|
||||
for(QuartzJob job: listQuartzJobs){
|
||||
job.setStatus(CommonConstant.STATUS_DISABLE);
|
||||
}
|
||||
List<String> list = ImportExcelUtil.importDateSave(listQuartzJobs, IQuartzJobService.class, errorMessage,CommonConstant.SQL_INDEX_UNIQ_JOB_CLASS_NAME);
|
||||
//add-end-author:taoyan date:20210909 for:导入定时任务,并不会被启动和调度,需要手动点击启动,才会加入调度任务中 #2986
|
||||
errorLines+=list.size();
|
||||
successLines+=(listQuartzJobs.size()-errorLines);
|
||||
} catch (Exception e) {
|
||||
|
||||
@ -117,6 +117,30 @@ public class LoginController {
|
||||
//update-end--Author:wangshuai Date:20200714 for:登录日志没有记录人员
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 【vue3专用】获取用户信息
|
||||
*/
|
||||
@GetMapping("/user/getUserInfo")
|
||||
public Result<JSONObject> getUserInfo(HttpServletRequest request){
|
||||
Result<JSONObject> result = new Result<JSONObject>();
|
||||
String username = JwtUtil.getUserNameByToken(request);
|
||||
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("sysAllDictItems", sysDictService.queryAllDictItems());
|
||||
result.setResult(obj);
|
||||
result.success("");
|
||||
}
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 退出登录
|
||||
|
||||
@ -0,0 +1,19 @@
|
||||
package org.jeecg.modules.system.controller;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.modules.system.entity.SysUser;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* vue3前端临时接口
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/")
|
||||
@Slf4j
|
||||
public class MockVue3Controller {
|
||||
|
||||
|
||||
}
|
||||
@ -140,7 +140,7 @@ public class SysAnnouncementController {
|
||||
* @param sysAnnouncement
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/edit", method = RequestMethod.PUT)
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<SysAnnouncement> eidt(@RequestBody SysAnnouncement sysAnnouncement) {
|
||||
Result<SysAnnouncement> result = new Result<SysAnnouncement>();
|
||||
SysAnnouncement sysAnnouncementEntity = sysAnnouncementService.getById(sysAnnouncement.getId());
|
||||
@ -314,7 +314,7 @@ public class SysAnnouncementController {
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/listByUser", method = RequestMethod.GET)
|
||||
public Result<Map<String,Object>> listByUser() {
|
||||
public Result<Map<String, Object>> listByUser(@RequestParam(required = false, defaultValue = "5") Integer pageSize) {
|
||||
Result<Map<String,Object>> result = new Result<Map<String,Object>>();
|
||||
LoginUser sysUser = (LoginUser)SecurityUtils.getSubject().getPrincipal();
|
||||
String userId = sysUser.getId();
|
||||
@ -347,9 +347,9 @@ public class SysAnnouncementController {
|
||||
}
|
||||
}
|
||||
// 2.查询用户未读的系统消息
|
||||
Page<SysAnnouncement> anntMsgList = new Page<SysAnnouncement>(0,5);
|
||||
Page<SysAnnouncement> anntMsgList = new Page<SysAnnouncement>(0, pageSize);
|
||||
anntMsgList = sysAnnouncementService.querySysCementPageByUserId(anntMsgList,userId,"1");//通知公告消息
|
||||
Page<SysAnnouncement> sysMsgList = new Page<SysAnnouncement>(0,5);
|
||||
Page<SysAnnouncement> sysMsgList = new Page<SysAnnouncement>(0, pageSize);
|
||||
sysMsgList = sysAnnouncementService.querySysCementPageByUserId(sysMsgList,userId,"2");//系统消息
|
||||
Map<String,Object> sysMsgMap = new HashMap<String, Object>();
|
||||
sysMsgMap.put("sysMsgList", sysMsgList.getRecords());
|
||||
|
||||
@ -8,8 +8,10 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.constant.WebsocketConst;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.message.websocket.WebSocket;
|
||||
import org.jeecg.modules.system.entity.SysAnnouncementSend;
|
||||
import org.jeecg.modules.system.model.AnnouncementSendModel;
|
||||
import org.jeecg.modules.system.service.ISysAnnouncementSendService;
|
||||
@ -45,7 +47,9 @@ import lombok.extern.slf4j.Slf4j;
|
||||
public class SysAnnouncementSendController {
|
||||
@Autowired
|
||||
private ISysAnnouncementSendService sysAnnouncementSendService;
|
||||
|
||||
@Autowired
|
||||
private WebSocket webSocket;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
* @param sysAnnouncementSend
|
||||
@ -235,6 +239,9 @@ public class SysAnnouncementSendController {
|
||||
updateWrapper.last("where user_id ='"+userId+"'");
|
||||
SysAnnouncementSend announcementSend = new SysAnnouncementSend();
|
||||
sysAnnouncementSendService.update(announcementSend, updateWrapper);
|
||||
JSONObject socketParams = new JSONObject();
|
||||
socketParams.put(WebsocketConst.MSG_CMD, WebsocketConst.CMD_TOPIC);
|
||||
webSocket.sendMessage(socketParams.toJSONString());
|
||||
result.setSuccess(true);
|
||||
result.setMessage("全部已读");
|
||||
return result;
|
||||
|
||||
@ -111,7 +111,7 @@ public class SysCategoryController {
|
||||
* @param sysCategory
|
||||
* @return
|
||||
*/
|
||||
@PutMapping(value = "/edit")
|
||||
@RequestMapping(value = "/edit", method = { RequestMethod.PUT,RequestMethod.POST })
|
||||
public Result<SysCategory> edit(@RequestBody SysCategory sysCategory) {
|
||||
Result<SysCategory> result = new Result<SysCategory>();
|
||||
SysCategory sysCategoryEntity = sysCategoryService.getById(sysCategory.getId());
|
||||
|
||||
@ -128,7 +128,7 @@ public class SysDataSourceController extends JeecgController<SysDataSource, ISys
|
||||
*/
|
||||
@AutoLog(value = "多数据源管理-编辑")
|
||||
@ApiOperation(value = "多数据源管理-编辑", notes = "多数据源管理-编辑")
|
||||
@PutMapping(value = "/edit")
|
||||
@RequestMapping(value = "/edit", method ={RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<?> edit(@RequestBody SysDataSource sysDataSource) {
|
||||
try {
|
||||
SysDataSource d = sysDataSourceService.getById(sysDataSource.getId());
|
||||
|
||||
@ -97,7 +97,7 @@ public class SysDepartController {
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/queryTreeList", method = RequestMethod.GET)
|
||||
public Result<List<SysDepartTreeModel>> queryTreeList() {
|
||||
public Result<List<SysDepartTreeModel>> queryTreeList(@RequestParam(name = "ids", required = false) String ids) {
|
||||
Result<List<SysDepartTreeModel>> result = new Result<>();
|
||||
try {
|
||||
// 从内存中读取
|
||||
@ -105,8 +105,13 @@ public class SysDepartController {
|
||||
// if (CollectionUtils.isEmpty(list)) {
|
||||
// list = sysDepartService.queryTreeList();
|
||||
// }
|
||||
List<SysDepartTreeModel> list = sysDepartService.queryTreeList();
|
||||
result.setResult(list);
|
||||
if(oConvertUtils.isNotEmpty(ids)){
|
||||
List<SysDepartTreeModel> departList = sysDepartService.queryTreeList(ids);
|
||||
result.setResult(departList);
|
||||
}else{
|
||||
List<SysDepartTreeModel> list = sysDepartService.queryTreeList();
|
||||
result.setResult(list);
|
||||
}
|
||||
result.setSuccess(true);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(),e);
|
||||
@ -116,14 +121,15 @@ public class SysDepartController {
|
||||
|
||||
/**
|
||||
* 异步查询部门list
|
||||
*
|
||||
* @param parentId 父节点 异步加载时传递
|
||||
* @param ids 前端回显是传递
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/queryDepartTreeSync", method = RequestMethod.GET)
|
||||
public Result<List<SysDepartTreeModel>> queryDepartTreeSync(@RequestParam(name = "pid", required = false) String parentId) {
|
||||
public Result<List<SysDepartTreeModel>> queryDepartTreeSync(@RequestParam(name = "pid", required = false) String parentId,@RequestParam(name = "ids", required = false) String ids) {
|
||||
Result<List<SysDepartTreeModel>> result = new Result<>();
|
||||
try {
|
||||
List<SysDepartTreeModel> list = sysDepartService.queryTreeListByPid(parentId);
|
||||
List<SysDepartTreeModel> list = sysDepartService.queryTreeListByPid(parentId,ids);
|
||||
result.setResult(list);
|
||||
result.setSuccess(true);
|
||||
} catch (Exception e) {
|
||||
|
||||
@ -359,7 +359,7 @@ public class SysDictController {
|
||||
* @return
|
||||
*/
|
||||
//@RequiresRoles({"admin"})
|
||||
@RequestMapping(value = "/edit", method = RequestMethod.PUT)
|
||||
@RequestMapping(value = "/edit", method = { RequestMethod.PUT,RequestMethod.POST })
|
||||
public Result<SysDict> edit(@RequestBody SysDict sysDict) {
|
||||
Result<SysDict> result = new Result<SysDict>();
|
||||
SysDict sysdict = sysDictService.getById(sysDict.getId());
|
||||
|
||||
@ -93,7 +93,7 @@ public class SysDictItemController {
|
||||
* @return
|
||||
*/
|
||||
//@RequiresRoles({"admin"})
|
||||
@RequestMapping(value = "/edit", method = RequestMethod.PUT)
|
||||
@RequestMapping(value = "/edit", method = { RequestMethod.PUT,RequestMethod.POST })
|
||||
@CacheEvict(value={CacheConstant.SYS_DICT_CACHE, CacheConstant.SYS_ENABLE_DICT_CACHE}, allEntries=true)
|
||||
public Result<SysDictItem> edit(@RequestBody SysDictItem sysDictItem) {
|
||||
Result<SysDictItem> result = new Result<SysDictItem>();
|
||||
|
||||
@ -14,16 +14,13 @@ 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.oConvertUtils;
|
||||
import org.jeecg.modules.system.entity.SysDepartPermission;
|
||||
import org.jeecg.modules.system.entity.SysPermission;
|
||||
import org.jeecg.modules.system.entity.SysPermissionDataRule;
|
||||
import org.jeecg.modules.system.entity.SysRolePermission;
|
||||
import org.jeecg.config.JeeccgBaseConfig;
|
||||
import org.jeecg.modules.system.entity.*;
|
||||
import org.jeecg.modules.system.model.SysPermissionTree;
|
||||
import org.jeecg.modules.system.model.TreeModel;
|
||||
import org.jeecg.modules.system.service.*;
|
||||
import org.jeecg.modules.system.util.PermissionDataUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.*;
|
||||
@ -56,12 +53,9 @@ public class SysPermissionController {
|
||||
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
/**
|
||||
* 系统安全模式(true开启,false关闭)
|
||||
*/
|
||||
@Value(value = "${jeecg.safeMode:false}")
|
||||
private Boolean sysSafeMode;
|
||||
|
||||
@Autowired
|
||||
private JeeccgBaseConfig jeeccgBaseConfig;
|
||||
|
||||
/**
|
||||
* 加载数据节点
|
||||
@ -238,6 +232,9 @@ public class SysPermissionController {
|
||||
JSONObject json = new JSONObject();
|
||||
JSONArray menujsonArray = new JSONArray();
|
||||
this.getPermissionJsonArray(menujsonArray, metaList, null);
|
||||
//一级菜单下的子菜单全部是隐藏路由,则一级菜单不显示
|
||||
this.handleFirstLevelMenuHidden(menujsonArray);
|
||||
|
||||
JSONArray authjsonArray = new JSONArray();
|
||||
this.getAuthJsonArray(authjsonArray, metaList);
|
||||
//查询所有的权限
|
||||
@ -254,9 +251,37 @@ public class SysPermissionController {
|
||||
json.put("auth", authjsonArray);
|
||||
//全部权限配置集合(按钮权限,访问权限)
|
||||
json.put("allAuth", allauthjsonArray);
|
||||
json.put("sysSafeMode", sysSafeMode);
|
||||
json.put("sysSafeMode", jeeccgBaseConfig.getSafeMode());
|
||||
result.setResult(json);
|
||||
result.success("查询成功");
|
||||
} catch (Exception e) {
|
||||
result.error500("查询失败:" + e.getMessage());
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 【vue3专用】查询用户拥有的按钮/表单访问权限
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/getPermCode", method = RequestMethod.GET)
|
||||
public Result<?> getPermCode() {
|
||||
Result<List<String>> result = new Result<List<String>>();
|
||||
try {
|
||||
//直接获取当前用户
|
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
//获取当前用户的权限集合
|
||||
List<SysPermission> metaList = sysPermissionService.queryByUser(loginUser.getUsername());
|
||||
//按钮权限(用户拥有的权限集合)
|
||||
List<String> authList = metaList.stream()
|
||||
.filter((permission) -> permission.getMenuType().equals(CommonConstant.MENU_TYPE_2)
|
||||
&& CommonConstant.STATUS_1.equals(permission.getStatus())
|
||||
)
|
||||
.collect(() -> new ArrayList<String>(),
|
||||
(list, permission) -> list.add(permission.getPerms()),
|
||||
(list1, list2) -> list1.addAll(list2)
|
||||
);
|
||||
result.setResult(authList);
|
||||
} catch (Exception e) {
|
||||
result.error500("查询失败:" + e.getMessage());
|
||||
log.error(e.getMessage(), e);
|
||||
@ -349,7 +374,7 @@ public class SysPermissionController {
|
||||
|
||||
/**
|
||||
* 获取全部的权限树
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/queryTreeList", method = RequestMethod.GET)
|
||||
@ -380,7 +405,7 @@ public class SysPermissionController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 异步加载数据节点
|
||||
* 异步加载数据节点 [接口是废的,没有用到]
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ -482,6 +507,31 @@ public class SysPermissionController {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 一级菜单的子菜单全部是隐藏路由,则一级菜单不显示
|
||||
* @param jsonArray
|
||||
*/
|
||||
private void handleFirstLevelMenuHidden(JSONArray jsonArray) {
|
||||
jsonArray = jsonArray.stream().map(obj -> {
|
||||
JSONObject returnObj = new JSONObject();
|
||||
JSONObject jsonObj = (JSONObject)obj;
|
||||
if(jsonObj.containsKey("children")){
|
||||
JSONArray childrens = jsonObj.getJSONArray("children");
|
||||
childrens = childrens.stream().filter(arrObj -> !"true".equals(((JSONObject) arrObj).getString("hidden"))).collect(Collectors.toCollection(JSONArray::new));
|
||||
if(childrens==null || childrens.size()==0){
|
||||
jsonObj.put("hidden",true);
|
||||
|
||||
//vue3版本兼容代码
|
||||
JSONObject meta = new JSONObject();
|
||||
meta.put("hideMenu",true);
|
||||
jsonObj.put("meta", meta);
|
||||
}
|
||||
}
|
||||
return returnObj;
|
||||
}).collect(Collectors.toCollection(JSONArray::new));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取权限JSON数组
|
||||
* @param jsonArray
|
||||
@ -605,16 +655,18 @@ public class SysPermissionController {
|
||||
json.put("name", urlToRouteName(permission.getUrl()));
|
||||
}
|
||||
|
||||
JSONObject meta = new JSONObject();
|
||||
// 是否隐藏路由,默认都是显示的
|
||||
if (permission.isHidden()) {
|
||||
json.put("hidden", true);
|
||||
//vue3版本兼容代码
|
||||
meta.put("hideMenu",true);
|
||||
}
|
||||
// 聚合路由
|
||||
if (permission.isAlwaysShow()) {
|
||||
json.put("alwaysShow", true);
|
||||
}
|
||||
json.put("component", permission.getComponent());
|
||||
JSONObject meta = new JSONObject();
|
||||
// 由用户设置是否缓存页面 用布尔值
|
||||
if (permission.isKeepAlive()) {
|
||||
meta.put("keepAlive", true);
|
||||
@ -654,6 +706,11 @@ public class SysPermissionController {
|
||||
if (isWWWHttpUrl(permission.getUrl())) {
|
||||
meta.put("url", permission.getUrl());
|
||||
}
|
||||
// update-begin--Author:sunjianlei Date:20210918 for:新增适配vue3项目的隐藏tab功能
|
||||
if (permission.isHideTab()) {
|
||||
meta.put("hideTab", true);
|
||||
}
|
||||
// update-end--Author:sunjianlei Date:20210918 for:新增适配vue3项目的隐藏tab功能
|
||||
json.put("meta", meta);
|
||||
}
|
||||
|
||||
@ -776,7 +833,6 @@ public class SysPermissionController {
|
||||
try {
|
||||
List<SysPermissionDataRule> permRuleList = sysPermissionDataRuleService.queryPermissionRule(sysPermissionDataRule);
|
||||
result.setResult(permRuleList);
|
||||
result.success("查询成功!");
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
result.error500("操作失败");
|
||||
|
||||
@ -107,7 +107,7 @@ public class SysPositionController {
|
||||
*/
|
||||
@AutoLog(value = "职务表-编辑")
|
||||
@ApiOperation(value = "职务表-编辑", notes = "职务表-编辑")
|
||||
@PutMapping(value = "/edit")
|
||||
@RequestMapping(value = "/edit", method ={RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<SysPosition> edit(@RequestBody SysPosition sysPosition) {
|
||||
Result<SysPosition> result = new Result<SysPosition>();
|
||||
SysPosition sysPositionEntity = sysPositionService.getById(sysPosition.getId());
|
||||
|
||||
@ -129,7 +129,7 @@ public class SysRoleController {
|
||||
* @return
|
||||
*/
|
||||
//@RequiresRoles({"admin"})
|
||||
@RequestMapping(value = "/edit", method = RequestMethod.PUT)
|
||||
@RequestMapping(value = "/edit",method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<SysRole> edit(@RequestBody SysRole role) {
|
||||
Result<SysRole> result = new Result<SysRole>();
|
||||
SysRole sysrole = sysRoleService.getById(role.getId());
|
||||
|
||||
@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -43,7 +44,23 @@ public class SysTenantController {
|
||||
public Result<IPage<SysTenant>> queryPageList(SysTenant sysTenant,@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,HttpServletRequest req) {
|
||||
Result<IPage<SysTenant>> result = new Result<IPage<SysTenant>>();
|
||||
QueryWrapper<SysTenant> queryWrapper = QueryGenerator.initQueryWrapper(sysTenant, req.getParameterMap());
|
||||
//---author:zhangyafei---date:20210916-----for: 租户管理添加日期范围查询---
|
||||
Date beginDate=null;
|
||||
Date endDate=null;
|
||||
if(oConvertUtils.isNotEmpty(sysTenant)) {
|
||||
beginDate=sysTenant.getBeginDate();
|
||||
endDate=sysTenant.getEndDate();
|
||||
sysTenant.setBeginDate(null);
|
||||
sysTenant.setEndDate(null);
|
||||
}
|
||||
//---author:zhangyafei---date:20210916-----for: 租户管理添加日期范围查询---
|
||||
QueryWrapper<SysTenant> queryWrapper = QueryGenerator.initQueryWrapper(sysTenant, req.getParameterMap());
|
||||
//---author:zhangyafei---date:20210916-----for: 租户管理添加日期范围查询---
|
||||
if(oConvertUtils.isNotEmpty(sysTenant)){
|
||||
queryWrapper.ge(oConvertUtils.isNotEmpty(beginDate),"begin_date",beginDate);
|
||||
queryWrapper.le(oConvertUtils.isNotEmpty(endDate),"end_date",endDate);
|
||||
}
|
||||
//---author:zhangyafei---date:20210916-----for: 租户管理添加日期范围查询---
|
||||
Page<SysTenant> page = new Page<SysTenant>(pageNo, pageSize);
|
||||
IPage<SysTenant> pageList = sysTenantService.page(page, queryWrapper);
|
||||
result.setSuccess(true);
|
||||
@ -58,7 +75,7 @@ public class SysTenantController {
|
||||
*/
|
||||
@RequestMapping(value = "/add", method = RequestMethod.POST)
|
||||
public Result<SysTenant> add(@RequestBody SysTenant sysTenant) {
|
||||
Result<SysTenant> result = new Result<SysTenant>();
|
||||
Result<SysTenant> result = new Result();
|
||||
if(sysTenantService.getById(sysTenant.getId())!=null){
|
||||
return result.error500("该编号已存在!");
|
||||
}
|
||||
@ -77,17 +94,16 @@ public class SysTenantController {
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/edit", method = RequestMethod.PUT)
|
||||
@RequestMapping(value = "/edit", method ={RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<SysTenant> edit(@RequestBody SysTenant tenant) {
|
||||
Result<SysTenant> result = new Result<SysTenant>();
|
||||
Result<SysTenant> result = new Result();
|
||||
SysTenant sysTenant = sysTenantService.getById(tenant.getId());
|
||||
if(sysTenant==null) {
|
||||
result.error500("未找到对应实体");
|
||||
}else {
|
||||
boolean ok = sysTenantService.updateById(tenant);
|
||||
if(ok) {
|
||||
result.success("修改成功!");
|
||||
}
|
||||
return result.error500("未找到对应实体");
|
||||
}
|
||||
boolean ok = sysTenantService.updateById(tenant);
|
||||
if(ok) {
|
||||
result.success("修改成功!");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -97,7 +113,7 @@ public class SysTenantController {
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/delete", method = RequestMethod.DELETE)
|
||||
@RequestMapping(value = "/delete", method ={RequestMethod.DELETE, RequestMethod.POST})
|
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
||||
sysTenantService.removeTenantById(id);
|
||||
return Result.ok("删除成功");
|
||||
|
||||
@ -107,7 +107,7 @@ public class SysUserAgentController {
|
||||
* @param sysUserAgent
|
||||
* @return
|
||||
*/
|
||||
@PutMapping(value = "/edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<SysUserAgent> edit(@RequestBody SysUserAgent sysUserAgent) {
|
||||
Result<SysUserAgent> result = new Result<SysUserAgent>();
|
||||
SysUserAgent sysUserAgentEntity = sysUserAgentService.getById(sysUserAgent.getId());
|
||||
|
||||
@ -157,7 +157,7 @@ public class SysUserController {
|
||||
|
||||
//@RequiresRoles({"admin"})
|
||||
//@RequiresPermissions("user:edit")
|
||||
@RequestMapping(value = "/edit", method = RequestMethod.PUT)
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<SysUser> edit(@RequestBody JSONObject jsonObject) {
|
||||
Result<SysUser> result = new Result<SysUser>();
|
||||
try {
|
||||
@ -172,6 +172,10 @@ public class SysUserController {
|
||||
user.setPassword(sysUser.getPassword());
|
||||
String roles = jsonObject.getString("selectedroles");
|
||||
String departs = jsonObject.getString("selecteddeparts");
|
||||
if(oConvertUtils.isEmpty(departs)){
|
||||
//vue3.0前端只传递了departIds
|
||||
departs=user.getDepartIds();
|
||||
}
|
||||
// 修改用户走一个service 保证事务
|
||||
sysUserService.editUser(user, roles, departs);
|
||||
result.success("修改成功!");
|
||||
|
||||
@ -1,9 +1,6 @@
|
||||
package org.jeecg.modules.system.controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
@ -55,45 +52,38 @@ public class SysUserOnlineController {
|
||||
private BaseCommonService baseCommonService;
|
||||
|
||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||
public Result<Page<SysUserOnlineVO>> list(@RequestParam(name="username", required=false) String username, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize) {
|
||||
public Result<Page<SysUserOnlineVO>> list(@RequestParam(name="username", required=false) String username,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,@RequestParam(name="pageSize", defaultValue="10") Integer pageSize) {
|
||||
Collection<String> keys = redisTemplate.keys(CommonConstant.PREFIX_USER_TOKEN + "*");
|
||||
SysUserOnlineVO online;
|
||||
List<SysUserOnlineVO> onlineList = new ArrayList<SysUserOnlineVO>();
|
||||
for (String key : keys) {
|
||||
online = new SysUserOnlineVO();
|
||||
String token = (String) redisUtil.get(key);
|
||||
if (!StringUtils.isEmpty(token)){
|
||||
String token = (String)redisUtil.get(key);
|
||||
if (StringUtils.isNotEmpty(token)) {
|
||||
SysUserOnlineVO online = new SysUserOnlineVO();
|
||||
online.setToken(token);
|
||||
//TODO 改成一次性查询
|
||||
LoginUser loginUser = sysBaseAPI.getUserByName(JwtUtil.getUsername(token));
|
||||
BeanUtils.copyProperties(loginUser, online);
|
||||
if (StringUtils.isNotEmpty(username)) {
|
||||
if (StringUtils.equals(username, online.getUsername())) {
|
||||
onlineList.add(online);
|
||||
}
|
||||
} else {
|
||||
onlineList.add(online);
|
||||
}
|
||||
onlineList.add(online);
|
||||
}
|
||||
}
|
||||
Collections.reverse(onlineList);
|
||||
|
||||
Page<SysUserOnlineVO> page = new Page<SysUserOnlineVO>(pageNo, pageSize);
|
||||
int count = onlineList.size();
|
||||
List<SysUserOnlineVO> pages = new ArrayList<>();
|
||||
//计算当前页第一条数据的下标
|
||||
int currId = pageNo>1 ? (pageNo-1)*pageSize:0;
|
||||
for (int i=0; i<pageSize && i<count - currId;i++){
|
||||
pages.add(onlineList.get(currId+i));
|
||||
// 计算当前页第一条数据的下标
|
||||
int currId = pageNo > 1 ? (pageNo - 1) * pageSize : 0;
|
||||
for (int i = 0; i < pageSize && i < count - currId; i++) {
|
||||
pages.add(onlineList.get(currId + i));
|
||||
}
|
||||
page.setSize(pageSize);
|
||||
page.setCurrent(pageNo);
|
||||
page.setTotal(count);
|
||||
//计算分页总页数
|
||||
page.setPages(count %10 == 0 ? count/10 :count/10+1);
|
||||
// 计算分页总页数
|
||||
page.setPages(count % 10 == 0 ? count / 10 : count / 10 + 1);
|
||||
page.setRecords(pages);
|
||||
|
||||
Collections.reverse(onlineList);
|
||||
onlineList.removeAll(Collections.singleton(null));
|
||||
Result<Page<SysUserOnlineVO>> result = new Result<Page<SysUserOnlineVO>>();
|
||||
result.setSuccess(true);
|
||||
result.setResult(page);
|
||||
|
||||
@ -130,6 +130,11 @@ public class SysPermission implements Serializable {
|
||||
*/
|
||||
private boolean hidden;
|
||||
|
||||
/**
|
||||
* 是否隐藏Tab: 0否,1是(默认值0)
|
||||
*/
|
||||
private boolean hideTab;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
|
||||
@ -127,7 +127,7 @@
|
||||
select ${text} as "title",
|
||||
${code} as "key",
|
||||
<if test="hasChildField != null and hasChildField != ''">
|
||||
(case when ${hasChildField} = '1' then 0 else 1 end) as isLeaf,
|
||||
${hasChildField} as "isLeaf",
|
||||
</if>
|
||||
${pidField} as parentId
|
||||
from ${table}
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
<result column="name" property="title" jdbcType="VARCHAR"/>
|
||||
<result column="icon" property="icon" jdbcType="VARCHAR"/>
|
||||
<result column="parent_id" property="parentId" jdbcType="VARCHAR"/>
|
||||
<result column="leaf_flag" property="isLeaf" jdbcType="INTEGER"/>
|
||||
<result column="is_leaf" property="isLeaf" jdbcType="INTEGER"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 通过<resultMap>映射实体类属性名和表的字段名对应关系 -->
|
||||
@ -26,7 +26,7 @@
|
||||
,parent_id
|
||||
,name
|
||||
,icon
|
||||
,leaf_flag
|
||||
,is_leaf
|
||||
FROM sys_permission
|
||||
WHERE 1=1
|
||||
<choose>
|
||||
|
||||
@ -29,6 +29,13 @@ public interface ISysDepartService extends IService<SysDepart>{
|
||||
*/
|
||||
List<SysDepartTreeModel> queryTreeList();
|
||||
|
||||
|
||||
/**
|
||||
* 查询所有部门信息,并分节点进行显示
|
||||
* @return
|
||||
*/
|
||||
List<SysDepartTreeModel> queryTreeList(String ids);
|
||||
|
||||
/**
|
||||
* 查询所有部门DepartId信息,并分节点进行显示
|
||||
* @return
|
||||
@ -112,7 +119,7 @@ public interface ISysDepartService extends IService<SysDepart>{
|
||||
* 获取我的部门下级所有部门
|
||||
* @return
|
||||
*/
|
||||
List<SysDepartTreeModel> queryTreeListByPid(String parentId);
|
||||
List<SysDepartTreeModel> queryTreeListByPid(String parentId,String ids);
|
||||
|
||||
/**
|
||||
* 获取某个部门的所有父级部门的ID
|
||||
|
||||
@ -114,8 +114,12 @@ public class SysAnnouncementServiceImpl extends ServiceImpl<SysAnnouncementMappe
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<SysAnnouncement> querySysCementPageByUserId(Page<SysAnnouncement> page, String userId,String msgCategory) {
|
||||
return page.setRecords(sysAnnouncementMapper.querySysCementListByUserId(page, userId, msgCategory));
|
||||
public Page<SysAnnouncement> querySysCementPageByUserId(Page<SysAnnouncement> page, String userId, String msgCategory) {
|
||||
if (page.getSize() == -1) {
|
||||
return page.setRecords(sysAnnouncementMapper.querySysCementListByUserId(null, userId, msgCategory));
|
||||
} else {
|
||||
return page.setRecords(sysAnnouncementMapper.querySysCementListByUserId(page, userId, msgCategory));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -25,6 +25,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@ -77,8 +78,8 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
|
||||
/**
|
||||
* queryTreeList 对应 queryTreeList 查询所有的部门数据,以树结构形式响应给前端
|
||||
*/
|
||||
@Cacheable(value = CacheConstant.SYS_DEPARTS_CACHE)
|
||||
@Override
|
||||
@Cacheable(value = CacheConstant.SYS_DEPARTS_CACHE)
|
||||
public List<SysDepartTreeModel> queryTreeList() {
|
||||
LambdaQueryWrapper<SysDepart> query = new LambdaQueryWrapper<SysDepart>();
|
||||
query.eq(SysDepart::getDelFlag, CommonConstant.DEL_FLAG_0.toString());
|
||||
@ -89,6 +90,26 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
|
||||
return listResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* queryTreeList 根据部门id查询,前端回显调用
|
||||
*/
|
||||
@Override
|
||||
public List<SysDepartTreeModel> queryTreeList(String ids) {
|
||||
List<SysDepartTreeModel> listResult=new ArrayList<>();
|
||||
LambdaQueryWrapper<SysDepart> query = new LambdaQueryWrapper<SysDepart>();
|
||||
query.eq(SysDepart::getDelFlag, CommonConstant.DEL_FLAG_0.toString());
|
||||
if(oConvertUtils.isNotEmpty(ids)){
|
||||
query.in(true,SysDepart::getId,ids.split(","));
|
||||
}
|
||||
query.orderByAsc(SysDepart::getDepartOrder);
|
||||
List<SysDepart> list= this.list(query);
|
||||
for (SysDepart depart : list) {
|
||||
listResult.add(new SysDepartTreeModel(depart));
|
||||
}
|
||||
return listResult;
|
||||
|
||||
}
|
||||
|
||||
@Cacheable(value = CacheConstant.SYS_DEPART_IDS_CACHE)
|
||||
@Override
|
||||
public List<DepartIdModel> queryDepartIdTreeList() {
|
||||
@ -458,11 +479,27 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
|
||||
/**
|
||||
* 根据parentId查询部门树
|
||||
* @param parentId
|
||||
* @param ids 前端回显传递
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<SysDepartTreeModel> queryTreeListByPid(String parentId) {
|
||||
List<SysDepart> list = this.baseMapper.queryTreeListByPid(parentId);
|
||||
public List<SysDepartTreeModel> queryTreeListByPid(String parentId,String ids) {
|
||||
Consumer<LambdaQueryWrapper<SysDepart>> square = i -> {
|
||||
if (oConvertUtils.isNotEmpty(ids)) {
|
||||
i.in(SysDepart::getId, ids.split(","));
|
||||
} else {
|
||||
if(oConvertUtils.isEmpty(parentId)){
|
||||
i.and(q->q.isNull(true,SysDepart::getParentId).or().eq(true,SysDepart::getParentId,""));
|
||||
}else{
|
||||
i.eq(true,SysDepart::getParentId,parentId);
|
||||
}
|
||||
}
|
||||
};
|
||||
LambdaQueryWrapper<SysDepart> lqw=new LambdaQueryWrapper();
|
||||
lqw.eq(true,SysDepart::getDelFlag,CommonConstant.DEL_FLAG_0);
|
||||
lqw.func(square);
|
||||
lqw.orderByDesc(SysDepart::getDepartOrder);
|
||||
List<SysDepart> list = list(lqw);
|
||||
List<SysDepartTreeModel> records = new ArrayList<>();
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
SysDepart depart = list.get(i);
|
||||
|
||||
@ -9,6 +9,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.base.BaseMap;
|
||||
import org.jeecg.common.constant.CacheConstant;
|
||||
import org.jeecg.common.constant.GlobalConstants;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.system.entity.SysGatewayRoute;
|
||||
import org.jeecg.modules.system.mapper.SysGatewayRouteMapper;
|
||||
import org.jeecg.modules.system.service.ISysGatewayRouteService;
|
||||
@ -17,7 +18,9 @@ import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: gateway路由管理
|
||||
@ -42,7 +45,7 @@ public class SysGatewayRouteServiceImpl extends ServiceImpl<SysGatewayRouteMappe
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
this.removeById(id);
|
||||
this.resreshRouter();
|
||||
this.resreshRouter(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -52,7 +55,14 @@ public class SysGatewayRouteServiceImpl extends ServiceImpl<SysGatewayRouteMappe
|
||||
try {
|
||||
json = json.getJSONObject("router");
|
||||
String id = json.getString("id");
|
||||
SysGatewayRoute route = getById(id);
|
||||
//update-begin-author:taoyan date:20211025 for: oracle路由网关新增小bug /issues/I4EV2J
|
||||
SysGatewayRoute route;
|
||||
if(oConvertUtils.isEmpty(id)){
|
||||
route = new SysGatewayRoute();
|
||||
}else{
|
||||
route = getById(id);
|
||||
}
|
||||
//update-end-author:taoyan date:20211025 for: oracle路由网关新增小bug /issues/I4EV2J
|
||||
if (ObjectUtil.isEmpty(route)) {
|
||||
route = new SysGatewayRoute();
|
||||
}
|
||||
@ -71,10 +81,10 @@ public class SysGatewayRouteServiceImpl extends ServiceImpl<SysGatewayRouteMappe
|
||||
route.setStatus(json.getInteger("status"));
|
||||
}
|
||||
this.saveOrUpdate(route);
|
||||
resreshRouter();
|
||||
resreshRouter(null);
|
||||
} catch (Exception e) {
|
||||
log.error("路由配置解析失败", e);
|
||||
resreshRouter();
|
||||
resreshRouter(null);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@ -82,11 +92,12 @@ public class SysGatewayRouteServiceImpl extends ServiceImpl<SysGatewayRouteMappe
|
||||
/**
|
||||
* 更新redis路由缓存
|
||||
*/
|
||||
private void resreshRouter() {
|
||||
private void resreshRouter(String id) {
|
||||
//更新redis路由缓存
|
||||
addRoute2Redis(CacheConstant.GATEWAY_ROUTES);
|
||||
BaseMap params = new BaseMap();
|
||||
params.put(GlobalConstants.HANDLER_NAME, "loderRouderHandler");
|
||||
params.put("routerId", id);
|
||||
//刷新网关
|
||||
redisTemplate.convertAndSend(GlobalConstants.REDIS_TOPIC_NAME, params);
|
||||
}
|
||||
|
||||
@ -1,52 +0,0 @@
|
||||
package org.jeecg.modules.system.service.impl.desform;
|
||||
|
||||
import org.jeecg.common.api.desform.ISysTranslateAPI;
|
||||
import org.jeecg.common.system.vo.DictModel;
|
||||
import org.jeecg.modules.system.service.ISysCategoryService;
|
||||
import org.jeecg.modules.system.service.ISysDictService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 表单设计器翻译API接口(system实现类)
|
||||
*
|
||||
* @author sunjianlei
|
||||
*/
|
||||
@Component
|
||||
public class SysTranslateAPIImpl implements ISysTranslateAPI {
|
||||
|
||||
@Autowired
|
||||
ISysCategoryService sysCategoryService;
|
||||
@Autowired
|
||||
ISysDictService sysDictService;
|
||||
|
||||
@Override
|
||||
public List<String> categoryLoadDictItem(String ids) {
|
||||
return sysCategoryService.loadDictItem(ids, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> dictLoadDictItem(String dictCode, String keys) {
|
||||
String[] params = dictCode.split(",");
|
||||
return sysDictService.queryTableDictByKeys(params[0], params[1], params[2], keys, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DictModel> dictGetDictItems(String dictCode) {
|
||||
List<DictModel> ls = sysDictService.getDictItems(dictCode);
|
||||
if (ls == null) {
|
||||
ls = new ArrayList<>();
|
||||
}
|
||||
return ls;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DictModel> dictLoadDict(String dictCode, String keyword, Integer pageSize) {
|
||||
return sysDictService.loadDict(dictCode, keyword, pageSize);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,25 +0,0 @@
|
||||
//package org.jeecg.modules.system.util;
|
||||
//
|
||||
//import lombok.extern.slf4j.Slf4j;
|
||||
//
|
||||
///**
|
||||
// * 多租户 tenant_id存储器
|
||||
// */
|
||||
//@Slf4j
|
||||
//public class TenantContext {
|
||||
//
|
||||
// private static ThreadLocal<String> currentTenant = new ThreadLocal<>();
|
||||
//
|
||||
// public static void setTenant(String tenant) {
|
||||
// log.debug(" setting tenant to " + tenant);
|
||||
// currentTenant.set(tenant);
|
||||
// }
|
||||
//
|
||||
// public static String getTenant() {
|
||||
// return currentTenant.get();
|
||||
// }
|
||||
//
|
||||
// public static void clear(){
|
||||
// currentTenant.remove();
|
||||
// }
|
||||
//}
|
||||
@ -1,60 +0,0 @@
|
||||
package org.jeecg.modules.system.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
*
|
||||
* @Author: chenli
|
||||
* @Date: 2020-06-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
public class SysOnlineVO {
|
||||
/**
|
||||
* 会话id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 会话编号
|
||||
*/
|
||||
private String token;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
private String realname;
|
||||
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 生日
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date birthday;
|
||||
|
||||
/**
|
||||
* 性别(1:男 2:女)
|
||||
*/
|
||||
@Dict(dicCode = "sex")
|
||||
private Integer sex;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
private String phone;
|
||||
}
|
||||
Reference in New Issue
Block a user