Commit 345855ce authored by 蔡镇泽's avatar 蔡镇泽

查询护理机构下所有子机构id

parent 8384a4f5
package com.hungraim.ism.controller; package com.hungraim.ism.controller;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hungraim.ism.pojo.vo.disable.DisableExamineInfoVO; import com.hungraim.ism.pojo.vo.disable.DisableExamineInfoVO;
import com.hungraim.ism.pojo.vo.disable.DisableVO; import com.hungraim.ism.pojo.vo.disable.DisableVO;
...@@ -80,6 +81,20 @@ public class DisableController { ...@@ -80,6 +81,20 @@ public class DisableController {
} }
/** /**
* 查询护理机构下所有子机构id
*
* @param organId 机构id
* @return 机构及所有子机构id,以逗号分隔,如果没有子机构则只返回机构id
*/
@RequestMapping("/fndDiseaseList")
public Result<String> subsidiariesOrganId(String organId) {
if (StrUtil.isBlank(organId)) {
return Result.failed("organId不能为空!");
}
return Result.success(disableService.subsidiariesOrganId(organId));
}
/**
* 失能人员信息列表 * 失能人员信息列表
* *
* @param organId 适用机构代码 * @param organId 适用机构代码
......
...@@ -76,4 +76,12 @@ public interface DisableService { ...@@ -76,4 +76,12 @@ public interface DisableService {
* @param parDiseTypeId 父疾病类型id * @param parDiseTypeId 父疾病类型id
*/ */
List<ChFndDiseaseType> fndDiseaseList(String parDiseTypeId); List<ChFndDiseaseType> fndDiseaseList(String parDiseTypeId);
/**
* 查询护理机构下所有子机构id
*
* @param organId 机构id
* @return 机构及所有子机构id,以逗号分隔,如果没有子机构则只返回机构id
*/
String subsidiariesOrganId(String organId);
} }
...@@ -14,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -14,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
@Service @Service
...@@ -64,13 +65,7 @@ public class DisableServiceImpl implements DisableService { ...@@ -64,13 +65,7 @@ public class DisableServiceImpl implements DisableService {
// 没有organId参数的时候,这个集合就为null // 没有organId参数的时候,这个集合就为null
List<String> organIds = null; List<String> organIds = null;
if (StrUtil.isNotBlank(organId)) { if (StrUtil.isNotBlank(organId)) {
organIds = new ArrayList<>(); organIds = Arrays.asList(organId.split(","));
// 先把最顶层id添加到集合
organIds.add(organId);
// 获取子孙机构集合
if ("0".equals(isIncludeSubsidiaries)) {
this.getOrganList(organId, organIds);
}
} }
return disableApplyMapper.disableList(new Page<>(page, pageSize), organIds, isIncludeSubsidiaries, districtProvincial, return disableApplyMapper.disableList(new Page<>(page, pageSize), organIds, isIncludeSubsidiaries, districtProvincial,
districtCity, districtArea, realName, certiCode, dataFrom, srvOrganName); districtCity, districtArea, realName, certiCode, dataFrom, srvOrganName);
...@@ -159,4 +154,18 @@ public class DisableServiceImpl implements DisableService { ...@@ -159,4 +154,18 @@ public class DisableServiceImpl implements DisableService {
return fndDiseaseTypeMapper.selectList(queryWrapper); return fndDiseaseTypeMapper.selectList(queryWrapper);
} }
@Override
public String subsidiariesOrganId(String organId) {
List<String> organIds = new ArrayList<>();
organIds.add(organId);
// 获取子孙机构集合
this.getOrganList(organId, organIds);
StringBuilder sb = new StringBuilder();
for (String o : organIds) {
sb.append(o).append(",");
}
sb.deleteCharAt(sb.length() - 1);
return sb.toString();
}
} }
\ No newline at end of file
...@@ -10,6 +10,8 @@ import com.hungraim.ltc.pojo.vo.assessment.TaskDistributionVO; ...@@ -10,6 +10,8 @@ import com.hungraim.ltc.pojo.vo.assessment.TaskDistributionVO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.List;
/** /**
* 失能评定Mapper * 失能评定Mapper
* *
...@@ -22,7 +24,7 @@ public interface TaskMapper extends BaseMapper<ChAprTask> { ...@@ -22,7 +24,7 @@ public interface TaskMapper extends BaseMapper<ChAprTask> {
/** /**
* 评定任务分配列表 * 评定任务分配列表
* *
* @param organId 适用机构代码 * @param organIds 适用机构代码
* @param isIncludeSubsidiaries 是否包含子机构 0包含,1不包含 * @param isIncludeSubsidiaries 是否包含子机构 0包含,1不包含
* @param provincial 所在省 * @param provincial 所在省
* @param city 所在市 * @param city 所在市
...@@ -36,7 +38,7 @@ public interface TaskMapper extends BaseMapper<ChAprTask> { ...@@ -36,7 +38,7 @@ public interface TaskMapper extends BaseMapper<ChAprTask> {
* @param status 任务状态 * @param status 任务状态
* @param isReturn 是否退回 * @param isReturn 是否退回
*/ */
Page<TaskDistributionVO> taskDistributionList(Page<TaskDistributionVO> page, String organId, String isIncludeSubsidiaries, String provincial, String city, Page<TaskDistributionVO> taskDistributionList(Page<TaskDistributionVO> page, List<String> organIds, String isIncludeSubsidiaries, String provincial, String city,
String street, String realName, String certiCode, String taskName, String taskTel, String street, String realName, String certiCode, String taskName, String taskTel,
String daysRemaining, String status, String isReturn, String area); String daysRemaining, String status, String isReturn, String area);
......
package com.hungraim.ltc.service.impl; package com.hungraim.ltc.service.impl;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ism.pojo.vo.disable.DisableEvaluateInfoVO; import com.hungraim.ism.pojo.vo.disable.DisableEvaluateInfoVO;
...@@ -10,6 +11,9 @@ import com.hungraim.ltc.service.TaskService; ...@@ -10,6 +11,9 @@ import com.hungraim.ltc.service.TaskService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.List;
@Service @Service
public class TaskServiceImpl implements TaskService { public class TaskServiceImpl implements TaskService {
...@@ -21,7 +25,11 @@ public class TaskServiceImpl implements TaskService { ...@@ -21,7 +25,11 @@ public class TaskServiceImpl implements TaskService {
String street, String realName, String certiCode, String taskName, String taskTel, String street, String realName, String certiCode, String taskName, String taskTel,
String daysRemaining, String status, String isReturn, String area, String daysRemaining, String status, String isReturn, String area,
int pageNum, int pageSize) { int pageNum, int pageSize) {
return taskMapper.taskDistributionList(new Page<>(pageNum, pageSize), organId, isIncludeSubsidiaries, provincial, city, List<String> organIds = null;
if (StrUtil.isNotBlank(organId)) {
organIds = Arrays.asList(organId.split(","));
}
return taskMapper.taskDistributionList(new Page<>(pageNum, pageSize), organIds, isIncludeSubsidiaries, provincial, city,
street, realName, certiCode, taskName, taskTel, daysRemaining, status, isReturn, area); street, realName, certiCode, taskName, taskTel, daysRemaining, status, isReturn, area);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment