yeshijie 8 лет назад
Родитель
Сommit
87bb68d12f

+ 2 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/patient/PatientDeviceDao.java

@ -22,4 +22,6 @@ public interface PatientDeviceDao extends PagingAndSortingRepository<PatientDevi
	PatientDevice findByDeviceSnAndCategoryCodeAndUserType(String deviceSn, String categoryCode,String userType);
	PatientDevice findByDeviceIdAndDeviceSnAndUserType(Long deviceId, String deviceSn,String userType);
	PatientDevice findByDeviceSnAndUserType(String deviceSn,String userType);
}

+ 2 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/device/PatientDeviceService.java

@ -99,7 +99,8 @@ public class PatientDeviceService extends BaseService {
			//校验sn码是否被使用
			if(needVerify) {
				PatientDevice device = patientDeviceDao.findByDeviceIdAndDeviceSnAndUserType(deviceId, sn, userType);
//				PatientDevice device = patientDeviceDao.findByDeviceIdAndDeviceSnAndUserType(deviceId, sn, userType);
				PatientDevice device = patientDeviceDao.findByDeviceSnAndUserType(sn, userType);
				if (device != null && !device.getId().equals(patientDevice.getId())) {
					throw new Exception("sn码" + sn + "已被使用!");
				}