| 
															
																@ -26,6 +26,7 @@ import com.yihu.jw.restmodel.ResponseContant; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.util.common.GpsUtil; 
															 | 
															
															 | 
															
																import com.yihu.jw.util.common.GpsUtil; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.util.common.IdCardUtil; 
															 | 
															
															 | 
															
																import com.yihu.jw.util.common.IdCardUtil; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.util.date.DateUtil; 
															 | 
															
															 | 
															
																import com.yihu.jw.util.date.DateUtil; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																import com.yihu.jw.util.entity.ServiceException; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.util.healthIndex.HealthIndexUtil; 
															 | 
															
															 | 
															
																import com.yihu.jw.util.healthIndex.HealthIndexUtil; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.util.http.HttpClientUtil; 
															 | 
															
															 | 
															
																import com.yihu.jw.util.http.HttpClientUtil; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.mysql.query.BaseJpaService; 
															 | 
															
															 | 
															
																import com.yihu.mysql.query.BaseJpaService; 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -199,7 +200,7 @@ public class PatientDeviceService extends BaseJpaService<DevicePatientDevice, Pa 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    /** 
															 | 
															
															 | 
															
																    /** 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     * 保存患者设备 
															 | 
															
															 | 
															
																     * 保存患者设备 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     */ 
															 | 
															
															 | 
															
																     */ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    public boolean saveDevice(DevicePatientDevice devicePatientDevice, BaseSleepPlan sleepPlan, String iotDeviceSn, String safeAreaGz) throws Exception { 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																    public int saveDevice(DevicePatientDevice devicePatientDevice, BaseSleepPlan sleepPlan, String iotDeviceSn, String safeAreaGz) throws Exception { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        //判断sn码是否被使用 
															 | 
															
															 | 
															
																        //判断sn码是否被使用 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        String sn = devicePatientDevice.getDeviceSn(); 
															 | 
															
															 | 
															
																        String sn = devicePatientDevice.getDeviceSn(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        String type = devicePatientDevice.getCategoryCode(); 
															 | 
															
															 | 
															
																        String type = devicePatientDevice.getCategoryCode(); 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -214,13 +215,13 @@ public class PatientDeviceService extends BaseJpaService<DevicePatientDevice, Pa 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        if (type.equals("7")){ 
															 | 
															
															 | 
															
																        if (type.equals("7")){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            if (StringUtils.isBlank(devicePatientDevice.getSosAddress())){ 
															 | 
															
															 | 
															
																            if (StringUtils.isBlank(devicePatientDevice.getSosAddress())){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                return false; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                return 0; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            } 
															 | 
															
															 | 
															
																            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        } 
															 | 
															
															 | 
															
																        } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        if (type.equals("13")){ 
															 | 
															
															 | 
															
																        if (type.equals("13")){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            if (StringUtils.isBlank(devicePatientDevice.getSosAddress())){ 
															 | 
															
															 | 
															
																            if (StringUtils.isBlank(devicePatientDevice.getSosAddress())){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                return false; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                return 0; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            } 
															 | 
															
															 | 
															
																            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        } 
															 | 
															
															 | 
															
																        } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -233,7 +234,8 @@ public class PatientDeviceService extends BaseJpaService<DevicePatientDevice, Pa 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                    needVerify = false; 
															 | 
															
															 | 
															
																                    needVerify = false; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                } 
															 | 
															
															 | 
															
																                } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            } else { 
															 | 
															
															 | 
															
																            } else { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                throw new Exception("不存在该条记录!"); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																//                throw new Exception("不存在该条记录!"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                return -4; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            } 
															 | 
															
															 | 
															
																            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        } 
															 | 
															
															 | 
															
																        } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -246,8 +248,10 @@ public class PatientDeviceService extends BaseJpaService<DevicePatientDevice, Pa 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                //监控器 12   报警器 7  14  15 
															 | 
															
															 | 
															
																                //监控器 12   报警器 7  14  15 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                if ("12".equals(type) || "14".equals(type) || "15".equals(type) || "7".equals(type) ) { 
															 | 
															
															 | 
															
																                if ("12".equals(type) || "14".equals(type) || "15".equals(type) || "7".equals(type) ) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                    System.out.println("此类设备支持多绑定"); 
															 | 
															
															 | 
															
																                    System.out.println("此类设备支持多绑定"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                } else { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    System.out.println("sn码" + sn + "已被使用!"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    return -3; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                } 
															 | 
															
															 | 
															
																                } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                throw new Exception("sn码" + sn + "已被使用!"); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            } 
															 | 
															
															 | 
															
																            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        } 
															 | 
															
															 | 
															
																        } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        devicePatientDevice.setCzrq(new Date()); 
															 | 
															
															 | 
															
																        devicePatientDevice.setCzrq(new Date()); 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -262,7 +266,7 @@ public class PatientDeviceService extends BaseJpaService<DevicePatientDevice, Pa 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            if ("13".equals(type)){ //睡眠带 
															 | 
															
															 | 
															
																            if ("13".equals(type)){ //睡眠带 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                if (StringUtils.isBlank(sleepPlan.getGetUpTime()) || StringUtils.isBlank(sleepPlan.getNightRestTime())) { 
															 | 
															
															 | 
															
																                if (StringUtils.isBlank(sleepPlan.getGetUpTime()) || StringUtils.isBlank(sleepPlan.getNightRestTime())) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                    String message = "请完善睡眠时间规划"; 
															 | 
															
															 | 
															
																                    String message = "请完善睡眠时间规划"; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                    throw new Exception(message); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    return -2; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                } 
															 | 
															
															 | 
															
																                } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                sleepPlanDao.save(sleepPlan); 
															 | 
															
															 | 
															
																                sleepPlanDao.save(sleepPlan); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            } 
															 | 
															
															 | 
															
																            } 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -276,10 +280,10 @@ public class PatientDeviceService extends BaseJpaService<DevicePatientDevice, Pa 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            patientDeviceDao.save(devicePatientDevice); 
															 | 
															
															 | 
															
																            patientDeviceDao.save(devicePatientDevice); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        }else { 
															 | 
															
															 | 
															
																        }else { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            String message = "设备不存在"; 
															 | 
															
															 | 
															
																            String message = "设备不存在"; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            throw new Exception(message); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            return -1; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        } 
															 | 
															
															 | 
															
																        } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        return true; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        return 1; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    } 
															 | 
															
															 | 
															
																    } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    public int delDeviceByDeviceSn(String deviceSn){ 
															 | 
															
															 | 
															
																    public int delDeviceByDeviceSn(String deviceSn){ 
															 |