|
@ -18,6 +18,7 @@ import com.yihu.jw.restmodel.web.PageEnvelop;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.json.JSONArray;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
@ -342,4 +343,31 @@ public class DoctorDeviceController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@ApiOperation("获取睡眠带睡眠报告")
|
|
|
@RequestMapping(value ="getSleepReport",method = RequestMethod.GET)
|
|
|
public String getSleepReport(@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 {
|
|
|
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,"该操作没有权限");
|
|
|
}
|
|
|
org.json.JSONObject result = patientDeviceService.getSleepReport(patient,deviceSn,day);
|
|
|
if (ResponseContant.success==result.getInt(ResponseContant.resultFlag)){
|
|
|
return write(200,"获取成功","data",result.get(ResponseContant.resultMsg));
|
|
|
}else {
|
|
|
return error(-1,result.getString(ResponseContant.resultMsg));
|
|
|
}
|
|
|
|
|
|
}catch (Exception e){
|
|
|
return errorResult(e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|