任务审核->路径信息接口。
This commit is contained in:
parent
32fa03401e
commit
fcaeeedf49
@ -3,6 +3,7 @@ package com.xinelu.web.controller.system;
|
||||
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.domain.entity.SysDictData;
|
||||
import com.xinelu.common.core.page.TableDataInfo;
|
||||
import com.xinelu.common.enums.BusinessType;
|
||||
@ -41,6 +42,13 @@ public class SysDictDataController extends BaseController {
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:list')")
|
||||
@GetMapping("/getList")
|
||||
public R<List<SysDictData>> getList(SysDictData dictData) {
|
||||
List<SysDictData> list = dictDataService.selectDictDataList(dictData);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
@Log(title = "字典数据", businessType = BusinessType.EXPORT)
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:export')")
|
||||
@PostMapping("/export")
|
||||
|
||||
@ -64,6 +64,11 @@ public class SysDictData extends BaseEntity {
|
||||
@Excel(name = "是否默认", readConverterExp = "Y=是,N=否")
|
||||
private String isDefault;
|
||||
|
||||
/**
|
||||
* 字典数据类型
|
||||
*/
|
||||
private String dictDataType;
|
||||
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
@ -163,7 +168,15 @@ public class SysDictData extends BaseEntity {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDictDataType() {
|
||||
return dictDataType;
|
||||
}
|
||||
|
||||
public void setDictDataType(String dictDataType) {
|
||||
this.dictDataType = dictDataType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("dictCode", getDictCode())
|
||||
|
||||
@ -13,14 +13,22 @@ import com.xinelu.manage.dto.patientquestionsubmitresult.PatientQuestionSubmitRe
|
||||
import com.xinelu.manage.service.signpatientmanageroute.ISignPatientManageRouteService;
|
||||
import com.xinelu.manage.vo.manualfollowup.ManualFollowUpVO;
|
||||
import com.xinelu.manage.vo.signpatientmanageroute.SignPatientManageRouteVO;
|
||||
import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageNodeAuditVo;
|
||||
import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteAuditVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 签约患者管理任务路径控制器
|
||||
@ -126,5 +134,23 @@ public class SignPatientManageRouteController extends BaseController {
|
||||
return signPatientManageRouteService.selectPhonePush(manageRouteNodeId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 路径审核->路径信息,获取主路径及子路径信息及节点
|
||||
* @param signRecordId 患者签约主键
|
||||
* @return 主路径信息及节点、子路径信息及节点
|
||||
*/
|
||||
@GetMapping("/getRouteAuditInfo/{signRecordId}")
|
||||
public SpecialDiseaseRouteAuditVo getRouteAuditInfo(@PathVariable("signRecordId") Long signRecordId){
|
||||
return signPatientManageRouteService.getRouteAuditInfo(signRecordId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 路径审核->路径审核,获取节点详细信息
|
||||
* @param signRecordId 患者签约主键
|
||||
* @return 节点详细信息
|
||||
*/
|
||||
@GetMapping("/getRouteNodeInfo/{signRecordId}")
|
||||
public List<SignPatientManageNodeAuditVo> getRouteNodeInfo(@PathVariable("signRecordId") Long signRecordId) {
|
||||
return signPatientManageRouteService.getRouteNodeInfo(signRecordId);
|
||||
}
|
||||
}
|
||||
|
||||
@ -111,8 +111,9 @@ public class SpecialDiseaseRouteController extends BaseController {
|
||||
/**
|
||||
* 富文本解析
|
||||
*/
|
||||
@GetMapping("/jsoupParse")
|
||||
|
||||
public List<String> jsoupParse(Long specialDiseaseNodeId) {
|
||||
return specialDiseaseRouteService.jsoupParse(specialDiseaseNodeId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -131,6 +131,12 @@ public class SignPatientManageRouteNode extends BaseEntity {
|
||||
@Excel(name = "电话短信模板名称")
|
||||
private String phoneMessageTemplateName;
|
||||
|
||||
/**
|
||||
* 替换标签后的电话短信模板内容
|
||||
*/
|
||||
@ApiModelProperty(value = "替换标签后的电话短信模板内容")
|
||||
private String phoneMessageTemplateContent;
|
||||
|
||||
/** 问卷表id */
|
||||
@ApiModelProperty(value = "问卷表id")
|
||||
@Excel(name = "问卷表id")
|
||||
@ -246,21 +252,6 @@ public class SignPatientManageRouteNode extends BaseEntity {
|
||||
@Excel(name = "小程序节点内容", readConverterExp = "富=文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记")
|
||||
private String appletNodeContent;
|
||||
|
||||
/** 人工随访模板表id */
|
||||
@ApiModelProperty(value = "人工随访模板表id")
|
||||
@Excel(name = "人工随访模板表id")
|
||||
private Long followTemplateId;
|
||||
|
||||
/** 人工随访模板名称 */
|
||||
@ApiModelProperty(value = "人工随访模板名称")
|
||||
@Excel(name = "人工随访模板名称")
|
||||
private String followTemplateName;
|
||||
|
||||
/** 人工随访模板内容(富文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记) */
|
||||
@ApiModelProperty(value = "人工随访模板内容")
|
||||
@Excel(name = "人工随访模板内容", readConverterExp = "富=文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记")
|
||||
private String followContent;
|
||||
|
||||
/** 节点审核状态,同意:AGREE,不同意:DISAGREE */
|
||||
@ApiModelProperty(value = "节点审核状态,同意:AGREE,不同意:DISAGREE")
|
||||
@Excel(name = "节点审核状态,同意:AGREE,不同意:DISAGREE")
|
||||
|
||||
@ -51,4 +51,7 @@ public class SignPatientManageRouteNodeDto {
|
||||
/** 节点任务执行状态,已执行:EXECUTED,未执行:UNEXECUTED */
|
||||
@ApiModelProperty(value = "节点任务执行状态,已执行:EXECUTED,未执行:UNEXECUTED")
|
||||
private String nodeExecuteStatus;
|
||||
|
||||
@ApiModelProperty(value = "签约患者管理路径表主键列表")
|
||||
private List<Long> manageRouteIdList;
|
||||
}
|
||||
|
||||
@ -113,6 +113,23 @@ public class SignPatientListDto extends BaseEntity {
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate serviceEndTimeEnd;
|
||||
|
||||
/** 出院时间开始,格式:yyyy-MM-dd HH:mm:ss */
|
||||
@ApiModelProperty(value = "出院时间开始,格式:yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate dischargeTimeStart;
|
||||
|
||||
/** 出院时间结束,格式:yyyy-MM-dd HH:mm:ss */
|
||||
@ApiModelProperty(value = "出院时间结束,格式:yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate dischargeTimeEnd;
|
||||
|
||||
/** 主要诊断 */
|
||||
@ApiModelProperty(value = "主要诊断")
|
||||
private String mainDiagnosis;
|
||||
|
||||
@ApiModelProperty(value = "患者来源,微信小程序:WE_CHAT_APPLET,微信公众号:WE_CHAT_OFFICIAL_ACCOUNT,管理端:MANAGE_END")
|
||||
private String patientSource;
|
||||
|
||||
@ApiModelProperty(value = "专病路径审核状态,未审核:UNAUDITED,同意:AGREE,不同意:DISAGREE")
|
||||
private String routeCheckStatus;
|
||||
|
||||
|
||||
@ -2,9 +2,9 @@ package com.xinelu.manage.mapper.labelfieldcontent;
|
||||
|
||||
import com.xinelu.manage.domain.labelfieldcontent.LabelFieldContent;
|
||||
import com.xinelu.manage.vo.labelfieldcontent.LabelFieldContentVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.xinelu.manage.vo.labelfieldcontent.LabelFieldInfoContentVo;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 标签字段内容信息Mapper接口
|
||||
@ -78,4 +78,11 @@ public interface LabelFieldContentMapper {
|
||||
* @return LabelFieldContentVO
|
||||
*/
|
||||
List<LabelFieldContentVO> selectLabelFieldContent(@Param("labelFieldIds") List<Long> labelFieldIds);
|
||||
|
||||
/**
|
||||
* 查询患者在用标签字段信息
|
||||
* @param patientId 患者主键
|
||||
* @return 患者标签字段列表
|
||||
*/
|
||||
List<LabelFieldInfoContentVo> selectByPatientId(Long patientId);
|
||||
}
|
||||
|
||||
@ -5,6 +5,8 @@ import com.xinelu.manage.dto.signpatientmanageroutenode.PatientTaskDto;
|
||||
import com.xinelu.manage.dto.signpatientmanageroutenode.SignPatientManageRouteNodeDto;
|
||||
import com.xinelu.manage.vo.signpatientmanageroutenode.PatientManageNodeListVo;
|
||||
import com.xinelu.manage.vo.signpatientmanageroutenode.PatientTaskVo;
|
||||
import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageNodeAuditVo;
|
||||
import com.xinelu.manage.vo.specialdiseasenode.SpecialDiseaseNodeAuditVo;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@ -39,6 +41,7 @@ public interface SignPatientManageRouteNodeMapper {
|
||||
public List<SignPatientManageRouteNode> selectSignPatientManageRouteNodeList(SignPatientManageRouteNodeDto signPatientManageRouteNodeDto);
|
||||
|
||||
List<PatientManageNodeListVo> selectPatientManageNodeList(SignPatientManageRouteNodeDto signPatientManageRouteNodeDto);
|
||||
|
||||
/**
|
||||
* 新增签约患者管理任务路径节点
|
||||
*
|
||||
@ -93,4 +96,14 @@ public interface SignPatientManageRouteNodeMapper {
|
||||
String selectNodeContent(Long manageRouteNodeId);
|
||||
|
||||
int updateMessageStatus(SignPatientManageRouteNode signPatientManageRouteNode);
|
||||
|
||||
List<SpecialDiseaseNodeAuditVo> selectByRouteId(Long manageRouteId);
|
||||
|
||||
/**
|
||||
* 任务审核,查询手动创建的任务节点详情
|
||||
* @param manageIds 路径主键列表
|
||||
* @return 节点详细信息列表
|
||||
*/
|
||||
List<SignPatientManageNodeAuditVo> selectAuditNodeInfo(List<Long> manageIds);
|
||||
|
||||
}
|
||||
|
||||
@ -2,6 +2,8 @@ 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.RouteTaskAuditVo;
|
||||
import com.xinelu.manage.vo.specialdiseasenode.SpecialDiseaseNodeAuditVo;
|
||||
import com.xinelu.manage.vo.specialdiseasenode.SpecialDiseaseNodeVO;
|
||||
import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteVO;
|
||||
import java.util.List;
|
||||
@ -96,6 +98,14 @@ public interface SpecialDiseaseNodeMapper {
|
||||
*/
|
||||
List<PatientSpecialDiseaseNodeVo> selectRouteNodeByRouteId(Long specialDiseaseRouteId);
|
||||
|
||||
List<SpecialDiseaseNodeAuditVo> selectByRouteId(Long routeId);
|
||||
|
||||
List<Long> selectSpecialDiseaseRouteIds(Long specialDiseaseRouteId);
|
||||
|
||||
/**
|
||||
* 根据主路径id查询所有主路径节点及子路径节点
|
||||
* @param parentRouteId 主路径id
|
||||
* @return 主路径节点及子路径节点列表
|
||||
*/
|
||||
List<RouteTaskAuditVo> getByParentRouteId(Long parentRouteId);
|
||||
}
|
||||
|
||||
@ -3,11 +3,12 @@ package com.xinelu.manage.mapper.specialdiseaseroute;
|
||||
import com.xinelu.manage.domain.specialdiseaseroute.SpecialDiseaseRoute;
|
||||
import com.xinelu.manage.dto.specialdiseaseroute.SpecialDiseaseRouteDTO;
|
||||
import com.xinelu.manage.vo.department.DepartmentVO;
|
||||
import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseChildRouteAuditVo;
|
||||
import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteAuditVo;
|
||||
import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteInfoVo;
|
||||
import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 专病路径信息Mapper接口
|
||||
@ -32,6 +33,12 @@ public interface SpecialDiseaseRouteMapper {
|
||||
*/
|
||||
List<SpecialDiseaseRoute> selectSpecialDiseaseRouteList(SpecialDiseaseRoute specialDiseaseRoute);
|
||||
|
||||
/**
|
||||
* 查询主路径及子路径列表
|
||||
* @param id 专病路径信息主键
|
||||
* @return
|
||||
*/
|
||||
List<SpecialDiseaseRoute> selectRouteAndChildren(Long id);
|
||||
/**
|
||||
* 查询专病路径信息列表
|
||||
*
|
||||
@ -40,6 +47,9 @@ public interface SpecialDiseaseRouteMapper {
|
||||
*/
|
||||
List<SpecialDiseaseRouteVO> selectDiseaseRouteList(SpecialDiseaseRouteDTO specialDiseaseRoute);
|
||||
|
||||
SpecialDiseaseRouteAuditVo getRouteAuditInfo(Long routeId);
|
||||
|
||||
List<SpecialDiseaseChildRouteAuditVo> selectAuditChildRoute(Long parentRouteId);
|
||||
/**
|
||||
* 新增专病路径信息
|
||||
*
|
||||
|
||||
@ -6,6 +6,8 @@ import com.xinelu.manage.dto.manualfollowup.ManualFollowUpDTO;
|
||||
import com.xinelu.manage.dto.patientquestionsubmitresult.PatientQuestionSubmitResultDTO;
|
||||
import com.xinelu.manage.vo.manualfollowup.ManualFollowUpVO;
|
||||
import com.xinelu.manage.vo.signpatientmanageroute.SignPatientManageRouteVO;
|
||||
import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageNodeAuditVo;
|
||||
import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteAuditVo;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -88,4 +90,18 @@ public interface ISignPatientManageRouteService {
|
||||
* 话术类型代办处理详情
|
||||
*/
|
||||
AjaxResult selectPhonePush(Long manageRouteNodeId);
|
||||
|
||||
/**
|
||||
* 路径审核->路径信息获取主路径及子路径信息及节点
|
||||
* @param patientId 患者主键
|
||||
* @return 主路径信息及节点、子路径信息及节点
|
||||
*/
|
||||
SpecialDiseaseRouteAuditVo getRouteAuditInfo(Long patientId);
|
||||
|
||||
/**
|
||||
* 路径审核->路径审核,节点详细信息
|
||||
* @param signRecordId 签约记录主键
|
||||
* @return 节点详细信息列表
|
||||
*/
|
||||
List<SignPatientManageNodeAuditVo> getRouteNodeInfo(Long signRecordId);
|
||||
}
|
||||
|
||||
@ -1,8 +1,15 @@
|
||||
package com.xinelu.manage.service.signpatientmanageroute.impl;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.xinelu.common.constant.TaskContentConstants;
|
||||
import com.xinelu.common.constant.TaskCreateTypeConstant;
|
||||
import com.xinelu.common.constant.TemplateTypeConstants;
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.common.enums.*;
|
||||
import com.xinelu.common.enums.NodeExecuteStatusEnum;
|
||||
import com.xinelu.common.enums.PhoneConnectStatusEnum;
|
||||
import com.xinelu.common.enums.PhoneMessageRemindEnum;
|
||||
import com.xinelu.common.enums.TaskContentEnum;
|
||||
import com.xinelu.common.enums.TaskCreateTypeEnum;
|
||||
import com.xinelu.common.exception.ServiceException;
|
||||
import com.xinelu.common.utils.AgeUtil;
|
||||
import com.xinelu.common.utils.SecurityUtils;
|
||||
@ -11,37 +18,67 @@ import com.xinelu.manage.domain.patientquestionoptionresult.PatientQuestionOptio
|
||||
import com.xinelu.manage.domain.patientquestionsubjectresult.PatientQuestionSubjectResult;
|
||||
import com.xinelu.manage.domain.patientquestionsubmitresult.PatientQuestionSubmitResult;
|
||||
import com.xinelu.manage.domain.patienttaskexecuterecord.PatientTaskExecuteRecord;
|
||||
import com.xinelu.manage.domain.patientvisitrecord.PatientVisitRecord;
|
||||
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.signroutetriggercondition.SignRouteTriggerCondition;
|
||||
import com.xinelu.manage.domain.textmessage.TextMessage;
|
||||
import com.xinelu.manage.domain.wechattemplate.WechatTemplate;
|
||||
import com.xinelu.manage.dto.manualfollowup.ManualFollowUpDTO;
|
||||
import com.xinelu.manage.dto.patientquestionoptionresult.PatientQuestionOptionResultDTO;
|
||||
import com.xinelu.manage.dto.patientquestionsubjectresult.PatientQuestionSubjectResultDTO;
|
||||
import com.xinelu.manage.dto.patientquestionsubmitresult.PatientQuestionSubmitResultDTO;
|
||||
import com.xinelu.manage.mapper.labelfieldcontent.LabelFieldContentMapper;
|
||||
import com.xinelu.manage.mapper.patientquestionoptionresult.PatientQuestionOptionResultMapper;
|
||||
import com.xinelu.manage.mapper.patientquestionsubjectresult.PatientQuestionSubjectResultMapper;
|
||||
import com.xinelu.manage.mapper.patientquestionsubmitresult.PatientQuestionSubmitResultMapper;
|
||||
import com.xinelu.manage.mapper.patienttaskexecuterecord.PatientTaskExecuteRecordMapper;
|
||||
import com.xinelu.manage.mapper.patientvisitrecord.PatientVisitRecordMapper;
|
||||
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.textmessage.TextMessageMapper;
|
||||
import com.xinelu.manage.mapper.wechattemplate.WechatTemplateMapper;
|
||||
import com.xinelu.manage.service.propagandainfo.IPropagandaInfoService;
|
||||
import com.xinelu.manage.service.questioninfo.IQuestionInfoService;
|
||||
import com.xinelu.manage.service.signpatientmanageroute.ISignPatientManageRouteService;
|
||||
import com.xinelu.manage.service.signpatientmanageroutenode.ISignPatientManageRouteNodeService;
|
||||
import com.xinelu.manage.service.specialdiseasenode.ISpecialDiseaseNodeService;
|
||||
import com.xinelu.manage.service.specialdiseaseroute.ISpecialDiseaseRouteService;
|
||||
import com.xinelu.manage.vo.labelfieldcontent.LabelFieldInfoContentVo;
|
||||
import com.xinelu.manage.vo.manualfollowup.ManualFollowPatientVO;
|
||||
import com.xinelu.manage.vo.manualfollowup.ManualFollowUpVO;
|
||||
import com.xinelu.manage.vo.propagandainfo.PropagandaMaterialsVo;
|
||||
import com.xinelu.manage.vo.questionInfo.QuestionVO;
|
||||
import com.xinelu.manage.vo.signpatientmanageroute.SignPatientManageRouteVO;
|
||||
import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageNodeAuditVo;
|
||||
import com.xinelu.manage.vo.signroutetriggercondition.SignRouteTriggerConditionVO;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import com.xinelu.manage.vo.specialdiseasenode.RouteTaskAuditVo;
|
||||
import com.xinelu.manage.vo.specialdiseasenode.SpecialDiseaseNodeAuditVo;
|
||||
import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseChildRouteAuditVo;
|
||||
import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteAuditVo;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.annotation.Resource;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
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;
|
||||
|
||||
|
||||
/**
|
||||
@ -68,6 +105,26 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
|
||||
private SignRouteTriggerConditionMapper signRouteTriggerConditionMapper;
|
||||
@Resource
|
||||
private ISignPatientManageRouteNodeService iSignPatientManageRouteNodeService;
|
||||
@Resource
|
||||
private SignPatientRecordMapper signPatientRecordMapper;
|
||||
@Resource
|
||||
private ISpecialDiseaseRouteService specialDiseaseRouteService;
|
||||
@Resource
|
||||
private ISpecialDiseaseNodeService specialDiseaseNodeService;
|
||||
@Resource
|
||||
private PatientVisitRecordMapper patientVisitRecordMapper;
|
||||
@Resource
|
||||
private ScriptInfoMapper scriptInfoMapper;
|
||||
@Resource
|
||||
private IQuestionInfoService questionInfoService;
|
||||
@Resource
|
||||
private IPropagandaInfoService propagandaInfoService;
|
||||
@Resource
|
||||
private LabelFieldContentMapper labelFieldContentMapper;
|
||||
@Resource
|
||||
private TextMessageMapper textMessageMapper;
|
||||
@Resource
|
||||
private WechatTemplateMapper wechatTemplateMapper;
|
||||
|
||||
/**
|
||||
* 查询签约患者管理任务路径
|
||||
@ -329,7 +386,210 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
|
||||
return AjaxResult.success(signPatientManageRouteMapper.selectSignPatientManageRouteNode(manageRouteNodeId));
|
||||
}
|
||||
|
||||
/**
|
||||
@Override public SpecialDiseaseRouteAuditVo getRouteAuditInfo(Long signRecordId) {
|
||||
SignPatientRecord signPatientRecord = signPatientRecordMapper.selectByPrimaryKey(signRecordId);
|
||||
if (ObjectUtils.isEmpty(signPatientRecord)) {
|
||||
throw new ServiceException("未找到该患者签约信息");
|
||||
}
|
||||
SignPatientManageRoute manageRouteQuery = new SignPatientManageRoute();
|
||||
manageRouteQuery.setSignPatientRecordId(signRecordId);
|
||||
manageRouteQuery.setTaskCreateType(TaskCreateTypeConstant.MANUAL_MATCHE);
|
||||
List<SignPatientManageRoute> manageRouteList = signPatientManageRouteMapper.selectSignPatientManageRouteList(manageRouteQuery);
|
||||
if (CollectionUtils.isEmpty(manageRouteList)) {
|
||||
throw new ServiceException("未找到签约管理路径");
|
||||
}
|
||||
SignPatientManageRoute signPatientManageRoute = manageRouteList.get(0);
|
||||
SpecialDiseaseRouteAuditVo specialDiseaseRouteAuditVo = specialDiseaseRouteService.getRouteAuditInfo(signPatientManageRoute.getRouteId());
|
||||
// 计算子路径的节点执行时间
|
||||
PatientVisitRecord patientVisitRecord = patientVisitRecordMapper.selectPatientVisitRecordById(signPatientRecord.getPatientVisitRecordId());
|
||||
if (ObjectUtils.isEmpty(patientVisitRecord)) {
|
||||
throw new ServiceException("未找到患者就诊记录");
|
||||
}
|
||||
// 计算主路径节点执行时间
|
||||
specialDiseaseRouteAuditVo.getNodeList().forEach(node -> {
|
||||
node.setExecuteTime(iSignPatientManageRouteNodeService.getExecuteTime(node.getExecutionTime(), node.getRouteNodeName(), node.getRouteNodeDay(), patientVisitRecord));
|
||||
});
|
||||
// 计算子路径节点执行时间
|
||||
specialDiseaseRouteAuditVo.getChildRouteList()
|
||||
.forEach(childRoute -> childRoute.getNodeList()
|
||||
.forEach(childNode -> childNode.setExecuteTime(
|
||||
iSignPatientManageRouteNodeService.getExecuteTime(childNode.getExecutionTime(), childNode.getRouteNodeName(), childNode.getRouteNodeDay(), patientVisitRecord))));
|
||||
// 查询手动创建的路径
|
||||
manageRouteQuery.setTaskCreateType(TaskCreateTypeConstant.MANUAL_CREATE);
|
||||
List<SignPatientManageRoute> manualRouteList = signPatientManageRouteMapper.selectSignPatientManageRouteList(manageRouteQuery);
|
||||
if (CollectionUtils.isNotEmpty(manualRouteList)) {
|
||||
// 查询节点信息组装成返回的数据类型
|
||||
manualRouteList.forEach(route -> {
|
||||
// 查询节点
|
||||
List<SpecialDiseaseNodeAuditVo> nodeList = signPatientManageRouteNodeMapper.selectByRouteId(route.getId());
|
||||
nodeList.forEach(node-> {
|
||||
node.setExecuteTime(
|
||||
iSignPatientManageRouteNodeService.getExecuteTime(node.getExecutionTime(), node.getRouteNodeName(), node.getRouteNodeDay(), patientVisitRecord));
|
||||
});
|
||||
specialDiseaseRouteAuditVo.getChildRouteList().add(
|
||||
SpecialDiseaseChildRouteAuditVo.builder().diseaseTypeName(route.getDiseaseTypeName())
|
||||
.routeName(route.getRouteName())
|
||||
.diseaseTypeId(route.getDiseaseTypeId())
|
||||
.nodeList(nodeList).build()
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
return specialDiseaseRouteAuditVo;
|
||||
}
|
||||
|
||||
@Override public List<SignPatientManageNodeAuditVo> getRouteNodeInfo(Long signRecordId) {
|
||||
List<SignPatientManageNodeAuditVo> manageNodeAuditList = new ArrayList<>();
|
||||
// 查询专病路径节点和手动创建的任务节点
|
||||
SignPatientRecord signPatientRecord = signPatientRecordMapper.selectByPrimaryKey(signRecordId);
|
||||
if (ObjectUtils.isEmpty(signPatientRecord)) {
|
||||
throw new ServiceException("未找到该患者签约信息");
|
||||
}
|
||||
SignPatientManageRoute manageRouteQuery = new SignPatientManageRoute();
|
||||
manageRouteQuery.setSignPatientRecordId(signRecordId);
|
||||
manageRouteQuery.setTaskCreateType(TaskCreateTypeConstant.MANUAL_MATCHE);
|
||||
List<SignPatientManageRoute> manageRouteList = signPatientManageRouteMapper.selectSignPatientManageRouteList(manageRouteQuery);
|
||||
if (CollectionUtils.isEmpty(manageRouteList)) {
|
||||
throw new ServiceException("未找到签约管理路径");
|
||||
}
|
||||
SignPatientManageRoute signPatientManageRoute = manageRouteList.get(0);
|
||||
// 查询主路径及子路径节点
|
||||
List<RouteTaskAuditVo> nodeList = specialDiseaseNodeService.getByParentRouteId(signPatientManageRoute.getRouteId());
|
||||
// 查询患者画像信息
|
||||
List<LabelFieldInfoContentVo> labelFieldContentList = labelFieldContentMapper.selectByPatientId(signPatientRecord.getPatientId());
|
||||
// 组装数据
|
||||
nodeList.forEach(node -> {
|
||||
SignPatientManageNodeAuditVo manageRouteNode = new SignPatientManageNodeAuditVo();
|
||||
BeanUtils.copyBeanProp(manageRouteNode, node);
|
||||
manageRouteNode.setManageRouteName(signPatientManageRoute.getRouteName());
|
||||
manageRouteNode.setId(null);
|
||||
manageRouteNode.setRouteNodeId(node.getId());
|
||||
manageRouteNode.setExecuteTime(node.getExecutionTime());
|
||||
|
||||
JSONObject templateDetail = new JSONObject();
|
||||
// 根据模板类型,存放模板字段
|
||||
switch(node.getTemplateType()) {
|
||||
// 宣教
|
||||
case TemplateTypeConstants.PROPAGANDA:
|
||||
manageRouteNode.setPropagandaInfoId(node.getTemplateId());
|
||||
manageRouteNode.setPropagandaTitle(node.getTemplateName());
|
||||
// 查询宣教表
|
||||
PropagandaMaterialsVo propagandaMaterialsVo = propagandaInfoService.selectPropagandaInfoById(node.getTemplateId());
|
||||
templateDetail = JSONObject.parseObject(JSONObject.toJSONString(propagandaMaterialsVo));
|
||||
manageRouteNode.setTemplateType(TemplateTypeConstants.PROPAGANDA);
|
||||
manageRouteNode.setTemplateDetail(templateDetail);
|
||||
break;
|
||||
// 问卷
|
||||
case TemplateTypeConstants.QUESTIONNAIRE:
|
||||
manageRouteNode.setQuestionInfoId(node.getTemplateId());
|
||||
manageRouteNode.setQuestionnaireName(node.getTemplateName());
|
||||
// 查询问卷详情
|
||||
QuestionVO questionVO = questionInfoService.selectQuestionInfoById(node.getTemplateId());
|
||||
if (ObjectUtils.isNotEmpty(questionVO)) {
|
||||
templateDetail = JSONObject.parseObject(JSONObject.toJSONString(questionVO));
|
||||
manageRouteNode.setTemplateType(TemplateTypeConstants.QUESTIONNAIRE);
|
||||
manageRouteNode.setTemplateDetail(templateDetail);
|
||||
}
|
||||
break;
|
||||
// 话术
|
||||
case TemplateTypeConstants.SCRIPT:
|
||||
manageRouteNode.setPhoneId(node.getTemplateId());
|
||||
// 查询话术
|
||||
ScriptInfo scriptInfo = scriptInfoMapper.selectScriptInfoById(node.getTemplateId());
|
||||
if (ObjectUtils.isNotEmpty(scriptInfo)) {
|
||||
// 话术库json内容替换
|
||||
manageRouteNode.setPhoneNodeContent(getFlowScheme(scriptInfo.getFlowScheme(), labelFieldContentList));
|
||||
templateDetail = JSONObject.parseObject(JSONObject.toJSONString(scriptInfo));
|
||||
manageRouteNode.setTemplateType(TemplateTypeConstants.SCRIPT);
|
||||
manageRouteNode.setTemplateDetail(templateDetail);
|
||||
|
||||
// 电话短信内容
|
||||
if (node.getPhoneMessageTemplateId() != null) {
|
||||
// 查询短信库
|
||||
manageRouteNode.setPhoneMessageTemplateContent(replaceMessageInfo(node.getPhoneMessageTemplateId(), labelFieldContentList));
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
// 替换短信、公众号、小程序内容
|
||||
replaceTemplateInfo(manageRouteNode, node, labelFieldContentList);
|
||||
// 替换nodeContent
|
||||
List<SignPatientManageNodeAuditVo> manageNodeList = new ArrayList<>();
|
||||
if (StringUtils.contains(node.getNodeContent(), "data-w-e-type")) {
|
||||
manageNodeList = replaceNodeContent(manageRouteNode, node, labelFieldContentList);
|
||||
} else {
|
||||
manageNodeList.add(manageRouteNode);
|
||||
}
|
||||
|
||||
manageNodeAuditList.addAll(manageNodeList);
|
||||
});
|
||||
// 查询手动创建的节点
|
||||
manageRouteQuery.setTaskCreateType(TaskCreateTypeConstant.MANUAL_CREATE);
|
||||
List<SignPatientManageRoute> createRouteList = signPatientManageRouteMapper.selectSignPatientManageRouteList(manageRouteQuery);
|
||||
List<Long> manageRouteIds = createRouteList.stream().map(SignPatientManageRoute::getId).collect(Collectors.toList());
|
||||
List<SignPatientManageNodeAuditVo> manageNodeList = signPatientManageRouteNodeMapper.selectAuditNodeInfo(manageRouteIds);
|
||||
// 根据node去替换模板信息
|
||||
manageNodeList.forEach(manageNode -> {
|
||||
JSONObject templateDetail = new JSONObject();
|
||||
switch(manageNode.getTaskType()) {
|
||||
// 电话外呼--话术
|
||||
case TaskContentConstants.PHONE_OUTBOUND:
|
||||
ScriptInfo scriptInfo = scriptInfoMapper.selectScriptInfoById(manageNode.getPhoneId());
|
||||
if (ObjectUtils.isNotEmpty(scriptInfo)) {
|
||||
// 话术库json内容替换
|
||||
manageNode.setPhoneNodeContent(getFlowScheme(scriptInfo.getFlowScheme(), labelFieldContentList));
|
||||
templateDetail = JSONObject.parseObject(JSONObject.toJSONString(scriptInfo));
|
||||
manageNode.setTemplateType(TemplateTypeConstants.SCRIPT);
|
||||
manageNode.setTemplateDetail(templateDetail);
|
||||
|
||||
// 电话短信内容
|
||||
if (manageNode.getPhoneMessageTemplateId() != null) {
|
||||
// 查询短信库
|
||||
manageNode.setPhoneMessageTemplateContent(replaceMessageInfo(manageNode.getPhoneMessageTemplateId(), labelFieldContentList));
|
||||
}
|
||||
}
|
||||
break;
|
||||
// 问卷
|
||||
case TaskContentConstants.QUESTIONNAIRE_SCALE:
|
||||
// 查询问卷详情
|
||||
QuestionVO questionVO = questionInfoService.selectQuestionInfoById(manageNode.getQuestionInfoId());
|
||||
if (ObjectUtils.isNotEmpty(questionVO)) {
|
||||
templateDetail = JSONObject.parseObject(JSONObject.toJSONString(questionVO));
|
||||
manageNode.setTemplateType(TemplateTypeConstants.QUESTIONNAIRE);
|
||||
manageNode.setTemplateDetail(templateDetail);
|
||||
}
|
||||
break;
|
||||
// 宣教
|
||||
case TaskContentConstants.PROPAGANDA_ARTICLE:
|
||||
// 查询宣教详情
|
||||
PropagandaMaterialsVo propagandaMaterialsVo = propagandaInfoService.selectPropagandaInfoById(manageNode.getPropagandaInfoId());
|
||||
if (ObjectUtils.isNotEmpty(propagandaMaterialsVo)) {
|
||||
templateDetail = JSONObject.parseObject(JSONObject.toJSONString(propagandaMaterialsVo));
|
||||
manageNode.setTemplateType(TemplateTypeConstants.PROPAGANDA);
|
||||
manageNode.setTemplateDetail(templateDetail);
|
||||
}
|
||||
break;
|
||||
// 文字提醒
|
||||
//case TaskContentConstants.TEXT_REMIND:
|
||||
// manageNode.setTemplateType(TemplateTypeConstants.PROPAGANDA);
|
||||
// break;
|
||||
// 人工随访
|
||||
case TaskContentConstants.ARTIFICIAL_FOLLOW_UP:
|
||||
// 查询问卷详情
|
||||
QuestionVO questionVO1 = questionInfoService.selectQuestionInfoById(Long.valueOf(manageNode.getPhoneTemplateId()));
|
||||
if (ObjectUtils.isNotEmpty(questionVO1)) {
|
||||
templateDetail = JSONObject.parseObject(JSONObject.toJSONString(questionVO1));
|
||||
manageNode.setTemplateType(TemplateTypeConstants.QUESTIONNAIRE);
|
||||
manageNode.setTemplateDetail(templateDetail);
|
||||
}
|
||||
break;
|
||||
}
|
||||
manageNodeAuditList.add(manageNode);
|
||||
});
|
||||
return manageNodeAuditList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增患者管理任务执行记录
|
||||
*/
|
||||
private Long insertPatientTaskExecuteRecord(PatientQuestionSubmitResultDTO dto, String routeHandlePerson, LocalDateTime time) {
|
||||
@ -399,9 +659,9 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
|
||||
signPatientManageRouteNode.setTextRemindContent(StringUtils.isBlank(routeNode.getTextRemindContent()) ? null : routeNode.getTextRemindContent());
|
||||
}
|
||||
if (Objects.nonNull(routeNode) && TaskContentEnum.ARTIFICIAL_FOLLOW_UP.getInfo().equals(routeNode.getTaskType())) {
|
||||
signPatientManageRouteNode.setFollowTemplateId(Objects.isNull(routeNode.getFollowTemplateId()) ? null : routeNode.getFollowTemplateId());
|
||||
signPatientManageRouteNode.setFollowContent(StringUtils.isBlank(routeNode.getFollowContent()) ? null : routeNode.getFollowContent());
|
||||
signPatientManageRouteNode.setFollowTemplateName(StringUtils.isBlank(routeNode.getFollowTemplateName()) ? null : routeNode.getFollowTemplateName());
|
||||
signPatientManageRouteNode.setPhoneTemplateId(Objects.isNull(routeNode.getPhoneTemplateId()) ? null : routeNode.getPhoneTemplateId());
|
||||
signPatientManageRouteNode.setPhoneNodeContent(StringUtils.isBlank(routeNode.getPhoneNodeContent()) ? null : routeNode.getPhoneNodeContent());
|
||||
signPatientManageRouteNode.setPhoneTemplateName(StringUtils.isBlank(routeNode.getPhoneTemplateName()) ? null : routeNode.getPhoneTemplateName());
|
||||
}
|
||||
signPatientManageRouteNode.setMessagePushSign(Objects.isNull(routeNode.getMessagePushSign()) ? null : routeNode.getMessagePushSign());
|
||||
signPatientManageRouteNode.setMessageTemplateId(Objects.isNull(routeNode.getMessageTemplateId()) ? null : routeNode.getMessageTemplateId());
|
||||
@ -422,4 +682,122 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
|
||||
signPatientManageRouteNode.setCreateBy(SecurityUtils.getUsername());
|
||||
signPatientManageRouteNodes.add(signPatientManageRouteNode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 话术json参数替换
|
||||
* @param flowScheme 话术json
|
||||
* @param labelFieldContentList 患者画像信息
|
||||
* @return
|
||||
*/
|
||||
private String getFlowScheme(String flowScheme, List<LabelFieldInfoContentVo> labelFieldContentList) {
|
||||
// 话术库json内容替换
|
||||
if (StringUtils.isNotBlank(flowScheme) && StringUtils.contains(flowScheme, "{{") && StringUtils.contains(flowScheme, "}}")) {
|
||||
// 替换{{}}中的内容
|
||||
Pattern pattern = Pattern.compile("\\{\\{([^\\{\\}}]+)\\}\\}");
|
||||
Matcher matcher = pattern.matcher(flowScheme);
|
||||
while (matcher.find()) {
|
||||
//过滤出符合条件的对象,不匹配返回null。
|
||||
LabelFieldInfoContentVo labelFieldContent = labelFieldContentList.stream().filter(s -> Objects.equals(s.getFieldCode(), matcher.group(1))).findFirst().orElse(null);
|
||||
if (ObjectUtils.isNotEmpty(labelFieldContent)) {
|
||||
flowScheme = flowScheme.replaceAll("\\{\\{([^\\{\\}}]+)\\}\\}", ObjectUtils.isEmpty(labelFieldContent) ? "" : labelFieldContent.getFieldValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
return flowScheme;
|
||||
}
|
||||
|
||||
/**
|
||||
* * 短信模板内容
|
||||
* @param messageTemplateId 短信模板主键
|
||||
* @param labelFieldContentList 患者画像信息
|
||||
* @return
|
||||
*/
|
||||
private String replaceMessageInfo(Long messageTemplateId, List<LabelFieldInfoContentVo> labelFieldContentList) {
|
||||
// 查询短信模板
|
||||
TextMessage textMessage = textMessageMapper.selectTextMessageById(messageTemplateId);
|
||||
String textMessageContent = textMessage.getTextMessageContent();
|
||||
// 替换{{}}中的内容
|
||||
Pattern pattern = Pattern.compile("\\{\\{([^\\{\\}}]+)\\}\\}");
|
||||
Matcher matcher = pattern.matcher(textMessage.getTextMessageContent());
|
||||
while (matcher.find()) {
|
||||
// 过滤出符合条件的对象,不匹配返回null。
|
||||
LabelFieldInfoContentVo labelFieldContent = labelFieldContentList.stream().filter(s -> Objects.equals(s.getFieldCode(), matcher.group(1))).findFirst().orElse(null);
|
||||
if (ObjectUtils.isNotEmpty(labelFieldContent)) {
|
||||
textMessageContent = textMessageContent.replaceAll("\\{\\{([^\\{\\}}]+)\\}\\}", ObjectUtils.isEmpty(labelFieldContent) ? "" : labelFieldContent.getFieldValue());
|
||||
}
|
||||
}
|
||||
return textMessageContent;
|
||||
}
|
||||
|
||||
private void replaceTemplateInfo(SignPatientManageNodeAuditVo manageRouteNode, RouteTaskAuditVo node, List<LabelFieldInfoContentVo> labelFieldContentList) {
|
||||
if (node.getMessagePushSign() == 1) {
|
||||
// 替换短信模板
|
||||
manageRouteNode.setMessageNodeContent(replaceMessageInfo(node.getMessageTemplateId(), labelFieldContentList));
|
||||
}
|
||||
// 替换公众号模板
|
||||
if (node.getOfficialPushSign() == 1) {
|
||||
manageRouteNode.setOfficialNodeContent(replaceWeChatTemplate(node.getOfficialTemplateId(), labelFieldContentList));
|
||||
}
|
||||
// 替换小程序模板
|
||||
if (node.getAppletPushSign() == 1) {
|
||||
manageRouteNode.setAppletNodeContent(replaceWeChatTemplate(node.getOfficialTemplateId(), labelFieldContentList));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 替换公众号、小程序模板内容
|
||||
* @param templateId 微信库模板id
|
||||
* @param labelFieldContentList 患者画像信息
|
||||
*/
|
||||
private String replaceWeChatTemplate(Long templateId, List<LabelFieldInfoContentVo> labelFieldContentList) {
|
||||
WechatTemplate wechatTemplate = wechatTemplateMapper.selectWechatTemplateById(templateId);
|
||||
if (ObjectUtils.isEmpty(wechatTemplate)){
|
||||
return null;
|
||||
}
|
||||
String templateContent = wechatTemplate.getTemplateContent();
|
||||
Pattern pattern = Pattern.compile("\\{\\{([^\\{\\}}]+)\\}\\}");
|
||||
Matcher matcher = pattern.matcher(templateContent);
|
||||
while (matcher.find()) {
|
||||
// 过滤出符合条件的对象,不匹配返回null。
|
||||
LabelFieldInfoContentVo labelFieldContent = labelFieldContentList.stream().filter(s -> Objects.equals(s.getFieldCode(), matcher.group(1))).findFirst().orElse(null);
|
||||
if (ObjectUtils.isNotEmpty(labelFieldContent)) {
|
||||
templateContent = templateContent.replaceAll("\\{\\{([^\\{\\}}]+)\\}\\}", ObjectUtils.isEmpty(labelFieldContent) ? "" : labelFieldContent.getFieldValue());
|
||||
}
|
||||
}
|
||||
return templateContent;
|
||||
}
|
||||
|
||||
/**
|
||||
* 替换节点内容
|
||||
* @param node 节点
|
||||
* @param labelFieldContentList 画像信息
|
||||
* @return 替换标签后的节点列表
|
||||
*/
|
||||
private List<SignPatientManageNodeAuditVo> replaceNodeContent(SignPatientManageNodeAuditVo manageRouteNode, RouteTaskAuditVo node, List<LabelFieldInfoContentVo> labelFieldContentList) {
|
||||
List<SignPatientManageNodeAuditVo> manageNodeList = new ArrayList<>();
|
||||
// 按照任务细分分组
|
||||
Map<Long, List<LabelFieldInfoContentVo>> groupbyPartition = labelFieldContentList.stream().collect(Collectors.groupingBy(LabelFieldInfoContentVo::getTaskPartitionDictId));
|
||||
List<LabelFieldInfoContentVo> nodeParamList = groupbyPartition.get(node.getTaskPartitionDictId());
|
||||
// 参数按照序列号分组
|
||||
Map<String, List<LabelFieldInfoContentVo>> groupBySn = nodeParamList.stream().collect(Collectors.groupingBy(LabelFieldInfoContentVo::getPortraitSn));
|
||||
|
||||
for (String portraitSn : groupBySn.keySet()) {
|
||||
SignPatientManageNodeAuditVo manageNode = new SignPatientManageNodeAuditVo();
|
||||
BeanUtils.copyBeanProp(manageNode, manageRouteNode);
|
||||
// 替换文本
|
||||
List<LabelFieldInfoContentVo> nodeParams = groupBySn.get(portraitSn);
|
||||
Map<String, String> map = nodeParams.stream().collect(Collectors.toMap(LabelFieldInfoContentVo::getFieldCode,LabelFieldInfoContentVo::getFieldValue,(key1,key2)->key2));
|
||||
Document document = Jsoup.parse(manageNode.getNodeContent());
|
||||
// 需要提取的span
|
||||
Elements spanlist = document.select("span[data-w-e-type]");
|
||||
for (Element span : spanlist) {
|
||||
String paramKey = span.attr("data-fieldMark");
|
||||
span.text(map.getOrDefault(paramKey, ""));
|
||||
span.unwrap();
|
||||
}
|
||||
manageNode.setNodeContent(document.body().html());
|
||||
manageNodeList.add(manageNode);
|
||||
}
|
||||
return manageNodeList;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.xinelu.manage.service.signpatientmanageroutenode;
|
||||
|
||||
import com.xinelu.manage.domain.patientnodeparamscurrent.PatientNodeParamsCurrent;
|
||||
import com.xinelu.manage.domain.patientvisitrecord.PatientVisitRecord;
|
||||
import com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRouteNode;
|
||||
import com.xinelu.manage.dto.signpatientmanageroutenode.AppletPatientTaskDto;
|
||||
import com.xinelu.manage.dto.signpatientmanageroutenode.PatientTaskDto;
|
||||
@ -12,6 +13,8 @@ import com.xinelu.manage.vo.signpatientmanageroutenode.PatientManageNodeListVo;
|
||||
import com.xinelu.manage.vo.signpatientmanageroutenode.PatientTaskVo;
|
||||
import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageRouteNodeVo;
|
||||
import com.xinelu.manage.vo.specialdiseasenode.PatientSpecialDiseaseNodeVo;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@ -135,4 +138,6 @@ public interface ISignPatientManageRouteNodeService {
|
||||
* @param taskType 任务类型
|
||||
*/
|
||||
void generateTask(Long manageRouteNodeId, String taskType);
|
||||
|
||||
LocalDateTime getExecuteTime(LocalTime executeTime, String routeNodeName, Integer routeNodeDay, PatientVisitRecord patientVisitRecord);
|
||||
}
|
||||
|
||||
@ -223,8 +223,8 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage
|
||||
}
|
||||
break;
|
||||
case (TaskContentConstants.ARTIFICIAL_FOLLOW_UP): // 人工随访-返回问卷信息
|
||||
if (node.getFollowTemplateId() != null) {
|
||||
QuestionVO questionVO = questionInfoService.selectQuestionInfoById(node.getFollowTemplateId());
|
||||
if (node.getPhoneTemplateId() != null) {
|
||||
QuestionVO questionVO = questionInfoService.selectQuestionInfoById(Long.valueOf(node.getPhoneTemplateId()));
|
||||
detailInfo = JSONObject.parseObject(JSONObject.toJSONString(questionVO));
|
||||
}
|
||||
break;
|
||||
@ -388,7 +388,7 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage
|
||||
List<SignPatientManageRouteNode> signNodeList = signPatientManageRouteNodeMapper.selectSignPatientManageRouteNodeList(nodeQuery);
|
||||
for (SignPatientManageRouteNode node : signNodeList) {
|
||||
// 任务执行时间
|
||||
LocalDateTime executeTime = getExecuteTime(node, patientVisitRecord);
|
||||
LocalDateTime executeTime = getExecuteTime(node.getExecuteTime(), node.getRouteNodeName(), node.getRouteNodeDay(), patientVisitRecord);
|
||||
|
||||
retList.add(AppletRouteNodeListVo.builder()
|
||||
.id(node.getId())
|
||||
@ -541,6 +541,49 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取节点执行时间
|
||||
* @param executeTime 节点执行时间,HH:mm
|
||||
* @param routeNodeName 节点名称
|
||||
* @param routeNodeDay 节点执行天数
|
||||
* @param patientVisitRecord 患者就诊记录
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public LocalDateTime getExecuteTime(LocalTime executeTime, String routeNodeName, Integer routeNodeDay, PatientVisitRecord patientVisitRecord) {
|
||||
LocalDateTime executeDateTime = null;
|
||||
|
||||
LocalTime et = LocalTime.of(8,0,0);
|
||||
if (executeTime != null) {
|
||||
et = executeTime;
|
||||
}
|
||||
switch(routeNodeName) {
|
||||
case RouteNodeNameConstants.AFTER_DISCHARGE: // 出院后
|
||||
case RouteNodeNameConstants.AFTER_VISIT_DISCHARGE: // 就诊/出院后
|
||||
// 判断是门诊/住院
|
||||
if (StringUtils.equals(VisitMethodConstants.BE_IN_HOSPITAL, patientVisitRecord.getVisitMethod())) {
|
||||
executeDateTime = LocalDateTime.of(patientVisitRecord.getDischargeTime().plusDays(routeNodeDay).toLocalDate(), et);
|
||||
} else {
|
||||
executeDateTime = LocalDateTime.of(patientVisitRecord.getVisitDate().plusDays(routeNodeDay).toLocalDate(), et);
|
||||
}
|
||||
break;
|
||||
case RouteNodeNameConstants.AFTER_ADMISSION: // 入院后
|
||||
if (StringUtils.equals(VisitMethodConstants.BE_IN_HOSPITAL, patientVisitRecord.getVisitMethod())) {
|
||||
executeDateTime = LocalDateTime.of(patientVisitRecord.getAdmissionTime().plusDays(routeNodeDay).toLocalDate(), et);
|
||||
} else {
|
||||
executeDateTime = LocalDateTime.of(patientVisitRecord.getVisitDate().plusDays(routeNodeDay).toLocalDate(), et);
|
||||
}
|
||||
break;
|
||||
case RouteNodeNameConstants.AFTER_CONSULTATION: // 就诊后
|
||||
executeDateTime = LocalDateTime.of(patientVisitRecord.getVisitDate().plusDays(routeNodeDay).toLocalDate(), et);
|
||||
break;
|
||||
default:
|
||||
executeDateTime = LocalDateTime.of(patientVisitRecord.getVisitDate().plusDays(routeNodeDay).toLocalDate(), et);
|
||||
break;
|
||||
}
|
||||
return executeDateTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成子路径任务
|
||||
* @param patientId 患者主键
|
||||
@ -555,41 +598,6 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage
|
||||
List<SpecialDiseaseTriggerCondition> triggerConditionList = triggerConditionMapper.selectSpecialDiseaseTriggerConditionList(triggerConditionQuery);
|
||||
|
||||
}
|
||||
|
||||
private LocalDateTime getExecuteTime(SignPatientManageRouteNode node, PatientVisitRecord patientVisitRecord) {
|
||||
LocalDateTime executeTime = null;
|
||||
|
||||
LocalTime et = LocalTime.of(8,0,0);
|
||||
if (node.getExecuteTime() != null) {
|
||||
et = node.getExecuteTime();
|
||||
}
|
||||
switch(node.getRouteNodeName()) {
|
||||
case RouteNodeNameConstants.AFTER_DISCHARGE: // 出院后
|
||||
case RouteNodeNameConstants.AFTER_VISIT_DISCHARGE: // 就诊/出院后
|
||||
// 判断是门诊/住院
|
||||
if (StringUtils.equals(VisitMethodConstants.BE_IN_HOSPITAL, patientVisitRecord.getVisitMethod())) {
|
||||
executeTime = LocalDateTime.of(patientVisitRecord.getDischargeTime().plusDays(node.getRouteNodeDay()).toLocalDate(), et);
|
||||
} else {
|
||||
executeTime = LocalDateTime.of(patientVisitRecord.getVisitDate().plusDays(node.getRouteNodeDay()).toLocalDate(), et);
|
||||
}
|
||||
break;
|
||||
case RouteNodeNameConstants.AFTER_ADMISSION: // 入院后
|
||||
if (StringUtils.equals(VisitMethodConstants.BE_IN_HOSPITAL, patientVisitRecord.getVisitMethod())) {
|
||||
executeTime = LocalDateTime.of(patientVisitRecord.getAdmissionTime().plusDays(node.getRouteNodeDay()).toLocalDate(), et);
|
||||
} else {
|
||||
executeTime = LocalDateTime.of(patientVisitRecord.getVisitDate().plusDays(node.getRouteNodeDay()).toLocalDate(), et);
|
||||
}
|
||||
break;
|
||||
case RouteNodeNameConstants.AFTER_CONSULTATION: // 就诊后
|
||||
executeTime = LocalDateTime.of(patientVisitRecord.getVisitDate().plusDays(node.getRouteNodeDay()).toLocalDate(), et);
|
||||
break;
|
||||
default:
|
||||
executeTime = LocalDateTime.of(patientVisitRecord.getVisitDate().plusDays(node.getRouteNodeDay()).toLocalDate(), et);
|
||||
break;
|
||||
}
|
||||
return executeTime;
|
||||
}
|
||||
|
||||
private String replaceNodeContent(String nodeContent, List<PatientNodeParamsCurrent> paramsList) {
|
||||
Map<String, String> map = paramsList.stream().collect(Collectors.toMap(PatientNodeParamsCurrent::getParamKey,PatientNodeParamsCurrent::getParamValue,(key1,key2)->key2));
|
||||
Document document = Jsoup.parse(nodeContent);
|
||||
|
||||
@ -4,7 +4,6 @@ import com.xinelu.common.annotation.DataScope;
|
||||
import com.xinelu.common.constant.SignRecordServiceStatusConstants;
|
||||
import com.xinelu.common.constant.TaskCreateTypeConstant;
|
||||
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;
|
||||
@ -17,7 +16,6 @@ import com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRout
|
||||
import com.xinelu.manage.domain.signpatientpackage.SignPatientPackage;
|
||||
import com.xinelu.manage.domain.signpatientpackagehardware.SignPatientPackageHardware;
|
||||
import com.xinelu.manage.domain.signpatientrecord.SignPatientRecord;
|
||||
import com.xinelu.manage.domain.specialdiseasenode.SpecialDiseaseNode;
|
||||
import com.xinelu.manage.domain.specialdiseaseroute.SpecialDiseaseRoute;
|
||||
import com.xinelu.manage.dto.signpatientmanageroutenode.SignPatientManageRouteNodeDto;
|
||||
import com.xinelu.manage.dto.signpatientpackage.SignPatientPackageSaveDto;
|
||||
@ -174,81 +172,20 @@ public class SignPatientRecordServiceImpl implements ISignPatientRecordService {
|
||||
throw new ServiceException("请选择管理路径");
|
||||
}
|
||||
// 保存管理路径
|
||||
// 查询主路径及子路径列表
|
||||
SignPatientManageRoute signPatientManageRoute = body.getRoute();
|
||||
SpecialDiseaseRoute specialDiseaseRoute = specialDiseaseRouteMapper.selectSpecialDiseaseRouteById(signPatientManageRoute.getRouteId());
|
||||
BeanUtils.copyBeanProp(signPatientManageRoute, specialDiseaseRoute);
|
||||
signPatientManageRoute.setSignPatientRecordId(signPatientRecord.getId());
|
||||
signPatientManageRoute.setPatientId(patient.getId());
|
||||
signPatientManageRoute.setId(null);
|
||||
signPatientManageRoute.setRouteId(specialDiseaseRoute.getId());
|
||||
signPatientManageRoute.setTaskCreateType(TaskCreateTypeConstant.MANUAL_MATCHE);
|
||||
signPatientManageRoute.setCreateTime(LocalDateTime.now());
|
||||
signPatientManageRoute.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName());
|
||||
signPatientManageRouteMapper.insertSignPatientManageRoute(signPatientManageRoute);
|
||||
// 保存管理节点
|
||||
SpecialDiseaseNode specialDiseaseNode = new SpecialDiseaseNode();
|
||||
specialDiseaseNode.setRouteId(signPatientManageRoute.getRouteId());
|
||||
specialDiseaseNode.setRouteCheckStatus(RouteCheckStatusEnum.AGREE.getInfo());
|
||||
List<SpecialDiseaseNode> nodeList = specialDiseaseNodeMapper.selectSpecialDiseaseNodeList(specialDiseaseNode);
|
||||
if (CollectionUtils.isEmpty(nodeList)) {
|
||||
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);
|
||||
//}
|
||||
// 保存触发条件
|
||||
//SpecialDiseaseTriggerCondition triggerConditionQuery = new SpecialDiseaseTriggerCondition();
|
||||
//triggerConditionQuery.setRouteId(signPatientManageRoute.getRouteId());
|
||||
//List<SpecialDiseaseTriggerCondition> triggerConditions = triggerConditionMapper.selectSpecialDiseaseTriggerConditionList(triggerConditionQuery);
|
||||
//if (!CollectionUtils.isEmpty(triggerConditions)) {
|
||||
// List<SignRouteTriggerCondition> routeTriggerConditionList = triggerConditions.stream().map(item->{
|
||||
// SignRouteTriggerCondition signRouteTriggerCondition = new SignRouteTriggerCondition();
|
||||
// BeanUtils.copyBeanProp(signRouteTriggerCondition, item);
|
||||
// signRouteTriggerCondition.setPatientManageRouteId(signPatientManageRoute.getId());
|
||||
// signRouteTriggerCondition.setRouteName(signPatientManageRoute.getRouteName());
|
||||
// signRouteTriggerCondition.setId(null);
|
||||
// return signRouteTriggerCondition;
|
||||
// }).collect(Collectors.toList());
|
||||
// signRouteTriggerConditionMapper.insertBatch(routeTriggerConditionList);
|
||||
//}
|
||||
List<SpecialDiseaseRoute> specialDiseaseRouteList = specialDiseaseRouteMapper.selectRouteAndChildren(signPatientManageRoute.getRouteId());
|
||||
specialDiseaseRouteList.forEach(specialDiseaseRoute -> {
|
||||
BeanUtils.copyBeanProp(signPatientManageRoute, specialDiseaseRoute);
|
||||
signPatientManageRoute.setSignPatientRecordId(signPatientRecord.getId());
|
||||
signPatientManageRoute.setPatientId(patient.getId());
|
||||
signPatientManageRoute.setId(null);
|
||||
signPatientManageRoute.setRouteId(specialDiseaseRoute.getId());
|
||||
signPatientManageRoute.setTaskCreateType(TaskCreateTypeConstant.MANUAL_MATCHE);
|
||||
signPatientManageRoute.setCreateTime(LocalDateTime.now());
|
||||
signPatientManageRoute.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName());
|
||||
signPatientManageRouteMapper.insertSignPatientManageRoute(signPatientManageRoute);
|
||||
});
|
||||
|
||||
// 保存硬件
|
||||
if (!CollectionUtils.isEmpty(body.getDevices())) {
|
||||
|
||||
@ -3,6 +3,7 @@ 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.specialdiseasenode.RouteTaskAuditVo;
|
||||
import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteVO;
|
||||
import java.util.List;
|
||||
|
||||
@ -78,4 +79,11 @@ public interface ISpecialDiseaseNodeService {
|
||||
AjaxResult updateRouteCheckStatus(SpecialDiseaseNode specialDiseaseNode);
|
||||
|
||||
List<List<PatientNodeParamsCurrent>> getParams(Long id, Long patientId);
|
||||
|
||||
/**
|
||||
* 根据主路径id查询所有主路径节点及子路径节点
|
||||
* @param parentRouteId 主路径id
|
||||
* @return 主路径节点及子路径节点列表
|
||||
*/
|
||||
List<RouteTaskAuditVo> getByParentRouteId(Long parentRouteId);
|
||||
}
|
||||
|
||||
@ -19,6 +19,7 @@ import com.xinelu.manage.mapper.specialdiseasenode.SpecialDiseaseNodeMapper;
|
||||
import com.xinelu.manage.mapper.specialdiseaseroute.SpecialDiseaseRouteMapper;
|
||||
import com.xinelu.manage.service.patientinfo.IPatientAllInfoViewService;
|
||||
import com.xinelu.manage.service.specialdiseasenode.ISpecialDiseaseNodeService;
|
||||
import com.xinelu.manage.vo.specialdiseasenode.RouteTaskAuditVo;
|
||||
import com.xinelu.manage.vo.specialdiseasenode.SpecialDiseaseNodeVO;
|
||||
import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@ -280,7 +281,11 @@ public class SpecialDiseaseNodeServiceImpl implements ISpecialDiseaseNodeService
|
||||
return retList;
|
||||
}
|
||||
|
||||
/**
|
||||
@Override public List<RouteTaskAuditVo> getByParentRouteId(Long parentRouteId) {
|
||||
return specialDiseaseNodeMapper.getByParentRouteId(parentRouteId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据任务细分类型获取患者的真实信息
|
||||
*
|
||||
* @param patientId 患者主键
|
||||
|
||||
@ -3,6 +3,7 @@ package com.xinelu.manage.service.specialdiseaseroute;
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.manage.domain.specialdiseaseroute.SpecialDiseaseRoute;
|
||||
import com.xinelu.manage.dto.specialdiseaseroute.SpecialDiseaseRouteDTO;
|
||||
import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteAuditVo;
|
||||
import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteInfoVo;
|
||||
import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteVO;
|
||||
import java.util.List;
|
||||
@ -92,4 +93,11 @@ public interface ISpecialDiseaseRouteService {
|
||||
* @return List<String>
|
||||
*/
|
||||
List<String> jsoupParse(Long specialDiseaseNodeId);
|
||||
|
||||
/**
|
||||
* 路径审核->路径信息获取主路径及子路径信息及节点
|
||||
* @param routeId 主路径主键
|
||||
* @return 主路径信息及节点、子路径信息及节点
|
||||
*/
|
||||
SpecialDiseaseRouteAuditVo getRouteAuditInfo(Long routeId);
|
||||
}
|
||||
|
||||
@ -18,9 +18,15 @@ import com.xinelu.manage.mapper.specialdiseaseroutepackage.SpecialDiseaseRoutePa
|
||||
import com.xinelu.manage.mapper.specialdiseasetriggercondition.SpecialDiseaseTriggerConditionMapper;
|
||||
import com.xinelu.manage.service.specialdiseaseroute.ISpecialDiseaseRouteService;
|
||||
import com.xinelu.manage.vo.department.DepartmentVO;
|
||||
import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteAuditVo;
|
||||
import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteInfoVo;
|
||||
import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteVO;
|
||||
import com.xinelu.manage.vo.specialdiseaseroutepackage.SpecialDiseaseRoutePackageVO;
|
||||
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.apache.commons.lang3.StringUtils;
|
||||
import org.jsoup.Jsoup;
|
||||
@ -30,12 +36,6 @@ 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;
|
||||
|
||||
/**
|
||||
* 专病路径信息Service业务层处理
|
||||
*
|
||||
@ -239,7 +239,7 @@ public class SpecialDiseaseRouteServiceImpl implements ISpecialDiseaseRouteServi
|
||||
List<SpecialDiseaseRouteInfoVo> childRouteList = specialDiseaseRouteMapper.getChildList(specialDiseaseRoute.getId());
|
||||
List<String> finalCheckStatus = checkStatusList;
|
||||
childRouteList.forEach(childRoute -> {
|
||||
List<String> checkStatus1 = specialDiseaseRouteMapper.selectRouteCheckStatus(childRoute.getId());
|
||||
List<String> checkStatus1 = specialDiseaseRouteMapper.selectRouteCheckStatus(childRoute.getSpecialDiseaseRouteId());
|
||||
if (CollectionUtils.isEmpty(checkStatus1)) {
|
||||
throw new ServiceException("存在无节点的子路径,请先增加节点并审核通过后发布!");
|
||||
}
|
||||
@ -261,6 +261,15 @@ public class SpecialDiseaseRouteServiceImpl implements ISpecialDiseaseRouteServi
|
||||
return specialDiseaseRouteMapper.updateSpecialDiseaseRoute(specialDiseaseRoute);
|
||||
}
|
||||
|
||||
/**
|
||||
* 路径审核->路径信息获取主路径及子路径信息及节点
|
||||
* @param routeId 主路径主键
|
||||
* @return 主路径信息及节点、子路径信息及节点
|
||||
*/
|
||||
@Override
|
||||
public SpecialDiseaseRouteAuditVo getRouteAuditInfo(Long routeId) {
|
||||
return specialDiseaseRouteMapper.getRouteAuditInfo(routeId);
|
||||
}
|
||||
/**
|
||||
* 富文本解析
|
||||
*
|
||||
|
||||
@ -1,6 +1,9 @@
|
||||
package com.xinelu.manage.service.specialdiseasetriggercondition.impl;
|
||||
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.xinelu.common.constant.CacheConstants;
|
||||
import com.xinelu.common.constant.Constants;
|
||||
import com.xinelu.common.core.domain.entity.SysDictData;
|
||||
import com.xinelu.common.core.redis.RedisCache;
|
||||
import com.xinelu.common.enums.ReleaseStatusEnum;
|
||||
import com.xinelu.common.exception.ServiceException;
|
||||
@ -9,6 +12,7 @@ import com.xinelu.common.utils.SecurityUtils;
|
||||
import com.xinelu.common.utils.StringUtils;
|
||||
import com.xinelu.common.utils.bean.BeanUtils;
|
||||
import com.xinelu.common.utils.codes.GenerateSystemCodeUtil;
|
||||
import com.xinelu.common.utils.spring.SpringUtils;
|
||||
import com.xinelu.manage.domain.specialdiseaseroute.SpecialDiseaseRoute;
|
||||
import com.xinelu.manage.domain.specialdiseasetriggercondition.SpecialDiseaseTriggerCondition;
|
||||
import com.xinelu.manage.dto.specialdiseasetriggercondition.TriggerConditionDto;
|
||||
@ -40,8 +44,6 @@ public class SpecialDiseaseTriggerConditionServiceImpl implements ISpecialDiseas
|
||||
private SpecialDiseaseRouteMapper specialDiseaseRouteMapper;
|
||||
@Resource
|
||||
private GenerateSystemCodeUtil generateSystemCodeUtil;
|
||||
@Resource
|
||||
private RedisCache redisCache;
|
||||
|
||||
/**
|
||||
* 查询触发条件关系
|
||||
@ -75,7 +77,7 @@ public class SpecialDiseaseTriggerConditionServiceImpl implements ISpecialDiseas
|
||||
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())) {
|
||||
if (Objects.nonNull(specialDiseaseRoute) && StringUtils.isNotBlank(specialDiseaseRoute.getReleaseStatus()) && !StringUtils.equals(ReleaseStatusEnum.UNPUBLISHED.getInfo(), specialDiseaseRoute.getReleaseStatus())) {
|
||||
throw new ServiceException("已发布过的专病路径不能修改!");
|
||||
}
|
||||
|
||||
@ -88,6 +90,11 @@ public class SpecialDiseaseTriggerConditionServiceImpl implements ISpecialDiseas
|
||||
if (StringUtils.isBlank(triggerConditionSaveDTO.getSuitRange())) {
|
||||
throw new ServiceException("请选择适用范围");
|
||||
}
|
||||
triggerConditionSaveDTO.getTriggerConditionList().forEach(item -> {
|
||||
if (StringUtils.isBlank(item.getTriggerConditionName()) || StringUtils.isBlank(item.getTriggerConditionOperator()) || StringUtils.isBlank(item.getTriggerConditionValue())) {
|
||||
throw new ServiceException("请选择完整的触发条件");
|
||||
}
|
||||
});
|
||||
// 保存子路径
|
||||
specialDiseaseRoute.setCreateTime(LocalDateTime.now());
|
||||
specialDiseaseRoute.setCreateBy(SecurityUtils.getUsername());
|
||||
@ -146,6 +153,11 @@ public class SpecialDiseaseTriggerConditionServiceImpl implements ISpecialDiseas
|
||||
if (StringUtils.isBlank(triggerConditionUpdateDto.getSuitRange())) {
|
||||
throw new ServiceException("请选择适用范围");
|
||||
}
|
||||
triggerConditionUpdateDto.getTriggerConditionList().forEach(item -> {
|
||||
if (StringUtils.isBlank(item.getTriggerConditionName()) || StringUtils.isBlank(item.getTriggerConditionOperator()) || StringUtils.isBlank(item.getTriggerConditionValue())) {
|
||||
throw new ServiceException("请选择完整的触发条件");
|
||||
}
|
||||
});
|
||||
// 修改子路径路径名称
|
||||
SpecialDiseaseRoute specialDiseaseRoute = new SpecialDiseaseRoute();
|
||||
specialDiseaseRoute.setId(triggerConditionUpdateDto.getRouteId());
|
||||
@ -206,14 +218,32 @@ public class SpecialDiseaseTriggerConditionServiceImpl implements ISpecialDiseas
|
||||
StringBuilder routeName = new StringBuilder();
|
||||
for (int i = 0; i < triggerConditionList.size(); i++) {
|
||||
TriggerConditionDto item = triggerConditionList.get(i);
|
||||
JSONArray arrayCache = SpringUtils.getBean(RedisCache.class).getCacheObject(CacheConstants.SYS_DICT_KEY + "trigger_condition_name");
|
||||
List<SysDictData> dictData = new ArrayList<>();
|
||||
if (StringUtils.isNotNull(arrayCache)) {
|
||||
dictData = arrayCache.toList(SysDictData.class);
|
||||
}
|
||||
SysDictData triggerCondition = new SysDictData();
|
||||
if (StringUtils.isNotEmpty(dictData)) {
|
||||
for (SysDictData dict : dictData) {
|
||||
if (item.getTriggerConditionCode().equals(dict.getDictValue())) {
|
||||
BeanUtils.copyBeanProp(triggerCondition, dict);
|
||||
}
|
||||
}
|
||||
}
|
||||
String triggerConditionValue = item.getTriggerConditionValue();
|
||||
if (StringUtils.equals("SELECT", triggerCondition.getDictDataType())) {
|
||||
triggerConditionValue = DictUtils.getDictLabel(triggerCondition.getDictValue(), item.getTriggerConditionValue());
|
||||
}
|
||||
if (i == 0) {
|
||||
routeName.append(DictUtils.getDictLabel("trigger_condition_name", item.getTriggerConditionCode()) + DictUtils.getDictLabel("trigger_condition_operator", item.getTriggerConditionOperator()) + item.getTriggerConditionValue());
|
||||
routeName.append(triggerCondition.getDictLabel() + DictUtils.getDictLabel("trigger_condition_operator", item.getTriggerConditionOperator()))
|
||||
.append(triggerConditionValue);
|
||||
}
|
||||
if (i == 1) {
|
||||
routeName.append("|"+ DictUtils.getDictLabel("trigger_condition_name", item.getTriggerConditionCode()) + DictUtils.getDictLabel("trigger_condition_operator", item.getTriggerConditionOperator()) + item.getTriggerConditionValue());
|
||||
routeName.append("|"+ triggerCondition.getDictLabel() + DictUtils.getDictLabel("trigger_condition_operator", item.getTriggerConditionOperator()) + triggerConditionValue);
|
||||
}
|
||||
if (i == 2) {
|
||||
routeName.append("(" + DictUtils.getDictLabel("trigger_logic", item.getTriggerLogic()) + ")" + DictUtils.getDictLabel("trigger_condition_name", item.getTriggerConditionCode()) + DictUtils.getDictLabel("trigger_condition_operator", item.getTriggerConditionOperator()) + item.getTriggerConditionValue());
|
||||
routeName.append("(" + triggerCondition.getDictLabel() + ")" + DictUtils.getDictLabel("trigger_condition_name", item.getTriggerConditionCode()) + DictUtils.getDictLabel("trigger_condition_operator", item.getTriggerConditionOperator()) + triggerConditionValue);
|
||||
}
|
||||
}
|
||||
return routeName.toString();
|
||||
|
||||
@ -0,0 +1,38 @@
|
||||
package com.xinelu.manage.vo.labelfieldcontent;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @description: 画像信息视图
|
||||
* @author: haown
|
||||
* @create: 2024-06-25 14:57
|
||||
**/
|
||||
@Data
|
||||
public class LabelFieldInfoContentVo {
|
||||
|
||||
/**
|
||||
* 字段编码
|
||||
*/
|
||||
@ApiModelProperty(value = "字段编码")
|
||||
private String fieldCode;
|
||||
|
||||
/**
|
||||
* 任务细分id,当做分组使用
|
||||
*/
|
||||
@ApiModelProperty(value = "任务细分id,当做分组使用")
|
||||
private Long taskPartitionDictId;
|
||||
|
||||
/**
|
||||
* 字段值,同param_value
|
||||
*/
|
||||
@ApiModelProperty(value = "字段值,同param_value")
|
||||
private String fieldValue;
|
||||
|
||||
/**
|
||||
* 画像流水号,用年月日时分秒毫秒数字转成的字符串
|
||||
*/
|
||||
@ApiModelProperty(value = "画像流水号,用年月日时分秒毫秒数字转成的字符串")
|
||||
private String portraitSn;
|
||||
|
||||
}
|
||||
@ -0,0 +1,46 @@
|
||||
package com.xinelu.manage.vo.signpatientmanageroutenode;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRouteNode;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @description: 路径审核->节点详细信息返回视图类
|
||||
* @author: haown
|
||||
* @create: 2024-06-24 14:07
|
||||
**/
|
||||
@Data
|
||||
public class SignPatientManageNodeAuditVo extends SignPatientManageRouteNode {
|
||||
|
||||
/**
|
||||
* 任务类型名称
|
||||
*/
|
||||
@ApiModelProperty(value = "任务类型名称")
|
||||
private String taskTypeName;
|
||||
|
||||
/**
|
||||
* 任务细分名称
|
||||
*/
|
||||
@ApiModelProperty(value = "任务细分名称")
|
||||
private String taskPartitionDictName;
|
||||
|
||||
/**
|
||||
* 节点选择模板类型
|
||||
*/
|
||||
@ApiModelProperty(value = "节点选择模板类型")
|
||||
private String templateType;
|
||||
|
||||
/**
|
||||
* 模板详情
|
||||
*/
|
||||
@ApiModelProperty(value = "模板详情")
|
||||
private JSONObject templateDetail;
|
||||
|
||||
/**
|
||||
* 推送方式
|
||||
*/
|
||||
@ApiModelProperty(value = "推送方式")
|
||||
private String pushMethod;
|
||||
|
||||
}
|
||||
@ -180,21 +180,6 @@ public class SignPatientManageRouteNodeInfoVo {
|
||||
@Excel(name = "小程序节点内容", readConverterExp = "富=文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记")
|
||||
private String appletNodeContent;
|
||||
|
||||
/** 人工随访模板表id */
|
||||
@ApiModelProperty(value = "人工随访模板表id")
|
||||
@Excel(name = "人工随访模板表id")
|
||||
private Long followTemplateId;
|
||||
|
||||
/** 人工随访模板名称 */
|
||||
@ApiModelProperty(value = "人工随访模板名称")
|
||||
@Excel(name = "人工随访模板名称")
|
||||
private String followTemplateName;
|
||||
|
||||
/** 人工随访模板内容(富文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记) */
|
||||
@ApiModelProperty(value = "人工随访模板内容")
|
||||
@Excel(name = "人工随访模板内容", readConverterExp = "富=文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记")
|
||||
private String followContent;
|
||||
|
||||
/** 文字提醒内容 */
|
||||
@ApiModelProperty(value = "文字提醒内容")
|
||||
@Excel(name = "文字提醒内容")
|
||||
|
||||
@ -21,7 +21,7 @@ public class SignPatientListVo {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@ApiModelProperty(value = "主键id")
|
||||
@ApiModelProperty(value = "签约记录主键id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
|
||||
@ -0,0 +1,31 @@
|
||||
package com.xinelu.manage.vo.specialdiseasenode;
|
||||
|
||||
import com.xinelu.manage.domain.specialdiseasenode.SpecialDiseaseNode;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @description: 路径任务审核查询专病路径节点返回视图类
|
||||
* @author: haown
|
||||
* @create: 2024-06-25 09:28
|
||||
**/
|
||||
@Data
|
||||
public class RouteTaskAuditVo extends SpecialDiseaseNode {
|
||||
|
||||
/**
|
||||
* 任务类型名称
|
||||
*/
|
||||
@ApiModelProperty(value = "任务类型名称")
|
||||
private String taskTypeName;
|
||||
|
||||
/**
|
||||
* 任务细分主键
|
||||
*/
|
||||
private Long taskPartitionDictId;
|
||||
/**
|
||||
* 任务细分名称
|
||||
*/
|
||||
@ApiModelProperty(value = "任务细分名称")
|
||||
private String taskPartitionDictName;
|
||||
|
||||
}
|
||||
@ -0,0 +1,53 @@
|
||||
package com.xinelu.manage.vo.specialdiseasenode;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @description: 路径审核->路径信息,节点对象
|
||||
* @author: haown
|
||||
* @create: 2024-06-21 16:27
|
||||
**/
|
||||
@Data
|
||||
public class SpecialDiseaseNodeAuditVo {
|
||||
/**
|
||||
* 节点名称,出院后:AFTER_DISCHARGE,入院后:AFTER_ADMISSION,就诊后:AFTER_CONSULTATION,就诊/出院后:AFTER_VISIT_DISCHARGE,术前:PREOPERATIVE,术后:POSTOPERATIVE
|
||||
*/
|
||||
@ApiModelProperty(value = "节点名称,出院后:AFTER_DISCHARGE,入院后:AFTER_ADMISSION,就诊后:AFTER_CONSULTATION,就诊/出院后:AFTER_VISIT_DISCHARGE,术前:PREOPERATIVE,术后:POSTOPERATIVE")
|
||||
private String routeNodeName;
|
||||
|
||||
/**
|
||||
* 节点天数,单位:天
|
||||
*/
|
||||
@ApiModelProperty(value = "节点天数,单位:天")
|
||||
private Integer routeNodeDay;
|
||||
|
||||
/**
|
||||
* 执行时间,格式:HH:mm
|
||||
*/
|
||||
@ApiModelProperty(value = "执行时间,格式:HH:mm")
|
||||
@JsonFormat(pattern = "HH:mm")
|
||||
private LocalTime executionTime;
|
||||
|
||||
/**
|
||||
* 执行时间
|
||||
*/
|
||||
@ApiModelProperty(value = "执行时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDateTime executeTime;
|
||||
|
||||
/**
|
||||
* 任务细分编码列表
|
||||
*/
|
||||
@ApiModelProperty(value = "任务细分编码,多个名称用逗号分割")
|
||||
private String taskPartitionCodes;
|
||||
|
||||
/**
|
||||
* 任务细分列表
|
||||
*/
|
||||
@ApiModelProperty(value = "任务细分名称,多个名称用逗号分割")
|
||||
private String taskPartitionDictNames;
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
package com.xinelu.manage.vo.specialdiseaseroute;
|
||||
|
||||
import com.xinelu.manage.vo.specialdiseasenode.SpecialDiseaseNodeAuditVo;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.List;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @description: 路径审核->子路径路径信息返回视图类
|
||||
* @author: haown
|
||||
* @create: 2024-06-21 15:48
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SpecialDiseaseChildRouteAuditVo {
|
||||
|
||||
@ApiModelProperty(value = "路径id")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "路径名称")
|
||||
private String routeName;
|
||||
|
||||
/**
|
||||
* 病种id
|
||||
*/
|
||||
@ApiModelProperty(value = "病种id")
|
||||
private Long diseaseTypeId;
|
||||
|
||||
/**
|
||||
* 病种名称
|
||||
*/
|
||||
@ApiModelProperty(value = "病种名称")
|
||||
private String diseaseTypeName;
|
||||
|
||||
/**
|
||||
* 节点列表
|
||||
*/
|
||||
private List<SpecialDiseaseNodeAuditVo> nodeList;
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
package com.xinelu.manage.vo.specialdiseaseroute;
|
||||
|
||||
import com.xinelu.manage.vo.specialdiseasenode.SpecialDiseaseNodeAuditVo;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @description: 路径审核->子路径路径信息返回视图类
|
||||
* @author: haown
|
||||
* @create: 2024-06-21 16:43
|
||||
**/
|
||||
@Data
|
||||
public class SpecialDiseaseRouteAuditVo {
|
||||
|
||||
@ApiModelProperty(value = "路径id")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "路径名称")
|
||||
private String routeName;
|
||||
|
||||
/**
|
||||
* 病种id
|
||||
*/
|
||||
@ApiModelProperty(value = "病种id")
|
||||
private Long diseaseTypeId;
|
||||
|
||||
/**
|
||||
* 病种名称
|
||||
*/
|
||||
@ApiModelProperty(value = "病种名称")
|
||||
private String diseaseTypeName;
|
||||
|
||||
/**
|
||||
* 主路径节点列表
|
||||
*/
|
||||
private List<SpecialDiseaseNodeAuditVo> nodeList;
|
||||
|
||||
@ApiModelProperty(value = "子路径信息及节点列表")
|
||||
private List<SpecialDiseaseChildRouteAuditVo> childRouteList;
|
||||
}
|
||||
@ -231,4 +231,14 @@
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectByPatientId" resultType="com.xinelu.manage.vo.labelfieldcontent.LabelFieldInfoContentVo">
|
||||
select
|
||||
content.field_code,
|
||||
info.task_partition_dict_id,
|
||||
content.field_value,
|
||||
content.portrait_sn
|
||||
from label_field_content content left join label_field_info info on content.field_id = info.id
|
||||
where content.patient_id = #{patientId} and content.portrait_status='INUSE'
|
||||
</select>
|
||||
</mapper>
|
||||
@ -101,9 +101,6 @@
|
||||
<result property="appletRemindContent" column="applet_remind_content"/>
|
||||
<result property="appletPromptDescription" column="applet_prompt_description"/>
|
||||
<result property="appletNodeContent" column="applet_node_content"/>
|
||||
<result property="followTemplateId" column="follow_template_id"/>
|
||||
<result property="followTemplateName" column="follow_template_name"/>
|
||||
<result property="followContent" column="follow_content"/>
|
||||
<result property="routeCheckStatus" column="route_check_status"/>
|
||||
<result property="routeCheckPerson" column="route_check_person"/>
|
||||
<result property="routeCheckDate" column="route_check_date"/>
|
||||
|
||||
@ -26,6 +26,7 @@
|
||||
<result property="phoneMessageRemind" column="phone_message_remind"/>
|
||||
<result property="phoneMessageTemplateId" column="phone_message_template_id"/>
|
||||
<result property="phoneMessageTemplateName" column="phone_message_template_name"/>
|
||||
<result property="phoneMessageTemplateContent" column="phone_message_template_content"/>
|
||||
<result property="questionInfoId" column="question_info_id"/>
|
||||
<result property="questionnaireName" column="questionnaire_name"/>
|
||||
<result property="questionnaireContent" column="questionnaire_content"/>
|
||||
@ -49,9 +50,6 @@
|
||||
<result property="appletRemindContent" column="applet_remind_content"/>
|
||||
<result property="appletPromptDescription" column="applet_prompt_description"/>
|
||||
<result property="appletNodeContent" column="applet_node_content"/>
|
||||
<result property="followTemplateId" column="follow_template_id"/>
|
||||
<result property="followTemplateName" column="follow_template_name"/>
|
||||
<result property="followContent" column="follow_content"/>
|
||||
<result property="routeCheckStatus" column="route_check_status"/>
|
||||
<result property="routeCheckPerson" column="route_check_person"/>
|
||||
<result property="routeCheckDate" column="route_check_date"/>
|
||||
@ -73,7 +71,7 @@
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSignPatientManageRouteNodeVo">
|
||||
select id, manage_route_id, manage_route_name, route_node_id, route_node_name, route_node_day, task_type, task_status, task_subdivision, second_classify_describe, execute_time, phone_push_sign, phone_id, phone_template_id, phone_template_name, phone_node_content, phone_redial_times, phone_time_interval, phone_message_remind, phone_message_template_id, phone_message_template_name, question_info_id, questionnaire_name, questionnaire_content, question_expiration_date, propaganda_info_id, propaganda_title, propaganda_content, message_push_sign, message_template_id, message_template_name, message_preview, message_node_content, official_push_sign, official_template_id, official_template_name, official_remind_content, official_node_content, applet_push_sign, applet_template_id, applet_template_name, applet_remind_content, applet_prompt_description, applet_node_content, follow_template_id, follow_template_name, follow_content, route_check_status, route_check_person, route_check_date, route_check_remark, route_node_remark, node_execute_status, route_handle_remark, route_handle_id, route_handle_person, route_link,text_remind_content, node_content,message_status, del_flag, create_by, create_time, update_by, update_time from sign_patient_manage_route_node
|
||||
select id, manage_route_id, manage_route_name, route_node_id, route_node_name, route_node_day, task_type, task_status, task_subdivision, second_classify_describe, execute_time, phone_push_sign, phone_id, phone_template_id, phone_template_name, phone_node_content, phone_redial_times, phone_time_interval, phone_message_remind, phone_message_template_id, phone_message_template_name,phone_message_template_content,question_info_id, questionnaire_name, questionnaire_content, question_expiration_date, propaganda_info_id, propaganda_title, propaganda_content, message_push_sign, message_template_id, message_template_name, message_preview, message_node_content, official_push_sign, official_template_id, official_template_name, official_remind_content, official_node_content, applet_push_sign, applet_template_id, applet_template_name, applet_remind_content, applet_prompt_description, applet_node_content, route_check_status, route_check_person, route_check_date, route_check_remark, route_node_remark, node_execute_status, route_handle_remark, route_handle_id, route_handle_person, route_link,text_remind_content, node_content,message_status, del_flag, create_by, create_time, update_by, update_time from sign_patient_manage_route_node
|
||||
</sql>
|
||||
|
||||
<select id="selectSignPatientManageRouteNodeList" parameterType="com.xinelu.manage.dto.signpatientmanageroutenode.SignPatientManageRouteNodeDto" resultMap="SignPatientManageRouteNodeResult">
|
||||
@ -145,13 +143,12 @@
|
||||
select node.id, node.manage_route_id, node.manage_route_name, node.route_node_id, node.route_node_name, node.route_node_day, node.task_type,
|
||||
node.task_status, node.task_subdivision,node.second_classify_describe, node.execute_time, node.phone_push_sign, node.phone_id,
|
||||
node.phone_template_id, node.phone_template_name, node.phone_node_content, node.phone_redial_times, node.phone_time_interval,
|
||||
node.phone_message_remind, node.phone_message_template_id, node.phone_message_template_name,
|
||||
node.phone_message_remind, node.phone_message_template_id, node.phone_message_template_name,node.phone_message_template_content,
|
||||
node.question_info_id, node.questionnaire_name, node.questionnaire_content, node.question_expiration_date,
|
||||
node.propaganda_info_id, node.propaganda_title, node.propaganda_content,
|
||||
node.message_push_sign, node.message_template_id, node.message_template_name,node.message_preview, node.message_node_content,
|
||||
node.official_push_sign, node.official_template_id, node.official_template_name, node.official_remind_content, node.official_node_content,
|
||||
node.applet_push_sign, node.applet_template_id, node.applet_template_name, node.applet_remind_content, node.applet_prompt_description, node.applet_node_content,
|
||||
node.follow_template_id, node.follow_template_name, node.follow_content,
|
||||
node.route_check_status, node.route_check_person, node.route_check_date, node.route_check_remark, node.route_node_remark,
|
||||
node.node_execute_status, node.route_handle_remark, node.route_handle_id, node.route_handle_person, node.route_link,node.text_remind_content,node.node_content
|
||||
from sign_patient_manage_route_node node
|
||||
@ -235,6 +232,8 @@
|
||||
</if>
|
||||
<if test="phoneMessageTemplateName != null">phone_message_template_name,
|
||||
</if>
|
||||
<if test="phoneMessageTemplateContent != null">phone_message_template_content,
|
||||
</if>
|
||||
<if test="questionInfoId != null">question_info_id,
|
||||
</if>
|
||||
<if test="questionnaireName != null">questionnaire_name,
|
||||
@ -281,12 +280,6 @@
|
||||
</if>
|
||||
<if test="appletNodeContent != null">applet_node_content,
|
||||
</if>
|
||||
<if test="followTemplateId != null">follow_template_id,
|
||||
</if>
|
||||
<if test="followTemplateName != null">follow_template_name,
|
||||
</if>
|
||||
<if test="followContent != null">follow_content,
|
||||
</if>
|
||||
<if test="routeCheckStatus != null">route_check_status,
|
||||
</if>
|
||||
<if test="routeCheckPerson != null">route_check_person,
|
||||
@ -365,6 +358,8 @@
|
||||
</if>
|
||||
<if test="phoneMessageTemplateName != null">#{phoneMessageTemplateName},
|
||||
</if>
|
||||
<if test="phoneMessageTemplateContent != null">#{phoneMessageTemplateContent},
|
||||
</if>
|
||||
<if test="questionInfoId != null">#{questionInfoId},
|
||||
</if>
|
||||
<if test="questionnaireName != null">#{questionnaireName},
|
||||
@ -411,12 +406,6 @@
|
||||
</if>
|
||||
<if test="appletNodeContent != null">#{appletNodeContent},
|
||||
</if>
|
||||
<if test="followTemplateId != null">#{followTemplateId},
|
||||
</if>
|
||||
<if test="followTemplateName != null">#{followTemplateName},
|
||||
</if>
|
||||
<if test="followContent != null">#{followContent},
|
||||
</if>
|
||||
<if test="routeCheckStatus != null">#{routeCheckStatus},
|
||||
</if>
|
||||
<if test="routeCheckPerson != null">#{routeCheckPerson},
|
||||
@ -460,8 +449,8 @@
|
||||
execute_time, phone_push_sign, phone_id, phone_template_id, phone_template_name, phone_node_content, phone_redial_times, phone_time_interval, phone_message_remind, phone_message_template_id,
|
||||
phone_message_template_name, question_info_id, questionnaire_name, questionnaire_content, question_expiration_date, propaganda_info_id, propaganda_title, propaganda_content, message_push_sign,
|
||||
message_template_id, message_template_name, message_preview, message_node_content, official_push_sign, official_template_id, official_template_name, official_remind_content,
|
||||
official_node_content, applet_push_sign, applet_template_id, applet_template_name, applet_remind_content, applet_prompt_description, applet_node_content, follow_template_id,
|
||||
follow_template_name, follow_content, route_check_status, route_check_person, route_check_date, route_check_remark, route_node_remark, node_execute_status, route_handle_remark,phone_connect_status,
|
||||
official_node_content, applet_push_sign, applet_template_id, applet_template_name, applet_remind_content, applet_prompt_description, applet_node_content,
|
||||
route_check_status, route_check_person, route_check_date, route_check_remark, route_node_remark, node_execute_status, route_handle_remark,phone_connect_status,
|
||||
route_handle_id, route_handle_person, route_link, text_remind_content,node_content, del_flag, create_by, create_time, update_by, update_time)
|
||||
values
|
||||
<foreach collection="nodeList" item="item" separator=",">
|
||||
@ -469,8 +458,8 @@
|
||||
#{item.executeTime},#{item.phonePushSign},#{item.phoneId},#{item.phoneTemplateId},#{item.phoneTemplateName},#{item.phoneNodeContent},#{item.phoneRedialTimes},#{item.phoneTimeInterval},#{item.phoneMessageRemind},#{item.phoneMessageTemplateId},#{item.phoneMessageTemplateName},
|
||||
#{item.questionInfoId},#{item.questionnaireName},#{item.questionnaireContent},#{item.questionExpirationDate},#{item.propagandaInfoId},#{item.propagandaTitle},#{item.propagandaContent},#{item.messagePushSign},#{item.messageTemplateId},
|
||||
#{item.messageTemplateName},#{item.messagePreview},#{item.messageNodeContent},#{item.officialPushSign},#{item.officialTemplateId},#{item.officialTemplateName},#{item.officialRemindContent},#{item.officialNodeContent},
|
||||
#{item.appletPushSign},#{item.appletTemplateId},#{item.appletTemplateName},#{item.appletRemindContent},#{item.appletPromptDescription},#{item.appletNodeContent},#{item.followTemplateId},
|
||||
#{item.followTemplateName},#{item.followContent},#{item.routeCheckStatus},#{item.routeCheckPerson},#{item.routeCheckDate},#{item.routeCheckRemark},#{item.routeNodeRemark},#{item.nodeExecuteStatus},#{item.routeHandleRemark},#{item.phoneConnectStatus},
|
||||
#{item.appletPushSign},#{item.appletTemplateId},#{item.appletTemplateName},#{item.appletRemindContent},#{item.appletPromptDescription},#{item.appletNodeContent},
|
||||
#{item.routeCheckStatus},#{item.routeCheckPerson},#{item.routeCheckDate},#{item.routeCheckRemark},#{item.routeNodeRemark},#{item.nodeExecuteStatus},#{item.routeHandleRemark},#{item.phoneConnectStatus},
|
||||
#{item.routeHandleId},#{item.routeHandlePerson},#{item.routeLink},#{item.textRemindContent},#{item.nodeContent},0,#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime})
|
||||
</foreach>
|
||||
</insert>
|
||||
@ -537,6 +526,9 @@
|
||||
<if test="phoneMessageTemplateName != null">phone_message_template_name =
|
||||
#{phoneMessageTemplateName},
|
||||
</if>
|
||||
<if test="phoneMessageTemplateContent != null">phone_message_template_content =
|
||||
#{phoneMessageTemplateContent},
|
||||
</if>
|
||||
<if test="questionInfoId != null">question_info_id =
|
||||
#{questionInfoId},
|
||||
</if>
|
||||
@ -606,15 +598,6 @@
|
||||
<if test="appletNodeContent != null">applet_node_content =
|
||||
#{appletNodeContent},
|
||||
</if>
|
||||
<if test="followTemplateId != null">follow_template_id =
|
||||
#{followTemplateId},
|
||||
</if>
|
||||
<if test="followTemplateName != null">follow_template_name =
|
||||
#{followTemplateName},
|
||||
</if>
|
||||
<if test="followContent != null">follow_content =
|
||||
#{followContent},
|
||||
</if>
|
||||
<if test="routeCheckStatus != null">route_check_status =
|
||||
#{routeCheckStatus},
|
||||
</if>
|
||||
@ -782,4 +765,30 @@
|
||||
set message_status = #{messageStatus}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<select id="selectByRouteId" resultType="com.xinelu.manage.vo.specialdiseasenode.SpecialDiseaseNodeAuditVo">
|
||||
select
|
||||
sdn.route_node_name routeNodeName,
|
||||
sdn.route_node_day routeNodeDay,
|
||||
sdn.execute_time executionTime,
|
||||
GROUP_CONCAT(sdn.task_type SEPARATOR ',') as taskPartitionCodes,
|
||||
GROUP_CONCAT(dic.dict_label SEPARATOR ',') as taskPartitionDictNames
|
||||
from sign_patient_manage_route_node sdn
|
||||
left join sys_dict_data dic on sdn.task_type = dic.dict_value
|
||||
where sdn.manage_route_id = #{manageRouteId} and dic.dict_type ='task_content'
|
||||
group by sdn.route_node_name, sdn.route_node_day
|
||||
</select>
|
||||
|
||||
<select id="selectAuditNodeInfo" resultType="com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageNodeAuditVo">
|
||||
select
|
||||
sdn.*,
|
||||
dic.dict_label as taskTypeName
|
||||
from sign_patient_manage_route_node node
|
||||
left join sys_dict_data dic on sdn.task_type = dic.dict_value
|
||||
where sdn.manage_route_id in
|
||||
<foreach item="manageRouteId" collection="array" open="(" separator="," close=")">
|
||||
#{manageRouteId}
|
||||
</foreach>
|
||||
and dic.dict_type ='task_content'
|
||||
</select>
|
||||
</mapper>
|
||||
@ -435,6 +435,18 @@
|
||||
and sign.route_check_status = #{routeCheckStatus}
|
||||
</when>
|
||||
</choose>
|
||||
<if test="mainDiagnosis != null and mainDiagnosis != ''">
|
||||
and patient.main_diagnosis like concat('%', #{mainDiagnosis}, '%')
|
||||
</if>
|
||||
<if test="dischargeTimeStart != null ">
|
||||
and date_format(patient.discharge_time,'%y%m%d') >= date_format(#{dischargeTimeStart},'%y%m%d')
|
||||
</if>
|
||||
<if test="dischargeTimeEnd != null ">
|
||||
and date_format(patient.discharge_time,'%y%m%d') <= date_format(#{dischargeTimeEnd},'%y%m%d')
|
||||
</if>
|
||||
<if test="patientSource != null ">
|
||||
and patient.patient_source like concat('%', #{patientSource}, '%')
|
||||
</if>
|
||||
<if test="serviceEndTimeStart != null">
|
||||
and date_format(p.service_end_time, '%y%m%d') >= date_format(#{serviceEndTimeStart}, '%y%m%d')
|
||||
</if>
|
||||
|
||||
@ -878,9 +878,37 @@
|
||||
and sdn.route_check_status = 'AGREE'
|
||||
</select>
|
||||
|
||||
<select id="selectByRouteId" resultType="com.xinelu.manage.vo.specialdiseasenode.SpecialDiseaseNodeAuditVo">
|
||||
select
|
||||
sdn.route_node_name routeNodeName,
|
||||
sdn.route_node_day routeNodeDay,
|
||||
sdn.execution_time executionTime,
|
||||
GROUP_CONCAT(sdn.task_subdivision SEPARATOR ',') as taskPartitionCodes,
|
||||
GROUP_CONCAT(tpd.task_partition_name SEPARATOR ',') as taskPartitionDictNames
|
||||
from special_disease_node sdn
|
||||
left join task_partition_dict tpd on tpd.task_partition_code = sdn.task_subdivision
|
||||
where sdn.route_id = #{routeId}
|
||||
group by sdn.route_node_name, sdn.route_node_day
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectSpecialDiseaseRouteIds" resultType="java.lang.Long">
|
||||
select id
|
||||
from special_disease_node
|
||||
where route_id = #{routeId}
|
||||
</select>
|
||||
|
||||
<select id="getByParentRouteId" resultType="com.xinelu.manage.vo.specialdiseasenode.RouteTaskAuditVo">
|
||||
select
|
||||
sdn.*,
|
||||
ttd.task_type_name taskTypeName,
|
||||
tpd.id taskPartitionDictId,
|
||||
tpd.task_partition_name taskPartitionDictName
|
||||
from special_disease_node sdn
|
||||
left join special_disease_route sdr ON sdn.route_id = sdr.id
|
||||
left join task_type_dict ttd ON ttd.task_type_code = sdn.task_type
|
||||
left join task_partition_dict tpd on tpd.task_partition_code = sdn.task_subdivision
|
||||
where sdr.id = #{parentRouteId} or sdr.parent_route_id = #{parentRouteId}
|
||||
and sdn.route_check_status = 'AGREE'
|
||||
</select>
|
||||
</mapper>
|
||||
@ -71,6 +71,37 @@
|
||||
resultMap="SpecialDiseaseRoutePackageResult"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteAuditVo" id="SpecialDiseaseRouteAuditResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="diseaseTypeId" column="disease_type_id"/>
|
||||
<result property="diseaseTypeName" column="disease_type_name"/>
|
||||
<result property="routeName" column="route_name"/>
|
||||
<collection
|
||||
property="nodeList"
|
||||
ofType="com.xinelu.manage.vo.specialdiseasenode.SpecialDiseaseNodeAuditVo"
|
||||
column="id"
|
||||
select="com.xinelu.manage.mapper.specialdiseasenode.SpecialDiseaseNodeMapper.selectByRouteId"
|
||||
/>
|
||||
<collection property="childRouteList" javaType="java.util.List"
|
||||
column="id"
|
||||
ofType="com.xinelu.manage.vo.specialdiseasenode.SpecialDiseaseNodeAuditVo"
|
||||
select="selectAuditChildRoute"
|
||||
/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseChildRouteAuditVo" id="SpecialDiseaseChildRouteAuditResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="diseaseTypeId" column="disease_type_id"/>
|
||||
<result property="diseaseTypeName" column="disease_type_name"/>
|
||||
<result property="routeName" column="route_name"/>
|
||||
<collection
|
||||
property="nodeList"
|
||||
ofType="com.xinelu.manage.vo.specialdiseasenode.SpecialDiseaseNodeAuditVo"
|
||||
column="id"
|
||||
select="com.xinelu.manage.mapper.specialdiseasenode.SpecialDiseaseNodeMapper.selectByRouteId"
|
||||
/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="com.xinelu.manage.vo.specialdiseasetriggercondition.TriggerConditionVO"
|
||||
id="SpecialDiseaseTriggerConditionResult">
|
||||
<result property="triggerConditionId" column="triggerConditionId"/>
|
||||
@ -94,6 +125,7 @@
|
||||
|
||||
<sql id="selectSpecialDiseaseRouteVo">
|
||||
select id,
|
||||
parent_route_id,
|
||||
department_id,
|
||||
department_name,
|
||||
disease_type_id,
|
||||
@ -159,6 +191,11 @@
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectRouteAndChildren" parameterType="Long"
|
||||
resultMap="SpecialDiseaseRouteResult">
|
||||
<include refid="selectSpecialDiseaseRouteVo"/>
|
||||
where id = #{id} or parent_route_id = #{id}
|
||||
</select>
|
||||
<select id="selectDiseaseRouteList"
|
||||
resultType="com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteVO">
|
||||
select sdr.id,
|
||||
@ -237,6 +274,27 @@
|
||||
GROUP BY sdr.id order by create_time DESC,route_sort ASC
|
||||
</select>
|
||||
|
||||
<select id="getRouteAuditInfo"
|
||||
resultType="com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteAuditVo"
|
||||
resultMap="SpecialDiseaseRouteAuditResult">
|
||||
select sdr.id,
|
||||
sdr.disease_type_id,
|
||||
sdr.disease_type_name,
|
||||
sdr.route_name
|
||||
from special_disease_route sdr
|
||||
where id = #{routeId}
|
||||
</select>
|
||||
<select id="selectAuditChildRoute"
|
||||
resultType="com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseChildRouteAuditVo"
|
||||
resultMap="SpecialDiseaseChildRouteAuditResult">
|
||||
select sdr.id,
|
||||
sdr.disease_type_id,
|
||||
sdr.disease_type_name,
|
||||
sdr.route_name
|
||||
from special_disease_route sdr
|
||||
where parent_route_id = #{parentRouteId}
|
||||
</select>
|
||||
|
||||
<select id="selectSpecialDiseaseRouteById" parameterType="Long"
|
||||
resultMap="SpecialDiseaseRouteResult">
|
||||
<include refid="selectSpecialDiseaseRouteVo"/>
|
||||
|
||||
@ -13,6 +13,7 @@
|
||||
<result property="cssClass" column="css_class"/>
|
||||
<result property="listClass" column="list_class"/>
|
||||
<result property="isDefault" column="is_default"/>
|
||||
<result property="dictDataType" column="dict_data_type"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
@ -21,7 +22,7 @@
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDictDataVo">
|
||||
select dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark,parent_dict_code
|
||||
select dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, dict_data_type, status, create_by, create_time, remark,parent_dict_code
|
||||
from sys_dict_data
|
||||
</sql>
|
||||
|
||||
@ -34,6 +35,9 @@
|
||||
<if test="dictLabel != null and dictLabel != ''">
|
||||
AND dict_label like concat('%', #{dictLabel}, '%')
|
||||
</if>
|
||||
<if test="dictDataType != null and dictDataType != ''">
|
||||
AND dict_data_type like concat('%', #{dictDataType}, '%')
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
@ -91,6 +95,7 @@
|
||||
<if test="cssClass != null">css_class = #{cssClass},</if>
|
||||
<if test="listClass != null">list_class = #{listClass},</if>
|
||||
<if test="isDefault != null and isDefault != ''">is_default = #{isDefault},</if>
|
||||
<if test="dictDataType != null">dict_data_type = #{dictDataType},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
@ -113,6 +118,7 @@
|
||||
<if test="cssClass != null and cssClass != ''">css_class,</if>
|
||||
<if test="listClass != null and listClass != ''">list_class,</if>
|
||||
<if test="isDefault != null and isDefault != ''">is_default,</if>
|
||||
<if test="dictDataType != null">dict_data_type,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
@ -126,6 +132,7 @@
|
||||
<if test="cssClass != null and cssClass != ''">#{cssClass},</if>
|
||||
<if test="listClass != null and listClass != ''">#{listClass},</if>
|
||||
<if test="isDefault != null and isDefault != ''">#{isDefault},</if>
|
||||
<if test="dictDataType != null">#{dictDataType},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user