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")
public List<LabelFieldTreeVO> labelFieldList(String fieldType) {
return labelFieldInfoService.labelFieldList(fieldType);
public List<LabelFieldTreeVO> labelFieldList(Long taskPartitionDictId, String fieldType) {
return labelFieldInfoService.labelFieldList(taskPartitionDictId, fieldType);
}
/**

View File

@ -36,7 +36,7 @@ public interface LabelFieldInfoMapper {
* @param fieldType 标签字段信息
* @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
*/
List<GroupingValue> selectLabelFieldInfoByTaskPartitionDictId(Long taskPartitionDictId);
@ -98,7 +98,7 @@ public interface LabelFieldInfoMapper {
/**
* 查询标签
*
* @param taskPartitionDictIds 标签
* @param taskPartitionDictIds 标签
* @return LabelFieldVO
*/
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);
/**
* 根据电话号码和居民姓名查询居民基本信息
*
* @param phone 手机号
* @param patientName 姓名
* @return 居民基本信息
*/
List<ResidentInfo> getResidentInfoByPhoneAndName(@Param("phone") String phone, @Param("patientName") String patientName);
}

View File

@ -36,7 +36,7 @@ public interface ILabelFieldInfoService {
* @param fieldType 字段类型
* @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
*/
@Override
public List<LabelFieldTreeVO> labelFieldList(String fieldType) {
public List<LabelFieldTreeVO> labelFieldList(Long taskPartitionDictId, String fieldType) {
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());
if (taskPartitionDictIds.size() == 0) {
return new ArrayList<>();

View File

@ -347,6 +347,7 @@
from label_field_info lfi
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_type_dict ttd on ttd.id = tpd.task_type_id
where 1=1
<if test="taskPartitionDictId != null and taskPartitionDictId != 0">
and lfi.task_partition_dict_id = #{taskPartitionDictId}
@ -360,7 +361,7 @@
<if test="portraitStatus != null">
and lfc.portrait_status = #{portraitStatus}
</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>
<insert id="insertLabelFieldContentList">

View File

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

View File

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

View File

@ -18,6 +18,7 @@ import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@ -197,7 +198,7 @@ public class WeChatOfficialAccountUtils {
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());
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();
}
//获取微信小程序的accessToken
@ -207,12 +208,12 @@ public class WeChatOfficialAccountUtils {
Map<String, Object> paramsMap = new LinkedHashMap<>();
paramsMap.put("touser", patientVO.getOpenId());
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<>();
dataMap.put("thing5", new MessageValueEntity(thing5));
dataMap.put("thing4", new MessageValueEntity(patientVO.getHospitalName()));
dataMap.put("time3", new MessageValueEntity(now.getYear() + "" + now.getMonthValue() + "" + now.getDayOfMonth() + "" + now.getHour() + ":" + now.getSecond()));
dataMap.put("thing6", new MessageValueEntity(patientVO.getRouteNodeName() + "" + patientVO.getRouteNodeDay()));
dataMap.put("thing4", new MessageValueEntity(patientVO.getHospitalAgencyName()));
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("thing1", new MessageValueEntity(thing1));
paramsMap.put("data", dataMap);
//拼接请求地址并发送

View File

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

View File

@ -118,7 +118,10 @@
spmrn.applet_push_sign,
spmrn.node_content,
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
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

View File

@ -35,7 +35,7 @@ public class subscribeTaskServiceImpl implements SubscribeTaskService {
*/
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());
if (CollectionUtils.isEmpty(collect)) {
return;
@ -49,7 +49,7 @@ public class subscribeTaskServiceImpl implements SubscribeTaskService {
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());
if (patientVO.getPatientType().equals(PatientTypeEnum.DISCHARGED_PATIENT.getInfo())) {
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());
if (patientVO.getPatientType().equals(PatientTypeEnum.IN_HOSPITAL_PATIENT.getInfo())) {
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());
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());
boolean before = localDate.isEqual(LocalDate.now());
if (before) {