From a697410e520f1db07db3dde1b2f14ef3d05598d8 Mon Sep 17 00:00:00 2001 From: haown <454902499@qq.com> Date: Fri, 31 May 2024 17:04:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B5=8B=E8=AF=95=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SignPatientManageRouteNodeController.java | 26 ++++++++----- .../SignPatientManageRouteNodeMapper.java | 2 +- .../PatientNodeParamsCurrentServiceImpl.java | 4 +- .../ISignPatientManageRouteNodeService.java | 7 ++++ ...SignPatientManageRouteNodeServiceImpl.java | 37 +++++++++++++++++++ .../impl/SpecialDiseaseNodeServiceImpl.java | 37 ++++++------------- .../impl/SpecialDiseaseRouteServiceImpl.java | 1 - 7 files changed, 73 insertions(+), 41 deletions(-) diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/signpatientmanageroutenode/SignPatientManageRouteNodeController.java b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/signpatientmanageroutenode/SignPatientManageRouteNodeController.java index 93eecb0a..8708c160 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/signpatientmanageroutenode/SignPatientManageRouteNodeController.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/signpatientmanageroutenode/SignPatientManageRouteNodeController.java @@ -5,11 +5,11 @@ import com.xinelu.common.core.domain.R; import com.xinelu.common.core.page.TableDataInfo; import com.xinelu.common.exception.ServiceException; import com.xinelu.common.utils.StringUtils; -import com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRouteNode; 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.service.signpatientmanageroutenode.ISignPatientManageRouteNodeService; +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.SignPatientManageRouteNodeVo; @@ -55,8 +55,7 @@ public class SignPatientManageRouteNodeController extends BaseController { @ApiOperation("患者任务列表查询") @GetMapping("/getList") public R> getList(SignPatientManageRouteNodeDto signPatientManageRouteNodeDto) { - List list = signNodeService.selectPatientManageNodeList(signPatientManageRouteNodeDto); - return R.ok(list); + return R.ok(signNodeService.selectPatientManageNodeList(signPatientManageRouteNodeDto)); } /** @@ -64,19 +63,27 @@ public class SignPatientManageRouteNodeController extends BaseController { */ @ApiOperation("查询节点详情") @GetMapping("/getById/{id}") - public R getById(@PathVariable("id") Long id) { + public R getById(@PathVariable("id") Long id) { return R.ok(signNodeService.selectSignPatientManageRouteNodeById(id)); } + /** + * 根据节点类型查询节点列表详情 + */ + @ApiOperation("根据节点类型查询节点列表详情") + @GetMapping("/getNodeListByPatient") + public R> getNodeListByPatient(PatientTaskDto patientTaskDto) { + return R.ok(signNodeService.getNodeListByPatient(patientTaskDto)); + } + /** - * 患者详情--查询患者手动创建的任务节点列表 + * 患者详情--查询患者任务路径及节点列表 */ - @ApiOperation("患者详情--查询患者手动创建的任务节点列表") + @ApiOperation("患者详情--查询患者任务路径及节点列表") @GetMapping("/getNodeList") public R> getNodeList(PatientTaskDto patientTaskDto) { - List list = signNodeService.getNodeList(patientTaskDto); - return R.ok(list); + return R.ok(signNodeService.getNodeList(patientTaskDto)); } /** @@ -94,8 +101,7 @@ public class SignPatientManageRouteNodeController extends BaseController { if (StringUtils.isBlank(patientTaskDto.getTaskCreateType())) { throw new ServiceException("请选择任务创建类型!"); } - List list = signNodeService.getRouteNodeList(patientTaskDto); - return R.ok(list); + return R.ok(signNodeService.getRouteNodeList(patientTaskDto)); } /** diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/signpatientmanageroutenode/SignPatientManageRouteNodeMapper.java b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/signpatientmanageroutenode/SignPatientManageRouteNodeMapper.java index d6d9e94c..341bdf92 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/signpatientmanageroutenode/SignPatientManageRouteNodeMapper.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/signpatientmanageroutenode/SignPatientManageRouteNodeMapper.java @@ -21,7 +21,7 @@ public interface SignPatientManageRouteNodeMapper { * @param id 签约患者管理任务路径节点主键 * @return 签约患者管理任务路径节点 */ - public SignPatientManageRouteNode selectSignPatientManageRouteNodeById(Long id); + SignPatientManageRouteNode selectSignPatientManageRouteNodeById(Long id); /** * 查询患者管理路径节点 diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientnodeparamscurrent/impl/PatientNodeParamsCurrentServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientnodeparamscurrent/impl/PatientNodeParamsCurrentServiceImpl.java index 51f662bf..d0ac5ce0 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientnodeparamscurrent/impl/PatientNodeParamsCurrentServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientnodeparamscurrent/impl/PatientNodeParamsCurrentServiceImpl.java @@ -149,7 +149,7 @@ public class PatientNodeParamsCurrentServiceImpl implements IPatientNodeParamsCu } // 删除参数 if (CollectionUtils.isNotEmpty(deleteIds)) { - patientNodeParamsCurrentMapper.deletePatientNodeParamsCurrentByIds(deleteIds.stream().toArray(Long[]::new)); + patientNodeParamsCurrentMapper.deletePatientNodeParamsCurrentByIds(deleteIds.toArray(new Long[0])); } // 新增的参数保存 if (CollectionUtils.isNotEmpty(saveList)) { @@ -166,8 +166,6 @@ public class PatientNodeParamsCurrentServiceImpl implements IPatientNodeParamsCu paramsLogList.add(paramsLog); }); patientNodeParamsLogMapper.insertList(paramsLogList); - - // 生成任务 manageRouteNodeService.updateTask(paramsList); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroutenode/ISignPatientManageRouteNodeService.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroutenode/ISignPatientManageRouteNodeService.java index 37c8a2d0..7a81fd75 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroutenode/ISignPatientManageRouteNodeService.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroutenode/ISignPatientManageRouteNodeService.java @@ -37,6 +37,13 @@ public interface ISignPatientManageRouteNodeService { */ List getNodeList(PatientTaskDto patientTaskDto); + /** + * 根据节点类型查询节点列表详情 + * @param patientTaskDto 任务查询传输对象 + * @return 患者管理任务路径节点 + */ + List getNodeListByPatient(PatientTaskDto patientTaskDto); + /** * 查询患者管理路径节点 * 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 bf4ced91..7912cdf0 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 @@ -138,6 +138,43 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage return getRouteNodeList(patientTaskDto); } + @Override public List getNodeListByPatient(PatientTaskDto patientTaskDto) { + List retList = new ArrayList<>(); + if (patientTaskDto.getPatientId() == null) { + throw new ServiceException("患者信息有误"); + } + PatientInfo patientInfo = patientInfoMapper.selectPatientInfoById(patientTaskDto.getPatientId()); + if (ObjectUtils.isEmpty(patientInfo)) { + throw new ServiceException("患者信息有误!"); + } + patientTaskDto.setSignPatientRecordId(patientInfo.getSignPatientRecordId()); + // 根据任务类型、审核状态查询节点列表 + List nodeList = signPatientManageRouteNodeMapper.getNodeList(patientTaskDto); + nodeList.forEach(node -> { + PatientManageNodeInfoVo retVo = new PatientManageNodeInfoVo(); + JSONObject detailInfo = new JSONObject(); + if (node.getPropagandaInfoId() != null) { + // 宣教 + PropagandaMaterialsVo propagandaMaterialsVo = propagandaInfoService.selectPropagandaInfoById(node.getPropagandaInfoId()); + detailInfo = JSONObject.parseObject(JSONObject.toJSONString(propagandaMaterialsVo)); + retVo.setTemplateType(TemplateTypeConstants.PROPAGANDA); + } else if (StringUtils.isNotBlank(node.getPhoneTemplateId())) { + // 话术 + ScriptInfo scriptInfo = scriptInfoMapper.selectScriptInfoById(node.getPhoneId()); + detailInfo = JSONObject.parseObject(JSONObject.toJSONString(scriptInfo)); + retVo.setTemplateType(TemplateTypeConstants.SCRIPT); + } else if (node.getQuestionInfoId() != null) { + // 问卷 + QuestionVO questionVO = questionInfoService.selectQuestionInfoById(node.getQuestionInfoId()); + detailInfo = JSONObject.parseObject(JSONObject.toJSONString(questionVO)); + retVo.setTemplateType(TemplateTypeConstants.QUESTIONNAIRE); + } + retVo.setDetailInfo(detailInfo); + retList.add(retVo); + }); + return retList; + } + @Override public List getRouteNodeList(PatientTaskDto patientTaskDto) { List retList = new ArrayList<>(); PatientInfo patientInfo = patientInfoMapper.selectPatientInfoById(patientTaskDto.getPatientId()); diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/specialdiseasenode/impl/SpecialDiseaseNodeServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/specialdiseasenode/impl/SpecialDiseaseNodeServiceImpl.java index e433ebba..025022ce 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/specialdiseasenode/impl/SpecialDiseaseNodeServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/specialdiseasenode/impl/SpecialDiseaseNodeServiceImpl.java @@ -249,21 +249,7 @@ public class SpecialDiseaseNodeServiceImpl implements ISpecialDiseaseNodeService Map> groupBySn = nodeParams.stream().collect(Collectors.groupingBy(PatientNodeParamsCurrent::getSn)); for (String sn : groupBySn.keySet()) { List oldParams = groupBySn.get(sn); - //List paramKeys = oldParams.stream().map(PatientNodeParamsCurrent::getParamKey).collect(Collectors.toList()); - //List newKeys = diseaseNodeParams.stream().map(PatientNodeParamsCurrent::getParamKey).collect(Collectors.toList()); - //if (ListUtils.isEqualList(paramKeys, newKeys)) { - // retList.add(oldParams); - //} else { - // for(PatientNodeParamsCurrent nodeParam : diseaseNodeParams) { - // if (!paramKeys.contains(nodeParam.getParamKey())) { - // oldParams.add(nodeParam); - // } - // if (!newKeys.contains(nodeParam.getParamKey())) { - // oldParams.remove(nodeParam); - // } - // } retList.add(oldParams); - //} } } return retList; @@ -281,18 +267,17 @@ public class SpecialDiseaseNodeServiceImpl implements ISpecialDiseaseNodeService PatientInfo patientInfo = patientInfoMapper.selectPatientInfoById(patientId); switch (taskSubdivision) { // 健康档案 - case "HEALTH_ARCHIVE": - retObj = JSONObject.parseObject(JSONObject.toJSONString(patientInfo)); - // 性别转换成中文、计算年龄 - retObj.fluentPut("sex", PatientSexEnum.getInfoByCode(patientInfo.getSex()).getInfo()) - .fluentPut("age", BaseUtil.getAge(patientInfo.getBirthDate())); - break; - default: - DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd"); - retObj.fluentPut("patientName", patientInfo.getPatientName()) - .fluentPut("dischargeTime", patientInfo.getDischargeTime() == null ? "" : patientInfo.getDischargeTime().format(df)) - .fluentPut("visitDate", patientInfo.getVisitDate().format(df)); - break; + case "HEALTH_ARCHIVE": + retObj = JSONObject.parseObject(JSONObject.toJSONString(patientInfo)); + // 性别转换成中文、计算年龄 + retObj.fluentPut("sex", PatientSexEnum.getInfoByCode(patientInfo.getSex()).getInfo()).fluentPut("age", BaseUtil.getAge(patientInfo.getBirthDate())); + break; + default: + DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + retObj.fluentPut("patientName", patientInfo.getPatientName()) + .fluentPut("dischargeTime", patientInfo.getDischargeTime() == null ? "" : patientInfo.getDischargeTime().format(df)) + .fluentPut("visitDate", patientInfo.getVisitDate().format(df)); + break; } return retObj; } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/specialdiseaseroute/impl/SpecialDiseaseRouteServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/specialdiseaseroute/impl/SpecialDiseaseRouteServiceImpl.java index 252dd2c7..bb75361a 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/specialdiseaseroute/impl/SpecialDiseaseRouteServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/specialdiseaseroute/impl/SpecialDiseaseRouteServiceImpl.java @@ -225,7 +225,6 @@ public class SpecialDiseaseRouteServiceImpl implements ISpecialDiseaseRouteServi return AjaxResult.error("请选择需要发布专病路径的信息!"); } if (ReleaseStatusEnum.PUBLISHED.getInfo().equals(specialDiseaseRoute.getReleaseStatus())) { - // 专病路径没有节点不能发布 int count = specialDiseaseRouteMapper.selectRouteCheckStatus(specialDiseaseRoute.getId(), RouteCheckStatusEnum.AGREE.getInfo()); if (count >= 0) { return AjaxResult.error("该路径无节点或存在未审核的节点,请全部审核后发布!");