Browse Source

Merge branch 'dev' of suhaiwen/wlyy2.0 into dev

huangwenjie 4 years ago
parent
commit
7187250673

+ 6 - 0
svr/svr-iot/src/main/java/com/yihu/iot/controller/device/IotDeviceController.java

@ -193,11 +193,17 @@ public class IotDeviceController extends EnvelopRestEndpoint {
            if (size == null) {
            if (size == null) {
                size = 10;
                size = 10;
            }
            }
            if(isBinding==3){
                return iotDeviceService.findDevice();
            }
            if (isBinding == null) {
            if (isBinding == null) {
                return iotDeviceService.queryPage(sn, hospital, hospitalName, orderId, purcharseId, productId, name, categoryCode, manufacturerId, page, size);
                return iotDeviceService.queryPage(sn, hospital, hospitalName, orderId, purcharseId, productId, name, categoryCode, manufacturerId, page, size);
            } else {
            } else {
                return iotDeviceService.queryPage(sn, hospital, orderId, purcharseId, isBinding, page, size);
                return iotDeviceService.queryPage(sn, hospital, orderId, purcharseId, isBinding, page, size);
            }
            }
        } catch (Exception e) {
        } catch (Exception e) {
            e.printStackTrace();
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
            return MixEnvelop.getError(e.getMessage());

+ 16 - 0
svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotDeviceService.java

@ -332,6 +332,22 @@ public class IotDeviceService extends BaseJpaService<IotDeviceDO,IotDeviceDao> {
        return MixEnvelop.getSuccessListWithPage(IotRequestMapping.Common.message_success_find_functions,iotDeviceVOList, page, size,count);
        return MixEnvelop.getSuccessListWithPage(IotRequestMapping.Common.message_success_find_functions,iotDeviceVOList, page, size,count);
    }
    }
    /**
     *
     * @return
     */
    public MixEnvelop<IotDeviceVO, IotDeviceVO> findDevice() {
        String sql ="SELECT DISTINCT c.* from iot_device c left join iot_patient_device t on t.del = 1 AND c.device_sn = t.device_sn  WHERE c.del=1 GROUP BY c.`name`";
        List<IotDeviceDO> list = jdbcTempalte.query(sql,new BeanPropertyRowMapper(IotDeviceDO.class));
        //DO转VO
        List<IotDeviceVO> iotDeviceVOList = convertToModels(list,new ArrayList<>(list.size()),IotDeviceVO.class);
        translateDictForList(iotDeviceVOList);
        return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_find_functions,iotDeviceVOList);
    }
    /**
    /**
     * 根据设备序列号判断设备是否存在
     * 根据设备序列号判断设备是否存在
     * @param deviceSn
     * @param deviceSn

+ 1 - 1
svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotDeviceSimService.java

@ -214,7 +214,7 @@ public class IotDeviceSimService  extends BaseJpaService<IotDeviceSimDO, IotDevi
        sim.setTime(time);
        sim.setTime(time);
        iotSystemDictDao.save(sim);
        iotSystemDictDao.save(sim);
        //触发JOB工程
        //触发JOB工程
        httpClientUtil.get(jobUrl,"UTF-8");
//        httpClientUtil.get(jobUrl,"UTF-8");
    }
    }