修改测试问题。

This commit is contained in:
haown 2024-05-31 17:04:58 +08:00
parent 26b455d0b5
commit a697410e52
7 changed files with 73 additions and 41 deletions

View File

@ -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<List<PatientManageNodeListVo>> getList(SignPatientManageRouteNodeDto signPatientManageRouteNodeDto) {
List<PatientManageNodeListVo> 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<SignPatientManageRouteNode> getById(@PathVariable("id") Long id) {
public R<PatientManageNodeInfoVo> getById(@PathVariable("id") Long id) {
return R.ok(signNodeService.selectSignPatientManageRouteNodeById(id));
}
/**
* 根据节点类型查询节点列表详情
*/
@ApiOperation("根据节点类型查询节点列表详情")
@GetMapping("/getNodeListByPatient")
public R<List<PatientManageNodeInfoVo>> getNodeListByPatient(PatientTaskDto patientTaskDto) {
return R.ok(signNodeService.getNodeListByPatient(patientTaskDto));
}
/**
* 患者详情--查询患者手动创建的任务节点列表
* 患者详情--查询患者任务路径及节点列表
*/
@ApiOperation("患者详情--查询患者手动创建的任务节点列表")
@ApiOperation("患者详情--查询患者任务路径及节点列表")
@GetMapping("/getNodeList")
public R<List<SignPatientManageRouteNodeVo>> getNodeList(PatientTaskDto patientTaskDto) {
List<SignPatientManageRouteNodeVo> 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<SignPatientManageRouteNodeVo> list = signNodeService.getRouteNodeList(patientTaskDto);
return R.ok(list);
return R.ok(signNodeService.getRouteNodeList(patientTaskDto));
}
/**

View File

@ -21,7 +21,7 @@ public interface SignPatientManageRouteNodeMapper {
* @param id 签约患者管理任务路径节点主键
* @return 签约患者管理任务路径节点
*/
public SignPatientManageRouteNode selectSignPatientManageRouteNodeById(Long id);
SignPatientManageRouteNode selectSignPatientManageRouteNodeById(Long id);
/**
* 查询患者管理路径节点

View File

@ -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);
}

View File

@ -37,6 +37,13 @@ public interface ISignPatientManageRouteNodeService {
*/
List<SignPatientManageRouteNodeVo> getNodeList(PatientTaskDto patientTaskDto);
/**
* 根据节点类型查询节点列表详情
* @param patientTaskDto 任务查询传输对象
* @return 患者管理任务路径节点
*/
List<PatientManageNodeInfoVo> getNodeListByPatient(PatientTaskDto patientTaskDto);
/**
* 查询患者管理路径节点
*

View File

@ -138,6 +138,43 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage
return getRouteNodeList(patientTaskDto);
}
@Override public List<PatientManageNodeInfoVo> getNodeListByPatient(PatientTaskDto patientTaskDto) {
List<PatientManageNodeInfoVo> 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<SignPatientManageRouteNode> 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<SignPatientManageRouteNodeVo> getRouteNodeList(PatientTaskDto patientTaskDto) {
List<SignPatientManageRouteNodeVo> retList = new ArrayList<>();
PatientInfo patientInfo = patientInfoMapper.selectPatientInfoById(patientTaskDto.getPatientId());

View File

@ -249,21 +249,7 @@ public class SpecialDiseaseNodeServiceImpl implements ISpecialDiseaseNodeService
Map<String, List<PatientNodeParamsCurrent>> groupBySn = nodeParams.stream().collect(Collectors.groupingBy(PatientNodeParamsCurrent::getSn));
for (String sn : groupBySn.keySet()) {
List<PatientNodeParamsCurrent> oldParams = groupBySn.get(sn);
//List<String> paramKeys = oldParams.stream().map(PatientNodeParamsCurrent::getParamKey).collect(Collectors.toList());
//List<String> 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;
}

View File

@ -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("该路径无节点或存在未审核的节点,请全部审核后发布!");