侯茂昌 1 éve
szülő
commit
022b23a1bd

+ 2 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/BpmProcessConfigurationController.java

@@ -4,6 +4,7 @@ import java.util.List;
 import javax.servlet.http.HttpServletResponse;
 
 import com.ruoyi.common.annotation.Anonymous;
+import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.system.entity.vo.NodeVo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -119,7 +120,7 @@ public class BpmProcessConfigurationController extends BaseController {
     }
 
     /**
-     * 新增流程配置信息
+     * 修改流程配置信息
      */
     @Log(title = "流程节点配置", businessType = BusinessType.INSERT)
     @PutMapping("/updateProcessNodeConfiguration")

+ 1 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/BpmProcessController.java

@@ -92,12 +92,11 @@ public class BpmProcessController extends BaseController {
     /**
      * 修改流程定义
      */
-//    @PreAuthorize("@ss.hasPermi('system:process:edit')")
+//  @PreAuthorize("@ss.hasPermi('system:process:edit')")
     @Log(title = "流程定义", businessType = BusinessType.UPDATE)
     @PutMapping
     @ApiOperation(value = "修改流程定义")
     public AjaxResult edit(BpmProcess bpmProcess, @RequestParam("fileXML") MultipartFile fileXML) {
-        System.err.println(bpmProcess.toString());
         return toAjax(bpmProcessService.updateBpmProcess(bpmProcess, fileXML));
     }
 

+ 9 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/DataSourceController.java

@@ -3,8 +3,10 @@ package com.ruoyi.web.controller.system;
 
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.domain.entity.DataSource;
+import com.ruoyi.common.utils.BpmUtils;
 import com.ruoyi.system.entity.TableInfo;
 import com.ruoyi.system.service.IDataSourceService;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
@@ -46,4 +48,11 @@ public class DataSourceController {
         return dataSourceService.tableFieldInfo(map);
     }
 
+    @Autowired
+    BpmUtils bpmUtils;
+
+    @GetMapping("/a")
+    public String[] queryTableInfo() {
+        return  bpmUtils.getRoleKeyByUserId(1L);
+    }
 }

+ 7 - 6
ruoyi-common/pom.xml

@@ -156,12 +156,13 @@
             <groupId>javax.servlet</groupId>
             <artifactId>javax.servlet-api</artifactId>
         </dependency>
-        <dependency>
-            <groupId>com.alibaba</groupId>
-            <artifactId>druid</artifactId>
-            <version>1.2.15</version>
-            <scope>compile</scope>
-        </dependency>
+
+        <!--<dependency>-->
+        <!--    <groupId>com.alibaba</groupId>-->
+        <!--    <artifactId>druid</artifactId>-->
+        <!--    <version>1.2.15</version>-->
+        <!--    <scope>compile</scope>-->
+        <!--</dependency>-->
         <dependency>
             <groupId>org.springframework</groupId>
             <artifactId>spring-webmvc</artifactId>

+ 24 - 0
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java

@@ -15,12 +15,17 @@ import com.fasterxml.jackson.annotation.JsonInclude;
  */
 public class BaseEntity implements Serializable
 {
+
+
     private static final long serialVersionUID = 1L;
 
     /** 搜索值 */
     @JsonIgnore
     private String searchValue;
 
+    /** 创建者Id*/
+    private Long createById;
+
     /** 创建者 */
     private String createBy;
 
@@ -28,6 +33,9 @@ public class BaseEntity implements Serializable
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date createTime;
 
+    /** 修改者Id */
+    private Long updateById;
+
     /** 更新者 */
     private String updateBy;
 
@@ -102,6 +110,22 @@ public class BaseEntity implements Serializable
         this.remark = remark;
     }
 
+    public Long getCreateById() {
+        return createById;
+    }
+
+    public void setCreateById(Long createById) {
+        this.createById = createById;
+    }
+
+    public Long getUpdateById() {
+        return updateById;
+    }
+
+    public void setUpdateById(Long updateById) {
+        this.updateById = updateById;
+    }
+
     public Map<String, Object> getParams()
     {
         if (params == null)

+ 41 - 0
ruoyi-common/src/main/java/com/ruoyi/common/utils/BpmUtils.java

@@ -0,0 +1,41 @@
+package com.ruoyi.common.utils;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONArray;
+import com.alibaba.fastjson2.JSONObject;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+import org.springframework.web.client.RestTemplate;
+
+import java.sql.Array;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author lucky
+ * @date 2023-11-02 15:29
+ * @Description:
+ */
+@Component
+public class BpmUtils {
+
+
+    // 查询字典中的基础库模版信息
+    @Value("${parameter.ip.MAIN_ROLESKEY_IP}")
+    private String rolesKeyId;
+
+    /**
+     * 根据用户查询角色key
+     * @param userId
+     * @return
+     */
+    public String[]  getRoleKeyByUserId(Long userId){
+        RestTemplate restTemplate = new RestTemplate();
+        String ret = restTemplate.getForObject(rolesKeyId+userId,String.class);
+        JSONObject jsonObject = JSONObject.parseObject(ret);
+        String s = (String) jsonObject.get("rolesKey");
+        String[] strings = JSONObject.parseObject(s, String[].class);
+        return  strings;
+    }
+}

+ 2 - 2
ruoyi-system/pom.xml

@@ -13,8 +13,8 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-compiler-plugin</artifactId>
                 <configuration>
-                    <source>9</source>
-                    <target>9</target>
+                    <source>1.8</source>
+                    <target>1.8</target>
                 </configuration>
             </plugin>
         </plugins>

+ 5 - 0
ruoyi-system/src/main/java/com/ruoyi/system/entity/BpmProcess.java

@@ -102,6 +102,11 @@ public class BpmProcess extends BaseEntity {
      */
     private String delFlag;
 
+    ///**
+    // *
+    // */
+    //private String delFlag;
+
     /**
      * 回传的xml流文件
      */

+ 2 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BpmProcessServiceImpl.java

@@ -95,6 +95,7 @@ public class BpmProcessServiceImpl implements IBpmProcessService {
         }
         bpmProcess.setProcessXmlPath(filePath);
         bpmProcess.setCreateTime(DateUtils.getNowDate());
+        bpmProcess.setCreateById(SecurityUtils.getUserId());
         bpmProcess.setCreateBy(SecurityUtils.getUsername());
         bpmProcess.setProcessVersion(0L);
         bpmProcess.setProcessType(0L);
@@ -129,6 +130,7 @@ public class BpmProcessServiceImpl implements IBpmProcessService {
         bpmProcess.setProcessXmlPath(filePath);
         bpmProcess.setUpdateTime(DateUtils.getNowDate());
         bpmProcess.setUpdateBy(SecurityUtils.getUsername());
+        bpmProcess.setUpdateById(SecurityUtils.getUserId());
         return bpmProcessMapper.updateBpmProcess(bpmProcess);
     }
 

+ 7 - 4
ruoyi-system/src/main/resources/mapper/BpmProcessConfigurationMapper.xml

@@ -73,14 +73,15 @@
         node_key, node_form_key, node_process_key,
         node_type, node_before, node_after,
         node_role_permission, spare1, spare2,
-        spare3, del_flag, create_by,
-        create_time, remark )
+        spare3, del_flag, create_by_id,create_by,
+        create_time,update_by_id,update_by,update_time, remark)
         values
         <foreach collection="list" item="item" index="index" separator=",">
             (#{item.nodeKey}, #{item.nodeFormKey}, #{item.nodeProcessKey}, #{item.nodeType}, #{item.nodeBefore},
             #{item.nodeAfter},
-            #{item.nodeRolePermission}, #{item.spare1}, #{item.spare2}, #{item.spare3}, '0', #{item.createBy},
-            #{item.createTime},#{item.remark})
+            #{item.nodeRolePermission}, #{item.spare1}, #{item.spare2}, #{item.spare3}, '0',#{item.createById},#{item.createBy},
+            #{item.createTime},#{item.updateById},#{item.updateBy},
+            #{item.updateTime},#{item.remark})
         </foreach>
     </insert>
 <!--    &#45;&#45;         <foreach collection="list" item="item" index="index" separator=";">-->
@@ -98,8 +99,10 @@
             <if test="spare2 != null">spare2 = #{spare2},</if>
             <if test="spare3 != null">spare3 = #{spare3},</if>
             <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="createById != null">create_by_id = #{createById},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateById != null">update_by_id = #{updateById},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="remark != null">remark = #{remark},</if>

+ 5 - 1
ruoyi-system/src/main/resources/mapper/BpmProcessMapper.xml

@@ -53,7 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
         order by create_time desc
     </select>
-    
+
     <select id="selectBpmProcessByProcessId" parameterType="Long" resultMap="BpmProcessResult">
         <include refid="selectBpmProcessVo"/>
         where process_id = #{processId}
@@ -74,6 +74,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="processJson != null">process_json,</if>
             <if test="processXmlContent != null">process_xml_content,</if>
             <if test="processXmlPath != null">process_xml_path,</if>
+            <if test="createById != null">create_by_id,</if>
             <if test="createBy != null">create_by,</if>
             <if test="createTime != null">create_time,</if>
             <if test="updateBy != null">update_by,</if>
@@ -94,6 +95,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="processJson != null">#{processJson},</if>
             <if test="processXmlContent != null">#{processXmlContent},</if>
             <if test="processXmlPath != null">#{processXmlPath},</if>
+            <if test="createById != null">#{createById},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="updateBy != null">#{updateBy},</if>
@@ -118,8 +120,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="processJson != null">process_json = #{processJson},</if>
             <if test="processXmlContent != null">process_xml_content = #{processXmlContent},</if>
             <if test="processXmlPath != null">process_xml_path = #{processXmlPath},</if>
+            <if test="createById != null">create_by_id= #{createById},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateById != null">update_by_id= #{updateById},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="delFlag != null">del_flag = #{delFlag},</if>