Browse Source

修改远程调用

luojun 2 years ago
parent
commit
d1102f7ce1

+ 2 - 1
soc-api/soc-api-system/src/main/java/com/xunmei/system/api/RemoteOrgService.java

@@ -7,6 +7,7 @@ import com.xunmei.system.api.domain.Org;
 import com.xunmei.system.api.domain.SysOrg;
 import com.xunmei.system.api.factory.RemoteOrgFallbackFactory;
 import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.cloud.openfeign.SpringQueryMap;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
@@ -32,7 +33,7 @@ public interface RemoteOrgService {
     public R<List<SysOrg>> listByIds(List<Long> ids, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
 
     @GetMapping("/dept/findListByOrgType")
-    public R<List<Long>> findListByOrgType(Integer execOrgType, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
+    public R<List<Long>> findListByOrgType( @RequestParam("execOrgType") Integer execOrgType, @RequestHeader(SecurityConstants.FROM_SOURCE)String source);
 
     @PostMapping("/org/sync/batch")
     R<Boolean> batchSaveSyncOrg(@RequestBody List<SysOrg> orgList, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

+ 14 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/controller/ApiPlanController.java

@@ -1,12 +1,15 @@
 package com.xunmei.core.resumption.controller;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.xunmei.common.core.constant.SecurityConstants;
+import com.xunmei.common.core.domain.R;
 import com.xunmei.common.core.web.domain.AjaxResult;
 import com.xunmei.core.resumption.domain.AppPlan;
 import com.xunmei.core.resumption.service.AppPlanService;
 import com.xunmei.core.resumption.vo.appPlan.AppPlanVo;
 import com.xunmei.core.resumption.vo.appPlan.RuleItemVo;
 import com.xunmei.core.resumption.vo.appPlan.RuleRequestVo;
+import com.xunmei.system.api.RemoteOrgService;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -28,7 +31,8 @@ public class ApiPlanController {
 
     @Autowired
     private AppPlanService appPlanService;
-
+    @Autowired
+    private RemoteOrgService remoteOrgService;
 
 //    @Autowired
 //    ResumptionTaskBusiness taskBusiness;
@@ -43,6 +47,15 @@ public class ApiPlanController {
         Page<AppPlan> result = appPlanService.selectPage(info);
         return AjaxResult.success(result);
     }
+    @RequestMapping("/test")
+    public AjaxResult test(Integer type){
+        R<List<Long>> res = remoteOrgService.findListByOrgType(type, SecurityConstants.INNER);
+        List<Long> list=null;
+        if (res.getCode()==200) {
+            list = res.getData();
+        }
+        return AjaxResult.success(list);
+    }
 
     /**
      * 检查要点分页查询

+ 2 - 2
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/controller/SysDeptController.java

@@ -158,7 +158,7 @@ public class SysDeptController extends BaseController {
     }
 
     @GetMapping("/findListByOrgType")
-    public List<Long> findListByOrgType(Integer execOrgType) {
-        return orgService.findListByOrgType(execOrgType);
+    public R<List<Long>> findListByOrgType(Integer execOrgType) {
+        return R.ok(orgService.findListByOrgType(execOrgType));
     }
 }

+ 1 - 1
soc-modules/soc-modules-system/src/main/resources/mapper/system/SysOrgMapper.xml

@@ -157,7 +157,7 @@
           and deleted = 0
     </select>
     <select id="findListByOrgType" resultType="java.lang.Long">
-        select a.id from sys_org a where a.type = #{execOrgType} and a.deleted=0 and a.is_lock=0 and a.temporarily_closed=0
+        select a.id from sys_org a where a.type = #{execOrgType} and a.deleted=0 and a.is_lock=0
 
     </select>
     <insert id="insertSysOrg" parameterType="com.xunmei.system.api.domain.SysOrg"            useGeneratedKeys="true" keyProperty="id">