diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/patientnodeparamscurrent/PatientNodeParamsCurrent.java b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/patientnodeparamscurrent/PatientNodeParamsCurrent.java index eaa79125..a84e0d6e 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/patientnodeparamscurrent/PatientNodeParamsCurrent.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/patientnodeparamscurrent/PatientNodeParamsCurrent.java @@ -46,13 +46,6 @@ private static final long serialVersionUID=1L; @Excel(name = "任务细分名称") private String taskPartitionDictName; - /** - * 任务细分编码 - */ - @ApiModelProperty(value = "任务细分编码") - @Excel(name = "任务细分编码") - private String taskPartitionCode; - /** 任务类型表id */ @ApiModelProperty(value = "任务类型表id") @Excel(name = "任务类型表id") @@ -63,11 +56,6 @@ private static final long serialVersionUID=1L; @Excel(name = "任务类型名称") private String taskTypeName; - /** 任务类型编码 */ - @ApiModelProperty(value = "任务类型编码") - @Excel(name = "任务类型编码") - private String taskTypeCode; - /** 专病路径表id */ @ApiModelProperty(value = "专病路径表id") @Excel(name = "专病路径表id") @@ -108,4 +96,17 @@ private static final long serialVersionUID=1L; @Excel(name = "键值") private String paramValue; + /** + * 管理路径id + */ + @ApiModelProperty(value = "管理路径id") + private Long manageRouteNodeId; + + /** + * 画像流水号,用年月日时分秒毫秒数字转成的字符串 + */ + @ApiModelProperty(value = "画像流水号,用年月日时分秒毫秒数字转成的字符串") + @Excel(name = "画像流水号,用年月日时分秒毫秒数字转成的字符串") + private String portraitSn; + } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/patientnodeparamslog/PatientNodeParamsLog.java b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/patientnodeparamslog/PatientNodeParamsLog.java index c5f49518..8b169264 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/patientnodeparamslog/PatientNodeParamsLog.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/patientnodeparamslog/PatientNodeParamsLog.java @@ -96,5 +96,15 @@ private static final long serialVersionUID=1L; @Excel(name = "键值") private String paramValue; + /** + * 管理路径id + */ + @ApiModelProperty(value = "管理路径id") + private Long manageRouteNodeId; + /** + * 画像流水号,用年月日时分秒毫秒数字转成的字符串 + */ + @ApiModelProperty(value = "画像流水号,用年月日时分秒毫秒数字转成的字符串") + private String portraitSn; } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/dto/signpatientrecord/PortaitCheckDto.java b/postdischarge-manage/src/main/java/com/xinelu/manage/dto/signpatientrecord/PortaitCheckDto.java index ad2dadd5..7b768579 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/dto/signpatientrecord/PortaitCheckDto.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/dto/signpatientrecord/PortaitCheckDto.java @@ -1,6 +1,6 @@ package com.xinelu.manage.dto.signpatientrecord; -import com.xinelu.manage.vo.labelfieldcontent.GroupingValue; +import com.xinelu.manage.vo.labelfieldcontent.LabelFieldAndPartitionDict; import io.swagger.annotations.ApiModelProperty; import java.util.List; import lombok.Data; @@ -14,7 +14,7 @@ import lombok.Data; public class PortaitCheckDto { @ApiModelProperty("画像信息") - List> labelFieldContentList; + private List labelFieldAndPartitionDictList; @ApiModelProperty("患者主键") private Long patientId; diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroutenode/impl/SignPatientManageRouteNodeServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroutenode/impl/SignPatientManageRouteNodeServiceImpl.java index 8ba26c99..6a9384ca 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroutenode/impl/SignPatientManageRouteNodeServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroutenode/impl/SignPatientManageRouteNodeServiceImpl.java @@ -553,15 +553,15 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage case TaskContentConstants.SMS_REMIND: // 短信提醒 // 判断是否发短信 if (!StringUtils.equals(PhoneMessageRemindConstants.NOT_SEND_MESSAGE, signNode.getPhoneMessageRemind())) { - if (signNode.getPhoneMessageTemplateId() == null) { - throw new ServiceException("为选择短信模板"); - } - TextMessage textMessage = textMessageMapper.selectTextMessageById(signNode.getPhoneMessageTemplateId()); - if (ObjectUtils.isEmpty(textMessage) || StringUtils.isBlank(textMessage.getTextMessageContent())) { - throw new ServiceException("短信模板不存在或短信模板内容为空,请联系管理员!"); - } + //if (signNode.getPhoneMessageTemplateId() == null) { + // throw new ServiceException("为选择短信模板"); + //} + //TextMessage textMessage = textMessageMapper.selectTextMessageById(signNode.getPhoneMessageTemplateId()); + //if (ObjectUtils.isEmpty(textMessage) || StringUtils.isBlank(textMessage.getTextMessageContent())) { + // throw new ServiceException("短信模板不存在或短信模板内容为空,请联系管理员!"); + //} signNode.setId(null); - signNode.setNodeContent(textMessage.getTextMessageContent()); + signNode.setNodeContent(signNode.getPhoneMessageTemplateContent()); signNode.setRouteCheckStatus(RouteCheckStatusEnum.AGREE.getInfo()); signNode.setNodeExecuteStatus(NodeExecuteStatusEnum.UNEXECUTED.getInfo()); signPatientManageRouteNodeMapper.insertSignPatientManageRouteNode(signNode); @@ -785,6 +785,9 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage manageRouteNode.setId(null); manageRouteNode.setRouteNodeId(node.getId()); manageRouteNode.setExecuteTime(node.getExecutionTime()); + manageRouteNode.setDelFlag(0); + manageRouteNode.setRouteCheckStatus(RouteCheckStatusEnum.AGREE.getInfo()); + manageRouteNode.setNodeExecuteStatus(NodeExecuteStatusEnum.UNEXECUTED.getInfo()); // 根据模板类型,存放模板字段 if(StringUtils.isNotBlank(node.getTemplateType())) { diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientrecord/impl/SignPatientRecordServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientrecord/impl/SignPatientRecordServiceImpl.java index 5b28a20e..d5ea6b08 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientrecord/impl/SignPatientRecordServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientrecord/impl/SignPatientRecordServiceImpl.java @@ -11,6 +11,7 @@ import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.StringUtils; import com.xinelu.common.utils.bean.BeanUtils; import com.xinelu.manage.domain.patientinfo.PatientInfo; +import com.xinelu.manage.domain.patientnodeparamscurrent.PatientNodeParamsCurrent; import com.xinelu.manage.domain.patientnodeparamslog.PatientNodeParamsLog; import com.xinelu.manage.domain.signpatientinformed.SignPatientInformed; import com.xinelu.manage.domain.signpatientmanageroute.SignPatientManageRoute; @@ -29,6 +30,7 @@ import com.xinelu.manage.dto.signpatientrecord.SignPatientListDto; import com.xinelu.manage.dto.signpatientrecord.SignPatientStatusDto; import com.xinelu.manage.mapper.labelfieldcontent.LabelFieldContentMapper; import com.xinelu.manage.mapper.patientinfo.PatientInfoMapper; +import com.xinelu.manage.mapper.patientnodeparamslcurrent.PatientNodeParamsCurrentMapper; import com.xinelu.manage.mapper.patientnodeparamslog.PatientNodeParamsLogMapper; import com.xinelu.manage.mapper.signpatientinformed.SignPatientInformedMapper; import com.xinelu.manage.mapper.signpatientmanageroute.SignPatientManageRouteMapper; @@ -36,10 +38,8 @@ import com.xinelu.manage.mapper.signpatientmanageroutenode.SignPatientManageRout import com.xinelu.manage.mapper.signpatientpackage.SignPatientPackageMapper; import com.xinelu.manage.mapper.signpatientpackagehardware.SignPatientPackageHardwareMapper; import com.xinelu.manage.mapper.signpatientrecord.SignPatientRecordMapper; -import com.xinelu.manage.mapper.signroutetriggercondition.SignRouteTriggerConditionMapper; import com.xinelu.manage.mapper.specialdiseasenode.SpecialDiseaseNodeMapper; import com.xinelu.manage.mapper.specialdiseaseroute.SpecialDiseaseRouteMapper; -import com.xinelu.manage.mapper.specialdiseasetriggercondition.SpecialDiseaseTriggerConditionMapper; import com.xinelu.manage.service.labelfieldcontent.ILabelFieldContentService; import com.xinelu.manage.service.signpatientmanageroutenode.ISignPatientManageRouteNodeService; import com.xinelu.manage.service.signpatientrecord.ISignPatientRecordService; @@ -49,6 +49,7 @@ import com.xinelu.manage.vo.patientinfo.PatientPortaitVo; import com.xinelu.manage.vo.signpatientrecord.SignPatientInfoVo; import com.xinelu.manage.vo.signpatientrecord.SignPatientListVo; import com.xinelu.manage.vo.signpatientrecord.SignPatientRecordVo; +import com.xinelu.manage.vo.specialdiseasenode.RouteTaskAuditVo; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; @@ -91,9 +92,7 @@ public class SignPatientRecordServiceImpl implements ISignPatientRecordService { @Resource private SignPatientManageRouteNodeMapper manageRouteNodeMapper; @Resource - private SpecialDiseaseTriggerConditionMapper triggerConditionMapper; - @Resource - private SignRouteTriggerConditionMapper signRouteTriggerConditionMapper; + private PatientNodeParamsCurrentMapper patientNodeParamsCurrentMapper; @Resource private PatientNodeParamsLogMapper patientNodeParamsLogMapper; @Resource @@ -393,14 +392,8 @@ public class SignPatientRecordServiceImpl implements ISignPatientRecordService { @Transactional(rollbackFor = Exception.class) public int updatePortaitCheckStatus(PortaitCheckDto portaitCheckDto) { // 画像信息保存 - if (CollectionUtils.isEmpty(portaitCheckDto.getLabelFieldContentList())) { - throw new ServiceException("请输入画像信息"); - } - if (StringUtils.isBlank(portaitCheckDto.getPortaitCheckStatus())) { - throw new ServiceException("请输入审核信息"); - } LabelField labelField = new LabelField(); - labelField.setGroupingValues(portaitCheckDto.getLabelFieldContentList()); + labelField.setLabelFieldAndPartitionDictList(portaitCheckDto.getLabelFieldAndPartitionDictList()); labelFieldContentService.insertLabelField(labelField); // 修改签约记录 @@ -408,6 +401,11 @@ public class SignPatientRecordServiceImpl implements ISignPatientRecordService { if (ObjectUtils.isEmpty(signPatientRecord)) { throw new ServiceException("未找到该签约记录"); } + // 画像信息保存到路径参数表 + if (StringUtils.equals(RouteCheckStatusEnum.AGREE.getInfo(), portaitCheckDto.getPortaitCheckStatus())) { + saveNodeParams(signPatientRecord); + } + signPatientRecord.setPortaitCheckStatus(portaitCheckDto.getPortaitCheckStatus()); signPatientRecord.setPortaitCheckRemark(portaitCheckDto.getPortaitCheckRemark()); signPatientRecord.setPortaitCheckDate(LocalDateTime.now()); @@ -419,6 +417,7 @@ public class SignPatientRecordServiceImpl implements ISignPatientRecordService { // 替换手动生成的任务中的标签 signPatientManageRouteNodeService.manualCreateTaskLabelReplace(portaitCheckDto.getSignPatientRecordId()); } + return flag; } @@ -442,4 +441,59 @@ public class SignPatientRecordServiceImpl implements ISignPatientRecordService { } return flag; } + + /** + * 画像信息保存到路径参数表 + * @param signPatientRecord 签约记录信息 + */ + private void saveNodeParams(SignPatientRecord signPatientRecord) { + // 画像信息保存到路径参数表 + SignPatientManageRoute manageRouteQuery = new SignPatientManageRoute(); + manageRouteQuery.setSignPatientRecordId(signPatientRecord.getId()); + manageRouteQuery.setTaskCreateType(TaskCreateTypeConstant.MANUAL_MATCHE); + List manageRouteList = signPatientManageRouteMapper.selectSignPatientManageRouteList(manageRouteQuery); + if (CollectionUtils.isEmpty(manageRouteList)) { + throw new ServiceException("未找到签约路径,请联系管理员"); + } + SignPatientManageRoute signPatientManageRoute = manageRouteList.get(0); + List nodeList = specialDiseaseNodeMapper.getByParentRouteId(signPatientManageRoute.getRouteId()); + List paramsCurrentList = new ArrayList<>(); + List paramsLogList = new ArrayList<>(); + + // 查询画像信息 + List labelFieldContentList = labelFieldContentMapper.selectByPatientId(signPatientRecord.getPatientId()); + if (!CollectionUtils.isEmpty(labelFieldContentList)) { + // 按照任务细分分组 + Map> groupByPartition = labelFieldContentList.stream().collect(Collectors.groupingBy(LabelFieldInfoContentVo::getTaskPartitionDictId)); + nodeList.forEach(node -> { + PatientNodeParamsCurrent paramsCurrent = new PatientNodeParamsCurrent(); + // 根据任务细分查询节点参数 + List nodeLabelFields = groupByPartition.get(node.getTaskPartitionDictId()); + nodeLabelFields.forEach(nodeLabelField -> { + paramsCurrent.setPatientId(signPatientRecord.getPatientId()); + paramsCurrent.setPatientName(signPatientRecord.getPatientName()); + paramsCurrent.setTaskPartitionDictId(nodeLabelField.getTaskPartitionDictId()); + paramsCurrent.setTaskPartitionDictName(node.getTaskPartitionDictName()); + paramsCurrent.setTaskTypeId(nodeLabelField.getTaskTypeId()); + paramsCurrent.setTaskTypeName(node.getTaskTypeName()); + paramsCurrent.setRouteId(node.getRouteId()); + paramsCurrent.setRouteName(node.getRouteName()); + paramsCurrent.setRouteNodeId(node.getId()); + paramsCurrent.setRouteNodeName(node.getRouteNodeName()); + paramsCurrent.setParamKey(nodeLabelField.getFieldCode()); + paramsCurrent.setParamValue(nodeLabelField.getFieldValue()); + paramsCurrent.setParamName(nodeLabelField.getFieldName()); + paramsCurrent.setPortraitSn(nodeLabelField.getPortraitSn()); + paramsCurrentList.add(paramsCurrent); + PatientNodeParamsLog paramsLog = new PatientNodeParamsLog(); + BeanUtils.copyBeanProp(paramsLog, paramsCurrent); + paramsLogList.add(paramsLog); + }); + }); + if (!CollectionUtils.isEmpty(paramsCurrentList)) { + patientNodeParamsCurrentMapper.insertList(paramsCurrentList); + patientNodeParamsLogMapper.insertList(paramsLogList); + } + } + } } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/vo/labelfieldcontent/LabelFieldInfoContentVo.java b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/labelfieldcontent/LabelFieldInfoContentVo.java index edf5c694..9e8d6c8d 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/vo/labelfieldcontent/LabelFieldInfoContentVo.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/labelfieldcontent/LabelFieldInfoContentVo.java @@ -11,6 +11,12 @@ import lombok.Data; @Data public class LabelFieldInfoContentVo { + /** + * 字段名称 + */ + @ApiModelProperty(value = "字段名称") + private String fieldName; + /** * 字段编码 */ @@ -23,6 +29,12 @@ public class LabelFieldInfoContentVo { @ApiModelProperty(value = "任务细分id,当做分组使用") private Long taskPartitionDictId; + /** + * 任务类型表id(冗余) + */ + @ApiModelProperty(value = "任务类型表id(冗余)") + private Long taskTypeId; + /** * 字段值,同param_value */ diff --git a/postdischarge-manage/src/main/resources/mapper/manage/labelfieldcontent/LabelFieldContentMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/labelfieldcontent/LabelFieldContentMapper.xml index bf330aa4..4fef2eff 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/labelfieldcontent/LabelFieldContentMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/labelfieldcontent/LabelFieldContentMapper.xml @@ -312,8 +312,10 @@ @@ -62,9 +63,6 @@ and route_node_name like concat('%', #{routeNodeName}, '%') - - - and sn = #{sn} and param_name = #{paramName} @@ -107,8 +105,6 @@ route_node_id, route_node_name, - - sn, param_name, @@ -116,6 +112,10 @@ param_value, + manage_route_node_id, + + portrait_sn, + create_time, update_by, @@ -145,8 +145,6 @@ #{routeNodeId}, #{routeNodeName}, - - #{sn}, #{paramName}, @@ -154,6 +152,10 @@ #{paramValue}, + #{manageRouteNodeId}, + + #{portraitSn}, + #{createTime}, #{updateBy}, @@ -197,9 +199,6 @@ route_node_name = #{routeNodeName}, - - sn = - #{sn}, param_name = #{paramName}, @@ -210,6 +209,12 @@ param_value = #{paramValue}, + manage_route_node_id = + #{manageRouteNodeId}, + + portrait_sn = + #{portraitSn}, + create_time = #{createTime}, @@ -241,13 +246,13 @@ insert into patient_node_params_current (patient_id, patient_name, task_partition_dict_id, task_partition_dict_name, task_type_id, task_type_name, route_id, route_name, route_node_id, route_node_name, - sn, param_name, param_key, param_value, create_time, update_by, update_time, create_by) + param_name, param_key, param_value, manage_route_node_id, portrait_sn, create_time, update_by, update_time, create_by) values (#{item.patientId}, #{item.patientName}, #{item.taskPartitionDictId}, #{item.taskPartitionDictName}, #{item.taskTypeId}, #{item.taskTypeName}, #{item.routeId}, #{item.routeName}, #{item.routeNodeId}, #{item.routeNodeName}, - #{item.sn},#{item.paramName},#{item.paramKey},#{item.paramValue}, #{item.createTime}, #{item.updateBy}, + #{item.paramName},#{item.paramKey},#{item.paramValue},#{item.manageRouteNodeId},#{item.portraitSn}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.createBy} ) diff --git a/postdischarge-manage/src/main/resources/mapper/manage/patientnodeparamslog/PatientNodeParamsLogMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/patientnodeparamslog/PatientNodeParamsLogMapper.xml index 8eb2ed88..b06f37b6 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/patientnodeparamslog/PatientNodeParamsLogMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/patientnodeparamslog/PatientNodeParamsLogMapper.xml @@ -16,10 +16,11 @@ - + + @@ -27,7 +28,7 @@ - select id, patient_id, patient_name, task_partition_dict_id, task_partition_dict_name, task_type_id, task_type_name, route_id, route_name, route_node_id, route_node_name, sn, param_name, param_key, param_value, create_time, create_by, update_by, update_time from patient_node_params_log + select id, patient_id, patient_name, task_partition_dict_id, task_partition_dict_name, task_type_id, task_type_name, route_id, route_name, route_node_id, route_node_name, param_name, param_key, param_value, manage_route_node_id, portrait_sn, create_time, create_by, update_by, update_time from patient_node_params_log