From 67c6b3ec9f9a916e5f39a1c0b14499e66f78c982 Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期二, 23 六月 2026 17:54:36 +0800
Subject: [PATCH] 【市一】外链开放机构号生成

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceOutPathController.java |   35 ++++++++++++++++++++++++-----------
 1 files changed, 24 insertions(+), 11 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceOutPathController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceOutPathController.java
index d2f4df2..5a91def 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceOutPathController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceOutPathController.java
@@ -7,11 +7,14 @@
 import com.ruoyi.common.core.domain.entity.SysUser;
 import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.smartor.domain.BaseOrganization;
 import com.smartor.domain.ServiceOutPath;
+import com.smartor.domain.ServiceTask;
 import com.smartor.service.IBaseOrganizationService;
 import com.smartor.service.IServiceOutPathService;
+import com.smartor.service.IServiceTaskService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.apache.commons.collections4.CollectionUtils;
@@ -33,6 +36,9 @@
 public class ServiceOutPathController extends BaseController {
     @Autowired
     private IServiceOutPathService serviceOutPathService;
+
+    @Autowired
+    private IServiceTaskService serviceTaskService;
 
     @Autowired
     private IBaseOrganizationService baseOrganizationService;
@@ -57,15 +63,6 @@
      */
     @PostMapping("/getInfoByParam")
     public AjaxResult param(@Param("param") String param) {
-        SysUser user = getLoginUser().getUser();
-        String orgname = "";
-        String orgid = user.getOrgid();
-        if(orgid != null && !"".equals(orgid)){
-            BaseOrganization baseOrganization = new BaseOrganization();
-            List<BaseOrganization> orgids = baseOrganizationService.selectBaseOrganizationList(baseOrganization);
-            orgname = orgids.get(0).getOrganizationName();
-        }
-
         ServiceOutPath serviceOutPath = new ServiceOutPath();
         serviceOutPath.setRadix(param);
         List<ServiceOutPath> list = serviceOutPathService.selectServiceOutPathList(serviceOutPath);
@@ -73,8 +70,24 @@
             ServiceOutPath serviceOutPath1 = list.get(0);
             serviceOutPath1.setId(null);
             serviceOutPath1.setRadix(null);
-            serviceOutPath1.setOrgid(orgid);
-            serviceOutPath1.setOrgname(orgname);
+            //鏍规嵁taskid鑾峰彇鏈烘瀯淇℃伅
+            if(StringUtils.isNotEmpty(serviceOutPath1.getParam1())){
+                String taskId = serviceOutPath1.getParam1();
+                if(StringUtils.isNotEmpty(taskId)){
+                    ServiceTask serviceTask = serviceTaskService.selectServiceTaskByTaskid(Long.valueOf(taskId));
+                    String orgId = serviceTask.getOrgid();
+                    if(StringUtils.isNotEmpty(orgId)){
+                        BaseOrganization baseOrganization = new BaseOrganization();
+                        baseOrganization.setOrgid(orgId);
+                        List<BaseOrganization> orgs = baseOrganizationService.selectBaseOrganizationList(baseOrganization);
+                        if(CollectionUtils.isNotEmpty(orgs)){
+                            String orgname = orgs.get(0).getOrganizationName();
+                            serviceOutPath1.setOrgid(orgId);
+                            serviceOutPath1.setOrgname(orgname);
+                        }
+                    }
+                }
+            }
             return success(serviceOutPath1);
         }
         return success(null);

--
Gitblit v1.9.3