From 9526971c403417c1c007804f24884c443b9e6cd7 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期三, 04 九月 2024 00:34:40 +0800
Subject: [PATCH] 代码提交

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceTaskController.java |   36 +++++++++++++++++++++++++++---------
 1 files changed, 27 insertions(+), 9 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceTaskController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceTaskController.java
index 8a872c2..f3b4d20 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceTaskController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceTaskController.java
@@ -9,6 +9,7 @@
 import com.ruoyi.common.utils.DtoConversionUtils;
 import com.ruoyi.common.utils.PageUtils;
 import com.ruoyi.common.utils.RSAPublicKeyExample;
+import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.smartor.domain.*;
 import com.smartor.service.IServiceSubtaskService;
@@ -23,6 +24,7 @@
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
+import java.net.URLDecoder;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -49,6 +51,9 @@
     @Value("${pri_key}")
     private String pri_key;
 
+    @Autowired
+    private RSAPublicKeyExample rsaPublicKeyExample;
+
     /**
      * 鏌ヨ璇煶浠诲姟鍒楄〃
      */
@@ -62,7 +67,7 @@
 
         if (CollectionUtils.isNotEmpty(serviceTaskVOS)) {
             for (ServiceTaskVO ServiceTaskVO : serviceTaskVOS) {
-                ServiceSubtask ServiceTaskcall = new ServiceSubtask();
+                ServiceSubtaskVO ServiceTaskcall = new ServiceSubtaskVO();
                 ServiceTaskcall.setTaskid(ServiceTaskVO.getTaskid());
                 List<ServiceSubtask> ServiceTaskcalls = iServiceTaskCallService.selectServiceSubtaskList(ServiceTaskcall);
                 if (CollectionUtils.isNotEmpty(ServiceTaskcalls)) {
@@ -153,9 +158,13 @@
     @ApiOperation("鍒犻櫎浠诲姟(鍖呮嫭瀹冨搴旂殑鎮h�呬俊鎭�)")
     @PreAuthorize("@ss.hasPermi('smartor:ServiceTask:remove')")
     @Log(title = "璇煶浠诲姟", businessType = BusinessType.DELETE)
-    @GetMapping("/remove/{removeTask}")
-    public AjaxResult removeTask(@PathVariable Long taskId) {
-        return toAjax(serviceTaskService.deleteServiceTaskByTaskid(taskId));
+    @GetMapping("/remove/{taskId}")
+    public AjaxResult removeTask(@PathVariable("taskId") String taskId) {
+        if (StringUtils.isEmpty(taskId)) {
+            AjaxResult.error("鍏ュ弬涓嶈兘涓虹┖");
+        }
+        Long tid = Long.valueOf(taskId);
+        return toAjax(serviceTaskService.deleteServiceTaskByTaskid(tid));
     }
 
     /**
@@ -165,12 +174,21 @@
      */
     @ApiOperation("閫氳繃浠诲姟ID鍜屾偅鑰匢D鑾峰彇鍗曚釜浜虹殑棰樼洰淇℃伅")
     @PostMapping("/getScriptInfoByCondition")
-    public TableDataInfo getScriptInfoByCondition(@RequestBody ServiceTaskScriptQues serviceTaskScriptQues) {
-        RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample();
-        Long tid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceTaskScriptQues.getParam1(), pri_key));
-        Long pid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceTaskScriptQues.getParam2(), pri_key));
+    public AjaxResult getScriptInfoByCondition(@RequestBody ServiceTaskScriptQues serviceTaskScriptQues) {
+        Long tid = null;
+        Long pid = null;
+        log.info("getScriptInfoByCondition鍏ュ弬涓猴細{}", serviceTaskScriptQues);
+        try {
+//            tid = Long.valueOf(rsaPublicKeyExample.decryptedData(URLDecoder.decode(serviceTaskScriptQues.getParam1(), "UTF-8"), pri_key));
+//            pid = Long.valueOf(rsaPublicKeyExample.decryptedData(URLDecoder.decode(serviceTaskScriptQues.getParam2(), "UTF-8"), pri_key));
+            tid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceTaskScriptQues.getParam1(), pri_key));
+            pid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceTaskScriptQues.getParam2(), pri_key));
+        } catch (Exception e) {
+            log.error("getScriptInfoByCondition鎶ラ敊浜嗭細{}", e.getMessage());
+        }
+
         log.info("tid鍜宲id鐨勫�间负锛歿},{}", tid, pid);
-        return getDataTable(serviceTaskService.getScriptInfoByCondition(tid, pid));
+        return success(serviceTaskService.getScriptInfoByCondition(tid, pid));
     }
 
 }

--
Gitblit v1.9.3