mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2026-01-03 20:35:29 +08:00
Merge branch 'master' into springboot3
# Conflicts: # jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java # jeecg-module-demo/src/main/java/org/jeecg/modules/demo/test/entity/JeecgDemo.java # jeecg-module-system/jeecg-system-biz/pom.xml # jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysTableWhiteListController.java # jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/WechatVerifyController.java # jeecg-module-system/jeecg-system-start/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.1</version>
|
||||
<version>3.6.2</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@ -94,6 +94,22 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
@GetMapping("/sys/api/getDepartIdsByUsername")
|
||||
List<String> getDepartIdsByUsername(@RequestParam("username") String username);
|
||||
|
||||
/**
|
||||
* 8.2 通过用户账号查询部门父ID集合
|
||||
* @param username
|
||||
* @return 部门 parentIds
|
||||
*/
|
||||
@GetMapping("/sys/api/getDepartParentIdsByUsername")
|
||||
Set<String> getDepartParentIdsByUsername(@RequestParam("username")String username);
|
||||
|
||||
/**
|
||||
* 8.3 查询部门父ID集合
|
||||
* @param depIds
|
||||
* @return 部门 parentIds
|
||||
*/
|
||||
@GetMapping("/sys/api/getDepartParentIdsByDepIds")
|
||||
Set<String> getDepartParentIdsByDepIds(@RequestParam("depIds") Set depIds);
|
||||
|
||||
/**
|
||||
* 9通过用户账号查询部门 name
|
||||
* @param username
|
||||
@ -481,6 +497,14 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
@GetMapping("/sys/api/loadCategoryDictItem")
|
||||
List<String> loadCategoryDictItem(@RequestParam("ids") String ids);
|
||||
|
||||
/**
|
||||
* 44 反向翻译分类字典,用于导入
|
||||
*
|
||||
* @param names 名称,逗号分割
|
||||
*/
|
||||
@GetMapping("/sys/api/loadCategoryDictItemByNames")
|
||||
List<String> loadCategoryDictItemByNames(@RequestParam("names") String names, @RequestParam("delNotExist") boolean delNotExist);
|
||||
|
||||
/**
|
||||
* 43 根据字典code加载字典text
|
||||
*
|
||||
@ -551,17 +575,20 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
@GetMapping("/sys/api/translateManyDict")
|
||||
Map<String, List<DictModel>> translateManyDict(@RequestParam("dictCodes") String dictCodes, @RequestParam("keys") String keys);
|
||||
|
||||
//update-begin---author:chenrui ---date:20231221 for:[issues/#5643]解决分布式下表字典跨库无法查询问题------------
|
||||
/**
|
||||
* 49 字典表的 翻译,可批量
|
||||
* @param table
|
||||
* @param text
|
||||
* @param code
|
||||
* @param keys 多个用逗号分割
|
||||
* @param ds
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@GetMapping("/sys/api/translateDictFromTableByKeys")
|
||||
List<DictModel> translateDictFromTableByKeys(@RequestParam("table") String table, @RequestParam("text") String text, @RequestParam("code") String code, @RequestParam("keys") String keys);
|
||||
List<DictModel> translateDictFromTableByKeys(@RequestParam("table") String table, @RequestParam("text") String text, @RequestParam("code") String code, @RequestParam("keys") String keys, @RequestParam("ds") String ds);
|
||||
//update-end---author:chenrui ---date:20231221 for:[issues/#5643]解决分布式下表字典跨库无法查询问题------------
|
||||
|
||||
/**
|
||||
* 发送模板消息
|
||||
|
||||
@ -65,6 +65,16 @@ public class SysBaseAPIFallback implements ISysBaseAPI {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getDepartParentIdsByUsername(String username) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getDepartParentIdsByDepIds(Set depIds) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getDepartNamesByUsername(String username) {
|
||||
return null;
|
||||
@ -275,10 +285,12 @@ public class SysBaseAPIFallback implements ISysBaseAPI {
|
||||
return null;
|
||||
}
|
||||
|
||||
//update-begin---author:chenrui ---date:20231221 for:[issues/#5643]解决分布式下表字典跨库无法查询问题------------
|
||||
@Override
|
||||
public List<DictModel> translateDictFromTableByKeys(String table, String text, String code, String keys) {
|
||||
public List<DictModel> translateDictFromTableByKeys(String table, String text, String code, String keys, String dataSource) {
|
||||
return null;
|
||||
}
|
||||
//update-end---author:chenrui ---date:20231221 for:[issues/#5643]解决分布式下表字典跨库无法查询问题------------
|
||||
|
||||
@Override
|
||||
public void sendTemplateMessage(MessageDTO message) {
|
||||
@ -319,6 +331,11 @@ public class SysBaseAPIFallback implements ISysBaseAPI {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> loadCategoryDictItemByNames(String names, boolean delNotExist) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> loadDictItem(String dictCode, String keys) {
|
||||
return null;
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>jeecg-system-api</artifactId>
|
||||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<version>3.6.1</version>
|
||||
<version>3.6.2</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@ -89,6 +89,20 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
*/
|
||||
List<String> getDepartIdsByUsername(String username);
|
||||
|
||||
/**
|
||||
* 8.2 通过用户账号查询部门父ID集合
|
||||
* @param username
|
||||
* @return 部门 parentIds
|
||||
*/
|
||||
Set<String> getDepartParentIdsByUsername(String username);
|
||||
|
||||
/**
|
||||
* 8.2 查询部门父ID集合
|
||||
* @param depIds
|
||||
* @return 部门 parentIds
|
||||
*/
|
||||
Set<String> getDepartParentIdsByDepIds(Set depIds);
|
||||
|
||||
/**
|
||||
* 9通过用户账号查询部门 name
|
||||
* @param username
|
||||
@ -373,6 +387,13 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
*/
|
||||
List<String> loadCategoryDictItem(String ids);
|
||||
|
||||
/**
|
||||
* 反向翻译分类字典,用于导入
|
||||
*
|
||||
* @param names 名称,逗号分割
|
||||
*/
|
||||
List<String> loadCategoryDictItemByNames(String names, boolean delNotExist);
|
||||
|
||||
/**
|
||||
* 根据字典code加载字典text
|
||||
*
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>jeecg-module-system</artifactId>
|
||||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<version>3.6.1</version>
|
||||
<version>3.6.2</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.1</version>
|
||||
<version>3.6.2</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@ -35,15 +35,15 @@
|
||||
<artifactId>jimureport-spring-boot3-starter-fastjson2</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jeecgframework.boot3</groupId>
|
||||
<artifactId>drag-free</artifactId>
|
||||
<version>1.0.2</version>
|
||||
<groupId>org.jeecgframework.jimureport</groupId>
|
||||
<artifactId>jimureport-drag</artifactId>
|
||||
<version>2.0.1</version>
|
||||
</dependency>
|
||||
<!-- 积木报表 mongo redis 支持包
|
||||
<!-- 积木报表 mongo redis 支持包
|
||||
<dependency>
|
||||
<groupId>org.jeecgframework.jimureport</groupId>
|
||||
<artifactId>jimureport-nosql-starter</artifactId>
|
||||
</dependency> -->
|
||||
</dependency>-->
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
||||
@ -140,6 +140,26 @@ public class SystemApiController {
|
||||
return sysBaseApi.getDepartIdsByUsername(username);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过用户账号查询部门父ID集合
|
||||
* @param username
|
||||
* @return 部门 id
|
||||
*/
|
||||
@GetMapping("/getDepartParentIdsByUsername")
|
||||
Set<String> getDepartParentIdsByUsername(@RequestParam("username") String username){
|
||||
return sysBaseApi.getDepartParentIdsByUsername(username);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询部门父ID集合
|
||||
* @param depIds
|
||||
* @return 部门 id
|
||||
*/
|
||||
@GetMapping("/getDepartParentIdsByDepIds")
|
||||
Set<String> getDepartParentIdsByDepIds(@RequestParam("depIds") Set depIds){
|
||||
return sysBaseApi.getDepartParentIdsByDepIds(depIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过用户账号查询部门 name
|
||||
* @param username
|
||||
@ -527,6 +547,17 @@ public class SystemApiController {
|
||||
return sysBaseApi.loadCategoryDictItem(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 反向翻译分类字典,用于导入
|
||||
*
|
||||
* @param names 名称,逗号分割
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/loadCategoryDictItemByNames")
|
||||
List<String> loadCategoryDictItemByNames(@RequestParam("names") String names, @RequestParam("delNotExist") boolean delNotExist) {
|
||||
return sysBaseApi.loadCategoryDictItemByNames(names, delNotExist);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据字典code加载字典text
|
||||
*
|
||||
@ -655,6 +686,7 @@ public class SystemApiController {
|
||||
}
|
||||
|
||||
|
||||
//update-begin---author:chenrui ---date:20231221 for:[issues/#5643]解决分布式下表字典跨库无法查询问题------------
|
||||
/**
|
||||
* 【接口签名验证】
|
||||
* 49 字典表的 翻译,可批量
|
||||
@ -663,12 +695,14 @@ public class SystemApiController {
|
||||
* @param text
|
||||
* @param code
|
||||
* @param keys 多个用逗号分割
|
||||
* @param ds 数据源
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/translateDictFromTableByKeys")
|
||||
public List<DictModel> translateDictFromTableByKeys(@RequestParam("table") String table, @RequestParam("text") String text, @RequestParam("code") String code, @RequestParam("keys") String keys) {
|
||||
return this.sysBaseApi.translateDictFromTableByKeys(table, text, code, keys);
|
||||
public List<DictModel> translateDictFromTableByKeys(@RequestParam("table") String table, @RequestParam("text") String text, @RequestParam("code") String code, @RequestParam("keys") String keys, @RequestParam("ds") String ds) {
|
||||
return this.sysBaseApi.translateDictFromTableByKeys(table, text, code, keys, ds);
|
||||
}
|
||||
//update-end---author:chenrui ---date:20231221 for:[issues/#5643]解决分布式下表字典跨库无法查询问题------------
|
||||
|
||||
/**
|
||||
* 发送模板信息
|
||||
|
||||
@ -79,7 +79,7 @@ public class QuartzJobController {
|
||||
* @param quartzJob
|
||||
* @return
|
||||
*/
|
||||
//@RequiresRoles("admin")
|
||||
@RequiresRoles("admin")
|
||||
@RequiresPermissions("system:quartzJob:add")
|
||||
@RequestMapping(value = "/add", method = RequestMethod.POST)
|
||||
public Result<?> add(@RequestBody QuartzJob quartzJob) {
|
||||
@ -93,7 +93,7 @@ public class QuartzJobController {
|
||||
* @param quartzJob
|
||||
* @return
|
||||
*/
|
||||
//@RequiresRoles("admin")
|
||||
@RequiresRoles("admin")
|
||||
@RequiresPermissions("system:quartzJob:edit")
|
||||
@RequestMapping(value = "/edit", method ={RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<?> eidt(@RequestBody QuartzJob quartzJob) {
|
||||
@ -112,7 +112,7 @@ public class QuartzJobController {
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@RequiresRoles("admin")
|
||||
@RequiresRoles("admin")
|
||||
@RequiresPermissions("system:quartzJob:delete")
|
||||
@RequestMapping(value = "/delete", method = RequestMethod.DELETE)
|
||||
public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
@ -131,7 +131,7 @@ public class QuartzJobController {
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
//@RequiresRoles("admin")
|
||||
@RequiresRoles("admin")
|
||||
@RequiresPermissions("system:quartzJob:deleteBatch")
|
||||
@RequestMapping(value = "/deleteBatch", method = RequestMethod.DELETE)
|
||||
public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
@ -151,7 +151,7 @@ public class QuartzJobController {
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@RequiresRoles("admin")
|
||||
@RequiresRoles("admin")
|
||||
@RequiresPermissions("system:quartzJob:pause")
|
||||
@GetMapping(value = "/pause")
|
||||
@Operation(summary = "停止定时任务")
|
||||
@ -170,7 +170,7 @@ public class QuartzJobController {
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@RequiresRoles("admin")
|
||||
@RequiresRoles("admin")
|
||||
@RequiresPermissions("system:quartzJob:resume")
|
||||
@GetMapping(value = "/resume")
|
||||
@Operation(summary = "启动定时任务")
|
||||
@ -271,7 +271,7 @@ public class QuartzJobController {
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@RequiresRoles("admin")
|
||||
@RequiresRoles("admin")
|
||||
@RequiresPermissions("system:quartzJob:execute")
|
||||
@GetMapping("/execute")
|
||||
public Result<?> execute(@RequestParam(name = "id", required = true) String id) {
|
||||
|
||||
@ -25,6 +25,7 @@ import org.jeecg.modules.system.model.SysDepartTreeModel;
|
||||
import org.jeecg.modules.system.service.ISysDepartService;
|
||||
import org.jeecg.modules.system.service.ISysUserDepartService;
|
||||
import org.jeecg.modules.system.service.ISysUserService;
|
||||
import org.jeecg.modules.system.vo.SysDepartExportVo;
|
||||
import org.jeecg.modules.system.vo.lowapp.ExportDepartVo;
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
@ -350,25 +351,34 @@ public class SysDepartController {
|
||||
}
|
||||
//------------------------------------------------------------------------------------------------
|
||||
|
||||
// Step.1 组装查询条件
|
||||
QueryWrapper<SysDepart> queryWrapper = QueryGenerator.initQueryWrapper(sysDepart, request.getParameterMap());
|
||||
//Step.2 AutoPoi 导出Excel
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||
List<SysDepart> pageList = sysDepartService.list(queryWrapper);
|
||||
//update-begin---author:wangshuai---date:2023-10-19---for:【QQYUN-5482】系统的部门导入导出也可以改成敲敲云模式的部门路径---
|
||||
//// Step.1 组装查询条件
|
||||
//QueryWrapper<SysDepart> queryWrapper = QueryGenerator.initQueryWrapper(sysDepart, request.getParameterMap());
|
||||
//Step.1 AutoPoi 导出Excel
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||
//List<SysDepart> pageList = sysDepartService.list(queryWrapper);
|
||||
//按字典排序
|
||||
Collections.sort(pageList, new Comparator<SysDepart>() {
|
||||
@Override
|
||||
public int compare(SysDepart arg0, SysDepart arg1) {
|
||||
return arg0.getOrgCode().compareTo(arg1.getOrgCode());
|
||||
}
|
||||
});
|
||||
//Collections.sort(pageList, new Comparator<SysDepart>() {
|
||||
//@Override
|
||||
//public int compare(SysDepart arg0, SysDepart arg1) {
|
||||
//return arg0.getOrgCode().compareTo(arg1.getOrgCode());
|
||||
//}
|
||||
//});
|
||||
//step.2 组装导出数据
|
||||
List<SysDepartExportVo> sysDepartExportVos = sysDepartService.getExportDepart(sysDepart.getTenantId());
|
||||
//导出文件名称
|
||||
mv.addObject(NormalExcelConstants.FILE_NAME, "部门列表");
|
||||
mv.addObject(NormalExcelConstants.CLASS, SysDepart.class);
|
||||
mv.addObject(NormalExcelConstants.CLASS, SysDepartExportVo.class);
|
||||
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("部门列表数据", "导出人:"+user.getRealname(), "导出信息"));
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
|
||||
return mv;
|
||||
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("导入规则:\n" +
|
||||
"1、标题为第三行,部门路径和部门名称的标题不允许修改,否则会匹配失败;第四行为数据填写范围;\n" +
|
||||
"2、部门路径用英文字符/分割,部门名称为部门路径的最后一位;\n" +
|
||||
"3、部门从一级名称开始创建,如果有同级就需要多添加一行,如研发部/研发一部;研发部/研发二部;\n" +
|
||||
"4、自定义的部门编码需要满足规则才能导入。如一级部门编码为A01,那么子部门为A01A01,同级子部门为A01A02,编码固定为三位,首字母为A-Z,后两位为数字0-99,依次递增;", "导出人:"+user.getRealname(), "导出信息"));
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, sysDepartExportVos);
|
||||
//update-end---author:wangshuai---date:2023-10-19---for:【QQYUN-5482】系统的部门导入导出也可以改成敲敲云模式的部门路径---
|
||||
|
||||
return mv;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -386,7 +396,8 @@ public class SysDepartController {
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
||||
List<String> errorMessageList = new ArrayList<>();
|
||||
List<SysDepart> listSysDeparts = null;
|
||||
//List<SysDepart> listSysDeparts = null;
|
||||
List<SysDepartExportVo> listSysDeparts = null;
|
||||
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
|
||||
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
|
||||
// 获取上传文件对象
|
||||
@ -396,51 +407,59 @@ public class SysDepartController {
|
||||
params.setHeadRows(1);
|
||||
params.setNeedSave(true);
|
||||
try {
|
||||
// orgCode编码长度
|
||||
int codeLength = YouBianCodeUtil.ZHANWEI_LENGTH;
|
||||
listSysDeparts = ExcelImportUtil.importExcel(file.getInputStream(), SysDepart.class, params);
|
||||
//按长度排序
|
||||
Collections.sort(listSysDeparts, new Comparator<SysDepart>() {
|
||||
@Override
|
||||
public int compare(SysDepart arg0, SysDepart arg1) {
|
||||
return arg0.getOrgCode().length() - arg1.getOrgCode().length();
|
||||
}
|
||||
});
|
||||
|
||||
int num = 0;
|
||||
for (SysDepart sysDepart : listSysDeparts) {
|
||||
String orgCode = sysDepart.getOrgCode();
|
||||
if(orgCode.length() > codeLength) {
|
||||
String parentCode = orgCode.substring(0, orgCode.length()-codeLength);
|
||||
QueryWrapper<SysDepart> queryWrapper = new QueryWrapper<SysDepart>();
|
||||
queryWrapper.eq("org_code", parentCode);
|
||||
try {
|
||||
SysDepart parentDept = sysDepartService.getOne(queryWrapper);
|
||||
if(!parentDept.equals(null)) {
|
||||
sysDepart.setParentId(parentDept.getId());
|
||||
//更新父级部门不是叶子结点
|
||||
sysDepartService.updateIzLeaf(parentDept.getId(),CommonConstant.NOT_LEAF);
|
||||
} else {
|
||||
sysDepart.setParentId("");
|
||||
}
|
||||
}catch (Exception e) {
|
||||
//没有查找到parentDept
|
||||
}
|
||||
}else{
|
||||
sysDepart.setParentId("");
|
||||
}
|
||||
//update-begin---author:liusq Date:20210223 for:批量导入部门以后,不能追加下一级部门 #2245------------
|
||||
sysDepart.setOrgType(sysDepart.getOrgCode().length()/codeLength+"");
|
||||
//update-end---author:liusq Date:20210223 for:批量导入部门以后,不能追加下一级部门 #2245------------
|
||||
sysDepart.setDelFlag(CommonConstant.DEL_FLAG_0.toString());
|
||||
//update-begin---author:wangshuai ---date:20220105 for:[JTC-363]部门导入 机构类别没有时导入失败,赋默认值------------
|
||||
if(oConvertUtils.isEmpty(sysDepart.getOrgCategory())){
|
||||
sysDepart.setOrgCategory("1");
|
||||
}
|
||||
//update-end---author:wangshuai ---date:20220105 for:[JTC-363]部门导入 机构类别没有时导入失败,赋默认值------------
|
||||
ImportExcelUtil.importDateSaveOne(sysDepart, ISysDepartService.class, errorMessageList, num, CommonConstant.SQL_INDEX_UNIQ_DEPART_ORG_CODE);
|
||||
num++;
|
||||
}
|
||||
//update-begin---author:wangshuai---date:2023-10-20---for: 注释掉原来的导入部门的逻辑---
|
||||
// // orgCode编码长度
|
||||
// int codeLength = YouBianCodeUtil.ZHANWEI_LENGTH;
|
||||
// listSysDeparts = ExcelImportUtil.importExcel(file.getInputStream(), SysDepart.class, params);
|
||||
// //按长度排序
|
||||
// Collections.sort(listSysDeparts, new Comparator<SysDepart>() {
|
||||
// @Override
|
||||
// public int compare(SysDepart arg0, SysDepart arg1) {
|
||||
// return arg0.getOrgCode().length() - arg1.getOrgCode().length();
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// int num = 0;
|
||||
// for (SysDepart sysDepart : listSysDeparts) {
|
||||
// String orgCode = sysDepart.getOrgCode();
|
||||
// if(orgCode.length() > codeLength) {
|
||||
// String parentCode = orgCode.substring(0, orgCode.length()-codeLength);
|
||||
// QueryWrapper<SysDepart> queryWrapper = new QueryWrapper<SysDepart>();
|
||||
// queryWrapper.eq("org_code", parentCode);
|
||||
// try {
|
||||
// SysDepart parentDept = sysDepartService.getOne(queryWrapper);
|
||||
// if(!parentDept.equals(null)) {
|
||||
// sysDepart.setParentId(parentDept.getId());
|
||||
// //更新父级部门不是叶子结点
|
||||
// sysDepartService.updateIzLeaf(parentDept.getId(),CommonConstant.NOT_LEAF);
|
||||
// } else {
|
||||
// sysDepart.setParentId("");
|
||||
// }
|
||||
// }catch (Exception e) {
|
||||
// //没有查找到parentDept
|
||||
// }
|
||||
// }else{
|
||||
// sysDepart.setParentId("");
|
||||
// }
|
||||
// //update-begin---author:liusq Date:20210223 for:批量导入部门以后,不能追加下一级部门 #2245------------
|
||||
// sysDepart.setOrgType(sysDepart.getOrgCode().length()/codeLength+"");
|
||||
// //update-end---author:liusq Date:20210223 for:批量导入部门以后,不能追加下一级部门 #2245------------
|
||||
// sysDepart.setDelFlag(CommonConstant.DEL_FLAG_0.toString());
|
||||
// //update-begin---author:wangshuai ---date:20220105 for:[JTC-363]部门导入 机构类别没有时导入失败,赋默认值------------
|
||||
// if(oConvertUtils.isEmpty(sysDepart.getOrgCategory())){
|
||||
// sysDepart.setOrgCategory("1");
|
||||
// }
|
||||
// //update-end---author:wangshuai ---date:20220105 for:[JTC-363]部门导入 机构类别没有时导入失败,赋默认值------------
|
||||
// ImportExcelUtil.importDateSaveOne(sysDepart, ISysDepartService.class, errorMessageList, num, CommonConstant.SQL_INDEX_UNIQ_DEPART_ORG_CODE);
|
||||
// num++;
|
||||
// }
|
||||
//update-end---author:wangshuai---date:2023-10-20---for: 注释掉原来的导入部门的逻辑---
|
||||
|
||||
//update-begin---author:wangshuai---date:2023-10-19---for:【QQYUN-5482】系统的部门导入导出也可以改成敲敲云模式的部门路径---
|
||||
listSysDeparts = ExcelImportUtil.importExcel(file.getInputStream(), SysDepartExportVo.class, params);
|
||||
sysDepartService.importSysDepart(listSysDeparts,errorMessageList);
|
||||
//update-end---author:wangshuai---date:2023-10-19---for:【QQYUN-5482】系统的部门导入导出也可以改成敲敲云模式的部门路径---
|
||||
|
||||
//清空部门缓存
|
||||
Set keys3 = redisTemplate.keys(CacheConstant.SYS_DEPARTS_CACHE + "*");
|
||||
Set keys4 = redisTemplate.keys(CacheConstant.SYS_DEPART_IDS_CACHE + "*");
|
||||
@ -544,7 +563,7 @@ public class SysDepartController {
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/queryByIds", method = RequestMethod.GET)
|
||||
public Result<Collection<SysDepart>> queryByIds(@RequestParam String deptIds) {
|
||||
public Result<Collection<SysDepart>> queryByIds(@RequestParam(name = "deptIds") String deptIds) {
|
||||
Result<Collection<SysDepart>> result = new Result<>();
|
||||
String[] ids = deptIds.split(",");
|
||||
Collection<String> idList = Arrays.asList(ids);
|
||||
|
||||
@ -80,8 +80,8 @@ public class SysDepartRoleController extends JeecgController<SysDepartRole, ISys
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<SysDepartRole> queryWrapper = QueryGenerator.initQueryWrapper(sysDepartRole, req.getParameterMap());
|
||||
Page<SysDepartRole> page = new Page<SysDepartRole>(pageNo, pageSize);
|
||||
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
List<String> deptIds = null;
|
||||
// LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
// List<String> deptIds = null;
|
||||
// if(oConvertUtils.isEmpty(deptId)){
|
||||
// if(oConvertUtils.isNotEmpty(user.getUserIdentity()) && user.getUserIdentity().equals(CommonConstant.USER_IDENTITY_2) ){
|
||||
// deptIds = sysDepartService.getMySubDepIdsByDepId(user.getDepartIds());
|
||||
@ -94,7 +94,10 @@ public class SysDepartRoleController extends JeecgController<SysDepartRole, ISys
|
||||
// queryWrapper.in("depart_id",deptIds);
|
||||
|
||||
//我的部门,选中部门只能看当前部门下的角色
|
||||
queryWrapper.eq("depart_id",deptId);
|
||||
if(oConvertUtils.isNotEmpty(deptId)){
|
||||
queryWrapper.eq("depart_id",deptId);
|
||||
}
|
||||
|
||||
IPage<SysDepartRole> pageList = sysDepartRoleService.page(page, queryWrapper);
|
||||
return Result.ok(pageList);
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@ import java.util.Arrays;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
@ -54,6 +55,7 @@ public class SysLogController {
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||
//@RequiresPermissions("system:log:list")
|
||||
public Result<IPage<SysLog>> queryPageList(SysLog syslog,@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,HttpServletRequest req) {
|
||||
Result<IPage<SysLog>> result = new Result<IPage<SysLog>>();
|
||||
@ -84,6 +86,7 @@ public class SysLogController {
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/delete", method = RequestMethod.DELETE)
|
||||
//@RequiresPermissions("system:log:delete")
|
||||
public Result<SysLog> delete(@RequestParam(name="id",required=true) String id) {
|
||||
Result<SysLog> result = new Result<SysLog>();
|
||||
SysLog sysLog = sysLogService.getById(id);
|
||||
@ -104,6 +107,7 @@ public class SysLogController {
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/deleteBatch", method = RequestMethod.DELETE)
|
||||
//@RequiresPermissions("system:log:deleteBatch")
|
||||
public Result<SysRole> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
Result<SysRole> result = new Result<SysRole>();
|
||||
if(ids==null || "".equals(ids.trim())) {
|
||||
|
||||
@ -123,9 +123,13 @@ public class SysRoleController {
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
Result<IPage<SysRole>> result = new Result<IPage<SysRole>>();
|
||||
//------------------------------------------------------------------------------------------------
|
||||
//此接口必须通过租户来隔离查询
|
||||
role.setTenantId(oConvertUtils.getInt(!"0".equals(TenantContext.getTenant()) ? TenantContext.getTenant() : "", -1));
|
||||
|
||||
//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】低代码模式 选择组织角色没有数据 在租户角色中添加数据后,列表也无数据展示---
|
||||
|
||||
QueryWrapper<SysRole> queryWrapper = QueryGenerator.initQueryWrapper(role, req.getParameterMap());
|
||||
Page<SysRole> page = new Page<SysRole>(pageNo, pageSize);
|
||||
@ -527,7 +531,6 @@ public class SysRoleController {
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO 权限未完成(敲敲云接口,租户应用)
|
||||
* 分页获取全部角色列表(包含每个角色的数量)
|
||||
* @return
|
||||
*/
|
||||
|
||||
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import org.apache.shiro.authz.annotation.RequiresRoles;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
@ -40,7 +41,7 @@ public class SysTableWhiteListController extends JeecgController<SysTableWhiteLi
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@RequiresRoles("admin")
|
||||
@RequiresRoles("admin")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<?> queryPageList(
|
||||
SysTableWhiteList sysTableWhiteList,
|
||||
@ -62,7 +63,7 @@ public class SysTableWhiteListController extends JeecgController<SysTableWhiteLi
|
||||
*/
|
||||
@AutoLog(value = "系统表白名单-添加")
|
||||
@Operation(summary = "系统表白名单-添加")
|
||||
//@RequiresRoles("admin")
|
||||
@RequiresRoles("admin")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@RequestBody SysTableWhiteList sysTableWhiteList) {
|
||||
if (sysTableWhiteListService.add(sysTableWhiteList)) {
|
||||
@ -80,7 +81,7 @@ public class SysTableWhiteListController extends JeecgController<SysTableWhiteLi
|
||||
*/
|
||||
@AutoLog(value = "系统表白名单-编辑")
|
||||
@Operation(summary = "系统表白名单-编辑")
|
||||
//@RequiresRoles("admin")
|
||||
@RequiresRoles("admin")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<?> edit(@RequestBody SysTableWhiteList sysTableWhiteList) {
|
||||
if (sysTableWhiteListService.edit(sysTableWhiteList)) {
|
||||
@ -98,7 +99,7 @@ public class SysTableWhiteListController extends JeecgController<SysTableWhiteLi
|
||||
*/
|
||||
@AutoLog(value = "系统表白名单-通过id删除")
|
||||
@Operation(summary = "系统表白名单-通过id删除")
|
||||
//@RequiresRoles("admin")
|
||||
@RequiresRoles("admin")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<?> delete(@RequestParam(name = "id") String id) {
|
||||
if (sysTableWhiteListService.deleteByIds(id)) {
|
||||
@ -116,7 +117,7 @@ public class SysTableWhiteListController extends JeecgController<SysTableWhiteLi
|
||||
*/
|
||||
@AutoLog(value = "系统表白名单-批量删除")
|
||||
@Operation(summary = "系统表白名单-批量删除")
|
||||
//@RequiresRoles("admin")
|
||||
@RequiresRoles("admin")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name = "ids") String ids) {
|
||||
if (sysTableWhiteListService.deleteByIds(ids)) {
|
||||
@ -134,7 +135,7 @@ public class SysTableWhiteListController extends JeecgController<SysTableWhiteLi
|
||||
*/
|
||||
@AutoLog(value = "系统表白名单-通过id查询")
|
||||
@Operation(summary = "系统表白名单-通过id查询")
|
||||
//@RequiresRoles("admin")
|
||||
@RequiresRoles("admin")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<?> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
SysTableWhiteList sysTableWhiteList = sysTableWhiteListService.getById(id);
|
||||
|
||||
@ -858,16 +858,19 @@ public class SysTenantController {
|
||||
@GetMapping("/getTenantCount")
|
||||
public Result<Map<String,Long>> getTenantCount(HttpServletRequest request){
|
||||
Map<String,Long> map = new HashMap<>();
|
||||
Integer tenantId = oConvertUtils.getInt(TokenUtils.getTenantIdByRequest(request),0);
|
||||
LambdaQueryWrapper<SysUserTenant> userTenantQuery = new LambdaQueryWrapper<>();
|
||||
userTenantQuery.eq(SysUserTenant::getTenantId,tenantId);
|
||||
userTenantQuery.eq(SysUserTenant::getStatus,CommonConstant.USER_TENANT_NORMAL);
|
||||
long userCount = relationService.count(userTenantQuery);
|
||||
//update-begin---author:wangshuai---date:2023-11-24---for:【QQYUN-7177】用户数量显示不正确---
|
||||
if(oConvertUtils.isEmpty(TokenUtils.getTenantIdByRequest(request))){
|
||||
return Result.error("当前租户为空,禁止访问!");
|
||||
}
|
||||
Integer tenantId = oConvertUtils.getInt(TokenUtils.getTenantIdByRequest(request));
|
||||
Long userCount = relationService.getUserCount(tenantId,CommonConstant.USER_TENANT_NORMAL);
|
||||
//update-end---author:wangshuai---date:2023-11-24---for:【QQYUN-7177】用户数量显示不正确---
|
||||
map.put("userCount",userCount);
|
||||
LambdaQueryWrapper<SysDepart> departQuery = new LambdaQueryWrapper<>();
|
||||
departQuery.eq(SysDepart::getDelFlag,String.valueOf(CommonConstant.DEL_FLAG_0));
|
||||
departQuery.eq(SysDepart::getTenantId,tenantId);
|
||||
departQuery.eq(SysDepart::getStatus,CommonConstant.STATUS_1);
|
||||
//部门状态暂时没用,先注释掉
|
||||
//departQuery.eq(SysDepart::getStatus,CommonConstant.STATUS_1);
|
||||
long departCount = sysDepartService.count(departQuery);
|
||||
map.put("departCount",departCount);
|
||||
return Result.ok(map);
|
||||
|
||||
@ -437,12 +437,13 @@ public class SysUserController {
|
||||
@RequestParam(name = "departId", required = false) String departId,
|
||||
@RequestParam(name="realname",required=false) String realname,
|
||||
@RequestParam(name="username",required=false) String username,
|
||||
@RequestParam(name="isMultiTranslate",required=false) String isMultiTranslate,
|
||||
@RequestParam(name="id",required = false) String id) {
|
||||
//update-begin-author:taoyan date:2022-7-14 for: VUEN-1702【禁止问题】sql注入漏洞
|
||||
String[] arr = new String[]{departId, realname, username, id};
|
||||
SqlInjectionUtil.filterContent(arr, SymbolConstant.SINGLE_QUOTATION_MARK);
|
||||
//update-end-author:taoyan date:2022-7-14 for: VUEN-1702【禁止问题】sql注入漏洞
|
||||
IPage<SysUser> pageList = sysUserDepartService.queryDepartUserPageList(departId, username, realname, pageSize, pageNo,id);
|
||||
IPage<SysUser> pageList = sysUserDepartService.queryDepartUserPageList(departId, username, realname, pageSize, pageNo,id,isMultiTranslate);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@ -568,7 +569,7 @@ public class SysUserController {
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/queryByIds", method = RequestMethod.GET)
|
||||
public Result<Collection<SysUser>> queryByIds(@RequestParam String userIds) {
|
||||
public Result<Collection<SysUser>> queryByIds(@RequestParam(name = "userIds") String userIds) {
|
||||
Result<Collection<SysUser>> result = new Result<>();
|
||||
String[] userId = userIds.split(",");
|
||||
Collection<String> idList = Arrays.asList(userId);
|
||||
@ -585,7 +586,7 @@ public class SysUserController {
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/queryByNames", method = RequestMethod.GET)
|
||||
public Result<Collection<SysUser>> queryByNames(@RequestParam String userNames) {
|
||||
public Result<Collection<SysUser>> queryByNames(@RequestParam(name = "userNames") String userNames) {
|
||||
Result<Collection<SysUser>> result = new Result<>();
|
||||
String[] names = userNames.split(",");
|
||||
QueryWrapper<SysUser> queryWrapper=new QueryWrapper();
|
||||
|
||||
@ -424,10 +424,6 @@ public class ThirdAppController {
|
||||
@GetMapping("/getThirdConfigByTenantId")
|
||||
public Result<SysThirdAppConfig> getThirdAppByTenantId(@RequestParam(name = "tenantId", required = false) Integer tenantId,
|
||||
@RequestParam(name = "thirdType") String thirdType) {
|
||||
Result<SysThirdAppConfig> result = new Result<>();
|
||||
LambdaQueryWrapper<SysThirdAppConfig> query = new LambdaQueryWrapper<>();
|
||||
query.eq(SysThirdAppConfig::getThirdType,thirdType);
|
||||
|
||||
if (MybatisPlusSaasConfig.OPEN_SYSTEM_TENANT_CONTROL) {
|
||||
if (tenantId == null) {
|
||||
return Result.error("开启多租户模式,租户ID参数不允许为空!");
|
||||
@ -438,7 +434,9 @@ public class ThirdAppController {
|
||||
tenantId = oConvertUtils.getInt(TenantContext.getTenant(), 0);
|
||||
}
|
||||
}
|
||||
|
||||
Result<SysThirdAppConfig> result = new Result<>();
|
||||
LambdaQueryWrapper<SysThirdAppConfig> query = new LambdaQueryWrapper<>();
|
||||
query.eq(SysThirdAppConfig::getThirdType,thirdType);
|
||||
query.eq(SysThirdAppConfig::getTenantId,tenantId);
|
||||
SysThirdAppConfig sysThirdAppConfig = appConfigService.getOne(query);
|
||||
result.setSuccess(true);
|
||||
|
||||
@ -67,7 +67,7 @@ public class SysTenantPackUser implements Serializable {
|
||||
private transient String packCode;
|
||||
|
||||
/**
|
||||
* 状态(1 正常 2 离职 3 待审核 4 拒绝 5 邀请加入)
|
||||
* 状态(申请状态0 正常状态1)
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
|
||||
@ -48,6 +48,4 @@ public class SysUserRole implements Serializable {
|
||||
this.roleId = roleId;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -9,6 +9,7 @@ import org.jeecg.modules.system.entity.SysDepart;
|
||||
import org.jeecg.modules.system.entity.SysUser;
|
||||
import org.jeecg.modules.system.model.SysDepartTreeModel;
|
||||
import org.jeecg.modules.system.model.TreeModel;
|
||||
import org.jeecg.modules.system.vo.SysDepartExportVo;
|
||||
import org.jeecg.modules.system.vo.SysUserDepVo;
|
||||
import org.jeecg.modules.system.vo.lowapp.ExportDepartVo;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
@ -161,4 +162,12 @@ public interface SysDepartMapper extends BaseMapper<SysDepart> {
|
||||
* @return
|
||||
*/
|
||||
List<SysDepart> getDepartPageByName(@Param("page") Page<SysDepart> page, @Param("departName") String departName, @Param("tenantId") Integer tenantId, @Param("parentId") String parentId);
|
||||
|
||||
/**
|
||||
* 获取租户id和部门父id获取的部门数据
|
||||
* @param tenantId
|
||||
* @param parentId
|
||||
* @return
|
||||
*/
|
||||
List<SysDepartExportVo> getSysDepartList(@Param("parentId") String parentId,@Param("tenantId") Integer tenantId);
|
||||
}
|
||||
|
||||
@ -119,5 +119,12 @@ public interface SysTenantMapper extends BaseMapper<SysTenant> {
|
||||
* @return
|
||||
*/
|
||||
Long getApplySuperAdminCount(@Param("userId") String userId, @Param("tenantId") Integer tenantId);
|
||||
|
||||
|
||||
/**
|
||||
* 租户是否存在
|
||||
* @param tenantId
|
||||
* @return
|
||||
*/
|
||||
@Select("select count(1) from sys_tenant where id = #{tenantId} and del_flag = 0")
|
||||
Long tenantIzExist(@Param("tenantId") Integer tenantId);
|
||||
}
|
||||
|
||||
@ -25,4 +25,11 @@ public interface SysTenantPackUserMapper extends BaseMapper<SysTenantPackUser> {
|
||||
@InterceptorIgnore(tenantLine = "true")
|
||||
List<String> queryTenantPackUserNameList(@Param("tenantId") Integer tenantId, @Param("packCodeList") List<String> packCodeList);
|
||||
|
||||
/**
|
||||
* 判断当前用户在该租户下是否拥有管理员的权限
|
||||
* @param userId
|
||||
* @param tenantId
|
||||
* @return
|
||||
*/
|
||||
Long izHaveBuyAuth(@Param("userId") String userId, @Param("tenantId") String tenantId);
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ package org.jeecg.modules.system.mapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.jeecg.modules.system.entity.SysThirdAccount;
|
||||
import org.jeecg.modules.system.vo.thirdapp.JwUserDepartVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -22,5 +23,12 @@ public interface SysThirdAccountMapper extends BaseMapper<SysThirdAccount> {
|
||||
* @return
|
||||
*/
|
||||
List<SysThirdAccount> selectThirdIdsByUsername(@Param("sysUsernameArr") String[] sysUsernameArr, @Param("thirdType") String thirdType, @Param("tenantId") Integer tenantId);
|
||||
|
||||
|
||||
/**
|
||||
* 查询被绑定的用户
|
||||
* @param tenantId
|
||||
* @param thirdType
|
||||
* @return
|
||||
*/
|
||||
List<JwUserDepartVo> getThirdUserBindByWechat(@Param("tenantId") int tenantId, @Param("thirdType") String thirdType);
|
||||
}
|
||||
|
||||
@ -1,17 +1,17 @@
|
||||
package org.jeecg.modules.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Delete;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.jeecg.modules.system.entity.SysUser;
|
||||
import org.jeecg.modules.system.entity.SysUserPosition;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.jeecg.modules.system.vo.SysUserPositionVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 用户职位关系表
|
||||
* @Author: jeecg-boot
|
||||
@ -66,7 +66,7 @@ public interface SysUserPositionMapper extends BaseMapper<SysUserPosition> {
|
||||
* @return
|
||||
*/
|
||||
@InterceptorIgnore(tenantLine = "true")
|
||||
List<String> getPositionIdByUserTenantId(@Param("userId") String userId, @Param("tenantId") Integer tenantId);
|
||||
List<String> getPositionIdByUserTenantId(@Param("userId")String userId, @Param("tenantId")Integer tenantId);
|
||||
|
||||
/**
|
||||
* 根据用户id获取用户职位
|
||||
|
||||
@ -12,6 +12,7 @@ import org.jeecg.modules.system.entity.SysUser;
|
||||
import org.jeecg.modules.system.entity.SysUserTenant;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.jeecg.modules.system.vo.SysUserTenantVo;
|
||||
import org.jeecg.modules.system.vo.thirdapp.JwUserDepartVo;
|
||||
|
||||
/**
|
||||
* @Description: sys_user_tenant_relation
|
||||
@ -149,4 +150,20 @@ public interface SysUserTenantMapper extends BaseMapper<SysUserTenant> {
|
||||
* @param tenantIds
|
||||
*/
|
||||
void deleteUserByTenantId(@Param("tenantIds") List<Integer> tenantIds);
|
||||
|
||||
/**
|
||||
* 获取租户下的成员数量
|
||||
*
|
||||
* @param tenantId
|
||||
* @param tenantStatus
|
||||
* @return
|
||||
*/
|
||||
Long getUserCount(Integer tenantId, String tenantStatus);
|
||||
|
||||
/**
|
||||
* 根据租户id和名称获取用户数据
|
||||
* @param tenantId
|
||||
* @return
|
||||
*/
|
||||
List<JwUserDepartVo> getUsersByTenantIdAndName(@Param("tenantId") Integer tenantId);
|
||||
}
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
|
||||
|
||||
<select id="querySysCementListByUserId" parameterType="String" resultMap="SysAnnouncement">
|
||||
select * from sys_announcement
|
||||
select id,titile,create_time,priority,bus_id,open_type,open_page,sender,send_time,msg_content from sys_announcement
|
||||
where send_status = '1'
|
||||
and del_flag = '0'
|
||||
and msg_category = #{msgCategory}
|
||||
|
||||
@ -114,7 +114,9 @@
|
||||
SELECT id,depart_name,org_code,parent_id FROM sys_depart
|
||||
where
|
||||
depart_name = #{departName}
|
||||
and tenant_id = #{tenantId}
|
||||
<if test="null != tenantId and 0 != tenantId">
|
||||
and tenant_id = #{tenantId}
|
||||
</if>
|
||||
<if test="parentId != null and parentId != ''">
|
||||
and parent_id = #{parentId}
|
||||
</if>
|
||||
@ -154,4 +156,24 @@
|
||||
</foreach>
|
||||
)
|
||||
</select>
|
||||
|
||||
<!--系统后台导出,根据父级id和租户id查询部门数据-->
|
||||
<select id="getSysDepartList" resultType="org.jeecg.modules.system.vo.SysDepartExportVo">
|
||||
SELECT id,depart_name,parent_id,depart_name_en,depart_order,description,org_category,org_code,mobile,fax,address,memo FROM sys_depart
|
||||
WHERE
|
||||
1=1
|
||||
<if test="null != tenantId and 0 != tenantId">
|
||||
AND tenant_id = #{tenantId}
|
||||
</if>
|
||||
AND
|
||||
<choose>
|
||||
<when test="parentId != null and parentId != ''">
|
||||
parent_id = #{parentId}
|
||||
</when>
|
||||
<otherwise>
|
||||
parent_id IS NULL OR parent_id=''
|
||||
</otherwise>
|
||||
</choose>
|
||||
ORDER BY depart_order DESC
|
||||
</select>
|
||||
</mapper>
|
||||
@ -43,6 +43,7 @@
|
||||
<select id="queryTenantPackUserCount" resultType="org.jeecg.modules.system.vo.tenant.TenantPackUserCount">
|
||||
SELECT pack_code, count(*) as user_count FROM sys_tenant_pack a
|
||||
join sys_tenant_pack_user b on a.id = b.pack_id
|
||||
join sys_user_tenant sut on a.tenant_id = sut.tenant_id and b.user_id = sut.user_id and sut.status = 1
|
||||
where a.tenant_id = #{tenantId}
|
||||
and a.pack_code in ('superAdmin', 'accountAdmin', 'appAdmin')
|
||||
and b.status = 1
|
||||
@ -74,6 +75,7 @@
|
||||
SELECT c.id, c.username, c.realname, c.phone, c.avatar, a.pack_name, a.id as pack_id FROM sys_user c
|
||||
join sys_tenant_pack_user b on c.id = b.user_id
|
||||
join sys_tenant_pack a on a.id = b.pack_id
|
||||
join sys_user_tenant sut on a.tenant_id = sut.tenant_id and b.user_id = sut.user_id and sut.status = 1
|
||||
where c.status = 1
|
||||
and c.del_flag = 0
|
||||
and b.status = #{packUserStatus}
|
||||
|
||||
@ -15,4 +15,12 @@
|
||||
)
|
||||
</select>
|
||||
|
||||
<!-- 判断当前用户在该租户下是否拥有管理员的权限 -->
|
||||
<select id="izHaveBuyAuth" resultType="java.lang.Long">
|
||||
SELECT count(1) from sys_tenant_pack_user stpu
|
||||
left join sys_tenant_pack stp on stpu.pack_id = stp.id
|
||||
WHERE stpu.tenant_id = #{tenantId}
|
||||
and stpu.user_id = #{userId}
|
||||
and stp.pack_code in('superAdmin','accountAdmin')
|
||||
</select>
|
||||
</mapper>
|
||||
@ -14,5 +14,14 @@
|
||||
<!-- TODO in 查询数据量大的时候可能会报错 -->
|
||||
<foreach collection="sysUsernameArr" item="item" open=" sys_user.username IN (" close=")" separator=",">#{item}</foreach>
|
||||
</select>
|
||||
|
||||
<!--查询被绑定的用户-->
|
||||
<select id="getThirdUserBindByWechat" resultType="org.jeecg.modules.system.vo.thirdapp.JwUserDepartVo">
|
||||
SELECT su.id userId, su.realname, su.avatar, sta.realname as wechatRealName, sta.third_user_id as wechatUserId, sta.id as thirdId
|
||||
FROM sys_third_account sta
|
||||
LEFT JOIN sys_user su on sta.sys_user_id = su.id
|
||||
WHERE sta.tenant_id = #{tenantId}
|
||||
AND sta.third_type = #{thirdType}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@ -39,9 +39,9 @@
|
||||
|
||||
<!--通过用户id获取租户列表-->
|
||||
<select id="getTenantListByUserId" resultType="org.jeecg.modules.system.vo.SysUserTenantVo">
|
||||
SELECT st.id as tenantUserId,st.name,st.trade,st.house_number,st.create_by,sut.status as userTenantStatus
|
||||
SELECT st.id as tenantUserId,st.name,st.trade,st.house_number,st.create_by,sut.status as userTenantStatus,sut.user_id as id
|
||||
FROM sys_user_tenant sut
|
||||
JOIN sys_tenant st ON sut.tenant_id = st.id
|
||||
LEFT JOIN sys_tenant st ON sut.tenant_id = st.id
|
||||
WHERE st.status = 1
|
||||
AND st.del_flag = 0
|
||||
AND sut.user_id = #{userId}
|
||||
@ -164,4 +164,22 @@
|
||||
#{tenantId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<!-- 获取租户下的成员数量 -->
|
||||
<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}
|
||||
</select>
|
||||
|
||||
<!--根据租户id和名称获取用户数据-->
|
||||
<select id="getUsersByTenantIdAndName" resultType="org.jeecg.modules.system.vo.thirdapp.JwUserDepartVo">
|
||||
SELECT su.id userId,su.realname,su.avatar
|
||||
FROM sys_user_tenant sut
|
||||
JOIN sys_tenant st ON sut.tenant_id = st.id and st.status = 1 and st.del_flag = 0
|
||||
JOIN sys_user su ON sut.user_id = su.id and su.status = 1 and su.del_flag = 0
|
||||
WHERE
|
||||
sut.status = 1
|
||||
AND sut.tenant_id = #{tenantId}
|
||||
</select>
|
||||
</mapper>
|
||||
@ -89,4 +89,13 @@ public interface ISysCategoryService extends IService<SysCategory> {
|
||||
*/
|
||||
List<String> loadDictItem(String ids, boolean delNotExist);
|
||||
|
||||
/**
|
||||
* 【仅导入使用】分类字典控件反向翻译
|
||||
*
|
||||
* @param names
|
||||
* @param delNotExist 是否移除不存在的项,设为false如果某个key不存在数据库中,则直接返回key本身
|
||||
* @return
|
||||
*/
|
||||
List<String> loadDictItemByNames(String names, boolean delNotExist);
|
||||
|
||||
}
|
||||
|
||||
@ -5,8 +5,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.system.entity.SysDepart;
|
||||
import org.jeecg.modules.system.entity.SysUserDepart;
|
||||
import org.jeecg.modules.system.model.DepartIdModel;
|
||||
import org.jeecg.modules.system.model.SysDepartTreeModel;
|
||||
import org.jeecg.modules.system.vo.SysDepartExportVo;
|
||||
import org.jeecg.modules.system.vo.lowapp.ExportDepartVo;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
@ -215,5 +217,18 @@ public interface ISysDepartService extends IService<SysDepart>{
|
||||
List<ExportDepartVo> getExcelDepart(int tenantId);
|
||||
|
||||
void importExcel(List<ExportDepartVo> listSysDeparts, List<String> errorMessageList);
|
||||
|
||||
|
||||
/**
|
||||
* 根据租户id导出部门
|
||||
* @param tenantId
|
||||
* @return
|
||||
*/
|
||||
List<SysDepartExportVo> getExportDepart(int tenantId);
|
||||
|
||||
/**
|
||||
* 导出系统部门excel
|
||||
* @param listSysDeparts
|
||||
* @param errorMessageList
|
||||
*/
|
||||
void importSysDepart(List<SysDepartExportVo> listSysDeparts, List<String> errorMessageList);
|
||||
}
|
||||
|
||||
@ -107,6 +107,7 @@ public interface ISysDictService extends IService<SysDict> {
|
||||
@Deprecated
|
||||
String queryTableDictTextByKey(String table, String text, String code, String key);
|
||||
|
||||
//update-begin---author:chenrui ---date:20231221 for:[issues/#5643]解决分布式下表字典跨库无法查询问题------------
|
||||
/**
|
||||
* 通过查询指定table的 text code key 获取字典值,可批量查询
|
||||
*
|
||||
@ -114,9 +115,11 @@ public interface ISysDictService extends IService<SysDict> {
|
||||
* @param text
|
||||
* @param code
|
||||
* @param keys
|
||||
* @param dataSource 数据源
|
||||
* @return
|
||||
*/
|
||||
List<DictModel> queryTableDictTextByKeys(String table, String text, String code, List<String> keys);
|
||||
List<DictModel> queryTableDictTextByKeys(String table, String text, String code, List<String> keys, String dataSource);
|
||||
//update-end---author:chenrui ---date:20231221 for:[issues/#5643]解决分布式下表字典跨库无法查询问题------------
|
||||
|
||||
/**
|
||||
* 通过查询指定table的 text code key 获取字典值,包含value
|
||||
|
||||
@ -75,7 +75,8 @@ public interface ISysThirdAccountService extends IService<SysThirdAccount> {
|
||||
* @param unionid
|
||||
* @param thirdType
|
||||
* @param tenantId
|
||||
* @param thirdUserId
|
||||
* @return
|
||||
*/
|
||||
SysThirdAccount getOneByUuidAndThirdType(String unionid, String thirdType,Integer tenantId);
|
||||
SysThirdAccount getOneByUuidAndThirdType(String unionid, String thirdType,Integer tenantId,String thirdUserId);
|
||||
}
|
||||
|
||||
@ -51,9 +51,10 @@ public interface ISysUserDepartService extends IService<SysUserDepart> {
|
||||
* @param pageNo
|
||||
* @param realname
|
||||
* @param id
|
||||
* @param isMultiTranslate 是否多字段翻译
|
||||
* @return
|
||||
*/
|
||||
IPage<SysUser> queryDepartUserPageList(String departId, String username, String realname, int pageSize, int pageNo,String id);
|
||||
IPage<SysUser> queryDepartUserPageList(String departId, String username, String realname, int pageSize, int pageNo,String id,String isMultiTranslate);
|
||||
|
||||
/**
|
||||
* 获取用户信息
|
||||
|
||||
@ -120,4 +120,12 @@ public interface ISysUserTenantService extends IService<SysUserTenant> {
|
||||
* @return
|
||||
*/
|
||||
SysUserTenant getUserTenantByTenantId(String userId, Integer tenantId);
|
||||
|
||||
/**
|
||||
* 获取租户下的成员数量
|
||||
* @param tenantId
|
||||
* @param tenantStatus
|
||||
* @return
|
||||
*/
|
||||
Long getUserCount(Integer tenantId, String tenantStatus);
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ 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 lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
@ -61,7 +62,12 @@ public class SysAnnouncementServiceImpl extends ServiceImpl<SysAnnouncementMappe
|
||||
sysAnnouncementMapper.insert(sysAnnouncement);
|
||||
// 2.插入用户通告阅读标记表记录
|
||||
String userId = sysAnnouncement.getUserIds();
|
||||
String[] userIds = userId.substring(0, (userId.length()-1)).split(",");
|
||||
//update-begin-author:liusq---date:2023-10-31--for:[issues/5503]【公告】通知无法接收
|
||||
if(StringUtils.isNotBlank(userId) && userId.endsWith(",")){
|
||||
userId = userId.substring(0, (userId.length()-1));
|
||||
}
|
||||
String[] userIds = userId.split(",");
|
||||
//update-end-author:liusq---date:2023-10-31--for:[issues/5503]【公告】通知无法接收
|
||||
String anntId = sysAnnouncement.getId();
|
||||
Date refDate = new Date();
|
||||
for(int i=0;i<userIds.length;i++) {
|
||||
|
||||
@ -34,7 +34,8 @@ import org.jeecg.common.system.query.QueryCondition;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||
import org.jeecg.common.system.vo.*;
|
||||
import org.jeecg.common.util.*;
|
||||
import org.jeecg.common.util.HTMLUtils;
|
||||
import org.jeecg.common.util.YouBianCodeUtil;
|
||||
import org.jeecg.common.util.dynamic.db.FreemarkerParseFactory;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.config.firewall.SqlInjection.IDictTableWhiteListHandler;
|
||||
@ -57,6 +58,7 @@ import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.ui.freemarker.FreeMarkerTemplateUtils;
|
||||
import org.springframework.util.AntPathMatcher;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.PathMatcher;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
@ -323,6 +325,30 @@ public class SysBaseApiImpl implements ISysBaseAPI {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getDepartParentIdsByUsername(String username) {
|
||||
List<SysDepart> list = sysDepartService.queryDepartsByUsername(username);
|
||||
Set<String> result = new HashSet<>(list.size());
|
||||
for (SysDepart depart : list) {
|
||||
result.add(depart.getParentId());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getDepartParentIdsByDepIds(Set depIds) {
|
||||
LambdaQueryWrapper<SysDepart> departQuery = new LambdaQueryWrapper<SysDepart>().in(SysDepart::getId, depIds);
|
||||
List<SysDepart> departList = departMapper.selectList(departQuery);
|
||||
|
||||
if(CollectionUtils.isEmpty(departList)){
|
||||
return null;
|
||||
}
|
||||
Set<String> parentIds = departList.stream()
|
||||
.map(SysDepart::getParentId)
|
||||
.collect(Collectors.toSet());
|
||||
return parentIds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getDepartNamesByUsername(String username) {
|
||||
List<SysDepart> list = sysDepartService.queryDepartsByUsername(username);
|
||||
@ -1388,6 +1414,11 @@ public class SysBaseApiImpl implements ISysBaseAPI {
|
||||
return sysCategoryService.loadDictItem(ids, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> loadCategoryDictItemByNames(String names, boolean delNotExist) {
|
||||
return sysCategoryService.loadDictItemByNames(names, delNotExist);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据字典code加载字典text
|
||||
*
|
||||
@ -1461,13 +1492,17 @@ public class SysBaseApiImpl implements ISysBaseAPI {
|
||||
public Map<String, List<DictModel>> translateManyDict(String dictCodes, String keys) {
|
||||
List<String> dictCodeList = Arrays.asList(dictCodes.split(","));
|
||||
List<String> values = Arrays.asList(keys.split(","));
|
||||
//update-begin---author:chenrui ---date:20231221 for:[issues/#5643]解决分布式下表字典跨库无法查询问题------------
|
||||
return sysDictService.queryManyDictByKeys(dictCodeList, values);
|
||||
//update-end---author:chenrui ---date:20231221 for:[issues/#5643]解决分布式下表字典跨库无法查询问题------------
|
||||
}
|
||||
|
||||
//update-begin---author:chenrui ---date:20231221 for:[issues/#5643]解决分布式下表字典跨库无法查询问题------------
|
||||
@Override
|
||||
public List<DictModel> translateDictFromTableByKeys(String table, String text, String code, String keys) {
|
||||
return sysDictService.queryTableDictTextByKeys(table, text, code, Arrays.asList(keys.split(",")));
|
||||
public List<DictModel> translateDictFromTableByKeys(String table, String text, String code, String keys, String dataSource) {
|
||||
return sysDictService.queryTableDictTextByKeys(table, text, code, Arrays.asList(keys.split(",")), dataSource);
|
||||
}
|
||||
//update-end---author:chenrui ---date:20231221 for:[issues/#5643]解决分布式下表字典跨库无法查询问题------------
|
||||
|
||||
//-------------------------------------流程节点发送模板消息-----------------------------------------------
|
||||
@Autowired
|
||||
|
||||
@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.constant.FillRuleConstant;
|
||||
import org.jeecg.common.constant.SymbolConstant;
|
||||
import org.jeecg.common.exception.JeecgBootException;
|
||||
@ -18,10 +17,7 @@ import org.jeecg.modules.system.service.ISysCategoryService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@ -235,4 +231,22 @@ public class SysCategoryServiceImpl extends ServiceImpl<SysCategoryMapper, SysCa
|
||||
return textList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> loadDictItemByNames(String names, boolean delNotExist) {
|
||||
List<String> nameList = Arrays.asList(names.split(SymbolConstant.COMMA));
|
||||
LambdaQueryWrapper<SysCategory> query = new LambdaQueryWrapper<>();
|
||||
query.select(SysCategory::getId, SysCategory::getName);
|
||||
query.in(SysCategory::getName, nameList);
|
||||
// 查询数据
|
||||
List<SysCategory> list = super.list(query);
|
||||
// 取出id并返回
|
||||
return nameList.stream().map(name -> {
|
||||
SysCategory res = list.stream().filter(i -> name.equals(i.getName())).findFirst().orElse(null);
|
||||
if (res == null) {
|
||||
return delNotExist ? null : name;
|
||||
}
|
||||
return res.getId();
|
||||
}).filter(Objects::nonNull).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package org.jeecg.modules.system.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
@ -28,9 +29,9 @@ import org.jeecg.modules.system.model.DepartIdModel;
|
||||
import org.jeecg.modules.system.model.SysDepartTreeModel;
|
||||
import org.jeecg.modules.system.service.ISysDepartService;
|
||||
import org.jeecg.modules.system.util.FindsDepartsChildrenUtil;
|
||||
import org.jeecg.modules.system.vo.SysDepartExportVo;
|
||||
import org.jeecg.modules.system.vo.lowapp.ExportDepartVo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@ -69,6 +70,11 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
|
||||
//根据部门id获取所负责部门
|
||||
LambdaQueryWrapper<SysDepart> query = new LambdaQueryWrapper<SysDepart>();
|
||||
String[] codeArr = this.getMyDeptParentOrgCode(departIds);
|
||||
//update-begin---author:wangshuai---date:2023-12-01---for:【QQYUN-7320】查询部门没数据,导致报错空指针---
|
||||
if(ArrayUtil.isEmpty(codeArr)){
|
||||
return null;
|
||||
}
|
||||
//update-end---author:wangshuai---date:2023-12-01---for:【QQYUN-7320】查询部门没数据,导致报错空指针---
|
||||
for(int i=0;i<codeArr.length;i++){
|
||||
query.or().likeRight(SysDepart::getOrgCode,codeArr[i]);
|
||||
}
|
||||
@ -197,6 +203,14 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
|
||||
sysDepart.setDelFlag(CommonConstant.DEL_FLAG_0.toString());
|
||||
//新添加的部门是叶子节点
|
||||
sysDepart.setIzLeaf(CommonConstant.IS_LEAF);
|
||||
// 【QQYUN-7172】数据库默认值兼容
|
||||
if (oConvertUtils.isEmpty(sysDepart.getOrgCategory())) {
|
||||
if (oConvertUtils.isEmpty(sysDepart.getParentId())) {
|
||||
sysDepart.setOrgCategory("1");
|
||||
} else {
|
||||
sysDepart.setOrgCategory("2");
|
||||
}
|
||||
}
|
||||
this.save(sysDepart);
|
||||
//update-begin---author:wangshuai ---date:20220307 for:[JTC-119]在部门管理菜单下设置部门负责人 创建用户的时候不需要处理
|
||||
//新增部门的时候新增负责部门
|
||||
@ -485,7 +499,10 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
|
||||
//根据部门id查询所负责部门
|
||||
LambdaQueryWrapper<SysDepart> query = new LambdaQueryWrapper<SysDepart>();
|
||||
query.eq(SysDepart::getDelFlag, CommonConstant.DEL_FLAG_0.toString());
|
||||
query.in(SysDepart::getId, Arrays.asList(departIds.split(",")));
|
||||
if(oConvertUtils.isNotEmpty(departIds)){
|
||||
query.in(SysDepart::getId, Arrays.asList(departIds.split(",")));
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------
|
||||
//是否开启系统管理模块的多租户数据隔离【SAAS多租户模式】
|
||||
if(MybatisPlusSaasConfig.OPEN_SYSTEM_TENANT_CONTROL){
|
||||
@ -1195,4 +1212,169 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//========================begin 系统下部门与人员导入 ==================================================================
|
||||
/**
|
||||
* 系统部门导出
|
||||
* @param tenantId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<SysDepartExportVo> getExportDepart(int tenantId) {
|
||||
//获取父级部门
|
||||
List<SysDepartExportVo> parentDepart = departMapper.getSysDepartList("", tenantId);
|
||||
//子部门
|
||||
List<SysDepartExportVo> childrenDepart = new ArrayList<>();
|
||||
//把一级部门名称放在里面
|
||||
List<SysDepartExportVo> exportDepartVoList = new ArrayList<>();
|
||||
//存放部门一级id避免重复
|
||||
List<String> departIdList = new ArrayList<>();
|
||||
for (SysDepartExportVo sysDepart : parentDepart) {
|
||||
//step 1.添加第一级部门
|
||||
departIdList.add(sysDepart.getId());
|
||||
sysDepart.setDepartNameUrl(sysDepart.getDepartName());
|
||||
exportDepartVoList.add(sysDepart);
|
||||
//step 2.添加自己部门路径,用/分离
|
||||
//创建路径
|
||||
List<String> path = new ArrayList<>();
|
||||
path.add(sysDepart.getDepartName());
|
||||
//创建子部门路径
|
||||
findSysDepartPath(sysDepart, path, tenantId, childrenDepart, departIdList);
|
||||
path.clear();
|
||||
}
|
||||
exportDepartVoList.addAll(childrenDepart);
|
||||
childrenDepart.clear();
|
||||
departIdList.clear();
|
||||
return exportDepartVoList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 系统部门导入
|
||||
* @param listSysDeparts
|
||||
* @param errorMessageList
|
||||
*/
|
||||
@Override
|
||||
public void importSysDepart(List<SysDepartExportVo> listSysDeparts, List<String> errorMessageList) {
|
||||
int num = 0;
|
||||
int tenantId = 0;
|
||||
if(MybatisPlusSaasConfig.OPEN_SYSTEM_TENANT_CONTROL) {
|
||||
tenantId = oConvertUtils.getInt(TenantContext.getTenant(), 0);
|
||||
}
|
||||
//部门路径排序
|
||||
Collections.sort(listSysDeparts, new Comparator<SysDepartExportVo>() {
|
||||
@Override
|
||||
public int compare(SysDepartExportVo o1, SysDepartExportVo o2) {
|
||||
if(oConvertUtils.isNotEmpty(o1.getDepartNameUrl()) && oConvertUtils.isNotEmpty(o2.getDepartNameUrl())){
|
||||
int oldLength = o1.getDepartNameUrl().split(SymbolConstant.SINGLE_SLASH).length;
|
||||
int newLength = o2.getDepartNameUrl().split(SymbolConstant.SINGLE_SLASH).length;
|
||||
return oldLength - newLength;
|
||||
}else{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
});
|
||||
//存放部门数据的map
|
||||
Map<String,SysDepart> departMap = new HashMap<>();
|
||||
// orgCode编码长度
|
||||
int codeLength = YouBianCodeUtil.ZHANWEI_LENGTH;
|
||||
//循环第二遍导入数据
|
||||
for (SysDepartExportVo departExportVo : listSysDeparts) {
|
||||
SysDepart sysDepart = new SysDepart();
|
||||
boolean izExport = false;
|
||||
try {
|
||||
izExport = this.addDepartByName(departExportVo.getDepartNameUrl(),departExportVo.getDepartName(),sysDepart,errorMessageList,tenantId,departMap,num);
|
||||
} catch (Exception e) {
|
||||
//没有查找到parentDept
|
||||
}
|
||||
//没有错误的时候才会导入数据
|
||||
if(izExport){
|
||||
if(oConvertUtils.isNotEmpty(departExportVo.getOrgCode())){
|
||||
SysDepart depart = this.baseMapper.queryCompByOrgCode(departExportVo.getOrgCode());
|
||||
if(null != depart){
|
||||
if(oConvertUtils.isNotEmpty(sysDepart.getParentId())){
|
||||
//更新上级部门为叶子节点
|
||||
this.updateIzLeaf(sysDepart.getParentId(),CommonConstant.IS_LEAF);
|
||||
}
|
||||
//部门名称已存在
|
||||
errorMessageList.add("第 " + num + " 行:记录部门名称“"+departExportVo.getDepartName()+"”部门编码重复,请检查!");
|
||||
continue;
|
||||
}
|
||||
String departNameUrl = departExportVo.getDepartNameUrl();
|
||||
//包含/说明是多级
|
||||
if(departNameUrl.contains(SymbolConstant.SINGLE_SLASH)){
|
||||
//判断添加部门的规则是否和生成的一致
|
||||
if(!sysDepart.getOrgCode().equals(departExportVo.getOrgCode())){
|
||||
if(oConvertUtils.isNotEmpty(sysDepart.getParentId())){
|
||||
//更新上级部门为叶子节点
|
||||
this.updateIzLeaf(sysDepart.getParentId(),CommonConstant.IS_LEAF);
|
||||
}
|
||||
//部门名称已存在
|
||||
errorMessageList.add("第 " + num + " 行:记录部门名称“"+departExportVo.getDepartName()+"”部门编码规则不匹配,请检查!");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
sysDepart.setOrgCode(departExportVo.getOrgCode());
|
||||
if(oConvertUtils.isNotEmpty(sysDepart.getParentId())){
|
||||
//上级
|
||||
sysDepart.setOrgType("2");
|
||||
}else{
|
||||
//下级
|
||||
sysDepart.setOrgType("1");
|
||||
}
|
||||
}else{
|
||||
sysDepart.setOrgType(sysDepart.getOrgCode().length()/codeLength+"");
|
||||
}
|
||||
sysDepart.setDelFlag(CommonConstant.DEL_FLAG_0.toString());
|
||||
sysDepart.setDepartNameEn(departExportVo.getDepartNameEn());
|
||||
sysDepart.setDepartOrder(departExportVo.getDepartOrder());
|
||||
sysDepart.setOrgCategory(oConvertUtils.getString(departExportVo.getOrgCategory(),"1"));
|
||||
sysDepart.setMobile(departExportVo.getMobile());
|
||||
sysDepart.setFax(departExportVo.getFax());
|
||||
sysDepart.setAddress(departExportVo.getAddress());
|
||||
sysDepart.setMemo(departExportVo.getMemo());
|
||||
ImportExcelUtil.importDateSaveOne(sysDepart, ISysDepartService.class, errorMessageList, num, CommonConstant.SQL_INDEX_UNIQ_DEPART_ORG_CODE);
|
||||
departMap.put(departExportVo.getDepartNameUrl(),sysDepart);
|
||||
}
|
||||
num++;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 寻找部门路径
|
||||
*
|
||||
* @param departVo 部门vo
|
||||
* @param path 部门路径
|
||||
* @param tenantId 租户id
|
||||
* @param childrenDepart 子部门
|
||||
* @param departIdList 部门id集合
|
||||
*/
|
||||
private void findSysDepartPath(SysDepartExportVo departVo, List<String> path, Integer tenantId, List<SysDepartExportVo> childrenDepart, List<String> departIdList) {
|
||||
//step 1.查询子部门的数据
|
||||
//获取租户id和部门父id获取的部门数据
|
||||
List<SysDepartExportVo> departList = departMapper.getSysDepartList(departVo.getId(), tenantId);
|
||||
//部门为空判断
|
||||
if (departList == null || departList.size() <= 0) {
|
||||
//判断最后一个子部门是否已拼接
|
||||
if (!departIdList.contains(departVo.getId())) {
|
||||
departVo.setDepartNameUrl(String.join(SymbolConstant.SINGLE_SLASH, path));
|
||||
childrenDepart.add(departVo);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
for (SysDepartExportVo exportDepartVo : departList) {
|
||||
//存放子级路径
|
||||
List<String> cPath = new ArrayList<>(path);
|
||||
cPath.add(exportDepartVo.getDepartName());
|
||||
//step 2.拼接子部门路径
|
||||
if (!departIdList.contains(departVo.getId())) {
|
||||
departIdList.add(departVo.getId());
|
||||
departVo.setDepartNameUrl(String.join(SymbolConstant.SINGLE_SLASH, path));
|
||||
childrenDepart.add(departVo);
|
||||
}
|
||||
//step 3.递归查询子路径,直到找不到为止
|
||||
findSysDepartPath(exportDepartVo, cPath, tenantId, childrenDepart, departIdList);
|
||||
}
|
||||
}
|
||||
//========================end 系统下部门与人员导入 ==================================================================
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package org.jeecg.modules.system.service.impl;
|
||||
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@ -327,15 +328,22 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DictModel> queryTableDictTextByKeys(String table, String text, String code, List<String> codeValues) {
|
||||
public List<DictModel> queryTableDictTextByKeys(String table, String text, String code, List<String> codeValues, String dataSource) {
|
||||
String str = table+","+text+","+code;
|
||||
// 【QQYUN-6533】表字典白名单check
|
||||
sysBaseAPI.dictTableWhiteListCheckByDict(table, text, code);
|
||||
// 1.表字典黑名单check
|
||||
if(!dictQueryBlackListHandler.isPass(str)){
|
||||
log.error(dictQueryBlackListHandler.getError());
|
||||
return null;
|
||||
//update-begin---author:chenrui ---date:20231221 for:[issues/#5643]解决分布式下表字典跨库无法查询问题------------
|
||||
// 是否自定义数据源
|
||||
boolean isCustomDataSource = oConvertUtils.isNotEmpty(dataSource);
|
||||
// 如果是自定义数据源就不检查表字典白名单
|
||||
if (!isCustomDataSource) {
|
||||
// 【QQYUN-6533】表字典白名单check
|
||||
sysBaseAPI.dictTableWhiteListCheckByDict(table, text, code);
|
||||
// 1.表字典黑名单check
|
||||
if (!dictQueryBlackListHandler.isPass(str)) {
|
||||
log.error(dictQueryBlackListHandler.getError());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
//update-end---author:chenrui ---date:20231221 for:[issues/#5643]解决分布式下表字典跨库无法查询问题------------
|
||||
|
||||
// 2.分割SQL获取表名和条件
|
||||
String filterSql = null;
|
||||
@ -353,8 +361,19 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
|
||||
table = SqlInjectionUtil.getSqlInjectTableName(table);
|
||||
text = SqlInjectionUtil.getSqlInjectField(text);
|
||||
code = SqlInjectionUtil.getSqlInjectField(code);
|
||||
|
||||
return sysDictMapper.queryTableDictByKeysAndFilterSql(table, text, code, filterSql, codeValues);
|
||||
|
||||
//update-begin---author:chenrui ---date:20231221 for:[issues/#5643]解决分布式下表字典跨库无法查询问题------------
|
||||
// 切换为字典表的数据源
|
||||
if (isCustomDataSource) {
|
||||
DynamicDataSourceContextHolder.push(dataSource);
|
||||
}
|
||||
List<DictModel> restData = sysDictMapper.queryTableDictByKeysAndFilterSql(table, text, code, filterSql, codeValues);
|
||||
// 清理自定义的数据源
|
||||
if (isCustomDataSource) {
|
||||
DynamicDataSourceContextHolder.clear();
|
||||
}
|
||||
return restData;
|
||||
//update-end---author:chenrui ---date:20231221 for:[issues/#5643]解决分布式下表字典跨库无法查询问题------------
|
||||
//update-end-author:taoyan date:20220113 for: @dict注解支持 dicttable 设置where条件
|
||||
}
|
||||
|
||||
|
||||
@ -128,11 +128,19 @@ public class SysTenantPackServiceImpl extends ServiceImpl<SysTenantPackMapper, S
|
||||
|
||||
@Override
|
||||
public void addDefaultTenantPack(Integer tenantId) {
|
||||
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);
|
||||
String packId = currentService.saveOne(superAdminPack);
|
||||
|
||||
query.eq(SysTenantPack::getPackCode, TenantConstant.SUPER_ADMIN);
|
||||
SysTenantPack sysTenantPackSuperAdmin = currentService.getOne(query);
|
||||
String packId = "";
|
||||
if(null == sysTenantPackSuperAdmin){
|
||||
packId = currentService.saveOne(superAdminPack);
|
||||
}else{
|
||||
packId = sysTenantPackSuperAdmin.getId();
|
||||
}
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
SysTenantPackUser packUser = new SysTenantPackUser(tenantId, packId, sysUser.getId());
|
||||
packUser.setRealname(sysUser.getRealname());
|
||||
@ -140,13 +148,22 @@ public class SysTenantPackServiceImpl extends ServiceImpl<SysTenantPackMapper, S
|
||||
//添加人员和管理员的关系数据
|
||||
currentService.savePackUser(packUser);
|
||||
|
||||
// 创建超级管理员
|
||||
SysTenantPack accountAdminPack = new SysTenantPack(tenantId, "组织账户管理员", TenantConstant.ACCOUNT_ADMIN);
|
||||
currentService.saveOne(accountAdminPack);
|
||||
|
||||
// 创建超级管理员
|
||||
SysTenantPack appAdminPack = new SysTenantPack(tenantId, "组织应用管理员", TenantConstant.APP_ADMIN);
|
||||
currentService.saveOne(appAdminPack);
|
||||
query.eq(SysTenantPack::getPackCode, TenantConstant.ACCOUNT_ADMIN);
|
||||
SysTenantPack sysTenantPackAccountAdmin = currentService.getOne(query);
|
||||
if(null == sysTenantPackAccountAdmin){
|
||||
// 创建超级管理员
|
||||
SysTenantPack accountAdminPack = new SysTenantPack(tenantId, "组织账户管理员", TenantConstant.ACCOUNT_ADMIN);
|
||||
currentService.saveOne(accountAdminPack);
|
||||
}
|
||||
|
||||
query.eq(SysTenantPack::getPackCode, TenantConstant.APP_ADMIN);
|
||||
SysTenantPack sysTenantPackAppAdmin = currentService.getOne(query);
|
||||
|
||||
if(null == sysTenantPackAppAdmin){
|
||||
// 创建超级管理员
|
||||
SysTenantPack appAdminPack = new SysTenantPack(tenantId, "组织应用管理员", TenantConstant.APP_ADMIN);
|
||||
currentService.saveOne(appAdminPack);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -156,7 +156,7 @@ public class SysTenantServiceImpl extends ServiceImpl<SysTenantMapper, SysTenant
|
||||
sysTenantPackService.addDefaultTenantPack(tenantId);
|
||||
|
||||
//添加租户到关系表
|
||||
return this.saveTenantRelation(sysTenant.getId(), userId);
|
||||
return tenantId;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -164,6 +164,7 @@ public class SysTenantServiceImpl extends ServiceImpl<SysTenantMapper, SysTenant
|
||||
//获取租户id
|
||||
sysTenant.setId(this.tenantIdGenerate());
|
||||
sysTenant.setHouseNumber(RandomUtil.randomStringUpper(6));
|
||||
sysTenant.setDelFlag(CommonConstant.DEL_FLAG_0);
|
||||
this.save(sysTenant);
|
||||
//update-begin---author:wangshuai ---date:20230710 for:【QQYUN-5723】1、把当前创建人加入到租户关系里面------------
|
||||
//当前登录人的id
|
||||
@ -680,6 +681,9 @@ public class SysTenantServiceImpl extends ServiceImpl<SysTenantMapper, SysTenant
|
||||
messageDTO.setData(data);
|
||||
messageDTO.setContent(title);
|
||||
messageDTO.setType("system");
|
||||
//update-begin---author:wangshuai---date:2023-11-24---for:【QQYUN-7168】邀请成员时,会报错,但实际已经邀请成功了---
|
||||
messageDTO.setCategory(CommonConstant.MSG_CATEGORY_1);
|
||||
//update-end---author:wangshuai---date:2023-11-24---for:【QQYUN-7168】邀请成员时,会报错,但实际已经邀请成功了---
|
||||
//update-begin---author:wangshuai ---date:20230721 for:【QQYUN-5726】邀请加入租户加个按钮直接跳转过去------------
|
||||
messageDTO.setBusType(SysAnnmentTypeEnum.TENANT_INVITE.getType());
|
||||
sysBaseApi.sendBusAnnouncement(messageDTO);
|
||||
|
||||
@ -62,6 +62,8 @@ public class SysThirdAccountServiceImpl extends ServiceImpl<SysThirdAccountMappe
|
||||
//修改第三方登录账户表使其进行添加用户id
|
||||
LambdaQueryWrapper<SysThirdAccount> query = new LambdaQueryWrapper<>();
|
||||
query.eq(SysThirdAccount::getThirdUserUuid,thirdUserUuid);
|
||||
//扫码登录更新用户创建的时候存的是默认租户,更新的时候也需要根据默认租户来查询,同一个公司下UUID是一样的,不同应用需要区分租户。
|
||||
query.eq(SysThirdAccount::getTenantId,CommonConstant.TENANT_ID_DEFAULT_VALUE);
|
||||
SysThirdAccount account = sysThirdAccountMapper.selectOne(query);
|
||||
SysThirdAccount sysThirdAccount = new SysThirdAccount();
|
||||
sysThirdAccount.setSysUserId(sysUser.getId());
|
||||
@ -189,7 +191,7 @@ public class SysThirdAccountServiceImpl extends ServiceImpl<SysThirdAccountMappe
|
||||
//获取当前登录用户
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
//当前第三方用户已被其他用户所绑定
|
||||
SysThirdAccount oneByThirdUserId = this.getOneByUuidAndThirdType(thirdUserUuid, thirdType,CommonConstant.TENANT_ID_DEFAULT_VALUE);
|
||||
SysThirdAccount oneByThirdUserId = this.getOneByUuidAndThirdType(thirdUserUuid, thirdType,CommonConstant.TENANT_ID_DEFAULT_VALUE, null);
|
||||
if(null != oneByThirdUserId){
|
||||
//如果不为空,并且第三方表和当前登录的用户一致,直接返回
|
||||
if(oConvertUtils.isNotEmpty(oneByThirdUserId.getSysUserId()) && oneByThirdUserId.getSysUserId().equals(sysUser.getId())){
|
||||
@ -210,10 +212,16 @@ public class SysThirdAccountServiceImpl extends ServiceImpl<SysThirdAccountMappe
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysThirdAccount getOneByUuidAndThirdType(String unionid, String thirdType,Integer tenantId) {
|
||||
public SysThirdAccount getOneByUuidAndThirdType(String unionid, String thirdType,Integer tenantId,String thirdUserId) {
|
||||
LambdaQueryWrapper<SysThirdAccount> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(SysThirdAccount::getThirdUserUuid, unionid);
|
||||
queryWrapper.eq(SysThirdAccount::getThirdType, thirdType);
|
||||
//update-begin---author:wangshuai---date:2023-12-04---for: 如果第三方用户id为空那么就不走第三方用户查询逻辑,因为扫码登录third_user_id是唯一的,没有重复的情况---
|
||||
if(oConvertUtils.isNotEmpty(thirdUserId)){
|
||||
queryWrapper.and((wrapper) ->wrapper.eq(SysThirdAccount::getThirdUserUuid,unionid).or().eq(SysThirdAccount::getThirdUserId,thirdUserId));
|
||||
}else{
|
||||
queryWrapper.eq(SysThirdAccount::getThirdUserUuid, unionid);
|
||||
}
|
||||
//update-end---author:wangshuai---date:2023-12-04---for:如果第三方用户id为空那么就不走第三方用户查询逻辑,因为扫码登录third_user_id是唯一的,没有重复的情况---
|
||||
queryWrapper.eq(SysThirdAccount::getTenantId, tenantId);
|
||||
return super.getOne(queryWrapper);
|
||||
}
|
||||
|
||||
@ -143,8 +143,19 @@ public class SysUserDepartServiceImpl extends ServiceImpl<SysUserDepartMapper, S
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param departId
|
||||
* @param username
|
||||
* @param realname
|
||||
* @param pageSize
|
||||
* @param pageNo
|
||||
* @param id
|
||||
* @param isMultiTranslate 是否多字段翻译
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public IPage<SysUser> queryDepartUserPageList(String departId, String username, String realname, int pageSize, int pageNo,String id) {
|
||||
public IPage<SysUser> queryDepartUserPageList(String departId, String username, String realname, int pageSize, int pageNo,String id,String isMultiTranslate) {
|
||||
IPage<SysUser> pageList = null;
|
||||
// 部门ID不存在 直接查询用户表即可
|
||||
Page<SysUser> page = new Page<SysUser>(pageNo, pageSize);
|
||||
@ -153,9 +164,17 @@ public class SysUserDepartServiceImpl extends ServiceImpl<SysUserDepartMapper, S
|
||||
//update-begin---author:wangshuai ---date:20220104 for:[JTC-297]已冻结用户仍可设置为代理人------------
|
||||
query.eq(SysUser::getStatus,Integer.parseInt(CommonConstant.STATUS_1));
|
||||
//update-end---author:wangshuai ---date:20220104 for:[JTC-297]已冻结用户仍可设置为代理人------------
|
||||
//update-begin---author:liusq ---date:20231215 for:逗号分割多个用户翻译问题------------
|
||||
if(oConvertUtils.isNotEmpty(username)){
|
||||
query.like(SysUser::getUsername, username);
|
||||
String COMMA = ",";
|
||||
if(oConvertUtils.isNotEmpty(isMultiTranslate) && username.contains(COMMA)){
|
||||
String[] usernameArr = username.split(COMMA);
|
||||
query.in(SysUser::getUsername,usernameArr);
|
||||
}else {
|
||||
query.like(SysUser::getUsername, username);
|
||||
}
|
||||
}
|
||||
//update-end---author:liusq ---date:20231215 for:逗号分割多个用户翻译问题------------
|
||||
//update-begin---author:wangshuai ---date:20220608 for:[VUEN-1238]邮箱回复时,发送到显示的为用户id------------
|
||||
if(oConvertUtils.isNotEmpty(id)){
|
||||
query.eq(SysUser::getId, id);
|
||||
|
||||
@ -26,6 +26,7 @@ import org.jeecg.common.constant.enums.MessageTypeEnum;
|
||||
import org.jeecg.common.constant.enums.RoleIndexConfigEnum;
|
||||
import org.jeecg.common.desensitization.annotation.SensitiveEncode;
|
||||
import org.jeecg.common.exception.JeecgBootException;
|
||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.jeecg.common.system.vo.SysUserCacheInfo;
|
||||
import org.jeecg.common.util.*;
|
||||
@ -40,9 +41,9 @@ import org.jeecg.modules.system.service.ISysUserService;
|
||||
import org.jeecg.modules.system.vo.SysUserDepVo;
|
||||
import org.jeecg.modules.system.vo.SysUserPositionVo;
|
||||
import org.jeecg.modules.system.vo.UserAvatar;
|
||||
import org.jeecg.modules.system.vo.lowapp.AppExportUserVo;
|
||||
import org.jeecg.modules.system.vo.lowapp.DepartAndUserInfo;
|
||||
import org.jeecg.modules.system.vo.lowapp.DepartInfo;
|
||||
import org.jeecg.modules.system.vo.lowapp.AppExportUserVo;
|
||||
import org.jeecg.modules.system.vo.lowapp.UpdateDepartInfo;
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
@ -100,13 +101,13 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||
@Autowired
|
||||
private SysThirdAccountMapper sysThirdAccountMapper;
|
||||
@Autowired
|
||||
ThirdAppWechatEnterpriseServiceImpl wechatEnterpriseService;
|
||||
ThirdAppWechatEnterpriseServiceImpl wechatEnterpriseService;
|
||||
@Autowired
|
||||
ThirdAppDingtalkServiceImpl dingtalkService;
|
||||
ThirdAppDingtalkServiceImpl dingtalkService;
|
||||
@Autowired
|
||||
SysRoleIndexMapper sysRoleIndexMapper;
|
||||
SysRoleIndexMapper sysRoleIndexMapper;
|
||||
@Autowired
|
||||
SysTenantMapper sysTenantMapper;
|
||||
SysTenantMapper sysTenantMapper;
|
||||
@Autowired
|
||||
private SysUserTenantMapper relationMapper;
|
||||
@Autowired
|
||||
@ -117,6 +118,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||
private SysPositionMapper sysPositionMapper;
|
||||
@Autowired
|
||||
private SystemSendMsgHandle systemSendMsgHandle;
|
||||
|
||||
@Autowired
|
||||
private ISysThirdAccountService sysThirdAccountService;
|
||||
|
||||
@ -831,6 +833,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||
SysUserTenant userTenant = new SysUserTenant();
|
||||
userTenant.setStatus(CommonConstant.USER_TENANT_QUIT);
|
||||
userTenantMapper.update(userTenant,query);
|
||||
//update-end---author:wangshuai ---date:20230111 for:[QQYUN-3951]租户用户离职重构------------
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -15,6 +15,7 @@ import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.system.entity.SysTenant;
|
||||
import org.jeecg.modules.system.entity.SysUser;
|
||||
import org.jeecg.modules.system.entity.SysUserTenant;
|
||||
import org.jeecg.modules.system.mapper.SysTenantPackUserMapper;
|
||||
import org.jeecg.modules.system.mapper.SysUserMapper;
|
||||
import org.jeecg.modules.system.mapper.SysUserPositionMapper;
|
||||
import org.jeecg.modules.system.mapper.SysUserTenantMapper;
|
||||
@ -53,6 +54,9 @@ public class SysUserTenantServiceImpl extends ServiceImpl<SysUserTenantMapper, S
|
||||
@Autowired
|
||||
private SysUserPositionMapper userPositionMapper;
|
||||
|
||||
@Autowired
|
||||
private SysTenantPackUserMapper packUserMapper;
|
||||
|
||||
@Override
|
||||
public Page<SysUser> getPageUserList(Page<SysUser> page, Integer userTenantId, SysUser user) {
|
||||
return page.setRecords(userTenantMapper.getPageUserList(page,userTenantId,user));
|
||||
@ -162,7 +166,6 @@ public class SysUserTenantServiceImpl extends ServiceImpl<SysUserTenantMapper, S
|
||||
return userTenantMapper.userTenantIzExist(userId,tenantId);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IPage<SysTenant> getTenantPageListByUserId(Page<SysTenant> page, String userId, List<String> userTenantStatus,SysUserTenantVo sysUserTenantVo) {
|
||||
return page.setRecords(userTenantMapper.getTenantPageListByUserId(page,userId,userTenantStatus,sysUserTenantVo));
|
||||
@ -183,4 +186,9 @@ public class SysUserTenantServiceImpl extends ServiceImpl<SysUserTenantMapper, S
|
||||
public SysUserTenant getUserTenantByTenantId(String userId, Integer tenantId) {
|
||||
return userTenantMapper.getUserTenantByTenantId(userId,tenantId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getUserCount(Integer tenantId, String tenantStatus) {
|
||||
return userTenantMapper.getUserCount(tenantId,tenantStatus);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package org.jeecg.modules.system.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
@ -983,6 +984,7 @@ public class ThirdAppDingtalkServiceImpl implements IThirdAppService {
|
||||
* OAuth2登录,成功返回登录的SysUser,失败返回null
|
||||
*/
|
||||
public SysUser oauth2Login(String authCode,Integer tenantId) {
|
||||
this.tenantIzExist(tenantId);
|
||||
//update-begin---author:wangshuai ---date:20230224 for:[QQYUN-3440]新建企业微信和钉钉配置表,通过租户模式隔离------------
|
||||
SysThirdAppConfig dtConfig = configMapper.getThirdConfigByThirdType(tenantId, MessageTypeEnum.DD.getType());
|
||||
//update-end---author:wangshuai ---date:20230224 for:[QQYUN-3440]新建企业微信和钉钉配置表,通过租户模式隔离------------
|
||||
@ -1017,7 +1019,9 @@ public class ThirdAppDingtalkServiceImpl implements IThirdAppService {
|
||||
LambdaQueryWrapper<SysThirdAccount> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(SysThirdAccount::getThirdType, THIRD_TYPE);
|
||||
queryWrapper.eq(SysThirdAccount::getTenantId, tenantId);
|
||||
queryWrapper.eq(SysThirdAccount::getThirdUserUuid, unionId);
|
||||
//update-begin---author:wangshuai---date:2023-12-04---for: auth登录需要联查一下---
|
||||
queryWrapper.and((wrapper)->wrapper.eq(SysThirdAccount::getThirdUserUuid,appUserId).or().eq(SysThirdAccount::getThirdUserId,appUserId));
|
||||
//update-end---author:wangshuai---date:2023-12-04---for: auth登录需要联查一下---
|
||||
SysThirdAccount thirdAccount = sysThirdAccountService.getOne(queryWrapper);
|
||||
if (thirdAccount != null) {
|
||||
return this.getSysUserByThird(thirdAccount, null, appUserId, accessToken,tenantId);
|
||||
@ -1082,6 +1086,7 @@ public class ThirdAppDingtalkServiceImpl implements IThirdAppService {
|
||||
*/
|
||||
private SysThirdAppConfig getDingThirdAppConfig(){
|
||||
int tenantId = oConvertUtils.getInt(TenantContext.getTenant(), 0);
|
||||
this.tenantIzExist(tenantId);
|
||||
return configMapper.getThirdConfigByThirdType(tenantId,MessageTypeEnum.DD.getType());
|
||||
}
|
||||
|
||||
@ -1164,7 +1169,7 @@ public class ThirdAppDingtalkServiceImpl implements IThirdAppService {
|
||||
}
|
||||
syncedUserIdSet.add(user.getUserid());
|
||||
SysUser userByPhone = userMapper.getUserByPhone(user.getMobile());
|
||||
SysThirdAccount sysThirdAccount = sysThirdAccountService.getOneByUuidAndThirdType(user.getUnionid(), THIRD_TYPE,tenantId);
|
||||
SysThirdAccount sysThirdAccount = sysThirdAccountService.getOneByUuidAndThirdType(user.getUnionid(), THIRD_TYPE,tenantId,user.getUserid());
|
||||
if (null != userByPhone) {
|
||||
// 循环到此说明用户匹配成功,进行更新操作
|
||||
SysUser updateSysUser = this.dtUserToSysUser(user, userByPhone);
|
||||
@ -1220,4 +1225,17 @@ public class ThirdAppDingtalkServiceImpl implements IThirdAppService {
|
||||
}
|
||||
|
||||
//========================end 应用低代码钉钉同步用户部门专用 ====================
|
||||
|
||||
/**
|
||||
* 验证租户是否存在
|
||||
* @param tenantId
|
||||
*/
|
||||
public void tenantIzExist(Integer tenantId){
|
||||
if(MybatisPlusSaasConfig.OPEN_SYSTEM_TENANT_CONTROL){
|
||||
Long count = tenantMapper.tenantIzExist(tenantId);
|
||||
if(ObjectUtil.isEmpty(count) || 0 == count){
|
||||
throw new JeecgBootException("租户不存在!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,7 @@
|
||||
package org.jeecg.modules.system.service.impl;
|
||||
|
||||
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.toolkit.Wrappers;
|
||||
@ -28,20 +30,21 @@ import org.jeecg.common.config.TenantContext;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.constant.SymbolConstant;
|
||||
import org.jeecg.common.constant.enums.MessageTypeEnum;
|
||||
import org.jeecg.common.exception.JeecgBootException;
|
||||
import org.jeecg.common.system.util.JwtUtil;
|
||||
import org.jeecg.common.util.PasswordUtil;
|
||||
import org.jeecg.common.util.RestUtil;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.config.JeecgBaseConfig;
|
||||
import org.jeecg.config.mybatis.MybatisPlusSaasConfig;
|
||||
import org.jeecg.modules.system.entity.*;
|
||||
import org.jeecg.modules.system.mapper.SysAnnouncementSendMapper;
|
||||
import org.jeecg.modules.system.mapper.SysThirdAppConfigMapper;
|
||||
import org.jeecg.modules.system.mapper.SysUserMapper;
|
||||
import org.jeecg.modules.system.mapper.*;
|
||||
import org.jeecg.modules.system.model.SysDepartTreeModel;
|
||||
import org.jeecg.modules.system.model.ThirdLoginModel;
|
||||
import org.jeecg.modules.system.service.*;
|
||||
import org.jeecg.modules.system.vo.thirdapp.JwDepartmentTreeVo;
|
||||
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.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -50,6 +53,7 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@ -76,7 +80,16 @@ public class ThirdAppWechatEnterpriseServiceImpl implements IThirdAppService {
|
||||
private SysAnnouncementSendMapper sysAnnouncementSendMapper;
|
||||
@Autowired
|
||||
private SysThirdAppConfigMapper configMapper;
|
||||
|
||||
@Autowired
|
||||
private SysTenantMapper sysTenantMapper;
|
||||
@Autowired
|
||||
private SysUserTenantMapper sysUserTenantMapper;
|
||||
@Autowired
|
||||
private SysThirdAccountMapper sysThirdAccountMapper;
|
||||
@Autowired
|
||||
private SysTenantMapper tenantMapper;
|
||||
|
||||
|
||||
/**
|
||||
* errcode
|
||||
*/
|
||||
@ -235,82 +248,85 @@ public class ThirdAppWechatEnterpriseServiceImpl implements IThirdAppService {
|
||||
}
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public SyncInfoVo syncThirdAppDepartmentToLocal(String ids) {
|
||||
// SyncInfoVo syncInfo = new SyncInfoVo();
|
||||
// String accessToken = this.getAccessToken();
|
||||
// if (accessToken == null) {
|
||||
// syncInfo.addFailInfo("accessToken获取失败!");
|
||||
// return syncInfo;
|
||||
// }
|
||||
// // 获取企业微信所有的部门
|
||||
// List<Department> departments = JwDepartmentAPI.getAllDepartment(accessToken);
|
||||
// if (departments == null) {
|
||||
// syncInfo.addFailInfo("企业微信部门信息获取失败!");
|
||||
// return syncInfo;
|
||||
// }
|
||||
// String username = JwtUtil.getUserNameByToken(SpringContextUtils.getHttpServletRequest());
|
||||
// // 将list转为tree
|
||||
// List<JwDepartmentTreeVo> departmentTreeList = JwDepartmentTreeVo.listToTree(departments);
|
||||
// // 递归同步部门
|
||||
// this.syncDepartmentToLocalRecursion(departmentTreeList, null, username, syncInfo);
|
||||
// return syncInfo;
|
||||
// }
|
||||
public SyncInfoVo syncThirdAppDepartmentToLocal(Integer tenantId, Map<String,String> map) {
|
||||
SyncInfoVo syncInfo = new SyncInfoVo();
|
||||
String accessToken = this.getAccessToken();
|
||||
if (accessToken == null) {
|
||||
syncInfo.addFailInfo("accessToken获取失败!");
|
||||
return syncInfo;
|
||||
}
|
||||
// 获取企业微信所有的部门
|
||||
List<Department> departments = JwDepartmentAPI.getAllDepartment(accessToken);
|
||||
if (departments == null) {
|
||||
syncInfo.addFailInfo("企业微信部门信息获取失败!");
|
||||
return syncInfo;
|
||||
}
|
||||
String username = JwtUtil.getUserNameByToken(SpringContextUtils.getHttpServletRequest());
|
||||
// 将list转为tree
|
||||
List<JwDepartmentTreeVo> departmentTreeList = JwDepartmentTreeVo.listToTree(departments);
|
||||
// 递归同步部门
|
||||
this.syncDepartmentToLocalRecursion(departmentTreeList, null, username, syncInfo, tenantId, map);
|
||||
return syncInfo;
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 递归同步部门到本地
|
||||
// */
|
||||
// private void syncDepartmentToLocalRecursion(List<JwDepartmentTreeVo> departmentTreeList, String sysParentId, String username, SyncInfoVo syncInfo) {
|
||||
// if (departmentTreeList != null && departmentTreeList.size() != 0) {
|
||||
// for (JwDepartmentTreeVo departmentTree : departmentTreeList) {
|
||||
// String depId = departmentTree.getId();
|
||||
// LambdaQueryWrapper<SysDepart> queryWrapper = new LambdaQueryWrapper<>();
|
||||
// // 根据 qywxIdentifier 字段查询
|
||||
// queryWrapper.eq(SysDepart::getQywxIdentifier, depId);
|
||||
// SysDepart sysDepart = sysDepartService.getOne(queryWrapper);
|
||||
// if (sysDepart != null) {
|
||||
// // 执行更新操作
|
||||
// SysDepart updateSysDepart = this.qwDepartmentToSysDepart(departmentTree, sysDepart);
|
||||
// if (sysParentId != null) {
|
||||
// updateSysDepart.setParentId(sysParentId);
|
||||
// }
|
||||
// try {
|
||||
// sysDepartService.updateDepartDataById(updateSysDepart, username);
|
||||
// String str = String.format("部门 %s 更新成功!", updateSysDepart.getDepartName());
|
||||
// syncInfo.addSuccessInfo(str);
|
||||
// } catch (Exception e) {
|
||||
// this.syncDepartCollectErrInfo(e, departmentTree, syncInfo);
|
||||
// }
|
||||
// if (departmentTree.hasChildren()) {
|
||||
// // 紧接着同步子级
|
||||
// this.syncDepartmentToLocalRecursion(departmentTree.getChildren(), updateSysDepart.getId(), username, syncInfo);
|
||||
// }
|
||||
// } else {
|
||||
// // 执行新增操作
|
||||
// SysDepart newSysDepart = this.qwDepartmentToSysDepart(departmentTree, null);
|
||||
// if (sysParentId != null) {
|
||||
// newSysDepart.setParentId(sysParentId);
|
||||
// // 2 = 组织机构
|
||||
// newSysDepart.setOrgCategory("2");
|
||||
// } else {
|
||||
// // 1 = 公司
|
||||
// newSysDepart.setOrgCategory("1");
|
||||
// }
|
||||
// try {
|
||||
// sysDepartService.saveDepartData(newSysDepart, username);
|
||||
// String str = String.format("部门 %s 创建成功!", newSysDepart.getDepartName());
|
||||
// syncInfo.addSuccessInfo(str);
|
||||
// } catch (Exception e) {
|
||||
// this.syncDepartCollectErrInfo(e, departmentTree, syncInfo);
|
||||
// }
|
||||
// // 紧接着同步子级
|
||||
// if (departmentTree.hasChildren()) {
|
||||
// this.syncDepartmentToLocalRecursion(departmentTree.getChildren(), newSysDepart.getId(), username, syncInfo);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
/**
|
||||
* 递归同步部门到本地
|
||||
*/
|
||||
private void syncDepartmentToLocalRecursion(List<JwDepartmentTreeVo> departmentTreeList, String sysParentId, String username, SyncInfoVo syncInfo,Integer tenantId, Map<String,String> map) {
|
||||
if (departmentTreeList != null && departmentTreeList.size() != 0) {
|
||||
for (JwDepartmentTreeVo departmentTree : departmentTreeList) {
|
||||
String depId = departmentTree.getId();
|
||||
LambdaQueryWrapper<SysDepart> queryWrapper = new LambdaQueryWrapper<>();
|
||||
// 根据 qywxIdentifier 字段和租户id查询,租户id默认为0
|
||||
queryWrapper.eq(SysDepart::getQywxIdentifier, depId);
|
||||
queryWrapper.eq(SysDepart::getTenantId, tenantId);
|
||||
SysDepart sysDepart = sysDepartService.getOne(queryWrapper);
|
||||
if (sysDepart != null) {
|
||||
// 执行更新操作
|
||||
SysDepart updateSysDepart = this.qwDepartmentToSysDepart(departmentTree, sysDepart);
|
||||
if (sysParentId != null) {
|
||||
updateSysDepart.setParentId(sysParentId);
|
||||
}
|
||||
try {
|
||||
sysDepartService.updateDepartDataById(updateSysDepart, username);
|
||||
String str = String.format("部门 %s 更新成功!", updateSysDepart.getDepartName());
|
||||
syncInfo.addSuccessInfo(str);
|
||||
map.put(depId,updateSysDepart.getId());
|
||||
} catch (Exception e) {
|
||||
this.syncDepartCollectErrInfo(e, departmentTree, syncInfo);
|
||||
}
|
||||
if (departmentTree.hasChildren()) {
|
||||
// 紧接着同步子级
|
||||
this.syncDepartmentToLocalRecursion(departmentTree.getChildren(), updateSysDepart.getId(), username, syncInfo, tenantId, map);
|
||||
}
|
||||
} else {
|
||||
// 执行新增操作
|
||||
SysDepart newSysDepart = this.qwDepartmentToSysDepart(departmentTree, null);
|
||||
if (sysParentId != null) {
|
||||
newSysDepart.setParentId(sysParentId);
|
||||
// 2 = 组织机构
|
||||
newSysDepart.setOrgCategory("2");
|
||||
} else {
|
||||
// 1 = 公司
|
||||
newSysDepart.setOrgCategory("1");
|
||||
}
|
||||
newSysDepart.setTenantId(tenantId);
|
||||
try {
|
||||
sysDepartService.saveDepartData(newSysDepart, username);
|
||||
String str = String.format("部门 %s 创建成功!", newSysDepart.getDepartName());
|
||||
syncInfo.addSuccessInfo(str);
|
||||
map.put(depId,newSysDepart.getId());
|
||||
} catch (Exception e) {
|
||||
this.syncDepartCollectErrInfo(e, departmentTree, syncInfo);
|
||||
}
|
||||
// 紧接着同步子级
|
||||
if (departmentTree.hasChildren()) {
|
||||
this.syncDepartmentToLocalRecursion(departmentTree.getChildren(), newSysDepart.getId(), username, syncInfo, tenantId, map);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public SyncInfoVo syncLocalUserToThirdApp(String ids) {
|
||||
@ -374,7 +390,7 @@ public class ThirdAppWechatEnterpriseServiceImpl implements IThirdAppService {
|
||||
int errCode = JwUserAPI.updateUser(qwUser, accessToken);
|
||||
// 收集错误信息
|
||||
this.syncUserCollectErrInfo(errCode, sysUser, syncInfo);
|
||||
this.thirdAccountSaveOrUpdate(sysThirdAccount, sysUser.getId(), qwUser.getUserid());
|
||||
this.thirdAccountSaveOrUpdate(sysThirdAccount, sysUser.getId(), qwUser.getUserid(),qwUser.getName());
|
||||
// 更新完成,直接跳到下一次外部循环继续
|
||||
continue for1;
|
||||
}
|
||||
@ -384,7 +400,7 @@ public class ThirdAppWechatEnterpriseServiceImpl implements IThirdAppService {
|
||||
// 收集错误信息
|
||||
boolean apiSuccess = this.syncUserCollectErrInfo(errCode, sysUser, syncInfo);
|
||||
if (apiSuccess) {
|
||||
this.thirdAccountSaveOrUpdate(sysThirdAccount, sysUser.getId(), qwUser.getUserid());
|
||||
this.thirdAccountSaveOrUpdate(sysThirdAccount, sysUser.getId(), qwUser.getUserid(),qwUser.getName());
|
||||
}
|
||||
}
|
||||
return syncInfo;
|
||||
@ -453,8 +469,9 @@ public class ThirdAppWechatEnterpriseServiceImpl implements IThirdAppService {
|
||||
* @param sysThirdAccount 第三方账户表对象,为null就新增数据,否则就修改
|
||||
* @param sysUserId 本地系统用户ID
|
||||
* @param qwUserId 企业微信用户ID
|
||||
* @param wechatRealName 企业微信用户真实姓名
|
||||
*/
|
||||
private void thirdAccountSaveOrUpdate(SysThirdAccount sysThirdAccount, String sysUserId, String qwUserId) {
|
||||
private void thirdAccountSaveOrUpdate(SysThirdAccount sysThirdAccount, String sysUserId, String qwUserId, String wechatRealName) {
|
||||
if (sysThirdAccount == null) {
|
||||
sysThirdAccount = new SysThirdAccount();
|
||||
sysThirdAccount.setSysUserId(sysUserId);
|
||||
@ -463,6 +480,8 @@ public class ThirdAppWechatEnterpriseServiceImpl implements IThirdAppService {
|
||||
sysThirdAccount.setThirdType(THIRD_TYPE);
|
||||
}
|
||||
sysThirdAccount.setThirdUserId(qwUserId);
|
||||
sysThirdAccount.setThirdUserUuid(qwUserId);
|
||||
sysThirdAccount.setRealname(wechatRealName);
|
||||
sysThirdAccountService.saveOrUpdate(sysThirdAccount);
|
||||
}
|
||||
|
||||
@ -919,6 +938,10 @@ public class ThirdAppWechatEnterpriseServiceImpl implements IThirdAppService {
|
||||
* OAuth2登录,成功返回登录的SysUser,失败返回null
|
||||
*/
|
||||
public SysUser oauth2Login(String code,Integer tenantId) {
|
||||
Long count = tenantMapper.tenantIzExist(tenantId);
|
||||
if(ObjectUtil.isEmpty(count) || 0 == count){
|
||||
throw new JeecgBootException("租户不存在!");
|
||||
}
|
||||
//update-begin---author:wangshuai ---date:20230224 for:[QQYUN-3440]新建企业微信和钉钉配置表,通过租户模式隔离------------
|
||||
SysThirdAppConfig config = configMapper.getThirdConfigByThirdType(tenantId, MessageTypeEnum.QYWX.getType());
|
||||
String accessToken = this.getAppAccessToken(config);
|
||||
@ -933,19 +956,14 @@ public class ThirdAppWechatEnterpriseServiceImpl implements IThirdAppService {
|
||||
String userTicket = map.get("userTicket");
|
||||
// 判断第三方用户表有没有这个人
|
||||
LambdaQueryWrapper<SysThirdAccount> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(SysThirdAccount::getThirdUserUuid, appUserId);
|
||||
queryWrapper.or().eq(SysThirdAccount::getThirdUserId, appUserId);
|
||||
queryWrapper.eq(SysThirdAccount::getThirdUserId, appUserId);
|
||||
queryWrapper.eq(SysThirdAccount::getThirdType, THIRD_TYPE);
|
||||
queryWrapper.eq(SysThirdAccount::getTenantId, tenantId);
|
||||
SysThirdAccount thirdAccount = sysThirdAccountService.getOne(queryWrapper);
|
||||
if (thirdAccount != null) {
|
||||
return this.getSysUserByThird(thirdAccount, null, appUserId, accessToken, userTicket,tenantId);
|
||||
} else {
|
||||
// 直接创建新账号
|
||||
User appUser = this.getUserByUserTicket(userTicket, accessToken);
|
||||
ThirdLoginModel tlm = new ThirdLoginModel(THIRD_TYPE, appUser.getUserid(), appUser.getName(), appUser.getAvatar());
|
||||
thirdAccount = sysThirdAccountService.saveThirdUser(tlm,tenantId);
|
||||
return this.getSysUserByThird(thirdAccount, appUser, null, null, userTicket,tenantId);
|
||||
throw new JeecgBootException("该用户尚未同步,请同步后再次登录!");
|
||||
}
|
||||
}
|
||||
return null;
|
||||
@ -1032,4 +1050,242 @@ public class ThirdAppWechatEnterpriseServiceImpl implements IThirdAppService {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取企业微信绑定的用户信息
|
||||
* @return
|
||||
*/
|
||||
public JwSysUserDepartVo getThirdUserByWechat(Integer tenantId) {
|
||||
JwSysUserDepartVo sysUserDepartVo = new JwSysUserDepartVo();
|
||||
//step1 获取用户id和部门id
|
||||
String accessToken = this.getAccessToken();
|
||||
if (accessToken == null) {
|
||||
throw new JeecgBootException("accessToken获取失败!");
|
||||
}
|
||||
//获取当前租户下的用户
|
||||
List<JwUserDepartVo> userList = sysUserTenantMapper.getUsersByTenantIdAndName(tenantId);
|
||||
// 获取企业微信所有的用户(只能获取userid)
|
||||
List<User> qwUsers = JwUserAPI.getUsersByDepartid("1","1",null,accessToken);
|
||||
if(oConvertUtils.isEmpty(qwUsers)){
|
||||
throw new JeecgBootException("企业微信下没查询到用户!");
|
||||
}
|
||||
List<String> userIds = new ArrayList<>();
|
||||
List<JwUserDepartVo> userWechatList = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < qwUsers.size(); i++) {
|
||||
User user = qwUsers.get(i);
|
||||
String userId = qwUsers.get(i).getUserid();
|
||||
//保证用户唯一
|
||||
if(!userIds.contains(userId)){
|
||||
//step2 查看是否已经同步过了,同步过的不做处理
|
||||
SysThirdAccount oneBySysUserId = sysThirdAccountService.getOneByUuidAndThirdType(userId, THIRD_TYPE,tenantId, userId);
|
||||
if(null != oneBySysUserId){
|
||||
userIds.add(qwUsers.get(i).getUserid());
|
||||
userList = userList.stream().filter(item -> !item.getUserId().equals(oneBySysUserId.getSysUserId())).collect(Collectors.toList());;
|
||||
continue;
|
||||
}
|
||||
AtomicBoolean excludeUser = new AtomicBoolean(false);
|
||||
if(ObjectUtil.isNotEmpty(qwUsers)){
|
||||
//step3 通过名称匹配敲敲云
|
||||
userList.forEach(item ->{
|
||||
if(item.getRealName().equals(user.getName())){
|
||||
item.setWechatUserId(user.getUserid());
|
||||
item.setWechatRealName(user.getName());
|
||||
if(ObjectUtil.isNotEmpty(user.getDepartment())){
|
||||
item.setWechatDepartId(Arrays.toString(user.getDepartment()));
|
||||
}
|
||||
excludeUser.set(true);
|
||||
}
|
||||
});
|
||||
userIds.add(user.getUserid());
|
||||
}
|
||||
if(!excludeUser.get()){
|
||||
JwUserDepartVo userDepartVo = new JwUserDepartVo();
|
||||
userDepartVo.setWechatRealName(user.getName());
|
||||
userDepartVo.setWechatUserId(user.getUserid());
|
||||
if(ObjectUtil.isNotEmpty(user.getDepartment())){
|
||||
userDepartVo.setWechatDepartId(Arrays.toString(user.getDepartment()));
|
||||
}
|
||||
userWechatList.add(userDepartVo);
|
||||
}
|
||||
}
|
||||
}
|
||||
//step4 返回用户信息
|
||||
sysUserDepartVo.setUserList(userWechatList);
|
||||
sysUserDepartVo.setJwUserDepartVos(userList);
|
||||
return sysUserDepartVo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步企业微信和部门
|
||||
* @param jwUserDepartJson
|
||||
* @return
|
||||
*/
|
||||
public SyncInfoVo syncWechatEnterpriseDepartAndUserToLocal(String jwUserDepartJson, Integer tenantId) {
|
||||
//step 1 同步部门
|
||||
//存放部门id的map
|
||||
Map<String,String> idsMap = new HashMap<>();
|
||||
SyncInfoVo syncInfoVo = this.syncThirdAppDepartmentToLocal(tenantId, idsMap);
|
||||
//step 2 同步用户及用户部门
|
||||
this.syncDepartAndUser(syncInfoVo, tenantId, idsMap, jwUserDepartJson);
|
||||
//step 3 返回同步成功或者同步失败的消息
|
||||
return syncInfoVo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步用户和部门
|
||||
* @param syncInfoVo 存放错误信息的日志
|
||||
* @param tenantId 租户id
|
||||
* @param idsMap 部门id集合 key为企业微信的id value 为系统部门的id
|
||||
* @param jwUserDepartJson
|
||||
*/
|
||||
private void syncDepartAndUser(SyncInfoVo syncInfoVo, Integer tenantId, Map<String, String> idsMap, String jwUserDepartJson) {
|
||||
if (oConvertUtils.isNotEmpty(jwUserDepartJson)) {
|
||||
JSONArray jsonArray = JSONObject.parseArray(jwUserDepartJson);
|
||||
for (Object object : jsonArray) {
|
||||
JSONObject jsonObject = JSONObject.parseObject(object.toString());
|
||||
Object userId = jsonObject.get("userId");
|
||||
String wechatUserId = jsonObject.getString("wechatUserId");
|
||||
String wechatRealName = jsonObject.getString("wechatRealName");
|
||||
Object wechatDepartId = jsonObject.get("wechatDepartId");
|
||||
String sysUserId = "";
|
||||
//step 1 新建或更新用户
|
||||
//用户id为空说明需要创建用户
|
||||
if (null == userId) {
|
||||
SysTenant sysTenant = sysTenantMapper.selectById(tenantId);
|
||||
String houseNumber = "";
|
||||
//空说明没有租户直接用用户名
|
||||
if (null != sysTenant) {
|
||||
houseNumber = sysTenant.getHouseNumber();
|
||||
}
|
||||
//用户名和密码用门牌号+用户id的格式,避免用户名重复
|
||||
String username = houseNumber + wechatUserId;
|
||||
//新建用户
|
||||
sysUserId = this.saveUser(username, wechatRealName, syncInfoVo, wechatUserId);
|
||||
} else {
|
||||
//根据id查询用户
|
||||
SysUser sysUser = userMapper.selectById(userId.toString());
|
||||
if (null != sysUser) {
|
||||
sysUserId = sysUser.getId();
|
||||
//如果真实姓名为空的情况下,才会改真实姓名
|
||||
if(oConvertUtils.isEmpty(sysUser.getRealname())){
|
||||
sysUser.setRealname(wechatRealName);
|
||||
//更新用户
|
||||
userMapper.updateById(sysUser);
|
||||
}
|
||||
String str = String.format("用户 %s(%s) 更新成功!", sysUser.getRealname(), sysUser.getUsername());
|
||||
syncInfoVo.addSuccessInfo(str);
|
||||
}else{
|
||||
syncInfoVo.addFailInfo("企业微信用户 "+wechatRealName+" 对应的组织用户没有匹配到!");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (oConvertUtils.isNotEmpty(sysUserId)) {
|
||||
//step 2 新增租户用户表
|
||||
this.createUserTenant(sysUserId,false,tenantId);
|
||||
//step 3 新建或更新第三方账号表
|
||||
SysThirdAccount sysThirdAccount = sysThirdAccountService.getOneByUuidAndThirdType(wechatUserId, THIRD_TYPE, tenantId, wechatUserId);
|
||||
this.thirdAccountSaveOrUpdate(sysThirdAccount,sysUserId,wechatUserId,wechatRealName);
|
||||
//step 4 新建或更新用户部门关系表
|
||||
if(oConvertUtils.isNotEmpty(wechatDepartId)){
|
||||
String wechatDepartIds = wechatDepartId.toString();
|
||||
String[] departIds = wechatDepartIds.substring(1, wechatDepartIds.length() - 1).split(",");
|
||||
this.userDepartSaveOrUpdate(idsMap,sysUserId,departIds);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
syncInfoVo.addFailInfo("用户同同步失败,请查看企业微信是否存在用户!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存用户
|
||||
*
|
||||
* @param username 用户名
|
||||
* @param wechatRealName 企业微信用户真实姓名
|
||||
* @param syncInfo 存放成功或失败的信息
|
||||
* @param wechatUserId wechatUserId 企业微信对应的id
|
||||
* @return
|
||||
*/
|
||||
private String saveUser(String username, String wechatRealName, SyncInfoVo syncInfo, String wechatUserId) {
|
||||
SysUser sysUser = new SysUser();
|
||||
sysUser.setRealname(wechatRealName);
|
||||
sysUser.setPassword(username);
|
||||
sysUser.setUsername(username);
|
||||
sysUser.setDelFlag(CommonConstant.DEL_FLAG_0);
|
||||
//设置创建时间
|
||||
sysUser.setCreateTime(new Date());
|
||||
String salt = oConvertUtils.randomGen(8);
|
||||
sysUser.setSalt(salt);
|
||||
String passwordEncode = PasswordUtil.encrypt(sysUser.getUsername(), sysUser.getPassword(), salt);
|
||||
sysUser.setPassword(passwordEncode);
|
||||
sysUser.setStatus(1);
|
||||
sysUser.setDelFlag(CommonConstant.DEL_FLAG_0);
|
||||
//用户表字段org_code不能在这里设置他的值
|
||||
sysUser.setOrgCode(null);
|
||||
try {
|
||||
userMapper.insert(sysUser);
|
||||
String str = String.format("用户 %s(%s) 创建成功!", sysUser.getRealname(), sysUser.getUsername());
|
||||
syncInfo.addSuccessInfo(str);
|
||||
return sysUser.getId();
|
||||
} catch (Exception e) {
|
||||
User user = new User();
|
||||
user.setUserid(wechatUserId);
|
||||
user.setName(wechatRealName);
|
||||
this.syncUserCollectErrInfo(e, user, syncInfo);
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户租户
|
||||
*
|
||||
* @param userId
|
||||
* @param isUpdate 是否是新增
|
||||
* @param tenantId
|
||||
*/
|
||||
private void createUserTenant(String userId, Boolean isUpdate, Integer tenantId) {
|
||||
if (MybatisPlusSaasConfig.OPEN_SYSTEM_TENANT_CONTROL) {
|
||||
//判断当前用户是否已在该租户下面
|
||||
Integer count = sysUserTenantMapper.userTenantIzExist(userId, tenantId);
|
||||
//count 为0 新增租户用户,否则不用新增
|
||||
if (count == 0) {
|
||||
SysUserTenant userTenant = new SysUserTenant();
|
||||
userTenant.setTenantId(tenantId);
|
||||
userTenant.setUserId(userId);
|
||||
userTenant.setStatus(isUpdate ? CommonConstant.USER_TENANT_UNDER_REVIEW : CommonConstant.USER_TENANT_NORMAL);
|
||||
sysUserTenantMapper.insert(userTenant);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新建或更新用户部门关系表
|
||||
* @param idsMap 部门id集合 key为企业微信的id value 为系统部门的id
|
||||
* @param sysUserId 系统对应的用户id
|
||||
*/
|
||||
private void userDepartSaveOrUpdate(Map<String, String> idsMap, String sysUserId, String[] departIds) {
|
||||
LambdaQueryWrapper<SysUserDepart> query = new LambdaQueryWrapper<>();
|
||||
query.eq(SysUserDepart::getUserId,sysUserId);
|
||||
for (String departId:departIds) {
|
||||
departId = departId.trim();
|
||||
if(idsMap.containsKey(departId)){
|
||||
String value = idsMap.get(departId);
|
||||
//查询用户是否在部门里面
|
||||
query.eq(SysUserDepart::getDepId,value);
|
||||
long count = sysUserDepartService.count(query);
|
||||
if(count == 0){
|
||||
//不存在,则新增部门用户关系
|
||||
SysUserDepart sysUserDepart = new SysUserDepart(null,sysUserId,value);
|
||||
sysUserDepartService.save(sysUserDepart);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public List<JwUserDepartVo> getThirdUserBindByWechat(int tenantId) {
|
||||
return sysThirdAccountMapper.getThirdUserBindByWechat(tenantId,THIRD_TYPE);
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,46 @@
|
||||
package org.jeecg.modules.system.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
@Data
|
||||
public class SysDepartExportVo {
|
||||
/**部门路径*/
|
||||
@Excel(name="部门路径",width=50)
|
||||
private String departNameUrl;
|
||||
/**机构/部门名称*/
|
||||
@Excel(name="部门名称",width=50)
|
||||
private String departName;
|
||||
/**id*/
|
||||
private String id;
|
||||
/**父级id*/
|
||||
private String parentId;
|
||||
/**英文名*/
|
||||
@Excel(name="英文名",width=15)
|
||||
private String departNameEn;
|
||||
/**排序*/
|
||||
@Excel(name="排序",width=15)
|
||||
private Integer departOrder;
|
||||
/**描述*/
|
||||
@Excel(name="描述",width=15)
|
||||
private String description;
|
||||
/**机构类别 1=公司,2=组织机构,3=岗位*/
|
||||
@Excel(name="机构类别",width=15,dicCode="org_category")
|
||||
private String orgCategory;
|
||||
/**机构编码*/
|
||||
@Excel(name="机构编码",width=15)
|
||||
private String orgCode;
|
||||
/**手机号*/
|
||||
@Excel(name="手机号",width=15)
|
||||
private String mobile;
|
||||
/**传真*/
|
||||
@Excel(name="传真",width=15)
|
||||
private String fax;
|
||||
/**地址*/
|
||||
@Excel(name="地址",width=15)
|
||||
private String address;
|
||||
/**备注*/
|
||||
@Excel(name="备注",width=15)
|
||||
private String memo;
|
||||
}
|
||||
@ -102,4 +102,14 @@ public class SysUserTenantVo {
|
||||
* 门牌号
|
||||
*/
|
||||
private String houseNumber;
|
||||
|
||||
/**
|
||||
* 是否为会员
|
||||
*/
|
||||
private String memberType;
|
||||
|
||||
/**
|
||||
* 是否为租户管理员
|
||||
*/
|
||||
private Boolean tenantAdmin = false;
|
||||
}
|
||||
|
||||
@ -0,0 +1,23 @@
|
||||
package org.jeecg.modules.system.vo.thirdapp;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 企业微信的实现类
|
||||
*/
|
||||
@Data
|
||||
public class JwSysUserDepartVo {
|
||||
|
||||
/**
|
||||
* 企业微信和用户的映射类
|
||||
*/
|
||||
private List<JwUserDepartVo> jwUserDepartVos;
|
||||
|
||||
/**
|
||||
* 用户列表
|
||||
*/
|
||||
private List<JwUserDepartVo> userList;
|
||||
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
package org.jeecg.modules.system.vo.thirdapp;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Description: 企业微信用户同步工具类
|
||||
*
|
||||
* @author: wangshuai
|
||||
* @date: 2023/11/28 18:17
|
||||
*/
|
||||
@Data
|
||||
public class JwUserDepartVo {
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 用户头像
|
||||
*/
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 真实姓名
|
||||
*/
|
||||
private String realName;
|
||||
|
||||
/**
|
||||
* 企业微信的名字
|
||||
*/
|
||||
private String wechatRealName;
|
||||
|
||||
/**
|
||||
* 企业微信对应的部门
|
||||
*/
|
||||
private String wechatDepartId;
|
||||
|
||||
/**
|
||||
* 企业微信对应的用户id
|
||||
*/
|
||||
private String wechatUserId;
|
||||
|
||||
/**
|
||||
* 第三方id
|
||||
*/
|
||||
private String thirdId;
|
||||
}
|
||||
@ -131,6 +131,57 @@
|
||||
</#if>
|
||||
</#if>
|
||||
</#function>
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
<#-- ** 高级查询生成(Vue3 * -->
|
||||
<#function superQueryFieldListForVue3(po,order)>
|
||||
<#-- 字段展示/DB类型 -->
|
||||
<#assign baseAttrs="view: '${po.classType}', type: 'string',">
|
||||
<#if po.fieldDbType=='int' || po.fieldDbType=='double' || po.fieldDbType=='BigDecimal'>
|
||||
<#assign baseAttrs="view: 'number', type: 'number',">
|
||||
</#if>
|
||||
|
||||
<#-- 特殊类型控件扩展字段 -->
|
||||
<#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}'">
|
||||
<#elseif po.dictField?default("")?trim?length gt 1>
|
||||
<#assign dictCode="dictCode: '${po.dictField}'">
|
||||
</#if>
|
||||
|
||||
<#if po.classType=='list' || po.classType=='list_multi' || po.classType=='sel_search' || po.classType=='checkbox'>
|
||||
<#assign extAttrs="${dictCode},">
|
||||
<#elseif po.classType=='cat_tree'>
|
||||
<#-- 分类字典树 -->
|
||||
<#assign extAttrs="pcode: '${po.dictField}',">
|
||||
<#elseif po.classType=='sel_tree'>
|
||||
<#-- 自定义树 -->
|
||||
<#if po.dictText??>
|
||||
<#-- dictText示例:id,pid,name,has_child -->
|
||||
<#if po.dictText?split(',')[2]?? && po.dictText?split(',')[0]??>
|
||||
<#assign extAttrs="dict: '${po.dictTable},${po.dictText?split(',')[2]},${po.dictText?split(',')[0]}'">
|
||||
<#elseif po.dictText?split(',')[1]??>
|
||||
<#assign extAttrs="pidField: '${po.dictText?split(',')[1]}'">
|
||||
<#elseif po.dictText?split(',')[3]??>
|
||||
<#assign extAttrs="hasChildField: '${po.dictText?split(',')[3]}'">
|
||||
</#if>
|
||||
</#if>
|
||||
<#assign extAttrs="${extAttrs}, pidValue: '${po.dictField}',">
|
||||
<#elseif po.classType=='popup'>
|
||||
<#-- popup -->
|
||||
<#if po.dictText?default("")?trim?length gt 1 && po.dictText?index_of(',') gt 0>
|
||||
<#-- 如果有多个回填字段,找到popup字段对应的来源字段 -->
|
||||
<#assign orgFieldIx=po.dictText?split(',')?seq_index_of(po.fieldDbName)>
|
||||
<#assign orgField=po.dictField?split(',')[orgFieldIx]>
|
||||
<#else>
|
||||
<#assign orgField=po.dictField?default("")>
|
||||
</#if>
|
||||
<#assign extAttrs="code: '${po.dictTable?default('')}', orgFields: '${orgField}', destFields: '${po.fieldName}', popupMulti: false,">
|
||||
</#if>
|
||||
|
||||
<#return "${po.fieldName}: {title: '${po.filedComment}',order: ${order},${baseAttrs}${extAttrs}}" >
|
||||
</#function>
|
||||
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
|
||||
|
||||
<#-- vue3 获取表单modal的宽度-->
|
||||
|
||||
@ -37,6 +37,10 @@
|
||||
<Icon icon="mdi:chevron-down"></Icon>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
<!-- 高级查询 -->
|
||||
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
|
||||
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
@ -71,12 +75,12 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="${entityPackage}-${entityName?uncap_first}" setup>
|
||||
import {ref, computed, unref} from 'vue';
|
||||
import {ref, reactive, computed, unref} from 'vue';
|
||||
import {BasicTable, useTable, TableAction} from '/@/components/Table';
|
||||
import {useModal} from '/@/components/Modal';
|
||||
import { useListPage } from '/@/hooks/system/useListPage'
|
||||
import ${entityName}Modal from './components/${entityName}Modal.vue'
|
||||
import {columns, searchFormSchema} from './${entityName}.data';
|
||||
import {columns, searchFormSchema, superQuerySchema} from './${entityName}.data';
|
||||
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './${entityName}.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
@ -91,6 +95,7 @@
|
||||
<#if bpm_flag==true>
|
||||
import { startProcess } from '/@/api/common/api';
|
||||
</#if>
|
||||
const queryParam = reactive<any>({});
|
||||
const checkedKeys = ref<Array<string | number>>([]);
|
||||
const userStore = useUserStore();
|
||||
//注册model
|
||||
@ -136,10 +141,14 @@
|
||||
width: 120,
|
||||
fixed:'right'
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
return Object.assign(params, queryParam);
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name:"${tableVo.ftlDescription}",
|
||||
url: getExportUrl,
|
||||
params: queryParam,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
@ -149,6 +158,20 @@
|
||||
|
||||
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
|
||||
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
// 高级查询配置
|
||||
const superQueryConfig = reactive(superQuerySchema);
|
||||
|
||||
/**
|
||||
* 高级查询事件
|
||||
*/
|
||||
function handleSuperQuery(params) {
|
||||
Object.keys(params).map((k) => {
|
||||
queryParam[k] = params[k];
|
||||
});
|
||||
reload();
|
||||
}
|
||||
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
|
||||
@ -247,11 +247,18 @@ export const formSchema: FormSchema[] = [
|
||||
componentProps:{
|
||||
dictCode:"${form_field_dictCode}"
|
||||
},
|
||||
<#elseif po.classType=='list_multi' || po.classType=='checkbox'>
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7583] Vue3风格表单页面多选控件渲染成了下拉多选---------- -->
|
||||
<#elseif po.classType=='list_multi'>
|
||||
component: 'JSelectMultiple',
|
||||
componentProps:{
|
||||
dictCode:"${form_field_dictCode}"
|
||||
},
|
||||
<#elseif po.classType=='checkbox'>
|
||||
component: 'JCheckbox',
|
||||
componentProps:{
|
||||
dictCode:"${form_field_dictCode}"
|
||||
},
|
||||
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7583] Vue3风格表单页面多选控件渲染成了下拉多选---------- -->
|
||||
<#elseif po.classType=='sel_search'>
|
||||
component: 'JSearchSelect',
|
||||
componentProps:{
|
||||
@ -376,7 +383,16 @@ export const formSchema: FormSchema[] = [
|
||||
</#if>
|
||||
];
|
||||
|
||||
|
||||
<#-- update-begin-author:chenrui date:2023-12-28 for:[QQYUN-7527]vue3代码生成默认带上高级查询 -->
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
<#list columns as po>
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id'>
|
||||
${superQueryFieldListForVue3(po,po_index)},
|
||||
</#if>
|
||||
</#list>
|
||||
};
|
||||
<#-- update-end-author:chenrui date:2023-12-28 for:[QQYUN-7527]vue3代码生成默认带上高级查询 -->
|
||||
|
||||
/**
|
||||
* 流程表单调用这个方法获取formSchema
|
||||
|
||||
@ -101,6 +101,10 @@
|
||||
<Icon icon="mdi:chevron-down"></Icon>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
<!-- 高级查询 -->
|
||||
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
|
||||
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
@ -137,7 +141,7 @@
|
||||
import { ref, reactive } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns } from './${entityName}.data';
|
||||
import { columns, superQuerySchema } from './${entityName}.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './${entityName}.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import ${entityName}Modal from './components/${entityName}Modal.vue'
|
||||
@ -198,6 +202,21 @@
|
||||
sm: 20,
|
||||
});
|
||||
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
// 高级查询配置
|
||||
const superQueryConfig = reactive(superQuerySchema);
|
||||
|
||||
/**
|
||||
* 高级查询事件
|
||||
*/
|
||||
function handleSuperQuery(params) {
|
||||
Object.keys(params).map((k) => {
|
||||
queryParam[k] = params[k];
|
||||
});
|
||||
searchQuery();
|
||||
}
|
||||
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
|
||||
@ -233,11 +233,18 @@ export const formSchema: FormSchema[] = [
|
||||
componentProps:{
|
||||
dictCode: "${form_field_dictCode}"
|
||||
},
|
||||
<#elseif po.classType=='list_multi' || po.classType=='checkbox'>
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7583] Vue3风格表单页面多选控件渲染成了下拉多选---------- -->
|
||||
<#elseif po.classType=='list_multi'>
|
||||
component: 'JSelectMultiple',
|
||||
componentProps:{
|
||||
dictCode: "${form_field_dictCode}"
|
||||
},
|
||||
dictCode:"${form_field_dictCode}"
|
||||
},
|
||||
<#elseif po.classType=='checkbox'>
|
||||
component: 'JCheckbox',
|
||||
componentProps:{
|
||||
dictCode:"${form_field_dictCode}"
|
||||
},
|
||||
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7583] Vue3风格表单页面多选控件渲染成了下拉多选---------- -->
|
||||
<#elseif po.classType=='sel_search'>
|
||||
component: 'JSearchSelect',
|
||||
componentProps:{
|
||||
@ -361,3 +368,14 @@ export const formSchema: FormSchema[] = [
|
||||
},
|
||||
</#if>
|
||||
];
|
||||
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
<#list columns as po>
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id'>
|
||||
${superQueryFieldListForVue3(po,po_index)},
|
||||
</#if>
|
||||
</#list>
|
||||
};
|
||||
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
@ -43,6 +43,10 @@
|
||||
<Icon icon="ant-design:down-outlined"></Icon>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
<!-- 高级查询 -->
|
||||
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
|
||||
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
@ -78,12 +82,12 @@
|
||||
|
||||
<script lang="ts" name="${entityPackage}-${entityName?uncap_first}" setup>
|
||||
//ts语法
|
||||
import {ref, computed, unref, toRaw, nextTick} from 'vue';
|
||||
import {ref, reactive, computed, unref, toRaw, nextTick} from 'vue';
|
||||
import {BasicTable, TableAction} from '/@/components/Table';
|
||||
import {useModal} from '/@/components/Modal';
|
||||
import { useListPage } from '/@/hooks/system/useListPage'
|
||||
import ${entityName}Modal from './components/${entityName}Modal.vue';
|
||||
import {columns,searchFormSchema} from './${entityName}.data';
|
||||
import {columns, searchFormSchema, superQuerySchema} from './${entityName}.data';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import {list, delete${entityName}, batchDelete${entityName}, getExportUrl,getImportUrl, getChildList,getChildListBatch} from './${entityName}.api';
|
||||
<#if list_need_pca>
|
||||
@ -92,6 +96,7 @@
|
||||
<#if bpm_flag==true>
|
||||
import { startProcess } from '/@/api/common/api';
|
||||
</#if>
|
||||
const queryParam = reactive<any>({});
|
||||
const expandedRowKeys = ref([]);
|
||||
//字典model
|
||||
const [registerModal, {openModal}] = useModal();
|
||||
@ -102,6 +107,9 @@
|
||||
title: '${tableVo.ftlDescription}',
|
||||
columns,
|
||||
canResize:false,
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:[issue/#5658] 树表复选框与展开按钮重叠问题---------- -->
|
||||
isTreeTable: true,
|
||||
<#-- update-end---author:chenrui ---date:20231228 for:[issue/#5658] 树表复选框与展开按钮重叠问题---------- -->
|
||||
formConfig: {
|
||||
//labelWidth: 120,
|
||||
schemas: searchFormSchema,
|
||||
@ -136,10 +144,14 @@
|
||||
width: 240,
|
||||
fixed:'right'
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
return Object.assign(params, queryParam);
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name:"${tableVo.ftlDescription}",
|
||||
url: getExportUrl,
|
||||
params: queryParam,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
@ -149,6 +161,21 @@
|
||||
|
||||
const [registerTable, {reload, collapseAll, updateTableDataRecord, findTableDataRecord,getDataSource},{ rowSelection, selectedRowKeys }] = tableContext
|
||||
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
// 高级查询配置
|
||||
const superQueryConfig = reactive(superQuerySchema);
|
||||
|
||||
/**
|
||||
* 高级查询事件
|
||||
*/
|
||||
function handleSuperQuery(params) {
|
||||
Object.keys(params).map((k) => {
|
||||
queryParam[k] = params[k];
|
||||
});
|
||||
reload();
|
||||
}
|
||||
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
|
||||
@ -273,11 +273,18 @@ export const formSchema: FormSchema[] = [
|
||||
componentProps:{
|
||||
dictCode:"${form_field_dictCode}"
|
||||
},
|
||||
<#elseif po.classType=='list_multi' || po.classType=='checkbox'>
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7583] Vue3风格表单页面多选控件渲染成了下拉多选---------- -->
|
||||
<#elseif po.classType=='list_multi'>
|
||||
component: 'JSelectMultiple',
|
||||
componentProps:{
|
||||
dictCode:"${form_field_dictCode}"
|
||||
},
|
||||
<#elseif po.classType=='checkbox'>
|
||||
component: 'JCheckbox',
|
||||
componentProps:{
|
||||
dictCode:"${form_field_dictCode}"
|
||||
},
|
||||
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7583] Vue3风格表单页面多选控件渲染成了下拉多选---------- -->
|
||||
<#elseif po.classType=='sel_search'>
|
||||
component: 'JSearchSelect',
|
||||
componentProps:{
|
||||
@ -405,6 +412,17 @@ export const formSchema: FormSchema[] = [
|
||||
</#if>
|
||||
];
|
||||
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
<#list columns as po>
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id'>
|
||||
${superQueryFieldListForVue3(po,po_index)},
|
||||
</#if>
|
||||
</#list>
|
||||
};
|
||||
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
|
||||
|
||||
/**
|
||||
* 流程表单调用这个方法获取formSchema
|
||||
|
||||
@ -111,6 +111,10 @@
|
||||
<Icon icon="ant-design:down-outlined"></Icon>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
<!-- 高级查询 -->
|
||||
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
|
||||
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
@ -148,7 +152,7 @@
|
||||
import { ref, reactive, unref } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns } from './${entityName}.data';
|
||||
import { columns, superQuerySchema } from './${entityName}.data';
|
||||
import {list, delete${entityName}, batchDelete${entityName}, getExportUrl,getImportUrl, getChildList,getChildListBatch} from './${entityName}.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import ${entityName}Modal from './components/${entityName}Modal.vue'
|
||||
@ -207,6 +211,21 @@
|
||||
sm: 20,
|
||||
});
|
||||
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
// 高级查询配置
|
||||
const superQueryConfig = reactive(superQuerySchema);
|
||||
|
||||
/**
|
||||
* 高级查询事件
|
||||
*/
|
||||
function handleSuperQuery(params) {
|
||||
Object.keys(params).map((k) => {
|
||||
queryParam[k] = params[k];
|
||||
});
|
||||
reload();
|
||||
}
|
||||
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
|
||||
@ -263,11 +263,18 @@ export const formSchema: FormSchema[] = [
|
||||
componentProps:{
|
||||
dictCode: "${form_field_dictCode}"
|
||||
},
|
||||
<#elseif po.classType=='list_multi' || po.classType=='checkbox'>
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7583] Vue3风格表单页面多选控件渲染成了下拉多选---------- -->
|
||||
<#elseif po.classType=='list_multi'>
|
||||
component: 'JSelectMultiple',
|
||||
componentProps:{
|
||||
dictCode: "${form_field_dictCode}"
|
||||
dictCode:"${form_field_dictCode}"
|
||||
},
|
||||
<#elseif po.classType=='checkbox'>
|
||||
component: 'JCheckbox',
|
||||
componentProps:{
|
||||
dictCode:"${form_field_dictCode}"
|
||||
},
|
||||
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7583] Vue3风格表单页面多选控件渲染成了下拉多选---------- -->
|
||||
<#elseif po.classType=='sel_search'>
|
||||
component: 'JSearchSelect',
|
||||
componentProps:{
|
||||
@ -394,3 +401,14 @@ export const formSchema: FormSchema[] = [
|
||||
},
|
||||
</#if>
|
||||
];
|
||||
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
<#list columns as po>
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id'>
|
||||
${superQueryFieldListForVue3(po,po_index)},
|
||||
</#if>
|
||||
</#list>
|
||||
};
|
||||
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
|
||||
@ -37,6 +37,10 @@
|
||||
<Icon icon="mdi:chevron-down"></Icon>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
<!-- 高级查询 -->
|
||||
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
|
||||
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
@ -81,7 +85,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="${entityPackage}-${entityName?uncap_first}" setup>
|
||||
import {ref, computed, unref,provide} from 'vue';
|
||||
import {ref, reactive, computed, unref,provide} from 'vue';
|
||||
import {BasicTable, useTable, TableAction} from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage'
|
||||
import {useModal} from '/@/components/Modal';
|
||||
@ -90,7 +94,7 @@
|
||||
<#list subTables as sub>
|
||||
import ${sub.entityName}List from './${sub.entityName}List.vue'
|
||||
</#list>
|
||||
import {columns, searchFormSchema} from './${entityName}.data';
|
||||
import {columns, searchFormSchema, superQuerySchema} from './${entityName}.data';
|
||||
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './${entityName}.api';
|
||||
import {downloadFile} from '/@/utils/common/renderUtils';
|
||||
<#if list_need_pca>
|
||||
@ -104,6 +108,7 @@
|
||||
<#if bpm_flag==true>
|
||||
import { startProcess } from '/@/api/common/api';
|
||||
</#if>
|
||||
const queryParam = reactive<any>({});
|
||||
//注册model
|
||||
const [registerModal, {openModal}] = useModal();
|
||||
//注册table数据
|
||||
@ -145,6 +150,9 @@
|
||||
width: 120,
|
||||
fixed:'right'
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
return Object.assign(params, queryParam);
|
||||
},
|
||||
pagination:{
|
||||
current: 1,
|
||||
pageSize: 5,
|
||||
@ -154,6 +162,7 @@
|
||||
exportConfig: {
|
||||
name:"${tableVo.ftlDescription}",
|
||||
url: getExportUrl,
|
||||
params: queryParam,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
@ -166,6 +175,22 @@
|
||||
const mainId = computed(() => (unref(selectedRowKeys).length > 0 ? unref(selectedRowKeys)[0] : ''));
|
||||
//下发 mainId,子组件接收
|
||||
provide('mainId', mainId);
|
||||
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
// 高级查询配置
|
||||
const superQueryConfig = reactive(superQuerySchema);
|
||||
|
||||
/**
|
||||
* 高级查询事件
|
||||
*/
|
||||
function handleSuperQuery(params) {
|
||||
Object.keys(params).map((k) => {
|
||||
queryParam[k] = params[k];
|
||||
});
|
||||
reload();
|
||||
}
|
||||
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
|
||||
@ -240,11 +240,18 @@ export const formSchema: FormSchema[] = [
|
||||
componentProps:{
|
||||
dictCode:"${form_field_dictCode}"
|
||||
},
|
||||
<#elseif po.classType=='list_multi' || po.classType=='checkbox'>
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7583] Vue3风格表单页面多选控件渲染成了下拉多选---------- -->
|
||||
<#elseif po.classType=='list_multi'>
|
||||
component: 'JSelectMultiple',
|
||||
componentProps:{
|
||||
dictCode:"${form_field_dictCode}"
|
||||
},
|
||||
<#elseif po.classType=='checkbox'>
|
||||
component: 'JCheckbox',
|
||||
componentProps:{
|
||||
dictCode:"${form_field_dictCode}"
|
||||
},
|
||||
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7583] Vue3风格表单页面多选控件渲染成了下拉多选---------- -->
|
||||
<#elseif po.classType=='sel_search'>
|
||||
component: 'JSearchSelect',
|
||||
componentProps:{
|
||||
@ -507,11 +514,18 @@ export const ${sub.entityName?uncap_first}FormSchema: FormSchema[] = [
|
||||
componentProps:{
|
||||
dictCode:"${form_field_dictCode}"
|
||||
},
|
||||
<#elseif po.classType=='list_multi' || po.classType=='checkbox'>
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7583] Vue3风格表单页面多选控件渲染成了下拉多选---------- -->
|
||||
<#elseif po.classType=='list_multi'>
|
||||
component: 'JSelectMultiple',
|
||||
componentProps:{
|
||||
dictCode:"${form_field_dictCode}"
|
||||
},
|
||||
<#elseif po.classType=='checkbox'>
|
||||
component: 'JCheckbox',
|
||||
componentProps:{
|
||||
dictCode:"${form_field_dictCode}"
|
||||
},
|
||||
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7583] Vue3风格表单页面多选控件渲染成了下拉多选---------- -->
|
||||
<#elseif po.classType=='sel_search'>
|
||||
component: 'JSearchSelect',
|
||||
componentProps:{
|
||||
@ -627,4 +641,15 @@ export const ${sub.entityName?uncap_first}FormSchema: FormSchema[] = [
|
||||
</#if>
|
||||
</#list>
|
||||
];
|
||||
</#list>
|
||||
</#list>
|
||||
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
<#list columns as po>
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id'>
|
||||
${superQueryFieldListForVue3(po,po_index)},
|
||||
</#if>
|
||||
</#list>
|
||||
};
|
||||
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
@ -106,6 +106,10 @@
|
||||
<Icon icon="mdi:chevron-down"></Icon>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
<!-- 高级查询 -->
|
||||
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
|
||||
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
@ -154,7 +158,7 @@
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage'
|
||||
import ${entityName}Modal from './components/${entityName}Modal.vue'
|
||||
import { columns, searchFormSchema } from './${entityName}.data';
|
||||
import { columns, searchFormSchema, superQuerySchema } from './${entityName}.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl,getExportUrl } from './${entityName}.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
<#include "/common/form/native/vue3NativeImport.ftl">
|
||||
@ -173,7 +177,7 @@
|
||||
import ${sub.entityName}List from './${sub.entityName}List.vue'
|
||||
</#list>
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
|
||||
|
||||
const formRef = ref();
|
||||
const queryParam = reactive<any>({});
|
||||
const checkedKeys = ref<Array<string | number>>([]);
|
||||
@ -211,7 +215,22 @@
|
||||
const mainId = computed(() => (unref(selectedRowKeys).length > 0 ? unref(selectedRowKeys)[0] : ''));
|
||||
//下发 mainId,子组件接收
|
||||
provide('mainId', mainId);
|
||||
|
||||
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
// 高级查询配置
|
||||
const superQueryConfig = reactive(superQuerySchema);
|
||||
|
||||
/**
|
||||
* 高级查询事件
|
||||
*/
|
||||
function handleSuperQuery(params) {
|
||||
Object.keys(params).map((k) => {
|
||||
queryParam[k] = params[k];
|
||||
});
|
||||
reload();
|
||||
}
|
||||
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
|
||||
@ -240,11 +240,18 @@ export const formSchema: FormSchema[] = [
|
||||
componentProps:{
|
||||
dictCode:"${form_field_dictCode}"
|
||||
},
|
||||
<#elseif po.classType=='list_multi' || po.classType=='checkbox'>
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7583] Vue3风格表单页面多选控件渲染成了下拉多选---------- -->
|
||||
<#elseif po.classType=='list_multi'>
|
||||
component: 'JSelectMultiple',
|
||||
componentProps:{
|
||||
dictCode:"${form_field_dictCode}"
|
||||
},
|
||||
dictCode:"${form_field_dictCode}"
|
||||
},
|
||||
<#elseif po.classType=='checkbox'>
|
||||
component: 'JCheckbox',
|
||||
componentProps:{
|
||||
dictCode:"${form_field_dictCode}"
|
||||
},
|
||||
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7583] Vue3风格表单页面多选控件渲染成了下拉多选---------- -->
|
||||
<#elseif po.classType=='sel_search'>
|
||||
component: 'JSearchSelect',
|
||||
componentProps:{
|
||||
@ -507,11 +514,18 @@ export const ${sub.entityName?uncap_first}FormSchema: FormSchema[] = [
|
||||
componentProps:{
|
||||
dictCode:"${form_field_dictCode}"
|
||||
},
|
||||
<#elseif po.classType=='list_multi' || po.classType=='checkbox'>
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7583]Vue3风格表单页面多选控件渲染成了下拉多选---------- -->
|
||||
<#elseif po.classType=='list_multi'>
|
||||
component: 'JSelectMultiple',
|
||||
componentProps:{
|
||||
dictCode:"${form_field_dictCode}"
|
||||
},
|
||||
dictCode:"${form_field_dictCode}"
|
||||
},
|
||||
<#elseif po.classType=='checkbox'>
|
||||
component: 'JCheckbox',
|
||||
componentProps:{
|
||||
dictCode:"${form_field_dictCode}"
|
||||
},
|
||||
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7583]Vue3风格表单页面多选控件渲染成了下拉多选---------- -->
|
||||
<#elseif po.classType=='sel_search'>
|
||||
component: 'JSearchSelect',
|
||||
componentProps:{
|
||||
@ -627,4 +641,15 @@ export const ${sub.entityName?uncap_first}FormSchema: FormSchema[] = [
|
||||
</#if>
|
||||
</#list>
|
||||
];
|
||||
</#list>
|
||||
</#list>
|
||||
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
<#list columns as po>
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id'>
|
||||
${superQueryFieldListForVue3(po,po_index)},
|
||||
</#if>
|
||||
</#list>
|
||||
};
|
||||
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
@ -51,6 +51,10 @@
|
||||
<Icon icon="mdi:chevron-down"></Icon>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
<!-- 高级查询 -->
|
||||
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
|
||||
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
@ -85,7 +89,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="${entityPackage}-${entityName?uncap_first}" setup>
|
||||
import {ref, computed, unref} from 'vue';
|
||||
import {ref, reactive, computed, unref} from 'vue';
|
||||
import {BasicTable, useTable, TableAction} from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage'
|
||||
import {useModal} from '/@/components/Modal';
|
||||
@ -93,7 +97,7 @@
|
||||
<#list subTables as sub>
|
||||
import ${sub.entityName}SubTable from './subTables/${sub.entityName}SubTable.vue'
|
||||
</#list>
|
||||
import {columns, searchFormSchema} from './${entityName}.data';
|
||||
import {columns, searchFormSchema, superQuerySchema} from './${entityName}.data';
|
||||
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './${entityName}.api';
|
||||
import {downloadFile} from '/@/utils/common/renderUtils';
|
||||
<#if list_need_pca>
|
||||
@ -108,6 +112,7 @@
|
||||
import { startProcess } from '/@/api/common/api';
|
||||
</#if>
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
const queryParam = reactive<any>({});
|
||||
// 展开key
|
||||
const expandedRowKeys = ref<any[]>([]);
|
||||
//注册model
|
||||
@ -154,10 +159,14 @@
|
||||
width: 120,
|
||||
fixed:'right'
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
return Object.assign(params, queryParam);
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name:"${tableVo.ftlDescription}",
|
||||
url: getExportUrl,
|
||||
params: queryParam,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
@ -166,6 +175,22 @@
|
||||
})
|
||||
|
||||
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
|
||||
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
// 高级查询配置
|
||||
const superQueryConfig = reactive(superQuerySchema);
|
||||
|
||||
/**
|
||||
* 高级查询事件
|
||||
*/
|
||||
function handleSuperQuery(params) {
|
||||
Object.keys(params).map((k) => {
|
||||
queryParam[k] = params[k];
|
||||
});
|
||||
reload();
|
||||
}
|
||||
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
|
||||
/**
|
||||
* 展开事件
|
||||
* */
|
||||
|
||||
@ -243,11 +243,18 @@ export const formSchema: FormSchema[] = [
|
||||
componentProps:{
|
||||
dictCode:"${form_field_dictCode}"
|
||||
},
|
||||
<#elseif po.classType=='list_multi' || po.classType=='checkbox'>
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7583] Vue3风格表单页面多选控件渲染成了下拉多选---------- -->
|
||||
<#elseif po.classType=='list_multi'>
|
||||
component: 'JSelectMultiple',
|
||||
componentProps:{
|
||||
dictCode:"${form_field_dictCode}"
|
||||
},
|
||||
<#elseif po.classType=='checkbox'>
|
||||
component: 'JCheckbox',
|
||||
componentProps:{
|
||||
dictCode:"${form_field_dictCode}"
|
||||
},
|
||||
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7583] Vue3风格表单页面多选控件渲染成了下拉多选---------- -->
|
||||
<#elseif po.classType=='sel_search'>
|
||||
component: 'JSearchSelect',
|
||||
componentProps:{
|
||||
@ -508,11 +515,18 @@ export const ${sub.entityName?uncap_first}FormSchema: FormSchema[] = [
|
||||
componentProps:{
|
||||
dictCode:"${form_field_dictCode}"
|
||||
},
|
||||
<#elseif po.classType=='list_multi' || po.classType=='checkbox'>
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7583] Vue3风格表单页面多选控件渲染成了下拉多选---------- -->
|
||||
<#elseif po.classType=='list_multi'>
|
||||
component: 'JSelectMultiple',
|
||||
componentProps:{
|
||||
dictCode:"${form_field_dictCode}"
|
||||
},
|
||||
<#elseif po.classType=='checkbox'>
|
||||
component: 'JCheckbox',
|
||||
componentProps:{
|
||||
dictCode:"${form_field_dictCode}"
|
||||
},
|
||||
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7583] Vue3风格表单页面多选控件渲染成了下拉多选---------- -->
|
||||
<#elseif po.classType=='sel_search'>
|
||||
component: 'JSearchSelect',
|
||||
componentProps:{
|
||||
@ -794,6 +808,31 @@ export const ${sub.entityName?uncap_first}JVxeColumns: JVxeColumn[] = [
|
||||
</#if>
|
||||
</#list>
|
||||
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
<#list columns as po>
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id'>
|
||||
${superQueryFieldListForVue3(po,po_index)},
|
||||
</#if>
|
||||
</#list>
|
||||
//子表高级查询
|
||||
<#list subTables as sub>
|
||||
${sub.entityName?uncap_first}: {
|
||||
title: '${sub.ftlDescription}',
|
||||
view: 'table',
|
||||
fields: {
|
||||
<#list sub.colums as subCol>
|
||||
<#if subCol.isShowList =='Y' && subCol.fieldName !='id'>
|
||||
${superQueryFieldListForVue3(subCol,subCol_index)},
|
||||
</#if>
|
||||
</#list>
|
||||
}
|
||||
},
|
||||
</#list>
|
||||
};
|
||||
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
|
||||
/**
|
||||
* 流程表单调用这个方法获取formSchema
|
||||
* @param param
|
||||
|
||||
@ -37,6 +37,10 @@
|
||||
<Icon icon="mdi:chevron-down"></Icon>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
<!-- 高级查询 -->
|
||||
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
|
||||
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
@ -71,12 +75,12 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="${entityPackage}-${entityName?uncap_first}" setup>
|
||||
import {ref, computed, unref} from 'vue';
|
||||
import {ref, reactive, computed, unref} from 'vue';
|
||||
import {BasicTable, useTable, TableAction} from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage'
|
||||
import {useModal} from '/@/components/Modal';
|
||||
import ${entityName}Modal from './components/${entityName}Modal.vue'
|
||||
import {columns, searchFormSchema} from './${entityName}.data';
|
||||
import {columns, searchFormSchema, superQuerySchema} from './${entityName}.data';
|
||||
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './${entityName}.api';
|
||||
import {downloadFile} from '/@/utils/common/renderUtils';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
@ -91,6 +95,7 @@
|
||||
<#if bpm_flag==true>
|
||||
import { startProcess } from '/@/api/common/api';
|
||||
</#if>
|
||||
const queryParam = reactive<any>({});
|
||||
const checkedKeys = ref<Array<string | number>>([]);
|
||||
const userStore = useUserStore();
|
||||
//注册model
|
||||
@ -136,10 +141,14 @@
|
||||
width: 120,
|
||||
fixed:'right'
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
return Object.assign(params, queryParam);
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name:"${tableVo.ftlDescription}",
|
||||
url: getExportUrl,
|
||||
params: queryParam,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
@ -149,6 +158,21 @@
|
||||
|
||||
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
|
||||
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
// 高级查询配置
|
||||
const superQueryConfig = reactive(superQuerySchema);
|
||||
|
||||
/**
|
||||
* 高级查询事件
|
||||
*/
|
||||
function handleSuperQuery(params) {
|
||||
Object.keys(params).map((k) => {
|
||||
queryParam[k] = params[k];
|
||||
});
|
||||
reload();
|
||||
}
|
||||
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
|
||||
@ -243,11 +243,18 @@ export const formSchema: FormSchema[] = [
|
||||
componentProps:{
|
||||
dictCode:"${form_field_dictCode}"
|
||||
},
|
||||
<#elseif po.classType=='list_multi' || po.classType=='checkbox'>
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7583] Vue3风格表单页面多选控件渲染成了下拉多选---------- -->
|
||||
<#elseif po.classType=='list_multi'>
|
||||
component: 'JSelectMultiple',
|
||||
componentProps:{
|
||||
dictCode:"${form_field_dictCode}"
|
||||
},
|
||||
<#elseif po.classType=='checkbox'>
|
||||
component: 'JCheckbox',
|
||||
componentProps:{
|
||||
dictCode:"${form_field_dictCode}"
|
||||
},
|
||||
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7583] Vue3风格表单页面多选控件渲染成了下拉多选---------- -->
|
||||
<#elseif po.classType=='sel_search'>
|
||||
component: 'JSearchSelect',
|
||||
componentProps:{
|
||||
@ -448,11 +455,18 @@ export const ${sub.entityName?uncap_first}FormSchema: FormSchema[] = [
|
||||
componentProps:{
|
||||
dictCode:"${form_field_dictCode}"
|
||||
},
|
||||
<#elseif po.classType=='list_multi' || po.classType=='checkbox'>
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7583] Vue3风格表单页面多选控件渲染成了下拉多选---------- -->
|
||||
<#elseif po.classType=='list_multi'>
|
||||
component: 'JSelectMultiple',
|
||||
componentProps:{
|
||||
dictCode:"${form_field_dictCode}"
|
||||
}
|
||||
},
|
||||
<#elseif po.classType=='checkbox'>
|
||||
component: 'JCheckbox',
|
||||
componentProps:{
|
||||
dictCode:"${form_field_dictCode}"
|
||||
},
|
||||
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7583] Vue3风格表单页面多选控件渲染成了下拉多选---------- -->
|
||||
<#elseif po.classType=='sel_search'>
|
||||
component: 'JSearchSelect',
|
||||
componentProps:{
|
||||
@ -735,6 +749,31 @@ export const ${sub.entityName?uncap_first}Columns: JVxeColumn[] = [
|
||||
</#list>
|
||||
|
||||
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
<#list columns as po>
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id'>
|
||||
${superQueryFieldListForVue3(po,po_index)},
|
||||
</#if>
|
||||
</#list>
|
||||
//子表高级查询
|
||||
<#list subTables as sub>
|
||||
${sub.entityName?uncap_first}: {
|
||||
title: '${sub.ftlDescription}',
|
||||
view: 'table',
|
||||
fields: {
|
||||
<#list sub.colums as subCol>
|
||||
<#if subCol.isShowList =='Y' && subCol.fieldName !='id'>
|
||||
${superQueryFieldListForVue3(subCol,subCol_index)},
|
||||
</#if>
|
||||
</#list>
|
||||
}
|
||||
},
|
||||
</#list>
|
||||
};
|
||||
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
|
||||
/**
|
||||
* 流程表单调用这个方法获取formSchema
|
||||
* @param param
|
||||
|
||||
@ -105,6 +105,10 @@
|
||||
<Icon icon="mdi:chevron-down"></Icon>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
<!-- 高级查询 -->
|
||||
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
|
||||
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
@ -144,7 +148,7 @@
|
||||
import { useListPage } from '/@/hooks/system/useListPage'
|
||||
import {useModal} from '/@/components/Modal';
|
||||
import ${entityName}Modal from './components/${entityName}Modal.vue'
|
||||
import {columns, searchFormSchema} from './${entityName}.data';
|
||||
import {columns, searchFormSchema, superQuerySchema} from './${entityName}.data';
|
||||
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './${entityName}.api';
|
||||
import {downloadFile} from '/@/utils/common/renderUtils';
|
||||
<#include "/common/form/native/vue3NativeImport.ftl">
|
||||
@ -195,6 +199,21 @@
|
||||
|
||||
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
|
||||
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
// 高级查询配置
|
||||
const superQueryConfig = reactive(superQuerySchema);
|
||||
|
||||
/**
|
||||
* 高级查询事件
|
||||
*/
|
||||
function handleSuperQuery(params) {
|
||||
Object.keys(params).map((k) => {
|
||||
queryParam[k] = params[k];
|
||||
});
|
||||
reload();
|
||||
}
|
||||
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
|
||||
@ -229,11 +229,18 @@ export const formSchema: FormSchema[] = [
|
||||
componentProps:{
|
||||
dictCode:"${form_field_dictCode}"
|
||||
},
|
||||
<#elseif po.classType=='list_multi' || po.classType=='checkbox'>
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7583] Vue3风格表单页面多选控件渲染成了下拉多选---------- -->
|
||||
<#elseif po.classType=='list_multi'>
|
||||
component: 'JSelectMultiple',
|
||||
componentProps:{
|
||||
dictCode:"${form_field_dictCode}"
|
||||
},
|
||||
<#elseif po.classType=='checkbox'>
|
||||
component: 'JCheckbox',
|
||||
componentProps:{
|
||||
dictCode:"${form_field_dictCode}"
|
||||
},
|
||||
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7583] Vue3风格表单页面多选控件渲染成了下拉多选---------- -->
|
||||
<#elseif po.classType=='sel_search'>
|
||||
component: 'JSearchSelect',
|
||||
componentProps:{
|
||||
@ -425,11 +432,18 @@ export const ${sub.entityName?uncap_first}FormSchema: FormSchema[] = [
|
||||
componentProps:{
|
||||
dictCode:"${form_field_dictCode}"
|
||||
},
|
||||
<#elseif po.classType=='list_multi' || po.classType=='checkbox'>
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7583]Vue3风格表单页面多选控件渲染成了下拉多选---------- -->
|
||||
<#elseif po.classType=='list_multi'>
|
||||
component: 'JSelectMultiple',
|
||||
componentProps:{
|
||||
dictCode:"${form_field_dictCode}"
|
||||
}
|
||||
},
|
||||
<#elseif po.classType=='checkbox'>
|
||||
component: 'JCheckbox',
|
||||
componentProps:{
|
||||
dictCode:"${form_field_dictCode}"
|
||||
},
|
||||
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7583]Vue3风格表单页面多选控件渲染成了下拉多选---------- -->
|
||||
<#elseif po.classType=='sel_search'>
|
||||
component: 'JSearchSelect',
|
||||
componentProps:{
|
||||
@ -709,4 +723,29 @@ export const ${sub.entityName?uncap_first}Columns: JVxeColumn[] = [
|
||||
<#-- 循环子表的列 结束 -->
|
||||
]
|
||||
</#if>
|
||||
</#list>
|
||||
</#list>
|
||||
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
<#list columns as po>
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id'>
|
||||
${superQueryFieldListForVue3(po,po_index)},
|
||||
</#if>
|
||||
</#list>
|
||||
//子表高级查询
|
||||
<#list subTables as sub>
|
||||
${sub.entityName?uncap_first}: {
|
||||
title: '${sub.ftlDescription}',
|
||||
view: 'table',
|
||||
fields: {
|
||||
<#list sub.colums as subCol>
|
||||
<#if subCol.isShowList =='Y' && subCol.fieldName !='id'>
|
||||
${superQueryFieldListForVue3(subCol,subCol_index)},
|
||||
</#if>
|
||||
</#list>
|
||||
}
|
||||
},
|
||||
</#list>
|
||||
};
|
||||
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
@ -37,6 +37,10 @@
|
||||
<Icon icon="mdi:chevron-down"></Icon>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
<!-- 高级查询 -->
|
||||
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
|
||||
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
@ -71,12 +75,12 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="${entityPackage}-${entityName?uncap_first}" setup>
|
||||
import {ref, computed, unref} from 'vue';
|
||||
import {ref, reactive, computed, unref} from 'vue';
|
||||
import {BasicTable, useTable, TableAction} from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage'
|
||||
import {useModal} from '/@/components/Modal';
|
||||
import ${entityName}Modal from './components/${entityName}Modal.vue'
|
||||
import {columns, searchFormSchema} from './${entityName}.data';
|
||||
import {columns, searchFormSchema, superQuerySchema} from './${entityName}.data';
|
||||
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './${entityName}.api';
|
||||
import {downloadFile} from '/@/utils/common/renderUtils';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
@ -91,6 +95,7 @@
|
||||
<#if bpm_flag==true>
|
||||
import { startProcess } from '/@/api/common/api';
|
||||
</#if>
|
||||
const queryParam = reactive<any>({});
|
||||
const userStore = useUserStore();
|
||||
const checkedKeys = ref<Array<string | number>>([]);
|
||||
//注册model
|
||||
@ -136,10 +141,14 @@
|
||||
width: 120,
|
||||
fixed:'right'
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
return Object.assign(params, queryParam);
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name:"${tableVo.ftlDescription}",
|
||||
url: getExportUrl,
|
||||
params: queryParam,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
@ -149,6 +158,20 @@
|
||||
|
||||
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
|
||||
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
// 高级查询配置
|
||||
const superQueryConfig = reactive(superQuerySchema);
|
||||
|
||||
/**
|
||||
* 高级查询事件
|
||||
*/
|
||||
function handleSuperQuery(params) {
|
||||
Object.keys(params).map((k) => {
|
||||
queryParam[k] = params[k];
|
||||
});
|
||||
reload();
|
||||
}
|
||||
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
|
||||
@ -240,11 +240,18 @@ export const formSchema: FormSchema[] = [
|
||||
componentProps:{
|
||||
dictCode:"${form_field_dictCode}"
|
||||
},
|
||||
<#elseif po.classType=='list_multi' || po.classType=='checkbox'>
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7583] Vue3风格表单页面多选控件渲染成了下拉多选---------- -->
|
||||
<#elseif po.classType=='list_multi'>
|
||||
component: 'JSelectMultiple',
|
||||
componentProps:{
|
||||
dictCode:"${form_field_dictCode}"
|
||||
},
|
||||
<#elseif po.classType=='checkbox'>
|
||||
component: 'JCheckbox',
|
||||
componentProps:{
|
||||
dictCode:"${form_field_dictCode}"
|
||||
},
|
||||
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7583] Vue3风格表单页面多选控件渲染成了下拉多选---------- -->
|
||||
<#elseif po.classType=='sel_search'>
|
||||
component: 'JSearchSelect',
|
||||
componentProps:{
|
||||
@ -442,11 +449,18 @@ export const ${sub.entityName?uncap_first}FormSchema: FormSchema[] = [
|
||||
componentProps:{
|
||||
dictCode:"${form_field_dictCode}"
|
||||
},
|
||||
<#elseif po.classType=='list_multi' || po.classType=='checkbox'>
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7583] Vue3风格表单页面多选控件渲染成了下拉多选---------- -->
|
||||
<#elseif po.classType=='list_multi'>
|
||||
component: 'JSelectMultiple',
|
||||
componentProps:{
|
||||
dictCode:"${form_field_dictCode}"
|
||||
},
|
||||
<#elseif po.classType=='checkbox'>
|
||||
component: 'JCheckbox',
|
||||
componentProps:{
|
||||
dictCode:"${form_field_dictCode}"
|
||||
},
|
||||
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7583] Vue3风格表单页面多选控件渲染成了下拉多选----------- -->
|
||||
<#elseif po.classType=='sel_search'>
|
||||
component: 'JSearchSelect',
|
||||
componentProps:{
|
||||
@ -726,4 +740,29 @@ export const ${sub.entityName?uncap_first}Columns: JVxeColumn[] = [
|
||||
<#-- 循环子表的列 结束 -->
|
||||
]
|
||||
</#if>
|
||||
</#list>
|
||||
</#list>
|
||||
|
||||
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
<#list columns as po>
|
||||
<#if po.isShowList =='Y' && po.fieldName !='id'>
|
||||
${superQueryFieldListForVue3(po,po_index)},
|
||||
</#if>
|
||||
</#list>
|
||||
//子表高级查询
|
||||
<#list subTables as sub>
|
||||
${sub.entityName?uncap_first}: {
|
||||
title: '${sub.ftlDescription}',
|
||||
view: 'table',
|
||||
fields: {
|
||||
<#list sub.colums as subCol>
|
||||
<#if subCol.isShowList =='Y' && subCol.fieldName !='id'>
|
||||
${superQueryFieldListForVue3(subCol,subCol_index)},
|
||||
</#if>
|
||||
</#list>
|
||||
}
|
||||
},
|
||||
</#list>
|
||||
};
|
||||
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
||||
@ -128,8 +128,32 @@
|
||||
</#if>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
${data.msgContent!''}
|
||||
</div>
|
||||
<div id="content"></div>
|
||||
<script>
|
||||
//update-begin-author:liusq---date:2023-10-30--for: 【QQYUN-6802】查看公告详情,此段端渲染有问题
|
||||
// 获取富文本内容的容器元素
|
||||
let contentContainer = document.getElementById('content');
|
||||
|
||||
// 富文本内容
|
||||
let richText = `${data.msgContent!""}`;
|
||||
if(richText.includes("<") || richText.includes(">")){
|
||||
richText = richText.replace(/</g, '<').replace(/>/g, '>');
|
||||
}
|
||||
// 将富文本内容插入到容器中
|
||||
contentContainer.innerHTML = richText;
|
||||
// 找到所有的iframe元素
|
||||
let iframes = contentContainer.getElementsByTagName('iframe');
|
||||
|
||||
// 动态加载和渲染每个iframe
|
||||
Array.prototype.forEach.call(iframes, function(iframe) {
|
||||
iframe.onload = function() {
|
||||
// iframe加载完成后,调整它的高度以适应内容
|
||||
iframe.style.width = '100%';
|
||||
iframe.style.height = iframe.contentWindow.document.body.scrollHeight +'px';
|
||||
};
|
||||
iframe.src = iframe.getAttribute('src');
|
||||
});
|
||||
//update-end-author:liusq---date:2023-10-30--for: 【QQYUN-6802】查看公告详情,此段端渲染有问题
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@ -11,6 +11,6 @@ WORKDIR /jeecg-boot
|
||||
EXPOSE 8080
|
||||
|
||||
#ADD ./src/main/resources/jeecg ./config/jeecg
|
||||
ADD ./target/jeecg-system-start-3.6.1.jar ./
|
||||
ADD ./target/jeecg-system-start-3.6.2.jar ./
|
||||
|
||||
CMD sleep 60;java -Djava.security.egd=file:/dev/./urandom -jar jeecg-system-start-3.6.1.jar
|
||||
CMD sleep 60;java -Djava.security.egd=file:/dev/./urandom -jar jeecg-system-start-3.6.2.jar
|
||||
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>jeecg-module-system</artifactId>
|
||||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<version>3.6.1</version>
|
||||
<version>3.6.2</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@ -24,6 +24,31 @@
|
||||
<artifactId>jeecg-module-demo</artifactId>
|
||||
<version>${jeecgboot.version}</version>
|
||||
</dependency>
|
||||
<!--人大金仓
|
||||
<dependency>
|
||||
<groupId>org.jeecgframework</groupId>
|
||||
<artifactId>kingbase8</artifactId>
|
||||
<version>9.0.0</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>-->
|
||||
<!--达梦数据库 -->
|
||||
<dependency>
|
||||
<groupId>com.dameng</groupId>
|
||||
<artifactId>Dm8JdbcDriver18</artifactId>
|
||||
<version>${dm8.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.dameng</groupId>
|
||||
<artifactId>DmDialect-for-hibernate5.0</artifactId>
|
||||
<version>${dm8.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!--支持 mysql5.7、mysql8、MariaDB10.3.16-->
|
||||
<dependency>
|
||||
<groupId>org.flywaydb</groupId>
|
||||
<artifactId>flyway-core</artifactId>
|
||||
<version>7.15.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
||||
@ -4,6 +4,7 @@ import org.jeecgframework.codegenerate.window.CodeWindow;
|
||||
|
||||
/**
|
||||
* @Title: 单表代码生成器入口
|
||||
* 【 GUI模式功能弱一些,请优先使用Online代码生成 】
|
||||
* @Author 张代浩
|
||||
* @site www.jeecg.com
|
||||
* @Version:V1.0.1
|
||||
|
||||
@ -9,6 +9,8 @@ import org.jeecgframework.codegenerate.generate.pojo.onetomany.SubTableVo;
|
||||
|
||||
/**
|
||||
* 代码生成器入口【一对多】
|
||||
*
|
||||
* 【 GUI模式功能弱一些,请优先使用Online代码生成 】
|
||||
* @Author 张代浩
|
||||
* @site www.jeecg.com
|
||||
*
|
||||
|
||||
@ -25,6 +25,29 @@ management:
|
||||
include: metrics,httptrace
|
||||
|
||||
spring:
|
||||
# flyway配置
|
||||
flyway:
|
||||
# 是否启用flyway
|
||||
enabled: true
|
||||
# 编码格式,默认UTF-8
|
||||
encoding: UTF-8
|
||||
# 迁移sql脚本文件存放路径,官方默认db/migration
|
||||
locations: classpath:flyway/sql/mysql
|
||||
# 迁移sql脚本文件名称的前缀,默认V
|
||||
sql-migration-prefix: V
|
||||
# 迁移sql脚本文件名称的分隔符,默认2个下划线__
|
||||
sql-migration-separator: __
|
||||
# 避免带${}sql执行失败
|
||||
placeholder-prefix: '#('
|
||||
placeholder-suffix: )
|
||||
# 迁移sql脚本文件名称的后缀
|
||||
sql-migration-suffixes: .sql
|
||||
# 迁移时是否进行校验,默认true
|
||||
validate-on-migrate: true
|
||||
# 当迁移发现数据库非空且存在没有元数据的表时,自动执行基准迁移,新建schema_version表
|
||||
baseline-on-migrate: true
|
||||
# 是否关闭要清除已有库下的表功能,生产环境必须为true,否则会删库,非常重要!!!
|
||||
clean-disabled: true
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 10MB
|
||||
@ -250,6 +273,7 @@ cas:
|
||||
#Mybatis输出sql日志
|
||||
logging:
|
||||
level:
|
||||
org.flywaydb: debug
|
||||
org.jeecg.modules.system.mapper: info
|
||||
#swagger
|
||||
knife4j:
|
||||
|
||||
@ -25,13 +25,36 @@ management:
|
||||
include: metrics,httptrace
|
||||
|
||||
spring:
|
||||
# flyway配置
|
||||
flyway:
|
||||
# 是否启用flyway
|
||||
enabled: false
|
||||
# 编码格式,默认UTF-8
|
||||
encoding: UTF-8
|
||||
# 迁移sql脚本文件存放路径,官方默认db/migration
|
||||
locations: classpath:flyway/sql/mysql
|
||||
# 迁移sql脚本文件名称的前缀,默认V
|
||||
sql-migration-prefix: V
|
||||
# 迁移sql脚本文件名称的分隔符,默认2个下划线__
|
||||
sql-migration-separator: __
|
||||
# 避免带${}sql执行失败
|
||||
placeholder-prefix: '#('
|
||||
placeholder-suffix: )
|
||||
# 迁移sql脚本文件名称的后缀
|
||||
sql-migration-suffixes: .sql
|
||||
# 迁移时是否进行校验,默认true
|
||||
validate-on-migrate: true
|
||||
# 当迁移发现数据库非空且存在没有元数据的表时,自动执行基准迁移,新建schema_version表
|
||||
baseline-on-migrate: true
|
||||
# 是否关闭要清除已有库下的表功能,生产环境必须为true,否则会删库,非常重要!!!
|
||||
clean-disabled: true
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 10MB
|
||||
max-request-size: 10MB
|
||||
mail:
|
||||
host: smtp.163.com
|
||||
username: ??
|
||||
username: jeecgos@163.com
|
||||
password: ??
|
||||
properties:
|
||||
mail:
|
||||
@ -196,7 +219,7 @@ jeecg:
|
||||
#webapp文件路径
|
||||
webapp: /opt/jeecg-boot/webapp
|
||||
shiro:
|
||||
excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/jmreport/bigscreen2/**,/api/getUserInfo
|
||||
excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/bigscreen/category/**,/bigscreen/visual/**,/bigscreen/map/**,/jmreport/bigscreen2/**,/api/getUserInfo
|
||||
#阿里云oss存储和大鱼短信秘钥配置
|
||||
oss:
|
||||
accessKey: ??
|
||||
|
||||
@ -25,6 +25,29 @@ management:
|
||||
include: metrics,httptrace
|
||||
|
||||
spring:
|
||||
# flyway配置
|
||||
flyway:
|
||||
# 是否启用flyway
|
||||
enabled: true
|
||||
# 编码格式,默认UTF-8
|
||||
encoding: UTF-8
|
||||
# 迁移sql脚本文件存放路径,官方默认db/migration
|
||||
locations: classpath:flyway/sql/mysql
|
||||
# 迁移sql脚本文件名称的前缀,默认V
|
||||
sql-migration-prefix: V
|
||||
# 迁移sql脚本文件名称的分隔符,默认2个下划线__
|
||||
sql-migration-separator: __
|
||||
# 避免带${}sql执行失败
|
||||
placeholder-prefix: '#('
|
||||
placeholder-suffix: )
|
||||
# 迁移sql脚本文件名称的后缀
|
||||
sql-migration-suffixes: .sql
|
||||
# 迁移时是否进行校验,默认true
|
||||
validate-on-migrate: true
|
||||
# 当迁移发现数据库非空且存在没有元数据的表时,自动执行基准迁移,新建schema_version表
|
||||
baseline-on-migrate: true
|
||||
# 是否关闭要清除已有库下的表功能,生产环境必须为true,否则会删库,非常重要!!!
|
||||
clean-disabled: true
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 10MB
|
||||
@ -196,7 +219,7 @@ jeecg:
|
||||
#webapp文件路径
|
||||
webapp: D://opt//webapp
|
||||
shiro:
|
||||
excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/jmreport/bigscreen2/**
|
||||
excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/bigscreen/category/**,/bigscreen/visual/**,/bigscreen/map/**,/jmreport/bigscreen2/**
|
||||
#阿里云oss存储和大鱼短信秘钥配置
|
||||
oss:
|
||||
accessKey: ??
|
||||
@ -247,6 +270,7 @@ jeecg:
|
||||
#Mybatis输出sql日志
|
||||
logging:
|
||||
level:
|
||||
org.flywaydb: debug
|
||||
org.jeecg.modules.system.mapper: info
|
||||
#cas单点登录
|
||||
cas:
|
||||
|
||||
@ -9,6 +9,9 @@ ${AnsiColor.BRIGHT_BLUE}
|
||||
|
||||
|
||||
${AnsiColor.BRIGHT_GREEN}
|
||||
Jeecg Boot Version: 3.6.1
|
||||
Jeecg Boot Version: 3.6.2
|
||||
Spring Boot Version: ${spring-boot.version}${spring-boot.formatted-version}
|
||||
产品官网: www.jeecg.com
|
||||
版权所属: 北京国炬信息技术有限公司
|
||||
公司官网: www.guojusoft.com
|
||||
${AnsiColor.BLACK}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -44,5 +44,12 @@ public class TestStr {
|
||||
valArray.add("qwe");
|
||||
System.out.println("值: " + StringUtils.join(valArray, ","));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSql() {
|
||||
String sql = "select * from sys_user where sex = ${sex}";
|
||||
sql = sql.replaceAll("'?\\$\\{sex}'?","1");
|
||||
System.out.println(sql);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>jeecg-boot-parent</artifactId>
|
||||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<version>3.6.1</version>
|
||||
<version>3.6.2</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user