子路径的保存。
This commit is contained in:
parent
2bbd91fd71
commit
a344a3495e
@ -106,7 +106,7 @@ public class SpecialDiseaseRouteController extends BaseController {
|
||||
*/
|
||||
@PostMapping("/editReleaseStatus")
|
||||
public AjaxResult editReleaseStatus(@RequestBody SpecialDiseaseRoute specialDiseaseRoute) {
|
||||
return specialDiseaseRouteService.editReleaseStatus(specialDiseaseRoute);
|
||||
return AjaxResult.success(specialDiseaseRouteService.editReleaseStatus(specialDiseaseRoute));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -227,6 +227,30 @@ public class SignPatientRecord extends BaseEntity {
|
||||
@ApiModelProperty(value = "健康管理师姓名")
|
||||
private String healthManageName;
|
||||
|
||||
/**
|
||||
* 专病路径审核状态,同意:AGREE,不同意:DISAGREE
|
||||
*/
|
||||
@ApiModelProperty(value = "专病路径审核状态,同意:AGREE,不同意:DISAGREE")
|
||||
private String routeCheckStatus;
|
||||
|
||||
/**
|
||||
* 专病路径审核人姓名
|
||||
*/
|
||||
@ApiModelProperty(value = "专病路径审核人姓名")
|
||||
private String routeCheckPerson;
|
||||
|
||||
/**
|
||||
* 专病路径审核时间
|
||||
*/
|
||||
@ApiModelProperty(value = "专病路径审核时间")
|
||||
private LocalDateTime routeCheckDate;
|
||||
|
||||
/**
|
||||
* 专病路径审核备注信息,存储审核备注信息以及审核不通过原因等信息
|
||||
*/
|
||||
@ApiModelProperty(value = "专病路径审核备注信息,存储审核备注信息以及审核不通过原因等信息")
|
||||
private String routeCheckRemark;
|
||||
|
||||
/**
|
||||
* 删除标识,0:未删除,1:已删除
|
||||
*/
|
||||
|
||||
@ -113,4 +113,7 @@ public class SignPatientListDto extends BaseEntity {
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate serviceEndTimeEnd;
|
||||
|
||||
@ApiModelProperty(value = "专病路径审核状态,未审核:UNAUDITED,同意:AGREE,不同意:DISAGREE")
|
||||
private String routeCheckStatus;
|
||||
|
||||
}
|
||||
|
||||
@ -17,6 +17,12 @@ public class TriggerConditionUpdateDto {
|
||||
@ApiModelProperty("子路径主键")
|
||||
private Long routeId;
|
||||
|
||||
/**
|
||||
* 适用范围,在院:IN_THE_HOSPITAL,出院:DISCHARGE,门诊:OUTPATIENT_SERVICE,门诊+出院:OUTPATIENT_SERVICE_DISCHARGE
|
||||
*/
|
||||
@ApiModelProperty(value = "适用范围,在院:IN_THE_HOSPITAL,出院:DISCHARGE,门诊:OUTPATIENT_SERVICE,门诊+出院:OUTPATIENT_SERVICE_DISCHARGE")
|
||||
private String suitRange;
|
||||
|
||||
@ApiModelProperty("触发条件列表")
|
||||
private List<TriggerConditionDto> triggerConditionList;
|
||||
}
|
||||
|
||||
@ -22,6 +22,7 @@ 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.domain.specialdiseasetriggercondition.SpecialDiseaseTriggerCondition;
|
||||
import com.xinelu.manage.domain.textmessage.TextMessage;
|
||||
import com.xinelu.manage.dto.patientinfo.PatientInfoDto;
|
||||
import com.xinelu.manage.dto.signpatientmanageroutenode.AppletPatientTaskDto;
|
||||
@ -35,6 +36,7 @@ import com.xinelu.manage.mapper.signpatientmanageroute.SignPatientManageRouteMap
|
||||
import com.xinelu.manage.mapper.signpatientmanageroutenode.SignPatientManageRouteNodeMapper;
|
||||
import com.xinelu.manage.mapper.signpatientrecord.SignPatientRecordMapper;
|
||||
import com.xinelu.manage.mapper.specialdiseasenode.SpecialDiseaseNodeMapper;
|
||||
import com.xinelu.manage.mapper.specialdiseasetriggercondition.SpecialDiseaseTriggerConditionMapper;
|
||||
import com.xinelu.manage.mapper.textmessage.TextMessageMapper;
|
||||
import com.xinelu.manage.service.propagandainfo.IPropagandaInfoService;
|
||||
import com.xinelu.manage.service.questioninfo.IQuestionInfoService;
|
||||
@ -98,6 +100,8 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage
|
||||
private SpecialDiseaseNodeMapper specialDiseaseNodeMapper;
|
||||
@Resource
|
||||
private TextMessageMapper textMessageMapper;
|
||||
@Resource
|
||||
private SpecialDiseaseTriggerConditionMapper triggerConditionMapper;
|
||||
|
||||
/**
|
||||
* 查询签约患者管理任务路径节点
|
||||
@ -539,10 +543,16 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage
|
||||
|
||||
/**
|
||||
* 生成子路径任务
|
||||
* @param patientId 患者主键
|
||||
* @param routeId 子路径id
|
||||
* @param routeNodeId 节点id
|
||||
*/
|
||||
private void generateChildRouteTask(Long routeId, Long routeNodeId) {
|
||||
private void generateChildRouteTask(Long patientId, Long routeId, Long routeNodeId) {
|
||||
|
||||
// 查询子路径触发条件
|
||||
SpecialDiseaseTriggerCondition triggerConditionQuery = new SpecialDiseaseTriggerCondition();
|
||||
triggerConditionQuery.setRouteId(routeId);
|
||||
List<SpecialDiseaseTriggerCondition> triggerConditionList = triggerConditionMapper.selectSpecialDiseaseTriggerConditionList(triggerConditionQuery);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -3,7 +3,6 @@ package com.xinelu.manage.service.signpatientrecord.impl;
|
||||
import com.xinelu.common.annotation.DataScope;
|
||||
import com.xinelu.common.constant.SignRecordServiceStatusConstants;
|
||||
import com.xinelu.common.constant.TaskCreateTypeConstant;
|
||||
import com.xinelu.common.constant.TemplateTypeConstants;
|
||||
import com.xinelu.common.enums.NodeExecuteStatusEnum;
|
||||
import com.xinelu.common.enums.RouteCheckStatusEnum;
|
||||
import com.xinelu.common.exception.ServiceException;
|
||||
@ -195,46 +194,46 @@ public class SignPatientRecordServiceImpl implements ISignPatientRecordService {
|
||||
throw new ServiceException("该管理任务没有任务节点");
|
||||
}
|
||||
// nodeContent为空,或者不包含替换标签则自动生成任务
|
||||
List<SignPatientManageRouteNode> 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());
|
||||
manageRouteNode.setManageRouteName(signPatientManageRoute.getRouteName());
|
||||
manageRouteNode.setId(null);
|
||||
manageRouteNode.setRouteCheckStatus(RouteCheckStatusEnum.AGREE.getInfo());
|
||||
manageRouteNode.setRouteCheckDate(LocalDateTime.now());
|
||||
manageRouteNode.setRouteCheckRemark("签约自动审核通过");
|
||||
manageRouteNode.setNodeExecuteStatus(NodeExecuteStatusEnum.UNEXECUTED.getInfo());
|
||||
manageRouteNode.setRouteNodeId(node.getId());
|
||||
manageRouteNode.setExecuteTime(node.getExecutionTime());
|
||||
// 根据模板类型,存放模板字段
|
||||
switch(node.getTemplateType()) {
|
||||
// 宣教
|
||||
case TemplateTypeConstants.PROPAGANDA:
|
||||
manageRouteNode.setPropagandaInfoId(node.getTemplateId());
|
||||
manageRouteNode.setPropagandaTitle(node.getTemplateName());
|
||||
break;
|
||||
// 问卷
|
||||
case TemplateTypeConstants.QUESTIONNAIRE:
|
||||
manageRouteNode.setQuestionInfoId(node.getTemplateId());
|
||||
manageRouteNode.setQuestionnaireName(node.getTemplateName());
|
||||
break;
|
||||
// 话术
|
||||
case TemplateTypeConstants.SCRIPT:
|
||||
manageRouteNode.setPhoneId(node.getTemplateId());
|
||||
break;
|
||||
}
|
||||
manageRouteNode.setDelFlag(0);
|
||||
manageRouteNode.setCreateTime(LocalDateTime.now());
|
||||
manageRouteNode.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName());
|
||||
return manageRouteNode;
|
||||
}).collect(Collectors.toList());
|
||||
// 批量保存
|
||||
if (!CollectionUtils.isEmpty(manageNodeList)) {
|
||||
manageRouteNodeMapper.insertBatch(manageNodeList);
|
||||
}
|
||||
//List<SignPatientManageRouteNode> 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());
|
||||
// manageRouteNode.setManageRouteName(signPatientManageRoute.getRouteName());
|
||||
// manageRouteNode.setId(null);
|
||||
// manageRouteNode.setRouteCheckStatus(RouteCheckStatusEnum.AGREE.getInfo());
|
||||
// manageRouteNode.setRouteCheckDate(LocalDateTime.now());
|
||||
// manageRouteNode.setRouteCheckRemark("签约自动审核通过");
|
||||
// manageRouteNode.setNodeExecuteStatus(NodeExecuteStatusEnum.UNEXECUTED.getInfo());
|
||||
// manageRouteNode.setRouteNodeId(node.getId());
|
||||
// manageRouteNode.setExecuteTime(node.getExecutionTime());
|
||||
// // 根据模板类型,存放模板字段
|
||||
// switch(node.getTemplateType()) {
|
||||
// // 宣教
|
||||
// case TemplateTypeConstants.PROPAGANDA:
|
||||
// manageRouteNode.setPropagandaInfoId(node.getTemplateId());
|
||||
// manageRouteNode.setPropagandaTitle(node.getTemplateName());
|
||||
// break;
|
||||
// // 问卷
|
||||
// case TemplateTypeConstants.QUESTIONNAIRE:
|
||||
// manageRouteNode.setQuestionInfoId(node.getTemplateId());
|
||||
// manageRouteNode.setQuestionnaireName(node.getTemplateName());
|
||||
// break;
|
||||
// // 话术
|
||||
// case TemplateTypeConstants.SCRIPT:
|
||||
// manageRouteNode.setPhoneId(node.getTemplateId());
|
||||
// break;
|
||||
// }
|
||||
// manageRouteNode.setDelFlag(0);
|
||||
// manageRouteNode.setCreateTime(LocalDateTime.now());
|
||||
// manageRouteNode.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName());
|
||||
// return manageRouteNode;
|
||||
//}).collect(Collectors.toList());
|
||||
//// 批量保存
|
||||
//if (!CollectionUtils.isEmpty(manageNodeList)) {
|
||||
// manageRouteNodeMapper.insertBatch(manageNodeList);
|
||||
//}
|
||||
// 保存触发条件
|
||||
//SpecialDiseaseTriggerCondition triggerConditionQuery = new SpecialDiseaseTriggerCondition();
|
||||
//triggerConditionQuery.setRouteId(signPatientManageRoute.getRouteId());
|
||||
|
||||
@ -118,11 +118,20 @@ public class SpecialDiseaseNodeServiceImpl implements ISpecialDiseaseNodeService
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public AjaxResult updateSpecialDiseaseNode(SpecialDiseaseRouteVO specialDiseaseNode) {
|
||||
|
||||
if (Objects.nonNull(specialDiseaseNode) && Objects.nonNull(specialDiseaseNode.getSpecialDiseaseRouteId())) {
|
||||
SpecialDiseaseRoute specialDiseaseRoute = specialDiseaseRouteMapper.selectSpecialDiseaseRouteById(specialDiseaseNode.getSpecialDiseaseRouteId());
|
||||
if (Objects.nonNull(specialDiseaseRoute) && StringUtils.isNotBlank(specialDiseaseRoute.getReleaseStatus()) && !ReleaseStatusEnum.UNPUBLISHED.getInfo().equals(specialDiseaseRoute.getReleaseStatus())) {
|
||||
return AjaxResult.error("已发布过的专病路径不能修改!");
|
||||
}
|
||||
if (specialDiseaseRoute.getParentRouteId() == null || specialDiseaseRoute.getParentRouteId() == 0) {
|
||||
if (Objects.nonNull(specialDiseaseRoute) && StringUtils.isNotBlank(specialDiseaseRoute.getReleaseStatus()) && !ReleaseStatusEnum.UNPUBLISHED.getInfo().equals(specialDiseaseRoute.getReleaseStatus())) {
|
||||
return AjaxResult.error("已发布过的专病路径不能修改!");
|
||||
}
|
||||
} else {
|
||||
// 判断主路径的发布状态
|
||||
SpecialDiseaseRoute parentRoute = specialDiseaseRouteMapper.selectSpecialDiseaseRouteById(specialDiseaseRoute.getParentRouteId());
|
||||
if (Objects.nonNull(parentRoute) && StringUtils.isNotBlank(parentRoute.getReleaseStatus()) && !StringUtils.equals(ReleaseStatusEnum.UNPUBLISHED.getInfo(), specialDiseaseRoute.getReleaseStatus())) {
|
||||
return AjaxResult.error("已发布过的专病路径不能修改!");
|
||||
}
|
||||
}
|
||||
}
|
||||
List<Long> longs = specialDiseaseNodeMapper.selectSpecialDiseaseRouteIds(specialDiseaseNode.getSpecialDiseaseRouteId());
|
||||
SpecialDiseaseRoute specialDiseaseRoute = new SpecialDiseaseRoute();
|
||||
@ -146,22 +155,29 @@ public class SpecialDiseaseNodeServiceImpl implements ISpecialDiseaseNodeService
|
||||
List<SpecialDiseaseNodeVO> specialDiseaseNodeVOS = new ArrayList<>();
|
||||
int i = 0;
|
||||
for (SpecialDiseaseNodeVO diseaseNode : specialDiseaseNode.getSpecialDiseaseNodeList()) {
|
||||
if (StringUtils.isNotBlank(diseaseNode.getRouteNodeName()) && Objects.nonNull(diseaseNode.getRouteNodeDay()) && StringUtils.isNotBlank(diseaseNode.getTaskType()) && StringUtils.isNotBlank(diseaseNode.getTaskSubdivision()) && StringUtils.isNotBlank(diseaseNode.getTaskStatus())) {
|
||||
diseaseNode.setRouteId(specialDiseaseRoute.getId());
|
||||
diseaseNode.setRouteName(specialDiseaseNode.getRouteName());
|
||||
diseaseNode.setTemplateType(null);
|
||||
if (StringUtils.isNotBlank(diseaseNode.getTaskSubdivisiontemplateType())
|
||||
&& (TemplateTypeEnum.QUESTIONNAIRE.getInfo().equals(diseaseNode.getTaskSubdivisiontemplateType()) || TemplateTypeEnum.PROPAGANDA.getInfo().equals(diseaseNode.getTaskSubdivisiontemplateType()) || TemplateTypeEnum.SCRIPT.getInfo().equals(diseaseNode.getTaskSubdivisiontemplateType()))) {
|
||||
diseaseNode.setTemplateType(diseaseNode.getTaskSubdivisiontemplateType());
|
||||
}
|
||||
diseaseNode.setUpdateTime(LocalDateTime.now());
|
||||
diseaseNode.setUpdateBy(SecurityUtils.getUsername());
|
||||
if (CollectionUtils.isNotEmpty(longs) && (i < longs.size()) && Objects.nonNull(longs.get(i))) {
|
||||
diseaseNode.setId(longs.get(i));
|
||||
i++;
|
||||
}
|
||||
specialDiseaseNodeVOS.add(diseaseNode);
|
||||
if(StringUtils.isBlank(diseaseNode.getRouteNodeName())) {
|
||||
throw new ServiceException("请输入节点名称");
|
||||
}
|
||||
if (diseaseNode.getRouteNodeDay() == null) {
|
||||
throw new ServiceException("请输入节点时间");
|
||||
}
|
||||
if (StringUtils.isBlank(diseaseNode.getTaskType()) || StringUtils.isBlank(diseaseNode.getTaskSubdivision()) || StringUtils.isBlank(diseaseNode.getTaskStatus())) {
|
||||
throw new ServiceException("任务类型、任务细分、任务状态不能为空");
|
||||
}
|
||||
diseaseNode.setRouteId(specialDiseaseRoute.getId());
|
||||
diseaseNode.setRouteName(specialDiseaseNode.getRouteName());
|
||||
diseaseNode.setTemplateType(null);
|
||||
if (StringUtils.isNotBlank(diseaseNode.getTaskSubdivisiontemplateType())
|
||||
&& (TemplateTypeEnum.QUESTIONNAIRE.getInfo().equals(diseaseNode.getTaskSubdivisiontemplateType()) || TemplateTypeEnum.PROPAGANDA.getInfo().equals(diseaseNode.getTaskSubdivisiontemplateType()) || TemplateTypeEnum.SCRIPT.getInfo().equals(diseaseNode.getTaskSubdivisiontemplateType()))) {
|
||||
diseaseNode.setTemplateType(diseaseNode.getTaskSubdivisiontemplateType());
|
||||
}
|
||||
diseaseNode.setUpdateTime(LocalDateTime.now());
|
||||
diseaseNode.setUpdateBy(SecurityUtils.getUsername());
|
||||
if (CollectionUtils.isNotEmpty(longs) && (i < longs.size()) && Objects.nonNull(longs.get(i))) {
|
||||
diseaseNode.setId(longs.get(i));
|
||||
i++;
|
||||
}
|
||||
specialDiseaseNodeVOS.add(diseaseNode);
|
||||
}
|
||||
int insertNodeCount = specialDiseaseNodeMapper.insertSpecialDiseaseNodeList(specialDiseaseNodeVOS);
|
||||
if (insertNodeCount < 0) {
|
||||
|
||||
@ -83,7 +83,7 @@ public interface ISpecialDiseaseRouteService {
|
||||
* @param specialDiseaseRoute 路径信息
|
||||
* @return AjaxResult
|
||||
*/
|
||||
AjaxResult editReleaseStatus(SpecialDiseaseRoute specialDiseaseRoute);
|
||||
int editReleaseStatus(SpecialDiseaseRoute specialDiseaseRoute);
|
||||
|
||||
/**
|
||||
* 富文本解析
|
||||
|
||||
@ -225,30 +225,40 @@ public class SpecialDiseaseRouteServiceImpl implements ISpecialDiseaseRouteServi
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public AjaxResult editReleaseStatus(SpecialDiseaseRoute specialDiseaseRoute) {
|
||||
public int editReleaseStatus(SpecialDiseaseRoute specialDiseaseRoute) {
|
||||
if (Objects.isNull(specialDiseaseRoute) || StringUtils.isBlank(specialDiseaseRoute.getReleaseStatus()) || Objects.isNull(specialDiseaseRoute.getId())) {
|
||||
return AjaxResult.error("请选择需要发布专病路径的信息!");
|
||||
throw new ServiceException("请选择需要发布专病路径的信息!");
|
||||
}
|
||||
if (ReleaseStatusEnum.PUBLISHED.getInfo().equals(specialDiseaseRoute.getReleaseStatus())) {
|
||||
List<String> strings = specialDiseaseRouteMapper.selectRouteCheckStatus(specialDiseaseRoute.getId());
|
||||
if (CollectionUtils.isEmpty(strings)) {
|
||||
return AjaxResult.error("该路径无节点,请先增加节点并审核通过后发布!");
|
||||
}
|
||||
for (String string : strings) {
|
||||
if (string == null) {
|
||||
return AjaxResult.error("该路径存在未审核通过的节点,请全部审核通过后发布!");
|
||||
}
|
||||
if (!RouteCheckStatusEnum.AGREE.getInfo().equals(string)) {
|
||||
return AjaxResult.error("该路径存在未审核通过的节点,请全部审核通过后发布!");
|
||||
}
|
||||
List<String> checkStatusList = new ArrayList<>();
|
||||
if (StringUtils.equals(ReleaseStatusEnum.PUBLISHED.getInfo(), specialDiseaseRoute.getReleaseStatus())) {
|
||||
checkStatusList = specialDiseaseRouteMapper.selectRouteCheckStatus(specialDiseaseRoute.getId());
|
||||
if (CollectionUtils.isEmpty(checkStatusList)) {
|
||||
throw new ServiceException("该路径无节点,请先增加节点并审核通过后发布!");
|
||||
}
|
||||
// 判断子路径是否都审核通过---子路径都包含节点并且审核通过,主路径才能发布
|
||||
List<SpecialDiseaseRouteInfoVo> childRouteList = specialDiseaseRouteMapper.getChildList(specialDiseaseRoute.getId());
|
||||
List<String> finalCheckStatus = checkStatusList;
|
||||
childRouteList.forEach(childRoute -> {
|
||||
List<String> checkStatus1 = specialDiseaseRouteMapper.selectRouteCheckStatus(childRoute.getId());
|
||||
if (CollectionUtils.isEmpty(checkStatus1)) {
|
||||
throw new ServiceException("存在无节点的子路径,请先增加节点并审核通过后发布!");
|
||||
}
|
||||
finalCheckStatus.addAll(checkStatus1);
|
||||
});
|
||||
|
||||
for (String checkStatus : finalCheckStatus) {
|
||||
if (!StringUtils.equals(RouteCheckStatusEnum.AGREE.getInfo(), checkStatus)) {
|
||||
throw new ServiceException("该路径存在未审核通过的节点,请全部审核通过后发布!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ReleaseStatusEnum.UNPUBLISHED.getInfo().equals(specialDiseaseRoute.getReleaseStatus())) {
|
||||
specialDiseaseRoute.setReleaseStatus(ReleaseStatusEnum.REVOKE.getInfo());
|
||||
}
|
||||
specialDiseaseRoute.setUpdateTime(LocalDateTime.now());
|
||||
specialDiseaseRoute.setUpdateBy(SecurityUtils.getUsername());
|
||||
return AjaxResult.success(specialDiseaseRouteMapper.updateSpecialDiseaseRoute(specialDiseaseRoute));
|
||||
return specialDiseaseRouteMapper.updateSpecialDiseaseRoute(specialDiseaseRoute);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.xinelu.manage.service.specialdiseasetriggercondition.impl;
|
||||
|
||||
import com.xinelu.common.constant.Constants;
|
||||
import com.xinelu.common.enums.ReleaseStatusEnum;
|
||||
import com.xinelu.common.exception.ServiceException;
|
||||
import com.xinelu.common.utils.SecurityUtils;
|
||||
import com.xinelu.common.utils.StringUtils;
|
||||
@ -17,6 +18,7 @@ import com.xinelu.manage.service.specialdiseasetriggercondition.ISpecialDiseaseT
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import javax.annotation.Resource;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -67,6 +69,12 @@ public class SpecialDiseaseTriggerConditionServiceImpl implements ISpecialDiseas
|
||||
*/
|
||||
@Override
|
||||
public int insertSpecialDiseaseTriggerCondition(TriggerConditionSaveDTO triggerConditionSaveDTO) {
|
||||
// 判断主路径的发布状态
|
||||
SpecialDiseaseRoute specialDiseaseRoute = specialDiseaseRouteMapper.selectSpecialDiseaseRouteById(triggerConditionSaveDTO.getParentRouteId());
|
||||
if (Objects.nonNull(specialDiseaseRoute) && org.apache.commons.lang3.StringUtils.isNotBlank(specialDiseaseRoute.getReleaseStatus()) && !StringUtils.equals(ReleaseStatusEnum.UNPUBLISHED.getInfo(), specialDiseaseRoute.getReleaseStatus())) {
|
||||
throw new ServiceException("已发布过的专病路径不能修改!");
|
||||
}
|
||||
|
||||
if (triggerConditionSaveDTO.getParentRouteId() == null) {
|
||||
throw new ServiceException("请选择主路径");
|
||||
}
|
||||
@ -77,7 +85,6 @@ public class SpecialDiseaseTriggerConditionServiceImpl implements ISpecialDiseas
|
||||
throw new ServiceException("请选择适用范围");
|
||||
}
|
||||
// 保存子路径
|
||||
SpecialDiseaseRoute specialDiseaseRoute = specialDiseaseRouteMapper.selectSpecialDiseaseRouteById(triggerConditionSaveDTO.getParentRouteId());
|
||||
specialDiseaseRoute.setCreateTime(LocalDateTime.now());
|
||||
specialDiseaseRoute.setCreateBy(SecurityUtils.getUsername());
|
||||
specialDiseaseRoute.setRouteCode(Constants.ROUTE_CODE + generateSystemCodeUtil.generateSystemCode(Constants.ROUTE_CODE));
|
||||
@ -116,10 +123,29 @@ public class SpecialDiseaseTriggerConditionServiceImpl implements ISpecialDiseas
|
||||
*/
|
||||
@Override
|
||||
public int updateSpecialDiseaseTriggerCondition(TriggerConditionUpdateDto triggerConditionUpdateDto) {
|
||||
// 判断主路径的发布状态
|
||||
SpecialDiseaseRoute route = specialDiseaseRouteMapper.selectSpecialDiseaseRouteById(triggerConditionUpdateDto.getRouteId());
|
||||
if (Objects.nonNull(route)) {
|
||||
SpecialDiseaseRoute parentRoute = specialDiseaseRouteMapper.selectSpecialDiseaseRouteById(route.getParentRouteId());
|
||||
if (Objects.nonNull(parentRoute) && org.apache.commons.lang3.StringUtils.isNotBlank(parentRoute.getReleaseStatus()) && !StringUtils.equals(ReleaseStatusEnum.UNPUBLISHED.getInfo(), parentRoute.getReleaseStatus())) {
|
||||
throw new ServiceException("已发布过的专病路径不能修改!");
|
||||
}
|
||||
}
|
||||
|
||||
if (triggerConditionUpdateDto.getRouteId() == null) {
|
||||
throw new ServiceException("请选择路径");
|
||||
}
|
||||
if (CollectionUtils.isEmpty(triggerConditionUpdateDto.getTriggerConditionList())) {
|
||||
throw new ServiceException("请选择触发条件");
|
||||
}
|
||||
if (StringUtils.isBlank(triggerConditionUpdateDto.getSuitRange())) {
|
||||
throw new ServiceException("请选择适用范围");
|
||||
}
|
||||
// 修改子路径路径名称
|
||||
SpecialDiseaseRoute specialDiseaseRoute = new SpecialDiseaseRoute();
|
||||
specialDiseaseRoute.setId(triggerConditionUpdateDto.getRouteId());
|
||||
specialDiseaseRoute.setRouteName(getRouteName(triggerConditionUpdateDto.getTriggerConditionList()));
|
||||
specialDiseaseRoute.setSuitRange(triggerConditionUpdateDto.getSuitRange());
|
||||
specialDiseaseRouteMapper.updateSpecialDiseaseRoute(specialDiseaseRoute);
|
||||
|
||||
// 修改触发条件
|
||||
|
||||
@ -180,6 +180,12 @@ public class SignPatientListVo {
|
||||
@ApiModelProperty(value = "缴费状态,已缴费:PAID,未交费:UNPAID_FEES")
|
||||
private String paymentStatus;
|
||||
|
||||
/**
|
||||
* 专病路径审核状态,同意:AGREE,不同意:DISAGREE
|
||||
*/
|
||||
@ApiModelProperty(value = "专病路径审核状态,同意:AGREE,不同意:DISAGREE")
|
||||
private String routeCheckStatus;
|
||||
|
||||
/** 服务包表id */
|
||||
@ApiModelProperty(value = "服务包表id")
|
||||
@Excel(name = "服务包表id")
|
||||
|
||||
@ -37,7 +37,11 @@
|
||||
<result property="paymentStatus" column="payment_status" jdbcType="VARCHAR"/>
|
||||
<result property="healthManageId" column="health_manage_id" jdbcType="VARCHAR"/>
|
||||
<result property="healthManageName" column="health_manage_name" jdbcType="VARCHAR"/>
|
||||
<result property="delFlag" column="del_flag" jdbcType="TINYINT"/>
|
||||
<result property="routeCheckStatus" column="route_check_status" jdbcType="VARCHAR"/>
|
||||
<result property="routeCheckPerson" column="route_check_person" jdbcType="VARCHAR"/>
|
||||
<result property="routeCheckDate" column="route_check_date" jdbcType="TIMESTAMP"/>
|
||||
<result property="routeCheckRemark" column="route_check_remark" jdbcType="VARCHAR"/>
|
||||
<result property="delFlag" column="del_flag" jdbcType="TINYINT"/>
|
||||
<result property="createBy" column="create_by" jdbcType="VARCHAR"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
|
||||
@ -53,9 +57,9 @@
|
||||
visit_method,in_hospital_number,sign_diagnosis,review_diagnosis,
|
||||
service_status,sign_status,intentional_source,
|
||||
intentional_time,billing_doctor_id,billing_doctor_name,
|
||||
price,payment_status,health_manage_id,health_manage_name,del_flag,
|
||||
create_by,create_time,update_by,
|
||||
update_time
|
||||
price,payment_status,health_manage_id,health_manage_name,
|
||||
route_check_status,route_check_person,route_check_date,route_check_remark,
|
||||
del_flag,create_by,create_time,update_by,update_time
|
||||
</sql>
|
||||
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
@ -79,8 +83,9 @@
|
||||
,visit_method,in_hospital_number,sign_diagnosis,review_diagnosis
|
||||
,service_status,sign_status,intentional_source
|
||||
,intentional_time,billing_doctor_id,billing_doctor_name
|
||||
,price,payment_status,health_manage_id,health_manage_name,del_flag
|
||||
,create_by,create_time,update_by
|
||||
,price,payment_status,health_manage_id,health_manage_name
|
||||
,route_check_status,route_check_person,route_check_date,route_check_remark
|
||||
,del_flag,create_by,create_time,update_by
|
||||
,update_time)
|
||||
values (#{id,jdbcType=BIGINT},#{patientId,jdbcType=BIGINT},#{patientName,jdbcType=VARCHAR}
|
||||
,#{patientPhone,jdbcType=VARCHAR},#{cardNo,jdbcType=VARCHAR},#{sex,jdbcType=VARCHAR},#{birthDate,jdbcType=DATE},#{signTime,jdbcType=TIMESTAMP}
|
||||
@ -91,6 +96,7 @@
|
||||
,#{serviceStatus,jdbcType=VARCHAR},#{signStatus,jdbcType=VARCHAR},#{intentionalSource,jdbcType=VARCHAR}
|
||||
,#{intentionalTime,jdbcType=TIMESTAMP},#{billingDoctorId,jdbcType=BIGINT},#{billingDoctorName,jdbcType=VARCHAR}
|
||||
,#{price,jdbcType=DECIMAL},#{paymentStatus,jdbcType=VARCHAR},#{healthManageId,jdbcType=BIGINT},#{healthManageName,jdbcType=VARCHAR}
|
||||
,#{routeCheckStatus,jdbcType=VARCHAR},#{routeCheckPerson,jdbcType=VARCHAR},#{routeCheckDate,jdbcType=TIMESTAMP},#{routeCheckRemark,jdbcType=VARCHAR}
|
||||
,#{delFlag,jdbcType=TINYINT},#{createBy,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateBy,jdbcType=VARCHAR}
|
||||
,#{updateTime,jdbcType=TIMESTAMP})
|
||||
</insert>
|
||||
@ -129,6 +135,10 @@
|
||||
<if test="paymentStatus != null">payment_status,</if>
|
||||
<if test="healthManageId != null">health_manage_id,</if>
|
||||
<if test="healthManageName != null">health_manage_name,</if>
|
||||
<if test="routeCheckStatus != null">route_check_status,</if>
|
||||
<if test="routeCheckPerson != null">route_check_person,</if>
|
||||
<if test="routeCheckDate != null">route_check_date,</if>
|
||||
<if test="routeCheckRemark != null">route_check_remark,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
@ -168,6 +178,10 @@
|
||||
<if test="paymentStatus != null">#{paymentStatus,jdbcType=VARCHAR},</if>
|
||||
<if test="healthManageId != null">#{healthManageId,jdbcType=BIGINT},</if>
|
||||
<if test="healthManageName != null">#{healthManageName,jdbcType=VARCHAR},</if>
|
||||
<if test="routeCheckStatus != null">#{routeCheckStatus,jdbcType=VARCHAR},</if>
|
||||
<if test="routeCheckPerson != null">#{routeCheckPerson,jdbcType=VARCHAR},</if>
|
||||
<if test="routeCheckDate != null">#{routeCheckDate,jdbcType=TIMESTAMP},</if>
|
||||
<if test="routeCheckRemark != null">#{routeCheckRemark,jdbcType=VARCHAR},</if>
|
||||
<if test="delFlag != null">#{delFlag,jdbcType=TINYINT},</if>
|
||||
<if test="createBy != null">#{createBy,jdbcType=VARCHAR},</if>
|
||||
<if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
|
||||
@ -271,6 +285,18 @@
|
||||
<if test="healthManageName != null">
|
||||
health_manage_name = #{healthManageName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="routeCheckStatus != null">
|
||||
route_check_status = #{routeCheckStatus,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="routeCheckPerson != null">
|
||||
route_check_person = #{routeCheckPerson,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="routeCheckDate != null">
|
||||
route_check_date = #{routeCheckDate,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="routeCheckRemark != null">
|
||||
route_check_remark = #{routeCheckRemark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="delFlag != null">
|
||||
del_flag = #{delFlag,jdbcType=TINYINT},
|
||||
</if>
|
||||
@ -323,6 +349,10 @@
|
||||
payment_status = #{paymentStatus,jdbcType=VARCHAR},
|
||||
health_manage_id = #{healthManageId,jdbcType=BIGINT},
|
||||
health_manage_name = #{healthManageName,jdbcType=VARCHAR},
|
||||
route_check_status = #{routeCheckStatus,jdbcType=VARCHAR},
|
||||
route_check_person = #{routeCheckPerson,jdbcType=VARCHAR},
|
||||
route_check_date = #{routeCheckDate,jdbcType=TIMESTAMP},
|
||||
route_check_remark = #{routeCheckRemark,jdbcType=VARCHAR},
|
||||
del_flag = #{delFlag,jdbcType=TINYINT},
|
||||
create_by = #{createBy,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
@ -342,6 +372,7 @@
|
||||
sign.visit_serial_number,sign.visit_method,sign.in_hospital_number,sign.sign_diagnosis,sign.review_diagnosis,
|
||||
sign.service_status,sign.sign_status,sign.intentional_source,
|
||||
sign.intentional_time,sign.billing_doctor_name,sign.payment_status,sign.price,sign.health_manage_id, sign.health_manage_name,
|
||||
sign.route_check_status,
|
||||
p.service_package_id, p.package_name, p.service_end_time, p.package_term, p.package_term_unit
|
||||
from patient_info patient
|
||||
left join sign_patient_record sign on patient.sign_patient_record_id = sign.id
|
||||
@ -393,6 +424,17 @@
|
||||
<if test="signStatus != null ">
|
||||
and sign.sign_status = #{signStatus}
|
||||
</if>
|
||||
<choose>
|
||||
<when test="routeCheckStatus != null and routeCheckStatus == 'UNAUDITED'.toString()">
|
||||
and sign.route_check_status is null
|
||||
</when>
|
||||
<when test="routeCheckStatus != null and routeCheckStatus == 'AGREE'.toString()">
|
||||
and sign.route_check_status = #{routeCheckStatus}
|
||||
</when>
|
||||
<when test="routeCheckStatus != null and routeCheckStatus == 'DISAGREE'.toString()">
|
||||
and sign.route_check_status = #{routeCheckStatus}
|
||||
</when>
|
||||
</choose>
|
||||
<if test="serviceEndTimeStart != null">
|
||||
and date_format(p.service_end_time, '%y%m%d') >= date_format(#{serviceEndTimeStart}, '%y%m%d')
|
||||
</if>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user