针对导入的患者,手动创建任务时,同步生成画像数据
This commit is contained in:
parent
929370c09d
commit
528dbcfe65
@ -55,10 +55,10 @@ public class SignPatientManageRouteNode extends BaseEntity {
|
||||
@Excel(name = "任务执行类型(批量还是单个执行,'批量任务:BATCH_TASK,单个实时拔打任务:ACTUAL_TIME_TASK')")
|
||||
private String taskExcuteType;
|
||||
|
||||
/** 任务计划执行时间,格式:YYYY-MM-dd HH:mm */
|
||||
@ApiModelProperty(value = "任务计划执行时间,格式:yyyy-MM-dd HH:mm")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
@Excel(name = "任务计划执行时间,格式:yyyy-MM-dd HH:mm", width = 30, dateFormat = "yyyy-MM-dd HH:mm")
|
||||
/** 任务计划执行时间,格式:YYYY-MM-dd HH:mm:ss */
|
||||
@ApiModelProperty(value = "任务计划执行时间,格式:yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "任务计划执行时间,格式:yyyy-MM-dd HH:mm:ss", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime nodePlanTime;
|
||||
|
||||
|
||||
|
||||
@ -211,6 +211,7 @@ public class LabelFieldContentServiceImpl implements ILabelFieldContentService {
|
||||
patientTaskDto.setPatientId(patientId);
|
||||
//根据患者id查询节点富文本所需标签
|
||||
List<SignPatientManageRouteNode> nodeList = signPatientManageRouteNodeMapper.getNodeList(patientTaskDto);
|
||||
//同上一句代码 好像有重复????zyk 20241211
|
||||
List<SignPatientManageRouteNode> routeNodeContentList = signPatientManageRouteNodeMapper.getRouteNodeContentList(patientId);
|
||||
if (CollectionUtils.isNotEmpty(routeNodeContentList)) {
|
||||
nodeList.addAll(routeNodeContentList);
|
||||
|
||||
@ -54,13 +54,18 @@ import com.xinelu.manage.mapper.signpatientmanageroutenode.SignPatientManageRout
|
||||
import com.xinelu.manage.mapper.signpatientrecord.SignPatientRecordMapper;
|
||||
import com.xinelu.manage.mapper.signroutetriggercondition.SignRouteTriggerConditionMapper;
|
||||
import com.xinelu.manage.service.aiob.IAIOBService;
|
||||
import com.xinelu.manage.service.labelfieldcontent.ILabelFieldContentService;
|
||||
import com.xinelu.manage.service.labelfieldcontent.impl.LabelFieldContentServiceImpl;
|
||||
import com.xinelu.manage.service.patienttaskstatistics.IPatientTaskStatisticsService;
|
||||
import com.xinelu.manage.service.propagandainfo.IPropagandaInfoService;
|
||||
import com.xinelu.manage.service.questioninfo.IQuestionInfoService;
|
||||
import com.xinelu.manage.service.signpatientmanageroute.ISignPatientManageRouteService;
|
||||
import com.xinelu.manage.service.signpatientmanageroutenode.ISignPatientManageRouteNodeService;
|
||||
import com.xinelu.manage.service.signpatientrecord.ISignPatientRecordService;
|
||||
import com.xinelu.manage.service.specialdiseasenode.ISpecialDiseaseNodeService;
|
||||
import com.xinelu.manage.service.specialdiseaseroute.ISpecialDiseaseRouteService;
|
||||
import com.xinelu.manage.vo.labelfieldcontent.LabelField;
|
||||
import com.xinelu.manage.vo.labelfieldcontent.LabelFieldAndPartitionDict;
|
||||
import com.xinelu.manage.vo.labelfieldcontent.LabelFieldInfoContentVo;
|
||||
import com.xinelu.manage.vo.manualfollowup.ManualFollowPatientVO;
|
||||
import com.xinelu.manage.vo.manualfollowup.ManualFollowUpVO;
|
||||
@ -145,7 +150,12 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
|
||||
@Resource
|
||||
private IPatientTaskStatisticsService patientTaskStatisticsService;
|
||||
|
||||
@Resource
|
||||
@Resource
|
||||
private ILabelFieldContentService labelFieldContentService;
|
||||
|
||||
|
||||
|
||||
@Resource
|
||||
private PatientInfoMapper patientInfoMapper;
|
||||
@Resource
|
||||
private IAIOBService aiobService;
|
||||
@ -226,7 +236,7 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
|
||||
//任务路由主表 新增
|
||||
int insertRoute = signPatientManageRouteMapper.insertSignPatientManageRoute(signPatientManageRoute);
|
||||
if (insertRoute < 0) {
|
||||
return AjaxResult.error(901,"新增签约患者管理任务路径失败!请联系管理员!");
|
||||
return AjaxResult.error(901,"患者管理任务路径失败!请联系管理员!");//新增签约
|
||||
}
|
||||
// 新增节点表
|
||||
List<SignPatientManageRouteNode> signPatientManageRouteNodes = new ArrayList<>();
|
||||
@ -240,13 +250,13 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
|
||||
if(StringUtils.isNotBlank(signPatientManageRoute.getImportMainId()))
|
||||
{ routeNode.setTaskExcuteType(TaskExcuteTypeEnum.BATCH_TASK.getInfo());}
|
||||
if(Objects.isNull(signPatientManageRoute.getSignPatientRecordId())) {
|
||||
//更新 审核状态为 已审核,适用场景:手动创建任务 zyk 20241204
|
||||
//更新 审核状态为 已审核,适用场景:对未签约患者 手动创建任务 zyk 20241204
|
||||
routeNode.setRouteCheckStatus(RouteCheckStatusEnum.AGREE.getInfo());
|
||||
}
|
||||
extracted(signPatientManageRoute, signPatientManageRouteNodes, routeNode);
|
||||
}
|
||||
if (CollectionUtils.isEmpty(signPatientManageRouteNodes)) {
|
||||
return AjaxResult.error(901,"创建任务中至少有一个管理任务节点!");
|
||||
return AjaxResult.error(901,"创建任务中至少有一个管理任务节点!可能是因为时间或其它属性信息不全导致,请完善后重试。");
|
||||
}
|
||||
//批量插入任务
|
||||
int insertBatchCount = signPatientManageRouteNodeMapper.insertBatch(signPatientManageRouteNodes);
|
||||
@ -257,20 +267,35 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
|
||||
|
||||
SignPatientRecord signPatientRecord = new SignPatientRecord();
|
||||
|
||||
if(Objects.isNull(signPatientManageRoute.getSignPatientRecordId())) {
|
||||
//更新 签约记录的 审核状态为 已审核,适用场景:手动创建任务 zyk 20241204
|
||||
signPatientRecord.setRouteCheckStatus(RouteCheckStatusEnum.AGREE.getInfo());
|
||||
// if(Objects.isNull(signPatientManageRoute.getSignPatientRecordId())) {
|
||||
// //更新 签约记录的 审核状态为 已审核,适用场景:手动创建任务 zyk 20241204
|
||||
// signPatientRecord.setRouteCheckStatus(RouteCheckStatusEnum.AGREE.getInfo());
|
||||
// }
|
||||
// else
|
||||
|
||||
//×××××更新 签约记录的 审核状态为 未审核,适用场景:对已签约患者 手动创建任务 zyk 20241204
|
||||
if(Objects.nonNull(signPatientManageRoute.getSignPatientRecordId()))
|
||||
{
|
||||
signPatientRecord.setRouteCheckStatus(RouteCheckStatusEnum.UNAUDITED.getInfo());
|
||||
signPatientRecord.setId(signPatientManageRoute.getSignPatientRecordId());
|
||||
int updateRecord = signPatientRecordMapper.updateByPrimaryKeySelective(signPatientRecord);
|
||||
if (updateRecord < 0) {
|
||||
return AjaxResult.error(901,"修改签约患者管理任务路径失败!请联系管理员!");
|
||||
}
|
||||
}
|
||||
//适用场景:对未签约患者 手动创建任务
|
||||
else
|
||||
{
|
||||
//×××××更新 签约记录的 审核状态为 未审核,适用场景:手动创建任务 zyk 20241204
|
||||
signPatientRecord.setRouteCheckStatus(RouteCheckStatusEnum.UNAUDITED.getInfo());
|
||||
}
|
||||
//获取画像信息
|
||||
List<LabelFieldAndPartitionDict> labelFieldAndPartitionDictList = labelFieldContentService.groupingValue(0L,signPatientManageRoute.getPatientId());
|
||||
// 画像信息保存
|
||||
LabelField labelField = new LabelField();
|
||||
labelField.setLabelFieldAndPartitionDictList(labelFieldAndPartitionDictList);
|
||||
labelFieldContentService.insertLabelField(labelField);
|
||||
|
||||
// 替换手动生成的任务中的标签
|
||||
signPatientManageRouteNodeService.manualCreateTaskLabelReplaceByPatientId(signPatientManageRoute.getPatientId());
|
||||
|
||||
signPatientRecord.setId(signPatientManageRoute.getSignPatientRecordId());
|
||||
int updateRecord = signPatientRecordMapper.updateByPrimaryKeySelective(signPatientRecord);
|
||||
if (updateRecord < 0) {
|
||||
return AjaxResult.error(901,"修改签约患者管理任务路径失败!请联系管理员!");
|
||||
}
|
||||
|
||||
return AjaxResult.success();
|
||||
|
||||
@ -160,6 +160,11 @@ public interface ISignPatientManageRouteNodeService {
|
||||
* @param signRecordId 签约记录主键
|
||||
*/
|
||||
void manualCreateTaskLabelReplace(Long signRecordId);
|
||||
/**
|
||||
* 手动创建的任务标签替换
|
||||
* @param patientId 患者Id
|
||||
*/
|
||||
void manualCreateTaskLabelReplaceByPatientId(Long patientId);
|
||||
|
||||
/**
|
||||
* 根据触发条件生成子路径任务
|
||||
|
||||
@ -786,6 +786,26 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage
|
||||
manageRouteQuery.setSignPatientRecordId(signRecordId);
|
||||
manageRouteQuery.setTaskCreateType(TaskCreateTypeConstant.MANUAL_CREATE);
|
||||
List<SignPatientManageRoute> manageRouteList = signRouteMapper.selectSignPatientManageRouteList(manageRouteQuery);
|
||||
manualCreateTaskLabelReplaceForManageRouteList(manageRouteList);
|
||||
}
|
||||
/**
|
||||
* 手动创建的任务标签替换
|
||||
* @param patientId 签约记录主键
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void manualCreateTaskLabelReplaceByPatientId(Long patientId) {
|
||||
SignPatientManageRoute manageRouteQuery = new SignPatientManageRoute();
|
||||
manageRouteQuery.setPatientId(patientId);
|
||||
manageRouteQuery.setTaskCreateType(TaskCreateTypeConstant.MANUAL_CREATE);
|
||||
List<SignPatientManageRoute> manageRouteList = signRouteMapper.selectSignPatientManageRouteList(manageRouteQuery);
|
||||
manualCreateTaskLabelReplaceForManageRouteList(manageRouteList);
|
||||
}
|
||||
/**
|
||||
* 手动创建的任务标签替换
|
||||
* @param manageRouteList
|
||||
*/
|
||||
public void manualCreateTaskLabelReplaceForManageRouteList(List<SignPatientManageRoute> manageRouteList) {
|
||||
if (CollectionUtils.isNotEmpty(manageRouteList)) {
|
||||
// 查询患者画像信息
|
||||
List<LabelFieldInfoContentVo> labelFieldContentList = labelFieldContentMapper.selectByPatientId(manageRouteList.get(0).getPatientId());
|
||||
@ -852,7 +872,7 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage
|
||||
// 任务统计表中插入数据
|
||||
if (CollectionUtils.isNotEmpty(manageNodeList)) {
|
||||
patientTaskStatisticsService.insertOrUpdate(PatientTaskStatistics.builder()
|
||||
.signPatientRecordId(signRecordId)
|
||||
.signPatientRecordId(manageRouteList.get(0).getSignPatientRecordId())
|
||||
.patientId(manageRouteList.get(0).getPatientId())
|
||||
.taskNum(BigDecimal.valueOf(manageNodeList.size()))
|
||||
.taskExecuteNum(BigDecimal.ZERO)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user