|
@ -183,7 +183,7 @@ public class PatientDeviceService extends BaseJpaService<DevicePatientDevice, Pa
|
|
|
/**
|
|
|
* 保存患者设备
|
|
|
*/
|
|
|
public boolean saveDevice(DevicePatientDevice devicePatientDevice, String safe_area, Integer fenceNO, String name, BaseSleepPlan sleepPlan) throws Exception {
|
|
|
public boolean saveDevice(DevicePatientDevice devicePatientDevice, BaseSleepPlan sleepPlan) throws Exception {
|
|
|
//判断sn码是否被使用
|
|
|
String sn = devicePatientDevice.getDeviceSn();
|
|
|
String type = devicePatientDevice.getCategoryCode();
|
|
@ -243,35 +243,6 @@ public class PatientDeviceService extends BaseJpaService<DevicePatientDevice, Pa
|
|
|
MultiValueMap<String, String> param = new LinkedMultiValueMap<>();
|
|
|
if(checkDeviceSn(sn)){
|
|
|
|
|
|
//V1.0.0 添加手表的时候需要设置围栏
|
|
|
if ("4".equals(type)){
|
|
|
Device device = deviceDao.findOne(new Long (type));
|
|
|
if (device!=null){
|
|
|
if ("X1".equals(device.getModel())){
|
|
|
url = MessageFormat.format(AqgConfig.X1fence_area, sn,fenceNO);
|
|
|
}
|
|
|
}
|
|
|
param.add("name", name);
|
|
|
param.add("freq", "1"); //"0,触发一天;1,每日触发 "
|
|
|
param.add("enable","1");
|
|
|
param.add("time_begin", "0");
|
|
|
param.add("time_end", "86400");
|
|
|
param.add("safe_area", safe_area);
|
|
|
HttpEntity<com.alibaba.fastjson.JSONObject> response = httpClientUtil.aqgCookieHttp(url, param, HttpMethod.POST, getCookie());
|
|
|
com.alibaba.fastjson.JSONObject object = response.getBody();
|
|
|
if (object.get("success").equals("true")){
|
|
|
System.out.println("围栏地址添加成功");
|
|
|
} else {
|
|
|
System.out.println("添加失败");
|
|
|
String message = "围栏设置失败";
|
|
|
throw new Exception(message);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if ("16".equals(type)){ //智能拐杖
|
|
|
|
|
|
}
|
|
|
|
|
|
if ("13".equals(type)){ //睡眠带
|
|
|
if (StringUtils.isBlank(sleepPlan.getGetUpTime()) || StringUtils.isBlank(sleepPlan.getNightRestTime())) {
|
|
|
String message = "请完善睡眠时间规划";
|