消息推送修改
This commit is contained in:
parent
ee6cf0ea77
commit
d89006ccc3
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -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);
|
||||
|
||||
/**
|
||||
* 新增标签字段信息
|
||||
|
||||
@ -36,7 +36,7 @@ public interface ILabelFieldInfoService {
|
||||
* @param fieldType 字段类型
|
||||
* @return AjaxResult
|
||||
*/
|
||||
List<LabelFieldTreeVO> labelFieldList(String fieldType);
|
||||
List<LabelFieldTreeVO> labelFieldList(Long taskPartitionDictId, String fieldType);
|
||||
|
||||
/**
|
||||
* 新增标签字段信息
|
||||
|
||||
@ -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<>();
|
||||
|
||||
@ -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">
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -72,6 +72,7 @@
|
||||
and template_type = #{templateType}
|
||||
</if>
|
||||
</where>
|
||||
order by task_partition_sort
|
||||
</select>
|
||||
|
||||
<select id="selectTaskPartitionDictById" parameterType="Long"
|
||||
|
||||
@ -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);
|
||||
//拼接请求地址并发送
|
||||
|
||||
@ -72,7 +72,7 @@ public class PatientVO {
|
||||
private Long signPatientManageRouteNodeId;
|
||||
|
||||
@ApiModelProperty(value = "医院名称")
|
||||
private String hospitalName;
|
||||
private String hospitalAgencyName;
|
||||
|
||||
@ApiModelProperty(value = "微信内容")
|
||||
private String appletNodeContent;
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user