专病路径详情接口。
This commit is contained in:
parent
d4f39c848c
commit
73cea5a223
@ -86,7 +86,6 @@ public class ServicePackageController extends BaseController {
|
||||
* 获取服务包基础信息
|
||||
*/
|
||||
@ApiOperation("获取服务包基础信息")
|
||||
@PreAuthorize("@ss.hasPermi('manage:servicepackage:query')")
|
||||
@GetMapping(value = "/getById/{id}")
|
||||
public R<ServicePackageVO> getById(@PathVariable("id") Long id) {
|
||||
return R.ok(servicePackageService.getById(id));
|
||||
|
||||
@ -11,8 +11,11 @@ import com.xinelu.common.enums.BusinessType;
|
||||
import com.xinelu.manage.domain.specialdiseaseroute.SpecialDiseaseRoute;
|
||||
import com.xinelu.manage.dto.specialdiseaseroute.SpecialDiseaseRouteDTO;
|
||||
import com.xinelu.manage.service.specialdiseaseroute.ISpecialDiseaseRouteService;
|
||||
import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageNodeAuditVo;
|
||||
import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteAuditVo;
|
||||
import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteInfoVo;
|
||||
import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteVO;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@ -108,12 +111,30 @@ public class SpecialDiseaseRouteController extends BaseController {
|
||||
return AjaxResult.success(specialDiseaseRouteService.editReleaseStatus(specialDiseaseRoute));
|
||||
}
|
||||
|
||||
/**
|
||||
* 富文本解析
|
||||
*/
|
||||
/**
|
||||
* 路径详情->路径信息,获取主路径及子路径信息及节点
|
||||
* @param id 专病路径主键
|
||||
* @return 主路径信息及节点、子路径信息及节点
|
||||
* @author haown
|
||||
* @date 2024-07-26 15:51
|
||||
*/
|
||||
@ApiOperation("路径详情->路径信息")
|
||||
@GetMapping("/getRouteInfo/{id}")
|
||||
public R<SpecialDiseaseRouteAuditVo> getRouteInfo(@PathVariable("id") Long id){
|
||||
return R.ok(specialDiseaseRouteService.getRouteAuditInfo(id));
|
||||
}
|
||||
|
||||
public List<String> jsoupParse(Long specialDiseaseNodeId) {
|
||||
return specialDiseaseRouteService.jsoupParse(specialDiseaseNodeId);
|
||||
}
|
||||
/**
|
||||
* 路径详情->路径任务,获取主路径及子路径信息及节点
|
||||
* @param id 专病路径主键
|
||||
* @return 主路径信息及节点、子路径信息及节点
|
||||
* @author haown
|
||||
* @date 2024-07-26 16:00
|
||||
*/
|
||||
@ApiOperation("路径详情->路径任务")
|
||||
@GetMapping("/getRouteNodeInfo/{id}")
|
||||
public R<List<SignPatientManageNodeAuditVo>> getRouteNodeInfo(@PathVariable("id") Long id){
|
||||
return R.ok(specialDiseaseRouteService.getRouteNodeInfo(id));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -134,13 +134,6 @@ public interface ISignPatientManageRouteNodeService {
|
||||
*/
|
||||
void updateTaskWithParam(List<List<PatientNodeParamsCurrent>> paramsCurrentLists);
|
||||
|
||||
/**
|
||||
* 手动生成任务
|
||||
* @param manageRouteNodeId 患者管理节点id
|
||||
* @param taskType 任务类型
|
||||
*/
|
||||
void generateTask(Long manageRouteNodeId, String taskType);
|
||||
|
||||
LocalDateTime getExecuteTime(LocalTime executeTime, String routeNodeName, Integer routeNodeDay, PatientVisitRecord patientVisitRecord);
|
||||
|
||||
/**
|
||||
|
||||
@ -3,9 +3,7 @@ package com.xinelu.manage.service.signpatientmanageroutenode.impl;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.xinelu.common.annotation.DataScope;
|
||||
import com.xinelu.common.constant.ApplyRangeContant;
|
||||
import com.xinelu.common.constant.PhoneMessageRemindConstants;
|
||||
import com.xinelu.common.constant.RouteNodeNameConstants;
|
||||
import com.xinelu.common.constant.TaskContentConstants;
|
||||
import com.xinelu.common.constant.TaskCreateTypeConstant;
|
||||
import com.xinelu.common.constant.TaskNodeTypeConstants;
|
||||
import com.xinelu.common.constant.TemplateTypeConstants;
|
||||
@ -548,37 +546,6 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 手动创建任务
|
||||
* @param manageRouteNodeId 患者管理节点id
|
||||
* @param taskType 任务类型
|
||||
*/
|
||||
@Override public void generateTask(Long manageRouteNodeId, String taskType) {
|
||||
if (StringUtils.isBlank(taskType)) {
|
||||
throw new ServiceException("请输入任务类型");
|
||||
}
|
||||
SignPatientManageRouteNode signNode = signPatientManageRouteNodeMapper.selectSignPatientManageRouteNodeById(manageRouteNodeId);
|
||||
switch(taskType) {
|
||||
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("短信模板不存在或短信模板内容为空,请联系管理员!");
|
||||
//}
|
||||
signNode.setId(null);
|
||||
signNode.setNodeContent(signNode.getPhoneMessageTemplateContent());
|
||||
signNode.setRouteCheckStatus(RouteCheckStatusEnum.AGREE.getInfo());
|
||||
signNode.setNodeExecuteStatus(NodeExecuteStatusEnum.UNEXECUTED.getInfo());
|
||||
signPatientManageRouteNodeMapper.insertSignPatientManageRouteNode(signNode);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取节点执行时间
|
||||
* @param executeTime 节点执行时间,HH:mm
|
||||
|
||||
@ -3,6 +3,7 @@ package com.xinelu.manage.service.specialdiseaseroute;
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.manage.domain.specialdiseaseroute.SpecialDiseaseRoute;
|
||||
import com.xinelu.manage.dto.specialdiseaseroute.SpecialDiseaseRouteDTO;
|
||||
import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageNodeAuditVo;
|
||||
import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteAuditVo;
|
||||
import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteInfoVo;
|
||||
import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteVO;
|
||||
@ -86,18 +87,19 @@ public interface ISpecialDiseaseRouteService {
|
||||
*/
|
||||
int editReleaseStatus(SpecialDiseaseRoute specialDiseaseRoute);
|
||||
|
||||
/**
|
||||
* 富文本解析
|
||||
*
|
||||
* @param specialDiseaseNodeId 节点id
|
||||
* @return List<String>
|
||||
*/
|
||||
List<String> jsoupParse(Long specialDiseaseNodeId);
|
||||
|
||||
/**
|
||||
* 路径审核->路径信息获取主路径及子路径信息及节点
|
||||
* @param routeId 主路径主键
|
||||
* @return 主路径信息及节点、子路径信息及节点
|
||||
*/
|
||||
SpecialDiseaseRouteAuditVo getRouteAuditInfo(Long routeId);
|
||||
|
||||
/**
|
||||
* 路径详情->路径任务,节点详细信息
|
||||
* @param id 签约记录主键
|
||||
* @return 节点详细信息列表
|
||||
* @author haown
|
||||
* @date 2024-07-26 16:00
|
||||
*/
|
||||
List<SignPatientManageNodeAuditVo> getRouteNodeInfo(Long id);
|
||||
}
|
||||
|
||||
@ -1,26 +1,40 @@
|
||||
package com.xinelu.manage.service.specialdiseaseroute.impl;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.xinelu.common.constant.Constants;
|
||||
import com.xinelu.common.constant.TaskNodeTypeConstants;
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.common.enums.ReleaseStatusEnum;
|
||||
import com.xinelu.common.enums.RouteCheckStatusEnum;
|
||||
import com.xinelu.common.enums.RouteNodeNameEnum;
|
||||
import com.xinelu.common.exception.ServiceException;
|
||||
import com.xinelu.common.utils.SecurityUtils;
|
||||
import com.xinelu.common.utils.bean.BeanUtils;
|
||||
import com.xinelu.common.utils.codes.GenerateSystemCodeUtil;
|
||||
import com.xinelu.manage.domain.agency.Agency;
|
||||
import com.xinelu.manage.domain.specialdiseasenode.SpecialDiseaseNode;
|
||||
import com.xinelu.manage.domain.scriptInfo.ScriptInfo;
|
||||
import com.xinelu.manage.domain.specialdiseaseroute.SpecialDiseaseRoute;
|
||||
import com.xinelu.manage.domain.specialdiseaseroutepackage.SpecialDiseaseRoutePackage;
|
||||
import com.xinelu.manage.domain.textmessage.TextMessage;
|
||||
import com.xinelu.manage.domain.wechattemplate.WechatTemplate;
|
||||
import com.xinelu.manage.dto.specialdiseaseroute.SpecialDiseaseRouteDTO;
|
||||
import com.xinelu.manage.mapper.agency.AgencyMapper;
|
||||
import com.xinelu.manage.mapper.scriptInfo.ScriptInfoMapper;
|
||||
import com.xinelu.manage.mapper.specialdiseasenode.SpecialDiseaseNodeMapper;
|
||||
import com.xinelu.manage.mapper.specialdiseaseroute.SpecialDiseaseRouteMapper;
|
||||
import com.xinelu.manage.mapper.specialdiseaseroutepackage.SpecialDiseaseRoutePackageMapper;
|
||||
import com.xinelu.manage.mapper.specialdiseasetriggercondition.SpecialDiseaseTriggerConditionMapper;
|
||||
import com.xinelu.manage.mapper.textmessage.TextMessageMapper;
|
||||
import com.xinelu.manage.mapper.wechattemplate.WechatTemplateMapper;
|
||||
import com.xinelu.manage.service.propagandainfo.IPropagandaInfoService;
|
||||
import com.xinelu.manage.service.questioninfo.IQuestionInfoService;
|
||||
import com.xinelu.manage.service.specialdiseaseroute.ISpecialDiseaseRouteService;
|
||||
import com.xinelu.manage.vo.department.DepartmentBaseVo;
|
||||
import com.xinelu.manage.vo.department.DepartmentVO;
|
||||
import com.xinelu.manage.vo.propagandainfo.PropagandaMaterialsVo;
|
||||
import com.xinelu.manage.vo.questionInfo.QuestionVO;
|
||||
import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageNodeAuditVo;
|
||||
import com.xinelu.manage.vo.specialdiseasenode.RouteTaskAuditVo;
|
||||
import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteAuditVo;
|
||||
import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteInfoVo;
|
||||
import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteVO;
|
||||
@ -33,10 +47,6 @@ import javax.annotation.Resource;
|
||||
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;
|
||||
|
||||
@ -60,7 +70,16 @@ public class SpecialDiseaseRouteServiceImpl implements ISpecialDiseaseRouteServi
|
||||
private SpecialDiseaseRoutePackageMapper specialDiseaseRoutePackageMapper;
|
||||
@Resource
|
||||
private AgencyMapper agencyMapper;
|
||||
|
||||
@Resource
|
||||
private ScriptInfoMapper scriptInfoMapper;
|
||||
@Resource
|
||||
private IQuestionInfoService questionInfoService;
|
||||
@Resource
|
||||
private IPropagandaInfoService propagandaInfoService;
|
||||
@Resource
|
||||
private TextMessageMapper textMessageMapper;
|
||||
@Resource
|
||||
private WechatTemplateMapper wechatTemplateMapper;
|
||||
|
||||
/**
|
||||
* 查询专病路径信息
|
||||
@ -268,24 +287,96 @@ public class SpecialDiseaseRouteServiceImpl implements ISpecialDiseaseRouteServi
|
||||
public SpecialDiseaseRouteAuditVo getRouteAuditInfo(Long routeId) {
|
||||
return specialDiseaseRouteMapper.getRouteAuditInfo(routeId);
|
||||
}
|
||||
/**
|
||||
* 富文本解析
|
||||
*
|
||||
* @param specialDiseaseNodeId 节点id
|
||||
* @return List<String>
|
||||
*/
|
||||
public List<String> jsoupParse(Long specialDiseaseNodeId) {
|
||||
SpecialDiseaseNode specialDiseaseNode = specialDiseaseNodeMapper.selectSpecialDiseaseNodeById(specialDiseaseNodeId);
|
||||
if (Objects.isNull(specialDiseaseNode) || StringUtils.isBlank(specialDiseaseNode.getNodeContent())) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
String xmlString = specialDiseaseNode.getNodeContent();
|
||||
Document doc = Jsoup.parse(xmlString);
|
||||
Elements select = doc.select("span[data-w-e-type]");
|
||||
List<String> strings = new ArrayList<>();
|
||||
for (Element element : select) {
|
||||
strings.add(String.valueOf(element));
|
||||
}
|
||||
return strings;
|
||||
}
|
||||
|
||||
/**
|
||||
* 路径详情->路径任务,节点详细信息
|
||||
* @param id 签约记录主键
|
||||
* @return 节点详细信息列表
|
||||
* @author haown
|
||||
* @date 2024-07-26 16:00
|
||||
*/
|
||||
@Override
|
||||
public List<SignPatientManageNodeAuditVo> getRouteNodeInfo(Long id) {
|
||||
List<SignPatientManageNodeAuditVo> manageNodeAuditList = new ArrayList<>();
|
||||
SpecialDiseaseRoute specialDiseaseRoute = specialDiseaseRouteMapper.selectSpecialDiseaseRouteById(id);
|
||||
// 查询主路径及子路径节点
|
||||
List<RouteTaskAuditVo> nodeList = specialDiseaseNodeMapper.getByParentRouteId(id);
|
||||
|
||||
// 组装数据
|
||||
nodeList.forEach(node -> {
|
||||
SignPatientManageNodeAuditVo manageRouteNode = new SignPatientManageNodeAuditVo();
|
||||
BeanUtils.copyBeanProp(manageRouteNode, node);
|
||||
manageRouteNode.setManageRouteName(specialDiseaseRoute.getRouteName());
|
||||
manageRouteNode.setId(null);
|
||||
manageRouteNode.setRouteNodeId(node.getId());
|
||||
manageRouteNode.setExecuteTime(node.getExecutionTime());
|
||||
manageRouteNode.setRouteNodeNameCN(RouteNodeNameEnum.getNameByInfo(node.getRouteNodeName()).getName());
|
||||
|
||||
JSONObject templateDetail = new JSONObject();
|
||||
// 根据模板类型,存放模板字段
|
||||
if (StringUtils.isNotBlank(node.getTaskNodeType())) {
|
||||
switch (node.getTaskNodeType()) {
|
||||
// 宣教
|
||||
case TaskNodeTypeConstants.PROPAGANDA_ARTICLE:
|
||||
manageRouteNode.setPropagandaInfoId(node.getTemplateId());
|
||||
manageRouteNode.setPropagandaTitle(node.getTemplateName());
|
||||
// 查询宣教表
|
||||
if (manageRouteNode.getPropagandaInfoId() != null) {
|
||||
PropagandaMaterialsVo propagandaMaterialsVo = propagandaInfoService.selectPropagandaInfoById(node.getTemplateId());
|
||||
if (ObjectUtils.isNotEmpty(propagandaMaterialsVo)) {
|
||||
templateDetail = JSONObject.parseObject(JSONObject.toJSONString(propagandaMaterialsVo));
|
||||
manageRouteNode.setTemplateDetail(templateDetail);
|
||||
}
|
||||
}
|
||||
break;
|
||||
// 问卷
|
||||
case TaskNodeTypeConstants.QUESTIONNAIRE_SCALE:
|
||||
manageRouteNode.setQuestionInfoId(node.getTemplateId());
|
||||
manageRouteNode.setQuestionnaireName(node.getTemplateName());
|
||||
// 查询问卷详情
|
||||
QuestionVO questionVO = questionInfoService.selectQuestionInfoById(node.getTemplateId());
|
||||
if (ObjectUtils.isNotEmpty(questionVO)) {
|
||||
templateDetail = JSONObject.parseObject(JSONObject.toJSONString(questionVO));
|
||||
manageRouteNode.setTemplateDetail(templateDetail);
|
||||
}
|
||||
break;
|
||||
// 话术
|
||||
case TaskNodeTypeConstants.PHONE_OUTBOUND:
|
||||
manageRouteNode.setPhoneId(node.getPhoneTemplateId());
|
||||
// 查询话术
|
||||
ScriptInfo scriptInfo = scriptInfoMapper.selectScriptInfoById(node.getPhoneTemplateId());
|
||||
if (ObjectUtils.isNotEmpty(scriptInfo)) {
|
||||
// 话术库json内容替换
|
||||
manageRouteNode.setPhoneNodeContent(scriptInfo.getFlowScheme());
|
||||
templateDetail = JSONObject.parseObject(JSONObject.toJSONString(scriptInfo));
|
||||
manageRouteNode.setTemplateDetail(templateDetail);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
// 查询短信、公众号、小程序内容
|
||||
if (node.getMessageTemplateId() != null) {
|
||||
// 替换短信模板
|
||||
TextMessage textMessage = textMessageMapper.selectTextMessageById(node.getMessageTemplateId());
|
||||
manageRouteNode.setMessageNodeContent(ObjectUtils.isEmpty(textMessage) ? "" : textMessage.getTextMessageContent());
|
||||
}
|
||||
if (node.getPhoneMessageTemplateId() != null) {
|
||||
// 替换短信模板
|
||||
TextMessage textMessage = textMessageMapper.selectTextMessageById(node.getPhoneMessageTemplateId());
|
||||
manageRouteNode.setPhoneMessageTemplateContent(ObjectUtils.isEmpty(textMessage) ? "" : textMessage.getTextMessageContent());
|
||||
}
|
||||
// 替换公众号模板
|
||||
if (node.getOfficialPushSign() != null && node.getOfficialPushSign() == 1) {
|
||||
WechatTemplate wechatTemplate = wechatTemplateMapper.selectWechatTemplateById(node.getOfficialTemplateId());
|
||||
manageRouteNode.setOfficialNodeContent(ObjectUtils.isEmpty(wechatTemplate) ? "" : wechatTemplate.getTemplateContent());
|
||||
}
|
||||
// 替换小程序模板
|
||||
if (node.getAppletPushSign() != null && node.getAppletPushSign() == 1) {
|
||||
WechatTemplate wechatTemplate = wechatTemplateMapper.selectWechatTemplateById(node.getAppletTemplateId());
|
||||
manageRouteNode.setAppletNodeContent(ObjectUtils.isEmpty(wechatTemplate) ? "" : wechatTemplate.getTemplateContent());
|
||||
}
|
||||
manageNodeAuditList.add(manageRouteNode);
|
||||
});
|
||||
return manageNodeAuditList;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user