|
@ -11,9 +11,11 @@ import com.yihu.jw.base.service.device.DeviceManageService;
|
|
|
import com.yihu.jw.base.service.device.DmDeviceService;
|
|
|
import com.yihu.jw.base.service.device.WlyyPatientDeviceService;
|
|
|
import com.yihu.jw.base.service.device.YsDeviceService;
|
|
|
import com.yihu.jw.entity.base.patient.BasePatientDO;
|
|
|
import com.yihu.jw.entity.care.device.Device;
|
|
|
import com.yihu.jw.entity.care.device.DeviceDetail;
|
|
|
import com.yihu.jw.entity.care.device.DevicePatientDevice;
|
|
|
import com.yihu.jw.patient.dao.BasePatientDao;
|
|
|
import com.yihu.jw.restmodel.ResponseContant;
|
|
|
import com.yihu.jw.restmodel.iot.device.WlyyPatientDeviceVO;
|
|
|
import com.yihu.jw.restmodel.web.Envelop;
|
|
@ -75,6 +77,8 @@ public class DeviceManageEndpoint extends EnvelopRestEndpoint {
|
|
|
private DmDeviceService dmDeviceService;
|
|
|
@Autowired
|
|
|
private YsDeviceService ysDeviceService;
|
|
|
@Autowired
|
|
|
private BasePatientDao patientDao;
|
|
|
|
|
|
@GetMapping("findWlyyDevices")
|
|
|
@ApiOperation("获取设备列表")
|
|
@ -151,12 +155,18 @@ public class DeviceManageEndpoint extends EnvelopRestEndpoint {
|
|
|
WlyyPatientDeviceVO deviceVO= new WlyyPatientDeviceVO();
|
|
|
BeanUtils.copyProperties(tmp, deviceVO, getNullPropertyNames(tmp));
|
|
|
deviceVO.setId(tmp.getId().intValue());
|
|
|
BasePatientDO patient = patientDao.findById(tmp.getUser());
|
|
|
if (patient!=null){
|
|
|
deviceVO.setUserName(patient.getName());
|
|
|
}
|
|
|
List<DeviceDetail> deviceDetails = deviceDetailDao.findByDeviceCode(deviceVO.getDeviceSn());
|
|
|
if (deviceDetails.size()>0){
|
|
|
DeviceDetail deviceDetail = deviceDetails.get(0);
|
|
|
deviceVO.setSim(deviceDetail.getSim());
|
|
|
deviceVO.setIccid(deviceDetail.getIccid());
|
|
|
deviceVO.setImsi(deviceDetail.getImsi());
|
|
|
deviceVO.setDeviceModel(deviceDetail.getDeviceModel());
|
|
|
deviceVO.setManufacturer(deviceDetail.getManufacturer());
|
|
|
}
|
|
|
|
|
|
list2.add(deviceVO);
|
|
@ -194,9 +204,9 @@ public class DeviceManageEndpoint extends EnvelopRestEndpoint {
|
|
|
@RequestParam(value = "size") int size){
|
|
|
try {
|
|
|
if (StringUtils.isBlank(filters)){
|
|
|
filters="del=0";
|
|
|
filters="del=1";
|
|
|
}else {
|
|
|
filters+=";del=0";
|
|
|
filters+=";del=1";
|
|
|
}
|
|
|
List<Device> list = dmDeviceService.search(fields, filters, sorts,page,size);
|
|
|
int count = (int) dmDeviceService.getCount(filters);
|