screen-manage/src/main/java/com/moral/api/service/impl/DeviceServiceImpl.java
@@ -83,6 +83,7 @@
        deviceMapper.insert(device);
        Map<String, Object> deviceInfo = selectDeviceInfoById(device.getId());
        //新增设备信息存入redis
        RedisUtil.del("device_" + device.getMac());
        RedisUtil.set("device_" + device.getMac(), deviceInfo);
        //操作日志记录
        HttpServletRequest request = ((ServletRequestAttributes) Objects.requireNonNull(RequestContextHolder.getRequestAttributes())).getRequest();
@@ -177,17 +178,13 @@
    }
    @Override
    public List<Map<String, Object>> selectDevicesByOrgId(Integer orgId) {
        QueryWrapper<Device> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("is_delete", Constants.NOT_DELETE).eq("organization_id", orgId);
        return deviceMapper.selectMaps(queryWrapper);
    public Map<String, Object> selectDevicesByOrgId(Map<String, Object> parameters) {
        return selectDevices(parameters);
    }
    @Override
    public List<Map<String, Object>> selectDevicesByMpId(Integer mpId) {
        QueryWrapper<Device> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("is_delete", Constants.NOT_DELETE).eq("monitor_point_id", mpId);
        return deviceMapper.selectMaps(queryWrapper);
    public Map<String, Object> selectDevicesByMpId(Map<String, Object> parameters) {
        return selectDevices(parameters);
    }
    @Override
@@ -199,12 +196,26 @@
        Object orderType = parameters.get("orderType");
        Object name = parameters.get("name");
        Object mac = parameters.get("mac");
        Object orgId = parameters.get("organizationId");
        Object mpId = parameters.get("monitorPointId");
        //查询某组织下所有设备
        if (orgId != null) {
            queryWrapper.eq("organization_id", orgId);
        }
        //查询某站点下所有设备
        if (mpId != null) {
            queryWrapper.eq("monitor_point_id", mpId);
        }
        if (name != null) {
            queryWrapper.like("name", name);
        }
        if (mac != null) {
            queryWrapper.like("mac", mac);
        }
        //排序参数,默认create_time降序
        if (order != null && orderType != null) {
@@ -255,6 +266,9 @@
        deviceInfo.put("createTime", DateUtils.dateToDateString(device.getCreateTime()));
        deviceInfo.put("installTime", device.getInstallTime() == null ? null : DateUtils.dateToDateString(device.getInstallTime()));
        //扩展字段
        deviceInfo.put("extend", device.getExtend());
        //行业
        deviceInfo.put("profession", device.getProfession());
        deviceInfo.put("professionName", device.getProfessionName());
@@ -302,6 +316,7 @@
        mpInfo.put("id", monitorPoint.getId());
        mpInfo.put("name", monitorPoint.getName());
        deviceInfo.put("monitorPoint", mpInfo);
        RedisUtil.set("device_" + mac, deviceInfo);
        return deviceInfo;
    }