From 909f311f512b9fc226ffa16550eb27eb229cf953 Mon Sep 17 00:00:00 2001 From: youxilong Date: Wed, 10 Apr 2024 17:37:01 +0800 Subject: [PATCH 01/20] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=BA=E5=B7=A5?= =?UTF-8?q?=E9=9A=8F=E8=AE=BF=E4=BB=A3=E5=8A=9E=E5=A4=84=E7=90=86,?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A0=B9=E6=8D=AEid=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=86=85=E5=AE=B9=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/dto/manualfollowup/ManualFollowUpDTO.java | 3 +++ .../PatientQuestionSubmitResultDTO.java | 3 +++ .../servicewaycontent/ServiceWayContentEditDTO.java | 7 +++++++ .../impl/ServiceWayContentServiceImpl.java | 3 +++ .../manage/vo/manualfollowup/ManualFollowUpVO.java | 6 ++++++ .../vo/servicefrequency/ServiceFrequencyVO.java | 5 +++++ .../ServiceWayContentAndFrequencyVO.java | 3 +++ .../labelfieldcontent/LabelFieldContentMapper.xml | 1 + .../manage/labelfieldinfo/LabelFieldInfoMapper.xml | 1 + .../servicewaycontent/ServiceWayContentMapper.xml | 7 +++++-- .../SignPatientManageRouteMapper.xml | 12 +++++++++--- 11 files changed, 46 insertions(+), 5 deletions(-) diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/dto/manualfollowup/ManualFollowUpDTO.java b/postdischarge-manage/src/main/java/com/xinelu/manage/dto/manualfollowup/ManualFollowUpDTO.java index d000e5cb..6c13a524 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/dto/manualfollowup/ManualFollowUpDTO.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/dto/manualfollowup/ManualFollowUpDTO.java @@ -89,5 +89,8 @@ public class ManualFollowUpDTO { @ApiModelProperty(value = "主治医生姓名") private String attendingPhysicianName; + @ApiModelProperty(value = "节点任务执行状态,已执行:EXECUTED,未执行:UNEXECUTED") + private String nodeExecuteStatus; + } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/dto/patientquestionsubmitresult/PatientQuestionSubmitResultDTO.java b/postdischarge-manage/src/main/java/com/xinelu/manage/dto/patientquestionsubmitresult/PatientQuestionSubmitResultDTO.java index de1a9c66..da91fbfe 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/dto/patientquestionsubmitresult/PatientQuestionSubmitResultDTO.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/dto/patientquestionsubmitresult/PatientQuestionSubmitResultDTO.java @@ -28,6 +28,9 @@ public class PatientQuestionSubmitResultDTO extends PatientQuestionSubmitResult @ApiModelProperty(value = "任务处理信息") private String routeHandleRemark; + @ApiModelProperty(value = "患者就诊记录基本信息表id") + private Long visitRecordId; + /** * 患者问卷题目提交结果信息 */ diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/dto/servicewaycontent/ServiceWayContentEditDTO.java b/postdischarge-manage/src/main/java/com/xinelu/manage/dto/servicewaycontent/ServiceWayContentEditDTO.java index ef8b930e..2f94b56f 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/dto/servicewaycontent/ServiceWayContentEditDTO.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/dto/servicewaycontent/ServiceWayContentEditDTO.java @@ -69,4 +69,11 @@ public class ServiceWayContentEditDTO { @ApiModelProperty(value = "服务频次数字结束值") @Excel(name = "服务频次数字结束值") private Integer serviceFrequencyEnd; + + /** + * 排序 + */ + @ApiModelProperty(value = "排序") + @Excel(name = "排序") + private Integer serviceSort; } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/servicewaycontent/impl/ServiceWayContentServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/servicewaycontent/impl/ServiceWayContentServiceImpl.java index 740b0fc9..5df68904 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/servicewaycontent/impl/ServiceWayContentServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/servicewaycontent/impl/ServiceWayContentServiceImpl.java @@ -94,6 +94,7 @@ public class ServiceWayContentServiceImpl implements IServiceWayContentService { serviceFrequency.setServiceFrequencyEnd(serviceWayContentAddDTO.getServiceFrequencyEnd()); serviceFrequency.setCreateBy(username); serviceFrequency.setCreateTime(LocalDateTime.now()); + serviceFrequency.setServiceSort(serviceWayContentAddDTO.getServiceSort()); if (serviceWayContentMapper.insertServiceWayContent(serviceFrequency) <= 0) { throw new ServiceException("新增服务频次失败"); } @@ -119,6 +120,7 @@ public class ServiceWayContentServiceImpl implements IServiceWayContentService { serviceFrequency.setCreateBy(username); serviceFrequency.setCreateTime(LocalDateTime.now()); serviceFrequency.setServiceSort(serviceWayContentAddDTO.getServiceSort()); + serviceFrequency.setServiceSort(serviceWayContentAddDTO.getServiceSort()); if (serviceWayContentMapper.insertServiceWayContent(serviceFrequency) <= 0) { throw new ServiceException("新增服务频次失败"); } @@ -192,6 +194,7 @@ public class ServiceWayContentServiceImpl implements IServiceWayContentService { currentFrequency.setServiceFrequencyText(serviceWayContentEditDTO.getServiceFrequencyText()); currentFrequency.setServiceFrequencyStart(serviceWayContentEditDTO.getServiceFrequencyStart()); currentFrequency.setServiceFrequencyEnd(serviceWayContentEditDTO.getServiceFrequencyEnd()); + currentFrequency.setServiceSort(serviceWayContentEditDTO.getServiceSort()); currentFrequency.setUpdateBy(username); currentFrequency.setUpdateTime(LocalDateTime.now()); diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/vo/manualfollowup/ManualFollowUpVO.java b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/manualfollowup/ManualFollowUpVO.java index 7852b9a4..af46bc5d 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/vo/manualfollowup/ManualFollowUpVO.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/manualfollowup/ManualFollowUpVO.java @@ -114,5 +114,11 @@ public class ManualFollowUpVO { @ApiModelProperty(value = "模板id") private String templateId; + @ApiModelProperty(value = "节点任务执行状态,已执行:EXECUTED,未执行:UNEXECUTED") + private String nodeExecuteStatus; + + @ApiModelProperty(value = "任务执行记录id") + private Long taskExecuteRecordId; + } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/vo/servicefrequency/ServiceFrequencyVO.java b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/servicefrequency/ServiceFrequencyVO.java index 2a33f507..c3388634 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/vo/servicefrequency/ServiceFrequencyVO.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/servicefrequency/ServiceFrequencyVO.java @@ -48,4 +48,9 @@ public class ServiceFrequencyVO { @ApiModelProperty(value = "服务频次数字结束值") @Excel(name = "服务频次数字结束值") private Integer serviceFrequencyEnd; + + @ApiModelProperty(value = "服务频次排序") + private Integer serviceFrequencySort; + + } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/vo/servicewaycontent/ServiceWayContentAndFrequencyVO.java b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/servicewaycontent/ServiceWayContentAndFrequencyVO.java index 33c53622..e739575d 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/vo/servicewaycontent/ServiceWayContentAndFrequencyVO.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/servicewaycontent/ServiceWayContentAndFrequencyVO.java @@ -67,4 +67,7 @@ public class ServiceWayContentAndFrequencyVO { @ApiModelProperty(value = "服务频次数字结束值") @Excel(name = "服务频次数字结束值") private Integer serviceFrequencyEnd; + + @ApiModelProperty(value = "服务频次排序") + private Integer serviceFrequencySort; } diff --git a/postdischarge-manage/src/main/resources/mapper/manage/labelfieldcontent/LabelFieldContentMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/labelfieldcontent/LabelFieldContentMapper.xml index 22d2dff0..d70a18b7 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/labelfieldcontent/LabelFieldContentMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/labelfieldcontent/LabelFieldContentMapper.xml @@ -77,6 +77,7 @@ #{fieldMark} + order by create_time DESC diff --git a/postdischarge-manage/src/main/resources/mapper/manage/servicewaycontent/ServiceWayContentMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/servicewaycontent/ServiceWayContentMapper.xml index 0a673901..2ac19b57 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/servicewaycontent/ServiceWayContentMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/servicewaycontent/ServiceWayContentMapper.xml @@ -35,6 +35,7 @@ + @@ -155,7 +156,8 @@ swc2.service_frequency_type, swc2.service_frequency_text, swc2.service_frequency_start, - swc2.service_frequency_end + swc2.service_frequency_end, + swc2.service_sort AS 'serviceFrequencySort' FROM service_way_content swc1 JOIN service_way_content swc2 on swc1.id = swc2.service_content_id @@ -185,7 +187,8 @@ swc1.service_frequency_type, swc1.service_frequency_text, swc1.service_frequency_start, - swc1.service_frequency_end + swc1.service_frequency_end, + swc1.service_sort AS 'serviceFrequencySort' FROM service_way_content swc1 LEFT JOIN service_way_content swc2 ON swc1.service_content_id = swc2.id WHERE swc1.service_type = 'SERVICE_FREQUENCY' diff --git a/postdischarge-manage/src/main/resources/mapper/manage/signpatientmanageroute/SignPatientManageRouteMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/signpatientmanageroute/SignPatientManageRouteMapper.xml index abc1ccb4..c74b4663 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/signpatientmanageroute/SignPatientManageRouteMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/signpatientmanageroute/SignPatientManageRouteMapper.xml @@ -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.discharge_time IS NOT NULL THEN 'DISCHARGE' END AS 'suitRange', + pter.id AS 'taskExecuteRecordId', pter.execute_time AS 'executeTime', spmr.id AS 'manageRouteId', spmrn.id AS 'manageRouteNodeId', @@ -330,10 +331,11 @@ WHEN spmrn.task_type = 'ARTIFICIAL_FOLLOW_UP' THEN spmrn.follow_template_name END AS 'templateName', 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 = 'ARTIFICIAL_FOLLOW_UP' THEN spmrn.follow_template_id - END AS 'templateId' + END AS 'templateId', + spmrn.node_execute_status FROM sign_patient_manage_route spmr LEFT JOIN sign_patient_manage_route_node spmrn ON spmr.id = spmrn.manage_route_id @@ -342,7 +344,7 @@ LEFT JOIN patient_visit_record pvr ON pi.patient_visit_record_id = pvr.id 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 pi.patient_name LIKE concat('%', #{patientName}, '%') @@ -404,7 +406,11 @@ AND pi.attending_physician_name LIKE concat('%',#{attendingPhysicianName}, '%') + + AND spmrn.node_execute_status = #{nodeExecuteStatus} + + order by spmr.create_time DESC - + + where id = #{id} + + insert into sign_patient_manage_route_node diff --git a/postdischarge-quartz/pom.xml b/postdischarge-quartz/pom.xml index af1c982a..68783c4b 100644 --- a/postdischarge-quartz/pom.xml +++ b/postdischarge-quartz/pom.xml @@ -32,6 +32,10 @@ com.xinelu postdischarge-common + + com.xinelu + postdischarge-manage + \ No newline at end of file diff --git a/postdischarge-quartz/src/main/java/com/xinelu/quartz/task/SignPackageExpireTask.java b/postdischarge-quartz/src/main/java/com/xinelu/quartz/task/SignPackageExpireTask.java index 393e944c..0af40125 100644 --- a/postdischarge-quartz/src/main/java/com/xinelu/quartz/task/SignPackageExpireTask.java +++ b/postdischarge-quartz/src/main/java/com/xinelu/quartz/task/SignPackageExpireTask.java @@ -1,5 +1,16 @@ package com.xinelu.quartz.task; +import com.xinelu.common.constant.SignRecordServiceStatusConstants; +import com.xinelu.manage.domain.patientinfo.PatientInfo; +import com.xinelu.manage.domain.signpatientrecord.SignPatientRecord; +import com.xinelu.manage.dto.signpatientrecord.SignPatientListDto; +import com.xinelu.manage.mapper.patientinfo.PatientInfoMapper; +import com.xinelu.manage.mapper.signpatientrecord.SignPatientRecordMapper; +import com.xinelu.manage.service.signpatientrecord.ISignPatientRecordService; +import com.xinelu.manage.vo.signpatientrecord.SignPatientListVo; +import java.time.LocalDateTime; +import java.util.List; +import javax.annotation.Resource; import org.springframework.stereotype.Component; /** @@ -9,7 +20,35 @@ import org.springframework.stereotype.Component; **/ @Component("SignPackageExpireTask") public class SignPackageExpireTask { + @Resource + private ISignPatientRecordService signPatientRecordService; + + @Resource + private SignPatientRecordMapper signPatientRecordMapper; + + @Resource + private PatientInfoMapper patientInfoMapper; + public void SignPackageExpireTask() { // 查询签约患者 + SignPatientListDto signPatientListDto = new SignPatientListDto(); + signPatientListDto.setSignStatus(SignRecordServiceStatusConstants.SERVICE_CENTER); + List 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); + } + } } } From 306e29477c7329cfab7d82171a504a7a21065466 Mon Sep 17 00:00:00 2001 From: zhangheng <3226558941@qq.com> Date: Thu, 11 Apr 2024 18:01:57 +0800 Subject: [PATCH 10/20] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/enums/TaskCreateTypeEnum.java | 29 +++++++++++++++++++ .../SignPatientManageRouteServiceImpl.java | 2 ++ 2 files changed, 31 insertions(+) create mode 100644 postdischarge-common/src/main/java/com/xinelu/common/enums/TaskCreateTypeEnum.java diff --git a/postdischarge-common/src/main/java/com/xinelu/common/enums/TaskCreateTypeEnum.java b/postdischarge-common/src/main/java/com/xinelu/common/enums/TaskCreateTypeEnum.java new file mode 100644 index 00000000..38f6f76c --- /dev/null +++ b/postdischarge-common/src/main/java/com/xinelu/common/enums/TaskCreateTypeEnum.java @@ -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; + } +} \ No newline at end of file diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroute/impl/SignPatientManageRouteServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroute/impl/SignPatientManageRouteServiceImpl.java index f41efcdc..a73c5c7d 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroute/impl/SignPatientManageRouteServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroute/impl/SignPatientManageRouteServiceImpl.java @@ -4,6 +4,7 @@ import com.xinelu.common.constant.TaskCreateTypeConstant; import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.common.enums.NodeExecuteStatusEnum; import com.xinelu.common.enums.TaskContentEnum; +import com.xinelu.common.enums.TaskCreateTypeEnum; import com.xinelu.common.exception.ServiceException; import com.xinelu.common.utils.AgeUtil; import com.xinelu.common.utils.SecurityUtils; @@ -97,6 +98,7 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout @Override public AjaxResult insertSignPatientManageRoute(SignPatientManageRouteVO signPatientManageRoute) { //新增主表 + signPatientManageRoute.setTaskCreateType(TaskCreateTypeEnum.MANUAL_CREATE.getInfo()); signPatientManageRoute.setCreateBy(SecurityUtils.getUsername()); signPatientManageRoute.setCreateTime(LocalDateTime.now()); int insertRoute = signPatientManageRouteMapper.insertSignPatientManageRoute(signPatientManageRoute); From e7a4d1494d4f98dfcec79db9e8a72b29500310ad Mon Sep 17 00:00:00 2001 From: youxilong Date: Fri, 12 Apr 2024 10:13:31 +0800 Subject: [PATCH 11/20] =?UTF-8?q?=E4=BA=BA=E5=B7=A5=E9=9A=8F=E8=AE=BF?= =?UTF-8?q?=E4=BB=A3=E5=8A=9E=E6=9F=A5=E8=AF=A2=E5=88=97=E8=A1=A8=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E6=95=B0=E6=8D=AE=E6=96=B0=E5=A2=9E=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/xinelu/manage/vo/manualfollowup/ManualFollowUpVO.java | 3 +++ .../signpatientmanageroute/SignPatientManageRouteMapper.xml | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/vo/manualfollowup/ManualFollowUpVO.java b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/manualfollowup/ManualFollowUpVO.java index af46bc5d..f15e1ad1 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/vo/manualfollowup/ManualFollowUpVO.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/manualfollowup/ManualFollowUpVO.java @@ -120,5 +120,8 @@ public class ManualFollowUpVO { @ApiModelProperty(value = "任务执行记录id") private Long taskExecuteRecordId; + @ApiModelProperty(value = "任务处理信息") + private String routeHandleRemark; + } diff --git a/postdischarge-manage/src/main/resources/mapper/manage/signpatientmanageroute/SignPatientManageRouteMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/signpatientmanageroute/SignPatientManageRouteMapper.xml index c74b4663..fa8516b6 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/signpatientmanageroute/SignPatientManageRouteMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/signpatientmanageroute/SignPatientManageRouteMapper.xml @@ -335,7 +335,8 @@ WHEN spmrn.task_type = 'QUESTIONNAIRE_SCALE' THEN spmrn.question_info_id WHEN spmrn.task_type = 'ARTIFICIAL_FOLLOW_UP' THEN spmrn.follow_template_id END AS 'templateId', - spmrn.node_execute_status + spmrn.node_execute_status, + spmrn.route_handle_remark FROM sign_patient_manage_route spmr LEFT JOIN sign_patient_manage_route_node spmrn ON spmr.id = spmrn.manage_route_id From 7e907edcd84c4a606d4b351e9f317d270c6913b0 Mon Sep 17 00:00:00 2001 From: zhangheng <3226558941@qq.com> Date: Fri, 12 Apr 2024 10:17:24 +0800 Subject: [PATCH 12/20] =?UTF-8?q?=E6=97=B6=E9=97=B4=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SignPatientManageRouteController.java | 2 -- .../PatientTaskExecuteRecordMapper.xml | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/signpatientmanageroute/SignPatientManageRouteController.java b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/signpatientmanageroute/SignPatientManageRouteController.java index bda7141e..3e59512f 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/signpatientmanageroute/SignPatientManageRouteController.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/signpatientmanageroute/SignPatientManageRouteController.java @@ -118,6 +118,4 @@ public class SignPatientManageRouteController extends BaseController { public AjaxResult addPatientQuestionResult(@RequestBody PatientQuestionSubmitResultDTO dto) { return signPatientManageRouteService.addPatientQuestionResult(dto); } - - } diff --git a/postdischarge-manage/src/main/resources/mapper/manage/patienttaskexecuterecord/PatientTaskExecuteRecordMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/patienttaskexecuterecord/PatientTaskExecuteRecordMapper.xml index d098acca..d1a1d5ba 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/patienttaskexecuterecord/PatientTaskExecuteRecordMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/patienttaskexecuterecord/PatientTaskExecuteRecordMapper.xml @@ -141,10 +141,10 @@ and pi.visit_method = #{visitMethod} - and pter.execute_time <= #{startDate} + and pter.execute_time >=#{startDate} - and pter.execute_time >= #{endDate} + and pter.execute_time <= #{endDate} and pter.manage_route_name like concat('%', #{manageRouteName}, '%') From 96e93196e5321ce92c249c4c2bb4dcf9f7eab7ed Mon Sep 17 00:00:00 2001 From: youxilong Date: Fri, 12 Apr 2024 10:20:01 +0800 Subject: [PATCH 13/20] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E8=AE=B0=E5=BD=95=E5=88=97=E8=A1=A8=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PatientTaskExecuteRecordMapper.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/postdischarge-manage/src/main/resources/mapper/manage/patienttaskexecuterecord/PatientTaskExecuteRecordMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/patienttaskexecuterecord/PatientTaskExecuteRecordMapper.xml index d1a1d5ba..e49d2be9 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/patienttaskexecuterecord/PatientTaskExecuteRecordMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/patienttaskexecuterecord/PatientTaskExecuteRecordMapper.xml @@ -140,10 +140,10 @@ and pi.visit_method = #{visitMethod} - + and pter.execute_time >=#{startDate} - + and pter.execute_time <= #{endDate} From f57352a5d5871b7119f6cb4350154e23bb944dda Mon Sep 17 00:00:00 2001 From: youxilong Date: Fri, 12 Apr 2024 12:48:30 +0800 Subject: [PATCH 14/20] =?UTF-8?q?=E4=BA=BA=E5=B7=A5=E9=9A=8F=E8=AE=BF?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=9F=A5=E8=AF=A2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../signpatientmanageroute/SignPatientManageRouteMapper.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/postdischarge-manage/src/main/resources/mapper/manage/signpatientmanageroute/SignPatientManageRouteMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/signpatientmanageroute/SignPatientManageRouteMapper.xml index fa8516b6..8e4676bf 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/signpatientmanageroute/SignPatientManageRouteMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/signpatientmanageroute/SignPatientManageRouteMapper.xml @@ -410,6 +410,12 @@ AND spmrn.node_execute_status = #{nodeExecuteStatus} + + AND pter.execute_time >= #{followStartTime} + + + AND pter.execute_time <= #{followEndTime} + order by spmr.create_time DESC From f8a808e5bab1531e6c3d36585acca5d456c78dad Mon Sep 17 00:00:00 2001 From: zhangheng <3226558941@qq.com> Date: Fri, 12 Apr 2024 14:47:37 +0800 Subject: [PATCH 15/20] =?UTF-8?q?=E9=97=AE=E5=8D=B7=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../questioninfo/QuestionInfoController.java | 4 ++-- .../manage/domain/questioninfo/QuestionInfo.java | 6 ++++++ .../mapper/questioninfo/QuestionInfoMapper.java | 2 +- .../questioninfo/IQuestionInfoService.java | 2 +- .../impl/QuestionInfoServiceImpl.java | 5 +++-- .../impl/SignPatientManageRouteServiceImpl.java | 3 +++ .../impl/SpecialDiseaseNodeServiceImpl.java | 1 + .../impl/SpecialDiseaseRouteServiceImpl.java | 3 +++ .../manage/questioninfo/QuestionInfoMapper.xml | 15 +++++++++++++++ 9 files changed, 35 insertions(+), 6 deletions(-) diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/questioninfo/QuestionInfoController.java b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/questioninfo/QuestionInfoController.java index bc5f659c..66ae1903 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/questioninfo/QuestionInfoController.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/questioninfo/QuestionInfoController.java @@ -110,7 +110,7 @@ public class QuestionInfoController extends BaseController { * 科室问卷数量 */ @GetMapping("/departmentQuestionCount") - public AjaxResult departmentQuestionCount(String departmentName, String questionnaireStatus) { - return questionInfoService.departmentQuestionCount(departmentName, questionnaireStatus); + public AjaxResult departmentQuestionCount(String departmentName, String questionnaireStatus,String questionType) { + return questionInfoService.departmentQuestionCount(departmentName, questionnaireStatus,questionType); } } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/questioninfo/QuestionInfo.java b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/questioninfo/QuestionInfo.java index 28bd2f82..89a66ff9 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/questioninfo/QuestionInfo.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/questioninfo/QuestionInfo.java @@ -123,6 +123,12 @@ public class QuestionInfo extends BaseEntity { @Excel(name = "问卷备注信息") private String questionnaireRemark; + /** + * 问卷类型,普通问卷:REGULAR_QUESTIONNAIRE,满意度问卷:SATISFACTION_QUESTIONNAIRE + */ + @ApiModelProperty(value = "问卷类型") + @Excel(name = "问卷类型") + private String questionType; @Override public String toString() { diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/questioninfo/QuestionInfoMapper.java b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/questioninfo/QuestionInfoMapper.java index f1482991..64d2e8ac 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/questioninfo/QuestionInfoMapper.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/questioninfo/QuestionInfoMapper.java @@ -69,5 +69,5 @@ public interface QuestionInfoMapper { * @param questionnaireStatus 问卷状态 * @return DepartmentVO */ - List departmentQuestionByDepartmentName(@Param("departmentName") String departmentName, @Param("questionnaireStatus") String questionnaireStatus); + List departmentQuestionByDepartmentName(@Param("departmentName") String departmentName, @Param("questionnaireStatus") String questionnaireStatus, @Param("questionType") String questionType); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/questioninfo/IQuestionInfoService.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/questioninfo/IQuestionInfoService.java index e36fc62a..486d98d8 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/questioninfo/IQuestionInfoService.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/questioninfo/IQuestionInfoService.java @@ -75,5 +75,5 @@ public interface IQuestionInfoService { * @param departmentName 科室名称 * @return AjaxResult */ - AjaxResult departmentQuestionCount(String departmentName, String questionnaireStatus); + AjaxResult departmentQuestionCount(String departmentName, String questionnaireStatus,String questionType); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/questioninfo/impl/QuestionInfoServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/questioninfo/impl/QuestionInfoServiceImpl.java index 75775b5e..90a55a41 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/questioninfo/impl/QuestionInfoServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/questioninfo/impl/QuestionInfoServiceImpl.java @@ -255,6 +255,7 @@ public class QuestionInfoServiceImpl implements IQuestionInfoService { * @param questionInfo 问卷基本信息 * @return 结果 */ + @Transactional(rollbackFor = Exception.class) @Override public AjaxResult updateQuestionByDepartment(QuestionInfo questionInfo) { if (Objects.isNull(questionInfo) || Objects.isNull(questionInfo.getId())) { @@ -294,12 +295,12 @@ public class QuestionInfoServiceImpl implements IQuestionInfoService { * @return AjaxResult */ @Override - public AjaxResult departmentQuestionCount(String departmentName, String questionnaireStatus) { + public AjaxResult departmentQuestionCount(String departmentName, String questionnaireStatus, String questionType) { DepartmentVO departmentVO = new DepartmentVO(); List department = new ArrayList<>(); departmentVO.setDepartmentName("全部"); departmentVO.setCountNum(0); - List departmentVOS = questionInfoMapper.departmentQuestionByDepartmentName(departmentName, questionnaireStatus); + List departmentVOS = questionInfoMapper.departmentQuestionByDepartmentName(departmentName, questionnaireStatus, questionType); if (CollectionUtils.isNotEmpty(departmentVOS)) { Integer result = departmentVOS.stream().mapToInt(DepartmentVO::getCountNum).sum(); departmentVO.setCountNum(result); diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroute/impl/SignPatientManageRouteServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroute/impl/SignPatientManageRouteServiceImpl.java index a73c5c7d..190b8613 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroute/impl/SignPatientManageRouteServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroute/impl/SignPatientManageRouteServiceImpl.java @@ -95,6 +95,7 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout * @param signPatientManageRoute 签约患者管理任务路径 * @return 结果 */ + @Transactional(rollbackFor = Exception.class) @Override public AjaxResult insertSignPatientManageRoute(SignPatientManageRouteVO signPatientManageRoute) { //新增主表 @@ -138,6 +139,7 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout * @param signPatientManageRoute 签约患者管理任务路径 * @return 结果 */ + @Transactional(rollbackFor = Exception.class) @Override public AjaxResult updateSignPatientManageRoute(SignPatientManageRouteVO signPatientManageRoute) { int deleteRouteNodeCount = signPatientManageRouteNodeMapper.deleteRouteNodeByManageRouteId(signPatientManageRoute.getSignPatientManageRouteId()); @@ -186,6 +188,7 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout * @param ids 需要删除的签约患者管理任务路径主键 * @return 结果 */ + @Transactional(rollbackFor = Exception.class) @Override public int deleteSignPatientManageRouteByIds(Long[] ids) { return signPatientManageRouteMapper.deleteSignPatientManageRouteByIds(ids); diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/specialdiseasenode/impl/SpecialDiseaseNodeServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/specialdiseasenode/impl/SpecialDiseaseNodeServiceImpl.java index c5525fde..8abc07c2 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/specialdiseasenode/impl/SpecialDiseaseNodeServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/specialdiseasenode/impl/SpecialDiseaseNodeServiceImpl.java @@ -163,6 +163,7 @@ public class SpecialDiseaseNodeServiceImpl implements ISpecialDiseaseNodeService * @param specialDiseaseNode 节点信息 * @return AjaxResult */ + @Transactional(rollbackFor = Exception.class) @Override public AjaxResult updateRouteCheckStatus(SpecialDiseaseNode specialDiseaseNode) { if (Objects.isNull(specialDiseaseNode) || Objects.isNull(specialDiseaseNode.getId())) { diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/specialdiseaseroute/impl/SpecialDiseaseRouteServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/specialdiseaseroute/impl/SpecialDiseaseRouteServiceImpl.java index 44c2a65a..bb6a904c 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/specialdiseaseroute/impl/SpecialDiseaseRouteServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/specialdiseaseroute/impl/SpecialDiseaseRouteServiceImpl.java @@ -77,6 +77,7 @@ public class SpecialDiseaseRouteServiceImpl implements ISpecialDiseaseRouteServi * @param specialDiseaseRoute 专病路径信息 * @return 结果 */ + @Transactional(rollbackFor = Exception.class) @Override public AjaxResult insertSpecialDiseaseRoute(SpecialDiseaseRouteVO specialDiseaseRoute) { specialDiseaseRoute.setCreateTime(LocalDateTime.now()); @@ -111,6 +112,7 @@ public class SpecialDiseaseRouteServiceImpl implements ISpecialDiseaseRouteServi * @param specialDiseaseRoute 专病路径信息 * @return 结果 */ + @Transactional(rollbackFor = Exception.class) @Override public AjaxResult updateSpecialDiseaseRoute(SpecialDiseaseRouteVO specialDiseaseRoute) { int deleteRoutePackageCount = specialDiseaseRoutePackageMapper.deleteSpecialDiseaseRoutePackageByRouteId(specialDiseaseRoute.getId()); @@ -209,6 +211,7 @@ public class SpecialDiseaseRouteServiceImpl implements ISpecialDiseaseRouteServi * @param specialDiseaseRoute 路径信息 * @return AjaxResult */ + @Transactional(rollbackFor = Exception.class) @Override public AjaxResult editReleaseStatus(SpecialDiseaseRoute specialDiseaseRoute) { if (Objects.isNull(specialDiseaseRoute) || StringUtils.isBlank(specialDiseaseRoute.getReleaseStatus())) { diff --git a/postdischarge-manage/src/main/resources/mapper/manage/questioninfo/QuestionInfoMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/questioninfo/QuestionInfoMapper.xml index 4b533bc9..b9c1b247 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/questioninfo/QuestionInfoMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/questioninfo/QuestionInfoMapper.xml @@ -19,6 +19,7 @@ + @@ -40,6 +41,7 @@ questionnaire_status, questionnaire_sort, questionnaire_remark, + question_type, create_by, create_time, update_by, @@ -89,6 +91,9 @@ and questionnaire_remark = #{questionnaireRemark} + + and question_type = #{questionType} + @@ -128,6 +133,8 @@ questionnaire_remark, + question_type, + create_by, create_time, @@ -164,6 +171,8 @@ #{questionnaireRemark}, + #{questionType}, + #{createBy}, #{createTime}, @@ -217,6 +226,9 @@ questionnaire_remark = #{questionnaireRemark}, + question_type = + #{questionType}, + create_by = #{createBy}, @@ -259,6 +271,9 @@ qi.questionnaire_status =#{questionnaireStatus} + + qi.question_type =#{questionType} + GROUP BY dt.id From 1a2fa27b8341392827fbbe7d4639aa4f084fa11f Mon Sep 17 00:00:00 2001 From: zhangheng <3226558941@qq.com> Date: Fri, 12 Apr 2024 14:56:11 +0800 Subject: [PATCH 16/20] =?UTF-8?q?=E9=97=AE=E5=8D=B7=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../questioninfo/QuestionInfoController.java | 13 ++++++++----- .../questioninfo/impl/QuestionInfoServiceImpl.java | 3 +++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/questioninfo/QuestionInfoController.java b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/questioninfo/QuestionInfoController.java index 66ae1903..a08701a3 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/questioninfo/QuestionInfoController.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/questioninfo/QuestionInfoController.java @@ -72,7 +72,7 @@ public class QuestionInfoController extends BaseController { @Log(title = "问卷基本信息", businessType = BusinessType.INSERT) @PostMapping("/add") 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 questionInfoService.insertQuestionInfo(questionInfo); @@ -85,6 +85,9 @@ public class QuestionInfoController extends BaseController { @Log(title = "问卷基本信息", businessType = BusinessType.UPDATE) @PostMapping("/edit") 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); } @@ -94,8 +97,8 @@ public class QuestionInfoController extends BaseController { @PreAuthorize("@ss.hasPermi('system:question:remove')") @Log(title = "问卷基本信息", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") - public AjaxResult remove(@PathVariable Long id) { - return toAjax(questionInfoService.deleteQuestionInfoById(id)); + public AjaxResult remove(@PathVariable Long ids) { + return toAjax(questionInfoService.deleteQuestionInfoById(ids)); } /** @@ -110,7 +113,7 @@ public class QuestionInfoController extends BaseController { * 科室问卷数量 */ @GetMapping("/departmentQuestionCount") - public AjaxResult departmentQuestionCount(String departmentName, String questionnaireStatus,String questionType) { - return questionInfoService.departmentQuestionCount(departmentName, questionnaireStatus,questionType); + public AjaxResult departmentQuestionCount(String departmentName, String questionnaireStatus, String questionType) { + return questionInfoService.departmentQuestionCount(departmentName, questionnaireStatus, questionType); } } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/questioninfo/impl/QuestionInfoServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/questioninfo/impl/QuestionInfoServiceImpl.java index 90a55a41..b70fb70c 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/questioninfo/impl/QuestionInfoServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/questioninfo/impl/QuestionInfoServiceImpl.java @@ -194,6 +194,9 @@ public class QuestionInfoServiceImpl implements IQuestionInfoService { log.info("修改问卷题目表失败," + questionSubjects); throw new SecurityException("修改问卷失败!请联系管理员!"); } + if (CollectionUtils.isEmpty(questionSubjectOptions)) { + return AjaxResult.success(); + } List saveQuestionSubjectOptions = new ArrayList<>(); for (QuestionSubjectOptionVO questionSubjectOption : questionSubjectOptions) { QuestionSubjectOption saveQuestionSubjectOption = new QuestionSubjectOption(); From 8853a97ec03880e0db7c33a4a6297ceb0a5b05ae Mon Sep 17 00:00:00 2001 From: zhangheng <3226558941@qq.com> Date: Fri, 12 Apr 2024 15:04:48 +0800 Subject: [PATCH 17/20] =?UTF-8?q?=E9=97=AE=E5=8D=B7=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/manage/questioninfo/QuestionInfoMapper.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/postdischarge-manage/src/main/resources/mapper/manage/questioninfo/QuestionInfoMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/questioninfo/QuestionInfoMapper.xml index b9c1b247..8287803d 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/questioninfo/QuestionInfoMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/questioninfo/QuestionInfoMapper.xml @@ -266,13 +266,13 @@ from department dt left join question_info qi on dt.id = qi.department_id - dt.department_name like concat('%',#{departmentName},'%') + and dt.department_name like concat('%',#{departmentName},'%') - qi.questionnaire_status =#{questionnaireStatus} + and qi.questionnaire_status =#{questionnaireStatus} - qi.question_type =#{questionType} + and qi.question_type = #{questionType} GROUP BY dt.id From b4d7529c438ba4dc8b0adb18988f3fc7d63346bb Mon Sep 17 00:00:00 2001 From: youxilong Date: Fri, 12 Apr 2024 17:17:01 +0800 Subject: [PATCH 18/20] =?UTF-8?q?=E4=BA=BA=E5=B7=A5=E9=9A=8F=E8=AE=BF?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=9F=A5=E8=AF=A2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../signpatientmanageroute/SignPatientManageRouteMapper.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/postdischarge-manage/src/main/resources/mapper/manage/signpatientmanageroute/SignPatientManageRouteMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/signpatientmanageroute/SignPatientManageRouteMapper.xml index 8e4676bf..8a6943d5 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/signpatientmanageroute/SignPatientManageRouteMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/signpatientmanageroute/SignPatientManageRouteMapper.xml @@ -307,7 +307,7 @@ pvr.surgical_name, pi.attending_physician_id, 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 WHEN spmr.suit_range = 'OUTPATIENT_SERVICE' THEN pi.visit_date WHEN spmr.suit_range = 'DISCHARGE' THEN pi.discharge_time From f098cd7d266d0b47ae739f9ac645322491b3f543 Mon Sep 17 00:00:00 2001 From: zhangheng <3226558941@qq.com> Date: Mon, 15 Apr 2024 15:51:40 +0800 Subject: [PATCH 19/20] =?UTF-8?q?=E6=BB=A1=E6=84=8F=E5=BA=A6=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xinelu/common/enums/QuestionTypeEnum.java | 29 +++++ ...PatientQuestionSubmitResultController.java | 20 +++ .../PatientQuestionSubmitResultMapper.java | 15 ++- .../IPatientQuestionSubjectResultService.java | 2 +- .../IPatientQuestionSubmitResultService.java | 18 +++ ...atientQuestionSubmitResultServiceImpl.java | 27 +++++ .../PatientTaskExecuteRecordServiceImpl.java | 2 +- .../PatientQuestionSubmitResultVO.java | 14 +++ .../SatisfactionSurveyVO.java | 93 ++++++++++++++ .../PatientQuestionSubmitResultMapper.xml | 114 +++++++++++++----- 10 files changed, 297 insertions(+), 37 deletions(-) create mode 100644 postdischarge-common/src/main/java/com/xinelu/common/enums/QuestionTypeEnum.java create mode 100644 postdischarge-manage/src/main/java/com/xinelu/manage/vo/patientquestionsubmitresult/SatisfactionSurveyVO.java diff --git a/postdischarge-common/src/main/java/com/xinelu/common/enums/QuestionTypeEnum.java b/postdischarge-common/src/main/java/com/xinelu/common/enums/QuestionTypeEnum.java new file mode 100644 index 00000000..c9dda5bf --- /dev/null +++ b/postdischarge-common/src/main/java/com/xinelu/common/enums/QuestionTypeEnum.java @@ -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; + } +} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/patientquestionsubmitresult/PatientQuestionSubmitResultController.java b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/patientquestionsubmitresult/PatientQuestionSubmitResultController.java index 568e9899..4a0031c5 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/patientquestionsubmitresult/PatientQuestionSubmitResultController.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/patientquestionsubmitresult/PatientQuestionSubmitResultController.java @@ -8,6 +8,7 @@ import com.xinelu.common.enums.BusinessType; import com.xinelu.common.utils.poi.ExcelUtil; import com.xinelu.manage.domain.patientquestionsubmitresult.PatientQuestionSubmitResult; import com.xinelu.manage.service.patientquestionsubmitresult.IPatientQuestionSubmitResultService; +import com.xinelu.manage.vo.patientquestionsubmitresult.SatisfactionSurveyVO; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; @@ -88,4 +89,23 @@ public class PatientQuestionSubmitResultController extends BaseController { public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(patientQuestionSubmitResultService.deletePatientQuestionSubmitResultByIds(ids)); } + + /** + * 满意度调查问卷列表 + */ + @GetMapping("/satisfactionSurvey") + public TableDataInfo satisfactionSurvey(SatisfactionSurveyVO satisfactionSurvey) { + startPage(); + List list = patientQuestionSubmitResultService.satisfactionSurvey(satisfactionSurvey); + return getDataTable(list); + } + + /** + * 满意度调查问卷 + */ + @GetMapping("/selectQuestionnaireResult") + public AjaxResult selectQuestionnaireResult(Long patientQuestionSubmitResultId) { + return patientQuestionSubmitResultService.selectQuestionnaireResult(patientQuestionSubmitResultId); + + } } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/patientquestionsubmitresult/PatientQuestionSubmitResultMapper.java b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/patientquestionsubmitresult/PatientQuestionSubmitResultMapper.java index 14632f3f..827e5034 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/patientquestionsubmitresult/PatientQuestionSubmitResultMapper.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/patientquestionsubmitresult/PatientQuestionSubmitResultMapper.java @@ -2,6 +2,8 @@ package com.xinelu.manage.mapper.patientquestionsubmitresult; import com.xinelu.manage.domain.patientquestionsubmitresult.PatientQuestionSubmitResult; import com.xinelu.manage.vo.patientquestionsubmitresult.PatientQuestionSubmitResultVO; +import com.xinelu.manage.vo.patientquestionsubmitresult.SatisfactionSurveyVO; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -63,8 +65,17 @@ public interface PatientQuestionSubmitResultMapper { /** * 根据任务执行记录查询患者问卷信息 * - * @param taskExecuteRecordId 患者管理任务执行记录表id + * @param taskExecuteRecordId 患者管理任务执行记录表id + * @param patientQuestionSubmitResultId 患者问卷提交结果信息表 * @return PatientQuestionSubmitResultVO */ - PatientQuestionSubmitResultVO selectResultByTaskExecuteRecordId(Long taskExecuteRecordId); + PatientQuestionSubmitResultVO selectResultByTaskExecuteRecordId(@Param("taskExecuteRecordId") Long taskExecuteRecordId, @Param("patientQuestionSubmitResultId") Long patientQuestionSubmitResultId); + + /** + * 满意度调查问卷列表 + * + * @param satisfactionSurvey 居民信息 + * @return AjaxResult + */ + List selectSatisfactionSurvey(SatisfactionSurveyVO satisfactionSurvey); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientquestionsubjectresult/IPatientQuestionSubjectResultService.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientquestionsubjectresult/IPatientQuestionSubjectResultService.java index 8153bd9f..65084c16 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientquestionsubjectresult/IPatientQuestionSubjectResultService.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientquestionsubjectresult/IPatientQuestionSubjectResultService.java @@ -17,7 +17,7 @@ public interface IPatientQuestionSubjectResultService { * @param id 患者问卷题目提交结果信息主键 * @return 患者问卷题目提交结果信息 */ - public PatientQuestionSubjectResult selectPatientQuestionSubjectResultById(Long id); + PatientQuestionSubjectResult selectPatientQuestionSubjectResultById(Long id); /** * 查询患者问卷题目提交结果信息列表 diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientquestionsubmitresult/IPatientQuestionSubmitResultService.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientquestionsubmitresult/IPatientQuestionSubmitResultService.java index c8535f0d..464dbf4b 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientquestionsubmitresult/IPatientQuestionSubmitResultService.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientquestionsubmitresult/IPatientQuestionSubmitResultService.java @@ -1,6 +1,8 @@ package com.xinelu.manage.service.patientquestionsubmitresult; +import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.manage.domain.patientquestionsubmitresult.PatientQuestionSubmitResult; +import com.xinelu.manage.vo.patientquestionsubmitresult.SatisfactionSurveyVO; import java.util.List; @@ -58,4 +60,20 @@ public interface IPatientQuestionSubmitResultService { * @return 结果 */ int deletePatientQuestionSubmitResultById(Long id); + + /** + * 满意度调查问卷列表 + * + * @param satisfactionSurvey 居民信息 + * @return AjaxResult + */ + List satisfactionSurvey(SatisfactionSurveyVO satisfactionSurvey); + + /** + * 满意度调查问卷 + * + * @param patientQuestionSubmitResultId 问卷信息 + * @return AjaxResult + */ + AjaxResult selectQuestionnaireResult(Long patientQuestionSubmitResultId); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientquestionsubmitresult/impl/PatientQuestionSubmitResultServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientquestionsubmitresult/impl/PatientQuestionSubmitResultServiceImpl.java index 2fab972b..97208eb9 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientquestionsubmitresult/impl/PatientQuestionSubmitResultServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientquestionsubmitresult/impl/PatientQuestionSubmitResultServiceImpl.java @@ -1,8 +1,11 @@ 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.mapper.patientquestionsubmitresult.PatientQuestionSubmitResultMapper; import com.xinelu.manage.service.patientquestionsubmitresult.IPatientQuestionSubmitResultService; +import com.xinelu.manage.vo.patientquestionsubmitresult.SatisfactionSurveyVO; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -87,4 +90,28 @@ public class PatientQuestionSubmitResultServiceImpl implements IPatientQuestionS public int deletePatientQuestionSubmitResultById(Long id) { return patientQuestionSubmitResultMapper.deletePatientQuestionSubmitResultById(id); } + + /** + * 满意度调查问卷列表 + * + * @param satisfactionSurvey 居民信息 + * @return AjaxResult + */ + @Override + public List 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)); + } } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patienttaskexecuterecord/impl/PatientTaskExecuteRecordServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patienttaskexecuterecord/impl/PatientTaskExecuteRecordServiceImpl.java index 46952cea..fe343753 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patienttaskexecuterecord/impl/PatientTaskExecuteRecordServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patienttaskexecuterecord/impl/PatientTaskExecuteRecordServiceImpl.java @@ -118,6 +118,6 @@ public class PatientTaskExecuteRecordServiceImpl implements IPatientTaskExecuteR */ @Override public AjaxResult selectPatientQuestionSubmit(Long taskExecuteRecordId) { - return AjaxResult.success(submitResultMapper.selectResultByTaskExecuteRecordId(taskExecuteRecordId)); + return AjaxResult.success(submitResultMapper.selectResultByTaskExecuteRecordId(taskExecuteRecordId, null)); } } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/vo/patientquestionsubmitresult/PatientQuestionSubmitResultVO.java b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/patientquestionsubmitresult/PatientQuestionSubmitResultVO.java index 8d2d52dc..915b170c 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/vo/patientquestionsubmitresult/PatientQuestionSubmitResultVO.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/patientquestionsubmitresult/PatientQuestionSubmitResultVO.java @@ -4,6 +4,7 @@ import com.xinelu.manage.vo.patientquestionsubjectresult.PatientQuestionSubjectR import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import java.math.BigDecimal; import java.util.List; /** @@ -34,5 +35,18 @@ public class PatientQuestionSubmitResultVO { @ApiModelProperty(value = "问卷说明") private String questionnaireDescription; + /** + * 问卷总分值,小数点后两位 + */ + @ApiModelProperty(value = "问卷总分值,小数点后两位") + private BigDecimal questionnaireTotalScore; + + /** + * 问卷总得分,根据患者提交问卷得出的分值 + */ + @ApiModelProperty(value = "问卷总得分,根据患者提交问卷得出的分值") + private BigDecimal totalScore; + + List subjectResultList; } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/vo/patientquestionsubmitresult/SatisfactionSurveyVO.java b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/patientquestionsubmitresult/SatisfactionSurveyVO.java new file mode 100644 index 00000000..d1385acb --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/patientquestionsubmitresult/SatisfactionSurveyVO.java @@ -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; + + /** + * 性别,男:MALE,女:FEMALE + */ + @ApiModelProperty(value = "性别,男:MALE,女:FEMALE") + 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; +} diff --git a/postdischarge-manage/src/main/resources/mapper/manage/patientquestionsubmitresult/PatientQuestionSubmitResultMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/patientquestionsubmitresult/PatientQuestionSubmitResultMapper.xml index a5628a87..3608fb45 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/patientquestionsubmitresult/PatientQuestionSubmitResultMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/patientquestionsubmitresult/PatientQuestionSubmitResultMapper.xml @@ -37,6 +37,8 @@ + + @@ -375,39 +377,85 @@ + + \ No newline at end of file From 07a2b6177b40c904408b18c03e97d6e20b664bd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BA=AA=E5=AF=92?= <2533659732@qq.com> Date: Tue, 16 Apr 2024 14:17:14 +0800 Subject: [PATCH 20/20] =?UTF-8?q?=E9=99=A2=E5=90=8E=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E7=99=BB=E5=BD=95=E5=92=8C=E4=B8=AA?= =?UTF-8?q?=E4=BA=BA=E4=BF=A1=E6=81=AF=E6=8E=A5=E5=8F=A3=E5=BC=80=E5=8F=91?= =?UTF-8?q?=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application.yml | 2 +- .../com/xinelu/common/constant/Constants.java | 30 +++++ .../residentinfo/ResidentInfoMapper.java | 13 +- .../residentinfo/ResidentInfoMapper.xml | 14 ++ .../AppletPersonCenterController.java | 54 ++++++++ .../AppletPersonCenterService.java | 29 +++++ .../Impl/AppletPersonCenterServiceImpl.java | 123 ++++++++++++++++++ .../mobile/utils/WeChatAppletUtils.java | 50 +++++++ .../PostDischargeAppletPhoneVO.java | 85 ++++++++++++ .../PostDischargeAppletVO.java | 39 ++++++ 10 files changed, 437 insertions(+), 2 deletions(-) create mode 100644 postdischarge-mobile/src/main/java/com/xinelu/mobile/controller/appletpersoncenter/AppletPersonCenterController.java create mode 100644 postdischarge-mobile/src/main/java/com/xinelu/mobile/service/appletpersoncenter/AppletPersonCenterService.java create mode 100644 postdischarge-mobile/src/main/java/com/xinelu/mobile/service/appletpersoncenter/Impl/AppletPersonCenterServiceImpl.java create mode 100644 postdischarge-mobile/src/main/java/com/xinelu/mobile/vo/appletpersoncenter/PostDischargeAppletPhoneVO.java create mode 100644 postdischarge-mobile/src/main/java/com/xinelu/mobile/vo/appletpersoncenter/PostDischargeAppletVO.java diff --git a/postdischarge-admin/src/main/resources/application.yml b/postdischarge-admin/src/main/resources/application.yml index c6131886..0671ce1a 100644 --- a/postdischarge-admin/src/main/resources/application.yml +++ b/postdischarge-admin/src/main/resources/application.yml @@ -103,7 +103,7 @@ token: # 令牌有效期(默认30分钟) expireTime: 30 # 请求拦截白名单 - ant-matchers: /postDischarge/**,/testMobile/** + ant-matchers: /postDischarge/**,/testMobile/**,/postDischargeApplet/** ## MyBatis-Plus配置 mybatis-plus: diff --git a/postdischarge-common/src/main/java/com/xinelu/common/constant/Constants.java b/postdischarge-common/src/main/java/com/xinelu/common/constant/Constants.java index 9ae03f9a..0102e27c 100644 --- a/postdischarge-common/src/main/java/com/xinelu/common/constant/Constants.java +++ b/postdischarge-common/src/main/java/com/xinelu/common/constant/Constants.java @@ -283,4 +283,34 @@ public class Constants { * 成功 */ public static final int SUCCESS_ERROR_CODE = 0; + + /** + * 院后微信小程序登录接口地址 + */ + public static final String APPLET_LOGIN_URL = "https://api.weixin.qq.com/sns/jscode2session"; + + /** + * 微信小程序ACCESS_TOKEN前缀 + */ + public static final String POST_DISCHARGE_APPLET_ACCESS_TOKEN = "POST_Discharge_APPLET_ACCESS_TOKEN_"; + + /** + * 返回成功状态码 + */ + public static final int SUCCESS_CODE = 0; + + /** + * 院后微信小程序获取用户手机号接口地址 + */ + public static final String PHONE_NUMBER_URL = "https://api.weixin.qq.com/wxa/business/getuserphonenumber?access_token="; + + /** + * 获取微信小程序access_token错误码 + */ + public static final int ERROR_ACCESS_CODE = 40001; + + /** + * 返回成功状态码 + */ + public static final String OK = "ok"; } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/residentinfo/ResidentInfoMapper.java b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/residentinfo/ResidentInfoMapper.java index 771126ec..daeb251c 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/residentinfo/ResidentInfoMapper.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/residentinfo/ResidentInfoMapper.java @@ -1,6 +1,8 @@ package com.xinelu.manage.mapper.residentinfo; import com.xinelu.manage.domain.residentinfo.ResidentInfo; +import org.apache.ibatis.annotations.Param; + import java.util.List; @@ -17,7 +19,7 @@ public interface ResidentInfoMapper { * @param id 居民信息主键 * @return 居民信息 */ - public ResidentInfo selectResidentInfoById(Long id); + ResidentInfo selectResidentInfoById(Long id); /** * 查询居民信息列表 @@ -58,4 +60,13 @@ public interface ResidentInfoMapper { * @return 结果 */ int deleteResidentInfoByIds(Long[] ids); + + /** + * 根据电话号码和微信小程序openid查询居民基本信息 + * + * @param phone 手机号 + * @param openId 微信小程序openId + * @return 被护理人基本信息 + */ + ResidentInfo getResidentInfoByPhoneAndOpenId(@Param("phone") String phone, @Param("openId") String openId); } diff --git a/postdischarge-manage/src/main/resources/mapper/manage/residentinfo/ResidentInfoMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/residentinfo/ResidentInfoMapper.xml index 1c5ae83d..366b49e2 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/residentinfo/ResidentInfoMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/residentinfo/ResidentInfoMapper.xml @@ -183,4 +183,18 @@ #{id} + + \ No newline at end of file diff --git a/postdischarge-mobile/src/main/java/com/xinelu/mobile/controller/appletpersoncenter/AppletPersonCenterController.java b/postdischarge-mobile/src/main/java/com/xinelu/mobile/controller/appletpersoncenter/AppletPersonCenterController.java new file mode 100644 index 00000000..2bf9b0de --- /dev/null +++ b/postdischarge-mobile/src/main/java/com/xinelu/mobile/controller/appletpersoncenter/AppletPersonCenterController.java @@ -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); + } +} diff --git a/postdischarge-mobile/src/main/java/com/xinelu/mobile/service/appletpersoncenter/AppletPersonCenterService.java b/postdischarge-mobile/src/main/java/com/xinelu/mobile/service/appletpersoncenter/AppletPersonCenterService.java new file mode 100644 index 00000000..2a4dc85f --- /dev/null +++ b/postdischarge-mobile/src/main/java/com/xinelu/mobile/service/appletpersoncenter/AppletPersonCenterService.java @@ -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); +} diff --git a/postdischarge-mobile/src/main/java/com/xinelu/mobile/service/appletpersoncenter/Impl/AppletPersonCenterServiceImpl.java b/postdischarge-mobile/src/main/java/com/xinelu/mobile/service/appletpersoncenter/Impl/AppletPersonCenterServiceImpl.java new file mode 100644 index 00000000..8fe5f36e --- /dev/null +++ b/postdischarge-mobile/src/main/java/com/xinelu/mobile/service/appletpersoncenter/Impl/AppletPersonCenterServiceImpl.java @@ -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 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)); + } +} diff --git a/postdischarge-mobile/src/main/java/com/xinelu/mobile/utils/WeChatAppletUtils.java b/postdischarge-mobile/src/main/java/com/xinelu/mobile/utils/WeChatAppletUtils.java index 62b2cba8..86ff58b8 100644 --- a/postdischarge-mobile/src/main/java/com/xinelu/mobile/utils/WeChatAppletUtils.java +++ b/postdischarge-mobile/src/main/java/com/xinelu/mobile/utils/WeChatAppletUtils.java @@ -6,11 +6,15 @@ import com.xinelu.common.constant.Constants; import com.xinelu.common.entity.AccessToken; import com.xinelu.common.exception.ServiceException; 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.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Component; import javax.annotation.Resource; +import java.util.HashMap; +import java.util.Map; import java.util.Objects; import java.util.concurrent.TimeUnit; @@ -68,4 +72,50 @@ public class WeChatAppletUtils { } 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 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); + } } diff --git a/postdischarge-mobile/src/main/java/com/xinelu/mobile/vo/appletpersoncenter/PostDischargeAppletPhoneVO.java b/postdischarge-mobile/src/main/java/com/xinelu/mobile/vo/appletpersoncenter/PostDischargeAppletPhoneVO.java new file mode 100644 index 00000000..0f667667 --- /dev/null +++ b/postdischarge-mobile/src/main/java/com/xinelu/mobile/vo/appletpersoncenter/PostDischargeAppletPhoneVO.java @@ -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:不合法的code(code不存在、已过期或者使用过) + */ + @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; + } + } +} diff --git a/postdischarge-mobile/src/main/java/com/xinelu/mobile/vo/appletpersoncenter/PostDischargeAppletVO.java b/postdischarge-mobile/src/main/java/com/xinelu/mobile/vo/appletpersoncenter/PostDischargeAppletVO.java new file mode 100644 index 00000000..d5929f1d --- /dev/null +++ b/postdischarge-mobile/src/main/java/com/xinelu/mobile/vo/appletpersoncenter/PostDischargeAppletVO.java @@ -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; + + /** + * 错误状态码,40029:js_code无效,45011:API 调用太频繁,请稍候再试 + * 40226:高风险等级用户,小程序登录拦截 ,-1:系统繁忙,此时请开发者稍候再试 + */ + private Integer errcode; + + /** + * 状态信息,取值有,40029:code 无效, + * 45011:api minute-quota reach limit mustslower retry next minute + * 40226:code blocked + * -1:system error + */ + private String errmsg; +}