|
@ -349,15 +349,15 @@ public class DoctorDeviceController extends BaseController {
|
|
|
@ApiParam(name="deviceSn")@RequestParam(value = "deviceSn",required = false)String deviceSn,
|
|
|
@ApiParam(name="day")@RequestParam(value = "day",required = false)String day){
|
|
|
try {
|
|
|
if (StringUtils.isBlank(patient)&&StringUtils.isBlank(deviceSn)){
|
|
|
return error(-1,"请求参数");
|
|
|
}
|
|
|
//医生端登录鉴权
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("doctorId",permissionService.getUID());
|
|
|
if (permissionService.noPermission(1, jsonObject)) {
|
|
|
return error(-1,"该操作没有权限");
|
|
|
}
|
|
|
if (StringUtils.isBlank(patient)&&StringUtils.isBlank(deviceSn)){
|
|
|
return error(-1,"请求参数");
|
|
|
}
|
|
|
org.json.JSONObject result = patientDeviceService.getSleepReport(patient,deviceSn,day);
|
|
|
if (ResponseContant.success==result.getInt(ResponseContant.resultFlag)){
|
|
|
return write(200,"获取成功","data",result.get(ResponseContant.resultMsg));
|
|
@ -370,4 +370,31 @@ public class DoctorDeviceController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
@ApiOperation("获取患者手表睡眠质量(医生端)")
|
|
|
@RequestMapping(value = "getX1SleepInfo", method = RequestMethod.GET)
|
|
|
public String getX1SleepInfo(@ApiParam(name = "patient") @RequestParam(value = "patient", required = false) String patient,
|
|
|
@ApiParam(name = "deviceSn") @RequestParam(value = "deviceSn", required = false) String deviceSn,
|
|
|
@ApiParam(name = "day") @RequestParam(value = "day", required = false) String day) {
|
|
|
try {
|
|
|
//医生端登录鉴权
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("doctorId",permissionService.getUID());
|
|
|
if (permissionService.noPermission(1, jsonObject)) {
|
|
|
return error(-1,"该操作没有权限");
|
|
|
}
|
|
|
if (StringUtils.isBlank(patient) && StringUtils.isBlank(deviceSn)) {
|
|
|
return write(-1,"请求参数");
|
|
|
}
|
|
|
org.json.JSONObject result = patientDeviceService.getX1SleepInfo(patient, deviceSn, day);
|
|
|
if (ResponseContant.success == result.getInt(ResponseContant.resultFlag)) {
|
|
|
return write(200,"获取成功","data", result.get(ResponseContant.resultMsg));
|
|
|
} else {
|
|
|
return write(-1,result.getString(ResponseContant.resultMsg));
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
return errorResult(e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|