Browse Source

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

pt
ma 4 years ago
parent
commit
c9da7e1b48
  1. 4
      mt/src/main/resources/mapper_dao/CompeteProjectDao.xml
  2. 9
      recovery/src/main/java/com/ccsens/recovery/api/PatientController.java
  3. 6
      recovery/src/main/java/com/ccsens/recovery/bean/dto/PatientDto.java
  4. 1
      recovery/src/main/java/com/ccsens/recovery/bean/message/RecoveryWithStartDrill.java
  5. 6
      recovery/src/main/java/com/ccsens/recovery/bean/vo/PatientVo.java
  6. 7
      recovery/src/main/java/com/ccsens/recovery/service/IPatientService.java
  7. 16
      recovery/src/main/java/com/ccsens/recovery/service/PatientService.java
  8. 2
      recovery/src/main/resources/mapper_dao/PatientDao.xml

4
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}

9
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<PatientDto.PatientId> 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<PatientDto.EndDrill> params) {

6
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("动作反馈")

1
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";
}

6
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

7
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);
}

16
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<String> 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)){
}
}
}

2
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}
</select>
<select id="getRobotByPatientId" resultType="com.ccsens.recovery.bean.po.RecoveryRobot">
SELECT

Loading…
Cancel
Save