修改测试问题。
This commit is contained in:
parent
c2ef98dc6d
commit
8bfe8ddc46
@ -0,0 +1,291 @@
|
||||
package com.xinelu.common.utils;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Calendar;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
/**
|
||||
* @description: 基本工具类
|
||||
* @author: mengkuiliang
|
||||
* @createDate: 2021-12-03 10:50
|
||||
*/
|
||||
public class BaseUtil {
|
||||
|
||||
/**
|
||||
* @return java.lang.String
|
||||
* @Author mengkuiliang
|
||||
* @Description 根据身份证号计算年龄(周岁)
|
||||
* @Date 2021-12-03 11:03
|
||||
* @Param [identity]
|
||||
**/
|
||||
public static String calculateAgeByIdentity(String identity) {
|
||||
|
||||
if (StringUtils.isBlank(identity)) {
|
||||
return "";
|
||||
}
|
||||
String age;
|
||||
Calendar cal = Calendar.getInstance();
|
||||
int yearNow = cal.get(Calendar.YEAR);
|
||||
int monthNow = cal.get(Calendar.MONTH) + 1;
|
||||
int dayNow = cal.get(Calendar.DATE);
|
||||
int year = 0;
|
||||
int month = 0;
|
||||
int day = 0;
|
||||
if(identity.length() == 15) {
|
||||
year = 1900 + Integer.parseInt(identity.substring(6, 8));
|
||||
month = Integer.parseInt(identity.substring(8, 10));
|
||||
day = Integer.parseInt(identity.substring(10, 12));
|
||||
} else if(identity.length() == 18) {
|
||||
year = Integer.parseInt(identity.substring(6, 10));
|
||||
month = Integer.parseInt(identity.substring(10, 12));
|
||||
day = Integer.parseInt(identity.substring(12, 14));
|
||||
}
|
||||
|
||||
|
||||
if ((month < monthNow) || (month == monthNow && day <= dayNow)) {
|
||||
age = String.valueOf(yearNow - year);
|
||||
} else {
|
||||
age = String.valueOf(yearNow - year - 1);
|
||||
}
|
||||
return age;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return java.lang.String
|
||||
* @Author mengkuiliang
|
||||
* @Description 根据出生日期计算年龄(周岁)
|
||||
* @Date 2022-04-29 8:50
|
||||
* @Param [birthday]
|
||||
**/
|
||||
public static String calculateAgeByBirthdy(LocalDate birthday) {
|
||||
|
||||
if (birthday == null) {
|
||||
return "";
|
||||
}
|
||||
String age;
|
||||
Calendar cal = Calendar.getInstance();
|
||||
int yearNow = cal.get(Calendar.YEAR);
|
||||
int monthNow = cal.get(Calendar.MONTH) + 1;
|
||||
int dayNow = cal.get(Calendar.DATE);
|
||||
|
||||
int year = birthday.getYear();
|
||||
int month = birthday.getMonthValue();
|
||||
int day = birthday.getDayOfMonth();
|
||||
|
||||
if ((month < monthNow) || (month == monthNow && day <= dayNow)) {
|
||||
age = String.valueOf(yearNow - year);
|
||||
} else {
|
||||
age = String.valueOf(yearNow - year - 1);
|
||||
}
|
||||
return age;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return java.lang.String
|
||||
* @Author mengkuiliang
|
||||
* @Description 根据身份证号获取出生日期
|
||||
* @Date 2021-12-15 14:50
|
||||
* @Param [identity]
|
||||
**/
|
||||
public static LocalDate getBirthday(String identity) {
|
||||
if (StringUtils.isBlank(identity)) {
|
||||
return null;
|
||||
}
|
||||
String year = "";
|
||||
String month = "";
|
||||
String day = "";
|
||||
if(identity.length() == 15) {
|
||||
year = "19" + identity.substring(6, 8);
|
||||
month = identity.substring(8, 10);
|
||||
day = identity.substring(10, 12);
|
||||
} else if(identity.length() == 18) {
|
||||
year = identity.substring(6, 10);
|
||||
month = identity.substring(10, 12);
|
||||
day = identity.substring(12, 14);
|
||||
}
|
||||
return LocalDate.of(Integer.parseInt(year), Integer.parseInt(month), Integer.parseInt(day));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return [1: 男 2:女]
|
||||
* @Author mengkuiliang
|
||||
* @Description 根据身份证号获取性别
|
||||
* @Date 2021-12-14 17:13
|
||||
* @Param
|
||||
**/
|
||||
public static String getGender(String identity) {
|
||||
if (StringUtils.isBlank(identity)) {
|
||||
return null;
|
||||
}
|
||||
Integer type = null;
|
||||
if(identity.length() == 15) {
|
||||
type = Integer.parseInt(identity.substring(14));
|
||||
} else if(identity.length() == 18) {
|
||||
type = Integer.parseInt(identity.substring(16, 17));
|
||||
}
|
||||
if(type == null) {
|
||||
return null;
|
||||
}
|
||||
if (type % 2 == 0) {
|
||||
return "FEMALE";
|
||||
} else {
|
||||
return "MALE";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return boolean
|
||||
* @Author mengkuiliang
|
||||
* @Description 是否包含汉字
|
||||
* @Date 2022-02-11 13:31
|
||||
* @Param [str]
|
||||
**/
|
||||
public static boolean bChineseCharacters(String str) {
|
||||
if (StringUtils.isBlank(str)) {
|
||||
return false;
|
||||
}
|
||||
Pattern p = Pattern.compile("[\u4e00-\u9fa5]");
|
||||
Matcher m = p.matcher(str);
|
||||
if (m.find()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
* @Author mengkuiliang
|
||||
* @Description 获取指定字符串 在源字符串中 出现的次数
|
||||
* @Date 2022-03-09 15:56
|
||||
* @Param [source:源字符串, find:要查找的字符串]
|
||||
**/
|
||||
public static int appearNumber(String source, String find) {
|
||||
int count = 0;
|
||||
Pattern p = Pattern.compile(find);
|
||||
Matcher m = p.matcher(source);
|
||||
while (m.find()) {
|
||||
count++;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
* @Author mengkuiliang
|
||||
* @Description 获取指定字符串 在源字符串中 第几次出现的位置
|
||||
* @Date 2022-03-09 15:56
|
||||
* @Param [source:源字符串, find:要查找的字符串, number:第几次]
|
||||
**/
|
||||
public static int appearNumberIndex(String source, String find, Integer number) {
|
||||
Matcher slashMatcher = Pattern.compile(find).matcher(source);
|
||||
int mIdx = 0;
|
||||
while (slashMatcher.find()) {
|
||||
mIdx++;
|
||||
if (mIdx == number) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return slashMatcher.start();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return java.lang.Boolean
|
||||
* @Author mengkuiliang
|
||||
* @Description 校验新版本是否大于最新版本
|
||||
* @Date 2022-03-10 8:39
|
||||
* @Param [lastVersion, newVersion]
|
||||
**/
|
||||
public static Boolean compareVersion(String lastVersion, String newVersion) {
|
||||
if (StringUtils.isBlank(lastVersion)) {
|
||||
return true;
|
||||
}
|
||||
if (StringUtils.isBlank(newVersion)) {
|
||||
return false;
|
||||
}
|
||||
String[] lastArray = lastVersion.split("\\.");
|
||||
String[] newArray = newVersion.split("\\.");
|
||||
// 获取最大长度
|
||||
int length = Math.max(lastArray.length, newArray.length);
|
||||
for (int i = 0; i < length; i++) {
|
||||
// 获取每个版本节点,挨个判断大小
|
||||
int lastV = i < lastArray.length ? Integer.parseInt(lastArray[i]) : 0;
|
||||
int newV = i < newArray.length ? Integer.parseInt(newArray[i]) : 0;
|
||||
if (lastV < newV) {
|
||||
return true;
|
||||
}
|
||||
if (lastV > newV) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 加密身份证号
|
||||
*
|
||||
* @param idNo 身份证号码
|
||||
* <li>(1)把原字符串按字符循环获取 asc 码,并格式化为 3 位整数;</li>
|
||||
* <li>(2)把数字字符串进行奇偶交换(第 1 位和第 2 位交换,第 3 位和第 4 位交换,
|
||||
* 依次类推,如果总长是奇数位,则最后一位不变),重新组合数字字符串</li>
|
||||
* <li>例如:原字符串是“ab2”,第一步获取asc码转换为“097098050”,第二步转
|
||||
* 换就变成900789500</li>
|
||||
* @return {@link String}
|
||||
* @author gaoyu
|
||||
* @date 2022-05-18 14:28
|
||||
*/
|
||||
public static String encryptIdNo(String idNo) {
|
||||
if (StringUtils.isEmpty(idNo)) {
|
||||
return "";
|
||||
}
|
||||
StringBuilder chars = new StringBuilder();
|
||||
for (int i = 0; i < idNo.length(); i++) {
|
||||
int asc_i = idNo.charAt(i);
|
||||
if (asc_i < 10) {
|
||||
chars.append("00").append(asc_i);
|
||||
} else if (asc_i < 100) {
|
||||
chars.append("0").append(asc_i);
|
||||
} else {
|
||||
chars.append(asc_i);
|
||||
}
|
||||
}
|
||||
String tempStr;
|
||||
String lastChar = "";
|
||||
if (chars.length() % 2 == 0) {
|
||||
tempStr = chars.toString();
|
||||
} else {
|
||||
tempStr = chars.substring(0, chars.length() - 1);
|
||||
lastChar = String.valueOf(chars.charAt(chars.length() - 1));
|
||||
}
|
||||
StringBuilder resultStr = new StringBuilder();
|
||||
for (int i = 0; i < tempStr.length(); i++) {
|
||||
if (i % 2 == 0) {
|
||||
resultStr.append(tempStr.charAt(i));
|
||||
} else {
|
||||
resultStr.insert(resultStr.length() - 1, tempStr.charAt(i));
|
||||
}
|
||||
}
|
||||
return resultStr.append(lastChar).toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* @Author mengkuiliang
|
||||
* @Description 判断是否为小数
|
||||
* @Date 2023-03-13 15:20
|
||||
* @Param [str]
|
||||
* @return boolean
|
||||
**/
|
||||
public static boolean isDecimal(String str){
|
||||
if(str != null) {
|
||||
Pattern pattern = Pattern.compile("[0-9]*\\.?[0-9]+");
|
||||
Matcher isNum = pattern.matcher(str);
|
||||
if (!isNum.matches()) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@ -2,7 +2,6 @@ package com.xinelu.manage.dto.signpatientmanageroutenode;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.List;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@ -23,10 +22,10 @@ public class MobilePatientTaskDto {
|
||||
private Long residentId;
|
||||
|
||||
/**
|
||||
* 任务类型列表
|
||||
* 任务类型列表,多个类型用,拼接
|
||||
*/
|
||||
@ApiModelProperty("任务类型列表")
|
||||
@ApiModelProperty("任务类型列表,多个类型用,拼接")
|
||||
@NotNull(message = "数据传输有误")
|
||||
private List<String> taskTypeList;
|
||||
private String taskTypeList;
|
||||
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ import com.xinelu.common.constant.NodeTypeConstants;
|
||||
import com.xinelu.common.constant.PatientTypeConstants;
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.common.exception.ServiceException;
|
||||
import com.xinelu.common.utils.BaseUtil;
|
||||
import com.xinelu.common.utils.SecurityUtils;
|
||||
import com.xinelu.common.utils.StringUtils;
|
||||
import com.xinelu.common.utils.bean.BeanUtils;
|
||||
@ -64,6 +65,16 @@ public class PatientPreHospitalizationServiceImpl implements IPatientPreHospital
|
||||
|
||||
@Override
|
||||
public int insert(PatientPreHospitalization preHospitalization) {
|
||||
// 根据身份证号设置出生日期、性别
|
||||
if (StringUtils.isBlank(preHospitalization.getCardNo())) {
|
||||
throw new ServiceException("请填写正确的身份证号!");
|
||||
}
|
||||
if (preHospitalization.getBirthDate() == null) {
|
||||
preHospitalization.setBirthDate(BaseUtil.getBirthday(preHospitalization.getCardNo()));
|
||||
}
|
||||
if (StringUtils.isBlank(preHospitalization.getSex())) {
|
||||
preHospitalization.setSex(BaseUtil.getGender(preHospitalization.getCardNo()));
|
||||
}
|
||||
// 根据身份证号+医院id查询是否有患者信息
|
||||
PatientInfoDto patientInfoDto = new PatientInfoDto();
|
||||
patientInfoDto.setCardNo(preHospitalization.getCardNo());
|
||||
@ -80,8 +91,10 @@ public class PatientPreHospitalizationServiceImpl implements IPatientPreHospital
|
||||
} else {
|
||||
// 修改患者信息
|
||||
patientInfo = patientList.get(0);
|
||||
Long patientId = patientInfo.getId();
|
||||
BeanUtils.copyBeanProp(patientInfo, preHospitalization);
|
||||
patientInfo.setPatientType(PatientTypeConstants.PRE_HOSPITALIZED_PATIENT);
|
||||
patientInfo.setId(patientId);
|
||||
patientInfoService.updatePatientInfo(patientInfo);
|
||||
preHospitalization.setPatientId(patientInfo.getId());
|
||||
preHospitalization.setResidentId(patientInfo.getResidentId());
|
||||
|
||||
@ -7,6 +7,7 @@ import com.xinelu.common.constant.VisitMethodConstants;
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.common.enums.PatientSourceEnum;
|
||||
import com.xinelu.common.exception.ServiceException;
|
||||
import com.xinelu.common.utils.BaseUtil;
|
||||
import com.xinelu.common.utils.SecurityUtils;
|
||||
import com.xinelu.common.utils.StringUtils;
|
||||
import com.xinelu.common.utils.bean.BeanUtils;
|
||||
@ -96,6 +97,15 @@ public class PatientVisitRecordServiceImpl implements IPatientVisitRecordService
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void insertPatientVisitRecord(PatientVisitRecordSaveDto saveDto) {
|
||||
if (StringUtils.isBlank(saveDto.getCardNo())) {
|
||||
throw new ServiceException("请填写正确的身份证号!");
|
||||
}
|
||||
if (saveDto.getBirthDate() == null) {
|
||||
saveDto.setBirthDate(BaseUtil.getBirthday(saveDto.getCardNo()));
|
||||
}
|
||||
if (StringUtils.isBlank(saveDto.getSex())) {
|
||||
saveDto.setSex(BaseUtil.getGender(saveDto.getCardNo()));
|
||||
}
|
||||
// 根据机构id、患者身份证号判断门诊/住院号是否重复
|
||||
PatientVisitRecordDto patientVisitRecordDto = new PatientVisitRecordDto();
|
||||
patientVisitRecordDto.setHospitalAgencyId(saveDto.getHospitalAgencyId());
|
||||
@ -116,7 +126,6 @@ public class PatientVisitRecordServiceImpl implements IPatientVisitRecordService
|
||||
// 患者档案信息新增/修改
|
||||
PatientInfo patientInfo = new PatientInfo();
|
||||
if(CollectionUtils.isEmpty(patientInfoList)) {
|
||||
// 新增档案
|
||||
BeanUtils.copyBeanProp(patientInfo, saveDto);
|
||||
patientInfo.setPatientSource(PatientSourceEnum.MANAGE_END.name());
|
||||
patientInfo.setDelFlag(0);
|
||||
@ -166,6 +175,15 @@ public class PatientVisitRecordServiceImpl implements IPatientVisitRecordService
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int updatePatientVisitRecord(PatientVisitRecord patientVisitRecord) {
|
||||
if (StringUtils.isBlank(patientVisitRecord.getCardNo())) {
|
||||
throw new ServiceException("请填写正确的身份证号!");
|
||||
}
|
||||
if (patientVisitRecord.getBirthDate() == null) {
|
||||
patientVisitRecord.setBirthDate(BaseUtil.getBirthday(patientVisitRecord.getCardNo()));
|
||||
}
|
||||
if (StringUtils.isBlank(patientVisitRecord.getSex())) {
|
||||
patientVisitRecord.setSex(BaseUtil.getGender(patientVisitRecord.getCardNo()));
|
||||
}
|
||||
// 根据机构id、患者身份证号判断门诊/住院号是否重复
|
||||
PatientVisitRecordDto patientVisitRecordDto = new PatientVisitRecordDto();
|
||||
patientVisitRecordDto.setHospitalAgencyId(patientVisitRecord.getHospitalAgencyId());
|
||||
|
||||
@ -37,7 +37,9 @@ import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageRouteNod
|
||||
import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageRouteNodeVo;
|
||||
import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteVO;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -280,29 +282,37 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage
|
||||
SignPatientManageRoute signRoute = signRouteList.get(0);
|
||||
SignPatientManageRouteNodeDto nodeQuery = new SignPatientManageRouteNodeDto();
|
||||
nodeQuery.setManageRouteId(signRoute.getId());
|
||||
nodeQuery.setTaskTypeList(Arrays.asList(mobilePatientTaskDto.getTaskTypeList().split(",")));
|
||||
List<SignPatientManageRouteNode> signNodeList = signPatientManageRouteNodeMapper.selectSignPatientManageRouteNodeList(nodeQuery);
|
||||
for (SignPatientManageRouteNode node : signNodeList) {
|
||||
LocalDateTime executeTime = null;
|
||||
|
||||
LocalTime et = LocalTime.of(8,0,0);
|
||||
if (node.getExecuteTime() != null) {
|
||||
et = node.getExecuteTime();
|
||||
}
|
||||
switch(node.getRouteNodeName()) {
|
||||
case RouteNodeNameConstants.AFTER_DISCHARGE: // 出院后
|
||||
executeTime = LocalDateTime.of(patientVisitRecord.getDischargeTime().minusDays(node.getRouteNodeDay()).toLocalDate(), node.getExecuteTime());
|
||||
break;
|
||||
case RouteNodeNameConstants.AFTER_ADMISSION: // 入院后
|
||||
executeTime = LocalDateTime.of(patientVisitRecord.getAdmissionTime().minusDays(node.getRouteNodeDay()).toLocalDate(), node.getExecuteTime());
|
||||
break;
|
||||
case RouteNodeNameConstants.AFTER_CONSULTATION: // 就诊后
|
||||
executeTime = LocalDateTime.of(patientVisitRecord.getVisitDate().minusDays(node.getRouteNodeDay()).toLocalDate(), node.getExecuteTime());
|
||||
break;
|
||||
case RouteNodeNameConstants.AFTER_VISIT_DISCHARGE: // 就诊/出院后
|
||||
// 判断是门诊/住院
|
||||
if (StringUtils.equals(VisitMethodConstants.BE_IN_HOSPITAL, patientVisitRecord.getVisitMethod())) {
|
||||
executeTime = LocalDateTime.of(patientVisitRecord.getDischargeTime().minusDays(node.getRouteNodeDay()).toLocalDate(), node.getExecuteTime());
|
||||
executeTime = LocalDateTime.of(patientVisitRecord.getDischargeTime().plusDays(node.getRouteNodeDay()).toLocalDate(), et);
|
||||
} else {
|
||||
executeTime = LocalDateTime.of(patientVisitRecord.getVisitDate().minusDays(node.getRouteNodeDay()).toLocalDate(), node.getExecuteTime());
|
||||
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().minusDays(node.getRouteNodeDay()).toLocalDate(), node.getExecuteTime());
|
||||
executeTime = LocalDateTime.of(patientVisitRecord.getVisitDate().plusDays(node.getRouteNodeDay()).toLocalDate(), et);
|
||||
break;
|
||||
}
|
||||
retList.add(MobileRouteNodeListVo.builder()
|
||||
|
||||
@ -164,48 +164,50 @@ public class SignPatientRecordServiceImpl implements ISignPatientRecordService {
|
||||
signPatientPackage.setCreateTime(LocalDateTime.now());
|
||||
signPatientPackage.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName());
|
||||
signPatientPackageMapper.insertSignPatientPackage(signPatientPackage);
|
||||
|
||||
if (ObjectUtils.isEmpty(body.getRoute()) || body.getRoute().getRouteId() == null) {
|
||||
throw new ServiceException("请选择管理路径");
|
||||
}
|
||||
// 保存管理路径
|
||||
if (body.getRoute() != null) {
|
||||
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("该管理任务没有任务节点");
|
||||
}
|
||||
List<SignPatientManageRouteNode> manageNodeList = nodeList.stream().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.setCreateTime(LocalDateTime.now());
|
||||
manageRouteNode.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName());
|
||||
return manageRouteNode;
|
||||
}).collect(Collectors.toList());
|
||||
// 批量保存
|
||||
manageRouteNodeMapper.insertBatch(manageNodeList);
|
||||
// 保存触发条件
|
||||
SpecialDiseaseTriggerCondition triggerConditionQuery = new SpecialDiseaseTriggerCondition();
|
||||
triggerConditionQuery.setRouteId(signPatientManageRoute.getRouteId());
|
||||
List<SpecialDiseaseTriggerCondition> triggerConditions = triggerConditionMapper.selectSpecialDiseaseTriggerConditionList(triggerConditionQuery);
|
||||
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("该管理任务没有任务节点");
|
||||
}
|
||||
List<SignPatientManageRouteNode> manageNodeList = nodeList.stream().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.setCreateTime(LocalDateTime.now());
|
||||
manageRouteNode.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName());
|
||||
return manageRouteNode;
|
||||
}).collect(Collectors.toList());
|
||||
// 批量保存
|
||||
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);
|
||||
@ -271,6 +273,10 @@ public class SignPatientRecordServiceImpl implements ISignPatientRecordService {
|
||||
if (ObjectUtils.isEmpty(patientInfo)) {
|
||||
throw new ServiceException("未找到该居民");
|
||||
}
|
||||
// 查询当前居民签约状态是否已意向签约
|
||||
if (StringUtils.equals(SignRecordServiceStatusConstants.INTENTIONAL_SIGNING, patientInfo.getServiceStatus())) {
|
||||
throw new ServiceException("该居民已意向签约!");
|
||||
}
|
||||
// 查询当前居民签约状态是否已签约
|
||||
if (StringUtils.equals(SignRecordServiceStatusConstants.SERVICE_CENTER, patientInfo.getServiceStatus())) {
|
||||
throw new ServiceException("该居民已签约!");
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.xinelu.manage.vo.signpatientmanageroutenode;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.time.LocalDateTime;
|
||||
@ -51,5 +52,6 @@ public class MobileRouteNodeListVo {
|
||||
* 执行时间
|
||||
*/
|
||||
@ApiModelProperty(value = "执行时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime executeTime;
|
||||
}
|
||||
|
||||
@ -62,7 +62,7 @@
|
||||
sex,
|
||||
address,
|
||||
patient_type,
|
||||
sign_status,sign_patient_record_id,
|
||||
sign_status,sign_patient_record_id,service_status,
|
||||
sign_time,
|
||||
visit_method, attending_physician_id, attending_physician_name, main_diagnosis,
|
||||
hospital_agency_id, hospital_agency_name, campus_agency_id, campus_agency_name, department_id, department_name, ward_id, ward_name,
|
||||
|
||||
@ -288,9 +288,9 @@
|
||||
|
||||
<select id="selectList" parameterType="com.xinelu.manage.dto.patientinfo.PatientInfoDto" resultMap="BaseResultMap">
|
||||
select
|
||||
p.id,p.patient_id,p.patient_name,
|
||||
p.patient_phone,p.card_no,p.sex,
|
||||
p.birth_date,p.family_member_phone,p.address,
|
||||
p.id,p.patient_id,patient.patient_name,
|
||||
patient.patient_phone,patient.card_no,patient.sex,
|
||||
patient.birth_date,patient.family_member_phone,patient.address,
|
||||
p.main_diagnosis,p.hospital_agency_id,p.hospital_agency_name,
|
||||
p.campus_agency_name,
|
||||
p.department_name,p.ward_name,
|
||||
@ -300,13 +300,13 @@
|
||||
<where>
|
||||
p.del_flag = 0 and patient.patient_type = 'PRE_HOSPITALIZED_PATIENT'
|
||||
<if test="patientName != null and patientName != ''">
|
||||
and p.patient_name = #{patientName}
|
||||
and patient.patient_name = #{patientName}
|
||||
</if>
|
||||
<if test="patientPhone != null and patientPhone != ''">
|
||||
and p.patient_phone like concat('%', #{patientPhone}, '%')
|
||||
and patient.patient_phone like concat('%', #{patientPhone}, '%')
|
||||
</if>
|
||||
<if test="cardNo != null and cardNo != ''">
|
||||
and p.card_no = #{cardNo}
|
||||
and patient.card_no = #{cardNo}
|
||||
</if>
|
||||
<if test="hospitalAgencyId != null ">
|
||||
and p.hospital_agency_id = #{hospitalAgencyId}
|
||||
@ -326,10 +326,20 @@
|
||||
<if test="certificateIssuingDoctorId != null and certificateIssuingDoctorId != ''">
|
||||
and p.certificate_issuing_doctor_id = #{certificateIssuingDoctorId}
|
||||
</if>
|
||||
<if test="appointmentDateStart != null ">
|
||||
and date_format(p.appointment_date, '%y%m%d') >= date_format(#{appointmentDateStart}, '%y%m%d')
|
||||
</if>
|
||||
<if test="appointmentDateEnd != null ">
|
||||
and date_format(p.appointment_date, '%y%m%d') <= date_format(#{appointmentDateEnd}, '%y%m%d')
|
||||
</if>
|
||||
<if test="certificateIssuingDoctorId != null">
|
||||
and p.certificate_issuing_doctor_id = #{certificateIssuingDoctorId}
|
||||
</if>
|
||||
<if test="registrationNo != null and registrationNo != ''">
|
||||
and p.registration_no = #{registrationNo}
|
||||
</if>
|
||||
</where>
|
||||
order by p.appointment_date
|
||||
</select>
|
||||
|
||||
<select id="selectApplyList" parameterType="com.xinelu.manage.domain.patientprehospitalization.PatientPreHospitalization" resultMap="BaseResultMap">
|
||||
|
||||
@ -478,8 +478,8 @@
|
||||
</insert>
|
||||
<select id="getLastRecord" resultMap="PatientVisitRecordResult">
|
||||
<include refid="selectPatientVisitRecordVo"/>
|
||||
where del_flag = 0
|
||||
<where>
|
||||
del_flag = 0
|
||||
<if test="patientId != null">
|
||||
AND patient_id = #{patientId,jdbcType=BIGINT}
|
||||
</if>
|
||||
|
||||
@ -59,12 +59,13 @@
|
||||
and create_by = #{createBy}
|
||||
</if>
|
||||
<if test="createTimeStart != null">
|
||||
and date_format(create_time, '%y%m%d') >= date_format(createTimeStart, '%y%m%d')
|
||||
and date_format(create_time, '%y%m%d') >= date_format(#{createTimeStart}, '%y%m%d')
|
||||
</if>
|
||||
<if test="createTimeEnd != null">
|
||||
and date_format(create_time, '%y%m%d') <= date_format(#{createTimeEnd}, '%y%m%d')
|
||||
</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectPropagandaInfoById" parameterType="Long"
|
||||
|
||||
@ -97,7 +97,7 @@
|
||||
<if test="taskTypeList != null and taskTypeList.size > 0">
|
||||
and
|
||||
<foreach collection="taskTypeList" item="item" index="index" open="(" close=")" separator="or">
|
||||
task_type = {item}
|
||||
task_type = #{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
@ -653,13 +653,13 @@
|
||||
and patient.main_diagnosis like concat('%', #{mainDiagnosis}, '%')
|
||||
</if>
|
||||
<choose>
|
||||
<when test="routeCheckStatus != null and routeCheckStatus == 'UNAUDITED'">
|
||||
<when test="routeCheckStatus != null and routeCheckStatus == 'UNAUDITED'.toString()">
|
||||
and node.route_check_status is null
|
||||
</when>
|
||||
<when test="routeCheckStatus != null and routeCheckStatus == 'AGREE'">
|
||||
<when test="routeCheckStatus != null and routeCheckStatus == 'AGREE'.toString()">
|
||||
and node.route_check_status = #{routeCheckStatus}
|
||||
</when>
|
||||
<when test="routeCheckStatus != null and routeCheckStatus == 'DISAGREE'">
|
||||
<when test="routeCheckStatus != null and routeCheckStatus == 'DISAGREE'.toString()">
|
||||
and node.route_check_status = #{routeCheckStatus}
|
||||
</when>
|
||||
</choose>
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.xinelu.mobile.controller.appletsignpatienttask;
|
||||
|
||||
import com.xinelu.common.core.controller.BaseController;
|
||||
import com.xinelu.common.core.domain.R;
|
||||
import com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRouteNode;
|
||||
import com.xinelu.manage.dto.signpatientmanageroutenode.MobilePatientTaskDto;
|
||||
@ -23,7 +24,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@Api(tags = "小程序-患者任务控制器")
|
||||
@RestController
|
||||
@RequestMapping("/postDischarge/signnode")
|
||||
public class AppletSignPatientTaskController {
|
||||
public class AppletSignPatientTaskController extends BaseController {
|
||||
@Resource
|
||||
private ISignPatientManageRouteNodeService signNodeService;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user