添加多租户插件

master
hshansha 7 months ago
parent 802c2ddc2e
commit caa85ffee4

@ -5,7 +5,7 @@
<parent>
<artifactId>ruoyi-flowable-plus</artifactId>
<groupId>com.ruoyi</groupId>
<version>0.8.3</version>
<version>0.8.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
@ -21,6 +21,7 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional> <!-- 表示依赖不会传递 -->
</dependency>
@ -66,6 +67,11 @@
<artifactId>ruoyi-oss</artifactId>
</dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-sms</artifactId>
</dependency>
<!-- 代码生成-->
<dependency>
<groupId>com.ruoyi</groupId>
@ -78,6 +84,7 @@
<artifactId>ruoyi-demo</artifactId>
</dependency>
<!-- flowable模块-->
<dependency>
<groupId>com.ruoyi</groupId>
@ -105,7 +112,7 @@
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<finalName>pay</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>

@ -3,6 +3,7 @@ package com.ruoyi;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup;
import org.springframework.scheduling.annotation.EnableScheduling;
/**
*
@ -11,6 +12,7 @@ import org.springframework.boot.context.metrics.buffering.BufferingApplicationSt
*/
@SpringBootApplication
@EnableScheduling
public class RuoYiApplication {
public static void main(String[] args) {

@ -4,21 +4,16 @@ import cn.dev33.satoken.annotation.SaIgnore;
import cn.hutool.captcha.AbstractCaptcha;
import cn.hutool.captcha.generator.CodeGenerator;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.RandomUtil;
import com.ruoyi.common.constant.CacheConstants;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.enums.CaptchaType;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.email.MailUtils;
import com.ruoyi.common.utils.redis.RedisUtils;
import com.ruoyi.common.utils.reflect.ReflectUtils;
import com.ruoyi.common.utils.spring.SpringUtils;
import com.ruoyi.framework.config.properties.CaptchaProperties;
import com.ruoyi.framework.config.properties.MailProperties;
import com.ruoyi.sms.config.properties.SmsProperties;
import com.ruoyi.sms.core.SmsTemplate;
import com.ruoyi.sms.entity.SmsResult;
import com.ruoyi.system.service.ISysConfigService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@ -49,7 +44,6 @@ public class CaptchaController {
private final CaptchaProperties captchaProperties;
private final SmsProperties smsProperties;
private final ISysConfigService configService;
private final MailProperties mailProperties;
/**
*
@ -57,45 +51,33 @@ public class CaptchaController {
* @param phonenumber
*/
@GetMapping("/captchaSms")
public R<Void> smsCaptcha(@NotBlank(message = "{user.phonenumber.not.blank}") String phonenumber) {
if (!smsProperties.getEnabled()) {
public R<Void> smsCaptcha(@NotBlank(message = "{user.phonenumber.not.blank}")
String phonenumber) {
//实际使用时放开
/* if (!smsProperties.getEnabled()) {
return R.fail("当前系统没有开启短信功能!");
}
if (!SpringUtils.containsBean("aliyunSmsTemplate")) {
return R.fail("阿里云依赖未引入!");
}*/
String key = CacheConstants.CAPTCHA_CODE_KEY + phonenumber;
String code = RandomUtil.randomNumbers(4);
//实际使用时注掉这个 放开下面的代码注意修改templateId
String code = "1234";
RedisUtils.setCacheObject(key, code, Duration.ofMinutes(Constants.CAPTCHA_EXPIRATION));
/*String code = RandomUtil.randomNumbers(4);
RedisUtils.setCacheObject(key, code, Duration.ofMinutes(Constants.CAPTCHA_EXPIRATION));
// 验证码模板id 自行处理 (查数据库或写死均可)
String templateId = "";
String templateId = "SMS_206546421"; //自己阿里云设置的模板id
Map<String, String> map = new HashMap<>(1);
map.put("code", code);
SmsTemplate smsTemplate = SpringUtils.getBean(SmsTemplate.class);
//SmsTemplate smsTemplate = SpringUtils.getBean(SmsTemplate.class);
SmsTemplate smsTemplate = SpringUtils.getBean(AliyunSmsTemplate.class);
SmsResult result = smsTemplate.send(phonenumber, templateId, map);
if (!result.isSuccess()) {
log.error("验证码短信发送异常 => {}", result);
return R.fail(result.getMessage());
}
return R.ok();
}
/**
*
*
* @param email
*/
@GetMapping("/captchaEmail")
public R<Void> emailCode(@NotBlank(message = "{user.email.not.blank}") String email) {
if (!mailProperties.getEnabled()) {
return R.fail("当前系统没有开启邮箱功能!");
}
String key = CacheConstants.CAPTCHA_CODE_KEY + email;
String code = RandomUtil.randomNumbers(4);
RedisUtils.setCacheObject(key, code, Duration.ofMinutes(Constants.CAPTCHA_EXPIRATION));
try {
MailUtils.sendText(email, "登录验证码", "您本次验证码为:" + code + ",有效性为" + Constants.CAPTCHA_EXPIRATION + "分钟,请尽快填写。");
} catch (Exception e) {
log.error("验证码短信发送异常 => {}", e.getMessage());
return R.fail(e.getMessage());
}
}*/
return R.ok();
}

@ -33,6 +33,7 @@ public class CacheController {
private final static List<SysCache> CACHES = new ArrayList<>();
static {
CACHES.add(new SysCache(CacheConstants.LOGIN_TOKEN_KEY, "用户信息"));
CACHES.add(new SysCache(CacheConstants.ONLINE_TOKEN_KEY, "在线用户"));
CACHES.add(new SysCache(CacheNames.SYS_CONFIG, "配置信息"));
CACHES.add(new SysCache(CacheNames.SYS_DICT, "数据字典"));

@ -45,7 +45,7 @@ public class SysUserOnlineController extends BaseController {
List<String> keys = StpUtil.searchTokenValue("", 0, -1, false);
List<UserOnlineDTO> userOnlineDTOList = new ArrayList<>();
for (String key : keys) {
String token = StringUtils.substringAfterLast(key, ":");
String token = key.replace(CacheConstants.LOGIN_TOKEN_KEY, "");
// 如果已经过期则跳过
if (StpUtil.stpLogic.getTokenActivityTimeoutByToken(token) < -1) {
continue;

@ -37,7 +37,7 @@ public class SysDictDataController extends BaseController {
/**
*
*/
@SaCheckPermission("system:dict:list")
// @SaCheckPermission("system:dict:list")
@GetMapping("/list")
public TableDataInfo<SysDictData> list(SysDictData dictData, PageQuery pageQuery) {
return dictDataService.selectPageDictDataList(dictData, pageQuery);

@ -5,12 +5,13 @@ import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.domain.entity.SysMenu;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.EmailLoginBody;
import com.ruoyi.common.core.domain.model.LoginBody;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.core.domain.model.SmsLoginBody;
import com.ruoyi.common.core.service.DictService;
import com.ruoyi.common.helper.LoginHelper;
import com.ruoyi.system.domain.vo.RouterVo;
import com.ruoyi.system.mapper.SysUserMapper;
import com.ruoyi.system.service.ISysMenuService;
import com.ruoyi.system.service.ISysUserService;
import com.ruoyi.system.service.SysLoginService;
@ -22,9 +23,8 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.constraints.NotBlank;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.text.ParseException;
import java.util.*;
/**
*
@ -39,7 +39,9 @@ public class SysLoginController {
private final SysLoginService loginService;
private final ISysMenuService menuService;
private final ISysUserService userService;
private final SysUserMapper userMapper;
private final DictService dictService;
// private final IAsSubscriptionInfoService iAsSubscriptionInfoService;
/**
*
*
@ -48,17 +50,71 @@ public class SysLoginController {
*/
@SaIgnore
@PostMapping("/login")
public R<Map<String, Object>> login(@Validated @RequestBody LoginBody loginBody) {
/*public R<Map<String, Object>> login(@Validated @RequestBody LoginBody loginBody) throws ParseException {
Map<String, Object> ajax = new HashMap<>();
// 生成令牌
String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(),
loginBody.getUuid());
//除管理员用户外,所有用户根据用户公司拿到到期时间 未到期允许登录 否则不允许登录
String companyName = LoginHelper.getCompanyName();
if(companyName!=null&&companyName!=""){
String expire_time = dictService.getDictValue("expire_time", companyName);
if(expire_time==null||expire_time.equals("")){
// return R.fail("公司没有系统的使用期限,请联系管理员或开发人员!");
}else{
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
int result = format.parse(expire_time).compareTo(new Date());
if(result<0){
return R.fail("系统已到期,请联系管理员或开发人员!");
}
}
}
ajax.put(Constants.TOKEN, token);
return R.ok(ajax);
}*/
public R<Map<String, Object>> login(@Validated @RequestBody LoginBody loginBody) throws ParseException {
Map<String, Object> ajax = new HashMap<>();
// 生成令牌
String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(),
loginBody.getUuid());
//除管理员用户外,所有用户根据用户公司拿到到期时间 未到期允许登录 否则不允许登录
String companyName = LoginHelper.getCompanyName();
Long tenantId = LoginHelper.getTenantId();
/*if(companyName!=null&&companyName!=""){
//查询订阅信息中的结束时间
AsSubscriptionInfoBo bo = new AsSubscriptionInfoBo();
bo.setTenantId(tenantId);
List<AsSubscriptionInfoVo> asSubscriptionInfoVos = iAsSubscriptionInfoService.queryList(bo);
if(asSubscriptionInfoVos!=null&&asSubscriptionInfoVos.size()>0){
AsSubscriptionInfoVo subscriptionInfo = asSubscriptionInfoVos.get(0);
//截止日期不为空并且激活状态为已激活默认0已激活
if(subscriptionInfo.getEndTime()!=null&&subscriptionInfo.getActive().equals("0")){
Date endTime= subscriptionInfo.getEndTime();
Calendar calendar = Calendar.getInstance();
calendar.setTime(endTime);
// 在当前日期上加一天(包含失效日期)
calendar.add(Calendar.DAY_OF_MONTH, 1);
Date expireTime = calendar.getTime();
Date currentTime = new Date();
int result = expireTime.compareTo(currentTime);
if(result<0){
return R.fail("系统已到期,请联系管理员或开发人员!");
}
}else{
return R.fail("公司没有系统的使用权限,请联系管理员或开发人员!");
}
}else{
return R.fail("公司没有订阅信息,请联系管理员或开发人员!");
}
}*/
ajax.put(Constants.TOKEN, token);
return R.ok(ajax);
}
/**
*
* ()
*
* @param smsLoginBody
* @return
@ -73,21 +129,6 @@ public class SysLoginController {
return R.ok(ajax);
}
/**
*
*
* @param body
* @return
*/
@PostMapping("/emailLogin")
public R<Map<String, Object>> emailLogin(@Validated @RequestBody EmailLoginBody body) {
Map<String, Object> ajax = new HashMap<>();
// 生成令牌
String token = loginService.emailLogin(body.getEmail(), body.getEmailCode());
ajax.put(Constants.TOKEN, token);
return R.ok(ajax);
}
/**
* ()
*
@ -123,10 +164,16 @@ public class SysLoginController {
public R<Map<String, Object>> getInfo() {
LoginUser loginUser = LoginHelper.getLoginUser();
SysUser user = userService.selectUserById(loginUser.getUserId());
if ("client".equals(user.getUserType())) {
user.setClientId(userMapper.getClientIdByUserId(user.getUserId()));
} else if ("maintenance".equals(user.getUserType())) {
user.setMaintainerId(userMapper.getMaintainerIdByUserId(user.getUserId()));
}
Map<String, Object> ajax = new HashMap<>();
ajax.put("user", user);
ajax.put("roles", loginUser.getRolePermission());
ajax.put("permissions", loginUser.getMenuPermission());
ajax.put("companyName",LoginHelper.getCompanyName());
return R.ok(ajax);
}

@ -2,7 +2,10 @@ package com.ruoyi.web.controller.system;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.http.HttpException;
import cn.hutool.http.HttpUtil;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.PageQuery;
@ -10,6 +13,11 @@ import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.validate.QueryGroup;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.file.FileUtils;
import com.ruoyi.oss.core.OssClient;
import com.ruoyi.oss.factory.OssFactory;
import com.ruoyi.system.domain.SysOss;
import com.ruoyi.system.domain.bo.SysOssBo;
import com.ruoyi.system.domain.vo.SysOssVo;
import com.ruoyi.system.service.ISysOssService;
@ -72,7 +80,7 @@ public class SysOssController extends BaseController {
@PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
public R<Map<String, String>> upload(@RequestPart("file") MultipartFile file) {
if (ObjectUtil.isNull(file)) {
return R.fail("上传文件不能为空");
throw new ServiceException("上传文件不能为空");
}
SysOssVo oss = iSysOssService.upload(file);
Map<String, String> map = new HashMap<>(2);

@ -1,12 +1,18 @@
package com.ruoyi.web.controller.system;
import cn.dev33.satoken.annotation.SaIgnore;
import cn.dev33.satoken.secure.BCrypt;
import cn.hutool.core.util.ObjectUtil;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.RegisterBody;
import com.ruoyi.system.service.ISysConfigService;
import com.ruoyi.system.service.SysRegisterService;
import com.ruoyi.common.core.service.DictService;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.service.*;
import lombok.RequiredArgsConstructor;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -24,7 +30,11 @@ public class SysRegisterController extends BaseController {
private final SysRegisterService registerService;
private final ISysConfigService configService;
private final ISysRoleService roleService;
private final ISysUserService userService;
private final SysLoginService loginService;
private final DictService dictService;
/**
*
*/
@ -37,4 +47,160 @@ public class SysRegisterController extends BaseController {
registerService.register(user);
return R.ok();
}
//用户注册修改为3步公司注册——》2添加默认角色公司注册成功后系统自动添加——》3添加用户
/**
*
*/
/* @SaIgnore
@PostMapping("/registerGs")
public R<Map<String ,Object>> register1(@Validated(AddGroup.class) @RequestBody AsCompanyBo bo) {
//添加验证 手机号相同或者公司名相同不允许注册
AsCompanyBo queryBo = new AsCompanyBo();
queryBo.setPhone(bo.getPhone());
List<AsCompanyVo> asCompanyVos = iAsCompanyService.queryList(queryBo);
if(asCompanyVos!=null&&asCompanyVos.size()>0){
return new R().fail("手机号已注册");
}
queryBo.setName(bo.getName());
queryBo.setPhone(null);
List<AsCompanyVo> asCompanyVos2 = iAsCompanyService.queryList(queryBo);
if(asCompanyVos2!=null&&asCompanyVos2.size()>0){
return new R().fail("公司名已注册");
}
if(iAsCompanyService.insertByBo(bo)){
//公司注册成功后自动添加3个角色管理员、客户、运维
Long[] adids={1655371202140614657L, 1642699828651147266L, 1642699828651147267L, 1642699828651147268L, 1642699828651147269L, 1642699828651147270L, 1642699828651147271L, 1702576150650126337L, 1642699829787803649L, 1642699829787803650L, 1642699829787803651L, 1642699829787803652L, 1642699829787803653L, 1642699829787803654L, 1702576351469207553L, 1642699830664413186L, 1642699830664413187L, 1642699830664413188L, 1642699830664413189L, 1642699830664413190L, 1655482882922754049L, 1655840316736458753L, 1655448497192230913L, 1654661619136454657L, 1655842888306184194L, 1654661698882756610L, 1654661489897365506L, 1642699830664413191L, 1666004221847199746L, 1702576545644511234L, 1645595648910704641L, 1645314322216816642L, 1645314322216816643L, 1645314322216816644L, 1645314322216816645L, 1645314322216816646L, 1645314322216816647L, 1702576946385092610L, 1658662667209936897L, 1658662667209936898L, 1658662667209936899L, 1658662667209936900L, 1658662667209936901L, 1658662667209936902L, 1701529461713534977L, 1645688918156320769L, 1645688918156320770L, 1645688918156320771L, 1645688918156320772L, 1645688918156320773L, 1645688918156320774L, 1702577106473287681L, 1658662668782800897L, 1658662668782800898L, 1658662668782800899L, 1658662668782800900L, 1658662668782800901L, 1658662668782800902L, 1702577252363763714L, 1647137024584462337L, 1647137024584462338L, 1647137024584462339L, 1647137024584462340L, 1647137024584462341L, 1647137024584462342L, 1661650957882208257L, 1702578000103309314L, 1645688916713480193L, 1645688916713480194L, 1645688916713480195L, 1645688916713480196L, 1645688916713480197L, 1645688916713480198L, 1702578372427481090L, 1642699829523562497L, 1642699829523562498L, 1642699829523562499L, 1642699829523562500L, 1642699829523562501L, 1642699829523562502L, 1702581675269914626L, 1642699828978302977L, 1642699828978302978L, 1642699828978302979L, 1642699828978302980L, 1642699828978302981L, 1642699828978302982L, 1701527993971376129L, 1661257205264498690L, 1661257343563284481L, 1662289656452018177L, 1662289815781044225L, 1662289897637081089L, 1662289992025698306L, 1669951329203130370L, 1645314323366055938L, 1702567199455936513L, 1645314323366055939L, 1645314323366055940L, 1645314323366055941L, 1645314323366055942L, 1645314323366055943L, 1642699830974791687L, 1642699830320480257L, 1642699830320480258L, 1642699830320480259L, 1642699830320480260L, 1642699830320480261L, 1642699830320480262L, 1702582089298051073L, 1642699830031073281L, 1642699830031073282L, 1642699830031073283L, 1642699830031073284L, 1642699830031073285L, 1642699830031073286L, 1644533653729988609L, 1702582246030802945L, 1645597336069488641L, 1645688917699141633L, 1645688917699141634L, 1645688917699141635L, 1645688917699141636L, 1645688917699141637L, 1645688917699141638L, 1702582588248260610L, 1642699829242544129L, 1642699829242544130L, 1642699829242544131L, 1642699829242544132L, 1642699829242544133L, 1642699829242544134L, 1702582422652944386L, 1645688917497815042L, 1645688917497815043L, 1645688917497815044L, 1645688917497815045L, 1645688917497815046L, 1645688917497815047L, 1702582710013100034L, 1645329015545835521L, 1645329015545835522L, 1645329015545835523L, 1645329015545835524L, 1645329015545835525L, 1645329015545835526L, 1702582843756871681L, 1645688917900468225L, 1645688917900468226L, 1645688917900468227L, 1645688917900468228L, 1645688917900468229L, 1645688917900468230L, 1702582979249668098L, 1L, 100L, 1001L, 1002L, 1003L, 1004L, 1005L, 1006L, 1007L, 1702585719430414338L, 101L, 1010L, 1011L, 1012L, 1013L, 1702585850393362434L};
Long[] khids={1655371202140614657L, 1642699828651147266L, 1642699828651147268L, 1642699830664413186L, 1642699830664413187L, 1642699830664413188L, 1642699830664413189L, 1642699830664413190L, 1655482882922754049L, 1655840316736458753L, 1655842888306184194L, 1654661489897365506L, 1702576545644511234L, 1661257205264498690L, 1661257343563284481L, 1662289656452018177L, 1662289815781044225L, 1662289897637081089L, 1662289992025698306L, 1669951329203130370L};
Long[] wxids = {1702576150650126337L, 1642699829787803649L, 1642699829787803650L, 1642699829787803651L, 1642699829787803652L, 1642699829787803653L, 1642699829787803654L, 1642699830664413186L, 1642699830664413187L, 1642699830664413188L, 1642699830664413189L, 1642699830664413190L, 1655482882922754049L, 1655840316736458753L, 1655448497192230913L, 1654661619136454657L, 1655842888306184194L, 1654661698882756610L, 1654661489897365506L, 1642699830664413191L, 1702576545644511234L, 1702576946385092610L, 1701529461713534977L, 1702577106473287681L, 1702577252363763714L, 1702578372427481090L, 1702581675269914626L, 1701527993971376129L, 1661257205264498690L, 1661257343563284481L, 1662289656452018177L, 1662289815781044225L, 1662289897637081089L, 1662289992025698306L, 1669951329203130370L};
SysRole role1 = new SysRole();
role1.setRoleKey("companyAdmin");
role1.setRoleName("公司管理员");
role1.setTenantId(bo.getId());
role1.setStatus("0");
role1.setRoleSort(0);
role1.setMenuCheckStrictly(false);
role1.setDeptCheckStrictly(true);
role1.setFlag(false);
role1.setMenuIds(adids);
SysRole role2 = new SysRole();
role2.setRoleKey("client");
role2.setRoleName("客户");
role2.setTenantId(bo.getId());
role2.setStatus("0");
role2.setRoleSort(0);
role2.setMenuCheckStrictly(false);
role2.setDeptCheckStrictly(true);
role2.setFlag(false);
role2.setMenuIds(khids);
SysRole role3 = new SysRole();
role3.setRoleKey("maintainer");
role3.setRoleName("维修");
role3.setTenantId(bo.getId());
role3.setStatus("0");
role3.setRoleSort(0);
role3.setMenuCheckStrictly(false);
role3.setDeptCheckStrictly(true);
role3.setFlag(false);
role3.setMenuIds(wxids);
roleService.insertRole(role1);
roleService.insertRole(role2);
roleService.insertRole(role3);
Map<String ,Object> data = new HashMap<>();
List<SysRole> roles = new ArrayList<>();
roles.add(role1);
roles.add(role2);
roles.add(role3);
// data.put("id",bo.getId());
data.put("roles",roles);
return new R().ok(data);
}else{
return new R().fail("注册失败,请重试");
}
}*/
/**
*
*/
@SaIgnore
@Transactional
@PostMapping("/registerUser")
public R<Void> register2(@Validated @RequestBody SysUser user) {
if (!userService.checkUserNameUnique(user)) {
return R.fail("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
} else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) {
return R.fail("新增用户'" + user.getUserName() + "'失败,手机号码已存在");
} else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) {
return R.fail("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在");
} else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkNickNameUnique(user)) {
return R.fail("新增用户'" + user.getUserName() + "'失败,用户已存在");
}
user.setPassword(BCrypt.hashpw(user.getPassword()));
/* //1.查询试用的订阅计划信息 2.注册管理员用户同时添加公司的订阅计划——免费试用3月
AsSubscriptionInfoBo bo = new AsSubscriptionInfoBo();
AsSubscriptionPlanBo planBo= new AsSubscriptionPlanBo();
planBo.setName(dictService.getDictValue("trial_plan","sub_name")); //对应字典的使用计划名称查询试用计划
List<AsSubscriptionPlanVo> asSubscriptionPlanVos = iAsSubscriptionPlanService.queryList(planBo);
if(asSubscriptionPlanVos!=null&&asSubscriptionPlanVos.size()>0){
Date date = new Date();
Calendar calendar = Calendar.getInstance();
calendar.setTime(date); // 设置当前日期
calendar.add(Calendar.MONTH, 3); // 增加三个月
Date endDate = calendar.getTime(); // 获取新的日期
bo.setActive("0");
bo.setTenantId(user.getTenantId());
bo.setCompanyName(user.getTenantName());
bo.setSubplanId(asSubscriptionPlanVos.get(0).getId());
bo.setSubplanName(asSubscriptionPlanVos.get(0).getName());
bo.setStartTime(date);
bo.setEndTime(endDate);
bo.setRemark("用户注册默认试用");
}else{
bo.setActive("1");
bo.setTenantId(user.getTenantId());
bo.setCompanyName(user.getTenantName());
bo.setEndTime(null);
bo.setStartTime(null);
bo.setRemark("用户注册时未找到试用计划");
}
iAsSubscriptionInfoService.insertByBo(bo);*/
user.setTenantName(null);
return toAjax(userService.insertUser(user));
}
//忘记密码功能分3步1、发送短信验证码 2、查找是否有该用户并验证短信验证码是否正确 3、验证码通过后修改密码
//发送手机短信调用CaptchaController的 captchaSms接口发送短信 当前测试用的自己的阿里云账号先不真正发送短信设置code=1234
/**
* 2 ConstantsCAPTCHA_EXPIRATION
* @param phonenumber
* @param smsCode
* @return
*/
@SaIgnore
@PostMapping("/validateSmsCode")
public R<SysUser> validateSmsCode(String phonenumber, String smsCode) {
// 通过手机号查找用户
SysUser user = loginService.loadUserByPhonenumber(phonenumber);
//验证短信验证码
if(loginService.validateSmsCode(phonenumber, smsCode)){
return R.ok(user);
}else{
return R.fail("验证码错误");
}
}
/**
*
* @return
*/
@SaIgnore
@PostMapping("/modifyPass")
public R<Void> modifyPass(@RequestBody SysUser user) {
if (ObjectUtil.isNotNull(user.getUserId()) && user.isAdmin()) {
throw new ServiceException("不允许操作超级管理员用户");
}
//注释掉数据权限验证 userService.checkUserDataScope(user.getUserId());
user.setPassword(BCrypt.hashpw(user.getPassword()));
System.out.println("用户——"+user.getUserId()+"——通过短信重置密码");
return toAjax(userService.resetPwd(user));
}
}

@ -1,29 +1,38 @@
package com.ruoyi.web.controller.system;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.exception.NotLoginException;
import cn.dev33.satoken.stp.StpUtil;
import cn.hutool.core.collection.CollUtil;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.CacheConstants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.PageQuery;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.helper.LoginHelper;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.domain.SysUserRole;
import com.ruoyi.system.mapper.SysRoleMapper;
import com.ruoyi.system.service.ISysDeptService;
import com.ruoyi.system.service.ISysRoleService;
import com.ruoyi.system.service.ISysUserService;
import com.ruoyi.system.service.SysPermissionService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
*
@ -39,7 +48,7 @@ public class SysRoleController extends BaseController {
private final ISysRoleService roleService;
private final ISysUserService userService;
private final ISysDeptService deptService;
private final SysPermissionService permissionService;
private final SysRoleMapper baseMapper;
/**
*
@ -96,6 +105,17 @@ public class SysRoleController extends BaseController {
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
@PutMapping
public R<Void> edit(@Validated @RequestBody SysRole role) {
//非admin用户不得修改客户、维修 这两个角色
if(!LoginHelper.isAdmin()){
// 获取角色列表
List<SysRole> sysRoles = baseMapper.selectBatchIds(Arrays.asList(role.getRoleId()));
// 筛选出roleKey=="client"或者"maintainer"的角色
List<SysRole> collect = sysRoles.stream().filter(sysRole ->"companyAdmin".equals(sysRole.getRoleKey()) || "client".equals(sysRole.getRoleKey()) || "maintainer".equals(sysRole.getRoleKey())).collect(Collectors.toList());
if (collect.size() > 0) {
throw new ServiceException("不能修改系统角色");
}
}
roleService.checkRoleAllowed(role);
roleService.checkRoleDataScope(role.getRoleId());
if (!roleService.checkRoleNameUnique(role)) {
@ -105,7 +125,25 @@ public class SysRoleController extends BaseController {
}
if (roleService.updateRole(role) > 0) {
roleService.cleanOnlineUserByRole(role.getRoleId());
List<String> keys = StpUtil.searchTokenValue("", 0, -1, false);
if (CollUtil.isEmpty(keys)) {
return R.ok();
}
// 角色关联的在线用户量过大会导致redis阻塞卡顿 谨慎操作
keys.parallelStream().forEach(key -> {
String token = key.replace(CacheConstants.LOGIN_TOKEN_KEY, "");
// 如果已经过期则跳过
if (StpUtil.stpLogic.getTokenActivityTimeoutByToken(token) < -1) {
return;
}
LoginUser loginUser = LoginHelper.getLoginUser(token);
if (loginUser.getRoles().stream().anyMatch(r -> r.getRoleId().equals(role.getRoleId()))) {
try {
StpUtil.logoutByTokenValue(token);
} catch (NotLoginException ignored) {
}
}
});
return R.ok();
}
return R.fail("修改角色'" + role.getRoleName() + "'失败,请联系管理员");
@ -130,6 +168,17 @@ public class SysRoleController extends BaseController {
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
@PutMapping("/changeStatus")
public R<Void> changeStatus(@RequestBody SysRole role) {
//非admin用户不得停用公司管理员这个角色
if(!LoginHelper.isAdmin()){
// 获取角色列表
List<SysRole> sysRoles = baseMapper.selectBatchIds(Arrays.asList(role.getRoleId()));
// 筛选出roleKey=="client"或者"maintainer"的角色
List<SysRole> collect = sysRoles.stream().filter(sysRole ->"companyAdmin".equals(sysRole.getRoleKey())).collect(Collectors.toList());
if (collect.size() > 0) {
throw new ServiceException("不能停用公司管理员角色");
}
}
roleService.checkRoleAllowed(role);
roleService.checkRoleDataScope(role.getRoleId());
return toAjax(roleService.updateRoleStatus(role));

@ -41,7 +41,7 @@ import java.util.List;
import java.util.Map;
/**
*
*
*
* @author Lion Li
*/
@ -56,6 +56,7 @@ public class SysUserController extends BaseController {
private final ISysPostService postService;
private final ISysDeptService deptService;
/**
*
*/
@ -151,6 +152,8 @@ public class SysUserController extends BaseController {
return R.fail("新增用户'" + user.getUserName() + "'失败,手机号码已存在");
} else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) {
return R.fail("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在");
} else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkNickNameUnique(user)) {
return R.fail("新增用户'" + user.getUserName() + "'失败,用户已存在");
}
user.setPassword(BCrypt.hashpw(user.getPassword()));
return toAjax(userService.insertUser(user));
@ -185,7 +188,7 @@ public class SysUserController extends BaseController {
@DeleteMapping("/{userIds}")
public R<Void> remove(@PathVariable Long[] userIds) {
if (ArrayUtil.contains(userIds, getUserId())) {
return R.fail("当前用户不能删除");
return R.fail("不能删除当前用户");
}
return toAjax(userService.deleteUserByIds(userIds));
}
@ -255,4 +258,44 @@ public class SysUserController extends BaseController {
return R.ok(deptService.selectDeptTreeList(dept));
}
/**
*
*
* @param ids
*/
/* @SaCheckPermission("aftersale:company:remove")
@Log(title = "公司信息", businessType = BusinessType.DELETE)
@Transactional
@DeleteMapping("/company/{ids}")
public R<Void> delete(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] ids) {
for(Long id:ids){
//公司下有用户的不能删除
SysUser user = new SysUser();
user.setTenantId(id);
List<SysUser> users = userService.selectUserList(user);
if(users!=null&&users.size()>0){
return R.fail("公司下已有用户,不能删除");
}
}
for(Long id:ids){
//删除公司下的所有角色
SysRole role = new SysRole();
role.setTenantId(id);
List<SysRole> roles = roleService.selectRoleList(role);
if(roles!=null&&roles.size()>0){
List<Long> rids = roles.stream().map(SysRole::getRoleId).collect(Collectors.toList());
roleService.deleteRoleByIds(rids.toArray(rids.toArray(new Long[rids.size()])));
}
//删除公司订阅信息
AsSubscriptionInfoBo subInfo=new AsSubscriptionInfoBo();
subInfo.setTenantId(id);
List<AsSubscriptionInfoVo> infoVos = iAsSubscriptionInfoService.queryList(subInfo);
List<Long> sids = infoVos.stream().map(AsSubscriptionInfoVo::getId).collect(Collectors.toList());
if(sids!=null&&sids.size()>0){
iAsSubscriptionInfoService.deleteWithValidByIds(sids,true);
}
}
return toAjax(iAsCompanyService.deleteWithValidByIds(Arrays.asList(ids), true));
}*/
}

@ -51,7 +51,6 @@ public class WfInstanceController {
* @param instanceId ID
* @param deleteReason
*/
@Deprecated
@DeleteMapping(value = "/delete")
public R delete(@RequestParam String instanceId, String deleteReason) {
instanceService.delete(instanceId, deleteReason);

@ -9,6 +9,7 @@ import com.ruoyi.common.core.domain.PageQuery;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.JsonUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.flowable.core.domain.ProcessQuery;
import com.ruoyi.workflow.domain.bo.WfCopyBo;
@ -187,9 +188,9 @@ public class WfProcessController extends BaseController {
@GetMapping("/getProcessForm")
@SaCheckPermission("workflow:process:start")
public R<?> getForm(@RequestParam(value = "definitionId") String definitionId,
@RequestParam(value = "deployId") String deployId,
@RequestParam(value = "procInsId", required = false) String procInsId) {
return R.ok(processService.selectFormContent(definitionId, deployId, procInsId));
@RequestParam(value = "deployId") String deployId) {
String formContent = processService.selectFormContent(definitionId, deployId);
return R.ok(JsonUtils.parseObject(formContent, Map.class));
}
/**
@ -206,17 +207,6 @@ public class WfProcessController extends BaseController {
}
/**
*
*
* @param instanceIds ID
*/
@DeleteMapping("/instance/{instanceIds}")
public R<Void> delete(@PathVariable String[] instanceIds) {
processService.deleteProcessByIds(instanceIds);
return R.ok();
}
/**
* xml
* @param processDefId ID

@ -31,7 +31,7 @@ public class WfTaskController {
private final IWfTaskService flowTaskService;
/**
*
*
*/
@PostMapping(value = "/stopProcess")
@SaCheckPermission("workflow:process:cancel")

@ -53,13 +53,13 @@ spring:
username: root
password: hs123456
# 从库数据源
slave:
lazy: true
type: ${spring.datasource.type}
driverClassName: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/ry-flowable-plus?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&nullCatalogMeansCurrent=true
username:
password:
# slave:
# lazy: true
# type: ${spring.datasource.type}
# driverClassName: com.mysql.cj.jdbc.Driver
# url: jdbc:mysql://localhost:3306/ry-flowable-plus?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&nullCatalogMeansCurrent=true
# username:
# password:
# oracle:
# type: ${spring.datasource.type}
# driverClassName: oracle.jdbc.OracleDriver

@ -14,7 +14,7 @@ spring.boot.admin.client:
--- # xxl-job 配置
xxl.job:
# 执行器开关
enabled: true
enabled: false
# 调度中心地址:如调度中心集群部署存在多个地址则用逗号分隔。
admin-addresses: http://localhost:9100/xxl-job-admin
# 执行器通讯TOKEN非空时启用

@ -53,7 +53,7 @@ logging:
level:
com.ruoyi: @logging.level@
org.springframework: warn
config: classpath:logback-plus.xml
config: classpath:logback.xml
# 用户配置
user:

@ -18,7 +18,6 @@ user.password.not.blank=用户密码不能为空
user.password.length.valid=用户密码长度必须在{min}到{max}个字符之间
user.password.not.valid=* 5-50个字符
user.email.not.valid=邮箱格式错误
user.email.not.blank=邮箱不能为空
user.phonenumber.not.blank=用户手机号不能为空
user.mobile.phone.number.not.valid=手机号格式错误
user.login.success=登录成功
@ -43,7 +42,4 @@ rate.limiter.message=访问过于频繁,请稍候再试
sms.code.not.blank=短信验证码不能为空
sms.code.retry.limit.count=短信验证码输入错误{0}次
sms.code.retry.limit.exceed=短信验证码输入错误{0}次,帐户锁定{1}分钟
email.code.not.blank=邮箱验证码不能为空
email.code.retry.limit.count=邮箱验证码输入错误{0}次
email.code.retry.limit.exceed=邮箱验证码输入错误{0}次,帐户锁定{1}分钟
xcx.code.not.blank=小程序code不能为空

@ -18,7 +18,6 @@ user.password.not.blank=Password cannot be empty
user.password.length.valid=Password length must be between {min} and {max} characters
user.password.not.valid=* 5-50 characters
user.email.not.valid=Mailbox format error
user.email.not.blank=Mailbox cannot be blank
user.phonenumber.not.blank=Phone number cannot be blank
user.mobile.phone.number.not.valid=Phone number format error
user.login.success=Login successful
@ -43,7 +42,4 @@ rate.limiter.message=Visit too frequently, please try again later
sms.code.not.blank=Sms code cannot be blank
sms.code.retry.limit.count=Sms code input error {0} times
sms.code.retry.limit.exceed=Sms code input error {0} times, account locked for {1} minutes
email.code.not.blank=Email code cannot be blank
email.code.retry.limit.count=Email code input error {0} times
email.code.retry.limit.exceed=Email code input error {0} times, account locked for {1} minutes
xcx.code.not.blank=Mini program code cannot be blank

@ -18,7 +18,6 @@ user.password.not.blank=用户密码不能为空
user.password.length.valid=用户密码长度必须在{min}到{max}个字符之间
user.password.not.valid=* 5-50个字符
user.email.not.valid=邮箱格式错误
user.email.not.blank=邮箱不能为空
user.phonenumber.not.blank=用户手机号不能为空
user.mobile.phone.number.not.valid=手机号格式错误
user.login.success=登录成功
@ -43,7 +42,4 @@ rate.limiter.message=访问过于频繁,请稍候再试
sms.code.not.blank=短信验证码不能为空
sms.code.retry.limit.count=短信验证码输入错误{0}次
sms.code.retry.limit.exceed=短信验证码输入错误{0}次,帐户锁定{1}分钟
email.code.not.blank=邮箱验证码不能为空
email.code.retry.limit.count=邮箱验证码输入错误{0}次
email.code.retry.limit.exceed=邮箱验证码输入错误{0}次,帐户锁定{1}分钟
xcx.code.not.blank=小程序code不能为空

@ -1,129 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<property name="log.path" value="./logs"/>
<property name="console.log.pattern"
value="%red(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{36}%n) - %msg%n"/>
<property name="log.pattern" value="%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"/>
<!-- 控制台输出 -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${console.log.pattern}</pattern>
<charset>utf-8</charset>
</encoder>
</appender>
<!-- 控制台输出 -->
<appender name="file_console" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-console.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/sys-console.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大 1天 -->
<maxHistory>1</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
<charset>utf-8</charset>
</encoder>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<!-- 过滤的级别 -->
<level>INFO</level>
</filter>
</appender>
<!-- 系统日志输出 -->
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-info.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>INFO</level>
<!-- 匹配时的操作:接收(记录) -->
<onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-error.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/sys-error.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>ERROR</level>
<!-- 匹配时的操作:接收(记录) -->
<onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- info异步输出 -->
<appender name="async_info" class="ch.qos.logback.classic.AsyncAppender">
<!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
<discardingThreshold>0</discardingThreshold>
<!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
<queueSize>512</queueSize>
<!-- 添加附加的appender,最多只能添加一个 -->
<appender-ref ref="file_info"/>
</appender>
<!-- error异步输出 -->
<appender name="async_error" class="ch.qos.logback.classic.AsyncAppender">
<!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
<discardingThreshold>0</discardingThreshold>
<!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
<queueSize>512</queueSize>
<!-- 添加附加的appender,最多只能添加一个 -->
<appender-ref ref="file_error"/>
</appender>
<!-- 整合 skywalking 控制台输出 tid -->
<!-- <appender name="console" class="ch.qos.logback.core.ConsoleAppender">-->
<!-- <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">-->
<!-- <layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">-->
<!-- <pattern>[%tid] ${console.log.pattern}</pattern>-->
<!-- </layout>-->
<!-- <charset>utf-8</charset>-->
<!-- </encoder>-->
<!-- </appender>-->
<!-- 整合 skywalking 推送采集日志 -->
<!-- <appender name="sky_log" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">-->
<!-- <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">-->
<!-- <layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">-->
<!-- <pattern>[%tid] ${console.log.pattern}</pattern>-->
<!-- </layout>-->
<!-- <charset>utf-8</charset>-->
<!-- </encoder>-->
<!-- </appender>-->
<!--系统操作日志-->
<root level="info">
<appender-ref ref="console" />
<appender-ref ref="async_info" />
<appender-ref ref="async_error" />
<appender-ref ref="file_console" />
<!-- <appender-ref ref="sky_log"/>-->
</root>
</configuration>

@ -1,70 +0,0 @@
package com.ruoyi.test;
import com.ruoyi.common.config.RuoYiConfig;
import org.junit.jupiter.api.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import java.util.concurrent.TimeUnit;
/**
*
*
* @author Lion Li
*/
@SpringBootTest // 此注解只能在 springboot 主包下使用 需包含 main 方法与 yml 配置文件
@DisplayName("单元测试案例")
public class DemoUnitTest {
@Autowired
private RuoYiConfig ruoYiConfig;
@DisplayName("测试 @SpringBootTest @Test @DisplayName 注解")
@Test
public void testTest() {
System.out.println(ruoYiConfig);
}
@Disabled
@DisplayName("测试 @Disabled 注解")
@Test
public void testDisabled() {
System.out.println(ruoYiConfig);
}
@Timeout(value = 2L, unit = TimeUnit.SECONDS)
@DisplayName("测试 @Timeout 注解")
@Test
public void testTimeout() throws InterruptedException {
Thread.sleep(3000);
System.out.println(ruoYiConfig);
}
@DisplayName("测试 @RepeatedTest 注解")
@RepeatedTest(3)
public void testRepeatedTest() {
System.out.println(666);
}
@BeforeAll
public static void testBeforeAll() {
System.out.println("@BeforeAll ==================");
}
@BeforeEach
public void testBeforeEach() {
System.out.println("@BeforeEach ==================");
}
@AfterEach
public void testAfterEach() {
System.out.println("@AfterEach ==================");
}
@AfterAll
public static void testAfterAll() {
System.out.println("@AfterAll ==================");
}
}

@ -1,72 +0,0 @@
package com.ruoyi.test;
import com.ruoyi.common.enums.UserType;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.EnumSource;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.NullSource;
import org.junit.jupiter.params.provider.ValueSource;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;
/**
*
*
* @author Lion Li
*/
@DisplayName("带参数单元测试案例")
public class ParamUnitTest {
@DisplayName("测试 @ValueSource 注解")
@ParameterizedTest
@ValueSource(strings = {"t1", "t2", "t3"})
public void testValueSource(String str) {
System.out.println(str);
}
@DisplayName("测试 @NullSource 注解")
@ParameterizedTest
@NullSource
public void testNullSource(String str) {
System.out.println(str);
}
@DisplayName("测试 @EnumSource 注解")
@ParameterizedTest
@EnumSource(UserType.class)
public void testEnumSource(UserType type) {
System.out.println(type.getUserType());
}
@DisplayName("测试 @MethodSource 注解")
@ParameterizedTest
@MethodSource("getParam")
public void testMethodSource(String str) {
System.out.println(str);
}
public static Stream<String> getParam() {
List<String> list = new ArrayList<>();
list.add("t1");
list.add("t2");
list.add("t3");
return list.stream();
}
@BeforeEach
public void testBeforeEach() {
System.out.println("@BeforeEach ==================");
}
@AfterEach
public void testAfterEach() {
System.out.println("@AfterEach ==================");
}
}

@ -5,7 +5,7 @@
<parent>
<artifactId>ruoyi-flowable-plus</artifactId>
<groupId>com.ruoyi</groupId>
<version>0.8.3</version>
<version>0.8.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@ -78,6 +78,18 @@
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<exclusions>
<!-- 解决jsqlparser 依赖版本冲突&ndash;&gt;-->
<exclusion>
<artifactId>jsqlparser</artifactId>
<groupId>com.github.jsqlparser</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.github.jsqlparser</groupId>
<artifactId>jsqlparser</artifactId>
<version>4.3</version>
</dependency>
<!-- dynamic-datasource 多数据源-->
@ -159,12 +171,6 @@
<artifactId>bcprov-jdk15to18</artifactId>
</dependency>
<!-- 离线IP地址定位库 -->
<dependency>
<groupId>org.lionsoul</groupId>
<artifactId>ip2region</artifactId>
</dependency>
</dependencies>
</project>

@ -7,6 +7,11 @@ package com.ruoyi.common.constant;
*/
public interface CacheConstants {
/**
* redis key
*/
String LOGIN_TOKEN_KEY = "Authorization:login:token:";
/**
* 线 redis key
*/

@ -35,11 +35,6 @@ public interface CacheNames {
*/
String SYS_USER_NAME = "sys_user_name#30d";
/**
*
*/
String SYS_NICK_NAME = "sys_nick_name#30d";
/**
*
*/

@ -32,6 +32,11 @@ public interface Constants {
*/
String HTTPS = "https://";
/**
*
*/
String RESOURCE_PREFIX = "/profile";
/**
*
*/

@ -11,6 +11,8 @@ public interface UserConstants {
*
*/
String SYS_USER = "SYS_USER";
String CLIENT = "client";
String MAINTENANCE = "maintenance";
/**
*

@ -30,6 +30,11 @@ public class RoleDTO implements Serializable {
*/
private String roleKey;
/**
*
*/
private Long tenantId;
/**
* 12345
*/

@ -61,6 +61,12 @@ public class SysRole extends BaseEntity {
@NotNull(message = "显示顺序不能为空")
private Integer roleSort;
/**
*
*/
@ExcelProperty(value = "所属公司ID")
private Long tenantId;
/**
* 12345
*/

@ -1,6 +1,5 @@
package com.ruoyi.common.core.domain.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
@ -37,16 +36,20 @@ public class SysUser extends BaseEntity {
@TableId(value = "user_id")
private Long userId;
/**
* ID
*/
private Long deptId;
/**
* ID
*/
@ExcelProperty(value = "所属租户ID")
private Long tenantId;
/**
* ID
*
*/
private Long deptId;
private String tenantName;
/**
*
@ -68,6 +71,16 @@ public class SysUser extends BaseEntity {
*/
private String userType;
/**
* ID
*/
private Long clientId;
/**
* ID
*/
private Long maintainerId;
/**
*
*/
@ -79,7 +92,7 @@ public class SysUser extends BaseEntity {
/**
*
*/
@Sensitive(strategy = SensitiveStrategy.PHONE)
//@Sensitive(strategy = SensitiveStrategy.PHONE)
private String phonenumber;
/**
@ -140,6 +153,18 @@ public class SysUser extends BaseEntity {
@TableField(exist = false)
private SysDept dept;
/**
*
*/
@TableField(exist = false)
private String address;
/**
*
*/
@TableField(exist = false)
private String companyType;
/**
*
*/

@ -1,30 +0,0 @@
package com.ruoyi.common.core.domain.model;
import lombok.Data;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
/**
*
*
* @author Lion Li
*/
@Data
public class EmailLoginBody {
/**
*
*/
@NotBlank(message = "{user.email.not.blank}")
@Email(message = "{user.email.not.valid}")
private String email;
/**
* code
*/
@NotBlank(message = "{email.code.not.blank}")
private String emailCode;
}

@ -25,6 +25,11 @@ public class LoginUser implements Serializable {
*/
private Long userId;
/**
* ID
*/
private Long deptId;
/**
* ID
*/
@ -35,11 +40,6 @@ public class LoginUser implements Serializable {
*/
private String companyName;
/**
* ID
*/
private Long deptId;
/**
*
*/

@ -14,13 +14,13 @@ import javax.validation.constraints.NotBlank;
public class SmsLoginBody {
/**
*
*
*/
@NotBlank(message = "{user.phonenumber.not.blank}")
private String phonenumber;
/**
* code
*
*/
@NotBlank(message = "{sms.code.not.blank}")
private String smsCode;

@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.*;
import com.baomidou.mybatisplus.core.toolkit.ReflectionKit;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.toolkit.Db;
import com.ruoyi.common.utils.BeanCopyUtils;

@ -14,13 +14,4 @@ public interface UserService {
* @return
*/
String selectUserNameById(Long userId);
/**
* ID
*
* @param userId ID
* @return
*/
String selectNickNameById(Long userId);
}

@ -22,11 +22,6 @@ public enum LoginType {
*/
SMS("sms.code.retry.limit.exceed", "sms.code.retry.limit.count"),
/**
*
*/
EMAIL("email.code.retry.limit.exceed", "email.code.retry.limit.count"),
/**
*
*/

@ -42,7 +42,7 @@ public class DefaultExcelListener<T> extends AnalysisEventListener<T> implements
private ExcelResult<T> excelResult;
public DefaultExcelListener(boolean isValidate) {
this.excelResult = new DefaultExcelResult<>();
this.excelResult = new DefautExcelResult<>();
this.isValidate = isValidate;
}

@ -1,73 +0,0 @@
package com.ruoyi.common.excel;
import cn.hutool.core.util.StrUtil;
import lombok.Setter;
import java.util.ArrayList;
import java.util.List;
/**
* excel
*
* @author Yjoioooo
* @author Lion Li
*/
public class DefaultExcelResult<T> implements ExcelResult<T> {
/**
* list
*/
@Setter
private List<T> list;
/**
*
*/
@Setter
private List<String> errorList;
public DefaultExcelResult() {
this.list = new ArrayList<>();
this.errorList = new ArrayList<>();
}
public DefaultExcelResult(List<T> list, List<String> errorList) {
this.list = list;
this.errorList = errorList;
}
public DefaultExcelResult(ExcelResult<T> excelResult) {
this.list = excelResult.getList();
this.errorList = excelResult.getErrorList();
}
@Override
public List<T> getList() {
return list;
}
@Override
public List<String> getErrorList() {
return errorList;
}
/**
*
*
* @return
*/
@Override
public String getAnalysis() {
int successCount = list.size();
int errorCount = errorList.size();
if (successCount == 0) {
return "读取失败,未解析到数据";
} else {
if (errorCount == 0) {
return StrUtil.format("恭喜您,全部读取成功!共{}条", successCount);
} else {
return "";
}
}
}
}

@ -66,7 +66,7 @@ public class DataBaseHelper {
// instr(',0,100,101,' , ',100,') <> 0
return "instr(','||" + var2 + "||',' , '," + var + ",') <> 0";
}
// find_in_set('100' , '0,100,101')
return "find_in_set('" + var + "' , " + var2 + ") <> 0";
// find_in_set(100 , '0,100,101')
return "find_in_set(" + var + " , " + var2 + ") <> 0";
}
}

@ -10,7 +10,6 @@ import lombok.NoArgsConstructor;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Supplier;
/**
*
@ -62,32 +61,4 @@ public class DataPermissionHelper {
InterceptorIgnoreHelper.clearIgnoreStrategy();
}
/**
*
*
* @param handle
*/
public static void ignore(Runnable handle) {
enableIgnore();
try {
handle.run();
} finally {
disableIgnore();
}
}
/**
*
*
* @param handle
*/
public static <T> T ignore(Supplier<T> handle) {
enableIgnore();
try {
return handle.get();
} finally {
disableIgnore();
}
}
}

@ -116,6 +116,18 @@ public class LoginHelper {
return getLoginUser().getNickName();
}
/**
*
*/
public static Long getTenantId() { return getLoginUser().getTenantId(); }
/**
*
*/
public static String getCompanyName() {
return getLoginUser().getCompanyName();
}
/**
*
*/

@ -19,7 +19,6 @@ public class DeptNameTranslationImpl implements TranslationInterface<String> {
private final DeptService deptService;
@Override
public String translation(Object key, String other) {
return deptService.selectDeptNameByIds(key.toString());
}

@ -20,7 +20,6 @@ public class DictTypeTranslationImpl implements TranslationInterface<String> {
private final DictService dictService;
@Override
public String translation(Object key, String other) {
if (key instanceof String && StringUtils.isNotBlank(other)) {
return dictService.getDictLabel(other, key.toString());

@ -19,7 +19,6 @@ public class OssUrlTranslationImpl implements TranslationInterface<String> {
private final OssService ossService;
@Override
public String translation(Object key, String other) {
return ossService.selectUrlByIds(key.toString());
}

@ -19,7 +19,6 @@ public class UserNameTranslationImpl implements TranslationInterface<String> {
private final UserService userService;
@Override
public String translation(Object key, String other) {
if (key instanceof Long) {
return userService.selectUserNameById((Long) key);

@ -1,243 +0,0 @@
package com.ruoyi.common.utils;
import cn.hutool.core.codec.Base64;
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.SecureUtil;
import cn.hutool.crypto.SmUtil;
import cn.hutool.crypto.asymmetric.KeyType;
import cn.hutool.crypto.asymmetric.RSA;
import cn.hutool.crypto.asymmetric.SM2;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;
/**
*
*
* @author
*/
public class EncryptUtils {
/**
*
*/
public static final String PUBLIC_KEY = "publicKey";
/**
*
*/
public static final String PRIVATE_KEY = "privateKey";
/**
* Base64
*
* @param data
* @return
*/
public static String encryptByBase64(String data) {
return Base64.encode(data, StandardCharsets.UTF_8);
}
/**
* Base64
*
* @param data
* @return
*/
public static String decryptByBase64(String data) {
return Base64.decodeStr(data, StandardCharsets.UTF_8);
}
/**
* AES
*
* @param data
* @param password
* @return , Base64
*/
public static String encryptByAes(String data, String password) {
if (StrUtil.isBlank(password)) {
throw new IllegalArgumentException("AES需要传入秘钥信息");
}
// aes算法的秘钥要求是16位、24位、32位
int[] array = {16, 24, 32};
if (!ArrayUtil.contains(array, password.length())) {
throw new IllegalArgumentException("AES秘钥长度要求为16位、24位、32位");
}
return SecureUtil.aes(password.getBytes(StandardCharsets.UTF_8)).encryptBase64(data, StandardCharsets.UTF_8);
}
/**
* AES
*
* @param data
* @param password
* @return
*/
public static String decryptByAes(String data, String password) {
if (StrUtil.isBlank(password)) {
throw new IllegalArgumentException("AES需要传入秘钥信息");
}
// aes算法的秘钥要求是16位、24位、32位
int[] array = {16, 24, 32};
if (!ArrayUtil.contains(array, password.length())) {
throw new IllegalArgumentException("AES秘钥长度要求为16位、24位、32位");
}
return SecureUtil.aes(password.getBytes(StandardCharsets.UTF_8)).decryptStr(data, StandardCharsets.UTF_8);
}
/**
* sm4
*
* @param data
* @param password
* @return , Base64
*/
public static String encryptBySm4(String data, String password) {
if (StrUtil.isBlank(password)) {
throw new IllegalArgumentException("SM4需要传入秘钥信息");
}
// sm4算法的秘钥要求是16位长度
int sm4PasswordLength = 16;
if (sm4PasswordLength != password.length()) {
throw new IllegalArgumentException("SM4秘钥长度要求为16位");
}
return SmUtil.sm4(password.getBytes(StandardCharsets.UTF_8)).encryptBase64(data, StandardCharsets.UTF_8);
}
/**
* sm4
*
* @param data
* @param password
* @return
*/
public static String decryptBySm4(String data, String password) {
if (StrUtil.isBlank(password)) {
throw new IllegalArgumentException("SM4需要传入秘钥信息");
}
// sm4算法的秘钥要求是16位长度
int sm4PasswordLength = 16;
if (sm4PasswordLength != password.length()) {
throw new IllegalArgumentException("SM4秘钥长度要求为16位");
}
return SmUtil.sm4(password.getBytes(StandardCharsets.UTF_8)).decryptStr(data, StandardCharsets.UTF_8);
}
/**
* sm2
*
* @return Map
*/
public static Map<String, String> generateSm2Key() {
Map<String, String> keyMap = new HashMap<>(2);
SM2 sm2 = SmUtil.sm2();
keyMap.put(PRIVATE_KEY, sm2.getPrivateKeyBase64());
keyMap.put(PUBLIC_KEY, sm2.getPublicKeyBase64());
return keyMap;
}
/**
* sm2
*
* @param data
* @param publicKey
* @return , Base64
*/
public static String encryptBySm2(String data, String publicKey) {
if (StrUtil.isBlank(publicKey)) {
throw new IllegalArgumentException("SM2需要传入公钥进行加密");
}
SM2 sm2 = SmUtil.sm2(null, publicKey);
return sm2.encryptBase64(data, StandardCharsets.UTF_8, KeyType.PublicKey);
}
/**
* sm2
*
* @param data
* @param privateKey
* @return
*/
public static String decryptBySm2(String data, String privateKey) {
if (StrUtil.isBlank(privateKey)) {
throw new IllegalArgumentException("SM2需要传入私钥进行解密");
}
SM2 sm2 = SmUtil.sm2(privateKey, null);
return sm2.decryptStr(data, KeyType.PrivateKey, StandardCharsets.UTF_8);
}
/**
* RSA
*
* @return Map
*/
public static Map<String, String> generateRsaKey() {
Map<String, String> keyMap = new HashMap<>(2);
RSA rsa = SecureUtil.rsa();
keyMap.put(PRIVATE_KEY, rsa.getPrivateKeyBase64());
keyMap.put(PUBLIC_KEY, rsa.getPublicKeyBase64());
return keyMap;
}
/**
* rsa
*
* @param data
* @param publicKey
* @return , Base64
*/
public static String encryptByRsa(String data, String publicKey) {
if (StrUtil.isBlank(publicKey)) {
throw new IllegalArgumentException("RSA需要传入公钥进行加密");
}
RSA rsa = SecureUtil.rsa(null, publicKey);
return rsa.encryptBase64(data, StandardCharsets.UTF_8, KeyType.PublicKey);
}
/**
* rsa
*
* @param data
* @param privateKey
* @return
*/
public static String decryptByRsa(String data, String privateKey) {
if (StrUtil.isBlank(privateKey)) {
throw new IllegalArgumentException("RSA需要传入私钥进行解密");
}
RSA rsa = SecureUtil.rsa(privateKey, null);
return rsa.decryptStr(data, KeyType.PrivateKey, StandardCharsets.UTF_8);
}
/**
* md5
*
* @param data
* @return , Hex
*/
public static String encryptByMd5(String data) {
return SecureUtil.md5(data);
}
/**
* sha256
*
* @param data
* @return , Hex
*/
public static String encryptBySha256(String data) {
return SecureUtil.sha256(data);
}
/**
* sm3
*
* @param data
* @return , Hex
*/
public static String encryptBySm3(String data) {
return SmUtil.sm3(data);
}
}

@ -37,4 +37,23 @@ public class MimeTypeUtils {
// pdf
"pdf"};
public static String getExtension(String prefix)
{
switch (prefix)
{
case IMAGE_PNG:
return "png";
case IMAGE_JPG:
return "jpg";
case IMAGE_JPEG:
return "jpeg";
case IMAGE_BMP:
return "bmp";
case IMAGE_GIF:
return "gif";
default:
return "";
}
}
}

@ -1,7 +1,12 @@
package com.ruoyi.common.utils.ip;
import cn.hutool.core.lang.Dict;
import cn.hutool.core.net.NetUtil;
import cn.hutool.http.HtmlUtil;
import cn.hutool.http.HttpUtil;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.utils.JsonUtils;
import com.ruoyi.common.utils.StringUtils;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
@ -16,18 +21,40 @@ import lombok.extern.slf4j.Slf4j;
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class AddressUtils {
// IP地址查询
public static final String IP_URL = "http://whois.pconline.com.cn/ipJson.jsp";
// 未知地址
public static final String UNKNOWN = "XX XX";
public static String getRealAddressByIP(String ip) {
String address = UNKNOWN;
if (StringUtils.isBlank(ip)) {
return UNKNOWN;
return address;
}
// 内网不查询
ip = "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : HtmlUtil.cleanHtmlTag(ip);
if (NetUtil.isInnerIP(ip)) {
return "内网IP";
}
return RegionUtils.getCityInfo(ip);
if (RuoYiConfig.isAddressEnabled()) {
try {
String rspStr = HttpUtil.createGet(IP_URL)
.body("ip=" + ip + "&json=true", Constants.GBK)
.execute()
.body();
if (StringUtils.isEmpty(rspStr)) {
log.error("获取地理位置异常 {}", ip);
return UNKNOWN;
}
Dict obj = JsonUtils.parseMap(rspStr);
String region = obj.getStr("pro");
String city = obj.getStr("city");
return String.format("%s %s", region, city);
} catch (Exception e) {
log.error("获取地理位置异常 {}", ip);
}
}
return UNKNOWN;
}
}

@ -1,66 +0,0 @@
package com.ruoyi.common.utils.ip;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.io.resource.ClassPathResource;
import cn.hutool.core.util.ObjectUtil;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.file.FileUtils;
import lombok.extern.slf4j.Slf4j;
import org.lionsoul.ip2region.xdb.Searcher;
import java.io.File;
/**
* ip线
* <a href="https://gitee.com/lionsoul/ip2region/tree/master/binding/java"> ip2region 线IP</a>
*
* @author lishuyan
*/
@Slf4j
public class RegionUtils {
private static final Searcher SEARCHER;
static {
String fileName = "/ip2region.xdb";
File existFile = FileUtils.file(FileUtil.getTmpDir() + FileUtil.FILE_SEPARATOR + fileName);
if (!FileUtils.exist(existFile)) {
ClassPathResource fileStream = new ClassPathResource(fileName);
if (ObjectUtil.isEmpty(fileStream.getStream())) {
throw new ServiceException("RegionUtils初始化失败原因IP地址库数据不存在");
}
FileUtils.writeFromStream(fileStream.getStream(), existFile);
}
String dbPath = existFile.getPath();
// 1、从 dbPath 加载整个 xdb 到内存。
byte[] cBuff;
try {
cBuff = Searcher.loadContentFromFile(dbPath);
} catch (Exception e) {
throw new ServiceException("RegionUtils初始化失败原因从ip2region.xdb文件加载内容失败" + e.getMessage());
}
// 2、使用上述的 cBuff 创建一个完全基于内存的查询对象。
try {
SEARCHER = Searcher.newWithBuffer(cBuff);
} catch (Exception e) {
throw new ServiceException("RegionUtils初始化失败原因" + e.getMessage());
}
}
/**
* IP线
*/
public static String getCityInfo(String ip) {
try {
ip = ip.trim();
// 3、执行查询
String region = SEARCHER.search(ip);
return region.replace("0|", "").replace("|0", "");
} catch (Exception e) {
log.error("IP地址离线获取城市异常 {}", ip);
return "未知";
}
}
}

@ -5,7 +5,7 @@
<parent>
<artifactId>ruoyi-flowable-plus</artifactId>
<groupId>com.ruoyi</groupId>
<version>0.8.3</version>
<version>0.8.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@ -29,10 +29,10 @@
</dependency>
<!-- 短信 用哪个导入哪个依赖 -->
<!-- <dependency>-->
<!-- <groupId>com.aliyun</groupId>-->
<!-- <artifactId>dysmsapi20170525</artifactId>-->
<!-- </dependency>-->
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>dysmsapi20170525</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.tencentcloudapi</groupId>-->

@ -49,16 +49,4 @@ public class RedisRateLimiterController {
return R.ok("操作成功", value);
}
/**
* IP(key)
* IP
*
* # #{# != 1 ? 1 : 0}
*/
@RateLimiter(count = 2, time = 10, limitType = LimitType.IP, key = "#value")
@GetMapping("/testObj")
public R<String> testObj(String value) {
return R.ok("操作成功", value);
}
}

@ -5,7 +5,7 @@
<parent>
<artifactId>ruoyi-flowable-plus</artifactId>
<groupId>com.ruoyi</groupId>
<version>0.8.3</version>
<version>0.8.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>ruoyi-extend</artifactId>

@ -5,7 +5,7 @@
<parent>
<artifactId>ruoyi-extend</artifactId>
<groupId>com.ruoyi</groupId>
<version>0.8.3</version>
<version>0.8.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>

@ -6,9 +6,6 @@ spring:
profiles:
active: @profiles.active@
logging:
config: classpath:logback-plus.xml
--- # 监控中心服务端配置
spring:
security:

@ -1,34 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false" scan="true" scanPeriod="1 seconds">
<contextName>logback</contextName>
<property name="log.path" value="./logs/ruoyi-monitor-admin"/>
<property name="console.log.pattern"
value="%red(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{36}%n) - %msg%n"/>
<property name="log.pattern" value="%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"/>
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${console.log.pattern}</pattern>
<charset>utf-8</charset>
</encoder>
</appender>
<appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.path}.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
<root level="info">
<appender-ref ref="console"/>
<appender-ref ref="file"/>
</root>
</configuration>

@ -4,7 +4,7 @@
<parent>
<artifactId>ruoyi-extend</artifactId>
<groupId>com.ruoyi</groupId>
<version>0.8.3</version>
<version>0.8.2</version>
</parent>
<artifactId>ruoyi-xxl-job-admin</artifactId>
<packaging>jar</packaging>

@ -1,6 +1,5 @@
package com.xxl.job.admin.controller;
import com.xxl.job.admin.controller.annotation.PermissionLimit;
import com.xxl.job.admin.core.model.XxlJobGroup;
import com.xxl.job.admin.core.model.XxlJobRegistry;
import com.xxl.job.admin.core.util.I18nUtil;
@ -36,14 +35,12 @@ public class JobGroupController {
private XxlJobRegistryDao xxlJobRegistryDao;
@RequestMapping
@PermissionLimit(adminuser = true)
public String index(Model model) {
return "jobgroup/jobgroup.index";
}
@RequestMapping("/pageList")
@ResponseBody
@PermissionLimit(adminuser = true)
public Map<String, Object> pageList(HttpServletRequest request,
@RequestParam(required = false, defaultValue = "0") int start,
@RequestParam(required = false, defaultValue = "10") int length,
@ -63,7 +60,6 @@ public class JobGroupController {
@RequestMapping("/save")
@ResponseBody
@PermissionLimit(adminuser = true)
public ReturnT<String> save(XxlJobGroup xxlJobGroup) {
// valid
@ -107,7 +103,6 @@ public class JobGroupController {
@RequestMapping("/update")
@ResponseBody
@PermissionLimit(adminuser = true)
public ReturnT<String> update(XxlJobGroup xxlJobGroup) {
// valid
if (xxlJobGroup.getAppname() == null || xxlJobGroup.getAppname().trim().length() == 0) {
@ -176,7 +171,6 @@ public class JobGroupController {
@RequestMapping("/remove")
@ResponseBody
@PermissionLimit(adminuser = true)
public ReturnT<String> remove(int id) {
// valid
@ -196,7 +190,6 @@ public class JobGroupController {
@RequestMapping("/loadById")
@ResponseBody
@PermissionLimit(adminuser = true)
public ReturnT<XxlJobGroup> loadById(int id) {
XxlJobGroup jobGroup = xxlJobGroupDao.load(id);
return jobGroup != null ? new ReturnT<XxlJobGroup>(jobGroup) : new ReturnT<XxlJobGroup>(ReturnT.FAIL_CODE, null);

@ -130,26 +130,22 @@ public class JobLogController {
model.addAttribute("triggerCode", jobLog.getTriggerCode());
model.addAttribute("handleCode", jobLog.getHandleCode());
model.addAttribute("executorAddress", jobLog.getExecutorAddress());
model.addAttribute("triggerTime", jobLog.getTriggerTime().getTime());
model.addAttribute("logId", jobLog.getId());
return "joblog/joblog.detail";
}
@RequestMapping("/logDetailCat")
@ResponseBody
public ReturnT<LogResult> logDetailCat(long logId, int fromLineNum) {
public ReturnT<LogResult> logDetailCat(String executorAddress, long triggerTime, long logId, int fromLineNum) {
try {
// valid
XxlJobLog jobLog = xxlJobLogDao.load(logId); // todo, need to improve performance
if (jobLog == null) {
return new ReturnT<LogResult>(ReturnT.FAIL_CODE, I18nUtil.getString("joblog_logid_unvalid"));
}
// log cat
ExecutorBiz executorBiz = XxlJobScheduler.getExecutorBiz(jobLog.getExecutorAddress());
ReturnT<LogResult> logResult = executorBiz.log(new LogParam(jobLog.getTriggerTime().getTime(), logId, fromLineNum));
ExecutorBiz executorBiz = XxlJobScheduler.getExecutorBiz(executorAddress);
ReturnT<LogResult> logResult = executorBiz.log(new LogParam(triggerTime, logId, fromLineNum));
// is end
if (logResult.getContent() != null && logResult.getContent().getFromLineNum() > logResult.getContent().getToLineNum()) {
XxlJobLog jobLog = xxlJobLogDao.load(logId);
if (jobLog.getHandleCode() > 0) {
logResult.getContent().setEnd(true);
}

@ -16,9 +16,6 @@ spring:
resources:
static-locations: classpath:/static/
logging:
config: classpath:logback-plus.xml
--- # mybatis 配置
mybatis:
mapper-locations: classpath:/mybatis-mapper/*Mapper.xml

@ -1,6 +1,6 @@
admin_name=Scheduling Center
admin_name_full=Distributed Task Scheduling Platform XXL-JOB
admin_version=2.4.0
admin_version=2.3.1
admin_i18n=en
## system

@ -1,6 +1,6 @@
admin_name=任务调度中心
admin_name_full=分布式任务调度平台XXL-JOB
admin_version=2.4.0
admin_version=2.3.1
admin_i18n=
## system

@ -1,6 +1,6 @@
admin_name=任務調度中心
admin_name_full=分布式任務調度平臺XXL-JOB
admin_version=2.4.0
admin_version=2.3.1
admin_i18n=
## system

@ -1,34 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false" scan="true" scanPeriod="1 seconds">
<contextName>logback</contextName>
<property name="log.path" value="./logs/ruoyi-xxl-job-admin"/>
<property name="console.log.pattern"
value="%red(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{36}%n) - %msg%n"/>
<property name="log.pattern" value="%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"/>
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${console.log.pattern}</pattern>
<charset>utf-8</charset>
</encoder>
</appender>
<appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.path}.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
<root level="info">
<appender-ref ref="console"/>
<appender-ref ref="file"/>
</root>
</configuration>

@ -25,6 +25,8 @@ $(function() {
async: false, // sync, make log ordered
url : base_url + '/joblog/logDetailCat',
data : {
"executorAddress":executorAddress,
"triggerTime":triggerTime,
"logId":logId,
"fromLineNum":fromLineNum
},

@ -62,6 +62,8 @@
// 参数
var triggerCode = '${triggerCode}';
var handleCode = '${handleCode}';
var executorAddress = '${executorAddress!}';
var triggerTime = '${triggerTime?c}';
var logId = '${logId}';
</script>
<script src="${request.contextPath}/static/js/joblog.detail.1.js"></script>

@ -5,7 +5,7 @@
<parent>
<artifactId>ruoyi-flowable-plus</artifactId>
<groupId>com.ruoyi</groupId>
<version>0.8.3</version>
<version>0.8.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

@ -5,7 +5,7 @@
<parent>
<artifactId>ruoyi-flowable-plus</artifactId>
<groupId>com.ruoyi</groupId>
<version>0.8.3</version>
<version>0.8.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

@ -18,7 +18,6 @@ import org.redisson.api.RateType;
import org.springframework.core.DefaultParameterNameDiscoverer;
import org.springframework.core.ParameterNameDiscoverer;
import org.springframework.expression.EvaluationContext;
import org.springframework.expression.Expression;
import org.springframework.expression.ExpressionParser;
import org.springframework.expression.ParserContext;
import org.springframework.expression.common.TemplateParserContext;
@ -103,14 +102,7 @@ public class RateLimiterAspect {
}
// 解析返回给key
try {
Expression expression;
if (StringUtils.startsWith(key, parserContext.getExpressionPrefix())
&& StringUtils.endsWith(key, parserContext.getExpressionSuffix())) {
expression = parser.parseExpression(key, parserContext);
} else {
expression = parser.parseExpression(key);
}
key = expression.getValue(context, String.class) + ":";
key = parser.parseExpression(key, parserContext).getValue(context, String.class) + ":";
} catch (Exception e) {
throw new ServiceException("限流key解析异常!请联系管理员!");
}

@ -36,11 +36,68 @@ import java.util.Locale;
@Configuration
@MapperScan("${mybatis-plus.mapperPackage}")
public class MybatisPlusConfig {
/* @Autowired
private TenantHandler tenantHandler;*/
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() {
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
//多租户插件
interceptor.addInnerInterceptor(new TenantLineInnerInterceptor(new TenantLineHandler() {
@Override
public Expression getTenantId() {
LoginUser loginUser = LoginHelper.getLoginUser();
if (ObjectUtil.isEmpty(loginUser.getTenantId())) {
return new NullValue();
}
return new LongValue(loginUser.getTenantId());
}
//这是 default 方法,默认返回 false 表示所有表都需要拼多租户条件
@Override
public boolean ignoreTable(String tableName) {
// 判断是否登录,如果登录则过滤
if (StpUtil.getLoginIdDefaultNull() != null) {
// 判断是否平台超级管理员,如果是平台超级管理员则拥有所有数据权限
if (!LoginHelper.isAdmin(LoginHelper.getLoginUser().getUserId())) {
// 需要拼接租户条件的表
String[] tenantTables = {
//系统表
"sys_user",
"sys_role",
//业务表
"as_maintainer",
"as_client",
"as_event",
"as_spare_part",
"as_spare_log",
"as_repair_log",
// "as_repair_info",
"as_evaluation",
"as_work_order",
"as_warehouse",
"as_out_in_type",
"as_product_type",
"as_product_unit",
"as_project",
"as_asset",
"as_asset_sxt",
"as_area",
"as_asset_common"
};
// 转为 List
List<String> list = Arrays.asList(tenantTables);
// 判断tableName是否在tenantTables中, 在的话返回false, 不在的话返回true
return !list.contains(tableName.toLowerCase(Locale.ROOT));
}
}
return true;
}
@Override
public String getTenantIdColumn() {
// 对应数据库租户ID的列名
return "tenant_id";
}
}));
// 数据权限处理
interceptor.addInnerInterceptor(dataPermissionInterceptor());
@ -49,8 +106,7 @@ public MybatisPlusInterceptor mybatisPlusInterceptor() {
// 乐观锁插件
interceptor.addInnerInterceptor(optimisticLockerInnerInterceptor());
return interceptor;
}
}
/**
*
@ -95,7 +151,6 @@ public MybatisPlusInterceptor mybatisPlusInterceptor() {
return new DefaultIdentifierGenerator(NetUtil.getLocalhost());
}
/**
* PaginationInnerInterceptor
* https://baomidou.com/pages/97710a/

@ -1,6 +1,8 @@
package com.ruoyi.framework.config;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.framework.interceptor.PlusWebInvokeTimeInterceptor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.cors.CorsConfiguration;
@ -17,6 +19,8 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
*/
@Configuration
public class ResourcesConfig implements WebMvcConfigurer {
@Value("${ruoyi.profile}")
private String profile;
@Override
public void addInterceptors(InterceptorRegistry registry) {
@ -26,6 +30,9 @@ public class ResourcesConfig implements WebMvcConfigurer {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
/** 本地文件上传路径 */
registry.addResourceHandler(Constants.RESOURCE_PREFIX + "/**")
.addResourceLocations("file:" + profile + "/");
}
/**

@ -1,34 +0,0 @@
package com.ruoyi.framework.config.properties;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import java.util.List;
/**
*
*
* @author vishun
*/
@Configuration
@ConfigurationProperties(prefix = "tenant")
@Data
public class TenantProperties {
/**
*
*/
private Boolean enable;
/**
*
*/
private String column;
/**
*
*/
private List<String> excludes;
}

@ -1,6 +1,6 @@
package com.ruoyi.framework.encrypt;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import com.ruoyi.common.annotation.EncryptField;
import com.ruoyi.common.encrypt.EncryptContext;
@ -62,12 +62,12 @@ public class MybatisDecryptInterceptor implements Interceptor {
}
if (sourceObject instanceof List<?>) {
List<?> sourceList = (List<?>) sourceObject;
if(CollUtil.isEmpty(sourceList)) {
if(CollectionUtil.isEmpty(sourceList)) {
return;
}
// 判断第一个元素是否含有注解。如果没有直接返回,提高效率
Object firstItem = sourceList.get(0);
if (ObjectUtil.isNull(firstItem) || CollUtil.isEmpty(encryptorManager.getFieldCache(firstItem.getClass()))) {
if (CollectionUtil.isEmpty(encryptorManager.getFieldCache(firstItem.getClass()))) {
return;
}
((List<?>) sourceObject).forEach(this::decryptHandler);
@ -91,9 +91,6 @@ public class MybatisDecryptInterceptor implements Interceptor {
* @return
*/
private String decryptField(String value, Field field) {
if (ObjectUtil.isNull(value)) {
return null;
}
EncryptField encryptField = field.getAnnotation(EncryptField.class);
EncryptContext encryptContext = new EncryptContext();
encryptContext.setAlgorithm(encryptField.algorithm() == AlgorithmType.DEFAULT ? defaultProperties.getAlgorithm() : encryptField.algorithm());

@ -1,6 +1,6 @@
package com.ruoyi.framework.encrypt;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import com.ruoyi.common.annotation.EncryptField;
import com.ruoyi.common.encrypt.EncryptContext;
@ -72,12 +72,12 @@ public class MybatisEncryptInterceptor implements Interceptor {
}
if (sourceObject instanceof List<?>) {
List<?> sourceList = (List<?>) sourceObject;
if(CollUtil.isEmpty(sourceList)) {
if(CollectionUtil.isEmpty(sourceList)) {
return;
}
// 判断第一个元素是否含有注解。如果没有直接返回,提高效率
Object firstItem = sourceList.get(0);
if (ObjectUtil.isNull(firstItem) || CollUtil.isEmpty(encryptorManager.getFieldCache(firstItem.getClass()))) {
if (CollectionUtil.isEmpty(encryptorManager.getFieldCache(firstItem.getClass()))) {
return;
}
((List<?>) sourceObject).forEach(this::encryptHandler);
@ -101,9 +101,6 @@ public class MybatisEncryptInterceptor implements Interceptor {
* @return
*/
private String encryptField(String value, Field field) {
if (ObjectUtil.isNull(value)) {
return null;
}
EncryptField encryptField = field.getAnnotation(EncryptField.class);
EncryptContext encryptContext = new EncryptContext();
encryptContext.setAlgorithm(encryptField.algorithm() == AlgorithmType.DEFAULT ? defaultProperties.getAlgorithm() : encryptField.algorithm());

@ -73,7 +73,7 @@ public class CreateAndUpdateMetaObjectHandler implements MetaObjectHandler {
log.warn("自动注入警告 => 用户未登录");
return null;
}
return ObjectUtil.isNotNull(loginUser) ? loginUser.getUsername() : null;
return loginUser.getUsername();
}
}

@ -26,6 +26,7 @@ public class SaPermissionImpl implements StpInterface {
return new ArrayList<>(loginUser.getMenuPermission());
} else if (userType == UserType.APP_USER) {
// 其他端 自行根据业务编写
return new ArrayList<>(loginUser.getMenuPermission());
}
return new ArrayList<>();
}

@ -5,7 +5,7 @@
<parent>
<artifactId>ruoyi-flowable-plus</artifactId>
<groupId>com.ruoyi</groupId>
<version>0.8.3</version>
<version>0.8.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

@ -11,7 +11,7 @@ import java.util.List;
*
* @author Lion Li
*/
@InterceptorIgnore(dataPermission = "true")
@InterceptorIgnore(dataPermission = "true",tenantLine = "1")
public interface GenTableColumnMapper extends BaseMapperPlus<GenTableColumnMapper, GenTableColumn, GenTableColumn> {
/**
*

@ -13,7 +13,7 @@ import java.util.List;
*
* @author Lion Li
*/
@InterceptorIgnore(dataPermission = "true")
@InterceptorIgnore(dataPermission = "true",tenantLine = "1")
public interface GenTableMapper extends BaseMapperPlus<GenTableMapper, GenTable, GenTable> {
/**

@ -317,11 +317,13 @@ public class GenTableServiceImpl implements IGenTableService {
column.setIsRequired(prevColumn.getIsRequired());
column.setHtmlType(prevColumn.getHtmlType());
}
genTableColumnMapper.updateById(column);
} else {
genTableColumnMapper.insert(column);
}
saveColumns.add(column);
});
if (CollUtil.isNotEmpty(saveColumns)) {
genTableColumnMapper.insertOrUpdateBatch(saveColumns);
genTableColumnMapper.insertBatch(saveColumns);
}
List<GenTableColumn> delColumns = StreamUtils.filter(tableColumns, column -> !dbTableColumnNames.contains(column.getColumnName()));
if (CollUtil.isNotEmpty(delColumns)) {

@ -3,8 +3,8 @@ gen:
# 作者
author: ruoyi
# 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool
packageName: com.ruoyi.system
packageName: com.ruoyi.pay
# 自动去除表前缀默认是false
autoRemovePre: false
# 表前缀(生成类名不会包含表前缀,多个用逗号分隔)
tablePrefix: sys_
tablePrefix: sys_,pay_

@ -5,7 +5,7 @@
<parent>
<artifactId>ruoyi-flowable-plus</artifactId>
<groupId>com.ruoyi</groupId>
<version>0.8.3</version>
<version>0.8.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>

@ -5,7 +5,7 @@
<parent>
<artifactId>ruoyi-flowable-plus</artifactId>
<groupId>com.ruoyi</groupId>
<version>0.8.3</version>
<version>0.8.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

@ -5,7 +5,7 @@
<parent>
<artifactId>ruoyi-flowable-plus</artifactId>
<groupId>com.ruoyi</groupId>
<version>0.8.3</version>
<version>0.8.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

@ -5,7 +5,7 @@
<parent>
<artifactId>ruoyi-flowable-plus</artifactId>
<groupId>com.ruoyi</groupId>
<version>0.8.3</version>
<version>0.8.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

@ -1,5 +1,6 @@
package com.ruoyi.system.mapper;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.ruoyi.common.core.mapper.BaseMapperPlus;
import com.ruoyi.system.domain.SysConfig;
@ -8,6 +9,7 @@ import com.ruoyi.system.domain.SysConfig;
*
* @author Lion Li
*/
@InterceptorIgnore(tenantLine = "1")
public interface SysConfigMapper extends BaseMapperPlus<SysConfigMapper, SysConfig, SysConfig> {
}

@ -1,5 +1,6 @@
package com.ruoyi.system.mapper;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.ruoyi.common.annotation.DataColumn;
@ -15,6 +16,7 @@ import java.util.List;
*
* @author Lion Li
*/
@InterceptorIgnore(tenantLine = "1")
public interface SysDeptMapper extends BaseMapperPlus<SysDeptMapper, SysDept, SysDept> {
/**

@ -1,5 +1,6 @@
package com.ruoyi.system.mapper;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.domain.entity.SysDictData;
@ -12,6 +13,7 @@ import java.util.List;
*
* @author Lion Li
*/
@InterceptorIgnore(tenantLine = "1")
public interface SysDictDataMapper extends BaseMapperPlus<SysDictDataMapper, SysDictData, SysDictData> {
default List<SysDictData> selectDictDataByType(String dictType) {

@ -1,5 +1,6 @@
package com.ruoyi.system.mapper;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.ruoyi.common.core.domain.entity.SysDictType;
import com.ruoyi.common.core.mapper.BaseMapperPlus;
@ -8,6 +9,7 @@ import com.ruoyi.common.core.mapper.BaseMapperPlus;
*
* @author Lion Li
*/
@InterceptorIgnore(tenantLine = "1")
public interface SysDictTypeMapper extends BaseMapperPlus<SysDictTypeMapper, SysDictType, SysDictType> {
}

@ -1,5 +1,6 @@
package com.ruoyi.system.mapper;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.ruoyi.common.core.mapper.BaseMapperPlus;
import com.ruoyi.system.domain.SysLogininfor;
@ -8,6 +9,7 @@ import com.ruoyi.system.domain.SysLogininfor;
*
* @author Lion Li
*/
@InterceptorIgnore(tenantLine = "1")
public interface SysLogininforMapper extends BaseMapperPlus<SysLogininforMapper, SysLogininfor, SysLogininfor> {
}

@ -1,5 +1,6 @@
package com.ruoyi.system.mapper;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
@ -15,6 +16,7 @@ import java.util.List;
*
* @author Lion Li
*/
@InterceptorIgnore(tenantLine = "1")
public interface SysMenuMapper extends BaseMapperPlus<SysMenuMapper, SysMenu, SysMenu> {
/**

@ -1,5 +1,6 @@
package com.ruoyi.system.mapper;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.ruoyi.common.core.mapper.BaseMapperPlus;
import com.ruoyi.system.domain.SysNotice;
@ -8,6 +9,7 @@ import com.ruoyi.system.domain.SysNotice;
*
* @author Lion Li
*/
@InterceptorIgnore(tenantLine = "1")
public interface SysNoticeMapper extends BaseMapperPlus<SysNoticeMapper, SysNotice, SysNotice> {
}

@ -1,5 +1,6 @@
package com.ruoyi.system.mapper;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.ruoyi.common.core.mapper.BaseMapperPlus;
import com.ruoyi.system.domain.SysOperLog;
@ -8,6 +9,7 @@ import com.ruoyi.system.domain.SysOperLog;
*
* @author Lion Li
*/
@InterceptorIgnore(tenantLine = "1")
public interface SysOperLogMapper extends BaseMapperPlus<SysOperLogMapper, SysOperLog, SysOperLog> {
}

@ -1,5 +1,6 @@
package com.ruoyi.system.mapper;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.ruoyi.common.core.mapper.BaseMapperPlus;
import com.ruoyi.system.domain.SysOssConfig;
import com.ruoyi.system.domain.vo.SysOssConfigVo;
@ -11,6 +12,7 @@ import com.ruoyi.system.domain.vo.SysOssConfigVo;
* @author
* @date 2021-08-13
*/
@InterceptorIgnore(tenantLine = "1")
public interface SysOssConfigMapper extends BaseMapperPlus<SysOssConfigMapper, SysOssConfig, SysOssConfigVo> {
}

@ -1,5 +1,6 @@
package com.ruoyi.system.mapper;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.ruoyi.common.core.mapper.BaseMapperPlus;
import com.ruoyi.system.domain.SysOss;
import com.ruoyi.system.domain.vo.SysOssVo;
@ -9,5 +10,6 @@ import com.ruoyi.system.domain.vo.SysOssVo;
*
* @author Lion Li
*/
@InterceptorIgnore(tenantLine = "1")
public interface SysOssMapper extends BaseMapperPlus<SysOssMapper, SysOss, SysOssVo> {
}

@ -1,5 +1,6 @@
package com.ruoyi.system.mapper;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.ruoyi.common.core.mapper.BaseMapperPlus;
import com.ruoyi.system.domain.SysPost;
@ -10,6 +11,7 @@ import java.util.List;
*
* @author Lion Li
*/
@InterceptorIgnore(tenantLine = "1")
public interface SysPostMapper extends BaseMapperPlus<SysPostMapper, SysPost, SysPost> {
/**

@ -1,5 +1,6 @@
package com.ruoyi.system.mapper;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.ruoyi.common.core.mapper.BaseMapperPlus;
import com.ruoyi.system.domain.SysRoleDept;
@ -8,6 +9,7 @@ import com.ruoyi.system.domain.SysRoleDept;
*
* @author Lion Li
*/
@InterceptorIgnore(tenantLine = "1")
public interface SysRoleDeptMapper extends BaseMapperPlus<SysRoleDeptMapper, SysRoleDept, SysRoleDept> {
}

@ -16,6 +16,7 @@ import java.util.List;
*
* @author Lion Li
*/
//@InterceptorIgnore(tenantLine = "1")
public interface SysRoleMapper extends BaseMapperPlus<SysRoleMapper, SysRole, SysRole> {
@DataPermission({

@ -1,5 +1,6 @@
package com.ruoyi.system.mapper;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.ruoyi.common.core.mapper.BaseMapperPlus;
import com.ruoyi.system.domain.SysRoleMenu;
@ -8,6 +9,7 @@ import com.ruoyi.system.domain.SysRoleMenu;
*
* @author Lion Li
*/
@InterceptorIgnore(tenantLine = "1")
public interface SysRoleMenuMapper extends BaseMapperPlus<SysRoleMenuMapper, SysRoleMenu, SysRoleMenu> {
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save