Kaynağa Gözat

获取患者手表步数数据

xiaoyunquan 2 yıl önce
ebeveyn
işleme
24786f06fe

+ 27 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/device/DoctorDeviceController.java

@ -397,4 +397,31 @@ public class DoctorDeviceController extends BaseController {
		}
		}
	}
	}
	@ApiOperation("获取患者手表步数数据(医生端)")
	@RequestMapping(value = "getPatientStep", method = RequestMethod.GET)
	public String getPatientStep(@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.getPatientStep(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);
		}
	}
}
}

+ 28 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/device/PatientDeviceController.java

@ -580,4 +580,32 @@ public class PatientDeviceController extends BaseController {
        }
        }
    }
    }
    @ApiOperation("获取患者手表步数数据(居民端)")
    @RequestMapping(value = "getPatientStep", method = RequestMethod.GET)
    public String getPatientStep(@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 {
            //居民端登录鉴权
            com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject();
            jsonObject.put("patient",permissionService.getUID());
            if (permissionService.noPermission(1, jsonObject)) {
                return write(-1,"该操作没有权限");
            }
            if (StringUtils.isBlank(patient) && StringUtils.isBlank(deviceSn)) {
                return write(-1,"请求参数");
            }
            org.json.JSONObject result = patientDeviceService.getPatientStep(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);
        }
    }
}
}