小程序消息推送及任务代办列表修改
This commit is contained in:
parent
609f7a3f39
commit
ab5be773a5
@ -72,4 +72,9 @@ public class ManualFollowUpDTO extends BaseEntity {
|
||||
|
||||
@ApiModelProperty(value = "任务名称")
|
||||
private String manageRouteName;
|
||||
|
||||
/**
|
||||
* 时间标识 whole:全部 today:今天及今天之前
|
||||
*/
|
||||
private String timeSign;
|
||||
}
|
||||
|
||||
@ -72,6 +72,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
@ -181,9 +182,9 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
|
||||
}
|
||||
//List<SignRouteTriggerCondition> signRouteTriggerConditions = new ArrayList<SignRouteTriggerCondition>();
|
||||
//for (SignRouteTriggerConditionVO signRouteTriggerCondition : signPatientManageRoute.getTriggerConditionList()) {
|
||||
// if (StringUtils.isBlank(signRouteTriggerCondition.getTriggerConditionCode()) || StringUtils.isBlank(signRouteTriggerCondition.getTriggerConditionOperator()) || StringUtils.isBlank(signRouteTriggerCondition.getTriggerConditionValue())) {
|
||||
// return AjaxResult.error("请选择完整的触发条件");
|
||||
// }
|
||||
// if (StringUtils.isBlank(signRouteTriggerCondition.getTriggerConditionCode()) || StringUtils.isBlank(signRouteTriggerCondition.getTriggerConditionOperator()) || StringUtils.isBlank(signRouteTriggerCondition.getTriggerConditionValue())) {
|
||||
// return AjaxResult.error("请选择完整的触发条件");
|
||||
// }
|
||||
// SignRouteTriggerCondition triggerCondition = new SignRouteTriggerCondition();
|
||||
// signRouteTriggerCondition.setPatientManageRouteId(signPatientManageRoute.getId());
|
||||
// signRouteTriggerCondition.setCreateTime(LocalDateTime.now());
|
||||
@ -283,7 +284,42 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
|
||||
@Override
|
||||
@DataScope(agencyAlias = "pi", deptAlias = "pi")
|
||||
public List<ManualFollowUpVO> selectManualFollowUpList(ManualFollowUpDTO manualFollowUpDTO) {
|
||||
return signPatientManageRouteMapper.selectManualFollowUpList(manualFollowUpDTO);
|
||||
List<ManualFollowUpVO> manualFollowUpVOS = signPatientManageRouteMapper.selectManualFollowUpList(manualFollowUpDTO);
|
||||
if (StringUtils.isNotBlank(manualFollowUpDTO.getTimeSign()) && manualFollowUpDTO.getTimeSign().equals("WHOLE")) {
|
||||
return manualFollowUpVOS;
|
||||
}
|
||||
ArrayList<ManualFollowUpVO> manualFollowUps = new ArrayList<>();
|
||||
for (ManualFollowUpVO manualFollowUpVO : manualFollowUpVOS) {
|
||||
//判断路径节点,组装数据
|
||||
if (manualFollowUpVO.getRouteNodeName().equals(RouteNodeNameEnum.AFTER_DISCHARGE.getInfo()) || manualFollowUpVO.getRouteNodeName().equals(RouteNodeNameEnum.AFTER_VISIT_DISCHARGE.getInfo())) {
|
||||
if (manualFollowUpVO.getPatientType().equals(PatientTypeEnum.DISCHARGED_PATIENT.getInfo())) {
|
||||
LocalDate localDate = manualFollowUpVO.getDischargeTime().plusDays(manualFollowUpVO.getRouteNodeDay()).toLocalDate();
|
||||
boolean before = localDate.isBefore(LocalDate.now()) || localDate.isEqual(LocalDate.now());
|
||||
if (before) {
|
||||
manualFollowUps.add(manualFollowUpVO);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (manualFollowUpVO.getRouteNodeName().equals(RouteNodeNameEnum.AFTER_ADMISSION.getInfo())) {
|
||||
if (manualFollowUpVO.getPatientType().equals(PatientTypeEnum.IN_HOSPITAL_PATIENT.getInfo())) {
|
||||
LocalDate localDate = manualFollowUpVO.getAdmissionTime().plusDays(manualFollowUpVO.getRouteNodeDay()).toLocalDate();
|
||||
boolean before = localDate.isBefore(LocalDate.now()) || localDate.isEqual(LocalDate.now());
|
||||
if (before) {
|
||||
manualFollowUps.add(manualFollowUpVO);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (manualFollowUpVO.getRouteNodeName().equals(RouteNodeNameEnum.AFTER_CONSULTATION.getInfo()) || manualFollowUpVO.getRouteNodeName().equals(RouteNodeNameEnum.AFTER_VISIT_DISCHARGE.getInfo())) {
|
||||
if (manualFollowUpVO.getPatientType().equals(PatientTypeEnum.OUTPATIENT.getInfo()) && manualFollowUpVO.getAdmissionTime() == null) {
|
||||
LocalDate localDate = manualFollowUpVO.getVisitTime().plusDays(manualFollowUpVO.getRouteNodeDay()).toLocalDate();
|
||||
boolean before = localDate.isBefore(LocalDate.now()) || localDate.isEqual(LocalDate.now());
|
||||
if (before) {
|
||||
manualFollowUps.add(manualFollowUpVO);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return manualFollowUps;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -332,7 +368,7 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
|
||||
smsInfoDTO.setTemplateCode(aliYunSmsTwoConfig.getTemplateCode());
|
||||
Boolean b = sendSms(smsInfoDTO);
|
||||
if (!b) {
|
||||
log.info("短信发送失败");
|
||||
log.info("短信发送失败");
|
||||
}
|
||||
log.info("短信发送成功");
|
||||
}
|
||||
|
||||
@ -51,6 +51,9 @@ public class ManualFollowUpVO {
|
||||
@ApiModelProperty(value = "性别,男:MALE,女:FEMALE")
|
||||
private String sex;
|
||||
|
||||
@ApiModelProperty(value = "在院患者:IN_HOSPITAL_PATIENT,门诊患者:OUTPATIENT,出院患者:DISCHARGED_PATIENT")
|
||||
private String patientType;
|
||||
|
||||
@ApiModelProperty(value = "所属医院id")
|
||||
private Long hospitalAgencyId;
|
||||
|
||||
|
||||
@ -297,6 +297,7 @@
|
||||
pi.patient_name,
|
||||
pi.patient_phone,
|
||||
pi.sex,
|
||||
pi.patient_type,
|
||||
pi.hospital_agency_id,
|
||||
pi.hospital_agency_name,
|
||||
pi.campus_agency_id,
|
||||
|
||||
@ -60,7 +60,7 @@ public class subscribeTaskServiceImpl implements SubscribeTaskService {
|
||||
PatientVO patientVO = patient.stream().filter(Objects::nonNull).filter(item -> signPatientManageRouteNode.getPatientId().equals(item.getPatientId())).findFirst().orElse(new PatientVO());
|
||||
if (patientVO.getPatientType().equals(PatientTypeEnum.DISCHARGED_PATIENT.getInfo())) {
|
||||
LocalDate localDate = patientVO.getDischargeTime().plusDays(signPatientManageRouteNode.getRouteNodeDay());
|
||||
boolean before = localDate.isEqual(LocalDate.now());
|
||||
boolean before = localDate.isBefore(LocalDate.now()) || localDate.isEqual(LocalDate.now());
|
||||
if (before) {
|
||||
signPatientManageRouteNode.setOpenId(patientVO.getOpenId());
|
||||
signPatientManageRouteNode.setRouteNodeName(RouteNodeNameEnum.AFTER_DISCHARGE.getName());
|
||||
@ -72,7 +72,7 @@ public class subscribeTaskServiceImpl implements SubscribeTaskService {
|
||||
PatientVO patientVO = patient.stream().filter(Objects::nonNull).filter(item -> signPatientManageRouteNode.getPatientId().equals(item.getPatientId())).findFirst().orElse(new PatientVO());
|
||||
if (patientVO.getPatientType().equals(PatientTypeEnum.IN_HOSPITAL_PATIENT.getInfo())) {
|
||||
LocalDate localDate = patientVO.getAdmissionTime().plusDays(signPatientManageRouteNode.getRouteNodeDay());
|
||||
boolean before = localDate.isEqual(LocalDate.now());
|
||||
boolean before = localDate.isBefore(LocalDate.now()) || localDate.isEqual(LocalDate.now());
|
||||
if (before) {
|
||||
signPatientManageRouteNode.setOpenId(patientVO.getOpenId());
|
||||
signPatientManageRouteNode.setRouteNodeName(RouteNodeNameEnum.AFTER_ADMISSION.getName());
|
||||
@ -84,7 +84,7 @@ public class subscribeTaskServiceImpl implements SubscribeTaskService {
|
||||
PatientVO patientVO = patient.stream().filter(Objects::nonNull).filter(item -> signPatientManageRouteNode.getPatientId().equals(item.getPatientId())).findFirst().orElse(new PatientVO());
|
||||
if (patientVO.getPatientType().equals(PatientTypeEnum.OUTPATIENT.getInfo()) && patientVO.getAdmissionTime() == null) {
|
||||
LocalDate localDate = patientVO.getVisitDate().plusDays(signPatientManageRouteNode.getRouteNodeDay());
|
||||
boolean before = localDate.isEqual(LocalDate.now());
|
||||
boolean before = localDate.isBefore(LocalDate.now()) || localDate.isEqual(LocalDate.now());
|
||||
if (before) {
|
||||
signPatientManageRouteNode.setOpenId(patientVO.getOpenId());
|
||||
signPatientManageRouteNode.setRouteNodeName(RouteNodeNameEnum.AFTER_CONSULTATION.getName());
|
||||
|
||||
Loading…
Reference in New Issue
Block a user