生成子路径任务定时任务。
This commit is contained in:
parent
e322b48110
commit
bbea24ebe9
@ -39,7 +39,7 @@ public interface SignPatientManageRouteMapper {
|
|||||||
* @param signPatientManageRoute 签约患者管理任务路径
|
* @param signPatientManageRoute 签约患者管理任务路径
|
||||||
* @return 签约患者管理任务路径集合
|
* @return 签约患者管理任务路径集合
|
||||||
*/
|
*/
|
||||||
public List<SignPatientManageRoute> selectSignPatientManageRouteList(SignPatientManageRoute signPatientManageRoute);
|
List<SignPatientManageRoute> selectSignPatientManageRouteList(SignPatientManageRoute signPatientManageRoute);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增签约患者管理任务路径
|
* 新增签约患者管理任务路径
|
||||||
|
|||||||
@ -590,8 +590,8 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
|
|||||||
// 人工随访
|
// 人工随访
|
||||||
case TaskContentConstants.ARTIFICIAL_FOLLOW_UP:
|
case TaskContentConstants.ARTIFICIAL_FOLLOW_UP:
|
||||||
// 查询问卷详情
|
// 查询问卷详情
|
||||||
if (StringUtils.isNotBlank(manageNode.getPhoneTemplateId())) {
|
if (manageNode.getFollowTemplateId() != null) {
|
||||||
QuestionVO questionVO1 = questionInfoService.selectQuestionInfoById(Long.valueOf(manageNode.getPhoneTemplateId()));
|
QuestionVO questionVO1 = questionInfoService.selectQuestionInfoById(manageNode.getFollowTemplateId());
|
||||||
if (ObjectUtils.isNotEmpty(questionVO1)) {
|
if (ObjectUtils.isNotEmpty(questionVO1)) {
|
||||||
templateDetail = JSONObject.parseObject(JSONObject.toJSONString(questionVO1));
|
templateDetail = JSONObject.parseObject(JSONObject.toJSONString(questionVO1));
|
||||||
manageNode.setTemplateType(TemplateTypeConstants.QUESTIONNAIRE);
|
manageNode.setTemplateType(TemplateTypeConstants.QUESTIONNAIRE);
|
||||||
|
|||||||
@ -188,20 +188,19 @@ public class SignPatientRecordServiceImpl implements ISignPatientRecordService {
|
|||||||
if (ObjectUtils.isEmpty(body.getRoute()) || body.getRoute().getRouteId() == null) {
|
if (ObjectUtils.isEmpty(body.getRoute()) || body.getRoute().getRouteId() == null) {
|
||||||
throw new ServiceException("请选择管理路径");
|
throw new ServiceException("请选择管理路径");
|
||||||
}
|
}
|
||||||
// 保存管理路径主路径
|
// 保存管理路径
|
||||||
SignPatientManageRoute signPatientManageRoute = body.getRoute();
|
SignPatientManageRoute signPatientManageRoute = body.getRoute();
|
||||||
List<SpecialDiseaseRoute> specialDiseaseRouteList = specialDiseaseRouteMapper.selectRouteAndChildren(signPatientManageRoute.getRouteId());
|
SpecialDiseaseRoute specialDiseaseRoute = specialDiseaseRouteMapper.selectSpecialDiseaseRouteById(signPatientManageRoute.getRouteId());
|
||||||
specialDiseaseRouteList.forEach(specialDiseaseRoute -> {
|
BeanUtils.copyBeanProp(signPatientManageRoute, specialDiseaseRoute);
|
||||||
BeanUtils.copyBeanProp(signPatientManageRoute, specialDiseaseRoute);
|
signPatientManageRoute.setSignPatientRecordId(signPatientRecord.getId());
|
||||||
signPatientManageRoute.setSignPatientRecordId(signPatientRecord.getId());
|
signPatientManageRoute.setPatientId(patient.getId());
|
||||||
signPatientManageRoute.setPatientId(patient.getId());
|
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(0L);
|
||||||
signPatientManageRoute.setCreateTime(LocalDateTime.now());
|
signPatientManageRoute.setCreateTime(LocalDateTime.now());
|
||||||
signPatientManageRoute.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName());
|
signPatientManageRoute.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName());
|
||||||
signPatientManageRouteMapper.insertSignPatientManageRoute(signPatientManageRoute);
|
signPatientManageRouteMapper.insertSignPatientManageRoute(signPatientManageRoute);
|
||||||
});
|
|
||||||
|
|
||||||
// 保存硬件
|
// 保存硬件
|
||||||
if (!CollectionUtils.isEmpty(body.getDevices())) {
|
if (!CollectionUtils.isEmpty(body.getDevices())) {
|
||||||
|
|||||||
@ -245,7 +245,7 @@ public class SpecialDiseaseTriggerConditionServiceImpl implements ISpecialDiseas
|
|||||||
routeName.append("|"+ triggerCondition.getDictLabel() + DictUtils.getDictLabel("trigger_condition_operator", item.getTriggerConditionOperator()) + triggerConditionValue);
|
routeName.append("|"+ triggerCondition.getDictLabel() + DictUtils.getDictLabel("trigger_condition_operator", item.getTriggerConditionOperator()) + triggerConditionValue);
|
||||||
}
|
}
|
||||||
if (i == 2) {
|
if (i == 2) {
|
||||||
routeName.append("(" + triggerCondition.getDictLabel() + ")" + DictUtils.getDictLabel("trigger_condition_name", item.getTriggerConditionCode()) + DictUtils.getDictLabel("trigger_condition_operator", item.getTriggerConditionOperator()) + triggerConditionValue);
|
routeName.append("(" + DictUtils.getDictLabel("trigger_logic", item.getTriggerLogic()) + ")" + DictUtils.getDictLabel("trigger_condition_name", item.getTriggerConditionCode()) + DictUtils.getDictLabel("trigger_condition_operator", item.getTriggerConditionOperator()) + triggerConditionValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return routeName.toString();
|
return routeName.toString();
|
||||||
|
|||||||
@ -162,7 +162,7 @@
|
|||||||
and disease_type_name like concat('%', #{diseaseTypeName}, '%')
|
and disease_type_name like concat('%', #{diseaseTypeName}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="parentRouteId == null">
|
<if test="parentRouteId == null">
|
||||||
and parent_route_id = 0
|
and (parent_route_id = 0 or parent_route_id is null)
|
||||||
</if>
|
</if>
|
||||||
<if test="parentRouteId != null ">
|
<if test="parentRouteId != null ">
|
||||||
and parent_route_id = #{parentRouteId}
|
and parent_route_id = #{parentRouteId}
|
||||||
|
|||||||
@ -1,8 +1,20 @@
|
|||||||
package com.xinelu.quartz.task;
|
package com.xinelu.quartz.task;
|
||||||
|
|
||||||
|
import com.xinelu.common.constant.SignRecordServiceStatusConstants;
|
||||||
|
import com.xinelu.common.constant.TaskCreateTypeConstant;
|
||||||
|
import com.xinelu.common.enums.RouteCheckStatusEnum;
|
||||||
|
import com.xinelu.manage.domain.signpatientmanageroute.SignPatientManageRoute;
|
||||||
|
import com.xinelu.manage.domain.specialdiseaseroute.SpecialDiseaseRoute;
|
||||||
|
import com.xinelu.manage.dto.signpatientrecord.SignPatientListDto;
|
||||||
|
import com.xinelu.manage.mapper.signpatientmanageroute.SignPatientManageRouteMapper;
|
||||||
import com.xinelu.manage.mapper.signpatientrecord.SignPatientRecordMapper;
|
import com.xinelu.manage.mapper.signpatientrecord.SignPatientRecordMapper;
|
||||||
import com.xinelu.manage.service.signpatientrecord.ISignPatientRecordService;
|
import com.xinelu.manage.mapper.specialdiseaseroute.SpecialDiseaseRouteMapper;
|
||||||
|
import com.xinelu.manage.service.signpatientmanageroutenode.ISignPatientManageRouteNodeService;
|
||||||
|
import com.xinelu.manage.vo.signpatientrecord.SignPatientListVo;
|
||||||
|
import java.util.List;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -10,20 +22,53 @@ import org.springframework.stereotype.Component;
|
|||||||
* @author: haown
|
* @author: haown
|
||||||
* @create: 2024-06-28 14:27
|
* @create: 2024-06-28 14:27
|
||||||
**/
|
**/
|
||||||
|
@Slf4j
|
||||||
@Component("GenerateChildRouteTask")
|
@Component("GenerateChildRouteTask")
|
||||||
public class GenerateChildRouteTask {
|
public class GenerateChildRouteTask {
|
||||||
|
|
||||||
@Resource
|
|
||||||
private ISignPatientRecordService signPatientRecordService;
|
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private SignPatientRecordMapper signPatientRecordMapper;
|
private SignPatientRecordMapper signPatientRecordMapper;
|
||||||
|
@Resource
|
||||||
|
private SignPatientManageRouteMapper signPatientManageRouteMapper;
|
||||||
|
@Resource
|
||||||
|
private SpecialDiseaseRouteMapper specialDiseaseRouteMapper;
|
||||||
|
@Resource
|
||||||
|
private ISignPatientManageRouteNodeService signPatientManageRouteNodeService;
|
||||||
|
|
||||||
public void GenerateChildRouteTask() {
|
public void GenerateChildRouteTask() {
|
||||||
// 查询在签患者
|
log.info("开始执行生成子路径任务定时任务......");
|
||||||
|
// 查询画像和路径都审核通过的在签患者
|
||||||
|
SignPatientListDto signPatientRecord = new SignPatientListDto();
|
||||||
|
signPatientRecord.setRouteCheckStatus(RouteCheckStatusEnum.AGREE.getInfo());
|
||||||
|
signPatientRecord.setServiceStatus(SignRecordServiceStatusConstants.IN_SIGN);
|
||||||
|
List<SignPatientListVo> signPatientList = signPatientRecordMapper.selectList(signPatientRecord);
|
||||||
// 查询患者签约专病路径包含的子路径id
|
// 查询患者签约专病路径包含的子路径id
|
||||||
// 查询签约路径表已生成的子路径id
|
signPatientList.forEach(signPatient -> {
|
||||||
// 取差集
|
// 查询签约路径
|
||||||
// 生成子路径任务
|
SignPatientManageRoute manageRouteQuery = new SignPatientManageRoute();
|
||||||
|
manageRouteQuery.setSignPatientRecordId(signPatient.getId());
|
||||||
|
manageRouteQuery.setTaskCreateType(TaskCreateTypeConstant.MANUAL_MATCHE);
|
||||||
|
List<SignPatientManageRoute> manageRouteList = signPatientManageRouteMapper.selectSignPatientManageRouteList(manageRouteQuery);
|
||||||
|
if (CollectionUtils.isNotEmpty(manageRouteList)) {
|
||||||
|
SignPatientManageRoute signPatientManageRoute = manageRouteList.get(0);
|
||||||
|
SpecialDiseaseRoute specialDiseaseRouteQuery = new SpecialDiseaseRoute();
|
||||||
|
specialDiseaseRouteQuery.setParentRouteId(signPatientManageRoute.getRouteId());
|
||||||
|
List<SpecialDiseaseRoute> childSpecialRoutes = specialDiseaseRouteMapper.selectSpecialDiseaseRouteList(specialDiseaseRouteQuery);
|
||||||
|
if (CollectionUtils.isNotEmpty(childSpecialRoutes)) {
|
||||||
|
childSpecialRoutes.forEach(specialDiseaseRoute -> {
|
||||||
|
// 查询路径是否生成过任务
|
||||||
|
manageRouteQuery.setTaskCreateType(TaskCreateTypeConstant.MANUAL_CREATE);
|
||||||
|
manageRouteQuery.setRouteId(specialDiseaseRoute.getId());
|
||||||
|
manageRouteQuery.setParentRouteId(signPatientManageRoute.getId());
|
||||||
|
List<SignPatientManageRoute> createManageRouteList = signPatientManageRouteMapper.selectSignPatientManageRouteList(manageRouteQuery);
|
||||||
|
if (CollectionUtils.isEmpty(createManageRouteList)) {
|
||||||
|
log.info("开始生成" + signPatient.getPatientName() + "子路径任务定时任务......");
|
||||||
|
signPatientManageRouteNodeService.generateChildRouteTask(signPatient.getPatientId(), signPatient.getId(), specialDiseaseRoute.getId());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
log.info("完成生成子路径任务定时任务......");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user