|
@ -61,7 +61,7 @@ public class DeviceDetailService extends BaseJpaService<DeviceDetail, DeviceDeta
|
|
* @param isFirst
|
|
* @param isFirst
|
|
* @throws Exception
|
|
* @throws Exception
|
|
*/
|
|
*/
|
|
@Transactional
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
public void updateAfterBinding(DevicePatientDevice devicePatientDevice, Date grantTime, boolean isFirst)throws Exception{
|
|
public void updateAfterBinding(DevicePatientDevice devicePatientDevice, Date grantTime, boolean isFirst)throws Exception{
|
|
DeviceDetail deviceDetail = deviceDetailDao.findBySn(devicePatientDevice.getDeviceSn());
|
|
DeviceDetail deviceDetail = deviceDetailDao.findBySn(devicePatientDevice.getDeviceSn());
|
|
long adminTeam=0L;
|
|
long adminTeam=0L;
|
|
@ -76,8 +76,7 @@ public class DeviceDetailService extends BaseJpaService<DeviceDetail, DeviceDeta
|
|
}
|
|
}
|
|
//设备表没有数据则插入一条数据
|
|
//设备表没有数据则插入一条数据
|
|
if (deviceDetail==null){
|
|
if (deviceDetail==null){
|
|
insertDevice(devicePatientDevice,String.valueOf(adminTeam),hospitalName,hospital,"",doctorCode,doctorName,1);
|
|
|
|
deviceDetail = deviceDetailDao.findBySn(devicePatientDevice.getDeviceSn());
|
|
|
|
|
|
deviceDetail = insertDevice(devicePatientDevice,String.valueOf(adminTeam),hospitalName,hospital,"",doctorCode,doctorName,1);
|
|
}
|
|
}
|
|
|
|
|
|
Integer bind = deviceDetail.getIsBinding();
|
|
Integer bind = deviceDetail.getIsBinding();
|
|
@ -120,7 +119,7 @@ public class DeviceDetailService extends BaseJpaService<DeviceDetail, DeviceDeta
|
|
* @param isBind 0未绑定 1已绑定
|
|
* @param isBind 0未绑定 1已绑定
|
|
* @throws Exception
|
|
* @throws Exception
|
|
*/
|
|
*/
|
|
public void insertDevice(DevicePatientDevice devicePatientDevice, String adminTeam, String orgName, String orgCode, String bindCount, String doctorCode, String doctorName, int isBind)throws Exception{
|
|
|
|
|
|
public DeviceDetail insertDevice(DevicePatientDevice devicePatientDevice, String adminTeam, String orgName, String orgCode, String bindCount, String doctorCode, String doctorName, int isBind)throws Exception{
|
|
//获取原始数据
|
|
//获取原始数据
|
|
DeviceDetail deviceDetail = new DeviceDetail();
|
|
DeviceDetail deviceDetail = new DeviceDetail();
|
|
BasePatientDO patient = patientDao.findById(devicePatientDevice.getUser());
|
|
BasePatientDO patient = patientDao.findById(devicePatientDevice.getUser());
|
|
@ -169,6 +168,7 @@ public class DeviceDetailService extends BaseJpaService<DeviceDetail, DeviceDeta
|
|
deviceDetail.setApplicantMail(doctor.getMobile());
|
|
deviceDetail.setApplicantMail(doctor.getMobile());
|
|
}
|
|
}
|
|
deviceDetailDao.save(deviceDetail);
|
|
deviceDetailDao.save(deviceDetail);
|
|
|
|
return deviceDetail;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|