diff --git a/mt/src/main/resources/mapper_dao/CompeteProjectDao.xml b/mt/src/main/resources/mapper_dao/CompeteProjectDao.xml index 4ad00116..aee91563 100644 --- a/mt/src/main/resources/mapper_dao/CompeteProjectDao.xml +++ b/mt/src/main/resources/mapper_dao/CompeteProjectDao.xml @@ -76,7 +76,7 @@ FROM t_compete_project_player pp LEFT JOIN t_compete_player p on pp.player_id = p.id and p.rec_status = 0 - LEFT JOIN t_compete_group g on p.compete_group_id = g.id and g.rec_status = 0 and g.type = 5 + LEFT JOIN t_compete_group g on p.compete_group_id = g.id and g.rec_status = 0 and g.type = 4 LEFT JOIN t_compete_company c on p.company_id = c.id and c.rec_status = 0 WHERE pp.project_id = #{projectId} @@ -91,7 +91,7 @@ t.id FROM t_compete_team t - LEFT JOIN t_compete_group g on t.group_remark = g.group_remark and t.gender_group = g.sex and g.rec_status = 0 and g.type = 5 + LEFT JOIN t_compete_group g on t.group_remark = g.group_remark and t.gender_group = g.sex and g.rec_status = 0 and g.type = 4 LEFT JOIN t_compete_company c on t.company_id = c.id and c.rec_status = 0 WHERE t.project_id = #{projectId} 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 863531f1..0a1d99d0 100644 --- a/recovery/src/main/java/com/ccsens/recovery/api/PatientController.java +++ b/recovery/src/main/java/com/ccsens/recovery/api/PatientController.java @@ -111,6 +111,15 @@ public class PatientController { return JsonResponse.newInstance().ok(recipeRecordId); } + @MustLogin + @ApiOperation(value = "倒计时结束", notes = "zy:") + @RequestMapping(value = "/countdown", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) + public JsonResponse countdown(@ApiParam @Validated @RequestBody QueryDto params) throws Exception { + log.info("倒计时结束:{}",params); + patientService.countdown(params.getParam(),params.getUserId()); + return JsonResponse.newInstance().ok(); + } + @ApiOperation(value = "结束训练", notes = "zy:") @RequestMapping(value = "/end", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) public JsonResponse endDrill(@ApiParam @Validated @RequestBody QueryDto params) { 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 197c21ae..a08ca381 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 @@ -110,6 +110,12 @@ public class PatientDto { @ApiModelProperty("训练的分数") private int score; } + @Data + @ApiModel("训练记录id") + public static class RecordId{ + @ApiModelProperty("训练记录id") + private Long id; + } @Data @ApiModel("动作反馈") diff --git a/recovery/src/main/java/com/ccsens/recovery/bean/message/RecoveryWithStartDrill.java b/recovery/src/main/java/com/ccsens/recovery/bean/message/RecoveryWithStartDrill.java index b59b9d68..001b4f85 100644 --- a/recovery/src/main/java/com/ccsens/recovery/bean/message/RecoveryWithStartDrill.java +++ b/recovery/src/main/java/com/ccsens/recovery/bean/message/RecoveryWithStartDrill.java @@ -23,6 +23,7 @@ public class RecoveryWithStartDrill extends BaseMessageDto{ private Long projectId; //任务详情id private Long taskDetailId; + private Long subTaskId = 1402180562474635420L; //插件名 private String pluginName = "start_training"; } diff --git a/recovery/src/main/java/com/ccsens/recovery/bean/vo/PatientVo.java b/recovery/src/main/java/com/ccsens/recovery/bean/vo/PatientVo.java index 45bc6f12..c5228897 100644 --- a/recovery/src/main/java/com/ccsens/recovery/bean/vo/PatientVo.java +++ b/recovery/src/main/java/com/ccsens/recovery/bean/vo/PatientVo.java @@ -54,6 +54,12 @@ public class PatientVo { private Long id; @ApiModelProperty("训练状态 0未开始 1进行中 2已结束") private int status; + @ApiModelProperty("开始时间") + private Long startTime; + @ApiModelProperty("时长") + private Long duration = 60000L; + @ApiModelProperty("分数") + private int score = 11; } @Data 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 0d5be14e..15d3ed9d 100644 --- a/recovery/src/main/java/com/ccsens/recovery/service/IPatientService.java +++ b/recovery/src/main/java/com/ccsens/recovery/service/IPatientService.java @@ -99,4 +99,11 @@ public interface IPatientService { * @return 返回训练的状态 */ PatientVo.RecordStatus getDrillStatus(PatientDto.SubTimeTaskId param, Long userId); + + /** + * 倒计时结束通知患者 + * @param param 患者id + * @param userId userId + */ + void countdown(PatientDto.PatientId 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 4956476d..d5518c5b 100644 --- a/recovery/src/main/java/com/ccsens/recovery/service/PatientService.java +++ b/recovery/src/main/java/com/ccsens/recovery/service/PatientService.java @@ -147,12 +147,12 @@ public class PatientService implements IPatientService{ data.setRecordId(recRecord.getId()); data.setGameId(param.getGameId()); data.setProjectId(patient.getProjectId()); - data.setTaskDetailId(projectDecompose.getTaskId()); +// data.setTaskDetailId(projectDecompose.getTaskId()); recoveryWithStartDrill.setData(data); //查询接收者 Set userIdSet = new HashSet<>(); - userIdSet.add(param.getPatientId().toString()); + userIdSet.add(patient.getUserId().toString()); // RecoveryRobot recoveryRobot = patientDao.getRobotByPatientId(param.getPatientId()); // if(ObjectUtil.isNotNull(recoveryRobot)){ // userIdSet.add(recoveryRobot.getUserid().toString()); @@ -287,10 +287,12 @@ public class PatientService implements IPatientService{ if(ObjectUtil.isNotNull(recipeRecord.getStartTime()) && ObjectUtil.isNotNull(recipeRecord.getEndTime())){ if(recipeRecord.getStartTime() != 0 && recipeRecord.getEndTime() == 0){ recordStatus.setStatus(1); + recordStatus.setStartTime(recipeRecord.getStartTime()); return recordStatus; } if(recipeRecord.getEndTime() != 0){ recordStatus.setStatus(2); + recordStatus.setStartTime(recipeRecord.getStartTime()); return recordStatus; } } @@ -298,4 +300,14 @@ public class PatientService implements IPatientService{ recordStatus.setStatus(0); return recordStatus; } + + @Override + public void countdown(PatientDto.PatientId param, Long userId) { + //查询患者信息 + Patient patient = patientDao.selectByPrimaryKey(param.getId()); + if(ObjectUtil.isNotNull(patient)){ + + } + + } } diff --git a/recovery/src/main/resources/mapper_dao/PatientDao.xml b/recovery/src/main/resources/mapper_dao/PatientDao.xml index 5fd3a015..f66a3d75 100644 --- a/recovery/src/main/resources/mapper_dao/PatientDao.xml +++ b/recovery/src/main/resources/mapper_dao/PatientDao.xml @@ -156,7 +156,7 @@ and rp.rec_status = 0 and rpd.rec_status = 0 and rd.rec_status = 0 - and rpd.task_id = #{detailId} + and rpd.robot_task_id = #{detailId}