|
@ -93,9 +93,14 @@ public class KitService extends BaseService {
|
|
String maxAlarm = dataJSONStr.getString("max_alarm");//设备闹钟数
|
|
String maxAlarm = dataJSONStr.getString("max_alarm");//设备闹钟数
|
|
String maxDrugs = dataJSONStr.getString("max_drugs");//设备药格数
|
|
String maxDrugs = dataJSONStr.getString("max_drugs");//设备药格数
|
|
System.out.println("sn:"+sn+",deviceType:"+deviceType+",maxAlarm:"+maxAlarm+",maxDrugs:"+maxDrugs);
|
|
System.out.println("sn:"+sn+",deviceType:"+deviceType+",maxAlarm:"+maxAlarm+",maxDrugs:"+maxDrugs);
|
|
|
|
|
|
|
|
DeviceDetail deviceDetail = null;
|
|
|
|
DeviceDetail d = deviceDetailDao.findBySn(deviceSn);
|
|
|
|
if(d!=null){
|
|
|
|
deviceDetail = d;
|
|
|
|
}else{
|
|
|
|
deviceDetail = new DeviceDetail();
|
|
|
|
}
|
|
//添加设备
|
|
//添加设备
|
|
DeviceDetail deviceDetail = new DeviceDetail();
|
|
|
|
deviceDetail.setDeviceModel(deviceType);//设备型号
|
|
deviceDetail.setDeviceModel(deviceType);//设备型号
|
|
deviceDetail.setDeviceName("巨烨科技智能药盒");
|
|
deviceDetail.setDeviceName("巨烨科技智能药盒");
|
|
deviceDetail.setDeviceCode(sn);
|
|
deviceDetail.setDeviceCode(sn);
|
|
@ -140,11 +145,6 @@ public class KitService extends BaseService {
|
|
patientDeviceLog.setIsDel(1);
|
|
patientDeviceLog.setIsDel(1);
|
|
patientDeviceLogDao.save(patientDeviceLog);
|
|
patientDeviceLogDao.save(patientDeviceLog);
|
|
}else {
|
|
}else {
|
|
if("1".equals(typeTemp)){
|
|
|
|
typeTemp="0";
|
|
|
|
}else if("2".equals(typeTemp)){
|
|
|
|
typeTemp="1";
|
|
|
|
}
|
|
|
|
List<PatientDevice> list = patientDeviceDao.findByDeviceSn(deviceSn);
|
|
List<PatientDevice> list = patientDeviceDao.findByDeviceSn(deviceSn);
|
|
if(list.size()>0){
|
|
if(list.size()>0){
|
|
patientDevice = list.get(0);
|
|
patientDevice = list.get(0);
|
|
@ -152,7 +152,7 @@ public class KitService extends BaseService {
|
|
throw new Exception(" 数据库中没有该设备!");
|
|
throw new Exception(" 数据库中没有该设备!");
|
|
}
|
|
}
|
|
|
|
|
|
patientDeviceService.deleteDevices(deviceSn,typeTemp,null);
|
|
|
|
|
|
patientDeviceService.deleteDevices(deviceSn,"3",null);
|
|
//全部解绑后去判断就更新设备表中是否绑定字段
|
|
//全部解绑后去判断就更新设备表中是否绑定字段
|
|
patientDeviceLogService.savePatientDeviceLog(patientDevice,deviceSn,2,2);
|
|
patientDeviceLogService.savePatientDeviceLog(patientDevice,deviceSn,2,2);
|
|
deviceDetailService.unBindUpdateIsBinding(deviceSn);
|
|
deviceDetailService.unBindUpdateIsBinding(deviceSn);
|