Browse Source

3.7.1版本发布

pull/7199/head
JEECG 2 months ago
parent
commit
17c68f6d53
  1. 948
      jeecg-boot/db/jeecgboot-mysql-5.7.sql
  2. 2
      jeecg-boot/jeecg-boot-base-core/pom.xml
  3. 9
      jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/constant/CommonConstant.java
  4. 33
      jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/constant/ProvinceCityArea.java
  5. 2
      jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/JeecgBootExceptionHandler.java
  6. 9
      jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/query/QueryGenerator.java
  7. 206
      jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/FileDownloadUtils.java
  8. 14
      jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/HTMLUtils.java
  9. 4
      jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/RestUtil.java
  10. 18
      jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/JeecgBaseConfig.java
  11. 9
      jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/Swagger2Config.java
  12. 1
      jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/WebMvcConfiguration.java
  13. 7
      jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroRealm.java
  14. 15
      jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/vo/BaiduApi.java
  15. 11
      jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/vo/Firewall.java
  16. 52
      jeecg-boot/jeecg-boot-base-core/src/main/resources/static/pca.json
  17. 4
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/test/service/impl/JeecgOrderMainServiceImpl.java
  18. 2
      jeecg-boot/jeecg-module-system/jeecg-system-api/jeecg-system-cloud-api/src/main/java/org/jeecg/common/system/api/ISysBaseAPI.java
  19. 2
      jeecg-boot/jeecg-module-system/jeecg-system-api/jeecg-system-cloud-api/src/main/java/org/jeecg/common/system/api/fallback/SysBaseAPIFallback.java
  20. 2
      jeecg-boot/jeecg-module-system/jeecg-system-api/jeecg-system-local-api/src/main/java/org/jeecg/common/system/api/ISysBaseAPI.java
  21. 3
      jeecg-boot/jeecg-module-system/jeecg-system-biz/pom.xml
  22. 9
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/api/controller/SystemApiController.java
  23. 7
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/quartz/controller/QuartzJobController.java
  24. 2
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/CommonController.java
  25. 11
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysAnnouncementSendController.java
  26. 10
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysDepartController.java
  27. 3
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysDepartRoleController.java
  28. 72
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysDictController.java
  29. 72
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysGatewayRouteController.java
  30. 3
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysPermissionController.java
  31. 13
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysPositionController.java
  32. 2
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysRoleController.java
  33. 19
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysTableWhiteListController.java
  34. 25
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysUserController.java
  35. 33
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/ThirdLoginController.java
  36. 8
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/entity/SysComment.java
  37. 7
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/entity/SysGatewayRoute.java
  38. 2
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/entity/SysPosition.java
  39. 2
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/SysDepartMapper.java
  40. 1
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/SysDepartRolePermissionMapper.java
  41. 1
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/SysDepartRoleUserMapper.java
  42. 14
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/SysDictMapper.java
  43. 21
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/SysGatewayRouteMapper.java
  44. 5
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/SysAnnouncementMapper.xml
  45. 4
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/SysAnnouncementSendMapper.xml
  46. 8
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/SysDepartMapper.xml
  47. 7
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/SysDepartRolePermissionMapper.xml
  48. 7
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/SysDepartRoleUserMapper.xml
  49. 24
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/SysDictMapper.xml
  50. 25
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/SysGatewayRouteMapper.xml
  51. 24
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/SysPermissionMapper.xml
  52. 15
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/SysRoleMapper.xml
  53. 7
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/SysUserDepartMapper.xml
  54. 9
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/model/AnnouncementSendModel.java
  55. 5
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/ISysDepartRoleService.java
  56. 3
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/ISysDepartService.java
  57. 17
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/ISysDictService.java
  58. 26
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/ISysGatewayRouteService.java
  59. 15
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/ISysUserService.java
  60. 4
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysBaseApiImpl.java
  61. 33
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysCommentServiceImpl.java
  62. 23
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysDepartRoleServiceImpl.java
  63. 14
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysDepartServiceImpl.java
  64. 39
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysDictServiceImpl.java
  65. 81
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysGatewayRouteServiceImpl.java
  66. 10
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysUserDepartServiceImpl.java
  67. 66
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java
  68. 12
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/ThirdAppDingtalkServiceImpl.java
  69. 32
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/common/blob.ftl
  70. 2
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/common/form/native/vue3NativeForm.ftl
  71. 6
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/common/form/native/vue3NativeSearch.ftl
  72. 4
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/common/sql/menu_insert.ftl
  73. 22
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai
  74. 5
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai
  75. 6
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/uniapp/${entityName}Form.vue
  76. 2
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/uniapp/${entityName}List.vue
  77. 12
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei
  78. 6
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Form.vuei
  79. 2
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3/${entityName}List.vuei
  80. 14
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__api.tsi
  81. 2
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__data.tsi
  82. 2
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3/components/${entityName}Form.vuei
  83. 4
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3/components/${entityName}Modal.vuei
  84. 2
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}List.vuei
  85. 14
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}__api.tsi
  86. 2
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3Native/components/${entityName}Form.vuei
  87. 2
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai
  88. 12
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei
  89. 8
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Form.vuei
  90. 2
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai
  91. 5
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai
  92. 14
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei
  93. 4
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Modal.vuei
  94. 2
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3/${entityName}List.vuei
  95. 18
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__api.tsi
  96. 2
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__data.tsi
  97. 2
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3/components/${entityName}Form.vuei
  98. 2
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}List.vuei
  99. 18
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}__api.tsi
  100. 2
      jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3Native/components/${entityName}Form.vuei
  101. Some files were not shown because too many files have changed in this diff Show More

948
jeecg-boot/db/jeecgboot-mysql-5.7.sql

File diff suppressed because one or more lines are too long

2
jeecg-boot/jeecg-boot-base-core/pom.xml

@ -149,7 +149,7 @@
<dependency>
<groupId>org.jeecgframework</groupId>
<artifactId>kingbase8</artifactId>
<version>${kingbase8.version}</version>
<version>9.0.0</version>
<scope>runtime</scope>
</dependency>
<!--达梦数据库驱动 版本号1-3-26-2023.07.26-197096-20046-ENT -->

9
jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/constant/CommonConstant.java

@ -144,7 +144,9 @@ public interface CommonConstant {
*/
String STATUS_0 = "0";
String STATUS_1 = "1";
Integer STATUS_0_INT = 0;
Integer STATUS_1_INT = 1;
/**
* 同步工作流引擎1同步0不同步
*/
@ -475,6 +477,11 @@ public interface CommonConstant {
*/
String FILE_EDITABLE = "editable";
/**
* 文件 只读
*/
String FILE_READONLY = "readonly";
/**
* 登录失败用于记录失败次数的key
*/

33
jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/constant/ProvinceCityArea.java

@ -1,6 +1,7 @@
package org.jeecg.common.constant;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.jeecg.common.util.oConvertUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
@ -22,26 +23,30 @@ public class ProvinceCityArea {
List<Area> areaList;
public String getText(String code){
this.initAreaList();
if(this.areaList!=null || this.areaList.size()>0){
List<String> ls = new ArrayList<String>();
getAreaByCode(code,ls);
return String.join("/",ls);
if(StringUtils.isNotBlank(code)){
this.initAreaList();
if(this.areaList!=null || this.areaList.size()>0){
List<String> ls = new ArrayList<String>();
getAreaByCode(code,ls);
return String.join("/",ls);
}
}
return "";
}
public String getCode(String text){
this.initAreaList();
if(areaList!=null && areaList.size()>0){
for(int i=areaList.size()-1;i>=0;i--){
//update-begin-author:taoyan date:2022-5-24 for:VUEN-1088 online 导入 省市区导入后 导入数据错乱 北京市/市辖区/西城区-->山西省/晋城市/城区
String areaText = areaList.get(i).getText();
String cityText = areaList.get(i).getAheadText();
if(text.indexOf(areaText)>=0 && (cityText!=null && text.indexOf(cityText)>=0)){
return areaList.get(i).getId();
if(StringUtils.isNotBlank(text)){
this.initAreaList();
if(areaList!=null && areaList.size()>0){
for(int i=areaList.size()-1;i>=0;i--){
//update-begin-author:taoyan date:2022-5-24 for:VUEN-1088 online 导入 省市区导入后 导入数据错乱 北京市/市辖区/西城区-->山西省/晋城市/城区
String areaText = areaList.get(i).getText();
String cityText = areaList.get(i).getAheadText();
if(text.indexOf(areaText)>=0 && (cityText!=null && text.indexOf(cityText)>=0)){
return areaList.get(i).getId();
}
//update-end-author:taoyan date:2022-5-24 for:VUEN-1088 online 导入 省市区导入后 导入数据错乱 北京市/市辖区/西城区-->山西省/晋城市/城区
}
//update-end-author:taoyan date:2022-5-24 for:VUEN-1088 online 导入 省市区导入后 导入数据错乱 北京市/市辖区/西城区-->山西省/晋城市/城区
}
}
return null;

2
jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/JeecgBootExceptionHandler.java

@ -104,7 +104,7 @@ public class JeecgBootExceptionHandler {
@ExceptionHandler({UnauthorizedException.class, AuthorizationException.class})
public Result<?> handleAuthorizationException(AuthorizationException e){
log.error(e.getMessage(), e);
return Result.noauth("没有权限,请联系管理员授权后刷新缓存!");
return Result.noauth("没有权限,请联系管理员分配权限!");
}
@ExceptionHandler(Exception.class)

9
jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/query/QueryGenerator.java

@ -746,7 +746,11 @@ public class QueryGenerator {
private static boolean judgedIsUselessField(String name) {
return "class".equals(name) || "ids".equals(name)
|| "page".equals(name) || "rows".equals(name)
|| "sort".equals(name) || "order".equals(name);
//// update-begin--author:sunjianlei date:20240808 for:【TV360X-2009】取消过滤 sort、order 字段,防止前端排序报错 ------
//// https://github.com/jeecgboot/JeecgBoot/issues/6937
// || "sort".equals(name) || "order".equals(name)
//// update-end----author:sunjianlei date:20240808 for:【TV360X-2009】取消过滤 sort、order 字段,防止前端排序报错 ------
;
}
@ -834,6 +838,9 @@ public class QueryGenerator {
public static String getSqlRuleValue(String sqlRule){
try {
Set<String> varParams = getSqlRuleParams(sqlRule);
if (varParams == null || varParams.isEmpty()) {
return sqlRule;
}
for(String var:varParams){
String tempValue = converRuleValue(var);
sqlRule = sqlRule.replace("#{"+var+"}",tempValue);

206
jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/FileDownloadUtils.java

@ -0,0 +1,206 @@
package org.jeecg.common.util;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FilenameUtils;
import org.jeecg.common.exception.JeecgBootException;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;
import java.nio.file.Files;
import java.util.List;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
/**
* @program: file
* @description: 文件下载
* @author: chenrui
* @date: 2019-05-24 16:34
**/
@Slf4j
public class FileDownloadUtils {
/**
* 单文件下载
*
* @param response
* @param storePath 下载文件储存地址
* @param fileName 文件名称
* @author: chenrui
* @date: 2019/5/24 17:10
*/
public static void downloadFile(HttpServletResponse response, String storePath, String fileName) {
response.setCharacterEncoding("UTF-8");
File file = new File(storePath);
if (!file.exists()) {
throw new NullPointerException("Specified file not found");
}
if (fileName == null || fileName.isEmpty()) {
throw new NullPointerException("The file name can not null");
}
// 配置文件下载
response.setHeader("content-type", "application/octet-stream");
response.setContentType("application/octet-stream");
// 下载文件能正常显示中文
try {
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8"));
response.setHeader("Access-Control-Expose-Headers", "Content-Disposition");
} catch (UnsupportedEncodingException e) {
log.error(e.getMessage(), e);
}
// 实现文件下载
byte[] buffer = new byte[1024];
try (FileInputStream fis = new FileInputStream(file);
BufferedInputStream bis = new BufferedInputStream(fis);) {
OutputStream os = response.getOutputStream();
int i = bis.read(buffer);
while (i != -1) {
os.write(buffer, 0, i);
i = bis.read(buffer);
}
} catch (Exception e) {
log.error(e.getMessage(), e);
}
}
/**
* 多文件下载
*
* @param filesPath 下载文件集合
* @param zipFileName 多文件合称名
* @author: chenrui
* @date: 2019/5/24 17:48
*/
public static void downloadFileMulti(HttpServletResponse response, List<String> filesPath, String zipFileName) throws IOException {
//设置压缩包的名字
String downloadName = zipFileName + ".zip";
response.setCharacterEncoding("UTF-8");
response.setHeader("content-type", "application/octet-stream");
response.setContentType("application/octet-stream");
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(downloadName, "UTF-8"));
response.setHeader("Access-Control-Expose-Headers", "Content-Disposition");
log.info("开始压缩文件:" + filesPath);
//设置压缩流:直接写入response,实现边压缩边下载
try (ZipOutputStream zipOut = new ZipOutputStream(new BufferedOutputStream(response.getOutputStream()));
DataOutputStream os = new DataOutputStream(zipOut);) {
//设置压缩方法
zipOut.setMethod(ZipOutputStream.DEFLATED);
for (String filePath : filesPath) {
//循环将文件写入压缩流
File file = new File(filePath);
if (file.exists()) {
//添加ZipEntry,并ZipEntry中写入文件流也就是将文件压入zip文件的目录下
String fileName = file.getName();
zipOut.putNextEntry(new ZipEntry(fileName));
//格式输出流文件
InputStream is = Files.newInputStream(file.toPath());
byte[] b = new byte[1024];
int length;
while ((length = is.read(b)) != -1) {
os.write(b, 0, length);
}
is.close();
zipOut.closeEntry();
}
}
} catch (IOException e) {
log.error(e.getMessage(), e);
throw new JeecgBootException(e);
}
}
/**
* 下载网络资源到磁盘
*
* @param fileUrl
* @param storePath
* @author chenrui
* @date 2024/1/19 10:09
*/
public static String download2DiskFromNet(String fileUrl, String storePath) {
try {
URL url = new URL(fileUrl);
URLConnection conn = url.openConnection();
// 设置超时间为3秒
conn.setConnectTimeout(3 * 1000);
// 防止屏蔽程序
conn.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)");
// 确保目录存在
File file = ensureDestFileDir(storePath);
try (InputStream inStream = conn.getInputStream();
FileOutputStream fs = new FileOutputStream(file);) {
int byteread;
byte[] buffer = new byte[1204];
while ((byteread = inStream.read(buffer)) != -1) {
fs.write(buffer, 0, byteread);
}
return storePath;
} catch (IOException e) {
log.error(e.getMessage(), e);
throw new JeecgBootException(e);
}
} catch (IOException e) {
log.error(e.getMessage(), e);
throw new JeecgBootException(e);
}
}
/**
* 获取不重名的文件
*
* @param file
* @return
* @author chenrui
* @date 2017年5月24日下午6:29:13
* @version v0.0.1
*/
public static File getUniqueFile(final File file) {
if (!file.exists()) {
return file;
}
File tmpFile = new File(file.getAbsolutePath());
File parentDir = tmpFile.getParentFile();
int count = 1;
String extension = FilenameUtils.getExtension(tmpFile.getName());
String baseName = FilenameUtils.getBaseName(tmpFile.getName());
do {
tmpFile = new File(parentDir, baseName + "(" + count++ + ")." + extension);
} while (tmpFile.exists());
return tmpFile;
}
/**
* 确保输出文件目录
*
* @param destFilePath
* @return
* @author: chenrui
* @date: 2019-05-21 16:49
*/
private static File ensureDestFileDir(String destFilePath) {
File destFile = new File(destFilePath);
FileDownloadUtils.checkDirAndCreate(destFile.getParentFile());
return destFile;
}
/**
* 验证文件夹存在且创建目录
*
* @param dir
* @author chenrui
* @date 2017年5月24日下午6:29:24
* @version v0.0.1
*/
public static void checkDirAndCreate(File dir) {
if (!dir.exists()) {
dir.mkdirs();
}
}
}

14
jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/HTMLUtils.java

@ -1,7 +1,9 @@
package org.jeecg.common.util;
import org.apache.commons.lang3.StringUtils;
import org.pegdown.PegDownProcessor;
import org.commonmark.node.Node;
import org.commonmark.parser.Parser;
import org.commonmark.renderer.html.HtmlRenderer;
import org.springframework.web.util.HtmlUtils;
/**
@ -36,8 +38,14 @@ public class HTMLUtils {
* @return
*/
public static String parseMarkdown(String markdownContent) {
PegDownProcessor pdp = new PegDownProcessor();
return pdp.markdownToHtml(markdownContent);
//update-begin---author:wangshuai---date:2024-06-26---for:【TV360X-1344】JDK17 邮箱发送失败,需要换写法---
/*PegDownProcessor pdp = new PegDownProcessor();
return pdp.markdownToHtml(markdownContent);*/
Parser parser = Parser.builder().build();
Node document = parser.parse(markdownContent);
HtmlRenderer renderer = HtmlRenderer.builder().build();
return renderer.render(document);
//update-end---author:wangshuai---date:2024-06-26---for:【TV360X-1344】JDK17 邮箱发送失败,需要换写法---
}
}

4
jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/RestUtil.java

@ -57,8 +57,8 @@ public class RestUtil {
static {
SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory();
requestFactory.setConnectTimeout(30000);
requestFactory.setReadTimeout(30000);
requestFactory.setConnectTimeout(3000);
requestFactory.setReadTimeout(3000);
RT = new RestTemplate(requestFactory);
// 解决乱码问题
RT.getMessageConverters().set(1, new StringHttpMessageConverter(StandardCharsets.UTF_8));

18
jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/JeecgBaseConfig.java

@ -62,8 +62,12 @@ public class JeecgBaseConfig {
* @return
*/
private WeiXinPay weiXinPay;
/**
* 百度开放API配置
*/
private BaiduApi baiduApi;
public Elasticsearch getElasticsearch() {
return elasticsearch;
}
@ -143,5 +147,13 @@ public class JeecgBaseConfig {
public void setWeiXinPay(WeiXinPay weiXinPay) {
this.weiXinPay = weiXinPay;
}
public BaiduApi getBaiduApi() {
return baiduApi;
}
public void setBaiduApi(BaiduApi baiduApi) {
this.baiduApi = baiduApi;
}
}

9
jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/Swagger2Config.java

@ -3,6 +3,7 @@ package org.jeecg.config;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.constant.CommonConstant;
import org.jeecg.config.mybatis.MybatisPlusSaasConfig;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.context.annotation.Bean;
@ -94,6 +95,14 @@ public class Swagger2Config implements WebMvcConfigurer {
List<Parameter> pars = new ArrayList<>();
tokenPar.name(CommonConstant.X_ACCESS_TOKEN).description("token").modelRef(new ModelRef("string")).parameterType("header").required(false).build();
pars.add(tokenPar.build());
//update-begin-author:liusq---date:2024-08-15--for: 开启多租户时,全局参数增加租户id
if(MybatisPlusSaasConfig.OPEN_SYSTEM_TENANT_CONTROL){
ParameterBuilder tenantPar = new ParameterBuilder();
tenantPar.name(CommonConstant.TENANT_ID).description("租户ID").modelRef(new ModelRef("string")).parameterType("header").required(false).build();
pars.add(tenantPar.build());
}
//update-end-author:liusq---date:2024-08-15--for: 开启多租户时,全局参数增加租户id
return pars;
}

1
jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/WebMvcConfiguration.java

@ -15,6 +15,7 @@ import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.boot.actuate.trace.http.InMemoryHttpTraceRepository;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

7
jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroRealm.java

@ -19,6 +19,7 @@ import org.jeecg.common.util.RedisUtil;
import org.jeecg.common.util.SpringContextUtils;
import org.jeecg.common.util.TokenUtils;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.config.mybatis.MybatisPlusSaasConfig;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;
@ -141,7 +142,7 @@ public class ShiroRealm extends AuthorizingRealm {
}
//update-begin-author:taoyan date:20210609 for:校验用户的tenant_id和前端传过来的是否一致
String userTenantIds = loginUser.getRelTenantIds();
if(oConvertUtils.isNotEmpty(userTenantIds)){
if(MybatisPlusSaasConfig.OPEN_SYSTEM_TENANT_CONTROL && oConvertUtils.isNotEmpty(userTenantIds)){
String contextTenantId = TenantContext.getTenant();
log.debug("登录租户:" + contextTenantId);
log.debug("用户拥有那些租户:" + userTenantIds);
@ -167,8 +168,8 @@ public class ShiroRealm extends AuthorizingRealm {
//*********************************************
if(!isAuthorization){
log.info("租户异常——登录租户:" + contextTenantId);
log.info("租户异常——用户拥有租户组:" + userTenantIds);
log.warn("租户异常——当前登录租户:" + contextTenantId);
log.warn("租户异常——用户拥有的租户是:" + userTenantIds);
throw new AuthenticationException("登录租户授权变更,请重新登陆!");
}
//*********************************************

15
jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/vo/BaiduApi.java

@ -0,0 +1,15 @@
package org.jeecg.config.vo;
import lombok.Data;
/**
* 百度开放api配置
*/
@Data
public class BaiduApi {
private String appId;
private String apiKey;
private String secretKey;
}

11
jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/vo/Firewall.java

@ -11,6 +11,10 @@ public class Firewall {
* 数据源安全 (开启后Online报表和图表的数据源为必填)
*/
private Boolean dataSourceSafe = false;
/**
* 是否禁止使用 * 查询所有字段
*/
private Boolean disableSelectAll = false;
/**
* 低代码模式dev:开发模式prod:发布模式关闭所有在线开发配置能力
*/
@ -36,4 +40,11 @@ public class Firewall {
this.lowCodeMode = lowCodeMode;
}
public Boolean getDisableSelectAll() {
return disableSelectAll;
}
public void setDisableSelectAll(Boolean disableSelectAll) {
this.disableSelectAll = disableSelectAll;
}
}

52
jeecg-boot/jeecg-boot-base-core/src/main/resources/static/pca.json

File diff suppressed because one or more lines are too long

4
jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/test/service/impl/JeecgOrderMainServiceImpl.java

@ -95,7 +95,7 @@ public class JeecgOrderMainServiceImpl extends ServiceImpl<JeecgOrderMainMapper,
// 当传过来的id数据库不存在时,说明数据库没有,走新增逻辑
ticket.setOrderId(jeecgOrderMain.getId());
jeecgOrderTicketMapper.insert(ticket);
break;
continue;
}
if(orderTicket.getId().equals(ticket.getId())){
// 传过来的id和数据库id一至时,说明数据库存在该数据,走更新逻辑
@ -109,7 +109,7 @@ public class JeecgOrderMainServiceImpl extends ServiceImpl<JeecgOrderMainMapper,
// 当传过来的id数据库不存在时,说明数据库没有,走新增逻辑
customer.setOrderId(jeecgOrderMain.getId());
jeecgOrderCustomerMapper.insert(customer);
break;
continue;
}
if(customers.getId().equals(customer.getId())){
//TODO 传过来的id和数据库id一至时,说明数据库存在该数据,走更新逻辑

2
jeecg-boot/jeecg-module-system/jeecg-system-api/jeecg-system-cloud-api/src/main/java/org/jeecg/common/system/api/ISysBaseAPI.java

@ -597,7 +597,7 @@ public interface ISysBaseAPI extends CommonAPI {
* @return
*/
@GetMapping("/sys/api/loadDictItemByKeyword")
List<DictModel> loadDictItemByKeyword(@RequestParam("dictCode") String dictCode, @RequestParam("keyword") String keyword, @RequestParam(value = "pageSize", required = false) Integer pageSize);
List<DictModel> loadDictItemByKeyword(@RequestParam("dictCode") String dictCode, @RequestParam("keyword") String keyword, @RequestParam(value = "pageNo", defaultValue = "1", required = false) Integer pageNo, @RequestParam(value = "pageSize", required = false) Integer pageSize);
/**
* 47 根据多个部门id(逗号分隔)查询返回多个部门信息

2
jeecg-boot/jeecg-module-system/jeecg-system-api/jeecg-system-cloud-api/src/main/java/org/jeecg/common/system/api/fallback/SysBaseAPIFallback.java

@ -382,7 +382,7 @@ public class SysBaseAPIFallback implements ISysBaseAPI {
}
@Override
public List<DictModel> loadDictItemByKeyword(String dictCode, String keyword, Integer pageSize) {
public List<DictModel> loadDictItemByKeyword(String dictCode, String keyword, Integer pageNo, Integer pageSize) {
return null;
}

2
jeecg-boot/jeecg-module-system/jeecg-system-api/jeecg-system-local-api/src/main/java/org/jeecg/common/system/api/ISysBaseAPI.java

@ -457,7 +457,7 @@ public interface ISysBaseAPI extends CommonAPI {
* @param pageSize 分页条数
* @return
*/
List<DictModel> loadDictItemByKeyword(String dictCode, String keyword, Integer pageSize);
List<DictModel> loadDictItemByKeyword(String dictCode, String keyword, Integer pageNo, Integer pageSize);
/**
* 新增数据日志

3
jeecg-boot/jeecg-module-system/jeecg-system-biz/pom.xml

@ -34,9 +34,10 @@
<groupId>org.jeecgframework.jimureport</groupId>
<artifactId>jimureport-spring-boot-starter</artifactId>
</dependency>
<!-- 积木仪表盘 -->
<dependency>
<groupId>org.jeecgframework.jimureport</groupId>
<artifactId>drag-free</artifactId>
<artifactId>jimureport-dashboard-spring-boot-starter</artifactId>
</dependency>
<!-- 积木报表 mongo redis 支持包
<dependency>

9
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/api/controller/SystemApiController.java

@ -98,7 +98,7 @@ public class SystemApiController {
try {
SensitiveInfoUtil.handlerObject(loginUser, true);
} catch (IllegalAccessException e) {
e.printStackTrace();
log.error(e.getMessage(), e);
}
return loginUser;
}
@ -666,8 +666,11 @@ public class SystemApiController {
* @return
*/
@GetMapping("/loadDictItemByKeyword")
public List<DictModel> loadDictItemByKeyword(@RequestParam("dictCode") String dictCode, @RequestParam("keyword") String keyword, @RequestParam(value = "pageSize", required = false) Integer pageSize) {
return sysBaseApi.loadDictItemByKeyword(dictCode, keyword, pageSize);
public List<DictModel> loadDictItemByKeyword(@RequestParam("dictCode") String dictCode,
@RequestParam("keyword") String keyword,
@RequestParam(value = "pageNo", defaultValue = "1", required = false) Integer pageNo,
@RequestParam(value = "pageSize", required = false) Integer pageSize) {
return sysBaseApi.loadDictItemByKeyword(dictCode, keyword,pageNo, pageSize);
}
/**

7
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/quartz/controller/QuartzJobController.java

@ -15,6 +15,7 @@ import org.jeecg.common.constant.SymbolConstant;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.ImportExcelUtil;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.quartz.entity.QuartzJob;
import org.jeecg.modules.quartz.service.IQuartzJobService;
import org.jeecgframework.poi.excel.ExcelImportUtil;
@ -206,6 +207,12 @@ public class QuartzJobController {
public ModelAndView exportXls(HttpServletRequest request, QuartzJob quartzJob) {
// Step.1 组装查询条件
QueryWrapper<QuartzJob> queryWrapper = QueryGenerator.initQueryWrapper(quartzJob, request.getParameterMap());
// 过滤选中数据
String selections = request.getParameter("selections");
if (oConvertUtils.isNotEmpty(selections)) {
List<String> selectionList = Arrays.asList(selections.split(","));
queryWrapper.in("id",selectionList);
}
// Step.2 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
List<QuartzJob> pageList = quartzJobService.list(queryWrapper);

2
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/CommonController.java

@ -51,7 +51,7 @@ public class CommonController {
*/
@GetMapping("/403")
public Result<?> noauth() {
return Result.error("没有权限,请联系管理员授权后刷新缓存!");
return Result.error("没有权限,请联系管理员分配权限!");
}
/**

11
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysAnnouncementSendController.java

@ -5,6 +5,7 @@ import java.util.Date;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.constant.CommonConstant;
@ -217,13 +218,21 @@ public class SysAnnouncementSendController {
@GetMapping(value = "/getMyAnnouncementSend")
public Result<IPage<AnnouncementSendModel>> getMyAnnouncementSend(AnnouncementSendModel announcementSendModel,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize) {
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize) {
Result<IPage<AnnouncementSendModel>> result = new Result<IPage<AnnouncementSendModel>>();
LoginUser sysUser = (LoginUser)SecurityUtils.getSubject().getPrincipal();
String userId = sysUser.getId();
announcementSendModel.setUserId(userId);
announcementSendModel.setPageNo((pageNo-1)*pageSize);
announcementSendModel.setPageSize(pageSize);
//update-begin---author:wangshuai---date:2024-06-11---for:【TV360X-545】我的消息列表不能通过时间范围查询---
if(StringUtils.isNotEmpty(announcementSendModel.getSendTimeBegin())){
announcementSendModel.setSendTimeBegin(announcementSendModel.getSendTimeBegin() + " 00:00:00");
}
if(StringUtils.isNotEmpty(announcementSendModel.getSendTimeBegin())){
announcementSendModel.setSendTimeEnd(announcementSendModel.getSendTimeEnd() + " 23:59:59");
}
//update-end---author:wangshuai---date:2024-06-11---for:【TV360X-545】我的消息列表不能通过时间范围查询---
Page<AnnouncementSendModel> pageList = new Page<AnnouncementSendModel>(pageNo,pageSize);
pageList = sysAnnouncementSendService.getMyAnnouncementSendPage(pageList, announcementSendModel);
result.setResult(pageList);

10
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysDepartController.java

@ -364,9 +364,17 @@ public class SysDepartController {
//return arg0.getOrgCode().compareTo(arg1.getOrgCode());
//}
//});
// 过滤选中数据
String selections = request.getParameter("selections");
List<String> idList = new ArrayList<>();
if (oConvertUtils.isNotEmpty(selections)) {
idList = Arrays.asList(selections.split(","));
}
//step.2 组装导出数据
Integer tenantId = sysDepart == null ? null : sysDepart.getTenantId();
List<SysDepartExportVo> sysDepartExportVos = sysDepartService.getExportDepart(tenantId);
//update-begin---author:wangshuai---date:2024-07-05---for:【TV360X-1671】部门管理不支持选中的记录导出---
List<SysDepartExportVo> sysDepartExportVos = sysDepartService.getExportDepart(tenantId,idList);
//update-end---author:wangshuai---date:2024-07-05---for:【TV360X-1671】部门管理不支持选中的记录导出---
//导出文件名称
mv.addObject(NormalExcelConstants.FILE_NAME, "部门列表");
mv.addObject(NormalExcelConstants.CLASS, SysDepartExportVo.class);

3
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysDepartRoleController.java

@ -155,7 +155,8 @@ public class SysDepartRoleController extends JeecgController<SysDepartRole, ISys
@RequiresPermissions("system:depart:role:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.sysDepartRoleService.removeByIds(Arrays.asList(ids.split(",")));
this.sysDepartRoleService.deleteDepartRole(Arrays.asList(ids.split(",")));
//this.sysDepartRoleService.removeByIds(Arrays.asList(ids.split(",")));
return Result.ok("批量删除成功!");
}

72
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysDictController.java

@ -2,11 +2,13 @@ package org.jeecg.modules.system.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.subject.Subject;
@ -19,10 +21,7 @@ import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.vo.DictModel;
import org.jeecg.common.system.vo.DictQuery;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.ImportExcelUtil;
import org.jeecg.common.util.RedisUtil;
import org.jeecg.common.util.TokenUtils;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.common.util.*;
import org.jeecg.config.mybatis.MybatisPlusSaasConfig;
import org.jeecg.config.shiro.ShiroRealm;
import org.jeecg.modules.system.entity.SysDict;
@ -78,8 +77,14 @@ public class SysDictController {
private ShiroRealm shiroRealm;
@RequestMapping(value = "/list", method = RequestMethod.GET)
public Result<IPage<SysDict>> queryPageList(SysDict sysDict,@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,HttpServletRequest req) {
public Result<IPage<SysDict>> queryPageList(
SysDict sysDict,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
// 查询关键字,模糊筛选code和name
@RequestParam(name = "keywords", required = false) String keywords,
HttpServletRequest req
) {
Result<IPage<SysDict>> result = new Result<IPage<SysDict>>();
//------------------------------------------------------------------------------------------------
//是否开启系统管理模块的多租户数据隔离【SAAS多租户模式】
@ -88,7 +93,12 @@ public class SysDictController {
}
//------------------------------------------------------------------------------------------------
QueryWrapper<SysDict> queryWrapper = QueryGenerator.initQueryWrapper(sysDict, req.getParameterMap());
Page<SysDict> page = new Page<SysDict>(pageNo, pageSize);
// 查询关键字,模糊筛选code和name
if (oConvertUtils.isNotEmpty(keywords)) {
queryWrapper.and(i -> i.like("dict_code", keywords).or().like("dict_name", keywords));
}
Page<SysDict> page = new Page<>(pageNo, pageSize);
IPage<SysDict> pageList = sysDictService.page(page, queryWrapper);
log.debug("查询当前页:"+pageList.getCurrent());
log.debug("查询当前页数量:"+pageList.getSize());
@ -202,7 +212,8 @@ public class SysDictController {
public Result<List<DictModel>> loadDict(@PathVariable("dictCode") String dictCode,
@RequestParam(name="keyword",required = false) String keyword,
@RequestParam(value = "sign",required = false) String sign,
@RequestParam(value = "pageSize", required = false) Integer pageSize) {
@RequestParam(name = "pageNo", defaultValue = "1", required = false) Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10", required = false) Integer pageSize) {
//update-begin-author:taoyan date:2023-5-22 for: /issues/4905 因为中括号(%5)的问题导致的 表单生成器字段配置时,选择关联字段,在进行高级配置时,无法加载数据库列表,提示 Sgin签名校验错误! #4905 RouteToRequestUrlFilter
if(keyword!=null && keyword.indexOf("%5")>=0){
@ -217,7 +228,7 @@ public class SysDictController {
log.info(" 加载字典表数据,加载关键字: "+ keyword);
Result<List<DictModel>> result = new Result<List<DictModel>>();
try {
List<DictModel> ls = sysDictService.loadDict(dictCode, keyword, pageSize);
List<DictModel> ls = sysDictService.loadDict(dictCode, keyword, pageNo,pageSize);
if (ls == null) {
result.error500("字典Code格式不正确!");
return result;
@ -249,12 +260,12 @@ public class SysDictController {
@RequestParam(value = "sign", required = false) String sign,
@RequestParam(value = "pageSize", required = false) Integer pageSize) {
// 首次查询查出来用户选中的值,并且不分页
Result<List<DictModel>> firstRes = this.loadDict(dictCode, keyword, sign, null);
Result<List<DictModel>> firstRes = this.loadDict(dictCode, keyword, sign,null, null);
if (!firstRes.isSuccess()) {
return firstRes;
}
// 然后再查询出第一页的数据
Result<List<DictModel>> result = this.loadDict(dictCode, "", sign, pageSize);
Result<List<DictModel>> result = this.loadDict(dictCode, "", sign,1, pageSize);
if (!result.isSuccess()) {
return result;
}
@ -666,6 +677,45 @@ public class SysDictController {
return Result.error("操作失败!");
}
}
/**
* 还原被逻辑删除的用户
*
* @param jsonObject
* @return
*/
@RequestMapping(value = "/putRecycleBin", method = RequestMethod.PUT)
public Result putRecycleBin(@RequestBody JSONObject jsonObject, HttpServletRequest request) {
try {
String ids = jsonObject.getString("ids");
if (StringUtils.isNotBlank(ids)) {
sysDictService.revertLogicDeleted(Arrays.asList(ids.split(",")));
return Result.ok("操作成功!");
}
} catch (Exception e) {
e.printStackTrace();
return Result.error("操作失败!");
}
return Result.ok("还原成功");
}
/**
* 彻底删除字典
*
* @param ids 被删除的字典ID多个id用半角逗号分割
* @return
*/
@RequiresPermissions("system:dict:deleteRecycleBin")
@RequestMapping(value = "/deleteRecycleBin", method = RequestMethod.DELETE)
public Result deleteRecycleBin(@RequestParam("ids") String ids) {
try {
if (StringUtils.isNotBlank(ids)) {
sysDictService.removeLogicDeleted(Arrays.asList(ids.split(",")));
}
return Result.ok("删除成功!");
} catch (Exception e) {
e.printStackTrace();
return Result.error("删除失败!");
}
}
/**
* VUEN-2584issue平台sql注入漏洞几个问题

72
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysGatewayRouteController.java

@ -5,8 +5,8 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.util.oConvertUtils;
@ -15,6 +15,8 @@ import org.jeecg.modules.system.service.ISysGatewayRouteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.Arrays;
import java.util.List;
/**
@ -75,4 +77,72 @@ public class SysGatewayRouteController extends JeecgController<SysGatewayRoute,
return Result.ok("删除路由成功");
}
/**
* 查询被删除的列表
* @return
*/
@RequestMapping(value = "/deleteList", method = RequestMethod.GET)
public Result<List<SysGatewayRoute>> deleteList(HttpServletRequest request) {
Result<List<SysGatewayRoute>> result = new Result<>();
List<SysGatewayRoute> list = sysGatewayRouteService.getDeletelist();
result.setSuccess(true);
result.setResult(list);
return result;
}
/**
* 还原被逻辑删除的路由
*
* @param jsonObject
* @return
*/
@RequiresPermissions("system:gateway:putRecycleBin")
@RequestMapping(value = "/putRecycleBin", method = RequestMethod.PUT)
public Result putRecycleBin(@RequestBody JSONObject jsonObject, HttpServletRequest request) {
try {
String ids = jsonObject.getString("ids");
if (StringUtils.isNotBlank(ids)) {
sysGatewayRouteService.revertLogicDeleted(Arrays.asList(ids.split(",")));
return Result.ok("操作成功!");
}
} catch (Exception e) {
e.printStackTrace();
return Result.error("操作失败!");
}
return Result.ok("还原成功");
}
/**
* 彻底删除路由
*
* @param ids 被删除的路由ID多个id用半角逗号分割
* @return
*/
@RequiresPermissions("system:gateway:deleteRecycleBin")
@RequestMapping(value = "/deleteRecycleBin", method = RequestMethod.DELETE)
public Result deleteRecycleBin(@RequestParam("ids") String ids) {
try {
if (StringUtils.isNotBlank(ids)) {
sysGatewayRouteService.deleteLogicDeleted(Arrays.asList(ids.split(",")));
}
return Result.ok("删除成功!");
} catch (Exception e) {
e.printStackTrace();
return Result.error("删除失败!");
}
}
/**
* 复制路由
*
* @param id 路由id
* @return
*/
@RequiresPermissions("system:gateway:copyRoute")
@RequestMapping(value = "/copyRoute", method = RequestMethod.GET)
public Result<SysGatewayRoute> copyRoute(@RequestParam(name = "id", required = true) String id, HttpServletRequest req) {
Result<SysGatewayRoute> result = new Result<>();
SysGatewayRoute sysGatewayRoute= sysGatewayRouteService.copyRoute(id);
result.setResult(sysGatewayRoute);
result.setSuccess(true);
return result;
}
}

3
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysPermissionController.java

@ -604,9 +604,8 @@ public class SysPermissionController {
log.info("======角色授权成功=====耗时:" + (System.currentTimeMillis() - start) + "毫秒");
//update-begin---author:scott ---date:2024-06-18 for:【TV360X-1320】分配权限必须退出重新登录才生效,造成很多用户困扰---
// 获取当前用户的Subject对象
Subject currentUser = SecurityUtils.getSubject();
// 清除当前用户的授权缓存信息
Subject currentUser = SecurityUtils.getSubject();
if (currentUser.isAuthenticated()) {
shiroRealm.clearCache(currentUser.getPrincipals());
}

13
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysPositionController.java

@ -219,26 +219,31 @@ public class SysPositionController {
* @param response
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
public ModelAndView exportXls(SysPosition sysPosition,HttpServletRequest request, HttpServletResponse response) {
// Step.1 组装查询条件
QueryWrapper<SysPosition> queryWrapper = null;
try {
String paramsStr = request.getParameter("paramsStr");
if (oConvertUtils.isNotEmpty(paramsStr)) {
String deString = URLDecoder.decode(paramsStr, "UTF-8");
SysPosition sysPosition = JSON.parseObject(deString, SysPosition.class);
sysPosition = JSON.parseObject(deString, SysPosition.class);
//------------------------------------------------------------------------------------------------
//是否开启系统管理模块的多租户数据隔离【SAAS多租户模式】
if(MybatisPlusSaasConfig.OPEN_SYSTEM_TENANT_CONTROL){
sysPosition.setTenantId(oConvertUtils.getInt(TenantContext.getTenant(),0));
}
//------------------------------------------------------------------------------------------------
queryWrapper = QueryGenerator.initQueryWrapper(sysPosition, request.getParameterMap());
}
queryWrapper = QueryGenerator.initQueryWrapper(sysPosition, request.getParameterMap());
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
//update-begin--Author:liusq Date:20240715 for:[03]职务导出,如果选择数据则只导出相关数据--------------------
String selections = request.getParameter("selections");
if(!oConvertUtils.isEmpty(selections)){
queryWrapper.in("id",selections.split(","));
}
//update-end--Author:liusq Date:20240715 for:[03]职务导出,如果选择数据则只导出相关数据----------------------
//Step.2 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
List<SysPosition> pageList = sysPositionService.list(queryWrapper);

2
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysRoleController.java

@ -220,7 +220,7 @@ public class SysRoleController {
String username = "admin";
if(getRoleCount == 0 && !username.equals(sysUser.getUsername())){
baseCommonService.addLog("未经授权,删除非本租户下的角色ID:" + id + ",操作人:" + sysUser.getUsername(), CommonConstant.LOG_TYPE_2, CommonConstant.OPERATE_TYPE_4);
return Result.error("删除角色失败,删除角色不属于登录租户!");
return Result.error("删除角色失败,当前角色不在此租户中。");
}
}

19
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysTableWhiteListController.java

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
@ -42,7 +43,8 @@ public class SysTableWhiteListController extends JeecgController<SysTableWhiteLi
* @param req
* @return
*/
@RequiresRoles("admin")
//@RequiresRoles("admin")
@RequiresPermissions("system:tableWhite:list")
@GetMapping(value = "/list")
public Result<?> queryPageList(
SysTableWhiteList sysTableWhiteList,
@ -64,7 +66,8 @@ public class SysTableWhiteListController extends JeecgController<SysTableWhiteLi
*/
@AutoLog(value = "系统表白名单-添加")
@ApiOperation(value = "系统表白名单-添加", notes = "系统表白名单-添加")
@RequiresRoles("admin")
//@RequiresRoles("admin")
@RequiresPermissions("system:tableWhite:add")
@PostMapping(value = "/add")
public Result<?> add(@RequestBody SysTableWhiteList sysTableWhiteList) {
if (sysTableWhiteListService.add(sysTableWhiteList)) {
@ -82,7 +85,8 @@ public class SysTableWhiteListController extends JeecgController<SysTableWhiteLi
*/
@AutoLog(value = "系统表白名单-编辑")
@ApiOperation(value = "系统表白名单-编辑", notes = "系统表白名单-编辑")
@RequiresRoles("admin")
//@RequiresRoles("admin")
@RequiresPermissions("system:tableWhite:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<?> edit(@RequestBody SysTableWhiteList sysTableWhiteList) {
if (sysTableWhiteListService.edit(sysTableWhiteList)) {
@ -100,7 +104,8 @@ public class SysTableWhiteListController extends JeecgController<SysTableWhiteLi
*/
@AutoLog(value = "系统表白名单-通过id删除")
@ApiOperation(value = "系统表白名单-通过id删除", notes = "系统表白名单-通过id删除")
@RequiresRoles("admin")
// @RequiresRoles("admin")
@RequiresPermissions("system:tableWhite:delete")
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name = "id") String id) {
if (sysTableWhiteListService.deleteByIds(id)) {
@ -118,7 +123,8 @@ public class SysTableWhiteListController extends JeecgController<SysTableWhiteLi
*/
@AutoLog(value = "系统表白名单-批量删除")
@ApiOperation(value = "系统表白名单-批量删除", notes = "系统表白名单-批量删除")
@RequiresRoles("admin")
// @RequiresRoles("admin")
@RequiresPermissions("system:tableWhite:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<?> deleteBatch(@RequestParam(name = "ids") String ids) {
if (sysTableWhiteListService.deleteByIds(ids)) {
@ -136,7 +142,8 @@ public class SysTableWhiteListController extends JeecgController<SysTableWhiteLi
*/
@AutoLog(value = "系统表白名单-通过id查询")
@ApiOperation(value = "系统表白名单-通过id查询", notes = "系统表白名单-通过id查询")
@RequiresRoles("admin")
// @RequiresRoles("admin")
@RequiresPermissions("system:tableWhite:queryById")
@GetMapping(value = "/queryById")
public Result<?> queryById(@RequestParam(name = "id", required = true) String id) {
SysTableWhiteList sysTableWhiteList = sysTableWhiteListService.getById(id);

25
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysUserController.java

@ -205,7 +205,8 @@ public class SysUserController {
// 修改用户走一个service 保证事务
//获取租户ids
String relTenantIds = jsonObject.getString("relTenantIds");
sysUserService.editUser(user, roles, departs, relTenantIds);
String updateFromPage = jsonObject.getString("updateFromPage");
sysUserService.editUser(user, roles, departs, relTenantIds, updateFromPage);
result.success("修改成功!");
}
} catch (Exception e) {
@ -222,7 +223,12 @@ public class SysUserController {
@RequestMapping(value = "/delete", method = RequestMethod.DELETE)
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
baseCommonService.addLog("删除用户,id: " +id ,CommonConstant.LOG_TYPE_2, 3);
List<String> userNameList = sysUserService.userIdToUsername(Arrays.asList(id));
this.sysUserService.deleteUser(id);
if (!userNameList.isEmpty()) {
String joinedString = String.join(",", userNameList);
}
return Result.ok("删除用户成功");
}
@ -233,7 +239,13 @@ public class SysUserController {
@RequestMapping(value = "/deleteBatch", method = RequestMethod.DELETE)
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
baseCommonService.addLog("批量删除用户, ids: " +ids ,CommonConstant.LOG_TYPE_2, 3);
List<String> userNameList = sysUserService.userIdToUsername(Arrays.asList(ids.split(",")));
this.sysUserService.deleteBatchUsers(ids);
// 用户变更,触发同步工作流
if (!userNameList.isEmpty()) {
String joinedString = String.join(",", userNameList);
}
return Result.ok("批量删除用户成功");
}
@ -906,6 +918,9 @@ public class SysUserController {
boolean b = sysUserDepartService.remove(queryWrapper);
if(b){
departRoleUserService.removeDeptRoleUser(Arrays.asList(userIds.split(",")),depId);
}else{
result.error500("删除失败,目标用户不在当前部门!");
return result;
}
result.success("删除成功!");
}catch(Exception e) {
@ -1261,6 +1276,12 @@ public class SysUserController {
updateUser.setUpdateBy(JwtUtil.getUserNameByToken(request));
updateUser.setUpdateTime(new Date());
sysUserService.revertLogicDeleted(Arrays.asList(userIds.split(",")), updateUser);
// 用户变更,触发同步工作流
List<String> userNameList = sysUserService.userIdToUsername(Arrays.asList(userIds.split(",")));
if (!userNameList.isEmpty()) {
String joinedString = String.join(",", userNameList);
}
}
return Result.ok("还原成功");
}
@ -1286,7 +1307,7 @@ public class SysUserController {
* @param jsonObject
* @return
*/
@RequiresRoles({"admin"})
@RequiresPermissions("system:user:app:edit")
@RequestMapping(value = "/appEdit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<SysUser> appEdit(HttpServletRequest request,@RequestBody JSONObject jsonObject) {
Result<SysUser> result = new Result<SysUser>();

33
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/ThirdLoginController.java

@ -11,12 +11,14 @@ import me.zhyd.oauth.model.AuthCallback;
import me.zhyd.oauth.model.AuthResponse;
import me.zhyd.oauth.request.AuthRequest;
import me.zhyd.oauth.utils.AuthStateUtils;
import me.zhyd.oauth.utils.StringUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.constant.enums.MessageTypeEnum;
import org.jeecg.common.system.util.JwtUtil;
import org.jeecg.common.util.*;
import org.jeecg.modules.base.service.BaseCommonService;
import org.jeecg.modules.system.entity.SysDepart;
import org.jeecg.modules.system.entity.SysThirdAccount;
import org.jeecg.modules.system.entity.SysThirdAppConfig;
import org.jeecg.modules.system.entity.SysUser;
@ -25,6 +27,7 @@ import org.jeecg.modules.system.service.ISysDictService;
import org.jeecg.modules.system.service.ISysThirdAccountService;
import org.jeecg.modules.system.service.ISysThirdAppConfigService;
import org.jeecg.modules.system.service.ISysUserService;
import org.jeecg.modules.system.service.ISysDepartService;
import org.jeecg.modules.system.service.impl.ThirdAppDingtalkServiceImpl;
import org.jeecg.modules.system.service.impl.ThirdAppWechatEnterpriseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
@ -60,6 +63,8 @@ public class ThirdLoginController {
private RedisUtil redisUtil;
@Autowired
private AuthRequestFactory factory;
@Autowired
private ISysDepartService sysDepartService;
@Autowired
private ThirdAppWechatEnterpriseServiceImpl thirdAppWechatEnterpriseService;
@ -250,8 +255,8 @@ public class ThirdLoginController {
}
//update-end-author:wangshuai date:20201118 for:如果真实姓名和头像不存在就取第三方登录的
JSONObject obj = new JSONObject();
//TODO 第三方登确定登录租户和部门逻辑
//第三方登确定登录租户和部门逻辑
this.setUserTenantAndDepart(sysUser,obj,result);
//用户登录信息
obj.put("userInfo", sysUser);
//获取字典缓存【解决 #jeecg-boot/issues/3998】
@ -528,4 +533,28 @@ public class ThirdLoginController {
return Result.error("注册失败");
}
}
/**
* 设置用户租户和部门信息
*
* @param sysUser
* @param obj
* @param result
*/
private void setUserTenantAndDepart(SysUser sysUser, JSONObject obj, Result<JSONObject> result) {
//1.设置登录租户
sysUserService.setLoginTenant(sysUser, obj, sysUser.getUsername(), result);
//2.设置登录部门
String orgCode = sysUser.getOrgCode();
//部门不为空还是用原来的部门code
if(StringUtils.isEmpty(orgCode)){
List<SysDepart> departs = sysDepartService.queryUserDeparts(sysUser.getId());
//部门不为空取第一个作为当前登录部门
if(CollectionUtil.isNotEmpty(departs)){
orgCode = departs.get(0).getOrgCode();
sysUser.setOrgCode(orgCode);
this.sysUserService.updateUserDepart(sysUser.getUsername(), orgCode,null);
}
}
}
}

8
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/entity/SysComment.java

@ -1,6 +1,7 @@
package org.jeecg.modules.system.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
@ -77,4 +78,11 @@ public class SysComment implements Serializable {
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新日期")
private Date updateTime;
/**
* 不是数据库字段用于评论跳转
*/
@TableField(exist = false)
private String tableId;
}

7
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/entity/SysGatewayRoute.java

@ -2,6 +2,7 @@ package org.jeecg.modules.system.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
@ -97,6 +98,12 @@ public class SysGatewayRoute implements Serializable {
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建日期")
private Date createTime;
/**
* 删除状态0未删除1已删除
*/
@TableLogic
private Integer delFlag;
/* *//**更新人*//*
@ApiModelProperty(value = "更新人")
private String updateBy;

2
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/entity/SysPosition.java

@ -47,7 +47,7 @@ public class SysPosition {
/**
* 职级
*/
@Excel(name = "职级", width = 15,dicCode ="position_rank")
//@Excel(name = "职级", width = 15,dicCode ="position_rank")
@ApiModelProperty(value = "职级")
@Dict(dicCode = "position_rank")
private java.lang.String postRank;

2
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/SysDepartMapper.java

@ -177,5 +177,5 @@ public interface SysDepartMapper extends BaseMapper<SysDepart> {
* @param parentId
* @return
*/
List<SysDepartExportVo> getSysDepartList(@Param("parentId") String parentId,@Param("tenantId") Integer tenantId);
List<SysDepartExportVo> getSysDepartList(@Param("parentId") String parentId,@Param("tenantId") Integer tenantId, List<String> idList);
}

1
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/SysDepartRolePermissionMapper.java

@ -14,4 +14,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface SysDepartRolePermissionMapper extends BaseMapper<SysDepartRolePermission> {
void deleteByRoleIds(@Param("ids")List<String> ids);
}

1
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/SysDepartRoleUserMapper.java

@ -14,4 +14,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface SysDepartRoleUserMapper extends BaseMapper<SysDepartRoleUser> {
void deleteByRoleIds(@Param("ids")List<String> ids);
}

14
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/SysDictMapper.java

@ -200,4 +200,18 @@ public interface SysDictMapper extends BaseMapper<SysDict> {
*/
@Select("select * from sys_dict where del_flag = 1 and tenant_id = #{tenantId}")
List<SysDict> queryDeleteListBtTenantId(@Param("tenantId") Integer tenantId);
/**
* 还原被逻辑删除的数据根据id
* @param ids
* @return
*/
int revertLogicDeleted(@Param("ids") List<String> ids);
/**
* 彻底删除的数据根据ids
* @param ids
* @return
*/
int removeLogicDeleted(@Param("ids")List<String> ids);
}

21
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/SysGatewayRouteMapper.java

@ -1,8 +1,12 @@
package org.jeecg.modules.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.system.entity.SysGatewayRoute;
import java.util.List;
/**
* @Description: gateway路由管理
* @Author: jeecg-boot
@ -10,5 +14,22 @@ import org.jeecg.modules.system.entity.SysGatewayRoute;
* @Version: V1.0
*/
public interface SysGatewayRouteMapper extends BaseMapper<SysGatewayRoute> {
/**
* 还原逻辑删除
* @param ids
*/
int revertLogicDeleted(@Param("ids") List<String> ids);
/**
*彻底删除
* @param ids
*/
int deleteLogicDeleted(@Param("ids") List<String> ids);
/**
* 查询删除的列表
* @return
*/
@Select("select * from sys_gateway_route where del_flag = 1")
List<SysGatewayRoute> queryDeleteList();
}

5
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/SysAnnouncementMapper.xml

@ -47,7 +47,10 @@
<!-- 获取用户未读消息数量 -->
<select id="getUnreadMessageCountByUserId" resultType="java.lang.Integer">
select count(1) from sys_announcement_send where user_id = #{userId} and read_flag = 0 and create_time &gt;= #{beginDate}
<!-- update by wangshuai 2024-07-02【TV360X-1682】撤销之后数量还显示,但是点开面板没有这条数据,他会一直显示有数据,需要联查判断已经发送的-->
select count(1) from sys_announcement_send sas
right join sys_announcement sa on sas.annt_id = sa.id and sa.send_status = '1'
where sas.user_id = #{userId} and sas.read_flag = 0 and sas.create_time &gt;= #{beginDate}
</select>
<!-- 查询消息记录 -->

4
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/SysAnnouncementSendMapper.xml

@ -58,6 +58,10 @@
<if test="announcementSendModel.msgCategory !=null and announcementSendModel.msgCategory != ''">
and sa.msg_category = #{announcementSendModel.msgCategory}
</if>
<if test="announcementSendModel.sendTimeBegin !=null and announcementSendModel.sendTimeBegin != ''
and announcementSendModel.sendTimeEnd != '' and announcementSendModel.sendTimeEnd != ''">
and sa.send_time between #{announcementSendModel.sendTimeBegin} and #{announcementSendModel.sendTimeEnd}
</if>
order by sas.read_flag,sa.send_time desc
</select>

8
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/SysDepartMapper.xml

@ -182,9 +182,15 @@
parent_id = #{parentId}
</when>
<otherwise>
parent_id IS NULL OR parent_id=''
(parent_id IS NULL OR parent_id='')
</otherwise>
</choose>
<if test="idList != null and !idList.isEmpty()">
and id in
<foreach item="id" index="index" collection="idList" open="(" separator="," close=")">
#{id}
</foreach>
</if>
ORDER BY depart_order DESC
</select>
</mapper>

7
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/SysDepartRolePermissionMapper.xml

@ -2,4 +2,11 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.system.mapper.SysDepartRolePermissionMapper">
<delete id="deleteByRoleIds">
DELETE FROM sys_depart_role_permission
WHERE role_id IN
<foreach collection="ids" item="roleId" open="(" close=")" separator="," >
#{roleId}
</foreach>
</delete>
</mapper>

7
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/SysDepartRoleUserMapper.xml

@ -2,4 +2,11 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.system.mapper.SysDepartRoleUserMapper">
<delete id="deleteByRoleIds">
DELETE FROM sys_depart_role_user
WHERE drole_id IN
<foreach collection="ids" item="roleId" open="(" close=")" separator="," >
#{roleId}
</foreach>
</delete>
</mapper>

24
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/SysDictMapper.xml

@ -217,5 +217,29 @@
and tenant_id = #{tenantId}
</select>
<!-- 还原被逻辑删除的字典 -->
<update id="revertLogicDeleted">
UPDATE
sys_dict
SET
del_flag = 0
WHERE
del_flag = 1
AND id IN
<foreach collection="ids" item="dictId" open="(" close=")" separator="," >
#{dictId}
</foreach>
</update>
<!-- 彻底删除字典 -->
<delete id="removeLogicDeleted">
DELETE FROM sys_dict
WHERE
del_flag = 1
AND id IN
<foreach collection="ids" item="dictId" open="(" close=")" separator="," >
#{dictId}
</foreach>
</delete>
</mapper>

25
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/SysGatewayRouteMapper.xml

@ -2,4 +2,29 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.system.mapper.SysGatewayRouteMapper">
<!-- 还原被逻辑删除的路由 -->
<update id="revertLogicDeleted">
UPDATE
sys_gateway_route
SET
del_flag = 0
WHERE
del_flag = 1
AND id IN
<foreach collection="ids" item="routeId" open="(" close=")" separator="," >
#{routeId}
</foreach>
</update>
<!-- 彻底删除路由 -->
<delete id="deleteLogicDeleted">
DELETE FROM sys_gateway_route
WHERE
del_flag = 1
AND id IN
<foreach collection="ids" item="routeId" open="(" close=")" separator="," >
#{routeId}
</foreach>
</delete>
</mapper>

24
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/SysPermissionMapper.xml

@ -181,7 +181,29 @@
<!-- 查询部门权限数据 -->
<select id="queryDepartPermissionList" parameterType="String" resultType="org.jeecg.modules.system.entity.SysPermission">
SELECT * FROM sys_permission
SELECT
id,
parent_id,
name,
url,
component,
is_route,
component_name,
redirect,
menu_type,
perms,
perms_type,
sort_no,
always_show,
icon,
is_leaf AS leaf,
keep_alive,
hidden,
hide_tab,
rule_flag,
status,
internal_or_external
FROM sys_permission
where del_flag = 0
and id in (
select permission_id from sys_depart_permission where depart_id = #{departId}

15
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/SysRoleMapper.xml

@ -10,9 +10,20 @@
AND role_name like #{bindKeyword}
</if>
<if test="role.roleCode!='' and role.roleCode!=null">
<bind name="bindRoleCode" value="'%'+role.roleCode+'%'"/>
AND role_code like #{bindRoleCode}
<choose>
<when test="role.roleCode.indexOf(',') != -1">
AND role_code in
<foreach item="item" index="index" collection="role.roleCode.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
</when>
<otherwise>
<bind name="bindRoleCode" value="'%'+role.roleCode+'%'"/>
AND role_code like #{bindRoleCode}
</otherwise>
</choose>
</if>
order by create_time desc
</select>

7
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/SysUserDepartMapper.xml

@ -23,9 +23,10 @@
<!-- 根据部门查询部门用户 分页 -->
<select id="queryDepartUserPageList" resultType="org.jeecg.modules.system.entity.SysUser">
select a.*, c.depart_name as org_code_txt from sys_user a
join sys_user_depart b on b.user_id = a.id
join sys_depart c on b.dep_id = c.id
<!-- update by wangshuai 2024-07-03【issues/6342】部门人员选择组件出现人员重复-->
select DISTINCT a.* from sys_user a
left join sys_user_depart b on b.user_id = a.id
left join sys_depart c on b.dep_id = c.id
<bind name="bindOrgCode" value="orgCode+'%'"/>
where a.del_flag = 0 and a.status = 1 and c.org_code like #{bindOrgCode} and a.username!='_reserve_user_external'
<if test="username!=null and username!=''">

9
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/model/AnnouncementSendModel.java

@ -74,4 +74,13 @@ public class AnnouncementSendModel implements Serializable {
*/
private java.lang.String msgAbstract;
/**
* 发布开始日期
*/
private java.lang.String sendTimeBegin;
/**
* 发布结束日期
*/
private java.lang.String sendTimeEnd;
}

5
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/ISysDepartRoleService.java

@ -21,4 +21,9 @@ public interface ISysDepartRoleService extends IService<SysDepartRole> {
*/
List<SysDepartRole> queryDeptRoleByDeptAndUser(String orgCode, String userId);
/**
* 删除部门角色和对应关联表信息
* @param ids
*/
void deleteDepartRole(List<String> ids);
}

3
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/ISysDepartService.java

@ -229,9 +229,10 @@ public interface ISysDepartService extends IService<SysDepart>{
/**
* 根据租户id导出部门
* @param tenantId
* @param idList
* @return
*/
List<SysDepartExportVo> getExportDepart(Integer tenantId);
List<SysDepartExportVo> getExportDepart(Integer tenantId, List<String> idList);
/**
* 导出系统部门excel

17
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/ISysDictService.java

@ -194,7 +194,7 @@ public interface ISysDictService extends IService<SysDict> {
* @return
*/
@Deprecated
public List<DictModel> queryLittleTableDictItems(String table, String text, String code, String condition, String keyword, int pageSize);
public List<DictModel> queryLittleTableDictItems(String table, String text, String code, String condition, String keyword, int pageNo, int pageSize);
/**
* 查询字典表所有数据
@ -264,10 +264,11 @@ public interface ISysDictService extends IService<SysDict> {
*
* @param dictCode 字典code格式table,text,code
* @param keyword
* @param pageNo
* @param pageSize 每页条数
* @return
*/
List<DictModel> loadDict(String dictCode, String keyword, Integer pageSize);
List<DictModel> loadDict(String dictCode, String keyword, Integer pageNo, Integer pageSize);
/**
* 根据应用id获取字典列表和详情
@ -287,4 +288,16 @@ public interface ISysDictService extends IService<SysDict> {
* @param sysDictVo
*/
void editDictByLowAppId(SysDictVo sysDictVo);
/**
* 还原逻辑删除
* @param ids
*/
boolean revertLogicDeleted(List<String> ids);
/**
* 彻底删除数据
* @param ids
*/
boolean removeLogicDeleted(List<String> ids);
}

26
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/ISysGatewayRouteService.java

@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.system.entity.SysGatewayRoute;
import java.util.List;
/**
* @Description: gateway路由管理
* @Author: jeecg-boot
@ -35,4 +37,28 @@ public interface ISysGatewayRouteService extends IService<SysGatewayRoute> {
*/
void clearRedis();
/**
* 还原逻辑删除
* @param ids
*/
void revertLogicDeleted(List<String> ids);
/**
* 彻底删除
* @param ids
*/
void deleteLogicDeleted(List<String> ids);
/**
* 复制路由
* @param id
* @return
*/
SysGatewayRoute copyRoute(String id);
/**
* 获取删除列表
* @return
*/
List<SysGatewayRoute> getDeletelist();
}

15
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/ISysUserService.java

@ -89,7 +89,7 @@ public interface ISysUserService extends IService<SysUser> {
* @param user
* @param roles
*/
public void addUserWithRole(SysUser user, String roles);
public void addUserWithRole(SysUser user,String roles);
/**
@ -97,7 +97,7 @@ public interface ISysUserService extends IService<SysUser> {
* @param user
* @param roles
*/
public void editUserWithRole(SysUser user, String roles);
public void editUserWithRole(SysUser user,String roles);
/**
* 获取用户的授权角色
@ -113,7 +113,7 @@ public interface ISysUserService extends IService<SysUser> {
* @param version 前端UI版本
* @return
*/
public SysRoleIndex getDynamicIndexByUserRole(String username, String version);
public SysRoleIndex getDynamicIndexByUserRole(String username,String version);
/**
* 查询用户信息包括 部门信息
@ -177,7 +177,7 @@ public interface ISysUserService extends IService<SysUser> {
* @param username 用户账户名称
* @return
*/
public IPage<SysUser> getUserByRoleId(Page<SysUser> page, String roleId, String username);
public IPage<SysUser> getUserByRoleId(Page<SysUser> page,String roleId, String username);
/**
* 通过用户名获取用户角色集合
@ -311,8 +311,9 @@ public interface ISysUserService extends IService<SysUser> {
* @param roles 选择的角色id多个以逗号隔开
* @param departs 选择的部门id多个以逗号隔开
* @param relTenantIds 多个租户id
* @param updateFromPage 更新来自的页面 [TV360X-1686]
*/
void editUser(SysUser user, String roles, String departs, String relTenantIds);
void editUser(SysUser user, String roles, String departs, String relTenantIds, String updateFromPage);
/**
* userId转为username
@ -355,7 +356,7 @@ public interface ISysUserService extends IService<SysUser> {
* @param sysUser
* @return
*/
Result<JSONObject> setLoginTenant(SysUser sysUser, JSONObject obj, String username, Result<JSONObject> result);
Result<JSONObject> setLoginTenant(SysUser sysUser, JSONObject obj, String username, Result<JSONObject> result);
//--- author:taoyan date:20221231 for: QQYUN-3515【应用】应用下的组织机构管理功能,细节实现 ---
/**
@ -399,7 +400,7 @@ public interface ISysUserService extends IService<SysUser> {
*/
void editTenantUser(SysUser sysUser, String tenantId, String departs, String roles);
/**
/**
* 修改用户账号状态
* @param id 账号id
* @param status 账号状态

4
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysBaseApiImpl.java

@ -1531,8 +1531,8 @@ public class SysBaseApiImpl implements ISysBaseAPI {
* @return
*/
@Override
public List<DictModel> loadDictItemByKeyword(String dictCode, String keyword, Integer pageSize) {
return sysDictService.loadDict(dictCode, keyword, pageSize);
public List<DictModel> loadDictItemByKeyword(String dictCode, String keyword, Integer pageNo, Integer pageSize) {
return sysDictService.loadDict(dictCode, keyword,pageNo, pageSize);
}
@Override

33
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysCommentServiceImpl.java

@ -276,15 +276,30 @@ public class SysCommentServiceImpl extends ServiceImpl<SysCommentMapper, SysComm
// update-begin-author:taoyan date:2023-5-10 for: QQYUN-4744【系统通知】6、系统通知@人后,对方看不到是哪个表单@的,没有超链接
String tableName = sysComment.getTableName();
String prefix = "desform:";
if(tableName!=null && tableName.startsWith(prefix)){
Map<String, Object> data = new HashMap<>();
data.put(CommonConstant.NOTICE_MSG_BUS_TYPE, "comment");
JSONObject params = new JSONObject();
params.put("code", tableName.substring(prefix.length()));
params.put("dataId", sysComment.getTableDataId());
params.put("type", "designForm");
data.put(CommonConstant.NOTICE_MSG_SUMMARY, params);
md.setData(data);
if (tableName != null) {
// 表单设计器
if (tableName.startsWith(prefix)) {
Map<String, Object> data = new HashMap<>();
data.put(CommonConstant.NOTICE_MSG_BUS_TYPE, "comment");
JSONObject params = new JSONObject();
params.put("code", tableName.substring(prefix.length()));
params.put("dataId", sysComment.getTableDataId());
params.put("type", "designForm");
data.put(CommonConstant.NOTICE_MSG_SUMMARY, params);
md.setData(data);
}
// Online表单,判断是否携带id
else if (oConvertUtils.isNotEmpty(sysComment.getTableId())) {
Map<String, Object> data = new HashMap<>();
data.put(CommonConstant.NOTICE_MSG_BUS_TYPE, "comment");
JSONObject params = new JSONObject();
params.put("code", tableName);
params.put("formId", sysComment.getTableId());
params.put("dataId", sysComment.getTableDataId());
params.put("type", "cgform");
data.put(CommonConstant.NOTICE_MSG_SUMMARY, params);
md.setData(data);
}
}
// update-end-author:taoyan date:2023-5-10 for: QQYUN-4744【系统通知】6、系统通知@人后,对方看不到是哪个表单@的,没有超链接

23
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysDepartRoleServiceImpl.java

@ -2,11 +2,16 @@ package org.jeecg.modules.system.service.impl;
import org.jeecg.modules.system.entity.SysDepartRole;
import org.jeecg.modules.system.mapper.SysDepartRoleMapper;
import org.jeecg.modules.system.mapper.SysDepartRolePermissionMapper;
import org.jeecg.modules.system.mapper.SysDepartRoleUserMapper;
import org.jeecg.modules.system.service.ISysDepartRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
/**
@ -18,8 +23,26 @@ import java.util.List;
@Service
public class SysDepartRoleServiceImpl extends ServiceImpl<SysDepartRoleMapper, SysDepartRole> implements ISysDepartRoleService {
@Autowired
SysDepartRolePermissionMapper sysDepartRolePermissionMapper;
@Autowired
SysDepartRoleUserMapper sysDepartRoleUserMapper;
@Override
public List<SysDepartRole> queryDeptRoleByDeptAndUser(String orgCode, String userId) {
return this.baseMapper.queryDeptRoleByDeptAndUser(orgCode,userId);
}
/**
* 删除部门角色和对应关联表信息
* @param ids
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void deleteDepartRole(List<String> ids) {
this.baseMapper.deleteBatchIds(ids);
this.sysDepartRolePermissionMapper.deleteByRoleIds(ids);
this.sysDepartRoleUserMapper.deleteByRoleIds(ids);
}
}

14
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysDepartServiceImpl.java

@ -1223,12 +1223,13 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
/**
* 系统部门导出
* @param tenantId
* @param idList 需要查询部门sql的id集合
* @return
*/
@Override
public List<SysDepartExportVo> getExportDepart(Integer tenantId) {
public List<SysDepartExportVo> getExportDepart(Integer tenantId, List<String> idList) {
//获取父级部门
List<SysDepartExportVo> parentDepart = departMapper.getSysDepartList("", tenantId);
List<SysDepartExportVo> parentDepart = departMapper.getSysDepartList("", tenantId, idList);
//子部门
List<SysDepartExportVo> childrenDepart = new ArrayList<>();
//把一级部门名称放在里面
@ -1245,7 +1246,7 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
List<String> path = new ArrayList<>();
path.add(sysDepart.getDepartName());
//创建子部门路径
findSysDepartPath(sysDepart, path, tenantId, childrenDepart, departIdList);
findSysDepartPath(sysDepart, path, tenantId, childrenDepart, departIdList, idList);
path.clear();
}
exportDepartVoList.addAll(childrenDepart);
@ -1353,11 +1354,12 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
* @param tenantId 租户id
* @param childrenDepart 子部门
* @param departIdList 部门id集合
* @param idList 需要查询sql的部门id集合
*/
private void findSysDepartPath(SysDepartExportVo departVo, List<String> path, Integer tenantId, List<SysDepartExportVo> childrenDepart, List<String> departIdList) {
private void findSysDepartPath(SysDepartExportVo departVo, List<String> path, Integer tenantId, List<SysDepartExportVo> childrenDepart, List<String> departIdList, List<String> idList) {
//step 1.查询子部门的数据
//获取租户id和部门父id获取的部门数据
List<SysDepartExportVo> departList = departMapper.getSysDepartList(departVo.getId(), tenantId);
List<SysDepartExportVo> departList = departMapper.getSysDepartList(departVo.getId(), tenantId, idList);
//部门为空判断
if (departList == null || departList.size() <= 0) {
//判断最后一个子部门是否已拼接
@ -1379,7 +1381,7 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
childrenDepart.add(departVo);
}
//step 3.递归查询子路径,直到找不到为止
findSysDepartPath(exportDepartVo, cPath, tenantId, childrenDepart, departIdList);
findSysDepartPath(exportDepartVo, cPath, tenantId, childrenDepart, departIdList, idList);
}
}
//========================end 系统下部门与人员导入 ==================================================================

39
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysDictServiceImpl.java

@ -23,6 +23,7 @@ import org.jeecg.common.system.vo.DictQuery;
import org.jeecg.common.util.CommonUtils;
import org.jeecg.common.util.RedisUtil;
import org.jeecg.common.util.SqlInjectionUtil;
import org.jeecg.common.util.dynamic.db.DbTypeUtils;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.config.mybatis.MybatisPlusSaasConfig;
import org.jeecg.modules.system.entity.SysDict;
@ -94,6 +95,11 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
// 4.执行SQL 查询是否存在值
try{
//update-begin---author:chenrui ---date:20240715 for:[TV360X-49]postgres日期、年月日时分秒唯一校验报错------------
if(DbTypeUtils.dbTypeIsPostgre(CommonUtils.getDatabaseTypeEnum())){
duplicateCheckVo.setFieldName("CAST("+duplicateCheckVo.getFieldName()+" as text)");
}
//update-end---author:chenrui ---date:20240715 for:[TV360X-49]postgres日期、年月日时分秒唯一校验报错------------
if (StringUtils.isNotBlank(duplicateCheckVo.getDataId())) {
// [1].编辑页面校验
count = sysDictMapper.duplicateCheckCountSql(duplicateCheckVo);
@ -503,8 +509,9 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
// }
@Override
public List<DictModel> queryLittleTableDictItems(String tableSql, String text, String code, String condition, String keyword, int pageSize) {
Page<DictModel> page = new Page<DictModel>(1, pageSize);
public List<DictModel> queryLittleTableDictItems(String tableSql, String text, String code, String condition, String keyword, int pageNo, int pageSize) {
int current = oConvertUtils.getInt(pageNo, 1);
Page<DictModel> page = new Page<DictModel>(current, pageSize);
page.setSearchCount(false);
//为了防止sql(jeecg提供了防注入的方法,可以在拼接 SQL 语句时自动对参数进行转义,避免SQL注入攻击)
@ -742,7 +749,7 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
}
@Override
public List<DictModel> loadDict(String dictCode, String keyword, Integer pageSize) {
public List<DictModel> loadDict(String dictCode, String keyword, Integer pageNo, Integer pageSize) {
// 【QQYUN-6533】表字典白名单check
sysBaseAPI.dictTableWhiteListCheckByDict(dictCode);
// 1.表字典黑名单check
@ -776,7 +783,7 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
}
List<DictModel> ls;
if (pageSize != null) {
ls = this.queryLittleTableDictItems(params[0], params[1], params[2], condition, keyword, pageSize);
ls = this.queryLittleTableDictItems(params[0], params[1], params[2], condition, keyword, pageNo,pageSize);
} else {
ls = this.queryAllTableDictItems(params[0], params[1], params[2], condition, keyword);
}
@ -833,6 +840,30 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
redisUtil.removeAll(CacheConstant.SYS_DICT_CACHE + "::" + dict.getDictCode());
}
/**
* 还原逻辑删除
* @param ids
*/
@Override
public boolean revertLogicDeleted(List<String> ids) {
return baseMapper.revertLogicDeleted(ids) > 0;
}
/**
* 彻底删除
* @param ids
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public boolean removeLogicDeleted(List<String> ids) {
// 1. 删除字典
int line = this.baseMapper.removeLogicDeleted(ids);
// 2. 删除字典选项配置
line += this.sysDictItemMapper.delete(new LambdaQueryWrapper<SysDictItem>().in(SysDictItem::getDictId, ids));
return line > 0;
}
/**
* 添加字典
* @param dictName

81
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysGatewayRouteServiceImpl.java

@ -1,6 +1,7 @@
package org.jeecg.modules.system.service.impl;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.RandomUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@ -14,14 +15,15 @@ import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.system.entity.SysGatewayRoute;
import org.jeecg.modules.system.mapper.SysGatewayRouteMapper;
import org.jeecg.modules.system.service.ISysGatewayRouteService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @Description: gateway路由管理
@ -37,7 +39,7 @@ public class SysGatewayRouteServiceImpl extends ServiceImpl<SysGatewayRouteMappe
private RedisTemplate<String, Object> redisTemplate;
private static final String STRING_STATUS = "status";
private static final SimpleDateFormat dateFormat = new SimpleDateFormat("MMdd");
@Override
public void addRoute2Redis(String key) {
List<SysGatewayRoute> ls = this.list(new LambdaQueryWrapper<SysGatewayRoute>());
@ -46,7 +48,13 @@ public class SysGatewayRouteServiceImpl extends ServiceImpl<SysGatewayRouteMappe
@Override
public void deleteById(String id) {
//1.将状态修改成禁用
SysGatewayRoute route = new SysGatewayRoute();
route.setId(id);
route.setStatus(0);
this.baseMapper.updateById(route);
this.removeById(id);
//2.刷新路由
this.resreshRouter(id);
}
@ -71,6 +79,8 @@ public class SysGatewayRouteServiceImpl extends ServiceImpl<SysGatewayRouteMappe
route.setRouterId(json.getString("routerId"));
route.setName(json.getString("name"));
route.setPredicates(json.getString("predicates"));
//初始化删除状态
route.setDelFlag(CommonConstant.DEL_FLAG_0);
String filters = json.getString("filters");
if (ObjectUtil.isEmpty(filters)) {
filters = "[]";
@ -109,5 +119,70 @@ public class SysGatewayRouteServiceImpl extends ServiceImpl<SysGatewayRouteMappe
redisTemplate.opsForValue().set(CacheConstant.GATEWAY_ROUTES, null);
}
/**
* 还原逻辑删除
* @param ids
*/
@Override
public void revertLogicDeleted(List<String> ids) {
this.baseMapper.revertLogicDeleted(ids);
resreshRouter(null);
}
/**
* 彻底删除
* @param ids
*/
@Override
public void deleteLogicDeleted(List<String> ids) {
this.baseMapper.deleteLogicDeleted(ids);
resreshRouter(ids.get(0));
}
/**
* 路由复制
* @param id
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public SysGatewayRoute copyRoute(String id) {
log.info("--gateway 路由复制--");
SysGatewayRoute targetRoute = new SysGatewayRoute();
try {
SysGatewayRoute sourceRoute = this.baseMapper.selectById(id);
//1.复制路由
BeanUtils.copyProperties(sourceRoute,targetRoute);
//1.1 获取当前日期
String formattedDate = dateFormat.format(new Date());
String copyRouteName = sourceRoute.getName() + "_copy_";
//1.2 判断数据库是否存在
Long count = this.baseMapper.selectCount(new LambdaQueryWrapper<SysGatewayRoute>().eq(SysGatewayRoute::getName, copyRouteName + formattedDate));
//1.3 新的路由名称
copyRouteName += count > 0?RandomUtil.randomNumbers(4):formattedDate;
targetRoute.setId(null);
targetRoute.setName(copyRouteName);
targetRoute.setCreateTime(new Date());
targetRoute.setStatus(0);
targetRoute.setDelFlag(CommonConstant.DEL_FLAG_0);
this.baseMapper.insert(targetRoute);
//2.刷新路由
resreshRouter(null);
} catch (Exception e) {
log.error("路由配置解析失败", e);
resreshRouter(null);
e.printStackTrace();
}
return targetRoute;
}
/**
* 查询删除列表
* @return
*/
@Override
public List<SysGatewayRoute> getDeletelist() {
return baseMapper.queryDeleteList();
}
}

10
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysUserDepartServiceImpl.java

@ -174,7 +174,15 @@ public class SysUserDepartServiceImpl extends ServiceImpl<SysUserDepartMapper, S
//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);
//update-begin---author:wangshuai ---date:2024-06-25 for:【TV360X-1482】写信,选择用户后第一次回显没翻译------------
String COMMA = ",";
if(oConvertUtils.isNotEmpty(isMultiTranslate) && id.contains(COMMA)){
String[] idArr = id.split(COMMA);
query.in(SysUser::getId, Arrays.asList(idArr));
}else {
query.eq(SysUser::getId, id);
}
//update-end---author:wangshuai ---date:2024-06-25 for:【TV360X-1482】写信,选择用户后第一次回显没翻译------------
}
//update-end---author:wangshuai ---date:20220608 for:[VUEN-1238]邮箱回复时,发送到显示的为用户id------------
//update-begin---author:wangshuai ---date:20220902 for:[VUEN-2121]临时用户不能直接显示------------

66
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java

@ -55,11 +55,9 @@ import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jetbrains.annotations.Nullable;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
@ -105,13 +103,13 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
@Autowired
private SysThirdAccountMapper sysThirdAccountMapper;
@Autowired
ThirdAppWechatEnterpriseServiceImpl wechatEnterpriseService;
ThirdAppWechatEnterpriseServiceImpl wechatEnterpriseService;
@Autowired
ThirdAppDingtalkServiceImpl dingtalkService;
ThirdAppDingtalkServiceImpl dingtalkService;
@Autowired
ISysRoleIndexService sysRoleIndexService;
ISysRoleIndexService sysRoleIndexService;
@Autowired
SysTenantMapper sysTenantMapper;
SysTenantMapper sysTenantMapper;
@Autowired
private SysUserTenantMapper relationMapper;
@Autowired
@ -122,10 +120,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
private SysPositionMapper sysPositionMapper;
@Autowired
private SystemSendMsgHandle systemSendMsgHandle;
@Autowired
private ISysThirdAccountService sysThirdAccountService;
@Autowired
private RedisUtil redisUtil;
@ -206,7 +202,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
List<String> positionList = sysUserPositionMapper.getPositionIdByUserTenantId(item.getId(),posTenantId);
//update-end---author:wangshuai---date:2023-11-15---for:【QQYUN-7028】用户职务保存后未回显---
//update-end---author:wangshuai ---date:20230228 for:[QQYUN-4354]加入更多字段:当前加入时间应该取当前租户的/职位也是当前租户下的------------
item.setPost(CommonUtils.getSplitText(positionList, SymbolConstant.COMMA));
item.setPost(CommonUtils.getSplitText(positionList,SymbolConstant.COMMA));
//update-begin---author:wangshuai---date:2023-10-08---for:【QQYUN-6668】钉钉部门和用户同步,我怎么知道哪些用户是双向绑定成功的---
//是否根据租户隔离(敲敲云用户列表专用,用于展示是否同步钉钉)
@ -269,13 +265,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
@CacheEvict(value={CacheConstant.SYS_USERS_CACHE}, allEntries=true)
@Transactional(rollbackFor = Exception.class)
public boolean deleteUser(String userId) {
//update-begin---author:wangshuai---date:2024-01-16---for:【QQYUN-7974】admin用户禁止删除---
//1.验证当前用户是管理员账号 admin
//验证用户是否为管理员
this.checkUserAdminRejectDel(userId);
//update-end---author:wangshuai---date:2024-01-16---for:【QQYUN-7974】admin用户禁止删除---
//2.删除用户
//1.删除用户
this.removeById(userId);
return false;
}
@ -284,9 +274,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
@CacheEvict(value={CacheConstant.SYS_USERS_CACHE}, allEntries=true)
@Transactional(rollbackFor = Exception.class)
public boolean deleteBatchUsers(String userIds) {
//1.验证当前用户是管理员账号 admin
this.checkUserAdminRejectDel(userIds);
//2.删除用户
//1.删除用户
this.removeByIds(Arrays.asList(userIds.split(",")));
return false;
}
@ -490,7 +478,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
* @return
*/
@Override
public IPage<SysUser> getUserByDepId(Page<SysUser> page, String departId, String username) {
public IPage<SysUser> getUserByDepId(Page<SysUser> page, String departId,String username) {
return userMapper.getUserByDepId(page, departId,username);
}
@ -533,7 +521,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
//根据部门orgCode查询部门,需要将职位id进行传递
for (SysUserSysDepartModel model:list) {
List<String> positionList = sysUserPositionMapper.getPositionIdByUserId(model.getId());
model.setPost(CommonUtils.getSplitText(positionList, SymbolConstant.COMMA));
model.setPost(CommonUtils.getSplitText(positionList,SymbolConstant.COMMA));
}
Integer total = baseMapper.getUserByOrgCodeTotal(orgCode, userParams);
@ -779,19 +767,21 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
@Override
@Transactional(rollbackFor = Exception.class)
@CacheEvict(value={CacheConstant.SYS_USERS_CACHE}, allEntries=true)
public void editUser(SysUser user, String roles, String departs, String relTenantIds) {
public void editUser(SysUser user, String roles, String departs, String relTenantIds, String updateFromPage) {
//获取用户编辑前台传过来的租户id
this.editUserTenants(user.getId(),relTenantIds);
//step.1 修改用户基础信息
this.updateById(user);
//step.2 修改角色
//处理用户角色 先删后加
sysUserRoleMapper.delete(new QueryWrapper<SysUserRole>().lambda().eq(SysUserRole::getUserId, user.getId()));
if(oConvertUtils.isNotEmpty(roles)) {
String[] arr = roles.split(",");
for (String roleId : arr) {
SysUserRole userRole = new SysUserRole(user.getId(), roleId);
sysUserRoleMapper.insert(userRole);
if (oConvertUtils.isEmpty(updateFromPage) || !"deptUsers".equalsIgnoreCase(updateFromPage)) {
// 处理用户角色 先删后加 , 如果是在部门用户页面修改用户,不处理用户角色,因为该页面无法编辑用户角色.
sysUserRoleMapper.delete(new QueryWrapper<SysUserRole>().lambda().eq(SysUserRole::getUserId, user.getId()));
if (oConvertUtils.isNotEmpty(roles)) {
String[] arr = roles.split(",");
for (String roleId : arr) {
SysUserRole userRole = new SysUserRole(user.getId(), roleId);
sysUserRoleMapper.insert(userRole);
}
}
}
@ -842,7 +832,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
}
@Override
@Cacheable(cacheNames= CacheConstant.SYS_USERS_CACHE, key="#username")
@Cacheable(cacheNames=CacheConstant.SYS_USERS_CACHE, key="#username")
@SensitiveEncode
public LoginUser getEncodeUserInfo(String username){
if(oConvertUtils.isEmpty(username)) {
@ -885,6 +875,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
@ -903,7 +894,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
* @return
*/
@Override
public Result<JSONObject> setLoginTenant(SysUser sysUser, JSONObject obj, String username, Result<JSONObject> result){
public Result<JSONObject> setLoginTenant(SysUser sysUser, JSONObject obj, String username, Result<JSONObject> result){
// update-begin--Author:sunjianlei Date:20210802 for:获取用户租户信息
//用户有哪些租户
// List<SysTenant> tenantList = null;
@ -1343,7 +1334,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
* @param orgName
* @param orgId
*/
private void getParentDepart(SysDepart depart, List<String> orgName, List<String> orgId){
private void getParentDepart(SysDepart depart,List<String> orgName,List<String> orgId){
String pid = depart.getParentId();
orgName.add(0, depart.getDepartName());
orgId.add(0, depart.getId());
@ -1471,7 +1462,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
private void userPositionId(SysUser sysUser) {
if(null != sysUser){
List<String> positionList = sysUserPositionMapper.getPositionIdByUserId(sysUser.getId());
sysUser.setPost(CommonUtils.getSplitText(positionList, SymbolConstant.COMMA));
sysUser.setPost(CommonUtils.getSplitText(positionList,SymbolConstant.COMMA));
}
}
@ -1522,7 +1513,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
* @param departChargeUsers
* @param departId
*/
private void removeDepartmentManager(List<String> departChargeUserIdList, List<SysUser> departChargeUsers, String departId){
private void removeDepartmentManager(List<String> departChargeUserIdList,List<SysUser> departChargeUsers,String departId){
//移除部门负责人
for(String chargeUserId: departChargeUserIdList){
for(SysUser chargeUser: departChargeUsers){
@ -1910,6 +1901,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
}
}
@Override
public void changePhone(JSONObject json, String username) {
String smscode = json.getString("smscode");
@ -1943,7 +1935,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
userMapper.updateById(sysUser);
}
}
/**
* 验证手机号
*
@ -1963,7 +1955,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
//验证完成之后清空手机验证码
redisUtil.removeAll(phoneKey);
}
@Override
public void sendChangePhoneSms(JSONObject jsonObject, String username, String ipAddress) {
String type = jsonObject.getString("type");
@ -2006,7 +1998,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
log.warn("--------[警告] IP地址:{}, 短信接口请求太多-------", clientIp);
throw new JeecgBootException("短信接口请求太多,请稍后再试!", CommonConstant.PHONE_SMS_FAIL_CODE);
}
//随机数
String captcha = RandomUtil.randomNumbers(6);
JSONObject obj = new JSONObject();

12
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/ThirdAppDingtalkServiceImpl.java

@ -28,6 +28,7 @@ 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.JeecgBootBizTipException;
import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.common.system.util.JwtUtil;
import org.jeecg.common.util.*;
@ -1147,6 +1148,11 @@ public class ThirdAppDingtalkServiceImpl implements IThirdAppService {
}
// 获取【钉钉】所有的部门
List<Department> departments = JdtDepartmentAPI.listAll(accessToken);
//update-begin---author:wangshuai---date:2024-06-25---for:【TV360X-1316】钉钉同步提示消息不正确---
if(departments.isEmpty()){
throw new JeecgBootBizTipException("请查看配置参数和白名单是否配置!");
}
//update-end---author:wangshuai---date:2024-06-25---for:【TV360X-1316】钉钉同步提示消息不正确---
String username = JwtUtil.getUserNameByToken(SpringContextUtils.getHttpServletRequest());
List<JdtDepartmentTreeVo> departmentTreeList = JdtDepartmentTreeVo.listToTree(departments);
int tenantId = oConvertUtils.getInt(TenantContext.getTenant(), 0);
@ -1182,7 +1188,11 @@ public class ThirdAppDingtalkServiceImpl implements IThirdAppService {
try {
userMapper.updateById(updateSysUser);
String str = String.format("用户 %s(%s) 更新成功!", updateSysUser.getRealname(), updateSysUser.getUsername());
syncInfo.addSuccessInfo(str);
//update-begin---author:wangshuai---date:2024-06-24---for:【TV360X-1317】钉钉同步 同步成功之后 重复提示---
if(!syncInfo.getSuccessInfo().contains(str)){
syncInfo.addSuccessInfo(str);
}
//update-end---author:wangshuai---date:2024-06-24---for:【TV360X-1317】钉钉同步 同步成功之后 重复提示---
} catch (Exception e) {
this.syncUserCollectErrInfo(e, user, syncInfo);
}

32
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/common/blob.ftl

@ -26,6 +26,38 @@
}
return "";
}
<#elseif po.classType=='switch'>
<#assign switch_extend_arr=['Y','N']>
<#if po.dictField?default("")?contains("[")>
<#assign switch_extend_arr=po.dictField?eval>
</#if>
<#list switch_extend_arr as a>
<#if a_index == 0>
<#assign switch_extend_arr1=a>
<#else>
<#assign switch_extend_arr2=a>
</#if>
</#list>
@Excel(name = "${po.filedComment}", width = 15,replace = {"是_${switch_extend_arr1}","否_${switch_extend_arr2}"} )
@ApiModelProperty(value = "${po.filedComment}")
private ${po.fieldType} ${po.fieldName};
<#elseif po.classType=='pca'>
@Excel(name = "${po.filedComment}", width = 15,exportConvert=true,importConvert = true )
@ApiModelProperty(value = "${po.filedComment}")
private ${po.fieldType} ${po.fieldName};
public String convertis${po.fieldName?cap_first}() {
return SpringContextUtils.getBean(ProvinceCityArea.class).getText(${po.fieldName});
}
public void convertset${po.fieldName?cap_first}(String text) {
this.${po.fieldName} = SpringContextUtils.getBean(ProvinceCityArea.class).getCode(text);
}
<#elseif po.classType=='cat_tree'>
<#assign list_field_dictCode=', dictTable = "sys_category", dicText = "name", dicCode = "id"'>
@Excel(name = "${po.filedComment}", width = 15${list_field_dictCode})
@ApiModelProperty(value = "${po.filedComment}")
private ${po.fieldType} ${po.fieldName};
<#else>
@ApiModelProperty(value = "${po.filedComment}")
<#if po.fieldDbName == 'del_flag'>

2
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/common/form/native/vue3NativeForm.ftl

@ -91,7 +91,7 @@
<j-image-upload <#if po.uploadnum??>:fileMax=${po.uploadnum}<#else>:fileMax="0"</#if> v-model:value="formData.${po.fieldName}" <#if po.readonly=='Y'>disabled</#if>></j-image-upload>
<#elseif po.classType=='umeditor'>
<#assign need_editor = true>
<j-editor v-model:value="formData.${autoStringSuffixForModel(po)}" <#if po.readonly=='Y'>disabled</#if>/>
<j-editor v-model:value="formData.${autoStringSuffixForModel(po)}" <#if po.readonly=='Y'>disabled</#if> :autoFocus="false"/>
<#elseif po.fieldDbType=='Blob'>
<a-input v-model:value="formData.${autoStringSuffixForModel(po)}" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if> allow-clear ></a-input>
<#elseif po.classType == 'sel_tree'>

6
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/common/form/native/vue3NativeSearch.ftl

@ -9,9 +9,11 @@
<#assign query_field_dictCode="">
<#if po.dictTable?default("")?trim?length gt 1>
<#assign need_select_tag = true>
<#assign need_multi = true>
<#assign query_field_dictCode="${po.dictTable},${po.dictText},${po.dictField}">
<#elseif po.dictField?default("")?trim?length gt 1>
<#assign need_select_tag = true>
<#assign need_multi = true>
<#assign query_field_dictCode="${po.dictField}">
</#if>
<#if po.queryMode=='single'>
@ -66,9 +68,9 @@
<#elseif po.classType=='list' || po.classType=='radio' || po.classType=='checkbox'>
<#-- ---------------------------下拉或是单选 判断数据字典是表字典还是普通字典------------------------------- -->
<#if po.dictTable?default("")?trim?length gt 1>
<#if query_field_no gt 1> </#if><j-dict-select-tag placeholder="请选择${po.filedComment}" v-model:value="queryParam.${po.fieldName}" dictCode="${po.dictTable},${po.dictText},${po.dictField}" allow-clear />
<#if query_field_no gt 1> </#if><j-select-multiple placeholder="请选择${po.filedComment}" v-model:value="queryParam.${po.fieldName}" dictCode="${po.dictTable},${po.dictText},${po.dictField}" allow-clear />
<#elseif po.dictField?default("")?trim?length gt 1>
<#if query_field_no gt 1> </#if><j-dict-select-tag placeholder="请选择${po.filedComment}" v-model:value="queryParam.${po.fieldName}" dictCode="${po.dictField}" allow-clear />
<#if query_field_no gt 1> </#if><j-select-multiple placeholder="请选择${po.filedComment}" v-model:value="queryParam.${po.fieldName}" dictCode="${po.dictField}" allow-clear />
<#else>
<#if query_field_no gt 1> </#if><a-input placeholder="请输入${po.filedComment}" v-model:value="queryParam.${po.fieldName}" allow-clear ></a-input>
</#if>

4
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/common/sql/menu_insert.ftl

@ -1,10 +1,10 @@
-- 注意:该页面对应的前台目录为views/${entityPackage}文件夹下
-- 注意:该页面对应的前台目录为views/${entityPackagePath}文件夹下
-- 如果你想更改到其他目录,请修改sql中component字段对应的值
<#assign id = '${.now?string["yyyyMMddhhmmSSsss"]}0'>
INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external)
VALUES ('${id}', NULL, '${tableVo.ftlDescription}', '/${entityPackage}/${entityName?uncap_first}List', '${entityPackage}/${entityName}List', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '${.now?string["yyyy-MM-dd HH:mm:ss"]}', NULL, NULL, 0);
VALUES ('${id}', NULL, '${tableVo.ftlDescription}', '/${entityPackagePath}/${entityName?uncap_first}List', '${entityPackagePath}/${entityName}List', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '${.now?string["yyyy-MM-dd HH:mm:ss"]}', NULL, NULL, 0);
-- 权限控制sql
-- 新增

22
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai

@ -1,6 +1,7 @@
package ${bussiPackage}.${entityPackage}.controller;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@ -11,6 +12,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.query.QueryRuleEnum;
import org.jeecg.common.util.oConvertUtils;
import ${bussiPackage}.${entityPackage}.entity.${entityName};
import ${bussiPackage}.${entityPackage}.service.I${entityName}Service;
@ -37,10 +39,14 @@ import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.apache.shiro.authz.annotation.RequiresPermissions;
<#assign bpm_flag=false>
<#assign has_multi_query_field=false>
<#list originalColumns as po>
<#if po.fieldDbName=='bpm_status'>
<#assign bpm_flag=true>
</#if>
<#if po.isQuery=='Y' && (po.classType=='list' || po.classType=='list_multi' || po.classType=='radio' || po.classType=='checkbox')>
<#assign has_multi_query_field=true>
</#if>
</#list>
/**
@ -51,7 +57,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
*/
@Api(tags="${tableVo.ftlDescription}")
@RestController
@RequestMapping("/${entityPackage}/${entityName?uncap_first}")
@RequestMapping("/${entityPackagePath}/${entityName?uncap_first}")
@Slf4j
public class ${entityName}Controller extends JeecgController<${entityName}, I${entityName}Service> {
@Autowired
@ -73,7 +79,19 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<${entityName}> queryWrapper = QueryGenerator.initQueryWrapper(${entityName?uncap_first}, req.getParameterMap());
<#if has_multi_query_field>
// 自定义查询规则
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
// 自定义多选的查询规则为:LIKE_WITH_OR
<#list originalColumns as po>
<#if po.isQuery=='Y' && (po.classType=='list' || po.classType=='list_multi' || po.classType=='radio' || po.classType=='checkbox')>
customeRuleMap.put("${po.fieldName}", QueryRuleEnum.LIKE_WITH_OR);
</#if>
</#list>
QueryWrapper<${entityName}> queryWrapper = QueryGenerator.initQueryWrapper(${entityName?uncap_first}, req.getParameterMap(),customeRuleMap);
<#else>
QueryWrapper<${entityName}> queryWrapper = QueryGenerator.initQueryWrapper(${entityName?uncap_first}, req.getParameterMap());
</#if>
Page<${entityName}> page = new Page<${entityName}>(pageNo, pageSize);
IPage<${entityName}> pageList = ${entityName?uncap_first}Service.page(page, queryWrapper);
return Result.OK(pageList);

5
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai

@ -9,6 +9,8 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import org.jeecg.common.constant.ProvinceCityArea;
import org.jeecg.common.util.SpringContextUtils;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
@ -34,6 +36,7 @@ public class ${entityName} implements Serializable {
private static final long serialVersionUID = 1L;
<#assign excel_ignore_arr=['createBy','createTime','updateBy','updateTime','sysOrgCode']>
<#assign excel_ignore_classType_arr=['pca','switch','cat_tree']>
<#list originalColumns as po>
<#-- 生成字典Code -->
<#assign list_field_dictCode="">
@ -69,7 +72,7 @@ public class ${entityName} implements Serializable {
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
</#if>
<#else>
<#if !excel_ignore_arr?seq_contains("${po.fieldName}")>
<#if !excel_ignore_arr?seq_contains("${po.fieldName}") && !excel_ignore_classType_arr?seq_contains("${po.classType}")>
@Excel(name = "${po.filedComment}", width = 15${list_field_dictCode})
</#if>
</#if>

6
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/uniapp/${entityName}Form.vue

@ -55,9 +55,9 @@
model: {},
backRouteName:'index',
url: {
queryById: "/${entityPackage}/${entityName?uncap_first}/queryById",
add: "/${entityPackage}/${entityName?uncap_first}/add",
edit: "/${entityPackage}/${entityName?uncap_first}/edit",
queryById: "/${entityPackagePath}/${entityName?uncap_first}/queryById",
add: "/${entityPackagePath}/${entityName?uncap_first}/add",
edit: "/${entityPackagePath}/${entityName?uncap_first}/edit",
},
}
},

2
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/uniapp/${entityName}List.vue

@ -31,7 +31,7 @@
return {
CustomBar:this.CustomBar,
NavBarColor:this.NavBarColor,
url: "/${entityPackage}/${entityName?uncap_first}/list",
url: "/${entityPackagePath}/${entityName?uncap_first}/list",
};
},
methods: {

12
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei

@ -318,11 +318,11 @@
}
],
url: {
list: "/${entityPackage}/${entityName?uncap_first}/list",
delete: "/${entityPackage}/${entityName?uncap_first}/delete",
deleteBatch: "/${entityPackage}/${entityName?uncap_first}/deleteBatch",
exportXlsUrl: "/${entityPackage}/${entityName?uncap_first}/exportXls",
importExcelUrl: "${entityPackage}/${entityName?uncap_first}/importExcel",
list: "/${entityPackagePath}/${entityName?uncap_first}/list",
delete: "/${entityPackagePath}/${entityName?uncap_first}/delete",
deleteBatch: "/${entityPackagePath}/${entityName?uncap_first}/deleteBatch",
exportXlsUrl: "/${entityPackagePath}/${entityName?uncap_first}/exportXls",
importExcelUrl: "${entityPackagePath}/${entityName?uncap_first}/importExcel",
<#if bpm_flag>startProcess: '/act/process/extActProcess/startMutilProcess'</#if>
},
<#if bpm_flag>
@ -380,7 +380,7 @@
let params = {
flowCode: this.flowCode,
id: record.id,
formUrl: '${entityPackage}/modules/${entityName}Form',
formUrl: '${entityPackagePath}/modules/${entityName}Form',
formUrlMobile: ''
}
postAction(this.url.startProcess, params).then(res=>{

6
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Form.vuei

@ -165,9 +165,9 @@
confirmLoading: false,
<#include "/common/validatorRulesTemplate/main.ftl">
url: {
add: "/${entityPackage}/${entityName?uncap_first}/add",
edit: "/${entityPackage}/${entityName?uncap_first}/edit",
queryById: "/${entityPackage}/${entityName?uncap_first}/queryById"
add: "/${entityPackagePath}/${entityName?uncap_first}/add",
edit: "/${entityPackagePath}/${entityName?uncap_first}/edit",
queryById: "/${entityPackagePath}/${entityName?uncap_first}/queryById"
}
}
},

2
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3/${entityName}List.vuei

@ -289,7 +289,7 @@
let params = {
flowCode: 'dev_${tableName}_001',
id: record.id,
formUrl: '${entityPackage}/components/${entityName}Form',
formUrl: '${entityPackagePath}/components/${entityName}Form',
formUrlMobile: ''
}
await startProcess(params);

14
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__api.tsi

@ -4,13 +4,13 @@ import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/${entityPackage}/${entityName?uncap_first}/list',
save='/${entityPackage}/${entityName?uncap_first}/add',
edit='/${entityPackage}/${entityName?uncap_first}/edit',
deleteOne = '/${entityPackage}/${entityName?uncap_first}/delete',
deleteBatch = '/${entityPackage}/${entityName?uncap_first}/deleteBatch',
importExcel = '/${entityPackage}/${entityName?uncap_first}/importExcel',
exportXls = '/${entityPackage}/${entityName?uncap_first}/exportXls',
list = '/${entityPackagePath}/${entityName?uncap_first}/list',
save='/${entityPackagePath}/${entityName?uncap_first}/add',
edit='/${entityPackagePath}/${entityName?uncap_first}/edit',
deleteOne = '/${entityPackagePath}/${entityName?uncap_first}/delete',
deleteBatch = '/${entityPackagePath}/${entityName?uncap_first}/deleteBatch',
importExcel = '/${entityPackagePath}/${entityName?uncap_first}/importExcel',
exportXls = '/${entityPackagePath}/${entityName?uncap_first}/exportXls',
}
/**
* 导出api

2
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__data.tsi

@ -181,7 +181,7 @@ export const searchFormSchema: FormSchema[] = [
},
<#elseif po.classType=='list' || po.classType=='radio' || po.classType=='checkbox'>
<#-- ---------------------------下拉或是单选 判断数据字典是表字典还是普通字典------------------------------- -->
component: 'JDictSelectTag',
component: 'JSelectMultiple',
componentProps:{
<#if po.dictTable?default("")?trim?length gt 1>
dictCode:"${po.dictTable},${po.dictText},${po.dictField}"

2
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3/components/${entityName}Form.vuei

@ -41,7 +41,7 @@
});
let formData = {};
const queryByIdUrl = '/${entityPackage}/${entityName?uncap_first}/queryById';
const queryByIdUrl = '/${entityPackagePath}/${entityName?uncap_first}/queryById';
async function initFormData(){
let params = {id: props.formData.dataId};
const data = await defHttp.get({url: queryByIdUrl, params});

4
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3/components/${entityName}Modal.vuei

@ -17,7 +17,9 @@
const isDetail = ref(false);
//表单配置
const [registerForm, { setProps,resetFields, setFieldsValue, validate, scrollToField }] = useForm({
//labelWidth: 150,
<#if tableVo.fieldRowNum == 1>
labelWidth: 150,
</#if>
schemas: formSchema,
showActionButtonGroup: false,
baseColProps: {span: ${getFormSpan(tableVo.fieldRowNum?default(1))}}

2
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}List.vuei

@ -393,7 +393,7 @@
let params = {
flowCode: 'dev_${tableName}_001',
id: record.id,
formUrl: '${entityPackage}/components/${entityName}Form',
formUrl: '${entityPackagePath}/components/${entityName}Form',
formUrlMobile: ''
}
await startProcess(params);

14
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}__api.tsi

@ -4,13 +4,13 @@ import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/${entityPackage}/${entityName?uncap_first}/list',
save='/${entityPackage}/${entityName?uncap_first}/add',
edit='/${entityPackage}/${entityName?uncap_first}/edit',
deleteOne = '/${entityPackage}/${entityName?uncap_first}/delete',
deleteBatch = '/${entityPackage}/${entityName?uncap_first}/deleteBatch',
importExcel = '/${entityPackage}/${entityName?uncap_first}/importExcel',
exportXls = '/${entityPackage}/${entityName?uncap_first}/exportXls',
list = '/${entityPackagePath}/${entityName?uncap_first}/list',
save='/${entityPackagePath}/${entityName?uncap_first}/add',
edit='/${entityPackagePath}/${entityName?uncap_first}/edit',
deleteOne = '/${entityPackagePath}/${entityName?uncap_first}/delete',
deleteBatch = '/${entityPackagePath}/${entityName?uncap_first}/deleteBatch',
importExcel = '/${entityPackagePath}/${entityName?uncap_first}/importExcel',
exportXls = '/${entityPackagePath}/${entityName?uncap_first}/exportXls',
}
/**

2
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3Native/components/${entityName}Form.vuei

@ -111,7 +111,7 @@
initFormData();
});
//渲染流程表单数据
const queryByIdUrl = '/${entityPackage}/${entityName?uncap_first}/queryById';
const queryByIdUrl = '/${entityPackagePath}/${entityName?uncap_first}/queryById';
async function initFormData(){
if(props.formBpm === true){
let params = {id: props.formData.dataId};

2
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai

@ -61,7 +61,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
*/
@Api(tags="${tableVo.ftlDescription}")
@RestController
@RequestMapping("/${entityPackage}/${entityName?uncap_first}")
@RequestMapping("/${entityPackagePath}/${entityName?uncap_first}")
@Slf4j
public class ${entityName}Controller {
@Autowired

12
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei

@ -310,11 +310,11 @@
}
],
url: {
list: "/${entityPackage}/${entityName?uncap_first}/list",
delete: "/${entityPackage}/${entityName?uncap_first}/delete",
deleteBatch: "/${entityPackage}/${entityName?uncap_first}/deleteBatch",
exportXlsUrl: "/${entityPackage}/${entityName?uncap_first}/exportXls",
importExcelUrl: "${entityPackage}/${entityName?uncap_first}/importExcel",
list: "/${entityPackagePath}/${entityName?uncap_first}/list",
delete: "/${entityPackagePath}/${entityName?uncap_first}/delete",
deleteBatch: "/${entityPackagePath}/${entityName?uncap_first}/deleteBatch",
exportXlsUrl: "/${entityPackagePath}/${entityName?uncap_first}/exportXls",
importExcelUrl: "${entityPackagePath}/${entityName?uncap_first}/importExcel",
<#if bpm_flag>startProcess: '/act/process/extActProcess/startMutilProcess'</#if>
},
<#if bpm_flag>
@ -363,7 +363,7 @@
let params = {
flowCode: this.flowCode,
id: record.id,
formUrl: '${entityPackage}/modules/${entityName}Form',
formUrl: '${entityPackagePath}/modules/${entityName}Form',
formUrlMobile: ''
}
postAction(this.url.startProcess, params).then(res=>{

8
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Form.vuei

@ -389,12 +389,12 @@
},
</#list>
url: {
add: "/${entityPackage}/${entityName?uncap_first}/add",
edit: "/${entityPackage}/${entityName?uncap_first}/edit",
queryById: "/${entityPackage}/${entityName?uncap_first}/queryById",
add: "/${entityPackagePath}/${entityName?uncap_first}/add",
edit: "/${entityPackagePath}/${entityName?uncap_first}/edit",
queryById: "/${entityPackagePath}/${entityName?uncap_first}/queryById",
<#list subTables as sub><#rt/>
${sub.entityName?uncap_first}: {
list: '/${entityPackage}/${entityName?uncap_first}/query${sub.entityName}ByMainId'
list: '/${entityPackagePath}/${entityName?uncap_first}/query${sub.entityName}ByMainId'
},
</#list>
}

2
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai

@ -52,7 +52,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
</#list>
@Api(tags="${tableVo.ftlDescription}")
@RestController
@RequestMapping("/${entityPackage}/${entityName?uncap_first}")
@RequestMapping("/${entityPackagePath}/${entityName?uncap_first}")
@Slf4j
public class ${entityName}Controller extends JeecgController<${entityName}, I${entityName}Service>{
@Autowired

5
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai

@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import org.jeecg.common.constant.ProvinceCityArea;
import org.jeecg.common.util.SpringContextUtils;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
@ -30,6 +32,7 @@ public class ${entityName} implements Serializable {
private static final long serialVersionUID = 1L;
<#assign excel_ignore_arr=['createBy','createTime','updateBy','updateTime','sysOrgCode']>
<#assign excel_ignore_classType_arr=['pca','switch','cat_tree']>
<#list originalColumns as po>
<#-- 生成字典Code -->
<#assign list_field_dictCode="">
@ -65,7 +68,7 @@ public class ${entityName} implements Serializable {
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
</#if>
<#else>
<#if !excel_ignore_arr?seq_contains("${po.fieldName}")>
<#if !excel_ignore_arr?seq_contains("${po.fieldName}") && !excel_ignore_classType_arr?seq_contains("${po.classType}")>
@Excel(name = "${po.filedComment}", width = 15${list_field_dictCode})
</#if>
</#if>

14
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei

@ -299,13 +299,13 @@
}
],
url: {
list: "/${entityPackage}/${entityName?uncap_first}/rootList",
childList: "/${entityPackage}/${entityName?uncap_first}/childList",
getChildListBatch: "/${entityPackage}/${entityName?uncap_first}/getChildListBatch",
delete: "/${entityPackage}/${entityName?uncap_first}/delete",
deleteBatch: "/${entityPackage}/${entityName?uncap_first}/deleteBatch",
exportXlsUrl: "/${entityPackage}/${entityName?uncap_first}/exportXls",
importExcelUrl: "${entityPackage}/${entityName?uncap_first}/importExcel",
list: "/${entityPackagePath}/${entityName?uncap_first}/rootList",
childList: "/${entityPackagePath}/${entityName?uncap_first}/childList",
getChildListBatch: "/${entityPackagePath}/${entityName?uncap_first}/getChildListBatch",
delete: "/${entityPackagePath}/${entityName?uncap_first}/delete",
deleteBatch: "/${entityPackagePath}/${entityName?uncap_first}/deleteBatch",
exportXlsUrl: "/${entityPackagePath}/${entityName?uncap_first}/exportXls",
importExcelUrl: "${entityPackagePath}/${entityName?uncap_first}/importExcel",
},
expandedRowKeys:[],
hasChildrenField:"${hasChildrenField}",

4
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Modal.vuei

@ -142,8 +142,8 @@
confirmLoading: false,
<#include "/common/validatorRulesTemplate/main.ftl">
url: {
add: "/${entityPackage}/${entityName?uncap_first}/add",
edit: "/${entityPackage}/${entityName?uncap_first}/edit",
add: "/${entityPackagePath}/${entityName?uncap_first}/add",
edit: "/${entityPackagePath}/${entityName?uncap_first}/edit",
},
expandedRowKeys:[],
pidField:"${pidFieldName}"

2
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3/${entityName}List.vuei

@ -434,7 +434,7 @@
let params = {
flowCode: 'dev_${tableName}_001',
id: record.id,
formUrl: '${entityPackage}/components/${entityName}Form',
formUrl: '${entityPackagePath}/components/${entityName}Form',
formUrlMobile: ''
}
await startProcess(params);

18
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__api.tsi

@ -4,15 +4,15 @@ import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/${entityPackage}/${entityName?uncap_first}/rootList',
save='/${entityPackage}/${entityName?uncap_first}/add',
edit='/${entityPackage}/${entityName?uncap_first}/edit',
delete${entityName} = '/${entityPackage}/${entityName?uncap_first}/delete',
importExcel = '/${entityPackage}/${entityName?uncap_first}/importExcel',
exportXls = '/${entityPackage}/${entityName?uncap_first}/exportXls',
loadTreeData = '/${entityPackage}/${entityName?uncap_first}/loadTreeRoot',
getChildList = '/${entityPackage}/${entityName?uncap_first}/childList',
getChildListBatch = '/${entityPackage}/${entityName?uncap_first}/getChildListBatch',
list = '/${entityPackagePath}/${entityName?uncap_first}/rootList',
save='/${entityPackagePath}/${entityName?uncap_first}/add',
edit='/${entityPackagePath}/${entityName?uncap_first}/edit',
delete${entityName} = '/${entityPackagePath}/${entityName?uncap_first}/delete',
importExcel = '/${entityPackagePath}/${entityName?uncap_first}/importExcel',
exportXls = '/${entityPackagePath}/${entityName?uncap_first}/exportXls',
loadTreeData = '/${entityPackagePath}/${entityName?uncap_first}/loadTreeRoot',
getChildList = '/${entityPackagePath}/${entityName?uncap_first}/childList',
getChildListBatch = '/${entityPackagePath}/${entityName?uncap_first}/getChildListBatch',
}
/**

2
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3/${entityName}__data.tsi

@ -200,7 +200,7 @@ export const searchFormSchema: FormSchema[] = [
},
<#elseif po.classType=='list' || po.classType=='radio' || po.classType=='checkbox'>
<#-- ---------------------------下拉或是单选 判断数据字典是表字典还是普通字典------------------------------- -->
component: 'JDictSelectTag',
component: 'JSelectMultiple',
componentProps:{
<#if po.dictTable?default("")?trim?length gt 1>
dictCode:"${po.dictTable},${po.dictText},${po.dictField}"

2
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3/components/${entityName}Form.vuei

@ -41,7 +41,7 @@
});
let formData = {};
const queryByIdUrl = '/${entityPackage}/${entityName?uncap_first}/queryById';
const queryByIdUrl = '/${entityPackagePath}/${entityName?uncap_first}/queryById';
async function initFormData(){
let params = {id: props.formData.dataId};
const data = await defHttp.get({url: queryByIdUrl, params});

2
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}List.vuei

@ -511,7 +511,7 @@
let params = {
flowCode: 'dev_${tableName}_001',
id: record.id,
formUrl: '${entityPackage}/components/${entityName}Form',
formUrl: '${entityPackagePath}/components/${entityName}Form',
formUrlMobile: ''
}
await startProcess(params);

18
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}__api.tsi

@ -4,15 +4,15 @@ import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/${entityPackage}/${entityName?uncap_first}/rootList',
save='/${entityPackage}/${entityName?uncap_first}/add',
edit='/${entityPackage}/${entityName?uncap_first}/edit',
delete${entityName} = '/${entityPackage}/${entityName?uncap_first}/delete',
importExcel = '/${entityPackage}/${entityName?uncap_first}/importExcel',
exportXls = '/${entityPackage}/${entityName?uncap_first}/exportXls',
loadTreeData = '/${entityPackage}/${entityName?uncap_first}/loadTreeRoot',
getChildList = '/${entityPackage}/${entityName?uncap_first}/childList',
getChildListBatch = '/${entityPackage}/${entityName?uncap_first}/getChildListBatch',
list = '/${entityPackagePath}/${entityName?uncap_first}/rootList',
save='/${entityPackagePath}/${entityName?uncap_first}/add',
edit='/${entityPackagePath}/${entityName?uncap_first}/edit',
delete${entityName} = '/${entityPackagePath}/${entityName?uncap_first}/delete',
importExcel = '/${entityPackagePath}/${entityName?uncap_first}/importExcel',
exportXls = '/${entityPackagePath}/${entityName?uncap_first}/exportXls',
loadTreeData = '/${entityPackagePath}/${entityName?uncap_first}/loadTreeRoot',
getChildList = '/${entityPackagePath}/${entityName?uncap_first}/childList',
getChildListBatch = '/${entityPackagePath}/${entityName?uncap_first}/getChildListBatch',
}
/**

2
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue3Native/components/${entityName}Form.vuei

@ -134,7 +134,7 @@
initFormData();
});
//渲染流程表单数据
const queryByIdUrl = '/${entityPackage}/${entityName?uncap_first}/queryById';
const queryByIdUrl = '/${entityPackagePath}/${entityName?uncap_first}/queryById';
async function initFormData(){
if(props.formBpm === true){
let params = {id: props.formData.dataId};

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

Loading…
Cancel
Save