Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	postdischarge-admin/src/main/resources/application.yml
#	postdischarge-common/src/main/java/com/xinelu/common/constant/Constants.java
This commit is contained in:
gognqingkai 2024-04-16 15:33:23 +08:00
commit 7cef1a057d
63 changed files with 1218 additions and 394 deletions

View File

@ -26,8 +26,6 @@ xinelu:
script-file-url: /scriptFileUrl script-file-url: /scriptFileUrl
# 获取管理端富文本的上传路径 # 获取管理端富文本的上传路径
rich-text-picture-url: /richTextPictureUrl rich-text-picture-url: /richTextPictureUrl
# 资讯富文本的上传路径
info-rich-text-picture-url: /infoRichTextPictureUrl
# 开发环境配置 # 开发环境配置
server: server:
@ -82,7 +80,7 @@ spring:
# 数据库索引 # 数据库索引
database: 6 database: 6
# 密码 # 密码
password: 123456 password: xinelu@6990
# 连接超时时间 # 连接超时时间
timeout: 10s timeout: 10s
lettuce: lettuce:
@ -105,7 +103,8 @@ token:
# 令牌有效期默认30分钟 # 令牌有效期默认30分钟
expireTime: 30 expireTime: 30
# 请求拦截白名单 # 请求拦截白名单
ant-matchers: /postDischarge/**,/testMobile/**,/mobile/** ant-matchers: /postDischarge/**,/testMobile/**
## MyBatis-Plus配置 ## MyBatis-Plus配置
mybatis-plus: mybatis-plus:
# 实体扫描多个package用逗号或者分号分隔 # 实体扫描多个package用逗号或者分号分隔

View File

@ -283,19 +283,4 @@ public class Constants {
* 成功 * 成功
*/ */
public static final int SUCCESS_ERROR_CODE = 0; public static final int SUCCESS_ERROR_CODE = 0;
/**
* 资讯分类编码前缀
*/
public static final String INFO_CATEGORY_CODE = "ICC";
/**
* 资讯编码前缀
*/
public static final String INFO_CODE = "IC";
/**
* 科室编码前缀
*/
public static final String DEPARTMENT_CODE = "HDC";
} }

View File

@ -1,18 +1,27 @@
package com.xinelu.common.enums; package com.xinelu.common.enums;
import lombok.Getter;
/** /**
* 节点执行状态枚举类 * 节点执行状态枚举类
* *
* @author haown * @author haown
* @date 2024-04-01 * @date 2024-04-01
*/ */
@Getter
public enum NodeExecuteStatusEnum { public enum NodeExecuteStatusEnum {
/** /**
* 已执行 * 已执行
*/ */
EXECUTED, EXECUTED("EXECUTED"),
/** /**
* 未执行 * 未执行
*/ */
UNEXECUTED UNEXECUTED("UNEXECUTED"),
;
final private String info;
NodeExecuteStatusEnum(String info) {
this.info = info;
}
} }

View File

@ -0,0 +1,29 @@
package com.xinelu.common.enums;
import lombok.Getter;
/**
* @Description 问卷类型
* @Author zh
* @Date 2024-04-15
*/
@Getter
public enum QuestionTypeEnum {
/**
* 普通问卷
*/
REGULAR_QUESTIONNAIRE("REGULAR_QUESTIONNAIRE"),
/**
* 满意度问卷
*/
SATISFACTION_QUESTIONNAIRE("SATISFACTION_QUESTIONNAIRE"),
;
final private String info;
QuestionTypeEnum(String info) {
this.info = info;
}
}

View File

@ -0,0 +1,29 @@
package com.xinelu.common.enums;
import lombok.Getter;
/**
* @Description 任务创建类型
* @Author zh
* @Date 2024-04-07
*/
@Getter
public enum TaskCreateTypeEnum {
/**
* 手动创建
*/
MANUAL_CREATE("MANUAL_CREATE"),
/**
* 自动匹配
*/
MANUAL_MATCHE("MANUAL_MATCHE"),
;
final private String info;
TaskCreateTypeEnum(String info) {
this.info = info;
}
}

View File

@ -85,6 +85,7 @@ public class PatientInfoController extends BaseController {
/** /**
* 修改患者信息 * 修改患者信息
*/ */
@ApiOperation("修改患者信息")
@PreAuthorize("@ss.hasPermi('manage:patientInfo:edit')") @PreAuthorize("@ss.hasPermi('manage:patientInfo:edit')")
@Log(title = "患者信息", businessType = BusinessType.UPDATE) @Log(title = "患者信息", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping

View File

@ -8,6 +8,7 @@ import com.xinelu.common.enums.BusinessType;
import com.xinelu.common.utils.poi.ExcelUtil; import com.xinelu.common.utils.poi.ExcelUtil;
import com.xinelu.manage.domain.patientquestionsubmitresult.PatientQuestionSubmitResult; import com.xinelu.manage.domain.patientquestionsubmitresult.PatientQuestionSubmitResult;
import com.xinelu.manage.service.patientquestionsubmitresult.IPatientQuestionSubmitResultService; import com.xinelu.manage.service.patientquestionsubmitresult.IPatientQuestionSubmitResultService;
import com.xinelu.manage.vo.patientquestionsubmitresult.SatisfactionSurveyVO;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -88,4 +89,23 @@ public class PatientQuestionSubmitResultController extends BaseController {
public AjaxResult remove(@PathVariable Long[] ids) { public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(patientQuestionSubmitResultService.deletePatientQuestionSubmitResultByIds(ids)); return toAjax(patientQuestionSubmitResultService.deletePatientQuestionSubmitResultByIds(ids));
} }
/**
* 满意度调查问卷列表
*/
@GetMapping("/satisfactionSurvey")
public TableDataInfo satisfactionSurvey(SatisfactionSurveyVO satisfactionSurvey) {
startPage();
List<SatisfactionSurveyVO> list = patientQuestionSubmitResultService.satisfactionSurvey(satisfactionSurvey);
return getDataTable(list);
}
/**
* 满意度调查问卷
*/
@GetMapping("/selectQuestionnaireResult")
public AjaxResult selectQuestionnaireResult(Long patientQuestionSubmitResultId) {
return patientQuestionSubmitResultService.selectQuestionnaireResult(patientQuestionSubmitResultId);
}
} }

View File

@ -72,7 +72,7 @@ public class QuestionInfoController extends BaseController {
@Log(title = "问卷基本信息", businessType = BusinessType.INSERT) @Log(title = "问卷基本信息", businessType = BusinessType.INSERT)
@PostMapping("/add") @PostMapping("/add")
public AjaxResult add(@RequestBody QuestionVO questionInfo) { public AjaxResult add(@RequestBody QuestionVO questionInfo) {
if (Objects.isNull(questionInfo) || StringUtils.isBlank(questionInfo.getQuestionnaireName())) { if (Objects.isNull(questionInfo) || StringUtils.isBlank(questionInfo.getQuestionnaireName()) || StringUtils.isBlank(questionInfo.getQuestionType())) {
return AjaxResult.error("请添加问卷信息!"); return AjaxResult.error("请添加问卷信息!");
} }
return questionInfoService.insertQuestionInfo(questionInfo); return questionInfoService.insertQuestionInfo(questionInfo);
@ -85,6 +85,9 @@ public class QuestionInfoController extends BaseController {
@Log(title = "问卷基本信息", businessType = BusinessType.UPDATE) @Log(title = "问卷基本信息", businessType = BusinessType.UPDATE)
@PostMapping("/edit") @PostMapping("/edit")
public AjaxResult edit(@RequestBody QuestionVO question) { public AjaxResult edit(@RequestBody QuestionVO question) {
if (Objects.isNull(question) || StringUtils.isBlank(question.getQuestionnaireName()) || StringUtils.isBlank(question.getQuestionType())) {
return AjaxResult.error("请添加问卷信息!");
}
return questionInfoService.updateQuestionInfo(question); return questionInfoService.updateQuestionInfo(question);
} }
@ -94,8 +97,8 @@ public class QuestionInfoController extends BaseController {
@PreAuthorize("@ss.hasPermi('system:question:remove')") @PreAuthorize("@ss.hasPermi('system:question:remove')")
@Log(title = "问卷基本信息", businessType = BusinessType.DELETE) @Log(title = "问卷基本信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long id) { public AjaxResult remove(@PathVariable Long ids) {
return toAjax(questionInfoService.deleteQuestionInfoById(id)); return toAjax(questionInfoService.deleteQuestionInfoById(ids));
} }
/** /**
@ -110,7 +113,7 @@ public class QuestionInfoController extends BaseController {
* 科室问卷数量 * 科室问卷数量
*/ */
@GetMapping("/departmentQuestionCount") @GetMapping("/departmentQuestionCount")
public AjaxResult departmentQuestionCount(String departmentName, String questionnaireStatus) { public AjaxResult departmentQuestionCount(String departmentName, String questionnaireStatus, String questionType) {
return questionInfoService.departmentQuestionCount(departmentName, questionnaireStatus); return questionInfoService.departmentQuestionCount(departmentName, questionnaireStatus, questionType);
} }
} }

View File

@ -118,6 +118,4 @@ public class SignPatientManageRouteController extends BaseController {
public AjaxResult addPatientQuestionResult(@RequestBody PatientQuestionSubmitResultDTO dto) { public AjaxResult addPatientQuestionResult(@RequestBody PatientQuestionSubmitResultDTO dto) {
return signPatientManageRouteService.addPatientQuestionResult(dto); return signPatientManageRouteService.addPatientQuestionResult(dto);
} }
} }

View File

@ -8,12 +8,12 @@ import com.xinelu.manage.dto.signpatientmanageroutenode.PatientTaskDto;
import com.xinelu.manage.dto.signpatientmanageroutenode.RouteNodeCheckDto; import com.xinelu.manage.dto.signpatientmanageroutenode.RouteNodeCheckDto;
import com.xinelu.manage.service.signpatientmanageroutenode.ISignPatientManageRouteNodeService; import com.xinelu.manage.service.signpatientmanageroutenode.ISignPatientManageRouteNodeService;
import com.xinelu.manage.vo.signpatientmanageroutenode.PatientTaskVo; import com.xinelu.manage.vo.signpatientmanageroutenode.PatientTaskVo;
import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageRouteNodeVo;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import java.util.List; import java.util.List;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -44,12 +44,22 @@ public class SignPatientManageRouteNodeController extends BaseController {
} }
/** /**
* 根据患者主键查询签约路径及节点 * 查询患者任务节点列表
*/ */
@ApiOperation("根据患者主键查询患者管理路径节点") @ApiOperation("查询患者任务节点列表")
@GetMapping("/getNodesByPatient/{patientId}") @GetMapping("/getNodeList")
public R<List<SignPatientManageRouteNode>> getNodesByPatient(@PathVariable("patientId") Long patientId) { public R<List<SignPatientManageRouteNode>> getNodeList(PatientTaskDto patientTaskDto) {
List<SignPatientManageRouteNode> list = signNodeService.getNodesByPatient(patientId); List<SignPatientManageRouteNode> list = signNodeService.getNodeList(patientTaskDto);
return R.ok(list);
}
/**
* 查询管理任务路径及节点
*/
@ApiOperation("查询管理任务路径及节点")
@GetMapping("/getRouteNodeList")
public R<List<SignPatientManageRouteNodeVo>> getRouteNodeList(PatientTaskDto patientTaskDto) {
List<SignPatientManageRouteNodeVo> list = signNodeService.getRouteNodeList(patientTaskDto);
return R.ok(list); return R.ok(list);
} }

View File

@ -123,6 +123,12 @@ public class QuestionInfo extends BaseEntity {
@Excel(name = "问卷备注信息") @Excel(name = "问卷备注信息")
private String questionnaireRemark; private String questionnaireRemark;
/**
* 问卷类型普通问卷REGULAR_QUESTIONNAIRE,满意度问卷SATISFACTION_QUESTIONNAIRE
*/
@ApiModelProperty(value = "问卷类型")
@Excel(name = "问卷类型")
private String questionType;
@Override @Override
public String toString() { public String toString() {

View File

@ -89,5 +89,8 @@ public class ManualFollowUpDTO {
@ApiModelProperty(value = "主治医生姓名") @ApiModelProperty(value = "主治医生姓名")
private String attendingPhysicianName; private String attendingPhysicianName;
@ApiModelProperty(value = "节点任务执行状态已执行EXECUTED未执行UNEXECUTED")
private String nodeExecuteStatus;
} }

View File

@ -28,6 +28,9 @@ public class PatientQuestionSubmitResultDTO extends PatientQuestionSubmitResult
@ApiModelProperty(value = "任务处理信息") @ApiModelProperty(value = "任务处理信息")
private String routeHandleRemark; private String routeHandleRemark;
@ApiModelProperty(value = "患者就诊记录基本信息表id")
private Long visitRecordId;
/** /**
* 患者问卷题目提交结果信息 * 患者问卷题目提交结果信息
*/ */

View File

@ -69,4 +69,11 @@ public class ServiceWayContentEditDTO {
@ApiModelProperty(value = "服务频次数字结束值") @ApiModelProperty(value = "服务频次数字结束值")
@Excel(name = "服务频次数字结束值") @Excel(name = "服务频次数字结束值")
private Integer serviceFrequencyEnd; private Integer serviceFrequencyEnd;
/**
* 排序
*/
@ApiModelProperty(value = "排序")
@Excel(name = "排序")
private Integer serviceSort;
} }

View File

@ -1,10 +1,10 @@
package com.xinelu.manage.dto.signpatientmanageroutenode; package com.xinelu.manage.dto.signpatientmanageroutenode;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import lombok.Data; import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
/** /**
* @description: 患者任务查询传输对象 * @description: 患者任务查询传输对象
@ -15,15 +15,29 @@ import lombok.Data;
@Data @Data
public class PatientTaskDto { public class PatientTaskDto {
/** 就诊时间格式yyyy-MM-dd HH:mm:ss */ /**
@ApiModelProperty(value = "就诊时间开始格式yyyy-MM-dd") * 患者主键
@JsonFormat(pattern = "yyyy-MM-dd") */
private LocalDateTime visitDateStart; @ApiModelProperty("患者主键")
private Long patientId;
/** 就诊时间格式yyyy-MM-dd HH:mm:ss */ /** 签约记录表id */
@ApiModelProperty(value = "就诊时间结束格式yyyy-MM-dd") @ApiModelProperty(value = "签约记录表id")
@JsonFormat(pattern = "yyyy-MM-dd") private Long signPatientRecordId;
private LocalDateTime visitDateEnd;
/** 任务创建类型手动创建MANUAL_CREATE自动匹配MANUAL_MATCHE */
@ApiModelProperty(value = "任务创建类型手动创建MANUAL_CREATE自动匹配MANUAL_MATCHE")
private String taskCreateType;
/** 出院时间开始格式yyyy-MM-dd HH:mm:ss */
@ApiModelProperty(value = "出院时间开始格式yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDateTime dischargeTimeStart;
/** 出院时间结束格式yyyy-MM-dd HH:mm:ss */
@ApiModelProperty(value = "出院时间结束格式yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDateTime dischargeTimeEnd;
/** 所属医院id */ /** 所属医院id */
@ApiModelProperty(value = "所属医院id") @ApiModelProperty(value = "所属医院id")
@ -53,4 +67,8 @@ public class PatientTaskDto {
@ApiModelProperty(value = "患者姓名") @ApiModelProperty(value = "患者姓名")
private String patientName; 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

@ -2,6 +2,8 @@ package com.xinelu.manage.mapper.patientquestionsubmitresult;
import com.xinelu.manage.domain.patientquestionsubmitresult.PatientQuestionSubmitResult; import com.xinelu.manage.domain.patientquestionsubmitresult.PatientQuestionSubmitResult;
import com.xinelu.manage.vo.patientquestionsubmitresult.PatientQuestionSubmitResultVO; import com.xinelu.manage.vo.patientquestionsubmitresult.PatientQuestionSubmitResultVO;
import com.xinelu.manage.vo.patientquestionsubmitresult.SatisfactionSurveyVO;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
@ -63,8 +65,17 @@ public interface PatientQuestionSubmitResultMapper {
/** /**
* 根据任务执行记录查询患者问卷信息 * 根据任务执行记录查询患者问卷信息
* *
* @param taskExecuteRecordId 患者管理任务执行记录表id * @param taskExecuteRecordId 患者管理任务执行记录表id
* @param patientQuestionSubmitResultId 患者问卷提交结果信息表
* @return PatientQuestionSubmitResultVO * @return PatientQuestionSubmitResultVO
*/ */
PatientQuestionSubmitResultVO selectResultByTaskExecuteRecordId(Long taskExecuteRecordId); PatientQuestionSubmitResultVO selectResultByTaskExecuteRecordId(@Param("taskExecuteRecordId") Long taskExecuteRecordId, @Param("patientQuestionSubmitResultId") Long patientQuestionSubmitResultId);
/**
* 满意度调查问卷列表
*
* @param satisfactionSurvey 居民信息
* @return AjaxResult
*/
List<SatisfactionSurveyVO> selectSatisfactionSurvey(SatisfactionSurveyVO satisfactionSurvey);
} }

View File

@ -69,5 +69,5 @@ public interface QuestionInfoMapper {
* @param questionnaireStatus 问卷状态 * @param questionnaireStatus 问卷状态
* @return DepartmentVO * @return DepartmentVO
*/ */
List<DepartmentVO> departmentQuestionByDepartmentName(@Param("departmentName") String departmentName, @Param("questionnaireStatus") String questionnaireStatus); List<DepartmentVO> departmentQuestionByDepartmentName(@Param("departmentName") String departmentName, @Param("questionnaireStatus") String questionnaireStatus, @Param("questionType") String questionType);
} }

View File

@ -1,6 +1,8 @@
package com.xinelu.manage.mapper.residentinfo; package com.xinelu.manage.mapper.residentinfo;
import com.xinelu.manage.domain.residentinfo.ResidentInfo; import com.xinelu.manage.domain.residentinfo.ResidentInfo;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
@ -17,7 +19,7 @@ public interface ResidentInfoMapper {
* @param id 居民信息主键 * @param id 居民信息主键
* @return 居民信息 * @return 居民信息
*/ */
public ResidentInfo selectResidentInfoById(Long id); ResidentInfo selectResidentInfoById(Long id);
/** /**
* 查询居民信息列表 * 查询居民信息列表
@ -58,4 +60,13 @@ public interface ResidentInfoMapper {
* @return 结果 * @return 结果
*/ */
int deleteResidentInfoByIds(Long[] ids); int deleteResidentInfoByIds(Long[] ids);
/**
* 根据电话号码和微信小程序openid查询居民基本信息
*
* @param phone 手机号
* @param openId 微信小程序openId
* @return 被护理人基本信息
*/
ResidentInfo getResidentInfoByPhoneAndOpenId(@Param("phone") String phone, @Param("openId") String openId);
} }

View File

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

View File

@ -17,7 +17,7 @@ public interface IPatientQuestionSubjectResultService {
* @param id 患者问卷题目提交结果信息主键 * @param id 患者问卷题目提交结果信息主键
* @return 患者问卷题目提交结果信息 * @return 患者问卷题目提交结果信息
*/ */
public PatientQuestionSubjectResult selectPatientQuestionSubjectResultById(Long id); PatientQuestionSubjectResult selectPatientQuestionSubjectResultById(Long id);
/** /**
* 查询患者问卷题目提交结果信息列表 * 查询患者问卷题目提交结果信息列表

View File

@ -1,6 +1,8 @@
package com.xinelu.manage.service.patientquestionsubmitresult; package com.xinelu.manage.service.patientquestionsubmitresult;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.manage.domain.patientquestionsubmitresult.PatientQuestionSubmitResult; import com.xinelu.manage.domain.patientquestionsubmitresult.PatientQuestionSubmitResult;
import com.xinelu.manage.vo.patientquestionsubmitresult.SatisfactionSurveyVO;
import java.util.List; import java.util.List;
@ -58,4 +60,20 @@ public interface IPatientQuestionSubmitResultService {
* @return 结果 * @return 结果
*/ */
int deletePatientQuestionSubmitResultById(Long id); int deletePatientQuestionSubmitResultById(Long id);
/**
* 满意度调查问卷列表
*
* @param satisfactionSurvey 居民信息
* @return AjaxResult
*/
List<SatisfactionSurveyVO> satisfactionSurvey(SatisfactionSurveyVO satisfactionSurvey);
/**
* 满意度调查问卷
*
* @param patientQuestionSubmitResultId 问卷信息
* @return AjaxResult
*/
AjaxResult selectQuestionnaireResult(Long patientQuestionSubmitResultId);
} }

View File

@ -1,8 +1,11 @@
package com.xinelu.manage.service.patientquestionsubmitresult.impl; package com.xinelu.manage.service.patientquestionsubmitresult.impl;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.enums.QuestionTypeEnum;
import com.xinelu.manage.domain.patientquestionsubmitresult.PatientQuestionSubmitResult; import com.xinelu.manage.domain.patientquestionsubmitresult.PatientQuestionSubmitResult;
import com.xinelu.manage.mapper.patientquestionsubmitresult.PatientQuestionSubmitResultMapper; import com.xinelu.manage.mapper.patientquestionsubmitresult.PatientQuestionSubmitResultMapper;
import com.xinelu.manage.service.patientquestionsubmitresult.IPatientQuestionSubmitResultService; import com.xinelu.manage.service.patientquestionsubmitresult.IPatientQuestionSubmitResultService;
import com.xinelu.manage.vo.patientquestionsubmitresult.SatisfactionSurveyVO;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
@ -87,4 +90,28 @@ public class PatientQuestionSubmitResultServiceImpl implements IPatientQuestionS
public int deletePatientQuestionSubmitResultById(Long id) { public int deletePatientQuestionSubmitResultById(Long id) {
return patientQuestionSubmitResultMapper.deletePatientQuestionSubmitResultById(id); return patientQuestionSubmitResultMapper.deletePatientQuestionSubmitResultById(id);
} }
/**
* 满意度调查问卷列表
*
* @param satisfactionSurvey 居民信息
* @return AjaxResult
*/
@Override
public List<SatisfactionSurveyVO> satisfactionSurvey(SatisfactionSurveyVO satisfactionSurvey) {
satisfactionSurvey.setQuestionType(QuestionTypeEnum.SATISFACTION_QUESTIONNAIRE.getInfo());
return patientQuestionSubmitResultMapper.selectSatisfactionSurvey(satisfactionSurvey);
}
/**
* 满意度调查问卷
*
* @param patientQuestionSubmitResultId 问卷信息
* @return AjaxResult
*/
@Override
public AjaxResult selectQuestionnaireResult(Long patientQuestionSubmitResultId) {
return AjaxResult.success(patientQuestionSubmitResultMapper.selectResultByTaskExecuteRecordId(null, patientQuestionSubmitResultId));
}
} }

View File

@ -1,22 +1,18 @@
package com.xinelu.manage.service.patienttaskexecuterecord.impl; package com.xinelu.manage.service.patienttaskexecuterecord.impl;
import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.enums.TaskContentEnum;
import com.xinelu.common.utils.AgeUtil; import com.xinelu.common.utils.AgeUtil;
import com.xinelu.manage.domain.patienttaskexecuterecord.PatientTaskExecuteRecord; import com.xinelu.manage.domain.patienttaskexecuterecord.PatientTaskExecuteRecord;
import com.xinelu.manage.mapper.patientquestionsubmitresult.PatientQuestionSubmitResultMapper; import com.xinelu.manage.mapper.patientquestionsubmitresult.PatientQuestionSubmitResultMapper;
import com.xinelu.manage.mapper.patienttaskexecuterecord.PatientTaskExecuteRecordMapper; import com.xinelu.manage.mapper.patienttaskexecuterecord.PatientTaskExecuteRecordMapper;
import com.xinelu.manage.service.patienttaskexecuterecord.IPatientTaskExecuteRecordService; import com.xinelu.manage.service.patienttaskexecuterecord.IPatientTaskExecuteRecordService;
import com.xinelu.manage.service.propagandainfo.IPropagandaInfoService; import com.xinelu.manage.service.propagandainfo.IPropagandaInfoService;
import com.xinelu.manage.vo.patientquestionsubmitresult.PatientQuestionSubmitResultVO;
import com.xinelu.manage.vo.patienttaskexecuterecord.PatientTaskExecuteRecordVO; import com.xinelu.manage.vo.patienttaskexecuterecord.PatientTaskExecuteRecordVO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
import java.util.Objects;
/** /**
* 患者管理任务执行记录Service业务层处理 * 患者管理任务执行记录Service业务层处理
@ -122,29 +118,6 @@ public class PatientTaskExecuteRecordServiceImpl implements IPatientTaskExecuteR
*/ */
@Override @Override
public AjaxResult selectPatientQuestionSubmit(Long taskExecuteRecordId) { public AjaxResult selectPatientQuestionSubmit(Long taskExecuteRecordId) {
//判断任务类型 return AjaxResult.success(submitResultMapper.selectResultByTaskExecuteRecordId(taskExecuteRecordId, null));
PatientTaskExecuteRecord patientTaskExecuteRecord = patientTaskExecuteRecordMapper.selectPatientTaskExecuteRecordById(taskExecuteRecordId);
if (Objects.isNull(patientTaskExecuteRecord) || StringUtils.isBlank(patientTaskExecuteRecord.getTaskContent())) {
return AjaxResult.success();
}
//如果是人工随访或问卷表
if (TaskContentEnum.ARTIFICIAL_FOLLOW_UP.getInfo().equals(patientTaskExecuteRecord.getTaskContent()) || TaskContentEnum.QUESTIONNAIRE_SCALE.getInfo().equals(patientTaskExecuteRecord.getTaskContent())) {
PatientQuestionSubmitResultVO patientQuestionSubmitResult = submitResultMapper.selectResultByTaskExecuteRecordId(taskExecuteRecordId);
patientQuestionSubmitResult.setTaskContent(patientTaskExecuteRecord.getTaskContent());
return AjaxResult.success(patientQuestionSubmitResult);
}
//如果是电话外呼
if (TaskContentEnum.PHONE_OUTBOUND.getInfo().equals(patientTaskExecuteRecord.getTaskContent())) {
return AjaxResult.success();
}
//如果是宣教文章
if (TaskContentEnum.PROPAGANDA_ARTICLE.getInfo().equals(patientTaskExecuteRecord.getTaskContent())) {
return AjaxResult.success();
}
if (TaskContentEnum.TEXT_REMIND.getInfo().equals(patientTaskExecuteRecord.getTaskContent())) {
return AjaxResult.success();
}
return AjaxResult.success();
} }
} }

View File

@ -75,5 +75,5 @@ public interface IQuestionInfoService {
* @param departmentName 科室名称 * @param departmentName 科室名称
* @return AjaxResult * @return AjaxResult
*/ */
AjaxResult departmentQuestionCount(String departmentName, String questionnaireStatus); AjaxResult departmentQuestionCount(String departmentName, String questionnaireStatus,String questionType);
} }

View File

@ -3,6 +3,7 @@ package com.xinelu.manage.service.questioninfo.impl;
import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.SecurityUtils;
import com.xinelu.common.utils.bean.BeanUtils; import com.xinelu.common.utils.bean.BeanUtils;
import com.xinelu.common.utils.uuid.IdUtils;
import com.xinelu.manage.domain.questioninfo.QuestionInfo; import com.xinelu.manage.domain.questioninfo.QuestionInfo;
import com.xinelu.manage.domain.questionsubject.QuestionSubject; import com.xinelu.manage.domain.questionsubject.QuestionSubject;
import com.xinelu.manage.domain.questionsubjectoption.QuestionSubjectOption; import com.xinelu.manage.domain.questionsubjectoption.QuestionSubjectOption;
@ -94,6 +95,7 @@ public class QuestionInfoServiceImpl implements IQuestionInfoService {
BeanUtils.copyBeanProp(questionInfo, question); BeanUtils.copyBeanProp(questionInfo, question);
questionInfo.setCreateTime(LocalDateTime.now()); questionInfo.setCreateTime(LocalDateTime.now());
questionInfo.setCreateBy(SecurityUtils.getUsername()); questionInfo.setCreateBy(SecurityUtils.getUsername());
questionInfo.setQuestionnaireId(IdUtils.fastUUID());
int questionCount = questionInfoMapper.insertQuestionInfo(questionInfo); int questionCount = questionInfoMapper.insertQuestionInfo(questionInfo);
if (questionCount <= 0) { if (questionCount <= 0) {
log.info("新增问卷表失败," + questionInfo); log.info("新增问卷表失败," + questionInfo);
@ -110,7 +112,9 @@ public class QuestionInfoServiceImpl implements IQuestionInfoService {
saveQuestionSubject.setCreateTime(LocalDateTime.now()); saveQuestionSubject.setCreateTime(LocalDateTime.now());
saveQuestionSubject.setCreateBy(SecurityUtils.getUsername()); saveQuestionSubject.setCreateBy(SecurityUtils.getUsername());
questionSubjects.add(saveQuestionSubject); questionSubjects.add(saveQuestionSubject);
questionSubjectOptions.addAll(questionSubject.getQuestionSubjectOptionList()); if (CollectionUtils.isNotEmpty(questionSubject.getQuestionSubjectOptionList())) {
questionSubjectOptions.addAll(questionSubject.getQuestionSubjectOptionList());
}
} }
int questionSubjectCount = questionSubjectMapper.insertQuestionSubjectList(questionSubjects); int questionSubjectCount = questionSubjectMapper.insertQuestionSubjectList(questionSubjects);
if (questionSubjectCount <= 0) { if (questionSubjectCount <= 0) {
@ -190,6 +194,9 @@ public class QuestionInfoServiceImpl implements IQuestionInfoService {
log.info("修改问卷题目表失败," + questionSubjects); log.info("修改问卷题目表失败," + questionSubjects);
throw new SecurityException("修改问卷失败!请联系管理员!"); throw new SecurityException("修改问卷失败!请联系管理员!");
} }
if (CollectionUtils.isEmpty(questionSubjectOptions)) {
return AjaxResult.success();
}
List<QuestionSubjectOption> saveQuestionSubjectOptions = new ArrayList<>(); List<QuestionSubjectOption> saveQuestionSubjectOptions = new ArrayList<>();
for (QuestionSubjectOptionVO questionSubjectOption : questionSubjectOptions) { for (QuestionSubjectOptionVO questionSubjectOption : questionSubjectOptions) {
QuestionSubjectOption saveQuestionSubjectOption = new QuestionSubjectOption(); QuestionSubjectOption saveQuestionSubjectOption = new QuestionSubjectOption();
@ -251,6 +258,7 @@ public class QuestionInfoServiceImpl implements IQuestionInfoService {
* @param questionInfo 问卷基本信息 * @param questionInfo 问卷基本信息
* @return 结果 * @return 结果
*/ */
@Transactional(rollbackFor = Exception.class)
@Override @Override
public AjaxResult updateQuestionByDepartment(QuestionInfo questionInfo) { public AjaxResult updateQuestionByDepartment(QuestionInfo questionInfo) {
if (Objects.isNull(questionInfo) || Objects.isNull(questionInfo.getId())) { if (Objects.isNull(questionInfo) || Objects.isNull(questionInfo.getId())) {
@ -290,12 +298,12 @@ public class QuestionInfoServiceImpl implements IQuestionInfoService {
* @return AjaxResult * @return AjaxResult
*/ */
@Override @Override
public AjaxResult departmentQuestionCount(String departmentName, String questionnaireStatus) { public AjaxResult departmentQuestionCount(String departmentName, String questionnaireStatus, String questionType) {
DepartmentVO departmentVO = new DepartmentVO(); DepartmentVO departmentVO = new DepartmentVO();
List<DepartmentVO> department = new ArrayList<>(); List<DepartmentVO> department = new ArrayList<>();
departmentVO.setDepartmentName("全部"); departmentVO.setDepartmentName("全部");
departmentVO.setCountNum(0); departmentVO.setCountNum(0);
List<DepartmentVO> departmentVOS = questionInfoMapper.departmentQuestionByDepartmentName(departmentName, questionnaireStatus); List<DepartmentVO> departmentVOS = questionInfoMapper.departmentQuestionByDepartmentName(departmentName, questionnaireStatus, questionType);
if (CollectionUtils.isNotEmpty(departmentVOS)) { if (CollectionUtils.isNotEmpty(departmentVOS)) {
Integer result = departmentVOS.stream().mapToInt(DepartmentVO::getCountNum).sum(); Integer result = departmentVOS.stream().mapToInt(DepartmentVO::getCountNum).sum();
departmentVO.setCountNum(result); departmentVO.setCountNum(result);

View File

@ -6,6 +6,7 @@ import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.SecurityUtils;
import com.xinelu.common.utils.file.FileUploadUtils; import com.xinelu.common.utils.file.FileUploadUtils;
import com.xinelu.common.utils.file.MimeTypeUtils; import com.xinelu.common.utils.file.MimeTypeUtils;
import com.xinelu.common.utils.uuid.IdUtils;
import com.xinelu.manage.domain.scriptInfo.ScriptInfo; import com.xinelu.manage.domain.scriptInfo.ScriptInfo;
import com.xinelu.manage.mapper.scriptInfo.ScriptInfoMapper; import com.xinelu.manage.mapper.scriptInfo.ScriptInfoMapper;
import com.xinelu.manage.service.scriptInfo.IScriptInfoService; import com.xinelu.manage.service.scriptInfo.IScriptInfoService;
@ -71,6 +72,7 @@ public class ScriptInfoServiceImpl implements IScriptInfoService {
// 设置创建人与创建时间 // 设置创建人与创建时间
scriptInfo.setCreateBy(SecurityUtils.getUsername()); scriptInfo.setCreateBy(SecurityUtils.getUsername());
scriptInfo.setCreateTime(LocalDateTime.now()); scriptInfo.setCreateTime(LocalDateTime.now());
scriptInfo.setScriptId(IdUtils.fastUUID());
return scriptInfoMapper.insertScriptInfo(scriptInfo); return scriptInfoMapper.insertScriptInfo(scriptInfo);
} }
@ -84,7 +86,7 @@ public class ScriptInfoServiceImpl implements IScriptInfoService {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public int updateScriptInfo(ScriptInfo scriptInfo) { public int updateScriptInfo(ScriptInfo scriptInfo) {
// 检查除当前记录之外是否存在同名的话术名称 // 检查除当前记录之外是否存在同名的话术名称
if (scriptInfoMapper.countByScriptNameExcludingId(scriptInfo.getScriptName(), scriptInfo.getDepartmentId(), scriptInfo.getId(),scriptInfo.getCommonScriptName()) > 0) { if (scriptInfoMapper.countByScriptNameExcludingId(scriptInfo.getScriptName(), scriptInfo.getDepartmentId(), scriptInfo.getId(), scriptInfo.getCommonScriptName()) > 0) {
// 存在同名的通用话术名称不能进行更新 // 存在同名的通用话术名称不能进行更新
throw new ServiceException("通用话术名称已存在,请使用其他名称。"); throw new ServiceException("通用话术名称已存在,请使用其他名称。");
} }

View File

@ -94,6 +94,7 @@ public class ServiceWayContentServiceImpl implements IServiceWayContentService {
serviceFrequency.setServiceFrequencyEnd(serviceWayContentAddDTO.getServiceFrequencyEnd()); serviceFrequency.setServiceFrequencyEnd(serviceWayContentAddDTO.getServiceFrequencyEnd());
serviceFrequency.setCreateBy(username); serviceFrequency.setCreateBy(username);
serviceFrequency.setCreateTime(LocalDateTime.now()); serviceFrequency.setCreateTime(LocalDateTime.now());
serviceFrequency.setServiceSort(serviceWayContentAddDTO.getServiceSort());
if (serviceWayContentMapper.insertServiceWayContent(serviceFrequency) <= 0) { if (serviceWayContentMapper.insertServiceWayContent(serviceFrequency) <= 0) {
throw new ServiceException("新增服务频次失败"); throw new ServiceException("新增服务频次失败");
} }
@ -119,6 +120,7 @@ public class ServiceWayContentServiceImpl implements IServiceWayContentService {
serviceFrequency.setCreateBy(username); serviceFrequency.setCreateBy(username);
serviceFrequency.setCreateTime(LocalDateTime.now()); serviceFrequency.setCreateTime(LocalDateTime.now());
serviceFrequency.setServiceSort(serviceWayContentAddDTO.getServiceSort()); serviceFrequency.setServiceSort(serviceWayContentAddDTO.getServiceSort());
serviceFrequency.setServiceSort(serviceWayContentAddDTO.getServiceSort());
if (serviceWayContentMapper.insertServiceWayContent(serviceFrequency) <= 0) { if (serviceWayContentMapper.insertServiceWayContent(serviceFrequency) <= 0) {
throw new ServiceException("新增服务频次失败"); throw new ServiceException("新增服务频次失败");
} }
@ -192,6 +194,7 @@ public class ServiceWayContentServiceImpl implements IServiceWayContentService {
currentFrequency.setServiceFrequencyText(serviceWayContentEditDTO.getServiceFrequencyText()); currentFrequency.setServiceFrequencyText(serviceWayContentEditDTO.getServiceFrequencyText());
currentFrequency.setServiceFrequencyStart(serviceWayContentEditDTO.getServiceFrequencyStart()); currentFrequency.setServiceFrequencyStart(serviceWayContentEditDTO.getServiceFrequencyStart());
currentFrequency.setServiceFrequencyEnd(serviceWayContentEditDTO.getServiceFrequencyEnd()); currentFrequency.setServiceFrequencyEnd(serviceWayContentEditDTO.getServiceFrequencyEnd());
currentFrequency.setServiceSort(serviceWayContentEditDTO.getServiceSort());
currentFrequency.setUpdateBy(username); currentFrequency.setUpdateBy(username);
currentFrequency.setUpdateTime(LocalDateTime.now()); currentFrequency.setUpdateTime(LocalDateTime.now());

View File

@ -23,7 +23,7 @@ public interface ISignPatientManageRouteService {
* @param id 签约患者管理任务路径主键 * @param id 签约患者管理任务路径主键
* @return 签约患者管理任务路径 * @return 签约患者管理任务路径
*/ */
SignPatientManageRoute selectSignPatientManageRouteById(Long id); SignPatientManageRouteVO selectSignPatientManageRouteById(Long id);
/** /**
* 查询签约患者管理任务路径列表 * 查询签约患者管理任务路径列表

View File

@ -4,6 +4,7 @@ import com.xinelu.common.constant.TaskCreateTypeConstant;
import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.enums.NodeExecuteStatusEnum; import com.xinelu.common.enums.NodeExecuteStatusEnum;
import com.xinelu.common.enums.TaskContentEnum; import com.xinelu.common.enums.TaskContentEnum;
import com.xinelu.common.enums.TaskCreateTypeEnum;
import com.xinelu.common.exception.ServiceException; import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.AgeUtil; import com.xinelu.common.utils.AgeUtil;
import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.SecurityUtils;
@ -32,6 +33,7 @@ import com.xinelu.manage.vo.manualfollowup.ManualFollowUpVO;
import com.xinelu.manage.vo.signpatientmanageroute.SignPatientManageRouteVO; import com.xinelu.manage.vo.signpatientmanageroute.SignPatientManageRouteVO;
import com.xinelu.manage.vo.signroutetriggercondition.SignRouteTriggerConditionVO; import com.xinelu.manage.vo.signroutetriggercondition.SignRouteTriggerConditionVO;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -72,8 +74,8 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
* @return 签约患者管理任务路径 * @return 签约患者管理任务路径
*/ */
@Override @Override
public SignPatientManageRoute selectSignPatientManageRouteById(Long id) { public SignPatientManageRouteVO selectSignPatientManageRouteById(Long id) {
return signPatientManageRouteMapper.selectSignPatientManageRouteById(id); return signPatientManageRouteMapper.selectSignPatientManageRoute(id);
} }
/** /**
@ -93,20 +95,24 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
* @param signPatientManageRoute 签约患者管理任务路径 * @param signPatientManageRoute 签约患者管理任务路径
* @return 结果 * @return 结果
*/ */
@Transactional(rollbackFor = Exception.class)
@Override @Override
public AjaxResult insertSignPatientManageRoute(SignPatientManageRouteVO signPatientManageRoute) { public AjaxResult insertSignPatientManageRoute(SignPatientManageRouteVO signPatientManageRoute) {
//新增主表
signPatientManageRoute.setTaskCreateType(TaskCreateTypeEnum.MANUAL_CREATE.getInfo());
signPatientManageRoute.setCreateBy(SecurityUtils.getUsername()); signPatientManageRoute.setCreateBy(SecurityUtils.getUsername());
signPatientManageRoute.setCreateTime(LocalDateTime.now()); signPatientManageRoute.setCreateTime(LocalDateTime.now());
int insertRoute = signPatientManageRouteMapper.insertSignPatientManageRoute(signPatientManageRoute); int insertRoute = signPatientManageRouteMapper.insertSignPatientManageRoute(signPatientManageRoute);
if (insertRoute < 0) { if (insertRoute < 0) {
return AjaxResult.error("新增签约患者管理任务路径失败!请联系管理员!"); return AjaxResult.error("新增签约患者管理任务路径失败!请联系管理员!");
} }
for (SignPatientManageRouteNode signPatientManageRouteNode : signPatientManageRoute.getRouteNodeList()) { //新增节点表
signPatientManageRouteNode.setManageRouteId(signPatientManageRoute.getId()); List<SignPatientManageRouteNode> signPatientManageRouteNodes = new ArrayList<>();
signPatientManageRouteNode.setCreateTime(LocalDateTime.now()); SignPatientManageRouteNode signPatientManageRouteNode = new SignPatientManageRouteNode();
signPatientManageRouteNode.setCreateBy(SecurityUtils.getUsername()); for (SignPatientManageRouteNode routeNode : signPatientManageRoute.getRouteNodeList()) {
extracted(signPatientManageRoute, signPatientManageRouteNodes, signPatientManageRouteNode, routeNode);
} }
int insertBatchCount = signPatientManageRouteNodeMapper.insertBatch(signPatientManageRoute.getRouteNodeList()); int insertBatchCount = signPatientManageRouteNodeMapper.insertBatch(signPatientManageRouteNodes);
if (insertBatchCount < 0) { if (insertBatchCount < 0) {
return AjaxResult.error("新增签约患者管理任务路径失败!请联系管理员!"); return AjaxResult.error("新增签约患者管理任务路径失败!请联系管理员!");
} }
@ -126,12 +132,14 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
return AjaxResult.success(); return AjaxResult.success();
} }
/** /**
* 修改签约患者管理任务路径 * 修改签约患者管理任务路径
* *
* @param signPatientManageRoute 签约患者管理任务路径 * @param signPatientManageRoute 签约患者管理任务路径
* @return 结果 * @return 结果
*/ */
@Transactional(rollbackFor = Exception.class)
@Override @Override
public AjaxResult updateSignPatientManageRoute(SignPatientManageRouteVO signPatientManageRoute) { public AjaxResult updateSignPatientManageRoute(SignPatientManageRouteVO signPatientManageRoute) {
int deleteRouteNodeCount = signPatientManageRouteNodeMapper.deleteRouteNodeByManageRouteId(signPatientManageRoute.getSignPatientManageRouteId()); int deleteRouteNodeCount = signPatientManageRouteNodeMapper.deleteRouteNodeByManageRouteId(signPatientManageRoute.getSignPatientManageRouteId());
@ -180,6 +188,7 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
* @param ids 需要删除的签约患者管理任务路径主键 * @param ids 需要删除的签约患者管理任务路径主键
* @return 结果 * @return 结果
*/ */
@Transactional(rollbackFor = Exception.class)
@Override @Override
public int deleteSignPatientManageRouteByIds(Long[] ids) { public int deleteSignPatientManageRouteByIds(Long[] ids) {
return signPatientManageRouteMapper.deleteSignPatientManageRouteByIds(ids); return signPatientManageRouteMapper.deleteSignPatientManageRouteByIds(ids);
@ -281,10 +290,7 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
PatientQuestionOptionResult saveQuestionOption = new PatientQuestionOptionResult(); PatientQuestionOptionResult saveQuestionOption = new PatientQuestionOptionResult();
BeanUtils.copyBeanProp(saveQuestionOption, patientQuestionOptionResult); BeanUtils.copyBeanProp(saveQuestionOption, patientQuestionOptionResult);
// 从已保存的患者问卷题目结果列表中查找当前选项所对应的题目结果 // 从已保存的患者问卷题目结果列表中查找当前选项所对应的题目结果
PatientQuestionSubjectResult patientQuestionSubjectResult = patientQuestionSubjectResults.stream(). PatientQuestionSubjectResult patientQuestionSubjectResult = patientQuestionSubjectResults.stream().filter(Objects::nonNull).filter(item -> Objects.nonNull(item.getQuestionNumber()) && patientQuestionOptionResult.getQuestionNumber().compareTo(item.getQuestionNumber()) == 0).findFirst().orElse(new PatientQuestionSubjectResult());
filter(Objects::nonNull).
filter(item -> Objects.nonNull(item.getQuestionNumber()) && patientQuestionOptionResult.getQuestionNumber().
compareTo(item.getQuestionNumber()) == 0).findFirst().orElse(new PatientQuestionSubjectResult());
saveQuestionOption.setQuestionSubjectResultId(patientQuestionSubjectResult.getId()); saveQuestionOption.setQuestionSubjectResultId(patientQuestionSubjectResult.getId());
saveQuestionOption.setCreateTime(time); saveQuestionOption.setCreateTime(time);
saveQuestionOption.setCreateBy(routeHandlePerson); saveQuestionOption.setCreateBy(routeHandlePerson);
@ -334,4 +340,46 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
} }
} }
/**
* 塞值
*/
private static void extracted(SignPatientManageRouteVO signPatientManageRoute, List<SignPatientManageRouteNode> signPatientManageRouteNodes, SignPatientManageRouteNode signPatientManageRouteNode, SignPatientManageRouteNode routeNode) {
if (Objects.nonNull(routeNode) && TaskContentEnum.PHONE_OUTBOUND.getInfo().equals(routeNode.getTaskType())) {
signPatientManageRouteNode.setPhonePushSign(Objects.isNull(routeNode.getPhonePushSign()) ? null : routeNode.getPhonePushSign());
signPatientManageRouteNode.setPhoneId(Objects.isNull(routeNode.getPhoneId()) ? null : routeNode.getPhoneId());
signPatientManageRouteNode.setPhoneTemplateId(Objects.isNull(routeNode.getPhoneTemplateId()) ? null : routeNode.getPhoneTemplateId());
signPatientManageRouteNode.setPhoneTemplateName(StringUtils.isBlank(routeNode.getPhoneTemplateName()) ? null : routeNode.getPhoneTemplateName());
signPatientManageRouteNode.setPhoneNodeContent(StringUtils.isBlank(routeNode.getPhoneNodeContent()) ? null : routeNode.getPhoneNodeContent());
signPatientManageRouteNode.setPhoneRedialTimes(StringUtils.isBlank(routeNode.getPhoneRedialTimes()) ? null : routeNode.getPhoneRedialTimes());
signPatientManageRouteNode.setPhoneTimeInterval(Objects.isNull(routeNode.getPhoneTimeInterval()) ? null : routeNode.getPhoneTimeInterval());
}
if (Objects.nonNull(routeNode) && TaskContentEnum.QUESTIONNAIRE_SCALE.getInfo().equals(routeNode.getTaskType())) {
signPatientManageRouteNode.setQuestionInfoId(Objects.isNull(routeNode.getQuestionInfoId()) ? null : routeNode.getQuestionInfoId());
signPatientManageRouteNode.setQuestionnaireName(StringUtils.isBlank(routeNode.getQuestionnaireName()) ? null : routeNode.getQuestionnaireName());
signPatientManageRouteNode.setQuestionnaireContent(StringUtils.isBlank(routeNode.getQuestionnaireContent()) ? null : routeNode.getQuestionnaireContent());
signPatientManageRouteNode.setQuestionExpirationDate(Objects.isNull(routeNode.getQuestionExpirationDate()) ? null : routeNode.getQuestionExpirationDate());
}
if (Objects.nonNull(routeNode) && TaskContentEnum.PROPAGANDA_ARTICLE.getInfo().equals(routeNode.getTaskType())) {
signPatientManageRouteNode.setPropagandaInfoId(Objects.isNull(routeNode.getPropagandaInfoId()) ? null : routeNode.getPropagandaInfoId());
signPatientManageRouteNode.setPropagandaTitle(StringUtils.isBlank(routeNode.getPropagandaTitle()) ? null : routeNode.getPropagandaTitle());
signPatientManageRouteNode.setPropagandaContent(StringUtils.isBlank(routeNode.getPropagandaContent()) ? null : routeNode.getPropagandaContent());
}
if (Objects.nonNull(routeNode) && TaskContentEnum.TEXT_REMIND.getInfo().equals(routeNode.getTaskType())) {
signPatientManageRouteNode.setTextRemindContent(StringUtils.isBlank(routeNode.getTextRemindContent()) ? null : routeNode.getTextRemindContent());
}
if (Objects.nonNull(routeNode) && TaskContentEnum.ARTIFICIAL_FOLLOW_UP.getInfo().equals(routeNode.getTaskType())) {
signPatientManageRouteNode.setFollowTemplateId(Objects.isNull(routeNode.getFollowTemplateId()) ? null : routeNode.getFollowTemplateId());
signPatientManageRouteNode.setFollowContent(StringUtils.isBlank(routeNode.getFollowContent()) ? null : routeNode.getFollowContent());
signPatientManageRouteNode.setFollowTemplateName(StringUtils.isBlank(routeNode.getFollowTemplateName()) ? null : routeNode.getFollowTemplateName());
}
signPatientManageRouteNode.setManageRouteId(signPatientManageRoute.getId());
signPatientManageRouteNode.setManageRouteName(signPatientManageRoute.getRouteName());
signPatientManageRouteNode.setNodeExecuteStatus(NodeExecuteStatusEnum.UNEXECUTED.getInfo());
signPatientManageRouteNode.setTaskType(routeNode.getTaskType());
signPatientManageRouteNode.setRouteNodeName(routeNode.getRouteNodeName());
signPatientManageRouteNode.setRouteNodeDay(routeNode.getRouteNodeDay());
signPatientManageRouteNode.setCreateTime(LocalDateTime.now());
signPatientManageRouteNode.setCreateBy(SecurityUtils.getUsername());
signPatientManageRouteNodes.add(signPatientManageRouteNode);
}
} }

View File

@ -4,6 +4,7 @@ import com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRout
import com.xinelu.manage.dto.signpatientmanageroutenode.PatientTaskDto; import com.xinelu.manage.dto.signpatientmanageroutenode.PatientTaskDto;
import com.xinelu.manage.dto.signpatientmanageroutenode.RouteNodeCheckDto; import com.xinelu.manage.dto.signpatientmanageroutenode.RouteNodeCheckDto;
import com.xinelu.manage.vo.signpatientmanageroutenode.PatientTaskVo; import com.xinelu.manage.vo.signpatientmanageroutenode.PatientTaskVo;
import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageRouteNodeVo;
import java.util.List; import java.util.List;
@ -23,12 +24,19 @@ public interface ISignPatientManageRouteNodeService {
public SignPatientManageRouteNode selectSignPatientManageRouteNodeById(Long id); public SignPatientManageRouteNode selectSignPatientManageRouteNodeById(Long id);
/** /**
* 根据患者主键查询患者管理路径节点 * 查询患者管理路径节点
* * @param patientTaskDto 任务查询传输对象
* @param patientId 患者主键 * @return 患者管理任务路径节点
* @return 签约患者管理任务路径节点
*/ */
List<SignPatientManageRouteNode> getNodesByPatient(Long patientId); List<SignPatientManageRouteNode> getNodeList(PatientTaskDto patientTaskDto);
/**
* 查询患者管理路径节点
*
* @param patientTaskDto 任务查询传输对象
* @return 患者管理任务路径节点
*/
List<SignPatientManageRouteNodeVo> getRouteNodeList(PatientTaskDto patientTaskDto);
/** /**
* 查询签约患者管理任务路径节点列表 * 查询签约患者管理任务路径节点列表

View File

@ -1,5 +1,6 @@
package com.xinelu.manage.service.signpatientmanageroutenode.impl; package com.xinelu.manage.service.signpatientmanageroutenode.impl;
import com.xinelu.common.exception.ServiceException;
import com.xinelu.manage.domain.patientinfo.PatientInfo; import com.xinelu.manage.domain.patientinfo.PatientInfo;
import com.xinelu.manage.domain.signpatientmanageroute.SignPatientManageRoute; import com.xinelu.manage.domain.signpatientmanageroute.SignPatientManageRoute;
import com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRouteNode; import com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRouteNode;
@ -10,11 +11,12 @@ import com.xinelu.manage.mapper.signpatientmanageroute.SignPatientManageRouteMap
import com.xinelu.manage.mapper.signpatientmanageroutenode.SignPatientManageRouteNodeMapper; import com.xinelu.manage.mapper.signpatientmanageroutenode.SignPatientManageRouteNodeMapper;
import com.xinelu.manage.service.signpatientmanageroutenode.ISignPatientManageRouteNodeService; import com.xinelu.manage.service.signpatientmanageroutenode.ISignPatientManageRouteNodeService;
import com.xinelu.manage.vo.signpatientmanageroutenode.PatientTaskVo; import com.xinelu.manage.vo.signpatientmanageroutenode.PatientTaskVo;
import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageRouteNodeVo;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.ObjectUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -44,23 +46,37 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage
return signPatientManageRouteNodeMapper.selectSignPatientManageRouteNodeById(id); return signPatientManageRouteNodeMapper.selectSignPatientManageRouteNodeById(id);
} }
@Override public List<SignPatientManageRouteNode> getNodesByPatient(Long patientId) { @Override public List<SignPatientManageRouteNode> getNodeList(PatientTaskDto patientTaskDto) {
List<SignPatientManageRouteNode> nodeList = new ArrayList<>(); if (patientTaskDto.getPatientId() == null) {
PatientInfo patientInfo = patientInfoMapper.selectPatientInfoById(patientId); throw new ServiceException("患者信息有误");
if (patientInfo.getSignPatientRecordId() != null) {
// 查询签约路径
SignPatientManageRoute signPatientManageRoute = new SignPatientManageRoute();
signPatientManageRoute.setSignPatientRecordId(patientInfo.getSignPatientRecordId());
signPatientManageRoute.setPatientId(patientId);
List<SignPatientManageRoute> signRoutes = signRouteMapper.selectSignPatientManageRouteList(signPatientManageRoute);
if (CollectionUtils.isNotEmpty(signRoutes)) {
SignPatientManageRoute signRoute = signRoutes.get(0);
SignPatientManageRouteNode nddeQuery = new SignPatientManageRouteNode();
nddeQuery.setManageRouteId(signRoute.getId());
nodeList = signPatientManageRouteNodeMapper.selectSignPatientManageRouteNodeList(nddeQuery);
}
} }
return nodeList; return signPatientManageRouteNodeMapper.getNodeList(patientTaskDto);
}
@Override public List<SignPatientManageRouteNodeVo> getRouteNodeList(PatientTaskDto patientTaskDto) {
List<SignPatientManageRouteNodeVo> retList = new ArrayList<>();
PatientInfo patientInfo = patientInfoMapper.selectPatientInfoById(patientTaskDto.getPatientId());
if (patientTaskDto.getPatientId() == null || ObjectUtils.isEmpty(patientInfo)) {
throw new ServiceException("请选择患者!");
}
// 查询任务列表
SignPatientManageRoute signPatientManageRoute = new SignPatientManageRoute();
signPatientManageRoute.setSignPatientRecordId(patientTaskDto.getSignPatientRecordId());
signPatientManageRoute.setPatientId(patientTaskDto.getPatientId());
signPatientManageRoute.setTaskCreateType(patientTaskDto.getTaskCreateType());
List<SignPatientManageRoute> signRoutes = signRouteMapper.selectSignPatientManageRouteList(signPatientManageRoute);
for (SignPatientManageRoute route : signRoutes) {
SignPatientManageRouteNode nodeQuery = new SignPatientManageRouteNode();
nodeQuery.setManageRouteId(route.getId());
List<SignPatientManageRouteNode> nodeList = signPatientManageRouteNodeMapper.selectSignPatientManageRouteNodeList(nodeQuery);
retList.add(SignPatientManageRouteNodeVo.builder().manageRouteId(route.getId())
.routeName(route.getRouteName())
.taskCreateType(route.getTaskCreateType())
.suitRange(route.getSuitRange())
.nodeList(nodeList).build());
}
return retList;
} }
/** /**

View File

@ -163,6 +163,7 @@ public class SpecialDiseaseNodeServiceImpl implements ISpecialDiseaseNodeService
* @param specialDiseaseNode 节点信息 * @param specialDiseaseNode 节点信息
* @return AjaxResult * @return AjaxResult
*/ */
@Transactional(rollbackFor = Exception.class)
@Override @Override
public AjaxResult updateRouteCheckStatus(SpecialDiseaseNode specialDiseaseNode) { public AjaxResult updateRouteCheckStatus(SpecialDiseaseNode specialDiseaseNode) {
if (Objects.isNull(specialDiseaseNode) || Objects.isNull(specialDiseaseNode.getId())) { if (Objects.isNull(specialDiseaseNode) || Objects.isNull(specialDiseaseNode.getId())) {

View File

@ -77,6 +77,7 @@ public class SpecialDiseaseRouteServiceImpl implements ISpecialDiseaseRouteServi
* @param specialDiseaseRoute 专病路径信息 * @param specialDiseaseRoute 专病路径信息
* @return 结果 * @return 结果
*/ */
@Transactional(rollbackFor = Exception.class)
@Override @Override
public AjaxResult insertSpecialDiseaseRoute(SpecialDiseaseRouteVO specialDiseaseRoute) { public AjaxResult insertSpecialDiseaseRoute(SpecialDiseaseRouteVO specialDiseaseRoute) {
specialDiseaseRoute.setCreateTime(LocalDateTime.now()); specialDiseaseRoute.setCreateTime(LocalDateTime.now());
@ -111,6 +112,7 @@ public class SpecialDiseaseRouteServiceImpl implements ISpecialDiseaseRouteServi
* @param specialDiseaseRoute 专病路径信息 * @param specialDiseaseRoute 专病路径信息
* @return 结果 * @return 结果
*/ */
@Transactional(rollbackFor = Exception.class)
@Override @Override
public AjaxResult updateSpecialDiseaseRoute(SpecialDiseaseRouteVO specialDiseaseRoute) { public AjaxResult updateSpecialDiseaseRoute(SpecialDiseaseRouteVO specialDiseaseRoute) {
int deleteRoutePackageCount = specialDiseaseRoutePackageMapper.deleteSpecialDiseaseRoutePackageByRouteId(specialDiseaseRoute.getId()); int deleteRoutePackageCount = specialDiseaseRoutePackageMapper.deleteSpecialDiseaseRoutePackageByRouteId(specialDiseaseRoute.getId());
@ -209,6 +211,7 @@ public class SpecialDiseaseRouteServiceImpl implements ISpecialDiseaseRouteServi
* @param specialDiseaseRoute 路径信息 * @param specialDiseaseRoute 路径信息
* @return AjaxResult * @return AjaxResult
*/ */
@Transactional(rollbackFor = Exception.class)
@Override @Override
public AjaxResult editReleaseStatus(SpecialDiseaseRoute specialDiseaseRoute) { public AjaxResult editReleaseStatus(SpecialDiseaseRoute specialDiseaseRoute) {
if (Objects.isNull(specialDiseaseRoute) || StringUtils.isBlank(specialDiseaseRoute.getReleaseStatus())) { if (Objects.isNull(specialDiseaseRoute) || StringUtils.isBlank(specialDiseaseRoute.getReleaseStatus())) {

View File

@ -4,6 +4,7 @@ import com.xinelu.common.core.domain.entity.SysDictData;
import com.xinelu.common.exception.ServiceException; import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.SecurityUtils;
import com.xinelu.common.utils.bean.BeanUtils; import com.xinelu.common.utils.bean.BeanUtils;
import com.xinelu.common.utils.uuid.IdUtils;
import com.xinelu.manage.domain.textmessage.TextMessage; import com.xinelu.manage.domain.textmessage.TextMessage;
import com.xinelu.manage.domain.textmessagesuittask.TextMessageSuitTask; import com.xinelu.manage.domain.textmessagesuittask.TextMessageSuitTask;
import com.xinelu.manage.dto.textmessage.TextMessageDTO; import com.xinelu.manage.dto.textmessage.TextMessageDTO;
@ -112,6 +113,7 @@ public class TextMessageServiceImpl implements ITextMessageService {
LocalDateTime currentTime = LocalDateTime.now(); LocalDateTime currentTime = LocalDateTime.now();
textMessageTaskDTO.setCreateBy(currentUsername); textMessageTaskDTO.setCreateBy(currentUsername);
textMessageTaskDTO.setCreateTime(currentTime); textMessageTaskDTO.setCreateTime(currentTime);
textMessageTaskDTO.setTextMessageId(IdUtils.fastUUID());
// 将textMessageTaskDTO对象的属性复制到textMessage对象 // 将textMessageTaskDTO对象的属性复制到textMessage对象
TextMessage textMessage = new TextMessage(); TextMessage textMessage = new TextMessage();

View File

@ -4,6 +4,7 @@ import com.xinelu.common.core.domain.entity.SysDictData;
import com.xinelu.common.exception.ServiceException; import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.SecurityUtils;
import com.xinelu.common.utils.bean.BeanUtils; import com.xinelu.common.utils.bean.BeanUtils;
import com.xinelu.common.utils.uuid.IdUtils;
import com.xinelu.manage.domain.wechattemplate.WechatTemplate; import com.xinelu.manage.domain.wechattemplate.WechatTemplate;
import com.xinelu.manage.domain.wechattemplatesuittask.WechatTemplateSuitTask; import com.xinelu.manage.domain.wechattemplatesuittask.WechatTemplateSuitTask;
import com.xinelu.manage.dto.wechattemplate.WechatTemplateDTO; import com.xinelu.manage.dto.wechattemplate.WechatTemplateDTO;
@ -104,7 +105,7 @@ public class WechatTemplateServiceImpl implements IWechatTemplateService {
// 将wechatTemplateTaskDTO对象的属性复制到wechatTemplate对象 // 将wechatTemplateTaskDTO对象的属性复制到wechatTemplate对象
WechatTemplate wechatTemplate = new WechatTemplate(); WechatTemplate wechatTemplate = new WechatTemplate();
BeanUtils.copyProperties(wechatTemplateTaskDTO, wechatTemplate); BeanUtils.copyProperties(wechatTemplateTaskDTO, wechatTemplate);
wechatTemplate.setTemplateId(IdUtils.fastUUID());
// 插入wechatTemplate记录并检查结果 // 插入wechatTemplate记录并检查结果
if (wechatTemplateMapper.insertWechatTemplate(wechatTemplate) <= 0) { if (wechatTemplateMapper.insertWechatTemplate(wechatTemplate) <= 0) {
throw new ServiceException("新增微信模板失败"); throw new ServiceException("新增微信模板失败");

View File

@ -114,5 +114,14 @@ public class ManualFollowUpVO {
@ApiModelProperty(value = "模板id") @ApiModelProperty(value = "模板id")
private String templateId; private String templateId;
@ApiModelProperty(value = "节点任务执行状态已执行EXECUTED未执行UNEXECUTED")
private String nodeExecuteStatus;
@ApiModelProperty(value = "任务执行记录id")
private Long taskExecuteRecordId;
@ApiModelProperty(value = "任务处理信息")
private String routeHandleRemark;
} }

View File

@ -4,6 +4,7 @@ import com.xinelu.manage.vo.patientquestionsubjectresult.PatientQuestionSubjectR
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal;
import java.util.List; import java.util.List;
/** /**
@ -34,5 +35,18 @@ public class PatientQuestionSubmitResultVO {
@ApiModelProperty(value = "问卷说明") @ApiModelProperty(value = "问卷说明")
private String questionnaireDescription; private String questionnaireDescription;
/**
* 问卷总分值小数点后两位
*/
@ApiModelProperty(value = "问卷总分值,小数点后两位")
private BigDecimal questionnaireTotalScore;
/**
* 问卷总得分根据患者提交问卷得出的分值
*/
@ApiModelProperty(value = "问卷总得分,根据患者提交问卷得出的分值")
private BigDecimal totalScore;
List<PatientQuestionSubjectResultVO> subjectResultList; List<PatientQuestionSubjectResultVO> subjectResultList;
} }

View File

@ -0,0 +1,93 @@
package com.xinelu.manage.vo.patientquestionsubmitresult;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.time.LocalDate;
/**
* 满意度调查
*
* @author xinelu
* @date 2024-04-15
*/
@Data
public class SatisfactionSurveyVO {
private Long patientQuestionSubmitResultId;
/**
* 患者姓名
*/
@ApiModelProperty(value = "患者姓名")
private String patientName;
/**
* 患者电话
*/
@ApiModelProperty(value = "患者电话")
private String patientPhone;
/**
* 身份证号
*/
@ApiModelProperty(value = "身份证号")
private String cardNo;
/**
* 出生日期格式yyyy-MM-dd
*/
@ApiModelProperty(value = "出生日期格式yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private LocalDate birthDate;
/**
* 性别MALEFEMALE
*/
@ApiModelProperty(value = "性别MALEFEMALE")
private String sex;
/**
* 问卷类型普通问卷REGULAR_QUESTIONNAIRE,满意度问卷SATISFACTION_QUESTIONNAIRE
*/
@ApiModelProperty(value = "问卷类型")
private String questionType;
/**
* 患者类型预住院患者PRE_HOSPITALIZED_PATIENT在院患者IN_HOSPITAL_PATIENT门诊患者OUTPATIENT出院患者DISCHARGED_PATIENT
* 签约患者CONTRACTED_PATIENT
*/
@ApiModelProperty(value = "患者类型预住院患者PRE_HOSPITALIZED_PATIENT在院患者IN_HOSPITAL_PATIENT门诊患者OUTPATIENT出院患者DISCHARGED_PATIENT签约患者CONTRACTED_PATIENT")
private String patientType;
/**
* 签约状态未签约UN_SIGN,在签IN_SIGN,解约SEPARATE_SIGN, 服务到期EXPIRE_SIGN
*/
@ApiModelProperty(value = "签约状态未签约UN_SIGN,在签IN_SIGN,解约SEPARATE_SIGN, 过期EXPIRE_SIGN")
private String signStatus;
/**
* 服务状态意向签约INTENTIONAL_SIGNING服务中SERVICE_CENTER服务结束SERVICE_END
*/
@ApiModelProperty(value = "服务状态意向签约INTENTIONAL_SIGNING服务中SERVICE_CENTER服务结束SERVICE_END")
private String serviceStatus;
/**
* 就诊方式门诊OUTPATIENT_SERVICE住院BE_IN_HOSPITAL
*/
@ApiModelProperty(value = "就诊方式门诊OUTPATIENT_SERVICE住院BE_IN_HOSPITAL")
private String visitMethod;
/**
* 所属医院名称
*/
@ApiModelProperty(value = "所属医院名称")
private String hospitalAgencyName;
/**
* 所属科室名称
*/
@ApiModelProperty(value = "所属科室名称")
private String departmentName;
}

View File

@ -3,8 +3,10 @@ package com.xinelu.manage.vo.patienttaskexecuterecord;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.xinelu.manage.domain.patienttaskexecuterecord.PatientTaskExecuteRecord; import com.xinelu.manage.domain.patienttaskexecuterecord.PatientTaskExecuteRecord;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
@ -102,4 +104,19 @@ public class PatientTaskExecuteRecordVO extends PatientTaskExecuteRecord {
@ApiModelProperty(value = "手术记录") @ApiModelProperty(value = "手术记录")
private String surgicalRecord; private String surgicalRecord;
@ApiModelProperty(value = "任务类型电话外呼PHONE_OUTBOUND问卷量表QUESTIONNAIRE_SCALE宣教文章PROPAGANDA_ARTICLE文字提醒TEXT_REMIND人工随访ARTIFICIAL_FOLLOW_UP")
private String taskType;
@ApiModelProperty(value = "模板id")
private String templateId;
@ApiModelProperty(value = "文字提醒内容(任务类型为文字提醒使用)")
private String textRemindContent;
@ApiModelProperty(value = "任务处理信息")
private String routeHandleRemark;
} }

View File

@ -48,4 +48,9 @@ public class ServiceFrequencyVO {
@ApiModelProperty(value = "服务频次数字结束值") @ApiModelProperty(value = "服务频次数字结束值")
@Excel(name = "服务频次数字结束值") @Excel(name = "服务频次数字结束值")
private Integer serviceFrequencyEnd; private Integer serviceFrequencyEnd;
@ApiModelProperty(value = "服务频次排序")
private Integer serviceFrequencySort;
} }

View File

@ -67,4 +67,7 @@ public class ServiceWayContentAndFrequencyVO {
@ApiModelProperty(value = "服务频次数字结束值") @ApiModelProperty(value = "服务频次数字结束值")
@Excel(name = "服务频次数字结束值") @Excel(name = "服务频次数字结束值")
private Integer serviceFrequencyEnd; private Integer serviceFrequencyEnd;
@ApiModelProperty(value = "服务频次排序")
private Integer serviceFrequencySort;
} }

View File

@ -1,211 +0,0 @@
package com.xinelu.manage.vo.signpatientmanageroute;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.time.LocalTime;
import lombok.Data;
/**
* @description: 居民管理路径查询返回视图类
* @author: haown
* @create: 2024-04-02 08:58
**/
@ApiModel("居民管理路径查询返回视图类")
@Data
public class SignPatientManageRouteNodeVo {
/** 签约记录表id */
@ApiModelProperty(value = "签约记录表id")
private Long signPatientRecordId;
/** 路径主键 */
@ApiModelProperty(value = "路径主键")
private Long routeId;
/** 路径名称(任务名称) */
@ApiModelProperty(value = "路径名称")
private String routeName;
/** 管理路径节点名称出院后AFTER_DISCHARGE入院后AFTER_ADMISSION就诊后AFTER_CONSULTATION就诊/出院后AFTER_VISIT_DISCHARGE术前PREOPERATIVE术后POSTOPERATIVE*/
@ApiModelProperty(value = "管理路径节点名称出院后AFTER_DISCHARGE入院后AFTER_ADMISSION就诊后AFTER_CONSULTATION"
+ "就诊/出院后AFTER_VISIT_DISCHARGE术前PREOPERATIVE术后POSTOPERATIVE")
private String routeNodeName;
/** 管理路径节点时间,时间单位为:天 */
@ApiModelProperty(value = "管理路径节点时间,时间单位为:天")
private Integer routeNodeDay;
/** 任务类型电话外呼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;
/** 任务状态 */
@ApiModelProperty(value = "任务状态")
private String taskStatus;
/** 任务细分 */
@ApiModelProperty(value = "任务细分")
private String taskSubdivision;
/** 二级分类描述 */
@ApiModelProperty(value = "二级分类描述")
private String secondClassifyDescribe;
/** 执行时间格式HH:mm */
@ApiModelProperty(value = "执行时间格式HH:mm")
@JsonFormat(pattern = "HH:mm")
private LocalTime executeTime;
/** 电话推送标识0未开启1已开启 */
@ApiModelProperty(value = "电话推送标识0未开启1已开启")
private Integer phonePushSign;
/** 电话话术表id */
@ApiModelProperty(value = "电话话术表id")
private Long phoneId;
/** 电话模板ID */
@ApiModelProperty(value = "电话模板ID")
private String phoneTemplateId;
/** 电话模板名称 */
@ApiModelProperty(value = "电话模板名称")
private String phoneTemplateName;
/** 电话内容(富文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记) */
@ApiModelProperty(value = "电话内容")
private String phoneNodeContent;
/** 电话重拨次数重拨一次REDIAL_ONCE重拨二次REDIAL_TWICE不重播NOT_REPLAY */
@ApiModelProperty(value = "电话重拨次数重拨一次REDIAL_ONCE重拨二次REDIAL_TWICE不重播NOT_REPLAY")
private String phoneRedialTimes;
/** 电话时间间隔,单位为:分钟 */
@ApiModelProperty(value = "电话时间间隔,单位为:分钟")
private Integer phoneTimeInterval;
/** 电话短信提醒不发送短信NOT_SEND_MESSAGE未接通发短信NOT_CONNECTED_SEND_MESSAGE接通后发短信CONNECTED_SEND_MESSAGE所有人发短信EVERYONE_SEND_MESSAGE */
@ApiModelProperty(value = "电话短信提醒不发送短信NOT_SEND_MESSAGE未接通发短信NOT_CONNECTED_SEND_MESSAGE接通后发短信CONNECTED_SEND_MESSAGE所有人发短信EVERYONE_SEND_MESSAGE")
private String phoneMessageRemind;
/** 电话短信模板表id */
@ApiModelProperty(value = "电话短信模板表id")
private Long phoneMessageTemplateId;
/** 电话短信模板名称 */
@ApiModelProperty(value = "电话短信模板名称")
private String phoneMessageTemplateName;
/** 问卷表id */
@ApiModelProperty(value = "问卷表id")
private Long questionInfoId;
/** 问卷模板名称 */
@ApiModelProperty(value = "问卷模板名称")
private String questionnaireName;
/** 问卷模板内容(富文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记) */
@ApiModelProperty(value = "问卷模板内容")
private String questionnaireContent;
/** 问卷有效期,单位:天 */
@ApiModelProperty(value = "问卷有效期,单位:天")
private Integer questionExpirationDate;
/** 宣教文章表id */
@ApiModelProperty(value = "宣教文章表id")
private Long propagandaInfoId;
/** 宣教文章模板标题(宣教模板名称) */
@ApiModelProperty(value = "宣教文章模板标题")
private String propagandaTitle;
/** 宣教文章内容(富文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记) */
@ApiModelProperty(value = "宣教文章内容")
private String propagandaContent;
/** 短信推送标识0未开启1已开启 */
@ApiModelProperty(value = "短信推送标识0未开启1已开启")
private Integer messagePushSign;
/** 短信模板表id */
@ApiModelProperty(value = "短信模板表id")
private Long messageTemplateId;
/** 短信模板名称 */
@ApiModelProperty(value = "短信模板名称")
private String messageTemplateName;
/** 短信预览 */
@ApiModelProperty(value = "短信预览")
private String messagePreview;
/** 短信节点内容(富文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记) */
@ApiModelProperty(value = "短信节点内容")
private String messageNodeContent;
/** 公众号推送标识0未开启1已开启 */
@ApiModelProperty(value = "公众号推送标识0未开启1已开启")
private Integer officialPushSign;
/** 公众号模板表id */
@ApiModelProperty(value = "公众号模板表id")
private Long officialTemplateId;
/** 公众号模板名称 */
@ApiModelProperty(value = "公众号模板名称")
private String officialTemplateName;
/** 公众号提醒内容 */
@ApiModelProperty(value = "公众号提醒内容")
private String officialRemindContent;
/** 公众号节点内容(富文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记) */
@ApiModelProperty(value = "公众号节点内容")
private String officialNodeContent;
/** 小程序推送标识0未开启1已开启 */
@ApiModelProperty(value = "小程序推送标识0未开启1已开启")
private Integer appletPushSign;
/** 小程序模板表id */
@ApiModelProperty(value = "小程序模板表id")
private Long appletTemplateId;
/** 小程序模板名称 */
@ApiModelProperty(value = "小程序模板名称")
private String appletTemplateName;
/** 小程序提醒内容 */
@ApiModelProperty(value = "小程序提醒内容")
private String appletRemindContent;
/** 小程序提示说明 */
@ApiModelProperty(value = "小程序提示说明")
private String appletPromptDescription;
/** 小程序节点内容(富文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记) */
@ApiModelProperty(value = "小程序节点内容")
private String appletNodeContent;
/** 人工随访模板表id */
@ApiModelProperty(value = "人工随访模板表id")
private Long followTemplateId;
/** 人工随访模板名称 */
@ApiModelProperty(value = "人工随访模板名称")
private String followTemplateName;
/** 人工随访模板内容(富文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记) */
@ApiModelProperty(value = "人工随访模板内容")
private String followContent;
/** 节点审核状态同意AGREE不同意DISAGREE */
@ApiModelProperty(value = "节点审核状态同意AGREE不同意DISAGREE")
private String routeCheckStatus;
/** 节点任务执行状态已执行EXECUTED未执行UNEXECUTED */
@ApiModelProperty(value = "节点任务执行状态已执行EXECUTED未执行UNEXECUTED")
private String nodeExecuteStatus;
}

View File

@ -121,10 +121,21 @@ public class PatientTaskVo {
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
private LocalDateTime visitDate; private LocalDateTime visitDate;
/**
* 出院时间出院患者时间格式yyyy-MM-dd
*/
@ApiModelProperty(value = "出院时间")
@JsonFormat(pattern = "yyyy-MM-dd")
private LocalDateTime dischargeTime;
/** 手术名称 */ /** 手术名称 */
@ApiModelProperty(value = "手术名称") @ApiModelProperty(value = "手术名称")
private String surgicalName; private String surgicalName;
/** 签约记录表id */
@ApiModelProperty(value = "签约记录表id")
private Long signPatientRecordId;
/** 签约患者管理任务路径节点id */ /** 签约患者管理任务路径节点id */
@ApiModelProperty(value = "签约患者管理任务路径节点id") @ApiModelProperty(value = "签约患者管理任务路径节点id")
private Long manageRouteNodeId; private Long manageRouteNodeId;

View File

@ -0,0 +1,45 @@
package com.xinelu.manage.vo.signpatientmanageroutenode;
import com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRouteNode;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @description: 查询管理路任务路径节点返回视图类
* @author: haown
* @create: 2024-04-10 15:40
**/
@ApiModel("查询管理路任务路径节点返回视图类")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SignPatientManageRouteNodeVo {
/** 签约患者管理任务表id */
@ApiModelProperty(value = "签约患者管理任务表id")
private Long manageRouteId;
/** 路径名称(任务名称) */
@ApiModelProperty(value = "路径名称")
private String routeName;
/** 任务创建类型手动创建MANUAL_CREATE自动匹配MANUAL_MATCHE */
@ApiModelProperty(value = "任务创建类型手动创建MANUAL_CREATE自动匹配MANUAL_MATCHE")
private String taskCreateType;
/** 适用范围在院IN_THE_HOSPITAL出院DISCHARGE门诊OUTPATIENT_SERVICE门诊+出院OUTPATIENT_SERVICE_DISCHARGE */
@ApiModelProperty(value = "适用范围在院IN_THE_HOSPITAL出院DISCHARGE门诊OUTPATIENT_SERVICE门诊+出院OUTPATIENT_SERVICE_DISCHARGE")
private String suitRange;
/**
* 节点列表
*/
@ApiModelProperty(value = "节点列表")
List<SignPatientManageRouteNode> nodeList;
}

View File

@ -189,6 +189,11 @@ public class SignPatientListVo {
@ApiModelProperty(value = "服务包名称") @ApiModelProperty(value = "服务包名称")
private String packageName; 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 = "服务周期") @ApiModelProperty(value = "服务周期")
private Integer packageTerm; private Integer packageTerm;

View File

@ -77,6 +77,7 @@
#{fieldMark} #{fieldMark}
</if> </if>
</where> </where>
order by create_time DESC
</select> </select>
<select id="selectLabelFieldContentById" parameterType="Long" <select id="selectLabelFieldContentById" parameterType="Long"

View File

@ -57,6 +57,7 @@
#{fieldRemark} #{fieldRemark}
</if> </if>
</where> </where>
order by create_time DESC
</select> </select>

View File

@ -37,6 +37,8 @@
<result property="submitResulId" column="submitResulId"/> <result property="submitResulId" column="submitResulId"/>
<result property="questionnaireName" column="questionnaire_name"/> <result property="questionnaireName" column="questionnaire_name"/>
<result property="questionnaireDescription" column="questionnaire_description"/> <result property="questionnaireDescription" column="questionnaire_description"/>
<result property="questionnaireTotalScore" column="questionnaire_total_score"/>
<result property="totalScore" column="total_score"/>
<collection property="subjectResultList" javaType="java.util.List" <collection property="subjectResultList" javaType="java.util.List"
resultMap="PatientQuestionSubjectResultResult"/> resultMap="PatientQuestionSubjectResultResult"/>
</resultMap> </resultMap>
@ -375,39 +377,85 @@
<select id="selectResultByTaskExecuteRecordId" <select id="selectResultByTaskExecuteRecordId"
resultType="com.xinelu.manage.vo.patientquestionsubmitresult.PatientQuestionSubmitResultVO" resultType="com.xinelu.manage.vo.patientquestionsubmitresult.PatientQuestionSubmitResultVO"
resultMap="PatientQuestionSubmitResultDTO"> resultMap="PatientQuestionSubmitResultDTO">
select pqsm.id submitResulId, select
pqsm.questionnaire_name, pqsm.id submitResulId,
pqsm.questionnaire_description, pqsm.questionnaire_name,
pqsj.id subjectResult, pqsm.questionnaire_description,
pqsj.question_submit_result_id, pqsm.questionnaire_total_score,
pqsj.question_info_id, pqsm.total_score,
pqsj.question_number, pqsj.id subjectResult,
pqsj.question_type, pqsj.question_submit_result_id,
pqsj.question_name, pqsj.question_info_id,
pqsj.question_description, pqsj.question_number,
pqsj.write_description, pqsj.question_type,
pqsj.fill_blanks_answer, pqsj.question_name,
pqsj.option_count, pqsj.question_description,
pqsj.whether_score, pqsj.write_description,
pqsj.scoring_method, pqsj.fill_blanks_answer,
pqsj.scoring_description, pqsj.option_count,
pqsj.question_score, pqsj.whether_score,
pqsj.question_sort, pqsj.scoring_method,
pqsj.question_remark, pqsj.scoring_description,
pqor.id, pqsj.question_score,
pqor.question_subject_result_id, pqsj.question_sort,
pqor.questionnaire_subject_id, pqsj.question_remark,
pqor.question_name, pqor.id,
pqor.option_name, pqor.question_subject_result_id,
pqor.option_answer, pqor.questionnaire_subject_id,
pqor.option_score, pqor.question_name,
pqor.option_choose_sign, pqor.option_name,
pqor.option_submit_answer, pqor.option_answer,
pqor.option_sort, pqor.option_score,
pqor.option_remark pqor.option_choose_sign,
pqor.option_submit_answer,
pqor.option_sort,
pqor.option_remark
FROM patient_question_submit_result pqsm FROM patient_question_submit_result pqsm
LEFT JOIN patient_question_subject_result pqsj ON pqsm.id = pqsj.question_submit_result_id LEFT JOIN patient_question_subject_result pqsj ON pqsm.id = pqsj.question_submit_result_id
LEFT JOIN patient_question_option_result pqor ON pqor.question_subject_result_id = pqsj.id LEFT JOIN patient_question_option_result pqor ON pqor.question_subject_result_id = pqsj.id
where pqsm.task_execute_record_id = #{taskExecuteRecordId} <where>
<if test="taskExecuteRecordId != null">
and pqsm.task_execute_record_id = #{taskExecuteRecordId}
</if>
<if test="patientQuestionSubmitResultId != null">
and pqsm.id = #{patientQuestionSubmitResultId}
</if>
</where>
</select>
<select id="selectSatisfactionSurvey" resultType="com.xinelu.manage.vo.patientquestionsubmitresult.SatisfactionSurveyVO">
select
pqsr.id patientQuestionSubmitResultId,
pqsr.patient_name,
pi.patient_phone,
pi.birth_date,
pi.card_no,
pi.sex,
pi.patient_type,
pi.sign_status,
pi.visit_method,
pi.patient_health_state,
pi.hospital_agency_name,
pi.department_name
from patient_question_submit_result pqsr
LEFT JOIN question_info qi on pqsr.question_info_id = qi.id
LEFT JOIN patient_info pi ON pi.id = pqsr.patient_id
where
pi.del_flag = 0
<if test="questionType != null and questionType != ''">
and qi.question_type = #{questionType}
</if>
<if test="patientName != null and patientName != ''">
and pi.patient_name like concat('%', #{patientName}, '%')
</if>
<if test="patientPhone != null and patientPhone != ''">
and pi.patient_phone like concat('%', #{patientPhone}, '%')
</if>
<if test="cardNo != null and cardNo != ''">
and pi.card_no = #{cardNo}
</if>
<if test="sex != null and sex != ''">
and pi.sex = #{sex}
</if>
</select> </select>
</mapper> </mapper>

View File

@ -111,9 +111,19 @@
pi.admission_time, pi.admission_time,
pi.discharge_time, pi.discharge_time,
pi.in_hospital_number, pi.in_hospital_number,
pi.patient_phone pi.patient_phone,
spmrn.task_type,
spmrn.route_handle_remark,
CASE
WHEN spmrn.task_type = 'PHONE_OUTBOUND' THEN spmrn.phone_id
WHEN spmrn.task_type = 'QUESTIONNAIRE_SCALE' THEN spmrn.question_info_id
WHEN spmrn.task_type = 'ARTIFICIAL_FOLLOW_UP' THEN spmrn.follow_template_id
WHEN spmrn.task_type = 'PROPAGANDA_ARTICLE' THEN spmrn.propaganda_info_id
END AS 'templateId',
IF(spmrn.task_type ='TEXT_REMIND',spmrn.text_remind_content,NULL) AS textRemindContent
from patient_task_execute_record pter from patient_task_execute_record pter
LEFT JOIN patient_info pi ON pi.id = pter.patient_id LEFT JOIN patient_info pi ON pi.id = pter.patient_id
LEFT JOIN sign_patient_manage_route_node spmrn ON pter.manage_route_node_id = spmrn.id
where pi.del_flag = 0 where pi.del_flag = 0
<if test="patientName != null and patientName != ''"> <if test="patientName != null and patientName != ''">
and pi.patient_name = #{patientName} and pi.patient_name = #{patientName}
@ -130,11 +140,11 @@
<if test="visitMethod != null and visitMethod != ''"> <if test="visitMethod != null and visitMethod != ''">
and pi.visit_method = #{visitMethod} and pi.visit_method = #{visitMethod}
</if> </if>
<if test="executeTime != null "> <if test="startDate != null ">
and pter.execute_time &lt;= #{startDate} and pter.execute_time &gt;=#{startDate}
</if> </if>
<if test="executeTime != null "> <if test="endDate != null ">
and pter.execute_time &gt;= #{endDate} and pter.execute_time &lt;= #{endDate}
</if> </if>
<if test="manageRouteName != null and manageRouteName != ''"> <if test="manageRouteName != null and manageRouteName != ''">
and pter.manage_route_name like concat('%', #{manageRouteName}, '%') and pter.manage_route_name like concat('%', #{manageRouteName}, '%')

View File

@ -19,6 +19,7 @@
<result property="questionnaireStatus" column="questionnaire_status"/> <result property="questionnaireStatus" column="questionnaire_status"/>
<result property="questionnaireSort" column="questionnaire_sort"/> <result property="questionnaireSort" column="questionnaire_sort"/>
<result property="questionnaireRemark" column="questionnaire_remark"/> <result property="questionnaireRemark" column="questionnaire_remark"/>
<result property="questionType" column="question_type"/>
<result property="createBy" column="create_by"/> <result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/> <result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/> <result property="updateBy" column="update_by"/>
@ -40,6 +41,7 @@
questionnaire_status, questionnaire_status,
questionnaire_sort, questionnaire_sort,
questionnaire_remark, questionnaire_remark,
question_type,
create_by, create_by,
create_time, create_time,
update_by, update_by,
@ -89,6 +91,9 @@
<if test="questionnaireRemark != null and questionnaireRemark != ''"> <if test="questionnaireRemark != null and questionnaireRemark != ''">
and questionnaire_remark = #{questionnaireRemark} and questionnaire_remark = #{questionnaireRemark}
</if> </if>
<if test="questionType != null and questionType != ''">
and question_type = #{questionType}
</if>
</where> </where>
</select> </select>
@ -128,6 +133,8 @@
</if> </if>
<if test="questionnaireRemark != null">questionnaire_remark, <if test="questionnaireRemark != null">questionnaire_remark,
</if> </if>
<if test="questionType != null">question_type,
</if>
<if test="createBy != null">create_by, <if test="createBy != null">create_by,
</if> </if>
<if test="createTime != null">create_time, <if test="createTime != null">create_time,
@ -164,6 +171,8 @@
</if> </if>
<if test="questionnaireRemark != null">#{questionnaireRemark}, <if test="questionnaireRemark != null">#{questionnaireRemark},
</if> </if>
<if test="questionType != null">#{questionType},
</if>
<if test="createBy != null">#{createBy}, <if test="createBy != null">#{createBy},
</if> </if>
<if test="createTime != null">#{createTime}, <if test="createTime != null">#{createTime},
@ -217,6 +226,9 @@
<if test="questionnaireRemark != null">questionnaire_remark = <if test="questionnaireRemark != null">questionnaire_remark =
#{questionnaireRemark}, #{questionnaireRemark},
</if> </if>
<if test="questionType != null">question_type =
#{questionType},
</if>
<if test="createBy != null">create_by = <if test="createBy != null">create_by =
#{createBy}, #{createBy},
</if> </if>
@ -254,10 +266,13 @@
from department dt left join question_info qi on dt.id = qi.department_id from department dt left join question_info qi on dt.id = qi.department_id
<where> <where>
<if test="departmentName != null and departmentName != ''"> <if test="departmentName != null and departmentName != ''">
dt.department_name like concat('%',#{departmentName},'%') and dt.department_name like concat('%',#{departmentName},'%')
</if> </if>
<if test="questionnaireStatus != null and questionnaireStatus != ''"> <if test="questionnaireStatus != null and questionnaireStatus != ''">
qi.questionnaire_status =#{questionnaireStatus} and qi.questionnaire_status =#{questionnaireStatus}
</if>
<if test="questionType != null and questionType != ''">
and qi.question_type = #{questionType}
</if> </if>
</where> </where>
GROUP BY dt.id GROUP BY dt.id

View File

@ -183,4 +183,18 @@
#{id} #{id}
</foreach> </foreach>
</delete> </delete>
<select id="getResidentInfoByPhoneAndOpenId" parameterType="string"
resultType="com.xinelu.manage.domain.residentinfo.ResidentInfo">
<include refid="selectResidentInfoVo" />
<where>
del_flag = 0
<if test="phone != null and phone != ''">
and patient_phone = #{phone}
</if>
<if test="openId != null and openId != ''">
and open_id = #{openId}
</if>
</where>
</select>
</mapper> </mapper>

View File

@ -35,6 +35,7 @@
<result column="service_frequency_text" property="serviceFrequencyText"/> <result column="service_frequency_text" property="serviceFrequencyText"/>
<result column="service_frequency_start" property="serviceFrequencyStart"/> <result column="service_frequency_start" property="serviceFrequencyStart"/>
<result column="service_frequency_end" property="serviceFrequencyEnd"/> <result column="service_frequency_end" property="serviceFrequencyEnd"/>
<result column="serviceFrequencySort" property="serviceFrequencySort"/>
</collection> </collection>
</resultMap> </resultMap>
@ -155,7 +156,8 @@
swc2.service_frequency_type, swc2.service_frequency_type,
swc2.service_frequency_text, swc2.service_frequency_text,
swc2.service_frequency_start, swc2.service_frequency_start,
swc2.service_frequency_end swc2.service_frequency_end,
swc2.service_sort AS 'serviceFrequencySort'
FROM service_way_content swc1 FROM service_way_content swc1
JOIN service_way_content swc2 on swc1.id = swc2.service_content_id JOIN service_way_content swc2 on swc1.id = swc2.service_content_id
<where> <where>
@ -185,7 +187,8 @@
swc1.service_frequency_type, swc1.service_frequency_type,
swc1.service_frequency_text, swc1.service_frequency_text,
swc1.service_frequency_start, swc1.service_frequency_start,
swc1.service_frequency_end swc1.service_frequency_end,
swc1.service_sort AS 'serviceFrequencySort'
FROM service_way_content swc1 FROM service_way_content swc1
LEFT JOIN service_way_content swc2 ON swc1.service_content_id = swc2.id LEFT JOIN service_way_content swc2 ON swc1.service_content_id = swc2.id
WHERE swc1.service_type = 'SERVICE_FREQUENCY' WHERE swc1.service_type = 'SERVICE_FREQUENCY'

View File

@ -307,7 +307,7 @@
pvr.surgical_name, pvr.surgical_name,
pi.attending_physician_id, pi.attending_physician_id,
pi.attending_physician_name, pi.attending_physician_name,
IF(spmr.suit_range = 'IN_THE_HOSPITAL', pi.admission_time, NULL) AS 'admissionTime', IF(spmr.suit_range = 'IN_THE_HOSPITAL' OR spmr.suit_range = 'DISCHARGE', pi.admission_time, NULL) AS 'admissionTime',
CASE CASE
WHEN spmr.suit_range = 'OUTPATIENT_SERVICE' THEN pi.visit_date WHEN spmr.suit_range = 'OUTPATIENT_SERVICE' THEN pi.visit_date
WHEN spmr.suit_range = 'DISCHARGE' THEN pi.discharge_time WHEN spmr.suit_range = 'DISCHARGE' THEN pi.discharge_time
@ -318,6 +318,7 @@
WHEN spmr.suit_range = 'OUTPATIENT_SERVICE_DISCHARGE' AND pi.visit_date IS NOT NULL THEN 'OUTPATIENT_SERVICE' WHEN spmr.suit_range = 'OUTPATIENT_SERVICE_DISCHARGE' AND pi.visit_date IS NOT NULL THEN 'OUTPATIENT_SERVICE'
WHEN spmr.suit_range = 'OUTPATIENT_SERVICE_DISCHARGE' AND pi.discharge_time IS NOT NULL THEN 'DISCHARGE' WHEN spmr.suit_range = 'OUTPATIENT_SERVICE_DISCHARGE' AND pi.discharge_time IS NOT NULL THEN 'DISCHARGE'
END AS 'suitRange', END AS 'suitRange',
pter.id AS 'taskExecuteRecordId',
pter.execute_time AS 'executeTime', pter.execute_time AS 'executeTime',
spmr.id AS 'manageRouteId', spmr.id AS 'manageRouteId',
spmrn.id AS 'manageRouteNodeId', spmrn.id AS 'manageRouteNodeId',
@ -330,10 +331,12 @@
WHEN spmrn.task_type = 'ARTIFICIAL_FOLLOW_UP' THEN spmrn.follow_template_name WHEN spmrn.task_type = 'ARTIFICIAL_FOLLOW_UP' THEN spmrn.follow_template_name
END AS 'templateName', END AS 'templateName',
CASE CASE
WHEN spmrn.task_type = 'PHONE_OUTBOUND' THEN spmrn.phone_template_id WHEN spmrn.task_type = 'PHONE_OUTBOUND' THEN spmrn.phone_id
WHEN spmrn.task_type = 'QUESTIONNAIRE_SCALE' THEN spmrn.question_info_id WHEN spmrn.task_type = 'QUESTIONNAIRE_SCALE' THEN spmrn.question_info_id
WHEN spmrn.task_type = 'ARTIFICIAL_FOLLOW_UP' THEN spmrn.follow_template_id WHEN spmrn.task_type = 'ARTIFICIAL_FOLLOW_UP' THEN spmrn.follow_template_id
END AS 'templateId' END AS 'templateId',
spmrn.node_execute_status,
spmrn.route_handle_remark
FROM FROM
sign_patient_manage_route spmr sign_patient_manage_route spmr
LEFT JOIN sign_patient_manage_route_node spmrn ON spmr.id = spmrn.manage_route_id LEFT JOIN sign_patient_manage_route_node spmrn ON spmr.id = spmrn.manage_route_id
@ -342,7 +345,7 @@
LEFT JOIN patient_visit_record pvr ON pi.patient_visit_record_id = pvr.id LEFT JOIN patient_visit_record pvr ON pi.patient_visit_record_id = pvr.id
<where> <where>
pi.del_flag = '0' AND spmr.task_create_type = 'MANUAL_CREATE' pi.del_flag = '0' AND spmr.task_create_type = 'MANUAL_CREATE'
AND spmrn.node_execute_status = 'UNEXECUTED' AND spmrn.route_check_status = 'AGREE'
AND spmrn.task_type in ('PHONE_OUTBOUND','QUESTIONNAIRE_SCALE','ARTIFICIAL_FOLLOW_UP') AND spmrn.task_type in ('PHONE_OUTBOUND','QUESTIONNAIRE_SCALE','ARTIFICIAL_FOLLOW_UP')
<if test="patientName != null and patientName != ''"> <if test="patientName != null and patientName != ''">
AND pi.patient_name LIKE concat('%', #{patientName}, '%') AND pi.patient_name LIKE concat('%', #{patientName}, '%')
@ -404,7 +407,17 @@
<if test="attendingPhysicianName != null and attendingPhysicianName != ''"> <if test="attendingPhysicianName != null and attendingPhysicianName != ''">
AND pi.attending_physician_name LIKE concat('%',#{attendingPhysicianName}, '%') AND pi.attending_physician_name LIKE concat('%',#{attendingPhysicianName}, '%')
</if> </if>
<if test="nodeExecuteStatus != null ">
AND spmrn.node_execute_status = #{nodeExecuteStatus}
</if>
<if test="followStartTime != null ">
AND pter.execute_time >= #{followStartTime}
</if>
<if test="followEndTime != null ">
AND pter.execute_time &lt;= #{followEndTime}
</if>
</where> </where>
order by spmr.create_time DESC
</select> </select>
<select id="selectFollowPatientInfo" <select id="selectFollowPatientInfo"

View File

@ -96,12 +96,38 @@
</where> </where>
</select> </select>
<select id="selectSignPatientManageRouteNodeById" parameterType="Long" <select id="selectSignPatientManageRouteNodeById" parameterType="Long" resultMap="SignPatientManageRouteNodeResult">
resultMap="SignPatientManageRouteNodeResult"> <include refid="selectSignPatientManageRouteNodeVo"/>
<include refid="selectSignPatientManageRouteNodeVo"/> where id = #{id}
where id = #{id}
</select> </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" <insert id="insertSignPatientManageRouteNode" parameterType="SignPatientManageRouteNode" useGeneratedKeys="true"
keyProperty="id"> keyProperty="id">
insert into sign_patient_manage_route_node insert into sign_patient_manage_route_node
@ -583,8 +609,8 @@
patient.address, patient.address,
patient.patient_type, patient.visit_method, patient.attending_physician_id, patient.attending_physician_name, patient.main_diagnosis, patient.patient_type, patient.visit_method, patient.attending_physician_id, patient.attending_physician_name, patient.main_diagnosis,
patient.hospital_agency_id, patient.hospital_agency_name, patient.campus_agency_id, patient.campus_agency_name, patient.hospital_agency_id, patient.hospital_agency_name, patient.campus_agency_id, patient.campus_agency_name,
patient.department_id, patient.department_name,patient.ward_id, patient.ward_name, patient.in_hospital_number, patient.visit_date, patient.department_id, patient.department_name,patient.ward_id, patient.ward_name, patient.in_hospital_number, patient.visit_date, patient.discharge_time,
patient.surgical_name, node.id as manageRouteNodeId, node.manage_route_id, node.manage_route_name,node.route_check_status patient.surgical_name,patient.sign_patient_record_id, node.id as manageRouteNodeId, node.manage_route_id, node.manage_route_name,node.route_check_status
from sign_patient_manage_route_node node from sign_patient_manage_route_node node
left join sign_patient_manage_route route on node.manage_route_id = route.id left join sign_patient_manage_route route on node.manage_route_id = route.id
left join patient_info patient on route.patient_id = patient.id left join patient_info patient on route.patient_id = patient.id
@ -595,9 +621,14 @@
<if test="mainDiagnosis != null and mainDiagnosis != ''"> <if test="mainDiagnosis != null and mainDiagnosis != ''">
and patient.main_diagnosis like concat('%', #{mainDiagnosis}, '%') and patient.main_diagnosis like concat('%', #{mainDiagnosis}, '%')
</if> </if>
<if test="routeCheckStatus != null "> <choose>
and node.route_check_status = #{routeCheckStatus} <when test="routeCheckStatus != null">
</if> and node.route_check_status = #{routeCheckStatus}
</when>
<otherwise>
and node.route_check_status is null
</otherwise>
</choose>
<if test="hospitalAgencyId != null "> <if test="hospitalAgencyId != null ">
and patient.hospital_agency_id = #{hospitalAgencyId} and patient.hospital_agency_id = #{hospitalAgencyId}
</if> </if>
@ -610,11 +641,11 @@
<if test="wardId != null "> <if test="wardId != null ">
and patient.ward_id = #{wardId} and patient.ward_id = #{wardId}
</if> </if>
<if test="visitDateStart != null "> <if test="dischargeTimeStart != null ">
and date_format(patient.visit_date,'%y%m%d') &gt;= date_format(#{visitDateStart},'%y%m%d') and date_format(patient.discharge_time,'%y%m%d') &gt;= date_format(#{dischargeTimeStart},'%y%m%d')
</if> </if>
<if test="visitDateEnd != null "> <if test="dischargeTimeEnd != null ">
and date_format(patient.visit_date,'%y%m%d') &lt;= date_format(#{visitDateEnd},'%y%m%d') and date_format(patient.discharge_time,'%y%m%d') &lt;= date_format(#{dischargeTimeEnd},'%y%m%d')
</if> </if>
</where> </where>
group by patient_id group by patient_id

View File

@ -411,7 +411,9 @@
left join sign_patient_manage_route route on route.sign_patient_record_id = sign.id left join sign_patient_manage_route route on route.sign_patient_record_id = sign.id
<where> <where>
sign.del_flag = 0 and sign.id = #{id} sign.del_flag = 0 and sign.id = #{id}
and route.task_create_type = 'MANUAL_MATCHE'
</where> </where>
LIMIT 1
</select> </select>
<select id="getByPatient" parameterType="java.lang.Long" resultType="com.xinelu.manage.vo.signpatientrecord.SignPatientRecordVo"> <select id="getByPatient" parameterType="java.lang.Long" resultType="com.xinelu.manage.vo.signpatientrecord.SignPatientRecordVo">

View File

@ -0,0 +1,54 @@
package com.xinelu.mobile.controller.appletpersoncenter;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.mobile.service.appletpersoncenter.AppletPersonCenterService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* @Description 院后小程序个人中心控制器
* @Author 纪寒
* @Date 2024-04-16 10:49:14
* @Version 1.0
*/
@RestController
@RequestMapping("/postDischargeApplet")
public class AppletPersonCenterController {
@Resource
private AppletPersonCenterService appletPersonCenterService;
/**
* 院后微信小程序一键登录接口
*
* @param loginCode 登录凭证
* @param phoneCode 获取手机号登录凭证
* @return 微信小程序用户登录信息
*/
@GetMapping("/appletLogin")
public AjaxResult appletLogin(@RequestParam("loginCode") String loginCode, @RequestParam("phoneCode") String phoneCode) {
if (StringUtils.isBlank(loginCode)) {
return AjaxResult.error("登录凭证编码不能为空!");
}
if (StringUtils.isBlank(phoneCode)) {
return AjaxResult.error("用户手机号凭证不存在");
}
return appletPersonCenterService.appletLogin(loginCode, phoneCode);
}
/**
* 根据居民表id查询患者个人信息
*
* @param residentId 居民表id
* @return 个人信息
*/
@GetMapping("/getResidentInfoById")
public AjaxResult getResidentInfoById(Long residentId) {
return appletPersonCenterService.getResidentInfoById(residentId);
}
}

View File

@ -0,0 +1,29 @@
package com.xinelu.mobile.service.appletpersoncenter;
import com.xinelu.common.core.domain.AjaxResult;
/**
* @Description 院后小程序个人中心业务层
* @Author 纪寒
* @Date 2024-04-16 10:51:28
* @Version 1.0
*/
public interface AppletPersonCenterService {
/**
* 院后微信小程序一键登录接口
*
* @param loginCode 登录凭证
* @param phoneCode 获取手机号登录凭证
* @return 微信小程序用户登录信息
*/
AjaxResult appletLogin(String loginCode, String phoneCode);
/**
* 根据居民表id查询患者个人信息
*
* @param residentId 居民表id
* @return 个人信息
*/
AjaxResult getResidentInfoById(Long residentId);
}

View File

@ -0,0 +1,123 @@
package com.xinelu.mobile.service.appletpersoncenter.Impl;
import com.xinelu.common.config.WeChatAppletChatConfig;
import com.xinelu.common.constant.Constants;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.manage.domain.residentinfo.ResidentInfo;
import com.xinelu.manage.mapper.residentinfo.ResidentInfoMapper;
import com.xinelu.mobile.service.appletpersoncenter.AppletPersonCenterService;
import com.xinelu.mobile.utils.WeChatAppletUtils;
import com.xinelu.mobile.vo.appletpersoncenter.PostDischargeAppletPhoneVO;
import com.xinelu.mobile.vo.appletpersoncenter.PostDischargeAppletVO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.Objects;
/**
* @Description 院后小程序个人中心业务层实现类
* @Author 纪寒
* @Date 2024-04-16 10:52:09
* @Version 1.0
*/
@Service
@Slf4j
public class AppletPersonCenterServiceImpl implements AppletPersonCenterService {
@Resource
private WeChatAppletUtils weChatAppletUtils;
@Resource
private WeChatAppletChatConfig weChatAppletChatConfig;
@Resource
private RedisTemplate<String, Object> redisTemplate;
@Resource
private ResidentInfoMapper residentInfoMapper;
/**
* 院后微信小程序一键登录接口
*
* @param loginCode 登录凭证
* @param phoneCode 获取手机号登录凭证
* @return 微信小程序用户登录信息
*/
@Override
public AjaxResult appletLogin(String loginCode, String phoneCode) {
//根据code获取用户的微信unionId以及openId等信息
PostDischargeAppletVO appletLoginInfo = weChatAppletUtils.getPostDischargeAppletLogin(weChatAppletChatConfig.getAppletId(), weChatAppletChatConfig.getSecret(), loginCode, weChatAppletChatConfig.getGrantType());
if (Objects.isNull(appletLoginInfo)) {
return AjaxResult.error("获取院后微信小程序用户信息失败");
}
if (Objects.nonNull(appletLoginInfo.getErrcode()) && appletLoginInfo.getErrcode() != Constants.SUCCESS_CODE) {
return AjaxResult.error("获取院后微信小程序用户信息失败,失败信息为:" + appletLoginInfo.getErrmsg());
}
//获取微信accessToken
String accessToken;
String accessTokenKey = Constants.POST_DISCHARGE_APPLET_ACCESS_TOKEN + "accessToken";
//从Redis中取出accessToken
Object object = redisTemplate.opsForValue().get(accessTokenKey);
if (Objects.isNull(object)) {
accessToken = weChatAppletUtils.getWeChatAppletAccessToken();
} else {
accessToken = (String) object;
}
//获取用户手机号
PostDischargeAppletPhoneVO appletPhoneInfo = weChatAppletUtils.getPostDischargeAppletPhone(phoneCode, accessToken);
if (Objects.isNull(appletPhoneInfo)) {
return AjaxResult.error("获取用户手机号失败");
}
if (Objects.nonNull(appletPhoneInfo.getErrcode()) && appletPhoneInfo.getErrcode() == Constants.ERROR_ACCESS_CODE) {
//当前Redis缓存中的access_token无效直接删除
if (Objects.nonNull(object)) {
redisTemplate.delete(accessTokenKey);
//删除之后重新获取获取accessToken
accessToken = weChatAppletUtils.getWeChatAppletAccessToken();
appletPhoneInfo = weChatAppletUtils.getPostDischargeAppletPhone(phoneCode, accessToken);
if (Objects.isNull(appletPhoneInfo)) {
return AjaxResult.error("获取用户手机号失败");
}
if (Objects.nonNull(appletPhoneInfo.getErrcode()) && appletPhoneInfo.getErrcode() == Constants.ERROR_ACCESS_CODE) {
return AjaxResult.error("登录失败!");
}
}
}
if (StringUtils.isNotBlank(appletPhoneInfo.getErrmsg()) && !Constants.OK.equals(appletPhoneInfo.getErrmsg())) {
return AjaxResult.error("获取用户手机号失败,失败信息为:" + appletPhoneInfo.getErrmsg());
}
//根据手机号和微信小程序openid判断当前用户是否存在
String phone = StringUtils.isBlank(appletPhoneInfo.getPhoneInfo().getPhoneNumber()) ? "" : appletPhoneInfo.getPhoneInfo().getPhoneNumber();
String openId = StringUtils.isBlank(appletLoginInfo.getOpenid()) ? "" : appletLoginInfo.getOpenid();
ResidentInfo residentInfoByPhone = residentInfoMapper.getResidentInfoByPhoneAndOpenId(null, openId);
ResidentInfo residentInfo = new ResidentInfo();
//居民信息为空新增个人信息
if (Objects.isNull(residentInfoByPhone)) {
residentInfo.setOpenId(openId);
residentInfo.setPatientPhone(phone);
residentInfo.setCreateTime(LocalDateTime.now());
residentInfoMapper.insertResidentInfo(residentInfo);
residentInfo.setId(residentInfo.getId());
return AjaxResult.success(residentInfo);
}
//更新居民信息的openid等微信标识信息
residentInfo.setId(residentInfoByPhone.getId());
residentInfo.setOpenId(openId);
residentInfo.setPatientPhone(StringUtils.isBlank(residentInfoByPhone.getPatientPhone()) ? "" : residentInfoByPhone.getPatientPhone());
residentInfo.setUpdateTime(LocalDateTime.now());
residentInfoMapper.updateResidentInfo(residentInfo);
return AjaxResult.success(residentInfo);
}
/**
* 根据居民表id查询患者个人信息
*
* @param residentId 居民表id
* @return 个人信息
*/
@Override
public AjaxResult getResidentInfoById(Long residentId) {
return AjaxResult.success(residentInfoMapper.selectResidentInfoById(residentId));
}
}

View File

@ -6,11 +6,15 @@ import com.xinelu.common.constant.Constants;
import com.xinelu.common.entity.AccessToken; import com.xinelu.common.entity.AccessToken;
import com.xinelu.common.exception.ServiceException; import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.http.HttpUtils; import com.xinelu.common.utils.http.HttpUtils;
import com.xinelu.mobile.vo.appletpersoncenter.PostDischargeAppletPhoneVO;
import com.xinelu.mobile.vo.appletpersoncenter.PostDischargeAppletVO;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects; import java.util.Objects;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
@ -68,4 +72,50 @@ public class WeChatAppletUtils {
} }
return accessToken; return accessToken;
} }
/**
* 根据登录编码获取微信小程序用户信息
*
* @param appletId 小程序id
* @param secret 小程序秘钥
* @param code 登录凭证码
* @param grantType 授权类型
* @return 登录信息
*/
public PostDischargeAppletVO getPostDischargeAppletLogin(String appletId, String secret, String code, String grantType) {
//请求地址
String appletLoginUrl = Constants.APPLET_LOGIN_URL
+ "?appid=" + appletId
+ "&secret=" + secret
+ "&js_code=" + code
+ "&grant_type=" + grantType;
//发送请求
String result = HttpUtils.sendGet(appletLoginUrl);
if (StringUtils.isBlank(result)) {
throw new ServiceException("获取院后微信小程序用户信息失败", 201);
}
return JSON.parseObject(result, PostDischargeAppletVO.class);
}
/**
* 获取院后微信小程序的手机号码
*
* @param code 登录凭证
* @param accessToken 小程序accessToken
* @return 手机信息
*/
public PostDischargeAppletPhoneVO getPostDischargeAppletPhone(String code, String accessToken) {
//请求地址
String phoneUrl = Constants.PHONE_NUMBER_URL + accessToken;
//请求参数
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("code", code);
String param = JSON.toJSONString(paramMap);
//发送POST请求
String result = HttpUtils.sendPostJson(phoneUrl, param);
if (StringUtils.isBlank(result)) {
throw new ServiceException("获取院后微信小程序手机号失败", 201);
}
return JSON.parseObject(result, PostDischargeAppletPhoneVO.class);
}
} }

View File

@ -0,0 +1,85 @@
package com.xinelu.mobile.vo.appletpersoncenter;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Description 获取小程序用户手机号实体类
* @Author 纪寒
* @Date 2024-04-16 11:15:53
* @Version 1.0
*/
@NoArgsConstructor
@Data
public class PostDischargeAppletPhoneVO implements Serializable {
private static final long serialVersionUID = 7053513139462975391L;
/**
* 错误编码
* 0成功
* -1系统繁忙此时请开发者稍候再试
* 40029不合法的codecode不存在已过期或者使用过
*/
@JsonProperty("errcode")
private Integer errcode;
/**
* 返回提示信息ok成功
*/
@JsonProperty("errmsg")
private String errmsg;
/**
* 电话信息实体类
*/
@JsonProperty("phone_info")
private PhoneInfoDTO phoneInfo;
@NoArgsConstructor
@Data
public static class PhoneInfoDTO {
/**
* 用户绑定的手机号国外手机号会有区号
*/
@JsonProperty("phoneNumber")
private String phoneNumber;
/**
* 没有区号的手机号
*/
@JsonProperty("purePhoneNumber")
private String purePhoneNumber;
/**
* 区号
*/
@JsonProperty("countryCode")
private Integer countryCode;
/**
* 数据水印
*/
@JsonProperty("watermark")
private WatermarkDTO watermark;
@NoArgsConstructor
@Data
public static class WatermarkDTO {
/**
* 用户获取手机号操作的时间戳
*/
@JsonProperty("timestamp")
private Integer timestamp;
/**
* 小程序appid
*/
@JsonProperty("appid")
private String appid;
}
}
}

View File

@ -0,0 +1,39 @@
package com.xinelu.mobile.vo.appletpersoncenter;
import lombok.Data;
import java.io.Serializable;
/**
* @Description 院后微信小程序用户信息实体类
* @Author 纪寒
* @Date 2024-04-16 10:56:22
* @Version 1.0
*/
@Data
public class PostDischargeAppletVO implements Serializable {
private static final long serialVersionUID = 9163624256938346478L;
/**
* 小程序unionid
*/
private String unionid;
/**
* 小程序openid
*/
private String openid;
/**
* 错误状态码40029js_code无效45011API 调用太频繁请稍候再试
* 40226高风险等级用户小程序登录拦截 -1系统繁忙此时请开发者稍候再试
*/
private Integer errcode;
/**
* 状态信息取值有40029code 无效
* 45011api minute-quota reach limit mustslower retry next minute
* 40226code blocked
* -1system error
*/
private String errmsg;
}

View File

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

View File

@ -0,0 +1,54 @@
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;
/**
* @description: 患者签约服务包到期状态修改定时任务
* @author: haown
* @create: 2024-04-10 10:23
**/
@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);
}
}
}
}