Browse Source

Merge branch 'master' of http://62.234.61.92:3000/wjm/mec-cloud_IntelligentManufacturing_CLIENT

ZYZ 1 year ago
parent
commit
f3e26241dc
100 changed files with 4867 additions and 988 deletions
  1. 19 7
      zkqy-admin/pom.xml
  2. 18 10
      zkqy-admin/src/main/java/com/zkqy/ZkqyApplication.java
  3. 9 0
      zkqy-admin/src/main/java/com/zkqy/web/controller/common/CommonFileController.java
  4. 12 0
      zkqy-admin/src/main/java/com/zkqy/web/controller/monitor/SysOperlogController.java
  5. 169 0
      zkqy-admin/src/main/java/com/zkqy/web/controller/projcetzip/DownloadController.java
  6. 130 0
      zkqy-admin/src/main/java/com/zkqy/web/controller/projcetzip/ExportController.java
  7. 118 0
      zkqy-admin/src/main/java/com/zkqy/web/controller/system/LoginPageConfigurationController.java
  8. 0 1
      zkqy-admin/src/main/java/com/zkqy/web/controller/system/SysDictDataController.java
  9. 338 0
      zkqy-admin/src/main/java/com/zkqy/web/controller/system/SysEngineeringController.java
  10. 41 5
      zkqy-admin/src/main/java/com/zkqy/web/controller/system/SysLoginController.java
  11. 1 0
      zkqy-admin/src/main/java/com/zkqy/web/controller/system/SysPostController.java
  12. 1 0
      zkqy-admin/src/main/java/com/zkqy/web/controller/system/SysRoleController.java
  13. 41 55
      zkqy-admin/src/main/java/com/zkqy/web/controller/system/SysUserController.java
  14. 175 0
      zkqy-admin/src/main/java/com/zkqy/web/controller/tool/daochuController.java
  15. 47 0
      zkqy-admin/src/main/java/com/zkqy/web/ljj.java
  16. 9 0
      zkqy-admin/src/main/resources/application.yml
  17. BIN
      zkqy-admin/src/main/resources/lib/DmJdbcDriver18.jar
  18. 4 1
      zkqy-admin/src/main/resources/logback-spring.xml
  19. 1 0
      zkqy-business/pom.xml
  20. 61 37
      zkqy-business/src/main/java/com/zkqy/business/controller/CommonBtnController.java
  21. 7 1
      zkqy-business/src/main/java/com/zkqy/business/controller/CommonController.java
  22. 16 3
      zkqy-business/src/main/java/com/zkqy/business/entity/DragForm.java
  23. 2 2
      zkqy-business/src/main/java/com/zkqy/business/entity/DragTable.java
  24. 95 50
      zkqy-business/src/main/java/com/zkqy/business/entity/DragTableBtn.java
  25. 4 0
      zkqy-business/src/main/java/com/zkqy/business/mapper/DragFormMapper.java
  26. 6 1
      zkqy-business/src/main/java/com/zkqy/business/service/IDragFormService.java
  27. 6 0
      zkqy-business/src/main/java/com/zkqy/business/service/IDragTableService.java
  28. 6 2
      zkqy-business/src/main/java/com/zkqy/business/service/impl/DragFormServiceImpl.java
  29. 7 0
      zkqy-business/src/main/java/com/zkqy/business/service/impl/DragTableServiceImpl.java
  30. 86 53
      zkqy-business/src/main/resources/mapper/dragmapper/DragFormMapper.xml
  31. 26 17
      zkqy-business/src/main/resources/mapper/dragmapper/DragTableBtnMapper.xml
  32. 10 0
      zkqy-common/pom.xml
  33. 1 1
      zkqy-common/src/main/java/com/zkqy/common/constant/Constants.java
  34. 28 0
      zkqy-common/src/main/java/com/zkqy/common/utils/StringUtils.java
  35. 52 0
      zkqy-common/src/main/java/com/zkqy/common/utils/ZipUtils.java
  36. 77 59
      zkqy-common/src/main/java/com/zkqy/common/utils/bpm/XmlDataParserUtils.java
  37. 7 0
      zkqy-framework/src/main/java/com/zkqy/framework/aspectj/LogAspect.java
  38. 31 4
      zkqy-framework/src/main/java/com/zkqy/framework/aspectj/SqlInterceptor.java
  39. 48 0
      zkqy-framework/src/main/java/com/zkqy/framework/manager/factory/AsyncFactory.java
  40. 8 9
      zkqy-framework/src/main/java/com/zkqy/framework/security/handle/LogoutSuccessHandlerImpl.java
  41. 41 51
      zkqy-framework/src/main/java/com/zkqy/framework/web/service/SysLoginService.java
  42. 23 0
      zkqy-framework/src/main/java/com/zkqy/framework/web/service/TokenService.java
  43. 7 0
      zkqy-process-execution/pom.xml
  44. 105 0
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/controller/BpmApprovalStatusController.java
  45. 5 5
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/controller/BpmExecuteNodeController.java
  46. 4 4
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/controller/BpmExecuteNodeFormController.java
  47. 4 4
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/controller/BpmExecuteNodeMiddleController.java
  48. 28 1
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/controller/BpmRunController.java
  49. 112 0
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/entity/BpmApprovalStatus.java
  50. 20 9
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/entity/runbpm/BpmBackNodeVo.java
  51. 24 2
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/entity/runbpm/BpmRunNodeFormFilterConditionsVo.java
  52. 32 3
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/entity/runbpm/BpmRunNodeVo.java
  53. 36 3
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/entity/runbpm/TriggerExceptionVO.java
  54. 70 0
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/mapper/BpmApprovalStatusMapper.java
  55. 26 15
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/mapper/BpmExecuteNodeFormMapper.java
  56. 7 0
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/mapper/BpmExecuteNodeMapper.java
  57. 264 117
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/runbpm/PreExecutionToolClass.java
  58. 62 0
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/IBpmApprovalStatusService.java
  59. 1 1
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/ICommonService.java
  60. 94 0
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/impl/BpmApprovalStatusServiceImpl.java
  61. 22 5
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/impl/BpmExecuteNodeMiddleServiceImpl.java
  62. 37 21
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/impl/BpmExecuteNodeServiceImpl.java
  63. 51 42
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/impl/BpmExecuteProcessServiceImpl.java
  64. 53 20
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/impl/CommonServiceImpl.java
  65. 4 2
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/impl/runbpm/hangye1/yichang/yichang1.java
  66. 50 0
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/impl/runbpm/mes/CommonAutoExecute.java
  67. 61 0
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/impl/runbpm/mes/ExceptionEditTheFinishTimeAgain.java
  68. 66 0
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/impl/runbpm/mes/ExceptionProductObsolescence.java
  69. 63 0
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/impl/runbpm/mes/ExceptionQualityControlCardEdit.java
  70. 69 0
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/impl/runbpm/mes/ExceptionQualityControlCardSubCard.java
  71. 68 0
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/impl/runbpm/mes/ExceptionRecordQualityControlCard.java
  72. 76 0
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/impl/runbpm/mes/ExceptionTaskTermination.java
  73. 116 0
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/impl/runbpm/smt/AntiErrorMaterial.java
  74. 11 3
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/utils/EchoNodeFormData.java
  75. 7 0
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/utils/Sending.java
  76. 68 146
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/utils/VerifyExecutionProcess.java
  77. 79 0
      zkqy-process-execution/src/main/resources/mapper/bpm/dispersed/BpmApprovalStatusMapper.xml
  78. 16 0
      zkqy-process-execution/src/main/resources/mapper/bpm/dispersed/BpmExecuteNodeFormMapper.xml
  79. 6 3
      zkqy-process-execution/src/main/resources/mapper/bpm/dispersed/BpmExecuteNodeMapper.xml
  80. 37 40
      zkqy-process-execution/src/main/resources/mapper/bpm/dispersed/BpmExecuteProcessMapper.xml
  81. 6 6
      zkqy-process-execution/src/main/resources/mapper/bpm/dispersed/BpmNodeScriptRelevanceMapper.xml
  82. 195 0
      zkqy-system/src/main/java/com/zkqy/system/domain/LoginPageConfiguration.java
  83. 157 0
      zkqy-system/src/main/java/com/zkqy/system/domain/SysEngineering.java
  84. 13 0
      zkqy-system/src/main/java/com/zkqy/system/domain/SysLogininfor.java
  85. 12 0
      zkqy-system/src/main/java/com/zkqy/system/domain/SysOperLog.java
  86. 73 0
      zkqy-system/src/main/java/com/zkqy/system/mapper/LoginPageConfigurationMapper.java
  87. 62 0
      zkqy-system/src/main/java/com/zkqy/system/mapper/SysEngineeringMapper.java
  88. 1 1
      zkqy-system/src/main/java/com/zkqy/system/mapper/SysMenuMapper.java
  89. 7 0
      zkqy-system/src/main/java/com/zkqy/system/mapper/SysUserMapper.java
  90. 70 0
      zkqy-system/src/main/java/com/zkqy/system/service/ILoginPageConfigurationService.java
  91. 62 0
      zkqy-system/src/main/java/com/zkqy/system/service/ISysEngineeringService.java
  92. 7 0
      zkqy-system/src/main/java/com/zkqy/system/service/ISysUserService.java
  93. 102 0
      zkqy-system/src/main/java/com/zkqy/system/service/impl/LoginPageConfigurationServiceImpl.java
  94. 92 0
      zkqy-system/src/main/java/com/zkqy/system/service/impl/SysEngineeringServiceImpl.java
  95. 21 14
      zkqy-system/src/main/java/com/zkqy/system/service/impl/SysLogininforServiceImpl.java
  96. 16 16
      zkqy-system/src/main/java/com/zkqy/system/service/impl/SysMenuServiceImpl.java
  97. 99 135
      zkqy-system/src/main/java/com/zkqy/system/service/impl/SysUserServiceImpl.java
  98. 118 0
      zkqy-system/src/main/resources/mapper/system/LoginPageConfigurationMapper.xml
  99. 1 1
      zkqy-system/src/main/resources/mapper/system/SysBpmNodeScriptMapper.xml
  100. 111 0
      zkqy-system/src/main/resources/mapper/system/SysEngineeringMapper.xml

+ 19 - 7
zkqy-admin/pom.xml

@@ -38,11 +38,19 @@
             <version>1.6.2</version>
         </dependency>
 
-         <!-- Mysql驱动包 -->
+        <!-- Mysql驱动包 -->
         <dependency>
             <groupId>mysql</groupId>
             <artifactId>mysql-connector-java</artifactId>
         </dependency>
+        <!-- 达梦驱动包 -->
+        <dependency>
+            <groupId>com.dm</groupId>
+            <artifactId>DmJdbcDriver18</artifactId>
+            <version>1.8</version>
+            <scope>system</scope>
+            <systemPath>${project.basedir}/src/main/resources/lib/DmJdbcDriver18.jar</systemPath>
+        </dependency>
         <!-- 核心模块-->
         <dependency>
             <groupId>com.zkqy</groupId>
@@ -61,6 +69,10 @@
             <version>2.10.1</version>
             <scope>compile</scope>
         </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+        </dependency>
 
     </dependencies>
 
@@ -81,15 +93,15 @@
                     </execution>
                 </executions>
             </plugin>
-            <plugin>   
-                <groupId>org.apache.maven.plugins</groupId>   
-                <artifactId>maven-war-plugin</artifactId>   
-                <version>3.1.0</version>   
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-war-plugin</artifactId>
+                <version>3.1.0</version>
                 <configuration>
                     <failOnMissingWebXml>false</failOnMissingWebXml>
                     <warName>${project.artifactId}</warName>
-                </configuration>   
-           </plugin>   
+                </configuration>
+            </plugin>
         </plugins>
         <finalName>${project.artifactId}</finalName>
     </build>

+ 18 - 10
zkqy-admin/src/main/java/com/zkqy/ZkqyApplication.java

@@ -19,16 +19,24 @@ public class ZkqyApplication
     public static void main(String[] args)
     {
         SpringApplication.run(ZkqyApplication.class, args);
-        System.out.println("(♥◠‿◠)ノ゙  中科擎云智能制造平台客户端后台启动成功   ლ(´ڡ`ლ)゙  \n" +
-                " .-------.       ____     __        \n" +
-                " |  _ _   \\      \\   \\   /  /    \n" +
-                " | ( ' )  |       \\  _. /  '       \n" +
-                " |(_ o _) /        _( )_ .'         \n" +
-                " | (_,_).' __  ___(_ o _)'          \n" +
-                " |  |\\ \\  |  ||   |(_,_)'         \n" +
-                " |  | \\ `'   /|   `-'  /           \n" +
-                " |  |  \\    /  \\      /           \n" +
-                " ''-'   `'-'    `-..-'              ");
+        System.out.println("(♥◠‿◠)ノ゙  中科擎云智能制造平台客户端后台启动成功   ლ(´ڡ`ლ)゙  \n"+
+                "        CCCCCCCCCCCCCLLLLLLLLLLL             IIIIIIIIIIEEEEEEEEEEEEEEEEEEEEEENNNNNNNN        NNNNNNNNTTTTTTTTTTTTTTTTTTTTTTT\n" +
+                "     CCC::::::::::::CL:::::::::L             I::::::::IE::::::::::::::::::::EN:::::::N       N::::::NT:::::::::::::::::::::T\n" +
+                "   CC:::::::::::::::CL:::::::::L             I::::::::IE::::::::::::::::::::EN::::::::N      N::::::NT:::::::::::::::::::::T\n" +
+                "  C:::::CCCCCCCC::::CLL:::::::LL             II::::::IIEE::::::EEEEEEEEE::::EN:::::::::N     N::::::NT:::::TT:::::::TT:::::T\n" +
+                " C:::::C       CCCCCC  L:::::L                 I::::I    E:::::E       EEEEEEN::::::::::N    N::::::NTTTTTT  T:::::T  TTTTTT\n" +
+                "C:::::C                L:::::L                 I::::I    E:::::E             N:::::::::::N   N::::::N        T:::::T        \n" +
+                "C:::::C                L:::::L                 I::::I    E::::::EEEEEEEEEE   N:::::::N::::N  N::::::N        T:::::T        \n" +
+                "C:::::C                L:::::L                 I::::I    E:::::::::::::::E   N::::::N N::::N N::::::N        T:::::T        \n" +
+                "C:::::C                L:::::L                 I::::I    E:::::::::::::::E   N::::::N  N::::N:::::::N        T:::::T        \n" +
+                "C:::::C                L:::::L                 I::::I    E::::::EEEEEEEEEE   N::::::N   N:::::::::::N        T:::::T        \n" +
+                "C:::::C                L:::::L                 I::::I    E:::::E             N::::::N    N::::::::::N        T:::::T        \n" +
+                " C:::::C       CCCCCC  L:::::L         LLLLLL  I::::I    E:::::E       EEEEEEN::::::N     N:::::::::N        T:::::T        \n" +
+                "  C:::::CCCCCCCC::::CLL:::::::LLLLLLLLL:::::LII::::::IIEE::::::EEEEEEEE:::::EN::::::N      N::::::::N      TT:::::::TT      \n" +
+                "   CC:::::::::::::::CL::::::::::::::::::::::LI::::::::IE::::::::::::::::::::EN::::::N       N:::::::N      T:::::::::T      \n" +
+                "     CCC::::::::::::CL::::::::::::::::::::::LI::::::::IE::::::::::::::::::::EN::::::N        N::::::N      T:::::::::T      \n" +
+                "        CCCCCCCCCCCCCLLLLLLLLLLLLLLLLLLLLLLLLIIIIIIIIIIEEEEEEEEEEEEEEEEEEEEEENNNNNNNN         NNNNNNN      TTTTTTTTTTT      "
+        );
         ////输出容器中所有bean
         //ApplicationContext context = SpringApplication.run(ZkqyApplication.class, args);
         //Arrays.stream(context.getBeanDefinitionNames()).forEach(System.out::println);

+ 9 - 0
zkqy-admin/src/main/java/com/zkqy/web/controller/common/CommonFileController.java

@@ -7,9 +7,11 @@ import com.alibaba.fastjson2.TypeReference;
 import com.zkqy.business.entity.DragTable;
 import com.zkqy.business.service.IDragTableService;
 import com.zkqy.common.annotation.Anonymous;
+import com.zkqy.common.annotation.Log;
 import com.zkqy.common.config.ZkqyConfig;
 import com.zkqy.common.constant.Constants;
 import com.zkqy.common.core.domain.AjaxResult;
+import com.zkqy.common.enums.BusinessType;
 import com.zkqy.common.utils.StringUtils;
 import com.zkqy.common.utils.file.FileUploadUtils;
 import com.zkqy.common.utils.file.FileUtils;
@@ -66,6 +68,7 @@ public class CommonFileController {
     /**
      * 通用导出excel
      */
+    @Log(title = "动态表格", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
     public void export(HttpServletResponse response, CommonEntity commonEntity) throws Exception {
         commonService.export(response, commonEntity);
@@ -78,6 +81,7 @@ public class CommonFileController {
      * @param tableName
      * @throws Exception
      */
+    @Log(title = "动态表格", businessType = BusinessType.EXPORT)
     @PostMapping("/exportTemplate")
     public void exportTemplate(HttpServletResponse response, String tableName, String sqlkey) throws Exception {
         commonService.exportTemplate(response, tableName, sqlkey);
@@ -89,6 +93,7 @@ public class CommonFileController {
      * @param fileName 文件名称
      * @param delete   是否删除
      */
+    @Log(title = "动态表格", businessType = BusinessType.EXPORT)
     @GetMapping("/download")
     public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request) {
         try {
@@ -112,6 +117,7 @@ public class CommonFileController {
     /**
      * 通用上传请求(单个)
      */
+    @Log(title = "动态表格", businessType = BusinessType.IMPORT)
     @PostMapping("/upload")
     public AjaxResult uploadFile(MultipartFile file) throws Exception {
         try {
@@ -134,6 +140,7 @@ public class CommonFileController {
     /**
      * 通用上传请求(多个)
      */
+    @Log(title = "动态表格", businessType = BusinessType.IMPORT)
     @PostMapping("/uploads")
     public AjaxResult uploadFiles(List<MultipartFile> files) throws Exception {
         try {
@@ -166,6 +173,7 @@ public class CommonFileController {
     /**
      * 本地资源通用下载
      */
+    @Log(title = "动态表格", businessType = BusinessType.EXPORT)
     @GetMapping("/download/resource")
     public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response)
             throws Exception {
@@ -191,6 +199,7 @@ public class CommonFileController {
      * 导入execl数据(单个文件)文件名即表名
      */
 
+    @Log(title = "动态表格", businessType = BusinessType.IMPORT)
     @Anonymous
     @ApiOperation("上传文件")
     @PostMapping(value = "/uploadData", headers = "content-type=multipart/form-data")

+ 12 - 0
zkqy-admin/src/main/java/com/zkqy/web/controller/monitor/SysOperlogController.java

@@ -2,6 +2,8 @@ package com.zkqy.web.controller.monitor;
 
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
+
+import com.zkqy.common.core.domain.entity.SysUser;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.DeleteMapping;
@@ -35,6 +37,11 @@ public class SysOperlogController extends BaseController
     @GetMapping("/list")
     public TableDataInfo list(SysOperLog operLog)
     {
+        if(SysUser.isAdmin(getUserId())){
+            operLog.setTenantId(0L);
+        }else {
+            operLog.setTenantId(getTenantId());
+        }
         startPage();
         List<SysOperLog> list = operLogService.selectOperLogList(operLog);
         return getDataTable(list);
@@ -45,6 +52,11 @@ public class SysOperlogController extends BaseController
     @PostMapping("/export")
     public void export(HttpServletResponse response, SysOperLog operLog)
     {
+        if(SysUser.isAdmin(getUserId())){
+            operLog.setTenantId(0L);
+        }else {
+            operLog.setTenantId(getTenantId());
+        }
         List<SysOperLog> list = operLogService.selectOperLogList(operLog);
         ExcelUtil<SysOperLog> util = new ExcelUtil<SysOperLog>(SysOperLog.class);
         util.exportExcel(response, list, "操作日志");

+ 169 - 0
zkqy-admin/src/main/java/com/zkqy/web/controller/projcetzip/DownloadController.java

@@ -0,0 +1,169 @@
+package com.zkqy.web.controller.projcetzip;
+
+import com.zkqy.common.config.ZkqyConfig;
+import com.zkqy.common.core.redis.RedisCache;
+import com.zkqy.common.utils.DateUtils;
+import com.zkqy.common.utils.SecurityUtils;
+import com.zkqy.common.utils.StringUtils;
+import com.zkqy.system.domain.SysEngineering;
+import com.zkqy.system.service.ISysEngineeringService;
+import org.apache.tools.zip.ZipEntry;
+import org.apache.tools.zip.ZipOutputStream;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.locks.ReentrantLock;
+
+@RestController
+@RequestMapping("/download/project-db")
+public class DownloadController {
+
+    @Autowired
+    private ISysEngineeringService sysEngineeringService;
+
+    @Autowired
+    private ZkqyConfig zkqyConfig;
+
+    @Autowired
+    private RedisCache redisCache;
+
+    private static final ReentrantLock lock = new ReentrantLock();
+    private volatile boolean exportCompleted = false;
+
+
+    @GetMapping("/status")
+    public ResponseEntity<String> checkExportStatus() {
+        String state = redisCache.getCacheObject("isExportState:" + SecurityUtils.getTenantId()).toString();
+        if (StringUtils.isNotNull(state) && !state.isEmpty() && state.equals("true")) {
+            return ResponseEntity.ok("导出已完成。您现在可以触发下载");
+        } else {
+            return ResponseEntity.status(HttpStatus.GATEWAY_TIMEOUT).body("文件还在生成中。请稍候。。。");
+        }
+
+    }
+
+    @GetMapping("/download")
+    public void downloadZip(HttpServletResponse response) {
+        String state = redisCache.getCacheObject("isExportState:" + SecurityUtils.getTenantId()).toString();
+        String sqlDirectoryPath = zkqyConfig.getUploadPath() + "/engineeringdownload/sql/" + SecurityUtils.getTenantId();
+        String jarDirectoryPath = zkqyConfig.getUploadPath() + "/engineeringdownload/jar/";
+        try {
+            if (StringUtils.isNotNull(state) && !state.isEmpty() && state.equals("true")) {
+                try {
+                    List<Map<String, String>> fileList = listFiles(sqlDirectoryPath, jarDirectoryPath);
+                    try {
+                        response.setContentType("application/x-octet-stream");
+                        response.setHeader("Content-Disposition", "attachment; filename=\"download.zip\"");
+                        response.setCharacterEncoding("utf-8");
+                        ZipOutputStream zos = new ZipOutputStream(response.getOutputStream());
+                        byte[] buffer = new byte[1024];
+                        for (Map<String, String> fileMap : fileList) {
+                            String fileName = fileMap.get("fileName");
+                            String filePath = fileMap.get("filePath");
+                            // 使用 File.separator 来实现跨平台兼容性
+                            String relativePath = fileName;
+                            // 在 Zip 中创建带有相对路径的 ZipEntry
+                            zos.putNextEntry(new ZipEntry(relativePath));
+                            try (InputStream is = new FileInputStream(filePath)) {
+                                int length;
+                                while ((length = is.read(buffer)) > 0) {
+                                    zos.write(buffer, 0, length);
+                                }
+                            } catch (IOException e) {
+                                e.printStackTrace();
+                            }
+                            zos.closeEntry();
+                        }
+                        zos.close();
+                        zos.flush();
+                    } catch (IOException e) {
+                        e.printStackTrace();
+                    }
+                    // 下载完成后删除sqlDirectoryPath路径下的所有文件
+                    deleteFilesInDirectory(sqlDirectoryPath);
+                } catch (Exception e) {
+                    e.printStackTrace();
+                    response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+                }
+            } else {
+                response.setStatus(HttpServletResponse.SC_NOT_FOUND);
+            }
+        } finally {
+            SysEngineering sysEngineering = new SysEngineering();
+            sysEngineering.setCreateTime(DateUtils.getNowDate());
+            sysEngineering.setDownloadTime(DateUtils.getNowDate());
+            sysEngineering.setEngineeringName(SecurityUtils.getLoginUser().getUser().getTenantName() + "-MES");
+            sysEngineering.setTenantId(SecurityUtils.getTenantId());
+            sysEngineeringService.insertSysEngineering(sysEngineering);
+
+            // 删除
+            redisCache.deleteObject("isExportState:" + SecurityUtils.getTenantId());
+        }
+    }
+
+
+    private List<Map<String, String>> listFiles(String sqlDirectoryPath, String jarDirectoryPath) {
+        List<Map<String, String>> fileList = new ArrayList<>();
+        processDirectory(sqlDirectoryPath, fileList);
+        processDirectory(jarDirectoryPath, fileList);
+        return fileList;
+    }
+
+    private void processDirectory(String directoryPath, List<Map<String, String>> fileList) {
+        File directory = new File(directoryPath);
+        if (directory.exists() && directory.isDirectory()) {
+            listFilesRecursively(directory, fileList);
+        }
+    }
+
+    private void listFilesRecursively(File directory, List<Map<String, String>> fileList) {
+        File[] files = directory.listFiles();
+        if (files != null) {
+            for (File file : files) {
+                if (file.isDirectory()) {
+                    listFilesRecursively(file, fileList);
+                } else {
+                    Map<String, String> fileInfo = new HashMap<>();
+                    fileInfo.put("fileName", file.getName());
+                    fileInfo.put("filePath", file.getAbsolutePath());
+                    fileList.add(fileInfo);
+                }
+            }
+        }
+    }
+
+    public void setExportCompleted(boolean value, String tenantKey) {
+        try {
+            exportCompleted = value;
+        } finally {
+            //  设置导出验证有效时间5分钟
+            redisCache.setCacheObject("isExportState:" + tenantKey, "true", 5, TimeUnit.MINUTES);
+        }
+    }
+
+    private void deleteFilesInDirectory(String directoryPath) {
+        File directory = new File(directoryPath);
+        if (directory.exists() && directory.isDirectory()) {
+            File[] files = directory.listFiles();
+            if (files != null) {
+                for (File file : files) {
+                    file.delete();
+                }
+            }
+        }
+    }
+}

+ 130 - 0
zkqy-admin/src/main/java/com/zkqy/web/controller/projcetzip/ExportController.java

@@ -0,0 +1,130 @@
+package com.zkqy.web.controller.projcetzip;
+
+import com.zkqy.common.config.ZkqyConfig;
+import com.zkqy.common.core.domain.AjaxResult;
+import com.zkqy.common.core.domain.entity.SysUser;
+import com.zkqy.common.utils.SecurityUtils;
+import com.zkqy.web.controller.tool.TestController;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.concurrent.CompletableFuture;
+
+import com.zkqy.common.core.domain.entity.DataSource;
+
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+
+
+@RestController
+@RequestMapping("/export/project-db")
+public class ExportController {
+
+    @Autowired
+    private ThreadPoolTaskExecutor taskExecutor;
+
+    @Autowired
+    private DownloadController downloadController;
+
+    // 执行当前环境下的mysql
+    @Value("${projectDownloadZip.mysql}")
+    private String MYSQLDUMP_PATH;
+
+    // sql 生成路径
+    private static final String SQL_OUTPUT_PATH = "sql";
+
+    private static final Logger log = LoggerFactory.getLogger(ExportController.class);
+
+    @PostMapping("/start")
+    public AjaxResult startExport(@RequestBody List<String> databaseNames) {
+        String sourceFilePath = ZkqyConfig.getUploadPath() + "/engineeringdownload/";
+        DataSource datasourceInfo = SecurityUtils.getDatasourceInfo();
+        SysUser sysUser = SecurityUtils.getLoginUser().getUser();
+        String tenantid = sysUser.getTenant().getTenantId().toString();
+//        if (databaseNames == null || databaseNames.isEmpty()) {
+//        databaseNames = Arrays.asList("ry-vue-call", datasourceInfo.getDatabaseName());
+        databaseNames = Arrays.asList(datasourceInfo.getDatabaseName());
+//        }
+        try {
+            // 获取数据库信息等
+            exportDatabases(databaseNames, sourceFilePath, datasourceInfo, tenantid);
+        } catch (Exception e) {
+            e.printStackTrace();
+            log.error("数据生成失败:" + sysUser);
+            return AjaxResult.error("数据生成失败!请联系管理员操作!");
+        }
+        // 导出完成后,设置导出状态为 true
+        downloadController.setExportCompleted(true, sysUser.getTenantId().toString());
+        log.info("导出数据文件成功!" + sysUser.getUserName());
+        return AjaxResult.success("数据生成成功!");
+    }
+
+    private void exportDatabases(List<String> databaseNames, String sourceFilePath, DataSource dataSource, String tenantId) {
+        try {
+            // 并行导出多个数据库
+            CompletableFuture.allOf(
+                    databaseNames.stream()
+                            .map(databaseName ->
+                                    CompletableFuture.runAsync(() ->
+                                            exportDatabase(databaseName, sourceFilePath, dataSource, tenantId), taskExecutor)
+                            )
+                            .toArray(CompletableFuture[]::new)
+            ).get(); // 等待所有导出完成
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    private void exportDatabase(String databaseName, String sourceFilePath, DataSource dataSource, String tenantId) {
+        String outputPath = sourceFilePath + SQL_OUTPUT_PATH + File.separator + tenantId;
+        try {
+            Files.createDirectories(Paths.get(outputPath));
+            String dumpFileName = outputPath + File.separator + databaseName + ".sql";
+            List<String> cmd = buildMysqldumpCommand(databaseName, dataSource);
+            ProcessBuilder pb = new ProcessBuilder(cmd);
+            pb.redirectOutput(new File(dumpFileName));
+            Process process = pb.start();
+            // 设置导出超时时间为10分钟
+            if (!process.waitFor(10, TimeUnit.MINUTES)) {
+                process.destroyForcibly(); // 超时则强制销毁进程
+                throw new TimeoutException("导出数据库超时");
+            }
+            int exitCode = process.exitValue();
+
+            if (exitCode == 0) {
+                System.out.println("数据库备份成功。导出文件:" + dumpFileName);
+            } else {
+                System.err.println("执行mysqldump命令时发生错误。退出代码:" + exitCode);
+            }
+        } catch (IOException | InterruptedException | TimeoutException e) {
+            e.printStackTrace();
+        }
+    }
+
+    private List<String> buildMysqldumpCommand(String databaseName, DataSource dataSource) {
+        // 使用 Arrays.asList 创建不可变 List
+        //  windwos: mysqldump --column-statistics=0
+        // Linux: 需要指明mysql脚本地址-》/usr/local/mysql/bin/mysqldump
+        return new ArrayList<>(Arrays.asList(
+                MYSQLDUMP_PATH,
+                "-h", dataSource.getDatabaseIp(),
+                "-u", dataSource.getUsername(),
+                "-p" + dataSource.getPassword(),
+                databaseName
+        ));
+    }
+}

+ 118 - 0
zkqy-admin/src/main/java/com/zkqy/web/controller/system/LoginPageConfigurationController.java

@@ -0,0 +1,118 @@
+package com.zkqy.web.controller.system;
+
+import com.zkqy.common.annotation.Anonymous;
+import com.zkqy.common.annotation.Log;
+import com.zkqy.common.core.controller.BaseController;
+import com.zkqy.common.core.domain.AjaxResult;
+import com.zkqy.common.core.page.TableDataInfo;
+import com.zkqy.common.enums.BusinessType;
+import com.zkqy.common.utils.poi.ExcelUtil;
+import com.zkqy.system.domain.LoginPageConfiguration;
+import com.zkqy.system.service.ILoginPageConfigurationService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+/**
+ * 登录页面配置信息Controller
+ *
+ * @author zkqy
+ * @date 2024-01-22
+ */
+@RestController
+@RequestMapping("/system/configuration")
+@Api(value = "/system/configuration", description = "登录页面配置信息-接口")
+public class LoginPageConfigurationController extends BaseController
+{
+    @Autowired
+    private ILoginPageConfigurationService loginPageConfigurationService;
+
+/**
+ * 查询登录页面配置信息列表
+ */
+@PreAuthorize("@ss.hasPermi('system:configuration:list')")
+@GetMapping("/list")
+@ApiOperation(value = "查询登录页面配置信息列表")
+    public TableDataInfo list(LoginPageConfiguration loginPageConfiguration)
+    {
+        startPage();
+        List<LoginPageConfiguration> list = loginPageConfigurationService.selectLoginPageConfigurationList(loginPageConfiguration);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出登录页面配置信息列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:configuration:export')")
+    @Log(title = "登录页面配置信息", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    @ApiOperation(value = "导出登录页面配置信息列表")
+    public void export(HttpServletResponse response, LoginPageConfiguration loginPageConfiguration)
+    {
+        List<LoginPageConfiguration> list = loginPageConfigurationService.selectLoginPageConfigurationList(loginPageConfiguration);
+        ExcelUtil<LoginPageConfiguration> util = new ExcelUtil<LoginPageConfiguration>(LoginPageConfiguration.class);
+        util.exportExcel(response, list, "登录页面配置信息数据");
+    }
+
+    /**
+     * 获取登录页面配置信息详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:configuration:query')")
+    @GetMapping(value = "/{tenantId}")
+    @ApiOperation(value = "获取登录页面配置信息详细信息")
+    public AjaxResult getInfo(@PathVariable("tenantId") Long tenantId)
+    {
+        return success(loginPageConfigurationService.selectLoginPageConfigurationByTenantId(tenantId));
+    }
+
+    /**
+     * 根据登录编号查询详细信息
+     */
+    @Anonymous
+    @GetMapping("/queryLoginPageConfigurationInfo/{loginPageNumber}")
+    public AjaxResult queryLoginPageConfigurationInfo(@PathVariable("loginPageNumber") String loginPageNumber){
+        System.err.println(loginPageNumber);
+        return success(loginPageConfigurationService.selectLoginPageConfigurationByLoginPageNumber(loginPageNumber));
+    }
+
+    /**
+     * 新增登录页面配置信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:configuration:add')")
+    @Log(title = "登录页面配置信息", businessType = BusinessType.INSERT)
+    @PostMapping
+    @ApiOperation(value = "新增登录页面配置信息")
+    public AjaxResult add(@RequestBody LoginPageConfiguration loginPageConfiguration)
+    {
+        return toAjax(loginPageConfigurationService.insertLoginPageConfiguration(loginPageConfiguration));
+    }
+
+    /**
+     * 修改登录页面配置信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:configuration:edit')")
+    @Log(title = "登录页面配置信息", businessType = BusinessType.UPDATE)
+    @PutMapping
+    @ApiOperation(value = "修改登录页面配置信息")
+    public AjaxResult edit(@RequestBody LoginPageConfiguration loginPageConfiguration)
+    {
+        return toAjax(loginPageConfigurationService.updateLoginPageConfiguration(loginPageConfiguration));
+    }
+
+    /**
+     * 删除登录页面配置信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:configuration:remove')")
+    @Log(title = "登录页面配置信息", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    @ApiOperation(value = "删除登录页面配置信息")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(loginPageConfigurationService.deleteLoginPageConfigurationByIds(ids));
+    }
+}

+ 0 - 1
zkqy-admin/src/main/java/com/zkqy/web/controller/system/SysDictDataController.java

@@ -79,7 +79,6 @@ public class SysDictDataController extends BaseController
     public AjaxResult dictType(@PathVariable String dictType)
     {
         List<SysDictData> data = dictTypeService.selectDictDataByTypeAll(dictType);
-        System.out.println("ddddd");
         if (StringUtils.isNull(data))
         {
             data = new ArrayList<>();

+ 338 - 0
zkqy-admin/src/main/java/com/zkqy/web/controller/system/SysEngineeringController.java

@@ -0,0 +1,338 @@
+package com.zkqy.web.controller.system;
+
+import java.io.*;
+import java.net.URLEncoder;
+import java.nio.file.DirectoryStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.*;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipOutputStream;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServletResponse;
+
+import cn.hutool.core.io.FileUtil;
+import com.zkqy.common.annotation.Anonymous;
+import com.zkqy.common.config.ZkqyConfig;
+import com.zkqy.common.core.domain.entity.DataSource;
+import com.zkqy.common.core.domain.entity.SysUser;
+import com.zkqy.common.utils.DateUtils;
+import com.zkqy.common.utils.SecurityUtils;
+import com.zkqy.common.utils.ZipUtils;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.core.io.FileSystemResource;
+import org.springframework.core.io.Resource;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import com.zkqy.common.annotation.Log;
+import com.zkqy.common.core.controller.BaseController;
+import com.zkqy.common.core.domain.AjaxResult;
+import com.zkqy.common.enums.BusinessType;
+import com.zkqy.system.domain.SysEngineering;
+import com.zkqy.system.service.ISysEngineeringService;
+import com.zkqy.common.utils.poi.ExcelUtil;
+import com.zkqy.common.core.page.TableDataInfo;
+import org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody;
+
+/**
+ * 工程部署Controller
+ *
+ * @author zkqy
+ * @date 2024-01-03
+ */
+@RestController
+@RequestMapping("/system/engineering")
+public class SysEngineeringController extends BaseController {
+    @Autowired
+    private ISysEngineeringService sysEngineeringService;
+
+    /**
+     * 查询工程部署列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:engineering:list')")
+    @GetMapping("/list")
+    @ApiOperation(value = "查询工程部署列表")
+    public TableDataInfo list(SysEngineering sysEngineering) {
+        startPage();
+        List<SysEngineering> list = sysEngineeringService.selectSysEngineeringList(sysEngineering);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出工程部署列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:engineering:export')")
+    @Log(title = "工程部署", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    @ApiOperation(value = "导出工程部署列表")
+    public void export(HttpServletResponse response, SysEngineering sysEngineering) {
+        List<SysEngineering> list = sysEngineeringService.selectSysEngineeringList(sysEngineering);
+        ExcelUtil<SysEngineering> util = new ExcelUtil<SysEngineering>(SysEngineering.class);
+        util.exportExcel(response, list, "工程部署数据");
+    }
+
+    /**
+     * 获取工程部署详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:engineering:query')")
+    @GetMapping(value = "/{id}")
+    @ApiOperation(value = "获取工程部署详细信息")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return success(sysEngineeringService.selectSysEngineeringById(id));
+    }
+
+    /**
+     * 新增工程部署
+     */
+    @PreAuthorize("@ss.hasPermi('system:engineering:add')")
+    @Log(title = "工程部署", businessType = BusinessType.INSERT)
+    @PostMapping
+    @ApiOperation(value = "新增工程部署")
+    public AjaxResult add(@RequestBody SysEngineering sysEngineering) {
+        return toAjax(sysEngineeringService.insertSysEngineering(sysEngineering));
+    }
+
+    /**
+     * 修改工程部署
+     */
+    @PreAuthorize("@ss.hasPermi('system:engineering:edit')")
+    @Log(title = "工程部署", businessType = BusinessType.UPDATE)
+    @PutMapping
+    @ApiOperation(value = "修改工程部署")
+    public AjaxResult edit(@RequestBody SysEngineering sysEngineering) {
+        return toAjax(sysEngineeringService.updateSysEngineering(sysEngineering));
+    }
+
+    /**
+     * 删除工程部署
+     */
+    @PreAuthorize("@ss.hasPermi('system:engineering:remove')")
+    @Log(title = "工程部署", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    @ApiOperation(value = "删除工程部署")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(sysEngineeringService.deleteSysEngineeringByIds(ids));
+    }
+
+
+    @GetMapping("/largeFile")
+    public ResponseEntity<Resource> downloadLargeFile() {
+        // 调用Service层获取文件
+        File name = new File("/Users/zrwj/Downloads/123.zip");
+        // 调用 FileDownloadService 中的方法获取文件
+        if (Objects.isNull(name)) {
+            throw new RuntimeException("文件名称不能为空");
+        }
+        // directoryPath为服务器文件路径
+        String path = "" + name;
+        File file = new File(path);
+        HttpHeaders headers = new HttpHeaders();
+        headers.add("Cache-Control", "no-cache, no-store, must-revalidate");
+        headers.add("Content-Disposition", "attachment; filename=" + file.getName());
+        headers.add("Pragma", "no-cache");
+        headers.add("Expires", "0");
+        headers.add("Last-Modified", new Date().toString());
+        headers.add("ETag", String.valueOf(System.currentTimeMillis()));
+        return ResponseEntity
+                .ok()
+                .headers(headers)
+                .contentLength(file.length())
+                .contentType(MediaType.parseMediaType("application/octet-stream"))
+                .body(new FileSystemResource(file));
+
+    }
+
+    /**
+     * 下载压缩包
+     */
+    @GetMapping("/download")
+    public ResponseEntity<StreamingResponseBody> downloadZip() {
+        // 指定要打包的文件或目录路径
+        String sourceFilePath = ZkqyConfig.getUploadPath() + "/engineeringdownload/";
+
+        File dir = new File(sourceFilePath);
+        // 判断文件夹路径是否存在,不存在创建
+        if (!dir.exists()) {
+            boolean isCreated = dir.mkdirs();
+            if (!isCreated) {
+                System.out.println("目录 '" + sourceFilePath + "' 创建失败.");
+            }
+        }
+        //当前用户数据源信息
+        DataSource datasourceInfo = SecurityUtils.getDatasourceInfo();
+        //导出数据库集合
+        Set<String> databaseList = new LinkedHashSet<>();
+        databaseList.add("ry-vue-call");
+        //        databaseList.add("zkqy-template");
+//        databaseList.add("zkqy-call");
+        databaseList.add(datasourceInfo.getDatabaseName());
+        //将sql文件导出到指定目录下
+        exportMultipleDatabasesToLocal(databaseList, sourceFilePath, datasourceInfo);
+        //下载成功插入数据
+        SysUser sysUser = SecurityUtils.getLoginUser().getUser();
+        SysEngineering sysEngineering = new SysEngineering();
+        sysEngineering.setCreateTime(DateUtils.getNowDate());
+        sysEngineering.setDownloadTime(DateUtils.getNowDate());
+        sysEngineering.setEngineeringName(sysUser.getTenantName() + "-mes");
+        sysEngineeringService.insertSysEngineering(sysEngineering);
+
+        String zipFileName = new Date().getTime() + ".zip";
+        HttpHeaders headers = new HttpHeaders();
+        headers.add(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + zipFileName + "\"");
+        headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
+
+        return ResponseEntity.ok()
+                .headers(headers)
+                .contentType(MediaType.APPLICATION_OCTET_STREAM)
+                .body(outputStream -> {
+                    try (DirectoryStream<Path> directoryStream = Files.newDirectoryStream(Paths.get(sourceFilePath));
+                         ZipOutputStream zipOut = new ZipOutputStream(outputStream)) {
+                        addFilesToZipRecursively(zipOut, Paths.get(sourceFilePath), directoryStream);
+                    } catch (IOException e) {
+                        throw new RuntimeException("Failed to create the ZIP stream.", e);
+                    }
+                });
+    }
+
+
+    /**
+     * 下载压缩包
+     */
+
+    @Anonymous
+    @GetMapping("/download1")
+    public void downloadZip1(HttpServletResponse response) {
+        // 指定要打包的文件或目录路径
+        String sourceFilePath = ZkqyConfig.getUploadPath() + "/engineeringdownload/";
+        //当前用户数据源信息
+        DataSource datasourceInfo = SecurityUtils.getDatasourceInfo();
+        //导出数据库集合
+        Set<String> databaseList = new LinkedHashSet<>();
+        databaseList.add("ry-vue-call");
+        databaseList.add(datasourceInfo.getDatabaseName());
+        //将sql文件导出到指定目录下
+        exportMultipleDatabasesToLocal(databaseList, sourceFilePath, datasourceInfo);
+        //下载成功插入数据
+        SysUser sysUser = SecurityUtils.getLoginUser().getUser();
+        SysEngineering sysEngineering = new SysEngineering();
+        sysEngineering.setCreateTime(DateUtils.getNowDate());
+        sysEngineering.setDownloadTime(DateUtils.getNowDate());
+        sysEngineering.setEngineeringName(sysUser.getTenantName() + "-mes");
+        sysEngineeringService.insertSysEngineering(sysEngineering);
+        List<Map<String, String>> fileList = listFiles(sourceFilePath);
+        ZipUtils.createZip(response, fileList);
+    }
+
+
+    private void addFilesToZipRecursively(ZipOutputStream zipOut, Path rootPath, DirectoryStream<Path> dirStream) throws
+            IOException {
+        for (Path filePath : dirStream) {
+            if (Files.isDirectory(filePath)) {
+                // 添加目录条目到ZIP
+                String entryName = filePath.toString().substring(rootPath.toString().length() + 1) + "/";
+                zipOut.putNextEntry(new ZipEntry(entryName));
+                zipOut.closeEntry();
+
+                // 递归处理子目录中的文件
+                try (DirectoryStream<Path> subDirStream = Files.newDirectoryStream(filePath)) {
+                    addFilesToZipRecursively(zipOut, rootPath, subDirStream);
+                }
+            } else if (Files.isRegularFile(filePath)) {
+                // 添加文件到ZIP
+                String entryName = filePath.toString().substring(rootPath.toString().length() + 1);
+                zipOut.putNextEntry(new ZipEntry(entryName));
+
+                try (InputStream fileIn = Files.newInputStream(filePath)) {
+                    byte[] buffer = new byte[4096];
+                    int read;
+                    while ((read = fileIn.read(buffer)) != -1) {
+                        zipOut.write(buffer, 0, read);
+                    }
+                }
+
+                zipOut.closeEntry();
+            }
+        }
+    }
+
+    /**
+     * 导出数据库文件
+     */
+    private static final String MYSQLDUMP_PATH = "/usr/local/mysql/bin/mysqldump";
+//    private static final String OUTPUT_PATH = "sql/";
+
+    public void exportMultipleDatabasesToLocal(Set<String> databaseNames, String sourceFilePath, DataSource dataSource) {
+
+        String outputPath = sourceFilePath + "sql/" + SecurityUtils.getTenantId();
+
+        try {
+            Files.createDirectories(Paths.get(outputPath));
+
+            for (String databaseName : databaseNames) {
+                String dumpFileName = outputPath + "/" + databaseName + ".sql";
+                List<String> cmd = buildMysqldumpCommand(databaseName, dataSource);
+
+                ProcessBuilder pb = new ProcessBuilder(cmd);
+                pb.redirectOutput(new File(dumpFileName));
+
+                Process process = pb.start();
+                int exitCode = process.waitFor();
+
+                if (exitCode == 0) {
+                    System.out.println("数据库备份成功,导出文件: " + dumpFileName);
+                } else {
+                    System.err.println("mysqldump命令执行失败,退出代码: " + exitCode);
+                }
+            }
+        } catch (IOException | InterruptedException e) {
+            e.printStackTrace();
+        }
+    }
+
+    private List<String> buildMysqldumpCommand(String databaseName, DataSource dataSource) {
+        List<String> cmd = new ArrayList<>();
+        cmd.add(MYSQLDUMP_PATH);
+        cmd.add("-h");
+        cmd.add(dataSource.getDatabaseIp());
+        cmd.add("-u");
+        cmd.add(dataSource.getUsername());
+        cmd.add("-p" + dataSource.getPassword());
+        cmd.add(databaseName);
+        return cmd;
+    }
+
+    public static List<Map<String, String>> listFiles(String directoryPath) {
+        List<Map<String, String>> fileList = new ArrayList<>();
+        File directory = new File(directoryPath);
+
+        if (directory.exists() && directory.isDirectory()) {
+            listFilesRecursively(directory, fileList);
+        }
+
+        return fileList;
+    }
+
+    private static void listFilesRecursively(File directory, List<Map<String, String>> fileList) {
+        File[] files = directory.listFiles();
+
+        if (files != null) {
+            for (File file : files) {
+                if (file.isFile()) {
+                    Map<String, String> fileMap = new HashMap<>();
+                    fileMap.put("fileName", file.getName());
+                    fileMap.put("filePath", file.getAbsolutePath());
+                    fileList.add(fileMap);
+                } else if (file.isDirectory()) {
+                    listFilesRecursively(file, fileList);
+                }
+            }
+        }
+    }
+
+
+}

+ 41 - 5
zkqy-admin/src/main/java/com/zkqy/web/controller/system/SysLoginController.java

@@ -5,6 +5,7 @@ import java.util.Set;
 
 import com.zkqy.common.core.domain.entity.DataSource;
 import com.zkqy.common.core.domain.entity.SysTenant;
+import com.zkqy.framework.web.service.TokenService;
 import com.zkqy.system.service.IDataSourceService;
 import com.zkqy.system.service.impl.SysTenantServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -49,6 +50,9 @@ public class SysLoginController {
     @Resource
     private SysTenantServiceImpl sysTenantService;
 
+    @Resource
+    private TokenService tokenService;
+
     //@Resource
     //private IDataSourceService dataSourceService;
 
@@ -87,15 +91,47 @@ public class SysLoginController {
         //校验租户状态?生成token
         AjaxResult ajax = AjaxResult.success();
         //校验不能是admin
-        if(loginBody.getUsername().equals("admin")){
-          return AjaxResult.error("未有此用户信息");
+        if (loginBody.getUsername().equals("admin")) {
+            return AjaxResult.error("未有此用户信息");
+        }
+        // 生成令牌
+        String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(),
+                loginBody.getUuid());
+        if (tokenService.getLoginUserIsAdminByToken(token)) {
+            return AjaxResult.error("用户不存在!");
+        }
+        //检查租户过期时间
+        String checkTenantExpirationTimeMsg = loginService.checkTenantExpirationTime(loginBody.getUsername());
+        if (!checkTenantExpirationTimeMsg.isEmpty()) {
+            return AjaxResult.error(checkTenantExpirationTimeMsg);
+        }
+        ajax.put(Constants.TOKEN, token);
+        return ajax;
+    }
+
+    /**
+     * 登录方法
+     *
+     * @param loginBody 登录信息
+     * @return 结果
+     */
+    @PostMapping("/loginAdmin")
+    public AjaxResult loginAdmin(@Valid @RequestBody LoginBody loginBody, BindingResult bindingResult) {
+        if (bindingResult.hasErrors()) {
+            return AjaxResult.error(bindingResult.getFieldError().getDefaultMessage());
+        }
+        //校验租户状态?生成token
+        AjaxResult ajax = AjaxResult.success();
+        //校验不能是admin
+        if (loginBody.getUsername().equals("admin")) {
+            return AjaxResult.error("未有此用户信息");
         }
         // 生成令牌
         String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(),
                 loginBody.getUuid());
         //检查租户过期时间
-        String  checkTenantExpirationTimeMsg= loginService.checkTenantExpirationTime(loginBody.getUsername());
-        if(!checkTenantExpirationTimeMsg.isEmpty()){
+        String checkTenantExpirationTimeMsg = loginService.checkTenantExpirationTime(loginBody.getUsername());
+        if (!checkTenantExpirationTimeMsg.isEmpty()) {
             return AjaxResult.error(checkTenantExpirationTimeMsg);
         }
         ajax.put(Constants.TOKEN, token);
@@ -124,7 +160,7 @@ public class SysLoginController {
             SysTenant sysTenant = sysTenantService.selectSysTenantByTenantId(user.getTenantId());
             ajax.put("tenant", sysTenant);
             //数据源信息
-            //DataSource dataSource = dataSourceService.selectById(sysTenant.getDatasourceId());
+            // DataSource dataSource = dataSourceService.selectById(sysTenant.getDatasourceId());
             ajax.put("dataSource", null);
         }
         return ajax;

+ 1 - 0
zkqy-admin/src/main/java/com/zkqy/web/controller/system/SysPostController.java

@@ -54,6 +54,7 @@ public class SysPostController extends BaseController
     @PostMapping("/export")
     public void export(HttpServletResponse response, SysPost post)
     {
+        post.setTenantId(getTenantId());
         List<SysPost> list = postService.selectPostList(post);
         ExcelUtil<SysPost> util = new ExcelUtil<SysPost>(SysPost.class);
         util.exportExcel(response, list, "岗位数据");

+ 1 - 0
zkqy-admin/src/main/java/com/zkqy/web/controller/system/SysRoleController.java

@@ -72,6 +72,7 @@ public class SysRoleController extends BaseController
     @PostMapping("/export")
     public void export(HttpServletResponse response, SysRole role)
     {
+        role.setTenantId(getTenantId());
         List<SysRole> list = roleService.selectRoleList(role);
         ExcelUtil<SysRole> util = new ExcelUtil<SysRole>(SysRole.class);
         util.exportExcel(response, list, "角色数据");

+ 41 - 55
zkqy-admin/src/main/java/com/zkqy/web/controller/system/SysUserController.java

@@ -38,13 +38,12 @@ import com.zkqy.system.service.ISysUserService;
 
 /**
  * 用户信息
- * 
+ *
  * @author ruoyi
  */
 @RestController
 @RequestMapping("/system/user")
-public class SysUserController extends BaseController
-{
+public class SysUserController extends BaseController {
     @Autowired
     private ISysUserService userService;
 
@@ -62,8 +61,7 @@ public class SysUserController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('system:user:list')")
     @GetMapping("/list")
-    public TableDataInfo list(SysUser user)
-    {
+    public TableDataInfo list(SysUser user) {
         startPage();
         if (getLoginUser().isTenantAdmin()) {
             user.setTenantId(getTenantId());
@@ -75,8 +73,11 @@ public class SysUserController extends BaseController
     @Log(title = "用户管理", businessType = BusinessType.EXPORT)
     @PreAuthorize("@ss.hasPermi('system:user:export')")
     @PostMapping("/export")
-    public void export(HttpServletResponse response, SysUser user)
-    {
+    public void export(HttpServletResponse response, SysUser user, List<String> uIds) {
+        if (uIds != null && uIds.size() != 0) {
+            // 导出指定用户集合
+
+        }
         List<SysUser> list = userService.selectUserList(user);
         ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
         util.exportExcel(response, list, "用户数据");
@@ -85,8 +86,7 @@ public class SysUserController extends BaseController
     @Log(title = "用户管理", businessType = BusinessType.IMPORT)
     @PreAuthorize("@ss.hasPermi('system:user:import')")
     @PostMapping("/importData")
-    public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
-    {
+    public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception {
         ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
         List<SysUser> userList = util.importExcel(file.getInputStream());
         String operName = getUsername();
@@ -95,8 +95,7 @@ public class SysUserController extends BaseController
     }
 
     @PostMapping("/importTemplate")
-    public void importTemplate(HttpServletResponse response)
-    {
+    public void importTemplate(HttpServletResponse response) {
         ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
         util.importTemplateExcel(response, "用户数据");
     }
@@ -105,28 +104,26 @@ public class SysUserController extends BaseController
      * 根据用户编号获取详细信息
      */
     @PreAuthorize("@ss.hasPermi('system:user:query')")
-    @GetMapping(value = { "/", "/{userId}" })
-    public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId)
-    {
+    @GetMapping(value = {"/", "/{userId}"})
+    public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId) {
         userService.checkUserDataScope(userId);
         AjaxResult ajax = AjaxResult.success();
         List<SysRole> roles = roleService.selectRoleAll();
         roles.forEach(r -> {
-            if(r.getTenantId() == null){
+            if (r.getTenantId() == null) {
                 r.setTenantId(0L);
             }
         });
         List<SysPost> sysPosts = postService.selectPostAll();
         sysPosts.forEach(s -> {
-            if (s.getTenantId() == null){
+            if (s.getTenantId() == null) {
                 s.setTenantId(0L);
             }
         });
 
         ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin() && r.getTenantId().equals(getTenantId())).collect(Collectors.toList()));
         ajax.put("posts", sysPosts.stream().filter(p -> p.getTenantId().equals(getTenantId())).collect(Collectors.toList()));
-        if (StringUtils.isNotNull(userId))
-        {
+        if (StringUtils.isNotNull(userId)) {
             SysUser sysUser = userService.selectUserById(userId);
             ajax.put(AjaxResult.DATA_TAG, sysUser);
             ajax.put("postIds", postService.selectPostListByUserId(userId));
@@ -141,18 +138,12 @@ public class SysUserController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:user:add')")
     @Log(title = "用户管理", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@Validated @RequestBody SysUser user)
-    {
-        if (!userService.checkUserNameUnique(user))
-        {
+    public AjaxResult add(@Validated @RequestBody SysUser user) {
+        if (!userService.checkUserNameUnique(user)) {
             return error("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
-        }
-        else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user))
-        {
+        } else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) {
             return error("新增用户'" + user.getUserName() + "'失败,手机号码已存在");
-        }
-        else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user))
-        {
+        } else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) {
             return error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在");
         }
         user.setCreateBy(getUsername());
@@ -170,20 +161,14 @@ public class SysUserController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:user:edit')")
     @Log(title = "用户管理", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@Validated @RequestBody SysUser user)
-    {
+    public AjaxResult edit(@Validated @RequestBody SysUser user) {
         userService.checkUserAllowed(user);
         userService.checkUserDataScope(user.getUserId());
-        if (!userService.checkUserNameUnique(user))
-        {
+        if (!userService.checkUserNameUnique(user)) {
             return error("修改用户'" + user.getUserName() + "'失败,登录账号已存在");
-        }
-        else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user))
-        {
+        } else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) {
             return error("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
-        }
-        else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user))
-        {
+        } else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) {
             return error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
         }
         user.setUpdateBy(getUsername());
@@ -196,10 +181,8 @@ public class SysUserController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:user:remove')")
     @Log(title = "用户管理", businessType = BusinessType.DELETE)
     @DeleteMapping("/{userIds}")
-    public AjaxResult remove(@PathVariable Long[] userIds)
-    {
-        if (ArrayUtils.contains(userIds, getUserId()))
-        {
+    public AjaxResult remove(@PathVariable Long[] userIds) {
+        if (ArrayUtils.contains(userIds, getUserId())) {
             return error("当前用户不能删除");
         }
         return toAjax(userService.deleteUserByIds(userIds));
@@ -211,8 +194,7 @@ public class SysUserController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:user:resetPwd')")
     @Log(title = "用户管理", businessType = BusinessType.UPDATE)
     @PutMapping("/resetPwd")
-    public AjaxResult resetPwd(@RequestBody SysUser user)
-    {
+    public AjaxResult resetPwd(@RequestBody SysUser user) {
         userService.checkUserAllowed(user);
         userService.checkUserDataScope(user.getUserId());
         user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
@@ -226,8 +208,7 @@ public class SysUserController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:user:edit')")
     @Log(title = "用户管理", businessType = BusinessType.UPDATE)
     @PutMapping("/changeStatus")
-    public AjaxResult changeStatus(@RequestBody SysUser user)
-    {
+    public AjaxResult changeStatus(@RequestBody SysUser user) {
         userService.checkUserAllowed(user);
         userService.checkUserDataScope(user.getUserId());
         user.setUpdateBy(getUsername());
@@ -239,8 +220,7 @@ public class SysUserController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('system:user:query')")
     @GetMapping("/authRole/{userId}")
-    public AjaxResult authRole(@PathVariable("userId") Long userId)
-    {
+    public AjaxResult authRole(@PathVariable("userId") Long userId) {
         AjaxResult ajax = AjaxResult.success();
         SysUser user = userService.selectUserById(userId);
         List<SysRole> roles = roleService.selectRolesByUserId(userId);
@@ -254,8 +234,7 @@ public class SysUserController extends BaseController
      */
     @Anonymous
     @GetMapping("/roleKeyByUserId/{userId}")
-    public AjaxResult roleKeyByUserId(@PathVariable("userId") Long userId)
-    {
+    public AjaxResult roleKeyByUserId(@PathVariable("userId") Long userId) {
         AjaxResult ajax = AjaxResult.success();
         String[] strings = roleService.selectRolesKeyByUserId(userId);
         ajax.put("rolesKey", JSON.toJSONString(strings));
@@ -268,8 +247,7 @@ public class SysUserController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:user:edit')")
     @Log(title = "用户管理", businessType = BusinessType.GRANT)
     @PutMapping("/authRole")
-    public AjaxResult insertAuthRole(Long userId, Long[] roleIds)
-    {
+    public AjaxResult insertAuthRole(Long userId, Long[] roleIds) {
         userService.checkUserDataScope(userId);
         userService.insertUserAuth(userId, roleIds);
         return success();
@@ -280,8 +258,7 @@ public class SysUserController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('system:user:list')")
     @GetMapping("/deptTree")
-    public AjaxResult deptTree(SysDept dept)
-    {
+    public AjaxResult deptTree(SysDept dept) {
         if (getLoginUser().isTenantAdmin()) {
             dept.setTenantId(getTenantId());
         }
@@ -292,7 +269,16 @@ public class SysUserController extends BaseController
      * 查询所有用户
      */
     @GetMapping("/selectAllUser")
-    public AjaxResult selectAllUser(){
+    public AjaxResult selectAllUser() {
         return AjaxResult.success(userService.selectAllUser());
     }
+
+    /**
+     * 校验用户账号
+     */
+    @GetMapping("/isExistUser")
+    public AjaxResult isExistUser(String userName) {
+        return AjaxResult.success(userService.isExistUser(userName));
+    }
+
 }

+ 175 - 0
zkqy-admin/src/main/java/com/zkqy/web/controller/tool/daochuController.java

@@ -0,0 +1,175 @@
+package com.zkqy.web.controller.tool;
+
+import com.zkqy.common.config.ZkqyConfig;
+import com.zkqy.common.core.domain.entity.DataSource;
+import com.zkqy.common.core.domain.entity.SysUser;
+import com.zkqy.common.utils.DateUtils;
+import com.zkqy.common.utils.SecurityUtils;
+import com.zkqy.common.utils.ZipUtils;
+import com.zkqy.system.domain.SysEngineering;
+import com.zkqy.system.service.ISysEngineeringService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.file.DirectoryStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.*;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.locks.ReentrantLock;
+import java.util.stream.Collectors;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipOutputStream;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+
+@RestController
+@RequestMapping("/download/project-db")
+public class daochuController {
+
+    @Autowired
+    private ISysEngineeringService sysEngineeringService;
+    @Autowired
+    private ThreadPoolTaskExecutor taskExecutor;
+    private static final String MYSQLDUMP_PATH = "/usr/local/mysql/bin/mysqldump";
+    private static final String SQL_OUTPUT_PATH = "sql";
+
+
+    @GetMapping("/zip")
+    public void downloadZip1(HttpServletResponse response) {
+        String sourceFilePath = ZkqyConfig.getUploadPath() + "/engineeringdownload/";
+        DataSource datasourceInfo = SecurityUtils.getDatasourceInfo();
+        SysUser sysUser = SecurityUtils.getLoginUser().getUser();
+        String tenantid = sysUser.getTenant().getTenantId().toString();
+        // 使用 Arrays.asList 转换数组为集合
+        List<String> databaseList = Arrays.asList("ry-vue-call", datasourceInfo.getDatabaseName());
+        List<CompletableFuture<Void>> exportFutures = databaseList.stream()
+                .map(databaseName -> CompletableFuture.runAsync(
+                                () -> exportDatabase(databaseName, sourceFilePath, datasourceInfo, tenantid), taskExecutor)
+                        .exceptionally(throwable -> {
+                            throwable.printStackTrace();
+                            return null;
+                        })
+                )
+                .collect(Collectors.toList());
+        CompletableFuture<Void> allOf = CompletableFuture.allOf(
+                exportFutures.toArray(new CompletableFuture[0])
+        );
+        try {
+            allOf.get(10, TimeUnit.MINUTES);
+        } catch (InterruptedException | ExecutionException | TimeoutException e) {
+            e.printStackTrace();
+        }
+        SysEngineering sysEngineering = new SysEngineering();
+        sysEngineering.setCreateTime(DateUtils.getNowDate());
+        sysEngineering.setDownloadTime(DateUtils.getNowDate());
+        sysEngineering.setEngineeringName(sysUser.getTenantName() + "-MES");
+        sysEngineering.setTenantId(sysUser.getTenantId());
+        sysEngineeringService.insertSysEngineering(sysEngineering);
+        List<Map<String, String>> fileList = listFiles(sourceFilePath);
+        ZipUtils.createZip(response, fileList);
+    }
+
+
+    private void addFilesToZipRecursively(ZipOutputStream zipOut, Path rootPath, DirectoryStream<Path> dirStream) throws
+            IOException {
+        for (Path filePath : dirStream) {
+            if (Files.isDirectory(filePath)) {
+                // 添加目录条目到ZIP
+                String entryName = filePath.toString().substring(rootPath.toString().length() + 1) + "/";
+                zipOut.putNextEntry(new ZipEntry(entryName));
+                zipOut.closeEntry();
+                // 递归处理子目录中的文件
+                try (DirectoryStream<Path> subDirStream = Files.newDirectoryStream(filePath)) {
+                    addFilesToZipRecursively(zipOut, rootPath, subDirStream);
+                }
+            } else if (Files.isRegularFile(filePath)) {
+                // 添加文件到ZIP
+                String entryName = filePath.toString().substring(rootPath.toString().length() + 1);
+                zipOut.putNextEntry(new ZipEntry(entryName));
+                try (InputStream fileIn = Files.newInputStream(filePath)) {
+                    byte[] buffer = new byte[4096];
+                    int read;
+                    while ((read = fileIn.read(buffer)) != -1) {
+                        zipOut.write(buffer, 0, read);
+                    }
+                }
+                zipOut.closeEntry();
+            }
+        }
+    }
+
+    private List<String> buildMysqldumpCommand(String databaseName, DataSource dataSource) {
+        // 使用 Arrays.asList 创建不可变 List
+        return new ArrayList<>(Arrays.asList(
+                MYSQLDUMP_PATH,
+                "-h", dataSource.getDatabaseIp(),
+                "-u", dataSource.getUsername(),
+                "-p" + dataSource.getPassword(),
+                databaseName
+        ));
+    }
+
+    public static List<Map<String, String>> listFiles(String directoryPath) {
+        List<Map<String, String>> fileList = new ArrayList<>();
+        File directory = new File(directoryPath);
+        if (directory.exists() && directory.isDirectory()) {
+            listFilesRecursively(directory, fileList);
+        }
+        return fileList;
+    }
+
+    private static void listFilesRecursively(File directory, List<Map<String, String>> fileList) {
+        File[] files = directory.listFiles();
+        if (files != null) {
+            for (File file : files) {
+                if (file.isFile()) {
+                    Map<String, String> fileMap = new HashMap<>();
+                    fileMap.put("fileName", file.getName());
+                    fileMap.put("filePath", file.getAbsolutePath());
+                    fileList.add(fileMap);
+                } else if (file.isDirectory()) {
+                    listFilesRecursively(file, fileList);
+                }
+            }
+        }
+    }
+
+    private void exportDatabase(String databaseName, String sourceFilePath, DataSource dataSource, String tenantId) {
+        String outputPath = sourceFilePath + SQL_OUTPUT_PATH + File.separator + tenantId;
+        try {
+            Files.createDirectories(Paths.get(outputPath));
+            String dumpFileName = outputPath + File.separator + databaseName + ".sql";
+            List<String> cmd = buildMysqldumpCommand(databaseName, dataSource);
+            ProcessBuilder pb = new ProcessBuilder(cmd);
+            pb.redirectOutput(new File(dumpFileName));
+            Process process = pb.start();
+            // 设置导出超时时间为10分钟
+            if (!process.waitFor(10, TimeUnit.MINUTES)) {
+                process.destroyForcibly(); // 超时则强制销毁进程
+                throw new TimeoutException("导出数据库超时");
+            }
+            int exitCode = process.exitValue();
+
+            if (exitCode == 0) {
+                System.out.println("数据库备份成功。导出文件:" + dumpFileName);
+            } else {
+                System.err.println("执行mysqldump命令时发生错误。退出代码:" + exitCode);
+            }
+        } catch (IOException | InterruptedException | TimeoutException e) {
+            e.printStackTrace();
+        }
+    }
+
+}

+ 47 - 0
zkqy-admin/src/main/java/com/zkqy/web/ljj.java

@@ -0,0 +1,47 @@
+package com.zkqy.web;
+
+import com.zkqy.common.annotation.Anonymous;
+import org.junit.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.concurrent.CompletableFuture;
+
+
+@Anonymous
+@RestController
+@RequestMapping("/test")
+public class ljj {
+    @Autowired
+    private ThreadPoolTaskExecutor threadPoolTaskExecutor;
+
+    @GetMapping("/asd")
+    public void main11() {
+        // 多线程调用
+        for (int i = 0; i < 1000000; i++) {
+            int finalI = i;
+            CompletableFuture.runAsync(() -> {
+                System.err.println(hashCode(finalI) + "线程ID:" + Thread.currentThread().getId() + "线程NAME:" + Thread.currentThread().getName());
+            }, threadPoolTaskExecutor).exceptionally(e -> {
+                System.out.println(e);
+                return null;
+            });
+        }
+    }
+
+    public int hashCode(int i) {
+        if (i % 3 == 0) {
+            System.out.println("🚀🚀🚀🚀🚀");
+            new Exception();
+            return 999;
+
+        } else {
+            return i;
+        }
+    }
+
+
+}

+ 9 - 0
zkqy-admin/src/main/resources/application.yml

@@ -35,9 +35,18 @@ server:
 
 # 日志配置
 logging:
+  # 定义全局日志级别,此处可以针对不同包或类设置不同的日志输出级别
   level:
+    # 设置com.zkqy包及其子包下的日志级别为debug
     com.zkqy: debug
+    # 设置org.springframework包及其子包下的日志级别为warn
     org.springframework: warn
+  # 文件日志相关配置
+  file:
+    # 指定日志文件的输出目录
+    # 此处将所有生成的日志文件存储在D:/rz/logs路径下(日志文件必须名为)
+    # logback-spring.xml中可以读取这个配置项(注意:日志配置文件必须叫logback-spring.xml)
+    path: D:/logs
 
 # 用户配置
 user:

BIN
zkqy-admin/src/main/resources/lib/DmJdbcDriver18.jar


+ 4 - 1
zkqy-admin/src/main/resources/logback.xml → zkqy-admin/src/main/resources/logback-spring.xml

@@ -1,7 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <configuration>
     <!-- 日志存放路径 -->
-	<property name="log.path" value="./logs" />
+    <!--<property name="log.path" value="./logs" />-->
+    <!-- 日志存放路径 -->
+    <!-- 引入Spring Boot的环境变量 文件名必须叫 logback-spring 否则不能引用logging.file.path -->
+    <springProperty scope="context" name="log.path" source="logging.file.path"/>
     <!-- 日志输出格式 -->
 	<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
 

+ 1 - 0
zkqy-business/pom.xml

@@ -35,6 +35,7 @@
             <artifactId>zkqy-process-execution</artifactId>
             <version>3.8.5</version>
         </dependency>
+
     </dependencies>
 
     <properties>

+ 61 - 37
zkqy-business/src/main/java/com/zkqy/business/controller/CommonBtnController.java

@@ -6,8 +6,10 @@ import com.zkqy.business.entity.DragTableBtn;
 import com.zkqy.business.service.IDragFormService;
 import com.zkqy.business.service.IDragTableBtnService;
 import com.zkqy.business.service.IDragTableGroupService;
+import com.zkqy.common.annotation.Log;
 import com.zkqy.common.core.controller.BaseController;
 import com.zkqy.common.core.domain.AjaxResult;
+import com.zkqy.common.enums.BusinessType;
 import com.zkqy.common.utils.form.FromUtils;
 import com.zkqy.execution.produce.dispersed.entity.CommonEntity;
 import com.zkqy.execution.produce.dispersed.runbpm.PreExecutionToolClass;
@@ -15,6 +17,7 @@ import com.zkqy.execution.produce.dispersed.runbpm.RunImplementationClass;
 import com.zkqy.execution.produce.dispersed.service.ICommonService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
+
 import javax.annotation.Resource;
 import java.util.HashMap;
 import java.util.Map;
@@ -54,10 +57,17 @@ public class CommonBtnController extends BaseController {
      * 判断什么类型走什么接口: visible  false代表弹窗未开启时走回显表单模板及数据信息接口;true代表弹窗开启时走保存数据接口
      * 是否提交表单操作 true是 false回显表单数据  commonEntity.getBasicMap().get("visible").toString()
      */
+
     @PostMapping("/commonBtnHandle")
+    @Log(title = "动态按钮操作", businessType = BusinessType.OTHER)
     public AjaxResult commonBtnHandle(@RequestBody CommonEntity commonEntity) throws JsonProcessingException {
         // 获取到按钮类型
         String btnType = commonEntity.getBasicMap().get("btnType").toString();
+        //查询当前按钮详情
+        DragTableBtn dragTableBtn = new DragTableBtn();
+        if (commonEntity.getBasicMap().get("btnKey") != null && !commonEntity.getBasicMap().get("btnKey").toString().isEmpty()) {
+            dragTableBtn = iDragTableBtnService.selectDragTableBtnByBtnKey(commonEntity.getBasicMap().get("btnKey").toString());
+        }
         /**
          * 发起流程类型(需要特定参数),
          * 启动脚本类型(执行特定脚本无需传递参数)
@@ -66,13 +76,13 @@ public class CommonBtnController extends BaseController {
             case "INSERT":
                 return insertBtn(commonEntity);
             case "UPDATE":
-                return updateBtn(commonEntity);
+                return updateBtn(commonEntity, dragTableBtn);
             case "DELETE":
                 return deleteBtn(commonEntity);
             case "EXECUTE":  // 执行脚本
-                return executeBtn(commonEntity);
+                return executeBtn(commonEntity, dragTableBtn);
             case "INITIATED":  // 发起流程
-                return initiatedBtn(commonEntity);
+                return initiatedBtn(commonEntity, dragTableBtn);
             default:
                 return warn("暂不支持该操作!");
         }
@@ -84,7 +94,6 @@ public class CommonBtnController extends BaseController {
      * @param commonEntity
      * @return
      */
-
     public AjaxResult insertBtn(CommonEntity commonEntity) throws JsonProcessingException {
         if (commonEntity.getBasicMap().get("visible").toString().equals("true")) {
             return AjaxResult.btnMessage(commonService.batchInsert(commonEntity));
@@ -103,12 +112,10 @@ public class CommonBtnController extends BaseController {
      * @param commonEntity
      * @return
      */
-    public AjaxResult updateBtn(CommonEntity commonEntity) throws JsonProcessingException {
+    public AjaxResult updateBtn(CommonEntity commonEntity, DragTableBtn dragTableBtn) throws JsonProcessingException {
         //是否开启弹窗
         if (commonEntity.getBasicMap().get("visible").toString().equals("true")) {
             if (commonEntity.getBasicMap().containsKey("btnKey")) {  // 按钮提交时会触发别的操作
-                // 根据按钮别名查询按钮详细信息
-                DragTableBtn dragTableBtn = iDragTableBtnService.selectDragTableBtnByBtnKey(commonEntity.getBasicMap().get("btnKey").toString());
                 // 根据流程的key判断当前按钮是否执行触发流程
                 if (!dragTableBtn.getBtnProcessKey().isEmpty()) {
                     // 调用发起流程接口
@@ -120,12 +127,13 @@ public class CommonBtnController extends BaseController {
                 } else if (!dragTableBtn.getBtnScriptKey().isEmpty()) {
                     // 调用执行脚本接口
                     logger.info("执行脚本接口");
-                     fromUtils.triggerScript(commonEntity);
+                    fromUtils.triggerScript(commonEntity);
                     //IScriptEntity iScriptEntity = new IScriptEntity();
                     //iScriptEntity.setScriptFlowKey(commonEntity.toString()); // 脚本别名
                     //irunImplementationClass.RunScriptImplementationClassLogicCode(iScriptEntity,commonEntity.toString());
                 }
             }
+            commonEntity.getCommMap().putAll(commonEntity.getBtnParametersMap());
             return toAjax(commonService.edit(commonEntity));
         } else if (commonEntity.getBasicMap().get("visible").toString().equals("false")) {
             Map<String, Object> map = new HashMap<>();
@@ -143,6 +151,7 @@ public class CommonBtnController extends BaseController {
 
     /**
      * 删除类型按钮
+     *
      * @param commonEntity
      * @return
      */
@@ -156,15 +165,11 @@ public class CommonBtnController extends BaseController {
      * @param commonEntity
      * @return
      */
-    public AjaxResult executeBtn(CommonEntity commonEntity) throws JsonProcessingException {
+    public AjaxResult executeBtn(CommonEntity commonEntity, DragTableBtn dragTableBtn) throws JsonProcessingException {
         if (commonEntity.getBasicMap().get("visible").toString().equals("true")) {
-            if (commonEntity.getBasicMap().containsKey("btnKey")) {  // 按钮提交时会触发别的操作
-                // 根据按钮别名查询按钮详细信息
-                DragTableBtn dragTableBtn = iDragTableBtnService.selectDragTableBtnByBtnKey(commonEntity.getBasicMap().get("btnKey").toString());
-                if (!dragTableBtn.getBtnScriptKey().isEmpty()) {
-                    // 调用执行脚本接口
-                    fromUtils.triggerScript(commonEntity);
-                }
+            if (!dragTableBtn.getBtnScriptKey().isEmpty()) {
+                // 调用执行脚本接口
+                fromUtils.triggerScript(commonEntity);
             }
             commonService.edit(commonEntity);
             return AjaxResult.success("执行脚本成功!");
@@ -186,39 +191,58 @@ public class CommonBtnController extends BaseController {
      * @param commonEntity
      * @return
      */
-    public AjaxResult initiatedBtn(CommonEntity commonEntity) throws JsonProcessingException {
+    public AjaxResult initiatedBtn(CommonEntity commonEntity, DragTableBtn dragTableBtn) throws JsonProcessingException {
         //是否开启弹窗
         if (commonEntity.getBasicMap().get("visible").toString().equals("true")) {
-            if (commonEntity.getBasicMap().containsKey("btnKey")) {  // 按钮提交时会触发别的操作
-                // 根据按钮别名查询按钮详细信息
-                DragTableBtn dragTableBtn = iDragTableBtnService.selectDragTableBtnByBtnKey(commonEntity.getBasicMap().get("btnKey").toString());
-                // 根据流程的key判断当前按钮是否执行触发流程
-                if (!dragTableBtn.getBtnProcessKey().isEmpty()) {
-                    //  表示对当前操作是及时选择的流程模板
-                    if (dragTableBtn.getBtnProcessKey().equals("unknown")) {
-                        // 调用发起流程接口
-                        //fromUtils.runBpmProductionScheduling(commonEntity);
-                        ipreExecutionToolClass.ReadyToExecute(commonEntity);
-                    } else {
-                        // 执行当前按钮绑定的流程-》暂无直接执行流程
+            // 根据流程的key判断当前按钮是否执行触发流程
+            if (!dragTableBtn.getBtnProcessKey().isEmpty()) {
+                //  表示对当前操作是及时选择的流程模板
+                if (dragTableBtn.getBtnProcessKey() != null && !dragTableBtn.getBtnProcessKey().isEmpty()) {
+                    if (commonEntity.getCommMap().get("process_key") == null) {
+                        commonEntity.getCommMap().put("process_key", dragTableBtn.getBtnProcessKey());
                     }
+                    // 调用发起流程接口
+                    ipreExecutionToolClass.ReadyToExecute(commonEntity);
+                } else {
+                    // 执行当前按钮绑定的流程-》暂无直接执行流程
                 }
             }
             toAjax(commonService.edit(commonEntity));
             return AjaxResult.success("启动流程成功!");
         } else if (commonEntity.getBasicMap().get("visible").toString().equals("false")) {
             Map<String, Object> map = new HashMap<>();
-            // 单纯是表格还是弹窗里有表格
-            String sqlKey = commonEntity.getBasicMap().get("sqlKey").toString();
-            DragForm dragForm = dragFormService.selectDragFormBySqlKey(sqlKey);
-            map.put("template", dragForm);
-            // 返回结果
-            map.put("result", commonService.getInfoById(commonEntity));
-            return success(map);
+            DragForm dragForm;
+            // 如果当前按钮绑定了表单则
+            // 判断当前表单的类型
+            if (dragTableBtn.getBtnFormType().equals("single")) {  // 单个表单
+                // 目前只是单个表单的模版
+                dragForm = dragFormService.selectDragFormByformKey(dragTableBtn.getBtnFormKey());
+                // 查询当前表的条件
+                CommonEntity commonEntity1 = new CommonEntity();
+                commonEntity1.getBasicMap().put("tableName", dragForm.getDfTableName());
+                commonEntity1.getConditionMap().putAll(commonEntity.getConditionMap());
+                // 返回结果
+                map.put("result", commonService.getInfoById(commonEntity1));
+                map.put("template", dragForm);
+                // 展示当前按钮绑定的表单
+                return success(map);
+            } else if (dragTableBtn.getBtnFormType().equals("multiple")) {  // 多个表单
+
+            } else if (dragTableBtn.getBtnFormType().equals("other")) {// 其他表单
+
+            } else {
+                // 单纯是表格还是弹窗里有表格
+                String sqlKey = commonEntity.getBasicMap().get("sqlKey").toString();
+                dragForm = dragFormService.selectDragFormBySqlKey(sqlKey);
+                map.put("template", dragForm);
+                // 返回结果
+                map.put("result", commonService.getInfoById(commonEntity));
+                return success(map);
+            }
         } else {
-            // return warn("暂不支持该操作!");
             return AjaxResult.error("发起流程失败!");
         }
+        return AjaxResult.error("发起流程失败!");
     }
 
 

+ 7 - 1
zkqy-business/src/main/java/com/zkqy/business/controller/CommonController.java

@@ -2,10 +2,12 @@ package com.zkqy.business.controller;
 
 import com.zkqy.business.entity.DragForm;
 import com.zkqy.business.service.*;
+import com.zkqy.common.annotation.Log;
 import com.zkqy.common.constant.ButtonTypeConstants;
 import com.zkqy.common.core.controller.BaseController;
 import com.zkqy.common.core.domain.AjaxResult;
 import com.zkqy.common.core.page.TableDataInfo;
+import com.zkqy.common.enums.BusinessType;
 import com.zkqy.common.exception.tenantdatassource.TenantDataSource;
 import com.zkqy.execution.produce.dispersed.entity.CommonEntity;
 import com.zkqy.execution.produce.dispersed.entity.TableSql;
@@ -48,6 +50,7 @@ public class CommonController extends BaseController {
     /**
      * 共通批量新增
      */
+    @Log(title = "动态表单", businessType = BusinessType.INSERT)
     @PostMapping("/batchInsert")
     public AjaxResult batchInsert(@RequestBody CommonEntity commonEntity) {
         return toAjax(commonService.batchInsert(commonEntity));
@@ -57,6 +60,7 @@ public class CommonController extends BaseController {
      * 共通修改sql
      */
     @PutMapping("/batchEdit")
+    @Log(title = "动态表单", businessType = BusinessType.UPDATE)
     public AjaxResult edit(@RequestBody CommonEntity commonEntity) {
         return toAjax(commonService.edit(commonEntity));
     }
@@ -67,6 +71,7 @@ public class CommonController extends BaseController {
      * 批量删除
      */
     @DeleteMapping("/batchDelete")
+    @Log(title = "动态表单", businessType = BusinessType.DELETE)
     public AjaxResult batchDelete(@RequestBody CommonEntity commonEntity) {
         return toAjax(commonService.batchDelete(commonEntity));
     }
@@ -88,8 +93,9 @@ public class CommonController extends BaseController {
     @GetMapping("/getTableList")
     public TableDataInfo queryTableList(CommonEntity commonEntity) throws TenantDataSource {
         TableSql tableSql = iTableSqlService.selectTableSqlByTSqlKey(commonEntity.getQueryMap().get("sqlkey").toString());
+        String tableFormat = dragTableService.getTableFormatBySqlKey(tableSql.getSqlKey());
         startPage();  // 校验是否sqlserver 否执行 是执行另一种方式的分页
-        return getDataTable(commonService.queryGroupTableList(commonEntity, tableSql));
+        return getDataTable(commonService.queryGroupTableList(commonEntity, tableSql,tableFormat));
     }
 
     /**

+ 16 - 3
zkqy-business/src/main/java/com/zkqy/business/entity/DragForm.java

@@ -18,6 +18,9 @@ public class DragForm extends BaseEntity {
      */
     private Long fId;
 
+    /** 表单key */
+    private String formKey;
+
     /**
      * sql编号
      */
@@ -92,13 +95,13 @@ public class DragForm extends BaseEntity {
     /**
      * 备用列
      */
-    @Excel(name = "备用列")
+
     private String spare;
 
     /**
      * 备用列
      */
-    @Excel(name = "备用列")
+
     private String spare1;
 
     //动态表格编号
@@ -113,6 +116,14 @@ public class DragForm extends BaseEntity {
         this.fId = fId;
     }
 
+    public String getFormKey() {
+        return formKey;
+    }
+
+    public void setFormKey(String formKey) {
+        this.formKey = formKey;
+    }
+
     public String getSqlKey() {
         return sqlKey;
     }
@@ -237,6 +248,7 @@ public class DragForm extends BaseEntity {
     public String toString() {
         return "DragForm{" +
                 "fId=" + fId +
+                ", formKey='" + formKey + '\'' +
                 ", sqlKey='" + sqlKey + '\'' +
                 ", dfName='" + dfName + '\'' +
                 ", dfNickname='" + dfNickname + '\'' +
@@ -259,8 +271,9 @@ public class DragForm extends BaseEntity {
 
     }
 
-    public DragForm(Long fId, String sqlKey, String dfName, String dfNickname, String dfVueTemplate, String dfHtmlTemplate, String dfFormSql, Long dfNodeId, String dfDatabase, String dfTableName, String dfFliePath, String dfNotes, String delFlag, String spare, String spare1, Long dtId) {
+    public DragForm(Long fId,String formKey, String sqlKey, String dfName, String dfNickname, String dfVueTemplate, String dfHtmlTemplate, String dfFormSql, Long dfNodeId, String dfDatabase, String dfTableName, String dfFliePath, String dfNotes, String delFlag, String spare, String spare1, Long dtId) {
         this.fId = fId;
+        this.formKey = formKey;
         this.sqlKey = sqlKey;
         this.dfName = dfName;
         this.dfNickname = dfNickname;

+ 2 - 2
zkqy-business/src/main/java/com/zkqy/business/entity/DragTable.java

@@ -75,13 +75,13 @@ public class DragTable extends BaseEntity {
     /**
      * 备用列
      */
-    @Excel(name = "备用列")
+
     private String spare;
 
     /**
      * 备用列
      */
-    @Excel(name = "备用列")
+
     private String spare1;
 
     /**

+ 95 - 50
zkqy-business/src/main/java/com/zkqy/business/entity/DragTableBtn.java

@@ -9,70 +9,112 @@ import java.util.List;
 
 /**
  * 格绑定的自定义按钮对象 drag_table_btn
- * 
+ *
  * @author ruoyi
  * @date 2023-11-07
  */
-public class DragTableBtn extends BaseEntity
-{
+public class DragTableBtn extends BaseEntity {
     private static final long serialVersionUID = 1L;
 
-    /** 主键 */
+    /**
+     * 主键
+     */
     private Long id;
 
-    /** 父级ID */
+    /**
+     * 父级ID
+     */
     private Long btnParentId;
 
-    /** 祖籍列表 */
+    /**
+     * 祖籍列表
+     */
     private String ancestorsId;
 
-    /** 按钮别名 */
+    /**
+     * 按钮别名
+     */
     private String btnKey;
 
-    /** 按钮组名称 */
+    /**
+     * 按钮组名称
+     */
     private String btnGroupName;
 
-    /** 按钮名称 */
+    /**
+     * 按钮名称
+     */
     private String btnName;
 
-    /** 按钮类型(0:操作按钮,1,其他,2表单,3跳转,4流程,5脚本,6目录) */
+    /**
+     * 按钮类型(0:操作按钮,1,其他,2表单,3跳转,4流程,5脚本,6目录)
+     */
     private String btnType;
 
-    /** 按钮图标 */
+    /**
+     * 按钮图标
+     */
     private String btnIcon;
 
-    /** 表单唯一标识 */
+    /**
+     * 表单唯一标识
+     */
     private String btnFormKey;
 
-    /** 流程唯一标识 */
+    /**
+     * 表单唯一标识
+     */
+    private String btnFormType;
+
+    /**
+     * 流程唯一标识
+     */
     private String btnProcessKey;
 
-    /** 表格唯一标识 */
+    /**
+     * 表格唯一标识
+     */
     private String btnTableKey;
 
-    /** 脚本唯一标识 */
+    /**
+     * 脚本唯一标识
+     */
     private String btnScriptKey;
 
-    /** 弹窗表格唯一标识 */
+    /**
+     * 弹窗表格唯一标识
+     */
     private String btnTableFormGroupKey;
 
-    /** 按钮显示条件 */
+    /**
+     * 按钮显示条件
+     */
     private String btnShowCondition;
 
-    /** 操作参数 */
+    /**
+     * 操作参数
+     */
     private String btnParams;
 
-    /** 权限字符 */
+    /**
+     * 权限字符
+     */
     private String btnHasPermi;
 
-    /** 按钮顺序 */
+    /**
+     * 按钮顺序
+     */
     private Long btnSort;
 
-    /** 删除标志(0:否;1:是) */
+    /**
+     * 删除标志(0:否;1:是)
+     */
     private String delFlag;
 
 
-    /** 子菜单 */
+    /**
+     * 子菜单
+     */
     private List<DragTableBtn> children = new ArrayList<DragTableBtn>();
 
     public Long getId() {
@@ -204,7 +246,6 @@ public class DragTableBtn extends BaseEntity
     }
 
 
-
     public List<DragTableBtn> getChildren() {
         return children;
     }
@@ -229,34 +270,38 @@ public class DragTableBtn extends BaseEntity
         this.btnTableFormGroupKey = btnTableFormGroupKey;
     }
 
-    @Override
-    public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("id", getId())
-            .append("btnParentId", getBtnParentId())
-            .append("ancestorsId",getAncestorsId())
-            .append("btnKey", getBtnKey())
-            .append("btnName", getBtnName())
-            .append("btnType", getBtnType())
-            .append("btnFormKey", getBtnFormKey())
-            .append("btnProcessKey", getBtnProcessKey())
-            .append("btnTableKey", getBtnTableKey())
-            .append("btnScriptKey", getBtnScriptKey())
-            .append("btnShowCondition", getBtnShowCondition())
-            .append("btnParams", getBtnParams())
-            .append("btnHasPermi", getBtnHasPermi())
-            .append("btnSort", getBtnSort())
-            .append("delFlag", getDelFlag())
-            .append("createBy", getCreateBy())
-            .append("createTime", getCreateTime())
-            .append("updateBy", getUpdateBy())
-            .append("updateTime", getUpdateTime())
-            .append("remark", getRemark())
-            .append("children",getChildren())
-            .append("btnGroupName",getBtnGroupName())
-            .append("btnIcon",getBtnIcon())
-            .toString();
+    public String getBtnFormType() {
+        return btnFormType;
     }
 
+    public void setBtnFormType(String btnFormType) {
+        this.btnFormType = btnFormType;
+    }
 
+    @Override
+    public String toString() {
+        final StringBuilder sb = new StringBuilder("DragTableBtn{");
+        sb.append("id=").append(id);
+        sb.append(", btnParentId=").append(btnParentId);
+        sb.append(", ancestorsId='").append(ancestorsId).append('\'');
+        sb.append(", btnKey='").append(btnKey).append('\'');
+        sb.append(", btnGroupName='").append(btnGroupName).append('\'');
+        sb.append(", btnName='").append(btnName).append('\'');
+        sb.append(", btnType='").append(btnType).append('\'');
+        sb.append(", btnIcon='").append(btnIcon).append('\'');
+        sb.append(", btnFormKey='").append(btnFormKey).append('\'');
+        sb.append(", btnFormType='").append(btnFormType).append('\'');
+        sb.append(", btnProcessKey='").append(btnProcessKey).append('\'');
+        sb.append(", btnTableKey='").append(btnTableKey).append('\'');
+        sb.append(", btnScriptKey='").append(btnScriptKey).append('\'');
+        sb.append(", btnTableFormGroupKey='").append(btnTableFormGroupKey).append('\'');
+        sb.append(", btnShowCondition='").append(btnShowCondition).append('\'');
+        sb.append(", btnParams='").append(btnParams).append('\'');
+        sb.append(", btnHasPermi='").append(btnHasPermi).append('\'');
+        sb.append(", btnSort=").append(btnSort);
+        sb.append(", delFlag='").append(delFlag).append('\'');
+        sb.append(", children=").append(children);
+        sb.append('}');
+        return sb.toString();
+    }
 }

+ 4 - 0
zkqy-business/src/main/java/com/zkqy/business/mapper/DragFormMapper.java

@@ -72,6 +72,10 @@ public interface DragFormMapper {
     DragForm selectDragFormBySqlKey(String sqlKey);
 
 
+    /**
+     * 根据formKey查询动态表单
+     */
+    DragForm selectDragFormByFormKey(String formKey);
     /**
      * 查询新增表单编号
      */

+ 6 - 1
zkqy-business/src/main/java/com/zkqy/business/service/IDragFormService.java

@@ -1,9 +1,9 @@
 package com.zkqy.business.service;
 
 
-
 import com.zkqy.common.core.domain.AjaxResult;
 import com.zkqy.business.entity.DragForm;
+
 import java.util.List;
 
 /**
@@ -72,4 +72,9 @@ public interface IDragFormService {
      * 根据sqlKey查询动态表单
      */
     DragForm selectDragFormBySqlKey(String sqlKey);
+
+    /**
+     * 根据formKey查询动态表单
+     */
+    DragForm selectDragFormByformKey(String formKey);
 }

+ 6 - 0
zkqy-business/src/main/java/com/zkqy/business/service/IDragTableService.java

@@ -50,4 +50,10 @@ public interface IDragTableService
      * 根据tableKey查询sqlKey
      */
     DragTable selectSqlKeyByTableKey(String tableKey);
+
+
+    /**
+     * 根据sqlKey查询Table的日期格式信息
+     */
+    String getTableFormatBySqlKey(String sqlKey);
 }

+ 6 - 2
zkqy-business/src/main/java/com/zkqy/business/service/impl/DragFormServiceImpl.java

@@ -128,7 +128,7 @@ public class DragFormServiceImpl implements IDragFormService {
         for (Long fId : fIds) {
             delFileForm(fId);
             //删除表单表格关联表
-            if(StringUtils.isNotNull(dragTableFormMapper.selectDragTableForm(fId))){
+            if (StringUtils.isNotNull(dragTableFormMapper.selectDragTableForm(fId))) {
                 dragTableFormMapper.deleteDragTableFormByDfId(fId);
             }
         }
@@ -156,6 +156,11 @@ public class DragFormServiceImpl implements IDragFormService {
         return queryFormSelect(dragForm);
     }
 
+    @Override
+    public DragForm selectDragFormByformKey(String formKey) {
+        return queryFormSelect(dragFormMapper.selectDragFormByFormKey(formKey));
+    }
+
     /**
      * 查询当前表单的详细信息-》中前表单中所包含的下拉框
      */
@@ -184,7 +189,6 @@ public class DragFormServiceImpl implements IDragFormService {
     }
 
 
-
     /**
      * 删除表单源文件
      *

+ 7 - 0
zkqy-business/src/main/java/com/zkqy/business/service/impl/DragTableServiceImpl.java

@@ -4,6 +4,7 @@ import com.zkqy.business.entity.*;
 import com.zkqy.business.entity.vo.DragTableVo;
 import com.zkqy.business.mapper.*;
 import com.zkqy.business.service.IDragTableService;
+import com.zkqy.common.utils.PageUtils;
 import com.zkqy.execution.produce.dispersed.entity.CommonEntity;
 import com.zkqy.execution.produce.dispersed.mapper.CommonMapper;
 import com.zkqy.execution.produce.dispersed.mapper.TableSqlMapper;
@@ -158,6 +159,12 @@ public class DragTableServiceImpl implements IDragTableService {
         return dragTableMapper.selectDragTableByTableKey(tableKey);
     }
 
+    @Override
+    public String getTableFormatBySqlKey(String sqlKey) {
+        DragTable dragTable = dragTableMapper.selectDragTableBySqlKey(sqlKey);
+        return dragTable.getTimeFormat();
+    }
+
     /**
      * 表格按钮过滤子级
      * @param root

+ 86 - 53
zkqy-business/src/main/resources/mapper/dragmapper/DragFormMapper.xml

@@ -1,34 +1,55 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.zkqy.business.mapper.DragFormMapper">
-    
+
     <resultMap type="com.zkqy.business.entity.DragForm" id="DragFormResult">
-        <result property="fId"    column="f_id"    />
+        <result property="fId" column="f_id"/>
+        <result property="formKey" column="form_key"/>
         <result property="sqlKey" column="sql_key"/>
-        <result property="dfName"    column="df_name"    />
-        <result property="dfNickname"    column="df_nickname"    />
-        <result property="dfVueTemplate"    column="df_vue_template"    />
-        <result property="dfHtmlTemplate"    column="df_html_template"    />
-        <result property="dfFormSql"    column="df_form_sql"    />
-        <result property="dfNodeId"    column="df_node_id"    />
-        <result property="dfDatabase"    column="df_database"    />
-        <result property="dfTableName"    column="df_table_name"    />
-        <result property="dfFliePath"    column="df_flie_path"    />
-        <result property="dfNotes"    column="df_notes"    />
-        <result property="delFlag"    column="del_flag"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="createBy"    column="create_by"    />
-        <result property="updateBy"    column="update_by"    />
-        <result property="updateTime"    column="update_time"    />
-        <result property="spare"    column="spare"    />
-        <result property="spare1"    column="spare1"    />
+        <result property="dfName" column="df_name"/>
+        <result property="dfNickname" column="df_nickname"/>
+        <result property="dfVueTemplate" column="df_vue_template"/>
+        <result property="dfHtmlTemplate" column="df_html_template"/>
+        <result property="dfFormSql" column="df_form_sql"/>
+        <result property="dfNodeId" column="df_node_id"/>
+        <result property="dfDatabase" column="df_database"/>
+        <result property="dfTableName" column="df_table_name"/>
+        <result property="dfFliePath" column="df_flie_path"/>
+        <result property="dfNotes" column="df_notes"/>
+        <result property="delFlag" column="del_flag"/>
+        <result property="createTime" column="create_time"/>
+        <result property="createBy" column="create_by"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="spare" column="spare"/>
+        <result property="spare1" column="spare1"/>
         <result property="dtId" column="dt_id"/>
     </resultMap>
 
     <sql id="selectDragFormVo">
-        select f_id,sql_key, df_name, df_nickname, df_vue_template, df_html_template, df_form_sql, df_node_id, df_database, df_table_name, df_flie_path, df_notes, del_flag, create_time, create_by, update_by, update_time, spare, spare1 from {DBNAME}.drag_form
+        select f_id,
+               form_key,
+               sql_key,
+               df_name,
+               df_nickname,
+               df_vue_template,
+               df_html_template,
+               df_form_sql,
+               df_node_id,
+               df_database,
+               df_table_name,
+               df_flie_path,
+               df_notes,
+               del_flag,
+               create_time,
+               create_by,
+               update_by,
+               update_time,
+               spare,
+               spare1
+        from {DBNAME}.drag_form
     </sql>
 
     <select id="selectDragFormList" parameterType="com.zkqy.business.entity.DragForm" resultMap="DragFormResult">
@@ -53,36 +74,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
         order by create_time desc
     </select>
-    
+
     <select id="selectDragFormByFId" parameterType="Long" resultMap="DragFormResult">
-        select
-            d.f_id,
-            d.sql_key,
-            d.df_name,
-            d.df_nickname,
-            d.df_vue_template,
-            d.df_html_template,
-            d.df_form_sql,
-            d.df_node_id,
-            d.df_database,
-            d.df_table_name,
-            d.df_flie_path,
-            d.df_notes,
-            d.del_flag,
-            d.create_time,
-            d.create_by,
-            d.update_by,
-            d.update_time,
-            d.spare,
-            d.spare1,
-            dtf.dt_id from drag_form d
-                LEFT JOIN drag_table_form dtf ON d.f_id = dtf.df_id
+        select d.f_id,
+               d.form_key,
+               d.sql_key,
+               d.df_name,
+               d.df_nickname,
+               d.df_vue_template,
+               d.df_html_template,
+               d.df_form_sql,
+               d.df_node_id,
+               d.df_database,
+               d.df_table_name,
+               d.df_flie_path,
+               d.df_notes,
+               d.del_flag,
+               d.create_time,
+               d.create_by,
+               d.update_by,
+               d.update_time,
+               d.spare,
+               d.spare1,
+               dtf.dt_id
+        from drag_form d
+                 LEFT JOIN drag_table_form dtf ON d.f_id = dtf.df_id
         where d.f_id = #{fId}
     </select>
-        
-    <insert id="insertDragForm" parameterType="com.zkqy.business.entity.DragForm" useGeneratedKeys="true" keyProperty="fId">
+
+    <insert id="insertDragForm" parameterType="com.zkqy.business.entity.DragForm" useGeneratedKeys="true"
+            keyProperty="fId">
         insert into drag_form
         <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="formKey != null">form_key,</if>
             <if test="sqlKey != null">sql_key,</if>
             <if test="dfName != null">df_name,</if>
             <if test="dfNickname != null">df_nickname,</if>
@@ -100,8 +124,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createBy != null">create_by,</if>
             <if test="spare != null">spare,</if>
             <if test="spare1 != null">spare1,</if>
-         </trim>
+        </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="formKey != null">#{formKey},</if>
             <if test="sqlKey != null">#{sqlKey},</if>
             <if test="dfName != null">#{dfName},</if>
             <if test="dfNickname != null">#{dfNickname},</if>
@@ -119,12 +144,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createBy != null">#{createBy},</if>
             <if test="spare != null">#{spare},</if>
             <if test="spare1 != null">#{spare1},</if>
-         </trim>
+        </trim>
     </insert>
 
     <update id="updateDragForm" parameterType="com.zkqy.business.entity.DragForm">
         update drag_form
         <trim prefix="SET" suffixOverrides=",">
+            <if test="formKey != null">form_key = #{formKey},</if>
             <if test="sqlKey != null">sql_key = #{sqlKey},</if>
             <if test="dfName != null">df_name = #{dfName},</if>
             <if test="dfNickname != null">df_nickname = #{dfNickname},</if>
@@ -148,13 +174,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <delete id="deleteDragFormByFId" parameterType="Long">
         update drag_form
-        set del_flag = 1
+        set del_flag = 2
         where f_id = #{fId}
     </delete>
 
     <delete id="deleteDragFormByFIds" parameterType="String">
         update drag_form
-        set del_flag = 1 where f_id in
+        set del_flag = 2 where f_id in
         <foreach item="fId" collection="array" open="(" separator="," close=")">
             #{fId}
         </foreach>
@@ -162,10 +188,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectDragFormBySqlKey" resultMap="DragFormResult">
         <include refid="selectDragFormVo"/>
-        where sql_key = #{sqlKey}
+        where sql_key = #{sqlKey} and del_flag = 0
+    </select>
+
+    <select id="selectDragFormByFormKey" resultMap="DragFormResult">
+        <include refid="selectDragFormVo"/>
+        where form_key = #{formKey} and del_flag = 0
     </select>
 
     <select id="selectDragFormFId" resultType="int">
-        select f_id from drag_form ORDER BY f_id desc LIMIT 1
+        select f_id
+        from drag_form
+        ORDER BY f_id desc LIMIT 1
     </select>
 </mapper>

+ 26 - 17
zkqy-business/src/main/resources/mapper/dragmapper/DragTableBtnMapper.xml

@@ -14,6 +14,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="btnType"    column="btn_type"    />
         <result property="btnIcon" column="btn_icon"/>
         <result property="btnFormKey"    column="btn_form_key"    />
+        <result property="btnFormType"    column="btn_form_type"    />
         <result property="btnProcessKey"    column="btn_process_key"    />
         <result property="btnTableKey"    column="btn_table_key"    />
         <result property="btnScriptKey"    column="btn_script_key"    />
@@ -32,28 +33,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectDragTableBtnVo">
-        select id, btn_parent_id,ancestors_id, btn_key,btn_group_name, btn_name, btn_type,btn_icon, btn_form_key, btn_process_key, btn_table_key, btn_script_key, btn_show_condition, btn_params, btn_has_permi, btn_sort, del_flag, create_by, create_by_id, create_time, update_by, update_by_id, update_time, remark from {DBNAME}.drag_table_btn
+        select id, btn_parent_id,ancestors_id, btn_key,btn_group_name, btn_name, btn_type,btn_icon, btn_form_key,btn_form_type, btn_process_key, btn_table_key, btn_script_key, btn_show_condition, btn_params, btn_has_permi, btn_sort, del_flag, create_by, create_by_id, create_time, update_by, update_by_id, update_time, remark from {DBNAME}.drag_table_btn
     </sql>
 
     <select id="selectDragTableBtnList" parameterType="com.zkqy.business.entity.DragTableBtn" resultMap="DragTableBtnResult">
         <include refid="selectDragTableBtnVo"/>
         where del_flag = '0'
-            <if test="btnParentId != null "> and btn_parent_id = #{btnParentId}</if>
-            <if test="btnKey != null  and btnKey != ''"> and btn_key = #{btnKey}</if>
-            <if test="btnGroupName != null  and btnGroupName != ''"> and btn_group_name like concat('%', #{btnGroupName}, '%')</if>
-            <if test="btnName != null  and btnName != ''"> and btn_name like concat('%', #{btnName}, '%')</if>
-            <if test="btnType != null  and btnType != ''"> and btn_type = #{btnType}</if>
-            <if test="btnFormKey != null  and btnFormKey != ''"> and btn_form_key = #{btnFormKey}</if>
-            <if test="btnProcessKey != null  and btnProcessKey != ''"> and btn_process_key = #{btnProcessKey}</if>
-            <if test="btnTableKey != null  and btnTableKey != ''"> and btn_table_key = #{btnTableKey}</if>
-            <if test="btnScriptKey != null  and btnScriptKey != ''"> and btn_script_key = #{btnScriptKey}</if>
-            <if test="btnShowCondition != null  and btnShowCondition != ''"> and btn_show_condition = #{btnShowCondition}</if>
-            <if test="btnParams != null  and btnParams != ''"> and btn_params = #{btnParams}</if>
-            <if test="btnHasPermi != null  and btnHasPermi != ''"> and btn_has_permi = #{btnHasPermi}</if>
-            <if test="btnSort != null "> and btn_sort = #{btnSort}</if>
-            <if test="createById != null "> and create_by_id = #{createById}</if>
-            <if test="updateById != null "> and update_by_id = #{updateById}</if>
-             order by btn_sort asc
+        <if test="btnParentId != null ">and btn_parent_id = #{btnParentId}</if>
+        <if test="btnKey != null  and btnKey != ''">and btn_key = #{btnKey}</if>
+        <if test="btnGroupName != null  and btnGroupName != ''">and btn_group_name like concat('%', #{btnGroupName},
+            '%')
+        </if>
+        <if test="btnName != null  and btnName != ''">and btn_name like concat('%', #{btnName}, '%')</if>
+        <if test="btnType != null  and btnType != ''">and btn_type = #{btnType}</if>
+        <if test="btnFormKey != null  and btnFormKey != ''">and btn_form_key = #{btnFormKey}</if>
+        <if test="btnFormType != null  and btnFormType != ''">and btn_form_type = #{btnFormType}</if>
+        <if test="btnProcessKey != null  and btnProcessKey != ''">and btn_process_key = #{btnProcessKey}</if>
+        <if test="btnTableKey != null  and btnTableKey != ''">and btn_table_key = #{btnTableKey}</if>
+        <if test="btnScriptKey != null  and btnScriptKey != ''">and btn_script_key = #{btnScriptKey}</if>
+        <if test="btnShowCondition != null  and btnShowCondition != ''">and btn_show_condition = #{btnShowCondition}
+        </if>
+        <if test="btnParams != null  and btnParams != ''">and btn_params = #{btnParams}</if>
+        <if test="btnHasPermi != null  and btnHasPermi != ''">and btn_has_permi = #{btnHasPermi}</if>
+        <if test="btnSort != null ">and btn_sort = #{btnSort}</if>
+        <if test="createById != null ">and create_by_id = #{createById}</if>
+        <if test="updateById != null ">and update_by_id = #{updateById}</if>
+        order by btn_sort asc
     </select>
     
     <select id="selectDragTableBtnById" parameterType="Long" resultMap="DragTableBtnResult">
@@ -72,6 +77,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="btnType != null">btn_type,</if>
             <if test="btnIcon != null">btn_icon,</if>
             <if test="btnFormKey != null">btn_form_key,</if>
+            <if test="btnFormType != null">btn_form_type,</if>
             <if test="btnProcessKey != null">btn_process_key,</if>
             <if test="btnTableKey != null">btn_table_key,</if>
             <if test="btnScriptKey != null">btn_script_key,</if>
@@ -94,6 +100,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="btnType != null">#{btnType},</if>
             <if test="btnIcon != null">#{btnIcon},</if>
             <if test="btnFormKey != null">#{btnFormKey},</if>
+            <if test="btnFormType != null">#{btnFormType},</if>
             <if test="btnProcessKey != null">#{btnProcessKey},</if>
             <if test="btnTableKey != null">#{btnTableKey},</if>
             <if test="btnScriptKey != null">#{btnScriptKey},</if>
@@ -120,6 +127,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="btnType != null">btn_type = #{btnType},</if>
             <if test="btnIcon != null">btn_icon = #{btnIcon},</if>
             <if test="btnFormKey != null">btn_form_key = #{btnFormKey},</if>
+            <if test="btnFormType != null">btn_form_type = #{btnFormType},</if>
             <if test="btnProcessKey != null">btn_process_key = #{btnProcessKey},</if>
             <if test="btnTableKey != null">btn_table_key = #{btnTableKey},</if>
             <if test="btnScriptKey != null">btn_script_key = #{btnScriptKey},</if>
@@ -160,6 +168,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <foreach collection="list" item="id" open="(" close=")" separator="or">
             FIND_IN_SET(#{id},ancestors_id)
         </foreach>
+        order by btn_sort asc
     </select>
 
     <select id="hasChildByBtnId" resultType="Integer">

+ 10 - 0
zkqy-common/pom.xml

@@ -137,28 +137,38 @@
             <artifactId>hutool-all</artifactId>
             <version>5.8.16</version>
         </dependency>
+        <!--阿里巴巴数据源-->
         <dependency>
             <groupId>com.alibaba</groupId>
             <artifactId>druid</artifactId>
             <version>1.2.16</version>
             <scope>compile</scope>
         </dependency>
+        <!--springmvc依赖-->
         <dependency>
             <groupId>org.springframework</groupId>
             <artifactId>spring-webmvc</artifactId>
         </dependency>
+        <!--阿里的excel导出依赖-->
         <dependency>
             <groupId>com.alibaba</groupId>
             <artifactId>easyexcel</artifactId>
             <version>3.3.2</version>
             <scope>compile</scope>
         </dependency>
+        <!--Json转换依赖-->
         <dependency>
             <groupId>com.google.code.gson</groupId>
             <artifactId>gson</artifactId>
             <version>2.10.1</version>
             <scope>compile</scope>
         </dependency>
+        <!--Zip压缩-->
+        <dependency>
+            <groupId>org.apache.ant</groupId>
+            <artifactId>ant</artifactId>
+            <version>1.9.1</version>
+        </dependency>
     </dependencies>
 
 </project>

+ 1 - 1
zkqy-common/src/main/java/com/zkqy/common/constant/Constants.java

@@ -132,7 +132,7 @@ public class Constants
     /**
      * 定时任务白名单配置(仅允许访问的包名,如其他需要可以自行添加)
      */
-    public static final String[] JOB_WHITELIST_STR = { "com.ruoyi" };
+    public static final String[] JOB_WHITELIST_STR = { "com.zkqy" };
 
     /**
      * 定时任务违规的字符

+ 28 - 0
zkqy-common/src/main/java/com/zkqy/common/utils/StringUtils.java

@@ -6,6 +6,9 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
 import org.springframework.util.AntPathMatcher;
 import com.zkqy.common.constant.Constants;
 import com.zkqy.common.core.text.StrFormatter;
@@ -23,6 +26,31 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
     /** 下划线 */
     private static final char SEPARATOR = '_';
 
+    /**
+     * 不带T
+     */
+    private static final String DATE_TIME_PATTERN1 = "\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}";
+
+    /**
+     * 带T的
+     */
+    private static final String DATE_TIME_PATTERN2 = "\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}";
+
+    /**
+     * 只有年月日的
+     */
+    private static final String DATE_PATTERN = "^\\d{4}-\\d{2}-\\d{2}$";
+
+
+    private static final Pattern pattern1 = Pattern.compile(DATE_TIME_PATTERN1);
+    private static final Pattern pattern2 = Pattern.compile(DATE_TIME_PATTERN2);
+
+    public static boolean isValidDateTimeFormat(String input) {
+        Matcher matcher1 = pattern1.matcher(input);
+        Matcher matcher2 = pattern2.matcher(input);
+        return matcher1.matches() || matcher2.matches();
+    }
+
     /**
      * 获取参数不为空值
      * 

+ 52 - 0
zkqy-common/src/main/java/com/zkqy/common/utils/ZipUtils.java

@@ -0,0 +1,52 @@
+package com.zkqy.common.utils;
+
+
+import org.apache.tools.zip.ZipEntry;
+import org.apache.tools.zip.ZipOutputStream;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.List;
+import java.util.Map;
+
+public class ZipUtils {
+
+    /**
+     * 创建多文件压缩包
+     *
+     * @param response
+     * @param fileList 文件信息集合
+     */
+    public static void createZip(HttpServletResponse response, List<Map<String, String>> fileList) {
+        try {
+            response.setContentType("application/x-octet-stream");
+            response.setHeader("Content-Disposition", "attachment; filename=\"download.zip\"");
+            response.setCharacterEncoding("utf-8");
+            ZipOutputStream zos = new ZipOutputStream(response.getOutputStream());
+            byte[] buffer = new byte[1024];
+            for (Map<String, String> fileMap : fileList) {
+                String fileName = fileMap.get("fileName");
+                String filePath = fileMap.get("filePath");
+                // 使用 File.separator 来实现跨平台兼容性
+                String relativePath = fileName;
+                // 在 Zip 中创建带有相对路径的 ZipEntry
+                zos.putNextEntry(new ZipEntry(relativePath));
+                try (InputStream is = new FileInputStream(filePath)) {
+                    int length;
+                    while ((length = is.read(buffer)) > 0) {
+                        zos.write(buffer, 0, length);
+                    }
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+                zos.closeEntry();
+            }
+            zos.close();
+            zos.flush();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+}

+ 77 - 59
zkqy-common/src/main/java/com/zkqy/common/utils/bpm/XmlDataParserUtils.java

@@ -3,6 +3,7 @@ package com.zkqy.common.utils.bpm;
 import cn.hutool.core.util.XmlUtil;
 import com.zkqy.common.utils.uuid.IdUtils;
 import org.w3c.dom.*;
+
 import javax.xml.transform.Transformer;
 import javax.xml.transform.TransformerFactory;
 import javax.xml.transform.dom.DOMSource;
@@ -27,23 +28,23 @@ public class XmlDataParserUtils {
      * @param xmlData xml内容
      * @return
      */
-    public static Map<String,String> getStartNodeAndNextNode(String xmlData){
+    public static Map<String, String> getStartNodeAndNextNode(String xmlData) {
         Map<String, String> map = new HashMap<>();
-        Document document= XmlUtil.parseXml(xmlData);
+        Document document = XmlUtil.parseXml(xmlData);
         //获得XML文档根节点
-        Element elementG=XmlUtil.getRootElement(document);
+        Element elementG = XmlUtil.getRootElement(document);
         //获取bpmn:process节点
-        Element bpmnProcessEvent = XmlUtil.getElement(elementG,"bpmn:process");
+        Element bpmnProcessEvent = XmlUtil.getElement(elementG, "bpmn:process");
         //获取开始节点并得到开始节点ID
-        Element bpmnStartEvent=XmlUtil.getElement(bpmnProcessEvent,"bpmn:startEvent");
+        Element bpmnStartEvent = XmlUtil.getElement(bpmnProcessEvent, "bpmn:startEvent");
         String startNode = bpmnStartEvent.getAttribute("id");
-        map.put("startNode",startNode);
+        map.put("startNode", startNode);
 
         //获取所有序列流(顺序),循环得到开始节点的下一个节点
         NodeList elementsByTagName = elementG.getElementsByTagName("bpmn:sequenceFlow");
         for (int i = 0; i < elementsByTagName.getLength(); i++) {
             if (startNode.equals(elementsByTagName.item(i).getAttributes().getNamedItem("sourceRef").getNodeValue())) {
-                map.put("nextNode",elementsByTagName.item(i).getAttributes().getNamedItem("targetRef").getNodeValue());
+                map.put("nextNode", elementsByTagName.item(i).getAttributes().getNamedItem("targetRef").getNodeValue());
                 break;
             }
         }
@@ -52,11 +53,12 @@ public class XmlDataParserUtils {
 
     /**
      * 新增用户异常节点
+     *
      * @param userTaskTagName 新增节点名称
-     * @param nextTagId 新增节点下一节点ID
+     * @param nextTagId       新增节点下一节点ID
      * @return
      */
-    public static String addUserTaskTag(String xmlData,String newUserTaskTagId,String userTaskTagName,String nextTagId) throws Exception {
+    public static String addUserTaskTag(String xmlData, String newUserTaskTagId, String userTaskTagName, String nextTagId) throws Exception {
         //新增节点标签ID
 //        String newUserTaskTagId = "Flow_" + IdUtils.fastSimpleUUID().substring(0,7);
         //新增序列流ID
@@ -66,9 +68,9 @@ public class XmlDataParserUtils {
         //上一节点标签ID
         String previousId = null;
         //将xml文件内容转成Document对象
-        Document document= XmlUtil.parseXml(xmlData);
+        Document document = XmlUtil.parseXml(xmlData);
         //获得XML文档根节点
-        Element elementG=XmlUtil.getRootElement(document);
+        Element elementG = XmlUtil.getRootElement(document);
         //获取所有序列流(顺序),循环得到新增节点下一节点序列流ID、上一节点标签ID,修改新增节点下一节点序列流sourceRef为新增节点标签ID
         NodeList elementsByTagName = elementG.getElementsByTagName("bpmn:sequenceFlow");
         for (int i = 0; i < elementsByTagName.getLength(); i++) {
@@ -86,8 +88,8 @@ public class XmlDataParserUtils {
         }
         //创建异常任务节点标签
         Element userTaskTag = document.createElement("bpmn:exceptionTask");
-        userTaskTag.setAttribute("id",newUserTaskTagId);
-        userTaskTag.setAttribute("name",userTaskTagName);
+        userTaskTag.setAttribute("id", newUserTaskTagId);
+        userTaskTag.setAttribute("name", userTaskTagName);
         userTaskTag.appendChild(document.createTextNode("\n\t\t"));
         Element userTaskTagChild1 = document.createElement("bpmn:incoming");
         userTaskTagChild1.setTextContent(newSequenceFlowId);
@@ -99,12 +101,12 @@ public class XmlDataParserUtils {
         userTaskTag.appendChild(document.createTextNode("\n\t"));
         //创建新序列流标签
         Element sequenceFlowTag = document.createElement("bpmn:sequenceFlow");
-        sequenceFlowTag.setAttribute("id",newSequenceFlowId);
-        sequenceFlowTag.setAttribute("sourceRef",previousId);
-        sequenceFlowTag.setAttribute("targetRef",newUserTaskTagId);
+        sequenceFlowTag.setAttribute("id", newSequenceFlowId);
+        sequenceFlowTag.setAttribute("sourceRef", previousId);
+        sequenceFlowTag.setAttribute("targetRef", newUserTaskTagId);
         //修改上一节点bpmn:outgoing和下一节点bpmn:incoming
         //获取bpmn:process节点
-        Element bpmnProcessEvent = XmlUtil.getElement(elementG,"bpmn:process");
+        Element bpmnProcessEvent = XmlUtil.getElement(elementG, "bpmn:process");
         NodeList bpmnProcessNextLevelEventList = bpmnProcessEvent.getChildNodes();
         for (int i = 0; i < bpmnProcessNextLevelEventList.getLength(); i++) {
             Node node = bpmnProcessNextLevelEventList.item(i);
@@ -112,18 +114,18 @@ public class XmlDataParserUtils {
             if (node.getNodeType() == Node.ELEMENT_NODE && node instanceof Element) {
                 Element element = (Element) node;
                 String id = element.getAttribute("id");
-                if(id.equals(previousId)){
-                    Element elementOutgoing = XmlUtil.getElement(element,"bpmn:outgoing");
+                if (id.equals(previousId)) {
+                    Element elementOutgoing = XmlUtil.getElement(element, "bpmn:outgoing");
                     elementOutgoing.setTextContent(newSequenceFlowId);
                 }
-                if(id.equals(nextTagId)){
-                    Element elementOutgoing = XmlUtil.getElement(element,"bpmn:incoming");
+                if (id.equals(nextTagId)) {
+                    Element elementOutgoing = XmlUtil.getElement(element, "bpmn:incoming");
                     elementOutgoing.setTextContent(sequenceFlowId);
                     //插入标签
                     Node parentNode = element.getParentNode();
-                    parentNode.insertBefore(userTaskTag,element);
+                    parentNode.insertBefore(userTaskTag, element);
 
-                    parentNode.insertBefore(sequenceFlowTag,element);
+                    parentNode.insertBefore(sequenceFlowTag, element);
                 }
             }
         }
@@ -139,20 +141,21 @@ public class XmlDataParserUtils {
 
     /**
      * 获取下一节点key
-     * @param xmlData xml内容
+     *
+     * @param xmlData     xml内容
      * @param taskNodeKey 当前节点key
      * @return
      */
-    public static String getNextNodeKey(String xmlData, String taskNodeKey){
+    public static String getNextNodeKey(String xmlData, String taskNodeKey) {
         //下一节点key
         String nextTaskNodeKey = null;
-        Document document= XmlUtil.parseXml(xmlData);
+        Document document = XmlUtil.parseXml(xmlData);
         //获得XML文档根节点
-        Element elementG=XmlUtil.getRootElement(document);
+        Element elementG = XmlUtil.getRootElement(document);
         //获取所有序列流(顺序),循环得到开始节点的下一个节点
         NodeList elementsByTagName = elementG.getElementsByTagName("bpmn:sequenceFlow");
         for (int i = 0; i < elementsByTagName.getLength(); i++) {
-            if(taskNodeKey.equals(elementsByTagName.item(i).getAttributes().getNamedItem("sourceRef").getNodeValue())){
+            if (taskNodeKey.equals(elementsByTagName.item(i).getAttributes().getNamedItem("sourceRef").getNodeValue())) {
                 nextTaskNodeKey = elementsByTagName.item(i).getAttributes().getNamedItem("targetRef").getNodeValue();
             }
         }
@@ -161,33 +164,34 @@ public class XmlDataParserUtils {
 
     /**
      * 按顺序获取流程节点
+     *
      * @param xmlData xml内容
      * @return
      */
-    public static Map<String,Object> getAllNodeKey(String xmlData){
-        Map<String,Object> resultMap = new HashMap<>();
+    public static Map<String, Object> getAllNodeKey(String xmlData) {
+        Map<String, Object> resultMap = new HashMap<>();
         //将xml文件内容转成Document对象
-        Document document= XmlUtil.parseXml(xmlData);
+        Document document = XmlUtil.parseXml(xmlData);
         //获得XML文档根节点
-        Element elementG=XmlUtil.getRootElement(document);
+        Element elementG = XmlUtil.getRootElement(document);
         //获取bpmn:process节点
-        Element bpmnProcessEvent = XmlUtil.getElement(elementG,"bpmn:process");
+        Element bpmnProcessEvent = XmlUtil.getElement(elementG, "bpmn:process");
         //获取所有序列流(顺序)
         NodeList elementsByTagName = elementG.getElementsByTagName("bpmn:sequenceFlow");
         //获取开始节点并得到开始节点ID
-        Element bpmnStartEvent=XmlUtil.getElement(bpmnProcessEvent,"bpmn:startEvent");
+        Element bpmnStartEvent = XmlUtil.getElement(bpmnProcessEvent, "bpmn:startEvent");
         String startNode = bpmnStartEvent.getAttribute("id");
-        Map<String,Integer> map = new HashMap<>();
-        map.put(startNode,0);
+        Map<String, Integer> map = new HashMap<>();
+        map.put(startNode, 0);
         List<String> list = new ArrayList<>();
         list.add(startNode);
-        resultMap.put("nodeList",list);
-        resultMap.put("nodeMap",recursiveParse(elementsByTagName, startNode, map, list));
+        resultMap.put("nodeList", list);
+        resultMap.put("nodeMap", recursiveParse(elementsByTagName, startNode, map, list));
         return resultMap;
     }
 
     //递归查找下一节点
-    private static Map<String,Integer> recursiveParse(NodeList nodeList, String currentId ,Map<String,Integer> map, List<String> list) {
+    private static Map<String, Integer> recursiveParse(NodeList nodeList, String currentId, Map<String, Integer> map, List<String> list) {
         for (int i = 0; i < nodeList.getLength(); i++) {
             Node node = nodeList.item(i);
             if (node.getNodeType() == Node.ELEMENT_NODE) {
@@ -195,9 +199,9 @@ public class XmlDataParserUtils {
                 String sourceRef = element.getAttribute("sourceRef");
                 String targetRef = element.getAttribute("targetRef");
                 if (sourceRef.equals(currentId)) {
-                    map.put(targetRef, map.size()+1);
+                    map.put(targetRef, map.size() + 1);
                     list.add(targetRef);
-                    recursiveParse(nodeList, targetRef,map,list);
+                    recursiveParse(nodeList, targetRef, map, list);
                     break;
                 }
             }
@@ -207,46 +211,50 @@ public class XmlDataParserUtils {
 
     /**
      * 清空异常节点
-     * @param xmlData xml内容
+     *
+     * @param xmlData       xml内容
      * @param currentNodeId 当前节点ID
      * @return
      */
-    public static String clearExceptionTask(String xmlData,String currentNodeId) {
+    public static String clearExceptionTask(String xmlData, String currentNodeId) {
         //将xml文件内容转成Document对象
         Document document = XmlUtil.parseXml(xmlData);
         //得到当前所有节点ID
         Map<String, Object> allNodeKey = getAllNodeKey(xmlData);
         List<String> list = (List<String>) allNodeKey.get("nodeList");
         //截取当前节点后的所有ID
-        list = new ArrayList<>(list.subList(list.indexOf(currentNodeId),list.size()));
+        list = new ArrayList<>(list.subList(list.indexOf(currentNodeId), list.size()));
         //获取所有异常节点,筛选出正常节点和异常节点
         List<String> exceptionList = new ArrayList<>();
-        for (int i = 1; i < list.size(); i++){
-            Element node = getElement(document, list.get(i),"id");
+        List<String> endList = new ArrayList<>();
+        for (int i = 1; i < list.size(); i++) {
+            Element node = getElement(document, list.get(i), "id");
             String nodeTagName = node.getTagName();
-            if (nodeTagName.equals("bpmn:exceptionTask")){
+            if (nodeTagName.equals("bpmn:exceptionTask")) {
                 exceptionList.add(list.get(i));
-                list.remove(i);
+            } else {
+                endList.add(list.get(i));
             }
         }
+        endList.add(0, list.get(0));
         // 循环正常节点,修改下一个节点指向
-        for (int i = 0; i < list.size() - 1; i++ ) {
+        for (int i = 0; i < endList.size() - 1; i++) {
             //获取下一节点
-            Element nextNode = getElement(document, list.get(i + 1),"id");
+            Element nextNode = getElement(document, endList.get(i + 1), "id");
             //得到上一个正常节点得序列流元素,修改targetRef指向下一个节点ID
-            Element currentSequenceFlow = getElement(document,list.get(i),"sourceRef");
-            currentSequenceFlow.setAttribute("targetRef",list.get(i+1));
+            Element currentSequenceFlow = getElement(document, endList.get(i), "sourceRef");
+            currentSequenceFlow.setAttribute("targetRef", endList.get(i + 1));
             //修改下一个节点入口incoming指向上一个节点序列流ID
-            Element elementOutgoing = XmlUtil.getElement(nextNode,"bpmn:incoming");
+            Element elementOutgoing = XmlUtil.getElement(nextNode, "bpmn:incoming");
             elementOutgoing.setTextContent(currentSequenceFlow.getAttributes().getNamedItem("id").getNodeValue());
         }
         //删除异常节点及异常节点序列线
         for (int i = 0; i < exceptionList.size(); i++) {
             //获取异常节点-删除
-            Element node = getElement(document, exceptionList.get(i),"id");
+            Element node = getElement(document, exceptionList.get(i), "id");
             node.getParentNode().removeChild(node);
             //获取序列线-删除
-            Element nodeXian = getElement(document, exceptionList.get(i),"sourceRef");
+            Element nodeXian = getElement(document, exceptionList.get(i), "sourceRef");
             nodeXian.getParentNode().removeChild(nodeXian);
         }
         //将document对象转成字符串
@@ -257,7 +265,7 @@ public class XmlDataParserUtils {
             DOMSource source = new DOMSource(document);
             StreamResult result = new StreamResult(new StringWriter()); // 使用StringWriter来将结果输出为字符串
             transformer.transform(source, result);
-            data =  result.getWriter().toString();
+            data = result.getWriter().toString();
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -267,14 +275,15 @@ public class XmlDataParserUtils {
 
     /**
      * 获取元素
+     *
      * @param document
-     * @param nodeAttributeId 节点属性ID
+     * @param nodeAttributeId   节点属性ID
      * @param nodeAttributeName 节点属性名称
      * @return
      */
-    private static Element getElement(Document document,String nodeAttributeId,String nodeAttributeName){
+    private static Element getElement(Document document, String nodeAttributeId, String nodeAttributeName) {
         try {
-            String expression = "//*[namespace-uri()='http://www.omg.org/spec/BPMN/20100524/MODEL'][@"+nodeAttributeName+"='"+nodeAttributeId+"']";
+            String expression = "//*[namespace-uri()='http://www.omg.org/spec/BPMN/20100524/MODEL'][@" + nodeAttributeName + "='" + nodeAttributeId + "']";
             XPath xpath = XPathFactory.newInstance().newXPath();
             NodeList nodeList = (NodeList) xpath.compile(expression).evaluate(document, XPathConstants.NODESET);
             // 遍历节点列表并获取第一个匹配的元素
@@ -299,4 +308,13 @@ public class XmlDataParserUtils {
         return null;
     }
 
+
+    public static String getNodeType(String xmlData, String nodeKey) {
+        //将xml文件内容转成Document对象
+        Document document = XmlUtil.parseXml(xmlData);
+        Element nodeinfo = getElement(document, nodeKey, "id");
+        // 返回当前节点类型
+        return nodeinfo.getLocalName();
+    }
+
 }

+ 7 - 0
zkqy-framework/src/main/java/com/zkqy/framework/aspectj/LogAspect.java

@@ -88,6 +88,13 @@ public class LogAspect
 
             // *========数据库日志=========*//
             SysOperLog operLog = new SysOperLog();
+            Long tenantId;
+            try {
+                tenantId = SecurityUtils.getTenantId();
+            } catch (Exception exception) {
+                tenantId = 0L;  // 0L 表示当前是admin(租户信息表id自增「自增id不会从0开始」)
+            }
+            operLog.setTenantId(tenantId);
             operLog.setStatus(BusinessStatus.SUCCESS.ordinal());
             // 请求的地址
             String ip = IpUtils.getIpAddr();

+ 31 - 4
zkqy-framework/src/main/java/com/zkqy/framework/aspectj/SqlInterceptor.java

@@ -34,7 +34,7 @@ public class SqlInterceptor implements Interceptor {
          * //System.out.println(name);
          */
         String sql = statementHandler.getBoundSql().getSql();
-        if(sql.contains("{DBNAME}.")){
+        if (sql.contains("{DBNAME}.")) {
             String modifiedSql = modifySql(sql);
             if (modifiedSql.equals("error")) {
                 return AjaxResult.error("当前用户没有数据源信息!");
@@ -42,7 +42,13 @@ public class SqlInterceptor implements Interceptor {
                 ReflectUtils.setFieldValue(statementHandler.getBoundSql(), "sql", modifiedSql);
                 return invocation.proceed();
             }
-        }else {
+        } else {
+            // 达梦数据源下 ``不识别
+            if (sql.contains("m.`query`")) {
+                String endsql = sql.replace("m.`query`", "m.query");
+                ReflectUtils.setFieldValue(statementHandler.getBoundSql(), "sql", endsql);
+                return invocation.proceed();
+            }
             // 如果不在指定路径下,直接放行
             return invocation.proceed();
         }
@@ -57,8 +63,19 @@ public class SqlInterceptor implements Interceptor {
         }
         if (SecurityUtils.getDatabaseType().equals("sqlserver"))
             return "USE `" + SecurityUtils.getDatabaseName() + "`; " + sql;
-        if (SecurityUtils.getDatabaseType().equals("dm"))
+        if (SecurityUtils.getDatabaseType().equals("dm")) {
+            String endSQl;
+            if (sql.contains("{DBNAME}.")) {
+
+                // 如果sql中出现  ` 符号
+//                if (sql.contains("`")) {
+//                    sql.replace("`", "");
+//                }
+                return sql.replace("{DBNAME}", SecurityUtils.getDatabaseName()).replace("`", "");
+            }
             return "set schema " + SecurityUtils.getDatabaseName() + "; " + sql;
+        }
+
         if (SecurityUtils.getDatabaseType().equals("mysql")) {
             if (sql.contains("{DBNAME}.")) {
                 return sql.replace("{DBNAME}.", "`" + SecurityUtils.getDatabaseName() + "`.");
@@ -112,4 +129,14 @@ public class SqlInterceptor implements Interceptor {
     @Override
     public void setProperties(Properties properties) {
     }
-}
+}
+/*
+
+关系对应
+name:code
+age:asd
+state:staue
+默认值:
+state:1
+
+ */

+ 48 - 0
zkqy-framework/src/main/java/com/zkqy/framework/manager/factory/AsyncFactory.java

@@ -80,6 +80,54 @@ public class AsyncFactory
         };
     }
 
+    // 重写
+    public static TimerTask recordLogininfor(final Long tenantId,final String username, final String status, final String message,
+                                             final Object... args)
+    {
+        final UserAgent userAgent = UserAgent.parseUserAgentString(ServletUtils.getRequest().getHeader("User-Agent"));
+        final String ip = IpUtils.getIpAddr();
+        return new TimerTask()
+        {
+            @Override
+            public void run()
+            {
+                String address = AddressUtils.getRealAddressByIP(ip);
+                StringBuilder s = new StringBuilder();
+                s.append(LogUtils.getBlock(ip));
+                s.append(address);
+                s.append(LogUtils.getBlock(username));
+                s.append(LogUtils.getBlock(status));
+                s.append(LogUtils.getBlock(message));
+                // 打印信息到日志
+                sys_user_logger.info(s.toString(), args);
+                // 获取客户端操作系统
+                String os = userAgent.getOperatingSystem().getName();
+                // 获取客户端浏览器
+                String browser = userAgent.getBrowser().getName();
+                // 封装对象
+                SysLogininfor logininfor = new SysLogininfor();
+                logininfor.setUserName(username);
+                logininfor.setIpaddr(ip);
+                logininfor.setLoginLocation(address);
+                logininfor.setBrowser(browser);
+                logininfor.setOs(os);
+                logininfor.setMsg(message);
+                // 增加租户标识
+                logininfor.setTenantId(tenantId);
+                // 日志状态
+                if (StringUtils.equalsAny(status, Constants.LOGIN_SUCCESS, Constants.LOGOUT, Constants.REGISTER))
+                {
+                    logininfor.setStatus(Constants.SUCCESS);
+                }
+                else if (Constants.LOGIN_FAIL.equals(status))
+                {
+                    logininfor.setStatus(Constants.FAIL);
+                }
+                // 插入数据
+                SpringUtils.getBean(ISysLogininforService.class).insertLogininfor(logininfor);
+            }
+        };
+    }
     /**
      * 操作日志记录
      * 

+ 8 - 9
zkqy-framework/src/main/java/com/zkqy/framework/security/handle/LogoutSuccessHandlerImpl.java

@@ -4,6 +4,7 @@ import java.io.IOException;
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.security.core.Authentication;
@@ -20,32 +21,30 @@ import com.zkqy.framework.web.service.TokenService;
 
 /**
  * 自定义退出处理类 返回成功
- * 
+ *
  * @author ruoyi
  */
 @Configuration
-public class LogoutSuccessHandlerImpl implements LogoutSuccessHandler
-{
+public class LogoutSuccessHandlerImpl implements LogoutSuccessHandler {
     @Autowired
     private TokenService tokenService;
 
     /**
      * 退出处理
-     * 
+     *
      * @return
      */
     @Override
     public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication)
-            throws IOException, ServletException
-    {
+            throws IOException, ServletException {
         LoginUser loginUser = tokenService.getLoginUser(request);
-        if (StringUtils.isNotNull(loginUser))
-        {
+        if (StringUtils.isNotNull(loginUser)) {
             String userName = loginUser.getUsername();
             // 删除用户缓存记录
             tokenService.delLoginUser(loginUser.getToken());
+            Long tenantId = loginUser.getTenantId() == null ? 0L : loginUser.getTenantId();
             // 记录用户退出日志
-            AsyncManager.me().execute(AsyncFactory.recordLogininfor(userName, Constants.LOGOUT, "退出成功"));
+            AsyncManager.me().execute(AsyncFactory.recordLogininfor(tenantId, userName, Constants.LOGOUT, "退出成功"));
         }
         ServletUtils.renderString(response, JSON.toJSONString(AjaxResult.success("退出成功")));
     }

+ 41 - 51
zkqy-framework/src/main/java/com/zkqy/framework/web/service/SysLoginService.java

@@ -40,12 +40,11 @@ import java.time.ZoneOffset;
 
 /**
  * 登录校验方法
- * 
+ *
  * @author ruoyi
  */
 @Component
-public class SysLoginService
-{
+public class SysLoginService {
     @Autowired
     private TokenService tokenService;
 
@@ -54,7 +53,7 @@ public class SysLoginService
 
     @Autowired
     private RedisCache redisCache;
-    
+
     @Autowired
     private ISysUserService userService;
 
@@ -66,15 +65,14 @@ public class SysLoginService
 
     /**
      * 登录验证
-     * 
+     *
      * @param username 用户名
      * @param password 密码
-     * @param code 验证码
-     * @param uuid 唯一标识
+     * @param code     验证码
+     * @param uuid     唯一标识
      * @return 结果
      */
-    public String login(String username, String password, String code, String uuid)
-    {
+    public String login(String username, String password, String code, String uuid) {
         //验证码校验
         validateCaptcha(username, code, uuid);
         //登录前置校验
@@ -82,32 +80,33 @@ public class SysLoginService
 
         // 用户验证
         Authentication authentication = null;
-        try
-        {
+        try {
             UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(username, password);
             AuthenticationContextHolder.setContext(authenticationToken);
             // 该方法会去调用UserDetailsServiceImpl.loadUserByUsername
             authentication = authenticationManager.authenticate(authenticationToken);
-        }
-        catch (Exception e)
-        {
-            if (e instanceof BadCredentialsException)
-            {
+        } catch (Exception e) {
+            if (e instanceof BadCredentialsException) {
                 AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match")));
                 throw new UserPasswordNotMatchException();
-            }
-            else
-            {
+            } else {
                 AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, e.getMessage()));
                 throw new ServiceException(e.getMessage());
             }
-        }
-        finally
-        {
+        } finally {
             AuthenticationContextHolder.clearContext();
         }
-        AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success")));
         LoginUser loginUser = (LoginUser) authentication.getPrincipal();
+        Long tenantId;
+        try {
+            tenantId = loginUser.getTenantId();
+            if (tenantId == null) {
+                tenantId = 0L;// 0L 表示当前是admin(租户信息表id自增「自增id不会从0开始」)
+            }
+        } catch (Exception exception) {
+            tenantId = 0L;  // 0L 表示当前是admin(租户信息表id自增「自增id不会从0开始」)
+        }
+        AsyncManager.me().execute(AsyncFactory.recordLogininfor(tenantId, username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success")));
         recordLoginInfo(loginUser.getUserId());
         // 生成token
         return tokenService.createToken(loginUser);
@@ -115,27 +114,23 @@ public class SysLoginService
 
     /**
      * 校验验证码
-     * 
+     *
      * @param username 用户名
-     * @param code 验证码
-     * @param uuid 唯一标识
+     * @param code     验证码
+     * @param uuid     唯一标识
      * @return 结果
      */
-    public void validateCaptcha(String username, String code, String uuid)
-    {
+    public void validateCaptcha(String username, String code, String uuid) {
         boolean captchaEnabled = configService.selectCaptchaEnabled();
-        if (captchaEnabled)
-        {
+        if (captchaEnabled) {
             String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + StringUtils.nvl(uuid, "");
             String captcha = redisCache.getCacheObject(verifyKey);
             redisCache.deleteObject(verifyKey);
-            if (captcha == null)
-            {
+            if (captcha == null) {
                 AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire")));
                 throw new CaptchaExpireException();
             }
-            if (!code.equalsIgnoreCase(captcha))
-            {
+            if (!code.equalsIgnoreCase(captcha)) {
                 AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error")));
                 throw new CaptchaException();
             }
@@ -144,35 +139,31 @@ public class SysLoginService
 
     /**
      * 登录前置校验
+     *
      * @param username 用户名
      * @param password 用户密码
      */
-    public void loginPreCheck(String username, String password)
-    {
+    public void loginPreCheck(String username, String password) {
         // 用户名或密码为空 错误
-        if (StringUtils.isEmpty(username) || StringUtils.isEmpty(password))
-        {
+        if (StringUtils.isEmpty(username) || StringUtils.isEmpty(password)) {
             AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("not.null")));
             throw new UserNotExistsException();
         }
         // 密码如果不在指定范围内 错误
         if (password.length() < UserConstants.PASSWORD_MIN_LENGTH
-                || password.length() > UserConstants.PASSWORD_MAX_LENGTH)
-        {
+                || password.length() > UserConstants.PASSWORD_MAX_LENGTH) {
             AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match")));
             throw new UserPasswordNotMatchException();
         }
         // 用户名不在指定范围内 错误
         if (username.length() < UserConstants.USERNAME_MIN_LENGTH
-                || username.length() > UserConstants.USERNAME_MAX_LENGTH)
-        {
+                || username.length() > UserConstants.USERNAME_MAX_LENGTH) {
             AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match")));
             throw new UserPasswordNotMatchException();
         }
         // IP黑名单校验
         String blackStr = configService.selectConfigByKey("sys.login.blackIPList");
-        if (IpUtils.isMatchedIp(blackStr, IpUtils.getIpAddr()))
-        {
+        if (IpUtils.isMatchedIp(blackStr, IpUtils.getIpAddr())) {
             AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("login.blocked")));
             throw new BlackListException();
         }
@@ -183,8 +174,7 @@ public class SysLoginService
      *
      * @param userId 用户ID
      */
-    public void recordLoginInfo(Long userId)
-    {
+    public void recordLoginInfo(Long userId) {
         SysUser sysUser = new SysUser();
         sysUser.setUserId(userId);
         sysUser.setLoginIp(IpUtils.getIpAddr());
@@ -195,24 +185,24 @@ public class SysLoginService
     public String checkTenantExpirationTime(String username) {
         SysUser user = userService.selectUserByUserName(username);
         //拿到当前登录用户
-        if(!user.getUserName().equals("admin")){
+        if (!user.getUserName().equals("admin")) {
             //根据租户id查询租户信息
             SysTenant sysTenant = sysTenantService.selectSysTenantByTenantId(user.getTenantId());
-            if(sysTenant.getTenantExpirationTime()==null||sysTenant.getTenantExpirationTime().isEmpty()){
+            if (sysTenant.getTenantExpirationTime() == null || sysTenant.getTenantExpirationTime().isEmpty()) {
                 return "该用户租户信息并未激活";
             }
             SymmetricCrypto symmetricCrypto = new SymmetricCrypto(SymmetricAlgorithm.DES, "sgEsnN6QWq8W7j5H01020304".getBytes());
             //当前时间
-            LocalDateTime now=LocalDateTime.now();
+            LocalDateTime now = LocalDateTime.now();
             long nowSecond = now.toEpochSecond(ZoneOffset.ofHours(8));
             //到期时间
             String LastActiveTimeStr = symmetricCrypto.decryptStr(sysTenant.getTenantExpirationTime(), CharsetUtil.CHARSET_UTF_8);
             LocalDateTime LastActiveDateTime = DateUtils.toLocalDateTime(LastActiveTimeStr, "yyyy-MM-dd HH:mm:ss");
             long expirationTimeSecond = LastActiveDateTime.toEpochSecond(ZoneOffset.ofHours(8));
             //计算时间戳
-            long difference=expirationTimeSecond-nowSecond; //相差的时间数 后边减前边
+            long difference = expirationTimeSecond - nowSecond; //相差的时间数 后边减前边
             //如果是负数证明已经过期了
-            if(difference<0){
+            if (difference < 0) {
                 return "该用户租户信息已过期";
             }
         }

+ 23 - 0
zkqy-framework/src/main/java/com/zkqy/framework/web/service/TokenService.java

@@ -4,6 +4,8 @@ import java.util.HashMap;
 import java.util.Map;
 import java.util.concurrent.TimeUnit;
 import javax.servlet.http.HttpServletRequest;
+
+import com.zkqy.common.utils.SecurityUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
@@ -76,6 +78,27 @@ public class TokenService
         }
         return null;
     }
+    /**
+     * 验证当前用户是否为admin
+     *
+     * @return 用户信息
+     */
+    public boolean getLoginUserIsAdminByToken(String token) {
+        if (StringUtils.isNotEmpty(token)) {
+            try {
+                String uuid = "";
+                Claims claims = parseToken(token);
+                // 解析对应的权限以及用户信息
+                uuid = (String) claims.get(Constants.LOGIN_USER_KEY);
+                String userKey = getTokenKey(uuid);
+                LoginUser user = redisCache.getCacheObject(userKey);
+                return SecurityUtils.isAdmin(user.getUserId());
+            } catch (Exception e) {
+                System.out.println(e);
+            }
+        }
+        return false;
+    }
 
     /**
      * 设置用户身份信息

+ 7 - 0
zkqy-process-execution/pom.xml

@@ -24,6 +24,13 @@
             <groupId>com.zkqy</groupId>
             <artifactId>zkqy-system</artifactId>
         </dependency>
+        <!-- https://mvnrepository.com/artifact/com.google.zxing/core -->
+        <dependency>
+            <groupId>com.google.zxing</groupId>
+            <artifactId>core</artifactId>
+            <version>3.5.1</version>
+        </dependency>
+
     </dependencies>
 
 </project>

+ 105 - 0
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/controller/BpmApprovalStatusController.java

@@ -0,0 +1,105 @@
+package com.zkqy.execution.produce.dispersed.controller;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.zkqy.common.utils.poi.ExcelUtil;
+import com.zkqy.execution.produce.dispersed.entity.BpmApprovalStatus;
+import com.zkqy.execution.produce.dispersed.service.IBpmApprovalStatusService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.zkqy.common.annotation.Log;
+import com.zkqy.common.core.controller.BaseController;
+import com.zkqy.common.core.domain.AjaxResult;
+import com.zkqy.common.enums.BusinessType;
+import com.zkqy.common.core.page.TableDataInfo;
+
+/**
+ * 审批数据条中间Controller
+ *
+ * @author hzh
+ * @date 2024-01-31
+ */
+@RestController
+@RequestMapping("/system/approvalStatus")
+public class BpmApprovalStatusController extends BaseController
+{
+    @Autowired
+    private IBpmApprovalStatusService bpmApprovalStatusService;
+
+/**
+ * 查询审批数据条中间列表
+ */
+@PreAuthorize("@ss.hasPermi('system:approvalStatus:list')")
+@GetMapping("/list")
+    public TableDataInfo list(BpmApprovalStatus bpmApprovalStatus)
+    {
+        startPage();
+        List<BpmApprovalStatus> list = bpmApprovalStatusService.selectBpmApprovalStatusList(bpmApprovalStatus);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出审批数据条中间列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:approvalStatus:export')")
+    @Log(title = "审批数据条中间", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, BpmApprovalStatus bpmApprovalStatus)
+    {
+        List<BpmApprovalStatus> list = bpmApprovalStatusService.selectBpmApprovalStatusList(bpmApprovalStatus);
+        ExcelUtil<BpmApprovalStatus> util = new ExcelUtil<BpmApprovalStatus>(BpmApprovalStatus.class);
+        util.exportExcel(response, list, "审批数据条中间数据");
+    }
+
+    /**
+     * 获取审批数据条中间详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:approvalStatus:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(bpmApprovalStatusService.selectBpmApprovalStatusById(id));
+    }
+
+    /**
+     * 新增审批数据条中间
+     */
+    @PreAuthorize("@ss.hasPermi('system:approvalStatus:add')")
+    @Log(title = "审批数据条中间", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody BpmApprovalStatus bpmApprovalStatus)
+    {
+        return toAjax(bpmApprovalStatusService.insertBpmApprovalStatus(bpmApprovalStatus));
+    }
+
+    /**
+     * 修改审批数据条中间
+     */
+    @PreAuthorize("@ss.hasPermi('system:approvalStatus:edit')")
+    @Log(title = "审批数据条中间", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody BpmApprovalStatus bpmApprovalStatus)
+    {
+        return toAjax(bpmApprovalStatusService.updateBpmApprovalStatus(bpmApprovalStatus));
+    }
+
+    /**
+     * 删除审批数据条中间
+     */
+    @PreAuthorize("@ss.hasPermi('system:approvalStatus:remove')")
+    @Log(title = "审批数据条中间", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(bpmApprovalStatusService.deleteBpmApprovalStatusByIds(ids));
+    }
+}

+ 5 - 5
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/controller/BpmExecuteNodeController.java

@@ -44,7 +44,7 @@ public class BpmExecuteNodeController extends BaseController {
      * 导出节点执行(记录)列表
      */
     @PreAuthorize("@ss.hasPermi('system:node:export')")
-    @Log(title = "节点执行(记录)", businessType = BusinessType.EXPORT)
+    @Log(title = "节点执行日志", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
     public void export(HttpServletResponse response, BpmExecuteNode bpmExecuteNode) {
         List<BpmExecuteNode> list = bpmExecuteNodeService.selectBpmExecuteNodeList(bpmExecuteNode);
@@ -65,7 +65,7 @@ public class BpmExecuteNodeController extends BaseController {
      * 新增节点执行(记录)
      */
     @PreAuthorize("@ss.hasPermi('system:node:add')")
-    @Log(title = "节点执行(记录)", businessType = BusinessType.INSERT)
+    @Log(title = "节点执行日志", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody BpmExecuteNode bpmExecuteNode) {
         return toAjax(bpmExecuteNodeService.insertBpmExecuteNode(bpmExecuteNode));
@@ -74,8 +74,8 @@ public class BpmExecuteNodeController extends BaseController {
     /**
      * 修改节点执行(记录)
      */
-    @PreAuthorize("@ss.hasPermi('system:node:edit')")
-    @Log(title = "节点执行(记录)", businessType = BusinessType.UPDATE)
+    //@PreAuthorize("@ss.hasPermi('system:node:edit')")
+    @Log(title = "节点执行日志", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody BpmExecuteNode bpmExecuteNode) {
         return toAjax(bpmExecuteNodeService.updateBpmExecuteNode(bpmExecuteNode));
@@ -85,7 +85,7 @@ public class BpmExecuteNodeController extends BaseController {
      * 删除节点执行(记录)
      */
     @PreAuthorize("@ss.hasPermi('system:node:remove')")
-    @Log(title = "节点执行(记录)", businessType = BusinessType.DELETE)
+    @Log(title = "节点执行日志", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(bpmExecuteNodeService.deleteBpmExecuteNodeByIds(ids));

+ 4 - 4
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/controller/BpmExecuteNodeFormController.java

@@ -44,7 +44,7 @@ public class BpmExecuteNodeFormController extends BaseController {
      * 导出执行节点单列表
      */
     @PreAuthorize("@ss.hasPermi('system:form:export')")
-    @Log(title = "执行节点单", businessType = BusinessType.EXPORT)
+    @Log(title = "执行节点单", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
     public void export(HttpServletResponse response, BpmExecuteNodeForm bpmExecuteNodeForm) {
         List<BpmExecuteNodeForm> list = bpmExecuteNodeFormService.selectBpmExecuteNodeFormList(bpmExecuteNodeForm);
@@ -65,7 +65,7 @@ public class BpmExecuteNodeFormController extends BaseController {
      * 新增执行节点单
      */
     @PreAuthorize("@ss.hasPermi('system:form:add')")
-    @Log(title = "执行节点单", businessType = BusinessType.INSERT)
+    @Log(title = "执行节点单", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody BpmExecuteNodeForm bpmExecuteNodeForm) {
         return toAjax(bpmExecuteNodeFormService.insertBpmExecuteNodeForm(bpmExecuteNodeForm));
@@ -75,7 +75,7 @@ public class BpmExecuteNodeFormController extends BaseController {
      * 修改执行节点单
      */
     @PreAuthorize("@ss.hasPermi('system:form:edit')")
-    @Log(title = "执行节点单", businessType = BusinessType.UPDATE)
+    @Log(title = "执行节点单", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody BpmExecuteNodeForm bpmExecuteNodeForm) {
         return toAjax(bpmExecuteNodeFormService.updateBpmExecuteNodeForm(bpmExecuteNodeForm));
@@ -85,7 +85,7 @@ public class BpmExecuteNodeFormController extends BaseController {
      * 删除执行节点单
      */
     @PreAuthorize("@ss.hasPermi('system:form:remove')")
-    @Log(title = "执行节点单", businessType = BusinessType.DELETE)
+    @Log(title = "执行节点单", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(bpmExecuteNodeFormService.deleteBpmExecuteNodeFormByIds(ids));

+ 4 - 4
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/controller/BpmExecuteNodeMiddleController.java

@@ -43,7 +43,7 @@ public class BpmExecuteNodeMiddleController extends BaseController {
      * 导出执行流程用户、节点关联脚本中间列表
      */
     @PreAuthorize("@ss.hasPermi('system:middle:export')")
-    @Log(title = "执行流程用户、节点关联脚本中间", businessType = BusinessType.EXPORT)
+    @Log(title = "执行流程日志", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
     public void export(HttpServletResponse response, BpmExecuteNodeMiddle bpmExecuteNodeMiddle) {
         List<BpmExecuteNodeMiddle> list = bpmExecuteNodeMiddleService.selectBpmExecuteNodeMiddleList(bpmExecuteNodeMiddle);
@@ -64,7 +64,7 @@ public class BpmExecuteNodeMiddleController extends BaseController {
      * 新增执行流程用户、节点关联脚本中间
      */
     @PreAuthorize("@ss.hasPermi('system:middle:add')")
-    @Log(title = "执行流程用户、节点关联脚本中间", businessType = BusinessType.INSERT)
+    @Log(title = "执行流程日志", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody BpmExecuteNodeMiddle bpmExecuteNodeMiddle) {
         return toAjax(bpmExecuteNodeMiddleService.insertBpmExecuteNodeMiddle(bpmExecuteNodeMiddle));
@@ -74,7 +74,7 @@ public class BpmExecuteNodeMiddleController extends BaseController {
      * 修改执行流程用户、节点关联脚本中间
      */
     @PreAuthorize("@ss.hasPermi('system:middle:edit')")
-    @Log(title = "执行流程用户、节点关联脚本中间", businessType = BusinessType.UPDATE)
+    @Log(title = "执行流程日志", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody BpmExecuteNodeMiddle bpmExecuteNodeMiddle) {
         return toAjax(bpmExecuteNodeMiddleService.updateBpmExecuteNodeMiddle(bpmExecuteNodeMiddle));
@@ -84,7 +84,7 @@ public class BpmExecuteNodeMiddleController extends BaseController {
      * 删除执行流程用户、节点关联脚本中间
      */
     @PreAuthorize("@ss.hasPermi('system:middle:remove')")
-    @Log(title = "执行流程用户、节点关联脚本中间", businessType = BusinessType.DELETE)
+    @Log(title = "执行流程日志", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(bpmExecuteNodeMiddleService.deleteBpmExecuteNodeMiddleByIds(ids));

+ 28 - 1
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/controller/BpmRunController.java

@@ -48,7 +48,7 @@ public class BpmRunController extends BaseController {
     }
 
     /**
-     * 共通执行节点接口
+     * 共通执行节点接口 工业离散型
      */
     @Log(title = "执行流程节点", businessType = BusinessType.INSERT)
     @PostMapping("/processNodeExecution")
@@ -66,6 +66,25 @@ public class BpmRunController extends BaseController {
         return AjaxResult.success(ipreExecutionToolClass.executionNode(bpmRunNodeVo));
     }
 
+    /**
+     * 共通执行节点接口 审批类型
+     */
+    @Log(title = "执行流程节点", businessType = BusinessType.INSERT)
+    @PostMapping("/processNodeExecutionApproval")
+    public AjaxResult processNodeExecutionApproval(BpmRunNodeVo bpmRunNodeVo, @RequestParam("fileXML") MultipartFile fileXML) {
+        if (!fileXML.isEmpty()) {
+            try {
+                // 解析得到当前文件中的内容
+                byte[] bytes = fileXML.getBytes();
+                String xmlContent = new String(bytes);
+                bpmRunNodeVo.setTaskProcessXmlContent(xmlContent);
+            } catch (IOException e) {
+                throw new RuntimeException(e);
+            }
+        }
+        return AjaxResult.success(ipreExecutionToolClass.approvalNode(bpmRunNodeVo));
+    }
+
 
     /**
      * 共通执行节点表单回显数据接口
@@ -75,6 +94,14 @@ public class BpmRunController extends BaseController {
         return AjaxResult.success(ipreExecutionToolClass.processNodeFormInfoData(bpmRunNodeFromVo));
     }
 
+    /**
+     * 共通执行节点表单回显数据接口
+     */
+    @GetMapping("/processNodeFormTemplate")
+    public AjaxResult processNodeFormTemplate (BpmRunNodeFromVo bpmRunNodeFromVo) {
+        return AjaxResult.success(ipreExecutionToolClass.getProcessNodeFormTemplate(bpmRunNodeFromVo));
+    }
+
     /**
      * 处理流程节点表单提交的业务数据
      *

+ 112 - 0
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/entity/BpmApprovalStatus.java

@@ -0,0 +1,112 @@
+package com.zkqy.execution.produce.dispersed.entity;
+
+import com.zkqy.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.zkqy.common.annotation.Excel;
+
+/**
+ * 审批数据条中间对象 bpm_approval_status
+ *
+ * @author hzh
+ * @date 2024-01-31
+ */
+public class BpmApprovalStatus extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    private Long id;
+
+    /**
+     * 表名某张表的数据表名
+     */
+    @Excel(name = "表名某张表的数据表名")
+    private String tableName;
+
+    /**
+     * 审批数据条主键
+     */
+    @Excel(name = "审批数据条主键")
+    private String tableId;
+
+    /**
+     * 审批状态 (0:已提交、1:已通过、2:不通过、4:驳回、5:审批中)
+     */
+    @Excel(name = "审批状态 (0:已提交、1:已通过、2:不通过、4:驳回、5:审批中)")
+    private String approvalState;
+
+    /**
+     * 流程任务key
+     */
+    @Excel(name = "流程任务key")
+    private String taskKey;
+
+    public BpmApprovalStatus(String approvalState, String taskKey) {
+        this.approvalState = approvalState;
+        this.taskKey = taskKey;
+    }
+
+    public BpmApprovalStatus() {
+    }
+
+    public BpmApprovalStatus(Long id, String tableName, String tableId, String approvalState, String taskKey) {
+        this.id = id;
+        this.tableName = tableName;
+        this.tableId = tableId;
+        this.approvalState = approvalState;
+        this.taskKey = taskKey;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setTableName(String tableName) {
+        this.tableName = tableName;
+    }
+
+    public String getTableName() {
+        return tableName;
+    }
+
+    public void setTableId(String tableId) {
+        this.tableId = tableId;
+    }
+
+    public String getTableId() {
+        return tableId;
+    }
+
+    public void setApprovalState(String approvalState) {
+        this.approvalState = approvalState;
+    }
+
+    public String getApprovalState() {
+        return approvalState;
+    }
+
+    public void setTaskKey(String taskKey) {
+        this.taskKey = taskKey;
+    }
+
+    public String getTaskKey() {
+        return taskKey;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("id", getId())
+                .append("tableName", getTableName())
+                .append("tableId", getTableId())
+                .append("approvalState", getApprovalState())
+                .append("taskKey", getTaskKey())
+                .toString();
+    }
+}

+ 20 - 9
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/entity/runbpm/BpmBackNodeVo.java

@@ -23,6 +23,26 @@ public class BpmBackNodeVo {
      */
     private String taskBackNodeKey;
 
+    /**
+     * 当前回退节点的类型
+     */
+    private String taskNodeType;
+
+    public BpmBackNodeVo(String taskProcessKey, String taskNodeKey, String taskBackNodeKey, String taskNodeType) {
+        this.taskProcessKey = taskProcessKey;
+        this.taskNodeKey = taskNodeKey;
+        this.taskBackNodeKey = taskBackNodeKey;
+        this.taskNodeType = taskNodeType;
+    }
+
+    public String getTaskNodeType() {
+        return taskNodeType;
+    }
+
+    public void setTaskNodeType(String taskNodeType) {
+        this.taskNodeType = taskNodeType;
+    }
+
     public BpmBackNodeVo() {
     }
 
@@ -56,13 +76,4 @@ public class BpmBackNodeVo {
         this.taskBackNodeKey = taskBackNodeKey;
     }
 
-    @Override
-    public String toString() {
-        final StringBuilder sb = new StringBuilder("BpmBackNodeVo{");
-        sb.append("taskProcessKey='").append(taskProcessKey).append('\'');
-        sb.append(", taskNodeKey='").append(taskNodeKey).append('\'');
-        sb.append(", taskBackNodeKey='").append(taskBackNodeKey).append('\'');
-        sb.append('}');
-        return sb.toString();
-    }
 }

+ 24 - 2
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/entity/runbpm/BpmRunNodeFormFilterConditionsVo.java

@@ -24,10 +24,14 @@ public class BpmRunNodeFormFilterConditionsVo {
      * 例如:下拉框是当前节点表单的回显数据,并不是回填的操作数据
      * <p>
      * 默认拼接当前任务、节点编码
+     * 是否带流程编码
      */
     private boolean isNodeOnlyData;
 
-
+    /**
+     *
+     */
+    //private boolean isNodeOnlyData;
     /**
      * 如果是数组,那么这就是返回数据的key
      * <p>
@@ -38,17 +42,26 @@ public class BpmRunNodeFormFilterConditionsVo {
      */
     private String listKey;
 
+    /**
+     * 是否以表名为键
+     */
+    private boolean  isTableNameKey = true;
+
+
     public BpmRunNodeFormFilterConditionsVo() {
         this.isNodeOnlyData = true;
+        this.isTableNameKey= true;
     }
 
+
     @Override
     public String toString() {
-        final StringBuilder sb = new StringBuilder("BpmRunNodeFormFilterConditionsVo{");
+        final StringBuffer sb = new StringBuffer("BpmRunNodeFormFilterConditionsVo{");
         sb.append("tableName='").append(tableName).append('\'');
         sb.append(", condition=").append(condition);
         sb.append(", isNodeOnlyData=").append(isNodeOnlyData);
         sb.append(", listKey='").append(listKey).append('\'');
+        sb.append(", isTableNameKey=").append(isTableNameKey);
         sb.append('}');
         return sb.toString();
     }
@@ -77,6 +90,12 @@ public class BpmRunNodeFormFilterConditionsVo {
         this.listKey = listKey;
     }
 
+    public BpmRunNodeFormFilterConditionsVo(String tableName, Map<String, Object> condition, boolean isNodeOnlyData, boolean isTableNameKey) {
+        this.tableName = tableName;
+        this.condition = condition;
+        this.isNodeOnlyData = isNodeOnlyData;
+        this.isTableNameKey = isTableNameKey;
+    }
     public String getTableName() {
         return tableName;
     }
@@ -109,4 +128,7 @@ public class BpmRunNodeFormFilterConditionsVo {
         this.listKey = listKey;
     }
 
+    public boolean getIsTableNameKey() {return isTableNameKey;}
+
+    public void setIsTableNameKey(boolean isTableNameKey) {this.isTableNameKey = isTableNameKey;}
 }

+ 32 - 3
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/entity/runbpm/BpmRunNodeVo.java

@@ -36,6 +36,28 @@ public class BpmRunNodeVo {
     // 节点类型
     private String taskNodeType;
 
+    // 审批状态
+    private String approvalStatus;
+
+    // 审批备注
+    private String approvalRemark;
+
+
+    public String getApprovalStatus() {
+        return approvalStatus;
+    }
+
+    public void setApprovalStatus(String approvalStatus) {
+        this.approvalStatus = approvalStatus;
+    }
+
+    public String getApprovalRemark() {
+        return approvalRemark;
+    }
+
+    public void setApprovalRemark(String approvalRemark) {
+        this.approvalRemark = approvalRemark;
+    }
 
     public String getTaskNodeType() {
         return taskNodeType;
@@ -90,7 +112,7 @@ public class BpmRunNodeVo {
         return formDataMap;
     }
 
-    public void setFormDataMap(String formDataMap) {
+    public void setFormDataMapString(String formDataMap) {
         try {
             ObjectMapper objectMapper = new ObjectMapper();
             this.formDataMap = objectMapper.readValue(formDataMap, Map.class);
@@ -100,6 +122,11 @@ public class BpmRunNodeVo {
         }
     }
 
+    public void setFormDataMap(Map<String, Object> formDataMap) {
+        this.formDataMap = formDataMap;
+    }
+
+
     public String getTableName() {
         return tableName;
     }
@@ -110,7 +137,7 @@ public class BpmRunNodeVo {
 
     @Override
     public String toString() {
-        final StringBuffer sb = new StringBuffer("BpmRunNodeVo{");
+        final StringBuilder sb = new StringBuilder("BpmRunNodeVo{");
         sb.append("taskProcessKey='").append(taskProcessKey).append('\'');
         sb.append(", taskNodeKey='").append(taskNodeKey).append('\'');
         sb.append(", nextNodeKey='").append(nextNodeKey).append('\'');
@@ -118,6 +145,9 @@ public class BpmRunNodeVo {
         sb.append(", taskProcessXmlContent='").append(taskProcessXmlContent).append('\'');
         sb.append(", formDataMap=").append(formDataMap);
         sb.append(", tableName='").append(tableName).append('\'');
+        sb.append(", taskNodeType='").append(taskNodeType).append('\'');
+        sb.append(", approvalStatus='").append(approvalStatus).append('\'');
+        sb.append(", approvalRemark='").append(approvalRemark).append('\'');
         sb.append('}');
         return sb.toString();
     }
@@ -126,7 +156,6 @@ public class BpmRunNodeVo {
     }
 
 
-
     public BpmRunNodeVo(String taskProcessKey, String taskNodeKey, String nextNodeKey, String implementationName, String taskProcessXmlContent, Map<String, Object> formDataMap, String tableName, String taskNodeType) {
         this.taskProcessKey = taskProcessKey;
         this.taskNodeKey = taskNodeKey;

+ 36 - 3
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/entity/runbpm/TriggerExceptionVO.java

@@ -5,15 +5,32 @@ package com.zkqy.execution.produce.dispersed.entity.runbpm;
  */
 public class TriggerExceptionVO {
 
-    /** 执行流程任务编号 */
+    /**
+     * 执行流程任务编号
+     */
     private String taskProcessKey;
 
-    /** 任务节点编号 */
+    /**
+     * 任务节点编号
+     */
     private String taskNodeKey;
 
-    /** 节点脚本 */
+    /**
+     * 当前抛出异常节点类型
+     */
+    private String taskNodeType;
+
+    /**
+     * 异常抛出异常参数,当前节点的下一个执行节点key
+     */
+    private String taskNextNodeKey;
+
+    /**
+     * 节点脚本
+     */
     private SysBpmNodeScriptVO sysBpmNodeScriptVO;
 
+
     public String getTaskProcessKey() {
         return taskProcessKey;
     }
@@ -37,4 +54,20 @@ public class TriggerExceptionVO {
     public void setSysBpmNodeScriptVO(SysBpmNodeScriptVO sysBpmNodeScriptVO) {
         this.sysBpmNodeScriptVO = sysBpmNodeScriptVO;
     }
+
+    public String getTaskNodeType() {
+        return taskNodeType;
+    }
+
+    public void setTaskNodeType(String taskNodeType) {
+        this.taskNodeType = taskNodeType;
+    }
+
+    public String getTaskNextNodeKey() {
+        return taskNextNodeKey;
+    }
+
+    public void setTaskNextNodeKey(String taskNextNodeKey) {
+        this.taskNextNodeKey = taskNextNodeKey;
+    }
 }

+ 70 - 0
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/mapper/BpmApprovalStatusMapper.java

@@ -0,0 +1,70 @@
+package com.zkqy.execution.produce.dispersed.mapper;
+
+import com.zkqy.execution.produce.dispersed.entity.BpmApprovalStatus;
+
+import java.util.List;
+
+/**
+ * 审批数据条中间Mapper接口
+ *
+ * @author hzh
+ * @date 2024-01-31
+ */
+public interface BpmApprovalStatusMapper {
+    /**
+     * 查询审批数据条中间
+     *
+     * @param id 审批数据条中间主键
+     * @return 审批数据条中间
+     */
+    public BpmApprovalStatus selectBpmApprovalStatusById(Long id);
+
+    /**
+     * 查询审批数据条中间列表
+     *
+     * @param bpmApprovalStatus 审批数据条中间
+     * @return 审批数据条中间集合
+     */
+    public List<BpmApprovalStatus> selectBpmApprovalStatusList(BpmApprovalStatus bpmApprovalStatus);
+
+    /**
+     * 新增审批数据条中间
+     *
+     * @param bpmApprovalStatus 审批数据条中间
+     * @return 结果
+     */
+    public int insertBpmApprovalStatus(BpmApprovalStatus bpmApprovalStatus);
+
+    /**
+     * 修改审批数据条中间
+     *
+     * @param bpmApprovalStatus 审批数据条中间
+     * @return 结果
+     */
+    public int updateBpmApprovalStatus(BpmApprovalStatus bpmApprovalStatus);
+
+    /**
+     * 删除审批数据条中间
+     *
+     * @param id 审批数据条中间主键
+     * @return 结果
+     */
+    public int deleteBpmApprovalStatusById(Long id);
+
+    /**
+     * 批量删除审批数据条中间
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteBpmApprovalStatusByIds(Long[] ids);
+
+
+    /**
+     * 修改当前审批条状态根据任务key
+     *
+     * @param bpmApprovalStatus
+     * @return
+     */
+    public int updateBpmApprovalStatusByTaskKey(BpmApprovalStatus bpmApprovalStatus);
+}

+ 26 - 15
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/mapper/BpmExecuteNodeFormMapper.java

@@ -9,15 +9,23 @@ import java.util.Map;
 
 /**
  * 执行节点单Mapper接口
- * 
+ *
  * @author zkqy
  * @date 2023-12-07
  */
-public interface BpmExecuteNodeFormMapper 
-{
+public interface BpmExecuteNodeFormMapper {
+    /**
+     * @param taskProcessKey 当前流程Key
+     * @param taskNodeKey
+     * @param taskScriptKeys 需要得到的信息的异常脚本节点Key
+     * @return
+     */
+
+    List<BpmExecuteNodeForm> selectByTaskScriptKeys(@Param("taskProcessKey") String taskProcessKey, @Param("taskScriptKeys") List<String> taskScriptKeys);
+
     /**
      * 查询执行节点单
-     * 
+     *
      * @param id 执行节点单主键
      * @return 执行节点单
      */
@@ -25,7 +33,7 @@ public interface BpmExecuteNodeFormMapper
 
     /**
      * 查询执行节点单列表
-     * 
+     *
      * @param bpmExecuteNodeForm 执行节点单
      * @return 执行节点单集合
      */
@@ -33,7 +41,7 @@ public interface BpmExecuteNodeFormMapper
 
     /**
      * 新增执行节点单
-     * 
+     *
      * @param bpmExecuteNodeForm 执行节点单
      * @return 结果
      */
@@ -41,7 +49,7 @@ public interface BpmExecuteNodeFormMapper
 
     /**
      * 修改执行节点单
-     * 
+     *
      * @param bpmExecuteNodeForm 执行节点单
      * @return 结果
      */
@@ -49,7 +57,7 @@ public interface BpmExecuteNodeFormMapper
 
     /**
      * 删除执行节点单
-     * 
+     *
      * @param id 执行节点单主键
      * @return 结果
      */
@@ -57,7 +65,7 @@ public interface BpmExecuteNodeFormMapper
 
     /**
      * 批量删除执行节点单
-     * 
+     *
      * @param ids 需要删除的数据主键集合
      * @return 结果
      */
@@ -80,35 +88,38 @@ public interface BpmExecuteNodeFormMapper
     BpmExecuteNodeForm selectBpmExecuteNodeFormInfo(BpmExecuteNodeForm bpmExecuteNodeForm);
 
     /**
-     *  根据 taskProcessKey和 taskNodeKey查询当前节点执行的表单模版信息
+     * 根据 taskProcessKey和 taskNodeKey查询当前节点执行的表单模版信息
      */
-    public BpmExecuteNodeForm selectBpmExecuteNodeFormByTpKAndTnkAndTsk(@Param("taskProcessKey") String taskProcessKey, @Param("taskNodeKey") String taskNodeKey,  @Param("taskScriptKey") String taskScriptKey);
+    public BpmExecuteNodeForm selectBpmExecuteNodeFormByTpKAndTnkAndTsk(@Param("taskProcessKey") String taskProcessKey, @Param("taskNodeKey") String taskNodeKey, @Param("taskScriptKey") String taskScriptKey);
 
     /**
      * 根据tableSql查询这个sql对应的数据
+     *
      * @param tableSql
      * @return
      */
-    public Map<String,String> tableSql(String tableSql);
+    public Map<String, String> tableSql(String tableSql);
 
     /**
      * 根据tableSql查询这个sql对应的数据(目前是查询表单下拉框数据在用)
+     *
      * @param tableSql
      * @return
      */
-    public List<Map<String,Object>> executeSql(String tableSql);
+    public List<Map<String, Object>> executeSql(String tableSql);
 
     /**
      * 根据sqlKey查询tableSql数据
+     *
      * @param sqlKey
      * @return
      */
-    public Map<String,String> getTableSqlBySqlKey(String sqlKey);
+    public Map<String, String> getTableSqlBySqlKey(String sqlKey);
 
     /**
      * 根据sqlKey查询对应表单
      */
-    public Map<String,String> getDfFormInfo();
+    public Map<String, String> getDfFormInfo();
 
 
 }

+ 7 - 0
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/mapper/BpmExecuteNodeMapper.java

@@ -92,6 +92,13 @@ public interface BpmExecuteNodeMapper {
      */
     public int updateNodeStateByKeys(@Param("processKey") String processKey, @Param("nodeKeys") List<String> nodeKeys);
 
+    /**
+     * 回退流程之后删除被回退节点后的异常节点
+     *
+     * @param processKey 当前流程key
+     * @param nodeKeys
+     * @return
+     */
     public int deleteExceptionNodeByKeys(@Param("processKey") String processKey, @Param("nodeKeys") List<String> nodeKeys);
 
     /**

+ 264 - 117
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/runbpm/PreExecutionToolClass.java

@@ -1,17 +1,22 @@
 package com.zkqy.execution.produce.dispersed.runbpm;
 
 
-
-
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONArray;
+import com.alibaba.fastjson2.JSONObject;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
 import com.zkqy.common.constant.HttpStatus;
 import com.zkqy.common.core.domain.AjaxResult;
 import com.zkqy.common.utils.DateUtils;
 import com.zkqy.common.utils.SecurityUtils;
+import com.zkqy.common.utils.StringUtils;
 import com.zkqy.common.utils.bpm.XmlDataParserUtils;
 import com.zkqy.common.utils.uuid.IdUtils;
 import com.zkqy.execution.produce.dispersed.entity.*;
 import com.zkqy.execution.produce.dispersed.entity.runbpm.*;
 import com.zkqy.execution.produce.dispersed.mapper.*;
+import com.zkqy.execution.produce.dispersed.service.IBpmApprovalStatusService;
 import com.zkqy.execution.produce.dispersed.service.IBpmExecuteNodeFormService;
 import com.zkqy.execution.produce.dispersed.service.IBpmExecuteNodeLogService;
 import com.zkqy.execution.produce.dispersed.service.IBpmExecuteProcessService;
@@ -73,6 +78,9 @@ public class PreExecutionToolClass<R> {
     @Autowired  // 节点日志
     private IBpmExecuteNodeLogService iBpmExecuteNodeLogService;
 
+    @Autowired  // 审批流程中间表
+    private IBpmApprovalStatusService iBpmApprovalStatusService;
+
     /**
      * 预执行流程自动执行开始节点
      *
@@ -86,13 +94,25 @@ public class PreExecutionToolClass<R> {
         /**
          * 根据流程key校验当前流程数据的完整性,是否可以运行
          */
-//        if (!iVerifyExecutionProcess.VerifyProcessData(intoProduction.getTaskProcessKey())) {
-//            return AjaxResult.error(HttpStatus.EXECUTEPROCESS, "流程数据验证失败!");
-//        }
+        // if (!iVerifyExecutionProcess.VerifyProcessData(intoProduction.getTaskProcessKey())) {
+        // return AjaxResult.error(HttpStatus.EXECUTEPROCESS, "流程数据验证失败!");
+        // }
         /**1️⃣1️⃣1️⃣ 得到当前投产需要执行的流程详细信息*/
         //--得到当前流程的详细信息
         BpmProcess bpmProcess = bpmProcessMapper.selectBpmProcessByProcessKey(
                 intoProduction.getTaskProcessKey());
+
+        String taskKey = IdUtils.fastSimpleUUID(); // 得到流程的唯一标识
+        if (bpmProcess.getProcessType().toString().equals("1")) { // 当前被发起的流程是审批类型
+            //  发起审批类型的流程逻辑
+            BpmApprovalStatus bpmApprovalStatus = new BpmApprovalStatus();
+            bpmApprovalStatus.setTableName(intoProduction.getTableName());
+            bpmApprovalStatus.setTableId(intoProduction.getGuid());
+            bpmApprovalStatus.setApprovalState("5");// 当前流程发起后更改数据条状态
+            bpmApprovalStatus.setTaskKey(taskKey);
+            // 新增审批关系表
+            iBpmApprovalStatusService.insertBpmApprovalStatus(bpmApprovalStatus);
+        }
         //---根据流程key得到当前流程的所有节点信息
         List<BpmProcessConfiguration> bpmProcessConfigurationList =
                 bpmProcessConfigurationMapper.selectBpmProcessConfigurationList(
@@ -121,7 +141,7 @@ public class PreExecutionToolClass<R> {
         /**2️⃣2️⃣2️⃣ 新增执行流程表数据*/
         BpmExecuteProcess runBpmExecuteProcess = new BpmExecuteProcess();
         // 当前流程启动的唯一标识
-        runBpmExecuteProcess.setTaskKey(IdUtils.fastSimpleUUID());
+        runBpmExecuteProcess.setTaskKey(taskKey);
         // 投产数据条的唯一标识
         runBpmExecuteProcess.setTaskPlanKey(intoProduction.getGuid().split("=")[1]);
         // 当前流程任务名称
@@ -198,8 +218,6 @@ public class PreExecutionToolClass<R> {
                     }
                 }
             });
-            System.err.println("🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀");
-            System.err.println(script0.toString().toString());
             // 手动异常触发脚本
             bpmExecuteNodeMiddle.setTaskArtificialScriptKey(script0.toString().replaceAll("\\[", "").replaceAll("\\]", ""));
             // 正常节点自动触发脚本
@@ -209,8 +227,17 @@ public class PreExecutionToolClass<R> {
             // 追加节点中间表list
             runBpmExecuteNodeMiddleList.add(bpmExecuteNodeMiddle);
         });
-
-        runBpmExecuteNodeMiddleMapper.insertBpmExecuteNodeMiddleList(runBpmExecuteNodeMiddleList);
+        List<BpmExecuteNodeMiddle> endrunBpmExecuteNodeMiddleList = new ArrayList<>();
+        runBpmExecuteNodeMiddleList.forEach(item -> {
+            String taskArtificialScriptKey = "";
+            String asd[] = item.getTaskArtificialScriptKey().split(",");
+            for (String s : asd) {
+                taskArtificialScriptKey += s.trim() + ",";
+            }
+            item.setTaskArtificialScriptKey(taskArtificialScriptKey.substring(0, taskArtificialScriptKey.lastIndexOf(",")));
+            endrunBpmExecuteNodeMiddleList.add(item);
+        });
+        runBpmExecuteNodeMiddleMapper.insertBpmExecuteNodeMiddleList(endrunBpmExecuteNodeMiddleList);
         //**3️⃣⚡️5️⃣ 流程任务当中的所有节点关联的表单信息 得到当前流程的所有节点以及当前节点脚本绑定的异常脚本-》处理当前节点脚本、异常脚本绑定的表单到中间表信息 */
         List<BpmExecuteNodeForm> bpmExecuteNodeFormList = new ArrayList<>();
         // 当前流程的正常节点、异常节点(理论上无论什么节点都会绑定一个表单)
@@ -271,6 +298,8 @@ public class PreExecutionToolClass<R> {
                 iBpmExecuteNodeLogService.insertBpmExecuteNodeLog(bpmExecuteNodeLog);
             }
         });
+        // 0L:表示工业类型 1L表示审批类型
+        if (bpmProcess.getProcessType() == 1L) return AjaxResult.success();
         if (optionalStartNode.isPresent()) {
             // optionalStartNode.get().getNodeKey();  当前流程开始节点key
             Optional<BpmUserScriptVo> optionalBpmUserScriptVo = bpmUserScriptVoList.stream().filter(item -> item.getNodeKey().equals(optionalStartNode.get().getNodeKey())).findFirst();
@@ -306,12 +335,9 @@ public class PreExecutionToolClass<R> {
         String taskNodeKey = bpmRunNodeVo.getTaskNodeKey(); // 任务节点编码
         // 得到当前节点的所有信息-》用于执行节点前后绑定的自动运行的脚本
         BpmExecuteNode currentBpmExecuteNode = runBpmExecuteNodeMapper.queryBpmExecuteNodeBytaskNodeKey(taskProcessKey, taskNodeKey);
-
-
         // ⚠️⚠️⚠️ 新增节点执行记录
         BpmExecuteNodeLog bpmExecuteNodeLog = new BpmExecuteNodeLog(currentBpmExecuteNode);
         iBpmExecuteNodeLogService.insertBpmExecuteNodeLog(bpmExecuteNodeLog);
-
         // 在执行节时得到除当前节点绑定的正常脚本外,有可能会绑定自动执行的脚本(这些自动执行的脚本参数不能确定,无法传递)
         BpmExecuteNodeMiddle bpmExecuteNodeMiddle = runBpmExecuteNodeMiddleMapper.queryBpmExecuteNodeMiddleByTaskNodeKey(taskProcessKey, taskNodeKey);
         String script[] = bpmExecuteNodeMiddle.getTaskNodeAroundScriptKey().split(",");  // 得到当前节点需要自动执行的脚本
@@ -377,8 +403,8 @@ public class PreExecutionToolClass<R> {
         //---3️⃣⚡️5️⃣ 添加节点执行记录  -》当前执行的节点详细信息
         // ⚠️⚠️⚠️ 当前节点执行完成新增日志数据,
         // 理论讲当前节点一旦点击运行操作就要新增日志,最后修改日志的状态
-//        BpmExecuteNodeLog bpmExecuteNodeLog1 = new BpmExecuteNodeLog(currentBpmExecuteNode);
-//        iBpmExecuteNodeLogService.insertBpmExecuteNodeLog(bpmExecuteNodeLog1);
+        // BpmExecuteNodeLog bpmExecuteNodeLog1 = new BpmExecuteNodeLog(currentBpmExecuteNode);
+        // iBpmExecuteNodeLogService.insertBpmExecuteNodeLog(bpmExecuteNodeLog1);
         // 4️⃣4️⃣4️⃣ 校验当前节点是否为结束节点
         System.err.println("--- 4️⃣4️⃣4️⃣ 校验当前节点是否为结束节点");
         if (bpmExecuteNode.getTaskNodeType().equals("endEvent")) {
@@ -417,12 +443,16 @@ public class PreExecutionToolClass<R> {
             BpmRunNodeVo bpmRunNodeVo1 = new BpmRunNodeVo();
             bpmRunNodeVo1.setTaskNodeKey(bpmExecuteNode.getTaskNodeKey());
             bpmRunNodeVo1.setTaskProcessKey(bpmExecuteNode.getTaskProcessKey());
+            bpmRunNodeVo1.setTaskProcessXmlContent(bpmRunNodeVo.getTaskProcessXmlContent());
             // 当前节点的下一个节点的编码
             bpmRunNodeVo1.setNextNodeKey(XmlDataParserUtils.getNextNodeKey(bpmRunNodeVo.getTaskProcessXmlContent(), bpmRunNodeVo.getNextNodeKey()));
             // 当前节点执行的脚本
             BpmExecuteNodeMiddle nextBpmExecuteNodeMiddle = runBpmExecuteNodeMiddleMapper.queryBpmExecuteNodeMiddleByTaskNodeKey(bpmRunNodeVo.getTaskProcessKey(), bpmRunNodeVo.getNextNodeKey());
-            bpmRunNodeVo1.setImplementationName(nextBpmExecuteNodeMiddle.getTaskArtificialScriptKey());
+            // 节点如果是自动的执行方式,那么节点类型一定是正常的(或者单独的节点类型等)
+            bpmRunNodeVo1.setTaskNodeType("userTask");
+            bpmRunNodeVo1.setImplementationName(nextBpmExecuteNodeMiddle.getTaskAutomaticScriptTriggerType());
             BpmExecuteProcess bpmExecuteProcess = new BpmExecuteProcess();
+            // bug位置,流程节点执行key
             bpmExecuteProcess.setTaskKey(bpmRunNodeVo.getTaskProcessKey());
             bpmExecuteProcess.setTaskNodeKey(bpmRunNodeVo.getTaskNodeKey());
             bpmExecuteProcess.setTaskNodeNextKey(bpmRunNodeVo.getNextNodeKey());
@@ -475,6 +505,122 @@ public class PreExecutionToolClass<R> {
     }
 
 
+    /**
+     * 共通执行节点表单模版接口
+     */
+    public List<Map> getProcessNodeFormTemplate(BpmRunNodeFromVo bpmRunNodeFromVo) {
+        //任务流程key
+        String taskProcessKey = bpmRunNodeFromVo.getTaskProcessKey();
+        //任务节点key
+        String taskNodeKey = bpmRunNodeFromVo.getTaskNodeKey();
+        //脚本名称
+        // String taskScriptKey = bpmRunNodeFromVo.getTaskScriptKey();
+        //根据流程key和节点key查询节点表单关系表【bpm_execute_node_form】
+        BpmExecuteNodeForm bpmExecuteNodeForm = iBpmExecuteNodeFormService.getBpmExecuteNodeForm(taskProcessKey, taskNodeKey, null);
+        //存放返回结果
+        List<Map> mapList = new ArrayList<>();
+        //节点对应的表单信息不能为空
+        if (bpmExecuteNodeForm != null) {
+            String taskNodeFormContent = bpmExecuteNodeForm.getTaskNodeFormContent();
+
+            //拿到当前节点对应的表单类型
+            String taskNodeFormType = bpmExecuteNodeForm.getTaskNodeFormType();
+            if (taskNodeFormType.equals("dragForm")) {
+                HashMap hashMap = new HashMap();
+                //解析存进去的表单信息【task_node_from_content】
+                JSONObject taskNodeFromContentJson = JSONObject.parseObject(taskNodeFormContent);
+                //得到sqlKey
+                String sqlKey = taskNodeFromContentJson.get("sqlKey").toString();
+                //根据sqlKey查询表单数据
+                if (!sqlKey.isEmpty()) {
+                    Map<String, String> tableSqlBySqlKey = executeNodeFormMapper.getTableSqlBySqlKey(sqlKey);
+                    hashMap.put("resultMap", tableSqlBySqlKey);
+                }
+                //得到【df_form_sql】
+                String dfFormSql = taskNodeFromContentJson.get("dfFormSql").toString();
+                ObjectMapper objectMapper = new ObjectMapper();
+                Map<String, Object> sqlMap = null;
+                try {
+                    sqlMap = objectMapper.readValue(dfFormSql, Map.class);
+                    //循环得到每一个sql语句返回结果
+                    for (Map.Entry<String, Object> entry : sqlMap.entrySet()) {
+                        List<Map<String, Object>> resultMap = executeNodeFormMapper.executeSql(entry.getValue().toString());
+                        sqlMap.put(entry.getKey(), resultMap);
+                    }
+                    //把原来的sql语句替换成下拉框数据
+                    taskNodeFromContentJson.put("dfFormSql", JSONObject.toJSONString(sqlMap));
+                } catch (JsonProcessingException e) {
+                    e.printStackTrace();
+                }
+                //表单结构信息
+                hashMap.put("template", taskNodeFromContentJson);
+                //添加到返回集合中
+                mapList.add(hashMap);
+            } else if (taskNodeFormType.equals("dragFormGroup")) { // 当前节点绑定的是表单组类型
+                HashMap hashMap = new HashMap();
+                //解析存进去的表单信息【task_node_from_content】
+                JSONObject taskNodeFromContentJson = JSONObject.parseObject(taskNodeFormContent);
+                //得到sqlKey
+                String sqlKey = taskNodeFromContentJson.get("sqlKey").toString();
+                //根据sqlKey查询表单数据
+                if (!sqlKey.isEmpty()) {
+                    Map<String, String> tableSqlBySqlKey = executeNodeFormMapper.getTableSqlBySqlKey(sqlKey);
+                    hashMap.put("resultMap", tableSqlBySqlKey);
+                }
+                //得到【df_form_sql】
+                String dfFormSql = taskNodeFromContentJson.get("dfFormSql").toString();
+                ObjectMapper objectMapper = new ObjectMapper();
+                Map<String, Object> sqlMap = null;
+                try {
+                    sqlMap = objectMapper.readValue(dfFormSql, Map.class);
+                    //循环得到每一个sql语句返回结果
+                    for (Map.Entry<String, Object> entry : sqlMap.entrySet()) {
+                        List<Map<String, Object>> resultMap = executeNodeFormMapper.executeSql(entry.getValue().toString());
+                        sqlMap.put(entry.getKey(), resultMap);
+                    }
+                    //把原来的sql语句替换成下拉框数据
+                    taskNodeFromContentJson.put("dfFormSql", JSONObject.toJSONString(sqlMap));
+                } catch (JsonProcessingException e) {
+                    e.printStackTrace();
+                }
+                //表单结构信息
+                hashMap.put("template", taskNodeFromContentJson);
+                //添加到返回集合中
+                mapList.add(hashMap);
+            } else if (taskNodeFormType.equals("composeForm")) {
+                //参数为一个数组
+                JSONArray objects = JSON.parseArray(taskNodeFormContent);
+
+                //循环数组元素
+                objects.forEach(item -> {
+                    String s = item.toString();
+                    JSONObject jsonObject = JSONObject.parseObject(s);
+                    String tableSql = jsonObject.get("tableSql").toString();
+                    String conditionArrayJson = jsonObject.get("condition").toString();
+                    JSONArray jsonArray = JSON.parseArray(conditionArrayJson);
+
+                    jsonArray.forEach(conditionItem -> {
+                        //处理下这个条件 去掉 #{ 去掉.
+                        String conditionString = conditionItem.toString().replace("#{", "").replace(".", "_");
+                        //转驼峰
+                        String CamelConditionString = StringUtils.toCamelCase(conditionString);
+                        //
+                    });
+
+                    Map<String, String> stringHashMap = executeNodeFormMapper.tableSql(tableSql);
+                    jsonObject.put("tableList", stringHashMap);
+                    mapList.add(jsonObject);
+                });
+            } else if (taskNodeFormContent.equals("designForm")) {
+                HashMap hashMap = new HashMap();
+                hashMap.put("resultMap", "");
+                hashMap.put("template", "");
+                mapList.add(hashMap);
+            }
+        }
+        return mapList;
+    }
+
     /**
      * 查询节点对应的表单信息
      *
@@ -488,6 +634,12 @@ public class PreExecutionToolClass<R> {
             if (nodeForm.get(item).equals("dragForm")) {  // 拖拽类型的表单
                 String fromInfo = iBpmExecuteProcessService.getFromInfo(item);
                 resultMap.put(item, fromInfo);
+            } else if (nodeForm.get(item).equals("dragFormGroup")) { // 拖拽的表单组
+
+                String groupTableInfo = iBpmExecuteProcessService.getGroupTableInfo(item);
+
+
+                resultMap.put(item, groupTableInfo);
             } else if (nodeForm.get(item).equals("composeForm")) { // 组合类型的表单
                 String groupTableInfo = iBpmExecuteProcessService.getGroupTableInfo(item);
                 resultMap.put(item, groupTableInfo);
@@ -505,25 +657,15 @@ public class PreExecutionToolClass<R> {
      * @return
      */
     public AjaxResult backProcessNode(BpmBackNodeVo bpmBackNodeVo) {
-        /**
-         *当前流程的任务编码
-         * 发起操作的节点编码
-         * 需要回退到的节点编码
-         *
-         *
-         * 发起的操作节点的表单还是操作的当前节点的表单
-         * 也就是说相当于把当前节点执行后在更改当前任务流程的执行节点
-         *
-         * 被回退的节点
-         */
-        // 得到当前流程的详细信息
         BpmExecuteProcess bpmExecuteProcess = runBpmExecuteProcessMapper.selectBpmExecuteProcessByTaskKey(bpmBackNodeVo.getTaskProcessKey());
         bpmExecuteProcess.getTaskProcessXmlContent(); // 当前流程xml内容
         Map<String, Object> bpmInfoOrder = XmlDataParserUtils.getAllNodeKey(bpmExecuteProcess.getTaskProcessXmlContent());
         // 修改流程-> 流程执行的xml文件
-        bpmExecuteProcess.setTaskNodeNextKey(bpmBackNodeVo.getTaskBackNodeKey());
         bpmExecuteProcess.setTaskProcessXmlContent(XmlDataParserUtils.clearExceptionTask(bpmExecuteProcess.getTaskProcessXmlContent(), bpmBackNodeVo.getTaskBackNodeKey()));
+        // 如果触发回退操作的节点是一个异常节点(需要更改当前流程绑定的执行节点)
+        bpmExecuteProcess.setTaskNodeNextKey(bpmBackNodeVo.getTaskBackNodeKey());
         runBpmExecuteProcessMapper.updateBpmExecuteProcess(bpmExecuteProcess);
+        // 得到当前流程的详细信息
         Map<String, Object> nodeMap = (Map<String, Object>) bpmInfoOrder.get("nodeMap");
         List<String> nodeList = (List<String>) bpmInfoOrder.get("nodeList");
         int index = (int) nodeMap.get(bpmBackNodeVo.getTaskBackNodeKey()); // 得到被回退的节点下标
@@ -550,94 +692,99 @@ public class PreExecutionToolClass<R> {
         return AjaxResult.success();
     }
 
+    /**
+     * 执行审批流程节点
+     *
+     * @param bpmRunNodeVo 当前节点信息
+     * @return
+     */
+    public AjaxResult approvalNode(BpmRunNodeVo bpmRunNodeVo) {
+
+        /**
+         * 不能确定某张表可以发起流程,也就是发起审批的这个条数据需要回传后台标识
+         *
+         * 表名以及当前数据条的主键,
+         */
+
+
+        /**
+         * 1️⃣1️⃣1️⃣  准备执行节点所需数据
+         * * 审批节点不过是通过、未通过、驳回等状态信息
+         * * 审批备注与通过、不通过等状态是同一列数据,
+         * * 如果轮回审批,那么备注字段也会是同列,之前审批的状态以及审批备注,需要从日志表中获取
+         * * 把当前流程节点的完整执行记录到日志表中,审批流程的执行只修改状态
+         */
+        String taskProcessKey = bpmRunNodeVo.getTaskProcessKey(); // 任务流程编码
+        String taskNodeKey = bpmRunNodeVo.getTaskNodeKey(); // 任务节点编码
+        String taskNextNodeKey = XmlDataParserUtils.getNextNodeKey(bpmRunNodeVo.getTaskProcessXmlContent(), taskNodeKey);
+        // 获取当前节点的下个节点类型
+        String taskNextNodeType = XmlDataParserUtils.getNodeType(bpmRunNodeVo.getTaskProcessXmlContent(), taskNextNodeKey);
+
+
+        // 得到当前执行的流程信息
+        BpmExecuteProcess currentBpmExecuteProcess = runBpmExecuteProcessMapper.selectBpmExecuteProcessByTaskKey(taskProcessKey);
+        // 得到当前节点的所有信息-》审批类型节点会出现节点后给某张表插入数据
+        BpmExecuteNode currentBpmExecuteNode = runBpmExecuteNodeMapper.queryBpmExecuteNodeBytaskNodeKey(taskProcessKey, taskNodeKey);
+        // 审批备注
+        String approvalRemark = bpmRunNodeVo.getApprovalRemark();
+        // 审批状态 pass:通过、noPass:不通过、reject:驳回
+        String approvalStatus = bpmRunNodeVo.getApprovalStatus();
+        // 当前执行的节点全部信息
+        currentBpmExecuteNode.setTaskNodeOtherState(approvalStatus);
+        currentBpmExecuteNode.setTaskRemark(approvalRemark);
+
+        // 当前执行的流程
+        currentBpmExecuteProcess.setTaskNodeKey(taskNodeKey);
+        currentBpmExecuteProcess.setTaskNodeNextKey(taskNextNodeKey);
+
+        // 2️⃣2️⃣2️⃣  开始执行当前节点
+        // 补充流程节点信息(如若驳回操作,会显示上次审批记录)
+        runBpmExecuteNodeMapper.updateBpmExecuteNode(currentBpmExecuteNode);
+        // --- 修改当前流程执行节点
+        runBpmExecuteProcessMapper.updateProcessNode(currentBpmExecuteProcess);
+        // --- 修改当前审批的数据条状态
 
-    public CommonEntity getProcessNodeFormTemplate(BpmRunNodeFromVo bpmRunNodeFromVo) {
-        CommonEntity commonEntity = new CommonEntity();
-        return commonEntity;
-    }
 
+        // 3️⃣3️⃣3️⃣  判断当前节点是否存在给其他表插入数据
+        // currentBpmExecuteNode.getTask
+
+        // ⚠️⚠️⚠️ 新增节点执行记录
+        BpmExecuteNodeLog bpmExecuteNodeLog = new BpmExecuteNodeLog(currentBpmExecuteNode);
+        iBpmExecuteNodeLogService.insertBpmExecuteNodeLog(bpmExecuteNodeLog);
+
+        // 4️⃣4️⃣4️⃣  判断是否结束审批流程
+        if (taskNextNodeType.equals("endEvent")) {
+            // 当前节点是改流程的最后一个节点,默认执行结束节点
+            // 结束节点也是只修改状态
+            // runBpmExecuteProcessMapper.updateProcessNode();
+
+            // 审批流程结束,修改当前审批关联数据条的关联数据条的状态(bpm_approval_status)
+            // 审批状态 (0:已提交、1:已通过、2:不通过、4:驳回、5:审批中)
+            // iBpmApprovalStatusService.updateBpmApprovalStatus();
+//            iBpmApprovalStatusService.updateBpmApprovalStatus();
+        }
+
+        /**
+         * €23092802001001001820€0990€23-0€0001€BTS高弹单丝轻网€100D/36f€001特黑€AA
+         */
+
+
+        /* 审批的发起操作,相当于这个流程的开始
+           那么用户首次调用当前接口,都会就是一级审批
+           需要当前操作的状态以及审批过后的备注信息 两列数据。
+           修改节点状态,添加审批的数据,修改流程执行节点的key。
+           如何当前节点有节点后需要插入的其他表数据则执行。
+
+           理论上来讲每一个节点的表单都是一样的,都是审批数据条是否通过,以及审批意见
+           如果需要审批的数据条是多表中的数据,也看作为一条数据来处理。
+
+           流程发起时的表单数据开始存在用户的表中,所以同生产流程逻辑一样。
+           在发起这个流程的时候记录当前的数据条的表名以及表主键
+
+        */
+
+
+        return AjaxResult.success();
+    }
 
-//    /**
-//     * 共通执行节点表单模版接口
-//     */
-//    public List<Map> getProcessNodeFormTemplate(BpmRunNodePlusVo bpmRunNodeV) {
-//        //任务流程key
-//        String taskProcessKey = bpmRunNodeV.getTaskProcessKey();
-//        //任务节点key
-//        String taskNodeKey = bpmRunNodeV.getTaskNodeKey();
-//        //脚本名称
-//        String taskScriptKey = bpmRunNodeV.getTaskScriptKey();
-//        //根据流程key和节点key查询节点表单关系表【bpm_execute_node_form】
-//        BpmExecuteNodeForm bpmExecuteNodeForm = iBpmExecuteNodeFormService.getBpmExecuteNodeForm(taskProcessKey, taskNodeKey, taskScriptKey);
-//        //存放返回结果
-//        List<Map> mapList = new ArrayList<>();
-//        //节点对应的表单信息不能为空
-//        if (bpmExecuteNodeForm != null) {
-//            String taskNodeFormContent = bpmExecuteNodeForm.getTaskNodeFromContent();
-//            //拿到当前节点对应的表单类型
-//            String taskNodeFormType = bpmExecuteNodeForm.getTaskNodeFromType();
-//            if (taskNodeFormType.equals("dragForm")) {
-//                HashMap hashMap = new HashMap();
-//                //解析存进去的表单信息【task_node_from_content】
-//                JSONObject taskNodeFromContentJson = JSONObject.parseObject(taskNodeFormContent);
-//                //得到sqlKey
-//                String sqlKey = taskNodeFromContentJson.get("sqlKey").toString();
-//                //根据sqlKey查询表单数据
-//                if (!sqlKey.isEmpty()) {
-//                    Map<String, String> tableSqlBySqlKey = executeNodeFormMapper.getTableSqlBySqlKey(sqlKey);
-//                    hashMap.put("resultMap", tableSqlBySqlKey);
-//                }
-//                //得到【df_form_sql】
-//                String dfFormSql = taskNodeFromContentJson.get("dfFormSql").toString();
-//                ObjectMapper objectMapper = new ObjectMapper();
-//                Map<String, Object> sqlMap = null;
-//                try {
-//                    sqlMap = objectMapper.readValue(dfFormSql, Map.class);
-//                    //循环得到每一个sql语句返回结果
-//                    for (Map.Entry<String, Object> entry : sqlMap.entrySet()) {
-//                        List<Map<String, Object>> resultMap = executeNodeFormMapper.executeSql(entry.getValue().toString());
-//                        sqlMap.put(entry.getKey(), resultMap);
-//                    }
-//                    //把原来的sql语句替换成下拉框数据
-//                    taskNodeFromContentJson.put("dfFormSql", JSONObject.toJSONString(sqlMap));
-//                } catch (JsonProcessingException e) {
-//                    e.printStackTrace();
-//                }
-//                //表单结构信息
-//                hashMap.put("template", taskNodeFromContentJson);
-//                //添加到返回集合中
-//                mapList.add(hashMap);
-//            } else if (taskNodeFormType.equals("composeForm")) {
-//                //参数为一个数组
-//                JSONArray objects = JSON.parseArray(taskNodeFormContent);
-//
-//                //循环数组元素
-//                objects.forEach(item -> {
-//                    String s = item.toString();
-//                    JSONObject jsonObject = JSONObject.parseObject(s);
-//                    String tableSql = jsonObject.get("tableSql").toString();
-//                    String conditionArrayJson = jsonObject.get("condition").toString();
-//                    JSONArray jsonArray = JSON.parseArray(conditionArrayJson);
-//
-//                    jsonArray.forEach(conditionItem -> {
-//                        //处理下这个条件 去掉 #{ 去掉.
-//                        String conditionString = conditionItem.toString().replace("#{", "").replace(".", "_");
-//                        //转驼峰
-//                        String CamelConditionString = CamelCaseConverterUtil.toCamelCase(conditionString);
-//                        //
-//                    });
-//
-//                    Map<String, String> stringHashMap = executeNodeFormMapper.tableSql(tableSql);
-//                    jsonObject.put("tableList", stringHashMap);
-//                    mapList.add(jsonObject);
-//                });
-//            } else if (taskNodeFormContent.equals("designForm")) {
-//                HashMap hashMap = new HashMap();
-//                hashMap.put("resultMap", "");
-//                hashMap.put("template", "");
-//                mapList.add(hashMap);
-//            }
-//        }
-//        return mapList;
-//    }
-}
+}

+ 62 - 0
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/IBpmApprovalStatusService.java

@@ -0,0 +1,62 @@
+package com.zkqy.execution.produce.dispersed.service;
+
+import com.zkqy.execution.produce.dispersed.entity.BpmApprovalStatus;
+
+import java.util.List;
+
+/**
+ * 审批数据条中间Service接口
+ * 
+ * @author hzh
+ * @date 2024-01-31
+ */
+public interface IBpmApprovalStatusService 
+{
+    /**
+     * 查询审批数据条中间
+     * 
+     * @param id 审批数据条中间主键
+     * @return 审批数据条中间
+     */
+    public BpmApprovalStatus selectBpmApprovalStatusById(Long id);
+
+    /**
+     * 查询审批数据条中间列表
+     * 
+     * @param bpmApprovalStatus 审批数据条中间
+     * @return 审批数据条中间集合
+     */
+    public List<BpmApprovalStatus> selectBpmApprovalStatusList(BpmApprovalStatus bpmApprovalStatus);
+
+    /**
+     * 新增审批数据条中间
+     * 
+     * @param bpmApprovalStatus 审批数据条中间
+     * @return 结果
+     */
+    public int insertBpmApprovalStatus(BpmApprovalStatus bpmApprovalStatus);
+
+    /**
+     * 修改审批数据条中间
+     * 
+     * @param bpmApprovalStatus 审批数据条中间
+     * @return 结果
+     */
+    public int updateBpmApprovalStatus(BpmApprovalStatus bpmApprovalStatus);
+
+    /**
+     * 批量删除审批数据条中间
+     * 
+     * @param ids 需要删除的审批数据条中间主键集合
+     * @return 结果
+     */
+    public int deleteBpmApprovalStatusByIds(Long[] ids);
+
+    /**
+     * 删除审批数据条中间信息
+     * 
+     * @param id 审批数据条中间主键
+     * @return 结果
+     */
+    public int deleteBpmApprovalStatusById(Long id);
+}

+ 1 - 1
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/ICommonService.java

@@ -78,7 +78,7 @@ public interface ICommonService {
      * @param tableSql
      * @return
      */
-    List<CommonEntity> queryGroupTableList(CommonEntity commonEntity, TableSql tableSql);
+    List<CommonEntity> queryGroupTableList(CommonEntity commonEntity, TableSql tableSql,String tableFormat);
 
 
 

+ 94 - 0
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/impl/BpmApprovalStatusServiceImpl.java

@@ -0,0 +1,94 @@
+package com.zkqy.execution.produce.dispersed.service.impl;
+
+import java.util.List;
+
+import com.zkqy.execution.produce.dispersed.entity.BpmApprovalStatus;
+import com.zkqy.execution.produce.dispersed.mapper.BpmApprovalStatusMapper;
+import com.zkqy.execution.produce.dispersed.service.IBpmApprovalStatusService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * 审批数据条中间Service业务层处理
+ * 
+ * @author hzh
+ * @date 2024-01-31
+ */
+@Service
+public class BpmApprovalStatusServiceImpl implements IBpmApprovalStatusService
+{
+    @Autowired
+    private BpmApprovalStatusMapper bpmApprovalStatusMapper;
+
+    /**
+     * 查询审批数据条中间
+     * 
+     * @param id 审批数据条中间主键
+     * @return 审批数据条中间
+     */
+    @Override
+    public BpmApprovalStatus selectBpmApprovalStatusById(Long id)
+    {
+        return bpmApprovalStatusMapper.selectBpmApprovalStatusById(id);
+    }
+
+    /**
+     * 查询审批数据条中间列表
+     * 
+     * @param bpmApprovalStatus 审批数据条中间
+     * @return 审批数据条中间
+     */
+    @Override
+    public List<BpmApprovalStatus> selectBpmApprovalStatusList(BpmApprovalStatus bpmApprovalStatus)
+    {
+        return bpmApprovalStatusMapper.selectBpmApprovalStatusList(bpmApprovalStatus);
+    }
+
+    /**
+     * 新增审批数据条中间
+     * 
+     * @param bpmApprovalStatus 审批数据条中间
+     * @return 结果
+     */
+    @Override
+    public int insertBpmApprovalStatus(BpmApprovalStatus bpmApprovalStatus)
+    {
+        return bpmApprovalStatusMapper.insertBpmApprovalStatus(bpmApprovalStatus);
+    }
+
+    /**
+     * 修改审批数据条中间
+     * 
+     * @param bpmApprovalStatus 审批数据条中间
+     * @return 结果
+     */
+    @Override
+    public int updateBpmApprovalStatus(BpmApprovalStatus bpmApprovalStatus)
+    {
+        return bpmApprovalStatusMapper.updateBpmApprovalStatus(bpmApprovalStatus);
+    }
+
+    /**
+     * 批量删除审批数据条中间
+     * 
+     * @param ids 需要删除的审批数据条中间主键
+     * @return 结果
+     */
+    @Override
+    public int deleteBpmApprovalStatusByIds(Long[] ids)
+    {
+        return bpmApprovalStatusMapper.deleteBpmApprovalStatusByIds(ids);
+    }
+
+    /**
+     * 删除审批数据条中间信息
+     * 
+     * @param id 审批数据条中间主键
+     * @return 结果
+     */
+    @Override
+    public int deleteBpmApprovalStatusById(Long id)
+    {
+        return bpmApprovalStatusMapper.deleteBpmApprovalStatusById(id);
+    }
+}

+ 22 - 5
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/impl/BpmExecuteNodeMiddleServiceImpl.java

@@ -1,11 +1,12 @@
 package com.zkqy.execution.produce.dispersed.service.impl;
 
 
-
 import com.zkqy.common.utils.StringUtils;
+import com.zkqy.execution.produce.dispersed.entity.BpmExecuteNodeForm;
 import com.zkqy.execution.produce.dispersed.entity.BpmExecuteNodeMiddle;
 import com.zkqy.execution.produce.dispersed.entity.CommonEntity;
 import com.zkqy.execution.produce.dispersed.entity.runbpm.SysBpmNodeScriptVO;
+import com.zkqy.execution.produce.dispersed.mapper.BpmExecuteNodeFormMapper;
 import com.zkqy.execution.produce.dispersed.mapper.BpmExecuteNodeMiddleMapper;
 import com.zkqy.execution.produce.dispersed.service.IBpmExecuteNodeMiddleService;
 import com.zkqy.execution.produce.utils.Sending;
@@ -31,6 +32,9 @@ public class BpmExecuteNodeMiddleServiceImpl implements IBpmExecuteNodeMiddleSer
     private BpmExecuteNodeMiddleMapper bpmExecuteNodeMiddleMapper;
 
 
+    @Autowired
+    private BpmExecuteNodeFormMapper bpmExecuteNodeFormMapper;
+
     @Autowired
     private Sending sending;
 
@@ -107,10 +111,15 @@ public class BpmExecuteNodeMiddleServiceImpl implements IBpmExecuteNodeMiddleSer
     public List<CommonEntity> addExceptionScript(List<CommonEntity> commonEntityList) throws Exception {
         //循环得到所有异常脚本key
         Set<String> scriptKeys = new LinkedHashSet<>();
+        List<BpmExecuteNodeForm> bpmExecuteNodeFormList = new ArrayList<>();
         commonEntityList.forEach(m -> {
-            scriptKeys.addAll(Arrays.asList(m.getResultMap().get("benmTaskArtificialScriptKey").toString().split(",")));
+            List<String> keys = Arrays.asList(m.getResultMap().get("benmTaskArtificialScriptKey").toString().split(","));
+            scriptKeys.addAll(keys);
+            if (keys.size() > 0) {
+                bpmExecuteNodeFormList.addAll(bpmExecuteNodeFormMapper.selectByTaskScriptKeys(m.getResultMap().get("bepTaskKey").toString(), keys));
+            }
         });
-        if(scriptKeys.size() == 0){
+        if (scriptKeys.size() == 0) {
             return commonEntityList;
         }
         //根据异常脚本key得到所有异常脚本信息
@@ -122,6 +131,8 @@ public class BpmExecuteNodeMiddleServiceImpl implements IBpmExecuteNodeMiddleSer
         //}
         //Set集合转换成List集合
         List<String> scriptKeysCollect = scriptKeys.stream().collect(Collectors.toList());
+
+
         List<SysBpmNodeScript> sysBpmNodeScripts = sending.sendGetScriptInfo(scriptKeysCollect);
         //if (responseEntity.getStatusCode().is2xxSuccessful()) {
         if (StringUtils.isNotEmpty(sysBpmNodeScripts)) {
@@ -134,9 +145,15 @@ public class BpmExecuteNodeMiddleServiceImpl implements IBpmExecuteNodeMiddleSer
                 //sysBpmNodeScriptVOList.forEach(s -> {
                 sysBpmNodeScripts.forEach(item -> {
                     //SysBpmNodeScriptVO sysBpmNodeScriptVO= JSONObject.parseObject(JSON.toJSONString(s),SysBpmNodeScriptVO.class);
-                    SysBpmNodeScriptVO sysBpmNodeScriptVO=new SysBpmNodeScriptVO();
-                    BeanUtils.copyProperties(item,sysBpmNodeScriptVO);
+                    SysBpmNodeScriptVO sysBpmNodeScriptVO = new SysBpmNodeScriptVO();
+                    BeanUtils.copyProperties(item, sysBpmNodeScriptVO);
                     if (scriptKeyList.contains(sysBpmNodeScriptVO.getScriptKey())) {
+
+                        String name = bpmExecuteNodeFormList.stream().filter(bpm -> bpm.getTaskProcessKey().equals(m.getResultMap().get("bepTaskKey")) && bpm.getTaskScriptKey().equals(sysBpmNodeScriptVO.getScriptKey())).findFirst().get().getTaskNodeName();
+
+                        sysBpmNodeScriptVO.setScriptName(name);
+
+
                         exceptionScriptList.add(sysBpmNodeScriptVO);
                     }
                 });

+ 37 - 21
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/impl/BpmExecuteNodeServiceImpl.java

@@ -5,16 +5,10 @@ import com.zkqy.common.constant.BpmNodeTypeConstants;
 import com.zkqy.common.utils.DateUtils;
 import com.zkqy.common.utils.bpm.XmlDataParserUtils;
 import com.zkqy.common.utils.uuid.IdUtils;
-import com.zkqy.execution.produce.dispersed.entity.BpmExecuteNode;
-import com.zkqy.execution.produce.dispersed.entity.BpmExecuteNodeForm;
-import com.zkqy.execution.produce.dispersed.entity.BpmExecuteNodeMiddle;
-import com.zkqy.execution.produce.dispersed.entity.BpmExecuteProcess;
+import com.zkqy.execution.produce.dispersed.entity.*;
 import com.zkqy.execution.produce.dispersed.entity.runbpm.SysBpmNodeScriptVO;
 import com.zkqy.execution.produce.dispersed.entity.runbpm.TriggerExceptionVO;
-import com.zkqy.execution.produce.dispersed.mapper.BpmExecuteNodeFormMapper;
-import com.zkqy.execution.produce.dispersed.mapper.BpmExecuteNodeMapper;
-import com.zkqy.execution.produce.dispersed.mapper.BpmExecuteNodeMiddleMapper;
-import com.zkqy.execution.produce.dispersed.mapper.BpmExecuteProcessMapper;
+import com.zkqy.execution.produce.dispersed.mapper.*;
 import com.zkqy.execution.produce.dispersed.service.IBpmExecuteNodeService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -37,6 +31,9 @@ public class BpmExecuteNodeServiceImpl implements IBpmExecuteNodeService {
     @Autowired
     private BpmExecuteNodeMapper bpmExecuteNodeMapper;
 
+    @Autowired
+    private BpmExecuteNodeLogMapper bpmExecuteNodeLogMapper;
+
     @Resource
     private BpmExecuteProcessMapper bpmExecuteProcessMapper;
 
@@ -125,30 +122,50 @@ public class BpmExecuteNodeServiceImpl implements IBpmExecuteNodeService {
         String newUserTaskTagId = "Activity_" + IdUtils.fastUUID();
         //select bpm_execute_process
         BpmExecuteProcess bpmExecuteProcess = bpmExecuteProcessMapper.selectBpmExecuteProcessByTaskKey(vo.getTaskProcessKey());
-        //sys_bpm_node_script info
+
+        //得到当前节点信息
+        BpmExecuteNode bpmExecuteNode = bpmExecuteNodeMapper.queryBpmExecuteNodeBytaskNodeKey(vo.getTaskProcessKey(), vo.getTaskNodeKey());
+
+
+        //sys_bpm_node_script 得到异常脚本info
         SysBpmNodeScriptVO sysBpmNodeScriptVO = vo.getSysBpmNodeScriptVO();
 
-        //select bpm_execute_node_form
+        //select bpm_execute_node_form  查询节点表单(插入的异常节点所需的表单)
         BpmExecuteNodeForm bpmExecuteNodeForm = new BpmExecuteNodeForm();
         bpmExecuteNodeForm.setTaskProcessKey(vo.getTaskProcessKey());
-        bpmExecuteNodeForm.setTaskNodeKey(vo.getTaskNodeKey());
+        String afterAnalysis;
+        //修改当前执行流程xml内容,在当前节点前增加异常节点,调整xml线指向
+        if (vo.getTaskNodeType().equals("exceptionTask")) {  // 异常节点抛出异常节点,在当前异常节点后插入新的异常节点
+            afterAnalysis = XmlDataParserUtils.addUserTaskTag(bpmExecuteProcess.getTaskProcessXmlContent(), newUserTaskTagId, sysBpmNodeScriptVO.getScriptName(), vo.getTaskNextNodeKey());
+
+            bpmExecuteNodeForm.setTaskNodeKey(vo.getTaskNextNodeKey());  // 追溯到正常节点抛出异常的节点key
+            // ?是否需要记录节点日志——》如不做记录管道展示不会展示没有执行过的异常!
+            if (true) {
+                // 新增节点日志记录
+                bpmExecuteNodeLogMapper.insertBpmExecuteNodeLog(new BpmExecuteNodeLog(bpmExecuteNode));
+            }
+
+        } else {
+            afterAnalysis = XmlDataParserUtils.addUserTaskTag(bpmExecuteProcess.getTaskProcessXmlContent(), newUserTaskTagId, sysBpmNodeScriptVO.getScriptName(), vo.getTaskNodeKey());
+            bpmExecuteNodeForm.setTaskNodeKey(vo.getTaskNodeKey());
+        }
         bpmExecuteNodeForm.setTaskScriptKey(vo.getSysBpmNodeScriptVO().getScriptKey());
         BpmExecuteNodeForm bpmExecuteNodeForm1 = bpmExecuteNodeFormMapper.selectBpmExecuteNodeFormInfo(bpmExecuteNodeForm);
-        //insert bpm_execute_node_form
+        //insert bpm_execute_node_form  节点运行表单
         bpmExecuteNodeForm1.setTaskNodeKey(newUserTaskTagId);
         bpmExecuteNodeFormMapper.insertBpmExecuteNodeForm(bpmExecuteNodeForm1);
-
-        //修改当前执行流程xml内容,当前节点下一节点信息
-        String afterAnalysis = XmlDataParserUtils.addUserTaskTag(bpmExecuteProcess.getTaskProcessXmlContent(), newUserTaskTagId, sysBpmNodeScriptVO.getScriptName(), vo.getTaskNodeKey());
         bpmExecuteProcess.setTaskProcessXmlContent(afterAnalysis);
-        bpmExecuteProcess.setTaskNodeKey(newUserTaskTagId);
-        bpmExecuteProcess.setTaskNodeNextKey(bpmExecuteProcess.getTaskNodeKey());
+
+//        bpmExecuteProcess.setTaskNodeKey(newUserTaskTagId);
+//        bpmExecuteProcess.setTaskNodeNextKey(bpmExecuteProcess.getTaskNodeKey());
+        bpmExecuteProcess.setTaskNodeNextKey(newUserTaskTagId);
+
         bpmExecuteProcessMapper.updateBpmExecuteProcess(bpmExecuteProcess);
+
         //生成虚拟角色编码
         String taskNodeRolePermission = IdUtils.fastSimpleUUID();
 
-        //得到当前节点信息,添加异常节点信息
-        BpmExecuteNode bpmExecuteNode = bpmExecuteNodeMapper.queryBpmExecuteNodeBytaskNodeKey(vo.getTaskProcessKey(), vo.getTaskNodeKey());
+        //添加异常节点信息
         bpmExecuteNode.setId(null);
         bpmExecuteNode.setTaskNodeKey(newUserTaskTagId);
         bpmExecuteNode.setTaskNodeName(bpmExecuteNodeForm1.getTaskNodeName());
@@ -164,7 +181,6 @@ public class BpmExecuteNodeServiceImpl implements IBpmExecuteNodeService {
         bpmExecuteNode.setTaskNodeRolePermission(taskNodeRolePermission);
         bpmExecuteNodeMapper.insertBpmExecuteNode(bpmExecuteNode);
 
-
         //得到当前节点用户关联表信息,添加异常节点用户关联表信息
         BpmExecuteNodeMiddle bpmExecuteNodeMiddle = bpmExecuteNodeMiddleMapper.queryBpmExecuteNodeMiddleByTaskNodeKey(vo.getTaskProcessKey(), vo.getTaskNodeKey());
         List<String> list = Arrays.asList(bpmExecuteNodeMiddle.getTaskArtificialScriptKey().split(","));
@@ -172,7 +188,7 @@ public class BpmExecuteNodeServiceImpl implements IBpmExecuteNodeService {
         bpmExecuteNodeMiddle.setTaskNodeKey(newUserTaskTagId);
         bpmExecuteNodeMiddle.setTaskAutomaticScriptTriggerType(sysBpmNodeScriptVO.getScriptKey());
         bpmExecuteNodeMiddle.setTaskVirtuallyRole(taskNodeRolePermission);
-        bpmExecuteNodeMiddle.setTaskArtificialScriptKey(String.join(",",list.stream().filter(f -> !f.equals(vo.getSysBpmNodeScriptVO().getScriptKey())).collect(Collectors.toList())));
+        bpmExecuteNodeMiddle.setTaskArtificialScriptKey(String.join(",", list.stream().filter(f -> !f.equals(vo.getSysBpmNodeScriptVO().getScriptKey())).collect(Collectors.toList())));
         return bpmExecuteNodeMiddleMapper.insertBpmExecuteNodeMiddle(bpmExecuteNodeMiddle);
     }
 }

+ 51 - 42
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/impl/BpmExecuteProcessServiceImpl.java

@@ -77,21 +77,21 @@ public class BpmExecuteProcessServiceImpl implements IBpmExecuteProcessService {
         //params.put("isEnablePaging", "false");  // 不弃启用分页
         //params.put("dictType", "plan_execution_data"); // 排需要的必要参数
         //ResponseEntity tenantDict = sending.sendGetTenantDict(params);
-        SysDictData dictData=new SysDictData();
+        SysDictData dictData = new SysDictData();
         dictData.setDictType("plan_execution_data");
         List<SysDictData> dictDataList = sending.sendGetTenantDict(dictData);
         //if (tenantDict.getStatusCodeValue() == 200) {
-        if(StringUtils.isNotEmpty(dictDataList)){
+        if (StringUtils.isNotEmpty(dictDataList)) {
             Map<String, Object> objectMap = new HashMap<>();  // 查询执行管道的参数
             objectMap.putAll(convertEntityToMap(bpmExecuteProcess));
+            dictDataList.forEach(item -> {
+                objectMap.put(item.getDictLabel(), item.getDictValue());
+            });
             if (bpmExecuteProcess.getTaskProcessState() == 3L) {
                 // 首先根据当前登陆用户得到他可以执行的所有节点
-                List<CommonEntity> commonEntities = runBpmExecuteProcessMapper.queryExecuteProcess(objectMap);
+                List<CommonEntity> commonEntities = runBpmExecuteProcessMapper.queryExecuteProcessEnd(objectMap);
                 return commonEntities;
             } else {
-                dictDataList.forEach(item -> {
-                    objectMap.put(item.getDictLabel(), item.getDictValue());
-                });
                 List<SysRole> sysRoles = SecurityUtils.getLoginUser().getUser().getRoles();
                 List<String> roles = new ArrayList<>();
                 if (sysRoles.size() != 0) {
@@ -107,11 +107,12 @@ public class BpmExecuteProcessServiceImpl implements IBpmExecuteProcessService {
                 List<CommonEntity> commonEntities1 = bpmExecuteNodeMiddleService.addExceptionScript(commonEntities);
                 commonEntities.forEach(item -> {
                     String keyName = item.getResultMap().get("benTaskNodeKey").toString();
+                    String taskKey = item.getResultMap().get("bepTaskKey").toString();
                     item.getResultMap().putAll(
                             commonEntities1.stream()
                                     .filter(ctem ->
-                                            ctem.getResultMap().get("benTaskNodeKey")
-                                                    .equals(keyName))
+                                            ctem.getResultMap().get("benTaskNodeKey").equals(keyName)
+                                                    && ctem.getResultMap().get("bepTaskKey").equals(taskKey))
                                     .findFirst()
                                     .get()
                                     .getResultMap()
@@ -125,41 +126,50 @@ public class BpmExecuteProcessServiceImpl implements IBpmExecuteProcessService {
 
     @Override
     public List<CommonEntity> selectBpmExecuteProcessListLog(BpmExecuteProcess bpmExecuteProcess) {
-        Map<String, Object> objectMap = new HashMap<>();
-        List<SysRole> sysRoles = SecurityUtils.getLoginUser().getUser().getRoles();
-        List<String> roles = new ArrayList<>();
-        if (sysRoles.size() != 0) {
-            roles.addAll(sysRoles.stream().map(SysRole::getRoleKey).collect(Collectors.toList()));
-        }
-        // 根据当前的用户id得到可以执行的流程节点
-        objectMap.put("userId", SecurityUtils.getUserId());
-        // 得到当前发起请求的用户角色列表
-        objectMap.put("taskRealRoleList", roles);
-        objectMap.putAll(convertEntityToMap(bpmExecuteProcess));
-        List<CommonEntity> commonEntityList = runBpmExecuteProcessMapper.selectBpmExecuteProcessListLog(objectMap); // 得到当前用户可以查看的流程
-        // 根据用户可以查看的流程任务编码,查询当前流程的详细信息
-        String[] taksKey = new String[commonEntityList.size()];
-        final int[] index = {0};
-        commonEntityList.forEach(item -> {
-            taksKey[index[0]] = item.getResultMap().get("taskKey").toString();
-            index[0]++;
-        });
-        if (taksKey.length <= 0){
+        SysDictData dictData = new SysDictData();
+        dictData.setDictType("plan_execution_data");
+        List<SysDictData> dictDataList = sending.sendGetTenantDict(dictData);
+        if (StringUtils.isNotEmpty(dictDataList)) {
+            Map<String, Object> objectMap = new HashMap<>();
+            dictDataList.forEach(item -> {
+                objectMap.put(item.getDictLabel(), item.getDictValue());
+            });
+            List<SysRole> sysRoles = SecurityUtils.getLoginUser().getUser().getRoles();
+            List<String> roles = new ArrayList<>();
+            if (sysRoles.size() != 0) {
+                roles.addAll(sysRoles.stream().map(SysRole::getRoleKey).collect(Collectors.toList()));
+            }
+            // 根据当前的用户id得到可以执行的流程节点
+            objectMap.put("userId", SecurityUtils.getUserId());
+            // 得到当前发起请求的用户角色列表
+            objectMap.put("taskRealRoleList", roles);
+            objectMap.putAll(convertEntityToMap(bpmExecuteProcess));
+            List<CommonEntity> commonEntityList = runBpmExecuteProcessMapper.selectBpmExecuteProcessListLog(objectMap); // 得到当前用户可以查看的流程
+            // 根据用户可以查看的流程任务编码,查询当前流程的详细信息
+            String[] taksKey = new String[commonEntityList.size()];
+            final int[] index = {0};
+            commonEntityList.forEach(item -> {
+                taksKey[index[0]] = item.getResultMap().get("taskKey").toString();
+                index[0]++;
+            });
+            if (taksKey.length <= 0) {
+                return commonEntityList;
+            }
+            objectMap.put("taskProcessList", taksKey);
+            // 当前用户可以看到流程的所有节点信息
+            List<BpmExecuteNodeLog> bpmExecuteNodeLogList = iBpmExecuteNodeLogService.selectBpmExecuteProcessNodeListLog(objectMap);
+            // 循环添加流程的详细信息
+            commonEntityList.forEach(item -> {
+                // 根据流程key筛选得到当前流程的所有执行过的节点信息
+                item.getResultMap().put("nodeLogList",
+                        bpmExecuteNodeLogList
+                                .stream()
+                                .filter(e -> e.getTaskProcessKey().equals(item.getResultMap().get("taskKey").toString()))
+                                .collect(Collectors.toList()));
+            });
             return commonEntityList;
         }
-        objectMap.put("taskProcessList", taksKey);
-        // 当前用户可以看到流程的所有节点信息
-        List<BpmExecuteNodeLog> bpmExecuteNodeLogList = iBpmExecuteNodeLogService.selectBpmExecuteProcessNodeListLog(objectMap);
-        // 循环添加流程的详细信息
-        commonEntityList.forEach(item -> {
-            // 根据流程key筛选得到当前流程的所有执行过的节点信息
-            item.getResultMap().put("nodeLogList",
-                    bpmExecuteNodeLogList
-                            .stream()
-                            .filter(e -> e.getTaskProcessKey().equals(item.getResultMap().get("taskKey").toString()))
-                            .collect(Collectors.toList()));
-        });
-        return commonEntityList;
+        return null;
     }
 
     /**
@@ -325,6 +335,5 @@ public class BpmExecuteProcessServiceImpl implements IBpmExecuteProcessService {
 
 
 
-
 
 

+ 53 - 20
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/impl/CommonServiceImpl.java

@@ -8,6 +8,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
 
 import com.zkqy.common.utils.DateUtils;
 import com.zkqy.common.utils.SecurityUtils;
+import com.zkqy.common.utils.StringUtils;
 import com.zkqy.execution.produce.dispersed.entity.CommonEntity;
 import com.zkqy.execution.produce.dispersed.entity.TableSql;
 import com.zkqy.execution.produce.dispersed.mapper.CommonMapper;
@@ -21,6 +22,9 @@ import org.springframework.stereotype.Service;
 import javax.annotation.Resource;
 import javax.servlet.ServletOutputStream;
 import javax.servlet.http.HttpServletResponse;
+import java.text.SimpleDateFormat;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
 import java.util.*;
 import java.util.concurrent.atomic.AtomicReference;
 
@@ -36,6 +40,7 @@ public class CommonServiceImpl implements ICommonService {
     @Resource
     private TableSqlMapper tableSqlMapper;
 
+
     @Override
     public List<CommonEntity> selectList(CommonEntity commonEntity) {
         String tableName = (String) commonEntity.getBasicMap().get("tableName");
@@ -51,7 +56,10 @@ public class CommonServiceImpl implements ICommonService {
             item.put("create_time", DateUtils.getTime());
             item.put("create_by", SecurityUtils.getUsername());
             item.put("create_by_id", SecurityUtils.getUserId().toString());
-            item.put("del_flag", "0");
+            if (item.get("delFlag") == null && item.get("del_flag") == null) {
+                item.put("del_flag", "0");
+            }
+//            list.stream().filter(del -> del.get("del_flag") != null && del.get("del_flag").equals("0")).findFirst().get().remove("del_flag");
         });
         List<Map<String, Object>> mapList = new ArrayList<>();
         for (Object obj : list) {
@@ -128,7 +136,7 @@ public class CommonServiceImpl implements ICommonService {
             } catch (JsonProcessingException e) {
                 throw new RuntimeException(e);
             }
-        //mapList = commonEntity.getExeclMap();
+            //mapList = commonEntity.getExeclMap();
         } else {
             List<Map<String, Object>> maps = new ArrayList<>();
             List<CommonEntity> commonEntities = queryTableList(commonEntity, tableSql);
@@ -223,12 +231,12 @@ public class CommonServiceImpl implements ICommonService {
     }
 
     @Override
-    public CommonEntity getInfoById(CommonEntity commonEntity) {
+    public CommonEntity  getInfoById(CommonEntity commonEntity) {
         String tableName = (String) commonEntity.getBasicMap().get("tableName");
         Map<String, Object> conditions = JSONObject.parseObject(JSON.toJSONString(commonEntity.getConditionMap()));
         CommonEntity common = new CommonEntity();
         CommonEntity commonEntity1 = commonMapper.getInfoById(tableName, conditions);
-        if(commonEntity1 == null){
+        if (commonEntity1 == null) {
             return common;
         }
         Map<String, Object> retMap = commonEntity1.getResultMap();
@@ -241,31 +249,31 @@ public class CommonServiceImpl implements ICommonService {
     }
 
     @Override
-    public List<CommonEntity> queryGroupTableList(CommonEntity commonEntity, TableSql tableSql) {
+    public List<CommonEntity> queryGroupTableList(CommonEntity commonEntity, TableSql tableSql, String tableFormat) {
         //前端传递过来的参数
         Map<String, Object> queryMap = commonEntity.getQueryMap();
         //是否存在
-        AtomicReference<Boolean> isExist= new AtomicReference<>(true);
+        AtomicReference<Boolean> isExist = new AtomicReference<>(true);
         //循环前端传过来的参数 跳过 sqlkey
-        AtomicReference<String> replaceSql= new AtomicReference<>(tableSql.getTableCondition());
-        queryMap.forEach((k,v)->{
-            if(!k.equals("sqlkey")&&!k.equals("queryCriteriaValue")){ //查询第一个表的数据是不会进行任何替换的
+        AtomicReference<String> replaceSql = new AtomicReference<>(tableSql.getTableCondition());
+        queryMap.forEach((k, v) -> {
+            if (!k.equals("sqlkey") && !k.equals("queryCriteriaValue")) { //查询第一个表的数据是不会进行任何替换的
                 int isExistIndex = tableSql.getTableCondition().indexOf(k);
                 replaceSql.set(tableSql.getTableCondition().replace(k, v.toString()));
-                if(isExistIndex<0){
+                if (isExistIndex < 0) {
                     isExist.set(false);
                 }
             }
         });
         //证明条件不对应不能让他进行查询
-        if(!isExist.get()){
+        if (!isExist.get()) {
             List<CommonEntity> commonEntityList = new ArrayList<>();
             CommonEntity common = new CommonEntity();
-            HashMap<String, Object> hashMap=new HashMap();
-            hashMap.put("err","查询条件不匹配查询失败");
+            HashMap<String, Object> hashMap = new HashMap();
+            hashMap.put("err", "查询条件不匹配查询失败");
             common.setResultMap(hashMap);
             commonEntityList.add(common);
-            return  commonEntityList;
+            return commonEntityList;
         }
         Map<String, Object> conditions = JSONObject.parseObject(JSON.toJSONString(commonEntity.getQueryMap()));
         //正常的查询
@@ -274,20 +282,45 @@ public class CommonServiceImpl implements ICommonService {
                         ? conditions.get("queryCriteriaValue").toString() : "";
         String endSQL = replaceSql.get().replace("#{val}", queryCriteriaValue);
         String sqlString = tableSql.getTableSql() + " where " + endSQL;
-        return commonMapper.queryTableList(sqlString);
+        List<CommonEntity> commonEntities = commonMapper.queryTableList(sqlString);
+        //根据sqlKey查询表格数据
+        commonEntities.forEach(item -> {
+            Map<String, Object> resultMap = item.getResultMap();
+            resultMap.forEach((k, v) -> {
+                if (StringUtils.isNotNull(v) && !v.toString().isEmpty()) {
+                    //正则匹配成功
+                    boolean validDateTimeFormat = isValidDateTimeFormat(v.toString());
+                    if (validDateTimeFormat) {
+                        if (v.toString().indexOf("T") > 0) {
+                            DateTimeFormatter formatter = DateTimeFormatter.ISO_LOCAL_DATE_TIME; // 默认支持这种格式
+                            LocalDateTime dateTime = LocalDateTime.parse(v.toString(), formatter);
+                            DateTimeFormatter fmt = DateTimeFormatter.ofPattern(tableFormat);
+                            String dateStr = dateTime.format(fmt);
+                            resultMap.put(k, dateStr);
+                        } else {
+                            LocalDateTime localDateTime = DateUtils.toLocalDateTime(v.toString(), "yyyy-MM-dd HH:mm:ss");
+                            DateTimeFormatter fmt = DateTimeFormatter.ofPattern(tableFormat);
+                            String dateStr = localDateTime.format(fmt);
+                            resultMap.put(k, dateStr);
+                        }
+                    }
+                }
+            });
+        });
+        return commonEntities;
     }
 
     @Override
     public CommonEntity queryDropDownBoxData(List<CommonEntity> commonEntityList) {
-        Map<String,Object> retMap = new HashMap<>();
-        for (CommonEntity commonEntity : commonEntityList){
+        Map<String, Object> retMap = new HashMap<>();
+        for (CommonEntity commonEntity : commonEntityList) {
             String tableName = (String) commonEntity.getBasicMap().get("tableName");
             Map<String, Object> conditions = JSONObject.parseObject(JSON.toJSONString(commonEntity.getConditionMap()));
             List<Long> list = new ArrayList<>();
             list.add(0L);
-            conditions.put("del_flag",list);
-            List<Map<String,Object>> mapList = commonMapper.queryDropDownBoxData(tableName,conditions);
-            retMap.put(tableName,mapList);
+            conditions.put("del_flag", list);
+            List<Map<String, Object>> mapList = commonMapper.queryDropDownBoxData(tableName, conditions);
+            retMap.put(tableName, mapList);
         }
         CommonEntity commonEntity = new CommonEntity();
         commonEntity.setResultMap(retMap);

+ 4 - 2
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/impl/runbpm/hangye1/yichang/yichang1.java

@@ -1,7 +1,6 @@
 package com.zkqy.execution.produce.dispersed.service.impl.runbpm.hangye1.yichang;
 
 
-
 import com.zkqy.common.core.domain.AjaxResult;
 import com.zkqy.execution.produce.dispersed.entity.BpmExecuteNode;
 import com.zkqy.execution.produce.dispersed.entity.CommonEntity;
@@ -57,7 +56,10 @@ public class yichang1 implements IRunBPMService {
         BpmBackNodeVo bpmBackNodeVo = new BpmBackNodeVo(
                 iRunBPMEntity.getExecutionMap().get("taskProcessKey").toString(),
                 iRunBPMEntity.getExecutionMap().get("taskNodeKey").toString(),
-                iRunBPMEntity.getExecutionMap().get("taskBackNodeKey").toString());
+                iRunBPMEntity.getExecutionMap().get("taskBackNodeKey").toString()
+//                ,
+//                iRunBPMEntity.getExecutionMap().get("taskNodeType").toString()
+        );
         preExecutionToolClass.backProcessNode(bpmBackNodeVo);
         return AjaxResult.success();
     }

+ 50 - 0
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/impl/runbpm/mes/CommonAutoExecute.java

@@ -0,0 +1,50 @@
+package com.zkqy.execution.produce.dispersed.service.impl.runbpm.mes;
+
+import com.zkqy.common.core.domain.AjaxResult;
+import com.zkqy.execution.produce.dispersed.entity.CommonEntity;
+import com.zkqy.execution.produce.dispersed.entity.runbpm.BpmRunNodeFromVo;
+import com.zkqy.execution.produce.dispersed.entity.runbpm.IRunBPMEntity;
+import com.zkqy.execution.produce.dispersed.service.IRunBPMService;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.PreDestroy;
+
+/**
+ * 共通自动执行-正常节点
+ */
+@Service("850da57a-0037-4f16-9887-1985656278e5")
+@Scope("prototype")
+public class CommonAutoExecute implements IRunBPMService {
+
+    @Override
+    public CommonEntity getNodeFormData(BpmRunNodeFromVo bpmRunNodeFromVo) {
+        return new CommonEntity();
+    }
+
+    @Override
+    public AjaxResult preValidation(IRunBPMEntity iRunBPMEntity) {
+        return AjaxResult.success();
+    }
+
+    @Override
+    public AjaxResult executeNode(IRunBPMEntity iRunBPMEntity) {
+        return AjaxResult.success();
+    }
+
+    @Override
+    public AjaxResult afterValidation(IRunBPMEntity iRunBPMEntity) {
+        return AjaxResult.success();
+    }
+
+    @Override
+    public boolean isVerificationMethod() {
+        return true;
+    }
+
+    @Override
+    @PreDestroy
+    public boolean preDestroy() {
+        return true;
+    }
+}

+ 61 - 0
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/impl/runbpm/mes/ExceptionEditTheFinishTimeAgain.java

@@ -0,0 +1,61 @@
+package com.zkqy.execution.produce.dispersed.service.impl.runbpm.mes;
+
+import com.zkqy.common.core.domain.AjaxResult;
+import com.zkqy.execution.produce.dispersed.entity.CommonEntity;
+import com.zkqy.execution.produce.dispersed.entity.runbpm.BpmRunNodeFormFilterConditionsVo;
+import com.zkqy.execution.produce.dispersed.entity.runbpm.BpmRunNodeFromVo;
+import com.zkqy.execution.produce.dispersed.entity.runbpm.IRunBPMEntity;
+import com.zkqy.execution.produce.dispersed.service.IRunBPMService;
+import com.zkqy.execution.produce.utils.EchoNodeFormData;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.PreDestroy;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 重新编辑完成时间-异常节点:有问题
+ */
+@Service("1af24b89-ce2f-4d1e-9b82-5158ebd708d0")
+@Scope("prototype")
+public class ExceptionEditTheFinishTimeAgain implements IRunBPMService {
+
+    @Autowired
+    private EchoNodeFormData echoNodeFormData;
+
+    @Override
+    public CommonEntity getNodeFormData(BpmRunNodeFromVo bpmRunNodeFromVo) {
+        Map<String, Object> map = new HashMap<>();
+        map.put("id",Long.valueOf(bpmRunNodeFromVo.getTaskPlanKey()));
+        bpmRunNodeFromVo.getFormDataVoList().add(new BpmRunNodeFormFilterConditionsVo("master_task", map, false,false));
+        return echoNodeFormData.getEchoNodeFormData(bpmRunNodeFromVo);
+    }
+
+    @Override
+    public AjaxResult preValidation(IRunBPMEntity iRunBPMEntity) {
+        return AjaxResult.success();
+    }
+
+    @Override
+    public AjaxResult executeNode(IRunBPMEntity iRunBPMEntity) {
+        return AjaxResult.success();
+    }
+
+    @Override
+    public AjaxResult afterValidation(IRunBPMEntity iRunBPMEntity) {
+        return AjaxResult.success();
+    }
+
+    @Override
+    public boolean isVerificationMethod() {
+        return true;
+    }
+
+    @Override
+    @PreDestroy
+    public boolean preDestroy() {
+        return true;
+    }
+}

+ 66 - 0
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/impl/runbpm/mes/ExceptionProductObsolescence.java

@@ -0,0 +1,66 @@
+package com.zkqy.execution.produce.dispersed.service.impl.runbpm.mes;
+
+import com.zkqy.common.core.domain.AjaxResult;
+import com.zkqy.execution.produce.dispersed.entity.CommonEntity;
+import com.zkqy.execution.produce.dispersed.entity.runbpm.BpmRunNodeFormFilterConditionsVo;
+import com.zkqy.execution.produce.dispersed.entity.runbpm.BpmRunNodeFromVo;
+import com.zkqy.execution.produce.dispersed.entity.runbpm.IRunBPMEntity;
+import com.zkqy.execution.produce.dispersed.mapper.BpmExecuteProcessMapper;
+import com.zkqy.execution.produce.dispersed.service.IRunBPMService;
+import com.zkqy.execution.produce.utils.EchoNodeFormData;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.PreDestroy;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 产品报废-异常节点
+ */
+@Service("f4c35300-1627-47e5-b809-ed22a0c6a0bd")
+@Scope("prototype")
+public class ExceptionProductObsolescence implements IRunBPMService {
+
+    @Autowired
+    private EchoNodeFormData echoNodeFormData;
+
+    @Autowired // 执行流程
+    private BpmExecuteProcessMapper runBpmExecuteProcessMapper;
+
+    @Override
+    public CommonEntity getNodeFormData(BpmRunNodeFromVo bpmRunNodeFromVo) {
+        Map<String,Object> map1 = new HashMap<>();
+        bpmRunNodeFromVo.getFormDataVoList().add(new BpmRunNodeFormFilterConditionsVo("product_obsolescence", map1, true));
+        return echoNodeFormData.getEchoNodeFormData(bpmRunNodeFromVo);
+    }
+
+    @Override
+    public AjaxResult preValidation(IRunBPMEntity iRunBPMEntity) {
+        return AjaxResult.success();
+    }
+
+    @Override
+    public AjaxResult executeNode(IRunBPMEntity iRunBPMEntity) {
+        // 更改任务流程状态
+        runBpmExecuteProcessMapper.endProcess(iRunBPMEntity.getExecutionFlowKey());
+        return AjaxResult.success();
+    }
+
+    @Override
+    public AjaxResult afterValidation(IRunBPMEntity iRunBPMEntity) {
+        return AjaxResult.success();
+    }
+
+    @Override
+    public boolean isVerificationMethod() {
+        return true;
+    }
+
+    @Override
+    @PreDestroy
+    public boolean preDestroy() {
+        return true;
+    }
+}

+ 63 - 0
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/impl/runbpm/mes/ExceptionQualityControlCardEdit.java

@@ -0,0 +1,63 @@
+package com.zkqy.execution.produce.dispersed.service.impl.runbpm.mes;
+
+import com.zkqy.common.core.domain.AjaxResult;
+import com.zkqy.execution.produce.dispersed.entity.CommonEntity;
+import com.zkqy.execution.produce.dispersed.entity.runbpm.BpmRunNodeFormFilterConditionsVo;
+import com.zkqy.execution.produce.dispersed.entity.runbpm.BpmRunNodeFromVo;
+import com.zkqy.execution.produce.dispersed.entity.runbpm.IRunBPMEntity;
+import com.zkqy.execution.produce.dispersed.service.IRunBPMService;
+import com.zkqy.execution.produce.utils.EchoNodeFormData;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.PreDestroy;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 质控卡修改-异常节点
+ */
+
+@Service("f1aeb03c-9dd5-4a7c-820d-aaac458cda19")
+@Scope("prototype")
+public class ExceptionQualityControlCardEdit implements IRunBPMService {
+
+    @Autowired
+    private EchoNodeFormData echoNodeFormData;
+
+    @Override
+    public CommonEntity getNodeFormData(BpmRunNodeFromVo bpmRunNodeFromVo) {
+        //质控卡
+        Map<String,Object> map = new HashMap<>();
+        map.put("task_process_key",bpmRunNodeFromVo.getTaskProcessKey());
+        bpmRunNodeFromVo.getFormDataVoList().add(new BpmRunNodeFormFilterConditionsVo("record_quality_control_card", map, false,false));
+        return echoNodeFormData.getEchoNodeFormData(bpmRunNodeFromVo);
+    }
+
+    @Override
+    public AjaxResult preValidation(IRunBPMEntity iRunBPMEntity) {
+        return AjaxResult.success();
+    }
+
+    @Override
+    public AjaxResult executeNode(IRunBPMEntity iRunBPMEntity) {
+        return AjaxResult.success();
+    }
+
+    @Override
+    public AjaxResult afterValidation(IRunBPMEntity iRunBPMEntity) {
+        return AjaxResult.success();
+    }
+
+    @Override
+    public boolean isVerificationMethod() {
+        return true;
+    }
+
+    @Override
+    @PreDestroy
+    public boolean preDestroy() {
+        return true;
+    }
+}

+ 69 - 0
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/impl/runbpm/mes/ExceptionQualityControlCardSubCard.java

@@ -0,0 +1,69 @@
+package com.zkqy.execution.produce.dispersed.service.impl.runbpm.mes;
+
+import com.zkqy.common.core.domain.AjaxResult;
+import com.zkqy.execution.produce.dispersed.entity.CommonEntity;
+import com.zkqy.execution.produce.dispersed.entity.runbpm.BpmRunNodeFormFilterConditionsVo;
+import com.zkqy.execution.produce.dispersed.entity.runbpm.BpmRunNodeFromVo;
+import com.zkqy.execution.produce.dispersed.entity.runbpm.IRunBPMEntity;
+import com.zkqy.execution.produce.dispersed.service.IRunBPMService;
+import com.zkqy.execution.produce.utils.EchoNodeFormData;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.PreDestroy;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 质控卡分卡-异常节点
+ */
+@Service("baf71011-9517-4ddc-994e-d1a9add9a7d5")
+@Scope("prototype")
+public class ExceptionQualityControlCardSubCard implements IRunBPMService {
+
+    @Autowired
+    private EchoNodeFormData echoNodeFormData;
+
+    @Override
+    public CommonEntity getNodeFormData(BpmRunNodeFromVo bpmRunNodeFromVo) {
+        //数量
+        Map<String,Object> map2 = new HashMap<>();
+        map2.put("id",bpmRunNodeFromVo.getTaskPlanKey());
+        bpmRunNodeFromVo.getFormDataVoList().add(new BpmRunNodeFormFilterConditionsVo("master_task", map2, false));
+        //质控卡
+        Map<String,Object> map = new HashMap<>();
+        map.put("task_process_key",bpmRunNodeFromVo.getTaskProcessKey());
+        bpmRunNodeFromVo.getFormDataVoList().add(new BpmRunNodeFormFilterConditionsVo("record_quality_control_card", map, false));
+        //质控卡分卡
+        Map<String,Object> map1 = new HashMap<>();
+        bpmRunNodeFromVo.getFormDataVoList().add(new BpmRunNodeFormFilterConditionsVo("quality_control_card_sub_card", map1, true));
+        return echoNodeFormData.getEchoNodeFormData(bpmRunNodeFromVo);
+    }
+
+    @Override
+    public AjaxResult preValidation(IRunBPMEntity iRunBPMEntity) {
+        return AjaxResult.success();
+    }
+
+    @Override
+    public AjaxResult executeNode(IRunBPMEntity iRunBPMEntity) {
+        return AjaxResult.success();
+    }
+
+    @Override
+    public AjaxResult afterValidation(IRunBPMEntity iRunBPMEntity) {
+        return AjaxResult.success();
+    }
+
+    @Override
+    public boolean isVerificationMethod() {
+        return true;
+    }
+
+    @Override
+    @PreDestroy
+    public boolean preDestroy() {
+        return true;
+    }
+}

+ 68 - 0
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/impl/runbpm/mes/ExceptionRecordQualityControlCard.java

@@ -0,0 +1,68 @@
+package com.zkqy.execution.produce.dispersed.service.impl.runbpm.mes;
+
+import com.zkqy.common.core.domain.AjaxResult;
+import com.zkqy.execution.produce.dispersed.entity.CommonEntity;
+import com.zkqy.execution.produce.dispersed.entity.runbpm.BpmRunNodeFormFilterConditionsVo;
+import com.zkqy.execution.produce.dispersed.entity.runbpm.BpmRunNodeFromVo;
+import com.zkqy.execution.produce.dispersed.entity.runbpm.IRunBPMEntity;
+import com.zkqy.execution.produce.dispersed.service.IRunBPMService;
+import com.zkqy.execution.produce.utils.EchoNodeFormData;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.PreDestroy;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 记录质控卡-异常节点
+ */
+@Service("f7c5527a-cbfe-4993-bce7-77d5ae538290")
+@Scope("prototype")
+public class ExceptionRecordQualityControlCard implements IRunBPMService {
+
+    @Autowired
+    private EchoNodeFormData echoNodeFormData;
+
+    @Override
+    public CommonEntity getNodeFormData(BpmRunNodeFromVo bpmRunNodeFromVo) {
+        // 物料需求信息info
+        Map<String,Object> map = new HashMap<>();
+        map.put("id",bpmRunNodeFromVo.getTaskPlanKey());
+        bpmRunNodeFromVo.getFormDataVoList().add(new BpmRunNodeFormFilterConditionsVo("master_task", map, false));
+        //质控卡号
+        Map<String,Object> map1 = new HashMap<>();
+        map1.put("task_process_key",bpmRunNodeFromVo.getTaskProcessKey());
+        map1.put("task_node_key",bpmRunNodeFromVo.getTaskNodeKey());
+        bpmRunNodeFromVo.getFormDataVoList().add(new BpmRunNodeFormFilterConditionsVo("record_quality_control_card", map1, true));
+
+        return echoNodeFormData.getEchoNodeFormData(bpmRunNodeFromVo);
+    }
+
+    @Override
+    public AjaxResult preValidation(IRunBPMEntity iRunBPMEntity) {
+        return AjaxResult.success();
+    }
+
+    @Override
+    public AjaxResult executeNode(IRunBPMEntity iRunBPMEntity) {
+        return AjaxResult.success();
+    }
+
+    @Override
+    public AjaxResult afterValidation(IRunBPMEntity iRunBPMEntity) {
+        return AjaxResult.success();
+    }
+
+    @Override
+    public boolean isVerificationMethod() {
+        return true;
+    }
+
+    @Override
+    @PreDestroy
+    public boolean preDestroy() {
+        return true;
+    }
+}

+ 76 - 0
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/impl/runbpm/mes/ExceptionTaskTermination.java

@@ -0,0 +1,76 @@
+package com.zkqy.execution.produce.dispersed.service.impl.runbpm.mes;
+
+import com.zkqy.common.core.domain.AjaxResult;
+import com.zkqy.execution.produce.dispersed.entity.BpmExecuteNode;
+import com.zkqy.execution.produce.dispersed.entity.CommonEntity;
+import com.zkqy.execution.produce.dispersed.entity.runbpm.BpmRunNodeFormFilterConditionsVo;
+import com.zkqy.execution.produce.dispersed.entity.runbpm.BpmRunNodeFromVo;
+import com.zkqy.execution.produce.dispersed.entity.runbpm.IRunBPMEntity;
+import com.zkqy.execution.produce.dispersed.mapper.BpmExecuteNodeMapper;
+import com.zkqy.execution.produce.dispersed.mapper.BpmExecuteProcessMapper;
+import com.zkqy.execution.produce.dispersed.service.IRunBPMService;
+import com.zkqy.execution.produce.utils.EchoNodeFormData;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.PreDestroy;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 任务结束-异常节点
+ */
+@Service("bd2cc2f3-5dec-4aec-aeea-2c0aee6b3750")
+@Scope("prototype")
+public class ExceptionTaskTermination implements IRunBPMService {
+
+    @Autowired
+    private EchoNodeFormData echoNodeFormData;
+
+    @Autowired // 执行流程
+    private BpmExecuteProcessMapper runBpmExecuteProcessMapper;
+
+//    @Autowired  // 执行流程节点表
+//    private BpmExecuteNodeMapper runBpmExecuteNodeMapper;
+
+    @Override
+    public CommonEntity getNodeFormData(BpmRunNodeFromVo bpmRunNodeFromVo) {
+        Map<String,Object> map1 = new HashMap<>();
+        bpmRunNodeFromVo.getFormDataVoList().add(new BpmRunNodeFormFilterConditionsVo("task_termination", map1, true));
+        return echoNodeFormData.getEchoNodeFormData(bpmRunNodeFromVo);
+    }
+
+    @Override
+    public AjaxResult preValidation(IRunBPMEntity iRunBPMEntity) {
+        return AjaxResult.success();
+    }
+
+    @Override
+    public AjaxResult executeNode(IRunBPMEntity iRunBPMEntity) {
+        // 更改任务流程状态
+        runBpmExecuteProcessMapper.endProcess(iRunBPMEntity.getExecutionFlowKey());
+        // 更改节点任务状态
+//        BpmExecuteNode bpmExecuteNode = new BpmExecuteNode();
+//        bpmExecuteNode.setTaskProcessKey(iRunBPMEntity.getExecutionFlowKey());
+//        bpmExecuteNode.setTaskNodeType(iRunBPMEntity.getExecutionNodeKey());
+//        runBpmExecuteNodeMapper.updateNodeState(bpmExecuteNode);
+        return AjaxResult.success();
+    }
+
+    @Override
+    public AjaxResult afterValidation(IRunBPMEntity iRunBPMEntity) {
+        return AjaxResult.success();
+    }
+
+    @Override
+    public boolean isVerificationMethod() {
+        return true;
+    }
+
+    @Override
+    @PreDestroy
+    public boolean preDestroy() {
+        return true;
+    }
+}

+ 116 - 0
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/impl/runbpm/smt/AntiErrorMaterial.java

@@ -0,0 +1,116 @@
+package com.zkqy.execution.produce.dispersed.service.impl.runbpm.smt;
+
+import cn.hutool.core.io.FileUtil;
+import cn.hutool.extra.qrcode.QrCodeUtil;
+import com.alibaba.fastjson2.JSONObject;
+import com.google.gson.Gson;
+import com.google.gson.reflect.TypeToken;
+import com.zkqy.common.config.ZkqyConfig;
+import com.zkqy.common.constant.Constants;
+import com.zkqy.common.core.domain.AjaxResult;
+import com.zkqy.common.utils.uuid.IdUtils;
+import com.zkqy.execution.produce.dispersed.entity.CommonEntity;
+import com.zkqy.execution.produce.dispersed.entity.runbpm.BpmRunNodeFormFilterConditionsVo;
+import com.zkqy.execution.produce.dispersed.entity.runbpm.BpmRunNodeFromVo;
+import com.zkqy.execution.produce.dispersed.entity.runbpm.IRunBPMEntity;
+import com.zkqy.execution.produce.dispersed.service.ICommonService;
+import com.zkqy.execution.produce.dispersed.service.IRunBPMService;
+import com.zkqy.execution.produce.utils.EchoNodeFormData;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.PreDestroy;
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 防错料-正常节点
+ */
+@Service("12f9e34d-5496-4787-8ae6-1cf59b2d29ae")
+@Scope("prototype")
+public class AntiErrorMaterial implements IRunBPMService {
+
+    @Autowired
+    private EchoNodeFormData echoNodeFormData;
+
+    @Resource
+    private ICommonService commonService;
+
+    //生成二维码
+    @Override
+    public CommonEntity getNodeFormData(BpmRunNodeFromVo bpmRunNodeFromVo) {
+        CommonEntity data = new CommonEntity();
+        List<Object> objectList = new ArrayList<>();
+
+        //查询计划详情,获取物料编号
+        CommonEntity commonEntity = new CommonEntity();
+        commonEntity.getBasicMap().put("tableName","plan_scheduling");
+        commonEntity.getConditionMap().put("p_id",bpmRunNodeFromVo.getTaskPlanKey());
+        CommonEntity planScheduling = commonService.getInfoById(commonEntity);
+        String[] materialIds = planScheduling.getResultMap().get("material_ids").toString().split(",", -1);
+
+
+        //循环生成二维码
+        for (String id : materialIds) {
+            //查询物料详情
+            CommonEntity commonEntity1 = new CommonEntity();
+            commonEntity1.getBasicMap().put("tableName","material");
+            commonEntity1.getConditionMap().put("id",Long.valueOf(id));
+            CommonEntity material = commonService.getInfoById(commonEntity1);
+
+            String partNo = material.getResultMap().get("part_no").toString();
+            String partName = material.getResultMap().get("part_name").toString();
+
+            //二维码内容
+            JSONObject jsonObject = new JSONObject();
+            jsonObject.put("partNo",partNo);
+            jsonObject.put("partName",partName);
+
+            //上传文件路径
+            String uuid = IdUtils.fastUUID();
+            String filePath = ZkqyConfig.getUploadPath()+ "/" + "tdc/" + uuid + ".jpg";
+
+            //生成路径
+            String path = Constants.RESOURCE_PREFIX + "/" + "upload/tdc/";
+            String fileName = path + uuid + ".jpg";
+            QrCodeUtil.generate(jsonObject.toString(), 300, 300, FileUtil.file(filePath));
+            material.getResultMap().put("description",jsonObject.toString());
+            material.getResultMap().put("imageUrl",fileName);
+            objectList.add(material);
+
+        }
+        data.getResultMap().put("data",objectList);
+
+        return data;
+    }
+
+    @Override
+    public AjaxResult preValidation(IRunBPMEntity iRunBPMEntity) {
+        return AjaxResult.success();
+    }
+
+    @Override
+    public AjaxResult executeNode(IRunBPMEntity iRunBPMEntity) {
+        return AjaxResult.success();
+    }
+
+    @Override
+    public AjaxResult afterValidation(IRunBPMEntity iRunBPMEntity) {
+        return AjaxResult.success();
+    }
+
+    @Override
+    public boolean isVerificationMethod() {
+        return true;
+    }
+
+    @Override
+    @PreDestroy
+    public boolean preDestroy() {
+        return true;
+    }
+}

+ 11 - 3
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/utils/EchoNodeFormData.java

@@ -80,15 +80,23 @@ public class EchoNodeFormData {
                     commonEntity.get().getResultMap().put(item.getListKey(), maps);
                 }
             } else {
+                //没有这个设置list
                 CommonEntity common = commonMapper.selectOne(item.getTableName(), item.getCondition());
                 if (common != null) {
+                    //带流程key
                     if(item.isNodeOnlyData()){
                         //节点数据回显逻辑
                         commonEntity.get().getResultMap().putAll(common.getResultMap());
+                    //不带流程key且
                     }else {
-                        //不是节点数据的表名做Key\对象做键
-                        String tableName = StringUtils.toCamelCase(item.getTableName());//转驼峰
-                        commonEntity.get().getResultMap().put(tableName, common.getResultMap());
+                        if(item.getIsTableNameKey()){
+                            //不是节点数据的表名做Key\对象做键
+                            String tableName = StringUtils.toCamelCase(item.getTableName());//转驼峰
+                            commonEntity.get().getResultMap().put(tableName, common.getResultMap());
+                        }else {
+                            //带流程key但是我不想让他以表名作为键
+                            commonEntity.get().getResultMap().putAll(common.getResultMap());
+                        }
                     }
                 }
             }

+ 7 - 0
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/utils/Sending.java

@@ -49,6 +49,9 @@ public class Sending<T> {
     @Resource
     private ISysUserService userService;
 
+//    @Resource
+//    private IDragFormService dragFormService;
+
 
     /**
      * get请求拼接参数使用
@@ -245,6 +248,10 @@ public class Sending<T> {
     //public ResponseEntity sendGetFormInfo(T param) {
     //    return this.sendCommonGetParams(bpmProperties.formGetFormInfoIp,param);
     //}
+//    public DragForm sendGetFormInfo(Long fId){
+//        return dragFormService.selectDragFormByFId(fId);
+//    }
+
 
     /**
      * 根据fid获取表格组详情接口

+ 68 - 146
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/utils/VerifyExecutionProcess.java

@@ -1,5 +1,6 @@
 package com.zkqy.execution.produce.utils;
 
+import com.zkqy.common.core.domain.AjaxResult;
 import com.zkqy.common.utils.StringUtils;
 import com.zkqy.execution.produce.dispersed.entity.BpmNodeHandleUser;
 import com.zkqy.execution.produce.dispersed.entity.BpmNodeScriptRelevance;
@@ -10,6 +11,7 @@ import com.zkqy.execution.produce.dispersed.service.IBpmNodeScriptRelevanceServi
 import com.zkqy.execution.produce.dispersed.service.IBpmProcessConfigurationService;
 import com.zkqy.system.domain.SysBpmNodeScript;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Component;
 
 import java.util.List;
@@ -43,125 +45,72 @@ public class VerifyExecutionProcess {
     private Sending sending;
 
     /*
-      判断开始节点结束节点是否存在、脚本是否存在
-      判断是否有其他节点,有,循环判断每一个节点是否包含自动执行脚本,并且脚本是否存在,
-      节点是否绑定角色权限,真实角色下是否存在可处理用户,虚拟角色下用户是否都真实存在
-      node_form_type类型为拖拽表单类型,查看该表单信息是否存在;为组合表单类型查看该表格组信息是否存在;
-      为自定义表单类型时,判断节点脚本关联表查看script_node_name该字段是否存在及该字段是否有“-”,"-"前是否有内容。
+        流程校验
+        校验开始结束节点是否是自动执行,脚本是否存在,可用
+        校验正常节点前后是否存在自动执行脚本,脚本是否存在,可用
+        校验正常节点是否已经绑定虚拟角色权限,并且判断当前虚拟角色下的真实角色/用户是否存在
+        校验表单类型,判断表单是否存在
+        校验异常节点脚本是否存在并且可用
     */
     public boolean VerifyProcessData(String processKey) {
-        // 根据流程编号(node_process_key)查询流程配置表(bpm_process_configuration)得到该流程所有节点信息
+
+        // 查询当前流程所有节点信息
         BpmProcessConfiguration bpmProcessConfiguration = new BpmProcessConfiguration();
         bpmProcessConfiguration.setNodeProcessKey(processKey);
         List<BpmProcessConfiguration> bpmProcessConfigurationList = bpmProcessConfigurationService.selectBpmProcessConfigurationList(bpmProcessConfiguration);
-        // 定义变量开始节点(startNode),结束节点(endNode)
+
+        // 开始节点数量
         int startNode = 0;
+        // 结束节点数量
         int endNode = 0;
+
         for (BpmProcessConfiguration b : bpmProcessConfigurationList) {
 
+            //开始节点校验逻辑
             if (b.getNodeType().equals("startEvent")) {
                 startNode++;
-                //校验正常节点存不存在
-                BpmNodeScriptRelevance bpmNodeScriptRelevance = new BpmNodeScriptRelevance();
-                bpmNodeScriptRelevance.setNodeKey(b.getNodeKey());
-                bpmNodeScriptRelevance.setScriptTriggerType(1L);
-                BpmNodeScriptRelevance bpmNodeScriptRelevance1 = bpmNodeScriptRelevanceService.selectBpmNodeScriptRelevanceInfo(bpmNodeScriptRelevance);
-                if (bpmNodeScriptRelevance1 != null) {
-                    //ResponseEntity<AjaxResult> responseEntity = sending.sendGetNodeScript(bpmNodeScriptRelevance1.getScriptKey());
-                    SysBpmNodeScript sysBpmNodeScript = sending.sendGetNodeScript(bpmNodeScriptRelevance1.getScriptKey());
-                    // if (responseEntity.getStatusCodeValue() != 200L) {
-                    if (StringUtils.isNull(sysBpmNodeScript)) {
-                        return false;
-                    }
-                    //AjaxResult ajaxResult = responseEntity.getBody();
-                    //if (Long.valueOf(ajaxResult.get("code").toString()) != 200L) {
-                    //    return false;
-                    //}
-                    //if (!ajaxResult.containsKey("data")) {
-                    //    return false;
-                    //}
-                    //Map<String, Object> dataMap = (Map<String, Object>) ajaxResult.get("data");
-                    //if (!runImplementationClass.isVerificationMethod(dataMap.get("scriptKey").toString())) {
-                    if (!runImplementationClass.isVerificationMethod(sysBpmNodeScript.getScriptKey())) {
-                        return false;
-                    }
-                    ;
+                //查询当前节点是否自动执行
+                BpmNodeScriptRelevance bpmNodeScriptRelevance = bpmNodeScriptRelevanceService.selectAutoScriptByNodeKey(b.getNodeKey());
+                if (bpmNodeScriptRelevance != null) {
+                    //校验当前节点绑定的脚本是否存在
+                    SysBpmNodeScript sysBpmNodeScript = sending.sendGetNodeScript(bpmNodeScriptRelevance.getScriptKey());
+                    if (StringUtils.isNull(sysBpmNodeScript)) return false;
+
+                    //校验当前节点绑定脚本是否可用
+                    if (!runImplementationClass.isVerificationMethod(sysBpmNodeScript.getScriptKey())) return false;
                 } else {
                     return false;
                 }
                 continue;
             }
+            //结束节点校验逻辑
             if (b.getNodeType().equals("endEvent")) {
                 endNode++;
-                //校验正常节点存不存在
-                BpmNodeScriptRelevance bpmNodeScriptRelevance = new BpmNodeScriptRelevance();
-                bpmNodeScriptRelevance.setNodeKey(b.getNodeKey());
-                bpmNodeScriptRelevance.setScriptTriggerType(1L);
-                BpmNodeScriptRelevance bpmNodeScriptRelevance1 = bpmNodeScriptRelevanceService.selectBpmNodeScriptRelevanceInfo(bpmNodeScriptRelevance);
-                if (bpmNodeScriptRelevance1 != null) {
-                    //ResponseEntity<AjaxResult> responseEntity = sending.sendGetNodeScript(bpmNodeScriptRelevance1.getScriptKey());
-                    SysBpmNodeScript sysBpmNodeScript = sending.sendGetNodeScript(bpmNodeScriptRelevance1.getScriptKey());
-                    //if (responseEntity.getStatusCodeValue() != 200L) {
-                    if(StringUtils.isNull(sysBpmNodeScript)) {
-                        return false;
-                    }
-                    //AjaxResult ajaxResult = responseEntity.getBody();
-                    //if (Long.valueOf(ajaxResult.get("code").toString()) != 200L) {
-                    //    return false;
-                    //}
-                    //if (!ajaxResult.containsKey("data")) {
-                    //    return false;
-                    //}
-                    //Map<String, Object> dataMap = (Map<String, Object>) ajaxResult.get("data");
-                    //if (!runImplementationClass.isVerificationMethod(dataMap.get("scriptKey").toString())) {
-                    if (!runImplementationClass.isVerificationMethod(sysBpmNodeScript.getScriptKey())) {
-                        return false;
-                    }
-
+                //校验当前节点是否自动执行
+                BpmNodeScriptRelevance bpmNodeScriptRelevance = bpmNodeScriptRelevanceService.selectAutoScriptByNodeKey(b.getNodeKey());
+                if (bpmNodeScriptRelevance != null) {
+                    //校验当前节点绑定的脚本是否存在
+                    SysBpmNodeScript sysBpmNodeScript = sending.sendGetNodeScript(bpmNodeScriptRelevance.getScriptKey());
+                    if(StringUtils.isNull(sysBpmNodeScript)) return false;
+                    //校验当前节点绑定脚本是否可用
+                    if (!runImplementationClass.isVerificationMethod(sysBpmNodeScript.getScriptKey())) return false;
                 } else {
                     return false;
                 }
                 continue;
             }
 
-
+            //------------------------------------正常节点校验逻辑---------------------------------------
             //判断节点前后是否执行自动脚本,并且脚本是否存在
             if (b.getNodeBefore().equals("true") || b.getNodeAfter().equals("true")) {
-
-                //判断当前节点名称是否存在&& '-' 前是否有内容
-                if (b.getNodeName().isEmpty()) {
-                    return false;
-                }
-                int separatorIndex = b.getNodeName().indexOf('-');
-                if (separatorIndex <= -1) {
-                    return false;
-                }
-                String nodeName = b.getNodeName().substring(0, b.getNodeName().indexOf('-'));
-                if (nodeName.isEmpty()) {
-                    return false;
-                }
-
                 // 查询自动执行脚本
                 BpmNodeScriptRelevance bpmNodeScriptRelevance = bpmNodeScriptRelevanceService.selectAutoScriptByNodeKey(b.getNodeKey());
                 if (bpmNodeScriptRelevance != null) {
                     // 获取执行脚本名称,判断脚本是否存在
-                    //ResponseEntity<AjaxResult> responseEntity = sending.sendGetNodeScript(bpmNodeScriptRelevance.getScriptKey());
                     SysBpmNodeScript sysBpmNodeScript = sending.sendGetNodeScript(bpmNodeScriptRelevance.getScriptKey());
-                    //if (responseEntity.getStatusCodeValue() != 200L) {
-                    if (StringUtils.isNull(sysBpmNodeScript)) {
-                        return false;
-                    }
-                    //AjaxResult ajaxResult = responseEntity.getBody();
-                    //if (Long.valueOf(ajaxResult.get("code").toString()) != 200L) {
-                    //    return false;
-                    //}
-                    //if (!ajaxResult.containsKey("data")) {
-                    //    return false;
-                    //}
-                    //Map<String, Object> dataMap = (Map<String, Object>) ajaxResult.get("data");
-                    if (!runImplementationClass.isVerificationMethod(sysBpmNodeScript.getScriptKey())) {
-                        return false;
-                    }
+                    if (StringUtils.isNull(sysBpmNodeScript)) return false;
+                    //校验当前脚本是否可用
+                    if (!runImplementationClass.isVerificationMethod(sysBpmNodeScript.getScriptKey())) return false;
                 } else {
                     return false;
                 }
@@ -169,83 +118,56 @@ public class VerifyExecutionProcess {
                 return false;
             }
 
-            //判断节点是否绑定角色权限,真实角色下是否存在可处理用户,虚拟角色下用户是否都真实存在
+            //判断节点是否绑定角色权限,真实角色下是否存在可处理用户,虚拟角色下用户是否存在
             if (StringUtils.isNotEmpty(b.getNodeRolePermission())) {
                 BpmNodeHandleUser bpmNodeHandleUser = bpmNodeHandleUserService.selectBpmNodeHandleUserByVirtuallyRole(b.getNodeRolePermission());
                 // 真实角色不为空查询真实角色下是否存在可处理用户
                 if (StringUtils.isNotEmpty(bpmNodeHandleUser.getRealRole())) {
-                    //ResponseEntity responseEntity = sending.sendQueryUserExistsByRoleKey(bpmNodeHandleUser.getRealRole());
                     int i = sending.sendQueryUserExistsByRoleKey(bpmNodeHandleUser.getRealRole());
-                    //if (responseEntity.getStatusCodeValue() != 200) {
-                    if(i<=0){
+                    if(i <= 0){
                         return false;
                     }
-                    //Map<String, Object> map = JSON.parseObject(responseEntity.getBody().toString());
-                    //if (Long.valueOf(map.get("code").toString()) != 200L) {
-                    //    return false;
-                    //}
-                    //if (Long.valueOf(map.get("data").toString()) <= 0L) {
-                    //    return false;
-                    //}
                 }
-                // 虚拟角色下用户是否都真实存在
+                // 虚拟角色下用户是否存在
                 if (StringUtils.isNotEmpty(bpmNodeHandleUser.getExecuteUserNo())) {
-                    //ResponseEntity<AjaxResult> responseEntity = sending.sendQueryUserExistsByUserIds(bpmNodeHandleUser.getExecuteUserNo());
                     int i = sending.sendQueryUserExistsByUserIds(bpmNodeHandleUser.getExecuteUserNo());
-                    if (i<=0) {
+                    if (i <= 0) {
                         return false;
                     }
-                    //AjaxResult ajaxResult = responseEntity.getBody();
-                    //if (Long.valueOf(ajaxResult.get("code").toString()) != 200L) {
-                    //    return false;
-                    //}
-                    //if (Long.valueOf(ajaxResult.get("data").toString()) <= 0L) {
-                    //    return false;
-                    //}
                 }
             } else {
                 return false;
             }
-            //判断当前节点是否是自定义表单类型,是判断该名称是否存在&& '-' 前是否有内容
-//            if (b.getNodeFormType().equals("designForm")) {
-//                BpmNodeScriptRelevance bpmNodeScriptRelevance = new BpmNodeScriptRelevance();
-//                bpmNodeScriptRelevance.setScriptNodeFormType("designForm");
-//                bpmNodeScriptRelevance.setNodeKey(b.getNodeKey());
-//                List<BpmNodeScriptRelevance> bpmNodeScriptRelevanceList = bpmNodeScriptRelevanceService.selectBpmNodeScriptRelevanceList(bpmNodeScriptRelevance);
-//                for (BpmNodeScriptRelevance bpmNodeScriptRelevance1 : bpmNodeScriptRelevanceList) {
-//                    if (bpmNodeScriptRelevance1.getScriptNodeName().isEmpty()) {
-//                        return false;
-//                    }
-//                    int separatorIndex = bpmNodeScriptRelevance1.getScriptNodeName().indexOf('-');
-//                    if (separatorIndex <= -1) {
-//                        return false;
-//                    }
-//                    String scriptNodeName = bpmNodeScriptRelevance1.getScriptNodeName().substring(0, bpmNodeScriptRelevance1.getScriptNodeName().indexOf('-'));
-//                    if (scriptNodeName.isEmpty()) {
-//                        return false;
-//                    }
-//                }
-//            }
+
+            //判断当前节点是否是自定义表单类型,是判断该名称是否存在
+            if (b.getNodeFormType().equals("designForm")) {
+
+                BpmNodeScriptRelevance bpmNodeScriptRelevance = new BpmNodeScriptRelevance();
+                bpmNodeScriptRelevance.setScriptNodeFormType("designForm");
+                bpmNodeScriptRelevance.setNodeKey(b.getNodeKey());
+                bpmNodeScriptRelevance.setScriptTriggerType(1L);
+                BpmNodeScriptRelevance bpmNodeScriptRelevance1 = bpmNodeScriptRelevanceService.selectBpmNodeScriptRelevanceInfo(bpmNodeScriptRelevance);
+
+                if (StringUtils.isEmpty(bpmNodeScriptRelevance1.getScriptNodeName())) {
+                    return false;
+                }
+            }
             //判断当前节点是否是拖拽表单类型,是查询drag_form表查看该表单是否存在
 //            if (b.getNodeFormType().equals("dragForm")) {
-//                ResponseEntity<AjaxResult> responseEntity = sending.sendGetFormInfo(Long.valueOf(b.getNodeFormKey()));
-//                if (responseEntity.getStatusCodeValue() != 200) {
-//                    return false;
-//                }
-//                if (!responseEntity.getBody().containsKey("data")) {
-//                    return false;
-//                }
-//            }
-            //判断当前节点是否是组合表单类型,是查询drag_table_group表查看该表单是否存在
-//            if (b.getNodeFormType().equals("composeForm")) {
-//                ResponseEntity<AjaxResult> responseEntity = sending.sendGetGroupInfo(b.getNodeFormKey());
-//                if (responseEntity.getStatusCodeValue() != 200) {
-//                    return false;
-//                }
-//                if (!responseEntity.getBody().containsKey("data")) {
-//                    return false;
-//                }
+//                DragForm dragForm = sending.sendGetFormInfo(Long.valueOf(b.getNodeFormKey()));
+//                if(StringUtils.isNull(dragForm)) return false;
 //            }
+
+            //校验异常节点脚本是否可执行
+            //------------------------------------异常节点校验逻辑---------------------------------------
+            //查询当前节点绑定的异常表单
+            BpmNodeScriptRelevance bpmNodeScriptRelevance = new BpmNodeScriptRelevance();
+            bpmNodeScriptRelevance.setNodeKey(b.getNodeKey());
+            bpmNodeScriptRelevance.setScriptTriggerType(0L);
+            List<BpmNodeScriptRelevance> bpmNodeScriptRelevanceList = bpmNodeScriptRelevanceService.selectBpmNodeScriptRelevanceList(bpmNodeScriptRelevance);
+            for (BpmNodeScriptRelevance bpmNodeScriptRelevance1 : bpmNodeScriptRelevanceList){
+                if (!runImplementationClass.isVerificationMethod(bpmNodeScriptRelevance1.getScriptKey())) return false;
+            }
         }
         if (startNode <= 0 || endNode <= 0) {
             return false;

+ 79 - 0
zkqy-process-execution/src/main/resources/mapper/bpm/dispersed/BpmApprovalStatusMapper.xml

@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.zkqy.execution.produce.dispersed.mapper.BpmApprovalStatusMapper">
+    
+    <resultMap type="com.zkqy.execution.produce.dispersed.entity.BpmApprovalStatus" id="BpmApprovalStatusResult">
+        <result property="id"    column="id"    />
+        <result property="tableName"    column="table_name"    />
+        <result property="tableId"    column="table_id"    />
+        <result property="approvalState"    column="approval_state"    />
+        <result property="taskKey"    column="task_key"    />
+    </resultMap>
+
+    <sql id="selectBpmApprovalStatusVo">
+        select id, table_name, table_id, approval_state, task_key from {DBNAME}.bpm_approval_status
+    </sql>
+
+    <select id="selectBpmApprovalStatusList" parameterType="com.zkqy.execution.produce.dispersed.entity.BpmApprovalStatus" resultMap="BpmApprovalStatusResult">
+        <include refid="selectBpmApprovalStatusVo"/>
+        <where>  
+            <if test="tableName != null  and tableName != ''"> and table_name like concat('%', #{tableName}, '%')</if>
+            <if test="tableId != null  and tableId != ''"> and table_id = #{tableId}</if>
+            <if test="approvalState != null  and approvalState != ''"> and approval_state = #{approvalState}</if>
+            <if test="taskKey != null  and taskKey != ''"> and task_key = #{taskKey}</if>
+        </where>
+    </select>
+    
+    <select id="selectBpmApprovalStatusById" parameterType="Long" resultMap="BpmApprovalStatusResult">
+        <include refid="selectBpmApprovalStatusVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertBpmApprovalStatus" parameterType="com.zkqy.execution.produce.dispersed.entity.BpmApprovalStatus" useGeneratedKeys="true" keyProperty="id">
+        insert into {DBNAME}.bpm_approval_status
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="tableName != null">table_name,</if>
+            <if test="tableId != null">table_id,</if>
+            <if test="approvalState != null">approval_state,</if>
+            <if test="taskKey != null">task_key,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="tableName != null">#{tableName},</if>
+            <if test="tableId != null">#{tableId},</if>
+            <if test="approvalState != null">#{approvalState},</if>
+            <if test="taskKey != null">#{taskKey},</if>
+        </trim>
+    </insert>
+
+    <update id="updateBpmApprovalStatus" parameterType="com.zkqy.execution.produce.dispersed.entity.BpmApprovalStatus">
+        update {DBNAME}.bpm_approval_status
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="tableName != null">table_name = #{tableName},</if>
+            <if test="tableId != null">table_id = #{tableId},</if>
+            <if test="approvalState != null">approval_state = #{approvalState},</if>
+            <if test="taskKey != null">task_key = #{taskKey},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <update id="updateBpmApprovalStatusByTaskKey">
+        update {DBNAME}.bpm_approval_status
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="approvalState != null">approval_state = #{approvalState},</if>
+        </trim>
+        where taskKey = #{taskKey}
+    </update>
+
+    <delete id="deleteBpmApprovalStatusById" parameterType="Long">
+        delete from bpm_approval_status where id = #{id}
+    </delete>
+
+    <delete id="deleteBpmApprovalStatusByIds" parameterType="String">
+        delete from bpm_approval_status where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 16 - 0
zkqy-process-execution/src/main/resources/mapper/bpm/dispersed/BpmExecuteNodeFormMapper.xml

@@ -27,6 +27,22 @@
         from {DBNAME}.bpm_execute_node_form
     </sql>
 
+    <select id="selectByTaskScriptKeys"
+            parameterType="com.zkqy.execution.produce.dispersed.entity.BpmExecuteNodeForm"
+            resultMap="BpmExecuteNodeFormResult">
+        <include refid="selectBpmExecuteNodeFormVo"/>
+        <where>
+            task_process_key = #{taskProcessKey}
+            <if test="taskScriptKeys != null  and taskScriptKeys.size() > 0">
+                and task_script_key in
+                <foreach item="taskScriptKey" collection="taskScriptKeys" open="(" separator="," close=")">
+                    #{taskScriptKey}
+                </foreach>
+            </if>
+        </where>
+
+    </select>
+
     <select id="selectBpmExecuteNodeFormList"
             parameterType="com.zkqy.execution.produce.dispersed.entity.BpmExecuteNodeForm"
             resultMap="BpmExecuteNodeFormResult">

+ 6 - 3
zkqy-process-execution/src/main/resources/mapper/bpm/dispersed/BpmExecuteNodeMapper.xml

@@ -41,7 +41,7 @@
                task_node_form_key,
                task_node_form_type,
                task_node_type,
-               `task_node_execute_type`,
+               task_node_execute_type,
                task_node_before,
                task_node_after,
                task_node_role_permission,
@@ -49,7 +49,7 @@
                task_node_number,
                task_node_weight,
                task_node_state,
-               `task_node_other_state`,
+               task_node_other_state,
                task_priority,
                task1,
                task2,
@@ -228,6 +228,7 @@
             <if test="taskNodeNumber != null">task_node_number = #{taskNodeNumber},</if>
             <if test="taskNodeWeight != null">task_node_weight = #{taskNodeWeight},</if>
             <if test="taskNodeState != null">task_node_state = #{taskNodeState},</if>
+            <if test="taskNodeOtherState != null">task_node_other_state = #{taskNodeOtherState},</if>
             <if test="taskPriority != null">task_priority = #{taskPriority},</if>
             <if test="task1 != null">task1 = #{task1},</if>
             <if test="task2 != null">task2 = #{task2},</if>
@@ -244,6 +245,8 @@
             <if test="taskProcessKey != null"> and task_process_key = #{taskProcessKey}</if>
             <if test="taskNodeKey != null">and task_node_key = #{taskNodeKey}</if>
         </where>
+
+
     </update>
 
 
@@ -254,7 +257,7 @@
     </delete>
 
     <delete id="deleteBpmExecuteNodeByIds" parameterType="String">
-        delete from bpm_execute_node where id in
+        delete from {DBNAME}.bpm_execute_node where id in
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
         </foreach>

+ 37 - 40
zkqy-process-execution/src/main/resources/mapper/bpm/dispersed/BpmExecuteProcessMapper.xml

@@ -64,36 +64,32 @@
     <!--benm.task_process_key-->
     <select id="selectBpmExecuteProcessListLog" resultMap="retMap">
         select
+        plan.${planName} as task_plan_name,
         bep.*
         from {DBNAME}.bpm_execute_process bep
         join {DBNAME}.bpm_execute_node_middle benm on bep.task_key = benm.task_process_key
+        join {DBNAME}.${planTableName} as plan on plan.${planID} = bep.task_plan_key
         where
-        FIND_IN_SET(#{userId}, benm.task_execute_user_no) > 0
+        ( FIND_IN_SET(#{userId}, benm.task_execute_user_no) > 0
         <if test="taskRealRoleList != null and taskRealRoleList.size() > 0">
             OR
             <foreach collection="taskRealRoleList" item="role" separator=" OR ">
                 FIND_IN_SET(#{role}, benm.task_real_role) > 0
             </foreach>
         </if>
-
-        <if test="taskKey != null  and taskKey != ''">and bep.task_key = #{taskKey}</if>
-        <if test="taskName != null  and taskName != ''">and bep.task_name like concat('%', #{taskName}, '%')</if>
-        <if test="taskNodeKey != null  and taskNodeKey != ''">and bep.task_node_key = #{taskNodeKey}</if>
-        <if test="taskNodeNextKey != null  and taskNodeNextKey != ''">and bep.task_node_next_key =
-            #{taskNodeNextKey}
-        </if>
-        <if test="taskProcessKey != null  and taskProcessKey != ''">and bep.task_process_key = #{taskProcessKey}
-        </if>
-        <if test="taskProcessXmlContent != null  and taskProcessXmlContent != ''">and bep.task_process_xml_content =
-            #{taskProcessXmlContent}
-        </if>
-        <if test="taskProcessState != null ">and bep.task_process_state = #{taskProcessState}</if>
-        <if test="taskProcessNote != null  and taskProcessNote != ''">and bep.task_process_note =
-            #{taskProcessNote}
-        </if>
-        <if test="taskProcessType != null  and taskProcessType != ''">and bep.task_process_type =
-            #{taskProcessType}
+        )
+        <if test="taskProcessState != null">and bep.task_process_state = #{taskProcessState}</if>
+        <if test="taskName != null  and taskName != ''">
+            and CONCAT(
+            IFNULL( bep.task_key, '' ),
+            IFNULL( bep.task_name, '' ),
+            IFNULL( bep.task_node_key, '' ),
+            IFNULL( bep.task_node_next_key, '' ),
+            IFNULL( bep.task_process_key, '' ),
+            IFNULL( bep.task_process_note, '' ),
+            IFNULL( plan.${planName}, '' )) LIKE concat('%', #{taskName}, '%')
         </if>
+
         GROUP BY benm.task_process_key
     </select>
 
@@ -250,18 +246,19 @@
             </foreach>
         </if>
         )
-        <if test="taskKey != null  and taskKey != ''">and bep.task_key = #{taskKey}</if>
-        <if test="taskName != null  and taskName != ''">and bep.task_name like concat('%', #{taskName}, '%')</if>
-        <if test="taskNodeKey != null  and taskNodeKey != ''">and bep.task_node_key = #{taskNodeKey}</if>
-        <if test="taskNodeNextKey != null  and taskNodeNextKey != ''">and bep.task_node_next_key =
-            #{executeProcessTaskNodeNextKey}
-        </if>
-        <if test="taskProcessKey != null  and taskProcessKey != ''">and bep.task_process_key = #{taskProcessKey}</if>
-        <if test="taskProcessState != null ">and bep.task_process_state = #{taskProcessState}</if>
-        <if test="taskProcessNote != null  and taskProcessNote != ''">and bep.task_process_note = #{taskProcessNote}
-        </if>
-        <if test="taskProcessType != null  and taskProcessType != ''">and bep.task_process_type = #{taskProcessType}
+        <if test="taskProcessState != null">and bep.task_process_state = #{taskProcessState}</if>
+        <if test="taskProcessType != null">and bep.task_process_type = #{taskProcessType}</if>
+        <if test="taskName != null  and taskName != ''">
+            and CONCAT(
+            IFNULL( bep.task_key, '' ),
+            IFNULL( bep.task_name, '' ),
+            IFNULL( bep.task_node_key, '' ),
+            IFNULL( bep.task_node_next_key, '' ),
+            IFNULL( bep.task_process_key, '' ),
+            IFNULL( bep.task_process_note, '' ),
+            IFNULL( plan.${planName}, '' )) LIKE concat('%', #{taskName}, '%')
         </if>
+
         order by ben.create_time desc
     </select>
 
@@ -384,16 +381,16 @@
         join {DBNAME}.${planTableName} as plan on
         plan.${planID} = bep.task_plan_key
         where bep.task_process_state = 3
-        <if test="taskKey != null  and taskKey != ''">and bep.task_key = #{taskKey}</if>
-        <if test="taskName != null  and taskName != ''">and bep.task_name like concat('%', #{taskName}, '%')</if>
-        <if test="taskNodeKey != null  and taskNodeKey != ''">and bep.task_node_key = #{taskNodeKey}</if>
-        <if test="taskNodeNextKey != null  and taskNodeNextKey != ''">and bep.task_node_next_key =
-            #{executeProcessTaskNodeNextKey}
-        </if>
-        <if test="taskProcessKey != null  and taskProcessKey != ''">and bep.task_process_key = #{taskProcessKey}</if>
-        <if test="taskProcessNote != null  and taskProcessNote != ''">and bep.task_process_note = #{taskProcessNote}
-        </if>
-        <if test="taskProcessType != null  and taskProcessType != ''">and bep.task_process_type = #{taskProcessType}
+        <if test="taskProcessType != null">and bep.task_process_type = #{taskProcessType}</if>
+        <if test="taskName != null  and taskName != ''">
+            and CONCAT(
+            IFNULL( bep.task_key, '' ),
+            IFNULL( bep.task_name, '' ),
+            IFNULL( bep.task_node_key, '' ),
+            IFNULL( bep.task_node_next_key, '' ),
+            IFNULL( bep.task_process_key, '' ),
+            IFNULL( bep.task_process_note, '' ),
+            IFNULL( plan.${planName}, '' )) LIKE concat('%', #{taskName}, '%')
         </if>
         order by ben.create_time desc
     </select>

+ 6 - 6
zkqy-process-execution/src/main/resources/mapper/bpm/dispersed/BpmNodeScriptRelevanceMapper.xml

@@ -26,9 +26,9 @@
             <if test="nodeKey != null  and nodeKey != ''">and node_key = #{nodeKey}</if>
             <if test="scriptKey != null  and scriptKey != ''">and script_key = #{scriptKey}</if>
             <if test="scriptTriggerType != null ">and script_trigger_type = #{scriptTriggerType}</if>
-            <if test="formKey != null">and form_key = #{formKey},</if>
-            <if test="scriptNodeName != null">and script_node_name = #{scriptNodeName},</if>
-            <if test="scriptNodeFormType != null">and script_node_form_type = #{scriptNodeFormType},</if>
+            <if test="formKey != null">and form_key = #{formKey}</if>
+            <if test="scriptNodeName != null">and script_node_name = #{scriptNodeName}</if>
+            <if test="scriptNodeFormType != null">and script_node_form_type = #{scriptNodeFormType}</if>
         </where>
     </select>
 
@@ -111,9 +111,9 @@
             <if test="nodeKey != null  and nodeKey != ''">and node_key = #{nodeKey}</if>
             <if test="scriptKey != null  and scriptKey != ''">and script_key = #{scriptKey}</if>
             <if test="scriptTriggerType != null ">and script_trigger_type = #{scriptTriggerType}</if>
-            <if test="formKey != null">and form_key = #{formKey},</if>
-            <if test="scriptNodeName != null">and script_node_name = #{scriptNodeName},</if>
-            <if test="scriptNodeFormType != null">and script_node_form_type = #{scriptNodeFormType},</if>
+            <if test="formKey != null">and form_key = #{formKey}</if>
+            <if test="scriptNodeName != null">and script_node_name = #{scriptNodeName}</if>
+            <if test="scriptNodeFormType != null">and script_node_form_type = #{scriptNodeFormType}</if>
         </where>
     </select>
 

+ 195 - 0
zkqy-system/src/main/java/com/zkqy/system/domain/LoginPageConfiguration.java

@@ -0,0 +1,195 @@
+package com.zkqy.system.domain;
+
+import com.zkqy.common.annotation.Excel;
+import com.zkqy.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * 登录页面配置信息对象 login_page_configuration
+ * 
+ * @author zkqy
+ * @date 2024-01-22
+ */
+public class LoginPageConfiguration extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 编号 */
+    private Long id;
+
+    /** 登录页面编号 */
+    @Excel(name = "登录页面编号")
+    private String loginPageNumber;
+
+    /** 登录页面标题 */
+    @Excel(name = "登录页面标题")
+    private String loginPageTitle;
+
+    /** 登录页面描述 */
+    @Excel(name = "登录页面描述")
+    private String loginPageDescription;
+
+    /** 登录页面logo路径 */
+    @Excel(name = "登录页面logo路径")
+    private String loginPageLogo;
+
+    /** 登录页面背景图路径 */
+    @Excel(name = "登录页面背景图路径")
+    private String loginPageBackgroundImage;
+
+    /** 窗口标题 */
+    @Excel(name = "窗口标题")
+    private String windowTitle;
+
+    /** 窗口logo路径 */
+    @Excel(name = "窗口logo路径")
+    private String windowLogo;
+
+    /** 租户编号 */
+    @Excel(name = "租户编号")
+    private Long tenantId;
+
+    /** 创建者ID */
+    @Excel(name = "创建者ID")
+    private Long createById;
+
+    /** 更新者ID */
+    @Excel(name = "更新者ID")
+    private Long updateById;
+
+    /** 删除标志(0:否;2:是) */
+    private String delFlag;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setLoginPageNumber(String loginPageNumber) 
+    {
+        this.loginPageNumber = loginPageNumber;
+    }
+
+    public String getLoginPageNumber() 
+    {
+        return loginPageNumber;
+    }
+    public void setLoginPageTitle(String loginPageTitle) 
+    {
+        this.loginPageTitle = loginPageTitle;
+    }
+
+    public String getLoginPageTitle() 
+    {
+        return loginPageTitle;
+    }
+    public void setLoginPageDescription(String loginPageDescription) 
+    {
+        this.loginPageDescription = loginPageDescription;
+    }
+
+    public String getLoginPageDescription() 
+    {
+        return loginPageDescription;
+    }
+    public void setLoginPageLogo(String loginPageLogo) 
+    {
+        this.loginPageLogo = loginPageLogo;
+    }
+
+    public String getLoginPageLogo() 
+    {
+        return loginPageLogo;
+    }
+    public void setLoginPageBackgroundImage(String loginPageBackgroundImage) 
+    {
+        this.loginPageBackgroundImage = loginPageBackgroundImage;
+    }
+
+    public String getLoginPageBackgroundImage() 
+    {
+        return loginPageBackgroundImage;
+    }
+    public void setWindowTitle(String windowTitle) 
+    {
+        this.windowTitle = windowTitle;
+    }
+
+    public String getWindowTitle() 
+    {
+        return windowTitle;
+    }
+    public void setWindowLogo(String windowLogo) 
+    {
+        this.windowLogo = windowLogo;
+    }
+
+    public String getWindowLogo() 
+    {
+        return windowLogo;
+    }
+    public void setTenantId(Long tenantId) 
+    {
+        this.tenantId = tenantId;
+    }
+
+    public Long getTenantId() 
+    {
+        return tenantId;
+    }
+    public void setCreateById(Long createById) 
+    {
+        this.createById = createById;
+    }
+
+    public Long getCreateById() 
+    {
+        return createById;
+    }
+    public void setUpdateById(Long updateById) 
+    {
+        this.updateById = updateById;
+    }
+
+    public Long getUpdateById() 
+    {
+        return updateById;
+    }
+    public void setDelFlag(String delFlag) 
+    {
+        this.delFlag = delFlag;
+    }
+
+    public String getDelFlag() 
+    {
+        return delFlag;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("loginPageNumber", getLoginPageNumber())
+            .append("loginPageTitle", getLoginPageTitle())
+            .append("loginPageDescription", getLoginPageDescription())
+            .append("loginPageLogo", getLoginPageLogo())
+            .append("loginPageBackgroundImage", getLoginPageBackgroundImage())
+            .append("windowTitle", getWindowTitle())
+            .append("windowLogo", getWindowLogo())
+            .append("tenantId", getTenantId())
+            .append("remark", getRemark())
+            .append("createBy", getCreateBy())
+            .append("createById", getCreateById())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateById", getUpdateById())
+            .append("updateTime", getUpdateTime())
+            .append("delFlag", getDelFlag())
+            .toString();
+    }
+}

+ 157 - 0
zkqy-system/src/main/java/com/zkqy/system/domain/SysEngineering.java

@@ -0,0 +1,157 @@
+package com.zkqy.system.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.zkqy.common.annotation.Excel;
+import com.zkqy.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import java.util.Date;
+
+/**
+ * 工程部署对象 sys_engineering
+ * 
+ * @author zkqy
+ * @date 2024-01-03
+ */
+public class SysEngineering extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 编号 */
+    private Long id;
+
+    /** 工程key */
+    @Excel(name = "工程key")
+    private String engineeringKey;
+
+    /** 工程名称 */
+    @Excel(name = "工程名称")
+    private String engineeringName;
+
+    /** 下载次数 */
+    @Excel(name = "下载次数")
+    private Long downloadNumber;
+
+    /** 下载时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "下载时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date downloadTime;
+
+    /** 租户编号 */
+    @Excel(name = "租户编号")
+    private Long tenantId;
+
+    /** 是否删除(0:否;2:是) */
+    private String delFlag;
+
+    /** 创建者ID */
+    @Excel(name = "创建者ID")
+    private Long createById;
+
+    /** 更新者ID */
+    @Excel(name = "更新者ID")
+    private Long updateById;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setEngineeringKey(String engineeringKey) 
+    {
+        this.engineeringKey = engineeringKey;
+    }
+
+    public String getEngineeringKey() 
+    {
+        return engineeringKey;
+    }
+    public void setEngineeringName(String engineeringName) 
+    {
+        this.engineeringName = engineeringName;
+    }
+
+    public String getEngineeringName() 
+    {
+        return engineeringName;
+    }
+    public void setDownloadNumber(Long downloadNumber) 
+    {
+        this.downloadNumber = downloadNumber;
+    }
+
+    public Long getDownloadNumber() 
+    {
+        return downloadNumber;
+    }
+    public void setDownloadTime(Date downloadTime) 
+    {
+        this.downloadTime = downloadTime;
+    }
+
+    public Date getDownloadTime() 
+    {
+        return downloadTime;
+    }
+    public void setTenantId(Long tenantId) 
+    {
+        this.tenantId = tenantId;
+    }
+
+    public Long getTenantId() 
+    {
+        return tenantId;
+    }
+    public void setDelFlag(String delFlag) 
+    {
+        this.delFlag = delFlag;
+    }
+
+    public String getDelFlag() 
+    {
+        return delFlag;
+    }
+    public void setCreateById(Long createById) 
+    {
+        this.createById = createById;
+    }
+
+    public Long getCreateById() 
+    {
+        return createById;
+    }
+    public void setUpdateById(Long updateById) 
+    {
+        this.updateById = updateById;
+    }
+
+    public Long getUpdateById() 
+    {
+        return updateById;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("engineeringKey", getEngineeringKey())
+            .append("engineeringName", getEngineeringName())
+            .append("downloadNumber", getDownloadNumber())
+            .append("downloadTime", getDownloadTime())
+            .append("tenantId", getTenantId())
+            .append("remark", getRemark())
+            .append("delFlag", getDelFlag())
+            .append("createBy", getCreateBy())
+            .append("createById", getCreateById())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateById", getUpdateById())
+            .append("updateTime", getUpdateTime())
+            .toString();
+    }
+}

+ 13 - 0
zkqy-system/src/main/java/com/zkqy/system/domain/SysLogininfor.java

@@ -52,6 +52,11 @@ public class SysLogininfor extends BaseEntity
     @Excel(name = "访问时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
     private Date loginTime;
 
+    /**
+     * 租户ID
+     */
+    private Long tenantId;
+
     public Long getInfoId()
     {
         return infoId;
@@ -141,4 +146,12 @@ public class SysLogininfor extends BaseEntity
     {
         this.loginTime = loginTime;
     }
+
+    public Long getTenantId() {
+        return tenantId;
+    }
+
+    public void setTenantId(Long tenantId) {
+        this.tenantId = tenantId;
+    }
 }

+ 12 - 0
zkqy-system/src/main/java/com/zkqy/system/domain/SysOperLog.java

@@ -86,6 +86,10 @@ public class SysOperLog extends BaseEntity
     /** 消耗时间 */
     @Excel(name = "消耗时间", suffix = "毫秒")
     private Long costTime;
+    /**
+     * 租户ID
+     */
+    private Long tenantId;
 
     public Long getOperId()
     {
@@ -266,4 +270,12 @@ public class SysOperLog extends BaseEntity
     {
         this.costTime = costTime;
     }
+
+    public Long getTenantId() {
+        return tenantId;
+    }
+
+    public void setTenantId(Long tenantId) {
+        this.tenantId = tenantId;
+    }
 }

+ 73 - 0
zkqy-system/src/main/java/com/zkqy/system/mapper/LoginPageConfigurationMapper.java

@@ -0,0 +1,73 @@
+package com.zkqy.system.mapper;
+
+import com.zkqy.system.domain.LoginPageConfiguration;
+
+import java.util.List;
+
+/**
+ * 登录页面配置信息Mapper接口
+ * 
+ * @author zkqy
+ * @date 2024-01-22
+ */
+public interface LoginPageConfigurationMapper 
+{
+    /**
+     * 查询登录页面配置信息
+     * 
+     * @param tenantId 租户编号
+     * @return 登录页面配置信息
+     */
+    LoginPageConfiguration selectLoginPageConfigurationByTenantId(Long tenantId);
+
+    /**
+     * 查询登录页面配置信息
+     *
+     * @param loginPageNumber 登录页面配置信息编号
+     * @return 登录页面配置信息
+     */
+    LoginPageConfiguration selectLoginPageConfigurationByLoginPageNumber(String loginPageNumber);
+
+    /**
+     * 查询登录页面配置信息列表
+     * 
+     * @param loginPageConfiguration 登录页面配置信息
+     * @return 登录页面配置信息集合
+     */
+    List<LoginPageConfiguration> selectLoginPageConfigurationList(LoginPageConfiguration loginPageConfiguration);
+
+    /**
+     * 新增登录页面配置信息
+     * 
+     * @param loginPageConfiguration 登录页面配置信息
+     * @return 结果
+     */
+    int insertLoginPageConfiguration(LoginPageConfiguration loginPageConfiguration);
+
+    /**
+     * 修改登录页面配置信息
+     * 
+     * @param loginPageConfiguration 登录页面配置信息
+     * @return 结果
+     */
+    int updateLoginPageConfiguration(LoginPageConfiguration loginPageConfiguration);
+
+    /**
+     * 删除登录页面配置信息
+     * 
+     * @param id 登录页面配置信息主键
+     * @return 结果
+     */
+    int deleteLoginPageConfigurationById(Long id);
+
+    /**
+     * 批量删除登录页面配置信息
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    int deleteLoginPageConfigurationByIds(Long[] ids);
+
+
+
+}

+ 62 - 0
zkqy-system/src/main/java/com/zkqy/system/mapper/SysEngineeringMapper.java

@@ -0,0 +1,62 @@
+package com.zkqy.system.mapper;
+
+import com.zkqy.system.domain.SysEngineering;
+
+import java.util.List;
+
+/**
+ * 工程部署Mapper接口
+ * 
+ * @author zkqy
+ * @date 2024-01-03
+ */
+public interface SysEngineeringMapper 
+{
+    /**
+     * 查询工程部署
+     * 
+     * @param id 工程部署主键
+     * @return 工程部署
+     */
+    public SysEngineering selectSysEngineeringById(Long id);
+
+    /**
+     * 查询工程部署列表
+     * 
+     * @param sysEngineering 工程部署
+     * @return 工程部署集合
+     */
+    public List<SysEngineering> selectSysEngineeringList(SysEngineering sysEngineering);
+
+    /**
+     * 新增工程部署
+     * 
+     * @param sysEngineering 工程部署
+     * @return 结果
+     */
+    public int insertSysEngineering(SysEngineering sysEngineering);
+
+    /**
+     * 修改工程部署
+     * 
+     * @param sysEngineering 工程部署
+     * @return 结果
+     */
+    public int updateSysEngineering(SysEngineering sysEngineering);
+
+    /**
+     * 删除工程部署
+     * 
+     * @param id 工程部署主键
+     * @return 结果
+     */
+    public int deleteSysEngineeringById(Long id);
+
+    /**
+     * 批量删除工程部署
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteSysEngineeringByIds(Long[] ids);
+}

+ 1 - 1
zkqy-system/src/main/java/com/zkqy/system/mapper/SysMenuMapper.java

@@ -25,7 +25,7 @@ public interface SysMenuMapper {
      * @param tenantId
      * @return
      */
-    public List<SysMenu> selectTenantMenuList(Long tenantId);
+    public List<SysMenu> selectTenantMenuList(@Param("menu") SysMenu menu,@Param("tenantId") Long tenantId);
 
     /**
      * 根据用户所有权限

+ 7 - 0
zkqy-system/src/main/java/com/zkqy/system/mapper/SysUserMapper.java

@@ -143,4 +143,11 @@ public interface SysUserMapper
      * @return
      */
     int selectUserByUserIds(List<Long> userIds);
+
+    /**
+     * 根据账号查询当前库中存在多少相同账号
+     * @param userName 账号
+     * @return
+     */
+    int queryCountUserName(String userName);
 }

+ 70 - 0
zkqy-system/src/main/java/com/zkqy/system/service/ILoginPageConfigurationService.java

@@ -0,0 +1,70 @@
+package com.zkqy.system.service;
+
+import com.zkqy.system.domain.LoginPageConfiguration;
+
+import java.util.List;
+
+/**
+ * 登录页面配置信息Service接口
+ * 
+ * @author zkqy
+ * @date 2024-01-22
+ */
+public interface ILoginPageConfigurationService 
+{
+    /**
+     * 查询登录页面配置信息
+     * 
+     * @param tenantId 登录页面配置信息主键
+     * @return 登录页面配置信息
+     */
+    LoginPageConfiguration selectLoginPageConfigurationByTenantId(Long tenantId);
+
+    /**
+     * 查询登录页面配置信息
+     *
+     * @param loginPageNumber 登录页面配置信息编号
+     * @return 登录页面配置信息
+     */
+    LoginPageConfiguration selectLoginPageConfigurationByLoginPageNumber(String loginPageNumber);
+
+    /**
+     * 查询登录页面配置信息列表
+     * 
+     * @param loginPageConfiguration 登录页面配置信息
+     * @return 登录页面配置信息集合
+     */
+    List<LoginPageConfiguration> selectLoginPageConfigurationList(LoginPageConfiguration loginPageConfiguration);
+
+    /**
+     * 新增登录页面配置信息
+     * 
+     * @param loginPageConfiguration 登录页面配置信息
+     * @return 结果
+     */
+    int insertLoginPageConfiguration(LoginPageConfiguration loginPageConfiguration);
+
+    /**
+     * 修改登录页面配置信息
+     * 
+     * @param loginPageConfiguration 登录页面配置信息
+     * @return 结果
+     */
+    int updateLoginPageConfiguration(LoginPageConfiguration loginPageConfiguration);
+
+    /**
+     * 批量删除登录页面配置信息
+     * 
+     * @param ids 需要删除的登录页面配置信息主键集合
+     * @return 结果
+     */
+    int deleteLoginPageConfigurationByIds(Long[] ids);
+
+    /**
+     * 删除登录页面配置信息信息
+     * 
+     * @param id 登录页面配置信息主键
+     * @return 结果
+     */
+    int deleteLoginPageConfigurationById(Long id);
+}

+ 62 - 0
zkqy-system/src/main/java/com/zkqy/system/service/ISysEngineeringService.java

@@ -0,0 +1,62 @@
+package com.zkqy.system.service;
+
+import com.zkqy.system.domain.SysEngineering;
+
+import java.util.List;
+
+/**
+ * 工程部署Service接口
+ * 
+ * @author zkqy
+ * @date 2024-01-03
+ */
+public interface ISysEngineeringService 
+{
+    /**
+     * 查询工程部署
+     * 
+     * @param id 工程部署主键
+     * @return 工程部署
+     */
+    public SysEngineering selectSysEngineeringById(Long id);
+
+    /**
+     * 查询工程部署列表
+     * 
+     * @param sysEngineering 工程部署
+     * @return 工程部署集合
+     */
+    public List<SysEngineering> selectSysEngineeringList(SysEngineering sysEngineering);
+
+    /**
+     * 新增工程部署
+     * 
+     * @param sysEngineering 工程部署
+     * @return 结果
+     */
+    public int insertSysEngineering(SysEngineering sysEngineering);
+
+    /**
+     * 修改工程部署
+     * 
+     * @param sysEngineering 工程部署
+     * @return 结果
+     */
+    public int updateSysEngineering(SysEngineering sysEngineering);
+
+    /**
+     * 批量删除工程部署
+     * 
+     * @param ids 需要删除的工程部署主键集合
+     * @return 结果
+     */
+    public int deleteSysEngineeringByIds(Long[] ids);
+
+    /**
+     * 删除工程部署信息
+     * 
+     * @param id 工程部署主键
+     * @return 结果
+     */
+    public int deleteSysEngineeringById(Long id);
+}

+ 7 - 0
zkqy-system/src/main/java/com/zkqy/system/service/ISysUserService.java

@@ -216,4 +216,11 @@ public interface ISysUserService
      * @return
      */
     int selectUserByUserIds(String userIds);
+
+    /**
+     * 根据账号查询当前库中存在多少相同账号
+     * @param userName 账号
+     * @return
+     */
+    boolean isExistUser(String userName);
 }

+ 102 - 0
zkqy-system/src/main/java/com/zkqy/system/service/impl/LoginPageConfigurationServiceImpl.java

@@ -0,0 +1,102 @@
+package com.zkqy.system.service.impl;
+
+import com.zkqy.common.utils.DateUtils;
+import com.zkqy.system.domain.LoginPageConfiguration;
+import com.zkqy.system.mapper.LoginPageConfigurationMapper;
+import com.zkqy.system.service.ILoginPageConfigurationService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 登录页面配置信息Service业务层处理
+ * 
+ * @author zkqy
+ * @date 2024-01-22
+ */
+@Service
+public class LoginPageConfigurationServiceImpl implements ILoginPageConfigurationService 
+{
+    @Autowired
+    private LoginPageConfigurationMapper loginPageConfigurationMapper;
+
+    /**
+     * 查询登录页面配置信息
+     * 
+     * @param tenantId 登录页面配置信息主键
+     * @return 登录页面配置信息
+     */
+    @Override
+    public LoginPageConfiguration selectLoginPageConfigurationByTenantId(Long tenantId)
+    {
+        return loginPageConfigurationMapper.selectLoginPageConfigurationByTenantId(tenantId);
+    }
+
+    @Override
+    public LoginPageConfiguration selectLoginPageConfigurationByLoginPageNumber(String loginPageNumber) {
+        return loginPageConfigurationMapper.selectLoginPageConfigurationByLoginPageNumber(loginPageNumber);
+    }
+
+    /**
+     * 查询登录页面配置信息列表
+     * 
+     * @param loginPageConfiguration 登录页面配置信息
+     * @return 登录页面配置信息
+     */
+    @Override
+    public List<LoginPageConfiguration> selectLoginPageConfigurationList(LoginPageConfiguration loginPageConfiguration)
+    {
+        return loginPageConfigurationMapper.selectLoginPageConfigurationList(loginPageConfiguration);
+    }
+
+    /**
+     * 新增登录页面配置信息
+     * 
+     * @param loginPageConfiguration 登录页面配置信息
+     * @return 结果
+     */
+    @Override
+    public int insertLoginPageConfiguration(LoginPageConfiguration loginPageConfiguration)
+    {
+        loginPageConfiguration.setCreateTime(DateUtils.getNowDate());
+        return loginPageConfigurationMapper.insertLoginPageConfiguration(loginPageConfiguration);
+    }
+
+    /**
+     * 修改登录页面配置信息
+     * 
+     * @param loginPageConfiguration 登录页面配置信息
+     * @return 结果
+     */
+    @Override
+    public int updateLoginPageConfiguration(LoginPageConfiguration loginPageConfiguration)
+    {
+        loginPageConfiguration.setUpdateTime(DateUtils.getNowDate());
+        return loginPageConfigurationMapper.updateLoginPageConfiguration(loginPageConfiguration);
+    }
+
+    /**
+     * 批量删除登录页面配置信息
+     * 
+     * @param ids 需要删除的登录页面配置信息主键
+     * @return 结果
+     */
+    @Override
+    public int deleteLoginPageConfigurationByIds(Long[] ids)
+    {
+        return loginPageConfigurationMapper.deleteLoginPageConfigurationByIds(ids);
+    }
+
+    /**
+     * 删除登录页面配置信息信息
+     * 
+     * @param id 登录页面配置信息主键
+     * @return 结果
+     */
+    @Override
+    public int deleteLoginPageConfigurationById(Long id)
+    {
+        return loginPageConfigurationMapper.deleteLoginPageConfigurationById(id);
+    }
+}

+ 92 - 0
zkqy-system/src/main/java/com/zkqy/system/service/impl/SysEngineeringServiceImpl.java

@@ -0,0 +1,92 @@
+package com.zkqy.system.service.impl;
+
+import com.zkqy.common.utils.DateUtils;
+import com.zkqy.common.utils.SecurityUtils;
+import com.zkqy.system.domain.SysEngineering;
+import com.zkqy.system.mapper.SysEngineeringMapper;
+import com.zkqy.system.service.ISysEngineeringService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 工程部署Service业务层处理
+ *
+ * @author zkqy
+ * @date 2024-01-03
+ */
+@Service
+public class SysEngineeringServiceImpl implements ISysEngineeringService {
+    @Autowired
+    private SysEngineeringMapper sysEngineeringMapper;
+
+    /**
+     * 查询工程部署
+     *
+     * @param id 工程部署主键
+     * @return 工程部署
+     */
+    @Override
+    public SysEngineering selectSysEngineeringById(Long id) {
+        return sysEngineeringMapper.selectSysEngineeringById(id);
+    }
+
+    /**
+     * 查询工程部署列表
+     *
+     * @param sysEngineering 工程部署
+     * @return 工程部署
+     */
+    @Override
+    public List<SysEngineering> selectSysEngineeringList(SysEngineering sysEngineering) {
+        sysEngineering.setTenantId(SecurityUtils.getTenantId());
+        return sysEngineeringMapper.selectSysEngineeringList(sysEngineering);
+    }
+
+    /**
+     * 新增工程部署
+     *
+     * @param sysEngineering 工程部署
+     * @return 结果
+     */
+    @Override
+    public int insertSysEngineering(SysEngineering sysEngineering) {
+        sysEngineering.setCreateTime(DateUtils.getNowDate());
+        return sysEngineeringMapper.insertSysEngineering(sysEngineering);
+    }
+
+    /**
+     * 修改工程部署
+     *
+     * @param sysEngineering 工程部署
+     * @return 结果
+     */
+    @Override
+    public int updateSysEngineering(SysEngineering sysEngineering) {
+        sysEngineering.setUpdateTime(DateUtils.getNowDate());
+        return sysEngineeringMapper.updateSysEngineering(sysEngineering);
+    }
+
+    /**
+     * 批量删除工程部署
+     *
+     * @param ids 需要删除的工程部署主键
+     * @return 结果
+     */
+    @Override
+    public int deleteSysEngineeringByIds(Long[] ids) {
+        return sysEngineeringMapper.deleteSysEngineeringByIds(ids);
+    }
+
+    /**
+     * 删除工程部署信息
+     *
+     * @param id 工程部署主键
+     * @return 结果
+     */
+    @Override
+    public int deleteSysEngineeringById(Long id) {
+        return sysEngineeringMapper.deleteSysEngineeringById(id);
+    }
+}

+ 21 - 14
zkqy-system/src/main/java/com/zkqy/system/service/impl/SysLogininforServiceImpl.java

@@ -1,6 +1,8 @@
 package com.zkqy.system.service.impl;
 
 import java.util.List;
+
+import com.zkqy.common.utils.SecurityUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.zkqy.system.domain.SysLogininfor;
@@ -9,48 +11,54 @@ import com.zkqy.system.service.ISysLogininforService;
 
 /**
  * 系统访问日志情况信息 服务层处理
- * 
+ *
  * @author ruoyi
  */
 @Service
-public class SysLogininforServiceImpl implements ISysLogininforService
-{
+public class SysLogininforServiceImpl implements ISysLogininforService {
 
     @Autowired
     private SysLogininforMapper logininforMapper;
 
     /**
      * 新增系统登录日志
-     * 
+     *
      * @param logininfor 访问日志对象
      */
     @Override
-    public void insertLogininfor(SysLogininfor logininfor)
-    {
+    public void insertLogininfor(SysLogininfor logininfor) {
         logininforMapper.insertLogininfor(logininfor);
     }
 
     /**
      * 查询系统登录日志集合
-     * 
+     *
      * @param logininfor 访问日志对象
      * @return 登录记录集合
      */
     @Override
-    public List<SysLogininfor> selectLogininforList(SysLogininfor logininfor)
-    {
+    public List<SysLogininfor> selectLogininforList(SysLogininfor logininfor) {
+        Long tenantId;
+        try {
+            tenantId = SecurityUtils.getTenantId();
+            if (tenantId == null) {
+                tenantId = 0L;
+            }
+        } catch (Exception exception) {
+            tenantId = 0L;  // 0L 表示当前是admin(租户信息表id自增「自增id不会从0开始」)
+        }
+        logininfor.setTenantId(tenantId);
         return logininforMapper.selectLogininforList(logininfor);
     }
 
     /**
      * 批量删除系统登录日志
-     * 
+     *
      * @param infoIds 需要删除的登录日志ID
      * @return 结果
      */
     @Override
-    public int deleteLogininforByIds(Long[] infoIds)
-    {
+    public int deleteLogininforByIds(Long[] infoIds) {
         return logininforMapper.deleteLogininforByIds(infoIds);
     }
 
@@ -58,8 +66,7 @@ public class SysLogininforServiceImpl implements ISysLogininforService
      * 清空系统登录日志
      */
     @Override
-    public void cleanLogininfor()
-    {
+    public void cleanLogininfor() {
         logininforMapper.cleanLogininfor();
     }
 }

+ 16 - 16
zkqy-system/src/main/java/com/zkqy/system/service/impl/SysMenuServiceImpl.java

@@ -79,19 +79,19 @@ public class SysMenuServiceImpl implements ISysMenuService {
         if (SysUser.isAdmin(userId)) {
             menuList = menuMapper.selectMenuList(menu);
         } else if (user.isTenantAdmin()) {
-            menuList = menuMapper.selectTenantMenuList(user.getTenantId());
+            menuList = menuMapper.selectTenantMenuList(menu,user.getTenantId());
         } else {
             menu.getParams().put("userId", userId);
             menuList = menuMapper.selectMenuListByUserId(menu);
         }
         //临时代码2
-        List<SysMenu> collect = menuList.stream().map(item -> {
-            if (item.getMenuName().equals("门户引擎")) {
-                 item.setMenuName("系统管理");
-            }
-            return item;
-        }).collect(Collectors.toList());
-        return collect;
+        //List<SysMenu> collect = menuList.stream().map(item -> {
+        //    if (item.getMenuName().equals("门户引擎")) {
+        //         item.setMenuName("系统管理");
+        //    }
+        //    return item;
+        //}).collect(Collectors.toList());
+        return menuList;
     }
 
     /**
@@ -174,10 +174,10 @@ public class SysMenuServiceImpl implements ISysMenuService {
     public List<RouterVo> buildMenus(List<SysMenu> menus) {
         List<RouterVo> routers = new LinkedList<RouterVo>();
         for (SysMenu menu : menus) {
-            //临时代码1
-            if(menu.getMenuName().equals("门户引擎")){
-                menu.setMenuName("系统管理");
-            }
+            ////临时代码1
+            //if(menu.getMenuName().equals("门户引擎")){
+            //    menu.setMenuName("系统管理");
+            //}
             RouterVo router = new RouterVo();
             router.setHidden("1".equals(menu.getVisible()));
             router.setName(getRouteName(menu));
@@ -264,10 +264,10 @@ public class SysMenuServiceImpl implements ISysMenuService {
     @Override
     public SysMenu selectMenuById(Long menuId) {
         SysMenu sysMenu = menuMapper.selectMenuById(menuId);
-        //临时代码3
-        if(sysMenu.getMenuName().equals("门户引擎")){
-            sysMenu.setMenuName("系统管理");
-        }
+        ////临时代码3
+        //if(sysMenu.getMenuName().equals("门户引擎")){
+        //    sysMenu.setMenuName("系统管理");
+        //}
         //return menuMapper.selectMenuById(menuId);
         return sysMenu;
     }

+ 99 - 135
zkqy-system/src/main/java/com/zkqy/system/service/impl/SysUserServiceImpl.java

@@ -5,6 +5,7 @@ import java.util.Arrays;
 import java.util.List;
 import java.util.stream.Collectors;
 import javax.validation.Validator;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -33,12 +34,11 @@ import com.zkqy.system.service.ISysUserService;
 
 /**
  * 用户 业务层处理
- * 
+ *
  * @author ruoyi
  */
 @Service
-public class SysUserServiceImpl implements ISysUserService
-{
+public class SysUserServiceImpl implements ISysUserService {
     private static final Logger log = LoggerFactory.getLogger(SysUserServiceImpl.class);
 
     @Autowired
@@ -64,79 +64,78 @@ public class SysUserServiceImpl implements ISysUserService
 
     /**
      * 根据条件分页查询用户列表
-     * 
+     *
      * @param user 用户信息
      * @return 用户信息集合信息
      */
     @Override
     @DataScope(deptAlias = "d", userAlias = "u")
-    public List<SysUser> selectUserList(SysUser user)
-    {
+    public List<SysUser> selectUserList(SysUser user) {
+        if (SecurityUtils.isAdmin(SecurityUtils.getUserId())) {
+            // 当前用户账号是admin权限,不做处理
+        } else {
+            // 导出当前租户下的数据
+            user.setTenantId(SecurityUtils.getTenantId());
+        }
         return userMapper.selectUserList(user);
     }
 
     /**
      * 根据条件分页查询已分配用户角色列表
-     * 
+     *
      * @param user 用户信息
      * @return 用户信息集合信息
      */
     @Override
     @DataScope(deptAlias = "d", userAlias = "u")
-    public List<SysUser> selectAllocatedList(SysUser user)
-    {
+    public List<SysUser> selectAllocatedList(SysUser user) {
         return userMapper.selectAllocatedList(user);
     }
 
     /**
      * 根据条件分页查询未分配用户角色列表
-     * 
+     *
      * @param user 用户信息
      * @return 用户信息集合信息
      */
     @Override
     @DataScope(deptAlias = "d", userAlias = "u")
-    public List<SysUser> selectUnallocatedList(SysUser user)
-    {
+    public List<SysUser> selectUnallocatedList(SysUser user) {
         return userMapper.selectUnallocatedList(user);
     }
 
     /**
      * 通过用户名查询用户
-     * 
+     *
      * @param userName 用户名
      * @return 用户对象信息
      */
     @Override
-    public SysUser selectUserByUserName(String userName)
-    {
+    public SysUser selectUserByUserName(String userName) {
         return userMapper.selectUserByUserName(userName);
     }
 
     /**
      * 通过用户ID查询用户
-     * 
+     *
      * @param userId 用户ID
      * @return 用户对象信息
      */
     @Override
-    public SysUser selectUserById(Long userId)
-    {
+    public SysUser selectUserById(Long userId) {
         return userMapper.selectUserById(userId);
     }
 
     /**
      * 查询用户所属角色组
-     * 
+     *
      * @param userName 用户名
      * @return 结果
      */
     @Override
-    public String selectUserRoleGroup(String userName)
-    {
+    public String selectUserRoleGroup(String userName) {
         List<SysRole> list = roleMapper.selectRolesByUserName(userName);
-        if (CollectionUtils.isEmpty(list))
-        {
+        if (CollectionUtils.isEmpty(list)) {
             return StringUtils.EMPTY;
         }
         return list.stream().map(SysRole::getRoleName).collect(Collectors.joining(","));
@@ -144,16 +143,14 @@ public class SysUserServiceImpl implements ISysUserService
 
     /**
      * 查询用户所属岗位组
-     * 
+     *
      * @param userName 用户名
      * @return 结果
      */
     @Override
-    public String selectUserPostGroup(String userName)
-    {
+    public String selectUserPostGroup(String userName) {
         List<SysPost> list = postMapper.selectPostsByUserName(userName);
-        if (CollectionUtils.isEmpty(list))
-        {
+        if (CollectionUtils.isEmpty(list)) {
             return StringUtils.EMPTY;
         }
         return list.stream().map(SysPost::getPostName).collect(Collectors.joining(","));
@@ -161,17 +158,15 @@ public class SysUserServiceImpl implements ISysUserService
 
     /**
      * 校验用户名称是否唯一
-     * 
+     *
      * @param user 用户信息
      * @return 结果
      */
     @Override
-    public boolean checkUserNameUnique(SysUser user)
-    {
+    public boolean checkUserNameUnique(SysUser user) {
         Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
         SysUser info = userMapper.checkUserNameUnique(user.getUserName());
-        if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue())
-        {
+        if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) {
             return UserConstants.NOT_UNIQUE;
         }
         return UserConstants.UNIQUE;
@@ -184,12 +179,10 @@ public class SysUserServiceImpl implements ISysUserService
      * @return
      */
     @Override
-    public boolean checkPhoneUnique(SysUser user)
-    {
+    public boolean checkPhoneUnique(SysUser user) {
         Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
         SysUser info = userMapper.checkPhoneUnique(user.getPhonenumber());
-        if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue())
-        {
+        if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) {
             return UserConstants.NOT_UNIQUE;
         }
         return UserConstants.UNIQUE;
@@ -202,12 +195,10 @@ public class SysUserServiceImpl implements ISysUserService
      * @return
      */
     @Override
-    public boolean checkEmailUnique(SysUser user)
-    {
+    public boolean checkEmailUnique(SysUser user) {
         Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
         SysUser info = userMapper.checkEmailUnique(user.getEmail());
-        if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue())
-        {
+        if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) {
             return UserConstants.NOT_UNIQUE;
         }
         return UserConstants.UNIQUE;
@@ -215,33 +206,28 @@ public class SysUserServiceImpl implements ISysUserService
 
     /**
      * 校验用户是否允许操作
-     * 
+     *
      * @param user 用户信息
      */
     @Override
-    public void checkUserAllowed(SysUser user)
-    {
-        if (StringUtils.isNotNull(user.getUserId()) && user.isAdmin())
-        {
+    public void checkUserAllowed(SysUser user) {
+        if (StringUtils.isNotNull(user.getUserId()) && user.isAdmin()) {
             throw new ServiceException("不允许操作超级管理员用户");
         }
     }
 
     /**
      * 校验用户是否有数据权限
-     * 
+     *
      * @param userId 用户id
      */
     @Override
-    public void checkUserDataScope(Long userId)
-    {
-        if (!SysUser.isAdmin(SecurityUtils.getUserId()))
-        {
+    public void checkUserDataScope(Long userId) {
+        if (!SysUser.isAdmin(SecurityUtils.getUserId())) {
             SysUser user = new SysUser();
             user.setUserId(userId);
             List<SysUser> users = SpringUtils.getAopProxy(this).selectUserList(user);
-            if (StringUtils.isEmpty(users))
-            {
+            if (StringUtils.isEmpty(users)) {
                 throw new ServiceException("没有权限访问用户数据!");
             }
         }
@@ -249,14 +235,13 @@ public class SysUserServiceImpl implements ISysUserService
 
     /**
      * 新增保存用户信息
-     * 
+     *
      * @param user 用户信息
      * @return 结果
      */
     @Override
     @Transactional
-    public int insertUser(SysUser user)
-    {
+    public int insertUser(SysUser user) {
         // 新增用户信息
         int rows = userMapper.insertUser(user);
         // 新增用户岗位关联
@@ -268,26 +253,24 @@ public class SysUserServiceImpl implements ISysUserService
 
     /**
      * 注册用户信息
-     * 
+     *
      * @param user 用户信息
      * @return 结果
      */
     @Override
-    public boolean registerUser(SysUser user)
-    {
+    public boolean registerUser(SysUser user) {
         return userMapper.insertUser(user) > 0;
     }
 
     /**
      * 修改保存用户信息
-     * 
+     *
      * @param user 用户信息
      * @return 结果
      */
     @Override
     @Transactional
-    public int updateUser(SysUser user)
-    {
+    public int updateUser(SysUser user) {
         Long userId = user.getUserId();
         // 删除用户与角色关联
         userRoleMapper.deleteUserRoleByUserId(userId);
@@ -302,104 +285,94 @@ public class SysUserServiceImpl implements ISysUserService
 
     /**
      * 用户授权角色
-     * 
-     * @param userId 用户ID
+     *
+     * @param userId  用户ID
      * @param roleIds 角色组
      */
     @Override
     @Transactional
-    public void insertUserAuth(Long userId, Long[] roleIds)
-    {
+    public void insertUserAuth(Long userId, Long[] roleIds) {
         userRoleMapper.deleteUserRoleByUserId(userId);
         insertUserRole(userId, roleIds);
     }
 
     /**
      * 修改用户状态
-     * 
+     *
      * @param user 用户信息
      * @return 结果
      */
     @Override
-    public int updateUserStatus(SysUser user)
-    {
+    public int updateUserStatus(SysUser user) {
         return userMapper.updateUser(user);
     }
 
     /**
      * 修改用户基本信息
-     * 
+     *
      * @param user 用户信息
      * @return 结果
      */
     @Override
-    public int updateUserProfile(SysUser user)
-    {
+    public int updateUserProfile(SysUser user) {
         return userMapper.updateUser(user);
     }
 
     /**
      * 修改用户头像
-     * 
+     *
      * @param userName 用户名
-     * @param avatar 头像地址
+     * @param avatar   头像地址
      * @return 结果
      */
     @Override
-    public boolean updateUserAvatar(String userName, String avatar)
-    {
+    public boolean updateUserAvatar(String userName, String avatar) {
         return userMapper.updateUserAvatar(userName, avatar) > 0;
     }
 
     /**
      * 重置用户密码
-     * 
+     *
      * @param user 用户信息
      * @return 结果
      */
     @Override
-    public int resetPwd(SysUser user)
-    {
+    public int resetPwd(SysUser user) {
         return userMapper.updateUser(user);
     }
 
     /**
      * 重置用户密码
-     * 
+     *
      * @param userName 用户名
      * @param password 密码
      * @return 结果
      */
     @Override
-    public int resetUserPwd(String userName, String password)
-    {
+    public int resetUserPwd(String userName, String password) {
         return userMapper.resetUserPwd(userName, password);
     }
 
     /**
      * 新增用户角色信息
-     * 
+     *
      * @param user 用户对象
      */
-    public void insertUserRole(SysUser user)
-    {
+    public void insertUserRole(SysUser user) {
         this.insertUserRole(user.getUserId(), user.getRoleIds());
     }
 
     /**
      * 新增用户岗位信息
-     * 
+     *
      * @param user 用户对象
      */
-    public void insertUserPost(SysUser user)
-    {
+    public void insertUserPost(SysUser user) {
         Long[] posts = user.getPostIds();
-        if (StringUtils.isNotEmpty(posts))
-        {
+        if (StringUtils.isNotEmpty(posts)) {
             // 新增用户与岗位管理
             List<SysUserPost> list = new ArrayList<SysUserPost>(posts.length);
-            for (Long postId : posts)
-            {
+            for (Long postId : posts) {
                 SysUserPost up = new SysUserPost();
                 up.setUserId(user.getUserId());
                 up.setPostId(postId);
@@ -411,18 +384,15 @@ public class SysUserServiceImpl implements ISysUserService
 
     /**
      * 新增用户角色信息
-     * 
-     * @param userId 用户ID
+     *
+     * @param userId  用户ID
      * @param roleIds 角色组
      */
-    public void insertUserRole(Long userId, Long[] roleIds)
-    {
-        if (StringUtils.isNotEmpty(roleIds))
-        {
+    public void insertUserRole(Long userId, Long[] roleIds) {
+        if (StringUtils.isNotEmpty(roleIds)) {
             // 新增用户与角色管理
             List<SysUserRole> list = new ArrayList<SysUserRole>(roleIds.length);
-            for (Long roleId : roleIds)
-            {
+            for (Long roleId : roleIds) {
                 SysUserRole ur = new SysUserRole();
                 ur.setUserId(userId);
                 ur.setRoleId(roleId);
@@ -434,14 +404,13 @@ public class SysUserServiceImpl implements ISysUserService
 
     /**
      * 通过用户ID删除用户
-     * 
+     *
      * @param userId 用户ID
      * @return 结果
      */
     @Override
     @Transactional
-    public int deleteUserById(Long userId)
-    {
+    public int deleteUserById(Long userId) {
         // 删除用户与角色关联
         userRoleMapper.deleteUserRoleByUserId(userId);
         // 删除用户与岗位表
@@ -451,16 +420,14 @@ public class SysUserServiceImpl implements ISysUserService
 
     /**
      * 批量删除用户信息
-     * 
+     *
      * @param userIds 需要删除的用户ID
      * @return 结果
      */
     @Override
     @Transactional
-    public int deleteUserByIds(Long[] userIds)
-    {
-        for (Long userId : userIds)
-        {
+    public int deleteUserByIds(Long[] userIds) {
+        for (Long userId : userIds) {
             checkUserAllowed(new SysUser(userId));
             checkUserDataScope(userId);
         }
@@ -473,17 +440,15 @@ public class SysUserServiceImpl implements ISysUserService
 
     /**
      * 导入用户数据
-     * 
-     * @param userList 用户数据列表
+     *
+     * @param userList        用户数据列表
      * @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据
-     * @param operName 操作用户
+     * @param operName        操作用户
      * @return 结果
      */
     @Override
-    public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName)
-    {
-        if (StringUtils.isNull(userList) || userList.size() == 0)
-        {
+    public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName) {
+        if (StringUtils.isNull(userList) || userList.size() == 0) {
             throw new ServiceException("导入用户数据不能为空!");
         }
         int successNum = 0;
@@ -491,23 +456,18 @@ public class SysUserServiceImpl implements ISysUserService
         StringBuilder successMsg = new StringBuilder();
         StringBuilder failureMsg = new StringBuilder();
         String password = configService.selectConfigByKey("sys.user.initPassword");
-        for (SysUser user : userList)
-        {
-            try
-            {
+        for (SysUser user : userList) {
+            try {
                 // 验证是否存在这个用户
                 SysUser u = userMapper.selectUserByUserName(user.getUserName());
-                if (StringUtils.isNull(u))
-                {
+                if (StringUtils.isNull(u)) {
                     BeanValidators.validateWithException(validator, user);
                     user.setPassword(SecurityUtils.encryptPassword(password));
                     user.setCreateBy(operName);
                     userMapper.insertUser(user);
                     successNum++;
                     successMsg.append("<br/>" + successNum + "、账号 " + user.getUserName() + " 导入成功");
-                }
-                else if (isUpdateSupport)
-                {
+                } else if (isUpdateSupport) {
                     BeanValidators.validateWithException(validator, user);
                     checkUserAllowed(u);
                     checkUserDataScope(u.getUserId());
@@ -516,28 +476,21 @@ public class SysUserServiceImpl implements ISysUserService
                     userMapper.updateUser(user);
                     successNum++;
                     successMsg.append("<br/>" + successNum + "、账号 " + user.getUserName() + " 更新成功");
-                }
-                else
-                {
+                } else {
                     failureNum++;
                     failureMsg.append("<br/>" + failureNum + "、账号 " + user.getUserName() + " 已存在");
                 }
-            }
-            catch (Exception e)
-            {
+            } catch (Exception e) {
                 failureNum++;
                 String msg = "<br/>" + failureNum + "、账号 " + user.getUserName() + " 导入失败:";
                 failureMsg.append(msg + e.getMessage());
                 log.error(msg, e);
             }
         }
-        if (failureNum > 0)
-        {
+        if (failureNum > 0) {
             failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
             throw new ServiceException(failureMsg.toString());
-        }
-        else
-        {
+        } else {
             successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
         }
         return successMsg.toString();
@@ -557,4 +510,15 @@ public class SysUserServiceImpl implements ISysUserService
         return userMapper.selectUserByUserIds(userIdsList);
     }
 
+    @Override
+    public boolean isExistUser(String userName) {
+        int count = userMapper.queryCountUserName(userName);
+        if (count == 0) {
+            return true;
+        } else if (count == 1) {
+            return false;
+        }
+        return false;
+    }
+
 }

+ 118 - 0
zkqy-system/src/main/resources/mapper/system/LoginPageConfigurationMapper.xml

@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.zkqy.system.mapper.LoginPageConfigurationMapper">
+    
+    <resultMap type="LoginPageConfiguration" id="LoginPageConfigurationResult">
+        <result property="id"    column="id"    />
+        <result property="loginPageNumber"    column="login_page_number"    />
+        <result property="loginPageTitle"    column="login_page_title"    />
+        <result property="loginPageDescription"    column="login_page_description"    />
+        <result property="loginPageLogo"    column="login_page_logo"    />
+        <result property="loginPageBackgroundImage"    column="login_page_background_image"    />
+        <result property="windowTitle"    column="window_title"    />
+        <result property="windowLogo"    column="window_logo"    />
+        <result property="tenantId"    column="tenant_id"    />
+        <result property="remark"    column="remark"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createById"    column="create_by_id"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateById"    column="update_by_id"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="delFlag"    column="del_flag"    />
+    </resultMap>
+
+    <sql id="selectLoginPageConfigurationVo">
+        select id, login_page_number, login_page_title, login_page_description, login_page_logo, login_page_background_image, window_title, window_logo, tenant_id, remark, create_by, create_by_id, create_time, update_by, update_by_id, update_time, del_flag from login_page_configuration
+    </sql>
+
+    <select id="selectLoginPageConfigurationList" parameterType="LoginPageConfiguration" resultMap="LoginPageConfigurationResult">
+        <include refid="selectLoginPageConfigurationVo"/>
+          where del_flag = '0'
+            <if test="loginPageNumber != null  and loginPageNumber != ''"> and login_page_number = #{loginPageNumber}</if>
+            <if test="loginPageTitle != null  and loginPageTitle != ''"> and login_page_title = #{loginPageTitle}</if>
+            <if test="loginPageDescription != null  and loginPageDescription != ''"> and login_page_description = #{loginPageDescription}</if>
+            <if test="loginPageLogo != null  and loginPageLogo != ''"> and login_page_logo = #{loginPageLogo}</if>
+            <if test="loginPageBackgroundImage != null  and loginPageBackgroundImage != ''"> and login_page_background_image = #{loginPageBackgroundImage}</if>
+            <if test="windowTitle != null  and windowTitle != ''"> and window_title = #{windowTitle}</if>
+            <if test="windowLogo != null  and windowLogo != ''"> and window_logo = #{windowLogo}</if>
+            <if test="tenantId != null "> and tenant_id = #{tenantId}</if>
+    </select>
+    
+    <select id="selectLoginPageConfigurationByTenantId" parameterType="Long" resultMap="LoginPageConfigurationResult">
+        <include refid="selectLoginPageConfigurationVo"/>
+        where tenant_id = #{tenantId}
+    </select>
+
+    <select id="selectLoginPageConfigurationByLoginPageNumber" parameterType="string" resultMap="LoginPageConfigurationResult">
+        <include refid="selectLoginPageConfigurationVo"/>
+        where login_page_number = #{loginPageNumber}
+    </select>
+        
+    <insert id="insertLoginPageConfiguration" parameterType="LoginPageConfiguration">
+        insert into login_page_configuration
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="loginPageNumber != null">login_page_number,</if>
+            <if test="loginPageTitle != null">login_page_title,</if>
+            <if test="loginPageDescription != null">login_page_description,</if>
+            <if test="loginPageLogo != null">login_page_logo,</if>
+            <if test="loginPageBackgroundImage != null">login_page_background_image,</if>
+            <if test="windowTitle != null">window_title,</if>
+            <if test="windowLogo != null">window_logo,</if>
+            <if test="tenantId != null">tenant_id,</if>
+            <if test="remark != null">remark,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createById != null">create_by_id,</if>
+            <if test="createTime != null">create_time,</if>
+            del_flag
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="loginPageNumber != null">#{loginPageNumber},</if>
+            <if test="loginPageTitle != null">#{loginPageTitle},</if>
+            <if test="loginPageDescription != null">#{loginPageDescription},</if>
+            <if test="loginPageLogo != null">#{loginPageLogo},</if>
+            <if test="loginPageBackgroundImage != null">#{loginPageBackgroundImage},</if>
+            <if test="windowTitle != null">#{windowTitle},</if>
+            <if test="windowLogo != null">#{windowLogo},</if>
+            <if test="tenantId != null">#{tenantId},</if>
+            <if test="remark != null">#{remark},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createById != null">#{createById},</if>
+            <if test="createTime != null">#{createTime},</if>
+            '0'
+         </trim>
+    </insert>
+
+    <update id="updateLoginPageConfiguration" parameterType="LoginPageConfiguration">
+        update login_page_configuration
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="loginPageNumber != null">login_page_number = #{loginPageNumber},</if>
+            <if test="loginPageTitle != null">login_page_title = #{loginPageTitle},</if>
+            <if test="loginPageDescription != null">login_page_description = #{loginPageDescription},</if>
+            <if test="loginPageLogo != null">login_page_logo = #{loginPageLogo},</if>
+            <if test="loginPageBackgroundImage != null">login_page_background_image = #{loginPageBackgroundImage},</if>
+            <if test="windowTitle != null">window_title = #{windowTitle},</if>
+            <if test="windowLogo != null">window_logo = #{windowLogo},</if>
+            <if test="tenantId != null">tenant_id = #{tenantId},</if>
+            <if test="remark != null">remark = #{remark},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateById != null">update_by_id = #{updateById},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteLoginPageConfigurationById" parameterType="Long">
+        update login_page_configuration set del_flag = '2' where id = #{id}
+    </delete>
+
+    <delete id="deleteLoginPageConfigurationByIds" parameterType="String">
+        update login_page_configuration set del_flag = '2' where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 1 - 1
zkqy-system/src/main/resources/mapper/system/SysBpmNodeScriptMapper.xml

@@ -99,7 +99,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectSysBpmNodeScriptByScriptKey" parameterType="String" resultMap="SysBpmNodeScriptResult">
         <include refid="selectSysBpmNodeScriptVo"/>
-        where script_key = #{scriptKey}
+        where script_key = #{scriptKey} and del_flag = '0'
     </select>
 
     <select id="selectSysBpmNodeScriptByScriptKeys"  resultMap="SysBpmNodeScriptResult">

+ 111 - 0
zkqy-system/src/main/resources/mapper/system/SysEngineeringMapper.xml

@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.zkqy.system.mapper.SysEngineeringMapper">
+    
+    <resultMap type="SysEngineering" id="SysEngineeringResult">
+        <result property="id"    column="id"    />
+        <result property="engineeringKey"    column="engineering_key"    />
+        <result property="engineeringName"    column="engineering_name"    />
+        <result property="downloadNumber"    column="download_number"    />
+        <result property="downloadTime"    column="download_time"    />
+        <result property="tenantId"    column="tenant_id" />
+        <result property="remark"    column="remark"    />
+        <result property="delFlag"    column="del_flag"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createById"    column="create_by_id"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateById"    column="update_by_id"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+
+    <sql id="selectSysEngineeringVo">
+        select id, engineering_key, engineering_name, download_number, download_time, tenant_id, remark, del_flag, create_by, create_by_id, create_time, update_by, update_by_id, update_time from sys_engineering
+    </sql>
+
+    <select id="selectSysEngineeringList" parameterType="SysEngineering" resultMap="SysEngineeringResult">
+        <include refid="selectSysEngineeringVo"/>
+        <where>  
+            <if test="engineeringKey != null  and engineeringKey != ''"> and engineering_key = #{engineeringKey}</if>
+            <if test="engineeringName != null  and engineeringName != ''"> and engineering_name like concat('%', #{engineeringName}, '%')</if>
+            <if test="downloadNumber != null "> and download_number = #{downloadNumber}</if>
+            <if test="downloadTime != null "> and download_time = #{downloadTime}</if>
+            <if test="tenantId != null "> and tenant_id = #{tenantId}</if>
+            <if test="createById != null "> and create_by_id = #{createById}</if>
+            <if test="updateById != null "> and update_by_id = #{updateById}</if>
+        </where>
+        order by download_time desc
+    </select>
+    
+    <select id="selectSysEngineeringById" parameterType="Long" resultMap="SysEngineeringResult">
+        <include refid="selectSysEngineeringVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertSysEngineering" parameterType="SysEngineering">
+        insert into sys_engineering
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="engineeringKey != null">engineering_key,</if>
+            <if test="engineeringName != null">engineering_name,</if>
+            <if test="downloadNumber != null">download_number,</if>
+            <if test="downloadTime != null">download_time,</if>
+            <if test="tenantId != null">tenant_id,</if>
+            <if test="remark != null">remark,</if>
+            <if test="delFlag != null">del_flag,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createById != null">create_by_id,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateById != null">update_by_id,</if>
+            <if test="updateTime != null">update_time,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="engineeringKey != null">#{engineeringKey},</if>
+            <if test="engineeringName != null">#{engineeringName},</if>
+            <if test="downloadNumber != null">#{downloadNumber},</if>
+            <if test="downloadTime != null">#{downloadTime},</if>
+            <if test="tenantId != null">#{tenantId},</if>
+            <if test="remark != null">#{remark},</if>
+            <if test="delFlag != null">#{delFlag},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createById != null">#{createById},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateById != null">#{updateById},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+         </trim>
+    </insert>
+
+    <update id="updateSysEngineering" parameterType="SysEngineering">
+        update sys_engineering
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="engineeringKey != null">engineering_key = #{engineeringKey},</if>
+            <if test="engineeringName != null">engineering_name = #{engineeringName},</if>
+            <if test="downloadNumber != null">download_number = #{downloadNumber},</if>
+            <if test="downloadTime != null">download_time = #{downloadTime},</if>
+            <if test="tenantId != null">tenant_id = #{tenantId},</if>
+            <if test="remark != null">remark = #{remark},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createById != null">create_by_id = #{createById},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateById != null">update_by_id = #{updateById},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteSysEngineeringById" parameterType="Long">
+        delete from sys_engineering where id = #{id}
+    </delete>
+
+    <delete id="deleteSysEngineeringByIds" parameterType="String">
+        delete from sys_engineering where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

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