diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/patientnodeparamscurrent/PatientNodeParamsCurrentController.java b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/patientnodeparamscurrent/PatientNodeParamsCurrentController.java index 9606e04d..5f8e02b9 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/patientnodeparamscurrent/PatientNodeParamsCurrentController.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/patientnodeparamscurrent/PatientNodeParamsCurrentController.java @@ -3,6 +3,7 @@ package com.xinelu.manage.controller.patientnodeparamscurrent; import com.xinelu.common.annotation.Log; import com.xinelu.common.core.controller.BaseController; import com.xinelu.common.core.domain.AjaxResult; +import com.xinelu.common.core.domain.R; import com.xinelu.common.core.page.TableDataInfo; import com.xinelu.common.enums.BusinessType; import com.xinelu.common.utils.poi.ExcelUtil; @@ -33,11 +34,11 @@ public class PatientNodeParamsCurrentController extends BaseController { @Resource private IPatientNodeParamsCurrentService patientNodeParamsCurrentService; -/** - * 查询患者节点参数列表 - */ -@PreAuthorize("@ss.hasPermi('manage:nodeParamsCurrent:list')") -@GetMapping("/list") + /** + * 查询患者节点参数列表 + */ + @PreAuthorize("@ss.hasPermi('manage:nodeParamsCurrent:list')") + @GetMapping("/list") public TableDataInfo list(PatientNodeParamsCurrent patientNodeParamsCurrent) { startPage(); List list = patientNodeParamsCurrentService.selectPatientNodeParamsCurrentList(patientNodeParamsCurrent); @@ -94,4 +95,15 @@ public class PatientNodeParamsCurrentController extends BaseController { public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(patientNodeParamsCurrentService.deletePatientNodeParamsCurrentByIds(ids)); } + + /** + * 批量新增患者节点参数 + */ + @PreAuthorize("@ss.hasPermi('manage:nodeParamsCurrent:add')") + @Log(title = "患者节点参数", businessType = BusinessType.INSERT) + @PostMapping("/inserList") + public R inserList(@RequestBody List> paramsList) { + patientNodeParamsCurrentService.insertList(paramsList); + return R.ok(); + } } 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 8b9ad163..556f58df 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,13 +5,12 @@ 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.patientnodeparamscurrent.PatientNodeParamsCurrent; -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.service.signpatientmanageroutenode.ISignPatientManageRouteNodeService; import com.xinelu.manage.vo.signpatientmanageroutenode.PatientTaskVo; import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageRouteNodeVo; +import com.xinelu.manage.vo.specialdiseasenode.PatientSpecialDiseaseNodeVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import java.util.List; @@ -89,29 +88,12 @@ public class SignPatientManageRouteNodeController extends BaseController { * 查询患者任务节点 */ @ApiOperation("生成数据---任务节点列表") - @GetMapping("/getAllNodeByPatient") - public R> getAllNodeByPatient(PatientTaskDto patientTaskDto) { + @GetMapping("/getSpecialDiseaseNode") + public R> getSpecialDiseaseNode(PatientTaskDto patientTaskDto) { if (patientTaskDto.getPatientId() == null) { throw new ServiceException("请选择患者!"); } - if (StringUtils.isBlank(patientTaskDto.getRouteCheckStatus())) { - throw new ServiceException("请选择审核状态!"); - } - return R.ok(signNodeService.getAllNodeByPatient(patientTaskDto)); + return R.ok(signNodeService.getSpecialDiseaseNode(patientTaskDto)); } - /** - * 根据节点id提取参数列表 - */ - @ApiOperation("根据节点id提取参数列表") - @GetMapping("/getParams") - public R> getParams(Long patientId, Long manageNodeId) { - if (patientId == null) { - throw new ServiceException("请选择患者!"); - } - if (manageNodeId == null) { - throw new ServiceException("请选择节点!"); - } - return R.ok(signNodeService.getParams(patientId, manageNodeId)); - } } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/specialdiseasenode/SpecialDiseaseNodeController.java b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/specialdiseasenode/SpecialDiseaseNodeController.java index 6f91d590..66d27266 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/specialdiseasenode/SpecialDiseaseNodeController.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/specialdiseasenode/SpecialDiseaseNodeController.java @@ -3,19 +3,29 @@ package com.xinelu.manage.controller.specialdiseasenode; import com.xinelu.common.annotation.Log; import com.xinelu.common.core.controller.BaseController; import com.xinelu.common.core.domain.AjaxResult; +import com.xinelu.common.core.domain.R; import com.xinelu.common.core.page.TableDataInfo; import com.xinelu.common.enums.BusinessType; +import com.xinelu.common.exception.ServiceException; import com.xinelu.common.utils.poi.ExcelUtil; +import com.xinelu.manage.domain.patientnodeparamscurrent.PatientNodeParamsCurrent; import com.xinelu.manage.domain.specialdiseasenode.SpecialDiseaseNode; import com.xinelu.manage.service.specialdiseasenode.ISpecialDiseaseNodeService; import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteVO; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; +import io.swagger.annotations.ApiOperation; import java.util.List; import java.util.Objects; +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; /** * 专病路径-管理节点信息Controller @@ -112,4 +122,16 @@ public class SpecialDiseaseNodeController extends BaseController { } return specialDiseaseNodeService.updateRouteCheckStatus(specialDiseaseNode); } + + /** + * 根据节点id提取参数列表 + */ + @ApiOperation("根据节点id提取参数列表") + @GetMapping("/getParams") + public R>> getParams(Long id, Long patientId) { + if (id == null) { + throw new ServiceException("请选择节点!"); + } + return R.ok(specialDiseaseNodeService.getParams(id, patientId)); + } } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/patientnodeparamscurrent/PatientNodeParamsCurrent.java b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/patientnodeparamscurrent/PatientNodeParamsCurrent.java index dbfe4e6f..eaa79125 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/patientnodeparamscurrent/PatientNodeParamsCurrent.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/patientnodeparamscurrent/PatientNodeParamsCurrent.java @@ -46,6 +46,13 @@ private static final long serialVersionUID=1L; @Excel(name = "任务细分名称") private String taskPartitionDictName; + /** + * 任务细分编码 + */ + @ApiModelProperty(value = "任务细分编码") + @Excel(name = "任务细分编码") + private String taskPartitionCode; + /** 任务类型表id */ @ApiModelProperty(value = "任务类型表id") @Excel(name = "任务类型表id") @@ -56,6 +63,11 @@ private static final long serialVersionUID=1L; @Excel(name = "任务类型名称") private String taskTypeName; + /** 任务类型编码 */ + @ApiModelProperty(value = "任务类型编码") + @Excel(name = "任务类型编码") + private String taskTypeCode; + /** 专病路径表id */ @ApiModelProperty(value = "专病路径表id") @Excel(name = "专病路径表id") diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/signpatientmanageroutenode/SignPatientManageRouteNode.java b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/signpatientmanageroutenode/SignPatientManageRouteNode.java index f85af7e2..865d8f86 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/signpatientmanageroutenode/SignPatientManageRouteNode.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/signpatientmanageroutenode/SignPatientManageRouteNode.java @@ -40,6 +40,11 @@ public class SignPatientManageRouteNode extends BaseEntity { @Excel(name = "路径名称", readConverterExp = "任务名称") private String manageRouteName; + /** 管理路径节点id */ + @ApiModelProperty(value = "管理路径节点id") + @Excel(name = "管理路径节点id") + private Long routeNodeId; + /** 管理路径节点名称 */ @ApiModelProperty(value = "管理路径节点名称") @Excel(name = "管理路径节点名称") diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/dto/signpatientmanageroutenode/SignPatientManageRouteNodeDto.java b/postdischarge-manage/src/main/java/com/xinelu/manage/dto/signpatientmanageroutenode/SignPatientManageRouteNodeDto.java index 274d71f0..4970ebe7 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/dto/signpatientmanageroutenode/SignPatientManageRouteNodeDto.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/dto/signpatientmanageroutenode/SignPatientManageRouteNodeDto.java @@ -41,4 +41,16 @@ public class SignPatientManageRouteNodeDto { * */ @ApiModelProperty(value = "任务类型列表") private List taskTypeList; + + /** + * 患者表主键 + */ + @ApiModelProperty(value = "患者表主键") + private Long patientId; + + /** + * 专病路径节点id + */ + @ApiModelProperty(value = "专病路径节点id") + private String routeNodeId; } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/patientnodeparamslcurrent/PatientNodeParamsCurrentMapper.java b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/patientnodeparamslcurrent/PatientNodeParamsCurrentMapper.java index e597d8f6..e9d652cc 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/patientnodeparamslcurrent/PatientNodeParamsCurrentMapper.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/patientnodeparamslcurrent/PatientNodeParamsCurrentMapper.java @@ -3,7 +3,6 @@ package com.xinelu.manage.mapper.patientnodeparamslcurrent; import com.xinelu.manage.domain.patientnodeparamscurrent.PatientNodeParamsCurrent; import java.util.List; - /** * 患者节点参数Mapper接口 * @@ -58,4 +57,7 @@ public interface PatientNodeParamsCurrentMapper { * @return 结果 */ int deletePatientNodeParamsCurrentByIds(Long[] ids); + + int insertList(List paramsList); + } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/patientnodeparamslog/PatientNodeParamsLogMapper.java b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/patientnodeparamslog/PatientNodeParamsLogMapper.java index 60c3ecd0..94d12ca8 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/patientnodeparamslog/PatientNodeParamsLogMapper.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/patientnodeparamslog/PatientNodeParamsLogMapper.java @@ -58,4 +58,6 @@ public interface PatientNodeParamsLogMapper { * @return 结果 */ int deletePatientNodeParamsLogByIds(Long[] ids); + + int insertList(List paramsLogList); } 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 44be4155..dad3ce8f 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 @@ -85,4 +85,5 @@ public interface SignPatientManageRouteNodeMapper { * @return 患者任务列表 */ List selectPatientTaskList(PatientTaskDto patientTaskDto); + } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/specialdiseasenode/SpecialDiseaseNodeMapper.java b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/specialdiseasenode/SpecialDiseaseNodeMapper.java index a2f8598c..ba8be244 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/specialdiseasenode/SpecialDiseaseNodeMapper.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/specialdiseasenode/SpecialDiseaseNodeMapper.java @@ -1,9 +1,9 @@ package com.xinelu.manage.mapper.specialdiseasenode; import com.xinelu.manage.domain.specialdiseasenode.SpecialDiseaseNode; +import com.xinelu.manage.vo.specialdiseasenode.PatientSpecialDiseaseNodeVo; import com.xinelu.manage.vo.specialdiseasenode.SpecialDiseaseNodeVO; import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteVO; - import java.util.List; @@ -87,4 +87,12 @@ public interface SpecialDiseaseNodeMapper { * @return 专病路径-管理节点信息 */ SpecialDiseaseRouteVO selectSpecialDiseaseByRouteId(Long specialDiseaseRouteId); + + /** + * 查询专病路径-管理节点信息 + * + * @param specialDiseaseRouteId 专病路径-管理节点信息主键 + * @return 专病路径-管理节点信息 + */ + List selectRouteNodeByRouteId(Long specialDiseaseRouteId); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientnodeparamscurrent/IPatientNodeParamsCurrentService.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientnodeparamscurrent/IPatientNodeParamsCurrentService.java index e3afecd2..32fbc026 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientnodeparamscurrent/IPatientNodeParamsCurrentService.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientnodeparamscurrent/IPatientNodeParamsCurrentService.java @@ -58,4 +58,13 @@ public interface IPatientNodeParamsCurrentService { * @return 结果 */ int deletePatientNodeParamsCurrentById(Long id); + + /** + * 批量新增患者节点参数 + * + * @param paramsList 患者节点参数列表 + * @return 结果 + */ + void insertList(List> paramsList); + } 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 837e009a..06bcb6f6 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 @@ -1,12 +1,21 @@ package com.xinelu.manage.service.patientnodeparamscurrent.impl; +import com.xinelu.common.utils.SecurityUtils; +import com.xinelu.common.utils.bean.BeanUtils; import com.xinelu.manage.domain.patientnodeparamscurrent.PatientNodeParamsCurrent; +import com.xinelu.manage.domain.patientnodeparamslog.PatientNodeParamsLog; import com.xinelu.manage.mapper.patientnodeparamslcurrent.PatientNodeParamsCurrentMapper; +import com.xinelu.manage.mapper.patientnodeparamslog.PatientNodeParamsLogMapper; import com.xinelu.manage.service.patientnodeparamscurrent.IPatientNodeParamsCurrentService; +import com.xinelu.manage.service.signpatientmanageroutenode.ISignPatientManageRouteNodeService; import java.time.LocalDateTime; +import java.util.ArrayList; import java.util.List; +import java.util.concurrent.atomic.AtomicBoolean; import javax.annotation.Resource; +import org.apache.commons.collections4.CollectionUtils; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; /** * 患者节点参数Service业务层处理 @@ -18,6 +27,10 @@ import org.springframework.stereotype.Service; public class PatientNodeParamsCurrentServiceImpl implements IPatientNodeParamsCurrentService { @Resource private PatientNodeParamsCurrentMapper patientNodeParamsCurrentMapper; + @Resource + private PatientNodeParamsLogMapper patientNodeParamsLogMapper; + @Resource + private ISignPatientManageRouteNodeService manageRouteNodeService; /** * 查询患者节点参数 @@ -86,4 +99,68 @@ public class PatientNodeParamsCurrentServiceImpl implements IPatientNodeParamsCu public int deletePatientNodeParamsCurrentById(Long id) { return patientNodeParamsCurrentMapper.deletePatientNodeParamsCurrentById(id); } + + @Override + @Transactional + public void insertList(List> paramsList) { + // 多个list组合成一个参数list + List allList = new ArrayList<>(); + List saveList = new ArrayList<>(); + List updList = new ArrayList<>(); + List> generateTaskList = new ArrayList<>(); + List> updateTaskList = new ArrayList<>(); + for (List paramList : paramsList) { + AtomicBoolean generateTask = new AtomicBoolean(true); + paramList.forEach(param-> { + if (param.getId() == null) { + param.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName()); + param.setCreateTime(LocalDateTime.now()); + saveList.add(param); + } else { + param.setUpdateBy(SecurityUtils.getLoginUser().getUser().getNickName()); + param.setUpdateTime(LocalDateTime.now()); + updList.add(param); + generateTask.set(false); + } + allList.add(param); + }); + + if (generateTask.get()) { + // 生成任务 + generateTaskList.add(paramList); + } else { + // 修改任务 + updateTaskList.add(paramList); + } + } + if (CollectionUtils.isNotEmpty(saveList)) { + patientNodeParamsCurrentMapper.insertList(saveList); + } + if (CollectionUtils.isNotEmpty(updList)) { + updList.forEach(updParam -> { + patientNodeParamsCurrentMapper.updatePatientNodeParamsCurrent(updParam); + }); + } + + // 保存参数日志表 + List paramsLogList = new ArrayList<>(); + allList.forEach(paramCurrent -> { + PatientNodeParamsLog paramsLog = new PatientNodeParamsLog(); + BeanUtils.copyBeanProp(paramsLog, paramCurrent); + paramsLog.setId(null); + paramsLog.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName()); + paramsLog.setCreateTime(LocalDateTime.now()); + paramsLogList.add(paramsLog); + }); + patientNodeParamsLogMapper.insertList(paramsLogList); + + // 生成任务 + if (CollectionUtils.isNotEmpty(generateTaskList)) { + manageRouteNodeService.generateTask(generateTaskList); + } + // 修改任务 + if (CollectionUtils.isNotEmpty(updateTaskList)) { + manageRouteNodeService.updateTask(updateTaskList); + } + } } 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 cb0b87ad..03a63ffc 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 @@ -9,6 +9,7 @@ import com.xinelu.manage.dto.signpatientmanageroutenode.SignPatientManageRouteNo import com.xinelu.manage.vo.signpatientmanageroutenode.AppletRouteNodeListVo; import com.xinelu.manage.vo.signpatientmanageroutenode.PatientTaskVo; import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageRouteNodeVo; +import com.xinelu.manage.vo.specialdiseasenode.PatientSpecialDiseaseNodeVo; import java.util.List; @@ -103,7 +104,17 @@ public interface ISignPatientManageRouteNodeService { */ List getAppletTaskList(AppletPatientTaskDto appletPatientTaskDto); - List getAllNodeByPatient(PatientTaskDto patientTaskDto); + List getSpecialDiseaseNode(PatientTaskDto patientTaskDto); - List getParams(Long patientId, Long manageNodeId); + /** + * 根据参数列表生成任务 + * @param paramsCurrentLists 参数列表 + */ + void generateTask(List> paramsCurrentLists); + + /** + * 根据参数列表修改任务 + * @param paramsCurrentLists 参数列表 + */ + void updateTask(List> paramsCurrentLists); } 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 ba9d6f6d..47cd9277 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 @@ -5,7 +5,10 @@ import com.xinelu.common.constant.RouteNodeNameConstants; import com.xinelu.common.constant.TaskContentConstants; import com.xinelu.common.constant.TaskCreateTypeConstant; import com.xinelu.common.constant.VisitMethodConstants; +import com.xinelu.common.enums.NodeExecuteStatusEnum; +import com.xinelu.common.enums.RouteCheckStatusEnum; import com.xinelu.common.exception.ServiceException; +import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.StringUtils; import com.xinelu.common.utils.bean.BeanUtils; import com.xinelu.manage.domain.patientinfo.PatientInfo; @@ -15,6 +18,7 @@ import com.xinelu.manage.domain.scriptInfo.ScriptInfo; import com.xinelu.manage.domain.signpatientmanageroute.SignPatientManageRoute; import com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRouteNode; import com.xinelu.manage.domain.signpatientrecord.SignPatientRecord; +import com.xinelu.manage.domain.specialdiseasenode.SpecialDiseaseNode; import com.xinelu.manage.dto.patientinfo.PatientInfoDto; import com.xinelu.manage.dto.signpatientmanageroutenode.AppletPatientTaskDto; import com.xinelu.manage.dto.signpatientmanageroutenode.PatientTaskDto; @@ -26,6 +30,9 @@ import com.xinelu.manage.mapper.scriptInfo.ScriptInfoMapper; import com.xinelu.manage.mapper.signpatientmanageroute.SignPatientManageRouteMapper; import com.xinelu.manage.mapper.signpatientmanageroutenode.SignPatientManageRouteNodeMapper; import com.xinelu.manage.mapper.signpatientrecord.SignPatientRecordMapper; +import com.xinelu.manage.mapper.signroutetriggercondition.SignRouteTriggerConditionMapper; +import com.xinelu.manage.mapper.specialdiseasenode.SpecialDiseaseNodeMapper; +import com.xinelu.manage.mapper.specialdiseasetriggercondition.SpecialDiseaseTriggerConditionMapper; import com.xinelu.manage.service.propagandainfo.IPropagandaInfoService; import com.xinelu.manage.service.questioninfo.IQuestionInfoService; import com.xinelu.manage.service.signpatientmanageroutenode.ISignPatientManageRouteNodeService; @@ -36,10 +43,10 @@ import com.xinelu.manage.vo.signpatientmanageroutenode.AppletRouteNodeListVo; import com.xinelu.manage.vo.signpatientmanageroutenode.PatientTaskVo; import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageRouteNodeInfoVo; import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageRouteNodeVo; +import com.xinelu.manage.vo.specialdiseasenode.PatientSpecialDiseaseNodeVo; import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteVO; import java.time.LocalDateTime; import java.time.LocalTime; -import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; @@ -82,6 +89,12 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage private SignPatientRecordMapper signPatientRecordMapper; @Resource private PatientVisitRecordMapper patientVisitRecordMapper; + @Resource + private SpecialDiseaseNodeMapper specialDiseaseNodeMapper; + @Resource + private SpecialDiseaseTriggerConditionMapper triggerConditionMapper; + @Resource + private SignRouteTriggerConditionMapper signRouteTriggerConditionMapper; /** * 查询签约患者管理任务路径节点 @@ -349,70 +362,174 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage return retList; } - @Override public List getAllNodeByPatient(PatientTaskDto patientTaskDto) { + @Override public List getSpecialDiseaseNode(PatientTaskDto patientTaskDto) { // 查询最新一次签约记录 PatientInfo patientInfo = patientInfoMapper.selectPatientInfoById(patientTaskDto.getPatientId()); if (ObjectUtils.isEmpty(patientInfo)) { throw new ServiceException("请选择患者!"); } patientTaskDto.setSignPatientRecordId(patientInfo.getSignPatientRecordId()); - return signPatientManageRouteNodeMapper.getNodeList(patientTaskDto); + SignPatientManageRoute routeQuery = new SignPatientManageRoute(); + routeQuery.setSignPatientRecordId(patientInfo.getSignPatientRecordId()); + routeQuery.setTaskCreateType(TaskCreateTypeConstant.MANUAL_MATCHE); + List manageRouteList = signRouteMapper.selectSignPatientManageRouteList(routeQuery); + if (CollectionUtils.isEmpty(manageRouteList)) { + throw new ServiceException("未找到签约管理路径"); + } + // 根据专病路径查询专病节点信息 + return specialDiseaseNodeMapper.selectRouteNodeByRouteId(manageRouteList.get(0).getRouteId()); } @Override - public List getParams(Long patientId, Long manageNodeId) { - List nodeParams = new ArrayList<>(); - SignPatientManageRouteNode signPatientManageRouteNode = signPatientManageRouteNodeMapper.selectSignPatientManageRouteNodeById(manageNodeId); - if (StringUtils.isNotBlank(signPatientManageRouteNode.getNodeContent()) && signPatientManageRouteNode.getNodeContent().contains("data-fieldMark")) { - JSONObject paramValues = getParamsValue(signPatientManageRouteNode.getTaskSubdivision(), patientId); - Document document = Jsoup.parse(signPatientManageRouteNode.getNodeContent()); - // 需要提取的span - Elements spanlist = document.getElementsByClass("attachment"); - for (Element span : spanlist) { - PatientNodeParamsCurrent nodeParam = new PatientNodeParamsCurrent(); - String paramKey = span.attr("data-fieldMark"); - String paramName = span.attr("data-fileSpan"); - nodeParam.setParamName(paramName); - nodeParam.setParamKey(paramKey); - nodeParam.setParamValue(paramValues.getOrDefault(paramKey, "").toString()); - nodeParams.add(nodeParam); + @Transactional(rollbackFor = Exception.class) + public void generateTask(List> paramsCurrentLists) { + // 查询患者 + PatientInfo patientInfo = patientInfoMapper.selectPatientInfoById(paramsCurrentLists.get(0).get(0).getPatientId()); + SignPatientManageRoute routeQuery = new SignPatientManageRoute(); + routeQuery.setSignPatientRecordId(patientInfo.getSignPatientRecordId()); + routeQuery.setTaskCreateType(TaskCreateTypeConstant.MANUAL_MATCHE); + List manageRouteList = signRouteMapper.selectSignPatientManageRouteList(routeQuery); + if (CollectionUtils.isEmpty(manageRouteList)) { + throw new ServiceException("未找到签约管理路径"); + } + // 查询专病路径节点 + SpecialDiseaseNode specialDiseaseNode = specialDiseaseNodeMapper.selectSpecialDiseaseNodeById(paramsCurrentLists.get(0).get(0).getRouteNodeId()); + if (ObjectUtils.isEmpty(specialDiseaseNode)) { + throw new ServiceException("数据错误,请联系管理员"); + } + + List manageNodeList = new ArrayList<>(); + for (List paramsCurrentList : paramsCurrentLists) { + List nodeList = paramsCurrentList.stream().map(params -> { + SignPatientManageRouteNode manageRouteNode = new SignPatientManageRouteNode(); + BeanUtils.copyBeanProp(manageRouteNode, specialDiseaseNode); + manageRouteNode.setManageRouteId(manageRouteList.get(0).getId()); + manageRouteNode.setManageRouteName(manageRouteList.get(0).getRouteName()); + manageRouteNode.setId(null); + manageRouteNode.setRouteNodeId(specialDiseaseNode.getId()); + manageRouteNode.setRouteCheckStatus(RouteCheckStatusEnum.AGREE.getInfo()); + manageRouteNode.setRouteCheckDate(LocalDateTime.now()); + manageRouteNode.setRouteCheckRemark("手动生成任务"); + manageRouteNode.setNodeExecuteStatus(NodeExecuteStatusEnum.UNEXECUTED.getInfo()); + // 替换文本 + manageRouteNode.setNodeContent(replaceNodeContent(specialDiseaseNode.getNodeContent(), paramsCurrentList)); + manageRouteNode.setCreateTime(LocalDateTime.now()); + manageRouteNode.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName()); + return manageRouteNode; + }).collect(Collectors.toList()); + manageNodeList.addAll(nodeList); + } + + // 批量保存 + signPatientManageRouteNodeMapper.insertBatch(manageNodeList); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void updateTask(List> paramsCurrentLists) { + // 查询患者 + PatientInfo patientInfo = patientInfoMapper.selectPatientInfoById(paramsCurrentLists.get(0).get(0).getPatientId()); + SignPatientManageRoute routeQuery = new SignPatientManageRoute(); + routeQuery.setSignPatientRecordId(patientInfo.getSignPatientRecordId()); + routeQuery.setTaskCreateType(TaskCreateTypeConstant.MANUAL_MATCHE); + List manageRouteList = signRouteMapper.selectSignPatientManageRouteList(routeQuery); + if (CollectionUtils.isEmpty(manageRouteList)) { + throw new ServiceException("未找到签约管理路径"); + } + + SignPatientManageRouteNodeDto signPatientManageRouteNodeDto = new SignPatientManageRouteNodeDto(); + signPatientManageRouteNodeDto.setPatientId(paramsCurrentLists.get(0).get(0).getPatientId()); + signPatientManageRouteNodeDto.setManageRouteId(manageRouteList.get(0).getId()); + List manageNodeList = signPatientManageRouteNodeMapper.selectSignPatientManageRouteNodeList(signPatientManageRouteNodeDto); + if (CollectionUtils.isEmpty(manageRouteList)) { + // 生成任务 + generateTask(paramsCurrentLists); + } else { + if (StringUtils.equals(NodeExecuteStatusEnum.EXECUTED.getInfo(), manageNodeList.get(0).getNodeExecuteStatus())) { + // 任务已执行不修改 + } else { + // 逐条修改任务nodeContent + for (int i = 0; i < manageNodeList.size(); i++) { + SignPatientManageRouteNode node = manageNodeList.get(i); + node.setNodeContent(replaceNodeContent(node.getNodeContent(), paramsCurrentLists.get(i))); + signPatientManageRouteNodeMapper.updateSignPatientManageRouteNode(node); + } } } - return nodeParams; } - /** - * 根据任务细分类型获取患者的真实信息 - * @param taskSubdivision 任务细分类型code - * @param patientId 患者主键 - * @return 实际信息 - */ - private JSONObject getParamsValue(String taskSubdivision, Long patientId) { - JSONObject retObj = new JSONObject(); - PatientInfo patientInfo = patientInfoMapper.selectPatientInfoById(patientId); - switch (taskSubdivision) { - // 健康档案 - case "TPC202405200001": - retObj = JSONObject.parseObject(JSONObject.toJSONString(patientInfo)); - break; - default: - DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd"); - retObj.fluentPut("patientName", patientInfo.getPatientName()) - .fluentPut("dischargeTime", patientInfo.getDischargeTime().format(df)) - .fluentPut("visitDate", patientInfo.getVisitDate().format(df)); - break; + private String replaceNodeContent(String nodeContent, List paramsList) { + Map map = paramsList.stream().collect(Collectors.toMap(PatientNodeParamsCurrent::getParamKey,PatientNodeParamsCurrent::getParamValue,(key1,key2)->key2)); + Document document = Jsoup.parse(nodeContent); + // 需要提取的span + Elements spanlist = document.select("span[data-w-e-type]"); + for (Element span : spanlist) { + PatientNodeParamsCurrent nodeParam = new PatientNodeParamsCurrent(); + String paramKey = span.attr("data-fieldMark"); + span.text(map.getOrDefault(paramKey, "")) + .removeAttr("data-w-e-type") + .removeAttr("data-fieldMark") + .removeAttr("data-link") + .removeAttr("data-w-e-is-void") + .removeAttr("data-w-e-is-inline") + .removeAttr("data-filespan") + .removeAttr("data-filename"); } - return retObj; + return document.body().html(); } - // nodeContent标签提取替换 public static void main(String[] args) { // json为数据库中的对象 JSONObject json = new JSONObject(); - json.fluentPut("name", "张三"); + json.fluentPut("patientName", "张三"); + json.fluentPut("sex", "女"); + json.fluentPut("age", "10"); // html为前端传入后端的数据 - String s = "

患者信息姓名:请按时使用药物治疗。" - + "患者信息姓名:请按时吃饭。

"; + String s = "

基本信息

姓名:\n" + + " \n" + + " 基本信息\n" + + " 姓名\n" + + " \n" + + "

性别:\n" + + " \n" + + " 基本信息\n" + + " 性别\n" + + " \n" + + "

年龄:\n" + + " \n" + + " 基本信息\n" + + " 年龄\n" + + " \n" + + "

地址:\n" + + " \n" + + " 基本信息\n" + + " 地址\n" + + " \n" + + "

"; Document document = Jsoup.parse(s); //Elements spanlist = document.getElementsByClass("attachment"); //for (Element span : spanlist) { @@ -429,10 +546,34 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage //Elements element = document.getElementsByTag("p"); //System.out.println("---------------------\n"+element.get(0).html()); - Elements spanlist = document.getElementsByClass("attachment"); + //Elements spanlist = document.select("span[data-w-e-type]"); + //for (Element span : spanlist) { + // String paramKey = span.attr("data-fieldMark"); + // String paramName = span.attr("data-fileSpan"); + // System.out.println("属性==========" + paramName + ":"+ paramKey); + //} + + Elements spanlist = document.select("span[data-w-e-type]"); for (Element span : spanlist) { - String customAttribute = span.attr("data-fileSpan"); - System.out.println("属性==========" + customAttribute); + PatientNodeParamsCurrent nodeParam = new PatientNodeParamsCurrent(); + String paramKey = span.attr("data-fieldMark"); + String text = json.getOrDefault(paramKey, "").toString(); + //span.replaceWith(new TextNode("

" + text +" manageNodeList = nodeList.stream().map(node -> { + // nodeContent为空,或者不包含替换标签则自动生成任务 + List manageNodeList = nodeList.stream() + .filter(node -> StringUtils.isBlank(node.getNodeContent()) || !node.getNodeContent().contains("data-w-e-type")) + .map(node -> { SignPatientManageRouteNode manageRouteNode = new SignPatientManageRouteNode(); BeanUtils.copyBeanProp(manageRouteNode, node); manageRouteNode.setManageRouteId(signPatientManageRoute.getId()); @@ -197,12 +200,15 @@ public class SignPatientRecordServiceImpl implements ISignPatientRecordService { manageRouteNode.setRouteCheckDate(LocalDateTime.now()); manageRouteNode.setRouteCheckRemark("签约自动审核通过"); manageRouteNode.setNodeExecuteStatus(NodeExecuteStatusEnum.UNEXECUTED.getInfo()); + manageRouteNode.setRouteNodeId(node.getId()); manageRouteNode.setCreateTime(LocalDateTime.now()); manageRouteNode.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName()); return manageRouteNode; }).collect(Collectors.toList()); // 批量保存 - manageRouteNodeMapper.insertBatch(manageNodeList); + if (!CollectionUtils.isEmpty(manageNodeList)) { + manageRouteNodeMapper.insertBatch(manageNodeList); + } // 保存触发条件 SpecialDiseaseTriggerCondition triggerConditionQuery = new SpecialDiseaseTriggerCondition(); triggerConditionQuery.setRouteId(signPatientManageRoute.getRouteId()); diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/specialdiseasenode/ISpecialDiseaseNodeService.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/specialdiseasenode/ISpecialDiseaseNodeService.java index b4f06545..01b9a73f 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/specialdiseasenode/ISpecialDiseaseNodeService.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/specialdiseasenode/ISpecialDiseaseNodeService.java @@ -1,9 +1,9 @@ package com.xinelu.manage.service.specialdiseasenode; import com.xinelu.common.core.domain.AjaxResult; +import com.xinelu.manage.domain.patientnodeparamscurrent.PatientNodeParamsCurrent; import com.xinelu.manage.domain.specialdiseasenode.SpecialDiseaseNode; import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteVO; - import java.util.List; /** @@ -76,4 +76,6 @@ public interface ISpecialDiseaseNodeService { * @return AjaxResult */ AjaxResult updateRouteCheckStatus(SpecialDiseaseNode specialDiseaseNode); + + List> getParams(Long id, Long patientId); } 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 e573c32c..fdc3cbaa 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 @@ -1,29 +1,41 @@ package com.xinelu.manage.service.specialdiseasenode.impl; +import com.alibaba.fastjson2.JSONObject; import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.common.exception.ServiceException; import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.bean.BeanUtils; +import com.xinelu.manage.domain.patientinfo.PatientInfo; +import com.xinelu.manage.domain.patientnodeparamscurrent.PatientNodeParamsCurrent; import com.xinelu.manage.domain.specialdiseasenode.SpecialDiseaseNode; import com.xinelu.manage.domain.specialdiseaseroute.SpecialDiseaseRoute; +import com.xinelu.manage.mapper.patientinfo.PatientInfoMapper; +import com.xinelu.manage.mapper.patientnodeparamslcurrent.PatientNodeParamsCurrentMapper; import com.xinelu.manage.mapper.specialdiseasenode.SpecialDiseaseNodeMapper; import com.xinelu.manage.mapper.specialdiseaseroute.SpecialDiseaseRouteMapper; import com.xinelu.manage.service.specialdiseasenode.ISpecialDiseaseNodeService; import com.xinelu.manage.vo.specialdiseasenode.SpecialDiseaseNodeVO; import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteVO; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.TreeSet; +import java.util.stream.Collectors; +import javax.annotation.Resource; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; 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; -import javax.annotation.Resource; -import java.time.LocalDateTime; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; -import java.util.stream.Collectors; - /** * 专病路径-管理节点信息Service业务层处理 * @@ -37,6 +49,10 @@ public class SpecialDiseaseNodeServiceImpl implements ISpecialDiseaseNodeService private SpecialDiseaseNodeMapper specialDiseaseNodeMapper; @Resource private SpecialDiseaseRouteMapper specialDiseaseRouteMapper; + @Resource + private PatientNodeParamsCurrentMapper patientNodeParamsCurrentMapper; + @Resource + private PatientInfoMapper patientInfoMapper; /** @@ -183,4 +199,68 @@ public class SpecialDiseaseNodeServiceImpl implements ISpecialDiseaseNodeService specialDiseaseNode.setRouteCheckDate(LocalDateTime.now()); return AjaxResult.success(specialDiseaseNodeMapper.updateSpecialDiseaseNode(specialDiseaseNode)); } + + @Override + public List> getParams(Long id, Long patientId) { + List> retList = new ArrayList<>(); + // 根据节点id查询是否有已经维护的参数 + PatientNodeParamsCurrent paramsQuery = new PatientNodeParamsCurrent(); + paramsQuery.setPatientId(patientId); + paramsQuery.setRouteNodeId(id); + List nodeParams = patientNodeParamsCurrentMapper.selectPatientNodeParamsCurrentList(paramsQuery); + + if (CollectionUtils.isEmpty(nodeParams)) { + SpecialDiseaseNode specialDiseaseNode = specialDiseaseNodeMapper.selectSpecialDiseaseNodeById(id); + if (StringUtils.isNotBlank(specialDiseaseNode.getNodeContent()) && specialDiseaseNode.getNodeContent().contains("data-fieldMark")) { + JSONObject paramValues = getParamsValue(specialDiseaseNode.getTaskSubdivision(), patientId); + Document document = Jsoup.parse(specialDiseaseNode.getNodeContent()); + // 需要提取的span + Elements spanlist = document.select("span[data-w-e-type]"); + for (Element span : spanlist) { + PatientNodeParamsCurrent nodeParam = new PatientNodeParamsCurrent(); + String paramKey = span.attr("data-fieldMark"); + String paramName = span.attr("data-fileSpan"); + nodeParam.setSn("1"); + nodeParam.setParamName(paramName); + nodeParam.setParamKey(paramKey); + nodeParam.setParamValue(paramValues.getOrDefault(paramKey, "").toString()); + nodeParams.add(nodeParam); + } + // nodeParams去重 + nodeParams = nodeParams.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(()-> new TreeSet<>(Comparator.comparing(PatientNodeParamsCurrent::getParamKey))), ArrayList::new)); + retList.add(nodeParams); + } + } else { + Map> groupBySn = nodeParams.stream().collect(Collectors.groupingBy(PatientNodeParamsCurrent::getSn)); + for (String sn : groupBySn.keySet()) { + retList.add(groupBySn.get(sn)); + } + } + + return retList; + } + + /** + * 根据任务细分类型获取患者的真实信息 + * @param taskSubdivision 任务细分类型code + * @param patientId 患者主键 + * @return 实际信息 + */ + private JSONObject getParamsValue(String taskSubdivision, Long patientId) { + JSONObject retObj = new JSONObject(); + PatientInfo patientInfo = patientInfoMapper.selectPatientInfoById(patientId); + switch (taskSubdivision) { + // 健康档案 + case "TPC202405200001": + retObj = JSONObject.parseObject(JSONObject.toJSONString(patientInfo)); + break; + default: + DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + retObj.fluentPut("patientName", patientInfo.getPatientName()) + .fluentPut("dischargeTime", patientInfo.getDischargeTime().format(df)) + .fluentPut("visitDate", patientInfo.getVisitDate().format(df)); + break; + } + return retObj; + } } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/vo/signpatientmanageroutenode/PatientMangeRouteNodeVo.java b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/signpatientmanageroutenode/PatientMangeRouteNodeVo.java new file mode 100644 index 00000000..1fb3cc11 --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/signpatientmanageroutenode/PatientMangeRouteNodeVo.java @@ -0,0 +1,76 @@ +package com.xinelu.manage.vo.signpatientmanageroutenode; + +import com.xinelu.common.annotation.Excel; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @description: 患者管理路径节点 + * @author: haown + * @create: 2024-05-21 10:14 + **/ +@ApiModel("患者管理路径节点") +@Data +public class PatientMangeRouteNodeVo { + + /** 主键id */ + private Long id; + + /** 签约患者管理任务表id */ + @ApiModelProperty(value = "签约患者管理任务表id") + @Excel(name = "签约患者管理任务表id") + private Long manageRouteId; + + /** 路径名称(任务名称) */ + @ApiModelProperty(value = "路径名称") + @Excel(name = "路径名称", readConverterExp = "任务名称") + private String manageRouteName; + + /** 管理路径节点名称 */ + @ApiModelProperty(value = "管理路径节点名称") + @Excel(name = "管理路径节点名称") + private String routeNodeName; + + /** 管理路径节点时间,时间单位为:天 */ + @ApiModelProperty(value = "管理路径节点时间,时间单位为:天") + @Excel(name = "管理路径节点时间,时间单位为:天") + private Integer routeNodeDay; + + /** 任务细分id */ + @ApiModelProperty(value = "任务细分id") + @Excel(name = "任务细分id") + private Long taskPartitionDictId; + + /** 任务细分名称 */ + @ApiModelProperty(value = "任务细分名称") + @Excel(name = "任务细分名称") + private String taskPartitionDictName; + + /** + * 任务细分编码 + */ + @ApiModelProperty(value = "任务细分编码") + @Excel(name = "任务细分编码") + private String taskPartitionCode; + + /** 任务类型表id */ + @ApiModelProperty(value = "任务类型表id") + @Excel(name = "任务类型表id") + private Long taskTypeId; + + /** 任务类型名称 */ + @ApiModelProperty(value = "任务类型名称") + @Excel(name = "任务类型名称") + private String taskTypeName; + + /** 任务类型编码 */ + @ApiModelProperty(value = "任务类型编码") + @Excel(name = "任务类型编码") + private String taskTypeCode; + + /** 节点审核状态,同意:AGREE,不同意:DISAGREE */ + @ApiModelProperty(value = "节点审核状态,同意:AGREE,不同意:DISAGREE") + @Excel(name = "节点审核状态,同意:AGREE,不同意:DISAGREE") + private String routeCheckStatus; +} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/vo/specialdiseasenode/PatientSpecialDiseaseNodeVo.java b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/specialdiseasenode/PatientSpecialDiseaseNodeVo.java new file mode 100644 index 00000000..3c9d53f5 --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/specialdiseasenode/PatientSpecialDiseaseNodeVo.java @@ -0,0 +1,71 @@ +package com.xinelu.manage.vo.specialdiseasenode; + +import com.xinelu.common.annotation.Excel; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @description: 患者签约专病管理路径节点信息 + * @author: haown + * @create: 2024-05-21 11:17 + **/ +@ApiModel("患者签约专病管理路径节点信息") +@Data +public class PatientSpecialDiseaseNodeVo { + + /** 任务细分id */ + @ApiModelProperty(value = "任务细分id") + private Long taskPartitionDictId; + + /** 任务细分名称 */ + @ApiModelProperty(value = "任务细分名称") + private String taskPartitionDictName; + + /** + * 任务细分编码 + */ + @ApiModelProperty(value = "任务细分编码") + private String taskPartitionCode; + + /** 任务类型表id */ + @ApiModelProperty(value = "任务类型表id") + private Long taskTypeId; + + /** 任务类型名称 */ + @ApiModelProperty(value = "任务类型名称") + private String taskTypeName; + + /** 任务类型编码 */ + @ApiModelProperty(value = "任务类型编码") + private String taskTypeCode; + + /** 专病路径表id */ + @ApiModelProperty(value = "专病路径表id") + private Long routeId; + + /** 路径名称(任务名称) */ + @ApiModelProperty(value = "路径名称") + private String routeName; + + /** + * 节点天数,单位:天 + */ + @ApiModelProperty(value = "节点天数,单位:天") + private Integer routeNodeDay; + + /** 节点ID */ + @ApiModelProperty(value = "节点ID") + private Long routeNodeId; + + /** 节点名称 */ + @ApiModelProperty(value = "节点名称") + private String routeNodeName; + + /** + * 节点审核状态,同意:AGREE,不同意:DISAGREE + */ + @ApiModelProperty(value = "节点审核状态,同意:AGREE,不同意:DISAGREE") + @Excel(name = "节点审核状态,同意:AGREE,不同意:DISAGREE") + private String routeCheckStatus; +} diff --git a/postdischarge-manage/src/main/resources/mapper/manage/patientnodeparamscurrent/PatientNodeParamsCurrentMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/patientnodeparamscurrent/PatientNodeParamsCurrentMapper.xml index cc86b779..ab5f1c46 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/patientnodeparamscurrent/PatientNodeParamsCurrentMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/patientnodeparamscurrent/PatientNodeParamsCurrentMapper.xml @@ -236,4 +236,21 @@ #{id} + + + insert into patient_node_params_current + (patient_id, patient_name, task_partition_dict_id, task_partition_dict_name, + task_type_id, task_type_name, route_id, route_name, route_node_id, route_node_name, + sn, param_name, param_key, param_value, create_time, update_by, update_time, create_by) + values + + (#{item.patientId}, #{item.patientName}, #{item.taskPartitionDictId}, #{item.taskPartitionDictName}, + #{item.taskTypeId}, #{item.taskTypeName}, #{item.routeId}, + #{item.routeName}, #{item.routeNodeId}, #{item.routeNodeName}, + #{item.sn},#{item.paramName},#{item.paramKey},#{item.paramValue}, #{item.createTime}, #{item.updateBy}, + #{item.updateTime}, #{item.createBy} + ) + + + \ No newline at end of file diff --git a/postdischarge-manage/src/main/resources/mapper/manage/patientnodeparamslog/PatientNodeParamsLogMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/patientnodeparamslog/PatientNodeParamsLogMapper.xml index a9b6846c..8eb2ed88 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/patientnodeparamslog/PatientNodeParamsLogMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/patientnodeparamslog/PatientNodeParamsLogMapper.xml @@ -236,4 +236,20 @@ #{id} + + + insert into patient_node_params_log + (patient_id, patient_name, task_partition_dict_id, task_partition_dict_name, + task_type_id, task_type_name, route_id, route_name, route_node_id, route_node_name, + sn, param_name, param_key, param_value, create_time, create_by, update_by, update_time) + values + + (#{item.patientId}, #{item.patientName}, #{item.taskPartitionDictId}, #{item.taskPartitionDictName}, + #{item.taskTypeId}, #{item.taskTypeName}, #{item.routeId}, + #{item.routeName}, #{item.routeNodeId}, #{item.routeNodeName}, + #{item.sn},#{item.paramName},#{item.paramKey},#{item.paramValue}, #{item.createTime}, #{item.createBy}, #{item.updateBy}, + #{item.updateTime} + ) + + \ No newline at end of file diff --git a/postdischarge-manage/src/main/resources/mapper/manage/specialdiseasenode/SpecialDiseaseNodeMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/specialdiseasenode/SpecialDiseaseNodeMapper.xml index 6f0a737a..0597e067 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/specialdiseasenode/SpecialDiseaseNodeMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/specialdiseasenode/SpecialDiseaseNodeMapper.xml @@ -826,4 +826,27 @@ left join task_partition_dict tpd on tpd.task_partition_code = sdn.task_subdivision where sdr.id = #{specialDiseaseRouteId} + + \ No newline at end of file