|
@ -99,7 +99,7 @@ public class PatientDeviceService extends BaseService {
|
|
|
|
|
|
//校验sn码是否被使用
|
|
|
if(needVerify) {
|
|
|
PatientDevice device = patientDeviceDao.findByDeviceIdAndDeviceSnAndUserTypeAndDel(deviceId, sn, userType,0);
|
|
|
PatientDevice device = patientDeviceDao.findByDeviceIdAndDeviceSnAndUserType(deviceId, sn, userType);
|
|
|
if (device != null && !device.getId().equals(patientDevice.getId())) {
|
|
|
throw new Exception("sn码" + sn + "已被使用!");
|
|
|
}
|
|
@ -178,14 +178,12 @@ public class PatientDeviceService extends BaseService {
|
|
|
|
|
|
|
|
|
public void deleteDevices(String deviceSn,String type,String uuid){
|
|
|
List<PatientDevice> patientDevices = patientDeviceDao.findByDeviceSnAndCategoryCodeAndDel(deviceSn,type,0);
|
|
|
List<PatientDevice> patientDevices = patientDeviceDao.findByDeviceSnAndCategoryCode(deviceSn,type);
|
|
|
if(patientDevices==null||patientDevices.size()==0){
|
|
|
throw new RuntimeException("设备未被绑定!");
|
|
|
}
|
|
|
for(PatientDevice patientDevice: patientDevices){
|
|
|
patientDevice.setDelUser(uuid);
|
|
|
patientDevice.setDel(1);
|
|
|
patientDeviceDao.save(patientDevice);
|
|
|
patientDeviceDao.delete(patientDevice);
|
|
|
}
|
|
|
}
|
|
|
|
|
@ -195,10 +193,8 @@ public class PatientDeviceService extends BaseService {
|
|
|
*/
|
|
|
public List<JSONObject> deleteDevice(String id,String uuid) {
|
|
|
PatientDevice device = patientDeviceDao.findOne(Long.valueOf(id));
|
|
|
device.setDelUser(uuid);
|
|
|
device.setDel(1);
|
|
|
patientDeviceDao.save(device);
|
|
|
List<PatientDevice> patientDevices = patientDeviceDao.findByDeviceSnAndCategoryCodeAndDel(device.getDeviceSn(),device.getCategoryCode(),0);
|
|
|
patientDeviceDao.delete(device);
|
|
|
List<PatientDevice> patientDevices = patientDeviceDao.findByDeviceSnAndCategoryCode(device.getDeviceSn(),device.getCategoryCode());
|
|
|
List<JSONObject> objects = new ArrayList<>();
|
|
|
for(PatientDevice patientDevice:patientDevices){
|
|
|
JSONObject object = new JSONObject(patientDevice);
|
|
@ -272,7 +268,7 @@ public class PatientDeviceService extends BaseService {
|
|
|
//else{
|
|
|
// list = patientDeviceDao.findByUserAndDoctor(patientCode, doctorCode,pageRequest);
|
|
|
//}
|
|
|
list = patientDeviceDao.findByUserAndDel(patientCode,0,pageRequest);
|
|
|
list = patientDeviceDao.findByUser(patientCode,pageRequest);
|
|
|
if(list!=null)
|
|
|
{
|
|
|
//获取设备路径,医生姓名
|
|
@ -366,7 +362,7 @@ public class PatientDeviceService extends BaseService {
|
|
|
* @return
|
|
|
*/
|
|
|
public Iterator<PatientDevice> findPatientHave(String patient) {
|
|
|
return patientDeviceDao.findByUser(patient,0).iterator();
|
|
|
return patientDeviceDao.findByUser(patient).iterator();
|
|
|
}
|
|
|
|
|
|
/**
|
|
@ -383,7 +379,7 @@ public class PatientDeviceService extends BaseService {
|
|
|
**/
|
|
|
public List<Map<String,String>> getDeviceUser(String user,String deviceSn,String type) throws Exception {
|
|
|
List<Map<String,String>> re = new ArrayList<>();
|
|
|
List<PatientDevice> list =patientDeviceDao.findByDeviceSnAndCategoryCodeAndDel(deviceSn,type,0);
|
|
|
List<PatientDevice> list =patientDeviceDao.findByDeviceSnAndCategoryCode(deviceSn,type);
|
|
|
if(list!=null)
|
|
|
{
|
|
|
for(PatientDevice item:list)
|
|
@ -417,7 +413,7 @@ public class PatientDeviceService extends BaseService {
|
|
|
}
|
|
|
|
|
|
public JSONArray getDeviceByDeviceSn(String deviceSn,String type){
|
|
|
List<PatientDevice> list =patientDeviceDao.findByDeviceSnAndCategoryCodeAndDel(deviceSn,type,0);
|
|
|
List<PatientDevice> list =patientDeviceDao.findByDeviceSnAndCategoryCode(deviceSn,type);
|
|
|
JSONArray objects = new JSONArray();
|
|
|
for(PatientDevice patientDevice:list){
|
|
|
JSONObject object = new JSONObject(patientDevice);
|