修改生成任务。
This commit is contained in:
parent
569e60a0eb
commit
ce84a8c97f
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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<List<List<GroupingValue>>> getPortaitByPatient(Long patientId) {
|
||||
return R.ok(labelFieldContentService.getPortaitByPatient(patientId));
|
||||
}
|
||||
}
|
||||
|
||||
@ -32,6 +32,7 @@ public interface SpecialDiseaseNodeMapper {
|
||||
*/
|
||||
List<SpecialDiseaseNode> selectSpecialDiseaseNodeList(SpecialDiseaseNode specialDiseaseNode);
|
||||
|
||||
List<SpecialDiseaseNodeVO> selectSpeciaDiseaseNodeVoList(SpecialDiseaseNode specialDiseaseNode);
|
||||
/**
|
||||
* 新增专病路径-管理节点信息
|
||||
*
|
||||
|
||||
@ -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<List<GroupingValue>> getPortaitByPatient(Long patientId);
|
||||
}
|
||||
|
||||
@ -296,33 +296,6 @@ public class LabelFieldContentServiceImpl implements ILabelFieldContentService {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<List<GroupingValue>> getPortaitByPatient(Long patientId) {
|
||||
//List<Map<String, List<List<GroupingValue>>>> retMap = new ArrayList<>();
|
||||
List<List<GroupingValue>> retList = new ArrayList<>();
|
||||
List<GroupingValue> labelFieldContents = labelFieldContentMapper.groupingValue(0L, patientId, null);
|
||||
if (CollectionUtils.isEmpty(labelFieldContents)) {
|
||||
return null;
|
||||
}
|
||||
retList.add(labelFieldContents);
|
||||
// 按照任务细分分组
|
||||
//Map<Long, List<GroupingValue>> groupByPartition = labelFieldContents.stream().collect(Collectors.groupingBy(GroupingValue::getTaskPartitionDictId));
|
||||
|
||||
//for (Long taskPartitionDictId : groupByPartition.keySet()) {
|
||||
// Map<String, List<List<GroupingValue>>> retObj = new HashMap<>();
|
||||
// List<List<GroupingValue>> lists = new ArrayList<>();
|
||||
// // 按照sn分组
|
||||
// List<GroupingValue> partitionList = groupByPartition.get(taskPartitionDictId);
|
||||
// Map<String, List<GroupingValue>> 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据任务细分类型获取患者的真实信息
|
||||
*
|
||||
|
||||
@ -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<SignPatientManageNodeAuditVo> 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<SignPatientManageNodeAuditVo> replaceNodeContent(SignPatientManageNodeAuditVo manageRouteNode, RouteTaskAuditVo node, List<LabelFieldInfoContentVo> labelFieldContentList) {
|
||||
List<SignPatientManageNodeAuditVo> manageNodeList = new ArrayList<>();
|
||||
// 按照任务细分分组
|
||||
Map<Long, List<LabelFieldInfoContentVo>> groupbyPartition = labelFieldContentList.stream().collect(Collectors.groupingBy(LabelFieldInfoContentVo::getTaskPartitionDictId));
|
||||
List<LabelFieldInfoContentVo> nodeParamList = groupbyPartition.get(node.getTaskPartitionDictId());
|
||||
// 参数按照序列号分组
|
||||
if (CollectionUtils.isNotEmpty(nodeParamList)) {
|
||||
Map<String, List<LabelFieldInfoContentVo>> groupBySn = nodeParamList.stream().collect(Collectors.groupingBy(LabelFieldInfoContentVo::getPortraitSn));
|
||||
|
||||
for (String portraitSn : groupBySn.keySet()) {
|
||||
SignPatientManageNodeAuditVo manageNode = new SignPatientManageNodeAuditVo();
|
||||
BeanUtils.copyBeanProp(manageNode, manageRouteNode);
|
||||
// 替换文本
|
||||
List<LabelFieldInfoContentVo> nodeParams = groupBySn.get(portraitSn);
|
||||
Map<String, String> 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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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<SignPatientManageNodeAuditVo> replaceNodeContent(SignPatientManageNodeAuditVo manageRouteNode, Long taskPartitionDictId, List<LabelFieldInfoContentVo> labelFieldContentList);
|
||||
}
|
||||
|
||||
@ -826,7 +826,15 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage
|
||||
// 替换nodeContent
|
||||
List<SignPatientManageRouteNode> 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<SignPatientManageNodeAuditVo> 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<SignPatientManageRouteNode> replaceNodeContent(SignPatientManageRouteNode manageRouteNode, Long taskPartitionDictId, List<LabelFieldInfoContentVo> labelFieldContentList) {
|
||||
List<SignPatientManageRouteNode> manageNodeList = new ArrayList<>();
|
||||
@Override
|
||||
public List<SignPatientManageNodeAuditVo> replaceNodeContent(SignPatientManageNodeAuditVo manageRouteNode, Long taskPartitionDictId, List<LabelFieldInfoContentVo> labelFieldContentList) {
|
||||
List<SignPatientManageNodeAuditVo> manageNodeList = new ArrayList<>();
|
||||
Map<String, List<LabelFieldInfoContentVo>> groupByRang = labelFieldContentList.stream().collect(Collectors.groupingBy(LabelFieldInfoContentVo::getApplyRange));
|
||||
// 筛选应用范围是否有私用的画像
|
||||
List<LabelFieldInfoContentVo> privateLabelFields = groupByRang.get("PRIVATE");
|
||||
|
||||
@ -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<LabelFieldInfoContentVo> labelFieldContentList = labelFieldContentMapper.selectByPatientId(signPatientRecord.getPatientId());
|
||||
if (!CollectionUtils.isEmpty(labelFieldContentList)) {
|
||||
// 按照任务细分分组
|
||||
Map<Long, List<LabelFieldInfoContentVo>> groupByPartition = labelFieldContentList.stream().collect(Collectors.groupingBy(LabelFieldInfoContentVo::getTaskPartitionDictId));
|
||||
// 按照公共私用分组
|
||||
Map<String, List<LabelFieldInfoContentVo>> groupByRang = labelFieldContentList.stream().collect(Collectors.groupingBy(LabelFieldInfoContentVo::getApplyRange));
|
||||
// 筛选应用范围是否有私用的画像
|
||||
List<LabelFieldInfoContentVo> privateLabelFields = groupByRang.get("PRIVATE");
|
||||
List<LabelFieldInfoContentVo> publicLabelFields = groupByRang.get("PUBLIC");
|
||||
|
||||
Map<Long, List<LabelFieldInfoContentVo>> groupByPartition = privateLabelFields.stream().collect(Collectors.groupingBy(LabelFieldInfoContentVo::getTaskPartitionDictId));
|
||||
nodeList.forEach(node -> {
|
||||
PatientNodeParamsCurrent paramsCurrent = new PatientNodeParamsCurrent();
|
||||
// 根据任务细分查询节点参数
|
||||
List<LabelFieldInfoContentVo> 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<String, LabelFieldInfoContentVo> 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<String, List<LabelFieldInfoContentVo>> 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<LabelFieldInfoContentVo> snLabelField = groupBySn.get(sn);
|
||||
snLabelField.addAll(publicLabelFields);
|
||||
Map<String, LabelFieldInfoContentVo> 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);
|
||||
|
||||
@ -47,4 +47,10 @@ public class LabelFieldInfoContentVo {
|
||||
@ApiModelProperty(value = "画像流水号,用年月日时分秒毫秒数字转成的字符串")
|
||||
private String portraitSn;
|
||||
|
||||
/**
|
||||
* 应用范围;PRIVATE:专用;PUBLIC:公共
|
||||
*/
|
||||
@ApiModelProperty("应用范围;PRIVATE:专用;PUBLIC:公共")
|
||||
private String applyRange;
|
||||
|
||||
}
|
||||
|
||||
@ -12,6 +12,12 @@ import lombok.Data;
|
||||
@Data
|
||||
public class RouteTaskAuditVo extends SpecialDiseaseNode {
|
||||
|
||||
/**
|
||||
* 任务类型id
|
||||
*/
|
||||
@ApiModelProperty(value = "任务类型id")
|
||||
private Long taskTypeId;
|
||||
|
||||
/**
|
||||
* 任务类型名称
|
||||
*/
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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 @@
|
||||
<if test="portraitStatus != null">
|
||||
and lfc.portrait_status = #{portraitStatus}
|
||||
</if>
|
||||
Order by tpd.task_partition_sort,lfc.portrait_sn
|
||||
Order by tpd.task_partition_sort,lfi.field_sort
|
||||
</select>
|
||||
|
||||
<insert id="insertLabelFieldContentList">
|
||||
|
||||
@ -311,6 +311,18 @@
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectSpeciaDiseaseNodeVoList" parameterType="SpecialDiseaseNode" resultMap="SpecialDiseaseNodeVOResult">
|
||||
select sdn.*,
|
||||
tpd.id as taskPartitionDictId,
|
||||
tpd.task_partition_name as taskSubdivisionName
|
||||
from special_disease_node sdn
|
||||
left join task_partition_dict tpd on tpd.task_partition_code = sdn.task_subdivision
|
||||
<where>
|
||||
<if test="routeId != null ">
|
||||
and sdn.route_id = #{routeId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSpecialDiseaseNodeById" parameterType="Long"
|
||||
resultMap="SpecialDiseaseNodeResult">
|
||||
@ -917,6 +929,7 @@
|
||||
<select id="getByParentRouteId" resultType="com.xinelu.manage.vo.specialdiseasenode.RouteTaskAuditVo">
|
||||
select
|
||||
sdn.*,
|
||||
ttd.id taskTypeId,
|
||||
ttd.task_type_name taskTypeName,
|
||||
tpd.id taskPartitionDictId,
|
||||
tpd.task_partition_name taskPartitionDictName
|
||||
|
||||
Loading…
Reference in New Issue
Block a user