专病路径发布、小程序消息列表

This commit is contained in:
zhangheng 2024-06-03 16:45:15 +08:00
parent 9a1ead4f48
commit 071b5a042f
11 changed files with 104 additions and 10 deletions

View File

@ -153,7 +153,7 @@ public class CommonController {
// 上传文件路径
String filePath = SystemBusinessConfig.getProfile() + systemBusinessConfig.getRichTextPictureUrl();
// 上传并返回新文件名称
String fileName = FileUploadUtils.upload(filePath, file, MimeTypeUtils.IMAGE_EXTENSION);
String fileName = FileUploadUtils.upload(filePath, file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION);
//拼接路径
String url = serverConfig.getUrl() + fileName;
AjaxResult ajax = AjaxResult.success();

View File

@ -0,0 +1,23 @@
package com.xinelu.common.enums;
import lombok.Getter;
@Getter
public enum MessageStatusEnum {
/**
* 未读
*/
READ("READ"),
/**
* 已读
*/
UNREAD("UNREAD"),
;
final private String info;
MessageStatusEnum(String info) {
this.info = info;
}
}

View File

@ -327,4 +327,7 @@ public class SignPatientManageRouteNode extends BaseEntity {
/** 删除标识0未删除1已删除 */
@ApiModelProperty(value = "删除标识0未删除1已删除")
private Integer delFlag;
@ApiModelProperty(value = "消息状态已读READ未读UNREAD。")
private String messageStatus;
}

View File

@ -88,4 +88,7 @@ public interface SignPatientManageRouteNodeMapper {
*/
List<PatientTaskVo> selectPatientTaskList(PatientTaskDto patientTaskDto);
List<SignPatientManageRouteNode> selectManageRouteByResidentId(Long residentId);
String selectNodeContent(Long id);
}

View File

@ -91,8 +91,7 @@ public interface SpecialDiseaseRouteMapper {
* 查询未审核节点状态
*
* @param routeId 路径信息
* @param routeCheckStatus 节点状态
* @return int
*/
int selectRouteCheckStatus(@Param("routeId") Long routeId, @Param("routeCheckStatus") String routeCheckStatus);
List<String> selectRouteCheckStatus(Long routeId);
}

View File

@ -225,9 +225,17 @@ public class SpecialDiseaseRouteServiceImpl implements ISpecialDiseaseRouteServi
return AjaxResult.error("请选择需要发布专病路径的信息!");
}
if (ReleaseStatusEnum.PUBLISHED.getInfo().equals(specialDiseaseRoute.getReleaseStatus())) {
int count = specialDiseaseRouteMapper.selectRouteCheckStatus(specialDiseaseRoute.getId(), RouteCheckStatusEnum.AGREE.getInfo());
if (count >= 0) {
return AjaxResult.error("该路径无节点或存在未审核的节点,请全部审核后发布!");
List<String> strings = specialDiseaseRouteMapper.selectRouteCheckStatus(specialDiseaseRoute.getId());
if (CollectionUtils.isEmpty(strings)) {
return AjaxResult.error("该路径无节点,请先增加节点并审核通过后发布!");
}
for (String string : strings) {
if (string == null) {
return AjaxResult.error("该路径存在未审核通过的节点,请全部审核通过后发布!");
}
if (!RouteCheckStatusEnum.AGREE.getInfo().equals(string)) {
return AjaxResult.error("该路径存在未审核通过的节点,请全部审核通过后发布!");
}
}
}
if (ReleaseStatusEnum.UNPUBLISHED.getInfo().equals(specialDiseaseRoute.getReleaseStatus())) {

View File

@ -64,6 +64,7 @@
<result property="routeLink" column="route_link"/>
<result property="textRemindContent" column="text_remind_content"/>
<result property="nodeContent" column="node_content"/>
<result property="messageStatus" column="message_status"/>
<result property="delFlag" column="del_flag"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
@ -72,7 +73,7 @@
</resultMap>
<sql id="selectSignPatientManageRouteNodeVo">
select id, manage_route_id, manage_route_name, route_node_id, route_node_name, route_node_day, task_type, task_status, task_subdivision, second_classify_describe, execute_time, phone_push_sign, phone_id, phone_template_id, phone_template_name, phone_node_content, phone_redial_times, phone_time_interval, phone_message_remind, phone_message_template_id, phone_message_template_name, question_info_id, questionnaire_name, questionnaire_content, question_expiration_date, propaganda_info_id, propaganda_title, propaganda_content, message_push_sign, message_template_id, message_template_name, message_preview, message_node_content, official_push_sign, official_template_id, official_template_name, official_remind_content, official_node_content, applet_push_sign, applet_template_id, applet_template_name, applet_remind_content, applet_prompt_description, applet_node_content, follow_template_id, follow_template_name, follow_content, route_check_status, route_check_person, route_check_date, route_check_remark, route_node_remark, node_execute_status, route_handle_remark, route_handle_id, route_handle_person, route_link,text_remind_content, node_content, del_flag, create_by, create_time, update_by, update_time from sign_patient_manage_route_node
select id, manage_route_id, manage_route_name, route_node_id, route_node_name, route_node_day, task_type, task_status, task_subdivision, second_classify_describe, execute_time, phone_push_sign, phone_id, phone_template_id, phone_template_name, phone_node_content, phone_redial_times, phone_time_interval, phone_message_remind, phone_message_template_id, phone_message_template_name, question_info_id, questionnaire_name, questionnaire_content, question_expiration_date, propaganda_info_id, propaganda_title, propaganda_content, message_push_sign, message_template_id, message_template_name, message_preview, message_node_content, official_push_sign, official_template_id, official_template_name, official_remind_content, official_node_content, applet_push_sign, applet_template_id, applet_template_name, applet_remind_content, applet_prompt_description, applet_node_content, follow_template_id, follow_template_name, follow_content, route_check_status, route_check_person, route_check_date, route_check_remark, route_node_remark, node_execute_status, route_handle_remark, route_handle_id, route_handle_person, route_link,text_remind_content, node_content,message_status, del_flag, create_by, create_time, update_by, update_time from sign_patient_manage_route_node
</sql>
<select id="selectSignPatientManageRouteNodeList" parameterType="com.xinelu.manage.dto.signpatientmanageroutenode.SignPatientManageRouteNodeDto" resultMap="SignPatientManageRouteNodeResult">
@ -742,4 +743,27 @@
</where>
group by patient.hospital_agency_id, patient.id
</select>
<select id="selectManageRouteByResidentId"
resultType="com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRouteNode">
select spmrn.id,
spmrn.manage_route_name,
spmrn.route_node_name,
spmrn.route_node_day,
spmrn.update_time
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
where pi.resident_id = #{residentId}
and spmrn.node_execute_status = #{nodeExecuteStatus}
and spmrn.del_flag = 0
and pi.del_flag = 0
Order BY spmrn.update_time DESC
</select>
<select id="selectNodeContent" resultType="java.lang.String">
select node_content
from sign_patient_manage_route_node
where id = #{id}
</select>
</mapper>

View File

@ -414,10 +414,9 @@
where sdr.id = #{id}
</select>
<select id="selectRouteCheckStatus" resultType="java.lang.Integer">
select COUNT(1)
<select id="selectRouteCheckStatus" resultType="java.lang.String">
select route_check_status
from special_disease_node
where route_id = #{routeId}
and route_check_status != #{routeCheckStatus}
</select>
</mapper>

View File

@ -90,4 +90,14 @@ public class HomePageController extends BaseController {
public AjaxResult subscriptionMessage(Long id){
return homePageService.subscriptionMessage(id);
}
@GetMapping("/messageNotification")
public AjaxResult selectSignPatientManageRouteNode(Long residentId){
return homePageService.selectSignPatientManageRouteNode(residentId);
}
@GetMapping("/updateMessageStatus")
private AjaxResult updateMessageStatus(Long manageRouteNodeId){
return homePageService.updateMessageStatus(manageRouteNodeId);
}
}

View File

@ -74,4 +74,8 @@ public interface HomePageService {
* @return AjaxResult
*/
AjaxResult subscriptionMessage(Long id);
AjaxResult selectSignPatientManageRouteNode(Long residentId);
AjaxResult updateMessageStatus(Long manageRouteNodeId);
}

View File

@ -16,6 +16,7 @@ import com.xinelu.manage.domain.patienttaskexecuterecord.PatientTaskExecuteRecor
import com.xinelu.manage.domain.questioninfo.QuestionInfo;
import com.xinelu.manage.domain.questionsubject.QuestionSubject;
import com.xinelu.manage.domain.scriptInfo.ScriptInfo;
import com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRouteNode;
import com.xinelu.manage.dto.patientquestionoptionresult.PatientQuestionOptionResultDTO;
import com.xinelu.manage.dto.patientquestionsubjectresult.PatientQuestionSubjectResultDTO;
import com.xinelu.manage.dto.patientquestionsubmitresult.PatientQuestionSubmitResultDTO;
@ -36,6 +37,7 @@ import com.xinelu.mobile.vo.myfollowup.MyFollowUpVO;
import com.xinelu.mobile.vo.satisfactionquestionnaire.SatisfactionQuestionnaire;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -261,4 +263,23 @@ public class HomePageServiceImpl implements HomePageService {
}
return AjaxResult.success(signPatientManageRouteNodeMapper.selectSignPatientManageRouteNodeById(id));
}
@Override
public AjaxResult selectSignPatientManageRouteNode(Long residentId) {
List<SignPatientManageRouteNode> signPatientManageRouteNodes = signPatientManageRouteNodeMapper.selectManageRouteByResidentId(residentId);
if (CollectionUtils.isEmpty(signPatientManageRouteNodes)) {
return AjaxResult.success(new ArrayList<>());
}
for (SignPatientManageRouteNode manageRouteNode : signPatientManageRouteNodes) {
if (Objects.nonNull(manageRouteNode) && StringUtils.isNotBlank(manageRouteNode.getManageRouteName()) && StringUtils.isNotBlank(manageRouteNode.getRouteNodeName()) && Objects.nonNull(manageRouteNode.getRouteNodeDay())) {
manageRouteNode.setRouteNodeName(manageRouteNode.getManageRouteName() + manageRouteNode.getRouteNodeName() + manageRouteNode.getRouteNodeDay() + "");
}
}
return AjaxResult.success(signPatientManageRouteNodes);
}
@Override
public AjaxResult updateMessageStatus(Long manageRouteNodeId) {
return AjaxResult.success(signPatientManageRouteNodeMapper.selectNodeContent(manageRouteNodeId));
}
}