任务管理删除
This commit is contained in:
parent
3fc17aec6e
commit
5c61ae2e2f
@ -239,4 +239,12 @@ public interface SignPatientManageRouteNodeMapper {
|
||||
* @return SignPatientManageRouteNode
|
||||
*/
|
||||
List<SignPatientManageRouteNode> selectSameManageRouteNodeIdByRouteIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 查询节点id的路径id
|
||||
*
|
||||
* @param ids
|
||||
* @return Long
|
||||
*/
|
||||
List<Long> selectManageRouteIdByIds(Long[] ids);
|
||||
}
|
||||
|
||||
@ -741,17 +741,22 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
|
||||
if (deleteNodeCount < 0) {
|
||||
return AjaxResult.error("删除失败,请联系管理员!");
|
||||
}
|
||||
List<Long> manageRouteIdByIds = signPatientManageRouteNodeMapper.selectManageRouteIdByIds(ids);
|
||||
//根据节点ids查询同路径的节点ids
|
||||
List<SignPatientManageRouteNode> signPatientManageRouteNodes = signPatientManageRouteNodeMapper.selectSameManageRouteNodeIdByNodeIds(ids);
|
||||
//无同级节点id
|
||||
List<Long> noSameLevelNodeIds = new ArrayList<>();
|
||||
//有同级节点,且同级节点状态不为0,不删除上级路径
|
||||
for (Long aLong : ids) {
|
||||
List<SignPatientManageRouteNode> collect = signPatientManageRouteNodes.stream().filter(Objects::nonNull).filter(item -> item.getId().equals(aLong)).collect(Collectors.toList());
|
||||
for (Long aLong : manageRouteIdByIds) {
|
||||
List<SignPatientManageRouteNode> collect = signPatientManageRouteNodes.stream().filter(Objects::nonNull).filter(item -> item.getManageRouteId().equals(aLong)).collect(Collectors.toList());
|
||||
if (CollectionUtils.isEmpty(collect) || collect.size() == 0) {
|
||||
noSameLevelNodeIds.add(aLong);
|
||||
}
|
||||
}
|
||||
//都存在同级节点,返回,不删除其他数据
|
||||
if (CollectionUtils.isEmpty(noSameLevelNodeIds) || noSameLevelNodeIds.size() == 0) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
//无同级节点,查询上级路径 signPatientManageRoutes 上级路径ids
|
||||
List<SignPatientManageRoute> signPatientManageRoutes = signPatientManageRouteMapper.selectRouteByNodeIds(noSameLevelNodeIds);
|
||||
if (CollectionUtils.isEmpty(signPatientManageRoutes) || signPatientManageRoutes.size() == 0) {
|
||||
@ -764,9 +769,9 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
|
||||
//List<SignPatientManageRoute> patientManageRouteIds = new ArrayList<>();
|
||||
//上级为主路径,查询是否有子路径。上级为子路径继续查询同级信息
|
||||
for (SignPatientManageRoute signPatientManageRoute : signPatientManageRoutes) {
|
||||
if (Objects.nonNull(signPatientManageRoute.getParentRouteId())) {
|
||||
if (Objects.nonNull(signPatientManageRoute.getParentRouteId()) && signPatientManageRoute.getParentRouteId() != 0) {
|
||||
patientManageRouteIds.add(signPatientManageRoute.getId());
|
||||
} else {
|
||||
} else if (Objects.isNull(signPatientManageRoute.getParentRouteId()) || signPatientManageRoute.getParentRouteId() == 0) {
|
||||
manageRouteIds.add(signPatientManageRoute.getId());
|
||||
}
|
||||
}
|
||||
|
||||
@ -1390,4 +1390,11 @@
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="selectManageRouteIdByIds" resultType="java.lang.Long">
|
||||
select manage_route_id from sign_patient_manage_route_node where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user