修改生成任务。

This commit is contained in:
haown 2024-07-11 17:39:41 +08:00
parent affaec809e
commit aa6681fbf8
7 changed files with 118 additions and 29 deletions

View File

@ -36,4 +36,9 @@ public class KnowledgeBaseConstants {
* 问卷
*/
public static final String QUESTION = "QUESTION";
/**
* 专病路径
*/
public static final String DISEASEROUTE = "DISEASEROUTE";
}

View File

@ -0,0 +1,25 @@
package com.xinelu.common.constant;
/**
* @description: 任务节点类型常量
* @author: haown
* @create: 2024-07-11 16:07
**/
public class TaskNodeTypeConstants {
/**
* 电话外呼
*/
public static final String PHONE_OUTBOUND = "PHONE_OUTBOUND";
/**
* 问卷量表
*/
public static final String QUESTIONNAIRE_SCALE = "QUESTIONNAIRE_SCALE";
/**
* 宣教文章
*/
public static final String PROPAGANDA_ARTICLE = "PROPAGANDA_ARTICLE";
/**
* 文字提醒
*/
public static final String TEXT_REMIND = "TEXT_REMIND";
}

View File

@ -31,4 +31,8 @@ public enum TaskNodeTypeEnum {
TaskNodeTypeEnum(String info) {
this.info = info;
}
public String getInfo() {
return info;
}
}

View File

@ -109,4 +109,16 @@ public class BaseInfoQueryDto {
@ApiModelProperty(value = "问卷状态已发布PUBLISHED未发布UNPUBLISHED")
private String questionnaireStatus;
/**
* 路径分类全部ALL科室管理路径DEPARTMENT_MANAGE_PATH专病管理路径SPECIAL_DIEASE_MANAGE_PATH
*/
@ApiModelProperty(value = "路径分类全部ALL科室管理路径DEPARTMENT_MANAGE_PATH专病管理路径SPECIAL_DIEASE_MANAGE_PATH")
private String routeClassify;
/**
* 发布状态全部ALL已发布PUBLISHED未发布UNPUBLISHED
*/
@ApiModelProperty(value = "发布状态全部ALL已发布PUBLISHED未发布UNPUBLISHED")
private String releaseStatus;
}

View File

@ -33,6 +33,7 @@ import com.xinelu.manage.dto.questioninfo.QuestionInfoDto;
import com.xinelu.manage.dto.script.ScriptInfoDto;
import com.xinelu.manage.dto.servicepackage.ServicePackageAddDTO;
import com.xinelu.manage.dto.servicepackage.ServicePackageDto;
import com.xinelu.manage.dto.specialdiseaseroute.SpecialDiseaseRouteDTO;
import com.xinelu.manage.dto.textmessage.TextMessageDTO;
import com.xinelu.manage.dto.textmessage.TextMessageTaskDTO;
import com.xinelu.manage.dto.wechattemplate.WechatTemplateDTO;
@ -56,6 +57,7 @@ import com.xinelu.manage.service.propagandainfo.IPropagandaInfoService;
import com.xinelu.manage.service.questioninfo.IQuestionInfoService;
import com.xinelu.manage.service.scriptInfo.IScriptInfoService;
import com.xinelu.manage.service.servicepackage.IServicePackageService;
import com.xinelu.manage.service.specialdiseaseroute.ISpecialDiseaseRouteService;
import com.xinelu.manage.service.textmessage.ITextMessageService;
import com.xinelu.manage.service.wechattemplate.IWechatTemplateService;
import com.xinelu.manage.vo.questionInfo.QuestionVO;
@ -63,6 +65,7 @@ import com.xinelu.manage.vo.questionsubject.QuestionSubjectVO;
import com.xinelu.manage.vo.questionsubjectoption.QuestionSubjectOptionVO;
import com.xinelu.manage.vo.servicepackage.ServicePackageVO;
import com.xinelu.manage.vo.servicepackagecontent.ServicePackageContentVO;
import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteVO;
import com.xinelu.manage.vo.textmessage.TextMessageVO;
import com.xinelu.manage.vo.wechattemplate.WechatTemplateTaskVO;
import java.time.LocalDateTime;
@ -125,6 +128,8 @@ public class KnowledgeBaseServiceImpl implements IKnowledgeBaseService {
private IQuestionInfoService questionInfoService;
@Resource
private QuestionSubjectOptionMapper questionSubjectOptionMapper;
@Resource
private ISpecialDiseaseRouteService specialDiseaseRouteService;
@Override
public TableDataInfo getBaseInfoList(BaseInfoQueryDto baseInfoQueryDto) {
@ -217,6 +222,18 @@ public class KnowledgeBaseServiceImpl implements IKnowledgeBaseService {
rspData.setPageNum(new PageInfo(questionInfoList).getPageNum());
rspData.setTotal(new PageInfo(questionInfoList).getTotal());
break;
case KnowledgeBaseConstants.DISEASEROUTE:
SpecialDiseaseRouteDTO specialDiseaseRoute = new SpecialDiseaseRouteDTO();
BeanUtils.copyBeanProp(specialDiseaseRoute, baseInfoQueryDto);
PageUtils.startPage();
List<SpecialDiseaseRouteVO> routeList = specialDiseaseRouteService.selectSpecialDiseaseRouteList(specialDiseaseRoute);
rspData.setCode(HttpStatus.SUCCESS);
rspData.setMsg("查询成功");
rspData.setRows(routeList);
// 返回 页码
rspData.setPageNum(new PageInfo(routeList).getPageNum());
rspData.setTotal(new PageInfo(routeList).getTotal());
break;
}
return rspData;
}
@ -254,6 +271,9 @@ public class KnowledgeBaseServiceImpl implements IKnowledgeBaseService {
case KnowledgeBaseConstants.QUESTION:
saveQuestionInfo(knowledgeBaseSaveDto);
break;
case KnowledgeBaseConstants.DISEASEROUTE:
saveSpecialDiseaseRoute(knowledgeBaseSaveDto);
break;
}
}
@ -518,4 +538,19 @@ public class KnowledgeBaseServiceImpl implements IKnowledgeBaseService {
questionInfoService.insertQuestionInfo(saveObj);
});
}
private void saveSpecialDiseaseRoute(KnowledgeBaseSaveDto knowledgeBaseSaveDto) {
knowledgeBaseSaveDto.getSourceTemplateIds().forEach(sourceId -> {
SpecialDiseaseRouteVO specialDiseaseRouteVO = specialDiseaseRouteService.selectSpecialDiseaseRouteById(sourceId);
SpecialDiseaseRouteVO saveObj = new SpecialDiseaseRouteVO();
BeanUtils.copyBeanProp(saveObj, specialDiseaseRouteVO);
saveObj.setId(null);
saveObj.setDepartmentId(knowledgeBaseSaveDto.getDepartmentId());
saveObj.setDepartmentName(knowledgeBaseSaveDto.getDepartmentName());
// 节点信息
specialDiseaseRouteService.insertSpecialDiseaseRoute(saveObj);
});
}
}

View File

@ -4,9 +4,16 @@ import com.alibaba.fastjson2.JSONObject;
import com.xinelu.common.annotation.DataScope;
import com.xinelu.common.constant.TaskContentConstants;
import com.xinelu.common.constant.TaskCreateTypeConstant;
import com.xinelu.common.constant.TaskNodeTypeConstants;
import com.xinelu.common.constant.TemplateTypeConstants;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.enums.*;
import com.xinelu.common.enums.NodeExecuteStatusEnum;
import com.xinelu.common.enums.PhoneConnectStatusEnum;
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.TaskNodeTypeEnum;
import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.AgeUtil;
import com.xinelu.common.utils.SecurityUtils;
@ -486,9 +493,9 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
JSONObject templateDetail = new JSONObject();
// 根据模板类型存放模板字段
if(StringUtils.isNotBlank(node.getTemplateType())) {
switch(node.getTemplateType()) {
switch(node.getTaskNodeType()) {
// 宣教
case TemplateTypeConstants.PROPAGANDA:
case TaskNodeTypeConstants.PROPAGANDA_ARTICLE:
manageRouteNode.setPropagandaInfoId(node.getTemplateId());
manageRouteNode.setPropagandaTitle(node.getTemplateName());
// 查询宣教表
@ -498,7 +505,7 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
manageRouteNode.setTemplateDetail(templateDetail);
break;
// 问卷
case TemplateTypeConstants.QUESTIONNAIRE:
case TaskNodeTypeConstants.QUESTIONNAIRE_SCALE:
manageRouteNode.setQuestionInfoId(node.getTemplateId());
manageRouteNode.setQuestionnaireName(node.getTemplateName());
// 查询问卷详情
@ -510,7 +517,7 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
}
break;
// 话术
case TemplateTypeConstants.SCRIPT:
case TaskNodeTypeConstants.PHONE_OUTBOUND:
manageRouteNode.setPhoneId(node.getPhoneTemplateId());
// 查询话术
ScriptInfo scriptInfo = scriptInfoMapper.selectScriptInfoById(node.getPhoneTemplateId());
@ -552,7 +559,7 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
JSONObject templateDetail = new JSONObject();
switch(manageNode.getTaskType()) {
// 电话外呼
case TaskContentConstants.PHONE_OUTBOUND:
case TaskNodeTypeConstants.PHONE_OUTBOUND:
// 电话外呼分为话术和问卷两种根据模板id判断选择的哪种模板
if (manageNode.getPhoneId() != null) { // 话术
ScriptInfo scriptInfo = scriptInfoMapper.selectScriptInfoById(manageNode.getPhoneId());
@ -579,7 +586,7 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
}
break;
// 问卷
case TaskContentConstants.QUESTIONNAIRE_SCALE:
case TaskNodeTypeConstants.QUESTIONNAIRE_SCALE:
// 查询问卷详情
QuestionVO questionVO = questionInfoService.selectQuestionInfoById(manageNode.getQuestionInfoId());
if (ObjectUtils.isNotEmpty(questionVO)) {
@ -589,7 +596,7 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
}
break;
// 宣教
case TaskContentConstants.PROPAGANDA_ARTICLE:
case TaskNodeTypeConstants.PROPAGANDA_ARTICLE:
// 查询宣教详情
PropagandaMaterialsVo propagandaMaterialsVo = propagandaInfoService.selectPropagandaInfoById(manageNode.getPropagandaInfoId());
if (ObjectUtils.isNotEmpty(propagandaMaterialsVo)) {
@ -599,21 +606,21 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
}
break;
// 文字提醒
case TaskContentConstants.TEXT_REMIND:
case TaskNodeTypeConstants.TEXT_REMIND:
manageNode.setTemplateType(TaskContentConstants.TEXT_REMIND);
break;
// 人工随访
case TaskContentConstants.ARTIFICIAL_FOLLOW_UP:
// 查询问卷详情
if (manageNode.getFollowTemplateId() != null) {
QuestionVO questionVO1 = questionInfoService.selectQuestionInfoById(manageNode.getFollowTemplateId());
if (ObjectUtils.isNotEmpty(questionVO1)) {
templateDetail = JSONObject.parseObject(JSONObject.toJSONString(questionVO1));
manageNode.setTemplateType(TemplateTypeConstants.QUESTIONNAIRE);
manageNode.setTemplateDetail(templateDetail);
}
}
break;
//case TaskContentConstants.ARTIFICIAL_FOLLOW_UP:
// // 查询问卷详情
// if (manageNode.getFollowTemplateId() != null) {
// QuestionVO questionVO1 = questionInfoService.selectQuestionInfoById(manageNode.getFollowTemplateId());
// if (ObjectUtils.isNotEmpty(questionVO1)) {
// templateDetail = JSONObject.parseObject(JSONObject.toJSONString(questionVO1));
// manageNode.setTemplateType(TemplateTypeConstants.QUESTIONNAIRE);
// manageNode.setTemplateDetail(templateDetail);
// }
// }
// break;
}
manageNodeAuditList.add(manageNode);
});

View File

@ -6,6 +6,7 @@ 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;
import com.xinelu.common.constant.TriggerConditionOperatorConstants;
import com.xinelu.common.constant.TriggerLogicConstants;
@ -657,7 +658,7 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage
manageNodeList.forEach(manageNode -> {
switch(manageNode.getTaskType()) {
// 电话外呼--话术/问卷只替换话术
case TaskContentConstants.PHONE_OUTBOUND:
case TaskNodeTypeConstants.PHONE_OUTBOUND:
if (manageNode.getPhoneId() != null) {
ScriptInfo scriptInfo = scriptInfoMapper.selectScriptInfoById(manageNode.getPhoneId());
if (ObjectUtils.isNotEmpty(scriptInfo)) {
@ -672,14 +673,14 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage
}
break;
// 问卷
case TaskContentConstants.QUESTIONNAIRE_SCALE:
case TaskNodeTypeConstants.QUESTIONNAIRE_SCALE:
// 宣教
case TaskContentConstants.PROPAGANDA_ARTICLE:
case TaskNodeTypeConstants.PROPAGANDA_ARTICLE:
// 文字提醒
case TaskContentConstants.TEXT_REMIND:
case TaskNodeTypeConstants.TEXT_REMIND:
// 人工随访
case TaskContentConstants.ARTIFICIAL_FOLLOW_UP:
break;
//case TaskContentConstants.ARTIFICIAL_FOLLOW_UP:
// break;
}
signPatientManageRouteNodeMapper.updateSignPatientManageRouteNode(manageNode);
});
@ -1008,17 +1009,17 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage
if(StringUtils.isNotBlank(node.getTemplateType())) {
switch(node.getTemplateType()) {
// 宣教
case TemplateTypeConstants.PROPAGANDA:
case TaskNodeTypeConstants.PROPAGANDA_ARTICLE:
manageRouteNode.setPropagandaInfoId(node.getTemplateId());
manageRouteNode.setPropagandaTitle(node.getTemplateName());
break;
// 问卷
case TemplateTypeConstants.QUESTIONNAIRE:
case TaskNodeTypeConstants.QUESTIONNAIRE_SCALE:
manageRouteNode.setQuestionInfoId(node.getTemplateId());
manageRouteNode.setQuestionnaireName(node.getTemplateName());
break;
// 话术
case TemplateTypeConstants.SCRIPT:
case TaskNodeTypeConstants.PHONE_OUTBOUND:
manageRouteNode.setPhoneId(node.getTemplateId());
// 查询话术
ScriptInfo scriptInfo = scriptInfoMapper.selectScriptInfoById(node.getPhoneTemplateId());