mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-09-18 01:06:40 +08:00
update [重大更新]全业务 增加 接口文档注解 格式化代码
This commit is contained in:
parent
bb43b2853d
commit
a6fb88d74c
@ -10,12 +10,12 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
public class RuoYiApplication
|
public class RuoYiApplication {
|
||||||
{
|
|
||||||
public static void main(String[] args)
|
public static void main(String[] args) {
|
||||||
{
|
|
||||||
System.setProperty("spring.devtools.restart.enabled", "false");
|
System.setProperty("spring.devtools.restart.enabled", "false");
|
||||||
SpringApplication.run(RuoYiApplication.class, args);
|
SpringApplication.run(RuoYiApplication.class, args);
|
||||||
System.out.println("(♥◠‿◠)ノ゙ RuoYi-Vue-Plus启动成功 ლ(´ڡ`ლ)゙");
|
System.out.println("(♥◠‿◠)ノ゙ RuoYi-Vue-Plus启动成功 ლ(´ڡ`ლ)゙");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -8,11 +8,11 @@ import org.springframework.boot.web.servlet.support.SpringBootServletInitializer
|
|||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public class RuoYiServletInitializer extends SpringBootServletInitializer
|
public class RuoYiServletInitializer extends SpringBootServletInitializer {
|
||||||
{
|
|
||||||
@Override
|
@Override
|
||||||
protected SpringApplicationBuilder configure(SpringApplicationBuilder application)
|
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
|
||||||
{
|
|
||||||
return application.sources(RuoYiApplication.class);
|
return application.sources(RuoYiApplication.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,9 @@ import com.ruoyi.common.utils.reflect.ReflectUtils;
|
|||||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||||
import com.ruoyi.framework.config.properties.CaptchaProperties;
|
import com.ruoyi.framework.config.properties.CaptchaProperties;
|
||||||
import com.ruoyi.system.service.ISysConfigService;
|
import com.ruoyi.system.service.ISysConfigService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
@ -24,22 +27,22 @@ import java.util.concurrent.TimeUnit;
|
|||||||
/**
|
/**
|
||||||
* 验证码操作处理
|
* 验证码操作处理
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
|
@Api(value = "验证码操作处理", tags = {"验证码管理"})
|
||||||
|
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||||
@RestController
|
@RestController
|
||||||
public class CaptchaController {
|
public class CaptchaController {
|
||||||
|
|
||||||
@Autowired
|
private final CaptchaProperties captchaProperties;
|
||||||
private CaptchaProperties captchaProperties;
|
private final ISysConfigService configService;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ISysConfigService configService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成验证码
|
* 生成验证码
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("生成验证码")
|
||||||
@GetMapping("/captchaImage")
|
@GetMapping("/captchaImage")
|
||||||
public AjaxResult getCode() {
|
public AjaxResult<Map<String, Object>> getCode() {
|
||||||
Map<String, Object> ajax = new HashMap<>();
|
Map<String, Object> ajax = new HashMap<>();
|
||||||
boolean captchaOnOff = configService.selectCaptchaOnOff();
|
boolean captchaOnOff = configService.selectCaptchaOnOff();
|
||||||
ajax.put("captchaOnOff", captchaOnOff);
|
ajax.put("captchaOnOff", captchaOnOff);
|
||||||
|
@ -1,8 +1,12 @@
|
|||||||
package com.ruoyi.web.controller.monitor;
|
package com.ruoyi.web.controller.monitor;
|
||||||
|
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.data.redis.connection.RedisServerCommands;
|
||||||
import org.springframework.data.redis.core.RedisCallback;
|
import org.springframework.data.redis.core.RedisCallback;
|
||||||
import org.springframework.data.redis.core.RedisTemplate;
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
@ -15,28 +19,30 @@ import java.util.*;
|
|||||||
/**
|
/**
|
||||||
* 缓存监控
|
* 缓存监控
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
|
@Api(value = "缓存监控", tags = {"缓存监控管理"})
|
||||||
|
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/monitor/cache")
|
@RequestMapping("/monitor/cache")
|
||||||
public class CacheController
|
public class CacheController {
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private RedisTemplate<String, String> redisTemplate;
|
|
||||||
|
|
||||||
|
private final RedisTemplate<String, String> redisTemplate;
|
||||||
|
|
||||||
|
@ApiOperation("获取缓存监控详细信息")
|
||||||
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
|
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")
|
||||||
@GetMapping()
|
@GetMapping()
|
||||||
public AjaxResult getInfo() throws Exception
|
public AjaxResult<Map<String, Object>> getInfo() throws Exception {
|
||||||
{
|
Properties info = (Properties) redisTemplate.execute((RedisCallback<Object>) RedisServerCommands::info);
|
||||||
Properties info = (Properties) redisTemplate.execute((RedisCallback<Object>) connection -> connection.info());
|
|
||||||
Properties commandStats = (Properties) redisTemplate.execute((RedisCallback<Object>) connection -> connection.info("commandstats"));
|
Properties commandStats = (Properties) redisTemplate.execute((RedisCallback<Object>) connection -> connection.info("commandstats"));
|
||||||
Object dbSize = redisTemplate.execute((RedisCallback<Object>) connection -> connection.dbSize());
|
Object dbSize = redisTemplate.execute((RedisCallback<Object>) RedisServerCommands::dbSize);
|
||||||
|
|
||||||
Map<String, Object> result = new HashMap<>(3);
|
Map<String, Object> result = new HashMap<>(3);
|
||||||
result.put("info", info);
|
result.put("info", info);
|
||||||
result.put("dbSize", dbSize);
|
result.put("dbSize", dbSize);
|
||||||
|
|
||||||
List<Map<String, String>> pieList = new ArrayList<>();
|
List<Map<String, String>> pieList = new ArrayList<>();
|
||||||
|
if (commandStats != null) {
|
||||||
commandStats.stringPropertyNames().forEach(key -> {
|
commandStats.stringPropertyNames().forEach(key -> {
|
||||||
Map<String, String> data = new HashMap<>(2);
|
Map<String, String> data = new HashMap<>(2);
|
||||||
String property = commandStats.getProperty(key);
|
String property = commandStats.getProperty(key);
|
||||||
@ -44,6 +50,7 @@ public class CacheController
|
|||||||
data.put("value", StringUtils.substringBetween(property, "calls=", ",usec"));
|
data.put("value", StringUtils.substringBetween(property, "calls=", ",usec"));
|
||||||
pieList.add(data);
|
pieList.add(data);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
result.put("commandStats", pieList);
|
result.put("commandStats", pieList);
|
||||||
return AjaxResult.success(result);
|
return AjaxResult.success(result);
|
||||||
}
|
}
|
||||||
|
@ -8,8 +8,12 @@ import com.ruoyi.common.enums.BusinessType;
|
|||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
import com.ruoyi.system.domain.SysLogininfor;
|
import com.ruoyi.system.domain.SysLogininfor;
|
||||||
import com.ruoyi.system.service.ISysLogininforService;
|
import com.ruoyi.system.service.ISysLogininforService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
@ -18,44 +22,46 @@ import java.util.List;
|
|||||||
/**
|
/**
|
||||||
* 系统访问记录
|
* 系统访问记录
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
|
@Validated
|
||||||
|
@Api(value = "系统访问记录", tags = {"系统访问记录管理"})
|
||||||
|
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/monitor/logininfor")
|
@RequestMapping("/monitor/logininfor")
|
||||||
public class SysLogininforController extends BaseController
|
public class SysLogininforController extends BaseController {
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private ISysLogininforService logininforService;
|
|
||||||
|
|
||||||
|
private final ISysLogininforService logininforService;
|
||||||
|
|
||||||
|
@ApiOperation("查询系统访问记录列表")
|
||||||
@PreAuthorize("@ss.hasPermi('monitor:logininfor:list')")
|
@PreAuthorize("@ss.hasPermi('monitor:logininfor:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(SysLogininfor logininfor)
|
public TableDataInfo<SysLogininfor> list(SysLogininfor logininfor) {
|
||||||
{
|
|
||||||
return logininforService.selectPageLogininforList(logininfor);
|
return logininforService.selectPageLogininforList(logininfor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("导出系统访问记录列表")
|
||||||
@Log(title = "登录日志", businessType = BusinessType.EXPORT)
|
@Log(title = "登录日志", businessType = BusinessType.EXPORT)
|
||||||
@PreAuthorize("@ss.hasPermi('monitor:logininfor:export')")
|
@PreAuthorize("@ss.hasPermi('monitor:logininfor:export')")
|
||||||
@GetMapping("/export")
|
@GetMapping("/export")
|
||||||
public void export(SysLogininfor logininfor, HttpServletResponse response)
|
public void export(SysLogininfor logininfor, HttpServletResponse response) {
|
||||||
{
|
|
||||||
List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
|
List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
|
||||||
ExcelUtil.exportExcel(list, "登录日志", SysLogininfor.class, response);
|
ExcelUtil.exportExcel(list, "登录日志", SysLogininfor.class, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除系统访问记录")
|
||||||
@PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')")
|
@PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')")
|
||||||
@Log(title = "登录日志", businessType = BusinessType.DELETE)
|
@Log(title = "登录日志", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{infoIds}")
|
@DeleteMapping("/{infoIds}")
|
||||||
public AjaxResult remove(@PathVariable Long[] infoIds)
|
public AjaxResult<Void> remove(@PathVariable Long[] infoIds) {
|
||||||
{
|
|
||||||
return toAjax(logininforService.deleteLogininforByIds(infoIds));
|
return toAjax(logininforService.deleteLogininforByIds(infoIds));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("清空系统访问记录")
|
||||||
@PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')")
|
@PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')")
|
||||||
@Log(title = "登录日志", businessType = BusinessType.CLEAN)
|
@Log(title = "登录日志", businessType = BusinessType.CLEAN)
|
||||||
@DeleteMapping("/clean")
|
@DeleteMapping("/clean")
|
||||||
public AjaxResult clean()
|
public AjaxResult<Void> clean() {
|
||||||
{
|
|
||||||
logininforService.cleanLogininfor();
|
logininforService.cleanLogininfor();
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
@ -8,8 +8,12 @@ import com.ruoyi.common.enums.BusinessType;
|
|||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
import com.ruoyi.system.domain.SysOperLog;
|
import com.ruoyi.system.domain.SysOperLog;
|
||||||
import com.ruoyi.system.service.ISysOperLogService;
|
import com.ruoyi.system.service.ISysOperLogService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
@ -18,44 +22,46 @@ import java.util.List;
|
|||||||
/**
|
/**
|
||||||
* 操作日志记录
|
* 操作日志记录
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
|
@Validated
|
||||||
|
@Api(value = "操作日志记录", tags = {"操作日志记录管理"})
|
||||||
|
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/monitor/operlog")
|
@RequestMapping("/monitor/operlog")
|
||||||
public class SysOperlogController extends BaseController
|
public class SysOperlogController extends BaseController {
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private ISysOperLogService operLogService;
|
|
||||||
|
|
||||||
|
private final ISysOperLogService operLogService;
|
||||||
|
|
||||||
|
@ApiOperation("查询操作日志记录列表")
|
||||||
@PreAuthorize("@ss.hasPermi('monitor:operlog:list')")
|
@PreAuthorize("@ss.hasPermi('monitor:operlog:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(SysOperLog operLog)
|
public TableDataInfo<SysOperLog> list(SysOperLog operLog) {
|
||||||
{
|
|
||||||
return operLogService.selectPageOperLogList(operLog);
|
return operLogService.selectPageOperLogList(operLog);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("导出操作日志记录列表")
|
||||||
@Log(title = "操作日志", businessType = BusinessType.EXPORT)
|
@Log(title = "操作日志", businessType = BusinessType.EXPORT)
|
||||||
@PreAuthorize("@ss.hasPermi('monitor:operlog:export')")
|
@PreAuthorize("@ss.hasPermi('monitor:operlog:export')")
|
||||||
@GetMapping("/export")
|
@GetMapping("/export")
|
||||||
public void export(SysOperLog operLog, HttpServletResponse response)
|
public void export(SysOperLog operLog, HttpServletResponse response) {
|
||||||
{
|
|
||||||
List<SysOperLog> list = operLogService.selectOperLogList(operLog);
|
List<SysOperLog> list = operLogService.selectOperLogList(operLog);
|
||||||
ExcelUtil.exportExcel(list, "操作日志", SysOperLog.class, response);
|
ExcelUtil.exportExcel(list, "操作日志", SysOperLog.class, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除操作日志记录")
|
||||||
@Log(title = "操作日志", businessType = BusinessType.DELETE)
|
@Log(title = "操作日志", businessType = BusinessType.DELETE)
|
||||||
@PreAuthorize("@ss.hasPermi('monitor:operlog:remove')")
|
@PreAuthorize("@ss.hasPermi('monitor:operlog:remove')")
|
||||||
@DeleteMapping("/{operIds}")
|
@DeleteMapping("/{operIds}")
|
||||||
public AjaxResult remove(@PathVariable Long[] operIds)
|
public AjaxResult<Void> remove(@PathVariable Long[] operIds) {
|
||||||
{
|
|
||||||
return toAjax(operLogService.deleteOperLogByIds(operIds));
|
return toAjax(operLogService.deleteOperLogByIds(operIds));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("清空操作日志记录")
|
||||||
@Log(title = "操作日志", businessType = BusinessType.CLEAN)
|
@Log(title = "操作日志", businessType = BusinessType.CLEAN)
|
||||||
@PreAuthorize("@ss.hasPermi('monitor:operlog:remove')")
|
@PreAuthorize("@ss.hasPermi('monitor:operlog:remove')")
|
||||||
@DeleteMapping("/clean")
|
@DeleteMapping("/clean")
|
||||||
public AjaxResult clean()
|
public AjaxResult<Void> clean() {
|
||||||
{
|
|
||||||
operLogService.cleanOperLog();
|
operLogService.cleanOperLog();
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,9 @@ import com.ruoyi.common.utils.RedisUtils;
|
|||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.ruoyi.system.domain.SysUserOnline;
|
import com.ruoyi.system.domain.SysUserOnline;
|
||||||
import com.ruoyi.system.service.ISysUserOnlineService;
|
import com.ruoyi.system.service.ISysUserOnlineService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@ -24,47 +27,37 @@ import java.util.List;
|
|||||||
/**
|
/**
|
||||||
* 在线用户监控
|
* 在线用户监控
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
|
@Api(value = "在线用户监控", tags = {"在线用户监控管理"})
|
||||||
|
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/monitor/online")
|
@RequestMapping("/monitor/online")
|
||||||
public class SysUserOnlineController extends BaseController
|
public class SysUserOnlineController extends BaseController {
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private ISysUserOnlineService userOnlineService;
|
|
||||||
|
|
||||||
|
private final ISysUserOnlineService userOnlineService;
|
||||||
|
|
||||||
|
@ApiOperation("在线用户列表")
|
||||||
@PreAuthorize("@ss.hasPermi('monitor:online:list')")
|
@PreAuthorize("@ss.hasPermi('monitor:online:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(String ipaddr, String userName)
|
public TableDataInfo<SysUserOnline> list(String ipaddr, String userName) {
|
||||||
{
|
|
||||||
Collection<String> keys = RedisUtils.keys(Constants.LOGIN_TOKEN_KEY + "*");
|
Collection<String> keys = RedisUtils.keys(Constants.LOGIN_TOKEN_KEY + "*");
|
||||||
List<SysUserOnline> userOnlineList = new ArrayList<SysUserOnline>();
|
List<SysUserOnline> userOnlineList = new ArrayList<SysUserOnline>();
|
||||||
for (String key : keys)
|
for (String key : keys) {
|
||||||
{
|
|
||||||
LoginUser user = RedisUtils.getCacheObject(key);
|
LoginUser user = RedisUtils.getCacheObject(key);
|
||||||
if (StringUtils.isNotEmpty(ipaddr) && StringUtils.isNotEmpty(userName))
|
if (StringUtils.isNotEmpty(ipaddr) && StringUtils.isNotEmpty(userName)) {
|
||||||
{
|
if (StringUtils.equals(ipaddr, user.getIpaddr()) && StringUtils.equals(userName, user.getUsername())) {
|
||||||
if (StringUtils.equals(ipaddr, user.getIpaddr()) && StringUtils.equals(userName, user.getUsername()))
|
|
||||||
{
|
|
||||||
userOnlineList.add(userOnlineService.selectOnlineByInfo(ipaddr, userName, user));
|
userOnlineList.add(userOnlineService.selectOnlineByInfo(ipaddr, userName, user));
|
||||||
}
|
}
|
||||||
}
|
} else if (StringUtils.isNotEmpty(ipaddr)) {
|
||||||
else if (StringUtils.isNotEmpty(ipaddr))
|
if (StringUtils.equals(ipaddr, user.getIpaddr())) {
|
||||||
{
|
|
||||||
if (StringUtils.equals(ipaddr, user.getIpaddr()))
|
|
||||||
{
|
|
||||||
userOnlineList.add(userOnlineService.selectOnlineByIpaddr(ipaddr, user));
|
userOnlineList.add(userOnlineService.selectOnlineByIpaddr(ipaddr, user));
|
||||||
}
|
}
|
||||||
}
|
} else if (StringUtils.isNotEmpty(userName) && StringUtils.isNotNull(user.getUser())) {
|
||||||
else if (StringUtils.isNotEmpty(userName) && StringUtils.isNotNull(user.getUser()))
|
if (StringUtils.equals(userName, user.getUsername())) {
|
||||||
{
|
|
||||||
if (StringUtils.equals(userName, user.getUsername()))
|
|
||||||
{
|
|
||||||
userOnlineList.add(userOnlineService.selectOnlineByUserName(userName, user));
|
userOnlineList.add(userOnlineService.selectOnlineByUserName(userName, user));
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
userOnlineList.add(userOnlineService.loginUserToUserOnline(user));
|
userOnlineList.add(userOnlineService.loginUserToUserOnline(user));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -76,11 +69,11 @@ public class SysUserOnlineController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 强退用户
|
* 强退用户
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("强退用户")
|
||||||
@PreAuthorize("@ss.hasPermi('monitor:online:forceLogout')")
|
@PreAuthorize("@ss.hasPermi('monitor:online:forceLogout')")
|
||||||
@Log(title = "在线用户", businessType = BusinessType.FORCE)
|
@Log(title = "在线用户", businessType = BusinessType.FORCE)
|
||||||
@DeleteMapping("/{tokenId}")
|
@DeleteMapping("/{tokenId}")
|
||||||
public AjaxResult forceLogout(@PathVariable String tokenId)
|
public AjaxResult<Void> forceLogout(@PathVariable String tokenId) {
|
||||||
{
|
|
||||||
RedisUtils.deleteObject(Constants.LOGIN_TOKEN_KEY + tokenId);
|
RedisUtils.deleteObject(Constants.LOGIN_TOKEN_KEY + tokenId);
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,9 @@ import com.ruoyi.common.enums.BusinessType;
|
|||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
import com.ruoyi.system.domain.SysConfig;
|
import com.ruoyi.system.domain.SysConfig;
|
||||||
import com.ruoyi.system.service.ISysConfigService;
|
import com.ruoyi.system.service.ISysConfigService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@ -21,30 +24,32 @@ import java.util.List;
|
|||||||
/**
|
/**
|
||||||
* 参数配置 信息操作处理
|
* 参数配置 信息操作处理
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
|
@Validated
|
||||||
|
@Api(value = "参数配置控制器", tags = {"参数配置管理"})
|
||||||
|
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/system/config")
|
@RequestMapping("/system/config")
|
||||||
public class SysConfigController extends BaseController
|
public class SysConfigController extends BaseController {
|
||||||
{
|
|
||||||
@Autowired
|
private final ISysConfigService configService;
|
||||||
private ISysConfigService configService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取参数配置列表
|
* 获取参数配置列表
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("获取参数配置列表")
|
||||||
@PreAuthorize("@ss.hasPermi('system:config:list')")
|
@PreAuthorize("@ss.hasPermi('system:config:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(SysConfig config)
|
public TableDataInfo<SysConfig> list(SysConfig config) {
|
||||||
{
|
|
||||||
return configService.selectPageConfigList(config);
|
return configService.selectPageConfigList(config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("导出参数配置列表")
|
||||||
@Log(title = "参数管理", businessType = BusinessType.EXPORT)
|
@Log(title = "参数管理", businessType = BusinessType.EXPORT)
|
||||||
@PreAuthorize("@ss.hasPermi('system:config:export')")
|
@PreAuthorize("@ss.hasPermi('system:config:export')")
|
||||||
@GetMapping("/export")
|
@GetMapping("/export")
|
||||||
public void export(SysConfig config, HttpServletResponse response)
|
public void export(SysConfig config, HttpServletResponse response) {
|
||||||
{
|
|
||||||
List<SysConfig> list = configService.selectConfigList(config);
|
List<SysConfig> list = configService.selectConfigList(config);
|
||||||
ExcelUtil.exportExcel(list, "参数数据", SysConfig.class, response);
|
ExcelUtil.exportExcel(list, "参数数据", SysConfig.class, response);
|
||||||
}
|
}
|
||||||
@ -52,33 +57,32 @@ public class SysConfigController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 根据参数编号获取详细信息
|
* 根据参数编号获取详细信息
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("根据参数编号获取详细信息")
|
||||||
@PreAuthorize("@ss.hasPermi('system:config:query')")
|
@PreAuthorize("@ss.hasPermi('system:config:query')")
|
||||||
@GetMapping(value = "/{configId}")
|
@GetMapping(value = "/{configId}")
|
||||||
public AjaxResult getInfo(@PathVariable Long configId)
|
public AjaxResult<SysConfig> getInfo(@PathVariable Long configId) {
|
||||||
{
|
|
||||||
return AjaxResult.success(configService.selectConfigById(configId));
|
return AjaxResult.success(configService.selectConfigById(configId));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据参数键名查询参数值
|
* 根据参数键名查询参数值
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("根据参数键名查询参数值")
|
||||||
@GetMapping(value = "/configKey/{configKey}")
|
@GetMapping(value = "/configKey/{configKey}")
|
||||||
public AjaxResult getConfigKey(@PathVariable String configKey)
|
public AjaxResult<Void> getConfigKey(@PathVariable String configKey) {
|
||||||
{
|
|
||||||
return AjaxResult.success(configService.selectConfigByKey(configKey));
|
return AjaxResult.success(configService.selectConfigByKey(configKey));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增参数配置
|
* 新增参数配置
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("新增参数配置")
|
||||||
@PreAuthorize("@ss.hasPermi('system:config:add')")
|
@PreAuthorize("@ss.hasPermi('system:config:add')")
|
||||||
@Log(title = "参数管理", businessType = BusinessType.INSERT)
|
@Log(title = "参数管理", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
@RepeatSubmit
|
@RepeatSubmit
|
||||||
public AjaxResult add(@Validated @RequestBody SysConfig config)
|
public AjaxResult<Void> add(@Validated @RequestBody SysConfig config) {
|
||||||
{
|
if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) {
|
||||||
if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config)))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在");
|
return AjaxResult.error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在");
|
||||||
}
|
}
|
||||||
config.setCreateBy(getUsername());
|
config.setCreateBy(getUsername());
|
||||||
@ -88,13 +92,12 @@ public class SysConfigController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 修改参数配置
|
* 修改参数配置
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("修改参数配置")
|
||||||
@PreAuthorize("@ss.hasPermi('system:config:edit')")
|
@PreAuthorize("@ss.hasPermi('system:config:edit')")
|
||||||
@Log(title = "参数管理", businessType = BusinessType.UPDATE)
|
@Log(title = "参数管理", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@Validated @RequestBody SysConfig config)
|
public AjaxResult<Void> edit(@Validated @RequestBody SysConfig config) {
|
||||||
{
|
if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) {
|
||||||
if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config)))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在");
|
return AjaxResult.error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在");
|
||||||
}
|
}
|
||||||
config.setUpdateBy(getUsername());
|
config.setUpdateBy(getUsername());
|
||||||
@ -104,11 +107,11 @@ public class SysConfigController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 删除参数配置
|
* 删除参数配置
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("删除参数配置")
|
||||||
@PreAuthorize("@ss.hasPermi('system:config:remove')")
|
@PreAuthorize("@ss.hasPermi('system:config:remove')")
|
||||||
@Log(title = "参数管理", businessType = BusinessType.DELETE)
|
@Log(title = "参数管理", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{configIds}")
|
@DeleteMapping("/{configIds}")
|
||||||
public AjaxResult remove(@PathVariable Long[] configIds)
|
public AjaxResult<Void> remove(@PathVariable Long[] configIds) {
|
||||||
{
|
|
||||||
configService.deleteConfigByIds(configIds);
|
configService.deleteConfigByIds(configIds);
|
||||||
return success();
|
return success();
|
||||||
}
|
}
|
||||||
@ -116,11 +119,11 @@ public class SysConfigController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 刷新参数缓存
|
* 刷新参数缓存
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("刷新参数缓存")
|
||||||
@PreAuthorize("@ss.hasPermi('system:config:remove')")
|
@PreAuthorize("@ss.hasPermi('system:config:remove')")
|
||||||
@Log(title = "参数管理", businessType = BusinessType.CLEAN)
|
@Log(title = "参数管理", businessType = BusinessType.CLEAN)
|
||||||
@DeleteMapping("/refreshCache")
|
@DeleteMapping("/refreshCache")
|
||||||
public AjaxResult refreshCache()
|
public AjaxResult<Void> refreshCache() {
|
||||||
{
|
|
||||||
configService.resetConfigCache();
|
configService.resetConfigCache();
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
@ -5,39 +5,44 @@ import com.ruoyi.common.annotation.Log;
|
|||||||
import com.ruoyi.common.constant.UserConstants;
|
import com.ruoyi.common.constant.UserConstants;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.domain.TreeSelect;
|
||||||
import com.ruoyi.common.core.domain.entity.SysDept;
|
import com.ruoyi.common.core.domain.entity.SysDept;
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.ruoyi.system.service.ISysDeptService;
|
import com.ruoyi.system.service.ISysDeptService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门信息
|
* 部门信息
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
|
@Validated
|
||||||
|
@Api(value = "部门控制器", tags = {"部门管理"})
|
||||||
|
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/system/dept")
|
@RequestMapping("/system/dept")
|
||||||
public class SysDeptController extends BaseController
|
public class SysDeptController extends BaseController {
|
||||||
{
|
|
||||||
@Autowired
|
private final ISysDeptService deptService;
|
||||||
private ISysDeptService deptService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取部门列表
|
* 获取部门列表
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("获取部门列表")
|
||||||
@PreAuthorize("@ss.hasPermi('system:dept:list')")
|
@PreAuthorize("@ss.hasPermi('system:dept:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public AjaxResult list(SysDept dept)
|
public AjaxResult<List<SysDept>> list(SysDept dept) {
|
||||||
{
|
|
||||||
List<SysDept> depts = deptService.selectDeptList(dept);
|
List<SysDept> depts = deptService.selectDeptList(dept);
|
||||||
return AjaxResult.success(depts);
|
return AjaxResult.success(depts);
|
||||||
}
|
}
|
||||||
@ -45,31 +50,23 @@ public class SysDeptController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 查询部门列表(排除节点)
|
* 查询部门列表(排除节点)
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("查询部门列表(排除节点)")
|
||||||
@PreAuthorize("@ss.hasPermi('system:dept:list')")
|
@PreAuthorize("@ss.hasPermi('system:dept:list')")
|
||||||
@GetMapping("/list/exclude/{deptId}")
|
@GetMapping("/list/exclude/{deptId}")
|
||||||
public AjaxResult excludeChild(@PathVariable(value = "deptId", required = false) Long deptId)
|
public AjaxResult<List<SysDept>> excludeChild(@PathVariable(value = "deptId", required = false) Long deptId) {
|
||||||
{
|
|
||||||
List<SysDept> depts = deptService.selectDeptList(new SysDept());
|
List<SysDept> depts = deptService.selectDeptList(new SysDept());
|
||||||
Iterator<SysDept> it = depts.iterator();
|
depts.removeIf(d -> d.getDeptId().equals(deptId)
|
||||||
while (it.hasNext())
|
|| ArrayUtil.contains(StringUtils.split(d.getAncestors(), ","), deptId + ""));
|
||||||
{
|
|
||||||
SysDept d = (SysDept) it.next();
|
|
||||||
if (d.getDeptId().intValue() == deptId
|
|
||||||
|| ArrayUtil.contains(StringUtils.split(d.getAncestors(), ","), deptId + ""))
|
|
||||||
{
|
|
||||||
it.remove();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return AjaxResult.success(depts);
|
return AjaxResult.success(depts);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据部门编号获取详细信息
|
* 根据部门编号获取详细信息
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("根据部门编号获取详细信息")
|
||||||
@PreAuthorize("@ss.hasPermi('system:dept:query')")
|
@PreAuthorize("@ss.hasPermi('system:dept:query')")
|
||||||
@GetMapping(value = "/{deptId}")
|
@GetMapping(value = "/{deptId}")
|
||||||
public AjaxResult getInfo(@PathVariable Long deptId)
|
public AjaxResult<SysDept> getInfo(@PathVariable Long deptId) {
|
||||||
{
|
|
||||||
deptService.checkDeptDataScope(deptId);
|
deptService.checkDeptDataScope(deptId);
|
||||||
return AjaxResult.success(deptService.selectDeptById(deptId));
|
return AjaxResult.success(deptService.selectDeptById(deptId));
|
||||||
}
|
}
|
||||||
@ -77,9 +74,9 @@ public class SysDeptController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 获取部门下拉树列表
|
* 获取部门下拉树列表
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("获取部门下拉树列表")
|
||||||
@GetMapping("/treeselect")
|
@GetMapping("/treeselect")
|
||||||
public AjaxResult treeselect(SysDept dept)
|
public AjaxResult<List<TreeSelect>> treeselect(SysDept dept) {
|
||||||
{
|
|
||||||
List<SysDept> depts = deptService.selectDeptList(dept);
|
List<SysDept> depts = deptService.selectDeptList(dept);
|
||||||
return AjaxResult.success(deptService.buildDeptTreeSelect(depts));
|
return AjaxResult.success(deptService.buildDeptTreeSelect(depts));
|
||||||
}
|
}
|
||||||
@ -87,9 +84,9 @@ public class SysDeptController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 加载对应角色部门列表树
|
* 加载对应角色部门列表树
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("加载对应角色部门列表树")
|
||||||
@GetMapping(value = "/roleDeptTreeselect/{roleId}")
|
@GetMapping(value = "/roleDeptTreeselect/{roleId}")
|
||||||
public AjaxResult roleDeptTreeselect(@PathVariable("roleId") Long roleId)
|
public AjaxResult<Map<String, Object>> roleDeptTreeselect(@PathVariable("roleId") Long roleId) {
|
||||||
{
|
|
||||||
List<SysDept> depts = deptService.selectDeptList(new SysDept());
|
List<SysDept> depts = deptService.selectDeptList(new SysDept());
|
||||||
Map<String, Object> ajax = new HashMap<>();
|
Map<String, Object> ajax = new HashMap<>();
|
||||||
ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId));
|
ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId));
|
||||||
@ -100,13 +97,12 @@ public class SysDeptController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 新增部门
|
* 新增部门
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("新增部门")
|
||||||
@PreAuthorize("@ss.hasPermi('system:dept:add')")
|
@PreAuthorize("@ss.hasPermi('system:dept:add')")
|
||||||
@Log(title = "部门管理", businessType = BusinessType.INSERT)
|
@Log(title = "部门管理", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@Validated @RequestBody SysDept dept)
|
public AjaxResult<Void> add(@Validated @RequestBody SysDept dept) {
|
||||||
{
|
if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept))) {
|
||||||
if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept)))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
return AjaxResult.error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
||||||
}
|
}
|
||||||
dept.setCreateBy(getUsername());
|
dept.setCreateBy(getUsername());
|
||||||
@ -116,22 +112,17 @@ public class SysDeptController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 修改部门
|
* 修改部门
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("修改部门")
|
||||||
@PreAuthorize("@ss.hasPermi('system:dept:edit')")
|
@PreAuthorize("@ss.hasPermi('system:dept:edit')")
|
||||||
@Log(title = "部门管理", businessType = BusinessType.UPDATE)
|
@Log(title = "部门管理", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@Validated @RequestBody SysDept dept)
|
public AjaxResult<Void> edit(@Validated @RequestBody SysDept dept) {
|
||||||
{
|
if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept))) {
|
||||||
if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept)))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
return AjaxResult.error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
||||||
}
|
} else if (dept.getParentId().equals(dept.getDeptId())) {
|
||||||
else if (dept.getParentId().equals(dept.getDeptId()))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己");
|
return AjaxResult.error("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己");
|
||||||
}
|
} else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus())
|
||||||
else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus())
|
&& deptService.selectNormalChildrenDeptById(dept.getDeptId()) > 0) {
|
||||||
&& deptService.selectNormalChildrenDeptById(dept.getDeptId()) > 0)
|
|
||||||
{
|
|
||||||
return AjaxResult.error("该部门包含未停用的子部门!");
|
return AjaxResult.error("该部门包含未停用的子部门!");
|
||||||
}
|
}
|
||||||
dept.setUpdateBy(getUsername());
|
dept.setUpdateBy(getUsername());
|
||||||
@ -141,17 +132,15 @@ public class SysDeptController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 删除部门
|
* 删除部门
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("删除部门")
|
||||||
@PreAuthorize("@ss.hasPermi('system:dept:remove')")
|
@PreAuthorize("@ss.hasPermi('system:dept:remove')")
|
||||||
@Log(title = "部门管理", businessType = BusinessType.DELETE)
|
@Log(title = "部门管理", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{deptId}")
|
@DeleteMapping("/{deptId}")
|
||||||
public AjaxResult remove(@PathVariable Long deptId)
|
public AjaxResult<Void> remove(@PathVariable Long deptId) {
|
||||||
{
|
if (deptService.hasChildByDeptId(deptId)) {
|
||||||
if (deptService.hasChildByDeptId(deptId))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("存在下级部门,不允许删除");
|
return AjaxResult.error("存在下级部门,不允许删除");
|
||||||
}
|
}
|
||||||
if (deptService.checkDeptExistUser(deptId))
|
if (deptService.checkDeptExistUser(deptId)) {
|
||||||
{
|
|
||||||
return AjaxResult.error("部门存在用户,不允许删除");
|
return AjaxResult.error("部门存在用户,不允许删除");
|
||||||
}
|
}
|
||||||
return toAjax(deptService.deleteDeptById(deptId));
|
return toAjax(deptService.deleteDeptById(deptId));
|
||||||
|
@ -10,6 +10,9 @@ import com.ruoyi.common.utils.StringUtils;
|
|||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
import com.ruoyi.system.service.ISysDictDataService;
|
import com.ruoyi.system.service.ISysDictDataService;
|
||||||
import com.ruoyi.system.service.ISysDictTypeService;
|
import com.ruoyi.system.service.ISysDictTypeService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@ -22,30 +25,30 @@ import java.util.List;
|
|||||||
/**
|
/**
|
||||||
* 数据字典信息
|
* 数据字典信息
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
|
@Validated
|
||||||
|
@Api(value = "数据字典信息控制器", tags = {"数据字典信息管理"})
|
||||||
|
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/system/dict/data")
|
@RequestMapping("/system/dict/data")
|
||||||
public class SysDictDataController extends BaseController
|
public class SysDictDataController extends BaseController {
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private ISysDictDataService dictDataService;
|
|
||||||
|
|
||||||
@Autowired
|
private final ISysDictDataService dictDataService;
|
||||||
private ISysDictTypeService dictTypeService;
|
private final ISysDictTypeService dictTypeService;
|
||||||
|
|
||||||
|
@ApiOperation("查询字典数据列表")
|
||||||
@PreAuthorize("@ss.hasPermi('system:dict:list')")
|
@PreAuthorize("@ss.hasPermi('system:dict:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(SysDictData dictData)
|
public TableDataInfo<SysDictData> list(SysDictData dictData) {
|
||||||
{
|
|
||||||
return dictDataService.selectPageDictDataList(dictData);
|
return dictDataService.selectPageDictDataList(dictData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("导出字典数据列表")
|
||||||
@Log(title = "字典数据", businessType = BusinessType.EXPORT)
|
@Log(title = "字典数据", businessType = BusinessType.EXPORT)
|
||||||
@PreAuthorize("@ss.hasPermi('system:dict:export')")
|
@PreAuthorize("@ss.hasPermi('system:dict:export')")
|
||||||
@GetMapping("/export")
|
@GetMapping("/export")
|
||||||
public void export(SysDictData dictData, HttpServletResponse response)
|
public void export(SysDictData dictData, HttpServletResponse response) {
|
||||||
{
|
|
||||||
List<SysDictData> list = dictDataService.selectDictDataList(dictData);
|
List<SysDictData> list = dictDataService.selectDictDataList(dictData);
|
||||||
ExcelUtil.exportExcel(list, "字典数据", SysDictData.class, response);
|
ExcelUtil.exportExcel(list, "字典数据", SysDictData.class, response);
|
||||||
}
|
}
|
||||||
@ -53,23 +56,22 @@ public class SysDictDataController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 查询字典数据详细
|
* 查询字典数据详细
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("查询字典数据详细")
|
||||||
@PreAuthorize("@ss.hasPermi('system:dict:query')")
|
@PreAuthorize("@ss.hasPermi('system:dict:query')")
|
||||||
@GetMapping(value = "/{dictCode}")
|
@GetMapping(value = "/{dictCode}")
|
||||||
public AjaxResult getInfo(@PathVariable Long dictCode)
|
public AjaxResult<SysDictData> getInfo(@PathVariable Long dictCode) {
|
||||||
{
|
|
||||||
return AjaxResult.success(dictDataService.selectDictDataById(dictCode));
|
return AjaxResult.success(dictDataService.selectDictDataById(dictCode));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据字典类型查询字典数据信息
|
* 根据字典类型查询字典数据信息
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("根据字典类型查询字典数据信息")
|
||||||
@GetMapping(value = "/type/{dictType}")
|
@GetMapping(value = "/type/{dictType}")
|
||||||
public AjaxResult dictType(@PathVariable String dictType)
|
public AjaxResult<List<SysDictData>> dictType(@PathVariable String dictType) {
|
||||||
{
|
|
||||||
List<SysDictData> data = dictTypeService.selectDictDataByType(dictType);
|
List<SysDictData> data = dictTypeService.selectDictDataByType(dictType);
|
||||||
if (StringUtils.isNull(data))
|
if (StringUtils.isNull(data)) {
|
||||||
{
|
data = new ArrayList<>();
|
||||||
data = new ArrayList<SysDictData>();
|
|
||||||
}
|
}
|
||||||
return AjaxResult.success(data);
|
return AjaxResult.success(data);
|
||||||
}
|
}
|
||||||
@ -77,11 +79,11 @@ public class SysDictDataController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 新增字典类型
|
* 新增字典类型
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("新增字典类型")
|
||||||
@PreAuthorize("@ss.hasPermi('system:dict:add')")
|
@PreAuthorize("@ss.hasPermi('system:dict:add')")
|
||||||
@Log(title = "字典数据", businessType = BusinessType.INSERT)
|
@Log(title = "字典数据", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@Validated @RequestBody SysDictData dict)
|
public AjaxResult<Void> add(@Validated @RequestBody SysDictData dict) {
|
||||||
{
|
|
||||||
dict.setCreateBy(getUsername());
|
dict.setCreateBy(getUsername());
|
||||||
return toAjax(dictDataService.insertDictData(dict));
|
return toAjax(dictDataService.insertDictData(dict));
|
||||||
}
|
}
|
||||||
@ -89,11 +91,11 @@ public class SysDictDataController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 修改保存字典类型
|
* 修改保存字典类型
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("修改保存字典类型")
|
||||||
@PreAuthorize("@ss.hasPermi('system:dict:edit')")
|
@PreAuthorize("@ss.hasPermi('system:dict:edit')")
|
||||||
@Log(title = "字典数据", businessType = BusinessType.UPDATE)
|
@Log(title = "字典数据", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@Validated @RequestBody SysDictData dict)
|
public AjaxResult<Void> edit(@Validated @RequestBody SysDictData dict) {
|
||||||
{
|
|
||||||
dict.setUpdateBy(getUsername());
|
dict.setUpdateBy(getUsername());
|
||||||
return toAjax(dictDataService.updateDictData(dict));
|
return toAjax(dictDataService.updateDictData(dict));
|
||||||
}
|
}
|
||||||
@ -101,11 +103,11 @@ public class SysDictDataController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 删除字典类型
|
* 删除字典类型
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("删除字典类型")
|
||||||
@PreAuthorize("@ss.hasPermi('system:dict:remove')")
|
@PreAuthorize("@ss.hasPermi('system:dict:remove')")
|
||||||
@Log(title = "字典类型", businessType = BusinessType.DELETE)
|
@Log(title = "字典类型", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{dictCodes}")
|
@DeleteMapping("/{dictCodes}")
|
||||||
public AjaxResult remove(@PathVariable Long[] dictCodes)
|
public AjaxResult<Void> remove(@PathVariable Long[] dictCodes) {
|
||||||
{
|
|
||||||
dictDataService.deleteDictDataByIds(dictCodes);
|
dictDataService.deleteDictDataByIds(dictCodes);
|
||||||
return success();
|
return success();
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,9 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
|||||||
import com.ruoyi.common.enums.BusinessType;
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
import com.ruoyi.system.service.ISysDictTypeService;
|
import com.ruoyi.system.service.ISysDictTypeService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@ -20,27 +23,29 @@ import java.util.List;
|
|||||||
/**
|
/**
|
||||||
* 数据字典信息
|
* 数据字典信息
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
|
@Validated
|
||||||
|
@Api(value = "数据字典信息控制器", tags = {"数据字典信息管理"})
|
||||||
|
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/system/dict/type")
|
@RequestMapping("/system/dict/type")
|
||||||
public class SysDictTypeController extends BaseController
|
public class SysDictTypeController extends BaseController {
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private ISysDictTypeService dictTypeService;
|
|
||||||
|
|
||||||
|
private final ISysDictTypeService dictTypeService;
|
||||||
|
|
||||||
|
@ApiOperation("查询字典类型列表")
|
||||||
@PreAuthorize("@ss.hasPermi('system:dict:list')")
|
@PreAuthorize("@ss.hasPermi('system:dict:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(SysDictType dictType)
|
public TableDataInfo<SysDictType> list(SysDictType dictType) {
|
||||||
{
|
|
||||||
return dictTypeService.selectPageDictTypeList(dictType);
|
return dictTypeService.selectPageDictTypeList(dictType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("导出字典类型列表")
|
||||||
@Log(title = "字典类型", businessType = BusinessType.EXPORT)
|
@Log(title = "字典类型", businessType = BusinessType.EXPORT)
|
||||||
@PreAuthorize("@ss.hasPermi('system:dict:export')")
|
@PreAuthorize("@ss.hasPermi('system:dict:export')")
|
||||||
@GetMapping("/export")
|
@GetMapping("/export")
|
||||||
public void export(SysDictType dictType, HttpServletResponse response)
|
public void export(SysDictType dictType, HttpServletResponse response) {
|
||||||
{
|
|
||||||
List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
|
List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
|
||||||
ExcelUtil.exportExcel(list, "字典类型", SysDictType.class, response);
|
ExcelUtil.exportExcel(list, "字典类型", SysDictType.class, response);
|
||||||
}
|
}
|
||||||
@ -48,23 +53,22 @@ public class SysDictTypeController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 查询字典类型详细
|
* 查询字典类型详细
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("查询字典类型详细")
|
||||||
@PreAuthorize("@ss.hasPermi('system:dict:query')")
|
@PreAuthorize("@ss.hasPermi('system:dict:query')")
|
||||||
@GetMapping(value = "/{dictId}")
|
@GetMapping(value = "/{dictId}")
|
||||||
public AjaxResult getInfo(@PathVariable Long dictId)
|
public AjaxResult<SysDictType> getInfo(@PathVariable Long dictId) {
|
||||||
{
|
|
||||||
return AjaxResult.success(dictTypeService.selectDictTypeById(dictId));
|
return AjaxResult.success(dictTypeService.selectDictTypeById(dictId));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增字典类型
|
* 新增字典类型
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("新增字典类型")
|
||||||
@PreAuthorize("@ss.hasPermi('system:dict:add')")
|
@PreAuthorize("@ss.hasPermi('system:dict:add')")
|
||||||
@Log(title = "字典类型", businessType = BusinessType.INSERT)
|
@Log(title = "字典类型", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@Validated @RequestBody SysDictType dict)
|
public AjaxResult<Void> add(@Validated @RequestBody SysDictType dict) {
|
||||||
{
|
if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) {
|
||||||
if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict)))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在");
|
return AjaxResult.error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在");
|
||||||
}
|
}
|
||||||
dict.setCreateBy(getUsername());
|
dict.setCreateBy(getUsername());
|
||||||
@ -74,13 +78,12 @@ public class SysDictTypeController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 修改字典类型
|
* 修改字典类型
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("修改字典类型")
|
||||||
@PreAuthorize("@ss.hasPermi('system:dict:edit')")
|
@PreAuthorize("@ss.hasPermi('system:dict:edit')")
|
||||||
@Log(title = "字典类型", businessType = BusinessType.UPDATE)
|
@Log(title = "字典类型", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@Validated @RequestBody SysDictType dict)
|
public AjaxResult<Void> edit(@Validated @RequestBody SysDictType dict) {
|
||||||
{
|
if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) {
|
||||||
if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict)))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在");
|
return AjaxResult.error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在");
|
||||||
}
|
}
|
||||||
dict.setUpdateBy(getUsername());
|
dict.setUpdateBy(getUsername());
|
||||||
@ -90,11 +93,11 @@ public class SysDictTypeController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 删除字典类型
|
* 删除字典类型
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("删除字典类型")
|
||||||
@PreAuthorize("@ss.hasPermi('system:dict:remove')")
|
@PreAuthorize("@ss.hasPermi('system:dict:remove')")
|
||||||
@Log(title = "字典类型", businessType = BusinessType.DELETE)
|
@Log(title = "字典类型", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{dictIds}")
|
@DeleteMapping("/{dictIds}")
|
||||||
public AjaxResult remove(@PathVariable Long[] dictIds)
|
public AjaxResult<Void> remove(@PathVariable Long[] dictIds) {
|
||||||
{
|
|
||||||
dictTypeService.deleteDictTypeByIds(dictIds);
|
dictTypeService.deleteDictTypeByIds(dictIds);
|
||||||
return success();
|
return success();
|
||||||
}
|
}
|
||||||
@ -102,11 +105,11 @@ public class SysDictTypeController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 刷新字典缓存
|
* 刷新字典缓存
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("刷新字典缓存")
|
||||||
@PreAuthorize("@ss.hasPermi('system:dict:remove')")
|
@PreAuthorize("@ss.hasPermi('system:dict:remove')")
|
||||||
@Log(title = "字典类型", businessType = BusinessType.CLEAN)
|
@Log(title = "字典类型", businessType = BusinessType.CLEAN)
|
||||||
@DeleteMapping("/refreshCache")
|
@DeleteMapping("/refreshCache")
|
||||||
public AjaxResult refreshCache()
|
public AjaxResult<Void> refreshCache() {
|
||||||
{
|
|
||||||
dictTypeService.resetDictCache();
|
dictTypeService.resetDictCache();
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
@ -114,9 +117,9 @@ public class SysDictTypeController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 获取字典选择框列表
|
* 获取字典选择框列表
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("获取字典选择框列表")
|
||||||
@GetMapping("/optionselect")
|
@GetMapping("/optionselect")
|
||||||
public AjaxResult optionselect()
|
public AjaxResult<List<SysDictType>> optionselect() {
|
||||||
{
|
|
||||||
List<SysDictType> dictTypes = dictTypeService.selectDictTypeAll();
|
List<SysDictType> dictTypes = dictTypeService.selectDictTypeAll();
|
||||||
return AjaxResult.success(dictTypes);
|
return AjaxResult.success(dictTypes);
|
||||||
}
|
}
|
||||||
|
@ -1,29 +1,35 @@
|
|||||||
package com.ruoyi.web.controller.system;
|
package com.ruoyi.web.controller.system;
|
||||||
|
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
|
||||||
import com.ruoyi.common.config.RuoYiConfig;
|
import com.ruoyi.common.config.RuoYiConfig;
|
||||||
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 首页
|
* 首页
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
|
@Api(value = "首页控制器", tags = {"首页管理"})
|
||||||
|
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||||
@RestController
|
@RestController
|
||||||
public class SysIndexController
|
public class SysIndexController {
|
||||||
{
|
|
||||||
/** 系统基础配置 */
|
/**
|
||||||
@Autowired
|
* 系统基础配置
|
||||||
private RuoYiConfig ruoyiConfig;
|
*/
|
||||||
|
private final RuoYiConfig ruoyiConfig;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 访问首页,提示语
|
* 访问首页,提示语
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/")
|
@ApiOperation("访问首页,提示语")
|
||||||
public String index()
|
@GetMapping("/")
|
||||||
{
|
public String index() {
|
||||||
return StringUtils.format("欢迎使用{}后台管理框架,当前版本:v{},请通过前端地址访问。", ruoyiConfig.getName(), ruoyiConfig.getVersion());
|
return StringUtils.format("欢迎使用{}后台管理框架,当前版本:v{},请通过前端地址访问。", ruoyiConfig.getName(), ruoyiConfig.getVersion());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,10 +6,15 @@ import com.ruoyi.common.core.domain.entity.SysMenu;
|
|||||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||||
import com.ruoyi.common.core.domain.model.LoginBody;
|
import com.ruoyi.common.core.domain.model.LoginBody;
|
||||||
import com.ruoyi.common.utils.SecurityUtils;
|
import com.ruoyi.common.utils.SecurityUtils;
|
||||||
|
import com.ruoyi.system.domain.vo.RouterVo;
|
||||||
|
import com.ruoyi.system.service.ISysMenuService;
|
||||||
import com.ruoyi.system.service.SysLoginService;
|
import com.ruoyi.system.service.SysLoginService;
|
||||||
import com.ruoyi.system.service.SysPermissionService;
|
import com.ruoyi.system.service.SysPermissionService;
|
||||||
import com.ruoyi.system.service.ISysMenuService;
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
@ -23,19 +28,17 @@ import java.util.Set;
|
|||||||
/**
|
/**
|
||||||
* 登录验证
|
* 登录验证
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
|
@Validated
|
||||||
|
@Api(value = "数据字典信息控制器", tags = {"数据字典信息管理"})
|
||||||
|
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||||
@RestController
|
@RestController
|
||||||
public class SysLoginController
|
public class SysLoginController {
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private SysLoginService loginService;
|
|
||||||
|
|
||||||
@Autowired
|
private final SysLoginService loginService;
|
||||||
private ISysMenuService menuService;
|
private final ISysMenuService menuService;
|
||||||
|
private final SysPermissionService permissionService;
|
||||||
@Autowired
|
|
||||||
private SysPermissionService permissionService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 登录方法
|
* 登录方法
|
||||||
@ -43,9 +46,9 @@ public class SysLoginController
|
|||||||
* @param loginBody 登录信息
|
* @param loginBody 登录信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("登录方法")
|
||||||
@PostMapping("/login")
|
@PostMapping("/login")
|
||||||
public AjaxResult login(@RequestBody LoginBody loginBody)
|
public AjaxResult<Map<String, Object>> login(@RequestBody LoginBody loginBody) {
|
||||||
{
|
|
||||||
Map<String, Object> ajax = new HashMap<>();
|
Map<String, Object> ajax = new HashMap<>();
|
||||||
// 生成令牌
|
// 生成令牌
|
||||||
String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(),
|
String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(),
|
||||||
@ -59,9 +62,9 @@ public class SysLoginController
|
|||||||
*
|
*
|
||||||
* @return 用户信息
|
* @return 用户信息
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("获取用户信息")
|
||||||
@GetMapping("getInfo")
|
@GetMapping("getInfo")
|
||||||
public AjaxResult getInfo()
|
public AjaxResult<Map<String, Object>> getInfo() {
|
||||||
{
|
|
||||||
SysUser user = SecurityUtils.getLoginUser().getUser();
|
SysUser user = SecurityUtils.getLoginUser().getUser();
|
||||||
// 角色集合
|
// 角色集合
|
||||||
Set<String> roles = permissionService.getRolePermission(user);
|
Set<String> roles = permissionService.getRolePermission(user);
|
||||||
@ -79,9 +82,9 @@ public class SysLoginController
|
|||||||
*
|
*
|
||||||
* @return 路由信息
|
* @return 路由信息
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("获取路由信息")
|
||||||
@GetMapping("getRouters")
|
@GetMapping("getRouters")
|
||||||
public AjaxResult getRouters()
|
public AjaxResult<List<RouterVo>> getRouters() {
|
||||||
{
|
|
||||||
Long userId = SecurityUtils.getUserId();
|
Long userId = SecurityUtils.getUserId();
|
||||||
List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId);
|
List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId);
|
||||||
return AjaxResult.success(menuService.buildMenus(menus));
|
return AjaxResult.success(menuService.buildMenus(menus));
|
||||||
|
@ -4,10 +4,14 @@ import com.ruoyi.common.annotation.Log;
|
|||||||
import com.ruoyi.common.constant.UserConstants;
|
import com.ruoyi.common.constant.UserConstants;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.domain.TreeSelect;
|
||||||
import com.ruoyi.common.core.domain.entity.SysMenu;
|
import com.ruoyi.common.core.domain.entity.SysMenu;
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.ruoyi.system.service.ISysMenuService;
|
import com.ruoyi.system.service.ISysMenuService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@ -20,22 +24,24 @@ import java.util.Map;
|
|||||||
/**
|
/**
|
||||||
* 菜单信息
|
* 菜单信息
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
|
@Validated
|
||||||
|
@Api(value = "菜单信息控制器", tags = {"菜单信息管理"})
|
||||||
|
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/system/menu")
|
@RequestMapping("/system/menu")
|
||||||
public class SysMenuController extends BaseController
|
public class SysMenuController extends BaseController {
|
||||||
{
|
|
||||||
@Autowired
|
private final ISysMenuService menuService;
|
||||||
private ISysMenuService menuService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取菜单列表
|
* 获取菜单列表
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("获取菜单列表")
|
||||||
@PreAuthorize("@ss.hasPermi('system:menu:list')")
|
@PreAuthorize("@ss.hasPermi('system:menu:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public AjaxResult list(SysMenu menu)
|
public AjaxResult<List<SysMenu>> list(SysMenu menu) {
|
||||||
{
|
|
||||||
List<SysMenu> menus = menuService.selectMenuList(menu, getUserId());
|
List<SysMenu> menus = menuService.selectMenuList(menu, getUserId());
|
||||||
return AjaxResult.success(menus);
|
return AjaxResult.success(menus);
|
||||||
}
|
}
|
||||||
@ -43,19 +49,19 @@ public class SysMenuController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 根据菜单编号获取详细信息
|
* 根据菜单编号获取详细信息
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("根据菜单编号获取详细信息")
|
||||||
@PreAuthorize("@ss.hasPermi('system:menu:query')")
|
@PreAuthorize("@ss.hasPermi('system:menu:query')")
|
||||||
@GetMapping(value = "/{menuId}")
|
@GetMapping(value = "/{menuId}")
|
||||||
public AjaxResult getInfo(@PathVariable Long menuId)
|
public AjaxResult<SysMenu> getInfo(@PathVariable Long menuId) {
|
||||||
{
|
|
||||||
return AjaxResult.success(menuService.selectMenuById(menuId));
|
return AjaxResult.success(menuService.selectMenuById(menuId));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取菜单下拉树列表
|
* 获取菜单下拉树列表
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("获取菜单下拉树列表")
|
||||||
@GetMapping("/treeselect")
|
@GetMapping("/treeselect")
|
||||||
public AjaxResult treeselect(SysMenu menu)
|
public AjaxResult<List<TreeSelect>> treeselect(SysMenu menu) {
|
||||||
{
|
|
||||||
List<SysMenu> menus = menuService.selectMenuList(menu, getUserId());
|
List<SysMenu> menus = menuService.selectMenuList(menu, getUserId());
|
||||||
return AjaxResult.success(menuService.buildMenuTreeSelect(menus));
|
return AjaxResult.success(menuService.buildMenuTreeSelect(menus));
|
||||||
}
|
}
|
||||||
@ -63,9 +69,9 @@ public class SysMenuController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 加载对应角色菜单列表树
|
* 加载对应角色菜单列表树
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("加载对应角色菜单列表树")
|
||||||
@GetMapping(value = "/roleMenuTreeselect/{roleId}")
|
@GetMapping(value = "/roleMenuTreeselect/{roleId}")
|
||||||
public AjaxResult roleMenuTreeselect(@PathVariable("roleId") Long roleId)
|
public AjaxResult<Map<String, Object>> roleMenuTreeselect(@PathVariable("roleId") Long roleId) {
|
||||||
{
|
|
||||||
List<SysMenu> menus = menuService.selectMenuList(getUserId());
|
List<SysMenu> menus = menuService.selectMenuList(getUserId());
|
||||||
Map<String, Object> ajax = new HashMap<>();
|
Map<String, Object> ajax = new HashMap<>();
|
||||||
ajax.put("checkedKeys", menuService.selectMenuListByRoleId(roleId));
|
ajax.put("checkedKeys", menuService.selectMenuListByRoleId(roleId));
|
||||||
@ -76,17 +82,14 @@ public class SysMenuController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 新增菜单
|
* 新增菜单
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("新增菜单")
|
||||||
@PreAuthorize("@ss.hasPermi('system:menu:add')")
|
@PreAuthorize("@ss.hasPermi('system:menu:add')")
|
||||||
@Log(title = "菜单管理", businessType = BusinessType.INSERT)
|
@Log(title = "菜单管理", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@Validated @RequestBody SysMenu menu)
|
public AjaxResult<Void> add(@Validated @RequestBody SysMenu menu) {
|
||||||
{
|
if (UserConstants.NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu))) {
|
||||||
if (UserConstants.NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu)))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("新增菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
|
return AjaxResult.error("新增菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
|
||||||
}
|
} else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) {
|
||||||
else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath()))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("新增菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头");
|
return AjaxResult.error("新增菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头");
|
||||||
}
|
}
|
||||||
menu.setCreateBy(getUsername());
|
menu.setCreateBy(getUsername());
|
||||||
@ -96,21 +99,16 @@ public class SysMenuController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 修改菜单
|
* 修改菜单
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("修改菜单")
|
||||||
@PreAuthorize("@ss.hasPermi('system:menu:edit')")
|
@PreAuthorize("@ss.hasPermi('system:menu:edit')")
|
||||||
@Log(title = "菜单管理", businessType = BusinessType.UPDATE)
|
@Log(title = "菜单管理", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@Validated @RequestBody SysMenu menu)
|
public AjaxResult<Void> edit(@Validated @RequestBody SysMenu menu) {
|
||||||
{
|
if (UserConstants.NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu))) {
|
||||||
if (UserConstants.NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu)))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
|
return AjaxResult.error("修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
|
||||||
}
|
} else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) {
|
||||||
else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath()))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("修改菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头");
|
return AjaxResult.error("修改菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头");
|
||||||
}
|
} else if (menu.getMenuId().equals(menu.getParentId())) {
|
||||||
else if (menu.getMenuId().equals(menu.getParentId()))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("修改菜单'" + menu.getMenuName() + "'失败,上级菜单不能选择自己");
|
return AjaxResult.error("修改菜单'" + menu.getMenuName() + "'失败,上级菜单不能选择自己");
|
||||||
}
|
}
|
||||||
menu.setUpdateBy(getUsername());
|
menu.setUpdateBy(getUsername());
|
||||||
@ -120,17 +118,15 @@ public class SysMenuController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 删除菜单
|
* 删除菜单
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("删除菜单")
|
||||||
@PreAuthorize("@ss.hasPermi('system:menu:remove')")
|
@PreAuthorize("@ss.hasPermi('system:menu:remove')")
|
||||||
@Log(title = "菜单管理", businessType = BusinessType.DELETE)
|
@Log(title = "菜单管理", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{menuId}")
|
@DeleteMapping("/{menuId}")
|
||||||
public AjaxResult remove(@PathVariable("menuId") Long menuId)
|
public AjaxResult<Void> remove(@PathVariable("menuId") Long menuId) {
|
||||||
{
|
if (menuService.hasChildByMenuId(menuId)) {
|
||||||
if (menuService.hasChildByMenuId(menuId))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("存在子菜单,不允许删除");
|
return AjaxResult.error("存在子菜单,不允许删除");
|
||||||
}
|
}
|
||||||
if (menuService.checkMenuExistRole(menuId))
|
if (menuService.checkMenuExistRole(menuId)) {
|
||||||
{
|
|
||||||
return AjaxResult.error("菜单已分配,不允许删除");
|
return AjaxResult.error("菜单已分配,不允许删除");
|
||||||
}
|
}
|
||||||
return toAjax(menuService.deleteMenuById(menuId));
|
return toAjax(menuService.deleteMenuById(menuId));
|
||||||
|
@ -1,17 +1,5 @@
|
|||||||
package com.ruoyi.web.controller.system;
|
package com.ruoyi.web.controller.system;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import com.ruoyi.common.annotation.Log;
|
import com.ruoyi.common.annotation.Log;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
@ -19,47 +7,56 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
|||||||
import com.ruoyi.common.enums.BusinessType;
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
import com.ruoyi.system.domain.SysNotice;
|
import com.ruoyi.system.domain.SysNotice;
|
||||||
import com.ruoyi.system.service.ISysNoticeService;
|
import com.ruoyi.system.service.ISysNoticeService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 公告 信息操作处理
|
* 公告 信息操作处理
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
|
@Validated
|
||||||
|
@Api(value = "公告信息控制器", tags = {"公告信息管理"})
|
||||||
|
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/system/notice")
|
@RequestMapping("/system/notice")
|
||||||
public class SysNoticeController extends BaseController
|
public class SysNoticeController extends BaseController {
|
||||||
{
|
|
||||||
@Autowired
|
private final ISysNoticeService noticeService;
|
||||||
private ISysNoticeService noticeService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取通知公告列表
|
* 获取通知公告列表
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("获取通知公告列表")
|
||||||
@PreAuthorize("@ss.hasPermi('system:notice:list')")
|
@PreAuthorize("@ss.hasPermi('system:notice:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(SysNotice notice)
|
public TableDataInfo<SysNotice> list(SysNotice notice) {
|
||||||
{
|
|
||||||
return noticeService.selectPageNoticeList(notice);
|
return noticeService.selectPageNoticeList(notice);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据通知公告编号获取详细信息
|
* 根据通知公告编号获取详细信息
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("根据通知公告编号获取详细信息")
|
||||||
@PreAuthorize("@ss.hasPermi('system:notice:query')")
|
@PreAuthorize("@ss.hasPermi('system:notice:query')")
|
||||||
@GetMapping(value = "/{noticeId}")
|
@GetMapping(value = "/{noticeId}")
|
||||||
public AjaxResult getInfo(@PathVariable Long noticeId)
|
public AjaxResult<SysNotice> getInfo(@PathVariable Long noticeId) {
|
||||||
{
|
|
||||||
return AjaxResult.success(noticeService.selectNoticeById(noticeId));
|
return AjaxResult.success(noticeService.selectNoticeById(noticeId));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增通知公告
|
* 新增通知公告
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("新增通知公告")
|
||||||
@PreAuthorize("@ss.hasPermi('system:notice:add')")
|
@PreAuthorize("@ss.hasPermi('system:notice:add')")
|
||||||
@Log(title = "通知公告", businessType = BusinessType.INSERT)
|
@Log(title = "通知公告", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@Validated @RequestBody SysNotice notice)
|
public AjaxResult<Void> add(@Validated @RequestBody SysNotice notice) {
|
||||||
{
|
|
||||||
notice.setCreateBy(getUsername());
|
notice.setCreateBy(getUsername());
|
||||||
return toAjax(noticeService.insertNotice(notice));
|
return toAjax(noticeService.insertNotice(notice));
|
||||||
}
|
}
|
||||||
@ -67,11 +64,11 @@ public class SysNoticeController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 修改通知公告
|
* 修改通知公告
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("修改通知公告")
|
||||||
@PreAuthorize("@ss.hasPermi('system:notice:edit')")
|
@PreAuthorize("@ss.hasPermi('system:notice:edit')")
|
||||||
@Log(title = "通知公告", businessType = BusinessType.UPDATE)
|
@Log(title = "通知公告", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@Validated @RequestBody SysNotice notice)
|
public AjaxResult<Void> edit(@Validated @RequestBody SysNotice notice) {
|
||||||
{
|
|
||||||
notice.setUpdateBy(getUsername());
|
notice.setUpdateBy(getUsername());
|
||||||
return toAjax(noticeService.updateNotice(notice));
|
return toAjax(noticeService.updateNotice(notice));
|
||||||
}
|
}
|
||||||
@ -79,11 +76,11 @@ public class SysNoticeController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 删除通知公告
|
* 删除通知公告
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("删除通知公告")
|
||||||
@PreAuthorize("@ss.hasPermi('system:notice:remove')")
|
@PreAuthorize("@ss.hasPermi('system:notice:remove')")
|
||||||
@Log(title = "通知公告", businessType = BusinessType.DELETE)
|
@Log(title = "通知公告", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{noticeIds}")
|
@DeleteMapping("/{noticeIds}")
|
||||||
public AjaxResult remove(@PathVariable Long[] noticeIds)
|
public AjaxResult<Void> remove(@PathVariable Long[] noticeIds) {
|
||||||
{
|
|
||||||
return toAjax(noticeService.deleteNoticeByIds(noticeIds));
|
return toAjax(noticeService.deleteNoticeByIds(noticeIds));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -100,10 +100,11 @@ public class SysOssConfigController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* 状态修改
|
* 状态修改
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("状态修改")
|
||||||
@PreAuthorize("@ss.hasPermi('system:oss:edit')")
|
@PreAuthorize("@ss.hasPermi('system:oss:edit')")
|
||||||
@Log(title = "对象存储状态修改", businessType = BusinessType.UPDATE)
|
@Log(title = "对象存储状态修改", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping("/changeStatus")
|
@PutMapping("/changeStatus")
|
||||||
public AjaxResult changeStatus(@RequestBody SysOssConfigBo bo) {
|
public AjaxResult<Void> changeStatus(@RequestBody SysOssConfigBo bo) {
|
||||||
return toAjax(iSysOssConfigService.updateOssConfigStatus(bo));
|
return toAjax(iSysOssConfigService.updateOssConfigStatus(bo));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -38,8 +38,6 @@ import org.springframework.web.multipart.MultipartFile;
|
|||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import javax.validation.constraints.NotEmpty;
|
import javax.validation.constraints.NotEmpty;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URLEncoder;
|
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -9,6 +9,9 @@ import com.ruoyi.common.enums.BusinessType;
|
|||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
import com.ruoyi.system.domain.SysPost;
|
import com.ruoyi.system.domain.SysPost;
|
||||||
import com.ruoyi.system.service.ISysPostService;
|
import com.ruoyi.system.service.ISysPostService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@ -20,30 +23,32 @@ import java.util.List;
|
|||||||
/**
|
/**
|
||||||
* 岗位信息操作处理
|
* 岗位信息操作处理
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
|
@Validated
|
||||||
|
@Api(value = "岗位信息控制器", tags = {"岗位信息管理"})
|
||||||
|
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/system/post")
|
@RequestMapping("/system/post")
|
||||||
public class SysPostController extends BaseController
|
public class SysPostController extends BaseController {
|
||||||
{
|
|
||||||
@Autowired
|
private final ISysPostService postService;
|
||||||
private ISysPostService postService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取岗位列表
|
* 获取岗位列表
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("获取岗位列表")
|
||||||
@PreAuthorize("@ss.hasPermi('system:post:list')")
|
@PreAuthorize("@ss.hasPermi('system:post:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(SysPost post)
|
public TableDataInfo<SysPost> list(SysPost post) {
|
||||||
{
|
|
||||||
return postService.selectPagePostList(post);
|
return postService.selectPagePostList(post);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("导出岗位列表")
|
||||||
@Log(title = "岗位管理", businessType = BusinessType.EXPORT)
|
@Log(title = "岗位管理", businessType = BusinessType.EXPORT)
|
||||||
@PreAuthorize("@ss.hasPermi('system:post:export')")
|
@PreAuthorize("@ss.hasPermi('system:post:export')")
|
||||||
@GetMapping("/export")
|
@GetMapping("/export")
|
||||||
public void export(SysPost post, HttpServletResponse response)
|
public void export(SysPost post, HttpServletResponse response) {
|
||||||
{
|
|
||||||
List<SysPost> list = postService.selectPostList(post);
|
List<SysPost> list = postService.selectPostList(post);
|
||||||
ExcelUtil.exportExcel(list, "岗位数据", SysPost.class, response);
|
ExcelUtil.exportExcel(list, "岗位数据", SysPost.class, response);
|
||||||
}
|
}
|
||||||
@ -51,27 +56,24 @@ public class SysPostController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 根据岗位编号获取详细信息
|
* 根据岗位编号获取详细信息
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("根据岗位编号获取详细信息")
|
||||||
@PreAuthorize("@ss.hasPermi('system:post:query')")
|
@PreAuthorize("@ss.hasPermi('system:post:query')")
|
||||||
@GetMapping(value = "/{postId}")
|
@GetMapping(value = "/{postId}")
|
||||||
public AjaxResult getInfo(@PathVariable Long postId)
|
public AjaxResult<SysPost> getInfo(@PathVariable Long postId) {
|
||||||
{
|
|
||||||
return AjaxResult.success(postService.selectPostById(postId));
|
return AjaxResult.success(postService.selectPostById(postId));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增岗位
|
* 新增岗位
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("新增岗位")
|
||||||
@PreAuthorize("@ss.hasPermi('system:post:add')")
|
@PreAuthorize("@ss.hasPermi('system:post:add')")
|
||||||
@Log(title = "岗位管理", businessType = BusinessType.INSERT)
|
@Log(title = "岗位管理", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@Validated @RequestBody SysPost post)
|
public AjaxResult<Void> add(@Validated @RequestBody SysPost post) {
|
||||||
{
|
if (UserConstants.NOT_UNIQUE.equals(postService.checkPostNameUnique(post))) {
|
||||||
if (UserConstants.NOT_UNIQUE.equals(postService.checkPostNameUnique(post)))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("新增岗位'" + post.getPostName() + "'失败,岗位名称已存在");
|
return AjaxResult.error("新增岗位'" + post.getPostName() + "'失败,岗位名称已存在");
|
||||||
}
|
} else if (UserConstants.NOT_UNIQUE.equals(postService.checkPostCodeUnique(post))) {
|
||||||
else if (UserConstants.NOT_UNIQUE.equals(postService.checkPostCodeUnique(post)))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("新增岗位'" + post.getPostName() + "'失败,岗位编码已存在");
|
return AjaxResult.error("新增岗位'" + post.getPostName() + "'失败,岗位编码已存在");
|
||||||
}
|
}
|
||||||
post.setCreateBy(getUsername());
|
post.setCreateBy(getUsername());
|
||||||
@ -81,17 +83,14 @@ public class SysPostController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 修改岗位
|
* 修改岗位
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("修改岗位")
|
||||||
@PreAuthorize("@ss.hasPermi('system:post:edit')")
|
@PreAuthorize("@ss.hasPermi('system:post:edit')")
|
||||||
@Log(title = "岗位管理", businessType = BusinessType.UPDATE)
|
@Log(title = "岗位管理", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@Validated @RequestBody SysPost post)
|
public AjaxResult<Void> edit(@Validated @RequestBody SysPost post) {
|
||||||
{
|
if (UserConstants.NOT_UNIQUE.equals(postService.checkPostNameUnique(post))) {
|
||||||
if (UserConstants.NOT_UNIQUE.equals(postService.checkPostNameUnique(post)))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("修改岗位'" + post.getPostName() + "'失败,岗位名称已存在");
|
return AjaxResult.error("修改岗位'" + post.getPostName() + "'失败,岗位名称已存在");
|
||||||
}
|
} else if (UserConstants.NOT_UNIQUE.equals(postService.checkPostCodeUnique(post))) {
|
||||||
else if (UserConstants.NOT_UNIQUE.equals(postService.checkPostCodeUnique(post)))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("修改岗位'" + post.getPostName() + "'失败,岗位编码已存在");
|
return AjaxResult.error("修改岗位'" + post.getPostName() + "'失败,岗位编码已存在");
|
||||||
}
|
}
|
||||||
post.setUpdateBy(getUsername());
|
post.setUpdateBy(getUsername());
|
||||||
@ -101,20 +100,20 @@ public class SysPostController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 删除岗位
|
* 删除岗位
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("删除岗位")
|
||||||
@PreAuthorize("@ss.hasPermi('system:post:remove')")
|
@PreAuthorize("@ss.hasPermi('system:post:remove')")
|
||||||
@Log(title = "岗位管理", businessType = BusinessType.DELETE)
|
@Log(title = "岗位管理", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{postIds}")
|
@DeleteMapping("/{postIds}")
|
||||||
public AjaxResult remove(@PathVariable Long[] postIds)
|
public AjaxResult<Void> remove(@PathVariable Long[] postIds) {
|
||||||
{
|
|
||||||
return toAjax(postService.deletePostByIds(postIds));
|
return toAjax(postService.deletePostByIds(postIds));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取岗位选择框列表
|
* 获取岗位选择框列表
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("获取岗位选择框列表")
|
||||||
@GetMapping("/optionselect")
|
@GetMapping("/optionselect")
|
||||||
public AjaxResult optionselect()
|
public AjaxResult<List<SysPost>> optionselect() {
|
||||||
{
|
|
||||||
List<SysPost> posts = postService.selectPostAll();
|
List<SysPost> posts = postService.selectPostAll();
|
||||||
return AjaxResult.success(posts);
|
return AjaxResult.success(posts);
|
||||||
}
|
}
|
||||||
|
@ -6,45 +6,45 @@ import com.ruoyi.common.core.controller.BaseController;
|
|||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
|
||||||
import com.ruoyi.common.core.service.TokenService;
|
import com.ruoyi.common.core.service.TokenService;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
import com.ruoyi.common.utils.SecurityUtils;
|
import com.ruoyi.common.utils.SecurityUtils;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.ruoyi.system.domain.SysOss;
|
import com.ruoyi.system.domain.SysOss;
|
||||||
import com.ruoyi.system.service.ISysOssService;
|
import com.ruoyi.system.service.ISysOssService;
|
||||||
import com.ruoyi.system.service.ISysUserService;
|
import com.ruoyi.system.service.ISysUserService;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 个人信息 业务处理
|
* 个人信息 业务处理
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
|
@Validated
|
||||||
|
@Api(value = "个人信息控制器", tags = {"个人信息管理"})
|
||||||
|
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/system/user/profile")
|
@RequestMapping("/system/user/profile")
|
||||||
public class SysProfileController extends BaseController
|
public class SysProfileController extends BaseController {
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private ISysUserService userService;
|
|
||||||
|
|
||||||
@Autowired
|
private final ISysUserService userService;
|
||||||
private TokenService tokenService;
|
private final TokenService tokenService;
|
||||||
|
private final ISysOssService iSysOssService;
|
||||||
@Autowired
|
|
||||||
private ISysOssService iSysOssService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 个人信息
|
* 个人信息
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("个人信息")
|
||||||
@GetMapping
|
@GetMapping
|
||||||
public AjaxResult profile()
|
public AjaxResult<Map<String, Object>> profile() {
|
||||||
{
|
|
||||||
LoginUser loginUser = getLoginUser();
|
LoginUser loginUser = getLoginUser();
|
||||||
SysUser user = loginUser.getUser();
|
SysUser user = loginUser.getUser();
|
||||||
Map<String, Object> ajax = new HashMap<>();
|
Map<String, Object> ajax = new HashMap<>();
|
||||||
@ -57,26 +57,23 @@ public class SysProfileController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 修改用户
|
* 修改用户
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("修改用户")
|
||||||
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
|
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult updateProfile(@RequestBody SysUser user)
|
public AjaxResult<Void> updateProfile(@RequestBody SysUser user) {
|
||||||
{
|
|
||||||
if (StringUtils.isNotEmpty(user.getPhonenumber())
|
if (StringUtils.isNotEmpty(user.getPhonenumber())
|
||||||
&& UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user)))
|
&& UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) {
|
||||||
{
|
|
||||||
return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
|
return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
|
||||||
}
|
}
|
||||||
if (StringUtils.isNotEmpty(user.getEmail())
|
if (StringUtils.isNotEmpty(user.getEmail())
|
||||||
&& UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user)))
|
&& UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user))) {
|
||||||
{
|
|
||||||
return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
|
return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
|
||||||
}
|
}
|
||||||
LoginUser loginUser = getLoginUser();
|
LoginUser loginUser = getLoginUser();
|
||||||
SysUser sysUser = loginUser.getUser();
|
SysUser sysUser = loginUser.getUser();
|
||||||
user.setUserId(sysUser.getUserId());
|
user.setUserId(sysUser.getUserId());
|
||||||
user.setPassword(null);
|
user.setPassword(null);
|
||||||
if (userService.updateUserProfile(user) > 0)
|
if (userService.updateUserProfile(user) > 0) {
|
||||||
{
|
|
||||||
// 更新缓存用户信息
|
// 更新缓存用户信息
|
||||||
sysUser.setNickName(user.getNickName());
|
sysUser.setNickName(user.getNickName());
|
||||||
sysUser.setPhonenumber(user.getPhonenumber());
|
sysUser.setPhonenumber(user.getPhonenumber());
|
||||||
@ -91,23 +88,20 @@ public class SysProfileController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 重置密码
|
* 重置密码
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("重置密码")
|
||||||
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
|
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping("/updatePwd")
|
@PutMapping("/updatePwd")
|
||||||
public AjaxResult updatePwd(String oldPassword, String newPassword)
|
public AjaxResult<Void> updatePwd(String oldPassword, String newPassword) {
|
||||||
{
|
|
||||||
LoginUser loginUser = getLoginUser();
|
LoginUser loginUser = getLoginUser();
|
||||||
String userName = loginUser.getUsername();
|
String userName = loginUser.getUsername();
|
||||||
String password = loginUser.getPassword();
|
String password = loginUser.getPassword();
|
||||||
if (!SecurityUtils.matchesPassword(oldPassword, password))
|
if (!SecurityUtils.matchesPassword(oldPassword, password)) {
|
||||||
{
|
|
||||||
return AjaxResult.error("修改密码失败,旧密码错误");
|
return AjaxResult.error("修改密码失败,旧密码错误");
|
||||||
}
|
}
|
||||||
if (SecurityUtils.matchesPassword(newPassword, password))
|
if (SecurityUtils.matchesPassword(newPassword, password)) {
|
||||||
{
|
|
||||||
return AjaxResult.error("新密码不能与旧密码相同");
|
return AjaxResult.error("新密码不能与旧密码相同");
|
||||||
}
|
}
|
||||||
if (userService.resetUserPwd(userName, SecurityUtils.encryptPassword(newPassword)) > 0)
|
if (userService.resetUserPwd(userName, SecurityUtils.encryptPassword(newPassword)) > 0) {
|
||||||
{
|
|
||||||
// 更新缓存用户密码
|
// 更新缓存用户密码
|
||||||
loginUser.getUser().setPassword(SecurityUtils.encryptPassword(newPassword));
|
loginUser.getUser().setPassword(SecurityUtils.encryptPassword(newPassword));
|
||||||
tokenService.setLoginUser(loginUser);
|
tokenService.setLoginUser(loginUser);
|
||||||
@ -119,18 +113,19 @@ public class SysProfileController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 头像上传
|
* 头像上传
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("头像上传")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "file", value = "用户头像", dataType = "java.io.File", required = true),
|
||||||
|
})
|
||||||
@Log(title = "用户头像", businessType = BusinessType.UPDATE)
|
@Log(title = "用户头像", businessType = BusinessType.UPDATE)
|
||||||
@PostMapping("/avatar")
|
@PostMapping("/avatar")
|
||||||
public AjaxResult avatar(@RequestParam("avatarfile") MultipartFile file) throws IOException
|
public AjaxResult<Map<String, Object>> avatar(@RequestPart("avatarfile") MultipartFile file) {
|
||||||
{
|
Map<String, Object> ajax = new HashMap<>();
|
||||||
if (!file.isEmpty())
|
if (!file.isEmpty()) {
|
||||||
{
|
|
||||||
LoginUser loginUser = getLoginUser();
|
LoginUser loginUser = getLoginUser();
|
||||||
SysOss oss = iSysOssService.upload(file);
|
SysOss oss = iSysOssService.upload(file);
|
||||||
String avatar = oss.getUrl();
|
String avatar = oss.getUrl();
|
||||||
if (userService.updateUserAvatar(loginUser.getUsername(), avatar))
|
if (userService.updateUserAvatar(loginUser.getUsername(), avatar)) {
|
||||||
{
|
|
||||||
Map<String,Object> ajax = new HashMap<>();
|
|
||||||
ajax.put("imgUrl", avatar);
|
ajax.put("imgUrl", avatar);
|
||||||
// 更新缓存用户头像
|
// 更新缓存用户头像
|
||||||
loginUser.getUser().setAvatar(avatar);
|
loginUser.getUser().setAvatar(avatar);
|
||||||
@ -138,6 +133,6 @@ public class SysProfileController extends BaseController
|
|||||||
return AjaxResult.success(ajax);
|
return AjaxResult.success(ajax);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return AjaxResult.error("上传图片异常,请联系管理员");
|
return AjaxResult.error("上传图片异常,请联系管理员", ajax);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,9 +4,13 @@ import com.ruoyi.common.core.controller.BaseController;
|
|||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.common.core.domain.model.RegisterBody;
|
import com.ruoyi.common.core.domain.model.RegisterBody;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.ruoyi.system.service.SysRegisterService;
|
|
||||||
import com.ruoyi.system.service.ISysConfigService;
|
import com.ruoyi.system.service.ISysConfigService;
|
||||||
|
import com.ruoyi.system.service.SysRegisterService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
@ -14,22 +18,21 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
/**
|
/**
|
||||||
* 注册验证
|
* 注册验证
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
|
@Validated
|
||||||
|
@Api(value = "注册验证控制器", tags = {"注册验证管理"})
|
||||||
|
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||||
@RestController
|
@RestController
|
||||||
public class SysRegisterController extends BaseController
|
public class SysRegisterController extends BaseController {
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private SysRegisterService registerService;
|
|
||||||
|
|
||||||
@Autowired
|
private final SysRegisterService registerService;
|
||||||
private ISysConfigService configService;
|
private final ISysConfigService configService;
|
||||||
|
|
||||||
|
@ApiOperation("用户注册")
|
||||||
@PostMapping("/register")
|
@PostMapping("/register")
|
||||||
public AjaxResult register(@RequestBody RegisterBody user)
|
public AjaxResult<Void> register(@RequestBody RegisterBody user) {
|
||||||
{
|
if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser")))) {
|
||||||
if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser"))))
|
|
||||||
{
|
|
||||||
return error("当前系统没有开启注册功能!");
|
return error("当前系统没有开启注册功能!");
|
||||||
}
|
}
|
||||||
String msg = registerService.register(user);
|
String msg = registerService.register(user);
|
||||||
|
@ -8,14 +8,17 @@ import com.ruoyi.common.core.domain.entity.SysRole;
|
|||||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
|
||||||
import com.ruoyi.common.core.service.TokenService;
|
import com.ruoyi.common.core.service.TokenService;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
import com.ruoyi.system.domain.SysUserRole;
|
import com.ruoyi.system.domain.SysUserRole;
|
||||||
import com.ruoyi.system.service.ISysRoleService;
|
import com.ruoyi.system.service.ISysRoleService;
|
||||||
import com.ruoyi.system.service.ISysUserService;
|
import com.ruoyi.system.service.ISysUserService;
|
||||||
import com.ruoyi.system.service.SysPermissionService;
|
import com.ruoyi.system.service.SysPermissionService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@ -27,36 +30,32 @@ import java.util.List;
|
|||||||
/**
|
/**
|
||||||
* 角色信息
|
* 角色信息
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
|
@Validated
|
||||||
|
@Api(value = "角色信息控制器", tags = {"角色信息管理"})
|
||||||
|
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/system/role")
|
@RequestMapping("/system/role")
|
||||||
public class SysRoleController extends BaseController
|
public class SysRoleController extends BaseController {
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private ISysRoleService roleService;
|
|
||||||
|
|
||||||
@Autowired
|
private final ISysRoleService roleService;
|
||||||
private TokenService tokenService;
|
private final TokenService tokenService;
|
||||||
|
private final ISysUserService userService;
|
||||||
@Autowired
|
private final SysPermissionService permissionService;
|
||||||
private SysPermissionService permissionService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ISysUserService userService;
|
|
||||||
|
|
||||||
|
@ApiOperation("查询角色信息列表")
|
||||||
@PreAuthorize("@ss.hasPermi('system:role:list')")
|
@PreAuthorize("@ss.hasPermi('system:role:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(SysRole role)
|
public TableDataInfo<SysRole> list(SysRole role) {
|
||||||
{
|
|
||||||
return roleService.selectPageRoleList(role);
|
return roleService.selectPageRoleList(role);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("导出角色信息列表")
|
||||||
@Log(title = "角色管理", businessType = BusinessType.EXPORT)
|
@Log(title = "角色管理", businessType = BusinessType.EXPORT)
|
||||||
@PreAuthorize("@ss.hasPermi('system:role:export')")
|
@PreAuthorize("@ss.hasPermi('system:role:export')")
|
||||||
@GetMapping("/export")
|
@GetMapping("/export")
|
||||||
public void export(SysRole role, HttpServletResponse response)
|
public void export(SysRole role, HttpServletResponse response) {
|
||||||
{
|
|
||||||
List<SysRole> list = roleService.selectRoleList(role);
|
List<SysRole> list = roleService.selectRoleList(role);
|
||||||
ExcelUtil.exportExcel(list, "角色数据", SysRole.class, response);
|
ExcelUtil.exportExcel(list, "角色数据", SysRole.class, response);
|
||||||
}
|
}
|
||||||
@ -64,10 +63,10 @@ public class SysRoleController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 根据角色编号获取详细信息
|
* 根据角色编号获取详细信息
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("根据角色编号获取详细信息")
|
||||||
@PreAuthorize("@ss.hasPermi('system:role:query')")
|
@PreAuthorize("@ss.hasPermi('system:role:query')")
|
||||||
@GetMapping(value = "/{roleId}")
|
@GetMapping(value = "/{roleId}")
|
||||||
public AjaxResult getInfo(@PathVariable Long roleId)
|
public AjaxResult<SysRole> getInfo(@PathVariable Long roleId) {
|
||||||
{
|
|
||||||
roleService.checkRoleDataScope(roleId);
|
roleService.checkRoleDataScope(roleId);
|
||||||
return AjaxResult.success(roleService.selectRoleById(roleId));
|
return AjaxResult.success(roleService.selectRoleById(roleId));
|
||||||
}
|
}
|
||||||
@ -75,17 +74,14 @@ public class SysRoleController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 新增角色
|
* 新增角色
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("新增角色")
|
||||||
@PreAuthorize("@ss.hasPermi('system:role:add')")
|
@PreAuthorize("@ss.hasPermi('system:role:add')")
|
||||||
@Log(title = "角色管理", businessType = BusinessType.INSERT)
|
@Log(title = "角色管理", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@Validated @RequestBody SysRole role)
|
public AjaxResult<Void> add(@Validated @RequestBody SysRole role) {
|
||||||
{
|
if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role))) {
|
||||||
if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role)))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("新增角色'" + role.getRoleName() + "'失败,角色名称已存在");
|
return AjaxResult.error("新增角色'" + role.getRoleName() + "'失败,角色名称已存在");
|
||||||
}
|
} else if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role))) {
|
||||||
else if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role)))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在");
|
return AjaxResult.error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在");
|
||||||
}
|
}
|
||||||
role.setCreateBy(getUsername());
|
role.setCreateBy(getUsername());
|
||||||
@ -96,28 +92,23 @@ public class SysRoleController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 修改保存角色
|
* 修改保存角色
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("修改保存角色")
|
||||||
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
||||||
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@Validated @RequestBody SysRole role)
|
public AjaxResult<Void> edit(@Validated @RequestBody SysRole role) {
|
||||||
{
|
|
||||||
roleService.checkRoleAllowed(role);
|
roleService.checkRoleAllowed(role);
|
||||||
if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role)))
|
if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role))) {
|
||||||
{
|
|
||||||
return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,角色名称已存在");
|
return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,角色名称已存在");
|
||||||
}
|
} else if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role))) {
|
||||||
else if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role)))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,角色权限已存在");
|
return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,角色权限已存在");
|
||||||
}
|
}
|
||||||
role.setUpdateBy(getUsername());
|
role.setUpdateBy(getUsername());
|
||||||
|
|
||||||
if (roleService.updateRole(role) > 0)
|
if (roleService.updateRole(role) > 0) {
|
||||||
{
|
|
||||||
// 更新缓存用户权限
|
// 更新缓存用户权限
|
||||||
LoginUser loginUser = getLoginUser();
|
LoginUser loginUser = getLoginUser();
|
||||||
if (StringUtils.isNotNull(loginUser.getUser()) && !loginUser.getUser().isAdmin())
|
if (StringUtils.isNotNull(loginUser.getUser()) && !loginUser.getUser().isAdmin()) {
|
||||||
{
|
|
||||||
loginUser.setPermissions(permissionService.getMenuPermission(loginUser.getUser()));
|
loginUser.setPermissions(permissionService.getMenuPermission(loginUser.getUser()));
|
||||||
loginUser.setUser(userService.selectUserByUserName(loginUser.getUser().getUserName()));
|
loginUser.setUser(userService.selectUserByUserName(loginUser.getUser().getUserName()));
|
||||||
tokenService.setLoginUser(loginUser);
|
tokenService.setLoginUser(loginUser);
|
||||||
@ -130,11 +121,11 @@ public class SysRoleController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 修改保存数据权限
|
* 修改保存数据权限
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("修改保存数据权限")
|
||||||
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
||||||
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping("/dataScope")
|
@PutMapping("/dataScope")
|
||||||
public AjaxResult dataScope(@RequestBody SysRole role)
|
public AjaxResult<Void> dataScope(@RequestBody SysRole role) {
|
||||||
{
|
|
||||||
roleService.checkRoleAllowed(role);
|
roleService.checkRoleAllowed(role);
|
||||||
return toAjax(roleService.authDataScope(role));
|
return toAjax(roleService.authDataScope(role));
|
||||||
}
|
}
|
||||||
@ -142,11 +133,11 @@ public class SysRoleController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 状态修改
|
* 状态修改
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("状态修改")
|
||||||
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
||||||
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping("/changeStatus")
|
@PutMapping("/changeStatus")
|
||||||
public AjaxResult changeStatus(@RequestBody SysRole role)
|
public AjaxResult<Void> changeStatus(@RequestBody SysRole role) {
|
||||||
{
|
|
||||||
roleService.checkRoleAllowed(role);
|
roleService.checkRoleAllowed(role);
|
||||||
role.setUpdateBy(getUsername());
|
role.setUpdateBy(getUsername());
|
||||||
return toAjax(roleService.updateRoleStatus(role));
|
return toAjax(roleService.updateRoleStatus(role));
|
||||||
@ -155,74 +146,74 @@ public class SysRoleController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 删除角色
|
* 删除角色
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("删除角色")
|
||||||
@PreAuthorize("@ss.hasPermi('system:role:remove')")
|
@PreAuthorize("@ss.hasPermi('system:role:remove')")
|
||||||
@Log(title = "角色管理", businessType = BusinessType.DELETE)
|
@Log(title = "角色管理", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{roleIds}")
|
@DeleteMapping("/{roleIds}")
|
||||||
public AjaxResult remove(@PathVariable Long[] roleIds)
|
public AjaxResult<Void> remove(@PathVariable Long[] roleIds) {
|
||||||
{
|
|
||||||
return toAjax(roleService.deleteRoleByIds(roleIds));
|
return toAjax(roleService.deleteRoleByIds(roleIds));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取角色选择框列表
|
* 获取角色选择框列表
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("获取角色选择框列表")
|
||||||
@PreAuthorize("@ss.hasPermi('system:role:query')")
|
@PreAuthorize("@ss.hasPermi('system:role:query')")
|
||||||
@GetMapping("/optionselect")
|
@GetMapping("/optionselect")
|
||||||
public AjaxResult optionselect()
|
public AjaxResult<List<SysRole>> optionselect() {
|
||||||
{
|
|
||||||
return AjaxResult.success(roleService.selectRoleAll());
|
return AjaxResult.success(roleService.selectRoleAll());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询已分配用户角色列表
|
* 查询已分配用户角色列表
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("查询已分配用户角色列表")
|
||||||
@PreAuthorize("@ss.hasPermi('system:role:list')")
|
@PreAuthorize("@ss.hasPermi('system:role:list')")
|
||||||
@GetMapping("/authUser/allocatedList")
|
@GetMapping("/authUser/allocatedList")
|
||||||
public TableDataInfo allocatedList(SysUser user)
|
public TableDataInfo<SysUser> allocatedList(SysUser user) {
|
||||||
{
|
|
||||||
return userService.selectAllocatedList(user);
|
return userService.selectAllocatedList(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询未分配用户角色列表
|
* 查询未分配用户角色列表
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("查询未分配用户角色列表")
|
||||||
@PreAuthorize("@ss.hasPermi('system:role:list')")
|
@PreAuthorize("@ss.hasPermi('system:role:list')")
|
||||||
@GetMapping("/authUser/unallocatedList")
|
@GetMapping("/authUser/unallocatedList")
|
||||||
public TableDataInfo unallocatedList(SysUser user)
|
public TableDataInfo<SysUser> unallocatedList(SysUser user) {
|
||||||
{
|
|
||||||
return userService.selectUnallocatedList(user);
|
return userService.selectUnallocatedList(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 取消授权用户
|
* 取消授权用户
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("取消授权用户")
|
||||||
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
||||||
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
||||||
@PutMapping("/authUser/cancel")
|
@PutMapping("/authUser/cancel")
|
||||||
public AjaxResult cancelAuthUser(@RequestBody SysUserRole userRole)
|
public AjaxResult<Void> cancelAuthUser(@RequestBody SysUserRole userRole) {
|
||||||
{
|
|
||||||
return toAjax(roleService.deleteAuthUser(userRole));
|
return toAjax(roleService.deleteAuthUser(userRole));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量取消授权用户
|
* 批量取消授权用户
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("批量取消授权用户")
|
||||||
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
||||||
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
||||||
@PutMapping("/authUser/cancelAll")
|
@PutMapping("/authUser/cancelAll")
|
||||||
public AjaxResult cancelAuthUserAll(Long roleId, Long[] userIds)
|
public AjaxResult<Void> cancelAuthUserAll(Long roleId, Long[] userIds) {
|
||||||
{
|
|
||||||
return toAjax(roleService.deleteAuthUsers(roleId, userIds));
|
return toAjax(roleService.deleteAuthUsers(roleId, userIds));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量选择用户授权
|
* 批量选择用户授权
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("批量选择用户授权")
|
||||||
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
||||||
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
||||||
@PutMapping("/authUser/selectAll")
|
@PutMapping("/authUser/selectAll")
|
||||||
public AjaxResult selectAuthUserAll(Long roleId, Long[] userIds)
|
public AjaxResult<Void> selectAuthUserAll(Long roleId, Long[] userIds) {
|
||||||
{
|
|
||||||
return toAjax(roleService.insertAuthUsers(roleId, userIds));
|
return toAjax(roleService.insertAuthUsers(roleId, userIds));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,11 @@ import com.ruoyi.system.domain.vo.SysUserImportVo;
|
|||||||
import com.ruoyi.system.service.ISysPostService;
|
import com.ruoyi.system.service.ISysPostService;
|
||||||
import com.ruoyi.system.service.ISysRoleService;
|
import com.ruoyi.system.service.ISysRoleService;
|
||||||
import com.ruoyi.system.service.ISysUserService;
|
import com.ruoyi.system.service.ISysUserService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@ -36,36 +41,34 @@ import java.util.stream.Collectors;
|
|||||||
/**
|
/**
|
||||||
* 用户信息
|
* 用户信息
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
|
@Validated
|
||||||
|
@Api(value = "用户信息控制器", tags = {"用户信息管理"})
|
||||||
|
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/system/user")
|
@RequestMapping("/system/user")
|
||||||
public class SysUserController extends BaseController
|
public class SysUserController extends BaseController {
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private ISysUserService userService;
|
|
||||||
|
|
||||||
@Autowired
|
private final ISysUserService userService;
|
||||||
private ISysRoleService roleService;
|
private final ISysRoleService roleService;
|
||||||
|
private final ISysPostService postService;
|
||||||
@Autowired
|
|
||||||
private ISysPostService postService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取用户列表
|
* 获取用户列表
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("获取用户列表")
|
||||||
@PreAuthorize("@ss.hasPermi('system:user:list')")
|
@PreAuthorize("@ss.hasPermi('system:user:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(SysUser user)
|
public TableDataInfo<SysUser> list(SysUser user) {
|
||||||
{
|
|
||||||
return userService.selectPageUserList(user);
|
return userService.selectPageUserList(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("导出用户列表")
|
||||||
@Log(title = "用户管理", businessType = BusinessType.EXPORT)
|
@Log(title = "用户管理", businessType = BusinessType.EXPORT)
|
||||||
@PreAuthorize("@ss.hasPermi('system:user:export')")
|
@PreAuthorize("@ss.hasPermi('system:user:export')")
|
||||||
@GetMapping("/export")
|
@GetMapping("/export")
|
||||||
public void export(SysUser user, HttpServletResponse response)
|
public void export(SysUser user, HttpServletResponse response) {
|
||||||
{
|
|
||||||
List<SysUser> list = userService.selectUserList(user);
|
List<SysUser> list = userService.selectUserList(user);
|
||||||
List<SysUserExportVo> listVo = BeanUtil.copyToList(list, SysUserExportVo.class);
|
List<SysUserExportVo> listVo = BeanUtil.copyToList(list, SysUserExportVo.class);
|
||||||
for (int i = 0; i < list.size(); i++) {
|
for (int i = 0; i < list.size(); i++) {
|
||||||
@ -79,11 +82,14 @@ public class SysUserController extends BaseController
|
|||||||
ExcelUtil.exportExcel(listVo, "用户数据", SysUserExportVo.class, response);
|
ExcelUtil.exportExcel(listVo, "用户数据", SysUserExportVo.class, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("导入用户列表")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "file", value = "导入文件", dataType = "java.io.File", required = true),
|
||||||
|
})
|
||||||
@Log(title = "用户管理", businessType = BusinessType.IMPORT)
|
@Log(title = "用户管理", businessType = BusinessType.IMPORT)
|
||||||
@PreAuthorize("@ss.hasPermi('system:user:import')")
|
@PreAuthorize("@ss.hasPermi('system:user:import')")
|
||||||
@PostMapping("/importData")
|
@PostMapping("/importData")
|
||||||
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
|
public AjaxResult<Void> importData(@RequestPart("file") MultipartFile file, boolean updateSupport) throws Exception {
|
||||||
{
|
|
||||||
List<SysUserImportVo> userListVo = ExcelUtil.importExcel(file.getInputStream(), SysUserImportVo.class);
|
List<SysUserImportVo> userListVo = ExcelUtil.importExcel(file.getInputStream(), SysUserImportVo.class);
|
||||||
List<SysUser> userList = BeanUtil.copyToList(userListVo, SysUser.class);
|
List<SysUser> userList = BeanUtil.copyToList(userListVo, SysUser.class);
|
||||||
String operName = getUsername();
|
String operName = getUsername();
|
||||||
@ -91,26 +97,25 @@ public class SysUserController extends BaseController
|
|||||||
return AjaxResult.success(message);
|
return AjaxResult.success(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("下载导入模板")
|
||||||
@GetMapping("/importTemplate")
|
@GetMapping("/importTemplate")
|
||||||
public void importTemplate(HttpServletResponse response)
|
public void importTemplate(HttpServletResponse response) {
|
||||||
{
|
|
||||||
ExcelUtil.exportExcel(new ArrayList<>(), "用户数据", SysUserImportVo.class, response);
|
ExcelUtil.exportExcel(new ArrayList<>(), "用户数据", SysUserImportVo.class, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户编号获取详细信息
|
* 根据用户编号获取详细信息
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("根据用户编号获取详细信息")
|
||||||
@PreAuthorize("@ss.hasPermi('system:user:query')")
|
@PreAuthorize("@ss.hasPermi('system:user:query')")
|
||||||
@GetMapping(value = {"/", "/{userId}"})
|
@GetMapping(value = {"/", "/{userId}"})
|
||||||
public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId)
|
public AjaxResult<Map<String, Object>> getInfo(@PathVariable(value = "userId", required = false) Long userId) {
|
||||||
{
|
|
||||||
userService.checkUserDataScope(userId);
|
userService.checkUserDataScope(userId);
|
||||||
Map<String, Object> ajax = new HashMap<>();
|
Map<String, Object> ajax = new HashMap<>();
|
||||||
List<SysRole> roles = roleService.selectRoleAll();
|
List<SysRole> roles = roleService.selectRoleAll();
|
||||||
ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
|
ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
|
||||||
ajax.put("posts", postService.selectPostAll());
|
ajax.put("posts", postService.selectPostAll());
|
||||||
if (StringUtils.isNotNull(userId))
|
if (StringUtils.isNotNull(userId)) {
|
||||||
{
|
|
||||||
ajax.put("user", userService.selectUserById(userId));
|
ajax.put("user", userService.selectUserById(userId));
|
||||||
ajax.put("postIds", postService.selectPostListByUserId(userId));
|
ajax.put("postIds", postService.selectPostListByUserId(userId));
|
||||||
ajax.put("roleIds", roleService.selectRoleListByUserId(userId));
|
ajax.put("roleIds", roleService.selectRoleListByUserId(userId));
|
||||||
@ -121,23 +126,18 @@ public class SysUserController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 新增用户
|
* 新增用户
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("新增用户")
|
||||||
@PreAuthorize("@ss.hasPermi('system:user:add')")
|
@PreAuthorize("@ss.hasPermi('system:user:add')")
|
||||||
@Log(title = "用户管理", businessType = BusinessType.INSERT)
|
@Log(title = "用户管理", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@Validated @RequestBody SysUser user)
|
public AjaxResult<Void> add(@Validated @RequestBody SysUser user) {
|
||||||
{
|
if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(user.getUserName()))) {
|
||||||
if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(user.getUserName())))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
|
return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
|
||||||
}
|
} else if (StringUtils.isNotEmpty(user.getPhonenumber())
|
||||||
else if (StringUtils.isNotEmpty(user.getPhonenumber())
|
&& UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) {
|
||||||
&& UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user)))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,手机号码已存在");
|
return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,手机号码已存在");
|
||||||
}
|
} else if (StringUtils.isNotEmpty(user.getEmail())
|
||||||
else if (StringUtils.isNotEmpty(user.getEmail())
|
&& UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user))) {
|
||||||
&& UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user)))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在");
|
return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在");
|
||||||
}
|
}
|
||||||
user.setCreateBy(getUsername());
|
user.setCreateBy(getUsername());
|
||||||
@ -148,20 +148,17 @@ public class SysUserController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 修改用户
|
* 修改用户
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("修改用户")
|
||||||
@PreAuthorize("@ss.hasPermi('system:user:edit')")
|
@PreAuthorize("@ss.hasPermi('system:user:edit')")
|
||||||
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@Validated @RequestBody SysUser user)
|
public AjaxResult<Void> edit(@Validated @RequestBody SysUser user) {
|
||||||
{
|
|
||||||
userService.checkUserAllowed(user);
|
userService.checkUserAllowed(user);
|
||||||
if (StringUtils.isNotEmpty(user.getPhonenumber())
|
if (StringUtils.isNotEmpty(user.getPhonenumber())
|
||||||
&& UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user)))
|
&& UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) {
|
||||||
{
|
|
||||||
return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
|
return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
|
||||||
}
|
} else if (StringUtils.isNotEmpty(user.getEmail())
|
||||||
else if (StringUtils.isNotEmpty(user.getEmail())
|
&& UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user))) {
|
||||||
&& UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user)))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
|
return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
|
||||||
}
|
}
|
||||||
user.setUpdateBy(getUsername());
|
user.setUpdateBy(getUsername());
|
||||||
@ -171,13 +168,12 @@ public class SysUserController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 删除用户
|
* 删除用户
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("删除用户")
|
||||||
@PreAuthorize("@ss.hasPermi('system:user:remove')")
|
@PreAuthorize("@ss.hasPermi('system:user:remove')")
|
||||||
@Log(title = "用户管理", businessType = BusinessType.DELETE)
|
@Log(title = "用户管理", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{userIds}")
|
@DeleteMapping("/{userIds}")
|
||||||
public AjaxResult remove(@PathVariable Long[] userIds)
|
public AjaxResult<Void> remove(@PathVariable Long[] userIds) {
|
||||||
{
|
if (ArrayUtil.contains(userIds, getUserId())) {
|
||||||
if (ArrayUtil.contains(userIds, getUserId()))
|
|
||||||
{
|
|
||||||
return error("当前用户不能删除");
|
return error("当前用户不能删除");
|
||||||
}
|
}
|
||||||
return toAjax(userService.deleteUserByIds(userIds));
|
return toAjax(userService.deleteUserByIds(userIds));
|
||||||
@ -186,11 +182,11 @@ public class SysUserController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 重置密码
|
* 重置密码
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("重置密码")
|
||||||
@PreAuthorize("@ss.hasPermi('system:user:resetPwd')")
|
@PreAuthorize("@ss.hasPermi('system:user:resetPwd')")
|
||||||
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping("/resetPwd")
|
@PutMapping("/resetPwd")
|
||||||
public AjaxResult resetPwd(@RequestBody SysUser user)
|
public AjaxResult<Void> resetPwd(@RequestBody SysUser user) {
|
||||||
{
|
|
||||||
userService.checkUserAllowed(user);
|
userService.checkUserAllowed(user);
|
||||||
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
|
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
|
||||||
user.setUpdateBy(getUsername());
|
user.setUpdateBy(getUsername());
|
||||||
@ -200,11 +196,11 @@ public class SysUserController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 状态修改
|
* 状态修改
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("状态修改")
|
||||||
@PreAuthorize("@ss.hasPermi('system:user:edit')")
|
@PreAuthorize("@ss.hasPermi('system:user:edit')")
|
||||||
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping("/changeStatus")
|
@PutMapping("/changeStatus")
|
||||||
public AjaxResult changeStatus(@RequestBody SysUser user)
|
public AjaxResult<Void> changeStatus(@RequestBody SysUser user) {
|
||||||
{
|
|
||||||
userService.checkUserAllowed(user);
|
userService.checkUserAllowed(user);
|
||||||
user.setUpdateBy(getUsername());
|
user.setUpdateBy(getUsername());
|
||||||
return toAjax(userService.updateUserStatus(user));
|
return toAjax(userService.updateUserStatus(user));
|
||||||
@ -213,10 +209,10 @@ public class SysUserController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 根据用户编号获取授权角色
|
* 根据用户编号获取授权角色
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("根据用户编号获取授权角色")
|
||||||
@PreAuthorize("@ss.hasPermi('system:user:query')")
|
@PreAuthorize("@ss.hasPermi('system:user:query')")
|
||||||
@GetMapping("/authRole/{userId}")
|
@GetMapping("/authRole/{userId}")
|
||||||
public AjaxResult authRole(@PathVariable("userId") Long userId)
|
public AjaxResult<Map<String, Object>> authRole(@PathVariable("userId") Long userId) {
|
||||||
{
|
|
||||||
SysUser user = userService.selectUserById(userId);
|
SysUser user = userService.selectUserById(userId);
|
||||||
List<SysRole> roles = roleService.selectRolesByUserId(userId);
|
List<SysRole> roles = roleService.selectRolesByUserId(userId);
|
||||||
Map<String, Object> ajax = new HashMap<>();
|
Map<String, Object> ajax = new HashMap<>();
|
||||||
@ -228,11 +224,11 @@ public class SysUserController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 用户授权角色
|
* 用户授权角色
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("用户授权角色")
|
||||||
@PreAuthorize("@ss.hasPermi('system:user:edit')")
|
@PreAuthorize("@ss.hasPermi('system:user:edit')")
|
||||||
@Log(title = "用户管理", businessType = BusinessType.GRANT)
|
@Log(title = "用户管理", businessType = BusinessType.GRANT)
|
||||||
@PutMapping("/authRole")
|
@PutMapping("/authRole")
|
||||||
public AjaxResult insertAuthRole(Long userId, Long[] roleIds)
|
public AjaxResult<Void> insertAuthRole(Long userId, Long[] roleIds) {
|
||||||
{
|
|
||||||
userService.insertUserAuth(userId, roleIds);
|
userService.insertUserAuth(userId, roleIds);
|
||||||
return success();
|
return success();
|
||||||
}
|
}
|
||||||
|
@ -248,10 +248,12 @@ swagger:
|
|||||||
email: crazylionli@163.com
|
email: crazylionli@163.com
|
||||||
url: https://gitee.com/JavaLionLi/RuoYi-Vue-Plus
|
url: https://gitee.com/JavaLionLi/RuoYi-Vue-Plus
|
||||||
groups:
|
groups:
|
||||||
|
- name: 代码生成模块
|
||||||
|
basePackage: com.ruoyi.generator
|
||||||
- name: 演示案例
|
- name: 演示案例
|
||||||
basePackage: com.ruoyi.demo
|
basePackage: com.ruoyi.demo
|
||||||
- name: 系统模块
|
- name: 系统模块
|
||||||
basePackage: com.ruoyi.admin
|
basePackage: com.ruoyi.web
|
||||||
|
|
||||||
# 防止XSS攻击
|
# 防止XSS攻击
|
||||||
xss:
|
xss:
|
||||||
|
@ -2,7 +2,6 @@ package com.ruoyi.common.config;
|
|||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@ -10,34 +9,42 @@ import org.springframework.stereotype.Component;
|
|||||||
/**
|
/**
|
||||||
* 读取项目相关配置
|
* 读取项目相关配置
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@Component
|
@Component
|
||||||
@ConfigurationProperties(prefix = "ruoyi")
|
@ConfigurationProperties(prefix = "ruoyi")
|
||||||
public class RuoYiConfig
|
public class RuoYiConfig {
|
||||||
{
|
|
||||||
/** 项目名称 */
|
/**
|
||||||
|
* 项目名称
|
||||||
|
*/
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
/** 版本 */
|
/**
|
||||||
|
* 版本
|
||||||
|
*/
|
||||||
private String version;
|
private String version;
|
||||||
|
|
||||||
/** 版权年份 */
|
/**
|
||||||
|
* 版权年份
|
||||||
|
*/
|
||||||
private String copyrightYear;
|
private String copyrightYear;
|
||||||
|
|
||||||
/** 实例演示开关 */
|
/**
|
||||||
|
* 实例演示开关
|
||||||
|
*/
|
||||||
private boolean demoEnabled;
|
private boolean demoEnabled;
|
||||||
|
|
||||||
/** 获取地址开关 */
|
/**
|
||||||
|
* 获取地址开关
|
||||||
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
private static boolean addressEnabled;
|
private static boolean addressEnabled;
|
||||||
|
|
||||||
public void setAddressEnabled(boolean addressEnabled)
|
public void setAddressEnabled(boolean addressEnabled) {
|
||||||
{
|
|
||||||
RuoYiConfig.addressEnabled = addressEnabled;
|
RuoYiConfig.addressEnabled = addressEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,10 +61,10 @@ public class GenConstants
|
|||||||
"update_time", "remark", "version" };
|
"update_time", "remark", "version" };
|
||||||
|
|
||||||
/** Entity基类字段 */
|
/** Entity基类字段 */
|
||||||
public static final String[] BASE_ENTITY = { "createBy", "createTime", "updateBy", "updateTime", "remark" };
|
public static final String[] BASE_ENTITY = { "createBy", "createTime", "updateBy", "updateTime" };
|
||||||
|
|
||||||
/** Tree基类字段 */
|
/** Tree基类字段 */
|
||||||
public static final String[] TREE_ENTITY = { "parentName", "parentId", "orderNum", "ancestors", "children" };
|
public static final String[] TREE_ENTITY = { "parentName", "parentId", "orderNum", "children" };
|
||||||
|
|
||||||
/** 文本框 */
|
/** 文本框 */
|
||||||
public static final String HTML_INPUT = "input";
|
public static final String HTML_INPUT = "input";
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
package com.ruoyi.common.core.domain;
|
package com.ruoyi.common.core.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
@ -14,11 +15,10 @@ import java.util.Map;
|
|||||||
/**
|
/**
|
||||||
* Entity基类
|
* Entity基类
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
public class BaseEntity implements Serializable {
|
public class BaseEntity implements Serializable {
|
||||||
|
|
||||||
@ -28,43 +28,43 @@ public class BaseEntity implements Serializable {
|
|||||||
* 搜索值
|
* 搜索值
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "搜索值")
|
@ApiModelProperty(value = "搜索值")
|
||||||
|
@TableField(exist = false)
|
||||||
private String searchValue;
|
private String searchValue;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建者
|
* 创建者
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "创建者")
|
@ApiModelProperty(value = "创建者")
|
||||||
|
@TableField(fill = FieldFill.INSERT)
|
||||||
private String createBy;
|
private String createBy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建时间
|
* 创建时间
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "创建时间")
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
@TableField(fill = FieldFill.INSERT)
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新者
|
* 更新者
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "更新者")
|
@ApiModelProperty(value = "更新者")
|
||||||
|
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||||
private String updateBy;
|
private String updateBy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新时间
|
* 更新时间
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "更新时间")
|
@ApiModelProperty(value = "更新时间")
|
||||||
|
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
@ApiModelProperty(value = "备注")
|
|
||||||
private String remark;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 请求参数
|
* 请求参数
|
||||||
*/
|
*/
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
@ApiModelProperty(value = "请求参数")
|
@ApiModelProperty(value = "请求参数")
|
||||||
|
@TableField(exist = false)
|
||||||
private Map<String, Object> params = new HashMap<>();
|
private Map<String, Object> params = new HashMap<>();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package com.ruoyi.common.core.domain;
|
package com.ruoyi.common.core.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -12,12 +12,11 @@ import java.util.List;
|
|||||||
/**
|
/**
|
||||||
* Tree基类
|
* Tree基类
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
public class TreeEntity extends BaseEntity {
|
public class TreeEntity extends BaseEntity {
|
||||||
|
|
||||||
@ -26,6 +25,7 @@ public class TreeEntity extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 父菜单名称
|
* 父菜单名称
|
||||||
*/
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
@ApiModelProperty(value = "父菜单名称")
|
@ApiModelProperty(value = "父菜单名称")
|
||||||
private String parentName;
|
private String parentName;
|
||||||
|
|
||||||
@ -39,17 +39,12 @@ public class TreeEntity extends BaseEntity {
|
|||||||
* 显示顺序
|
* 显示顺序
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "显示顺序")
|
@ApiModelProperty(value = "显示顺序")
|
||||||
private Integer orderNum;
|
private String orderNum;
|
||||||
|
|
||||||
/**
|
|
||||||
* 祖级列表
|
|
||||||
*/
|
|
||||||
@ApiModelProperty(value = "祖级列表")
|
|
||||||
private String ancestors;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 子部门
|
* 子部门
|
||||||
*/
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
@ApiModelProperty(value = "子部门")
|
@ApiModelProperty(value = "子部门")
|
||||||
private List<?> children = new ArrayList<>();
|
private List<?> children = new ArrayList<>();
|
||||||
|
|
||||||
|
@ -3,7 +3,10 @@ package com.ruoyi.common.core.domain;
|
|||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
import com.ruoyi.common.core.domain.entity.SysDept;
|
import com.ruoyi.common.core.domain.entity.SysDept;
|
||||||
import com.ruoyi.common.core.domain.entity.SysMenu;
|
import com.ruoyi.common.core.domain.entity.SysMenu;
|
||||||
import lombok.*;
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
@ -13,38 +16,52 @@ import java.util.stream.Collectors;
|
|||||||
/**
|
/**
|
||||||
* Treeselect树结构实体类
|
* Treeselect树结构实体类
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
public class TreeSelect implements Serializable
|
@ApiModel("树结构实体类")
|
||||||
{
|
public class TreeSelect implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/** 节点ID */
|
/**
|
||||||
|
* 节点ID
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "节点ID")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/** 节点名称 */
|
/**
|
||||||
|
* 节点名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "节点名称")
|
||||||
private String label;
|
private String label;
|
||||||
|
|
||||||
/** 子节点 */
|
/**
|
||||||
|
* 子节点
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "子节点")
|
||||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||||
private List<TreeSelect> children;
|
private List<TreeSelect> children;
|
||||||
|
|
||||||
public TreeSelect(SysDept dept)
|
public TreeSelect(SysDept dept) {
|
||||||
{
|
|
||||||
this.id = dept.getDeptId();
|
this.id = dept.getDeptId();
|
||||||
this.label = dept.getDeptName();
|
this.label = dept.getDeptName();
|
||||||
this.children = dept.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
|
this.children = dept.getChildren()
|
||||||
|
.stream()
|
||||||
|
.map(d -> new TreeSelect((SysDept) d))
|
||||||
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
public TreeSelect(SysMenu menu)
|
public TreeSelect(SysMenu menu) {
|
||||||
{
|
|
||||||
this.id = menu.getMenuId();
|
this.id = menu.getMenuId();
|
||||||
this.label = menu.getMenuName();
|
this.label = menu.getMenuName();
|
||||||
this.children = menu.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
|
this.children = menu.getChildren()
|
||||||
|
.stream()
|
||||||
|
.map(d -> new TreeSelect((SysMenu) d))
|
||||||
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -8,15 +8,16 @@ import java.io.Serializable;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 操作日志记录表 oper_log
|
* 通用操作日志实体
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
public class OperLogDTO implements Serializable {
|
public class OperLogDTO implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,48 +1,44 @@
|
|||||||
package com.ruoyi.common.core.domain.entity;
|
package com.ruoyi.common.core.domain.entity;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.ruoyi.common.core.domain.TreeEntity;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
import javax.validation.constraints.Email;
|
import javax.validation.constraints.Email;
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import javax.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门表 sys_dept
|
* 部门表 sys_dept
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@TableName("sys_dept")
|
@TableName("sys_dept")
|
||||||
public class SysDept implements Serializable {
|
@ApiModel("部门业务对象")
|
||||||
|
public class SysDept extends TreeEntity {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门ID
|
* 部门ID
|
||||||
*/
|
*/
|
||||||
@TableId(value = "dept_id", type = IdType.AUTO)
|
@ApiModelProperty(value = "部门id")
|
||||||
|
@TableId(value = "dept_id")
|
||||||
private Long deptId;
|
private Long deptId;
|
||||||
|
|
||||||
/**
|
|
||||||
* 父部门ID
|
|
||||||
*/
|
|
||||||
private Long parentId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 祖级列表
|
|
||||||
*/
|
|
||||||
private String ancestors;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门名称
|
* 部门名称
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "部门名称")
|
||||||
@NotBlank(message = "部门名称不能为空")
|
@NotBlank(message = "部门名称不能为空")
|
||||||
@Size(min = 0, max = 30, message = "部门名称长度不能超过30个字符")
|
@Size(min = 0, max = 30, message = "部门名称长度不能超过30个字符")
|
||||||
private String deptName;
|
private String deptName;
|
||||||
@ -50,23 +46,27 @@ public class SysDept implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 显示顺序
|
* 显示顺序
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "显示顺序")
|
||||||
@NotBlank(message = "显示顺序不能为空")
|
@NotBlank(message = "显示顺序不能为空")
|
||||||
private String orderNum;
|
private String orderNum;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 负责人
|
* 负责人
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "负责人")
|
||||||
private String leader;
|
private String leader;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 联系电话
|
* 联系电话
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "联系电话")
|
||||||
@Size(min = 0, max = 11, message = "联系电话长度不能超过11个字符")
|
@Size(min = 0, max = 11, message = "联系电话长度不能超过11个字符")
|
||||||
private String phone;
|
private String phone;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 邮箱
|
* 邮箱
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "邮箱")
|
||||||
@Email(message = "邮箱格式不正确")
|
@Email(message = "邮箱格式不正确")
|
||||||
@Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符")
|
@Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符")
|
||||||
private String email;
|
private String email;
|
||||||
@ -74,54 +74,20 @@ public class SysDept implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 部门状态:0正常,1停用
|
* 部门状态:0正常,1停用
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "部门状态:0正常,1停用")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除标志(0代表存在 2代表删除)
|
* 删除标志(0代表存在 2代表删除)
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "删除标志(0代表存在 2代表删除)")
|
||||||
@TableLogic
|
@TableLogic
|
||||||
private String delFlag;
|
private String delFlag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 父部门名称
|
* 祖级列表
|
||||||
*/
|
*/
|
||||||
@TableField(exist = false)
|
@ApiModelProperty(value = "祖级列表")
|
||||||
private String parentName;
|
private String ancestors;
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建者
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT)
|
|
||||||
private String createBy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT)
|
|
||||||
private Date createTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新者
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
|
||||||
private String updateBy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新时间
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
|
||||||
private Date updateTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 子部门
|
|
||||||
*/
|
|
||||||
@TableField(exist = false)
|
|
||||||
private List<SysDept> children = new ArrayList<SysDept>();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 请求参数
|
|
||||||
*/
|
|
||||||
@TableField(exist = false)
|
|
||||||
private Map<String, Object> params = new HashMap<>();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,51 +2,54 @@ package com.ruoyi.common.core.domain.entity;
|
|||||||
|
|
||||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.ruoyi.common.annotation.ExcelDictFormat;
|
import com.ruoyi.common.annotation.ExcelDictFormat;
|
||||||
import com.ruoyi.common.constant.UserConstants;
|
import com.ruoyi.common.constant.UserConstants;
|
||||||
import com.ruoyi.common.convert.ExcelDictConvert;
|
import com.ruoyi.common.convert.ExcelDictConvert;
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import javax.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 字典数据表 sys_dict_data
|
* 字典数据表 sys_dict_data
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@TableName("sys_dict_data")
|
@TableName("sys_dict_data")
|
||||||
@ExcelIgnoreUnannotated
|
@ExcelIgnoreUnannotated
|
||||||
public class SysDictData implements Serializable {
|
@ApiModel("字典数据业务对象")
|
||||||
private static final long serialVersionUID = 1L;
|
public class SysDictData extends BaseEntity {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 字典编码
|
* 字典编码
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "字典编码")
|
||||||
@ExcelProperty(value = "字典编码")
|
@ExcelProperty(value = "字典编码")
|
||||||
@TableId(value = "dict_code", type = IdType.AUTO)
|
@TableId(value = "dict_code")
|
||||||
private Long dictCode;
|
private Long dictCode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 字典排序
|
* 字典排序
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "字典排序")
|
||||||
@ExcelProperty(value = "字典排序")
|
@ExcelProperty(value = "字典排序")
|
||||||
private Long dictSort;
|
private Long dictSort;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 字典标签
|
* 字典标签
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "字典标签")
|
||||||
@ExcelProperty(value = "字典标签")
|
@ExcelProperty(value = "字典标签")
|
||||||
@NotBlank(message = "字典标签不能为空")
|
@NotBlank(message = "字典标签不能为空")
|
||||||
@Size(min = 0, max = 100, message = "字典标签长度不能超过100个字符")
|
@Size(min = 0, max = 100, message = "字典标签长度不能超过100个字符")
|
||||||
@ -55,6 +58,7 @@ public class SysDictData implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 字典键值
|
* 字典键值
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "字典键值")
|
||||||
@ExcelProperty(value = "字典键值")
|
@ExcelProperty(value = "字典键值")
|
||||||
@NotBlank(message = "字典键值不能为空")
|
@NotBlank(message = "字典键值不能为空")
|
||||||
@Size(min = 0, max = 100, message = "字典键值长度不能超过100个字符")
|
@Size(min = 0, max = 100, message = "字典键值长度不能超过100个字符")
|
||||||
@ -63,6 +67,7 @@ public class SysDictData implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 字典类型
|
* 字典类型
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "字典类型")
|
||||||
@ExcelProperty(value = "字典类型")
|
@ExcelProperty(value = "字典类型")
|
||||||
@NotBlank(message = "字典类型不能为空")
|
@NotBlank(message = "字典类型不能为空")
|
||||||
@Size(min = 0, max = 100, message = "字典类型长度不能超过100个字符")
|
@Size(min = 0, max = 100, message = "字典类型长度不能超过100个字符")
|
||||||
@ -71,17 +76,20 @@ public class SysDictData implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 样式属性(其他样式扩展)
|
* 样式属性(其他样式扩展)
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "样式属性(其他样式扩展)")
|
||||||
@Size(min = 0, max = 100, message = "样式属性长度不能超过100个字符")
|
@Size(min = 0, max = 100, message = "样式属性长度不能超过100个字符")
|
||||||
private String cssClass;
|
private String cssClass;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 表格字典样式
|
* 表格字典样式
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "表格字典样式")
|
||||||
private String listClass;
|
private String listClass;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否默认(Y是 N否)
|
* 是否默认(Y是 N否)
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "是否默认(Y是 N否)")
|
||||||
@ExcelProperty(value = "是否默认", converter = ExcelDictConvert.class)
|
@ExcelProperty(value = "是否默认", converter = ExcelDictConvert.class)
|
||||||
@ExcelDictFormat(dictType = "sys_yes_no")
|
@ExcelDictFormat(dictType = "sys_yes_no")
|
||||||
private String isDefault;
|
private String isDefault;
|
||||||
@ -89,47 +97,19 @@ public class SysDictData implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 状态(0正常 1停用)
|
* 状态(0正常 1停用)
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "状态(0正常 1停用)")
|
||||||
@ExcelProperty(value = "状态", converter = ExcelDictConvert.class)
|
@ExcelProperty(value = "状态", converter = ExcelDictConvert.class)
|
||||||
@ExcelDictFormat(dictType = "sys_normal_disable")
|
@ExcelDictFormat(dictType = "sys_normal_disable")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建者
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT)
|
|
||||||
private String createBy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT)
|
|
||||||
private Date createTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新者
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
|
||||||
private String updateBy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新时间
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
|
||||||
private Date updateTime;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
/**
|
|
||||||
* 请求参数
|
|
||||||
*/
|
|
||||||
@TableField(exist = false)
|
|
||||||
private Map<String, Object> params = new HashMap<>();
|
|
||||||
|
|
||||||
public boolean getDefault() {
|
public boolean getDefault() {
|
||||||
return UserConstants.YES.equals(this.isDefault) ? true : false;
|
return UserConstants.YES.equals(this.isDefault);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,44 +2,46 @@ package com.ruoyi.common.core.domain.entity;
|
|||||||
|
|
||||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.ruoyi.common.annotation.ExcelDictFormat;
|
import com.ruoyi.common.annotation.ExcelDictFormat;
|
||||||
import com.ruoyi.common.convert.ExcelDictConvert;
|
import com.ruoyi.common.convert.ExcelDictConvert;
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import javax.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 字典类型表 sys_dict_type
|
* 字典类型表 sys_dict_type
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@TableName("sys_dict_type")
|
@TableName("sys_dict_type")
|
||||||
@ExcelIgnoreUnannotated
|
@ExcelIgnoreUnannotated
|
||||||
public class SysDictType implements Serializable {
|
@ApiModel("字典类型业务对象")
|
||||||
private static final long serialVersionUID = 1L;
|
public class SysDictType extends BaseEntity {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 字典主键
|
* 字典主键
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "字典主键")
|
||||||
@ExcelProperty(value = "字典主键")
|
@ExcelProperty(value = "字典主键")
|
||||||
@TableId(value = "dict_id", type = IdType.AUTO)
|
@TableId(value = "dict_id")
|
||||||
private Long dictId;
|
private Long dictId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 字典名称
|
* 字典名称
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "字典名称")
|
||||||
@ExcelProperty(value = "字典名称")
|
@ExcelProperty(value = "字典名称")
|
||||||
@NotBlank(message = "字典名称不能为空")
|
@NotBlank(message = "字典名称不能为空")
|
||||||
@Size(min = 0, max = 100, message = "字典类型名称长度不能超过100个字符")
|
@Size(min = 0, max = 100, message = "字典类型名称长度不能超过100个字符")
|
||||||
@ -48,6 +50,7 @@ public class SysDictType implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 字典类型
|
* 字典类型
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "字典类型")
|
||||||
@ExcelProperty(value = "字典类型")
|
@ExcelProperty(value = "字典类型")
|
||||||
@NotBlank(message = "字典类型不能为空")
|
@NotBlank(message = "字典类型不能为空")
|
||||||
@Size(min = 0, max = 100, message = "字典类型类型长度不能超过100个字符")
|
@Size(min = 0, max = 100, message = "字典类型类型长度不能超过100个字符")
|
||||||
@ -56,43 +59,15 @@ public class SysDictType implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 状态(0正常 1停用)
|
* 状态(0正常 1停用)
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "状态(0正常 1停用)")
|
||||||
@ExcelProperty(value = "状态", converter = ExcelDictConvert.class)
|
@ExcelProperty(value = "状态", converter = ExcelDictConvert.class)
|
||||||
@ExcelDictFormat(dictType = "sys_normal_disable")
|
@ExcelDictFormat(dictType = "sys_normal_disable")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建者
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT)
|
|
||||||
private String createBy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT)
|
|
||||||
private Date createTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新者
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
|
||||||
private String updateBy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新时间
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
|
||||||
private Date updateTime;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
/**
|
|
||||||
* 请求参数
|
|
||||||
*/
|
|
||||||
@TableField(exist = false)
|
|
||||||
private Map<String, Object> params = new HashMap<>();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,154 +1,120 @@
|
|||||||
package com.ruoyi.common.core.domain.entity;
|
package com.ruoyi.common.core.domain.entity;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.ruoyi.common.core.domain.TreeEntity;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import javax.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 菜单权限表 sys_menu
|
* 菜单权限表 sys_menu
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@TableName("sys_menu")
|
@TableName("sys_menu")
|
||||||
public class SysMenu implements Serializable {
|
@ApiModel("菜单权限业务对象")
|
||||||
private static final long serialVersionUID = 1L;
|
public class SysMenu extends TreeEntity {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 菜单ID
|
* 菜单ID
|
||||||
*/
|
*/
|
||||||
@TableId(value = "menu_id", type = IdType.AUTO)
|
@ApiModelProperty(value = "菜单ID")
|
||||||
|
@TableId(value = "menu_id")
|
||||||
private Long menuId;
|
private Long menuId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 菜单名称
|
* 菜单名称
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "菜单名称")
|
||||||
@NotBlank(message = "菜单名称不能为空")
|
@NotBlank(message = "菜单名称不能为空")
|
||||||
@Size(min = 0, max = 50, message = "菜单名称长度不能超过50个字符")
|
@Size(min = 0, max = 50, message = "菜单名称长度不能超过50个字符")
|
||||||
private String menuName;
|
private String menuName;
|
||||||
|
|
||||||
/**
|
|
||||||
* 父菜单名称
|
|
||||||
*/
|
|
||||||
@TableField(exist = false)
|
|
||||||
private String parentName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 父菜单ID
|
|
||||||
*/
|
|
||||||
private Long parentId;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 显示顺序
|
* 显示顺序
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "显示顺序")
|
||||||
@NotBlank(message = "显示顺序不能为空")
|
@NotBlank(message = "显示顺序不能为空")
|
||||||
private String orderNum;
|
private String orderNum;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 路由地址
|
* 路由地址
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "路由地址")
|
||||||
@Size(min = 0, max = 200, message = "路由地址不能超过200个字符")
|
@Size(min = 0, max = 200, message = "路由地址不能超过200个字符")
|
||||||
private String path;
|
private String path;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 组件路径
|
* 组件路径
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "组件路径")
|
||||||
@Size(min = 0, max = 200, message = "组件路径不能超过255个字符")
|
@Size(min = 0, max = 200, message = "组件路径不能超过255个字符")
|
||||||
private String component;
|
private String component;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 路由参数
|
* 路由参数
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "路由参数")
|
||||||
private String query;
|
private String query;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否为外链(0是 1否)
|
* 是否为外链(0是 1否)
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "是否为外链(0是 1否)")
|
||||||
private String isFrame;
|
private String isFrame;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否缓存(0缓存 1不缓存)
|
* 是否缓存(0缓存 1不缓存)
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "是否缓存(0缓存 1不缓存)")
|
||||||
private String isCache;
|
private String isCache;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 类型(M目录 C菜单 F按钮)
|
* 类型(M目录 C菜单 F按钮)
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "类型(M目录 C菜单 F按钮)")
|
||||||
@NotBlank(message = "菜单类型不能为空")
|
@NotBlank(message = "菜单类型不能为空")
|
||||||
private String menuType;
|
private String menuType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 显示状态(0显示 1隐藏)
|
* 显示状态(0显示 1隐藏)
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "显示状态(0显示 1隐藏)")
|
||||||
private String visible;
|
private String visible;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 菜单状态(0显示 1隐藏)
|
* 菜单状态(0显示 1隐藏)
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "菜单状态(0显示 1隐藏)")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 权限字符串
|
* 权限字符串
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "权限字符串")
|
||||||
@Size(min = 0, max = 100, message = "权限标识长度不能超过100个字符")
|
@Size(min = 0, max = 100, message = "权限标识长度不能超过100个字符")
|
||||||
private String perms;
|
private String perms;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 菜单图标
|
* 菜单图标
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "菜单图标")
|
||||||
private String icon;
|
private String icon;
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建者
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT)
|
|
||||||
private String createBy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT)
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private Date createTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新者
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
|
||||||
private String updateBy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新时间
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private Date updateTime;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
/**
|
|
||||||
* 请求参数
|
|
||||||
*/
|
|
||||||
@TableField(exist = false)
|
|
||||||
private Map<String, Object> params = new HashMap<>();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 子菜单
|
|
||||||
*/
|
|
||||||
@TableField(exist = false)
|
|
||||||
private List<SysMenu> children = new ArrayList<SysMenu>();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,44 +2,48 @@ package com.ruoyi.common.core.domain.entity;
|
|||||||
|
|
||||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.ruoyi.common.annotation.ExcelDictFormat;
|
import com.ruoyi.common.annotation.ExcelDictFormat;
|
||||||
import com.ruoyi.common.convert.ExcelDictConvert;
|
import com.ruoyi.common.convert.ExcelDictConvert;
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import javax.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 角色表 sys_role
|
* 角色表 sys_role
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@TableName("sys_role")
|
@TableName("sys_role")
|
||||||
@ExcelIgnoreUnannotated
|
@ExcelIgnoreUnannotated
|
||||||
public class SysRole implements Serializable {
|
public class SysRole extends BaseEntity {
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 角色ID
|
* 角色ID
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "角色ID")
|
||||||
@ExcelProperty(value = "角色序号")
|
@ExcelProperty(value = "角色序号")
|
||||||
@TableId(value = "role_id", type = IdType.AUTO)
|
@TableId(value = "role_id")
|
||||||
private Long roleId;
|
private Long roleId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 角色名称
|
* 角色名称
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "角色名称")
|
||||||
@ExcelProperty(value = "角色名称")
|
@ExcelProperty(value = "角色名称")
|
||||||
@NotBlank(message = "角色名称不能为空")
|
@NotBlank(message = "角色名称不能为空")
|
||||||
@Size(min = 0, max = 30, message = "角色名称长度不能超过30个字符")
|
@Size(min = 0, max = 30, message = "角色名称长度不能超过30个字符")
|
||||||
@ -48,6 +52,7 @@ public class SysRole implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 角色权限
|
* 角色权限
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "角色权限")
|
||||||
@ExcelProperty(value = "角色权限")
|
@ExcelProperty(value = "角色权限")
|
||||||
@NotBlank(message = "权限字符不能为空")
|
@NotBlank(message = "权限字符不能为空")
|
||||||
@Size(min = 0, max = 100, message = "权限字符长度不能超过100个字符")
|
@Size(min = 0, max = 100, message = "权限字符长度不能超过100个字符")
|
||||||
@ -56,6 +61,7 @@ public class SysRole implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 角色排序
|
* 角色排序
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "角色排序")
|
||||||
@ExcelProperty(value = "角色排序")
|
@ExcelProperty(value = "角色排序")
|
||||||
@NotBlank(message = "显示顺序不能为空")
|
@NotBlank(message = "显示顺序不能为空")
|
||||||
private String roleSort;
|
private String roleSort;
|
||||||
@ -63,6 +69,7 @@ public class SysRole implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限;5:仅本人数据权限)
|
* 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限;5:仅本人数据权限)
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限;5:仅本人数据权限)")
|
||||||
@ExcelProperty(value = "数据范围", converter = ExcelDictConvert.class)
|
@ExcelProperty(value = "数据范围", converter = ExcelDictConvert.class)
|
||||||
@ExcelDictFormat(readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限,5=仅本人数据权限")
|
@ExcelDictFormat(readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限,5=仅本人数据权限")
|
||||||
private String dataScope;
|
private String dataScope;
|
||||||
@ -70,16 +77,19 @@ public class SysRole implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 菜单树选择项是否关联显示( 0:父子不互相关联显示 1:父子互相关联显示)
|
* 菜单树选择项是否关联显示( 0:父子不互相关联显示 1:父子互相关联显示)
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "菜单树选择项是否关联显示( 0:父子不互相关联显示 1:父子互相关联显示)")
|
||||||
private boolean menuCheckStrictly;
|
private boolean menuCheckStrictly;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门树选择项是否关联显示(0:父子不互相关联显示 1:父子互相关联显示 )
|
* 部门树选择项是否关联显示(0:父子不互相关联显示 1:父子互相关联显示 )
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "部门树选择项是否关联显示(0:父子不互相关联显示 1:父子互相关联显示 )")
|
||||||
private boolean deptCheckStrictly;
|
private boolean deptCheckStrictly;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 角色状态(0正常 1停用)
|
* 角色状态(0正常 1停用)
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "角色状态(0正常 1停用)")
|
||||||
@ExcelProperty(value = "角色状态", converter = ExcelDictConvert.class)
|
@ExcelProperty(value = "角色状态", converter = ExcelDictConvert.class)
|
||||||
@ExcelDictFormat(dictType = "sys_common_status")
|
@ExcelDictFormat(dictType = "sys_common_status")
|
||||||
private String status;
|
private String status;
|
||||||
@ -87,59 +97,34 @@ public class SysRole implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 删除标志(0代表存在 2代表删除)
|
* 删除标志(0代表存在 2代表删除)
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "删除标志(0代表存在 2代表删除)")
|
||||||
@TableLogic
|
@TableLogic
|
||||||
private String delFlag;
|
private String delFlag;
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建者
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT)
|
|
||||||
private String createBy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT)
|
|
||||||
private Date createTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新者
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
|
||||||
private String updateBy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新时间
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
|
||||||
private Date updateTime;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
/**
|
|
||||||
* 请求参数
|
|
||||||
*/
|
|
||||||
@TableField(exist = false)
|
|
||||||
private Map<String, Object> params = new HashMap<>();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户是否存在此角色标识 默认不存在
|
* 用户是否存在此角色标识 默认不存在
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "用户是否存在此角色标识 默认不存在")
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private boolean flag = false;
|
private boolean flag = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 菜单组
|
* 菜单组
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "菜单组")
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private Long[] menuIds;
|
private Long[] menuIds;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门组(数据权限)
|
* 部门组(数据权限)
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "部门组(数据权限)")
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private Long[] deptIds;
|
private Long[] deptIds;
|
||||||
|
|
||||||
@ -147,6 +132,7 @@ public class SysRole implements Serializable {
|
|||||||
this.roleId = roleId;
|
this.roleId = roleId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否管理员")
|
||||||
public boolean isAdmin() {
|
public boolean isAdmin() {
|
||||||
return isAdmin(this.roleId);
|
return isAdmin(this.roleId);
|
||||||
}
|
}
|
||||||
|
@ -3,46 +3,51 @@ package com.ruoyi.common.core.domain.entity;
|
|||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
import javax.validation.constraints.Email;
|
import javax.validation.constraints.Email;
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import javax.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户对象 sys_user
|
* 用户对象 sys_user
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@TableName("sys_user")
|
@TableName("sys_user")
|
||||||
public class SysUser implements Serializable {
|
@ApiModel("用户信息业务对象")
|
||||||
private static final long serialVersionUID = 1L;
|
public class SysUser extends BaseEntity {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户ID
|
* 用户ID
|
||||||
*/
|
*/
|
||||||
@TableId(value = "user_id", type = IdType.AUTO)
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
@TableId(value = "user_id")
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门ID
|
* 部门ID
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "部门ID")
|
||||||
private Long deptId;
|
private Long deptId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户账号
|
* 用户账号
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "用户账号")
|
||||||
@NotBlank(message = "用户账号不能为空")
|
@NotBlank(message = "用户账号不能为空")
|
||||||
@Size(min = 0, max = 30, message = "用户账号长度不能超过30个字符")
|
@Size(min = 0, max = 30, message = "用户账号长度不能超过30个字符")
|
||||||
private String userName;
|
private String userName;
|
||||||
@ -50,12 +55,14 @@ public class SysUser implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 用户昵称
|
* 用户昵称
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "用户昵称")
|
||||||
@Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符")
|
@Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符")
|
||||||
private String nickName;
|
private String nickName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户邮箱
|
* 用户邮箱
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "用户邮箱")
|
||||||
@Email(message = "邮箱格式不正确")
|
@Email(message = "邮箱格式不正确")
|
||||||
@Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符")
|
@Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符")
|
||||||
private String email;
|
private String email;
|
||||||
@ -63,21 +70,25 @@ public class SysUser implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 手机号码
|
* 手机号码
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "手机号码")
|
||||||
private String phonenumber;
|
private String phonenumber;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户性别
|
* 用户性别
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "用户性别")
|
||||||
private String sex;
|
private String sex;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户头像
|
* 用户头像
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "用户头像")
|
||||||
private String avatar;
|
private String avatar;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 密码
|
* 密码
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "密码")
|
||||||
@TableField(
|
@TableField(
|
||||||
insertStrategy = FieldStrategy.NOT_EMPTY,
|
insertStrategy = FieldStrategy.NOT_EMPTY,
|
||||||
updateStrategy = FieldStrategy.NOT_EMPTY,
|
updateStrategy = FieldStrategy.NOT_EMPTY,
|
||||||
@ -94,86 +105,66 @@ public class SysUser implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 帐号状态(0正常 1停用)
|
* 帐号状态(0正常 1停用)
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "帐号状态(0正常 1停用)")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除标志(0代表存在 2代表删除)
|
* 删除标志(0代表存在 2代表删除)
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "删除标志(0代表存在 2代表删除)")
|
||||||
@TableLogic
|
@TableLogic
|
||||||
private String delFlag;
|
private String delFlag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 最后登录IP
|
* 最后登录IP
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "最后登录IP")
|
||||||
private String loginIp;
|
private String loginIp;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 最后登录时间
|
* 最后登录时间
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "最后登录时间")
|
||||||
private Date loginDate;
|
private Date loginDate;
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建者
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT)
|
|
||||||
private String createBy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT)
|
|
||||||
private Date createTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新者
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
|
||||||
private String updateBy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新时间
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
|
||||||
private Date updateTime;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
/**
|
|
||||||
* 请求参数
|
|
||||||
*/
|
|
||||||
@TableField(exist = false)
|
|
||||||
private Map<String, Object> params = new HashMap<>();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门对象
|
* 部门对象
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "部门对象")
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private SysDept dept;
|
private SysDept dept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 角色对象
|
* 角色对象
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "角色对象")
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private List<SysRole> roles;
|
private List<SysRole> roles;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 角色组
|
* 角色组
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "角色组")
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private Long[] roleIds;
|
private Long[] roleIds;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 岗位组
|
* 岗位组
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "岗位组")
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private Long[] postIds;
|
private Long[] postIds;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 角色ID
|
* 角色ID
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "角色ID")
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private Long roleId;
|
private Long roleId;
|
||||||
|
|
||||||
@ -181,6 +172,7 @@ public class SysUser implements Serializable {
|
|||||||
this.userId = userId;
|
this.userId = userId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否管理员")
|
||||||
public boolean isAdmin() {
|
public boolean isAdmin() {
|
||||||
return isAdmin(this.userId);
|
return isAdmin(this.userId);
|
||||||
}
|
}
|
||||||
|
@ -1,37 +1,43 @@
|
|||||||
package com.ruoyi.common.core.domain.model;
|
package com.ruoyi.common.core.domain.model;
|
||||||
|
|
||||||
import lombok.*;
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户登录对象
|
* 用户登录对象
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
public class LoginBody
|
@ApiModel("用户登录对象")
|
||||||
{
|
public class LoginBody {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户名
|
* 用户名
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "用户名")
|
||||||
private String username;
|
private String username;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户密码
|
* 用户密码
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "用户密码")
|
||||||
private String password;
|
private String password;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 验证码
|
* 验证码
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "验证码")
|
||||||
private String code;
|
private String code;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 唯一标识
|
* 唯一标识
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "唯一标识")
|
||||||
private String uuid = "";
|
private String uuid = "";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,8 @@ package com.ruoyi.common.core.domain.model;
|
|||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||||
import lombok.*;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
import org.springframework.security.core.GrantedAuthority;
|
import org.springframework.security.core.GrantedAuthority;
|
||||||
import org.springframework.security.core.userdetails.UserDetails;
|
import org.springframework.security.core.userdetails.UserDetails;
|
||||||
@ -13,14 +14,14 @@ import java.util.Set;
|
|||||||
/**
|
/**
|
||||||
* 登录用户身份权限
|
* 登录用户身份权限
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
public class LoginUser implements UserDetails
|
public class LoginUser implements UserDetails {
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -78,14 +79,12 @@ public class LoginUser implements UserDetails
|
|||||||
*/
|
*/
|
||||||
private SysUser user;
|
private SysUser user;
|
||||||
|
|
||||||
public LoginUser(SysUser user, Set<String> permissions)
|
public LoginUser(SysUser user, Set<String> permissions) {
|
||||||
{
|
|
||||||
this.user = user;
|
this.user = user;
|
||||||
this.permissions = permissions;
|
this.permissions = permissions;
|
||||||
}
|
}
|
||||||
|
|
||||||
public LoginUser(Long userId, Long deptId, SysUser user, Set<String> permissions)
|
public LoginUser(Long userId, Long deptId, SysUser user, Set<String> permissions) {
|
||||||
{
|
|
||||||
this.userId = userId;
|
this.userId = userId;
|
||||||
this.deptId = deptId;
|
this.deptId = deptId;
|
||||||
this.user = user;
|
this.user = user;
|
||||||
@ -94,14 +93,12 @@ public class LoginUser implements UserDetails
|
|||||||
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
@Override
|
@Override
|
||||||
public String getPassword()
|
public String getPassword() {
|
||||||
{
|
|
||||||
return user.getPassword();
|
return user.getPassword();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUsername()
|
public String getUsername() {
|
||||||
{
|
|
||||||
return user.getUserName();
|
return user.getUserName();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -110,50 +107,39 @@ public class LoginUser implements UserDetails
|
|||||||
*/
|
*/
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
@Override
|
@Override
|
||||||
public boolean isAccountNonExpired()
|
public boolean isAccountNonExpired() {
|
||||||
{
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 指定用户是否解锁,锁定的用户无法进行身份验证
|
* 指定用户是否解锁,锁定的用户无法进行身份验证
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
@Override
|
@Override
|
||||||
public boolean isAccountNonLocked()
|
public boolean isAccountNonLocked() {
|
||||||
{
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 指示是否已过期的用户的凭据(密码),过期的凭据防止认证
|
* 指示是否已过期的用户的凭据(密码),过期的凭据防止认证
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
@Override
|
@Override
|
||||||
public boolean isCredentialsNonExpired()
|
public boolean isCredentialsNonExpired() {
|
||||||
{
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否可用 ,禁用的用户不能身份验证
|
* 是否可用 ,禁用的用户不能身份验证
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
@Override
|
@Override
|
||||||
public boolean isEnabled()
|
public boolean isEnabled() {
|
||||||
{
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<? extends GrantedAuthority> getAuthorities()
|
public Collection<? extends GrantedAuthority> getAuthorities() {
|
||||||
{
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
package com.ruoyi.common.core.domain.model;
|
package com.ruoyi.common.core.domain.model;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户注册对象
|
* 用户注册对象
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
public class RegisterBody extends LoginBody
|
@ApiModel("用户注册对象")
|
||||||
{
|
public class RegisterBody extends LoginBody {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -13,61 +13,61 @@ import org.springframework.stereotype.Component;
|
|||||||
@Component
|
@Component
|
||||||
@ConfigurationProperties(prefix = "gen")
|
@ConfigurationProperties(prefix = "gen")
|
||||||
@PropertySource(value = {"classpath:generator.yml"})
|
@PropertySource(value = {"classpath:generator.yml"})
|
||||||
public class GenConfig
|
public class GenConfig {
|
||||||
{
|
|
||||||
/** 作者 */
|
/**
|
||||||
|
* 作者
|
||||||
|
*/
|
||||||
public static String author;
|
public static String author;
|
||||||
|
|
||||||
/** 生成包路径 */
|
/**
|
||||||
|
* 生成包路径
|
||||||
|
*/
|
||||||
public static String packageName;
|
public static String packageName;
|
||||||
|
|
||||||
/** 自动去除表前缀,默认是false */
|
/**
|
||||||
|
* 自动去除表前缀,默认是false
|
||||||
|
*/
|
||||||
public static boolean autoRemovePre;
|
public static boolean autoRemovePre;
|
||||||
|
|
||||||
/** 表前缀(类名不会包含表前缀) */
|
/**
|
||||||
|
* 表前缀(类名不会包含表前缀)
|
||||||
|
*/
|
||||||
public static String tablePrefix;
|
public static String tablePrefix;
|
||||||
|
|
||||||
public static String getAuthor()
|
public static String getAuthor() {
|
||||||
{
|
|
||||||
return author;
|
return author;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Value("${author}")
|
@Value("${author}")
|
||||||
public void setAuthor(String author)
|
public void setAuthor(String author) {
|
||||||
{
|
|
||||||
GenConfig.author = author;
|
GenConfig.author = author;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getPackageName()
|
public static String getPackageName() {
|
||||||
{
|
|
||||||
return packageName;
|
return packageName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Value("${packageName}")
|
@Value("${packageName}")
|
||||||
public void setPackageName(String packageName)
|
public void setPackageName(String packageName) {
|
||||||
{
|
|
||||||
GenConfig.packageName = packageName;
|
GenConfig.packageName = packageName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean getAutoRemovePre()
|
public static boolean getAutoRemovePre() {
|
||||||
{
|
|
||||||
return autoRemovePre;
|
return autoRemovePre;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Value("${autoRemovePre}")
|
@Value("${autoRemovePre}")
|
||||||
public void setAutoRemovePre(boolean autoRemovePre)
|
public void setAutoRemovePre(boolean autoRemovePre) {
|
||||||
{
|
|
||||||
GenConfig.autoRemovePre = autoRemovePre;
|
GenConfig.autoRemovePre = autoRemovePre;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getTablePrefix()
|
public static String getTablePrefix() {
|
||||||
{
|
|
||||||
return tablePrefix;
|
return tablePrefix;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Value("${tablePrefix}")
|
@Value("${tablePrefix}")
|
||||||
public void setTablePrefix(String tablePrefix)
|
public void setTablePrefix(String tablePrefix) {
|
||||||
{
|
|
||||||
GenConfig.tablePrefix = tablePrefix;
|
GenConfig.tablePrefix = tablePrefix;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,9 @@ import com.ruoyi.generator.domain.GenTable;
|
|||||||
import com.ruoyi.generator.domain.GenTableColumn;
|
import com.ruoyi.generator.domain.GenTableColumn;
|
||||||
import com.ruoyi.generator.service.IGenTableColumnService;
|
import com.ruoyi.generator.service.IGenTableColumnService;
|
||||||
import com.ruoyi.generator.service.IGenTableService;
|
import com.ruoyi.generator.service.IGenTableService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.apache.commons.io.IOUtils;
|
import org.apache.commons.io.IOUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
@ -25,35 +28,35 @@ import java.util.Map;
|
|||||||
/**
|
/**
|
||||||
* 代码生成 操作处理
|
* 代码生成 操作处理
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
|
@Validated
|
||||||
|
@Api(value = "代码生成", tags = {"代码生成管理"})
|
||||||
|
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/tool/gen")
|
@RequestMapping("/tool/gen")
|
||||||
public class GenController extends BaseController
|
public class GenController extends BaseController {
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private IGenTableService genTableService;
|
|
||||||
|
|
||||||
@Autowired
|
private final IGenTableService genTableService;
|
||||||
private IGenTableColumnService genTableColumnService;
|
private final IGenTableColumnService genTableColumnService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询代码生成列表
|
* 查询代码生成列表
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("查询代码生成列表")
|
||||||
@PreAuthorize("@ss.hasPermi('tool:gen:list')")
|
@PreAuthorize("@ss.hasPermi('tool:gen:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo genList(GenTable genTable)
|
public TableDataInfo<GenTable> genList(GenTable genTable) {
|
||||||
{
|
|
||||||
return genTableService.selectPageGenTableList(genTable);
|
return genTableService.selectPageGenTableList(genTable);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改代码生成业务
|
* 修改代码生成业务
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("修改代码生成业务")
|
||||||
@PreAuthorize("@ss.hasPermi('tool:gen:query')")
|
@PreAuthorize("@ss.hasPermi('tool:gen:query')")
|
||||||
@GetMapping(value = "/{talbleId}")
|
@GetMapping(value = "/{talbleId}")
|
||||||
public AjaxResult getInfo(@PathVariable Long talbleId)
|
public AjaxResult<Map<String, Object>> getInfo(@PathVariable Long talbleId) {
|
||||||
{
|
|
||||||
GenTable table = genTableService.selectGenTableById(talbleId);
|
GenTable table = genTableService.selectGenTableById(talbleId);
|
||||||
List<GenTable> tables = genTableService.selectGenTableAll();
|
List<GenTable> tables = genTableService.selectGenTableAll();
|
||||||
List<GenTableColumn> list = genTableColumnService.selectGenTableColumnListByTableId(talbleId);
|
List<GenTableColumn> list = genTableColumnService.selectGenTableColumnListByTableId(talbleId);
|
||||||
@ -67,21 +70,21 @@ public class GenController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 查询数据库列表
|
* 查询数据库列表
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("查询数据库列表")
|
||||||
@PreAuthorize("@ss.hasPermi('tool:gen:list')")
|
@PreAuthorize("@ss.hasPermi('tool:gen:list')")
|
||||||
@GetMapping("/db/list")
|
@GetMapping("/db/list")
|
||||||
public TableDataInfo dataList(GenTable genTable)
|
public TableDataInfo<GenTable> dataList(GenTable genTable) {
|
||||||
{
|
|
||||||
return genTableService.selectPageDbTableList(genTable);
|
return genTableService.selectPageDbTableList(genTable);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询数据表字段列表
|
* 查询数据表字段列表
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("查询数据表字段列表")
|
||||||
@PreAuthorize("@ss.hasPermi('tool:gen:list')")
|
@PreAuthorize("@ss.hasPermi('tool:gen:list')")
|
||||||
@GetMapping(value = "/column/{talbleId}")
|
@GetMapping(value = "/column/{talbleId}")
|
||||||
public TableDataInfo columnList(Long tableId)
|
public TableDataInfo<GenTableColumn> columnList(Long tableId) {
|
||||||
{
|
TableDataInfo<GenTableColumn> dataInfo = new TableDataInfo<>();
|
||||||
TableDataInfo dataInfo = new TableDataInfo();
|
|
||||||
List<GenTableColumn> list = genTableColumnService.selectGenTableColumnListByTableId(tableId);
|
List<GenTableColumn> list = genTableColumnService.selectGenTableColumnListByTableId(tableId);
|
||||||
dataInfo.setRows(list);
|
dataInfo.setRows(list);
|
||||||
dataInfo.setTotal(list.size());
|
dataInfo.setTotal(list.size());
|
||||||
@ -91,11 +94,11 @@ public class GenController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 导入表结构(保存)
|
* 导入表结构(保存)
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("导入表结构(保存)")
|
||||||
@PreAuthorize("@ss.hasPermi('tool:gen:import')")
|
@PreAuthorize("@ss.hasPermi('tool:gen:import')")
|
||||||
@Log(title = "代码生成", businessType = BusinessType.IMPORT)
|
@Log(title = "代码生成", businessType = BusinessType.IMPORT)
|
||||||
@PostMapping("/importTable")
|
@PostMapping("/importTable")
|
||||||
public AjaxResult importTableSave(String tables)
|
public AjaxResult<Void> importTableSave(String tables) {
|
||||||
{
|
|
||||||
String[] tableNames = Convert.toStrArray(tables);
|
String[] tableNames = Convert.toStrArray(tables);
|
||||||
// 查询表信息
|
// 查询表信息
|
||||||
List<GenTable> tableList = genTableService.selectDbTableListByNames(tableNames);
|
List<GenTable> tableList = genTableService.selectDbTableListByNames(tableNames);
|
||||||
@ -106,11 +109,11 @@ public class GenController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 修改保存代码生成业务
|
* 修改保存代码生成业务
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("修改保存代码生成业务")
|
||||||
@PreAuthorize("@ss.hasPermi('tool:gen:edit')")
|
@PreAuthorize("@ss.hasPermi('tool:gen:edit')")
|
||||||
@Log(title = "代码生成", businessType = BusinessType.UPDATE)
|
@Log(title = "代码生成", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult editSave(@Validated @RequestBody GenTable genTable)
|
public AjaxResult<Void> editSave(@Validated @RequestBody GenTable genTable) {
|
||||||
{
|
|
||||||
genTableService.validateEdit(genTable);
|
genTableService.validateEdit(genTable);
|
||||||
genTableService.updateGenTable(genTable);
|
genTableService.updateGenTable(genTable);
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
@ -119,11 +122,11 @@ public class GenController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 删除代码生成
|
* 删除代码生成
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("删除代码生成")
|
||||||
@PreAuthorize("@ss.hasPermi('tool:gen:remove')")
|
@PreAuthorize("@ss.hasPermi('tool:gen:remove')")
|
||||||
@Log(title = "代码生成", businessType = BusinessType.DELETE)
|
@Log(title = "代码生成", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{tableIds}")
|
@DeleteMapping("/{tableIds}")
|
||||||
public AjaxResult remove(@PathVariable Long[] tableIds)
|
public AjaxResult<Void> remove(@PathVariable Long[] tableIds) {
|
||||||
{
|
|
||||||
genTableService.deleteGenTableByIds(tableIds);
|
genTableService.deleteGenTableByIds(tableIds);
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
@ -131,10 +134,10 @@ public class GenController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 预览代码
|
* 预览代码
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("预览代码")
|
||||||
@PreAuthorize("@ss.hasPermi('tool:gen:preview')")
|
@PreAuthorize("@ss.hasPermi('tool:gen:preview')")
|
||||||
@GetMapping("/preview/{tableId}")
|
@GetMapping("/preview/{tableId}")
|
||||||
public AjaxResult preview(@PathVariable("tableId") Long tableId) throws IOException
|
public AjaxResult<Map<String, String>> preview(@PathVariable("tableId") Long tableId) throws IOException {
|
||||||
{
|
|
||||||
Map<String, String> dataMap = genTableService.previewCode(tableId);
|
Map<String, String> dataMap = genTableService.previewCode(tableId);
|
||||||
return AjaxResult.success(dataMap);
|
return AjaxResult.success(dataMap);
|
||||||
}
|
}
|
||||||
@ -142,11 +145,11 @@ public class GenController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 生成代码(下载方式)
|
* 生成代码(下载方式)
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("生成代码(下载方式)")
|
||||||
@PreAuthorize("@ss.hasPermi('tool:gen:code')")
|
@PreAuthorize("@ss.hasPermi('tool:gen:code')")
|
||||||
@Log(title = "代码生成", businessType = BusinessType.GENCODE)
|
@Log(title = "代码生成", businessType = BusinessType.GENCODE)
|
||||||
@GetMapping("/download/{tableName}")
|
@GetMapping("/download/{tableName}")
|
||||||
public void download(HttpServletResponse response, @PathVariable("tableName") String tableName) throws IOException
|
public void download(HttpServletResponse response, @PathVariable("tableName") String tableName) throws IOException {
|
||||||
{
|
|
||||||
byte[] data = genTableService.downloadCode(tableName);
|
byte[] data = genTableService.downloadCode(tableName);
|
||||||
genCode(response, data);
|
genCode(response, data);
|
||||||
}
|
}
|
||||||
@ -154,11 +157,11 @@ public class GenController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 生成代码(自定义路径)
|
* 生成代码(自定义路径)
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("生成代码(自定义路径)")
|
||||||
@PreAuthorize("@ss.hasPermi('tool:gen:code')")
|
@PreAuthorize("@ss.hasPermi('tool:gen:code')")
|
||||||
@Log(title = "代码生成", businessType = BusinessType.GENCODE)
|
@Log(title = "代码生成", businessType = BusinessType.GENCODE)
|
||||||
@GetMapping("/genCode/{tableName}")
|
@GetMapping("/genCode/{tableName}")
|
||||||
public AjaxResult genCode(@PathVariable("tableName") String tableName)
|
public AjaxResult<Void> genCode(@PathVariable("tableName") String tableName) {
|
||||||
{
|
|
||||||
genTableService.generatorCode(tableName);
|
genTableService.generatorCode(tableName);
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
@ -166,11 +169,11 @@ public class GenController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 同步数据库
|
* 同步数据库
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("同步数据库")
|
||||||
@PreAuthorize("@ss.hasPermi('tool:gen:edit')")
|
@PreAuthorize("@ss.hasPermi('tool:gen:edit')")
|
||||||
@Log(title = "代码生成", businessType = BusinessType.UPDATE)
|
@Log(title = "代码生成", businessType = BusinessType.UPDATE)
|
||||||
@GetMapping("/synchDb/{tableName}")
|
@GetMapping("/synchDb/{tableName}")
|
||||||
public AjaxResult synchDb(@PathVariable("tableName") String tableName)
|
public AjaxResult<Void> synchDb(@PathVariable("tableName") String tableName) {
|
||||||
{
|
|
||||||
genTableService.synchDb(tableName);
|
genTableService.synchDb(tableName);
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
@ -178,11 +181,11 @@ public class GenController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 批量生成代码
|
* 批量生成代码
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation("批量生成代码")
|
||||||
@PreAuthorize("@ss.hasPermi('tool:gen:code')")
|
@PreAuthorize("@ss.hasPermi('tool:gen:code')")
|
||||||
@Log(title = "代码生成", businessType = BusinessType.GENCODE)
|
@Log(title = "代码生成", businessType = BusinessType.GENCODE)
|
||||||
@GetMapping("/batchGenCode")
|
@GetMapping("/batchGenCode")
|
||||||
public void batchGenCode(HttpServletResponse response, String tables) throws IOException
|
public void batchGenCode(HttpServletResponse response, String tables) throws IOException {
|
||||||
{
|
|
||||||
String[] tableNames = Convert.toStrArray(tables);
|
String[] tableNames = Convert.toStrArray(tables);
|
||||||
byte[] data = genTableService.downloadCode(tableNames);
|
byte[] data = genTableService.downloadCode(tableNames);
|
||||||
genCode(response, data);
|
genCode(response, data);
|
||||||
@ -191,8 +194,7 @@ public class GenController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 生成zip文件
|
* 生成zip文件
|
||||||
*/
|
*/
|
||||||
private void genCode(HttpServletResponse response, byte[] data) throws IOException
|
private void genCode(HttpServletResponse response, byte[] data) throws IOException {
|
||||||
{
|
|
||||||
response.reset();
|
response.reset();
|
||||||
response.addHeader("Access-Control-Allow-Origin", "*");
|
response.addHeader("Access-Control-Allow-Origin", "*");
|
||||||
response.addHeader("Access-Control-Expose-Headers", "Content-Disposition");
|
response.addHeader("Access-Control-Expose-Headers", "Content-Disposition");
|
||||||
|
@ -1,38 +1,36 @@
|
|||||||
package com.ruoyi.generator.domain;
|
package com.ruoyi.generator.domain;
|
||||||
|
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.ruoyi.common.constant.GenConstants;
|
import com.ruoyi.common.constant.GenConstants;
|
||||||
import lombok.*;
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 业务表 gen_table
|
* 业务表 gen_table
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@TableName("gen_table")
|
@TableName("gen_table")
|
||||||
public class GenTable implements Serializable {
|
public class GenTable extends BaseEntity {
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 编号
|
* 编号
|
||||||
*/
|
*/
|
||||||
@TableId(value = "table_id", type = IdType.AUTO)
|
@TableId(value = "table_id")
|
||||||
private Long tableId;
|
private Long tableId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -132,43 +130,11 @@ public class GenTable implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String options;
|
private String options;
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建者
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT)
|
|
||||||
private String createBy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT)
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private Date createTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新者
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
|
||||||
private String updateBy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新时间
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private Date updateTime;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
/**
|
|
||||||
* 请求参数
|
|
||||||
*/
|
|
||||||
@TableField(exist = false)
|
|
||||||
private Map<String, Object> params = new HashMap<>();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 树编码字段
|
* 树编码字段
|
||||||
*/
|
*/
|
||||||
|
@ -1,34 +1,33 @@
|
|||||||
package com.ruoyi.generator.domain;
|
package com.ruoyi.generator.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import lombok.Data;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.*;
|
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 代码生成业务字段表 gen_table_column
|
* 代码生成业务字段表 gen_table_column
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@TableName("gen_table_column")
|
@TableName("gen_table_column")
|
||||||
public class GenTableColumn implements Serializable {
|
public class GenTableColumn extends BaseEntity {
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 编号
|
* 编号
|
||||||
*/
|
*/
|
||||||
@TableId(value = "column_id", type = IdType.AUTO)
|
@TableId(value = "column_id")
|
||||||
private Long columnId;
|
private Long columnId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -125,38 +124,6 @@ public class GenTableColumn implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private Integer sort;
|
private Integer sort;
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建者
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT)
|
|
||||||
private String createBy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT)
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private Date createTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新者
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
|
||||||
private String updateBy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新时间
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private Date updateTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 请求参数
|
|
||||||
*/
|
|
||||||
@TableField(exist = false)
|
|
||||||
private Map<String, Object> params = new HashMap<>();
|
|
||||||
|
|
||||||
public String getCapJavaField() {
|
public String getCapJavaField() {
|
||||||
return StringUtils.uncapitalize(javaField);
|
return StringUtils.uncapitalize(javaField);
|
||||||
}
|
}
|
||||||
@ -224,9 +191,9 @@ public class GenTableColumn implements Serializable {
|
|||||||
public static boolean isSuperColumn(String javaField) {
|
public static boolean isSuperColumn(String javaField) {
|
||||||
return StringUtils.equalsAnyIgnoreCase(javaField,
|
return StringUtils.equalsAnyIgnoreCase(javaField,
|
||||||
// BaseEntity
|
// BaseEntity
|
||||||
"createBy", "createTime", "updateBy", "updateTime", "remark",
|
"createBy", "createTime", "updateBy", "updateTime",
|
||||||
// TreeEntity
|
// TreeEntity
|
||||||
"parentName", "parentId", "orderNum", "ancestors");
|
"parentName", "parentId", "orderNum");
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isUsableColumn() {
|
public boolean isUsableColumn() {
|
||||||
|
@ -8,7 +8,7 @@ import java.util.List;
|
|||||||
/**
|
/**
|
||||||
* 业务字段 数据层
|
* 业务字段 数据层
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
public interface GenTableColumnMapper extends BaseMapperPlus<GenTableColumn> {
|
public interface GenTableColumnMapper extends BaseMapperPlus<GenTableColumn> {
|
||||||
/**
|
/**
|
||||||
@ -17,6 +17,6 @@ public interface GenTableColumnMapper extends BaseMapperPlus<GenTableColumn> {
|
|||||||
* @param tableName 表名称
|
* @param tableName 表名称
|
||||||
* @return 列信息
|
* @return 列信息
|
||||||
*/
|
*/
|
||||||
public List<GenTableColumn> selectDbTableColumnsByName(String tableName);
|
List<GenTableColumn> selectDbTableColumnsByName(String tableName);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ import java.util.List;
|
|||||||
/**
|
/**
|
||||||
* 业务 数据层
|
* 业务 数据层
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
public interface GenTableMapper extends BaseMapperPlus<GenTable> {
|
public interface GenTableMapper extends BaseMapperPlus<GenTable> {
|
||||||
|
|
||||||
@ -25,7 +25,7 @@ public interface GenTableMapper extends BaseMapperPlus<GenTable> {
|
|||||||
* @param genTable 业务信息
|
* @param genTable 业务信息
|
||||||
* @return 业务集合
|
* @return 业务集合
|
||||||
*/
|
*/
|
||||||
public List<GenTable> selectGenTableList(GenTable genTable);
|
List<GenTable> selectGenTableList(GenTable genTable);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询据库列表
|
* 查询据库列表
|
||||||
@ -33,7 +33,7 @@ public interface GenTableMapper extends BaseMapperPlus<GenTable> {
|
|||||||
* @param genTable 业务信息
|
* @param genTable 业务信息
|
||||||
* @return 数据库表集合
|
* @return 数据库表集合
|
||||||
*/
|
*/
|
||||||
public List<GenTable> selectDbTableList(GenTable genTable);
|
List<GenTable> selectDbTableList(GenTable genTable);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询据库列表
|
* 查询据库列表
|
||||||
@ -41,14 +41,14 @@ public interface GenTableMapper extends BaseMapperPlus<GenTable> {
|
|||||||
* @param tableNames 表名称组
|
* @param tableNames 表名称组
|
||||||
* @return 数据库表集合
|
* @return 数据库表集合
|
||||||
*/
|
*/
|
||||||
public List<GenTable> selectDbTableListByNames(String[] tableNames);
|
List<GenTable> selectDbTableListByNames(String[] tableNames);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询所有表信息
|
* 查询所有表信息
|
||||||
*
|
*
|
||||||
* @return 表信息集合
|
* @return 表信息集合
|
||||||
*/
|
*/
|
||||||
public List<GenTable> selectGenTableAll();
|
List<GenTable> selectGenTableAll();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询表ID业务信息
|
* 查询表ID业务信息
|
||||||
@ -56,7 +56,7 @@ public interface GenTableMapper extends BaseMapperPlus<GenTable> {
|
|||||||
* @param id 业务ID
|
* @param id 业务ID
|
||||||
* @return 业务信息
|
* @return 业务信息
|
||||||
*/
|
*/
|
||||||
public GenTable selectGenTableById(Long id);
|
GenTable selectGenTableById(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询表名称业务信息
|
* 查询表名称业务信息
|
||||||
@ -64,6 +64,6 @@ public interface GenTableMapper extends BaseMapperPlus<GenTable> {
|
|||||||
* @param tableName 表名称
|
* @param tableName 表名称
|
||||||
* @return 业务信息
|
* @return 业务信息
|
||||||
*/
|
*/
|
||||||
public GenTable selectGenTableByName(String tableName);
|
GenTable selectGenTableByName(String tableName);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ import java.util.List;
|
|||||||
/**
|
/**
|
||||||
* 业务字段 服务层实现
|
* 业务字段 服务层实现
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class GenTableColumnServiceImpl extends ServicePlusImpl<GenTableColumnMapper, GenTableColumn, GenTableColumn> implements IGenTableColumnService {
|
public class GenTableColumnServiceImpl extends ServicePlusImpl<GenTableColumnMapper, GenTableColumn, GenTableColumn> implements IGenTableColumnService {
|
||||||
|
@ -41,7 +41,7 @@ import java.util.zip.ZipOutputStream;
|
|||||||
/**
|
/**
|
||||||
* 业务 服务层实现
|
* 业务 服务层实现
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
|
@ -8,7 +8,7 @@ import java.util.List;
|
|||||||
/**
|
/**
|
||||||
* 业务字段 服务层
|
* 业务字段 服务层
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
public interface IGenTableColumnService extends IService<GenTableColumn> {
|
public interface IGenTableColumnService extends IService<GenTableColumn> {
|
||||||
/**
|
/**
|
||||||
@ -17,7 +17,7 @@ public interface IGenTableColumnService extends IService<GenTableColumn> {
|
|||||||
* @param tableId 业务字段编号
|
* @param tableId 业务字段编号
|
||||||
* @return 业务字段集合
|
* @return 业务字段集合
|
||||||
*/
|
*/
|
||||||
public List<GenTableColumn> selectGenTableColumnListByTableId(Long tableId);
|
List<GenTableColumn> selectGenTableColumnListByTableId(Long tableId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增业务字段
|
* 新增业务字段
|
||||||
@ -25,7 +25,7 @@ public interface IGenTableColumnService extends IService<GenTableColumn> {
|
|||||||
* @param genTableColumn 业务字段信息
|
* @param genTableColumn 业务字段信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertGenTableColumn(GenTableColumn genTableColumn);
|
int insertGenTableColumn(GenTableColumn genTableColumn);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改业务字段
|
* 修改业务字段
|
||||||
@ -33,7 +33,7 @@ public interface IGenTableColumnService extends IService<GenTableColumn> {
|
|||||||
* @param genTableColumn 业务字段信息
|
* @param genTableColumn 业务字段信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateGenTableColumn(GenTableColumn genTableColumn);
|
int updateGenTableColumn(GenTableColumn genTableColumn);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除业务字段信息
|
* 删除业务字段信息
|
||||||
@ -41,5 +41,5 @@ public interface IGenTableColumnService extends IService<GenTableColumn> {
|
|||||||
* @param ids 需要删除的数据ID
|
* @param ids 需要删除的数据ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteGenTableColumnByIds(String ids);
|
int deleteGenTableColumnByIds(String ids);
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ import java.util.Map;
|
|||||||
/**
|
/**
|
||||||
* 业务 服务层
|
* 业务 服务层
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
public interface IGenTableService extends IService<GenTable> {
|
public interface IGenTableService extends IService<GenTable> {
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ public interface IGenTableService extends IService<GenTable> {
|
|||||||
* @param genTable 业务信息
|
* @param genTable 业务信息
|
||||||
* @return 业务集合
|
* @return 业务集合
|
||||||
*/
|
*/
|
||||||
public List<GenTable> selectGenTableList(GenTable genTable);
|
List<GenTable> selectGenTableList(GenTable genTable);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询据库列表
|
* 查询据库列表
|
||||||
@ -34,7 +34,7 @@ public interface IGenTableService extends IService<GenTable> {
|
|||||||
* @param genTable 业务信息
|
* @param genTable 业务信息
|
||||||
* @return 数据库表集合
|
* @return 数据库表集合
|
||||||
*/
|
*/
|
||||||
public List<GenTable> selectDbTableList(GenTable genTable);
|
List<GenTable> selectDbTableList(GenTable genTable);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询据库列表
|
* 查询据库列表
|
||||||
@ -42,14 +42,14 @@ public interface IGenTableService extends IService<GenTable> {
|
|||||||
* @param tableNames 表名称组
|
* @param tableNames 表名称组
|
||||||
* @return 数据库表集合
|
* @return 数据库表集合
|
||||||
*/
|
*/
|
||||||
public List<GenTable> selectDbTableListByNames(String[] tableNames);
|
List<GenTable> selectDbTableListByNames(String[] tableNames);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询所有表信息
|
* 查询所有表信息
|
||||||
*
|
*
|
||||||
* @return 表信息集合
|
* @return 表信息集合
|
||||||
*/
|
*/
|
||||||
public List<GenTable> selectGenTableAll();
|
List<GenTable> selectGenTableAll();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询业务信息
|
* 查询业务信息
|
||||||
@ -57,7 +57,7 @@ public interface IGenTableService extends IService<GenTable> {
|
|||||||
* @param id 业务ID
|
* @param id 业务ID
|
||||||
* @return 业务信息
|
* @return 业务信息
|
||||||
*/
|
*/
|
||||||
public GenTable selectGenTableById(Long id);
|
GenTable selectGenTableById(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改业务
|
* 修改业务
|
||||||
@ -65,7 +65,7 @@ public interface IGenTableService extends IService<GenTable> {
|
|||||||
* @param genTable 业务信息
|
* @param genTable 业务信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public void updateGenTable(GenTable genTable);
|
void updateGenTable(GenTable genTable);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除业务信息
|
* 删除业务信息
|
||||||
@ -73,14 +73,14 @@ public interface IGenTableService extends IService<GenTable> {
|
|||||||
* @param tableIds 需要删除的表数据ID
|
* @param tableIds 需要删除的表数据ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public void deleteGenTableByIds(Long[] tableIds);
|
void deleteGenTableByIds(Long[] tableIds);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导入表结构
|
* 导入表结构
|
||||||
*
|
*
|
||||||
* @param tableList 导入表列表
|
* @param tableList 导入表列表
|
||||||
*/
|
*/
|
||||||
public void importGenTable(List<GenTable> tableList);
|
void importGenTable(List<GenTable> tableList);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 预览代码
|
* 预览代码
|
||||||
@ -88,7 +88,7 @@ public interface IGenTableService extends IService<GenTable> {
|
|||||||
* @param tableId 表编号
|
* @param tableId 表编号
|
||||||
* @return 预览数据列表
|
* @return 预览数据列表
|
||||||
*/
|
*/
|
||||||
public Map<String, String> previewCode(Long tableId);
|
Map<String, String> previewCode(Long tableId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成代码(下载方式)
|
* 生成代码(下载方式)
|
||||||
@ -96,7 +96,7 @@ public interface IGenTableService extends IService<GenTable> {
|
|||||||
* @param tableName 表名称
|
* @param tableName 表名称
|
||||||
* @return 数据
|
* @return 数据
|
||||||
*/
|
*/
|
||||||
public byte[] downloadCode(String tableName);
|
byte[] downloadCode(String tableName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成代码(自定义路径)
|
* 生成代码(自定义路径)
|
||||||
@ -104,14 +104,14 @@ public interface IGenTableService extends IService<GenTable> {
|
|||||||
* @param tableName 表名称
|
* @param tableName 表名称
|
||||||
* @return 数据
|
* @return 数据
|
||||||
*/
|
*/
|
||||||
public void generatorCode(String tableName);
|
void generatorCode(String tableName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 同步数据库
|
* 同步数据库
|
||||||
*
|
*
|
||||||
* @param tableName 表名称
|
* @param tableName 表名称
|
||||||
*/
|
*/
|
||||||
public void synchDb(String tableName);
|
void synchDb(String tableName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量生成代码(下载方式)
|
* 批量生成代码(下载方式)
|
||||||
@ -119,12 +119,12 @@ public interface IGenTableService extends IService<GenTable> {
|
|||||||
* @param tableNames 表数组
|
* @param tableNames 表数组
|
||||||
* @return 数据
|
* @return 数据
|
||||||
*/
|
*/
|
||||||
public byte[] downloadCode(String[] tableNames);
|
byte[] downloadCode(String[] tableNames);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改保存参数校验
|
* 修改保存参数校验
|
||||||
*
|
*
|
||||||
* @param genTable 业务信息
|
* @param genTable 业务信息
|
||||||
*/
|
*/
|
||||||
public void validateEdit(GenTable genTable);
|
void validateEdit(GenTable genTable);
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package com.ruoyi.generator.util;
|
package com.ruoyi.generator.util;
|
||||||
|
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
|
||||||
import com.ruoyi.common.constant.GenConstants;
|
import com.ruoyi.common.constant.GenConstants;
|
||||||
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.ruoyi.generator.config.GenConfig;
|
import com.ruoyi.generator.config.GenConfig;
|
||||||
import com.ruoyi.generator.domain.GenTable;
|
import com.ruoyi.generator.domain.GenTable;
|
||||||
import com.ruoyi.generator.domain.GenTableColumn;
|
import com.ruoyi.generator.domain.GenTableColumn;
|
||||||
@ -14,13 +14,12 @@ import java.util.Arrays;
|
|||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public class GenUtils
|
public class GenUtils {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 初始化表信息
|
* 初始化表信息
|
||||||
*/
|
*/
|
||||||
public static void initTable(GenTable genTable, String operName)
|
public static void initTable(GenTable genTable, String operName) {
|
||||||
{
|
|
||||||
genTable.setClassName(convertClassName(genTable.getTableName()));
|
genTable.setClassName(convertClassName(genTable.getTableName()));
|
||||||
genTable.setPackageName(GenConfig.getPackageName());
|
genTable.setPackageName(GenConfig.getPackageName());
|
||||||
genTable.setModuleName(getModuleName(GenConfig.getPackageName()));
|
genTable.setModuleName(getModuleName(GenConfig.getPackageName()));
|
||||||
@ -74,55 +73,45 @@ public class GenUtils
|
|||||||
column.setIsInsert(GenConstants.REQUIRE);
|
column.setIsInsert(GenConstants.REQUIRE);
|
||||||
}
|
}
|
||||||
// BO对象 默认编辑勾选
|
// BO对象 默认编辑勾选
|
||||||
if (!arraysContains(GenConstants.COLUMNNAME_NOT_EDIT, columnName))
|
if (!arraysContains(GenConstants.COLUMNNAME_NOT_EDIT, columnName)) {
|
||||||
{
|
|
||||||
column.setIsEdit(GenConstants.REQUIRE);
|
column.setIsEdit(GenConstants.REQUIRE);
|
||||||
}
|
}
|
||||||
// BO对象 默认是否必填勾选
|
// BO对象 默认是否必填勾选
|
||||||
if (!arraysContains(GenConstants.COLUMNNAME_NOT_EDIT, columnName))
|
if (!arraysContains(GenConstants.COLUMNNAME_NOT_EDIT, columnName)) {
|
||||||
{
|
|
||||||
column.setIsRequired(GenConstants.REQUIRE);
|
column.setIsRequired(GenConstants.REQUIRE);
|
||||||
}
|
}
|
||||||
// VO对象 默认返回勾选
|
// VO对象 默认返回勾选
|
||||||
if (!arraysContains(GenConstants.COLUMNNAME_NOT_LIST, columnName))
|
if (!arraysContains(GenConstants.COLUMNNAME_NOT_LIST, columnName)) {
|
||||||
{
|
|
||||||
column.setIsList(GenConstants.REQUIRE);
|
column.setIsList(GenConstants.REQUIRE);
|
||||||
}
|
}
|
||||||
// BO对象 默认查询勾选
|
// BO对象 默认查询勾选
|
||||||
if (!arraysContains(GenConstants.COLUMNNAME_NOT_QUERY, columnName) && !column.isPk())
|
if (!arraysContains(GenConstants.COLUMNNAME_NOT_QUERY, columnName) && !column.isPk()) {
|
||||||
{
|
|
||||||
column.setIsQuery(GenConstants.REQUIRE);
|
column.setIsQuery(GenConstants.REQUIRE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询字段类型
|
// 查询字段类型
|
||||||
if (StringUtils.endsWithIgnoreCase(columnName, "name"))
|
if (StringUtils.endsWithIgnoreCase(columnName, "name")) {
|
||||||
{
|
|
||||||
column.setQueryType(GenConstants.QUERY_LIKE);
|
column.setQueryType(GenConstants.QUERY_LIKE);
|
||||||
}
|
}
|
||||||
// 状态字段设置单选框
|
// 状态字段设置单选框
|
||||||
if (StringUtils.endsWithIgnoreCase(columnName, "status"))
|
if (StringUtils.endsWithIgnoreCase(columnName, "status")) {
|
||||||
{
|
|
||||||
column.setHtmlType(GenConstants.HTML_RADIO);
|
column.setHtmlType(GenConstants.HTML_RADIO);
|
||||||
}
|
}
|
||||||
// 类型&性别字段设置下拉框
|
// 类型&性别字段设置下拉框
|
||||||
else if (StringUtils.endsWithIgnoreCase(columnName, "type")
|
else if (StringUtils.endsWithIgnoreCase(columnName, "type")
|
||||||
|| StringUtils.endsWithIgnoreCase(columnName, "sex"))
|
|| StringUtils.endsWithIgnoreCase(columnName, "sex")) {
|
||||||
{
|
|
||||||
column.setHtmlType(GenConstants.HTML_SELECT);
|
column.setHtmlType(GenConstants.HTML_SELECT);
|
||||||
}
|
}
|
||||||
// 图片字段设置图片上传控件
|
// 图片字段设置图片上传控件
|
||||||
else if (StringUtils.endsWithIgnoreCase(columnName, "image"))
|
else if (StringUtils.endsWithIgnoreCase(columnName, "image")) {
|
||||||
{
|
|
||||||
column.setHtmlType(GenConstants.HTML_IMAGE_UPLOAD);
|
column.setHtmlType(GenConstants.HTML_IMAGE_UPLOAD);
|
||||||
}
|
}
|
||||||
// 文件字段设置文件上传控件
|
// 文件字段设置文件上传控件
|
||||||
else if (StringUtils.endsWithIgnoreCase(columnName, "file"))
|
else if (StringUtils.endsWithIgnoreCase(columnName, "file")) {
|
||||||
{
|
|
||||||
column.setHtmlType(GenConstants.HTML_FILE_UPLOAD);
|
column.setHtmlType(GenConstants.HTML_FILE_UPLOAD);
|
||||||
}
|
}
|
||||||
// 内容字段设置富文本控件
|
// 内容字段设置富文本控件
|
||||||
else if (StringUtils.endsWithIgnoreCase(columnName, "content"))
|
else if (StringUtils.endsWithIgnoreCase(columnName, "content")) {
|
||||||
{
|
|
||||||
column.setHtmlType(GenConstants.HTML_EDITOR);
|
column.setHtmlType(GenConstants.HTML_EDITOR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -134,8 +123,7 @@ public class GenUtils
|
|||||||
* @param targetValue 值
|
* @param targetValue 值
|
||||||
* @return 是否包含
|
* @return 是否包含
|
||||||
*/
|
*/
|
||||||
public static boolean arraysContains(String[] arr, String targetValue)
|
public static boolean arraysContains(String[] arr, String targetValue) {
|
||||||
{
|
|
||||||
return Arrays.asList(arr).contains(targetValue);
|
return Arrays.asList(arr).contains(targetValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -145,8 +133,7 @@ public class GenUtils
|
|||||||
* @param packageName 包名
|
* @param packageName 包名
|
||||||
* @return 模块名
|
* @return 模块名
|
||||||
*/
|
*/
|
||||||
public static String getModuleName(String packageName)
|
public static String getModuleName(String packageName) {
|
||||||
{
|
|
||||||
int lastIndex = packageName.lastIndexOf(".");
|
int lastIndex = packageName.lastIndexOf(".");
|
||||||
int nameLength = packageName.length();
|
int nameLength = packageName.length();
|
||||||
String moduleName = StringUtils.substring(packageName, lastIndex + 1, nameLength);
|
String moduleName = StringUtils.substring(packageName, lastIndex + 1, nameLength);
|
||||||
@ -159,8 +146,7 @@ public class GenUtils
|
|||||||
* @param tableName 表名
|
* @param tableName 表名
|
||||||
* @return 业务名
|
* @return 业务名
|
||||||
*/
|
*/
|
||||||
public static String getBusinessName(String tableName)
|
public static String getBusinessName(String tableName) {
|
||||||
{
|
|
||||||
int firstIndex = tableName.indexOf("_");
|
int firstIndex = tableName.indexOf("_");
|
||||||
int nameLength = tableName.length();
|
int nameLength = tableName.length();
|
||||||
String businessName = StringUtils.substring(tableName, firstIndex + 1, nameLength);
|
String businessName = StringUtils.substring(tableName, firstIndex + 1, nameLength);
|
||||||
@ -174,12 +160,10 @@ public class GenUtils
|
|||||||
* @param tableName 表名称
|
* @param tableName 表名称
|
||||||
* @return 类名
|
* @return 类名
|
||||||
*/
|
*/
|
||||||
public static String convertClassName(String tableName)
|
public static String convertClassName(String tableName) {
|
||||||
{
|
|
||||||
boolean autoRemovePre = GenConfig.getAutoRemovePre();
|
boolean autoRemovePre = GenConfig.getAutoRemovePre();
|
||||||
String tablePrefix = GenConfig.getTablePrefix();
|
String tablePrefix = GenConfig.getTablePrefix();
|
||||||
if (autoRemovePre && StringUtils.isNotEmpty(tablePrefix))
|
if (autoRemovePre && StringUtils.isNotEmpty(tablePrefix)) {
|
||||||
{
|
|
||||||
String[] searchList = StringUtils.split(tablePrefix, ",");
|
String[] searchList = StringUtils.split(tablePrefix, ",");
|
||||||
tableName = replaceFirst(tableName, searchList);
|
tableName = replaceFirst(tableName, searchList);
|
||||||
}
|
}
|
||||||
@ -193,13 +177,10 @@ public class GenUtils
|
|||||||
* @param searchList 替换列表
|
* @param searchList 替换列表
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static String replaceFirst(String replacementm, String[] searchList)
|
public static String replaceFirst(String replacementm, String[] searchList) {
|
||||||
{
|
|
||||||
String text = replacementm;
|
String text = replacementm;
|
||||||
for (String searchString : searchList)
|
for (String searchString : searchList) {
|
||||||
{
|
if (replacementm.startsWith(searchString)) {
|
||||||
if (replacementm.startsWith(searchString))
|
|
||||||
{
|
|
||||||
text = replacementm.replaceFirst(searchString, "");
|
text = replacementm.replaceFirst(searchString, "");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -213,8 +194,7 @@ public class GenUtils
|
|||||||
* @param text 需要被替换的名字
|
* @param text 需要被替换的名字
|
||||||
* @return 替换后的名字
|
* @return 替换后的名字
|
||||||
*/
|
*/
|
||||||
public static String replaceText(String text)
|
public static String replaceText(String text) {
|
||||||
{
|
|
||||||
return RegExUtils.replaceAll(text, "(?:表|若依)", "");
|
return RegExUtils.replaceAll(text, "(?:表|若依)", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -224,14 +204,10 @@ public class GenUtils
|
|||||||
* @param columnType 列类型
|
* @param columnType 列类型
|
||||||
* @return 截取后的列类型
|
* @return 截取后的列类型
|
||||||
*/
|
*/
|
||||||
public static String getDbType(String columnType)
|
public static String getDbType(String columnType) {
|
||||||
{
|
if (StringUtils.indexOf(columnType, '(') > 0) {
|
||||||
if (StringUtils.indexOf(columnType, '(') > 0)
|
|
||||||
{
|
|
||||||
return StringUtils.substringBefore(columnType, "(");
|
return StringUtils.substringBefore(columnType, "(");
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
return columnType;
|
return columnType;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -242,15 +218,11 @@ public class GenUtils
|
|||||||
* @param columnType 列类型
|
* @param columnType 列类型
|
||||||
* @return 截取后的列类型
|
* @return 截取后的列类型
|
||||||
*/
|
*/
|
||||||
public static Integer getColumnLength(String columnType)
|
public static Integer getColumnLength(String columnType) {
|
||||||
{
|
if (StringUtils.indexOf(columnType, '(') > 0) {
|
||||||
if (StringUtils.indexOf(columnType, '(') > 0)
|
|
||||||
{
|
|
||||||
String length = StringUtils.substringBetween(columnType, "(", ")");
|
String length = StringUtils.substringBetween(columnType, "(", ")");
|
||||||
return Integer.valueOf(length);
|
return Integer.valueOf(length);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,24 +1,23 @@
|
|||||||
package com.ruoyi.generator.util;
|
package com.ruoyi.generator.util;
|
||||||
|
|
||||||
import java.util.Properties;
|
|
||||||
import org.apache.velocity.app.Velocity;
|
|
||||||
import com.ruoyi.common.constant.Constants;
|
import com.ruoyi.common.constant.Constants;
|
||||||
|
import org.apache.velocity.app.Velocity;
|
||||||
|
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* VelocityEngine工厂
|
* VelocityEngine工厂
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public class VelocityInitializer
|
public class VelocityInitializer {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 初始化vm方法
|
* 初始化vm方法
|
||||||
*/
|
*/
|
||||||
public static void initVelocity()
|
public static void initVelocity() {
|
||||||
{
|
|
||||||
Properties p = new Properties();
|
Properties p = new Properties();
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
// 加载classpath目录下的vm文件
|
// 加载classpath目录下的vm文件
|
||||||
p.setProperty("file.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
|
p.setProperty("file.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
|
||||||
// 定义字符集
|
// 定义字符集
|
||||||
@ -26,10 +25,9 @@ public class VelocityInitializer
|
|||||||
p.setProperty(Velocity.OUTPUT_ENCODING, Constants.UTF8);
|
p.setProperty(Velocity.OUTPUT_ENCODING, Constants.UTF8);
|
||||||
// 初始化Velocity引擎,指定配置Properties
|
// 初始化Velocity引擎,指定配置Properties
|
||||||
Velocity.init(p);
|
Velocity.init(p);
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -19,15 +19,21 @@ import java.util.Map;
|
|||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public class VelocityUtils
|
public class VelocityUtils {
|
||||||
{
|
|
||||||
/** 项目空间路径 */
|
/**
|
||||||
|
* 项目空间路径
|
||||||
|
*/
|
||||||
private static final String PROJECT_PATH = "main/java";
|
private static final String PROJECT_PATH = "main/java";
|
||||||
|
|
||||||
/** mybatis空间路径 */
|
/**
|
||||||
|
* mybatis空间路径
|
||||||
|
*/
|
||||||
private static final String MYBATIS_PATH = "main/resources/mapper";
|
private static final String MYBATIS_PATH = "main/resources/mapper";
|
||||||
|
|
||||||
/** 默认上级菜单,系统工具 */
|
/**
|
||||||
|
* 默认上级菜单,系统工具
|
||||||
|
*/
|
||||||
private static final String DEFAULT_PARENT_MENU_ID = "3";
|
private static final String DEFAULT_PARENT_MENU_ID = "3";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -35,8 +41,7 @@ public class VelocityUtils
|
|||||||
*
|
*
|
||||||
* @return 模板列表
|
* @return 模板列表
|
||||||
*/
|
*/
|
||||||
public static VelocityContext prepareContext(GenTable genTable)
|
public static VelocityContext prepareContext(GenTable genTable) {
|
||||||
{
|
|
||||||
String moduleName = genTable.getModuleName();
|
String moduleName = genTable.getModuleName();
|
||||||
String businessName = genTable.getBusinessName();
|
String businessName = genTable.getBusinessName();
|
||||||
String packageName = genTable.getPackageName();
|
String packageName = genTable.getPackageName();
|
||||||
@ -63,27 +68,23 @@ public class VelocityUtils
|
|||||||
velocityContext.put("table", genTable);
|
velocityContext.put("table", genTable);
|
||||||
velocityContext.put("dicts", getDicts(genTable));
|
velocityContext.put("dicts", getDicts(genTable));
|
||||||
setMenuVelocityContext(velocityContext, genTable);
|
setMenuVelocityContext(velocityContext, genTable);
|
||||||
if (GenConstants.TPL_TREE.equals(tplCategory))
|
if (GenConstants.TPL_TREE.equals(tplCategory)) {
|
||||||
{
|
|
||||||
setTreeVelocityContext(velocityContext, genTable);
|
setTreeVelocityContext(velocityContext, genTable);
|
||||||
}
|
}
|
||||||
if (GenConstants.TPL_SUB.equals(tplCategory))
|
if (GenConstants.TPL_SUB.equals(tplCategory)) {
|
||||||
{
|
|
||||||
setSubVelocityContext(velocityContext, genTable);
|
setSubVelocityContext(velocityContext, genTable);
|
||||||
}
|
}
|
||||||
return velocityContext;
|
return velocityContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setMenuVelocityContext(VelocityContext context, GenTable genTable)
|
public static void setMenuVelocityContext(VelocityContext context, GenTable genTable) {
|
||||||
{
|
|
||||||
String options = genTable.getOptions();
|
String options = genTable.getOptions();
|
||||||
Map<String, Object> paramsObj = JsonUtils.parseMap(options);
|
Map<String, Object> paramsObj = JsonUtils.parseMap(options);
|
||||||
String parentMenuId = getParentMenuId(paramsObj);
|
String parentMenuId = getParentMenuId(paramsObj);
|
||||||
context.put("parentMenuId", parentMenuId);
|
context.put("parentMenuId", parentMenuId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setTreeVelocityContext(VelocityContext context, GenTable genTable)
|
public static void setTreeVelocityContext(VelocityContext context, GenTable genTable) {
|
||||||
{
|
|
||||||
String options = genTable.getOptions();
|
String options = genTable.getOptions();
|
||||||
Map<String, Object> paramsObj = JsonUtils.parseMap(options);
|
Map<String, Object> paramsObj = JsonUtils.parseMap(options);
|
||||||
String treeCode = getTreecode(paramsObj);
|
String treeCode = getTreecode(paramsObj);
|
||||||
@ -94,18 +95,15 @@ public class VelocityUtils
|
|||||||
context.put("treeParentCode", treeParentCode);
|
context.put("treeParentCode", treeParentCode);
|
||||||
context.put("treeName", treeName);
|
context.put("treeName", treeName);
|
||||||
context.put("expandColumn", getExpandColumn(genTable));
|
context.put("expandColumn", getExpandColumn(genTable));
|
||||||
if (paramsObj.containsKey(GenConstants.TREE_PARENT_CODE))
|
if (paramsObj.containsKey(GenConstants.TREE_PARENT_CODE)) {
|
||||||
{
|
|
||||||
context.put("tree_parent_code", paramsObj.get(GenConstants.TREE_PARENT_CODE));
|
context.put("tree_parent_code", paramsObj.get(GenConstants.TREE_PARENT_CODE));
|
||||||
}
|
}
|
||||||
if (paramsObj.containsKey(GenConstants.TREE_NAME))
|
if (paramsObj.containsKey(GenConstants.TREE_NAME)) {
|
||||||
{
|
|
||||||
context.put("tree_name", paramsObj.get(GenConstants.TREE_NAME));
|
context.put("tree_name", paramsObj.get(GenConstants.TREE_NAME));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setSubVelocityContext(VelocityContext context, GenTable genTable)
|
public static void setSubVelocityContext(VelocityContext context, GenTable genTable) {
|
||||||
{
|
|
||||||
GenTable subTable = genTable.getSubTable();
|
GenTable subTable = genTable.getSubTable();
|
||||||
String subTableName = genTable.getSubTableName();
|
String subTableName = genTable.getSubTableName();
|
||||||
String subTableFkName = genTable.getSubTableFkName();
|
String subTableFkName = genTable.getSubTableFkName();
|
||||||
@ -127,8 +125,7 @@ public class VelocityUtils
|
|||||||
*
|
*
|
||||||
* @return 模板列表
|
* @return 模板列表
|
||||||
*/
|
*/
|
||||||
public static List<String> getTemplateList(String tplCategory)
|
public static List<String> getTemplateList(String tplCategory) {
|
||||||
{
|
|
||||||
List<String> templates = new ArrayList<String>();
|
List<String> templates = new ArrayList<String>();
|
||||||
templates.add("vm/java/domain.java.vm");
|
templates.add("vm/java/domain.java.vm");
|
||||||
templates.add("vm/java/vo.java.vm");
|
templates.add("vm/java/vo.java.vm");
|
||||||
@ -140,16 +137,11 @@ public class VelocityUtils
|
|||||||
templates.add("vm/xml/mapper.xml.vm");
|
templates.add("vm/xml/mapper.xml.vm");
|
||||||
templates.add("vm/sql/sql.vm");
|
templates.add("vm/sql/sql.vm");
|
||||||
templates.add("vm/js/api.js.vm");
|
templates.add("vm/js/api.js.vm");
|
||||||
if (GenConstants.TPL_CRUD.equals(tplCategory))
|
if (GenConstants.TPL_CRUD.equals(tplCategory)) {
|
||||||
{
|
|
||||||
templates.add("vm/vue/index.vue.vm");
|
templates.add("vm/vue/index.vue.vm");
|
||||||
}
|
} else if (GenConstants.TPL_TREE.equals(tplCategory)) {
|
||||||
else if (GenConstants.TPL_TREE.equals(tplCategory))
|
|
||||||
{
|
|
||||||
templates.add("vm/vue/index-tree.vue.vm");
|
templates.add("vm/vue/index-tree.vue.vm");
|
||||||
}
|
} else if (GenConstants.TPL_SUB.equals(tplCategory)) {
|
||||||
else if (GenConstants.TPL_SUB.equals(tplCategory))
|
|
||||||
{
|
|
||||||
templates.add("vm/vue/index.vue.vm");
|
templates.add("vm/vue/index.vue.vm");
|
||||||
templates.add("vm/java/sub-domain.java.vm");
|
templates.add("vm/java/sub-domain.java.vm");
|
||||||
}
|
}
|
||||||
@ -159,8 +151,7 @@ public class VelocityUtils
|
|||||||
/**
|
/**
|
||||||
* 获取文件名
|
* 获取文件名
|
||||||
*/
|
*/
|
||||||
public static String getFileName(String template, GenTable genTable)
|
public static String getFileName(String template, GenTable genTable) {
|
||||||
{
|
|
||||||
// 文件名称
|
// 文件名称
|
||||||
String fileName = "";
|
String fileName = "";
|
||||||
// 包路径
|
// 包路径
|
||||||
@ -176,56 +167,34 @@ public class VelocityUtils
|
|||||||
String mybatisPath = MYBATIS_PATH + "/" + moduleName;
|
String mybatisPath = MYBATIS_PATH + "/" + moduleName;
|
||||||
String vuePath = "vue";
|
String vuePath = "vue";
|
||||||
|
|
||||||
if (template.contains("domain.java.vm"))
|
if (template.contains("domain.java.vm")) {
|
||||||
{
|
|
||||||
fileName = StringUtils.format("{}/domain/{}.java", javaPath, className);
|
fileName = StringUtils.format("{}/domain/{}.java", javaPath, className);
|
||||||
}
|
}
|
||||||
if (template.contains("vo.java.vm"))
|
if (template.contains("vo.java.vm")) {
|
||||||
{
|
|
||||||
fileName = StringUtils.format("{}/domain/vo/{}Vo.java", javaPath, className);
|
fileName = StringUtils.format("{}/domain/vo/{}Vo.java", javaPath, className);
|
||||||
}
|
}
|
||||||
if (template.contains("bo.java.vm"))
|
if (template.contains("bo.java.vm")) {
|
||||||
{
|
|
||||||
fileName = StringUtils.format("{}/domain/bo/{}Bo.java", javaPath, className);
|
fileName = StringUtils.format("{}/domain/bo/{}Bo.java", javaPath, className);
|
||||||
}
|
}
|
||||||
if (template.contains("sub-domain.java.vm") && StringUtils.equals(GenConstants.TPL_SUB, genTable.getTplCategory()))
|
if (template.contains("sub-domain.java.vm") && StringUtils.equals(GenConstants.TPL_SUB, genTable.getTplCategory())) {
|
||||||
{
|
|
||||||
fileName = StringUtils.format("{}/domain/{}.java", javaPath, genTable.getSubTable().getClassName());
|
fileName = StringUtils.format("{}/domain/{}.java", javaPath, genTable.getSubTable().getClassName());
|
||||||
}
|
} else if (template.contains("mapper.java.vm")) {
|
||||||
else if (template.contains("mapper.java.vm"))
|
|
||||||
{
|
|
||||||
fileName = StringUtils.format("{}/mapper/{}Mapper.java", javaPath, className);
|
fileName = StringUtils.format("{}/mapper/{}Mapper.java", javaPath, className);
|
||||||
}
|
} else if (template.contains("service.java.vm")) {
|
||||||
else if (template.contains("service.java.vm"))
|
|
||||||
{
|
|
||||||
fileName = StringUtils.format("{}/service/I{}Service.java", javaPath, className);
|
fileName = StringUtils.format("{}/service/I{}Service.java", javaPath, className);
|
||||||
}
|
} else if (template.contains("serviceImpl.java.vm")) {
|
||||||
else if (template.contains("serviceImpl.java.vm"))
|
|
||||||
{
|
|
||||||
fileName = StringUtils.format("{}/service/impl/{}ServiceImpl.java", javaPath, className);
|
fileName = StringUtils.format("{}/service/impl/{}ServiceImpl.java", javaPath, className);
|
||||||
}
|
} else if (template.contains("controller.java.vm")) {
|
||||||
else if (template.contains("controller.java.vm"))
|
|
||||||
{
|
|
||||||
fileName = StringUtils.format("{}/controller/{}Controller.java", javaPath, className);
|
fileName = StringUtils.format("{}/controller/{}Controller.java", javaPath, className);
|
||||||
}
|
} else if (template.contains("mapper.xml.vm")) {
|
||||||
else if (template.contains("mapper.xml.vm"))
|
|
||||||
{
|
|
||||||
fileName = StringUtils.format("{}/{}Mapper.xml", mybatisPath, className);
|
fileName = StringUtils.format("{}/{}Mapper.xml", mybatisPath, className);
|
||||||
}
|
} else if (template.contains("sql.vm")) {
|
||||||
else if (template.contains("sql.vm"))
|
|
||||||
{
|
|
||||||
fileName = businessName + "Menu.sql";
|
fileName = businessName + "Menu.sql";
|
||||||
}
|
} else if (template.contains("api.js.vm")) {
|
||||||
else if (template.contains("api.js.vm"))
|
|
||||||
{
|
|
||||||
fileName = StringUtils.format("{}/api/{}/{}.js", vuePath, moduleName, businessName);
|
fileName = StringUtils.format("{}/api/{}/{}.js", vuePath, moduleName, businessName);
|
||||||
}
|
} else if (template.contains("index.vue.vm")) {
|
||||||
else if (template.contains("index.vue.vm"))
|
|
||||||
{
|
|
||||||
fileName = StringUtils.format("{}/views/{}/{}/index.vue", vuePath, moduleName, businessName);
|
fileName = StringUtils.format("{}/views/{}/{}/index.vue", vuePath, moduleName, businessName);
|
||||||
}
|
} else if (template.contains("index-tree.vue.vm")) {
|
||||||
else if (template.contains("index-tree.vue.vm"))
|
|
||||||
{
|
|
||||||
fileName = StringUtils.format("{}/views/{}/{}/index.vue", vuePath, moduleName, businessName);
|
fileName = StringUtils.format("{}/views/{}/{}/index.vue", vuePath, moduleName, businessName);
|
||||||
}
|
}
|
||||||
return fileName;
|
return fileName;
|
||||||
@ -237,8 +206,7 @@ public class VelocityUtils
|
|||||||
* @param packageName 包名称
|
* @param packageName 包名称
|
||||||
* @return 包前缀名称
|
* @return 包前缀名称
|
||||||
*/
|
*/
|
||||||
public static String getPackagePrefix(String packageName)
|
public static String getPackagePrefix(String packageName) {
|
||||||
{
|
|
||||||
int lastIndex = packageName.lastIndexOf(".");
|
int lastIndex = packageName.lastIndexOf(".");
|
||||||
String basePackage = StringUtils.substring(packageName, 0, lastIndex);
|
String basePackage = StringUtils.substring(packageName, 0, lastIndex);
|
||||||
return basePackage;
|
return basePackage;
|
||||||
@ -250,24 +218,18 @@ public class VelocityUtils
|
|||||||
* @param genTable 业务表对象
|
* @param genTable 业务表对象
|
||||||
* @return 返回需要导入的包列表
|
* @return 返回需要导入的包列表
|
||||||
*/
|
*/
|
||||||
public static HashSet<String> getImportList(GenTable genTable)
|
public static HashSet<String> getImportList(GenTable genTable) {
|
||||||
{
|
|
||||||
List<GenTableColumn> columns = genTable.getColumns();
|
List<GenTableColumn> columns = genTable.getColumns();
|
||||||
GenTable subGenTable = genTable.getSubTable();
|
GenTable subGenTable = genTable.getSubTable();
|
||||||
HashSet<String> importList = new HashSet<String>();
|
HashSet<String> importList = new HashSet<String>();
|
||||||
if (StringUtils.isNotNull(subGenTable))
|
if (StringUtils.isNotNull(subGenTable)) {
|
||||||
{
|
|
||||||
importList.add("java.util.List");
|
importList.add("java.util.List");
|
||||||
}
|
}
|
||||||
for (GenTableColumn column : columns)
|
for (GenTableColumn column : columns) {
|
||||||
{
|
if (!column.isSuperColumn() && GenConstants.TYPE_DATE.equals(column.getJavaType())) {
|
||||||
if (!column.isSuperColumn() && GenConstants.TYPE_DATE.equals(column.getJavaType()))
|
|
||||||
{
|
|
||||||
importList.add("java.util.Date");
|
importList.add("java.util.Date");
|
||||||
importList.add("com.fasterxml.jackson.annotation.JsonFormat");
|
importList.add("com.fasterxml.jackson.annotation.JsonFormat");
|
||||||
}
|
} else if (!column.isSuperColumn() && GenConstants.TYPE_BIGDECIMAL.equals(column.getJavaType())) {
|
||||||
else if (!column.isSuperColumn() && GenConstants.TYPE_BIGDECIMAL.equals(column.getJavaType()))
|
|
||||||
{
|
|
||||||
importList.add("java.math.BigDecimal");
|
importList.add("java.math.BigDecimal");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -280,15 +242,12 @@ public class VelocityUtils
|
|||||||
* @param genTable 业务表对象
|
* @param genTable 业务表对象
|
||||||
* @return 返回字典组
|
* @return 返回字典组
|
||||||
*/
|
*/
|
||||||
public static String getDicts(GenTable genTable)
|
public static String getDicts(GenTable genTable) {
|
||||||
{
|
|
||||||
List<GenTableColumn> columns = genTable.getColumns();
|
List<GenTableColumn> columns = genTable.getColumns();
|
||||||
List<String> dicts = new ArrayList<String>();
|
List<String> dicts = new ArrayList<String>();
|
||||||
for (GenTableColumn column : columns)
|
for (GenTableColumn column : columns) {
|
||||||
{
|
|
||||||
if (!column.isSuperColumn() && StringUtils.isNotEmpty(column.getDictType()) && StringUtils.equalsAny(
|
if (!column.isSuperColumn() && StringUtils.isNotEmpty(column.getDictType()) && StringUtils.equalsAny(
|
||||||
column.getHtmlType(), new String[] { GenConstants.HTML_SELECT, GenConstants.HTML_RADIO }))
|
column.getHtmlType(), new String[]{GenConstants.HTML_SELECT, GenConstants.HTML_RADIO})) {
|
||||||
{
|
|
||||||
dicts.add("'" + column.getDictType() + "'");
|
dicts.add("'" + column.getDictType() + "'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -302,8 +261,7 @@ public class VelocityUtils
|
|||||||
* @param businessName 业务名称
|
* @param businessName 业务名称
|
||||||
* @return 返回权限前缀
|
* @return 返回权限前缀
|
||||||
*/
|
*/
|
||||||
public static String getPermissionPrefix(String moduleName, String businessName)
|
public static String getPermissionPrefix(String moduleName, String businessName) {
|
||||||
{
|
|
||||||
return StringUtils.format("{}:{}", moduleName, businessName);
|
return StringUtils.format("{}:{}", moduleName, businessName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -313,11 +271,9 @@ public class VelocityUtils
|
|||||||
* @param paramsObj 生成其他选项
|
* @param paramsObj 生成其他选项
|
||||||
* @return 上级菜单ID字段
|
* @return 上级菜单ID字段
|
||||||
*/
|
*/
|
||||||
public static String getParentMenuId(Map<String, Object> paramsObj)
|
public static String getParentMenuId(Map<String, Object> paramsObj) {
|
||||||
{
|
|
||||||
if (StringUtils.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.PARENT_MENU_ID)
|
if (StringUtils.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.PARENT_MENU_ID)
|
||||||
&& StringUtils.isNotEmpty(Convert.toStr(paramsObj.get(GenConstants.PARENT_MENU_ID))))
|
&& StringUtils.isNotEmpty(Convert.toStr(paramsObj.get(GenConstants.PARENT_MENU_ID)))) {
|
||||||
{
|
|
||||||
return Convert.toStr(paramsObj.get(GenConstants.PARENT_MENU_ID));
|
return Convert.toStr(paramsObj.get(GenConstants.PARENT_MENU_ID));
|
||||||
}
|
}
|
||||||
return DEFAULT_PARENT_MENU_ID;
|
return DEFAULT_PARENT_MENU_ID;
|
||||||
@ -329,10 +285,8 @@ public class VelocityUtils
|
|||||||
* @param paramsObj 生成其他选项
|
* @param paramsObj 生成其他选项
|
||||||
* @return 树编码
|
* @return 树编码
|
||||||
*/
|
*/
|
||||||
public static String getTreecode(Map<String, Object> paramsObj)
|
public static String getTreecode(Map<String, Object> paramsObj) {
|
||||||
{
|
if (StringUtils.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.TREE_CODE)) {
|
||||||
if (StringUtils.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.TREE_CODE))
|
|
||||||
{
|
|
||||||
return StringUtils.toCamelCase(Convert.toStr(paramsObj.get(GenConstants.TREE_CODE)));
|
return StringUtils.toCamelCase(Convert.toStr(paramsObj.get(GenConstants.TREE_CODE)));
|
||||||
}
|
}
|
||||||
return StringUtils.EMPTY;
|
return StringUtils.EMPTY;
|
||||||
@ -344,10 +298,8 @@ public class VelocityUtils
|
|||||||
* @param paramsObj 生成其他选项
|
* @param paramsObj 生成其他选项
|
||||||
* @return 树父编码
|
* @return 树父编码
|
||||||
*/
|
*/
|
||||||
public static String getTreeParentCode(Map<String, Object> paramsObj)
|
public static String getTreeParentCode(Map<String, Object> paramsObj) {
|
||||||
{
|
if (StringUtils.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.TREE_PARENT_CODE)) {
|
||||||
if (StringUtils.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.TREE_PARENT_CODE))
|
|
||||||
{
|
|
||||||
return StringUtils.toCamelCase(Convert.toStr(paramsObj.get(GenConstants.TREE_PARENT_CODE)));
|
return StringUtils.toCamelCase(Convert.toStr(paramsObj.get(GenConstants.TREE_PARENT_CODE)));
|
||||||
}
|
}
|
||||||
return StringUtils.EMPTY;
|
return StringUtils.EMPTY;
|
||||||
@ -359,10 +311,8 @@ public class VelocityUtils
|
|||||||
* @param paramsObj 生成其他选项
|
* @param paramsObj 生成其他选项
|
||||||
* @return 树名称
|
* @return 树名称
|
||||||
*/
|
*/
|
||||||
public static String getTreeName(Map<String, Object> paramsObj)
|
public static String getTreeName(Map<String, Object> paramsObj) {
|
||||||
{
|
if (StringUtils.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.TREE_NAME)) {
|
||||||
if (StringUtils.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.TREE_NAME))
|
|
||||||
{
|
|
||||||
return StringUtils.toCamelCase(Convert.toStr(paramsObj.get(GenConstants.TREE_NAME)));
|
return StringUtils.toCamelCase(Convert.toStr(paramsObj.get(GenConstants.TREE_NAME)));
|
||||||
}
|
}
|
||||||
return StringUtils.EMPTY;
|
return StringUtils.EMPTY;
|
||||||
@ -374,20 +324,16 @@ public class VelocityUtils
|
|||||||
* @param genTable 业务表对象
|
* @param genTable 业务表对象
|
||||||
* @return 展开按钮列序号
|
* @return 展开按钮列序号
|
||||||
*/
|
*/
|
||||||
public static int getExpandColumn(GenTable genTable)
|
public static int getExpandColumn(GenTable genTable) {
|
||||||
{
|
|
||||||
String options = genTable.getOptions();
|
String options = genTable.getOptions();
|
||||||
Map<String, Object> paramsObj = JsonUtils.parseMap(options);
|
Map<String, Object> paramsObj = JsonUtils.parseMap(options);
|
||||||
String treeName = Convert.toStr(paramsObj.get(GenConstants.TREE_NAME));
|
String treeName = Convert.toStr(paramsObj.get(GenConstants.TREE_NAME));
|
||||||
int num = 0;
|
int num = 0;
|
||||||
for (GenTableColumn column : genTable.getColumns())
|
for (GenTableColumn column : genTable.getColumns()) {
|
||||||
{
|
if (column.isList()) {
|
||||||
if (column.isList())
|
|
||||||
{
|
|
||||||
num++;
|
num++;
|
||||||
String columnName = column.getColumnName();
|
String columnName = column.getColumnName();
|
||||||
if (columnName.equals(treeName))
|
if (columnName.equals(treeName)) {
|
||||||
{
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,44 +2,46 @@ package com.ruoyi.system.domain;
|
|||||||
|
|
||||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.ruoyi.common.annotation.ExcelDictFormat;
|
import com.ruoyi.common.annotation.ExcelDictFormat;
|
||||||
import com.ruoyi.common.convert.ExcelDictConvert;
|
import com.ruoyi.common.convert.ExcelDictConvert;
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import javax.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 参数配置表 sys_config
|
* 参数配置表 sys_config
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@TableName("sys_config")
|
@TableName("sys_config")
|
||||||
@ExcelIgnoreUnannotated
|
@ExcelIgnoreUnannotated
|
||||||
public class SysConfig implements Serializable {
|
@ApiModel("参数配置业务对象")
|
||||||
private static final long serialVersionUID = 1L;
|
public class SysConfig extends BaseEntity {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 参数主键
|
* 参数主键
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "参数主键")
|
||||||
@ExcelProperty(value = "参数主键")
|
@ExcelProperty(value = "参数主键")
|
||||||
@TableId(value = "config_id", type = IdType.AUTO)
|
@TableId(value = "config_id")
|
||||||
private Long configId;
|
private Long configId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 参数名称
|
* 参数名称
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "参数名称")
|
||||||
@ExcelProperty(value = "参数名称")
|
@ExcelProperty(value = "参数名称")
|
||||||
@NotBlank(message = "参数名称不能为空")
|
@NotBlank(message = "参数名称不能为空")
|
||||||
@Size(min = 0, max = 100, message = "参数名称不能超过100个字符")
|
@Size(min = 0, max = 100, message = "参数名称不能超过100个字符")
|
||||||
@ -48,6 +50,7 @@ public class SysConfig implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 参数键名
|
* 参数键名
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "参数键名")
|
||||||
@ExcelProperty(value = "参数键名")
|
@ExcelProperty(value = "参数键名")
|
||||||
@NotBlank(message = "参数键名长度不能为空")
|
@NotBlank(message = "参数键名长度不能为空")
|
||||||
@Size(min = 0, max = 100, message = "参数键名长度不能超过100个字符")
|
@Size(min = 0, max = 100, message = "参数键名长度不能超过100个字符")
|
||||||
@ -56,6 +59,7 @@ public class SysConfig implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 参数键值
|
* 参数键值
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "参数键值")
|
||||||
@ExcelProperty(value = "参数键值")
|
@ExcelProperty(value = "参数键值")
|
||||||
@NotBlank(message = "参数键值不能为空")
|
@NotBlank(message = "参数键值不能为空")
|
||||||
@Size(min = 0, max = 500, message = "参数键值长度不能超过500个字符")
|
@Size(min = 0, max = 500, message = "参数键值长度不能超过500个字符")
|
||||||
@ -64,43 +68,15 @@ public class SysConfig implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 系统内置(Y是 N否)
|
* 系统内置(Y是 N否)
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "系统内置(Y是 N否)")
|
||||||
@ExcelProperty(value = "系统内置", converter = ExcelDictConvert.class)
|
@ExcelProperty(value = "系统内置", converter = ExcelDictConvert.class)
|
||||||
@ExcelDictFormat(dictType = "sys_yes_no")
|
@ExcelDictFormat(dictType = "sys_yes_no")
|
||||||
private String configType;
|
private String configType;
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建者
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT)
|
|
||||||
private String createBy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT)
|
|
||||||
private Date createTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新者
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
|
||||||
private String updateBy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新时间
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
|
||||||
private Date updateTime;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
/**
|
|
||||||
* 请求参数
|
|
||||||
*/
|
|
||||||
@TableField(exist = false)
|
|
||||||
private Map<String, Object> params = new HashMap<>();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,14 +2,14 @@ package com.ruoyi.system.domain;
|
|||||||
|
|
||||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.ruoyi.common.annotation.ExcelDictFormat;
|
import com.ruoyi.common.annotation.ExcelDictFormat;
|
||||||
import com.ruoyi.common.convert.ExcelDictConvert;
|
import com.ruoyi.common.convert.ExcelDictConvert;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
@ -20,33 +20,36 @@ import java.util.Map;
|
|||||||
/**
|
/**
|
||||||
* 系统访问记录表 sys_logininfor
|
* 系统访问记录表 sys_logininfor
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@TableName("sys_logininfor")
|
@TableName("sys_logininfor")
|
||||||
@ExcelIgnoreUnannotated
|
@ExcelIgnoreUnannotated
|
||||||
|
@ApiModel("系统访问记录业务对象")
|
||||||
public class SysLogininfor implements Serializable {
|
public class SysLogininfor implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ID
|
* ID
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "访问ID")
|
||||||
@ExcelProperty(value = "序号")
|
@ExcelProperty(value = "序号")
|
||||||
@TableId(value = "info_id", type = IdType.AUTO)
|
@TableId(value = "info_id")
|
||||||
private Long infoId;
|
private Long infoId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户账号
|
* 用户账号
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "用户账号")
|
||||||
@ExcelProperty(value = "用户账号")
|
@ExcelProperty(value = "用户账号")
|
||||||
private String userName;
|
private String userName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 登录状态 0成功 1失败
|
* 登录状态 0成功 1失败
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "登录状态 0成功 1失败")
|
||||||
@ExcelProperty(value = "登录状态", converter = ExcelDictConvert.class)
|
@ExcelProperty(value = "登录状态", converter = ExcelDictConvert.class)
|
||||||
@ExcelDictFormat(dictType = "sys_common_status")
|
@ExcelDictFormat(dictType = "sys_common_status")
|
||||||
private String status;
|
private String status;
|
||||||
@ -54,42 +57,49 @@ public class SysLogininfor implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 登录IP地址
|
* 登录IP地址
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "登录IP地址")
|
||||||
@ExcelProperty(value = "登录地址")
|
@ExcelProperty(value = "登录地址")
|
||||||
private String ipaddr;
|
private String ipaddr;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 登录地点
|
* 登录地点
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "登录地点")
|
||||||
@ExcelProperty(value = "登录地点")
|
@ExcelProperty(value = "登录地点")
|
||||||
private String loginLocation;
|
private String loginLocation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 浏览器类型
|
* 浏览器类型
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "浏览器类型")
|
||||||
@ExcelProperty(value = "浏览器")
|
@ExcelProperty(value = "浏览器")
|
||||||
private String browser;
|
private String browser;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 操作系统
|
* 操作系统
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "操作系统")
|
||||||
@ExcelProperty(value = "操作系统")
|
@ExcelProperty(value = "操作系统")
|
||||||
private String os;
|
private String os;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提示消息
|
* 提示消息
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "提示消息")
|
||||||
@ExcelProperty(value = "提示消息")
|
@ExcelProperty(value = "提示消息")
|
||||||
private String msg;
|
private String msg;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 访问时间
|
* 访问时间
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "访问时间")
|
||||||
@ExcelProperty(value = "访问时间")
|
@ExcelProperty(value = "访问时间")
|
||||||
private Date loginTime;
|
private Date loginTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 请求参数
|
* 请求参数
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "请求参数")
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private Map<String, Object> params = new HashMap<>();
|
private Map<String, Object> params = new HashMap<>();
|
||||||
|
|
||||||
|
@ -1,39 +1,38 @@
|
|||||||
package com.ruoyi.system.domain;
|
package com.ruoyi.system.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import javax.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通知公告表 sys_notice
|
* 通知公告表 sys_notice
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@TableName("sys_notice")
|
@TableName("sys_notice")
|
||||||
public class SysNotice implements Serializable {
|
public class SysNotice extends BaseEntity {
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 公告ID
|
* 公告ID
|
||||||
*/
|
*/
|
||||||
@TableId(value = "notice_id", type = IdType.AUTO)
|
@ApiModelProperty(value = "公告ID")
|
||||||
|
@TableId(value = "notice_id")
|
||||||
private Long noticeId;
|
private Long noticeId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 公告标题
|
* 公告标题
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "公告标题")
|
||||||
@NotBlank(message = "公告标题不能为空")
|
@NotBlank(message = "公告标题不能为空")
|
||||||
@Size(min = 0, max = 50, message = "公告标题不能超过50个字符")
|
@Size(min = 0, max = 50, message = "公告标题不能超过50个字符")
|
||||||
private String noticeTitle;
|
private String noticeTitle;
|
||||||
@ -41,53 +40,25 @@ public class SysNotice implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 公告类型(1通知 2公告)
|
* 公告类型(1通知 2公告)
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "公告类型(1通知 2公告)")
|
||||||
private String noticeType;
|
private String noticeType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 公告内容
|
* 公告内容
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "公告内容")
|
||||||
private String noticeContent;
|
private String noticeContent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 公告状态(0正常 1关闭)
|
* 公告状态(0正常 1关闭)
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "公告状态(0正常 1关闭)")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建者
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT)
|
|
||||||
private String createBy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT)
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private Date createTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新者
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
|
||||||
private String updateBy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新时间
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private Date updateTime;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
/**
|
|
||||||
* 请求参数
|
|
||||||
*/
|
|
||||||
@TableField(exist = false)
|
|
||||||
private Map<String, Object> params = new HashMap<>();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,14 +2,14 @@ package com.ruoyi.system.domain;
|
|||||||
|
|
||||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.ruoyi.common.annotation.ExcelDictFormat;
|
import com.ruoyi.common.annotation.ExcelDictFormat;
|
||||||
import com.ruoyi.common.convert.ExcelDictConvert;
|
import com.ruoyi.common.convert.ExcelDictConvert;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
@ -20,33 +20,37 @@ import java.util.Map;
|
|||||||
/**
|
/**
|
||||||
* 操作日志记录表 oper_log
|
* 操作日志记录表 oper_log
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@TableName("sys_oper_log")
|
@TableName("sys_oper_log")
|
||||||
@ExcelIgnoreUnannotated
|
@ExcelIgnoreUnannotated
|
||||||
|
@ApiModel("操作日志记录业务对象")
|
||||||
public class SysOperLog implements Serializable {
|
public class SysOperLog implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 日志主键
|
* 日志主键
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "操作序号")
|
@ApiModelProperty(value = "日志主键")
|
||||||
@TableId(value = "oper_id", type = IdType.AUTO)
|
@ExcelProperty(value = "日志主键")
|
||||||
|
@TableId(value = "oper_id")
|
||||||
private Long operId;
|
private Long operId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 操作模块
|
* 操作模块
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "操作模块")
|
||||||
@ExcelProperty(value = "操作模块")
|
@ExcelProperty(value = "操作模块")
|
||||||
private String title;
|
private String title;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 业务类型(0其它 1新增 2修改 3删除)
|
* 业务类型(0其它 1新增 2修改 3删除)
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "业务类型(0其它 1新增 2修改 3删除)")
|
||||||
@ExcelProperty(value = "业务类型", converter = ExcelDictConvert.class)
|
@ExcelProperty(value = "业务类型", converter = ExcelDictConvert.class)
|
||||||
@ExcelDictFormat(dictType = "sys_oper_type")
|
@ExcelDictFormat(dictType = "sys_oper_type")
|
||||||
private Integer businessType;
|
private Integer businessType;
|
||||||
@ -54,24 +58,28 @@ public class SysOperLog implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 业务类型数组
|
* 业务类型数组
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "业务类型数组")
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private Integer[] businessTypes;
|
private Integer[] businessTypes;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 请求方法
|
* 请求方法
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "请求方法")
|
||||||
@ExcelProperty(value = "请求方法")
|
@ExcelProperty(value = "请求方法")
|
||||||
private String method;
|
private String method;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 请求方式
|
* 请求方式
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "请求方式")
|
||||||
@ExcelProperty(value = "请求方式")
|
@ExcelProperty(value = "请求方式")
|
||||||
private String requestMethod;
|
private String requestMethod;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 操作类别(0其它 1后台用户 2手机端用户)
|
* 操作类别(0其它 1后台用户 2手机端用户)
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "操作类别(0其它 1后台用户 2手机端用户)")
|
||||||
@ExcelProperty(value = "操作类别", converter = ExcelDictConvert.class)
|
@ExcelProperty(value = "操作类别", converter = ExcelDictConvert.class)
|
||||||
@ExcelDictFormat(readConverterExp = "0=其它,1=后台用户,2=手机端用户")
|
@ExcelDictFormat(readConverterExp = "0=其它,1=后台用户,2=手机端用户")
|
||||||
private Integer operatorType;
|
private Integer operatorType;
|
||||||
@ -79,48 +87,56 @@ public class SysOperLog implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 操作人员
|
* 操作人员
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "操作人员")
|
||||||
@ExcelProperty(value = "操作人员")
|
@ExcelProperty(value = "操作人员")
|
||||||
private String operName;
|
private String operName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门名称
|
* 部门名称
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "部门名称")
|
||||||
@ExcelProperty(value = "部门名称")
|
@ExcelProperty(value = "部门名称")
|
||||||
private String deptName;
|
private String deptName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 请求url
|
* 请求url
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "请求url")
|
||||||
@ExcelProperty(value = "请求地址")
|
@ExcelProperty(value = "请求地址")
|
||||||
private String operUrl;
|
private String operUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 操作地址
|
* 操作地址
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "操作地址")
|
||||||
@ExcelProperty(value = "操作地址")
|
@ExcelProperty(value = "操作地址")
|
||||||
private String operIp;
|
private String operIp;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 操作地点
|
* 操作地点
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "操作地点")
|
||||||
@ExcelProperty(value = "操作地点")
|
@ExcelProperty(value = "操作地点")
|
||||||
private String operLocation;
|
private String operLocation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 请求参数
|
* 请求参数
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "请求参数")
|
||||||
@ExcelProperty(value = "请求参数")
|
@ExcelProperty(value = "请求参数")
|
||||||
private String operParam;
|
private String operParam;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 返回参数
|
* 返回参数
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "返回参数")
|
||||||
@ExcelProperty(value = "返回参数")
|
@ExcelProperty(value = "返回参数")
|
||||||
private String jsonResult;
|
private String jsonResult;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 操作状态(0正常 1异常)
|
* 操作状态(0正常 1异常)
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "操作状态(0正常 1异常)")
|
||||||
@ExcelProperty(value = "状态", converter = ExcelDictConvert.class)
|
@ExcelProperty(value = "状态", converter = ExcelDictConvert.class)
|
||||||
@ExcelDictFormat(dictType = "sys_common_status")
|
@ExcelDictFormat(dictType = "sys_common_status")
|
||||||
private Integer status;
|
private Integer status;
|
||||||
@ -128,18 +144,21 @@ public class SysOperLog implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 错误消息
|
* 错误消息
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "错误消息")
|
||||||
@ExcelProperty(value = "错误消息")
|
@ExcelProperty(value = "错误消息")
|
||||||
private String errorMsg;
|
private String errorMsg;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 操作时间
|
* 操作时间
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "操作时间")
|
||||||
@ExcelProperty(value = "操作时间")
|
@ExcelProperty(value = "操作时间")
|
||||||
private Date operTime;
|
private Date operTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 请求参数
|
* 请求参数
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "请求参数")
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private Map<String, Object> params = new HashMap<>();
|
private Map<String, Object> params = new HashMap<>();
|
||||||
|
|
||||||
|
@ -2,44 +2,47 @@ package com.ruoyi.system.domain;
|
|||||||
|
|
||||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.ruoyi.common.annotation.ExcelDictFormat;
|
import com.ruoyi.common.annotation.ExcelDictFormat;
|
||||||
import com.ruoyi.common.convert.ExcelDictConvert;
|
import com.ruoyi.common.convert.ExcelDictConvert;
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import javax.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 岗位表 sys_post
|
* 岗位表 sys_post
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@TableName("sys_post")
|
@TableName("sys_post")
|
||||||
@ExcelIgnoreUnannotated
|
@ExcelIgnoreUnannotated
|
||||||
public class SysPost implements Serializable {
|
@ApiModel("岗位信息业务对象")
|
||||||
private static final long serialVersionUID = 1L;
|
public class SysPost extends BaseEntity {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 岗位序号
|
* 岗位序号
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "岗位序号")
|
||||||
@ExcelProperty(value = "岗位序号")
|
@ExcelProperty(value = "岗位序号")
|
||||||
@TableId(value = "post_id", type = IdType.AUTO)
|
@TableId(value = "post_id")
|
||||||
private Long postId;
|
private Long postId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 岗位编码
|
* 岗位编码
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "岗位编码")
|
||||||
@ExcelProperty(value = "岗位编码")
|
@ExcelProperty(value = "岗位编码")
|
||||||
@NotBlank(message = "岗位编码不能为空")
|
@NotBlank(message = "岗位编码不能为空")
|
||||||
@Size(min = 0, max = 64, message = "岗位编码长度不能超过64个字符")
|
@Size(min = 0, max = 64, message = "岗位编码长度不能超过64个字符")
|
||||||
@ -48,6 +51,7 @@ public class SysPost implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 岗位名称
|
* 岗位名称
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "岗位名称")
|
||||||
@ExcelProperty(value = "岗位名称")
|
@ExcelProperty(value = "岗位名称")
|
||||||
@NotBlank(message = "岗位名称不能为空")
|
@NotBlank(message = "岗位名称不能为空")
|
||||||
@Size(min = 0, max = 50, message = "岗位名称长度不能超过50个字符")
|
@Size(min = 0, max = 50, message = "岗位名称长度不能超过50个字符")
|
||||||
@ -56,6 +60,7 @@ public class SysPost implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 岗位排序
|
* 岗位排序
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "岗位排序")
|
||||||
@ExcelProperty(value = "岗位排序")
|
@ExcelProperty(value = "岗位排序")
|
||||||
@NotBlank(message = "显示顺序不能为空")
|
@NotBlank(message = "显示顺序不能为空")
|
||||||
private String postSort;
|
private String postSort;
|
||||||
@ -63,48 +68,21 @@ public class SysPost implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 状态(0正常 1停用)
|
* 状态(0正常 1停用)
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "状态(0正常 1停用)")
|
||||||
@ExcelProperty(value = "状态", converter = ExcelDictConvert.class)
|
@ExcelProperty(value = "状态", converter = ExcelDictConvert.class)
|
||||||
@ExcelDictFormat(dictType = "sys_common_status")
|
@ExcelDictFormat(dictType = "sys_common_status")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建者
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT)
|
|
||||||
private String createBy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT)
|
|
||||||
private Date createTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新者
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
|
||||||
private String updateBy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新时间
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
|
||||||
private Date updateTime;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
/**
|
|
||||||
* 请求参数
|
|
||||||
*/
|
|
||||||
@TableField(exist = false)
|
|
||||||
private Map<String, Object> params = new HashMap<>();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户是否存在此岗位标识 默认不存在
|
* 用户是否存在此岗位标识 默认不存在
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "用户是否存在此岗位标识 默认不存在")
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private boolean flag = false;
|
private boolean flag = false;
|
||||||
|
|
||||||
|
@ -1,29 +1,33 @@
|
|||||||
package com.ruoyi.system.domain;
|
package com.ruoyi.system.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 角色和部门关联 sys_role_dept
|
* 角色和部门关联 sys_role_dept
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@TableName("sys_role_dept")
|
@TableName("sys_role_dept")
|
||||||
|
@ApiModel("角色和部门关联")
|
||||||
public class SysRoleDept {
|
public class SysRoleDept {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 角色ID
|
* 角色ID
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "角色ID")
|
||||||
private Long roleId;
|
private Long roleId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门ID
|
* 部门ID
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "部门ID")
|
||||||
private Long deptId;
|
private Long deptId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,29 +1,33 @@
|
|||||||
package com.ruoyi.system.domain;
|
package com.ruoyi.system.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 角色和菜单关联 sys_role_menu
|
* 角色和菜单关联 sys_role_menu
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@TableName("sys_role_menu")
|
@TableName("sys_role_menu")
|
||||||
|
@ApiModel("角色和菜单关联")
|
||||||
public class SysRoleMenu {
|
public class SysRoleMenu {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 角色ID
|
* 角色ID
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "角色ID")
|
||||||
private Long roleId;
|
private Long roleId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 菜单ID
|
* 菜单ID
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "角色ID")
|
||||||
private Long menuId;
|
private Long menuId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,56 +1,67 @@
|
|||||||
package com.ruoyi.system.domain;
|
package com.ruoyi.system.domain;
|
||||||
|
|
||||||
import lombok.*;
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 当前在线会话
|
* 当前在线会话
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
|
@ApiModel("当前在线会话业务对象")
|
||||||
public class SysUserOnline {
|
public class SysUserOnline {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 会话编号
|
* 会话编号
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "会话编号")
|
||||||
private String tokenId;
|
private String tokenId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门名称
|
* 部门名称
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "部门名称")
|
||||||
private String deptName;
|
private String deptName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户名称
|
* 用户名称
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "用户名称")
|
||||||
private String userName;
|
private String userName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 登录IP地址
|
* 登录IP地址
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "登录IP地址")
|
||||||
private String ipaddr;
|
private String ipaddr;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 登录地址
|
* 登录地址
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "登录地址")
|
||||||
private String loginLocation;
|
private String loginLocation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 浏览器类型
|
* 浏览器类型
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "浏览器类型")
|
||||||
private String browser;
|
private String browser;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 操作系统
|
* 操作系统
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "操作系统")
|
||||||
private String os;
|
private String os;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 登录时间
|
* 登录时间
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "登录时间")
|
||||||
private Long loginTime;
|
private Long loginTime;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,29 +1,33 @@
|
|||||||
package com.ruoyi.system.domain;
|
package com.ruoyi.system.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户和岗位关联 sys_user_post
|
* 用户和岗位关联 sys_user_post
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@TableName("sys_user_post")
|
@TableName("sys_user_post")
|
||||||
|
@ApiModel("用户和岗位关联")
|
||||||
public class SysUserPost {
|
public class SysUserPost {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户ID
|
* 用户ID
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 岗位ID
|
* 岗位ID
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "岗位ID")
|
||||||
private Long postId;
|
private Long postId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,29 +1,33 @@
|
|||||||
package com.ruoyi.system.domain;
|
package com.ruoyi.system.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户和角色关联 sys_user_role
|
* 用户和角色关联 sys_user_role
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@TableName("sys_user_role")
|
@TableName("sys_user_role")
|
||||||
|
@ApiModel("用户和角色关联")
|
||||||
public class SysUserRole {
|
public class SysUserRole {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户ID
|
* 用户ID
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 角色ID
|
* 角色ID
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "角色ID")
|
||||||
private Long roleId;
|
private Long roleId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
package com.ruoyi.system.domain.vo;
|
package com.ruoyi.system.domain.vo;
|
||||||
|
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -12,27 +13,32 @@ import lombok.experimental.Accessors;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
|
@ApiModel("路由显示信息")
|
||||||
public class MetaVo {
|
public class MetaVo {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置该路由在侧边栏和面包屑中展示的名字
|
* 设置该路由在侧边栏和面包屑中展示的名字
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "设置该路由在侧边栏和面包屑中展示的名字")
|
||||||
private String title;
|
private String title;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置该路由的图标,对应路径src/assets/icons/svg
|
* 设置该路由的图标,对应路径src/assets/icons/svg
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "设置该路由的图标,对应路径src/assets/icons/svg")
|
||||||
private String icon;
|
private String icon;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置为true,则不会被 <keep-alive>缓存
|
* 设置为true,则不会被 <keep-alive>缓存
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "设置为true,则不会被 <keep-alive>缓存")
|
||||||
private boolean noCache;
|
private boolean noCache;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 内链地址(http(s)://开头)
|
* 内链地址(http(s)://开头)
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "内链地址(http(s)://开头)")
|
||||||
private String link;
|
private String link;
|
||||||
|
|
||||||
public MetaVo(String title, String icon) {
|
public MetaVo(String title, String icon) {
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
package com.ruoyi.system.domain.vo;
|
package com.ruoyi.system.domain.vo;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
import lombok.*;
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -9,56 +11,66 @@ import java.util.List;
|
|||||||
/**
|
/**
|
||||||
* 路由配置信息
|
* 路由配置信息
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||||
|
@ApiModel("路由配置信息")
|
||||||
public class RouterVo {
|
public class RouterVo {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 路由名字
|
* 路由名字
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "路由名字")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 路由地址
|
* 路由地址
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "路由地址")
|
||||||
private String path;
|
private String path;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否隐藏路由,当设置 true 的时候该路由不会再侧边栏出现
|
* 是否隐藏路由,当设置 true 的时候该路由不会再侧边栏出现
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "是否隐藏路由,当设置 true 的时候该路由不会再侧边栏出现")
|
||||||
private boolean hidden;
|
private boolean hidden;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 重定向地址,当设置 noRedirect 的时候该路由在面包屑导航中不可被点击
|
* 重定向地址,当设置 noRedirect 的时候该路由在面包屑导航中不可被点击
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "重定向地址,当设置 noRedirect 的时候该路由在面包屑导航中不可被点击")
|
||||||
private String redirect;
|
private String redirect;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 组件地址
|
* 组件地址
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "组件地址")
|
||||||
private String component;
|
private String component;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 路由参数:如 {"id": 1, "name": "ry"}
|
* 路由参数:如 {"id": 1, "name": "ry"}
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "路由参数:如 {\"id\": 1, \"name\": \"ry\"}")
|
||||||
private String query;
|
private String query;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 当你一个路由下面的 children 声明的路由大于1个时,自动会变成嵌套的模式--如组件页面
|
* 当你一个路由下面的 children 声明的路由大于1个时,自动会变成嵌套的模式--如组件页面
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "当你一个路由下面的 children 声明的路由大于1个时,自动会变成嵌套的模式--如组件页面")
|
||||||
private Boolean alwaysShow;
|
private Boolean alwaysShow;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 其他元素
|
* 其他元素
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "其他元素")
|
||||||
private MetaVo meta;
|
private MetaVo meta;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 子路由
|
* 子路由
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "子路由")
|
||||||
private List<RouterVo> children;
|
private List<RouterVo> children;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,6 @@ import io.swagger.annotations.ApiModelProperty;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 对象存储配置视图对象 sys_oss_config
|
* 对象存储配置视图对象 sys_oss_config
|
||||||
*
|
*
|
||||||
|
@ -6,7 +6,7 @@ import com.ruoyi.system.domain.SysConfig;
|
|||||||
/**
|
/**
|
||||||
* 参数配置 数据层
|
* 参数配置 数据层
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
public interface SysConfigMapper extends BaseMapperPlus<SysConfig> {
|
public interface SysConfigMapper extends BaseMapperPlus<SysConfig> {
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ import java.util.List;
|
|||||||
/**
|
/**
|
||||||
* 部门管理 数据层
|
* 部门管理 数据层
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
public interface SysDeptMapper extends BaseMapperPlus<SysDept> {
|
public interface SysDeptMapper extends BaseMapperPlus<SysDept> {
|
||||||
|
|
||||||
@ -19,7 +19,7 @@ public interface SysDeptMapper extends BaseMapperPlus<SysDept> {
|
|||||||
* @param dept 部门信息
|
* @param dept 部门信息
|
||||||
* @return 部门信息集合
|
* @return 部门信息集合
|
||||||
*/
|
*/
|
||||||
public List<SysDept> selectDeptList(SysDept dept);
|
List<SysDept> selectDeptList(SysDept dept);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据角色ID查询部门树信息
|
* 根据角色ID查询部门树信息
|
||||||
@ -28,7 +28,7 @@ public interface SysDeptMapper extends BaseMapperPlus<SysDept> {
|
|||||||
* @param deptCheckStrictly 部门树选择项是否关联显示
|
* @param deptCheckStrictly 部门树选择项是否关联显示
|
||||||
* @return 选中部门列表
|
* @return 选中部门列表
|
||||||
*/
|
*/
|
||||||
public List<Integer> selectDeptListByRoleId(@Param("roleId") Long roleId, @Param("deptCheckStrictly") boolean deptCheckStrictly);
|
List<Integer> selectDeptListByRoleId(@Param("roleId") Long roleId, @Param("deptCheckStrictly") boolean deptCheckStrictly);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改子元素关系
|
* 修改子元素关系
|
||||||
@ -36,6 +36,6 @@ public interface SysDeptMapper extends BaseMapperPlus<SysDept> {
|
|||||||
* @param depts 子元素
|
* @param depts 子元素
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateDeptChildren(@Param("depts") List<SysDept> depts);
|
int updateDeptChildren(@Param("depts") List<SysDept> depts);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ import java.util.List;
|
|||||||
/**
|
/**
|
||||||
* 字典表 数据层
|
* 字典表 数据层
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
public interface SysDictDataMapper extends BaseMapperPlus<SysDictData> {
|
public interface SysDictDataMapper extends BaseMapperPlus<SysDictData> {
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
|
|||||||
/**
|
/**
|
||||||
* 字典表 数据层
|
* 字典表 数据层
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
public interface SysDictTypeMapper extends BaseMapperPlus<SysDictType> {
|
public interface SysDictTypeMapper extends BaseMapperPlus<SysDictType> {
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import com.ruoyi.system.domain.SysLogininfor;
|
|||||||
/**
|
/**
|
||||||
* 系统访问日志情况信息 数据层
|
* 系统访问日志情况信息 数据层
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
public interface SysLogininforMapper extends BaseMapperPlus<SysLogininfor> {
|
public interface SysLogininforMapper extends BaseMapperPlus<SysLogininfor> {
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ import java.util.List;
|
|||||||
/**
|
/**
|
||||||
* 菜单表 数据层
|
* 菜单表 数据层
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
public interface SysMenuMapper extends BaseMapperPlus<SysMenu> {
|
public interface SysMenuMapper extends BaseMapperPlus<SysMenu> {
|
||||||
|
|
||||||
@ -18,7 +18,7 @@ public interface SysMenuMapper extends BaseMapperPlus<SysMenu> {
|
|||||||
*
|
*
|
||||||
* @return 权限列表
|
* @return 权限列表
|
||||||
*/
|
*/
|
||||||
public List<String> selectMenuPerms();
|
List<String> selectMenuPerms();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户查询系统菜单列表
|
* 根据用户查询系统菜单列表
|
||||||
@ -26,7 +26,7 @@ public interface SysMenuMapper extends BaseMapperPlus<SysMenu> {
|
|||||||
* @param menu 菜单信息
|
* @param menu 菜单信息
|
||||||
* @return 菜单列表
|
* @return 菜单列表
|
||||||
*/
|
*/
|
||||||
public List<SysMenu> selectMenuListByUserId(SysMenu menu);
|
List<SysMenu> selectMenuListByUserId(SysMenu menu);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户ID查询权限
|
* 根据用户ID查询权限
|
||||||
@ -34,14 +34,14 @@ public interface SysMenuMapper extends BaseMapperPlus<SysMenu> {
|
|||||||
* @param userId 用户ID
|
* @param userId 用户ID
|
||||||
* @return 权限列表
|
* @return 权限列表
|
||||||
*/
|
*/
|
||||||
public List<String> selectMenuPermsByUserId(Long userId);
|
List<String> selectMenuPermsByUserId(Long userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户ID查询菜单
|
* 根据用户ID查询菜单
|
||||||
*
|
*
|
||||||
* @return 菜单列表
|
* @return 菜单列表
|
||||||
*/
|
*/
|
||||||
public List<SysMenu> selectMenuTreeAll();
|
List<SysMenu> selectMenuTreeAll();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户ID查询菜单
|
* 根据用户ID查询菜单
|
||||||
@ -49,7 +49,7 @@ public interface SysMenuMapper extends BaseMapperPlus<SysMenu> {
|
|||||||
* @param userId 用户ID
|
* @param userId 用户ID
|
||||||
* @return 菜单列表
|
* @return 菜单列表
|
||||||
*/
|
*/
|
||||||
public List<SysMenu> selectMenuTreeByUserId(Long userId);
|
List<SysMenu> selectMenuTreeByUserId(Long userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据角色ID查询菜单树信息
|
* 根据角色ID查询菜单树信息
|
||||||
@ -58,6 +58,6 @@ public interface SysMenuMapper extends BaseMapperPlus<SysMenu> {
|
|||||||
* @param menuCheckStrictly 菜单树选择项是否关联显示
|
* @param menuCheckStrictly 菜单树选择项是否关联显示
|
||||||
* @return 选中菜单列表
|
* @return 选中菜单列表
|
||||||
*/
|
*/
|
||||||
public List<Integer> selectMenuListByRoleId(@Param("roleId") Long roleId, @Param("menuCheckStrictly") boolean menuCheckStrictly);
|
List<Integer> selectMenuListByRoleId(@Param("roleId") Long roleId, @Param("menuCheckStrictly") boolean menuCheckStrictly);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ import com.ruoyi.system.domain.SysNotice;
|
|||||||
/**
|
/**
|
||||||
* 通知公告表 数据层
|
* 通知公告表 数据层
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
public interface SysNoticeMapper extends BaseMapperPlus<SysNotice> {
|
public interface SysNoticeMapper extends BaseMapperPlus<SysNotice> {
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import com.ruoyi.system.domain.SysOperLog;
|
|||||||
/**
|
/**
|
||||||
* 操作日志 数据层
|
* 操作日志 数据层
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
public interface SysOperLogMapper extends BaseMapperPlus<SysOperLog> {
|
public interface SysOperLogMapper extends BaseMapperPlus<SysOperLog> {
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ import java.util.List;
|
|||||||
/**
|
/**
|
||||||
* 岗位信息 数据层
|
* 岗位信息 数据层
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
public interface SysPostMapper extends BaseMapperPlus<SysPost> {
|
public interface SysPostMapper extends BaseMapperPlus<SysPost> {
|
||||||
|
|
||||||
@ -18,7 +18,7 @@ public interface SysPostMapper extends BaseMapperPlus<SysPost> {
|
|||||||
* @param userId 用户ID
|
* @param userId 用户ID
|
||||||
* @return 选中岗位ID列表
|
* @return 选中岗位ID列表
|
||||||
*/
|
*/
|
||||||
public List<Integer> selectPostListByUserId(Long userId);
|
List<Integer> selectPostListByUserId(Long userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询用户所属岗位组
|
* 查询用户所属岗位组
|
||||||
@ -26,6 +26,6 @@ public interface SysPostMapper extends BaseMapperPlus<SysPost> {
|
|||||||
* @param userName 用户名
|
* @param userName 用户名
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public List<SysPost> selectPostsByUserName(String userName);
|
List<SysPost> selectPostsByUserName(String userName);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ import com.ruoyi.system.domain.SysRoleDept;
|
|||||||
/**
|
/**
|
||||||
* 角色与部门关联表 数据层
|
* 角色与部门关联表 数据层
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
public interface SysRoleDeptMapper extends BaseMapperPlus<SysRoleDept> {
|
public interface SysRoleDeptMapper extends BaseMapperPlus<SysRoleDept> {
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ import java.util.List;
|
|||||||
/**
|
/**
|
||||||
* 角色表 数据层
|
* 角色表 数据层
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
public interface SysRoleMapper extends BaseMapperPlus<SysRole> {
|
public interface SysRoleMapper extends BaseMapperPlus<SysRole> {
|
||||||
|
|
||||||
@ -22,7 +22,7 @@ public interface SysRoleMapper extends BaseMapperPlus<SysRole> {
|
|||||||
* @param role 角色信息
|
* @param role 角色信息
|
||||||
* @return 角色数据集合信息
|
* @return 角色数据集合信息
|
||||||
*/
|
*/
|
||||||
public List<SysRole> selectRoleList(SysRole role);
|
List<SysRole> selectRoleList(SysRole role);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户ID查询角色
|
* 根据用户ID查询角色
|
||||||
@ -30,7 +30,7 @@ public interface SysRoleMapper extends BaseMapperPlus<SysRole> {
|
|||||||
* @param userId 用户ID
|
* @param userId 用户ID
|
||||||
* @return 角色列表
|
* @return 角色列表
|
||||||
*/
|
*/
|
||||||
public List<SysRole> selectRolePermissionByUserId(Long userId);
|
List<SysRole> selectRolePermissionByUserId(Long userId);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -39,7 +39,7 @@ public interface SysRoleMapper extends BaseMapperPlus<SysRole> {
|
|||||||
* @param userId 用户ID
|
* @param userId 用户ID
|
||||||
* @return 选中角色ID列表
|
* @return 选中角色ID列表
|
||||||
*/
|
*/
|
||||||
public List<Integer> selectRoleListByUserId(Long userId);
|
List<Integer> selectRoleListByUserId(Long userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户ID查询角色
|
* 根据用户ID查询角色
|
||||||
@ -47,6 +47,6 @@ public interface SysRoleMapper extends BaseMapperPlus<SysRole> {
|
|||||||
* @param userName 用户名
|
* @param userName 用户名
|
||||||
* @return 角色列表
|
* @return 角色列表
|
||||||
*/
|
*/
|
||||||
public List<SysRole> selectRolesByUserName(String userName);
|
List<SysRole> selectRolesByUserName(String userName);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ import com.ruoyi.system.domain.SysRoleMenu;
|
|||||||
/**
|
/**
|
||||||
* 角色与菜单关联表 数据层
|
* 角色与菜单关联表 数据层
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
public interface SysRoleMenuMapper extends BaseMapperPlus<SysRoleMenu> {
|
public interface SysRoleMenuMapper extends BaseMapperPlus<SysRoleMenu> {
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ import java.util.List;
|
|||||||
/**
|
/**
|
||||||
* 用户表 数据层
|
* 用户表 数据层
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
public interface SysUserMapper extends BaseMapperPlus<SysUser> {
|
public interface SysUserMapper extends BaseMapperPlus<SysUser> {
|
||||||
|
|
||||||
@ -22,7 +22,7 @@ public interface SysUserMapper extends BaseMapperPlus<SysUser> {
|
|||||||
* @param sysUser 用户信息
|
* @param sysUser 用户信息
|
||||||
* @return 用户信息集合信息
|
* @return 用户信息集合信息
|
||||||
*/
|
*/
|
||||||
public List<SysUser> selectUserList(SysUser sysUser);
|
List<SysUser> selectUserList(SysUser sysUser);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据条件分页查询未已配用户角色列表
|
* 根据条件分页查询未已配用户角色列表
|
||||||
@ -30,7 +30,7 @@ public interface SysUserMapper extends BaseMapperPlus<SysUser> {
|
|||||||
* @param user 用户信息
|
* @param user 用户信息
|
||||||
* @return 用户信息集合信息
|
* @return 用户信息集合信息
|
||||||
*/
|
*/
|
||||||
public Page<SysUser> selectAllocatedList(@Param("page") Page<SysUser> page, @Param("user") SysUser user);
|
Page<SysUser> selectAllocatedList(@Param("page") Page<SysUser> page, @Param("user") SysUser user);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据条件分页查询未分配用户角色列表
|
* 根据条件分页查询未分配用户角色列表
|
||||||
@ -38,7 +38,7 @@ public interface SysUserMapper extends BaseMapperPlus<SysUser> {
|
|||||||
* @param user 用户信息
|
* @param user 用户信息
|
||||||
* @return 用户信息集合信息
|
* @return 用户信息集合信息
|
||||||
*/
|
*/
|
||||||
public Page<SysUser> selectUnallocatedList(@Param("page") Page<SysUser> page, @Param("user") SysUser user);
|
Page<SysUser> selectUnallocatedList(@Param("page") Page<SysUser> page, @Param("user") SysUser user);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过用户名查询用户
|
* 通过用户名查询用户
|
||||||
@ -46,7 +46,7 @@ public interface SysUserMapper extends BaseMapperPlus<SysUser> {
|
|||||||
* @param userName 用户名
|
* @param userName 用户名
|
||||||
* @return 用户对象信息
|
* @return 用户对象信息
|
||||||
*/
|
*/
|
||||||
public SysUser selectUserByUserName(String userName);
|
SysUser selectUserByUserName(String userName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过用户ID查询用户
|
* 通过用户ID查询用户
|
||||||
@ -54,6 +54,6 @@ public interface SysUserMapper extends BaseMapperPlus<SysUser> {
|
|||||||
* @param userId 用户ID
|
* @param userId 用户ID
|
||||||
* @return 用户对象信息
|
* @return 用户对象信息
|
||||||
*/
|
*/
|
||||||
public SysUser selectUserById(Long userId);
|
SysUser selectUserById(Long userId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ import com.ruoyi.system.domain.SysUserPost;
|
|||||||
/**
|
/**
|
||||||
* 用户与岗位关联表 数据层
|
* 用户与岗位关联表 数据层
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
public interface SysUserPostMapper extends BaseMapperPlus<SysUserPost> {
|
public interface SysUserPostMapper extends BaseMapperPlus<SysUserPost> {
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import com.ruoyi.system.domain.SysUserRole;
|
|||||||
/**
|
/**
|
||||||
* 用户与角色关联表 数据层
|
* 用户与角色关联表 数据层
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
public interface SysUserRoleMapper extends BaseMapperPlus<SysUserRole> {
|
public interface SysUserRoleMapper extends BaseMapperPlus<SysUserRole> {
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ import java.util.List;
|
|||||||
/**
|
/**
|
||||||
* 参数配置 服务层
|
* 参数配置 服务层
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
public interface ISysConfigService extends IService<SysConfig> {
|
public interface ISysConfigService extends IService<SysConfig> {
|
||||||
|
|
||||||
@ -22,7 +22,7 @@ public interface ISysConfigService extends IService<SysConfig> {
|
|||||||
* @param configId 参数配置ID
|
* @param configId 参数配置ID
|
||||||
* @return 参数配置信息
|
* @return 参数配置信息
|
||||||
*/
|
*/
|
||||||
public SysConfig selectConfigById(Long configId);
|
SysConfig selectConfigById(Long configId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据键名查询参数配置信息
|
* 根据键名查询参数配置信息
|
||||||
@ -30,14 +30,14 @@ public interface ISysConfigService extends IService<SysConfig> {
|
|||||||
* @param configKey 参数键名
|
* @param configKey 参数键名
|
||||||
* @return 参数键值
|
* @return 参数键值
|
||||||
*/
|
*/
|
||||||
public String selectConfigByKey(String configKey);
|
String selectConfigByKey(String configKey);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取验证码开关
|
* 获取验证码开关
|
||||||
*
|
*
|
||||||
* @return true开启,false关闭
|
* @return true开启,false关闭
|
||||||
*/
|
*/
|
||||||
public boolean selectCaptchaOnOff();
|
boolean selectCaptchaOnOff();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询参数配置列表
|
* 查询参数配置列表
|
||||||
@ -45,7 +45,7 @@ public interface ISysConfigService extends IService<SysConfig> {
|
|||||||
* @param config 参数配置信息
|
* @param config 参数配置信息
|
||||||
* @return 参数配置集合
|
* @return 参数配置集合
|
||||||
*/
|
*/
|
||||||
public List<SysConfig> selectConfigList(SysConfig config);
|
List<SysConfig> selectConfigList(SysConfig config);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增参数配置
|
* 新增参数配置
|
||||||
@ -53,7 +53,7 @@ public interface ISysConfigService extends IService<SysConfig> {
|
|||||||
* @param config 参数配置信息
|
* @param config 参数配置信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertConfig(SysConfig config);
|
int insertConfig(SysConfig config);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改参数配置
|
* 修改参数配置
|
||||||
@ -61,7 +61,7 @@ public interface ISysConfigService extends IService<SysConfig> {
|
|||||||
* @param config 参数配置信息
|
* @param config 参数配置信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateConfig(SysConfig config);
|
int updateConfig(SysConfig config);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除参数信息
|
* 批量删除参数信息
|
||||||
@ -69,22 +69,22 @@ public interface ISysConfigService extends IService<SysConfig> {
|
|||||||
* @param configIds 需要删除的参数ID
|
* @param configIds 需要删除的参数ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public void deleteConfigByIds(Long[] configIds);
|
void deleteConfigByIds(Long[] configIds);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 加载参数缓存数据
|
* 加载参数缓存数据
|
||||||
*/
|
*/
|
||||||
public void loadingConfigCache();
|
void loadingConfigCache();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 清空参数缓存数据
|
* 清空参数缓存数据
|
||||||
*/
|
*/
|
||||||
public void clearConfigCache();
|
void clearConfigCache();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 重置参数缓存数据
|
* 重置参数缓存数据
|
||||||
*/
|
*/
|
||||||
public void resetConfigCache();
|
void resetConfigCache();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验参数键名是否唯一
|
* 校验参数键名是否唯一
|
||||||
@ -92,5 +92,5 @@ public interface ISysConfigService extends IService<SysConfig> {
|
|||||||
* @param config 参数信息
|
* @param config 参数信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public String checkConfigKeyUnique(SysConfig config);
|
String checkConfigKeyUnique(SysConfig config);
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ import java.util.List;
|
|||||||
/**
|
/**
|
||||||
* 部门管理 服务层
|
* 部门管理 服务层
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
public interface ISysDeptService extends IService<SysDept> {
|
public interface ISysDeptService extends IService<SysDept> {
|
||||||
/**
|
/**
|
||||||
@ -18,7 +18,7 @@ public interface ISysDeptService extends IService<SysDept> {
|
|||||||
* @param dept 部门信息
|
* @param dept 部门信息
|
||||||
* @return 部门信息集合
|
* @return 部门信息集合
|
||||||
*/
|
*/
|
||||||
public List<SysDept> selectDeptList(SysDept dept);
|
List<SysDept> selectDeptList(SysDept dept);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 构建前端所需要树结构
|
* 构建前端所需要树结构
|
||||||
@ -26,7 +26,7 @@ public interface ISysDeptService extends IService<SysDept> {
|
|||||||
* @param depts 部门列表
|
* @param depts 部门列表
|
||||||
* @return 树结构列表
|
* @return 树结构列表
|
||||||
*/
|
*/
|
||||||
public List<SysDept> buildDeptTree(List<SysDept> depts);
|
List<SysDept> buildDeptTree(List<SysDept> depts);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 构建前端所需要下拉树结构
|
* 构建前端所需要下拉树结构
|
||||||
@ -34,7 +34,7 @@ public interface ISysDeptService extends IService<SysDept> {
|
|||||||
* @param depts 部门列表
|
* @param depts 部门列表
|
||||||
* @return 下拉树结构列表
|
* @return 下拉树结构列表
|
||||||
*/
|
*/
|
||||||
public List<TreeSelect> buildDeptTreeSelect(List<SysDept> depts);
|
List<TreeSelect> buildDeptTreeSelect(List<SysDept> depts);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据角色ID查询部门树信息
|
* 根据角色ID查询部门树信息
|
||||||
@ -42,7 +42,7 @@ public interface ISysDeptService extends IService<SysDept> {
|
|||||||
* @param roleId 角色ID
|
* @param roleId 角色ID
|
||||||
* @return 选中部门列表
|
* @return 选中部门列表
|
||||||
*/
|
*/
|
||||||
public List<Integer> selectDeptListByRoleId(Long roleId);
|
List<Integer> selectDeptListByRoleId(Long roleId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据部门ID查询信息
|
* 根据部门ID查询信息
|
||||||
@ -50,7 +50,7 @@ public interface ISysDeptService extends IService<SysDept> {
|
|||||||
* @param deptId 部门ID
|
* @param deptId 部门ID
|
||||||
* @return 部门信息
|
* @return 部门信息
|
||||||
*/
|
*/
|
||||||
public SysDept selectDeptById(Long deptId);
|
SysDept selectDeptById(Long deptId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据ID查询所有子部门(正常状态)
|
* 根据ID查询所有子部门(正常状态)
|
||||||
@ -58,7 +58,7 @@ public interface ISysDeptService extends IService<SysDept> {
|
|||||||
* @param deptId 部门ID
|
* @param deptId 部门ID
|
||||||
* @return 子部门数
|
* @return 子部门数
|
||||||
*/
|
*/
|
||||||
public long selectNormalChildrenDeptById(Long deptId);
|
long selectNormalChildrenDeptById(Long deptId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否存在部门子节点
|
* 是否存在部门子节点
|
||||||
@ -66,7 +66,7 @@ public interface ISysDeptService extends IService<SysDept> {
|
|||||||
* @param deptId 部门ID
|
* @param deptId 部门ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public boolean hasChildByDeptId(Long deptId);
|
boolean hasChildByDeptId(Long deptId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询部门是否存在用户
|
* 查询部门是否存在用户
|
||||||
@ -74,7 +74,7 @@ public interface ISysDeptService extends IService<SysDept> {
|
|||||||
* @param deptId 部门ID
|
* @param deptId 部门ID
|
||||||
* @return 结果 true 存在 false 不存在
|
* @return 结果 true 存在 false 不存在
|
||||||
*/
|
*/
|
||||||
public boolean checkDeptExistUser(Long deptId);
|
boolean checkDeptExistUser(Long deptId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验部门名称是否唯一
|
* 校验部门名称是否唯一
|
||||||
@ -82,14 +82,14 @@ public interface ISysDeptService extends IService<SysDept> {
|
|||||||
* @param dept 部门信息
|
* @param dept 部门信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public String checkDeptNameUnique(SysDept dept);
|
String checkDeptNameUnique(SysDept dept);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验部门是否有数据权限
|
* 校验部门是否有数据权限
|
||||||
*
|
*
|
||||||
* @param deptId 部门id
|
* @param deptId 部门id
|
||||||
*/
|
*/
|
||||||
public void checkDeptDataScope(Long deptId);
|
void checkDeptDataScope(Long deptId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增保存部门信息
|
* 新增保存部门信息
|
||||||
@ -97,7 +97,7 @@ public interface ISysDeptService extends IService<SysDept> {
|
|||||||
* @param dept 部门信息
|
* @param dept 部门信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertDept(SysDept dept);
|
int insertDept(SysDept dept);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改保存部门信息
|
* 修改保存部门信息
|
||||||
@ -105,7 +105,7 @@ public interface ISysDeptService extends IService<SysDept> {
|
|||||||
* @param dept 部门信息
|
* @param dept 部门信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateDept(SysDept dept);
|
int updateDept(SysDept dept);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除部门管理信息
|
* 删除部门管理信息
|
||||||
@ -113,5 +113,5 @@ public interface ISysDeptService extends IService<SysDept> {
|
|||||||
* @param deptId 部门ID
|
* @param deptId 部门ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteDeptById(Long deptId);
|
int deleteDeptById(Long deptId);
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ import java.util.List;
|
|||||||
/**
|
/**
|
||||||
* 字典 业务层
|
* 字典 业务层
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
public interface ISysDictDataService extends IService<SysDictData> {
|
public interface ISysDictDataService extends IService<SysDictData> {
|
||||||
|
|
||||||
@ -22,7 +22,7 @@ public interface ISysDictDataService extends IService<SysDictData> {
|
|||||||
* @param dictData 字典数据信息
|
* @param dictData 字典数据信息
|
||||||
* @return 字典数据集合信息
|
* @return 字典数据集合信息
|
||||||
*/
|
*/
|
||||||
public List<SysDictData> selectDictDataList(SysDictData dictData);
|
List<SysDictData> selectDictDataList(SysDictData dictData);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据字典类型和字典键值查询字典数据信息
|
* 根据字典类型和字典键值查询字典数据信息
|
||||||
@ -31,7 +31,7 @@ public interface ISysDictDataService extends IService<SysDictData> {
|
|||||||
* @param dictValue 字典键值
|
* @param dictValue 字典键值
|
||||||
* @return 字典标签
|
* @return 字典标签
|
||||||
*/
|
*/
|
||||||
public String selectDictLabel(String dictType, String dictValue);
|
String selectDictLabel(String dictType, String dictValue);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据字典数据ID查询信息
|
* 根据字典数据ID查询信息
|
||||||
@ -39,7 +39,7 @@ public interface ISysDictDataService extends IService<SysDictData> {
|
|||||||
* @param dictCode 字典数据ID
|
* @param dictCode 字典数据ID
|
||||||
* @return 字典数据
|
* @return 字典数据
|
||||||
*/
|
*/
|
||||||
public SysDictData selectDictDataById(Long dictCode);
|
SysDictData selectDictDataById(Long dictCode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除字典数据信息
|
* 批量删除字典数据信息
|
||||||
@ -47,7 +47,7 @@ public interface ISysDictDataService extends IService<SysDictData> {
|
|||||||
* @param dictCodes 需要删除的字典数据ID
|
* @param dictCodes 需要删除的字典数据ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public void deleteDictDataByIds(Long[] dictCodes);
|
void deleteDictDataByIds(Long[] dictCodes);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增保存字典数据信息
|
* 新增保存字典数据信息
|
||||||
@ -55,7 +55,7 @@ public interface ISysDictDataService extends IService<SysDictData> {
|
|||||||
* @param dictData 字典数据信息
|
* @param dictData 字典数据信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertDictData(SysDictData dictData);
|
int insertDictData(SysDictData dictData);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改保存字典数据信息
|
* 修改保存字典数据信息
|
||||||
@ -63,5 +63,5 @@ public interface ISysDictDataService extends IService<SysDictData> {
|
|||||||
* @param dictData 字典数据信息
|
* @param dictData 字典数据信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateDictData(SysDictData dictData);
|
int updateDictData(SysDictData dictData);
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ import java.util.List;
|
|||||||
/**
|
/**
|
||||||
* 字典 业务层
|
* 字典 业务层
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
public interface ISysDictTypeService extends IService<SysDictType> {
|
public interface ISysDictTypeService extends IService<SysDictType> {
|
||||||
|
|
||||||
@ -23,14 +23,14 @@ public interface ISysDictTypeService extends IService<SysDictType> {
|
|||||||
* @param dictType 字典类型信息
|
* @param dictType 字典类型信息
|
||||||
* @return 字典类型集合信息
|
* @return 字典类型集合信息
|
||||||
*/
|
*/
|
||||||
public List<SysDictType> selectDictTypeList(SysDictType dictType);
|
List<SysDictType> selectDictTypeList(SysDictType dictType);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据所有字典类型
|
* 根据所有字典类型
|
||||||
*
|
*
|
||||||
* @return 字典类型集合信息
|
* @return 字典类型集合信息
|
||||||
*/
|
*/
|
||||||
public List<SysDictType> selectDictTypeAll();
|
List<SysDictType> selectDictTypeAll();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据字典类型查询字典数据
|
* 根据字典类型查询字典数据
|
||||||
@ -38,7 +38,7 @@ public interface ISysDictTypeService extends IService<SysDictType> {
|
|||||||
* @param dictType 字典类型
|
* @param dictType 字典类型
|
||||||
* @return 字典数据集合信息
|
* @return 字典数据集合信息
|
||||||
*/
|
*/
|
||||||
public List<SysDictData> selectDictDataByType(String dictType);
|
List<SysDictData> selectDictDataByType(String dictType);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据字典类型ID查询信息
|
* 根据字典类型ID查询信息
|
||||||
@ -46,7 +46,7 @@ public interface ISysDictTypeService extends IService<SysDictType> {
|
|||||||
* @param dictId 字典类型ID
|
* @param dictId 字典类型ID
|
||||||
* @return 字典类型
|
* @return 字典类型
|
||||||
*/
|
*/
|
||||||
public SysDictType selectDictTypeById(Long dictId);
|
SysDictType selectDictTypeById(Long dictId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据字典类型查询信息
|
* 根据字典类型查询信息
|
||||||
@ -54,7 +54,7 @@ public interface ISysDictTypeService extends IService<SysDictType> {
|
|||||||
* @param dictType 字典类型
|
* @param dictType 字典类型
|
||||||
* @return 字典类型
|
* @return 字典类型
|
||||||
*/
|
*/
|
||||||
public SysDictType selectDictTypeByType(String dictType);
|
SysDictType selectDictTypeByType(String dictType);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除字典信息
|
* 批量删除字典信息
|
||||||
@ -62,22 +62,22 @@ public interface ISysDictTypeService extends IService<SysDictType> {
|
|||||||
* @param dictIds 需要删除的字典ID
|
* @param dictIds 需要删除的字典ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public void deleteDictTypeByIds(Long[] dictIds);
|
void deleteDictTypeByIds(Long[] dictIds);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 加载字典缓存数据
|
* 加载字典缓存数据
|
||||||
*/
|
*/
|
||||||
public void loadingDictCache();
|
void loadingDictCache();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 清空字典缓存数据
|
* 清空字典缓存数据
|
||||||
*/
|
*/
|
||||||
public void clearDictCache();
|
void clearDictCache();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 重置字典缓存数据
|
* 重置字典缓存数据
|
||||||
*/
|
*/
|
||||||
public void resetDictCache();
|
void resetDictCache();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增保存字典类型信息
|
* 新增保存字典类型信息
|
||||||
@ -85,7 +85,7 @@ public interface ISysDictTypeService extends IService<SysDictType> {
|
|||||||
* @param dictType 字典类型信息
|
* @param dictType 字典类型信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertDictType(SysDictType dictType);
|
int insertDictType(SysDictType dictType);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改保存字典类型信息
|
* 修改保存字典类型信息
|
||||||
@ -93,7 +93,7 @@ public interface ISysDictTypeService extends IService<SysDictType> {
|
|||||||
* @param dictType 字典类型信息
|
* @param dictType 字典类型信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateDictType(SysDictType dictType);
|
int updateDictType(SysDictType dictType);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验字典类型称是否唯一
|
* 校验字典类型称是否唯一
|
||||||
@ -101,5 +101,5 @@ public interface ISysDictTypeService extends IService<SysDictType> {
|
|||||||
* @param dictType 字典类型
|
* @param dictType 字典类型
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public String checkDictTypeUnique(SysDictType dictType);
|
String checkDictTypeUnique(SysDictType dictType);
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ import java.util.List;
|
|||||||
/**
|
/**
|
||||||
* 系统访问日志情况信息 服务层
|
* 系统访问日志情况信息 服务层
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
public interface ISysLogininforService extends IService<SysLogininfor> {
|
public interface ISysLogininforService extends IService<SysLogininfor> {
|
||||||
|
|
||||||
@ -21,7 +21,7 @@ public interface ISysLogininforService extends IService<SysLogininfor> {
|
|||||||
*
|
*
|
||||||
* @param logininfor 访问日志对象
|
* @param logininfor 访问日志对象
|
||||||
*/
|
*/
|
||||||
public void insertLogininfor(SysLogininfor logininfor);
|
void insertLogininfor(SysLogininfor logininfor);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询系统登录日志集合
|
* 查询系统登录日志集合
|
||||||
@ -29,7 +29,7 @@ public interface ISysLogininforService extends IService<SysLogininfor> {
|
|||||||
* @param logininfor 访问日志对象
|
* @param logininfor 访问日志对象
|
||||||
* @return 登录记录集合
|
* @return 登录记录集合
|
||||||
*/
|
*/
|
||||||
public List<SysLogininfor> selectLogininforList(SysLogininfor logininfor);
|
List<SysLogininfor> selectLogininforList(SysLogininfor logininfor);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除系统登录日志
|
* 批量删除系统登录日志
|
||||||
@ -37,10 +37,10 @@ public interface ISysLogininforService extends IService<SysLogininfor> {
|
|||||||
* @param infoIds 需要删除的登录日志ID
|
* @param infoIds 需要删除的登录日志ID
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public int deleteLogininforByIds(Long[] infoIds);
|
int deleteLogininforByIds(Long[] infoIds);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 清空系统登录日志
|
* 清空系统登录日志
|
||||||
*/
|
*/
|
||||||
public void cleanLogininfor();
|
void cleanLogininfor();
|
||||||
}
|
}
|
||||||
|
@ -11,16 +11,17 @@ import java.util.Set;
|
|||||||
/**
|
/**
|
||||||
* 菜单 业务层
|
* 菜单 业务层
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
public interface ISysMenuService extends IService<SysMenu> {
|
public interface ISysMenuService extends IService<SysMenu> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户查询系统菜单列表
|
* 根据用户查询系统菜单列表
|
||||||
*
|
*
|
||||||
* @param userId 用户ID
|
* @param userId 用户ID
|
||||||
* @return 菜单列表
|
* @return 菜单列表
|
||||||
*/
|
*/
|
||||||
public List<SysMenu> selectMenuList(Long userId);
|
List<SysMenu> selectMenuList(Long userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户查询系统菜单列表
|
* 根据用户查询系统菜单列表
|
||||||
@ -29,7 +30,7 @@ public interface ISysMenuService extends IService<SysMenu> {
|
|||||||
* @param userId 用户ID
|
* @param userId 用户ID
|
||||||
* @return 菜单列表
|
* @return 菜单列表
|
||||||
*/
|
*/
|
||||||
public List<SysMenu> selectMenuList(SysMenu menu, Long userId);
|
List<SysMenu> selectMenuList(SysMenu menu, Long userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户ID查询权限
|
* 根据用户ID查询权限
|
||||||
@ -37,7 +38,7 @@ public interface ISysMenuService extends IService<SysMenu> {
|
|||||||
* @param userId 用户ID
|
* @param userId 用户ID
|
||||||
* @return 权限列表
|
* @return 权限列表
|
||||||
*/
|
*/
|
||||||
public Set<String> selectMenuPermsByUserId(Long userId);
|
Set<String> selectMenuPermsByUserId(Long userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户ID查询菜单树信息
|
* 根据用户ID查询菜单树信息
|
||||||
@ -45,7 +46,7 @@ public interface ISysMenuService extends IService<SysMenu> {
|
|||||||
* @param userId 用户ID
|
* @param userId 用户ID
|
||||||
* @return 菜单列表
|
* @return 菜单列表
|
||||||
*/
|
*/
|
||||||
public List<SysMenu> selectMenuTreeByUserId(Long userId);
|
List<SysMenu> selectMenuTreeByUserId(Long userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据角色ID查询菜单树信息
|
* 根据角色ID查询菜单树信息
|
||||||
@ -53,7 +54,7 @@ public interface ISysMenuService extends IService<SysMenu> {
|
|||||||
* @param roleId 角色ID
|
* @param roleId 角色ID
|
||||||
* @return 选中菜单列表
|
* @return 选中菜单列表
|
||||||
*/
|
*/
|
||||||
public List<Integer> selectMenuListByRoleId(Long roleId);
|
List<Integer> selectMenuListByRoleId(Long roleId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 构建前端路由所需要的菜单
|
* 构建前端路由所需要的菜单
|
||||||
@ -61,7 +62,7 @@ public interface ISysMenuService extends IService<SysMenu> {
|
|||||||
* @param menus 菜单列表
|
* @param menus 菜单列表
|
||||||
* @return 路由列表
|
* @return 路由列表
|
||||||
*/
|
*/
|
||||||
public List<RouterVo> buildMenus(List<SysMenu> menus);
|
List<RouterVo> buildMenus(List<SysMenu> menus);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 构建前端所需要树结构
|
* 构建前端所需要树结构
|
||||||
@ -69,7 +70,7 @@ public interface ISysMenuService extends IService<SysMenu> {
|
|||||||
* @param menus 菜单列表
|
* @param menus 菜单列表
|
||||||
* @return 树结构列表
|
* @return 树结构列表
|
||||||
*/
|
*/
|
||||||
public List<SysMenu> buildMenuTree(List<SysMenu> menus);
|
List<SysMenu> buildMenuTree(List<SysMenu> menus);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 构建前端所需要下拉树结构
|
* 构建前端所需要下拉树结构
|
||||||
@ -77,7 +78,7 @@ public interface ISysMenuService extends IService<SysMenu> {
|
|||||||
* @param menus 菜单列表
|
* @param menus 菜单列表
|
||||||
* @return 下拉树结构列表
|
* @return 下拉树结构列表
|
||||||
*/
|
*/
|
||||||
public List<TreeSelect> buildMenuTreeSelect(List<SysMenu> menus);
|
List<TreeSelect> buildMenuTreeSelect(List<SysMenu> menus);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据菜单ID查询信息
|
* 根据菜单ID查询信息
|
||||||
@ -85,7 +86,7 @@ public interface ISysMenuService extends IService<SysMenu> {
|
|||||||
* @param menuId 菜单ID
|
* @param menuId 菜单ID
|
||||||
* @return 菜单信息
|
* @return 菜单信息
|
||||||
*/
|
*/
|
||||||
public SysMenu selectMenuById(Long menuId);
|
SysMenu selectMenuById(Long menuId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否存在菜单子节点
|
* 是否存在菜单子节点
|
||||||
@ -93,7 +94,7 @@ public interface ISysMenuService extends IService<SysMenu> {
|
|||||||
* @param menuId 菜单ID
|
* @param menuId 菜单ID
|
||||||
* @return 结果 true 存在 false 不存在
|
* @return 结果 true 存在 false 不存在
|
||||||
*/
|
*/
|
||||||
public boolean hasChildByMenuId(Long menuId);
|
boolean hasChildByMenuId(Long menuId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询菜单是否存在角色
|
* 查询菜单是否存在角色
|
||||||
@ -101,7 +102,7 @@ public interface ISysMenuService extends IService<SysMenu> {
|
|||||||
* @param menuId 菜单ID
|
* @param menuId 菜单ID
|
||||||
* @return 结果 true 存在 false 不存在
|
* @return 结果 true 存在 false 不存在
|
||||||
*/
|
*/
|
||||||
public boolean checkMenuExistRole(Long menuId);
|
boolean checkMenuExistRole(Long menuId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增保存菜单信息
|
* 新增保存菜单信息
|
||||||
@ -109,7 +110,7 @@ public interface ISysMenuService extends IService<SysMenu> {
|
|||||||
* @param menu 菜单信息
|
* @param menu 菜单信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertMenu(SysMenu menu);
|
int insertMenu(SysMenu menu);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改保存菜单信息
|
* 修改保存菜单信息
|
||||||
@ -117,7 +118,7 @@ public interface ISysMenuService extends IService<SysMenu> {
|
|||||||
* @param menu 菜单信息
|
* @param menu 菜单信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateMenu(SysMenu menu);
|
int updateMenu(SysMenu menu);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除菜单管理信息
|
* 删除菜单管理信息
|
||||||
@ -125,7 +126,7 @@ public interface ISysMenuService extends IService<SysMenu> {
|
|||||||
* @param menuId 菜单ID
|
* @param menuId 菜单ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteMenuById(Long menuId);
|
int deleteMenuById(Long menuId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验菜单名称是否唯一
|
* 校验菜单名称是否唯一
|
||||||
@ -133,5 +134,5 @@ public interface ISysMenuService extends IService<SysMenu> {
|
|||||||
* @param menu 菜单信息
|
* @param menu 菜单信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public String checkMenuNameUnique(SysMenu menu);
|
String checkMenuNameUnique(SysMenu menu);
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ import java.util.List;
|
|||||||
/**
|
/**
|
||||||
* 公告 服务层
|
* 公告 服务层
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
public interface ISysNoticeService extends IService<SysNotice> {
|
public interface ISysNoticeService extends IService<SysNotice> {
|
||||||
|
|
||||||
@ -22,7 +22,7 @@ public interface ISysNoticeService extends IService<SysNotice> {
|
|||||||
* @param noticeId 公告ID
|
* @param noticeId 公告ID
|
||||||
* @return 公告信息
|
* @return 公告信息
|
||||||
*/
|
*/
|
||||||
public SysNotice selectNoticeById(Long noticeId);
|
SysNotice selectNoticeById(Long noticeId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询公告列表
|
* 查询公告列表
|
||||||
@ -30,7 +30,7 @@ public interface ISysNoticeService extends IService<SysNotice> {
|
|||||||
* @param notice 公告信息
|
* @param notice 公告信息
|
||||||
* @return 公告集合
|
* @return 公告集合
|
||||||
*/
|
*/
|
||||||
public List<SysNotice> selectNoticeList(SysNotice notice);
|
List<SysNotice> selectNoticeList(SysNotice notice);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增公告
|
* 新增公告
|
||||||
@ -38,7 +38,7 @@ public interface ISysNoticeService extends IService<SysNotice> {
|
|||||||
* @param notice 公告信息
|
* @param notice 公告信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertNotice(SysNotice notice);
|
int insertNotice(SysNotice notice);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改公告
|
* 修改公告
|
||||||
@ -46,7 +46,7 @@ public interface ISysNoticeService extends IService<SysNotice> {
|
|||||||
* @param notice 公告信息
|
* @param notice 公告信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateNotice(SysNotice notice);
|
int updateNotice(SysNotice notice);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除公告信息
|
* 删除公告信息
|
||||||
@ -54,7 +54,7 @@ public interface ISysNoticeService extends IService<SysNotice> {
|
|||||||
* @param noticeId 公告ID
|
* @param noticeId 公告ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteNoticeById(Long noticeId);
|
int deleteNoticeById(Long noticeId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除公告信息
|
* 批量删除公告信息
|
||||||
@ -62,5 +62,5 @@ public interface ISysNoticeService extends IService<SysNotice> {
|
|||||||
* @param noticeIds 需要删除的公告ID
|
* @param noticeIds 需要删除的公告ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteNoticeByIds(Long[] noticeIds);
|
int deleteNoticeByIds(Long[] noticeIds);
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ import java.util.List;
|
|||||||
/**
|
/**
|
||||||
* 操作日志 服务层
|
* 操作日志 服务层
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
public interface ISysOperLogService extends IService<SysOperLog> {
|
public interface ISysOperLogService extends IService<SysOperLog> {
|
||||||
|
|
||||||
@ -20,7 +20,7 @@ public interface ISysOperLogService extends IService<SysOperLog> {
|
|||||||
*
|
*
|
||||||
* @param operLog 操作日志对象
|
* @param operLog 操作日志对象
|
||||||
*/
|
*/
|
||||||
public void insertOperlog(SysOperLog operLog);
|
void insertOperlog(SysOperLog operLog);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询系统操作日志集合
|
* 查询系统操作日志集合
|
||||||
@ -28,7 +28,7 @@ public interface ISysOperLogService extends IService<SysOperLog> {
|
|||||||
* @param operLog 操作日志对象
|
* @param operLog 操作日志对象
|
||||||
* @return 操作日志集合
|
* @return 操作日志集合
|
||||||
*/
|
*/
|
||||||
public List<SysOperLog> selectOperLogList(SysOperLog operLog);
|
List<SysOperLog> selectOperLogList(SysOperLog operLog);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除系统操作日志
|
* 批量删除系统操作日志
|
||||||
@ -36,7 +36,7 @@ public interface ISysOperLogService extends IService<SysOperLog> {
|
|||||||
* @param operIds 需要删除的操作日志ID
|
* @param operIds 需要删除的操作日志ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteOperLogByIds(Long[] operIds);
|
int deleteOperLogByIds(Long[] operIds);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询操作日志详细
|
* 查询操作日志详细
|
||||||
@ -44,10 +44,10 @@ public interface ISysOperLogService extends IService<SysOperLog> {
|
|||||||
* @param operId 操作ID
|
* @param operId 操作ID
|
||||||
* @return 操作日志对象
|
* @return 操作日志对象
|
||||||
*/
|
*/
|
||||||
public SysOperLog selectOperLogById(Long operId);
|
SysOperLog selectOperLogById(Long operId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 清空操作日志
|
* 清空操作日志
|
||||||
*/
|
*/
|
||||||
public void cleanOperLog();
|
void cleanOperLog();
|
||||||
}
|
}
|
||||||
|
@ -30,6 +30,7 @@ public interface ISysOssConfigService extends IServicePlus<SysOssConfig, SysOssC
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据新增业务对象插入对象存储配置
|
* 根据新增业务对象插入对象存储配置
|
||||||
|
*
|
||||||
* @param bo 对象存储配置新增业务对象
|
* @param bo 对象存储配置新增业务对象
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -37,6 +38,7 @@ public interface ISysOssConfigService extends IServicePlus<SysOssConfig, SysOssC
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据编辑业务对象修改对象存储配置
|
* 根据编辑业务对象修改对象存储配置
|
||||||
|
*
|
||||||
* @param bo 对象存储配置编辑业务对象
|
* @param bo 对象存储配置编辑业务对象
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -44,6 +46,7 @@ public interface ISysOssConfigService extends IServicePlus<SysOssConfig, SysOssC
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验并删除数据
|
* 校验并删除数据
|
||||||
|
*
|
||||||
* @param ids 主键集合
|
* @param ids 主键集合
|
||||||
* @param isValid 是否校验,true-删除前校验,false-不校验
|
* @param isValid 是否校验,true-删除前校验,false-不校验
|
||||||
* @return
|
* @return
|
||||||
|
@ -9,7 +9,7 @@ import java.util.List;
|
|||||||
/**
|
/**
|
||||||
* 岗位信息 服务层
|
* 岗位信息 服务层
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
public interface ISysPostService extends IService<SysPost> {
|
public interface ISysPostService extends IService<SysPost> {
|
||||||
|
|
||||||
@ -22,14 +22,14 @@ public interface ISysPostService extends IService<SysPost> {
|
|||||||
* @param post 岗位信息
|
* @param post 岗位信息
|
||||||
* @return 岗位列表
|
* @return 岗位列表
|
||||||
*/
|
*/
|
||||||
public List<SysPost> selectPostList(SysPost post);
|
List<SysPost> selectPostList(SysPost post);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询所有岗位
|
* 查询所有岗位
|
||||||
*
|
*
|
||||||
* @return 岗位列表
|
* @return 岗位列表
|
||||||
*/
|
*/
|
||||||
public List<SysPost> selectPostAll();
|
List<SysPost> selectPostAll();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过岗位ID查询岗位信息
|
* 通过岗位ID查询岗位信息
|
||||||
@ -37,7 +37,7 @@ public interface ISysPostService extends IService<SysPost> {
|
|||||||
* @param postId 岗位ID
|
* @param postId 岗位ID
|
||||||
* @return 角色对象信息
|
* @return 角色对象信息
|
||||||
*/
|
*/
|
||||||
public SysPost selectPostById(Long postId);
|
SysPost selectPostById(Long postId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户ID获取岗位选择框列表
|
* 根据用户ID获取岗位选择框列表
|
||||||
@ -45,7 +45,7 @@ public interface ISysPostService extends IService<SysPost> {
|
|||||||
* @param userId 用户ID
|
* @param userId 用户ID
|
||||||
* @return 选中岗位ID列表
|
* @return 选中岗位ID列表
|
||||||
*/
|
*/
|
||||||
public List<Integer> selectPostListByUserId(Long userId);
|
List<Integer> selectPostListByUserId(Long userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验岗位名称
|
* 校验岗位名称
|
||||||
@ -53,7 +53,7 @@ public interface ISysPostService extends IService<SysPost> {
|
|||||||
* @param post 岗位信息
|
* @param post 岗位信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public String checkPostNameUnique(SysPost post);
|
String checkPostNameUnique(SysPost post);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验岗位编码
|
* 校验岗位编码
|
||||||
@ -61,7 +61,7 @@ public interface ISysPostService extends IService<SysPost> {
|
|||||||
* @param post 岗位信息
|
* @param post 岗位信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public String checkPostCodeUnique(SysPost post);
|
String checkPostCodeUnique(SysPost post);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过岗位ID查询岗位使用数量
|
* 通过岗位ID查询岗位使用数量
|
||||||
@ -69,7 +69,7 @@ public interface ISysPostService extends IService<SysPost> {
|
|||||||
* @param postId 岗位ID
|
* @param postId 岗位ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public long countUserPostById(Long postId);
|
long countUserPostById(Long postId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除岗位信息
|
* 删除岗位信息
|
||||||
@ -77,7 +77,7 @@ public interface ISysPostService extends IService<SysPost> {
|
|||||||
* @param postId 岗位ID
|
* @param postId 岗位ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deletePostById(Long postId);
|
int deletePostById(Long postId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除岗位信息
|
* 批量删除岗位信息
|
||||||
@ -86,7 +86,7 @@ public interface ISysPostService extends IService<SysPost> {
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
* @throws Exception 异常
|
* @throws Exception 异常
|
||||||
*/
|
*/
|
||||||
public int deletePostByIds(Long[] postIds);
|
int deletePostByIds(Long[] postIds);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增保存岗位信息
|
* 新增保存岗位信息
|
||||||
@ -94,7 +94,7 @@ public interface ISysPostService extends IService<SysPost> {
|
|||||||
* @param post 岗位信息
|
* @param post 岗位信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertPost(SysPost post);
|
int insertPost(SysPost post);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改保存岗位信息
|
* 修改保存岗位信息
|
||||||
@ -102,5 +102,5 @@ public interface ISysPostService extends IService<SysPost> {
|
|||||||
* @param post 岗位信息
|
* @param post 岗位信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updatePost(SysPost post);
|
int updatePost(SysPost post);
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ import java.util.Set;
|
|||||||
/**
|
/**
|
||||||
* 角色业务层
|
* 角色业务层
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
public interface ISysRoleService extends IService<SysRole> {
|
public interface ISysRoleService extends IService<SysRole> {
|
||||||
|
|
||||||
@ -24,7 +24,7 @@ public interface ISysRoleService extends IService<SysRole> {
|
|||||||
* @param role 角色信息
|
* @param role 角色信息
|
||||||
* @return 角色数据集合信息
|
* @return 角色数据集合信息
|
||||||
*/
|
*/
|
||||||
public List<SysRole> selectRoleList(SysRole role);
|
List<SysRole> selectRoleList(SysRole role);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户ID查询角色列表
|
* 根据用户ID查询角色列表
|
||||||
@ -32,7 +32,7 @@ public interface ISysRoleService extends IService<SysRole> {
|
|||||||
* @param userId 用户ID
|
* @param userId 用户ID
|
||||||
* @return 角色列表
|
* @return 角色列表
|
||||||
*/
|
*/
|
||||||
public List<SysRole> selectRolesByUserId(Long userId);
|
List<SysRole> selectRolesByUserId(Long userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户ID查询角色权限
|
* 根据用户ID查询角色权限
|
||||||
@ -40,14 +40,14 @@ public interface ISysRoleService extends IService<SysRole> {
|
|||||||
* @param userId 用户ID
|
* @param userId 用户ID
|
||||||
* @return 权限列表
|
* @return 权限列表
|
||||||
*/
|
*/
|
||||||
public Set<String> selectRolePermissionByUserId(Long userId);
|
Set<String> selectRolePermissionByUserId(Long userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询所有角色
|
* 查询所有角色
|
||||||
*
|
*
|
||||||
* @return 角色列表
|
* @return 角色列表
|
||||||
*/
|
*/
|
||||||
public List<SysRole> selectRoleAll();
|
List<SysRole> selectRoleAll();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户ID获取角色选择框列表
|
* 根据用户ID获取角色选择框列表
|
||||||
@ -55,7 +55,7 @@ public interface ISysRoleService extends IService<SysRole> {
|
|||||||
* @param userId 用户ID
|
* @param userId 用户ID
|
||||||
* @return 选中角色ID列表
|
* @return 选中角色ID列表
|
||||||
*/
|
*/
|
||||||
public List<Integer> selectRoleListByUserId(Long userId);
|
List<Integer> selectRoleListByUserId(Long userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过角色ID查询角色
|
* 通过角色ID查询角色
|
||||||
@ -63,7 +63,7 @@ public interface ISysRoleService extends IService<SysRole> {
|
|||||||
* @param roleId 角色ID
|
* @param roleId 角色ID
|
||||||
* @return 角色对象信息
|
* @return 角色对象信息
|
||||||
*/
|
*/
|
||||||
public SysRole selectRoleById(Long roleId);
|
SysRole selectRoleById(Long roleId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验角色名称是否唯一
|
* 校验角色名称是否唯一
|
||||||
@ -71,7 +71,7 @@ public interface ISysRoleService extends IService<SysRole> {
|
|||||||
* @param role 角色信息
|
* @param role 角色信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public String checkRoleNameUnique(SysRole role);
|
String checkRoleNameUnique(SysRole role);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验角色权限是否唯一
|
* 校验角色权限是否唯一
|
||||||
@ -79,21 +79,21 @@ public interface ISysRoleService extends IService<SysRole> {
|
|||||||
* @param role 角色信息
|
* @param role 角色信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public String checkRoleKeyUnique(SysRole role);
|
String checkRoleKeyUnique(SysRole role);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验角色是否允许操作
|
* 校验角色是否允许操作
|
||||||
*
|
*
|
||||||
* @param role 角色信息
|
* @param role 角色信息
|
||||||
*/
|
*/
|
||||||
public void checkRoleAllowed(SysRole role);
|
void checkRoleAllowed(SysRole role);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验角色是否有数据权限
|
* 校验角色是否有数据权限
|
||||||
*
|
*
|
||||||
* @param roleId 角色id
|
* @param roleId 角色id
|
||||||
*/
|
*/
|
||||||
public void checkRoleDataScope(Long roleId);
|
void checkRoleDataScope(Long roleId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过角色ID查询角色使用数量
|
* 通过角色ID查询角色使用数量
|
||||||
@ -101,7 +101,7 @@ public interface ISysRoleService extends IService<SysRole> {
|
|||||||
* @param roleId 角色ID
|
* @param roleId 角色ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public long countUserRoleByRoleId(Long roleId);
|
long countUserRoleByRoleId(Long roleId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增保存角色信息
|
* 新增保存角色信息
|
||||||
@ -109,7 +109,7 @@ public interface ISysRoleService extends IService<SysRole> {
|
|||||||
* @param role 角色信息
|
* @param role 角色信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertRole(SysRole role);
|
int insertRole(SysRole role);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改保存角色信息
|
* 修改保存角色信息
|
||||||
@ -117,7 +117,7 @@ public interface ISysRoleService extends IService<SysRole> {
|
|||||||
* @param role 角色信息
|
* @param role 角色信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateRole(SysRole role);
|
int updateRole(SysRole role);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改角色状态
|
* 修改角色状态
|
||||||
@ -125,7 +125,7 @@ public interface ISysRoleService extends IService<SysRole> {
|
|||||||
* @param role 角色信息
|
* @param role 角色信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateRoleStatus(SysRole role);
|
int updateRoleStatus(SysRole role);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改数据权限信息
|
* 修改数据权限信息
|
||||||
@ -133,7 +133,7 @@ public interface ISysRoleService extends IService<SysRole> {
|
|||||||
* @param role 角色信息
|
* @param role 角色信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int authDataScope(SysRole role);
|
int authDataScope(SysRole role);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过角色ID删除角色
|
* 通过角色ID删除角色
|
||||||
@ -141,7 +141,7 @@ public interface ISysRoleService extends IService<SysRole> {
|
|||||||
* @param roleId 角色ID
|
* @param roleId 角色ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteRoleById(Long roleId);
|
int deleteRoleById(Long roleId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除角色信息
|
* 批量删除角色信息
|
||||||
@ -149,7 +149,7 @@ public interface ISysRoleService extends IService<SysRole> {
|
|||||||
* @param roleIds 需要删除的角色ID
|
* @param roleIds 需要删除的角色ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteRoleByIds(Long[] roleIds);
|
int deleteRoleByIds(Long[] roleIds);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 取消授权用户角色
|
* 取消授权用户角色
|
||||||
@ -157,7 +157,7 @@ public interface ISysRoleService extends IService<SysRole> {
|
|||||||
* @param userRole 用户和角色关联信息
|
* @param userRole 用户和角色关联信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteAuthUser(SysUserRole userRole);
|
int deleteAuthUser(SysUserRole userRole);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量取消授权用户角色
|
* 批量取消授权用户角色
|
||||||
@ -166,7 +166,7 @@ public interface ISysRoleService extends IService<SysRole> {
|
|||||||
* @param userIds 需要取消授权的用户数据ID
|
* @param userIds 需要取消授权的用户数据ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteAuthUsers(Long roleId, Long[] userIds);
|
int deleteAuthUsers(Long roleId, Long[] userIds);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量选择授权用户角色
|
* 批量选择授权用户角色
|
||||||
@ -175,5 +175,5 @@ public interface ISysRoleService extends IService<SysRole> {
|
|||||||
* @param userIds 需要删除的用户数据ID
|
* @param userIds 需要删除的用户数据ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertAuthUsers(Long roleId, Long[] userIds);
|
int insertAuthUsers(Long roleId, Long[] userIds);
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ import com.ruoyi.system.domain.SysUserOnline;
|
|||||||
/**
|
/**
|
||||||
* 在线用户 服务层
|
* 在线用户 服务层
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
public interface ISysUserOnlineService {
|
public interface ISysUserOnlineService {
|
||||||
/**
|
/**
|
||||||
@ -16,7 +16,7 @@ public interface ISysUserOnlineService {
|
|||||||
* @param user 用户信息
|
* @param user 用户信息
|
||||||
* @return 在线用户信息
|
* @return 在线用户信息
|
||||||
*/
|
*/
|
||||||
public SysUserOnline selectOnlineByIpaddr(String ipaddr, LoginUser user);
|
SysUserOnline selectOnlineByIpaddr(String ipaddr, LoginUser user);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过用户名称查询信息
|
* 通过用户名称查询信息
|
||||||
@ -25,7 +25,7 @@ public interface ISysUserOnlineService {
|
|||||||
* @param user 用户信息
|
* @param user 用户信息
|
||||||
* @return 在线用户信息
|
* @return 在线用户信息
|
||||||
*/
|
*/
|
||||||
public SysUserOnline selectOnlineByUserName(String userName, LoginUser user);
|
SysUserOnline selectOnlineByUserName(String userName, LoginUser user);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过登录地址/用户名称查询信息
|
* 通过登录地址/用户名称查询信息
|
||||||
@ -35,7 +35,7 @@ public interface ISysUserOnlineService {
|
|||||||
* @param user 用户信息
|
* @param user 用户信息
|
||||||
* @return 在线用户信息
|
* @return 在线用户信息
|
||||||
*/
|
*/
|
||||||
public SysUserOnline selectOnlineByInfo(String ipaddr, String userName, LoginUser user);
|
SysUserOnline selectOnlineByInfo(String ipaddr, String userName, LoginUser user);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置在线用户信息
|
* 设置在线用户信息
|
||||||
@ -43,5 +43,5 @@ public interface ISysUserOnlineService {
|
|||||||
* @param user 用户信息
|
* @param user 用户信息
|
||||||
* @return 在线用户
|
* @return 在线用户
|
||||||
*/
|
*/
|
||||||
public SysUserOnline loginUserToUserOnline(LoginUser user);
|
SysUserOnline loginUserToUserOnline(LoginUser user);
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ import java.util.List;
|
|||||||
/**
|
/**
|
||||||
* 用户 业务层
|
* 用户 业务层
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
public interface ISysUserService extends IService<SysUser> {
|
public interface ISysUserService extends IService<SysUser> {
|
||||||
|
|
||||||
@ -22,7 +22,7 @@ public interface ISysUserService extends IService<SysUser> {
|
|||||||
* @param user 用户信息
|
* @param user 用户信息
|
||||||
* @return 用户信息集合信息
|
* @return 用户信息集合信息
|
||||||
*/
|
*/
|
||||||
public List<SysUser> selectUserList(SysUser user);
|
List<SysUser> selectUserList(SysUser user);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据条件分页查询已分配用户角色列表
|
* 根据条件分页查询已分配用户角色列表
|
||||||
@ -30,7 +30,7 @@ public interface ISysUserService extends IService<SysUser> {
|
|||||||
* @param user 用户信息
|
* @param user 用户信息
|
||||||
* @return 用户信息集合信息
|
* @return 用户信息集合信息
|
||||||
*/
|
*/
|
||||||
public TableDataInfo<SysUser> selectAllocatedList(SysUser user);
|
TableDataInfo<SysUser> selectAllocatedList(SysUser user);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据条件分页查询未分配用户角色列表
|
* 根据条件分页查询未分配用户角色列表
|
||||||
@ -38,7 +38,7 @@ public interface ISysUserService extends IService<SysUser> {
|
|||||||
* @param user 用户信息
|
* @param user 用户信息
|
||||||
* @return 用户信息集合信息
|
* @return 用户信息集合信息
|
||||||
*/
|
*/
|
||||||
public TableDataInfo<SysUser> selectUnallocatedList(SysUser user);
|
TableDataInfo<SysUser> selectUnallocatedList(SysUser user);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过用户名查询用户
|
* 通过用户名查询用户
|
||||||
@ -46,7 +46,7 @@ public interface ISysUserService extends IService<SysUser> {
|
|||||||
* @param userName 用户名
|
* @param userName 用户名
|
||||||
* @return 用户对象信息
|
* @return 用户对象信息
|
||||||
*/
|
*/
|
||||||
public SysUser selectUserByUserName(String userName);
|
SysUser selectUserByUserName(String userName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过用户ID查询用户
|
* 通过用户ID查询用户
|
||||||
@ -54,7 +54,7 @@ public interface ISysUserService extends IService<SysUser> {
|
|||||||
* @param userId 用户ID
|
* @param userId 用户ID
|
||||||
* @return 用户对象信息
|
* @return 用户对象信息
|
||||||
*/
|
*/
|
||||||
public SysUser selectUserById(Long userId);
|
SysUser selectUserById(Long userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户ID查询用户所属角色组
|
* 根据用户ID查询用户所属角色组
|
||||||
@ -62,7 +62,7 @@ public interface ISysUserService extends IService<SysUser> {
|
|||||||
* @param userName 用户名
|
* @param userName 用户名
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public String selectUserRoleGroup(String userName);
|
String selectUserRoleGroup(String userName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户ID查询用户所属岗位组
|
* 根据用户ID查询用户所属岗位组
|
||||||
@ -70,7 +70,7 @@ public interface ISysUserService extends IService<SysUser> {
|
|||||||
* @param userName 用户名
|
* @param userName 用户名
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public String selectUserPostGroup(String userName);
|
String selectUserPostGroup(String userName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验用户名称是否唯一
|
* 校验用户名称是否唯一
|
||||||
@ -78,7 +78,7 @@ public interface ISysUserService extends IService<SysUser> {
|
|||||||
* @param userName 用户名称
|
* @param userName 用户名称
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public String checkUserNameUnique(String userName);
|
String checkUserNameUnique(String userName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验手机号码是否唯一
|
* 校验手机号码是否唯一
|
||||||
@ -86,7 +86,7 @@ public interface ISysUserService extends IService<SysUser> {
|
|||||||
* @param user 用户信息
|
* @param user 用户信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public String checkPhoneUnique(SysUser user);
|
String checkPhoneUnique(SysUser user);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验email是否唯一
|
* 校验email是否唯一
|
||||||
@ -94,21 +94,21 @@ public interface ISysUserService extends IService<SysUser> {
|
|||||||
* @param user 用户信息
|
* @param user 用户信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public String checkEmailUnique(SysUser user);
|
String checkEmailUnique(SysUser user);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验用户是否允许操作
|
* 校验用户是否允许操作
|
||||||
*
|
*
|
||||||
* @param user 用户信息
|
* @param user 用户信息
|
||||||
*/
|
*/
|
||||||
public void checkUserAllowed(SysUser user);
|
void checkUserAllowed(SysUser user);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验用户是否有数据权限
|
* 校验用户是否有数据权限
|
||||||
*
|
*
|
||||||
* @param userId 用户id
|
* @param userId 用户id
|
||||||
*/
|
*/
|
||||||
public void checkUserDataScope(Long userId);
|
void checkUserDataScope(Long userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增用户信息
|
* 新增用户信息
|
||||||
@ -116,7 +116,7 @@ public interface ISysUserService extends IService<SysUser> {
|
|||||||
* @param user 用户信息
|
* @param user 用户信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertUser(SysUser user);
|
int insertUser(SysUser user);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 注册用户信息
|
* 注册用户信息
|
||||||
@ -124,7 +124,7 @@ public interface ISysUserService extends IService<SysUser> {
|
|||||||
* @param user 用户信息
|
* @param user 用户信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public boolean registerUser(SysUser user);
|
boolean registerUser(SysUser user);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改用户信息
|
* 修改用户信息
|
||||||
@ -132,7 +132,7 @@ public interface ISysUserService extends IService<SysUser> {
|
|||||||
* @param user 用户信息
|
* @param user 用户信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateUser(SysUser user);
|
int updateUser(SysUser user);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户授权角色
|
* 用户授权角色
|
||||||
@ -140,7 +140,7 @@ public interface ISysUserService extends IService<SysUser> {
|
|||||||
* @param userId 用户ID
|
* @param userId 用户ID
|
||||||
* @param roleIds 角色组
|
* @param roleIds 角色组
|
||||||
*/
|
*/
|
||||||
public void insertUserAuth(Long userId, Long[] roleIds);
|
void insertUserAuth(Long userId, Long[] roleIds);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改用户状态
|
* 修改用户状态
|
||||||
@ -148,7 +148,7 @@ public interface ISysUserService extends IService<SysUser> {
|
|||||||
* @param user 用户信息
|
* @param user 用户信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateUserStatus(SysUser user);
|
int updateUserStatus(SysUser user);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改用户基本信息
|
* 修改用户基本信息
|
||||||
@ -156,7 +156,7 @@ public interface ISysUserService extends IService<SysUser> {
|
|||||||
* @param user 用户信息
|
* @param user 用户信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateUserProfile(SysUser user);
|
int updateUserProfile(SysUser user);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改用户头像
|
* 修改用户头像
|
||||||
@ -165,7 +165,7 @@ public interface ISysUserService extends IService<SysUser> {
|
|||||||
* @param avatar 头像地址
|
* @param avatar 头像地址
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public boolean updateUserAvatar(String userName, String avatar);
|
boolean updateUserAvatar(String userName, String avatar);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 重置用户密码
|
* 重置用户密码
|
||||||
@ -173,7 +173,7 @@ public interface ISysUserService extends IService<SysUser> {
|
|||||||
* @param user 用户信息
|
* @param user 用户信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int resetPwd(SysUser user);
|
int resetPwd(SysUser user);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 重置用户密码
|
* 重置用户密码
|
||||||
@ -182,7 +182,7 @@ public interface ISysUserService extends IService<SysUser> {
|
|||||||
* @param password 密码
|
* @param password 密码
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int resetUserPwd(String userName, String password);
|
int resetUserPwd(String userName, String password);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过用户ID删除用户
|
* 通过用户ID删除用户
|
||||||
@ -190,7 +190,7 @@ public interface ISysUserService extends IService<SysUser> {
|
|||||||
* @param userId 用户ID
|
* @param userId 用户ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteUserById(Long userId);
|
int deleteUserById(Long userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除用户信息
|
* 批量删除用户信息
|
||||||
@ -198,7 +198,7 @@ public interface ISysUserService extends IService<SysUser> {
|
|||||||
* @param userIds 需要删除的用户ID
|
* @param userIds 需要删除的用户ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteUserByIds(Long[] userIds);
|
int deleteUserByIds(Long[] userIds);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导入用户数据
|
* 导入用户数据
|
||||||
@ -208,5 +208,5 @@ public interface ISysUserService extends IService<SysUser> {
|
|||||||
* @param operName 操作用户
|
* @param operName 操作用户
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName);
|
String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName);
|
||||||
}
|
}
|
||||||
|
@ -26,10 +26,11 @@ import javax.servlet.http.HttpServletRequest;
|
|||||||
/**
|
/**
|
||||||
* 登录校验方法
|
* 登录校验方法
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class SysLoginService {
|
public class SysLoginService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private TokenService tokenService;
|
private TokenService tokenService;
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ import org.springframework.stereotype.Service;
|
|||||||
/**
|
/**
|
||||||
* 注册校验方法
|
* 注册校验方法
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class SysRegisterService {
|
public class SysRegisterService {
|
||||||
|
@ -26,7 +26,7 @@ import java.util.Map;
|
|||||||
/**
|
/**
|
||||||
* 参数配置 服务层实现
|
* 参数配置 服务层实现
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class SysConfigServiceImpl extends ServicePlusImpl<SysConfigMapper, SysConfig, SysConfig> implements ISysConfigService {
|
public class SysConfigServiceImpl extends ServicePlusImpl<SysConfigMapper, SysConfig, SysConfig> implements ISysConfigService {
|
||||||
|
@ -29,7 +29,7 @@ import java.util.stream.Collectors;
|
|||||||
/**
|
/**
|
||||||
* 部门管理 服务实现
|
* 部门管理 服务实现
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class SysDeptServiceImpl extends ServicePlusImpl<SysDeptMapper, SysDept, SysDept> implements ISysDeptService {
|
public class SysDeptServiceImpl extends ServicePlusImpl<SysDeptMapper, SysDept, SysDept> implements ISysDeptService {
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
package com.ruoyi.system.service.impl;
|
package com.ruoyi.system.service.impl;
|
||||||
|
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.ruoyi.common.core.domain.entity.SysDictData;
|
import com.ruoyi.common.core.domain.entity.SysDictData;
|
||||||
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
|
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
import com.ruoyi.common.utils.DictUtils;
|
import com.ruoyi.common.utils.DictUtils;
|
||||||
import com.ruoyi.common.utils.PageUtils;
|
import com.ruoyi.common.utils.PageUtils;
|
||||||
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.ruoyi.system.mapper.SysDictDataMapper;
|
import com.ruoyi.system.mapper.SysDictDataMapper;
|
||||||
import com.ruoyi.system.service.ISysDictDataService;
|
import com.ruoyi.system.service.ISysDictDataService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -16,7 +16,7 @@ import java.util.List;
|
|||||||
/**
|
/**
|
||||||
* 字典 业务层处理
|
* 字典 业务层处理
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class SysDictDataServiceImpl extends ServicePlusImpl<SysDictDataMapper, SysDictData, SysDictData> implements ISysDictDataService {
|
public class SysDictDataServiceImpl extends ServicePlusImpl<SysDictDataMapper, SysDictData, SysDictData> implements ISysDictDataService {
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package com.ruoyi.system.service.impl;
|
package com.ruoyi.system.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.ruoyi.common.constant.UserConstants;
|
import com.ruoyi.common.constant.UserConstants;
|
||||||
@ -12,6 +11,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
|||||||
import com.ruoyi.common.exception.ServiceException;
|
import com.ruoyi.common.exception.ServiceException;
|
||||||
import com.ruoyi.common.utils.DictUtils;
|
import com.ruoyi.common.utils.DictUtils;
|
||||||
import com.ruoyi.common.utils.PageUtils;
|
import com.ruoyi.common.utils.PageUtils;
|
||||||
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.ruoyi.system.mapper.SysDictDataMapper;
|
import com.ruoyi.system.mapper.SysDictDataMapper;
|
||||||
import com.ruoyi.system.mapper.SysDictTypeMapper;
|
import com.ruoyi.system.mapper.SysDictTypeMapper;
|
||||||
import com.ruoyi.system.service.ISysDictTypeService;
|
import com.ruoyi.system.service.ISysDictTypeService;
|
||||||
@ -27,7 +27,7 @@ import java.util.Map;
|
|||||||
/**
|
/**
|
||||||
* 字典 业务层处理
|
* 字典 业务层处理
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class SysDictTypeServiceImpl extends ServicePlusImpl<SysDictTypeMapper, SysDictType, SysDictType> implements ISysDictTypeService {
|
public class SysDictTypeServiceImpl extends ServicePlusImpl<SysDictTypeMapper, SysDictType, SysDictType> implements ISysDictTypeService {
|
||||||
|
@ -27,7 +27,7 @@ import java.util.Map;
|
|||||||
/**
|
/**
|
||||||
* 系统访问日志情况信息 服务层处理
|
* 系统访问日志情况信息 服务层处理
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
|
@ -26,11 +26,10 @@ import java.util.stream.Collectors;
|
|||||||
/**
|
/**
|
||||||
* 菜单 业务层处理
|
* 菜单 业务层处理
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class SysMenuServiceImpl extends ServicePlusImpl<SysMenuMapper, SysMenu, SysMenu> implements ISysMenuService {
|
public class SysMenuServiceImpl extends ServicePlusImpl<SysMenuMapper, SysMenu, SysMenu> implements ISysMenuService {
|
||||||
public static final String PREMISSION_STRING = "perms[\"{0}\"]";
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysRoleMapper roleMapper;
|
private SysRoleMapper roleMapper;
|
||||||
@ -137,7 +136,7 @@ public class SysMenuServiceImpl extends ServicePlusImpl<SysMenuMapper, SysMenu,
|
|||||||
router.setComponent(getComponent(menu));
|
router.setComponent(getComponent(menu));
|
||||||
router.setQuery(menu.getQuery());
|
router.setQuery(menu.getQuery());
|
||||||
router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()), menu.getPath()));
|
router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()), menu.getPath()));
|
||||||
List<SysMenu> cMenus = menu.getChildren();
|
List<SysMenu> cMenus = (List<SysMenu>) menu.getChildren();
|
||||||
if (!cMenus.isEmpty() && UserConstants.TYPE_DIR.equals(menu.getMenuType())) {
|
if (!cMenus.isEmpty() && UserConstants.TYPE_DIR.equals(menu.getMenuType())) {
|
||||||
router.setAlwaysShow(true);
|
router.setAlwaysShow(true);
|
||||||
router.setRedirect("noRedirect");
|
router.setRedirect("noRedirect");
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user