路径审核返回触发条件是否满足。
This commit is contained in:
parent
107b369de8
commit
76b34dd68f
@ -4,7 +4,7 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @description: 路径审核传世对象
|
||||
* @description: 路径审核传输对象
|
||||
* @author: haown
|
||||
* @create: 2024-06-26 13:41
|
||||
**/
|
||||
|
||||
@ -93,10 +93,10 @@ public interface ISignPatientManageRouteService {
|
||||
|
||||
/**
|
||||
* 路径审核->路径信息获取主路径及子路径信息及节点
|
||||
* @param patientId 患者主键
|
||||
* @param signRecordId 签约记录主键
|
||||
* @return 主路径信息及节点、子路径信息及节点
|
||||
*/
|
||||
SpecialDiseaseRouteAuditVo getRouteAuditInfo(Long patientId);
|
||||
SpecialDiseaseRouteAuditVo getRouteAuditInfo(Long signRecordId);
|
||||
|
||||
/**
|
||||
* 路径审核->路径审核,节点详细信息
|
||||
|
||||
@ -7,7 +7,13 @@ import com.xinelu.common.constant.TaskCreateTypeConstant;
|
||||
import com.xinelu.common.constant.TaskNodeTypeConstants;
|
||||
import com.xinelu.common.constant.TemplateTypeConstants;
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.common.enums.*;
|
||||
import com.xinelu.common.enums.NodeExecuteStatusEnum;
|
||||
import com.xinelu.common.enums.PhoneConnectStatusEnum;
|
||||
import com.xinelu.common.enums.PhoneMessageRemindEnum;
|
||||
import com.xinelu.common.enums.RouteNodeNameEnum;
|
||||
import com.xinelu.common.enums.TaskContentEnum;
|
||||
import com.xinelu.common.enums.TaskCreateTypeEnum;
|
||||
import com.xinelu.common.enums.TaskNodeTypeEnum;
|
||||
import com.xinelu.common.exception.ServiceException;
|
||||
import com.xinelu.common.utils.AgeUtil;
|
||||
import com.xinelu.common.utils.SecurityUtils;
|
||||
@ -37,8 +43,6 @@ import com.xinelu.manage.mapper.signpatientmanageroute.SignPatientManageRouteMap
|
||||
import com.xinelu.manage.mapper.signpatientmanageroutenode.SignPatientManageRouteNodeMapper;
|
||||
import com.xinelu.manage.mapper.signpatientrecord.SignPatientRecordMapper;
|
||||
import com.xinelu.manage.mapper.signroutetriggercondition.SignRouteTriggerConditionMapper;
|
||||
import com.xinelu.manage.mapper.textmessage.TextMessageMapper;
|
||||
import com.xinelu.manage.mapper.wechattemplate.WechatTemplateMapper;
|
||||
import com.xinelu.manage.service.propagandainfo.IPropagandaInfoService;
|
||||
import com.xinelu.manage.service.questioninfo.IQuestionInfoService;
|
||||
import com.xinelu.manage.service.signpatientmanageroute.ISignPatientManageRouteService;
|
||||
@ -57,17 +61,20 @@ import com.xinelu.manage.vo.specialdiseasenode.RouteTaskAuditVo;
|
||||
import com.xinelu.manage.vo.specialdiseasenode.SpecialDiseaseNodeAuditVo;
|
||||
import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseChildRouteAuditVo;
|
||||
import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteAuditVo;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.annotation.Resource;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
* 签约患者管理任务路径Service业务层处理
|
||||
@ -373,6 +380,11 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
|
||||
return AjaxResult.success(signPatientManageRouteMapper.selectSignPatientManageRouteNode(manageRouteNodeId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 路径审核->路径信息获取主路径及子路径信息及节点
|
||||
* @param signRecordId 签约记录主键
|
||||
* @return 主路径信息及节点、子路径信息及节点
|
||||
*/
|
||||
@Override public SpecialDiseaseRouteAuditVo getRouteAuditInfo(Long signRecordId) {
|
||||
SignPatientRecord signPatientRecord = signPatientRecordMapper.selectByPrimaryKey(signRecordId);
|
||||
if (ObjectUtils.isEmpty(signPatientRecord)) {
|
||||
@ -402,15 +414,21 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
|
||||
});
|
||||
// 计算子路径节点执行时间
|
||||
specialDiseaseRouteAuditVo.getChildRouteList()
|
||||
.forEach(childRoute -> childRoute.getNodeList()
|
||||
.forEach(childNode -> childNode.setExecuteTime(
|
||||
iSignPatientManageRouteNodeService.getExecuteTime(childNode.getExecutionTime(), childNode.getRouteNodeName(), childNode.getRouteNodeDay(), patientVisitRecord))));
|
||||
.forEach(childRoute -> {
|
||||
// 判断触发条件是否满足
|
||||
boolean satisfy = signPatientManageRouteNodeService.getTriggerConditon(childRoute.getId(), signPatientRecord.getPatientId());
|
||||
childRoute.setConditionSatisfyStatus(satisfy);
|
||||
childRoute.getNodeList()
|
||||
.forEach(childNode -> childNode.setExecuteTime(
|
||||
iSignPatientManageRouteNodeService.getExecuteTime(childNode.getExecutionTime(), childNode.getRouteNodeName(), childNode.getRouteNodeDay(), patientVisitRecord)));
|
||||
});
|
||||
// 查询手动创建的路径
|
||||
manageRouteQuery.setTaskCreateType(TaskCreateTypeConstant.MANUAL_CREATE);
|
||||
List<SignPatientManageRoute> manualRouteList = signPatientManageRouteMapper.selectSignPatientManageRouteList(manageRouteQuery);
|
||||
if (CollectionUtils.isNotEmpty(manualRouteList)) {
|
||||
// 查询节点信息组装成返回的数据类型
|
||||
manualRouteList.forEach(route -> {
|
||||
boolean satisfy = signPatientManageRouteNodeService.getSignTriggerConditon(route.getId(), signPatientRecord.getPatientId());
|
||||
// 查询节点
|
||||
List<SpecialDiseaseNodeAuditVo> nodeList = signPatientManageRouteNodeMapper.selectByRouteId(route.getId());
|
||||
nodeList.forEach(node-> {
|
||||
@ -418,9 +436,11 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
|
||||
node.setExecuteTime(iSignPatientManageRouteNodeService.getExecuteTime(node.getExecutionTime(), node.getRouteNodeName(), node.getRouteNodeDay(), patientVisitRecord));
|
||||
});
|
||||
specialDiseaseRouteAuditVo.getChildRouteList().add(
|
||||
SpecialDiseaseChildRouteAuditVo.builder().diseaseTypeName(route.getDiseaseTypeName())
|
||||
SpecialDiseaseChildRouteAuditVo.builder()
|
||||
.diseaseTypeName(route.getDiseaseTypeName())
|
||||
.routeName(route.getRouteName())
|
||||
.diseaseTypeId(route.getDiseaseTypeId())
|
||||
.conditionSatisfyStatus(satisfy)
|
||||
.nodeList(nodeList).build()
|
||||
);
|
||||
});
|
||||
@ -454,9 +474,9 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
|
||||
for (Long routeId : groupByRouteId.keySet()) {
|
||||
if (Objects.equals(routeId, signPatientManageRoute.getRouteId())) {
|
||||
// 主路径不做处理
|
||||
routeSatisfyMap.put(routeId, null);
|
||||
routeSatisfyMap.put(routeId, true);
|
||||
} else {
|
||||
boolean satisfy = signPatientManageRouteNodeService.getTriggerConditon(routeId, signPatientRecord.getId());
|
||||
boolean satisfy = signPatientManageRouteNodeService.getTriggerConditon(routeId, signPatientRecord.getPatientId());
|
||||
routeSatisfyMap.put(routeId, satisfy);
|
||||
}
|
||||
}
|
||||
@ -543,9 +563,15 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
|
||||
List<SignPatientManageRoute> createRouteList = signPatientManageRouteMapper.selectSignPatientManageRouteList(manageRouteQuery);
|
||||
if (CollectionUtils.isNotEmpty(createRouteList)) {
|
||||
List<Long> manageRouteIds = createRouteList.stream().map(SignPatientManageRoute::getId).collect(Collectors.toList());
|
||||
for (Long routeId : manageRouteIds) {
|
||||
boolean satisfy = signPatientManageRouteNodeService.getSignTriggerConditon(routeId, signPatientRecord.getPatientId());
|
||||
routeSatisfyMap.put(routeId, satisfy);
|
||||
}
|
||||
List<SignPatientManageNodeAuditVo> manageNodeList = signPatientManageRouteNodeMapper.selectAuditNodeInfo(manageRouteIds);
|
||||
// 根据node去替换模板信息
|
||||
manageNodeList.forEach(manageNode -> {
|
||||
// 判断触发条件是否满足
|
||||
manageNode.setConditionSatisfyStatus(routeSatisfyMap.get(manageNode.getManageRouteId()));
|
||||
manageNode.setRouteNodeNameCN(RouteNodeNameEnum.getNameByInfo(manageNode.getRouteNodeName()).getName());
|
||||
JSONObject templateDetail = new JSONObject();
|
||||
if (StringUtils.isNotBlank(manageNode.getTaskNodeType())) {
|
||||
|
||||
@ -37,6 +37,9 @@ public class SpecialDiseaseChildRouteAuditVo {
|
||||
@ApiModelProperty(value = "病种名称")
|
||||
private String diseaseTypeName;
|
||||
|
||||
@ApiModelProperty("触发条件满足情况")
|
||||
private Boolean conditionSatisfyStatus;
|
||||
|
||||
/**
|
||||
* 节点列表
|
||||
*/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user