消息推送修改

This commit is contained in:
zhangheng 2024-07-04 15:45:46 +08:00
parent ee6cf0ea77
commit d89006ccc3
11 changed files with 32 additions and 22 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);
/** /**
* 新增标签字段信息 * 新增标签字段信息

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

@ -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) {