修改生成任务。
This commit is contained in:
parent
29cc1732db
commit
8c058ac870
@ -499,10 +499,14 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
|
|||||||
manageRouteNode.setPropagandaInfoId(node.getTemplateId());
|
manageRouteNode.setPropagandaInfoId(node.getTemplateId());
|
||||||
manageRouteNode.setPropagandaTitle(node.getTemplateName());
|
manageRouteNode.setPropagandaTitle(node.getTemplateName());
|
||||||
// 查询宣教表
|
// 查询宣教表
|
||||||
|
if (manageRouteNode.getPropagandaInfoId() != null) {
|
||||||
PropagandaMaterialsVo propagandaMaterialsVo = propagandaInfoService.selectPropagandaInfoById(node.getTemplateId());
|
PropagandaMaterialsVo propagandaMaterialsVo = propagandaInfoService.selectPropagandaInfoById(node.getTemplateId());
|
||||||
|
if (ObjectUtils.isNotEmpty(propagandaMaterialsVo)) {
|
||||||
templateDetail = JSONObject.parseObject(JSONObject.toJSONString(propagandaMaterialsVo));
|
templateDetail = JSONObject.parseObject(JSONObject.toJSONString(propagandaMaterialsVo));
|
||||||
manageRouteNode.setTemplateType(TemplateTypeConstants.PROPAGANDA);
|
|
||||||
manageRouteNode.setTemplateDetail(templateDetail);
|
manageRouteNode.setTemplateDetail(templateDetail);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
manageRouteNode.setTemplateType(TemplateTypeConstants.PROPAGANDA);
|
||||||
break;
|
break;
|
||||||
// 问卷
|
// 问卷
|
||||||
case TaskNodeTypeConstants.QUESTIONNAIRE_SCALE:
|
case TaskNodeTypeConstants.QUESTIONNAIRE_SCALE:
|
||||||
@ -557,7 +561,8 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
|
|||||||
manageNodeList.forEach(manageNode -> {
|
manageNodeList.forEach(manageNode -> {
|
||||||
manageNode.setRouteNodeNameCN(RouteNodeNameEnum.getNameByInfo(manageNode.getRouteNodeName()).getName());
|
manageNode.setRouteNodeNameCN(RouteNodeNameEnum.getNameByInfo(manageNode.getRouteNodeName()).getName());
|
||||||
JSONObject templateDetail = new JSONObject();
|
JSONObject templateDetail = new JSONObject();
|
||||||
switch(manageNode.getTaskType()) {
|
if (StringUtils.isNotBlank(manageNode.getTaskNodeType())) {
|
||||||
|
switch(manageNode.getTaskNodeType()) {
|
||||||
// 电话外呼
|
// 电话外呼
|
||||||
case TaskNodeTypeConstants.PHONE_OUTBOUND:
|
case TaskNodeTypeConstants.PHONE_OUTBOUND:
|
||||||
// 电话外呼分为话术和问卷两种,根据模板id判断选择的哪种模板
|
// 电话外呼分为话术和问卷两种,根据模板id判断选择的哪种模板
|
||||||
@ -588,22 +593,26 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
|
|||||||
// 问卷
|
// 问卷
|
||||||
case TaskNodeTypeConstants.QUESTIONNAIRE_SCALE:
|
case TaskNodeTypeConstants.QUESTIONNAIRE_SCALE:
|
||||||
// 查询问卷详情
|
// 查询问卷详情
|
||||||
|
if (manageNode.getQuestionInfoId() != null) {
|
||||||
QuestionVO questionVO = questionInfoService.selectQuestionInfoById(manageNode.getQuestionInfoId());
|
QuestionVO questionVO = questionInfoService.selectQuestionInfoById(manageNode.getQuestionInfoId());
|
||||||
if (ObjectUtils.isNotEmpty(questionVO)) {
|
if (ObjectUtils.isNotEmpty(questionVO)) {
|
||||||
templateDetail = JSONObject.parseObject(JSONObject.toJSONString(questionVO));
|
templateDetail = JSONObject.parseObject(JSONObject.toJSONString(questionVO));
|
||||||
manageNode.setTemplateType(TemplateTypeConstants.QUESTIONNAIRE);
|
manageNode.setTemplateType(TemplateTypeConstants.QUESTIONNAIRE);
|
||||||
manageNode.setTemplateDetail(templateDetail);
|
manageNode.setTemplateDetail(templateDetail);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
// 宣教
|
// 宣教
|
||||||
case TaskNodeTypeConstants.PROPAGANDA_ARTICLE:
|
case TaskNodeTypeConstants.PROPAGANDA_ARTICLE:
|
||||||
// 查询宣教详情
|
// 查询宣教详情
|
||||||
|
if (manageNode.getPropagandaInfoId() != null) {
|
||||||
PropagandaMaterialsVo propagandaMaterialsVo = propagandaInfoService.selectPropagandaInfoById(manageNode.getPropagandaInfoId());
|
PropagandaMaterialsVo propagandaMaterialsVo = propagandaInfoService.selectPropagandaInfoById(manageNode.getPropagandaInfoId());
|
||||||
if (ObjectUtils.isNotEmpty(propagandaMaterialsVo)) {
|
if (ObjectUtils.isNotEmpty(propagandaMaterialsVo)) {
|
||||||
templateDetail = JSONObject.parseObject(JSONObject.toJSONString(propagandaMaterialsVo));
|
templateDetail = JSONObject.parseObject(JSONObject.toJSONString(propagandaMaterialsVo));
|
||||||
manageNode.setTemplateType(TemplateTypeConstants.PROPAGANDA);
|
manageNode.setTemplateType(TemplateTypeConstants.PROPAGANDA);
|
||||||
manageNode.setTemplateDetail(templateDetail);
|
manageNode.setTemplateDetail(templateDetail);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
// 文字提醒
|
// 文字提醒
|
||||||
case TaskNodeTypeConstants.TEXT_REMIND:
|
case TaskNodeTypeConstants.TEXT_REMIND:
|
||||||
@ -622,6 +631,7 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
|
|||||||
// }
|
// }
|
||||||
// break;
|
// break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
manageNodeAuditList.add(manageNode);
|
manageNodeAuditList.add(manageNode);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -74,6 +74,7 @@ import java.time.LocalTime;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
@ -820,9 +821,13 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage
|
|||||||
List<LabelFieldInfoContentVo> privateLabelFields = groupByRang.get("PRIVATE");
|
List<LabelFieldInfoContentVo> privateLabelFields = groupByRang.get("PRIVATE");
|
||||||
List<LabelFieldInfoContentVo> publicLabelFields = groupByRang.get("PUBLIC");
|
List<LabelFieldInfoContentVo> publicLabelFields = groupByRang.get("PUBLIC");
|
||||||
|
|
||||||
|
Map<Long, List<LabelFieldInfoContentVo>> groupByPartition = new HashMap<>();
|
||||||
|
List<LabelFieldInfoContentVo> nodeLabelFieldContent = new ArrayList<>();
|
||||||
// 按照sn进行分组,判断生成几条任务
|
// 按照sn进行分组,判断生成几条任务
|
||||||
Map<Long, List<LabelFieldInfoContentVo>> groupByPartition = privateLabelFields.stream().collect(Collectors.groupingBy(LabelFieldInfoContentVo::getTaskPartitionDictId));
|
if (CollectionUtils.isNotEmpty(privateLabelFields)) {
|
||||||
List<LabelFieldInfoContentVo> nodeLabelFieldContent = groupByPartition.get(taskPartitionDictId);
|
groupByPartition = privateLabelFields.stream().collect(Collectors.groupingBy(LabelFieldInfoContentVo::getTaskPartitionDictId));
|
||||||
|
nodeLabelFieldContent = groupByPartition.get(taskPartitionDictId);
|
||||||
|
}
|
||||||
if (CollectionUtils.isEmpty(privateLabelFields) || CollectionUtils.isEmpty(nodeLabelFieldContent)) {
|
if (CollectionUtils.isEmpty(privateLabelFields) || CollectionUtils.isEmpty(nodeLabelFieldContent)) {
|
||||||
// 都是公有属性,只生成一条任务
|
// 都是公有属性,只生成一条任务
|
||||||
SignPatientManageNodeAuditVo manageNode = new SignPatientManageNodeAuditVo();
|
SignPatientManageNodeAuditVo manageNode = new SignPatientManageNodeAuditVo();
|
||||||
|
|||||||
@ -473,48 +473,27 @@ public class SignPatientRecordServiceImpl implements ISignPatientRecordService {
|
|||||||
// 按照公共私用分组
|
// 按照公共私用分组
|
||||||
Map<String, List<LabelFieldInfoContentVo>> groupByRang = labelFieldContentList.stream().collect(Collectors.groupingBy(LabelFieldInfoContentVo::getApplyRange));
|
Map<String, List<LabelFieldInfoContentVo>> groupByRang = labelFieldContentList.stream().collect(Collectors.groupingBy(LabelFieldInfoContentVo::getApplyRange));
|
||||||
// 筛选应用范围是否有私用的画像
|
// 筛选应用范围是否有私用的画像
|
||||||
List<LabelFieldInfoContentVo> privateLabelFields = groupByRang.get("PRIVATE");
|
List<LabelFieldInfoContentVo> privateLabelFields = groupByRang.getOrDefault("PRIVATE", new ArrayList<>());
|
||||||
List<LabelFieldInfoContentVo> publicLabelFields = groupByRang.get("PUBLIC");
|
List<LabelFieldInfoContentVo> publicLabelFields = groupByRang.getOrDefault("PUBLIC", new ArrayList<>());
|
||||||
|
|
||||||
Map<Long, List<LabelFieldInfoContentVo>> groupByPartition = privateLabelFields.stream().collect(Collectors.groupingBy(LabelFieldInfoContentVo::getTaskPartitionDictId));
|
|
||||||
nodeList.forEach(node -> {
|
nodeList.forEach(node -> {
|
||||||
List<LabelFieldInfoContentVo> nodeLabelFields = groupByPartition.get(node.getTaskPartitionDictId());
|
if (StringUtils.contains(node.getNodeContent(), "data-w-e-type")) {
|
||||||
if (CollectionUtils.isEmpty(nodeLabelFields)) {
|
boolean hasPrivate = false;
|
||||||
Document document = Jsoup.parse(node.getNodeContent());
|
List<LabelFieldInfoContentVo> nodeLabelFields = new ArrayList<>();
|
||||||
// 需要提取的span
|
if (StringUtils.isNotBlank(node.getNodeContent()) && StringUtils.contains("data-w-e-type", node.getNodeContent())) {
|
||||||
Elements spanlist = document.select("span[data-w-e-type]");
|
if (!CollectionUtils.isEmpty(privateLabelFields)) {
|
||||||
Map<String, LabelFieldInfoContentVo> map = publicLabelFields.stream().collect(Collectors.toMap(LabelFieldInfoContentVo::getFieldCode,LabelFieldInfoContentVo->LabelFieldInfoContentVo ,(key1,key2)->key2));
|
Map<Long, List<LabelFieldInfoContentVo>> groupByPartition = privateLabelFields.stream().collect(Collectors.groupingBy(LabelFieldInfoContentVo::getTaskPartitionDictId));
|
||||||
|
nodeLabelFields = groupByPartition.get(node.getTaskPartitionDictId());
|
||||||
for (Element span : spanlist) {
|
if (!CollectionUtils.isEmpty(nodeLabelFields)) {
|
||||||
String paramKey = span.attr("data-fieldMark");
|
hasPrivate = true;
|
||||||
|
|
||||||
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 {
|
}
|
||||||
|
if (hasPrivate) {
|
||||||
|
// 从公共和私有查询标签
|
||||||
Map<String, List<LabelFieldInfoContentVo>> groupBySn = nodeLabelFields.stream().collect(Collectors.groupingBy(LabelFieldInfoContentVo::getPortraitSn));
|
Map<String, List<LabelFieldInfoContentVo>> groupBySn = nodeLabelFields.stream().collect(Collectors.groupingBy(LabelFieldInfoContentVo::getPortraitSn));
|
||||||
// 查询node中的标签
|
// 查询node中的标签
|
||||||
if (!CollectionUtils.isEmpty(publicLabelFields) && StringUtils.isNotBlank(node.getNodeContent()) && StringUtils.contains("data-w-e-type", node.getNodeContent())) {
|
if (!CollectionUtils.isEmpty(publicLabelFields)) {
|
||||||
Document document = Jsoup.parse(node.getNodeContent());
|
Document document = Jsoup.parse(node.getNodeContent());
|
||||||
// 需要提取的span
|
// 需要提取的span
|
||||||
Elements spanlist = document.select("span[data-w-e-type]");
|
Elements spanlist = document.select("span[data-w-e-type]");
|
||||||
@ -550,8 +529,41 @@ public class SignPatientRecordServiceImpl implements ISignPatientRecordService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
|
// 只取公共标签
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
if (!CollectionUtils.isEmpty(paramsCurrentList)) {
|
if (!CollectionUtils.isEmpty(paramsCurrentList)) {
|
||||||
patientNodeParamsCurrentMapper.insertList(paramsCurrentList);
|
patientNodeParamsCurrentMapper.insertList(paramsCurrentList);
|
||||||
@ -559,4 +571,5 @@ public class SignPatientRecordServiceImpl implements ISignPatientRecordService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -786,11 +786,11 @@
|
|||||||
sdn.route_node_name routeNodeName,
|
sdn.route_node_name routeNodeName,
|
||||||
sdn.route_node_day routeNodeDay,
|
sdn.route_node_day routeNodeDay,
|
||||||
sdn.execute_time executionTime,
|
sdn.execute_time executionTime,
|
||||||
GROUP_CONCAT(sdn.task_type SEPARATOR ',') as taskPartitionCodes,
|
GROUP_CONCAT(sdn.task_node_type SEPARATOR ',') as taskPartitionCodes,
|
||||||
GROUP_CONCAT(dic.dict_label SEPARATOR ',') as taskPartitionDictNames
|
GROUP_CONCAT(dic.dict_label SEPARATOR ',') as taskPartitionDictNames
|
||||||
from sign_patient_manage_route_node sdn
|
from sign_patient_manage_route_node sdn
|
||||||
left join sys_dict_data dic on sdn.task_type = dic.dict_value
|
left join sys_dict_data dic on sdn.task_node_type = dic.dict_value
|
||||||
where sdn.manage_route_id = #{manageRouteId} and dic.dict_type ='task_content'
|
where sdn.manage_route_id = #{manageRouteId} and dic.dict_type ='task_node_type'
|
||||||
group by sdn.route_node_name, sdn.route_node_day
|
group by sdn.route_node_name, sdn.route_node_day
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
@ -799,12 +799,12 @@
|
|||||||
node.*,
|
node.*,
|
||||||
dic.dict_label as taskTypeName
|
dic.dict_label as taskTypeName
|
||||||
from sign_patient_manage_route_node node
|
from sign_patient_manage_route_node node
|
||||||
left join sys_dict_data dic on node.task_type = dic.dict_value
|
left join sys_dict_data dic on node.task_node_type = dic.dict_value
|
||||||
where node.manage_route_id in
|
where node.manage_route_id in
|
||||||
<foreach item="manageRouteId" collection="manageRouteIds" open="(" separator="," close=")">
|
<foreach item="manageRouteId" collection="manageRouteIds" open="(" separator="," close=")">
|
||||||
#{manageRouteId}
|
#{manageRouteId}
|
||||||
</foreach>
|
</foreach>
|
||||||
and dic.dict_type ='task_content'
|
and dic.dict_type ='task_node_type'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectNodesByManageIds" resultMap="SignPatientManageRouteNodeResult">
|
<select id="selectNodesByManageIds" resultMap="SignPatientManageRouteNodeResult">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user