Merge branch 'master' into docker_package
This commit is contained in:
commit
ef5bb41a0f
|
@ -11,7 +11,6 @@ import io.swagger.annotations.Api;
|
|||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
|
|
@ -704,4 +704,9 @@ public class Controller {
|
|||
}
|
||||
/******************************2022/07/13 ytl修改视频资源 end********************************************/
|
||||
|
||||
@GetMapping("/checkCameraIfExists")
|
||||
public Result checkCameraIfExists(@RequestParam List<String> list){
|
||||
Result result = cameraChannelService.checkCameraIfExists(list);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -75,4 +75,6 @@ public interface CameraChannelMapper extends BaseDao<CameraChannel> {
|
|||
|
||||
@Delete("delete from t_camera_channel where gps_x is null or gps_y is null or gps_x = '' or gps_y = '' ")
|
||||
void deleteByNonPlace();
|
||||
|
||||
Map selectCameraChannelById(@Param("channelId") String channelId);
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package io.renren.modules.monitor.service;
|
|||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.renren.modules.monitor.dto.CameraChannelDto;
|
||||
import io.renren.modules.monitor.entity.Result;
|
||||
import io.renren.modules.monitor.mapper.CameraChannelMapper;
|
||||
import io.renren.modules.monitor.utils.EhcacheUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -9,7 +10,7 @@ import org.springframework.cache.ehcache.EhCacheCacheManager;
|
|||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
|
@ -38,4 +39,25 @@ public class CameraChannelService {
|
|||
return list;
|
||||
}
|
||||
|
||||
//根据输入的channel_id的列表查询到系统中存在的cameraChannel信息
|
||||
public Result checkCameraIfExists(List<String> channelList){
|
||||
List<Map> exists = new ArrayList<>();
|
||||
|
||||
Iterator<String> iterator = channelList.iterator();
|
||||
while(iterator.hasNext()){
|
||||
String s = iterator.next();
|
||||
Map map = cameraChannelMapper.selectCameraChannelById(s);
|
||||
if(map != null && !map.isEmpty()){
|
||||
exists.add(map);
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
|
||||
Map<String,Object> result = new HashMap<>();
|
||||
result.put("exists",exists);
|
||||
result.put("nonExists",channelList);
|
||||
|
||||
return Result.success(result);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@ import io.renren.modules.resource.videoPreview.VideoPreviewFactory;
|
|||
import io.renren.modules.sys.dto.SysDeptDTO;
|
||||
import io.renren.modules.sys.service.SysDeptService;
|
||||
import io.swagger.annotations.*;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -129,7 +130,11 @@ public class ResourceController {
|
|||
})
|
||||
public Result<PageData<ResourceDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params) {
|
||||
PageData<ResourceDTO> page = resourceService.page(params);
|
||||
page.getList().forEach(item -> item.setInfoList(resourceService.selectAttrsByResourceId(item.getId())));
|
||||
page.getList().forEach(item -> {
|
||||
item.setInfoList(resourceService.selectAttrsByResourceId(item.getId()));
|
||||
String deptName = sysDeptService.get(item.getDeptId()).getName();
|
||||
item.setDeptName(StringUtils.isNotBlank(deptName) ? deptName : "--");
|
||||
});
|
||||
return new Result<PageData<ResourceDTO>>().ok(page);
|
||||
}
|
||||
|
||||
|
|
|
@ -237,4 +237,9 @@
|
|||
(#{item.channel_code},#{item.label_code})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="selectCameraChannelById" parameterType="java.lang.String" resultType="java.util.Map">
|
||||
SELECT channel_id AS channelId,channel_name AS channelName FROM t_camera_channel
|
||||
WHERE channel_id = #{channelId} LIMIT 1
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in New Issue