Merge branch '0418_小程序开发' of http://182.92.166.109:3000/zhuangyuanke/PostDischargePatientManage into 0418_小程序开发

This commit is contained in:
haown 2024-07-04 16:20:18 +08:00
commit 26810e2990
13 changed files with 43 additions and 27 deletions

View File

@ -56,8 +56,8 @@ public class LabelFieldInfoController extends BaseController {
* 查询标签字段信息列表树图 * 查询标签字段信息列表树图
*/ */
@GetMapping("/labelFieldList") @GetMapping("/labelFieldList")
public List<LabelFieldTreeVO> labelFieldList(String fieldType) { public List<LabelFieldTreeVO> labelFieldList(Long taskPartitionDictId, String fieldType) {
return labelFieldInfoService.labelFieldList(fieldType); return labelFieldInfoService.labelFieldList(taskPartitionDictId, fieldType);
} }
/** /**

View File

@ -36,7 +36,7 @@ public interface LabelFieldInfoMapper {
* @param fieldType 标签字段信息 * @param fieldType 标签字段信息
* @return 标签字段信息集合 * @return 标签字段信息集合
*/ */
List<LabelFieldVO> selectLabelFieldList(String fieldType); List<LabelFieldVO> selectLabelFieldList(@Param("taskPartitionDictId") Long taskPartitionDictId, @Param("fieldType") String fieldType);
/** /**
* 新增标签字段信息 * 新增标签字段信息
@ -90,7 +90,7 @@ public interface LabelFieldInfoMapper {
/** /**
* 查询标签 * 查询标签
* *
* @param taskPartitionDictId 标签 * @param taskPartitionDictId 标签
* @return GroupingValue * @return GroupingValue
*/ */
List<GroupingValue> selectLabelFieldInfoByTaskPartitionDictId(Long taskPartitionDictId); List<GroupingValue> selectLabelFieldInfoByTaskPartitionDictId(Long taskPartitionDictId);
@ -98,7 +98,7 @@ public interface LabelFieldInfoMapper {
/** /**
* 查询标签 * 查询标签
* *
* @param taskPartitionDictIds 标签 * @param taskPartitionDictIds 标签
* @return LabelFieldVO * @return LabelFieldVO
*/ */
List<LabelFieldVO> selectLabelFieldNameByTaskPartitionDictIds(@Param("taskPartitionDictIds") List<Long> taskPartitionDictIds); List<LabelFieldVO> selectLabelFieldNameByTaskPartitionDictIds(@Param("taskPartitionDictIds") List<Long> taskPartitionDictIds);

View File

@ -70,6 +70,12 @@ public interface ResidentInfoMapper {
*/ */
ResidentInfo getResidentInfoByPhoneAndOpenId(@Param("phone") String phone, @Param("openId") String openId); ResidentInfo getResidentInfoByPhoneAndOpenId(@Param("phone") String phone, @Param("openId") String openId);
/**
* 根据电话号码和居民姓名查询居民基本信息
*
* @param phone 手机号
* @param patientName 姓名
* @return 居民基本信息
*/
List<ResidentInfo> getResidentInfoByPhoneAndName(@Param("phone") String phone, @Param("patientName") String patientName); List<ResidentInfo> getResidentInfoByPhoneAndName(@Param("phone") String phone, @Param("patientName") String patientName);
} }

View File

@ -36,7 +36,7 @@ public interface ILabelFieldInfoService {
* @param fieldType 字段类型 * @param fieldType 字段类型
* @return AjaxResult * @return AjaxResult
*/ */
List<LabelFieldTreeVO> labelFieldList(String fieldType); List<LabelFieldTreeVO> labelFieldList(Long taskPartitionDictId, String fieldType);
/** /**
* 新增标签字段信息 * 新增标签字段信息

View File

@ -70,10 +70,10 @@ public class LabelFieldInfoServiceImpl implements ILabelFieldInfoService {
* @return AjaxResult * @return AjaxResult
*/ */
@Override @Override
public List<LabelFieldTreeVO> labelFieldList(String fieldType) { public List<LabelFieldTreeVO> labelFieldList(Long taskPartitionDictId, String fieldType) {
int i = 1; int i = 1;
//查询细分 //查询细分
List<LabelFieldVO> labelFieldList = labelFieldInfoMapper.selectLabelFieldList(fieldType); List<LabelFieldVO> labelFieldList = labelFieldInfoMapper.selectLabelFieldList(taskPartitionDictId, fieldType);
List<Long> taskPartitionDictIds = labelFieldList.stream().filter(Objects::nonNull).map(LabelFieldVO::getTaskPartitionDictId).filter(Objects::nonNull).distinct().collect(Collectors.toList()); List<Long> taskPartitionDictIds = labelFieldList.stream().filter(Objects::nonNull).map(LabelFieldVO::getTaskPartitionDictId).filter(Objects::nonNull).distinct().collect(Collectors.toList());
if (taskPartitionDictIds.size() == 0) { if (taskPartitionDictIds.size() == 0) {
return new ArrayList<>(); return new ArrayList<>();

View File

@ -347,6 +347,7 @@
from label_field_info lfi from label_field_info lfi
LEFT JOIN label_field_content lfc ON lfi.id =lfc.field_id LEFT JOIN label_field_content lfc ON lfi.id =lfc.field_id
LEFT JOIN task_partition_dict tpd on tpd.id = lfi.task_partition_dict_id LEFT JOIN task_partition_dict tpd on tpd.id = lfi.task_partition_dict_id
LEFT JOIN task_type_dict ttd on ttd.id = tpd.task_type_id
where 1=1 where 1=1
<if test="taskPartitionDictId != null and taskPartitionDictId != 0"> <if test="taskPartitionDictId != null and taskPartitionDictId != 0">
and lfi.task_partition_dict_id = #{taskPartitionDictId} and lfi.task_partition_dict_id = #{taskPartitionDictId}
@ -360,7 +361,7 @@
<if test="portraitStatus != null"> <if test="portraitStatus != null">
and lfc.portrait_status = #{portraitStatus} and lfc.portrait_status = #{portraitStatus}
</if> </if>
Order by tpd.task_partition_sort,lfc.portrait_sn,lfi.field_sort Order by ttd.task_type_sort, tpd.task_partition_sort,lfc.portrait_sn,lfi.field_sort
</select> </select>
<insert id="insertLabelFieldContentList"> <insert id="insertLabelFieldContentList">

View File

@ -68,13 +68,17 @@
lfi.task_partition_dict_name label lfi.task_partition_dict_name label
from label_field_info lfi from label_field_info lfi
LEFT JOIN task_partition_dict tpd ON tpd.id = lfi.task_partition_dict_id LEFT JOIN task_partition_dict tpd ON tpd.id = lfi.task_partition_dict_id
LEFT JOIN task_type_dict ttd ON ttd.id = tpd.task_type_id
<where> <where>
<if test="fieldType != null and fieldType != ''"> <if test="fieldType != null and fieldType != ''">
lfi.field_type = #{fieldType} lfi.field_type = #{fieldType}
</if> </if>
<if test="taskPartitionDictId != null">
tpd.id = #{taskPartitionDictId}
</if>
</where> </where>
group by task_partition_dict_id group by task_partition_dict_id
order by tpd.task_partition_sort order by ttd.task_type_sort,tpd.task_partition_sort
</select> </select>
<select id="selectLabelFieldInfoById" parameterType="Long" <select id="selectLabelFieldInfoById" parameterType="Long"

View File

@ -72,6 +72,7 @@
and template_type = #{templateType} and template_type = #{templateType}
</if> </if>
</where> </where>
order by task_partition_sort
</select> </select>
<select id="selectTaskPartitionDictById" parameterType="Long" <select id="selectTaskPartitionDictById" parameterType="Long"

View File

@ -232,7 +232,7 @@ public class AppletPersonCenterServiceImpl implements AppletPersonCenterService
// 更新验证码和冷却键 // 更新验证码和冷却键
valueOperations.set(cacheKey, code, 5, TimeUnit.MINUTES); valueOperations.set(cacheKey, code, 5, TimeUnit.MINUTES);
valueOperations.set(coolDownKey, Constants.SMS_COOL_DOWN_VALUE, 60, TimeUnit.SECONDS); valueOperations.set(coolDownKey, Constants.SMS_COOL_DOWN_VALUE, 60, TimeUnit.SECONDS);
log.info("手机号为{}的验证码已经生成", phoneNum); log.info("手机号为{}的验证码已经生成,验证码:{}", phoneNum, code);
return AjaxResult.success("短信发送成功"); return AjaxResult.success("短信发送成功");
} catch (ClientException e) { } catch (ClientException e) {
log.error("短信发送失败,手机号:{},错误原因:{}", phoneNum, e.getMessage(), e); log.error("短信发送失败,手机号:{},错误原因:{}", phoneNum, e.getMessage(), e);
@ -256,16 +256,16 @@ public class AppletPersonCenterServiceImpl implements AppletPersonCenterService
String storedCode = valueOperations.get(cacheKey); String storedCode = valueOperations.get(cacheKey);
if (storedCode == null) { if (storedCode == null) {
log.info("验证码已过期,手机号:{}", verifySmsCodeDTO.getPhoneNum()); log.error("验证码已过期,手机号:{}", verifySmsCodeDTO.getPhoneNum());
return AjaxResult.error("验证码已过期,请重新获取!"); return AjaxResult.error("验证码已过期,请重新获取!");
} }
if (!storedCode.equals(smsCode)) { if (!storedCode.equals(smsCode)) {
log.info("验证码验证失败,手机号:{},输入的验证码:{},获取的验证码:{}", verifySmsCodeDTO.getPhoneNum(), smsCode, storedCode); log.error("验证码验证失败,手机号:{},输入的验证码:{},获取的验证码:{}", verifySmsCodeDTO.getPhoneNum(), smsCode, storedCode);
return AjaxResult.error("验证码错误,请重新输入!"); return AjaxResult.error("验证码错误,请重新输入!");
} }
log.info("验证码验证成功,手机号:{}", verifySmsCodeDTO.getPhoneNum()); log.info("验证码验证成功,手机号:{},输入的验证码:{},获取的验证码:{}", verifySmsCodeDTO.getPhoneNum(), smsCode, storedCode);
List<ResidentInfo> residentInfos = residentInfoMapper.getResidentInfoByPhoneAndName(verifySmsCodeDTO.getPhoneNum(), verifySmsCodeDTO.getPatientName()); List<ResidentInfo> residentInfos = residentInfoMapper.getResidentInfoByPhoneAndName(verifySmsCodeDTO.getPhoneNum(), verifySmsCodeDTO.getPatientName());
if (residentInfos == null || residentInfos.isEmpty()) { if (residentInfos == null || residentInfos.isEmpty()) {

View File

@ -18,6 +18,7 @@ import org.springframework.stereotype.Component;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -197,7 +198,7 @@ public class WeChatOfficialAccountUtils {
if (CollectionUtils.isNotEmpty(templateContents)) { if (CollectionUtils.isNotEmpty(templateContents)) {
TemplateContent templateContent = templateContents.stream().filter(Objects::nonNull).filter(item -> Objects.nonNull(item.getName()) && Objects.nonNull(item.getValue()) && "thing5".equals(item.getName())).findFirst().orElse(new TemplateContent()); TemplateContent templateContent = templateContents.stream().filter(Objects::nonNull).filter(item -> Objects.nonNull(item.getName()) && Objects.nonNull(item.getValue()) && "thing5".equals(item.getName())).findFirst().orElse(new TemplateContent());
thing5 = templateContent.getValue(); thing5 = templateContent.getValue();
TemplateContent templateContentTwo = templateContents.stream().filter(Objects::nonNull).filter(item -> Objects.nonNull(item.getName()) && Objects.nonNull(item.getValue()) && "thing5".equals(item.getName())).findFirst().orElse(new TemplateContent()); TemplateContent templateContentTwo = templateContents.stream().filter(Objects::nonNull).filter(item -> Objects.nonNull(item.getName()) && Objects.nonNull(item.getValue()) && "thing1".equals(item.getName())).findFirst().orElse(new TemplateContent());
thing1 = templateContentTwo.getValue(); thing1 = templateContentTwo.getValue();
} }
//获取微信小程序的accessToken //获取微信小程序的accessToken
@ -207,12 +208,12 @@ public class WeChatOfficialAccountUtils {
Map<String, Object> paramsMap = new LinkedHashMap<>(); Map<String, Object> paramsMap = new LinkedHashMap<>();
paramsMap.put("touser", patientVO.getOpenId()); paramsMap.put("touser", patientVO.getOpenId());
paramsMap.put("template_id", weChatAppletChatConfig.getHealthyPropagandaId()); paramsMap.put("template_id", weChatAppletChatConfig.getHealthyPropagandaId());
paramsMap.put("page", "/postDischarge/homePage/subscriptionMessage?id =" + patientVO.getSignPatientManageRouteNodeId()); paramsMap.put("page", "pages/homepage/homepage");
Map<String, Object> dataMap = new LinkedHashMap<>(); Map<String, Object> dataMap = new LinkedHashMap<>();
dataMap.put("thing5", new MessageValueEntity(thing5)); dataMap.put("thing5", new MessageValueEntity(thing5));
dataMap.put("thing4", new MessageValueEntity(patientVO.getHospitalName())); dataMap.put("thing4", new MessageValueEntity(patientVO.getHospitalAgencyName()));
dataMap.put("time3", new MessageValueEntity(now.getYear() + "" + now.getMonthValue() + "" + now.getDayOfMonth() + "" + now.getHour() + ":" + now.getSecond())); dataMap.put("time3", new MessageValueEntity(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"))));
dataMap.put("thing6", new MessageValueEntity(patientVO.getRouteNodeName() + "" + patientVO.getRouteNodeDay())); dataMap.put("thing6", new MessageValueEntity(patientVO.getRouteNodeName() + "" + patientVO.getRouteNodeDay() + ""));
dataMap.put("thing1", new MessageValueEntity(thing1)); dataMap.put("thing1", new MessageValueEntity(thing1));
paramsMap.put("data", dataMap); paramsMap.put("data", dataMap);
//拼接请求地址并发送 //拼接请求地址并发送

View File

@ -72,7 +72,7 @@ public class PatientVO {
private Long signPatientManageRouteNodeId; private Long signPatientManageRouteNodeId;
@ApiModelProperty(value = "医院名称") @ApiModelProperty(value = "医院名称")
private String hospitalName; private String hospitalAgencyName;
@ApiModelProperty(value = "微信内容") @ApiModelProperty(value = "微信内容")
private String appletNodeContent; private String appletNodeContent;

View File

@ -118,7 +118,10 @@
spmrn.applet_push_sign, spmrn.applet_push_sign,
spmrn.node_content, spmrn.node_content,
spmrn.node_execute_status, spmrn.node_execute_status,
spmrn.applet_node_content spmrn.applet_node_content,
spmr.patient_id,
pi.patient_type,
pi.hospital_agency_name
from sign_patient_manage_route_node spmrn from sign_patient_manage_route_node spmrn
LEFT JOIN sign_patient_manage_route spmr ON spmr.id = spmrn.manage_route_id LEFT JOIN sign_patient_manage_route spmr ON spmr.id = spmrn.manage_route_id
LEFT JOIN patient_info pi ON pi.id = spmr.patient_id LEFT JOIN patient_info pi ON pi.id = spmr.patient_id

View File

@ -35,7 +35,7 @@ public class subscribeTaskServiceImpl implements SubscribeTaskService {
*/ */
public void signPatientManageRouteNodeTask() { public void signPatientManageRouteNodeTask() {
//微信小程序订阅消息记录表 //微信小程序订阅消息记录表
List<PatientVO> patient = homePageMapper.selectResidentAndSubscribeMessageRecord(SubscribeStatusEnum.accept.getValue(), weChatAppletChatConfig.getFollowTemplateId()); List<PatientVO> patient = homePageMapper.selectResidentAndSubscribeMessageRecord(SubscribeStatusEnum.accept.getValue(), weChatAppletChatConfig.getHealthyPropagandaId());
List<Long> collect = patient.stream().filter(Objects::nonNull).map(PatientVO::getPatientId).filter(Objects::nonNull).collect(Collectors.toList()); List<Long> collect = patient.stream().filter(Objects::nonNull).map(PatientVO::getPatientId).filter(Objects::nonNull).collect(Collectors.toList());
if (CollectionUtils.isEmpty(collect)) { if (CollectionUtils.isEmpty(collect)) {
return; return;
@ -49,7 +49,7 @@ public class subscribeTaskServiceImpl implements SubscribeTaskService {
continue; continue;
} }
//判断路径节点组装数据 //判断路径节点组装数据
if (signPatientManageRouteNode.getRouteNodeName().equals(RouteNodeNameEnum.AFTER_DISCHARGE.getInfo()) || signPatientManageRouteNode.getRouteNodeName().equals(RouteNodeNameEnum.AFTER_VISIT_DISCHARGE.getInfo())) { if (signPatientManageRouteNode.getRouteNodeName().equals(RouteNodeNameEnum.AFTER_DISCHARGE.getName()) || signPatientManageRouteNode.getRouteNodeName().equals(RouteNodeNameEnum.AFTER_VISIT_DISCHARGE.getName())) {
PatientVO patientVO = patient.stream().filter(Objects::nonNull).filter(item -> signPatientManageRouteNode.getPatientId().equals(item.getPatientId())).findFirst().orElse(new PatientVO()); 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())) { if (patientVO.getPatientType().equals(PatientTypeEnum.DISCHARGED_PATIENT.getInfo())) {
LocalDate localDate = patientVO.getDischargeTime().plusDays(signPatientManageRouteNode.getRouteNodeDay()); LocalDate localDate = patientVO.getDischargeTime().plusDays(signPatientManageRouteNode.getRouteNodeDay());
@ -60,7 +60,7 @@ public class subscribeTaskServiceImpl implements SubscribeTaskService {
} }
} }
} }
if (signPatientManageRouteNode.getRouteNodeName().equals(RouteNodeNameEnum.AFTER_ADMISSION.getInfo())) { if (signPatientManageRouteNode.getRouteNodeName().equals(RouteNodeNameEnum.AFTER_ADMISSION.getName())) {
PatientVO patientVO = patient.stream().filter(Objects::nonNull).filter(item -> signPatientManageRouteNode.getPatientId().equals(item.getPatientId())).findFirst().orElse(new PatientVO()); 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())) { if (patientVO.getPatientType().equals(PatientTypeEnum.IN_HOSPITAL_PATIENT.getInfo())) {
LocalDate localDate = patientVO.getAdmissionTime().plusDays(signPatientManageRouteNode.getRouteNodeDay()); LocalDate localDate = patientVO.getAdmissionTime().plusDays(signPatientManageRouteNode.getRouteNodeDay());
@ -71,9 +71,9 @@ public class subscribeTaskServiceImpl implements SubscribeTaskService {
} }
} }
} }
if (signPatientManageRouteNode.getRouteNodeName().equals(RouteNodeNameEnum.AFTER_CONSULTATION.getInfo()) || signPatientManageRouteNode.getRouteNodeName().equals(RouteNodeNameEnum.AFTER_VISIT_DISCHARGE.getInfo())) { if (signPatientManageRouteNode.getRouteNodeName().equals(RouteNodeNameEnum.AFTER_CONSULTATION.getName()) || signPatientManageRouteNode.getRouteNodeName().equals(RouteNodeNameEnum.AFTER_VISIT_DISCHARGE.getName())) {
PatientVO patientVO = patient.stream().filter(Objects::nonNull).filter(item -> signPatientManageRouteNode.getPatientId().equals(item.getPatientId())).findFirst().orElse(new PatientVO()); 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.getDischargeTime() == null) { if (patientVO.getPatientType().equals(PatientTypeEnum.OUTPATIENT.getInfo()) && patientVO.getAdmissionTime() == null) {
LocalDate localDate = patientVO.getVisitDate().plusDays(signPatientManageRouteNode.getRouteNodeDay()); LocalDate localDate = patientVO.getVisitDate().plusDays(signPatientManageRouteNode.getRouteNodeDay());
boolean before = localDate.isEqual(LocalDate.now()); boolean before = localDate.isEqual(LocalDate.now());
if (before) { if (before) {