Explorar el Código

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

humingfen hace 4 años
padre
commit
48e5f266fb

+ 9 - 1
svr/svr-iot/src/main/java/com/yihu/iot/controller/device/IotDeviceController.java

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

+ 13 - 4
svr/svr-iot/src/main/java/com/yihu/iot/service/company/IotCompanyService.java

@ -144,10 +144,19 @@ public class IotCompanyService extends BaseJpaService<IotCompanyDO,IotCompanyDao
        List<Map<String,Object>> countList = jdbcTempalte.queryForList(sqlCount.toString());
        long count = Long.valueOf(countList.get(0).get("count").toString());
        //DO转VO
        List<IotCompanyVO> iotCompanyVOList = convertToModelVOs(list,new ArrayList<>(list.size()));
//        //DO转VO
//        List<IotCompanyVO> iotCompanyVOList = convertToModelVOs(list,new ArrayList<>(list.size()));
        return MixEnvelop.getSuccessListWithPage(IotRequestMapping.Company.message_success_find_functions,iotCompanyVOList, page, size,count);
        ArrayList<IotCompanyVO> listVO = new ArrayList<>();
        list.forEach(one->{
            IotCompanyVO companyVO = convertToModelVO(one);
            listVO.add(companyVO);
        });
        return MixEnvelop.getSuccessListWithPage(IotRequestMapping.Company.message_success_find_functions,listVO, page, size,count);
    }
    /**
@ -632,7 +641,7 @@ public class IotCompanyService extends BaseJpaService<IotCompanyDO,IotCompanyDao
        companyDO.setEhrUserId(userAgent.getUID());
        iotCompanyDao.save(companyDO);
        return MixEnvelop.getSuccess(IotRequestMapping.Company.message_success_create, convertToModelVO(iotCompany));
        return MixEnvelop.getSuccess("注册成功", convertToModelVO(iotCompany));
    }

+ 22 - 5
svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotDeviceService.java

@ -179,11 +179,11 @@ public class IotDeviceService extends BaseJpaService<IotDeviceDO,IotDeviceDao> {
        deviceDO.setSimNo(sim);
        iotDeviceDao.save(deviceDO);
        //修改SIM卡管理列表
        IotDeviceSimDO simDO = iotDeviceSimDao.findBySim(sim);
        simDO.setDeviceSn(deviceDO.getDeviceSn());
        simDO.setDeviceName(deviceDO.getName());
        simDO.setDel("0");
        iotDeviceSimDao.save(simDO);
//        IotDeviceSimDO simDO = iotDeviceSimDao.findBySim(sim);
//        simDO.setDeviceSn(deviceDO.getDeviceSn());
//        simDO.setDeviceName(deviceDO.getName());
//        simDO.setDel("0");
//        iotDeviceSimDao.save(simDO);
        return Envelop.getSuccess("修改成功");
    }
@ -332,6 +332,23 @@ public class IotDeviceService extends BaseJpaService<IotDeviceDO,IotDeviceDao> {
        return MixEnvelop.getSuccessListWithPage(IotRequestMapping.Common.message_success_find_functions,iotDeviceVOList, page, size,count);
    }
    /**
     *
     * @return
     */
    public MixEnvelop<IotDeviceVO, IotDeviceVO> findDevice(Integer page, Integer size) {
        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);
        long count = list.size();
        return MixEnvelop.getSuccessListWithPage(IotRequestMapping.Common.message_success_find_functions,iotDeviceVOList, page, size,count);
    }
    /**
     * 根据设备序列号判断设备是否存在
     * @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);
        iotSystemDictDao.save(sim);
        //触发JOB工程
        httpClientUtil.get(jobUrl,"UTF-8");
//        httpClientUtil.get(jobUrl,"UTF-8");
    }

+ 9 - 6
svr/svr-iot/src/main/java/com/yihu/iot/service/platform/IotShareInterfaceService.java

@ -184,16 +184,19 @@ public class IotShareInterfaceService extends BaseJpaService<IotShareInterfaceDO
        List<IotCompanyAppDO> list = jdbcTemplate.query(sql.toString(),new BeanPropertyRowMapper(IotCompanyAppDO.class));
        ArrayList<IotCompanyAppVO> resultList = new ArrayList<>();
        list.forEach(one->{
        
        for (IotCompanyAppDO iotCompanyAppDO : list){
            IotCompanyAppVO target = new IotCompanyAppVO();
            BeanUtils.copyProperties(one,target);
            IotCompanyDO companyDO = iotCompanyDao.findById(one.getCompanyId());
            BeanUtils.copyProperties(iotCompanyAppDO,target);
            IotCompanyDO companyDO = iotCompanyDao.findById(iotCompanyAppDO.getCompanyId());
            if(companyDO == null){
                continue;
            }
            target.setContactsMobile(companyDO.getContactsMobile());
            target.setContactsName(companyDO.getContactsName());
            target.setId(one.getId());
            target.setId(iotCompanyAppDO.getId());
            resultList.add(target);
        });
        }
        long count =list.size();