Browse Source

20210602接口定义

recovery
zy_Java 4 years ago
parent
commit
f08207a99c
  1. 1
      pom.xml
  2. 4
      recovery/src/main/java/com/ccsens/recovery/api/HospitalController.java
  3. 134
      recovery/src/main/java/com/ccsens/recovery/api/PatientController.java
  4. 106
      recovery/src/main/java/com/ccsens/recovery/api/RecipeController.java
  5. 39
      recovery/src/main/java/com/ccsens/recovery/bean/dto/PatientDto.java
  6. 11
      recovery/src/main/java/com/ccsens/recovery/bean/po/RecRecord.java
  7. 60
      recovery/src/main/java/com/ccsens/recovery/bean/po/RecRecordExample.java
  8. 1
      recovery/src/main/java/com/ccsens/recovery/bean/vo/HospitalVo.java
  9. 7
      recovery/src/main/java/com/ccsens/recovery/bean/vo/PatientVo.java
  10. 2
      recovery/src/main/java/com/ccsens/recovery/bean/vo/RecipeVo.java
  11. 23
      recovery/src/main/java/com/ccsens/recovery/service/HospitalService.java
  12. 22
      recovery/src/main/java/com/ccsens/recovery/service/IPatientService.java
  13. 58
      recovery/src/main/java/com/ccsens/recovery/service/PatientService.java
  14. 43
      recovery/src/main/java/com/ccsens/recovery/service/RecipeService.java
  15. 2
      recovery/src/main/resources/application-common.yml
  16. 4
      recovery/src/main/resources/application.yml
  17. 38
      recovery/src/main/resources/mapper_raw/RecRecordMapper.xml
  18. 94
      util/src/test/java/com/ccsens/util/Base64Test.java

1
pom.xml

@ -9,6 +9,7 @@
<module>cloudutil</module>
<module>util</module>
<module>tall</module>
<module>recovery</module>
<!-- <module>ht</module>-->
<!-- <module>game</module>-->
<!-- <module>mt</module>-->

4
recovery/src/main/java/com/ccsens/recovery/api/HospitalController.java

@ -3,7 +3,6 @@ package com.ccsens.recovery.api;
import com.ccsens.cloudutil.annotation.MustLogin;
import com.ccsens.recovery.bean.dto.HospitalDto;
import com.ccsens.recovery.bean.vo.HospitalVo;
import com.ccsens.recovery.bean.vo.PatientVo;
import com.ccsens.recovery.service.IHospitalService;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.bean.dto.QueryDto;
@ -11,6 +10,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
@ -23,7 +23,7 @@ import java.util.List;
/**
* @author
*/
@Api(tags = "患者相关接口" , description = "")
@Api(tags = "医院相关接口" , description = "")
@RestController
@RequestMapping("/hospital")
@Slf4j

134
recovery/src/main/java/com/ccsens/recovery/api/PatientController.java

@ -28,56 +28,86 @@ import java.util.List;
@RequestMapping("/patient")
@Slf4j
public class PatientController {
@Resource
private IPatientService patientService;
@MustLogin
@ApiOperation(value = "主治医生查看患者列表", notes = "zy:")
@RequestMapping(value = "/doctorId", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<PatientVo.Patient>> queryPatientByDoctorId(@ApiParam @Validated @RequestBody QueryDto<HospitalDto.DoctorId> params) {
log.info("主治医生查看患者列表:{}",params);
List<PatientVo.Patient> patientList = patientService.queryPatientByDoctorId(params.getParam(),params.getUserId());
log.info("主治医生查看患者列表成功:{}",patientList);
return JsonResponse.newInstance().ok(patientList);
}
@MustLogin
@ApiOperation(value = "康复中心查看患者列表", notes = "zy:")
@RequestMapping(value = "/recovery", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<PatientVo.Patient>> queryPatientByRecovery(@ApiParam @Validated @RequestBody QueryDto<HospitalDto.HospitalId> params) {
log.info("康复中心查看患者列表:{}",params);
List<PatientVo.Patient> patientList = patientService.queryPatientByRecovery(params.getParam(),params.getUserId());
log.info("康复中心查看患者列表成功:{}",patientList);
return JsonResponse.newInstance().ok(patientList);
}
@MustLogin
@ApiOperation(value = "查看患者的详细信息", notes = "zy:")
@RequestMapping(value = "/detail", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<PatientVo.Patient> getPatientById(@ApiParam @Validated @RequestBody QueryDto<PatientDto.PatientId> params) {
log.info("查看患者的详细信息:{}",params);
PatientVo.Patient patient = patientService.getPatientById(params.getParam(),params.getUserId());
log.info("查看患者的详细信息成功:{}",patient);
return JsonResponse.newInstance().ok(patient);
}
@MustLogin
@ApiOperation(value = "添加患者", notes = "zy:")
@RequestMapping(value = "/add", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse addPatient(@ApiParam @Validated @RequestBody QueryDto<PatientDto.PatientDetail> params) {
log.info("添加患者:{}",params);
patientService.addPatient(params.getParam(),params.getUserId());
log.info("添加患者成功");
return JsonResponse.newInstance().ok();
}
@MustLogin
@ApiOperation(value = "康复医生选择需要做康复的患者", notes = "zy:")
@RequestMapping(value = "/choose", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse choosePatient(@ApiParam @Validated @RequestBody QueryDto<PatientDto.ChoosePatient> params) {
log.info("康复医生选择需要做康复的患者:{}",params);
patientService.choosePatient(params.getParam(),params.getUserId());
log.info("康复医生选择需要做康复的患者成功");
return JsonResponse.newInstance().ok();
}
// @Resource
// private IPatientService patientService;
//
// @MustLogin
// @ApiOperation(value = "主治医生查看患者列表", notes = "zy:")
// @RequestMapping(value = "/doctorId", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
// public JsonResponse<List<PatientVo.Patient>> queryPatientByDoctorId(@ApiParam @Validated @RequestBody QueryDto<HospitalDto.DoctorId> params) {
// log.info("主治医生查看患者列表:{}",params);
// List<PatientVo.Patient> patientList = patientService.queryPatientByDoctorId(params.getParam(),params.getUserId());
// log.info("主治医生查看患者列表成功:{}",patientList);
// return JsonResponse.newInstance().ok(patientList);
// }
//
// @MustLogin
// @ApiOperation(value = "康复中心查看患者列表", notes = "zy:")
// @RequestMapping(value = "/recovery", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
// public JsonResponse<List<PatientVo.Patient>> queryPatientByRecovery(@ApiParam @Validated @RequestBody QueryDto<HospitalDto.HospitalId> params) {
// log.info("康复中心查看患者列表:{}",params);
// List<PatientVo.Patient> patientList = patientService.queryPatientByRecovery(params.getParam(),params.getUserId());
// log.info("康复中心查看患者列表成功:{}",patientList);
// return JsonResponse.newInstance().ok(patientList);
// }
//
// @MustLogin
// @ApiOperation(value = "查看患者的详细信息", notes = "zy:")
// @RequestMapping(value = "/detail", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
// public JsonResponse<PatientVo.Patient> getPatientById(@ApiParam @Validated @RequestBody QueryDto<PatientDto.PatientId> params) {
// log.info("查看患者的详细信息:{}",params);
// PatientVo.Patient patient = patientService.getPatientById(params.getParam(),params.getUserId());
// log.info("查看患者的详细信息成功:{}",patient);
// return JsonResponse.newInstance().ok(patient);
// }
//
// @MustLogin
// @ApiOperation(value = "添加患者", notes = "zy:")
// @RequestMapping(value = "/add", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
// public JsonResponse addPatient(@ApiParam @Validated @RequestBody QueryDto<PatientDto.PatientDetail> params) {
// log.info("添加患者:{}",params);
// patientService.addPatient(params.getParam(),params.getUserId());
// log.info("添加患者成功");
// return JsonResponse.newInstance().ok();
// }
//
// @MustLogin
// @ApiOperation(value = "康复医生选择需要做康复的患者", notes = "zy:")
// @RequestMapping(value = "/choose", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
// public JsonResponse choosePatient(@ApiParam @Validated @RequestBody QueryDto<PatientDto.ChoosePatient> params) {
// log.info("康复医生选择需要做康复的患者:{}",params);
// patientService.choosePatient(params.getParam(),params.getUserId());
// log.info("康复医生选择需要做康复的患者成功");
// return JsonResponse.newInstance().ok();
// }
//
// @MustLogin
// @ApiOperation(value = "开启训练", notes = "zy:")
// @RequestMapping(value = "/start", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
// public JsonResponse<PatientVo.RecipeRecordId> startDrill(@ApiParam @Validated @RequestBody QueryDto<PatientDto.StartDrill> params) {
// log.info("开启训练:{}",params);
// PatientVo.RecipeRecordId recipeRecordId = patientService.startDrill(params.getParam(),params.getUserId());
// log.info("开启训练成功:{}",recipeRecordId);
// return JsonResponse.newInstance().ok(recipeRecordId);
// }
//
// @MustLogin
// @ApiOperation(value = "结束训练", notes = "zy:")
// @RequestMapping(value = "/start", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
// public JsonResponse endDrill(@ApiParam @Validated @RequestBody QueryDto<PatientDto.EndDrill> params) {
// log.info("结束训练:{}",params);
// patientService.endDrill(params.getParam(),params.getUserId());
// log.info("结束训练成功");
// return JsonResponse.newInstance().ok();
// }
//
// @MustLogin
// @ApiOperation(value = "动作反馈", notes = "zy:")
// @RequestMapping(value = "/feedback", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
// public JsonResponse actionFeedback(@ApiParam @Validated @RequestBody QueryDto<PatientDto.ActionFeedback> params) {
// log.info("动作反馈:{}",params);
// patientService.actionFeedback(params.getParam(),params.getUserId());
// log.info("动作反馈成功");
// return JsonResponse.newInstance().ok();
// }
}

106
recovery/src/main/java/com/ccsens/recovery/api/RecipeController.java

@ -23,61 +23,61 @@ import java.util.List;
/**
* @author
*/
@Api(tags = "患者相关接口" , description = "")
@Api(tags = "处方训练相关" , description = "")
@RestController
@RequestMapping("/recipe")
@Slf4j
public class RecipeController {
@Resource
private IRecipeService recipeService;
@MustLogin
@ApiOperation(value = "查看所有训练", notes = "zy:")
@RequestMapping(value = "/queryDrill", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<RecipeVo.Drill>> queryDrill(@ApiParam @Validated @RequestBody QueryDto params) {
log.info("查看所有训练:{}",params);
List<RecipeVo.Drill> drillList = recipeService.queryDrill(params.getUserId());
log.info("查看所有训练成功:{}",drillList);
return JsonResponse.newInstance().ok(drillList);
}
@MustLogin
@ApiOperation(value = "查看训练项目对应的游戏", notes = "zy:")
@RequestMapping(value = "/game", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<RecipeVo.Game>> queryGameByDrill(@ApiParam @Validated @RequestBody QueryDto<RecipeDto.DrillId> params) {
log.info("查看训练项目对应的游戏:{}",params);
List<RecipeVo.Game> gameList = recipeService.queryGameByDrill(params.getParam(),params.getUserId());
log.info("查看训练项目对应的游戏成功:{}",gameList);
return JsonResponse.newInstance().ok(gameList);
}
@MustLogin
@ApiOperation(value = "给患者添加处方", notes = "zy:")
@RequestMapping(value = "/add", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse queryPatientByDoctorId(@ApiParam @Validated @RequestBody QueryDto<RecipeDto.AddRecipe> params) {
log.info("主治医生查看患者列表:{}",params);
recipeService.queryPatientByDoctorId(params.getParam(),params.getUserId());
log.info("主治医生查看患者列表成功");
return JsonResponse.newInstance().ok();
}
@MustLogin
@ApiOperation(value = "查看患者的处方信息", notes = "zy:查找患者所有的处方信息,按倒叙排列")
@RequestMapping(value = "/queryRecipe", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<RecipeVo.PatientRecipe>> queryRecipeByPatientId(@ApiParam @Validated @RequestBody QueryDto<PatientDto.PatientId> params) {
log.info("查看患者的处方信息:{}",params);
List<RecipeVo.PatientRecipe> patientRecipeList = recipeService.queryRecipeByPatientId(params.getParam(),params.getUserId());
log.info("查看患者的处方信息成功:{}",patientRecipeList);
return JsonResponse.newInstance().ok(patientRecipeList);
}
@MustLogin
@ApiOperation(value = "查看患者处方项下的训练记录", notes = "zy:")
@RequestMapping(value = "/queryRecipeRecord", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<RecipeVo.RecipeRecord>> queryRecipeRecord(@ApiParam @Validated @RequestBody QueryDto<RecipeDto.RecipeProjectId> params) {
log.info("查看患者处方项下的训练记录:{}",params);
List<RecipeVo.RecipeRecord> recipeRecords = recipeService.queryRecipeRecord(params.getParam(),params.getUserId());
log.info("查看患者处方项下的训练记录成功:{}",recipeRecords);
return JsonResponse.newInstance().ok(recipeRecords);
}
// @Resource
// private IRecipeService recipeService;
//
// @MustLogin
// @ApiOperation(value = "查看所有训练", notes = "zy:")
// @RequestMapping(value = "/queryDrill", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
// public JsonResponse<List<RecipeVo.Drill>> queryDrill(@ApiParam @Validated @RequestBody QueryDto params) {
// log.info("查看所有训练:{}",params);
// List<RecipeVo.Drill> drillList = recipeService.queryDrill(params.getUserId());
// log.info("查看所有训练成功:{}",drillList);
// return JsonResponse.newInstance().ok(drillList);
// }
//
// @MustLogin
// @ApiOperation(value = "查看训练项目对应的游戏", notes = "zy:")
// @RequestMapping(value = "/game", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
// public JsonResponse<List<RecipeVo.Game>> queryGameByDrill(@ApiParam @Validated @RequestBody QueryDto<RecipeDto.DrillId> params) {
// log.info("查看训练项目对应的游戏:{}",params);
// List<RecipeVo.Game> gameList = recipeService.queryGameByDrill(params.getParam(),params.getUserId());
// log.info("查看训练项目对应的游戏成功:{}",gameList);
// return JsonResponse.newInstance().ok(gameList);
// }
//
// @MustLogin
// @ApiOperation(value = "给患者添加处方", notes = "zy:")
// @RequestMapping(value = "/add", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
// public JsonResponse queryPatientByDoctorId(@ApiParam @Validated @RequestBody QueryDto<RecipeDto.AddRecipe> params) {
// log.info("主治医生查看患者列表:{}",params);
// recipeService.queryPatientByDoctorId(params.getParam(),params.getUserId());
// log.info("主治医生查看患者列表成功");
// return JsonResponse.newInstance().ok();
// }
//
// @MustLogin
// @ApiOperation(value = "查看患者的处方信息", notes = "zy:查找患者所有的处方信息,按倒叙排列")
// @RequestMapping(value = "/queryRecipe", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
// public JsonResponse<List<RecipeVo.PatientRecipe>> queryRecipeByPatientId(@ApiParam @Validated @RequestBody QueryDto<PatientDto.PatientId> params) {
// log.info("查看患者的处方信息:{}",params);
// List<RecipeVo.PatientRecipe> patientRecipeList = recipeService.queryRecipeByPatientId(params.getParam(),params.getUserId());
// log.info("查看患者的处方信息成功:{}",patientRecipeList);
// return JsonResponse.newInstance().ok(patientRecipeList);
// }
//
// @MustLogin
// @ApiOperation(value = "查看患者处方项下的训练记录", notes = "zy:")
// @RequestMapping(value = "/queryRecipeRecord", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
// public JsonResponse<List<RecipeVo.RecipeRecord>> queryRecipeRecord(@ApiParam @Validated @RequestBody QueryDto<RecipeDto.RecipeProjectId> params) {
// log.info("查看患者处方项下的训练记录:{}",params);
// List<RecipeVo.RecipeRecord> recipeRecords = recipeService.queryRecipeRecord(params.getParam(),params.getUserId());
// log.info("查看患者处方项下的训练记录成功:{}",recipeRecords);
// return JsonResponse.newInstance().ok(recipeRecords);
// }
}

39
recovery/src/main/java/com/ccsens/recovery/bean/dto/PatientDto.java

@ -56,5 +56,44 @@ public class PatientDto {
private Long robotId;
}
@Data
@ApiModel("开启训练")
public static class StartDrill{
@NotNull(message = "患者id不能为空")
@ApiModelProperty("患者id")
private Long patientId;
@NotNull(message = "任务id不能为空")
@ApiModelProperty("任务id")
private Long taskId;
@NotNull(message = "处方项id不能为空")
@ApiModelProperty("处方项目id")
private Long recipeProjectId;
@ApiModelProperty("智能机器人id")
private Long robotId;
@ApiModelProperty("游戏id")
private Long gameId;
@ApiModelProperty("康复中心医生id")
private Long sceneDoctorId;
@ApiModelProperty("是否有远程指导 0否 1是")
private Long remoteGuidance;
@ApiModelProperty("远程指导医生id")
private Long remoteDoctorId;
}
@Data
@ApiModel("结束训练")
public static class EndDrill{
@ApiModelProperty("训练记录id")
private Long id;
}
@Data
@ApiModel("动作反馈")
public static class ActionFeedback{
@ApiModelProperty("训练记录id")
private Long recordId;
@ApiModelProperty("动作的结果")
private boolean result;
}
}

11
recovery/src/main/java/com/ccsens/recovery/bean/po/RecRecord.java

@ -10,6 +10,8 @@ public class RecRecord implements Serializable {
private Long sceneDoctorId;
private Long robotId;
private Long startTime;
private Long endTime;
@ -58,6 +60,14 @@ public class RecRecord implements Serializable {
this.sceneDoctorId = sceneDoctorId;
}
public Long getRobotId() {
return robotId;
}
public void setRobotId(Long robotId) {
this.robotId = robotId;
}
public Long getStartTime() {
return startTime;
}
@ -155,6 +165,7 @@ public class RecRecord implements Serializable {
sb.append(", id=").append(id);
sb.append(", recipeProjectId=").append(recipeProjectId);
sb.append(", sceneDoctorId=").append(sceneDoctorId);
sb.append(", robotId=").append(robotId);
sb.append(", startTime=").append(startTime);
sb.append(", endTime=").append(endTime);
sb.append(", gameId=").append(gameId);

60
recovery/src/main/java/com/ccsens/recovery/bean/po/RecRecordExample.java

@ -285,6 +285,66 @@ public class RecRecordExample {
return (Criteria) this;
}
public Criteria andRobotIdIsNull() {
addCriterion("robot_id is null");
return (Criteria) this;
}
public Criteria andRobotIdIsNotNull() {
addCriterion("robot_id is not null");
return (Criteria) this;
}
public Criteria andRobotIdEqualTo(Long value) {
addCriterion("robot_id =", value, "robotId");
return (Criteria) this;
}
public Criteria andRobotIdNotEqualTo(Long value) {
addCriterion("robot_id <>", value, "robotId");
return (Criteria) this;
}
public Criteria andRobotIdGreaterThan(Long value) {
addCriterion("robot_id >", value, "robotId");
return (Criteria) this;
}
public Criteria andRobotIdGreaterThanOrEqualTo(Long value) {
addCriterion("robot_id >=", value, "robotId");
return (Criteria) this;
}
public Criteria andRobotIdLessThan(Long value) {
addCriterion("robot_id <", value, "robotId");
return (Criteria) this;
}
public Criteria andRobotIdLessThanOrEqualTo(Long value) {
addCriterion("robot_id <=", value, "robotId");
return (Criteria) this;
}
public Criteria andRobotIdIn(List<Long> values) {
addCriterion("robot_id in", values, "robotId");
return (Criteria) this;
}
public Criteria andRobotIdNotIn(List<Long> values) {
addCriterion("robot_id not in", values, "robotId");
return (Criteria) this;
}
public Criteria andRobotIdBetween(Long value1, Long value2) {
addCriterion("robot_id between", value1, value2, "robotId");
return (Criteria) this;
}
public Criteria andRobotIdNotBetween(Long value1, Long value2) {
addCriterion("robot_id not between", value1, value2, "robotId");
return (Criteria) this;
}
public Criteria andStartTimeIsNull() {
addCriterion("start_time is null");
return (Criteria) this;

1
recovery/src/main/java/com/ccsens/recovery/bean/vo/HospitalVo.java

@ -4,7 +4,6 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
/**
* @author

7
recovery/src/main/java/com/ccsens/recovery/bean/vo/PatientVo.java

@ -39,4 +39,11 @@ public class PatientVo {
private String doctorName;
}
@Data
@ApiModel("训练记录id")
public static class RecipeRecordId{
@ApiModelProperty("训练记录id")
private Long id;
}
}

2
recovery/src/main/java/com/ccsens/recovery/bean/vo/RecipeVo.java

@ -82,6 +82,8 @@ public class RecipeVo {
private Long startTime;
@ApiModelProperty("结束时间")
private Long endTime;
@ApiModelProperty("使用的智能机器人id")
private Long robotId;
@ApiModelProperty("康复中心医生id")
private Long sceneDoctorId;
@ApiModelProperty("康复中心医生名")

23
recovery/src/main/java/com/ccsens/recovery/service/HospitalService.java

@ -0,0 +1,23 @@
package com.ccsens.recovery.service;
import com.ccsens.recovery.bean.dto.HospitalDto;
import com.ccsens.recovery.bean.vo.HospitalVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* @author
*/
@Slf4j
@Service
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class HospitalService implements IHospitalService{
@Override
public List<HospitalVo.RobotInfo> queryRobotByHospital(HospitalDto.HospitalId param, Long userId) {
return null;
}
}

22
recovery/src/main/java/com/ccsens/recovery/service/IPatientService.java

@ -46,4 +46,26 @@ public interface IPatientService {
* @param userId userId
*/
void choosePatient(PatientDto.ChoosePatient param, Long userId);
/**
* 开启训练
* @param param 训练的信息
* @param userId userID
* @return 返回训练记录的id
*/
PatientVo.RecipeRecordId startDrill(PatientDto.StartDrill param, Long userId);
/**
* 结束训练
* @param param 训练记录id
* @param userId userId
*/
void endDrill(PatientDto.EndDrill param, Long userId);
/**
* 动作反馈
* @param param 记录id和结果
* @param userId userId
*/
void actionFeedback(PatientDto.ActionFeedback param, Long userId);
}

58
recovery/src/main/java/com/ccsens/recovery/service/PatientService.java

@ -0,0 +1,58 @@
package com.ccsens.recovery.service;
import com.ccsens.recovery.bean.dto.HospitalDto;
import com.ccsens.recovery.bean.dto.PatientDto;
import com.ccsens.recovery.bean.vo.PatientVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* @author
*/
@Slf4j
@Service
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class PatientService implements IPatientService{
@Override
public List<PatientVo.Patient> queryPatientByDoctorId(HospitalDto.DoctorId param, Long userId) {
return null;
}
@Override
public List<PatientVo.Patient> queryPatientByRecovery(HospitalDto.HospitalId param, Long userId) {
return null;
}
@Override
public PatientVo.Patient getPatientById(PatientDto.PatientId param, Long userId) {
return null;
}
@Override
public void addPatient(PatientDto.PatientDetail param, Long userId) {
}
@Override
public void choosePatient(PatientDto.ChoosePatient param, Long userId) {
}
@Override
public PatientVo.RecipeRecordId startDrill(PatientDto.StartDrill param, Long userId) {
return null;
}
@Override
public void endDrill(PatientDto.EndDrill param, Long userId) {
}
@Override
public void actionFeedback(PatientDto.ActionFeedback param, Long userId) {
}
}

43
recovery/src/main/java/com/ccsens/recovery/service/RecipeService.java

@ -0,0 +1,43 @@
package com.ccsens.recovery.service;
import com.ccsens.recovery.bean.dto.PatientDto;
import com.ccsens.recovery.bean.dto.RecipeDto;
import com.ccsens.recovery.bean.vo.RecipeVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* @author
*/
@Slf4j
@Service
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class RecipeService implements IRecipeService{
@Override
public void queryPatientByDoctorId(RecipeDto.AddRecipe param, Long userId) {
}
@Override
public List<RecipeVo.Drill> queryDrill(Long userId) {
return null;
}
@Override
public List<RecipeVo.PatientRecipe> queryRecipeByPatientId(PatientDto.PatientId param, Long userId) {
return null;
}
@Override
public List<RecipeVo.Game> queryGameByDrill(RecipeDto.DrillId param, Long userId) {
return null;
}
@Override
public List<RecipeVo.RecipeRecord> queryRecipeRecord(RecipeDto.RecipeProjectId param, Long userId) {
return null;
}
}

2
recovery/src/main/resources/application-common.yml

@ -9,7 +9,7 @@ logging:
mybatis:
config-location: classpath:mybatis/mybatis-config.xml
mapper-locations: classpath*:mapper_*/*.xml
type-aliases-package: com.ccsens.ht.bean
type-aliases-package: com.ccsens.recovery.bean
server:
tomcat:
uri-encoding: UTF-8

4
recovery/src/main/resources/application.yml

@ -1,6 +1,6 @@
spring:
profiles:
active: dev
include: util-dev,common
active: test
include: util-test,common

38
recovery/src/main/resources/mapper_raw/RecRecordMapper.xml

@ -5,6 +5,7 @@
<id column="id" jdbcType="BIGINT" property="id" />
<result column="recipe_project_id" jdbcType="BIGINT" property="recipeProjectId" />
<result column="scene_doctor_id" jdbcType="BIGINT" property="sceneDoctorId" />
<result column="robot_id" jdbcType="BIGINT" property="robotId" />
<result column="start_time" jdbcType="BIGINT" property="startTime" />
<result column="end_time" jdbcType="BIGINT" property="endTime" />
<result column="game_id" jdbcType="BIGINT" property="gameId" />
@ -76,8 +77,9 @@
</where>
</sql>
<sql id="Base_Column_List">
id, recipe_project_id, scene_doctor_id, start_time, end_time, game_id, remote_guidance,
remote_doctor_id, score, sub_task_id, operator, create_time, update_time, rec_status
id, recipe_project_id, scene_doctor_id, robot_id, start_time, end_time, game_id,
remote_guidance, remote_doctor_id, score, sub_task_id, operator, create_time, update_time,
rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.recovery.bean.po.RecRecordExample" resultMap="BaseResultMap">
select
@ -111,15 +113,17 @@
</delete>
<insert id="insert" parameterType="com.ccsens.recovery.bean.po.RecRecord">
insert into t_rec_record (id, recipe_project_id, scene_doctor_id,
start_time, end_time, game_id,
remote_guidance, remote_doctor_id, score,
sub_task_id, operator, create_time,
update_time, rec_status)
robot_id, start_time, end_time,
game_id, remote_guidance, remote_doctor_id,
score, sub_task_id, operator,
create_time, update_time, rec_status
)
values (#{id,jdbcType=BIGINT}, #{recipeProjectId,jdbcType=BIGINT}, #{sceneDoctorId,jdbcType=BIGINT},
#{startTime,jdbcType=BIGINT}, #{endTime,jdbcType=BIGINT}, #{gameId,jdbcType=BIGINT},
#{remoteGuidance,jdbcType=TINYINT}, #{remoteDoctorId,jdbcType=BIGINT}, #{score,jdbcType=INTEGER},
#{subTaskId,jdbcType=BIGINT}, #{operator,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT})
#{robotId,jdbcType=BIGINT}, #{startTime,jdbcType=BIGINT}, #{endTime,jdbcType=BIGINT},
#{gameId,jdbcType=BIGINT}, #{remoteGuidance,jdbcType=TINYINT}, #{remoteDoctorId,jdbcType=BIGINT},
#{score,jdbcType=INTEGER}, #{subTaskId,jdbcType=BIGINT}, #{operator,jdbcType=BIGINT},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}
)
</insert>
<insert id="insertSelective" parameterType="com.ccsens.recovery.bean.po.RecRecord">
insert into t_rec_record
@ -133,6 +137,9 @@
<if test="sceneDoctorId != null">
scene_doctor_id,
</if>
<if test="robotId != null">
robot_id,
</if>
<if test="startTime != null">
start_time,
</if>
@ -177,6 +184,9 @@
<if test="sceneDoctorId != null">
#{sceneDoctorId,jdbcType=BIGINT},
</if>
<if test="robotId != null">
#{robotId,jdbcType=BIGINT},
</if>
<if test="startTime != null">
#{startTime,jdbcType=BIGINT},
</if>
@ -230,6 +240,9 @@
<if test="record.sceneDoctorId != null">
scene_doctor_id = #{record.sceneDoctorId,jdbcType=BIGINT},
</if>
<if test="record.robotId != null">
robot_id = #{record.robotId,jdbcType=BIGINT},
</if>
<if test="record.startTime != null">
start_time = #{record.startTime,jdbcType=BIGINT},
</if>
@ -273,6 +286,7 @@
set id = #{record.id,jdbcType=BIGINT},
recipe_project_id = #{record.recipeProjectId,jdbcType=BIGINT},
scene_doctor_id = #{record.sceneDoctorId,jdbcType=BIGINT},
robot_id = #{record.robotId,jdbcType=BIGINT},
start_time = #{record.startTime,jdbcType=BIGINT},
end_time = #{record.endTime,jdbcType=BIGINT},
game_id = #{record.gameId,jdbcType=BIGINT},
@ -297,6 +311,9 @@
<if test="sceneDoctorId != null">
scene_doctor_id = #{sceneDoctorId,jdbcType=BIGINT},
</if>
<if test="robotId != null">
robot_id = #{robotId,jdbcType=BIGINT},
</if>
<if test="startTime != null">
start_time = #{startTime,jdbcType=BIGINT},
</if>
@ -337,6 +354,7 @@
update t_rec_record
set recipe_project_id = #{recipeProjectId,jdbcType=BIGINT},
scene_doctor_id = #{sceneDoctorId,jdbcType=BIGINT},
robot_id = #{robotId,jdbcType=BIGINT},
start_time = #{startTime,jdbcType=BIGINT},
end_time = #{endTime,jdbcType=BIGINT},
game_id = #{gameId,jdbcType=BIGINT},

94
util/src/test/java/com/ccsens/util/Base64Test.java

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save