子路径任务生成修改。
This commit is contained in:
parent
7c58b736e0
commit
ebc631c253
@ -152,4 +152,12 @@ public interface ISignPatientManageRouteNodeService {
|
|||||||
* @param signRecordId 签约记录主键
|
* @param signRecordId 签约记录主键
|
||||||
*/
|
*/
|
||||||
void manualCreateTaskLabelReplace(Long signRecordId);
|
void manualCreateTaskLabelReplace(Long signRecordId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据触发条件生成子路径任务
|
||||||
|
* @param patientId 患者主键
|
||||||
|
* @param signPatientRecordId 签约记录表主键
|
||||||
|
* @param specialDiseaseRouteId 专病管理路径子路径主键
|
||||||
|
*/
|
||||||
|
void generateChildRouteTask(Long patientId, Long signPatientRecordId, Long specialDiseaseRouteId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -607,8 +607,9 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage
|
|||||||
return executeDateTime;
|
return executeDateTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public void generateMainRouteTask(Long signRecordId) {
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void generateMainRouteTask(Long signRecordId) {
|
||||||
// 查询专病路径节点和手动创建的任务节点
|
// 查询专病路径节点和手动创建的任务节点
|
||||||
SignPatientRecord signPatientRecord = signPatientRecordMapper.selectByPrimaryKey(signRecordId);
|
SignPatientRecord signPatientRecord = signPatientRecordMapper.selectByPrimaryKey(signRecordId);
|
||||||
if (ObjectUtils.isEmpty(signPatientRecord)) {
|
if (ObjectUtils.isEmpty(signPatientRecord)) {
|
||||||
@ -626,6 +627,7 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void manualCreateTaskLabelReplace(Long signRecordId) {
|
public void manualCreateTaskLabelReplace(Long signRecordId) {
|
||||||
SignPatientManageRoute manageRouteQuery = new SignPatientManageRoute();
|
SignPatientManageRoute manageRouteQuery = new SignPatientManageRoute();
|
||||||
manageRouteQuery.setSignPatientRecordId(signRecordId);
|
manageRouteQuery.setSignPatientRecordId(signRecordId);
|
||||||
@ -672,11 +674,12 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成子路径任务
|
* 根据触发条件生成子路径任务
|
||||||
* @param patientId 患者主键
|
* @param patientId 患者主键
|
||||||
* @param signPatientRecordId 签约记录主键
|
* @param signPatientRecordId 签约记录表主键
|
||||||
* @param specialDiseaseRouteId 专病管理路径路径id
|
* @param specialDiseaseRouteId 专病管理路径子路径主键
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void generateChildRouteTask(Long patientId, Long signPatientRecordId, Long specialDiseaseRouteId) {
|
public void generateChildRouteTask(Long patientId, Long signPatientRecordId, Long specialDiseaseRouteId) {
|
||||||
boolean generateTask = false;
|
boolean generateTask = false;
|
||||||
@ -701,46 +704,21 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage
|
|||||||
// 条件1成立,继续判断条件2,3
|
// 条件1成立,继续判断条件2,3
|
||||||
if (triggerConditionList.size() > 1) {
|
if (triggerConditionList.size() > 1) {
|
||||||
boolean condition2 = judgeTriggerCondition(triggerConditionList.get(1), patientAllInfo, labelFieldContentList);
|
boolean condition2 = judgeTriggerCondition(triggerConditionList.get(1), patientAllInfo, labelFieldContentList);
|
||||||
if (condition2) {
|
if (triggerConditionList.size() > 2) { // 有3个条件
|
||||||
// 条件2成立,判断2、3的逻辑连接符,or:则不判断3,and:需要判断3
|
boolean condition3 = judgeTriggerCondition(triggerConditionList.get(2), patientAllInfo, labelFieldContentList);
|
||||||
if (triggerConditionList.size() > 2) {
|
|
||||||
boolean judgetCondition3 = true;
|
|
||||||
switch (triggerConditionList.get(2).getTriggerLogic()) {
|
switch (triggerConditionList.get(2).getTriggerLogic()) {
|
||||||
case TriggerLogicConstants.AND:
|
case TriggerLogicConstants.AND:
|
||||||
judgetCondition3 = true;
|
generateTask = condition2 && condition3;
|
||||||
break;
|
break;
|
||||||
case TriggerLogicConstants.OR:
|
case TriggerLogicConstants.OR:
|
||||||
judgetCondition3 = false;
|
generateTask = condition2 || condition3;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
generateTask = condition2 && condition3;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (judgetCondition3) {
|
} else { // 有两个条件
|
||||||
boolean condition3 = judgeTriggerCondition(triggerConditionList.get(2), patientAllInfo, labelFieldContentList);
|
generateTask = condition2;
|
||||||
if (condition3) {
|
|
||||||
// 3成立,则生成任务
|
|
||||||
generateTask = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// 条件2不成立,判断2、3的逻辑连接符,or:判断3,and:不判断3
|
|
||||||
if (triggerConditionList.size() > 2) {
|
|
||||||
boolean judgetCondition3 = false;
|
|
||||||
switch (triggerConditionList.get(2).getTriggerLogic()) {
|
|
||||||
case TriggerLogicConstants.AND:
|
|
||||||
judgetCondition3 = false;
|
|
||||||
break;
|
|
||||||
case TriggerLogicConstants.OR:
|
|
||||||
judgetCondition3 = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (judgetCondition3) {
|
|
||||||
boolean condition3 = judgeTriggerCondition(triggerConditionList.get(2), patientAllInfo, labelFieldContentList);
|
|
||||||
if (condition3) {
|
|
||||||
// 3成立,则生成任务
|
|
||||||
generateTask = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 只有1个条件且成立,生成任务
|
// 只有1个条件且成立,生成任务
|
||||||
@ -750,6 +728,14 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage
|
|||||||
}
|
}
|
||||||
if (generateTask) {
|
if (generateTask) {
|
||||||
// 保存sign_patient_manage_route表
|
// 保存sign_patient_manage_route表
|
||||||
|
SignPatientManageRoute manageRouteQuery = new SignPatientManageRoute();
|
||||||
|
manageRouteQuery.setSignPatientRecordId(signPatientRecordId);
|
||||||
|
manageRouteQuery.setTaskCreateType(TaskCreateTypeConstant.MANUAL_MATCHE);
|
||||||
|
List<SignPatientManageRoute> mainRouteList = signRouteMapper.selectSignPatientManageRouteList(manageRouteQuery);
|
||||||
|
if (CollectionUtils.isEmpty(mainRouteList)) {
|
||||||
|
throw new ServiceException("未找到签约管理路径");
|
||||||
|
}
|
||||||
|
SignPatientManageRoute mainManageRoute = mainRouteList.get(0);
|
||||||
SpecialDiseaseRoute specialDiseaseRoute = specialDiseaseRouteMapper.selectSpecialDiseaseRouteById(specialDiseaseRouteId);
|
SpecialDiseaseRoute specialDiseaseRoute = specialDiseaseRouteMapper.selectSpecialDiseaseRouteById(specialDiseaseRouteId);
|
||||||
SignPatientManageRoute signPatientManageRoute = new SignPatientManageRoute();
|
SignPatientManageRoute signPatientManageRoute = new SignPatientManageRoute();
|
||||||
BeanUtils.copyBeanProp(signPatientManageRoute, specialDiseaseRoute);
|
BeanUtils.copyBeanProp(signPatientManageRoute, specialDiseaseRoute);
|
||||||
@ -758,6 +744,7 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage
|
|||||||
signPatientManageRoute.setId(null);
|
signPatientManageRoute.setId(null);
|
||||||
signPatientManageRoute.setRouteId(specialDiseaseRoute.getId());
|
signPatientManageRoute.setRouteId(specialDiseaseRoute.getId());
|
||||||
signPatientManageRoute.setTaskCreateType(TaskCreateTypeConstant.MANUAL_MATCHE);
|
signPatientManageRoute.setTaskCreateType(TaskCreateTypeConstant.MANUAL_MATCHE);
|
||||||
|
signPatientManageRoute.setParentRouteId(mainManageRoute.getId());
|
||||||
signPatientManageRoute.setCreateTime(LocalDateTime.now());
|
signPatientManageRoute.setCreateTime(LocalDateTime.now());
|
||||||
signPatientManageRoute.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName());
|
signPatientManageRoute.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName());
|
||||||
signRouteMapper.insertSignPatientManageRoute(signPatientManageRoute);
|
signRouteMapper.insertSignPatientManageRoute(signPatientManageRoute);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user