定时任务修改患者签约服务包到期状态;患者任务节点查询接口。

This commit is contained in:
haown 2024-04-11 17:21:06 +08:00
parent 954935e6f4
commit fb9df1c0d4
9 changed files with 115 additions and 7 deletions

View File

@ -3,6 +3,7 @@ package com.xinelu.manage.controller.signpatientmanageroutenode;
import com.xinelu.common.core.controller.BaseController;
import com.xinelu.common.core.domain.R;
import com.xinelu.common.core.page.TableDataInfo;
import com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRouteNode;
import com.xinelu.manage.dto.signpatientmanageroutenode.PatientTaskDto;
import com.xinelu.manage.dto.signpatientmanageroutenode.RouteNodeCheckDto;
import com.xinelu.manage.service.signpatientmanageroutenode.ISignPatientManageRouteNodeService;
@ -42,6 +43,16 @@ public class SignPatientManageRouteNodeController extends BaseController {
return getDataTable(list);
}
/**
* 查询患者任务节点列表
*/
@ApiOperation("查询患者任务节点列表")
@GetMapping("/getNodeList")
public R<List<SignPatientManageRouteNode>> getNodeList(PatientTaskDto patientTaskDto) {
List<SignPatientManageRouteNode> list = signNodeService.getNodeList(patientTaskDto);
return R.ok(list);
}
/**
* 查询管理任务路径及节点
*/

View File

@ -67,4 +67,8 @@ public class PatientTaskDto {
@ApiModelProperty(value = "患者姓名")
private String patientName;
/** 任务类型电话外呼PHONE_OUTBOUND问卷量表QUESTIONNAIRE_SCALE宣教文章PROPAGANDA_ARTICLE文字提醒TEXT_REMIND人工随访ARTIFICIAL_FOLLOW_UP */
@ApiModelProperty(value = "任务类型电话外呼PHONE_OUTBOUND问卷量表QUESTIONNAIRE_SCALE宣教文章PROPAGANDA_ARTICLE文字提醒TEXT_REMIND人工随访ARTIFICIAL_FOLLOW_UP")
private String taskType;
}

View File

@ -6,8 +6,6 @@ import com.xinelu.manage.vo.signpatientmanageroutenode.PatientTaskVo;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 签约患者管理任务路径节点Mapper接口
*
@ -23,6 +21,13 @@ public interface SignPatientManageRouteNodeMapper {
*/
public SignPatientManageRouteNode selectSignPatientManageRouteNodeById(Long id);
/**
* 查询患者管理路径节点
* @param patientTaskDto 任务查询传输对象
* @return 患者管理任务路径节点
*/
List<SignPatientManageRouteNode> getNodeList(PatientTaskDto patientTaskDto);
/**
* 查询签约患者管理任务路径节点列表
*

View File

@ -24,7 +24,14 @@ public interface ISignPatientManageRouteNodeService {
public SignPatientManageRouteNode selectSignPatientManageRouteNodeById(Long id);
/**
* 根据患者管理路径节点
* 查询患者管理路径节点
* @param patientTaskDto 任务查询传输对象
* @return 患者管理任务路径节点
*/
List<SignPatientManageRouteNode> getNodeList(PatientTaskDto patientTaskDto);
/**
* 查询患者管理路径节点
*
* @param patientTaskDto 任务查询传输对象
* @return 患者管理任务路径节点

View File

@ -46,6 +46,13 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage
return signPatientManageRouteNodeMapper.selectSignPatientManageRouteNodeById(id);
}
@Override public List<SignPatientManageRouteNode> getNodeList(PatientTaskDto patientTaskDto) {
if (patientTaskDto.getPatientId() == null) {
throw new ServiceException("患者信息有误");
}
return signPatientManageRouteNodeMapper.getNodeList(patientTaskDto);
}
@Override public List<SignPatientManageRouteNodeVo> getRouteNodeList(PatientTaskDto patientTaskDto) {
List<SignPatientManageRouteNodeVo> retList = new ArrayList<>();
PatientInfo patientInfo = patientInfoMapper.selectPatientInfoById(patientTaskDto.getPatientId());

View File

@ -189,6 +189,11 @@ public class SignPatientListVo {
@ApiModelProperty(value = "服务包名称")
private String packageName;
/** 服务结束时间格式yyyy-MM-dd HH:mm:ss */
@ApiModelProperty(value = "服务结束时间格式yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd")
private LocalDate serviceEndTime;
/** 服务周期 */
@ApiModelProperty(value = "服务周期")
private Integer packageTerm;

View File

@ -96,12 +96,38 @@
</where>
</select>
<select id="selectSignPatientManageRouteNodeById" parameterType="Long"
resultMap="SignPatientManageRouteNodeResult">
<include refid="selectSignPatientManageRouteNodeVo"/>
where id = #{id}
<select id="selectSignPatientManageRouteNodeById" parameterType="Long" resultMap="SignPatientManageRouteNodeResult">
<include refid="selectSignPatientManageRouteNodeVo"/>
where id = #{id}
</select>
<select id="getNodeList" parameterType="com.xinelu.manage.dto.signpatientmanageroutenode.PatientTaskDto"
resultMap="SignPatientManageRouteNodeResult">
select node.id, node.manage_route_id, node.manage_route_name, node.route_node_name, node.route_node_day, node.task_type,
node.task_status, node.task_subdivision,node.second_classify_describe, node.execute_time, node.phone_push_sign, node.phone_id,
node.phone_template_id, node.phone_template_name, node.phone_node_content, node.phone_redial_times, node.phone_time_interval,
node.phone_message_remind, node.phone_message_template_id, node.phone_message_template_name,
node.question_info_id, node.questionnaire_name, node.questionnaire_content, node.question_expiration_date,
node.propaganda_info_id, node.propaganda_title, node.propaganda_content,
node.message_push_sign, node.message_template_id, node.message_template_name,node.message_preview, node.message_node_content,
node.official_push_sign, node.official_template_id, node.official_template_name, node.official_remind_content, node.official_node_content,
node.applet_push_sign, node.applet_template_id, node.applet_template_name, node.applet_remind_content, node.applet_prompt_description, node.applet_node_content,
node.follow_template_id, node.follow_template_name, node.follow_content,
node.route_check_status, node.route_check_person, node.route_check_date, node.route_check_remark, node.route_node_remark,
node.node_execute_status, node.route_handle_remark, node.route_handle_id, node.route_handle_person, node.route_link,node.text_remind_content
from sign_patient_manage_route_node node
left join sign_patient_manage_route route on node.manage_route_id = route.id
<where>
<if test="patientId != null">
and route.patient_id = #{patientId}
</if>
<if test="taskType != null and taskType != ''">
and node.task_type = #{taskType}
</if>
</where>
order by node.id desc
</select>
<insert id="insertSignPatientManageRouteNode" parameterType="SignPatientManageRouteNode" useGeneratedKeys="true"
keyProperty="id">
insert into sign_patient_manage_route_node

View File

@ -32,6 +32,10 @@
<groupId>com.xinelu</groupId>
<artifactId>postdischarge-common</artifactId>
</dependency>
<dependency>
<groupId>com.xinelu</groupId>
<artifactId>postdischarge-manage</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -1,5 +1,16 @@
package com.xinelu.quartz.task;
import com.xinelu.common.constant.SignRecordServiceStatusConstants;
import com.xinelu.manage.domain.patientinfo.PatientInfo;
import com.xinelu.manage.domain.signpatientrecord.SignPatientRecord;
import com.xinelu.manage.dto.signpatientrecord.SignPatientListDto;
import com.xinelu.manage.mapper.patientinfo.PatientInfoMapper;
import com.xinelu.manage.mapper.signpatientrecord.SignPatientRecordMapper;
import com.xinelu.manage.service.signpatientrecord.ISignPatientRecordService;
import com.xinelu.manage.vo.signpatientrecord.SignPatientListVo;
import java.time.LocalDateTime;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Component;
/**
@ -9,7 +20,35 @@ import org.springframework.stereotype.Component;
**/
@Component("SignPackageExpireTask")
public class SignPackageExpireTask {
@Resource
private ISignPatientRecordService signPatientRecordService;
@Resource
private SignPatientRecordMapper signPatientRecordMapper;
@Resource
private PatientInfoMapper patientInfoMapper;
public void SignPackageExpireTask() {
// 查询签约患者
SignPatientListDto signPatientListDto = new SignPatientListDto();
signPatientListDto.setSignStatus(SignRecordServiceStatusConstants.SERVICE_CENTER);
List<SignPatientListVo> signRecordList = signPatientRecordService.selectList(signPatientListDto);
for (SignPatientListVo sign : signRecordList) {
// 当前日期与服务到期日期比较
if (sign.getServiceEndTime().isBefore(LocalDateTime.now().toLocalDate())) {
SignPatientRecord signPatientRecord = new SignPatientRecord();
signPatientRecord.setId(sign.getId());
signPatientRecord.setServiceStatus(SignRecordServiceStatusConstants.SERVICE_END);
signPatientRecord.setSignStatus(SignRecordServiceStatusConstants.EXPIRE_SIGN);
signPatientRecordMapper.updateByPrimaryKeySelective(signPatientRecord);
// 修改患者表签约状态
PatientInfo patientInfo = new PatientInfo();
patientInfo.setId(sign.getPatientId());
patientInfo.setSignStatus(SignRecordServiceStatusConstants.EXPIRE_SIGN);
patientInfo.setServiceStatus(SignRecordServiceStatusConstants.SERVICE_END);
patientInfoMapper.updatePatientInfo(patientInfo);
}
}
}
}