From 907641e56c2085aaa81f267946dc3e3e9fca73e7 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期三, 18 九月 2024 09:39:02 +0800
Subject: [PATCH] 代码提交

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceTaskController.java |   48 ++++++++++++++++++++++++++++++++----------------
 1 files changed, 32 insertions(+), 16 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..3e4d7dc 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,11 +51,14 @@
     @Value("${pri_key}")
     private String pri_key;
 
+    @Autowired
+    private RSAPublicKeyExample rsaPublicKeyExample;
+
     /**
      * 鏌ヨ璇煶浠诲姟鍒楄〃
      */
     @ApiOperation("鏌ヨ浠诲姟鍒楄〃")
-    @PreAuthorize("@ss.hasPermi('smartor:ServiceTask:list')")
+    //@PreAuthorize("@ss.hasPermi('smartor:ServiceTask:list')")
     @PostMapping("/list")
     public TableDataInfo list(@RequestBody ServiceTask serviceTask) {
         PageUtils.startPageByPost(serviceTask.getPageNum(), serviceTask.getPageSize());
@@ -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)) {
@@ -94,7 +99,7 @@
      * 瀵煎嚭浠诲姟鍒楄〃
      */
     @ApiOperation("瀵煎嚭浠诲姟鍒楄〃")
-    @PreAuthorize("@ss.hasPermi('smartor:ServiceTask:export')")
+    //@PreAuthorize("@ss.hasPermi('smartor:ServiceTask:export')")
     @Log(title = "璇煶浠诲姟", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
     public void export(HttpServletResponse response, ServiceTask ServiceTask) {
@@ -107,7 +112,7 @@
      * 鑾峰彇浠诲姟璇︾粏淇℃伅
      */
     @ApiOperation("鑾峰彇浠诲姟璇︾粏淇℃伅")
-    @PreAuthorize("@ss.hasPermi('smartor:ServiceTask:query')")
+    //@PreAuthorize("@ss.hasPermi('smartor:ServiceTask:query')")
     @GetMapping(value = "/{taskid}")
     public AjaxResult getInfo(@PathVariable("taskid") Long taskid) {
         return success(serviceTaskService.selectServiceTaskByTaskid(taskid));
@@ -117,7 +122,7 @@
      * 鏂板浠诲姟
      */
     @ApiOperation("鏂板浠诲姟")
-    @PreAuthorize("@ss.hasPermi('smartor:ServiceTask:add')")
+    //@PreAuthorize("@ss.hasPermi('smartor:ServiceTask:add')")
     @Log(title = "璇煶浠诲姟", businessType = BusinessType.INSERT)
     @PostMapping("/add")
     public AjaxResult add(@RequestBody ServiceTask ServiceTask) {
@@ -128,7 +133,7 @@
      * 淇敼璇煶浠诲姟
      */
     @ApiOperation("淇敼浠诲姟")
-    @PreAuthorize("@ss.hasPermi('smartor:ServiceTask:edit')")
+    //@PreAuthorize("@ss.hasPermi('smartor:ServiceTask:edit')")
     @Log(title = "浠诲姟", businessType = BusinessType.UPDATE)
     @PostMapping("/edit")
     public AjaxResult edit(@RequestBody ServiceTask ServiceTask) {
@@ -139,7 +144,7 @@
 //     * 鍒犻櫎璇煶浠诲姟
 //     */
 //    @ApiOperation("鍒犻櫎浠诲姟")
-//    @PreAuthorize("@ss.hasPermi('smartor:ServiceTask:remove')")
+//    //@PreAuthorize("@ss.hasPermi('smartor:ServiceTask:remove')")
 //    @Log(title = "璇煶浠诲姟", businessType = BusinessType.DELETE)
 //    @GetMapping("/remove/{taskids}")
 //    public AjaxResult remove(@PathVariable Long[] taskids) {
@@ -151,11 +156,15 @@
      * 鍒犻櫎浠诲姟(鍖呮嫭瀹冨搴旂殑鎮h�呬俊鎭�)
      */
     @ApiOperation("鍒犻櫎浠诲姟(鍖呮嫭瀹冨搴旂殑鎮h�呬俊鎭�)")
-    @PreAuthorize("@ss.hasPermi('smartor:ServiceTask:remove')")
+    //@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,19 @@
      */
     @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(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