From aa6681fbf870bc0fcebd4a2f4e720b14d08818d3 Mon Sep 17 00:00:00 2001 From: haown <454902499@qq.com> Date: Thu, 11 Jul 2024 17:39:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=9F=E6=88=90=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../constant/KnowledgeBaseConstants.java | 5 ++ .../constant/TaskNodeTypeConstants.java | 25 ++++++++++ .../xinelu/common/enums/TaskNodeTypeEnum.java | 4 ++ .../dto/operationinfo/BaseInfoQueryDto.java | 12 +++++ .../impl/KnowledgeBaseServiceImpl.java | 35 ++++++++++++++ .../SignPatientManageRouteServiceImpl.java | 47 +++++++++++-------- ...SignPatientManageRouteNodeServiceImpl.java | 19 ++++---- 7 files changed, 118 insertions(+), 29 deletions(-) create mode 100644 postdischarge-common/src/main/java/com/xinelu/common/constant/TaskNodeTypeConstants.java diff --git a/postdischarge-common/src/main/java/com/xinelu/common/constant/KnowledgeBaseConstants.java b/postdischarge-common/src/main/java/com/xinelu/common/constant/KnowledgeBaseConstants.java index 5c44c9bd..0d721cb1 100644 --- a/postdischarge-common/src/main/java/com/xinelu/common/constant/KnowledgeBaseConstants.java +++ b/postdischarge-common/src/main/java/com/xinelu/common/constant/KnowledgeBaseConstants.java @@ -36,4 +36,9 @@ public class KnowledgeBaseConstants { * 问卷 */ public static final String QUESTION = "QUESTION"; + + /** + * 专病路径 + */ + public static final String DISEASEROUTE = "DISEASEROUTE"; } diff --git a/postdischarge-common/src/main/java/com/xinelu/common/constant/TaskNodeTypeConstants.java b/postdischarge-common/src/main/java/com/xinelu/common/constant/TaskNodeTypeConstants.java new file mode 100644 index 00000000..9fb11ffb --- /dev/null +++ b/postdischarge-common/src/main/java/com/xinelu/common/constant/TaskNodeTypeConstants.java @@ -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"; +} diff --git a/postdischarge-common/src/main/java/com/xinelu/common/enums/TaskNodeTypeEnum.java b/postdischarge-common/src/main/java/com/xinelu/common/enums/TaskNodeTypeEnum.java index 234dce31..c5975a7e 100644 --- a/postdischarge-common/src/main/java/com/xinelu/common/enums/TaskNodeTypeEnum.java +++ b/postdischarge-common/src/main/java/com/xinelu/common/enums/TaskNodeTypeEnum.java @@ -31,4 +31,8 @@ public enum TaskNodeTypeEnum { TaskNodeTypeEnum(String info) { this.info = info; } + + public String getInfo() { + return info; + } } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/dto/operationinfo/BaseInfoQueryDto.java b/postdischarge-manage/src/main/java/com/xinelu/manage/dto/operationinfo/BaseInfoQueryDto.java index 9fbf535a..73ff345f 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/dto/operationinfo/BaseInfoQueryDto.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/dto/operationinfo/BaseInfoQueryDto.java @@ -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; + } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/knowledgebase/impl/KnowledgeBaseServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/knowledgebase/impl/KnowledgeBaseServiceImpl.java index de8d1374..dc3ebf4f 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/knowledgebase/impl/KnowledgeBaseServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/knowledgebase/impl/KnowledgeBaseServiceImpl.java @@ -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 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); + }); + + } } 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 cbbee0dd..069e1da6 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 @@ -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); }); 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 a837c483..cf3bd30c 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 @@ -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());