Browse Source

fix:修改批量删除接口,新增下发接口工具类,执行流程排产、触发脚本方法

xuezizhuo 1 year ago
parent
commit
222bf3e0cf

+ 31 - 0
ruoyi-common/src/main/java/com/ruoyi/common/config/form/FormProperties.java

@@ -0,0 +1,31 @@
+package com.ruoyi.common.config.form;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
+public class FormProperties {
+
+    //开启流程
+    @Value("${bpm.runbpmurl}")
+    public String runBpmIp;
+
+    @Value("${script.runscripturl}")
+    public String runScriptIp;
+
+    public String getRunBpmIp() {
+        return runBpmIp;
+    }
+
+    public void setRunBpmIp(String runBpmIp) {
+        this.runBpmIp = runBpmIp;
+    }
+
+    public String getRunScriptIp() {
+        return runScriptIp;
+    }
+
+    public void setRunScriptIp(String runScriptIp) {
+        this.runScriptIp = runScriptIp;
+    }
+}

+ 33 - 0
ruoyi-common/src/main/java/com/ruoyi/common/utils/form/FromUtils.java

@@ -0,0 +1,33 @@
+package com.ruoyi.common.utils.form;
+
+import com.ruoyi.common.config.form.FormProperties;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.web.client.RestTemplate;
+
+import java.util.Map;
+
+@Component
+public class FromUtils<T> {
+
+    @Autowired
+    private FormProperties formProperties;
+
+    RestTemplate restTemplate = new RestTemplate();
+
+    /**
+     * 执行流程排产
+     */
+    public String runBpmProductionScheduling(T param) {
+        String data = restTemplate.postForObject(formProperties.runBpmIp, param, String.class);
+        return data;
+    }
+
+    /**
+     * 触发脚本
+     */
+    public String triggerScript(T param) {
+        String data = restTemplate.postForObject(formProperties.runScriptIp,param,String.class);
+        return data;
+    }
+}

+ 2 - 2
ruoyi-system/src/main/java/com/ruoyi/system/mapper/DragTableBtnMapper.java

@@ -55,10 +55,10 @@ public interface DragTableBtnMapper
     /**
      * 批量删除格绑定的自定义按钮
      * 
-     * @param btnTableKeys 需要删除的数据主键集合
+     * @param btnKeys 需要删除的数据主键集合
      * @return 结果
      */
-    int batchDeleteDragTableBtnByTableKey(List<String> btnTableKeys);
+    int batchDeleteDragTableBtnByBtnKeys(List<String> btnKeys);
 
     /**
      * 查询动态表格绑定的自定义按钮

+ 2 - 2
ruoyi-system/src/main/java/com/ruoyi/system/service/IDragTableBtnService.java

@@ -47,10 +47,10 @@ public interface IDragTableBtnService
     /**
      * 批量删除格绑定的自定义按钮
      * 
-     * @param btnTableKeys 需要删除的格绑定的自定义按钮主键集合
+     * @param btnKeys 需要删除的格绑定的自定义按钮主键集合
      * @return 结果
      */
-    int batchDeleteDragTableBtnByTableKey(List<String> btnTableKeys);
+    int batchDeleteDragTableBtnByBtnKeys(List<String> btnKeys);
 
     /**
      * 删除格绑定的自定义按钮信息

+ 3 - 3
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/DragTableBtnServiceImpl.java

@@ -137,13 +137,13 @@ public class DragTableBtnServiceImpl implements IDragTableBtnService
     /**
      * 批量删除格绑定的自定义按钮
      * 
-     * @param btnTableKeys 需要删除的格绑定的自定义按钮主键
+     * @param btnKeys 需要删除的格绑定的自定义按钮主键
      * @return 结果
      */
     @Override
-    public int batchDeleteDragTableBtnByTableKey(List<String> btnTableKeys)
+    public int batchDeleteDragTableBtnByBtnKeys(List<String> btnKeys)
     {
-        return dragTableBtnMapper.batchDeleteDragTableBtnByTableKey(btnTableKeys);
+        return dragTableBtnMapper.batchDeleteDragTableBtnByBtnKeys(btnKeys);
     }
 
     /**

+ 4 - 4
ruoyi-system/src/main/resources/mapper/dragmapper/DragTableBtnMapper.xml

@@ -139,10 +139,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         update drag_table_btn set del_flag = '2' where id = #{id}
     </update>
 
-    <update id="batchDeleteDragTableBtnByTableKey" parameterType="String">
-        update drag_table_btn set del_flag = '2' where btn_table_key in
-        <foreach item="btnTableKey" collection="list" open="(" separator="," close=")">
-            #{btnTableKey}
+    <update id="batchDeleteDragTableBtnByBtnKeys" parameterType="String">
+        update drag_table_btn set del_flag = '2' where btn_key in
+        <foreach item="btnKey" collection="list" open="(" separator="," close=")">
+            #{btnKey}
         </foreach>
     </update>