mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2026-01-03 12:05:28 +08:00
Merge branch 'master' into springboot3
# Conflicts: # db/tables_nacos.sql # jeecg-boot-base-core/pom.xml # jeecg-boot-base-core/src/main/java/org/jeecg/config/Swagger2Config.java # jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java # jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysFilesController.java # jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysRoleIndexController.java # jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/entity/SysFiles.java # jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysPermissionServiceImpl.java # jeecg-module-system/jeecg-system-start/pom.xml # jeecg-module-system/jeecg-system-start/src/main/resources/application-dev.yml # jeecg-server-cloud/jeecg-cloud-gateway/pom.xml # jeecg-server-cloud/jeecg-visual/jeecg-cloud-sentinel/pom.xml # pom.xml
This commit is contained in:
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>jeecg-system-api</artifactId>
|
||||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<version>3.6.2</version>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@ -108,7 +108,7 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
* @return 部门 parentIds
|
||||
*/
|
||||
@GetMapping("/sys/api/getDepartParentIdsByDepIds")
|
||||
Set<String> getDepartParentIdsByDepIds(@RequestParam("depIds") Set depIds);
|
||||
Set<String> getDepartParentIdsByDepIds(@RequestParam("depIds") Set<String> depIds);
|
||||
|
||||
/**
|
||||
* 9通过用户账号查询部门 name
|
||||
@ -213,7 +213,7 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/queryAllUser")
|
||||
public JSONObject queryAllUser(@RequestParam(name="userIds",required=false)String userIds, @RequestParam(name="pageNo",required=false) Integer pageNo,@RequestParam(name="pageSize",required=false) int pageSize);
|
||||
public JSONObject queryAllUser(@RequestParam(name="userIds",required=false)String userIds, @RequestParam(name="pageNo",required=false) Integer pageNo,@RequestParam(name="pageSize",required=false) Integer pageSize);
|
||||
|
||||
|
||||
/**
|
||||
@ -307,11 +307,11 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
|
||||
/**
|
||||
* 31获取用户的权限集合
|
||||
* @param username
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/getUserPermissionSet")
|
||||
Set<String> getUserPermissionSet(@RequestParam("username") String username);
|
||||
Set<String> getUserPermissionSet(@RequestParam("userId") String userId);
|
||||
|
||||
/**
|
||||
* 32判断是否有online访问的权限
|
||||
@ -351,12 +351,12 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
|
||||
/**
|
||||
* 36查询用户权限信息
|
||||
* @param username
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@GetMapping("/sys/api/queryUserAuths")
|
||||
Set<String> queryUserAuths(@RequestParam("username")String username);
|
||||
Set<String> queryUserAuths(@RequestParam("userId")String userId);
|
||||
|
||||
/**
|
||||
* 37根据 id 查询数据库中存储的 DynamicDataSourceModel
|
||||
@ -611,20 +611,6 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
@PostMapping("/sys/api/saveDataLog")
|
||||
void saveDataLog(DataLogDTO dataLogDto);
|
||||
|
||||
/**
|
||||
* 添加文件到知识库
|
||||
* @param sysFilesModel
|
||||
*/
|
||||
@PostMapping("/sys/api/addSysFiles")
|
||||
void addSysFiles(SysFilesModel sysFilesModel);
|
||||
|
||||
/**
|
||||
* 通过文件路径获取文件id
|
||||
* @param fileId
|
||||
*/
|
||||
@GetMapping("/sys/api/getFileUrl")
|
||||
String getFileUrl(@RequestParam(name="fileId") String fileId);
|
||||
|
||||
/**
|
||||
* 更新头像
|
||||
* @param loginUser
|
||||
@ -761,7 +747,7 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
@GetMapping("/sys/api/dictTableWhiteListCheckByDict")
|
||||
boolean dictTableWhiteListCheckByDict(
|
||||
@RequestParam("tableOrDictCode") String tableOrDictCode,
|
||||
@RequestParam(value = "fields", required = false) String[] fields
|
||||
@RequestParam(value = "fields", required = false) String... fields
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
@ -71,7 +71,7 @@ public class SysBaseAPIFallback implements ISysBaseAPI {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getDepartParentIdsByDepIds(Set depIds) {
|
||||
public Set<String> getDepartParentIdsByDepIds(Set<String> depIds) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -133,7 +133,7 @@ public class SysBaseAPIFallback implements ISysBaseAPI {
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject queryAllUser(String userIds, Integer pageNo, int pageSize) {
|
||||
public JSONObject queryAllUser(String userIds, Integer pageNo, Integer pageSize) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -194,7 +194,7 @@ public class SysBaseAPIFallback implements ISysBaseAPI {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getUserPermissionSet(String username) {
|
||||
public Set<String> getUserPermissionSet(String userId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -219,7 +219,7 @@ public class SysBaseAPIFallback implements ISysBaseAPI {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> queryUserAuths(String username) {
|
||||
public Set<String> queryUserAuths(String userId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -361,17 +361,6 @@ public class SysBaseAPIFallback implements ISysBaseAPI {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addSysFiles(SysFilesModel sysFilesModel) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFileUrl(String fileId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateAvatar(LoginUser loginUser) { }
|
||||
|
||||
@ -446,7 +435,7 @@ public class SysBaseAPIFallback implements ISysBaseAPI {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean dictTableWhiteListCheckByDict(String tableOrDictCode, String[] fields) {
|
||||
public boolean dictTableWhiteListCheckByDict(String tableOrDictCode, String... fields) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>jeecg-system-api</artifactId>
|
||||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<version>3.6.2</version>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@ -101,7 +101,7 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
* @param depIds
|
||||
* @return 部门 parentIds
|
||||
*/
|
||||
Set<String> getDepartParentIdsByDepIds(Set depIds);
|
||||
Set<String> getDepartParentIdsByDepIds(Set<String> depIds);
|
||||
|
||||
/**
|
||||
* 9通过用户账号查询部门 name
|
||||
@ -302,10 +302,10 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
|
||||
/**
|
||||
* 32获取用户的权限集合
|
||||
* @param username
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
Set<String> getUserPermissionSet(String username);
|
||||
Set<String> getUserPermissionSet(String userId);
|
||||
|
||||
/**
|
||||
* 33判断是否有online访问的权限
|
||||
@ -445,19 +445,6 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
* @param dataLogDto
|
||||
*/
|
||||
void saveDataLog(DataLogDTO dataLogDto);
|
||||
|
||||
/**
|
||||
* 添加文件到知识库
|
||||
* @param sysFilesModel
|
||||
*/
|
||||
void addSysFiles(SysFilesModel sysFilesModel);
|
||||
|
||||
/**
|
||||
* 通过文件路径获取文件id
|
||||
* @param fileId
|
||||
*/
|
||||
String getFileUrl(String fileId);
|
||||
|
||||
/**
|
||||
* 更新头像
|
||||
* @param loginUser
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>jeecg-module-system</artifactId>
|
||||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<version>3.6.2</version>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<artifactId>jeecg-module-system</artifactId>
|
||||
<version>3.6.2</version>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@ -156,7 +156,7 @@ public class SystemApiController {
|
||||
* @return 部门 id
|
||||
*/
|
||||
@GetMapping("/getDepartParentIdsByDepIds")
|
||||
Set<String> getDepartParentIdsByDepIds(@RequestParam("depIds") Set depIds){
|
||||
Set<String> getDepartParentIdsByDepIds(@RequestParam("depIds") Set<String> depIds){
|
||||
return sysBaseApi.getDepartParentIdsByDepIds(depIds);
|
||||
}
|
||||
|
||||
@ -347,7 +347,7 @@ public class SystemApiController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/queryAllUser")
|
||||
public JSONObject queryAllUser(@RequestParam(name="userIds",required=false)String userIds, @RequestParam(name="pageNo",required=false) Integer pageNo,@RequestParam(name="pageSize",required=false) int pageSize){
|
||||
public JSONObject queryAllUser(@RequestParam(name="userIds",required=false)String userIds, @RequestParam(name="pageNo",required=false) Integer pageNo,@RequestParam(name="pageSize",required=false) Integer pageSize){
|
||||
return sysBaseApi.queryAllUser(userIds, pageNo, pageSize);
|
||||
}
|
||||
|
||||
@ -386,12 +386,12 @@ public class SystemApiController {
|
||||
|
||||
/**
|
||||
* 获取用户的权限集合
|
||||
* @param username
|
||||
* @param userId 用户表ID
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getUserPermissionSet")
|
||||
public Set<String> getUserPermissionSet(@RequestParam("username") String username){
|
||||
return sysBaseApi.getUserPermissionSet(username);
|
||||
public Set<String> getUserPermissionSet(@RequestParam("userId") String userId){
|
||||
return sysBaseApi.getUserPermissionSet(userId);
|
||||
}
|
||||
|
||||
//-----
|
||||
@ -419,12 +419,12 @@ public class SystemApiController {
|
||||
|
||||
/**
|
||||
* 查询用户权限信息
|
||||
* @param username
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/queryUserAuths")
|
||||
public Set<String> queryUserAuths(@RequestParam("username") String username){
|
||||
return sysUserService.getUserPermissionsSet(username);
|
||||
public Set<String> queryUserAuths(@RequestParam("userId") String userId){
|
||||
return sysUserService.getUserPermissionsSet(userId);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -578,7 +578,7 @@ public class SystemApiController {
|
||||
* @param tenantId 新的租户ID
|
||||
* @return Map<String, String> Map<原字典编码, 新字典编码>
|
||||
*/
|
||||
@GetMapping("/sys/api/copyLowAppDict")
|
||||
@GetMapping("/copyLowAppDict")
|
||||
Map<String, String> copyLowAppDict(@RequestParam("originalAppId") String originalAppId, @RequestParam("appId") String appId, @RequestParam("tenantId") String tenantId) {
|
||||
return sysBaseApi.copyLowAppDict(originalAppId, appId, tenantId);
|
||||
}
|
||||
@ -732,14 +732,6 @@ public class SystemApiController {
|
||||
this.sysBaseApi.saveDataLog(dataLogDto);
|
||||
}
|
||||
|
||||
@PostMapping("/addSysFiles")
|
||||
public void addSysFiles(@RequestBody SysFilesModel sysFilesModel){this.sysBaseApi.addSysFiles(sysFilesModel);}
|
||||
|
||||
@GetMapping("/getFileUrl")
|
||||
public String getFileUrl(@RequestParam(name="fileId") String fileId){
|
||||
return this.sysBaseApi.getFileUrl(fileId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新头像
|
||||
* @param loginUser
|
||||
@ -858,7 +850,7 @@ public class SystemApiController {
|
||||
* @param deptIds
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/queryUserIdsByDeptIds")
|
||||
@GetMapping("/queryUserIdsByDeptIds")
|
||||
public List<String> queryUserIdsByDeptIds(@RequestParam("deptIds") List<String> deptIds){
|
||||
return sysBaseApi.queryUserIdsByDeptIds(deptIds);
|
||||
}
|
||||
@ -868,7 +860,7 @@ public class SystemApiController {
|
||||
* @param deptIds
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/queryUserAccountsByDeptIds")
|
||||
@GetMapping("/queryUserAccountsByDeptIds")
|
||||
public List<String> queryUserAccountsByDeptIds(@RequestParam("deptIds") List<String> deptIds){
|
||||
return sysBaseApi.queryUserAccountsByDeptIds(deptIds);
|
||||
}
|
||||
@ -878,7 +870,7 @@ public class SystemApiController {
|
||||
* @param roleCodes
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/queryUserIdsByRoleds")
|
||||
@GetMapping("/queryUserIdsByRoleds")
|
||||
public List<String> queryUserIdsByRoleds(@RequestParam("roleCodes") List<String> roleCodes){
|
||||
return sysBaseApi.queryUserIdsByRoleds(roleCodes);
|
||||
}
|
||||
@ -888,7 +880,7 @@ public class SystemApiController {
|
||||
* @param positionIds
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/queryUserIdsByPositionIds")
|
||||
@GetMapping("/queryUserIdsByPositionIds")
|
||||
public List<String> queryUserIdsByPositionIds(@RequestParam("positionIds") List<String> positionIds){
|
||||
return sysBaseApi.queryUserIdsByPositionIds(positionIds);
|
||||
}
|
||||
@ -900,7 +892,7 @@ public class SystemApiController {
|
||||
* @param orgCode 部门编码
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/getUserAccountsByDepCode")
|
||||
@GetMapping("/getUserAccountsByDepCode")
|
||||
public List<String> getUserAccountsByDepCode(String orgCode){
|
||||
return sysBaseApi.getUserAccountsByDepCode(orgCode);
|
||||
}
|
||||
@ -911,7 +903,7 @@ public class SystemApiController {
|
||||
* @param selectSql
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/dictTableWhiteListCheckBySql")
|
||||
@GetMapping("/dictTableWhiteListCheckBySql")
|
||||
public boolean dictTableWhiteListCheckBySql(@RequestParam("selectSql") String selectSql) {
|
||||
return sysBaseApi.dictTableWhiteListCheckBySql(selectSql);
|
||||
}
|
||||
@ -923,10 +915,10 @@ public class SystemApiController {
|
||||
* @param fields 如果传的是dictCode,则该参数必须传null
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/dictTableWhiteListCheckByDict")
|
||||
@GetMapping("/dictTableWhiteListCheckByDict")
|
||||
public boolean dictTableWhiteListCheckByDict(
|
||||
@RequestParam("tableOrDictCode") String tableOrDictCode,
|
||||
@RequestParam(value = "fields", required = false) String[] fields
|
||||
@RequestParam(value = "fields", required = false) String... fields
|
||||
) {
|
||||
return sysBaseApi.dictTableWhiteListCheckByDict(tableOrDictCode, fields);
|
||||
}
|
||||
|
||||
@ -79,6 +79,7 @@ public enum RangeDateEnum {
|
||||
//本周
|
||||
calendar1.set(Calendar.DAY_OF_WEEK, 2);
|
||||
|
||||
calendar2.set(Calendar.DAY_OF_WEEK,2);
|
||||
calendar2.add(Calendar.WEEK_OF_MONTH,1);
|
||||
calendar2.add(Calendar.DAY_OF_WEEK,-1);
|
||||
} else if(SZ.key.equals(key)){
|
||||
|
||||
@ -0,0 +1,25 @@
|
||||
package org.jeecg.modules.system.constant;
|
||||
|
||||
/**
|
||||
* 默认首页常量
|
||||
*/
|
||||
public interface DefIndexConst {
|
||||
|
||||
/**
|
||||
* 默认首页的roleCode
|
||||
*/
|
||||
String DEF_INDEX_ALL = "DEF_INDEX_ALL";
|
||||
|
||||
/**
|
||||
* 默认首页的缓存key
|
||||
*/
|
||||
String CACHE_KEY = "sys:cache:def_index";
|
||||
|
||||
/**
|
||||
* 默认首页的初始值
|
||||
*/
|
||||
String DEF_INDEX_NAME = "首页";
|
||||
String DEF_INDEX_URL = "/dashboard/analysis";
|
||||
String DEF_INDEX_COMPONENT = "dashboard/Analysis";
|
||||
|
||||
}
|
||||
@ -9,8 +9,6 @@ import org.jeecg.common.exception.JeecgBootException;
|
||||
import org.jeecg.common.util.CommonUtils;
|
||||
import org.jeecg.common.util.filter.SsrfFileTypeFilter;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.system.service.ISysFilesService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.util.AntPathMatcher;
|
||||
import org.springframework.util.FileCopyUtils;
|
||||
|
||||
@ -72,32 +72,24 @@ public class LoginController {
|
||||
|
||||
@Operation(summary = "登录接口")
|
||||
@RequestMapping(value = "/login", method = RequestMethod.POST)
|
||||
public Result<JSONObject> login(@RequestBody SysLoginModel sysLoginModel){
|
||||
public Result<JSONObject> login(@RequestBody SysLoginModel sysLoginModel, HttpServletRequest request){
|
||||
Result<JSONObject> result = new Result<JSONObject>();
|
||||
String username = sysLoginModel.getUsername();
|
||||
String password = sysLoginModel.getPassword();
|
||||
//update-begin-author:taoyan date:2022-11-7 for: issues/4109 平台用户登录失败锁定用户
|
||||
if(isLoginFailOvertimes(username)){
|
||||
return result.error500("该用户登录失败次数过多,请于10分钟后再次登录!");
|
||||
}
|
||||
//update-end-author:taoyan date:2022-11-7 for: issues/4109 平台用户登录失败锁定用户
|
||||
//update-begin--Author:scott Date:20190805 for:暂时注释掉密码加密逻辑,有点问题
|
||||
//前端密码加密,后端进行密码解密
|
||||
//password = AesEncryptUtil.desEncrypt(sysLoginModel.getPassword().replaceAll("%2B", "\\+")).trim();//密码解密
|
||||
//update-begin--Author:scott Date:20190805 for:暂时注释掉密码加密逻辑,有点问题
|
||||
|
||||
//update-begin-author:taoyan date:20190828 for:校验验证码
|
||||
// step.1 验证码check
|
||||
String captcha = sysLoginModel.getCaptcha();
|
||||
if(captcha==null){
|
||||
result.error500("验证码无效");
|
||||
return result;
|
||||
}
|
||||
String lowerCaseCaptcha = captcha.toLowerCase();
|
||||
//update-begin-author:taoyan date:2022-9-13 for: VUEN-2245 【漏洞】发现新漏洞待处理20220906
|
||||
// 加入密钥作为混淆,避免简单的拼接,被外部利用,用户自定义该密钥即可
|
||||
String origin = lowerCaseCaptcha+sysLoginModel.getCheckKey()+jeecgBaseConfig.getSignatureSecret();
|
||||
String realKey = Md5Util.md5Encode(origin, "utf-8");
|
||||
//update-end-author:taoyan date:2022-9-13 for: VUEN-2245 【漏洞】发现新漏洞待处理20220906
|
||||
Object checkCode = redisUtil.get(realKey);
|
||||
//当进入登录页时,有一定几率出现验证码错误 #1714
|
||||
if(checkCode==null || !checkCode.toString().equals(lowerCaseCaptcha)) {
|
||||
@ -107,40 +99,36 @@ public class LoginController {
|
||||
result.setCode(HttpStatus.PRECONDITION_FAILED.value());
|
||||
return result;
|
||||
}
|
||||
//update-end-author:taoyan date:20190828 for:校验验证码
|
||||
|
||||
//1. 校验用户是否有效
|
||||
//update-begin-author:wangshuai date:20200601 for: 登录代码验证用户是否注销bug,if条件永远为false
|
||||
// step.2 校验用户是否存在且有效
|
||||
LambdaQueryWrapper<SysUser> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(SysUser::getUsername,username);
|
||||
SysUser sysUser = sysUserService.getOne(queryWrapper);
|
||||
//update-end-author:wangshuai date:20200601 for: 登录代码验证用户是否注销bug,if条件永远为false
|
||||
result = sysUserService.checkUserIsEffective(sysUser);
|
||||
if(!result.isSuccess()) {
|
||||
return result;
|
||||
}
|
||||
|
||||
//2. 校验用户名或密码是否正确
|
||||
// step.3 校验用户名或密码是否正确
|
||||
String userpassword = PasswordUtil.encrypt(username, password, sysUser.getSalt());
|
||||
String syspassword = sysUser.getPassword();
|
||||
if (!syspassword.equals(userpassword)) {
|
||||
//update-begin-author:taoyan date:2022-11-7 for: issues/4109 平台用户登录失败锁定用户
|
||||
addLoginFailOvertimes(username);
|
||||
//update-end-author:taoyan date:2022-11-7 for: issues/4109 平台用户登录失败锁定用户
|
||||
result.error500("用户名或密码错误");
|
||||
return result;
|
||||
}
|
||||
|
||||
//用户登录信息
|
||||
userInfo(sysUser, result);
|
||||
//update-begin--Author:liusq Date:20210126 for:登录成功,删除redis中的验证码
|
||||
|
||||
// step.4 登录成功获取用户信息
|
||||
userInfo(sysUser, result, request);
|
||||
|
||||
// step.5 登录成功删除验证码
|
||||
redisUtil.del(realKey);
|
||||
//update-begin--Author:liusq Date:20210126 for:登录成功,删除redis中的验证码
|
||||
redisUtil.del(CommonConstant.LOGIN_FAIL + username);
|
||||
|
||||
// step.6 记录用户登录日志
|
||||
LoginUser loginUser = new LoginUser();
|
||||
BeanUtils.copyProperties(sysUser, loginUser);
|
||||
baseCommonService.addLog("用户名: " + username + ",登录成功!", CommonConstant.LOG_TYPE_1, null,loginUser);
|
||||
//update-end--Author:wangshuai Date:20200714 for:登录日志没有记录人员
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -150,18 +138,20 @@ public class LoginController {
|
||||
*/
|
||||
@GetMapping("/user/getUserInfo")
|
||||
public Result<JSONObject> getUserInfo(HttpServletRequest request){
|
||||
long start = System.currentTimeMillis();
|
||||
Result<JSONObject> result = new Result<JSONObject>();
|
||||
String username = JwtUtil.getUserNameByToken(request);
|
||||
if(oConvertUtils.isNotEmpty(username)) {
|
||||
// 根据用户名查询用户信息
|
||||
SysUser sysUser = sysUserService.getUserByName(username);
|
||||
JSONObject obj=new JSONObject();
|
||||
log.info("1 获取用户信息耗时(用户基础信息)" + (System.currentTimeMillis() - start) + "毫秒");
|
||||
|
||||
//update-begin---author:scott ---date:2022-06-20 for:vue3前端,支持自定义首页-----------
|
||||
String version = request.getHeader(CommonConstant.VERSION);
|
||||
String vue3Version = request.getHeader(CommonConstant.VERSION);
|
||||
//update-begin---author:liusq ---date:2022-06-29 for:接口返回值修改,同步修改这里的判断逻辑-----------
|
||||
SysRoleIndex roleIndex = sysUserService.getDynamicIndexByUserRole(username, version);
|
||||
if (oConvertUtils.isNotEmpty(version) && roleIndex != null && oConvertUtils.isNotEmpty(roleIndex.getUrl())) {
|
||||
SysRoleIndex roleIndex = sysUserService.getDynamicIndexByUserRole(username, vue3Version);
|
||||
if (oConvertUtils.isNotEmpty(vue3Version) && roleIndex != null && oConvertUtils.isNotEmpty(roleIndex.getUrl())) {
|
||||
String homePath = roleIndex.getUrl();
|
||||
if (!homePath.startsWith(SymbolConstant.SINGLE_SLASH)) {
|
||||
homePath = SymbolConstant.SINGLE_SLASH + homePath;
|
||||
@ -170,12 +160,16 @@ public class LoginController {
|
||||
}
|
||||
//update-begin---author:liusq ---date:2022-06-29 for:接口返回值修改,同步修改这里的判断逻辑-----------
|
||||
//update-end---author:scott ---date::2022-06-20 for:vue3前端,支持自定义首页--------------
|
||||
log.info("2 获取用户信息耗时 (首页面配置)" + (System.currentTimeMillis() - start) + "毫秒");
|
||||
|
||||
obj.put("userInfo",sysUser);
|
||||
obj.put("sysAllDictItems", sysDictService.queryAllDictItems());
|
||||
log.info("3 获取用户信息耗时 (字典数据)" + (System.currentTimeMillis() - start) + "毫秒");
|
||||
|
||||
result.setResult(obj);
|
||||
result.success("");
|
||||
}
|
||||
log.info("end 获取用户信息耗时 " + (System.currentTimeMillis() - start) + "毫秒");
|
||||
return result;
|
||||
|
||||
}
|
||||
@ -397,7 +391,7 @@ public class LoginController {
|
||||
*/
|
||||
@Operation(summary ="手机号登录接口")
|
||||
@PostMapping("/phoneLogin")
|
||||
public Result<JSONObject> phoneLogin(@RequestBody JSONObject jsonObject) {
|
||||
public Result<JSONObject> phoneLogin(@RequestBody JSONObject jsonObject, HttpServletRequest request) {
|
||||
Result<JSONObject> result = new Result<JSONObject>();
|
||||
String phone = jsonObject.getString("mobile");
|
||||
//update-begin-author:taoyan date:2022-11-7 for: issues/4109 平台用户登录失败锁定用户
|
||||
@ -423,11 +417,10 @@ public class LoginController {
|
||||
//update-begin-author:taoyan date:2022-11-7 for: issues/4109 平台用户登录失败锁定用户
|
||||
addLoginFailOvertimes(phone);
|
||||
//update-end-author:taoyan date:2022-11-7 for: issues/4109 平台用户登录失败锁定用户
|
||||
result.setMessage("手机验证码错误");
|
||||
return result;
|
||||
return Result.error("手机验证码错误");
|
||||
}
|
||||
//用户信息
|
||||
userInfo(sysUser, result);
|
||||
userInfo(sysUser, result, request);
|
||||
//添加日志
|
||||
baseCommonService.addLog("用户名: " + sysUser.getUsername() + ",登录成功!", CommonConstant.LOG_TYPE_1, null);
|
||||
|
||||
@ -442,7 +435,7 @@ public class LoginController {
|
||||
* @param result
|
||||
* @return
|
||||
*/
|
||||
private Result<JSONObject> userInfo(SysUser sysUser, Result<JSONObject> result) {
|
||||
private Result<JSONObject> userInfo(SysUser sysUser, Result<JSONObject> result, HttpServletRequest request) {
|
||||
String username = sysUser.getUsername();
|
||||
String syspassword = sysUser.getPassword();
|
||||
// 获取用户部门信息
|
||||
@ -482,7 +475,15 @@ public class LoginController {
|
||||
// update-end--Author:wangshuai Date:20200805 for:如果用戶为选择部门,数据库为存在上一次登录部门,则取一条存进去
|
||||
obj.put("multi_depart", 2);
|
||||
}
|
||||
obj.put("sysAllDictItems", sysDictService.queryAllDictItems());
|
||||
|
||||
//update-begin---author:scott ---date:2024-01-05 for:【QQYUN-7802】前端在登录时加载了两次数据字典,建议优化下,避免数据字典太多时可能产生的性能问题 #956---
|
||||
// login接口,在vue3前端下不加载字典数据,vue2下加载字典
|
||||
String vue3Version = request.getHeader(CommonConstant.VERSION);
|
||||
if(oConvertUtils.isEmpty(vue3Version)){
|
||||
obj.put("sysAllDictItems", sysDictService.queryAllDictItems());
|
||||
}
|
||||
//end-begin---author:scott ---date:2024-01-05 for:【QQYUN-7802】前端在登录时加载了两次数据字典,建议优化下,避免数据字典太多时可能产生的性能问题 #956---
|
||||
|
||||
result.setResult(obj);
|
||||
result.success("登录成功");
|
||||
return result;
|
||||
@ -543,7 +544,7 @@ public class LoginController {
|
||||
@RequiresRoles({"admin"})
|
||||
@GetMapping(value = "/switchVue3Menu")
|
||||
public Result<String> switchVue3Menu(HttpServletResponse response) {
|
||||
Result<String> res = new Result<String>();
|
||||
Result<String> res = new Result<String>();
|
||||
sysPermissionService.switchVue3Menu();
|
||||
return res;
|
||||
}
|
||||
@ -588,10 +589,12 @@ public class LoginController {
|
||||
String orgCode = sysUser.getOrgCode();
|
||||
if(oConvertUtils.isEmpty(orgCode)) {
|
||||
//如果当前用户无选择部门 查看部门关联信息
|
||||
|
||||
List<SysDepart> departs = sysDepartService.queryUserDeparts(sysUser.getId());
|
||||
//update-begin-author:taoyan date:20220117 for: JTC-1068【app】新建用户,没有设置部门及角色,点击登录提示暂未归属部,一直在登录页面 使用手机号登录 可正常
|
||||
if (departs == null || departs.size() == 0) {
|
||||
/*result.error500("用户暂未归属部门,不可登录!");
|
||||
|
||||
return result;*/
|
||||
}else{
|
||||
orgCode = departs.get(0).getOrgCode();
|
||||
@ -727,8 +730,8 @@ public class LoginController {
|
||||
if(failTime!=null){
|
||||
val = Integer.parseInt(failTime.toString());
|
||||
}
|
||||
// 10分钟
|
||||
redisUtil.set(key, ++val, 10);
|
||||
// 10分钟,一分钟为60s
|
||||
redisUtil.set(key, ++val, 600);
|
||||
}
|
||||
|
||||
}
|
||||
@ -333,6 +333,7 @@ public class SysAnnouncementController {
|
||||
*/
|
||||
@RequestMapping(value = "/listByUser", method = RequestMethod.GET)
|
||||
public Result<Map<String, Object>> listByUser(@RequestParam(required = false, defaultValue = "5") Integer pageSize) {
|
||||
long start = System.currentTimeMillis();
|
||||
Result<Map<String,Object>> result = new Result<Map<String,Object>>();
|
||||
Map<String,Object> sysMsgMap = new HashMap(5);
|
||||
LoginUser sysUser = (LoginUser)SecurityUtils.getSubject().getPrincipal();
|
||||
@ -349,12 +350,16 @@ public class SysAnnouncementController {
|
||||
anntMsgList = sysAnnouncementService.querySysCementPageByUserId(anntMsgList,userId,"1");
|
||||
sysMsgMap.put("anntMsgList", anntMsgList.getRecords());
|
||||
sysMsgMap.put("anntMsgTotal", anntMsgList.getTotal());
|
||||
|
||||
log.info("begin 获取用户系统公告 (通知)" + (System.currentTimeMillis() - start) + "毫秒");
|
||||
|
||||
//系统消息
|
||||
Page<SysAnnouncement> sysMsgList = new Page<SysAnnouncement>(0, pageSize);
|
||||
sysMsgList = sysAnnouncementService.querySysCementPageByUserId(sysMsgList,userId,"2");
|
||||
sysMsgMap.put("sysMsgList", sysMsgList.getRecords());
|
||||
sysMsgMap.put("sysMsgTotal", sysMsgList.getTotal());
|
||||
|
||||
log.info("end 获取用户系统公告 (系统消息)" + (System.currentTimeMillis() - start) + "毫秒");
|
||||
|
||||
result.setSuccess(true);
|
||||
result.setResult(sysMsgMap);
|
||||
|
||||
@ -600,9 +600,10 @@ public class SysDictController {
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/deleteList", method = RequestMethod.GET)
|
||||
public Result<List<SysDict>> deleteList() {
|
||||
public Result<List<SysDict>> deleteList(HttpServletRequest request) {
|
||||
Result<List<SysDict>> result = new Result<List<SysDict>>();
|
||||
List<SysDict> list = this.sysDictService.queryDeleteList();
|
||||
String tenantId = TokenUtils.getTenantIdByRequest(request);
|
||||
List<SysDict> list = this.sysDictService.queryDeleteList(tenantId);
|
||||
result.setSuccess(true);
|
||||
result.setResult(list);
|
||||
return result;
|
||||
|
||||
@ -1,152 +0,0 @@
|
||||
package org.jeecg.modules.system.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.modules.system.entity.SysFiles;
|
||||
import org.jeecg.modules.system.service.ISysFilesService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @Description: 知识库-文档管理
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2022-07-21
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Tag(name = "知识库-文档管理")
|
||||
@RestController
|
||||
@RequestMapping("/sys/files")
|
||||
public class SysFilesController extends JeecgController<SysFiles, ISysFilesService> {
|
||||
@Autowired
|
||||
private ISysFilesService sysFilesService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param sysFiles
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "知识库-文档管理-分页列表查询")
|
||||
@Operation(summary = "知识库-文档管理-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<?> queryPageList(SysFiles sysFiles,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<SysFiles> queryWrapper = QueryGenerator.initQueryWrapper(sysFiles, req.getParameterMap());
|
||||
Page<SysFiles> page = new Page<SysFiles>(pageNo, pageSize);
|
||||
IPage<SysFiles> pageList = sysFilesService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param sysFiles
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "知识库-文档管理-添加")
|
||||
@Operation(summary = "知识库-文档管理-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@RequestBody SysFiles sysFiles) {
|
||||
sysFilesService.save(sysFiles);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param sysFiles
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "知识库-文档管理-编辑")
|
||||
@Operation(summary = "知识库-文档管理-编辑")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<?> edit(@RequestBody SysFiles sysFiles) {
|
||||
sysFilesService.updateById(sysFiles);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "知识库-文档管理-通过id删除")
|
||||
@Operation(summary = "知识库-文档管理-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
sysFilesService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "知识库-文档管理-批量删除")
|
||||
@Operation(summary = "知识库-文档管理-批量删除")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
this.sysFilesService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "知识库-文档管理-通过id查询")
|
||||
@Operation(summary = "知识库-文档管理-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<?> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
SysFiles sysFiles = sysFilesService.getById(id);
|
||||
return Result.OK(sysFiles);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param sysFiles
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, SysFiles sysFiles) {
|
||||
return super.exportXls(request, sysFiles, SysFiles.class, "知识库-文档管理");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, SysFiles.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,15 +1,12 @@
|
||||
package org.jeecg.modules.system.controller;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.apache.shiro.authz.annotation.RequiresRoles;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.constant.SymbolConstant;
|
||||
@ -19,6 +16,7 @@ import org.jeecg.common.util.Md5Util;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.config.JeecgBaseConfig;
|
||||
import org.jeecg.modules.base.service.BaseCommonService;
|
||||
import org.jeecg.modules.system.constant.DefIndexConst;
|
||||
import org.jeecg.modules.system.entity.*;
|
||||
import org.jeecg.modules.system.model.SysPermissionTree;
|
||||
import org.jeecg.modules.system.model.TreeModel;
|
||||
@ -246,38 +244,66 @@ public class SysPermissionController {
|
||||
if (oConvertUtils.isEmpty(loginUser)) {
|
||||
return Result.error("请登录系统!");
|
||||
}
|
||||
List<SysPermission> metaList = sysPermissionService.queryByUser(loginUser.getUsername());
|
||||
List<SysPermission> metaList = sysPermissionService.queryByUser(loginUser.getId());
|
||||
//添加首页路由
|
||||
//update-begin-author:taoyan date:20200211 for: TASK #3368 【路由缓存】首页的缓存设置有问题,需要根据后台的路由配置来实现是否缓存
|
||||
if(!PermissionDataUtil.hasIndexPage(metaList)){
|
||||
SysPermission indexMenu = sysPermissionService.list(new LambdaQueryWrapper<SysPermission>().eq(SysPermission::getName,"首页")).get(0);
|
||||
metaList.add(0,indexMenu);
|
||||
}
|
||||
//update-end-author:taoyan date:20200211 for: TASK #3368 【路由缓存】首页的缓存设置有问题,需要根据后台的路由配置来实现是否缓存
|
||||
|
||||
//update-begin--Author:zyf Date:20220425 for:自定义首页地址 LOWCOD-1578
|
||||
String version = request.getHeader(CommonConstant.VERSION);
|
||||
//update-begin---author:liusq ---date:2022-06-29 for:接口返回值修改,同步修改这里的判断逻辑-----------
|
||||
SysRoleIndex roleIndex= sysUserService.getDynamicIndexByUserRole(loginUser.getUsername(),version);
|
||||
//update-end---author:liusq ---date:2022-06-29 for:接口返回值修改,同步修改这里的判断逻辑-----------
|
||||
SysRoleIndex defIndexCfg = sysUserService.getDynamicIndexByUserRole(loginUser.getUsername(), version);
|
||||
if (defIndexCfg == null) {
|
||||
defIndexCfg = sysRoleIndexService.initDefaultIndex();
|
||||
}
|
||||
//update-end--Author:zyf Date:20220425 for:自定义首页地址 LOWCOD-1578
|
||||
|
||||
if(roleIndex!=null){
|
||||
List<SysPermission> menus = metaList.stream().filter(sysPermission -> "首页".equals(sysPermission.getName())).collect(Collectors.toList());
|
||||
//update-begin---author:liusq ---date:2022-06-29 for:设置自定义首页地址和组件----------
|
||||
String component = roleIndex.getComponent();
|
||||
String routeUrl = roleIndex.getUrl();
|
||||
boolean route = roleIndex.isRoute();
|
||||
if(oConvertUtils.isNotEmpty(routeUrl)){
|
||||
// 如果没有授权角色首页,则自动添加首页路由
|
||||
if (!PermissionDataUtil.hasIndexPage(metaList, defIndexCfg)) {
|
||||
LambdaQueryWrapper<SysPermission> indexQueryWrapper = new LambdaQueryWrapper<>();
|
||||
indexQueryWrapper.eq(SysPermission::getUrl, defIndexCfg.getUrl());
|
||||
SysPermission indexMenu = sysPermissionService.getOne(indexQueryWrapper);
|
||||
if (indexMenu == null) {
|
||||
indexMenu = new SysPermission();
|
||||
indexMenu.setUrl(defIndexCfg.getUrl());
|
||||
indexMenu.setComponent(defIndexCfg.getComponent());
|
||||
indexMenu.setRoute(defIndexCfg.isRoute());
|
||||
indexMenu.setName(DefIndexConst.DEF_INDEX_NAME);
|
||||
indexMenu.setMenuType(0);
|
||||
}
|
||||
// 如果没有授权一级菜单,则自身变为一级菜单
|
||||
if (indexMenu.getParentId() != null && !PermissionDataUtil.hasMenuById(metaList, indexMenu.getParentId())) {
|
||||
indexMenu.setMenuType(0);
|
||||
indexMenu.setParentId(null);
|
||||
}
|
||||
if (oConvertUtils.isEmpty(indexMenu.getIcon())) {
|
||||
indexMenu.setIcon("ant-design:home");
|
||||
}
|
||||
metaList.add(0, indexMenu);
|
||||
}
|
||||
//update-end-author:taoyan date:20200211 for: TASK #3368 【路由缓存】首页的缓存设置有问题,需要根据后台的路由配置来实现是否缓存
|
||||
|
||||
/* TODO 注: 这段代码的主要作用是:把首页菜单的组件替换成角色菜单的组件,由于现在的逻辑如果角色菜单不存在则自动插入一条,所以这段代码暂时不需要
|
||||
List<SysPermission> menus = metaList.stream().filter(sysPermission -> {
|
||||
if (defIndexCfg.getUrl().equals(sysPermission.getUrl())) {
|
||||
return true;
|
||||
}
|
||||
return defIndexCfg.getUrl().equals(sysPermission.getUrl());
|
||||
}).collect(Collectors.toList());
|
||||
//update-begin---author:liusq ---date:2022-06-29 for:设置自定义首页地址和组件----------
|
||||
if (menus.size() == 1) {
|
||||
String component = defIndexCfg.getComponent();
|
||||
String routeUrl = defIndexCfg.getUrl();
|
||||
boolean route = defIndexCfg.isRoute();
|
||||
if (oConvertUtils.isNotEmpty(routeUrl)) {
|
||||
menus.get(0).setComponent(component);
|
||||
menus.get(0).setRoute(route);
|
||||
menus.get(0).setUrl(routeUrl);
|
||||
}else{
|
||||
} else {
|
||||
menus.get(0).setComponent(component);
|
||||
}
|
||||
//update-end---author:liusq ---date:2022-06-29 for:设置自定义首页地址和组件-----------
|
||||
}
|
||||
|
||||
//update-end---author:liusq ---date:2022-06-29 for:设置自定义首页地址和组件-----------
|
||||
*/
|
||||
|
||||
JSONObject json = new JSONObject();
|
||||
JSONArray menujsonArray = new JSONArray();
|
||||
this.getPermissionJsonArray(menujsonArray, metaList, null);
|
||||
@ -287,7 +313,7 @@ public class SysPermissionController {
|
||||
JSONArray authjsonArray = new JSONArray();
|
||||
this.getAuthJsonArray(authjsonArray, metaList);
|
||||
//查询所有的权限
|
||||
LambdaQueryWrapper<SysPermission> query = new LambdaQueryWrapper<SysPermission>();
|
||||
LambdaQueryWrapper<SysPermission> query = new LambdaQueryWrapper<SysPermission>().select( SysPermission::getName, SysPermission::getPermsType, SysPermission::getPerms, SysPermission::getStatus);
|
||||
query.eq(SysPermission::getDelFlag, CommonConstant.DEL_FLAG_0);
|
||||
query.eq(SysPermission::getMenuType, CommonConstant.MENU_TYPE_2);
|
||||
//query.eq(SysPermission::getStatus, "1");
|
||||
@ -298,6 +324,12 @@ public class SysPermissionController {
|
||||
json.put("menu", menujsonArray);
|
||||
//按钮权限(用户拥有的权限集合)
|
||||
json.put("auth", authjsonArray);
|
||||
// 按钮权限(用户拥有的权限集合)
|
||||
List<String> codeList = metaList.stream()
|
||||
.filter((permission) -> CommonConstant.MENU_TYPE_2.equals(permission.getMenuType()) && CommonConstant.STATUS_1.equals(permission.getStatus()))
|
||||
.collect(ArrayList::new, (list, permission) -> list.add(permission.getPerms()), ArrayList::addAll);
|
||||
// 所拥有的权限编码(vue3专用)
|
||||
json.put("codeList", codeList);
|
||||
//全部权限配置集合(按钮权限,访问权限)
|
||||
json.put("allAuth", allauthjsonArray);
|
||||
//数据源安全模式
|
||||
@ -325,7 +357,7 @@ public class SysPermissionController {
|
||||
return Result.error("请登录系统!");
|
||||
}
|
||||
// 获取当前用户的权限集合
|
||||
List<SysPermission> metaList = sysPermissionService.queryByUser(loginUser.getUsername());
|
||||
List<SysPermission> metaList = sysPermissionService.queryByUser(loginUser.getId());
|
||||
// 按钮权限(用户拥有的权限集合)
|
||||
List<String> codeList = metaList.stream()
|
||||
.filter((permission) -> CommonConstant.MENU_TYPE_2.equals(permission.getMenuType()) && CommonConstant.STATUS_1.equals(permission.getStatus()))
|
||||
@ -334,7 +366,7 @@ public class SysPermissionController {
|
||||
JSONArray authArray = new JSONArray();
|
||||
this.getAuthJsonArray(authArray, metaList);
|
||||
// 查询所有的权限
|
||||
LambdaQueryWrapper<SysPermission> query = new LambdaQueryWrapper<>();
|
||||
LambdaQueryWrapper<SysPermission> query = new LambdaQueryWrapper<SysPermission>().select( SysPermission::getName, SysPermission::getPermsType, SysPermission::getPerms, SysPermission::getStatus);
|
||||
query.eq(SysPermission::getDelFlag, CommonConstant.DEL_FLAG_0);
|
||||
query.eq(SysPermission::getMenuType, CommonConstant.MENU_TYPE_2);
|
||||
List<SysPermission> allAuthList = sysPermissionService.list(query);
|
||||
|
||||
@ -123,13 +123,8 @@ public class SysRoleController {
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
Result<IPage<SysRole>> result = new Result<IPage<SysRole>>();
|
||||
|
||||
//update-begin---author:wangshuai---date:2023-11-20---for:【QQYUN-7089】低代码模式 选择组织角色没有数据 在租户角色中添加数据后,列表也无数据展示---
|
||||
if(MybatisPlusSaasConfig.OPEN_SYSTEM_TENANT_CONTROL){
|
||||
//此接口必须通过租户来隔离查询
|
||||
role.setTenantId(oConvertUtils.getInt(!"0".equals(TenantContext.getTenant()) ? TenantContext.getTenant() : "", -1));
|
||||
}
|
||||
//update-end---author:wangshuai---date:2023-11-20---for:【QQYUN-7089】低代码模式 选择组织角色没有数据 在租户角色中添加数据后,列表也无数据展示---
|
||||
//此接口必须通过租户来隔离查询
|
||||
role.setTenantId(oConvertUtils.getInt(!"0".equals(TenantContext.getTenant()) ? TenantContext.getTenant() : "", -1));
|
||||
|
||||
QueryWrapper<SysRole> queryWrapper = QueryGenerator.initQueryWrapper(role, req.getParameterMap());
|
||||
Page<SysRole> page = new Page<SysRole>(pageNo, pageSize);
|
||||
@ -220,6 +215,12 @@ public class SysRoleController {
|
||||
return Result.error("删除角色失败,当前角色不在此租户中。");
|
||||
}
|
||||
}
|
||||
|
||||
//update-begin---author:wangshuai---date:2024-01-16---for:【QQYUN-7974】禁止删除 admin 角色---
|
||||
//是否存在admin角色
|
||||
sysRoleService.checkAdminRoleRejectDel(id);
|
||||
//update-end---author:wangshuai---date:2024-01-16---for:【QQYUN-7974】禁止删除 admin 角色---
|
||||
|
||||
sysRoleService.deleteRole(id);
|
||||
return Result.ok("删除角色成功");
|
||||
}
|
||||
@ -252,6 +253,8 @@ public class SysRoleController {
|
||||
}
|
||||
}
|
||||
}
|
||||
//验证是否为admin角色
|
||||
sysRoleService.checkAdminRoleRejectDel(ids);
|
||||
sysRoleService.deleteBatchRole(ids.split(","));
|
||||
result.success("删除角色成功!");
|
||||
}
|
||||
|
||||
@ -173,4 +173,32 @@ public class SysRoleIndexController extends JeecgController<SysRoleIndex, ISysRo
|
||||
SysRoleIndex sysRoleIndex = sysRoleIndexService.getOne(new LambdaQueryWrapper<SysRoleIndex>().eq(SysRoleIndex::getRoleCode, roleCode));
|
||||
return Result.OK(sysRoleIndex);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询默认首页配置
|
||||
*/
|
||||
@GetMapping("/queryDefIndex")
|
||||
public Result<SysRoleIndex> queryDefIndex() {
|
||||
SysRoleIndex defIndexCfg = sysRoleIndexService.queryDefaultIndex();
|
||||
return Result.OK(defIndexCfg);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新默认首页配置
|
||||
*/
|
||||
@RequiresPermissions("system:permission:setDefIndex")
|
||||
@PutMapping("/updateDefIndex")
|
||||
public Result<?> updateDefIndex(
|
||||
@RequestParam("url") String url,
|
||||
@RequestParam("component") String component,
|
||||
@RequestParam("isRoute") Boolean isRoute
|
||||
) {
|
||||
boolean success = sysRoleIndexService.updateDefaultIndex(url, component, isRoute);
|
||||
if (success) {
|
||||
return Result.OK("设置成功");
|
||||
} else {
|
||||
return Result.error("设置失败");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -244,6 +244,7 @@ public class SysUserController {
|
||||
Result<SysUser> result = new Result<SysUser>();
|
||||
try {
|
||||
String ids = jsonObject.getString("ids");
|
||||
sysUserService.checkUserAdminRejectDel(ids);
|
||||
String status = jsonObject.getString("status");
|
||||
String[] arr = ids.split(",");
|
||||
for (String id : arr) {
|
||||
@ -1428,7 +1429,7 @@ public class SysUserController {
|
||||
//------------------------------------------------------------------------------------------------
|
||||
//是否开启系统管理模块的多租户数据隔离【SAAS多租户模式】
|
||||
if (MybatisPlusSaasConfig.OPEN_SYSTEM_TENANT_CONTROL) {
|
||||
String tenantId = TokenUtils.getTenantIdByRequest(request);
|
||||
String tenantId = oConvertUtils.getString(TokenUtils.getTenantIdByRequest(request),"-1");
|
||||
//update-begin---author:wangshuai ---date:20221223 for:[QQYUN-3371]租户逻辑改造,改成关系表------------
|
||||
List<String> userIds = userTenantService.getUserIdsByTenantId(Integer.valueOf(tenantId));
|
||||
if (oConvertUtils.listIsNotEmpty(userIds)) {
|
||||
@ -1549,7 +1550,8 @@ public class SysUserController {
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
@RequestParam(name = "departId", required = false) String departId,
|
||||
@RequestParam(name = "roleId", required = false) String roleId,
|
||||
@RequestParam(name="keyword",required=false) String keyword) {
|
||||
@RequestParam(name="keyword",required=false) String keyword,
|
||||
@RequestParam(name="excludeUserIdList",required = false) String excludeUserIdList) {
|
||||
//------------------------------------------------------------------------------------------------
|
||||
Integer tenantId = null;
|
||||
//是否开启系统管理模块的多租户数据隔离【SAAS多租户模式】
|
||||
@ -1560,7 +1562,7 @@ public class SysUserController {
|
||||
}
|
||||
}
|
||||
//------------------------------------------------------------------------------------------------
|
||||
IPage<SysUser> pageList = sysUserDepartService.getUserInformation(tenantId, departId,roleId, keyword, pageSize, pageNo);
|
||||
IPage<SysUser> pageList = sysUserDepartService.getUserInformation(tenantId, departId,roleId, keyword, pageSize, pageNo,excludeUserIdList);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
|
||||
@ -61,7 +61,7 @@ public class SysUserOnlineController {
|
||||
online.setToken(token);
|
||||
//TODO 改成一次性查询
|
||||
LoginUser loginUser = sysBaseApi.getUserByName(JwtUtil.getUsername(token));
|
||||
if (loginUser != null) {
|
||||
if (loginUser != null && !"_reserve_user_external".equals(loginUser.getUsername())) {
|
||||
//update-begin---author:wangshuai ---date:20220104 for:[JTC-382]在线用户查询无效------------
|
||||
//验证用户名是否与传过来的用户名相同
|
||||
boolean isMatchUsername=true;
|
||||
|
||||
@ -14,6 +14,7 @@ import org.jeecg.common.constant.SymbolConstant;
|
||||
import org.jeecg.common.constant.enums.MessageTypeEnum;
|
||||
import org.jeecg.common.system.util.JwtUtil;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.jeecg.common.util.TokenUtils;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.config.mybatis.MybatisPlusSaasConfig;
|
||||
import org.jeecg.modules.system.entity.SysThirdAccount;
|
||||
@ -22,6 +23,8 @@ import org.jeecg.modules.system.service.ISysThirdAccountService;
|
||||
import org.jeecg.modules.system.service.ISysThirdAppConfigService;
|
||||
import org.jeecg.modules.system.service.impl.ThirdAppDingtalkServiceImpl;
|
||||
import org.jeecg.modules.system.service.impl.ThirdAppWechatEnterpriseServiceImpl;
|
||||
import org.jeecg.modules.system.vo.thirdapp.JwSysUserDepartVo;
|
||||
import org.jeecg.modules.system.vo.thirdapp.JwUserDepartVo;
|
||||
import org.jeecg.modules.system.vo.thirdapp.SyncInfoVo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -518,4 +521,46 @@ public class ThirdAppController {
|
||||
return Result.ok("解绑成功");
|
||||
}
|
||||
//========================end 应用低代码账号设置第三方账号绑定 ================================
|
||||
|
||||
/**
|
||||
* 获取企业微信绑定的用户信息
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getThirdUserByWechat")
|
||||
public Result<JwSysUserDepartVo> getThirdUserByWechat(HttpServletRequest request){
|
||||
//获取企业微信配置
|
||||
Integer tenantId = oConvertUtils.getInt(TokenUtils.getTenantIdByRequest(request),0);
|
||||
SysThirdAppConfig config = appConfigService.getThirdConfigByThirdType(tenantId, MessageTypeEnum.QYWX.getType());
|
||||
if (null != config) {
|
||||
JwSysUserDepartVo list = wechatEnterpriseService.getThirdUserByWechat(tenantId);
|
||||
return Result.ok(list);
|
||||
}
|
||||
return Result.error("企业微信尚未配置,请配置企业微信");
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步企业微信部门和用户到本地
|
||||
* @param jwUserDepartJson
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sync/wechatEnterprise/departAndUser/toLocal")
|
||||
public Result<SyncInfoVo> syncWechatEnterpriseDepartAndUserToLocal(@RequestParam(name = "jwUserDepartJson") String jwUserDepartJson,HttpServletRequest request){
|
||||
int tenantId = oConvertUtils.getInt(TokenUtils.getTenantIdByRequest(request), 0);
|
||||
SyncInfoVo syncInfoVo = wechatEnterpriseService.syncWechatEnterpriseDepartAndUserToLocal(jwUserDepartJson,tenantId);
|
||||
return Result.ok(syncInfoVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询被绑定的企业微信用户
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getThirdUserBindByWechat")
|
||||
public Result<List<JwUserDepartVo>> getThirdUserBindByWechat(HttpServletRequest request){
|
||||
int tenantId = oConvertUtils.getInt(TokenUtils.getTenantIdByRequest(request), 0);
|
||||
List<JwUserDepartVo> jwSysUserDepartVos = wechatEnterpriseService.getThirdUserBindByWechat(tenantId);
|
||||
return Result.ok(jwSysUserDepartVos);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,142 +0,0 @@
|
||||
package org.jeecg.modules.system.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description: 知识库-文档管理
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2022-07-21
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("sys_files")
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@Schema(description="sys_files对象")
|
||||
public class SysFiles {
|
||||
|
||||
/**主键id*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "主键id")
|
||||
private String id;
|
||||
/**文件名称*/
|
||||
@Excel(name = "文件名称", width = 15)
|
||||
@Schema(description = "文件名称")
|
||||
private String fileName;
|
||||
/**文件地址*/
|
||||
@Excel(name = "文件地址", width = 15)
|
||||
@Schema(description = "文件地址")
|
||||
private String url;
|
||||
/**创建人登录名称*/
|
||||
@Excel(name = "创建人登录名称", width = 15)
|
||||
@Dict(dicCode = "username",dicText = "realname",dictTable = "sys_user")
|
||||
@Schema(description = "创建人登录名称")
|
||||
private String createBy;
|
||||
/**创建日期*/
|
||||
@Excel(name = "创建日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "创建日期")
|
||||
private Date createTime;
|
||||
/**更新人登录名称*/
|
||||
@Excel(name = "更新人登录名称", width = 15)
|
||||
@Schema(description = "更新人登录名称")
|
||||
private String updateBy;
|
||||
/**更新日期*/
|
||||
@Excel(name = "更新日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "更新日期")
|
||||
private Date updateTime;
|
||||
/**文档类型(folder:文件夹 excel:excel doc:word pp:ppt image:图片 archive:其他文档 video:视频)*/
|
||||
@Excel(name = "文档类型(folder:文件夹 excel:excel doc:word pp:ppt image:图片 archive:其他文档 video:视频)", width = 15)
|
||||
@Schema(description = "文档类型(folder:文件夹 excel:excel doc:word pp:ppt image:图片 archive:其他文档 video:视频)")
|
||||
private String fileType;
|
||||
/**文件上传类型(temp/本地上传(临时文件) manage/知识库 comment)*/
|
||||
@Excel(name = "文件上传类型(temp/本地上传(临时文件) manage/知识库 common(通用上传))", width = 15)
|
||||
@Schema(description = "文件上传类型(temp/本地上传(临时文件) manage/知识库)")
|
||||
private String storeType;
|
||||
/**父级id*/
|
||||
@Excel(name = "父级id", width = 15)
|
||||
@Schema(description = "父级id")
|
||||
private String parentId;
|
||||
/**租户id*/
|
||||
@Excel(name = "租户id", width = 15)
|
||||
@Schema(description = "租户id")
|
||||
private String tenantId;
|
||||
/**文件大小(kb)*/
|
||||
@Excel(name = "文件大小(kb)", width = 15)
|
||||
@Schema(description = "文件大小(kb)")
|
||||
private Double fileSize;
|
||||
/**是否文件夹(1:是 0:否)*/
|
||||
@Excel(name = "是否文件夹(1:是 0:否)", width = 15)
|
||||
@Schema(description = "是否文件夹(1:是 0:否)")
|
||||
private String izFolder;
|
||||
/**是否为1级文件夹,允许为空 (1:是 )*/
|
||||
@Excel(name = "是否为1级文件夹,允许为空 (1:是 )", width = 15)
|
||||
@Schema(description = "是否为1级文件夹,允许为空 (1:是 )")
|
||||
private String izRootFolder;
|
||||
/**是否标星(1:是 0:否)*/
|
||||
@Excel(name = "是否标星(1:是 0:否)", width = 15)
|
||||
@Schema(description = "是否标星(1:是 0:否)")
|
||||
private String izStar;
|
||||
/**下载次数*/
|
||||
@Excel(name = "下载次数", width = 15)
|
||||
@Schema(description = "下载次数")
|
||||
private Integer downCount;
|
||||
/**阅读次数*/
|
||||
@Excel(name = "阅读次数", width = 15)
|
||||
@Schema(description = "阅读次数")
|
||||
private Integer readCount;
|
||||
/**分享链接*/
|
||||
@Excel(name = "分享链接", width = 15)
|
||||
@Schema(description = "分享链接")
|
||||
private String shareUrl;
|
||||
/**分享权限(1.关闭分享 2.允许所有联系人查看 3.允许任何人查看)*/
|
||||
@Excel(name = "分享权限(1.关闭分享 2.允许所有联系人查看 3.允许任何人查看)", width = 15)
|
||||
@Schema(description = "分享权限(1.关闭分享 2.允许所有联系人查看 3.允许任何人查看)")
|
||||
private String sharePerms;
|
||||
/**是否允许下载(1:是 0:否)*/
|
||||
@Excel(name = "是否允许下载(1:是 0:否)", width = 15)
|
||||
@Schema(description = "是否允许下载(1:是 0:否)")
|
||||
private String enableDown;
|
||||
/**是否允许修改(1:是 0:否)*/
|
||||
@Excel(name = "是否允许修改(1:是 0:否)", width = 15)
|
||||
@Schema(description = "是否允许修改(1:是 0:否)")
|
||||
private String enableUpdat;
|
||||
/**删除状态(0-正常,1-删除至回收站)*/
|
||||
@Excel(name = "删除状态(0-正常,1-删除至回收站)", width = 15)
|
||||
@Schema(description = "删除状态(0-正常,1-删除至回收站)")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 文件表不存在的字段:用户数据集合
|
||||
*/
|
||||
@TableField(exist=false)
|
||||
private String userData;
|
||||
|
||||
/**
|
||||
* 文件表不存在的字段:用户真实姓名
|
||||
*/
|
||||
@TableField(exist=false)
|
||||
private String realname;
|
||||
|
||||
/**
|
||||
* 文件表不存在的字段:压缩名称
|
||||
*/
|
||||
@TableField(exist=false)
|
||||
private String zipName;
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.jeecg.modules.system.constant.DefIndexConst;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@ -166,11 +166,11 @@ public class SysPermission implements Serializable {
|
||||
}
|
||||
public SysPermission(boolean index) {
|
||||
if(index) {
|
||||
this.id = "9502685863ab87f0ad1134142788a385";
|
||||
this.name="首页";
|
||||
this.component="dashboard/Analysis";
|
||||
this.componentName="dashboard-analysis";
|
||||
this.url="/dashboard/analysis";
|
||||
this.id = "9502685863ab87f0ad1134142788a385";
|
||||
this.name = DefIndexConst.DEF_INDEX_NAME;
|
||||
this.component = DefIndexConst.DEF_INDEX_COMPONENT;
|
||||
this.componentName = "dashboard-analysis";
|
||||
this.url = DefIndexConst.DEF_INDEX_URL;
|
||||
this.icon="home";
|
||||
this.menuType=0;
|
||||
this.sortNo=0.0;
|
||||
|
||||
@ -82,6 +82,12 @@ public interface SysDictMapper extends BaseMapper<SysDict> {
|
||||
*/
|
||||
List<DictModelMany> queryManyDictByKeys(@Param("dictCodeList") List<String> dictCodeList, @Param("keys") List<String> keys);
|
||||
|
||||
/**
|
||||
* 查询系统所有字典项
|
||||
* @return
|
||||
*/
|
||||
public List<DictModelMany> queryAllDictItems(List<Integer> tenantIdList);
|
||||
|
||||
/**
|
||||
* 查询所有部门 作为字典信息 id -->value,departName -->text
|
||||
* @return
|
||||
@ -187,4 +193,11 @@ public interface SysDictMapper extends BaseMapper<SysDict> {
|
||||
*/
|
||||
@InterceptorIgnore(tenantLine = "true")
|
||||
List<SysDict> getDictListByLowAppId(@Param("lowAppId") String lowAppId, @Param("tenantId") Integer tenantId);
|
||||
|
||||
/**
|
||||
* 查询被逻辑删除的数据(根据租户id)
|
||||
* @return
|
||||
*/
|
||||
@Select("select * from sys_dict where del_flag = 1 and tenant_id = #{tenantId}")
|
||||
List<SysDict> queryDeleteListBtTenantId(@Param("tenantId") Integer tenantId);
|
||||
}
|
||||
|
||||
@ -1,14 +0,0 @@
|
||||
package org.jeecg.modules.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.jeecg.modules.system.entity.SysFiles;
|
||||
|
||||
/**
|
||||
* @Description: 知识库-文档管理
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2022-07-21
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface SysFilesMapper extends BaseMapper<SysFiles> {
|
||||
|
||||
}
|
||||
@ -29,10 +29,10 @@ public interface SysPermissionMapper extends BaseMapper<SysPermission> {
|
||||
|
||||
/**
|
||||
* 根据用户查询用户权限
|
||||
* @param username 用户账户名称
|
||||
* @param userId 用户ID
|
||||
* @return List<SysPermission>
|
||||
*/
|
||||
public List<SysPermission> queryByUser(@Param("username") String username);
|
||||
public List<SysPermission> queryByUser(@Param("userId") String userId);
|
||||
|
||||
/**
|
||||
* 修改菜单状态字段: 是否子节点
|
||||
|
||||
@ -57,7 +57,7 @@ public interface SysUserDepartMapper extends BaseMapper<SysUserDepart>{
|
||||
* @param keyword
|
||||
* @return
|
||||
*/
|
||||
IPage<SysUser> getProcessUserList(Page<SysUser> page, @Param("orgCode") String orgCode, @Param("keyword") String keyword, @Param("tenantId") Integer tenantId);
|
||||
IPage<SysUser> getProcessUserList(Page<SysUser> page, @Param("orgCode") String orgCode, @Param("keyword") String keyword, @Param("tenantId") Integer tenantId, @Param("excludeUserIdList") List<String> excludeUserIdList);
|
||||
|
||||
/**
|
||||
* 获取租户下的部门通过前台传过来的部门id
|
||||
|
||||
@ -171,9 +171,10 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
|
||||
* @param page
|
||||
* @param roleId
|
||||
* @param keyword
|
||||
* @param userIdList
|
||||
* @return
|
||||
*/
|
||||
IPage<SysUser> selectUserListByRoleId(Page<SysUser> page, @Param("roleId") String roleId, @Param("keyword") String keyword, @Param("tenantId") Integer tenantId);
|
||||
IPage<SysUser> selectUserListByRoleId(Page<SysUser> page, @Param("roleId") String roleId, @Param("keyword") String keyword, @Param("tenantId") Integer tenantId, @Param("excludeUserIdList") List<String> excludeUserIdList);
|
||||
|
||||
/**
|
||||
* 更新刪除状态和离职状态
|
||||
|
||||
@ -63,6 +63,28 @@
|
||||
</foreach>
|
||||
)
|
||||
</select>
|
||||
|
||||
<!-- 获取全部字典项 -->
|
||||
<select id="queryAllDictItems" resultType="org.jeecg.common.system.vo.DictModelMany">
|
||||
SELECT
|
||||
dict.dict_code,
|
||||
item.item_text AS "text",
|
||||
item.item_value AS "value",
|
||||
item.item_color AS "color"
|
||||
FROM
|
||||
sys_dict_item item
|
||||
INNER JOIN sys_dict dict ON dict.id = item.dict_id
|
||||
WHERE dict.del_flag = 0
|
||||
<if test="tenantIdList!=null and tenantIdList.size()>0">
|
||||
AND dict.tenant_id IN (
|
||||
<foreach item="tenantId" collection="tenantIdList" separator=",">
|
||||
#{tenantId}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
AND item.status =1
|
||||
order by dict.dict_code, item.sort_order
|
||||
</select>
|
||||
|
||||
<!-- 查询部门信息 作为字典数据 -->
|
||||
<select id="queryAllDepartBackDictModel" resultType="org.jeecg.common.system.vo.DictModel">
|
||||
|
||||
@ -42,46 +42,104 @@
|
||||
<!-- 获取登录用户拥有的权限 -->
|
||||
<select id="queryByUser" parameterType="Object" resultMap="SysPermission">
|
||||
SELECT * FROM (
|
||||
SELECT p.*
|
||||
SELECT p.id,
|
||||
p.parent_id,
|
||||
p.name,
|
||||
p.url,
|
||||
p.component,
|
||||
p.is_route,
|
||||
p.component_name,
|
||||
p.redirect,
|
||||
p.menu_type,
|
||||
p.perms,
|
||||
p.perms_type,
|
||||
p.sort_no,
|
||||
p.always_show,
|
||||
p.icon,
|
||||
p.is_leaf,
|
||||
p.keep_alive,
|
||||
p.hidden,
|
||||
p.hide_tab,
|
||||
p.rule_flag,
|
||||
p.status,
|
||||
p.internal_or_external
|
||||
FROM sys_permission p
|
||||
WHERE (exists(
|
||||
select a.id from sys_role_permission a
|
||||
join sys_role b on a.role_id = b.id
|
||||
join sys_user_role c on c.role_id = b.id
|
||||
join sys_user d on d.id = c.user_id
|
||||
where p.id = a.permission_id AND d.username = #{username,jdbcType=VARCHAR}
|
||||
WHERE p.del_flag = 0
|
||||
AND ( p.id in (
|
||||
SELECT DISTINCT a.permission_id
|
||||
FROM sys_role_permission a
|
||||
JOIN sys_role b ON a.role_id = b.id
|
||||
JOIN sys_user_role c ON c.role_id = b.id AND c.user_id = #{userId,jdbcType=VARCHAR}
|
||||
)
|
||||
or (p.url like '%:code' and p.url like '/online%' and p.hidden = 1)
|
||||
or (p.url like '%:id' and p.url like '/online%' and p.hidden = 1)
|
||||
or p.url = '/online')
|
||||
and p.del_flag = 0
|
||||
or p.url = '/online'
|
||||
)
|
||||
<!--update begin Author:lvdandan Date:20200213 for:加入部门权限 -->
|
||||
UNION
|
||||
SELECT p.*
|
||||
FROM sys_permission p
|
||||
WHERE exists(
|
||||
select a.id from sys_depart_role_permission a
|
||||
join sys_depart_role b on a.role_id = b.id
|
||||
join sys_depart_role_user c on c.drole_id = b.id
|
||||
join sys_user d on d.id = c.user_id
|
||||
where p.id = a.permission_id AND d.username = #{username,jdbcType=VARCHAR}
|
||||
)
|
||||
SELECT p.id,
|
||||
p.parent_id,
|
||||
p.name,
|
||||
p.url,
|
||||
p.component,
|
||||
p.is_route,
|
||||
p.component_name,
|
||||
p.redirect,
|
||||
p.menu_type,
|
||||
p.perms,
|
||||
p.perms_type,
|
||||
p.sort_no,
|
||||
p.always_show,
|
||||
p.icon,
|
||||
p.is_leaf,
|
||||
p.keep_alive,
|
||||
p.hidden,
|
||||
p.hide_tab,
|
||||
p.rule_flag,
|
||||
p.status,
|
||||
p.internal_or_external
|
||||
FROM sys_permission p
|
||||
WHERE p.id in(
|
||||
SELECT DISTINCT a.permission_id
|
||||
FROM sys_depart_role_permission a
|
||||
INNER JOIN sys_depart_role b ON a.role_id = b.id
|
||||
INNER JOIN sys_depart_role_user c ON c.drole_id = b.id AND c.user_id = #{userId,jdbcType=VARCHAR}
|
||||
)
|
||||
and p.del_flag = 0
|
||||
<!--update end Author:lvdandan Date:20200213 for:加入部门权限 -->
|
||||
|
||||
<!-- update begin Author: taoyan Date:20200213 for:QQYUN-4303 【low app】 用户登录的时候 加载low app的套餐权限 加到用户信息 -->
|
||||
UNION
|
||||
SELECT p.*
|
||||
FROM sys_permission p
|
||||
WHERE exists(
|
||||
select a.id from sys_tenant_pack_perms a
|
||||
join sys_tenant_pack b on a.pack_id = b.id
|
||||
join sys_tenant_pack_user c on c.pack_id = b.id
|
||||
join sys_user d on d.id = c.user_id
|
||||
where p.id = a.permission_id AND d.username = #{username,jdbcType=VARCHAR}
|
||||
)
|
||||
and p.del_flag = 0
|
||||
<!-- update end Author: taoyan Date:20200213 for:QQYUN-4303 【low app】 用户登录的时候 加载low app的套餐权限 加到用户信息 -->
|
||||
UNION
|
||||
SELECT p.id,
|
||||
p.parent_id,
|
||||
p.name,
|
||||
p.url,
|
||||
p.component,
|
||||
p.is_route,
|
||||
p.component_name,
|
||||
p.redirect,
|
||||
p.menu_type,
|
||||
p.perms,
|
||||
p.perms_type,
|
||||
p.sort_no,
|
||||
p.always_show,
|
||||
p.icon,
|
||||
p.is_leaf,
|
||||
p.keep_alive,
|
||||
p.hidden,
|
||||
p.hide_tab,
|
||||
p.rule_flag,
|
||||
p.status,
|
||||
p.internal_or_external
|
||||
FROM sys_permission p
|
||||
WHERE p.id in (
|
||||
SELECT distinct a.permission_id
|
||||
FROM sys_tenant_pack_perms a
|
||||
INNER JOIN sys_tenant_pack b ON a.pack_id = b.id AND b.STATUS = '1'
|
||||
INNER JOIN sys_tenant_pack_user c ON c.pack_id = b.id AND c.STATUS = '1' AND c.user_id = #{userId,jdbcType=VARCHAR}
|
||||
)
|
||||
and p.del_flag = 0
|
||||
<!-- update end Author: taoyan Date:20200213 for:QQYUN-4303 【low app】 用户登录的时候 加载low app的套餐权限 加到用户信息 -->
|
||||
|
||||
) h order by h.sort_no ASC
|
||||
</select>
|
||||
|
||||
@ -74,6 +74,13 @@
|
||||
select user_id from sys_user_tenant where tenant_id = #{tenantId} and status = '1'
|
||||
)
|
||||
</if>
|
||||
<!--【QQYUN-8239】用户角色,添加用户 返回2页数据,实际只显示一页 需要将不符合的用户id排除-->
|
||||
<if test="excludeUserIdList!=null and excludeUserIdList.size()>0">
|
||||
and a.id not in
|
||||
<foreach collection="excludeUserIdList" item="userId" open="(" close=")" separator=",">
|
||||
#{userId}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!--获取租户下的部门-通过前台传过来的部门id-->
|
||||
|
||||
@ -219,6 +219,14 @@
|
||||
select user_id from sys_user_tenant where tenant_id = #{tenantId} and status = '1'
|
||||
)
|
||||
</if>
|
||||
|
||||
<!--【QQYUN-8239】用户角色,添加用户 返回2页数据,实际只显示一页 需要将不符合的用户id排除-->
|
||||
<if test="excludeUserIdList!=null and excludeUserIdList.size()>0">
|
||||
and a.id not in
|
||||
<foreach collection="excludeUserIdList" item="userId" open="(" close=")" separator=",">
|
||||
#{userId}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!--获取租户下的用户离职列表信息-->
|
||||
|
||||
@ -169,7 +169,7 @@
|
||||
<select id="getUserCount" resultType="java.lang.Long">
|
||||
SELECT count(1) FROM sys_user_tenant sut JOIN sys_user su on sut.user_id = su.id and su.del_flag = 0 and su.status = 1
|
||||
WHERE sut.status = #{tenantStatus}
|
||||
AND tenant_id = #{tenantId}
|
||||
AND sut.tenant_id = #{tenantId}
|
||||
</select>
|
||||
|
||||
<!--根据租户id和名称获取用户数据-->
|
||||
|
||||
@ -238,7 +238,7 @@ public interface ISysDictService extends IService<SysDict> {
|
||||
* 查询被逻辑删除的数据
|
||||
* @return
|
||||
*/
|
||||
public List<SysDict> queryDeleteList();
|
||||
public List<SysDict> queryDeleteList(String tenantId);
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
|
||||
@ -1,14 +0,0 @@
|
||||
package org.jeecg.modules.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.system.entity.SysFiles;
|
||||
|
||||
/**
|
||||
* @Description: 知识库-文档管理
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2022-07-21
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ISysFilesService extends IService<SysFiles> {
|
||||
|
||||
}
|
||||
@ -1,14 +1,43 @@
|
||||
package org.jeecg.modules.system.service;
|
||||
|
||||
import org.jeecg.modules.system.entity.SysRoleIndex;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.system.entity.SysRoleIndex;
|
||||
|
||||
/**
|
||||
* @Description: 角色首页配置
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2022-03-25
|
||||
* @Date: 2022-03-25
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ISysRoleIndexService extends IService<SysRoleIndex> {
|
||||
|
||||
/**
|
||||
* 查询默认首页
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
SysRoleIndex queryDefaultIndex();
|
||||
|
||||
/**
|
||||
* 更新默认首页
|
||||
*
|
||||
* @param url
|
||||
* @param component
|
||||
* @param isRoute 是否是路由页面
|
||||
* @return
|
||||
*/
|
||||
boolean updateDefaultIndex(String url, String component, boolean isRoute);
|
||||
|
||||
/**
|
||||
* 创建最原始的默认首页配置
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
SysRoleIndex initDefaultIndex();
|
||||
|
||||
/**
|
||||
* 清理默认首页的redis缓存
|
||||
*/
|
||||
void cleanDefaultIndexCache();
|
||||
|
||||
}
|
||||
|
||||
@ -67,4 +67,11 @@ public interface ISysRoleService extends IService<SysRole> {
|
||||
* @return
|
||||
*/
|
||||
Long getRoleCountByTenantId(String id, Integer tenantId);
|
||||
|
||||
/**
|
||||
* 验证是否为admin角色
|
||||
*
|
||||
* @param ids
|
||||
*/
|
||||
void checkAdminRoleRejectDel(String ids);
|
||||
}
|
||||
|
||||
@ -77,7 +77,7 @@ public interface ISysUserDepartService extends IService<SysUserDepart> {
|
||||
* @param pageNo
|
||||
* @return
|
||||
*/
|
||||
IPage<SysUser> getUserInformation(Integer tenantId,String departId,String roleId, String keyword, Integer pageSize, Integer pageNo);
|
||||
IPage<SysUser> getUserInformation(Integer tenantId,String departId,String roleId, String keyword, Integer pageSize, Integer pageNo, String excludeUserIdList);
|
||||
|
||||
/**
|
||||
* 通过部门id和租户id获取多个用户
|
||||
|
||||
@ -190,10 +190,10 @@ public interface ISysUserService extends IService<SysUser> {
|
||||
/**
|
||||
* 通过用户名获取用户权限集合
|
||||
*
|
||||
* @param username 用户名
|
||||
* @param userId 用户id
|
||||
* @return 权限集合
|
||||
*/
|
||||
Set<String> getUserPermissionsSet(String username);
|
||||
Set<String> getUserPermissionsSet(String userId);
|
||||
|
||||
/**
|
||||
* 根据用户名设置部门ID
|
||||
@ -411,4 +411,10 @@ public interface ISysUserService extends IService<SysUser> {
|
||||
* @return
|
||||
*/
|
||||
Result<?> importAppUser(HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 验证用户是否为管理员
|
||||
* @param ids
|
||||
*/
|
||||
void checkUserAdminRejectDel(String ids);
|
||||
}
|
||||
|
||||
@ -35,7 +35,7 @@ public interface ISysUserTenantService extends IService<SysUserTenant> {
|
||||
List<SysUser> setUserTenantIds(List<SysUser> records);
|
||||
|
||||
/**
|
||||
* 获取用户id根据用户id
|
||||
* 获取租户id获取用户ids
|
||||
* @param tenantId
|
||||
* @return
|
||||
*/
|
||||
|
||||
@ -22,7 +22,6 @@ import org.jeecg.common.api.dto.DataLogDTO;
|
||||
import org.jeecg.common.api.dto.OnlineAuthDTO;
|
||||
import org.jeecg.common.api.dto.message.*;
|
||||
import org.jeecg.common.aspect.UrlMatchEnum;
|
||||
import org.jeecg.common.config.TenantContext;
|
||||
import org.jeecg.common.constant.*;
|
||||
import org.jeecg.common.constant.enums.EmailTemplateEnum;
|
||||
import org.jeecg.common.constant.enums.MessageTypeEnum;
|
||||
@ -125,8 +124,6 @@ public class SysBaseApiImpl implements ISysBaseAPI {
|
||||
@Autowired
|
||||
private ISysDataLogService sysDataLogService;
|
||||
@Autowired
|
||||
private ISysFilesService sysFilesService;
|
||||
@Autowired
|
||||
private ISysRoleService sysRoleService;
|
||||
@Autowired
|
||||
private ISysUserTenantService sysUserTenantService;
|
||||
@ -336,7 +333,7 @@ public class SysBaseApiImpl implements ISysBaseAPI {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getDepartParentIdsByDepIds(Set depIds) {
|
||||
public Set<String> getDepartParentIdsByDepIds(Set<String> depIds) {
|
||||
LambdaQueryWrapper<SysDepart> departQuery = new LambdaQueryWrapper<SysDepart>().in(SysDepart::getId, depIds);
|
||||
List<SysDepart> departList = departMapper.selectList(departQuery);
|
||||
|
||||
@ -1098,13 +1095,13 @@ public class SysBaseApiImpl implements ISysBaseAPI {
|
||||
|
||||
/**
|
||||
* 查询用户拥有的权限集合
|
||||
* @param username
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Set<String> getUserPermissionSet(String username) {
|
||||
public Set<String> getUserPermissionSet(String userId) {
|
||||
Set<String> permissionSet = new HashSet<>();
|
||||
List<SysPermission> permissionList = sysPermissionMapper.queryByUser(username);
|
||||
List<SysPermission> permissionList = sysPermissionMapper.queryByUser(userId);
|
||||
//================= begin 开启租户的时候 如果没有test角色,默认加入test角色================
|
||||
if(MybatisPlusSaasConfig.OPEN_SYSTEM_TENANT_CONTROL){
|
||||
if (permissionList == null) {
|
||||
@ -1123,7 +1120,7 @@ public class SysBaseApiImpl implements ISysBaseAPI {
|
||||
permissionSet.add(po.getPerms());
|
||||
}
|
||||
}
|
||||
log.info("-------通过数据库读取用户拥有的权限Perms------username: "+ username+",Perms size: "+ (permissionSet==null?0:permissionSet.size()) );
|
||||
log.info("-------通过数据库读取用户拥有的权限Perms------userId: "+ userId+",Perms size: "+ (permissionSet==null?0:permissionSet.size()) );
|
||||
return permissionSet;
|
||||
}
|
||||
|
||||
@ -1148,7 +1145,13 @@ public class SysBaseApiImpl implements ISysBaseAPI {
|
||||
sysPermission.setUrl(onlineFormUrl);
|
||||
int count = sysPermissionMapper.queryCountByUsername(username, sysPermission);
|
||||
if(count<=0){
|
||||
return false;
|
||||
//update-begin---author:chenrui ---date:20240123 for:[QQYUN-7992]【online】工单申请下的online表单,未配置online表单开发菜单,操作报错无权限------------
|
||||
sysPermission.setUrl(onlineAuthDTO.getOnlineWorkOrderUrl());
|
||||
count = sysPermissionMapper.queryCountByUsername(username, sysPermission);
|
||||
if(count<=0) {
|
||||
return false;
|
||||
}
|
||||
//update-end---author:chenrui ---date:20240123 for:[QQYUN-7992]【online】工单申请下的online表单,未配置online表单开发菜单,操作报错无权限------------
|
||||
}
|
||||
} else {
|
||||
//找到菜单了
|
||||
@ -1174,12 +1177,12 @@ public class SysBaseApiImpl implements ISysBaseAPI {
|
||||
|
||||
/**
|
||||
* 查询用户拥有的权限集合 common api 里面的接口实现
|
||||
* @param username
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Set<String> queryUserAuths(String username) {
|
||||
return getUserPermissionSet(username);
|
||||
public Set<String> queryUserAuths(String userId) {
|
||||
return getUserPermissionSet(userId);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1591,30 +1594,14 @@ public class SysBaseApiImpl implements ISysBaseAPI {
|
||||
entity.setDataContent(dataLogDto.getContent());
|
||||
entity.setType(dataLogDto.getType());
|
||||
entity.setDataVersion("1");
|
||||
entity.autoSetCreateName();
|
||||
if (oConvertUtils.isNotEmpty(dataLogDto.getCreateName())) {
|
||||
entity.setCreateBy(dataLogDto.getCreateName());
|
||||
} else {
|
||||
entity.autoSetCreateName();
|
||||
}
|
||||
sysDataLogService.save(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addSysFiles(SysFilesModel sysFilesModel) {
|
||||
SysFiles sysFiles = new SysFiles();
|
||||
BeanUtils.copyProperties(sysFilesModel,sysFiles);
|
||||
String defaultValue = "0";
|
||||
sysFiles.setIzStar(defaultValue);
|
||||
sysFiles.setIzFolder(defaultValue);
|
||||
sysFiles.setIzRootFolder(defaultValue);
|
||||
sysFiles.setDelFlag(defaultValue);
|
||||
String tenantId = oConvertUtils.getString(TenantContext.getTenant());
|
||||
sysFiles.setTenantId(tenantId);
|
||||
sysFilesService.save(sysFiles);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFileUrl(String fileId) {
|
||||
SysFiles sysFiles = sysFilesService.getById(fileId);
|
||||
return sysFiles.getUrl();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateAvatar(LoginUser loginUser) {
|
||||
SysUser sysUser = new SysUser();
|
||||
|
||||
@ -12,14 +12,13 @@ import org.jeecg.common.constant.enums.FileTypeEnum;
|
||||
import org.jeecg.common.constant.enums.MessageTypeEnum;
|
||||
import org.jeecg.common.exception.JeecgBootException;
|
||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
import org.jeecg.common.system.vo.SysFilesModel;
|
||||
import org.jeecg.common.util.CommonUtils;
|
||||
import org.jeecg.common.util.RedisUtil;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.system.entity.SysComment;
|
||||
import org.jeecg.modules.system.entity.SysFiles;
|
||||
import org.jeecg.modules.system.entity.SysFormFile;
|
||||
import org.jeecg.modules.system.mapper.SysCommentMapper;
|
||||
import org.jeecg.modules.system.mapper.SysFilesMapper;
|
||||
import org.jeecg.modules.system.mapper.SysFormFileMapper;
|
||||
import org.jeecg.modules.system.service.ISysCommentService;
|
||||
import org.jeecg.modules.system.vo.SysCommentFileVo;
|
||||
@ -55,8 +54,8 @@ public class SysCommentServiceImpl extends ServiceImpl<SysCommentMapper, SysComm
|
||||
@Autowired
|
||||
private SysFormFileMapper sysFormFileMapper;
|
||||
|
||||
@Autowired
|
||||
private SysFilesMapper sysFilesMapper;
|
||||
// @Autowired
|
||||
// private IEasyOaBaseApi easyOaBseApi;
|
||||
|
||||
@Autowired
|
||||
private RedisUtil redisUtil;
|
||||
@ -158,7 +157,7 @@ public class SysCommentServiceImpl extends ServiceImpl<SysCommentMapper, SysComm
|
||||
FileTypeEnum fileType = FileTypeEnum.getByType(type);
|
||||
|
||||
//保存至 SysFiles
|
||||
SysFiles sysFiles = new SysFiles();
|
||||
SysFilesModel sysFiles = new SysFilesModel();
|
||||
sysFiles.setFileName(orgName);
|
||||
sysFiles.setUrl(savePath);
|
||||
sysFiles.setFileType(fileType.getValue());
|
||||
@ -166,16 +165,13 @@ public class SysCommentServiceImpl extends ServiceImpl<SysCommentMapper, SysComm
|
||||
if (size > 0) {
|
||||
sysFiles.setFileSize(Double.parseDouble(String.valueOf(size)));
|
||||
}
|
||||
String defaultValue = "0";
|
||||
sysFiles.setIzStar(defaultValue);
|
||||
sysFiles.setIzFolder(defaultValue);
|
||||
sysFiles.setIzRootFolder(defaultValue);
|
||||
sysFiles.setDelFlag(defaultValue);
|
||||
String fileId = String.valueOf(IdWorker.getId());
|
||||
sysFiles.setId(fileId);
|
||||
String tenantId = oConvertUtils.getString(TenantContext.getTenant());
|
||||
sysFiles.setTenantId(tenantId);
|
||||
sysFilesMapper.insert(sysFiles);
|
||||
// //update-begin---author:wangshuai---date:2024-01-04---for:【QQYUN-7821】知识库后端迁移---
|
||||
// easyOaBseApi.addSysFiles(sysFiles);
|
||||
// //update-end---author:wangshuai---date:2024-01-04---for:【QQYUN-7821】知识库后端迁移---
|
||||
|
||||
//保存至 SysFormFile
|
||||
String tableName = SYS_FORM_FILE_TABLE_NAME;
|
||||
@ -188,18 +184,20 @@ public class SysCommentServiceImpl extends ServiceImpl<SysCommentMapper, SysComm
|
||||
sysFormFileMapper.insert(sysFormFile);
|
||||
|
||||
}else{
|
||||
SysFiles sysFiles = sysFilesMapper.selectById(existFileId);
|
||||
if(sysFiles!=null){
|
||||
// //update-begin---author:wangshuai---date:2024-01-04---for:【QQYUN-7821】知识库后端迁移---
|
||||
// SysFilesModel sysFiles = easyOaBseApi.getFileById(existFileId);
|
||||
// //update-end---author:wangshuai---date:2024-01-04---for:【QQYUN-7821】知识库后端迁移---
|
||||
// if(sysFiles!=null){
|
||||
//保存至 SysFormFile
|
||||
String tableName = SYS_FORM_FILE_TABLE_NAME;
|
||||
String tableDataId = request.getParameter("commentId");
|
||||
SysFormFile sysFormFile = new SysFormFile();
|
||||
sysFormFile.setTableName(tableName);
|
||||
sysFormFile.setFileType(sysFiles.getFileType());
|
||||
sysFormFile.setFileType("");
|
||||
sysFormFile.setTableDataId(tableDataId);
|
||||
sysFormFile.setFileId(existFileId);
|
||||
sysFormFileMapper.insert(sysFormFile);
|
||||
}
|
||||
// }
|
||||
}
|
||||
//update-end-author:taoyan date:2023-6-12 for: QQYUN-4310【文件】从文件库选择文件功能未做
|
||||
}
|
||||
@ -224,7 +222,7 @@ public class SysCommentServiceImpl extends ServiceImpl<SysCommentMapper, SysComm
|
||||
FileTypeEnum fileType = FileTypeEnum.getByType(type);
|
||||
|
||||
//保存至 SysFiles
|
||||
SysFiles sysFiles = new SysFiles();
|
||||
SysFilesModel sysFiles = new SysFilesModel();
|
||||
sysFiles.setFileName(orgName);
|
||||
sysFiles.setUrl(savePath);
|
||||
sysFiles.setFileType(fileType.getValue());
|
||||
@ -233,16 +231,13 @@ public class SysCommentServiceImpl extends ServiceImpl<SysCommentMapper, SysComm
|
||||
sysFiles.setFileSize(Double.parseDouble(String.valueOf(size)));
|
||||
}
|
||||
String defaultValue = "0";
|
||||
sysFiles.setIzStar(defaultValue);
|
||||
sysFiles.setIzFolder(defaultValue);
|
||||
sysFiles.setIzRootFolder(defaultValue);
|
||||
sysFiles.setDelFlag(defaultValue);
|
||||
String fileId = String.valueOf(IdWorker.getId());
|
||||
sysFiles.setId(fileId);
|
||||
String tenantId = oConvertUtils.getString(TenantContext.getTenant());
|
||||
sysFiles.setTenantId(tenantId);
|
||||
sysFilesMapper.insert(sysFiles);
|
||||
|
||||
// //update-begin---author:wangshuai---date:2024-01-04---for:【QQYUN-7821】知识库后端迁移---
|
||||
// easyOaBseApi.addSysFiles(sysFiles);
|
||||
// //update-end---author:wangshuai---date:2024-01-04---for:【QQYUN-7821】知识库后端迁移---
|
||||
//保存至 SysFormFile
|
||||
String tableName = SYS_FORM_FILE_TABLE_NAME;
|
||||
String tableDataId = request.getParameter("commentId");
|
||||
|
||||
@ -152,37 +152,36 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
|
||||
|
||||
@Override
|
||||
public Map<String, List<DictModel>> queryAllDictItems() {
|
||||
Map<String, List<DictModel>> res = new HashMap(5);
|
||||
LambdaQueryWrapper<SysDict> sysDictQueryWrapper = new LambdaQueryWrapper<SysDict>();
|
||||
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
|
||||
long start = System.currentTimeMillis();
|
||||
Map<String, List<DictModel>> sysAllDictItems = new HashMap(5);
|
||||
List<Integer> tenantIds = null;
|
||||
//------------------------------------------------------------------------------------------------
|
||||
//是否开启系统管理模块的多租户数据隔离【SAAS多租户模式】
|
||||
if(MybatisPlusSaasConfig.OPEN_SYSTEM_TENANT_CONTROL){
|
||||
sysDictQueryWrapper.eq(SysDict::getTenantId, oConvertUtils.getInt(TenantContext.getTenant(), 0))
|
||||
.or().eq(SysDict::getTenantId,0);
|
||||
if (MybatisPlusSaasConfig.OPEN_SYSTEM_TENANT_CONTROL) {
|
||||
tenantIds = new ArrayList<>();
|
||||
tenantIds.add(0);
|
||||
if (TenantContext.getTenant() != null) {
|
||||
tenantIds.add(oConvertUtils.getInt(TenantContext.getTenant()));
|
||||
}
|
||||
}
|
||||
//------------------------------------------------------------------------------------------------
|
||||
|
||||
List<SysDict> ls = sysDictMapper.selectList(sysDictQueryWrapper);
|
||||
LambdaQueryWrapper<SysDictItem> queryWrapper = new LambdaQueryWrapper<SysDictItem>();
|
||||
queryWrapper.eq(SysDictItem::getStatus, 1);
|
||||
queryWrapper.orderByAsc(SysDictItem::getSortOrder);
|
||||
List<SysDictItem> sysDictItemList = sysDictItemMapper.selectList(queryWrapper);
|
||||
List<DictModelMany> sysDictItemList = sysDictMapper.queryAllDictItems(tenantIds);
|
||||
// 使用groupingBy根据dictCode分组
|
||||
sysAllDictItems = sysDictItemList.stream()
|
||||
.collect(Collectors.groupingBy(DictModelMany::getDictCode,
|
||||
Collectors.mapping(d -> new DictModel(d.getValue(), d.getText(), d.getColor()), Collectors.toList())));
|
||||
log.info(" >>> 1 获取系统字典项耗时(SQL):" + (System.currentTimeMillis() - start) + "毫秒");
|
||||
|
||||
for (SysDict d : ls) {
|
||||
List<DictModel> dictModelList = sysDictItemList.stream().filter(s -> d.getId().equals(s.getDictId())).map(item -> {
|
||||
DictModel dictModel = new DictModel();
|
||||
dictModel.setText(item.getItemText());
|
||||
dictModel.setValue(item.getItemValue());
|
||||
return dictModel;
|
||||
}).collect(Collectors.toList());
|
||||
res.put(d.getDictCode(), dictModelList);
|
||||
}
|
||||
//update-begin-author:taoyan date:2022-7-8 for: 系统字典数据应该包括自定义的java类-枚举
|
||||
Map<String, List<DictModel>> enumRes = ResourceUtil.getEnumDictData();
|
||||
res.putAll(enumRes);
|
||||
//update-end-author:taoyan date:2022-7-8 for: 系统字典数据应该包括自定义的java类-枚举
|
||||
log.debug("-------登录加载系统字典-----" + res.toString());
|
||||
return res;
|
||||
sysAllDictItems.putAll(enumRes);
|
||||
log.info(" >>> 2 获取系统字典项耗时(Enum):" + (System.currentTimeMillis() - start) + "毫秒");
|
||||
|
||||
log.info(" >>> end 获取系统字典库总耗时:" + (System.currentTimeMillis() - start) + "毫秒");
|
||||
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
|
||||
|
||||
//log.info("-------登录加载系统字典-----" + sysAllDictItems.toString());
|
||||
return sysAllDictItems;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -532,10 +531,12 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
|
||||
String filterSql = "";
|
||||
String keywordSql = null;
|
||||
String sqlWhere = "where ";
|
||||
String sqlAnd = " and ";
|
||||
|
||||
//【JTC-631】判断如果 table 携带了 where 条件,那么就使用 and 查询,防止报错
|
||||
if (tableSql.toLowerCase().contains(sqlWhere)) {
|
||||
sqlWhere = CommonUtils.getFilterSqlByTableSql(tableSql) + " and ";
|
||||
boolean tableHasWhere = tableSql.toLowerCase().contains(sqlWhere);
|
||||
if (tableHasWhere) {
|
||||
sqlWhere = CommonUtils.getFilterSqlByTableSql(tableSql);
|
||||
}
|
||||
|
||||
// 下拉搜索组件 支持传入排序信息 查询排序
|
||||
@ -566,11 +567,13 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
|
||||
|
||||
//下拉搜索组件 支持传入排序信息 查询排序
|
||||
if(oConvertUtils.isNotEmpty(condition) && oConvertUtils.isNotEmpty(keywordSql)){
|
||||
filterSql+= sqlWhere + condition + " and " + keywordSql;
|
||||
filterSql += sqlWhere + sqlAnd + condition + sqlAnd + keywordSql;
|
||||
}else if(oConvertUtils.isNotEmpty(condition)){
|
||||
filterSql+= sqlWhere + condition;
|
||||
filterSql += sqlWhere + sqlAnd + condition;
|
||||
}else if(oConvertUtils.isNotEmpty(keywordSql)){
|
||||
filterSql+= sqlWhere + keywordSql;
|
||||
filterSql += sqlWhere + sqlAnd + keywordSql;
|
||||
} else if (tableHasWhere){
|
||||
filterSql += sqlWhere;
|
||||
}
|
||||
|
||||
// 增加排序逻辑
|
||||
@ -653,7 +656,15 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysDict> queryDeleteList() {
|
||||
public List<SysDict> queryDeleteList(String tenantId) {
|
||||
//update-begin---author:wangshuai---date:2024-02-27---for:【QQYUN-8340】回收站查找软删除记录时,没有判断是否启用多租户,造成可以查找并回收其他租户的数据 #5907---
|
||||
if(MybatisPlusSaasConfig.OPEN_SYSTEM_TENANT_CONTROL){
|
||||
if(oConvertUtils.isEmpty(tenantId)){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return baseMapper.queryDeleteListBtTenantId(oConvertUtils.getInt(tenantId));
|
||||
}
|
||||
//update-end---author:wangshuai---date:2024-02-27---for:【QQYUN-8340】回收站查找软删除记录时,没有判断是否启用多租户,造成可以查找并回收其他租户的数据 #5907---
|
||||
return baseMapper.queryDeleteList();
|
||||
}
|
||||
|
||||
|
||||
@ -1,19 +0,0 @@
|
||||
package org.jeecg.modules.system.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.modules.system.entity.SysFiles;
|
||||
import org.jeecg.modules.system.mapper.SysFilesMapper;
|
||||
import org.jeecg.modules.system.service.ISysFilesService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 知识库-文档管理
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2022-07-21
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class SysFilesServiceImpl extends ServiceImpl<SysFilesMapper, SysFiles> implements ISysFilesService {
|
||||
|
||||
}
|
||||
@ -1,9 +1,8 @@
|
||||
package org.jeecg.modules.system.service.impl;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.common.constant.CacheConstant;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.exception.JeecgBootException;
|
||||
@ -11,6 +10,7 @@ import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.config.mybatis.MybatisPlusSaasConfig;
|
||||
import org.jeecg.modules.system.entity.SysPermission;
|
||||
import org.jeecg.modules.system.entity.SysPermissionDataRule;
|
||||
import org.jeecg.modules.system.entity.SysRoleIndex;
|
||||
import org.jeecg.modules.system.mapper.SysDepartPermissionMapper;
|
||||
import org.jeecg.modules.system.mapper.SysDepartRolePermissionMapper;
|
||||
import org.jeecg.modules.system.mapper.SysPermissionMapper;
|
||||
@ -18,14 +18,15 @@ import org.jeecg.modules.system.mapper.SysRolePermissionMapper;
|
||||
import org.jeecg.modules.system.model.TreeModel;
|
||||
import org.jeecg.modules.system.service.ISysPermissionDataRuleService;
|
||||
import org.jeecg.modules.system.service.ISysPermissionService;
|
||||
import org.jeecg.modules.system.service.ISysRoleIndexService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import jakarta.annotation.Resource;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@ -53,6 +54,9 @@ public class SysPermissionServiceImpl extends ServiceImpl<SysPermissionMapper, S
|
||||
@Resource
|
||||
private SysDepartRolePermissionMapper sysDepartRolePermissionMapper;
|
||||
|
||||
@Autowired
|
||||
private ISysRoleIndexService roleIndexService;
|
||||
|
||||
@Override
|
||||
public void switchVue3Menu() {
|
||||
sysPermissionMapper.backupVue2Menu();
|
||||
@ -217,13 +221,21 @@ public class SysPermissionServiceImpl extends ServiceImpl<SysPermissionMapper, S
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 同步更改默认菜单
|
||||
SysRoleIndex defIndexCfg = this.roleIndexService.queryDefaultIndex();
|
||||
boolean isDefIndex = defIndexCfg.getUrl().equals(p.getUrl());
|
||||
if (isDefIndex) {
|
||||
this.roleIndexService.updateDefaultIndex(sysPermission.getUrl(), sysPermission.getComponent(), sysPermission.isRoute());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysPermission> queryByUser(String username) {
|
||||
List<SysPermission> permissionList = this.sysPermissionMapper.queryByUser(username);
|
||||
public List<SysPermission> queryByUser(String userId) {
|
||||
List<SysPermission> permissionList = this.sysPermissionMapper.queryByUser(userId);
|
||||
//================= begin 开启租户的时候 如果没有test角色,默认加入test角色================
|
||||
if (MybatisPlusSaasConfig.OPEN_SYSTEM_TENANT_CONTROL) {
|
||||
if (permissionList == null) {
|
||||
|
||||
@ -1,19 +1,91 @@
|
||||
package org.jeecg.modules.system.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.util.RedisUtil;
|
||||
import org.jeecg.modules.system.constant.DefIndexConst;
|
||||
import org.jeecg.modules.system.entity.SysRoleIndex;
|
||||
import org.jeecg.modules.system.mapper.SysRoleIndexMapper;
|
||||
import org.jeecg.modules.system.service.ISysRoleIndexService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: 角色首页配置
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2022-03-25
|
||||
* @Date: 2022-03-25
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@Service("sysRoleIndexServiceImpl")
|
||||
public class SysRoleIndexServiceImpl extends ServiceImpl<SysRoleIndexMapper, SysRoleIndex> implements ISysRoleIndexService {
|
||||
|
||||
@Autowired
|
||||
private RedisUtil redisUtil;
|
||||
|
||||
@Override
|
||||
@Cacheable(cacheNames = DefIndexConst.CACHE_KEY, key = "'" + DefIndexConst.DEF_INDEX_ALL + "'")
|
||||
public SysRoleIndex queryDefaultIndex() {
|
||||
LambdaQueryWrapper<SysRoleIndex> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(SysRoleIndex::getRoleCode, DefIndexConst.DEF_INDEX_ALL);
|
||||
SysRoleIndex entity = super.getOne(queryWrapper);
|
||||
// 保证不为空
|
||||
if (entity == null) {
|
||||
entity = this.initDefaultIndex();
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateDefaultIndex(String url, String component, boolean isRoute) {
|
||||
// 1. 先查询出配置信息
|
||||
LambdaQueryWrapper<SysRoleIndex> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(SysRoleIndex::getRoleCode, DefIndexConst.DEF_INDEX_ALL);
|
||||
SysRoleIndex entity = super.getOne(queryWrapper);
|
||||
boolean success = false;
|
||||
// 2. 如果不存在则新增
|
||||
if (entity == null) {
|
||||
entity = this.newDefIndexConfig(url, component, isRoute);
|
||||
success = super.save(entity);
|
||||
} else {
|
||||
// 3. 如果存在则更新
|
||||
entity.setUrl(url);
|
||||
entity.setComponent(component);
|
||||
entity.setRoute(isRoute);
|
||||
success = super.updateById(entity);
|
||||
}
|
||||
// 4. 清理缓存
|
||||
if (success) {
|
||||
this.cleanDefaultIndexCache();
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysRoleIndex initDefaultIndex() {
|
||||
return this.newDefIndexConfig(DefIndexConst.DEF_INDEX_URL, DefIndexConst.DEF_INDEX_COMPONENT, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建默认首页配置
|
||||
*
|
||||
* @param indexComponent
|
||||
* @return
|
||||
*/
|
||||
private SysRoleIndex newDefIndexConfig(String indexUrl, String indexComponent, boolean isRoute) {
|
||||
SysRoleIndex entity = new SysRoleIndex();
|
||||
entity.setRoleCode(DefIndexConst.DEF_INDEX_ALL);
|
||||
entity.setUrl(indexUrl);
|
||||
entity.setComponent(indexComponent);
|
||||
entity.setRoute(isRoute);
|
||||
entity.setStatus(CommonConstant.STATUS_1);
|
||||
return entity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cleanDefaultIndexCache() {
|
||||
redisUtil.del(DefIndexConst.CACHE_KEY + "::" + DefIndexConst.DEF_INDEX_ALL);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,9 +1,12 @@
|
||||
package org.jeecg.modules.system.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.constant.SymbolConstant;
|
||||
import org.jeecg.common.exception.JeecgBootException;
|
||||
import org.jeecg.common.util.ImportExcelUtil;
|
||||
import org.jeecg.modules.system.entity.SysRole;
|
||||
import org.jeecg.modules.system.mapper.SysRoleMapper;
|
||||
@ -102,4 +105,15 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
|
||||
public Long getRoleCountByTenantId(String id, Integer tenantId) {
|
||||
return sysRoleMapper.getRoleCountByTenantId(id,tenantId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkAdminRoleRejectDel(String ids) {
|
||||
LambdaQueryWrapper<SysRole> query = new LambdaQueryWrapper<>();
|
||||
query.in(SysRole::getId,Arrays.asList(ids.split(SymbolConstant.COMMA)));
|
||||
query.eq(SysRole::getRoleCode,"admin");
|
||||
Long adminRoleCount = sysRoleMapper.selectCount(query);
|
||||
if(adminRoleCount>0){
|
||||
throw new JeecgBootException("admin角色,不允许删除!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -128,11 +128,13 @@ public class SysTenantPackServiceImpl extends ServiceImpl<SysTenantPackMapper, S
|
||||
|
||||
@Override
|
||||
public void addDefaultTenantPack(Integer tenantId) {
|
||||
ISysTenantPackService currentService = SpringContextUtils.getApplicationContext().getBean(ISysTenantPackService.class);
|
||||
// 创建租户超级管理员
|
||||
SysTenantPack superAdminPack = new SysTenantPack(tenantId, "超级管理员", TenantConstant.SUPER_ADMIN);
|
||||
|
||||
//step.1 创建租户套餐包(超级管理员)
|
||||
LambdaQueryWrapper<SysTenantPack> query = new LambdaQueryWrapper<>();
|
||||
query.eq(SysTenantPack::getTenantId,tenantId);
|
||||
// 创建超级管理员
|
||||
SysTenantPack superAdminPack = new SysTenantPack(tenantId, "超级管理员", TenantConstant.SUPER_ADMIN);
|
||||
ISysTenantPackService currentService = SpringContextUtils.getApplicationContext().getBean(ISysTenantPackService.class);
|
||||
query.eq(SysTenantPack::getPackCode, TenantConstant.SUPER_ADMIN);
|
||||
SysTenantPack sysTenantPackSuperAdmin = currentService.getOne(query);
|
||||
String packId = "";
|
||||
@ -141,13 +143,15 @@ public class SysTenantPackServiceImpl extends ServiceImpl<SysTenantPackMapper, S
|
||||
}else{
|
||||
packId = sysTenantPackSuperAdmin.getId();
|
||||
}
|
||||
//step.1.2 补充人员与套餐包的关系数据
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
SysTenantPackUser packUser = new SysTenantPackUser(tenantId, packId, sysUser.getId());
|
||||
packUser.setRealname(sysUser.getRealname());
|
||||
packUser.setPackName(superAdminPack.getPackName());
|
||||
//添加人员和管理员的关系数据
|
||||
currentService.savePackUser(packUser);
|
||||
|
||||
|
||||
//step.2 创建租户套餐包(组织账户管理员)和 添加人员关系数据
|
||||
query.eq(SysTenantPack::getTenantId,tenantId);
|
||||
query.eq(SysTenantPack::getPackCode, TenantConstant.ACCOUNT_ADMIN);
|
||||
SysTenantPack sysTenantPackAccountAdmin = currentService.getOne(query);
|
||||
if(null == sysTenantPackAccountAdmin){
|
||||
@ -155,10 +159,11 @@ public class SysTenantPackServiceImpl extends ServiceImpl<SysTenantPackMapper, S
|
||||
SysTenantPack accountAdminPack = new SysTenantPack(tenantId, "组织账户管理员", TenantConstant.ACCOUNT_ADMIN);
|
||||
currentService.saveOne(accountAdminPack);
|
||||
}
|
||||
|
||||
|
||||
//step.3 创建租户套餐包(组织应用管理员)
|
||||
query.eq(SysTenantPack::getTenantId,tenantId);
|
||||
query.eq(SysTenantPack::getPackCode, TenantConstant.APP_ADMIN);
|
||||
SysTenantPack sysTenantPackAppAdmin = currentService.getOne(query);
|
||||
|
||||
if(null == sysTenantPackAppAdmin){
|
||||
// 创建超级管理员
|
||||
SysTenantPack appAdminPack = new SysTenantPack(tenantId, "组织应用管理员", TenantConstant.APP_ADMIN);
|
||||
|
||||
@ -27,10 +27,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@ -262,24 +259,38 @@ public class SysUserDepartServiceImpl extends ServiceImpl<SysUserDepartMapper, S
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<SysUser> getUserInformation(Integer tenantId, String departId,String roleId, String keyword, Integer pageSize, Integer pageNo) {
|
||||
public IPage<SysUser> getUserInformation(Integer tenantId, String departId,String roleId, String keyword, Integer pageSize, Integer pageNo, String excludeUserIdList) {
|
||||
IPage<SysUser> pageList = null;
|
||||
// 部门ID不存在 直接查询用户表即可
|
||||
Page<SysUser> page = new Page<>(pageNo, pageSize);
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
|
||||
List<String> userIdList = new ArrayList<>();
|
||||
if(oConvertUtils.isNotEmpty(excludeUserIdList)){
|
||||
userIdList = Arrays.asList(excludeUserIdList.split(SymbolConstant.COMMA));
|
||||
}
|
||||
if(oConvertUtils.isNotEmpty(departId)){
|
||||
// 有部门ID 需要走自定义sql
|
||||
SysDepart sysDepart = sysDepartService.getById(departId);
|
||||
//update-begin-author:taoyan date:2023-1-3 for: 用户选择组件 加载用户需要根据租户ID过滤
|
||||
pageList = this.baseMapper.getProcessUserList(page, sysDepart.getOrgCode(), keyword, tenantId);
|
||||
//update-begin---author:wangshuai---date:2024-02-02---for:【QQYUN-8239】用户角色,添加用户 返回2页数据,实际只显示一页---
|
||||
//update-begin---author:wangshuai---date:2024-02-02---for:【QQYUN-8239】用户角色,添加用户 返回2页数据,实际只显示一页---
|
||||
pageList = this.baseMapper.getProcessUserList(page, sysDepart.getOrgCode(), keyword, tenantId, userIdList);
|
||||
//update-end---author:wangshuai---date:2024-02-02---for:【QQYUN-8239】用户角色,添加用户 返回2页数据,实际只显示一页---
|
||||
} else if (oConvertUtils.isNotEmpty(roleId)) {
|
||||
pageList = this.sysUserMapper.selectUserListByRoleId(page, roleId, keyword, tenantId);
|
||||
//update-begin---author:wangshuai---date:2024-02-02---for:【QQYUN-8239】用户角色,添加用户 返回2页数据,实际只显示一页---
|
||||
pageList = this.sysUserMapper.selectUserListByRoleId(page, roleId, keyword, tenantId,userIdList);
|
||||
//update-end---author:wangshuai---date:2024-02-02---for:【QQYUN-8239】用户角色,添加用户 返回2页数据,实际只显示一页---
|
||||
//update-end-author:taoyan date:2023-1-3 for: 用户选择组件 加载用户需要根据租户ID过滤
|
||||
} else{
|
||||
LambdaQueryWrapper<SysUser> query = new LambdaQueryWrapper<>();
|
||||
query.eq(SysUser::getStatus,Integer.parseInt(CommonConstant.STATUS_1));
|
||||
query.ne(SysUser::getUsername,"_reserve_user_external");
|
||||
|
||||
//update-begin---author:wangshuai---date:2024-02-02---for:【QQYUN-8239】用户角色,添加用户 返回2页数据,实际只显示一页---
|
||||
if(oConvertUtils.isNotEmpty(excludeUserIdList)){
|
||||
query.notIn(SysUser::getId,Arrays.asList(excludeUserIdList.split(SymbolConstant.COMMA)));
|
||||
}
|
||||
//update-end---author:wangshuai---date:2024-02-02---for:【QQYUN-8239】用户角色,添加用户 返回2页数据,实际只显示一页---
|
||||
// 支持租户隔离
|
||||
if (tenantId != null) {
|
||||
List<String> userIds = userTenantMapper.getUserIdsByTenantId(tenantId);
|
||||
|
||||
@ -1,11 +1,13 @@
|
||||
package org.jeecg.modules.system.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
@ -1384,7 +1386,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||
* 保存用户职位
|
||||
*
|
||||
* @param userId
|
||||
* @param postIds
|
||||
* @param positionIds
|
||||
*/
|
||||
private void saveUserPosition(String userId, String positionIds) {
|
||||
if (oConvertUtils.isNotEmpty(positionIds)) {
|
||||
@ -1802,5 +1804,15 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||
//update-end---author:wangshuai ---date:20230710 for:【QQYUN-5731】导入用户时,没有提醒------------
|
||||
}
|
||||
//======================================= end 用户与部门 用户列表导入 =========================================
|
||||
|
||||
@Override
|
||||
public void checkUserAdminRejectDel(String userIds) {
|
||||
LambdaQueryWrapper<SysUser> query = new LambdaQueryWrapper<>();
|
||||
query.in(SysUser::getId,Arrays.asList(userIds.split(SymbolConstant.COMMA)));
|
||||
query.eq(SysUser::getUsername,"admin");
|
||||
Long adminRoleCount = this.baseMapper.selectCount(query);
|
||||
//大于0说明存在管理员用户,不允许删除
|
||||
if(adminRoleCount>0){
|
||||
throw new JeecgBootException("admin用户,不允许删除!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,11 +1,14 @@
|
||||
package org.jeecg.modules.system.util;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.constant.SymbolConstant;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.system.entity.SysPermission;
|
||||
import org.jeecg.modules.system.entity.SysRoleIndex;
|
||||
import org.jeecg.modules.system.service.ISysRoleIndexService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: scott
|
||||
@ -82,8 +85,9 @@ public class PermissionDataUtil {
|
||||
*/
|
||||
public static void addIndexPage(List<SysPermission> metaList) {
|
||||
boolean hasIndexMenu = false;
|
||||
SysRoleIndex defIndexCfg = PermissionDataUtil.getDefIndexConfig();
|
||||
for (SysPermission sysPermission : metaList) {
|
||||
if("首页".equals(sysPermission.getName())) {
|
||||
if(defIndexCfg.getUrl().equals(sysPermission.getUrl())) {
|
||||
hasIndexMenu = true;
|
||||
break;
|
||||
}
|
||||
@ -98,15 +102,38 @@ public class PermissionDataUtil {
|
||||
* @param metaList
|
||||
* @return
|
||||
*/
|
||||
public static boolean hasIndexPage(List<SysPermission> metaList){
|
||||
public static boolean hasIndexPage(List<SysPermission> metaList, SysRoleIndex defIndexCfg){
|
||||
boolean hasIndexMenu = false;
|
||||
for (SysPermission sysPermission : metaList) {
|
||||
if("首页".equals(sysPermission.getName())) {
|
||||
if(defIndexCfg.getUrl().equals(sysPermission.getUrl())) {
|
||||
hasIndexMenu = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return hasIndexMenu;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id判断是否授权某个页面
|
||||
*
|
||||
* @param metaList
|
||||
* @return
|
||||
*/
|
||||
public static boolean hasMenuById(List<SysPermission> metaList, String id) {
|
||||
for (SysPermission sysPermission : metaList) {
|
||||
if (id.equals(sysPermission.getId())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取默认首页配置
|
||||
*/
|
||||
public static SysRoleIndex getDefIndexConfig() {
|
||||
ISysRoleIndexService sysRoleIndexService = SpringContextUtils.getBean(ISysRoleIndexService.class);
|
||||
return sysRoleIndexService.queryDefaultIndex();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,57 +0,0 @@
|
||||
package org.jeecg.modules.system.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @author: wangshuai
|
||||
* @date: 2022年09月27日 20:56
|
||||
*/
|
||||
@Data
|
||||
public class SysFileLogVo {
|
||||
/**
|
||||
* 文件id
|
||||
*/
|
||||
private String fileId;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private String userId;
|
||||
/**
|
||||
* 日志内容
|
||||
*/
|
||||
private String dataContent;
|
||||
/**
|
||||
* 真实姓名
|
||||
*/
|
||||
private String realname;
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 日志创建时间
|
||||
*/
|
||||
private String createTime;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 文件名称
|
||||
*/
|
||||
private String fileName;
|
||||
|
||||
/**
|
||||
* 路径
|
||||
*/
|
||||
private String url;
|
||||
|
||||
/**
|
||||
* 是否为文件夹
|
||||
*/
|
||||
private String izFolder;
|
||||
}
|
||||
@ -1,142 +0,0 @@
|
||||
package org.jeecg.modules.system.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @author: wangshuai
|
||||
* @date: 2022年09月21日 17:27
|
||||
*/
|
||||
@Data
|
||||
public class SysFilesVo {
|
||||
/**
|
||||
* 需要复制的文件夹或者文件id
|
||||
*/
|
||||
private String fileId;
|
||||
|
||||
/**
|
||||
* 需要复制到哪个文件夹下的id
|
||||
*/
|
||||
private String copyToFileId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 委托人的用户id
|
||||
*/
|
||||
private String msgTo;
|
||||
|
||||
/**
|
||||
* 权限
|
||||
*/
|
||||
private String authority;
|
||||
|
||||
/**
|
||||
* 文件名称
|
||||
*/
|
||||
private String fileName;
|
||||
|
||||
|
||||
/**
|
||||
* 删除状态
|
||||
*/
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 文件大小
|
||||
*/
|
||||
private Double fileSize;
|
||||
|
||||
/**
|
||||
* 文件路径
|
||||
*/
|
||||
private String fileUrl;
|
||||
|
||||
/**
|
||||
* 说明(添加到系统日志)
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private String updateTime;
|
||||
|
||||
/**
|
||||
* 下载数
|
||||
*/
|
||||
private String downCount;
|
||||
|
||||
/**
|
||||
* 阅读数
|
||||
*/
|
||||
private String readCount;
|
||||
|
||||
/**
|
||||
* 父id
|
||||
*/
|
||||
private String parentId;
|
||||
|
||||
/**
|
||||
* 分享地址
|
||||
*/
|
||||
private String shareUrl;
|
||||
|
||||
/**
|
||||
* 是否允许下载(1:是 0:否)
|
||||
*/
|
||||
private String enableDown;
|
||||
|
||||
/**
|
||||
* 分享权限(1.关闭分享 2.允许所有联系人查看 3.允许任何人查看)
|
||||
*/
|
||||
private String sharePerms;
|
||||
|
||||
/**
|
||||
* 是否允许修改(1:是 0:否)
|
||||
*/
|
||||
private String enableUpdat;
|
||||
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 真实姓名
|
||||
*/
|
||||
private String realname;
|
||||
|
||||
/**
|
||||
* 权限方式(enableDown:下载,enableUpdat:修改,sharePerms:分享权限,reduction:还原,rename:重命名,newFile:上传新版本)
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 最上级的id
|
||||
*/
|
||||
private String rootId;
|
||||
|
||||
/**
|
||||
* 是否为文件夹(0否 1是)
|
||||
*/
|
||||
private String izFolder;
|
||||
|
||||
/**
|
||||
* 是否为一级文件夹(0否 1是)
|
||||
*/
|
||||
private String izRootFolder;
|
||||
}
|
||||
@ -20,7 +20,9 @@
|
||||
JSelectDept,
|
||||
</#if>
|
||||
<#if need_dept_user>
|
||||
JSelectUserByDept,
|
||||
<#-- update-begin---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
JSelectUser,
|
||||
<#-- update-end---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
</#if>
|
||||
<#if need_select_tree>
|
||||
JTreeSelect,
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
<#include "/common/utils.ftl">
|
||||
<#if po.isShow =='Y' && po.fieldName != 'id' && isNotPidField(tableVo, po.fieldDbName)>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isShow =='Y' && po.fieldName != 'id' && po.fieldName !='delFlag' && isNotPidField(tableVo, po.fieldDbName)>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#assign form_field_dictCode="">
|
||||
<#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1>
|
||||
<#assign form_field_dictCode="${po.dictTable},${po.dictText},${po.dictField}">
|
||||
@ -48,7 +50,9 @@
|
||||
<a-input-password v-model:value="formData.${po.fieldName}" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled<#else>:disabled="disabled"</#if>/>
|
||||
<#elseif po.classType =='sel_user'>
|
||||
<#assign need_dept_user = true>
|
||||
<j-select-user-by-dept v-model:value="formData.${po.fieldName}" <#if po.readonly=='Y'>disabled<#else>:disabled="disabled"</#if>/>
|
||||
<#-- update-begin---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
<j-select-user v-model:value="formData.${po.fieldName}" <#if po.readonly=='Y'>disabled<#else>:disabled="disabled"</#if>/>
|
||||
<#-- update-end---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
<#elseif po.classType =='textarea'>
|
||||
<a-textarea v-model:value="formData.${autoStringSuffixForModel(po)}" :rows="4" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled<#else>:disabled="disabled"</#if>/>
|
||||
<#elseif po.classType=='radio'>
|
||||
|
||||
@ -20,7 +20,9 @@
|
||||
import JSelectDept from '/@/components/Form/src/jeecg/components/JSelectDept.vue';
|
||||
</#if>
|
||||
<#if need_dept_user>
|
||||
import JSelectUserByDept from '/@/components/Form/src/jeecg/components/JSelectUserByDept.vue';
|
||||
<#-- update-begin---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
import JSelectUser from '/@/components/Form/src/jeecg/components/JSelectUser.vue';
|
||||
<#-- update-end---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
</#if>
|
||||
<#if need_select_tree>
|
||||
import JTreeSelect from '/@/components/Form/src/jeecg/components/JTreeSelect.vue';
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
<#include "/common/utils.ftl">
|
||||
<#if po.isQuery=='Y'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isQuery=='Y' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#assign query_flag=true>
|
||||
<#if query_field_no==2>
|
||||
<template v-if="toggleSearchStatus">
|
||||
@ -19,7 +21,9 @@
|
||||
<#if po.classType=='sel_search'>
|
||||
<#if query_field_no gt 1> </#if><j-search-select placeholder="请选择${po.filedComment}" v-model:value="queryParam.${po.fieldName}" dict="${po.dictTable},${po.dictText},${po.dictField}" />
|
||||
<#elseif po.classType=='sel_user'>
|
||||
<#if query_field_no gt 1> </#if><j-select-user-by-dept placeholder="请选择${po.filedComment}" v-model:value="queryParam.${po.fieldName}" @change="(value)=>handleFormJoinChange('${po.fieldName}',value)"/>
|
||||
<#-- update-begin---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
<#if query_field_no gt 1> </#if><j-select-user placeholder="请选择${po.filedComment}" v-model:value="queryParam.${po.fieldName}" @change="(value)=>handleFormJoinChange('${po.fieldName}',value)"/>
|
||||
<#-- update-end---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
<#elseif po.classType=='switch'>
|
||||
<#if query_field_no gt 1> </#if><j-switch placeholder="请选择${po.filedComment}" v-model:value="queryParam.${po.fieldName}" <#if po.dictField!= 'is_open'>:options="${po.dictField}"</#if> query />
|
||||
<#elseif po.classType=='sel_depart'>
|
||||
|
||||
@ -144,7 +144,9 @@
|
||||
<#assign extAttrs="">
|
||||
<#assign dictCode="">
|
||||
<#if po.dictTable?default('')?trim?length gt 1 && po.dictText?default('')?trim?length gt 1 && po.dictField?default("")?trim?length gt 1>
|
||||
<#assign dictCode="dictTable: '${po.dictTable}', dictCode: '${po.dictField}', dictText: '${po.dictText}'">
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:fix 带条件字典存在单引号导致js编译错误---------- -->
|
||||
<#assign dictCode="dictTable: \"${po.dictTable}\", dictCode: '${po.dictField}', dictText: '${po.dictText}'">
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:fix 带条件字典存在单引号导致js编译错误---------- -->
|
||||
<#elseif po.dictField?default("")?trim?length gt 1>
|
||||
<#assign dictCode="dictCode: '${po.dictField}'">
|
||||
</#if>
|
||||
@ -153,7 +155,9 @@
|
||||
<#assign extAttrs="${dictCode},">
|
||||
<#elseif po.classType=='cat_tree'>
|
||||
<#-- 分类字典树 -->
|
||||
<#assign extAttrs="pcode: '${po.dictField}',">
|
||||
<#-- update-begin---author:chenrui ---date:20240109 for:[issue/5787]增加非空判断防止代码生成时空指针异常---------- -->
|
||||
<#assign extAttrs="pcode: '${po.dictField?default('')}',">
|
||||
<#-- update-end---author:chenrui ---date:20240109 for:[issue/5787]增加非空判断防止代码生成时空指针异常---------- -->
|
||||
<#elseif po.classType=='sel_tree'>
|
||||
<#-- 自定义树 -->
|
||||
<#if po.dictText??>
|
||||
@ -166,10 +170,14 @@
|
||||
<#assign extAttrs="hasChildField: '${po.dictText?split(',')[3]}'">
|
||||
</#if>
|
||||
</#if>
|
||||
<#assign extAttrs="${extAttrs}, pidValue: '${po.dictField}',">
|
||||
<#-- update-begin---author:chenrui ---date:20240109 for:[issue/5787]增加非空判断防止代码生成时空指针异常---------- -->
|
||||
<#assign extAttrs="${extAttrs}, pidValue: '${po.dictField?default('')}',">
|
||||
<#-- update-end---author:chenrui ---date:20240109 for:[issue/5787]增加非空判断防止代码生成时空指针异常---------- -->
|
||||
<#elseif po.classType=='popup'>
|
||||
<#-- popup -->
|
||||
<#if po.dictText?default("")?trim?length gt 1 && po.dictText?index_of(',') gt 0>
|
||||
<#-- update-begin---author:chenrui ---date:20240109 for:[issue/5787]增加非空判断防止代码生成时空指针异常---------- -->
|
||||
<#if po.dictText?default("")?trim?length gt 1 && po.dictText?index_of(',') gt 0 && po.dictField?default("")?trim?length gt 1>
|
||||
<#-- update-begin---author:chenrui ---date:20240109 for:[issue/5787]增加非空判断防止代码生成时空指针异常---------- -->
|
||||
<#-- 如果有多个回填字段,找到popup字段对应的来源字段 -->
|
||||
<#assign orgFieldIx=po.dictText?split(',')?seq_index_of(po.fieldDbName)>
|
||||
<#assign orgField=po.dictField?split(',')[orgFieldIx]>
|
||||
|
||||
@ -6,7 +6,9 @@ import { render } from '/@/utils/common/renderUtils';
|
||||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
<#list columns as po>
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
{
|
||||
title: '${po.filedComment}',
|
||||
align:"center",
|
||||
@ -70,7 +72,9 @@ export const searchFormSchema: FormSchema[] = [
|
||||
<#if po.fieldDbName=='bpm_status'>
|
||||
<#assign bpm_flag=true>
|
||||
</#if>
|
||||
<#if po.isQuery=='Y'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isQuery=='Y' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#assign query_flag=true>
|
||||
<#assign query_field_dictCode="">
|
||||
<#if po.dictTable?default("")?trim?length gt 1>
|
||||
@ -88,7 +92,9 @@ export const searchFormSchema: FormSchema[] = [
|
||||
dict:"${po.dictTable},${po.dictText},${po.dictField}"
|
||||
},
|
||||
<#elseif po.classType=='sel_user'>
|
||||
component: 'JSelectUserByDept',
|
||||
<#-- update-begin---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
component: 'JSelectUser',
|
||||
<#-- update-end---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
<#elseif po.classType=='switch'>
|
||||
component: 'JSwitch',
|
||||
componentProps:{
|
||||
@ -186,7 +192,9 @@ export const formSchema: FormSchema[] = [
|
||||
<#if po.fieldDbName == 'id'>
|
||||
<#assign id_exists = true>
|
||||
</#if>
|
||||
<#if po.isShow =='Y'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isShow =='Y' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#assign form_field_dictCode="">
|
||||
<#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1>
|
||||
<#assign form_field_dictCode="${po.dictTable},${po.dictText},${po.dictField}">
|
||||
@ -236,7 +244,9 @@ export const formSchema: FormSchema[] = [
|
||||
<#elseif po.classType =='password'>
|
||||
component: 'InputPassword',
|
||||
<#elseif po.classType =='sel_user'>
|
||||
component: 'JSelectUserByDept',
|
||||
<#-- update-begin---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
component: 'JSelectUser',
|
||||
<#-- update-end---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
componentProps:{
|
||||
labelKey:'realname',
|
||||
},
|
||||
@ -387,7 +397,9 @@ export const formSchema: FormSchema[] = [
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
<#list columns as po>
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
${superQueryFieldListForVue3(po,po_index)},
|
||||
</#if>
|
||||
</#list>
|
||||
|
||||
@ -6,7 +6,9 @@ import { render } from '/@/utils/common/renderUtils';
|
||||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
<#list columns as po>
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
{
|
||||
title: '${po.filedComment}',
|
||||
align: "center",
|
||||
@ -71,7 +73,9 @@ export const searchFormSchema: FormSchema[] = [
|
||||
<#if po.fieldDbName=='bpm_status'>
|
||||
<#assign bpm_flag=true>
|
||||
</#if>
|
||||
<#if po.isQuery=='Y'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isQuery=='Y' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#assign query_flag=true>
|
||||
<#assign query_field_dictCode="">
|
||||
<#if po.dictTable?default("")?trim?length gt 1>
|
||||
@ -89,7 +93,9 @@ export const searchFormSchema: FormSchema[] = [
|
||||
dict: "${po.dictTable},${po.dictText},${po.dictField}"
|
||||
},
|
||||
<#elseif po.classType=='sel_user'>
|
||||
component: 'JSelectUserByDept',
|
||||
<#-- update-begin---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
component: 'JSelectUser',
|
||||
<#-- update-end---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
<#elseif po.classType=='switch'>
|
||||
component: 'JSwitch',
|
||||
componentProps:{
|
||||
@ -181,7 +187,9 @@ export const formSchema: FormSchema[] = [
|
||||
<#if po.fieldDbName == 'id'>
|
||||
<#assign id_exists = true>
|
||||
</#if>
|
||||
<#if po.isShow =='Y'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isShow =='Y' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#assign form_field_dictCode="">
|
||||
<#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1>
|
||||
<#assign form_field_dictCode="${po.dictTable},${po.dictText},${po.dictField}">
|
||||
@ -222,7 +230,9 @@ export const formSchema: FormSchema[] = [
|
||||
<#elseif po.classType =='password'>
|
||||
component: 'InputPassword',
|
||||
<#elseif po.classType =='sel_user'>
|
||||
component: 'JSelectUserByDept',
|
||||
<#-- update-begin---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
component: 'JSelectUser',
|
||||
<#-- update-end---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
componentProps:{
|
||||
labelKey: 'realname',
|
||||
},
|
||||
@ -373,7 +383,9 @@ export const formSchema: FormSchema[] = [
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
<#list columns as po>
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
${superQueryFieldListForVue3(po,po_index)},
|
||||
</#if>
|
||||
</#list>
|
||||
|
||||
@ -80,7 +80,7 @@
|
||||
const validatorRules = {
|
||||
<#include "/common/validatorRulesTemplate/native/vue3MainNative.ftl">
|
||||
};
|
||||
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true });
|
||||
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
|
||||
|
||||
// 表单禁用
|
||||
const disabled = computed(()=>{
|
||||
@ -132,8 +132,14 @@
|
||||
function edit(record) {
|
||||
nextTick(() => {
|
||||
resetFields();
|
||||
const tmpData = {};
|
||||
Object.keys(formData).forEach((key) => {
|
||||
if(record.hasOwnProperty(key)){
|
||||
tmpData[key] = record[key]
|
||||
}
|
||||
})
|
||||
//赋值
|
||||
Object.assign(formData, record);
|
||||
Object.assign(formData, tmpData);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -6,7 +6,9 @@ import { render } from '/@/utils/common/renderUtils';
|
||||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
<#list columns as po>
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
{
|
||||
title: '${po.filedComment}',
|
||||
<#if po.fieldDbName == tableVo.extendParams.textField>
|
||||
@ -74,7 +76,9 @@ export const searchFormSchema: FormSchema[] = [
|
||||
<#if po.fieldDbName=='bpm_status'>
|
||||
<#assign bpm_flag=true>
|
||||
</#if>
|
||||
<#if po.isQuery=='Y'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isQuery=='Y' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#assign query_flag=true>
|
||||
<#assign query_field_dictCode="">
|
||||
<#if po.dictTable?default("")?trim?length gt 1>
|
||||
@ -92,7 +96,9 @@ export const searchFormSchema: FormSchema[] = [
|
||||
dict:"${po.dictTable},${po.dictText},${po.dictField}"
|
||||
},
|
||||
<#elseif po.classType=='sel_user'>
|
||||
component: 'JSelectUserByDept',
|
||||
<#-- update-begin---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
component: 'JSelectUser',
|
||||
<#-- update-end---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
<#elseif po.classType=='switch'>
|
||||
component: 'JSwitch',
|
||||
componentProps:{
|
||||
@ -204,7 +210,9 @@ export const formSchema: FormSchema[] = [
|
||||
<#if po.fieldDbName == 'id'>
|
||||
<#assign id_exists = true>
|
||||
</#if>
|
||||
<#if po.isShow =='Y'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isShow =='Y' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#assign form_field_dictCode="">
|
||||
<#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1>
|
||||
<#assign form_field_dictCode="${po.dictTable},${po.dictText},${po.dictField}">
|
||||
@ -262,7 +270,9 @@ export const formSchema: FormSchema[] = [
|
||||
<#elseif po.classType =='password'>
|
||||
component: 'InputPassword',
|
||||
<#elseif po.classType =='sel_user'>
|
||||
component: 'JSelectUserByDept',
|
||||
<#-- update-begin---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
component: 'JSelectUser',
|
||||
<#-- update-end---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
componentProps:{
|
||||
labelKey:'realname',
|
||||
},
|
||||
@ -416,7 +426,9 @@ export const formSchema: FormSchema[] = [
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
<#list columns as po>
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
${superQueryFieldListForVue3(po,po_index)},
|
||||
</#if>
|
||||
</#list>
|
||||
|
||||
@ -6,7 +6,9 @@ import { render } from '/@/utils/common/renderUtils';
|
||||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
<#list columns as po>
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
{
|
||||
title: '${po.filedComment}',
|
||||
<#if po.fieldDbName == tableVo.extendParams.textField>
|
||||
@ -75,7 +77,9 @@ export const searchFormSchema: FormSchema[] = [
|
||||
<#if po.fieldDbName=='bpm_status'>
|
||||
<#assign bpm_flag=true>
|
||||
</#if>
|
||||
<#if po.isQuery=='Y'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isQuery=='Y' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#assign query_flag=true>
|
||||
<#assign query_field_dictCode="">
|
||||
<#if po.dictTable?default("")?trim?length gt 1>
|
||||
@ -93,7 +97,9 @@ export const searchFormSchema: FormSchema[] = [
|
||||
dict:"${po.dictTable},${po.dictText},${po.dictField}"
|
||||
},
|
||||
<#elseif po.classType=='sel_user'>
|
||||
component: 'JSelectUserByDept',
|
||||
<#-- update-begin---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
component: 'JSelectUser',
|
||||
<#-- update-end---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
<#elseif po.classType=='switch'>
|
||||
component: 'JSwitch',
|
||||
componentProps: {
|
||||
@ -203,7 +209,9 @@ export const formSchema: FormSchema[] = [
|
||||
<#if po.fieldDbName == 'id'>
|
||||
<#assign id_exists = true>
|
||||
</#if>
|
||||
<#if po.isShow =='Y'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isShow =='Y' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#assign form_field_dictCode="">
|
||||
<#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1>
|
||||
<#assign form_field_dictCode="${po.dictTable},${po.dictText},${po.dictField}">
|
||||
@ -252,7 +260,9 @@ export const formSchema: FormSchema[] = [
|
||||
<#elseif po.classType =='password'>
|
||||
component: 'InputPassword',
|
||||
<#elseif po.classType =='sel_user'>
|
||||
component: 'JSelectUserByDept',
|
||||
<#-- update-begin---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
component: 'JSelectUser',
|
||||
<#-- update-end---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
componentProps:{
|
||||
labelKey: 'realname',
|
||||
},
|
||||
@ -406,7 +416,9 @@ export const formSchema: FormSchema[] = [
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
<#list columns as po>
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
${superQueryFieldListForVue3(po,po_index)},
|
||||
</#if>
|
||||
</#list>
|
||||
|
||||
@ -98,7 +98,7 @@
|
||||
const validatorRules = {
|
||||
<#include "/common/validatorRulesTemplate/native/vue3MainNative.ftl">
|
||||
};
|
||||
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true });
|
||||
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
|
||||
const props = defineProps({
|
||||
formDisabled: { type: Boolean, default: false },
|
||||
formData: { type: Object, default: ()=>{} },
|
||||
@ -157,9 +157,15 @@
|
||||
resetFields();
|
||||
expandedRowKeys.value = [];
|
||||
treeData.value = await loadTreeData({ async: false, pcode: '' });
|
||||
const tmpData = {};
|
||||
Object.keys(formData).forEach((key) => {
|
||||
if(record.hasOwnProperty(key)){
|
||||
tmpData[key] = record[key]
|
||||
}
|
||||
})
|
||||
//赋值
|
||||
Object.assign(formData, record);
|
||||
model = record
|
||||
Object.assign(formData,tmpData);
|
||||
model = tmpData
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -6,7 +6,9 @@ import { render } from '/@/utils/common/renderUtils';
|
||||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
<#list columns as po>
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
{
|
||||
title: '${po.filedComment}',
|
||||
align:"center",
|
||||
@ -67,7 +69,9 @@ export const columns: BasicColumn[] = [
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
<#-- 开始循环 -->
|
||||
<#list columns as po>
|
||||
<#if po.isQuery=='Y'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isQuery=='Y' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#assign query_flag=true>
|
||||
<#assign query_field_dictCode="">
|
||||
<#if po.dictTable?default("")?trim?length gt 1>
|
||||
@ -85,7 +89,9 @@ export const searchFormSchema: FormSchema[] = [
|
||||
dict:"${po.dictTable},${po.dictText},${po.dictField}"
|
||||
},
|
||||
<#elseif po.classType=='sel_user'>
|
||||
component: 'JSelectUserByDept',
|
||||
<#-- update-begin---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
component: 'JSelectUser',
|
||||
<#-- update-end---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
<#elseif po.classType=='switch'>
|
||||
component: 'JSwitch',
|
||||
componentProps:{
|
||||
@ -179,7 +185,9 @@ export const formSchema: FormSchema[] = [
|
||||
<#if po.fieldDbName == 'id'>
|
||||
<#assign id_exists = true>
|
||||
</#if>
|
||||
<#if po.isShow =='Y'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isShow =='Y' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#assign form_field_dictCode="">
|
||||
<#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1>
|
||||
<#assign form_field_dictCode="${po.dictTable},${po.dictText},${po.dictField}">
|
||||
@ -229,7 +237,9 @@ export const formSchema: FormSchema[] = [
|
||||
<#elseif po.classType =='password'>
|
||||
component: 'InputPassword',
|
||||
<#elseif po.classType =='sel_user'>
|
||||
component: 'JSelectUserByDept',
|
||||
<#-- update-begin---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
component: 'JSelectUser',
|
||||
<#-- update-end---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
componentProps:{
|
||||
labelKey:'realname',
|
||||
},
|
||||
@ -381,7 +391,9 @@ export const formSchema: FormSchema[] = [
|
||||
//子表列表数据
|
||||
export const ${sub.entityName?uncap_first}Columns: BasicColumn[] = [
|
||||
<#list sub.originalColumns as po>
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
{
|
||||
title: '${po.filedComment}',
|
||||
align:"center",
|
||||
@ -453,7 +465,9 @@ export const ${sub.entityName?uncap_first}FormSchema: FormSchema[] = [
|
||||
show: false
|
||||
},
|
||||
</#if>
|
||||
<#if po.isShow =='Y'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isShow =='Y' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#assign form_field_dictCode="">
|
||||
<#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1>
|
||||
<#assign form_field_dictCode="${po.dictTable},${po.dictText},${po.dictField}">
|
||||
@ -503,7 +517,9 @@ export const ${sub.entityName?uncap_first}FormSchema: FormSchema[] = [
|
||||
<#elseif po.classType =='password'>
|
||||
component: 'InputPassword',
|
||||
<#elseif po.classType =='sel_user'>
|
||||
component: 'JSelectUserByDept',
|
||||
<#-- update-begin---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
component: 'JSelectUser',
|
||||
<#-- update-end---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
componentProps:{
|
||||
labelKey:'realname',
|
||||
},
|
||||
@ -647,7 +663,9 @@ export const ${sub.entityName?uncap_first}FormSchema: FormSchema[] = [
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
<#list columns as po>
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
${superQueryFieldListForVue3(po,po_index)},
|
||||
</#if>
|
||||
</#list>
|
||||
|
||||
@ -6,7 +6,9 @@ import { render } from '/@/utils/common/renderUtils';
|
||||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
<#list columns as po>
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
{
|
||||
title: '${po.filedComment}',
|
||||
align:"center",
|
||||
@ -67,7 +69,9 @@ export const columns: BasicColumn[] = [
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
<#-- 开始循环 -->
|
||||
<#list columns as po>
|
||||
<#if po.isQuery=='Y'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isQuery=='Y' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#assign query_flag=true>
|
||||
<#assign query_field_dictCode="">
|
||||
<#if po.dictTable?default("")?trim?length gt 1>
|
||||
@ -85,7 +89,9 @@ export const searchFormSchema: FormSchema[] = [
|
||||
dict:"${po.dictTable},${po.dictText},${po.dictField}"
|
||||
},
|
||||
<#elseif po.classType=='sel_user'>
|
||||
component: 'JSelectUserByDept',
|
||||
<#-- update-begin---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
component: 'JSelectUser',
|
||||
<#-- update-end---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
<#elseif po.classType=='switch'>
|
||||
component: 'JSwitch',
|
||||
componentProps:{
|
||||
@ -179,7 +185,9 @@ export const formSchema: FormSchema[] = [
|
||||
<#if po.fieldDbName == 'id'>
|
||||
<#assign id_exists = true>
|
||||
</#if>
|
||||
<#if po.isShow =='Y'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isShow =='Y' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#assign form_field_dictCode="">
|
||||
<#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1>
|
||||
<#assign form_field_dictCode="${po.dictTable},${po.dictText},${po.dictField}">
|
||||
@ -229,7 +237,9 @@ export const formSchema: FormSchema[] = [
|
||||
<#elseif po.classType =='password'>
|
||||
component: 'InputPassword',
|
||||
<#elseif po.classType =='sel_user'>
|
||||
component: 'JSelectUserByDept',
|
||||
<#-- update-begin---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
component: 'JSelectUser',
|
||||
<#-- update-end---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
componentProps:{
|
||||
labelKey:'realname',
|
||||
},
|
||||
@ -381,7 +391,9 @@ export const formSchema: FormSchema[] = [
|
||||
//子表列表数据
|
||||
export const ${sub.entityName?uncap_first}Columns: BasicColumn[] = [
|
||||
<#list sub.originalColumns as po>
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
{
|
||||
title: '${po.filedComment}',
|
||||
align:"center",
|
||||
@ -453,7 +465,9 @@ export const ${sub.entityName?uncap_first}FormSchema: FormSchema[] = [
|
||||
show: false
|
||||
},
|
||||
</#if>
|
||||
<#if po.isShow =='Y'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isShow =='Y' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#assign form_field_dictCode="">
|
||||
<#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1>
|
||||
<#assign form_field_dictCode="${po.dictTable},${po.dictText},${po.dictField}">
|
||||
@ -503,7 +517,9 @@ export const ${sub.entityName?uncap_first}FormSchema: FormSchema[] = [
|
||||
<#elseif po.classType =='password'>
|
||||
component: 'InputPassword',
|
||||
<#elseif po.classType =='sel_user'>
|
||||
component: 'JSelectUserByDept',
|
||||
<#-- update-begin---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
component: 'JSelectUser',
|
||||
<#-- update-end---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
componentProps:{
|
||||
labelKey:'realname',
|
||||
},
|
||||
@ -647,7 +663,9 @@ export const ${sub.entityName?uncap_first}FormSchema: FormSchema[] = [
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
<#list columns as po>
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
${superQueryFieldListForVue3(po,po_index)},
|
||||
</#if>
|
||||
</#list>
|
||||
|
||||
@ -79,7 +79,7 @@
|
||||
const validatorRules = {
|
||||
<#include "/common/validatorRulesTemplate/native/vue3MainNative.ftl">
|
||||
};
|
||||
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true });
|
||||
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
|
||||
const formRef = ref();
|
||||
// 表单禁用
|
||||
const disabled = computed(()=>{
|
||||
@ -131,8 +131,14 @@
|
||||
function edit(record) {
|
||||
nextTick(() => {
|
||||
resetFields();
|
||||
const tmpData = {};
|
||||
Object.keys(formData).forEach((key) => {
|
||||
if(record.hasOwnProperty(key)){
|
||||
tmpData[key] = record[key]
|
||||
}
|
||||
})
|
||||
//赋值
|
||||
Object.assign(formData, record);
|
||||
Object.assign(formData,tmpData);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -78,7 +78,7 @@
|
||||
</#if>
|
||||
</#list>
|
||||
};
|
||||
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true });
|
||||
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
|
||||
const props = defineProps({
|
||||
disabled: { type: Boolean, default: false },
|
||||
});
|
||||
@ -100,8 +100,14 @@
|
||||
function edit(record) {
|
||||
nextTick(() => {
|
||||
resetFields();
|
||||
const tmpData = {};
|
||||
Object.keys(formData).forEach((key) => {
|
||||
if(record.hasOwnProperty(key)){
|
||||
tmpData[key] = record[key]
|
||||
}
|
||||
})
|
||||
//赋值
|
||||
Object.assign(formData, record);
|
||||
Object.assign(formData,tmpData);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -7,7 +7,9 @@ import {JVxeTypes,JVxeColumn} from '/@/components/jeecg/JVxeTable/types'
|
||||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
<#list columns as po>
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
{
|
||||
title: '${po.filedComment}',
|
||||
align:"center",
|
||||
@ -71,7 +73,9 @@ export const searchFormSchema: FormSchema[] = [
|
||||
<#if po.fieldDbName=='bpm_status'>
|
||||
<#assign bpm_flag=true>
|
||||
</#if>
|
||||
<#if po.isQuery=='Y'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isQuery=='Y' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#assign query_flag=true>
|
||||
<#assign query_field_dictCode="">
|
||||
<#if po.dictTable?default("")?trim?length gt 1>
|
||||
@ -89,7 +93,9 @@ export const searchFormSchema: FormSchema[] = [
|
||||
dict:"${po.dictTable},${po.dictText},${po.dictField}"
|
||||
},
|
||||
<#elseif po.classType=='sel_user'>
|
||||
component: 'JSelectUserByDept',
|
||||
<#-- update-begin---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
component: 'JSelectUser',
|
||||
<#-- update-end---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
<#elseif po.classType=='switch'>
|
||||
component: 'JSwitch',
|
||||
componentProps:{
|
||||
@ -182,7 +188,9 @@ export const formSchema: FormSchema[] = [
|
||||
<#if po.fieldDbName == 'id'>
|
||||
<#assign id_exists = true>
|
||||
</#if>
|
||||
<#if po.isShow =='Y'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isShow =='Y' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#assign form_field_dictCode="">
|
||||
<#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1>
|
||||
<#assign form_field_dictCode="${po.dictTable},${po.dictText},${po.dictField}">
|
||||
@ -232,7 +240,9 @@ export const formSchema: FormSchema[] = [
|
||||
<#elseif po.classType =='password'>
|
||||
component: 'InputPassword',
|
||||
<#elseif po.classType =='sel_user'>
|
||||
component: 'JSelectUserByDept',
|
||||
<#-- update-begin---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
component: 'JSelectUser',
|
||||
<#-- update-end---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
componentProps:{
|
||||
labelKey:'realname',
|
||||
},
|
||||
@ -384,7 +394,9 @@ export const formSchema: FormSchema[] = [
|
||||
//子表列表数据
|
||||
export const ${sub.entityName?uncap_first}Columns: BasicColumn[] = [
|
||||
<#list sub.originalColumns as po>
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
{
|
||||
title: '${po.filedComment}',
|
||||
align:"center",
|
||||
@ -504,7 +516,9 @@ export const ${sub.entityName?uncap_first}FormSchema: FormSchema[] = [
|
||||
<#elseif po.classType =='password'>
|
||||
component: 'InputPassword',
|
||||
<#elseif po.classType =='sel_user'>
|
||||
component: 'JSelectUserByDept',
|
||||
<#-- update-begin---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
component: 'JSelectUser',
|
||||
<#-- update-end---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
componentProps:{
|
||||
labelKey:'realname',
|
||||
},
|
||||
@ -660,7 +674,9 @@ export const ${sub.entityName?uncap_first}JVxeColumns: JVxeColumn[] = [
|
||||
|
||||
<#-- 循环子表的列 开始 -->
|
||||
<#list sub.colums as col><#rt/>
|
||||
<#if col.isShow =='Y'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if col.isShow =='Y' && col.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if col.filedComment !='外键' >
|
||||
{
|
||||
title: '${col.filedComment}',
|
||||
@ -812,7 +828,9 @@ export const ${sub.entityName?uncap_first}JVxeColumns: JVxeColumn[] = [
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
<#list columns as po>
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
${superQueryFieldListForVue3(po,po_index)},
|
||||
</#if>
|
||||
</#list>
|
||||
@ -823,7 +841,9 @@ export const superQuerySchema = {
|
||||
view: 'table',
|
||||
fields: {
|
||||
<#list sub.colums as subCol>
|
||||
<#if subCol.isShowList =='Y' && subCol.fieldName !='id'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if subCol.isShowList =='Y' && subCol.fieldName !='id' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
${superQueryFieldListForVue3(subCol,subCol_index)},
|
||||
</#if>
|
||||
</#list>
|
||||
|
||||
@ -7,7 +7,9 @@ import {JVxeTypes,JVxeColumn} from '/@/components/jeecg/JVxeTable/types'
|
||||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
<#list columns as po>
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
{
|
||||
title: '${po.filedComment}',
|
||||
align:"center",
|
||||
@ -71,7 +73,9 @@ export const searchFormSchema: FormSchema[] = [
|
||||
<#if po.fieldDbName=='bpm_status'>
|
||||
<#assign bpm_flag=true>
|
||||
</#if>
|
||||
<#if po.isQuery=='Y'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isQuery=='Y' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#assign query_flag=true>
|
||||
<#assign query_field_dictCode="">
|
||||
<#if po.dictTable?default("")?trim?length gt 1>
|
||||
@ -89,7 +93,9 @@ export const searchFormSchema: FormSchema[] = [
|
||||
dict:"${po.dictTable},${po.dictText},${po.dictField}"
|
||||
},
|
||||
<#elseif po.classType=='sel_user'>
|
||||
component: 'JSelectUserByDept',
|
||||
<#-- update-begin---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
component: 'JSelectUser',
|
||||
<#-- update-end---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
<#elseif po.classType=='switch'>
|
||||
component: 'JSwitch',
|
||||
componentProps:{
|
||||
@ -182,7 +188,9 @@ export const formSchema: FormSchema[] = [
|
||||
<#if po.fieldDbName == 'id'>
|
||||
<#assign id_exists = true>
|
||||
</#if>
|
||||
<#if po.isShow =='Y'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isShow =='Y' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#assign form_field_dictCode="">
|
||||
<#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1>
|
||||
<#assign form_field_dictCode="${po.dictTable},${po.dictText},${po.dictField}">
|
||||
@ -232,7 +240,9 @@ export const formSchema: FormSchema[] = [
|
||||
<#elseif po.classType =='password'>
|
||||
component: 'InputPassword',
|
||||
<#elseif po.classType =='sel_user'>
|
||||
component: 'JSelectUserByDept',
|
||||
<#-- update-begin---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件------------- -->
|
||||
component: 'JSelectUser',
|
||||
<#-- update-end---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件------------- -->
|
||||
componentProps:{
|
||||
labelKey:'realname',
|
||||
},
|
||||
@ -394,7 +404,9 @@ export const ${sub.entityName?uncap_first}FormSchema: FormSchema[] = [
|
||||
<#if po.fieldDbName=='id'>
|
||||
<#assign sub_id_exists=true>
|
||||
</#if>
|
||||
<#if po.isShow =='Y'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isShow =='Y' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#assign form_field_dictCode="">
|
||||
<#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1>
|
||||
<#assign form_field_dictCode="${po.dictTable},${po.dictText},${po.dictField}">
|
||||
@ -444,7 +456,9 @@ export const ${sub.entityName?uncap_first}FormSchema: FormSchema[] = [
|
||||
<#elseif po.classType =='password'>
|
||||
component: 'InputPassword',
|
||||
<#elseif po.classType =='sel_user'>
|
||||
component: 'JSelectUserByDept',
|
||||
<#-- update-begin---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件------------- -->
|
||||
component: 'JSelectUser',
|
||||
<#-- update-end---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件------------- -->
|
||||
componentProps:{
|
||||
labelKey:'realname',
|
||||
},
|
||||
@ -600,7 +614,9 @@ export const ${sub.entityName?uncap_first}Columns: JVxeColumn[] = [
|
||||
|
||||
<#-- 循环子表的列 开始 -->
|
||||
<#list sub.colums as col><#rt/>
|
||||
<#if col.isShow =='Y'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if col.isShow =='Y' && col.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if col.filedComment !='外键' >
|
||||
{
|
||||
title: '${col.filedComment}',
|
||||
@ -753,7 +769,9 @@ export const ${sub.entityName?uncap_first}Columns: JVxeColumn[] = [
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
<#list columns as po>
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
${superQueryFieldListForVue3(po,po_index)},
|
||||
</#if>
|
||||
</#list>
|
||||
@ -764,7 +782,9 @@ export const superQuerySchema = {
|
||||
view: 'table',
|
||||
fields: {
|
||||
<#list sub.colums as subCol>
|
||||
<#if subCol.isShowList =='Y' && subCol.fieldName !='id'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if subCol.isShowList =='Y' && subCol.fieldName !='id' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
${superQueryFieldListForVue3(subCol,subCol_index)},
|
||||
</#if>
|
||||
</#list>
|
||||
|
||||
@ -7,7 +7,9 @@ import {JVxeTypes,JVxeColumn} from '/@/components/jeecg/JVxeTable/types'
|
||||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
<#list columns as po>
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
{
|
||||
title: '${po.filedComment}',
|
||||
align:"center",
|
||||
@ -71,7 +73,9 @@ export const searchFormSchema: FormSchema[] = [
|
||||
<#if po.fieldDbName=='bpm_status'>
|
||||
<#assign bpm_flag=true>
|
||||
</#if>
|
||||
<#if po.isQuery=='Y'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isQuery=='Y' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#assign query_flag=true>
|
||||
<#assign query_field_dictCode="">
|
||||
<#if po.dictTable?default("")?trim?length gt 1>
|
||||
@ -89,7 +93,9 @@ export const searchFormSchema: FormSchema[] = [
|
||||
dict:"${po.dictTable},${po.dictText},${po.dictField}"
|
||||
},
|
||||
<#elseif po.classType=='sel_user'>
|
||||
component: 'JSelectUserByDept',
|
||||
<#-- update-begin---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件------------- -->
|
||||
component: 'JSelectUser',
|
||||
<#-- update-end---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件------------- -->
|
||||
<#elseif po.classType=='switch'>
|
||||
component: 'JSwitch',
|
||||
componentProps:{
|
||||
@ -177,7 +183,9 @@ export const formSchema: FormSchema[] = [
|
||||
<#if po.fieldDbName == 'id'>
|
||||
<#assign id_exists = true>
|
||||
</#if>
|
||||
<#if po.isShow =='Y'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isShow =='Y' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#assign form_field_dictCode="">
|
||||
<#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1>
|
||||
<#assign form_field_dictCode="${po.dictTable},${po.dictText},${po.dictField}">
|
||||
@ -218,7 +226,9 @@ export const formSchema: FormSchema[] = [
|
||||
<#elseif po.classType =='password'>
|
||||
component: 'InputPassword',
|
||||
<#elseif po.classType =='sel_user'>
|
||||
component: 'JSelectUserByDept',
|
||||
<#-- update-begin---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件------------- -->
|
||||
component: 'JSelectUser',
|
||||
<#-- update-end---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件------------- -->
|
||||
componentProps:{
|
||||
labelKey:'realname',
|
||||
},
|
||||
@ -380,7 +390,9 @@ export const ${sub.entityName?uncap_first}FormSchema: FormSchema[] = [
|
||||
<#if po.fieldDbName=='id'>
|
||||
<#assign sub_id_exists=true>
|
||||
</#if>
|
||||
<#if po.isShow =='Y'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isShow =='Y' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#assign form_field_dictCode="">
|
||||
<#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1>
|
||||
<#assign form_field_dictCode="${po.dictTable},${po.dictText},${po.dictField}">
|
||||
@ -421,7 +433,9 @@ export const ${sub.entityName?uncap_first}FormSchema: FormSchema[] = [
|
||||
<#elseif po.classType =='password'>
|
||||
component: 'InputPassword',
|
||||
<#elseif po.classType =='sel_user'>
|
||||
component: 'JSelectUserByDept',
|
||||
<#-- update-begin---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
component: 'JSelectUser',
|
||||
<#-- update-end---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
componentProps:{
|
||||
labelKey:'realname',
|
||||
},
|
||||
@ -577,7 +591,9 @@ export const ${sub.entityName?uncap_first}Columns: JVxeColumn[] = [
|
||||
|
||||
<#-- 循环子表的列 开始 -->
|
||||
<#list sub.colums as col><#rt/>
|
||||
<#if col.isShow =='Y'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if col.isShow =='Y' && col.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if col.filedComment !='外键' >
|
||||
{
|
||||
title: '${col.filedComment}',
|
||||
@ -729,7 +745,9 @@ export const ${sub.entityName?uncap_first}Columns: JVxeColumn[] = [
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
<#list columns as po>
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
${superQueryFieldListForVue3(po,po_index)},
|
||||
</#if>
|
||||
</#list>
|
||||
@ -740,7 +758,9 @@ export const superQuerySchema = {
|
||||
view: 'table',
|
||||
fields: {
|
||||
<#list sub.colums as subCol>
|
||||
<#if subCol.isShowList =='Y' && subCol.fieldName !='id'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if subCol.isShowList =='Y' && subCol.fieldName !='id' && subCol.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
${superQueryFieldListForVue3(subCol,subCol_index)},
|
||||
</#if>
|
||||
</#list>
|
||||
|
||||
@ -158,7 +158,7 @@
|
||||
</#if>
|
||||
</#list>
|
||||
});
|
||||
const {resetFields, validate, validateInfos} = useForm(formData, validatorRules, {immediate: true});
|
||||
const {resetFields, validate, validateInfos} = useForm(formData, validatorRules, {immediate: false});
|
||||
const dbData = {};
|
||||
const formItemLayout = {
|
||||
labelCol: {xs: {span: 24}, sm: {span: 5}},
|
||||
@ -241,9 +241,14 @@
|
||||
|
||||
async function queryMainData(id) {
|
||||
const row = await queryDataById(id);
|
||||
Object.keys(row).map(k => {
|
||||
formData[k] = row[k];
|
||||
});
|
||||
const tmpData = {};
|
||||
Object.keys(formData).forEach((key) => {
|
||||
if(row.hasOwnProperty(key)){
|
||||
tmpData[key] = row[key]
|
||||
}
|
||||
})
|
||||
//赋值
|
||||
Object.assign(formData,tmpData);
|
||||
}
|
||||
|
||||
const {getSubFormAndTableData, transformData} = useValidateAntFormAndTable(activeKey, {
|
||||
|
||||
@ -85,7 +85,7 @@
|
||||
</#if>
|
||||
</#list>
|
||||
})
|
||||
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, {immediate: true});
|
||||
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, {immediate: false});
|
||||
const formItemLayout = {
|
||||
labelCol: { xs: { span: 24 }, sm: { span: 5 } },
|
||||
wrapperCol: { xs: { span: 24 }, sm: { span: 16 } },
|
||||
@ -93,15 +93,20 @@
|
||||
|
||||
async function initFormData(mainId) {
|
||||
resetFields();
|
||||
let tmpData = {}
|
||||
if(mainId){
|
||||
let list = await query${sub.entityName}ListByMainId(mainId);
|
||||
if(list && list.length>0){
|
||||
let temp = list[0];
|
||||
Object.keys(temp).map(k=>{
|
||||
formData[k] = temp[k];
|
||||
Object.keys(formData).forEach((key) => {
|
||||
if(temp.hasOwnProperty(key)){
|
||||
tmpData[key] = temp[key]
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
//赋值
|
||||
Object.assign(formData,tmpData);
|
||||
}
|
||||
|
||||
async function getFormData() {
|
||||
|
||||
@ -7,7 +7,9 @@ import {JVxeTypes,JVxeColumn} from '/@/components/jeecg/JVxeTable/types'
|
||||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
<#list columns as po>
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
{
|
||||
title: '${po.filedComment}',
|
||||
align:"center",
|
||||
@ -71,7 +73,9 @@ export const searchFormSchema: FormSchema[] = [
|
||||
<#if po.fieldDbName=='bpm_status'>
|
||||
<#assign bpm_flag=true>
|
||||
</#if>
|
||||
<#if po.isQuery=='Y'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isQuery=='Y' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#assign query_flag=true>
|
||||
<#assign query_field_dictCode="">
|
||||
<#if po.dictTable?default("")?trim?length gt 1>
|
||||
@ -89,7 +93,9 @@ export const searchFormSchema: FormSchema[] = [
|
||||
dict:"${po.dictTable},${po.dictText},${po.dictField}"
|
||||
},
|
||||
<#elseif po.classType=='sel_user'>
|
||||
component: 'JSelectUserByDept',
|
||||
<#-- update-begin---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
component: 'JSelectUser',
|
||||
<#-- update-end---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
<#elseif po.classType=='switch'>
|
||||
component: 'JSwitch',
|
||||
componentProps:{
|
||||
@ -182,7 +188,9 @@ export const formSchema: FormSchema[] = [
|
||||
<#if po.fieldDbName == 'id'>
|
||||
<#assign id_exists = true>
|
||||
</#if>
|
||||
<#if po.isShow =='Y'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isShow =='Y' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#assign form_field_dictCode="">
|
||||
<#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1>
|
||||
<#assign form_field_dictCode="${po.dictTable},${po.dictText},${po.dictField}">
|
||||
@ -229,7 +237,9 @@ export const formSchema: FormSchema[] = [
|
||||
<#elseif po.classType =='password'>
|
||||
component: 'InputPassword',
|
||||
<#elseif po.classType =='sel_user'>
|
||||
component: 'JSelectUserByDept',
|
||||
<#-- update-begin---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
component: 'JSelectUser',
|
||||
<#-- update-end---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
componentProps:{
|
||||
labelKey:'realname',
|
||||
},
|
||||
@ -391,7 +401,9 @@ export const ${sub.entityName?uncap_first}FormSchema: FormSchema[] = [
|
||||
<#if po.fieldDbName == 'id'>
|
||||
<#assign sub_id_exists = true>
|
||||
</#if>
|
||||
<#if po.isShow =='Y'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isShow =='Y' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#assign form_field_dictCode="">
|
||||
<#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1>
|
||||
<#assign form_field_dictCode="${po.dictTable},${po.dictText},${po.dictField}">
|
||||
@ -438,7 +450,9 @@ export const ${sub.entityName?uncap_first}FormSchema: FormSchema[] = [
|
||||
<#elseif po.classType =='password'>
|
||||
component: 'InputPassword',
|
||||
<#elseif po.classType =='sel_user'>
|
||||
component: 'JSelectUserByDept',
|
||||
<#-- update-begin---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
component: 'JSelectUser',
|
||||
<#-- update-end---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
||||
componentProps:{
|
||||
labelKey:'realname',
|
||||
},
|
||||
@ -594,7 +608,9 @@ export const ${sub.entityName?uncap_first}Columns: JVxeColumn[] = [
|
||||
|
||||
<#-- 循环子表的列 开始 -->
|
||||
<#list sub.colums as col><#rt/>
|
||||
<#if col.isShow =='Y'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if col.isShow =='Y' && col.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if col.filedComment !='外键' >
|
||||
{
|
||||
title: '${col.filedComment}',
|
||||
@ -746,7 +762,9 @@ export const ${sub.entityName?uncap_first}Columns: JVxeColumn[] = [
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
<#list columns as po>
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
${superQueryFieldListForVue3(po,po_index)},
|
||||
</#if>
|
||||
</#list>
|
||||
@ -757,7 +775,9 @@ export const superQuerySchema = {
|
||||
view: 'table',
|
||||
fields: {
|
||||
<#list sub.colums as subCol>
|
||||
<#if subCol.isShowList =='Y' && subCol.fieldName !='id'>
|
||||
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
<#if subCol.isShowList =='Y' && subCol.fieldName !='id' && po.fieldName !='delFlag'>
|
||||
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
||||
${superQueryFieldListForVue3(subCol,subCol_index)},
|
||||
</#if>
|
||||
</#list>
|
||||
|
||||
@ -11,6 +11,6 @@ WORKDIR /jeecg-boot
|
||||
EXPOSE 8080
|
||||
|
||||
#ADD ./src/main/resources/jeecg ./config/jeecg
|
||||
ADD ./target/jeecg-system-start-3.6.2.jar ./
|
||||
ADD ./target/jeecg-system-start-3.6.3.jar ./
|
||||
|
||||
CMD sleep 60;java -Djava.security.egd=file:/dev/./urandom -jar jeecg-system-start-3.6.2.jar
|
||||
CMD sleep 60;java -Djava.security.egd=file:/dev/./urandom -jar jeecg-system-start-3.6.3.jar
|
||||
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>jeecg-module-system</artifactId>
|
||||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<version>3.6.2</version>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@ -43,7 +43,7 @@
|
||||
<version>${dm8.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!--支持 mysql5.7、mysql8、MariaDB10.3.16
|
||||
<!-- flyway支持 mysql5.7、mysql8、MariaDB10.3.16
|
||||
<dependency>
|
||||
<groupId>org.flywaydb</groupId>
|
||||
<artifactId>flyway-core</artifactId>
|
||||
|
||||
@ -0,0 +1,136 @@
|
||||
package org.jeecg.config.flyway;
|
||||
|
||||
import com.baomidou.dynamic.datasource.DynamicRoutingDataSource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.flywaydb.core.Flyway;
|
||||
import org.flywaydb.core.api.FlywayException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.env.Environment;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 初始化flyway配置 修改之后支持多数据源,当出现异常时打印日志,不影响项目启动
|
||||
*
|
||||
* @author: wangshuai
|
||||
* @date: 2024/3/12 10:03
|
||||
*/
|
||||
@Slf4j
|
||||
@Configuration
|
||||
public class FlywayConfig {
|
||||
|
||||
@Autowired
|
||||
private DataSource dataSource;
|
||||
|
||||
@Autowired
|
||||
private Environment environment;
|
||||
|
||||
/**
|
||||
* 是否开启flyway
|
||||
*/
|
||||
@Value("${spring.flyway.enabled:false}")
|
||||
private Boolean enabled;
|
||||
|
||||
/**
|
||||
* 编码格式,默认UTF-8
|
||||
*/
|
||||
@Value("${spring.flyway.encoding:UTF-8}")
|
||||
private String encoding;
|
||||
|
||||
/**
|
||||
* 迁移sql脚本文件存放路径,官方默认db/migration
|
||||
*/
|
||||
@Value("${spring.flyway.locations:}")
|
||||
private String locations;
|
||||
|
||||
/**
|
||||
* 迁移sql脚本文件名称的前缀,默认V
|
||||
*/
|
||||
@Value("${spring.flyway.sql-migration-prefix:V}")
|
||||
private String sqlMigrationPrefix;
|
||||
|
||||
/**
|
||||
* 迁移sql脚本文件名称的分隔符,默认2个下划线__
|
||||
*/
|
||||
@Value("${spring.flyway.sql-migration-separator:__}")
|
||||
private String sqlMigrationSeparator;
|
||||
|
||||
/**
|
||||
* 文本前缀
|
||||
*/
|
||||
@Value("${spring.flyway.placeholder-prefix:#(}")
|
||||
private String placeholderPrefix;
|
||||
|
||||
/**
|
||||
* 文本后缀
|
||||
*/
|
||||
@Value("${spring.flyway.placeholder-suffix:)}")
|
||||
private String placeholderSuffix;
|
||||
|
||||
/**
|
||||
* 迁移sql脚本文件名称的后缀
|
||||
*/
|
||||
@Value("${spring.flyway.sql-migration-suffixes:.sql}")
|
||||
private String sqlMigrationSuffixes;
|
||||
|
||||
/**
|
||||
* 迁移时是否进行校验,默认true
|
||||
*/
|
||||
@Value("${spring.flyway.validate-on-migrate:true}")
|
||||
private Boolean validateOnMigrate;
|
||||
|
||||
/**
|
||||
* 当迁移发现数据库非空且存在没有元数据的表时,自动执行基准迁移,新建schema_version表
|
||||
*/
|
||||
@Value("${spring.flyway.baseline-on-migrate:true}")
|
||||
private Boolean baselineOnMigrate;
|
||||
|
||||
/**
|
||||
* 是否关闭要清除已有库下的表功能,生产环境必须为true,否则会删库,非常重要!!!
|
||||
*/
|
||||
@Value("${spring.flyway.clean-disabled:true}")
|
||||
private Boolean cleanDisabled;
|
||||
|
||||
@Bean
|
||||
public void migrate() {
|
||||
if(!enabled){
|
||||
return;
|
||||
}
|
||||
|
||||
DynamicRoutingDataSource ds = (DynamicRoutingDataSource) dataSource;
|
||||
Map<String, DataSource> dataSources = ds.getDataSources();
|
||||
dataSources.forEach((k, v) -> {
|
||||
if("master".equals(k)){
|
||||
String databaseType = environment.getProperty("spring.datasource.dynamic.datasource." + k + ".url");
|
||||
if (databaseType != null && databaseType.contains("mysql")) {
|
||||
try {
|
||||
Flyway flyway = Flyway.configure()
|
||||
.dataSource(v)
|
||||
.locations(locations)
|
||||
.encoding(encoding)
|
||||
.sqlMigrationPrefix(sqlMigrationPrefix)
|
||||
.sqlMigrationSeparator(sqlMigrationSeparator)
|
||||
.placeholderPrefix(placeholderPrefix)
|
||||
.placeholderSuffix(placeholderSuffix)
|
||||
.sqlMigrationSuffixes(sqlMigrationSuffixes)
|
||||
.validateOnMigrate(validateOnMigrate)
|
||||
.baselineOnMigrate(baselineOnMigrate)
|
||||
.cleanDisabled(cleanDisabled)
|
||||
.load();
|
||||
flyway.migrate();
|
||||
log.info("【升级提示】平台集成了MySQL库的Flyway,数据库版本自动升级! ");
|
||||
} catch (FlywayException e) {
|
||||
log.error("【升级提示】flyway执行sql脚本失败", e);
|
||||
}
|
||||
} else {
|
||||
log.warn("【升级提示】平台只集成了MySQL库的Flyway,实现了数据库版本自动升级! 其他类型的数据库,您可以考虑手工升级~");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -123,7 +123,9 @@ spring:
|
||||
resource:
|
||||
static-locations: classpath:/static/,classpath:/public/
|
||||
autoconfigure:
|
||||
exclude: com.alibaba.druid.spring.boot3.autoconfigure.DruidDataSourceAutoConfigure
|
||||
exclude:
|
||||
- com.alibaba.druid.spring.boot3.autoconfigure.DruidDataSourceAutoConfigure
|
||||
- org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration
|
||||
datasource:
|
||||
druid:
|
||||
stat-view-servlet:
|
||||
@ -139,7 +141,7 @@ spring:
|
||||
# 初始化大小,最小,最大
|
||||
initial-size: 5
|
||||
min-idle: 5
|
||||
maxActive: 20
|
||||
maxActive: 1000
|
||||
# 配置获取连接等待超时的时间
|
||||
maxWait: 60000
|
||||
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
||||
@ -177,7 +179,7 @@ spring:
|
||||
database: 0
|
||||
host: 127.0.0.1
|
||||
port: 6379
|
||||
password:
|
||||
password:
|
||||
#mybatis plus 设置
|
||||
mybatis-plus:
|
||||
mapper-locations: classpath*:org/jeecg/modules/**/xml/*Mapper.xml
|
||||
@ -264,9 +266,23 @@ jeecg:
|
||||
#分布式锁配置
|
||||
redisson:
|
||||
address: 127.0.0.1:6379
|
||||
password:
|
||||
password:
|
||||
type: STANDALONE
|
||||
enabled: true
|
||||
# ai-chat
|
||||
ai-chat:
|
||||
# 是否开启;必须。
|
||||
enabled: false
|
||||
# openAi接口秘钥,填写自己的apiKey;必须。
|
||||
apiKey: "????"
|
||||
# openAi域名,有代理就填代理的域名。默认:openAI官方apiHost
|
||||
apiHost: "https://api.openai.com"
|
||||
# 超时时间单位:s。默认 60s
|
||||
timeout: 60
|
||||
# 本地代理地址
|
||||
# proxy:
|
||||
# host: "http://127.0.0.1"
|
||||
# port: "7890"
|
||||
#cas单点登录
|
||||
cas:
|
||||
prefixUrl: http://cas.example.org:8443/cas
|
||||
|
||||
@ -123,7 +123,9 @@ spring:
|
||||
resource:
|
||||
static-locations: classpath:/static/,classpath:/public/
|
||||
autoconfigure:
|
||||
exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
|
||||
exclude:
|
||||
- com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
|
||||
- org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration
|
||||
datasource:
|
||||
druid:
|
||||
stat-view-servlet:
|
||||
@ -273,6 +275,7 @@ cas:
|
||||
#Mybatis输出sql日志
|
||||
logging:
|
||||
level:
|
||||
org.flywaydb: debug
|
||||
org.jeecg.modules.system.mapper: info
|
||||
#swagger
|
||||
knife4j:
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user