From 9e5ac2928bb0693788115c99c2b74b1a60b3bc62 Mon Sep 17 00:00:00 2001 From: zy_Java <654600784@qq.com> Date: Thu, 3 Jun 2021 16:51:17 +0800 Subject: [PATCH] 20210603v1.2 --- .../recovery/api/PatientController.java | 10 +++++++ .../ccsens/recovery/bean/dto/PatientDto.java | 7 +++++ .../bean/message/RecoveryWithStartRecipe.java | 4 +-- .../com/ccsens/recovery/bean/vo/RecipeVo.java | 2 +- .../recovery/persist/dao/PatientDao.java | 8 ++++++ .../recovery/service/IPatientService.java | 12 +++++++-- .../recovery/service/PatientService.java | 13 ++++++++++ .../com/ccsens/recovery/util/Constant.java | 4 +-- .../main/resources/mapper_dao/PatientDao.xml | 26 +++++++++++++++++++ 9 files changed, 79 insertions(+), 7 deletions(-) diff --git a/recovery/src/main/java/com/ccsens/recovery/api/PatientController.java b/recovery/src/main/java/com/ccsens/recovery/api/PatientController.java index 26d34248..c567b9ee 100644 --- a/recovery/src/main/java/com/ccsens/recovery/api/PatientController.java +++ b/recovery/src/main/java/com/ccsens/recovery/api/PatientController.java @@ -51,6 +51,16 @@ public class PatientController { return JsonResponse.newInstance().ok(patientList); } + @MustLogin + @ApiOperation(value = "通过身份证号模糊查询患者信息(当前康复中心下)", notes = "zy:") + @RequestMapping(value = "/vague", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) + public JsonResponse vaguePatientByIdCard(@ApiParam @Validated @RequestBody QueryDto params) { + log.info("查看患者的详细信息:{}",params); + List patient = patientService.vaguePatientByIdCard(params.getParam(),params.getUserId()); + log.info("查看患者的详细信息成功:{}",patient); + return JsonResponse.newInstance().ok(patient); + } + @MustLogin @ApiOperation(value = "查看患者的详细信息", notes = "zy:") @RequestMapping(value = "/detail", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) diff --git a/recovery/src/main/java/com/ccsens/recovery/bean/dto/PatientDto.java b/recovery/src/main/java/com/ccsens/recovery/bean/dto/PatientDto.java index 30ea78e8..dd958196 100644 --- a/recovery/src/main/java/com/ccsens/recovery/bean/dto/PatientDto.java +++ b/recovery/src/main/java/com/ccsens/recovery/bean/dto/PatientDto.java @@ -22,6 +22,13 @@ public class PatientDto { private Long id; } + @Data + @ApiModel("身份证号模糊查询患者信息") + public static class VaguePatient{ + @ApiModelProperty("身份证号") + private String idCard; + } + @Data @ApiModel("任务详情id") public static class TaskDetailId{ diff --git a/recovery/src/main/java/com/ccsens/recovery/bean/message/RecoveryWithStartRecipe.java b/recovery/src/main/java/com/ccsens/recovery/bean/message/RecoveryWithStartRecipe.java index 7f1fd890..1e34236d 100644 --- a/recovery/src/main/java/com/ccsens/recovery/bean/message/RecoveryWithStartRecipe.java +++ b/recovery/src/main/java/com/ccsens/recovery/bean/message/RecoveryWithStartRecipe.java @@ -20,8 +20,8 @@ public class RecoveryWithStartRecipe extends BaseMessageDto{ private Data data; public RecoveryWithStartRecipe(){ - setType(Constant.Message.START_RECOVERY); - setEvent(Constant.Message.START_RECOVERY); + setType(Constant.Message.SWITCHOVER_PROJECT); + setEvent(Constant.Message.SWITCHOVER_PROJECT); setTime(System.currentTimeMillis()); } diff --git a/recovery/src/main/java/com/ccsens/recovery/bean/vo/RecipeVo.java b/recovery/src/main/java/com/ccsens/recovery/bean/vo/RecipeVo.java index 57e601ce..bdedd8d9 100644 --- a/recovery/src/main/java/com/ccsens/recovery/bean/vo/RecipeVo.java +++ b/recovery/src/main/java/com/ccsens/recovery/bean/vo/RecipeVo.java @@ -62,7 +62,7 @@ public class RecipeVo { @ApiModelProperty("康复训练的id") private Long drillId; @ApiModelProperty("训练名") - private Long drillName; + private String drillName; @ApiModelProperty("训练频率") private String cycle; @ApiModelProperty("每天几次") diff --git a/recovery/src/main/java/com/ccsens/recovery/persist/dao/PatientDao.java b/recovery/src/main/java/com/ccsens/recovery/persist/dao/PatientDao.java index c61588c0..ce2903f3 100644 --- a/recovery/src/main/java/com/ccsens/recovery/persist/dao/PatientDao.java +++ b/recovery/src/main/java/com/ccsens/recovery/persist/dao/PatientDao.java @@ -30,4 +30,12 @@ public interface PatientDao extends PatientMapper { * @return 机器人信息 */ RecoveryRobot getRobotByPatientId(@Param("patientId")Long patientId); + + /** + * 通过身份证号模糊查询患者信息 + * @param idCard 身份证号 + * @param centreId 康复中心id + * @return 患者信息 + */ + List vaguePatientByIdCard(@Param("idCard")String idCard, @Param("centreId")Long centreId); } diff --git a/recovery/src/main/java/com/ccsens/recovery/service/IPatientService.java b/recovery/src/main/java/com/ccsens/recovery/service/IPatientService.java index 3b1e72c7..10d01f94 100644 --- a/recovery/src/main/java/com/ccsens/recovery/service/IPatientService.java +++ b/recovery/src/main/java/com/ccsens/recovery/service/IPatientService.java @@ -54,7 +54,7 @@ public interface IPatientService { * @param userId userID * @return 返回训练记录的id */ - PatientVo.RecipeRecordId startDrill(PatientDto.StartDrill param, Long userId) throws JsonProcessingException, Exception; + PatientVo.RecipeRecordId startDrill(PatientDto.StartDrill param, Long userId) throws Exception; /** * 结束训练 @@ -68,7 +68,7 @@ public interface IPatientService { * @param param 记录id和结果 * @param userId userId */ - void actionFeedback(PatientDto.ActionFeedback param, Long userId) throws JsonProcessingException, Exception; + void actionFeedback(PatientDto.ActionFeedback param, Long userId) throws Exception; /** * 竖屏时通过任务id查看患者信息 @@ -84,4 +84,12 @@ public interface IPatientService { * @param userId userId */ void completeRecovery(PatientDto.EndRecovery param, Long userId) throws Exception; + + /** + * 通过身份证号模糊查询康复中心的患者信息 + * @param param 身份证号 + * @param userId 康复医生的userId + * @return 返回患者列表 + */ + List vaguePatientByIdCard(PatientDto.VaguePatient param, Long userId); } diff --git a/recovery/src/main/java/com/ccsens/recovery/service/PatientService.java b/recovery/src/main/java/com/ccsens/recovery/service/PatientService.java index d168d4b3..5ef9d019 100644 --- a/recovery/src/main/java/com/ccsens/recovery/service/PatientService.java +++ b/recovery/src/main/java/com/ccsens/recovery/service/PatientService.java @@ -268,4 +268,17 @@ public class PatientService implements IPatientService{ rabbitTemplate.convertAndSend(RabbitMQConfig.MESSAGE_QUEUE_NAME, JacksonUtil.beanToJson(inMessage)); } + + @Override + public List vaguePatientByIdCard(PatientDto.VaguePatient param, Long userId) { + Long centreId = null; + //如果康复中心id为空,通过userId查找康复师,然后查找康复中心的id + RecoveryDoctorExample recoveryDoctorExample = new RecoveryDoctorExample(); + recoveryDoctorExample.createCriteria().andUserIdEqualTo(userId); + List doctorList = recoveryDoctorMapper.selectByExample(recoveryDoctorExample); + if(CollectionUtil.isNotEmpty(doctorList)){ + centreId = doctorList.get(0).getCentreId(); + } + return patientDao.vaguePatientByIdCard(param.getIdCard(),centreId); + } } diff --git a/recovery/src/main/java/com/ccsens/recovery/util/Constant.java b/recovery/src/main/java/com/ccsens/recovery/util/Constant.java index 3a2e03e4..6a85f9c6 100644 --- a/recovery/src/main/java/com/ccsens/recovery/util/Constant.java +++ b/recovery/src/main/java/com/ccsens/recovery/util/Constant.java @@ -8,8 +8,8 @@ public class Constant { /**消息*/ public static final class Message { - /**启动康复流程*/ - public static final String START_RECOVERY = "startRecovery"; + /**切换项目*/ + public static final String SWITCHOVER_PROJECT = "switchoverProject"; /**开始训练*/ public static final String START_DRILL = "startDrill"; /**动作反馈*/ diff --git a/recovery/src/main/resources/mapper_dao/PatientDao.xml b/recovery/src/main/resources/mapper_dao/PatientDao.xml index 4e2869de..0e9bbc52 100644 --- a/recovery/src/main/resources/mapper_dao/PatientDao.xml +++ b/recovery/src/main/resources/mapper_dao/PatientDao.xml @@ -166,4 +166,30 @@ order by start_time limit 1 + \ No newline at end of file