jingyuanchao 2 роки тому
батько
коміт
355d69f282

+ 3 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/edu/service/impl/CoreEduTrainingPlanServiceImpl.java

@@ -433,6 +433,9 @@ public class CoreEduTrainingPlanServiceImpl extends ServiceImpl<CoreEduTrainingP
 
         //获取所有行社机构
         List<SysOrg> executeOrg = this.getExecuteOrg(plan);
+        if (ObjectUtil.isEmpty(executeOrg)){
+            throw new RuntimeException("未能查询到行社数据!");
+        }
 
         List<CoreEduTrainingPlan> list = new ArrayList<>();
         for (SysOrg sysOrg : executeOrg) {

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

@@ -234,7 +234,7 @@ public class SysDeptController extends BaseController {
     }
     @ApiOperation(value = "获取上级行社", notes = "获取上级行社")
     @InnerAuth
-    @PostMapping("/dept/selectParentHs")
+    @PostMapping("/selectParentHs")
     List<SysOrg> selectParentHs(@RequestBody List<Long> orgList) {
         return orgService.selectParentHs(orgList);
     }

+ 8 - 1
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysOrgServiceImpl.java

@@ -312,7 +312,14 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
         final List<SysOrg> sysOrgList = sysOrgMapper.selectList(new LambdaQueryWrapper<SysOrg>()
                 .in(SysOrg::getId, orgList)
                 .select(SysOrg::getPath));
-        final List<Long> orgIdList = sysOrgList.stream().map(SysOrg::getPath).map(path -> path.split("-")).map(Arrays::asList).flatMap(Collection::stream).map(Long::valueOf).distinct().collect(Collectors.toList());
+        final List<Long> orgIdList = sysOrgList.stream()
+                .map(SysOrg::getPath)
+                .map(path -> path.split("-"))
+                .map(Arrays::asList)
+                .flatMap(Collection::stream)
+                .map(Long::valueOf)
+                .distinct().
+                collect(Collectors.toList());
 
         return sysOrgMapper.selectList(new LambdaQueryWrapper<SysOrg>()
                 .in(SysOrg::getId, orgIdList)