diff --git a/postdischarge-common/src/main/java/com/xinelu/common/enums/PatientSexEnum.java b/postdischarge-common/src/main/java/com/xinelu/common/enums/PatientSexEnum.java index 6ef306c3..76909505 100644 --- a/postdischarge-common/src/main/java/com/xinelu/common/enums/PatientSexEnum.java +++ b/postdischarge-common/src/main/java/com/xinelu/common/enums/PatientSexEnum.java @@ -38,7 +38,7 @@ public enum PatientSexEnum { public static PatientSexEnum getInfoByCode(String code) { for (PatientSexEnum sex : PatientSexEnum.values()) { - if (code.equals(sex.getInfo())) { + if (code.equals(sex.getCode())) { return sex; } } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/labelfieldcontent/LabelFieldContentController.java b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/labelfieldcontent/LabelFieldContentController.java index e17d7723..5414d6dc 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/labelfieldcontent/LabelFieldContentController.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/labelfieldcontent/LabelFieldContentController.java @@ -3,20 +3,17 @@ package com.xinelu.manage.controller.labelfieldcontent; import com.xinelu.common.annotation.Log; import com.xinelu.common.core.controller.BaseController; import com.xinelu.common.core.domain.AjaxResult; -import com.xinelu.common.core.domain.R; import com.xinelu.common.core.page.TableDataInfo; import com.xinelu.common.enums.BusinessType; import com.xinelu.common.utils.poi.ExcelUtil; import com.xinelu.manage.domain.labelfieldcontent.LabelFieldContent; import com.xinelu.manage.dto.labelfieldcontent.LabelFieldContentAddDTO; import com.xinelu.manage.service.labelfieldcontent.ILabelFieldContentService; -import com.xinelu.manage.vo.labelfieldcontent.GroupingValue; import com.xinelu.manage.vo.labelfieldcontent.LabelField; +import com.xinelu.manage.vo.labelfieldcontent.LabelFieldAndPartitionDict; import java.util.List; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; - -import com.xinelu.manage.vo.labelfieldcontent.LabelFieldAndPartitionDict; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; @@ -125,11 +122,4 @@ public class LabelFieldContentController extends BaseController { return labelFieldContentService.insertLabelField(labelField); } - /** - * 画像查询 - */ - @GetMapping("/getPortaitByPatient") - public R>> getPortaitByPatient(Long patientId) { - return R.ok(labelFieldContentService.getPortaitByPatient(patientId)); - } } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/specialdiseasenode/SpecialDiseaseNodeMapper.java b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/specialdiseasenode/SpecialDiseaseNodeMapper.java index a1350f56..6fa35598 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/specialdiseasenode/SpecialDiseaseNodeMapper.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/specialdiseasenode/SpecialDiseaseNodeMapper.java @@ -32,6 +32,7 @@ public interface SpecialDiseaseNodeMapper { */ List selectSpecialDiseaseNodeList(SpecialDiseaseNode specialDiseaseNode); + List selectSpeciaDiseaseNodeVoList(SpecialDiseaseNode specialDiseaseNode); /** * 新增专病路径-管理节点信息 * diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldcontent/ILabelFieldContentService.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldcontent/ILabelFieldContentService.java index 7b17e7a3..885291b1 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldcontent/ILabelFieldContentService.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldcontent/ILabelFieldContentService.java @@ -3,10 +3,8 @@ package com.xinelu.manage.service.labelfieldcontent; import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.manage.domain.labelfieldcontent.LabelFieldContent; import com.xinelu.manage.dto.labelfieldcontent.LabelFieldContentAddDTO; -import com.xinelu.manage.vo.labelfieldcontent.GroupingValue; import com.xinelu.manage.vo.labelfieldcontent.LabelField; import com.xinelu.manage.vo.labelfieldcontent.LabelFieldAndPartitionDict; - import java.util.List; /** @@ -93,8 +91,4 @@ public interface ILabelFieldContentService { */ AjaxResult insertLabelField(LabelField labelField); - /** - * 画像审核->查询患者画像信息 - */ - List> getPortaitByPatient(Long patientId); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldcontent/impl/LabelFieldContentServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldcontent/impl/LabelFieldContentServiceImpl.java index f7bad8fd..1ed73eca 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldcontent/impl/LabelFieldContentServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldcontent/impl/LabelFieldContentServiceImpl.java @@ -296,33 +296,6 @@ public class LabelFieldContentServiceImpl implements ILabelFieldContentService { return AjaxResult.success(); } - @Override - public List> getPortaitByPatient(Long patientId) { - //List>>> retMap = new ArrayList<>(); - List> retList = new ArrayList<>(); - List labelFieldContents = labelFieldContentMapper.groupingValue(0L, patientId, null); - if (CollectionUtils.isEmpty(labelFieldContents)) { - return null; - } - retList.add(labelFieldContents); - // 按照任务细分分组 - //Map> groupByPartition = labelFieldContents.stream().collect(Collectors.groupingBy(GroupingValue::getTaskPartitionDictId)); - - //for (Long taskPartitionDictId : groupByPartition.keySet()) { - // Map>> retObj = new HashMap<>(); - // List> lists = new ArrayList<>(); - // // 按照sn分组 - // List partitionList = groupByPartition.get(taskPartitionDictId); - // Map> groupBySn = partitionList.stream().collect(Collectors.groupingBy(GroupingValue::getPortraitSn)); - // for (String sn : groupBySn.keySet()) { - // lists.add(groupBySn.get(sn)); - // } - // retObj.put(partitionList.get(0).getTaskPartitionDictName(), lists); - // retMap.add(retObj); - //} - return retList; - } - /** * 根据任务细分类型获取患者的真实信息 * diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroute/impl/SignPatientManageRouteServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroute/impl/SignPatientManageRouteServiceImpl.java index 63990ab4..33f06ee2 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroute/impl/SignPatientManageRouteServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroute/impl/SignPatientManageRouteServiceImpl.java @@ -7,11 +7,11 @@ import com.xinelu.common.constant.TemplateTypeConstants; import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.common.enums.NodeExecuteStatusEnum; import com.xinelu.common.enums.PhoneConnectStatusEnum; +import com.xinelu.common.enums.PhoneDialMethodEnum; 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.*; import com.xinelu.common.exception.ServiceException; import com.xinelu.common.utils.AgeUtil; import com.xinelu.common.utils.SecurityUtils; @@ -63,25 +63,19 @@ 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 org.apache.commons.collections4.CollectionUtils; -import org.apache.commons.lang3.ObjectUtils; -import org.apache.commons.lang3.StringUtils; -import org.jsoup.Jsoup; -import org.jsoup.nodes.Document; -import org.jsoup.nodes.Element; -import org.jsoup.select.Elements; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; -import java.util.Map; import java.util.Objects; import java.util.regex.Matcher; import java.util.regex.Pattern; 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; /** @@ -128,6 +122,8 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout private TextMessageMapper textMessageMapper; @Resource private WechatTemplateMapper wechatTemplateMapper; + @Resource + private ISignPatientManageRouteNodeService signPatientManageRouteNodeService; /** * 查询签约患者管理任务路径 @@ -528,7 +524,7 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout // 替换nodeContent List manageNodeList = new ArrayList<>(); if (StringUtils.contains(node.getNodeContent(), "data-w-e-type")) { - manageNodeList = replaceNodeContent(manageRouteNode, node, labelFieldContentList); + manageNodeList = signPatientManageRouteNodeService.replaceNodeContent(manageRouteNode, node.getTaskPartitionDictId(), labelFieldContentList); } else { manageNodeList.add(manageRouteNode); } @@ -730,7 +726,7 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout //过滤出符合条件的对象,不匹配返回null。 LabelFieldInfoContentVo labelFieldContent = labelFieldContentList.stream().filter(s -> Objects.equals(s.getFieldCode(), matcher.group(1))).findFirst().orElse(null); if (ObjectUtils.isNotEmpty(labelFieldContent)) { - flowScheme = flowScheme.replaceAll("#\\{([^\\}]*)\\}", ObjectUtils.isEmpty(labelFieldContent) ? "" : labelFieldContent.getFieldValue()); + flowScheme = flowScheme.replaceAll("#\\{"+matcher.group(1) +"\\}", ObjectUtils.isEmpty(labelFieldContent) ? "" : labelFieldContent.getFieldValue()); } } } @@ -754,7 +750,7 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout // 过滤出符合条件的对象,不匹配返回null。 LabelFieldInfoContentVo labelFieldContent = labelFieldContentList.stream().filter(s -> Objects.equals(s.getFieldCode(), matcher.group(1))).findFirst().orElse(null); if (ObjectUtils.isNotEmpty(labelFieldContent)) { - textMessageContent = textMessageContent.replaceAll("#\\{([^\\}]*)\\}", ObjectUtils.isEmpty(labelFieldContent) ? "" : labelFieldContent.getFieldValue()); + textMessageContent = textMessageContent.replaceAll("#\\{"+matcher.group(1) +"\\}", ObjectUtils.isEmpty(labelFieldContent) ? "" : labelFieldContent.getFieldValue()); } } return textMessageContent; @@ -771,7 +767,7 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout } // 替换小程序模板 if (node.getAppletPushSign() != null && node.getAppletPushSign() == 1) { - manageRouteNode.setAppletNodeContent(replaceWeChatTemplate(node.getOfficialTemplateId(), labelFieldContentList)); + manageRouteNode.setAppletNodeContent(replaceWeChatTemplate(node.getAppletTemplateId(), labelFieldContentList)); } } @@ -792,46 +788,10 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout // 过滤出符合条件的对象,不匹配返回null。 LabelFieldInfoContentVo labelFieldContent = labelFieldContentList.stream().filter(s -> Objects.equals(s.getFieldCode(), matcher.group(1))).findFirst().orElse(null); if (ObjectUtils.isNotEmpty(labelFieldContent)) { - templateContent = templateContent.replaceAll("#\\{([^\\}]*)\\}", ObjectUtils.isEmpty(labelFieldContent) ? "" : labelFieldContent.getFieldValue()); + templateContent = templateContent.replaceAll("#\\{"+matcher.group(1) +"\\}", ObjectUtils.isEmpty(labelFieldContent) ? "" : labelFieldContent.getFieldValue()); } } return templateContent; } - /** - * 替换节点内容 - * @param node 节点 - * @param labelFieldContentList 画像信息 - * @return 替换标签后的节点列表 - */ - private List replaceNodeContent(SignPatientManageNodeAuditVo manageRouteNode, RouteTaskAuditVo node, List labelFieldContentList) { - List manageNodeList = new ArrayList<>(); - // 按照任务细分分组 - Map> groupbyPartition = labelFieldContentList.stream().collect(Collectors.groupingBy(LabelFieldInfoContentVo::getTaskPartitionDictId)); - List nodeParamList = groupbyPartition.get(node.getTaskPartitionDictId()); - // 参数按照序列号分组 - if (CollectionUtils.isNotEmpty(nodeParamList)) { - Map> groupBySn = nodeParamList.stream().collect(Collectors.groupingBy(LabelFieldInfoContentVo::getPortraitSn)); - - for (String portraitSn : groupBySn.keySet()) { - SignPatientManageNodeAuditVo manageNode = new SignPatientManageNodeAuditVo(); - BeanUtils.copyBeanProp(manageNode, manageRouteNode); - // 替换文本 - List nodeParams = groupBySn.get(portraitSn); - Map map = nodeParams.stream().collect(Collectors.toMap(LabelFieldInfoContentVo::getFieldCode,LabelFieldInfoContentVo::getFieldValue,(key1,key2)->key2)); - Document document = Jsoup.parse(manageNode.getNodeContent()); - // 需要提取的span - Elements spanlist = document.select("span[data-w-e-type]"); - for (Element span : spanlist) { - String paramKey = span.attr("data-fieldMark"); - span.text(map.getOrDefault(paramKey, "")); - span.unwrap(); - } - manageNode.setNodeContent(document.body().html()); - manageNodeList.add(manageNode); - } - } - - return manageNodeList; - } } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroutenode/ISignPatientManageRouteNodeService.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroutenode/ISignPatientManageRouteNodeService.java index 3e20a3e7..f40ddf02 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroutenode/ISignPatientManageRouteNodeService.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroutenode/ISignPatientManageRouteNodeService.java @@ -7,10 +7,12 @@ import com.xinelu.manage.dto.signpatientmanageroutenode.AppletPatientTaskDto; import com.xinelu.manage.dto.signpatientmanageroutenode.PatientTaskDto; import com.xinelu.manage.dto.signpatientmanageroutenode.RouteNodeCheckDto; import com.xinelu.manage.dto.signpatientmanageroutenode.SignPatientManageRouteNodeDto; +import com.xinelu.manage.vo.labelfieldcontent.LabelFieldInfoContentVo; import com.xinelu.manage.vo.signpatientmanageroutenode.AppletRouteNodeListVo; import com.xinelu.manage.vo.signpatientmanageroutenode.PatientManageNodeInfoVo; import com.xinelu.manage.vo.signpatientmanageroutenode.PatientManageNodeListVo; import com.xinelu.manage.vo.signpatientmanageroutenode.PatientTaskVo; +import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageNodeAuditVo; import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageRouteNodeVo; import com.xinelu.manage.vo.specialdiseasenode.PatientSpecialDiseaseNodeVo; import java.time.LocalDateTime; @@ -160,4 +162,13 @@ public interface ISignPatientManageRouteNodeService { * @param specialDiseaseRouteId 专病管理路径子路径主键 */ void generateChildRouteTask(Long patientId, Long signPatientRecordId, Long specialDiseaseRouteId); + + /** + * 替换节点标签内容 + * @param manageRouteNode 签约管理路径节点 + * @param taskPartitionDictId 专病节点任务细分 + * @param labelFieldContentList 患者画像 + * @return 签约路径节点列表 + */ + List replaceNodeContent(SignPatientManageNodeAuditVo manageRouteNode, Long taskPartitionDictId, List labelFieldContentList); } 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 b52647a8..c24a6a51 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 @@ -826,7 +826,15 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage // 替换nodeContent List manageNodeList = new ArrayList<>(); if (StringUtils.contains(node.getNodeContent(), "data-w-e-type")) { - manageNodeList = replaceNodeContent(manageRouteNode, node.getTaskPartitionDictId(), labelFieldContentList); + SignPatientManageNodeAuditVo signPatientManageNodeAuditVo = new SignPatientManageNodeAuditVo(); + BeanUtils.copyBeanProp(signPatientManageNodeAuditVo, manageRouteNode); + List manageNodeAuditVoList = replaceNodeContent(signPatientManageNodeAuditVo, node.getTaskPartitionDictId(), labelFieldContentList); + manageNodeAuditVoList.forEach(manageNodeAuditVo -> { + SignPatientManageRouteNode signNode = new SignPatientManageRouteNode(); + BeanUtils.copyBeanProp(signNode, manageNodeAuditVo); + manageNodeList.add(signNode); + }); + } else { manageNodeList.add(manageRouteNode); } @@ -940,13 +948,15 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage } /** - * 替换节点内容 - * @param taskPartitionDictId 节点任务细分id - * @param labelFieldContentList 画像信息 - * @return 替换标签后的节点列表 + * 替换节点标签内容 + * @param manageRouteNode 签约管理路径节点 + * @param taskPartitionDictId 专病节点任务细分 + * @param labelFieldContentList 患者画像 + * @return 签约路径节点列表 */ - private List replaceNodeContent(SignPatientManageRouteNode manageRouteNode, Long taskPartitionDictId, List labelFieldContentList) { - List manageNodeList = new ArrayList<>(); + @Override + public List replaceNodeContent(SignPatientManageNodeAuditVo manageRouteNode, Long taskPartitionDictId, List labelFieldContentList) { + List manageNodeList = new ArrayList<>(); Map> groupByRang = labelFieldContentList.stream().collect(Collectors.groupingBy(LabelFieldInfoContentVo::getApplyRange)); // 筛选应用范围是否有私用的画像 List privateLabelFields = groupByRang.get("PRIVATE"); 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 d5ea6b08..56e0d92e 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 @@ -57,6 +57,10 @@ import java.util.Map; import java.util.stream.Collectors; import javax.annotation.Resource; import org.apache.commons.lang3.ObjectUtils; +import org.jsoup.Jsoup; +import org.jsoup.nodes.Document; +import org.jsoup.nodes.Element; +import org.jsoup.select.Elements; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; @@ -193,6 +197,7 @@ public class SignPatientRecordServiceImpl implements ISignPatientRecordService { BeanUtils.copyBeanProp(signPatientManageRoute, specialDiseaseRoute); signPatientManageRoute.setSignPatientRecordId(signPatientRecord.getId()); signPatientManageRoute.setPatientId(patient.getId()); + signPatientManageRoute.setPatientName(patient.getPatientName()); signPatientManageRoute.setId(null); signPatientManageRoute.setRouteId(specialDiseaseRoute.getId()); signPatientManageRoute.setTaskCreateType(TaskCreateTypeConstant.MANUAL_MATCHE); @@ -392,9 +397,11 @@ public class SignPatientRecordServiceImpl implements ISignPatientRecordService { @Transactional(rollbackFor = Exception.class) public int updatePortaitCheckStatus(PortaitCheckDto portaitCheckDto) { // 画像信息保存 - LabelField labelField = new LabelField(); - labelField.setLabelFieldAndPartitionDictList(portaitCheckDto.getLabelFieldAndPartitionDictList()); - labelFieldContentService.insertLabelField(labelField); + if (StringUtils.equals(RouteCheckStatusEnum.AGREE.getInfo(), portaitCheckDto.getPortaitCheckStatus())) { + LabelField labelField = new LabelField(); + labelField.setLabelFieldAndPartitionDictList(portaitCheckDto.getLabelFieldAndPartitionDictList()); + labelFieldContentService.insertLabelField(labelField); + } // 修改签约记录 SignPatientRecord signPatientRecord = signPatientRecordMapper.selectByPrimaryKey(portaitCheckDto.getSignPatientRecordId()); @@ -463,32 +470,88 @@ public class SignPatientRecordServiceImpl implements ISignPatientRecordService { // 查询画像信息 List labelFieldContentList = labelFieldContentMapper.selectByPatientId(signPatientRecord.getPatientId()); if (!CollectionUtils.isEmpty(labelFieldContentList)) { - // 按照任务细分分组 - Map> groupByPartition = labelFieldContentList.stream().collect(Collectors.groupingBy(LabelFieldInfoContentVo::getTaskPartitionDictId)); + // 按照公共私用分组 + Map> groupByRang = labelFieldContentList.stream().collect(Collectors.groupingBy(LabelFieldInfoContentVo::getApplyRange)); + // 筛选应用范围是否有私用的画像 + List privateLabelFields = groupByRang.get("PRIVATE"); + List publicLabelFields = groupByRang.get("PUBLIC"); + + Map> groupByPartition = privateLabelFields.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(nodeLabelFields)) { + Document document = Jsoup.parse(node.getNodeContent()); + // 需要提取的span + Elements spanlist = document.select("span[data-w-e-type]"); + Map map = publicLabelFields.stream().collect(Collectors.toMap(LabelFieldInfoContentVo::getFieldCode,LabelFieldInfoContentVo->LabelFieldInfoContentVo ,(key1,key2)->key2)); + + for (Element span : spanlist) { + String paramKey = span.attr("data-fieldMark"); + + LabelFieldInfoContentVo labelFieldInfoContentVo = map.get(paramKey); + if (ObjectUtils.isNotEmpty(labelFieldInfoContentVo)) { + PatientNodeParamsCurrent paramsCurrent = new PatientNodeParamsCurrent(); + paramsCurrent.setPatientId(signPatientRecord.getPatientId()); + paramsCurrent.setPatientName(signPatientRecord.getPatientName()); + paramsCurrent.setTaskPartitionDictId(node.getTaskPartitionDictId()); + paramsCurrent.setTaskPartitionDictName(node.getTaskPartitionDictName()); + paramsCurrent.setTaskTypeId(node.getTaskTypeId()); + paramsCurrent.setTaskTypeName(node.getTaskTypeName()); + paramsCurrent.setRouteId(node.getRouteId()); + paramsCurrent.setRouteName(node.getRouteName()); + paramsCurrent.setRouteNodeId(node.getId()); + paramsCurrent.setRouteNodeName(node.getRouteNodeName()); + paramsCurrent.setParamKey(paramKey); + paramsCurrent.setParamValue(labelFieldInfoContentVo.getFieldValue()); + paramsCurrent.setParamName(labelFieldInfoContentVo.getFieldName()); + paramsCurrent.setPortraitSn(labelFieldInfoContentVo.getPortraitSn()); + paramsCurrentList.add(paramsCurrent); + PatientNodeParamsLog paramsLog = new PatientNodeParamsLog(); + BeanUtils.copyBeanProp(paramsLog, paramsCurrent); + paramsLogList.add(paramsLog); + } + } + } else { + Map> groupBySn = nodeLabelFields.stream().collect(Collectors.groupingBy(LabelFieldInfoContentVo::getPortraitSn)); + // 查询node中的标签 + if (!CollectionUtils.isEmpty(publicLabelFields) && StringUtils.isNotBlank(node.getNodeContent()) && StringUtils.contains("data-w-e-type", node.getNodeContent())) { + Document document = Jsoup.parse(node.getNodeContent()); + // 需要提取的span + Elements spanlist = document.select("span[data-w-e-type]"); + for(String sn : groupBySn.keySet()) { + List snLabelField = groupBySn.get(sn); + snLabelField.addAll(publicLabelFields); + Map map = snLabelField.stream().collect(Collectors.toMap(LabelFieldInfoContentVo::getFieldCode,LabelFieldInfoContentVo->LabelFieldInfoContentVo ,(key1,key2)->key2)); + + for (Element span : spanlist) { + String paramKey = span.attr("data-fieldMark"); + LabelFieldInfoContentVo labelFieldInfoContentVo = map.get(paramKey); + if (ObjectUtils.isNotEmpty(labelFieldInfoContentVo)) { + PatientNodeParamsCurrent paramsCurrent = new PatientNodeParamsCurrent(); + paramsCurrent.setPatientId(signPatientRecord.getPatientId()); + paramsCurrent.setPatientName(signPatientRecord.getPatientName()); + paramsCurrent.setTaskPartitionDictId(node.getTaskPartitionDictId()); + paramsCurrent.setTaskPartitionDictName(node.getTaskPartitionDictName()); + paramsCurrent.setTaskTypeId(node.getTaskTypeId()); + paramsCurrent.setTaskTypeName(node.getTaskTypeName()); + paramsCurrent.setRouteId(node.getRouteId()); + paramsCurrent.setRouteName(node.getRouteName()); + paramsCurrent.setRouteNodeId(node.getId()); + paramsCurrent.setRouteNodeName(node.getRouteNodeName()); + paramsCurrent.setParamKey(paramKey); + paramsCurrent.setParamValue(labelFieldInfoContentVo.getFieldValue()); + paramsCurrent.setParamName(labelFieldInfoContentVo.getFieldName()); + paramsCurrent.setPortraitSn(labelFieldInfoContentVo.getPortraitSn()); + paramsCurrentList.add(paramsCurrent); + PatientNodeParamsLog paramsLog = new PatientNodeParamsLog(); + BeanUtils.copyBeanProp(paramsLog, paramsCurrent); + paramsLogList.add(paramsLog); + } + } + } + } + } + }); if (!CollectionUtils.isEmpty(paramsCurrentList)) { patientNodeParamsCurrentMapper.insertList(paramsCurrentList); 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 9e8d6c8d..12fc9e55 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 @@ -47,4 +47,10 @@ public class LabelFieldInfoContentVo { @ApiModelProperty(value = "画像流水号,用年月日时分秒毫秒数字转成的字符串") private String portraitSn; + /** + * 应用范围;PRIVATE:专用;PUBLIC:公共 + */ + @ApiModelProperty("应用范围;PRIVATE:专用;PUBLIC:公共") + private String applyRange; + } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/vo/specialdiseasenode/RouteTaskAuditVo.java b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/specialdiseasenode/RouteTaskAuditVo.java index 4f1761b0..a23d7a78 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/vo/specialdiseasenode/RouteTaskAuditVo.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/specialdiseasenode/RouteTaskAuditVo.java @@ -12,6 +12,12 @@ import lombok.Data; @Data public class RouteTaskAuditVo extends SpecialDiseaseNode { + /** + * 任务类型id + */ + @ApiModelProperty(value = "任务类型id") + private Long taskTypeId; + /** * 任务类型名称 */ diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/vo/specialdiseasenode/SpecialDiseaseNodeVO.java b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/specialdiseasenode/SpecialDiseaseNodeVO.java index ed28b426..08374d1f 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/vo/specialdiseasenode/SpecialDiseaseNodeVO.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/specialdiseasenode/SpecialDiseaseNodeVO.java @@ -1,6 +1,7 @@ package com.xinelu.manage.vo.specialdiseasenode; import com.xinelu.manage.domain.specialdiseasenode.SpecialDiseaseNode; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; @@ -18,6 +19,9 @@ public class SpecialDiseaseNodeVO extends SpecialDiseaseNode { private String taskTypeName; + @ApiModelProperty(value = "任务细分id") + private Long taskPartitionDictId; + private String taskSubdivisionName; private String taskStatusName; 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 4fef2eff..6e69053c 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/labelfieldcontent/LabelFieldContentMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/labelfieldcontent/LabelFieldContentMapper.xml @@ -316,6 +316,7 @@ content.field_code, info.task_partition_dict_id, info.task_type_id, + info.apply_range, content.field_value, content.portrait_sn from label_field_content content left join label_field_info info on content.field_id = info.id @@ -359,7 +360,7 @@ and lfc.portrait_status = #{portraitStatus} - Order by tpd.task_partition_sort,lfc.portrait_sn + Order by tpd.task_partition_sort,lfi.field_sort diff --git a/postdischarge-manage/src/main/resources/mapper/manage/specialdiseasenode/SpecialDiseaseNodeMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/specialdiseasenode/SpecialDiseaseNodeMapper.xml index 4224dff4..92b8d2cc 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/specialdiseasenode/SpecialDiseaseNodeMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/specialdiseasenode/SpecialDiseaseNodeMapper.xml @@ -311,6 +311,18 @@ + select sdn.*, + ttd.id taskTypeId, ttd.task_type_name taskTypeName, tpd.id taskPartitionDictId, tpd.task_partition_name taskPartitionDictName