Merge remote-tracking branch 'origin/master'

This commit is contained in:
yitonglei 2022-05-20 15:09:33 +08:00
commit 1aba80b199
4 changed files with 64 additions and 10 deletions

View File

@ -1,6 +1,5 @@
package com.hisense.monitormanage.controller;
import com.alibaba.fastjson.JSONObject;
import com.hisense.monitormanage.dto.*;
import com.hisense.monitormanage.entity.*;
import com.hisense.monitormanage.mapper.*;
@ -134,7 +133,7 @@ public class Controller {
* @return
*/
@GetMapping("selectByChannelCode")
@ApiOperation("根据channelCode查询摄像头详细信息")
@ApiOperation("根据摄像头编号查询摄像头详细信息")
@ApiImplicitParam(name = "channelCode",value = "摄像头标识",required = true,dataType = "String")
public Result selectByChannelCode(String channelCode){
@ -170,7 +169,7 @@ public class Controller {
* @return
*/
@GetMapping("selectByParentId")
@ApiOperation("根据parentId和checkStatus查询摄像头")
@ApiOperation("根据摄像头的组织Id和异常状态查询摄像头")
@ApiImplicitParams({
@ApiImplicitParam(name = "parentId",value = "摄像头的组织Id",required = true,dataType = "String"),
@ApiImplicitParam(name = "checkStatus",value = "异常状态 1正常,0异常",required = true,dataType = "String")
@ -231,14 +230,13 @@ public class Controller {
/**
* 查询所有标签
* @param label
* @return
*/
@GetMapping("selectAllLabel")
@ApiOperation("查询所有标签")
public Result selectAllLabel(Label label ){
public Result selectAllLabel(){
List<Label> labels = cameraChannelMapper.selectAllLabel(label);
List<Label> labels = cameraChannelMapper.selectAllLabel();
Result success = Result.success(labels);
@ -250,6 +248,8 @@ public class Controller {
* @return
*/
@GetMapping("selectByLabelName")
@ApiOperation("根据标签名字模糊查询标签")
@ApiImplicitParam(name = "labelName",value = "标签名称",required = true,dataType = "String")
public Result selectByLabelName(String labelName){
List<Label> labels = cameraChannelMapper.selectByLabelName(labelName);
@ -265,7 +265,7 @@ public class Controller {
* @return
*/
@GetMapping("selectSubOrgan")
@ApiOperation("根据parentId查询组织")
@ApiOperation("根据上级组织id查询组织")
@ApiImplicitParam(name = "parentId",value = "上级组织id",required = true,dataType = "String")
public Result selectSubOrganization(String parentId){
if (parentId == null){

View File

@ -4,9 +4,9 @@ import com.alibaba.fastjson.JSONObject;
import com.hisense.monitormanage.entity.Event;
import com.hisense.monitormanage.entity.Result;
import com.hisense.monitormanage.mapper.EventMapper;
import com.hisense.monitormanage.mapper.SedimentTrailMapper;
import com.hisense.monitormanage.service.EventService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.RestController;
import javax.servlet.ServletInputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
@ -141,6 +142,7 @@ public class EventController {
@GetMapping("selectEvent")
@ApiOperation("查询所有事件")
public Result selectEvent(){
List<Event> events = eventMapper.selectEvent();
Result success = Result.success(events);
@ -170,6 +172,7 @@ public class EventController {
*/
@GetMapping("selectByName")
@ApiOperation("根据事件名称查询事件")
@ApiImplicitParam(name = "eventCnName",value = "事件名称",required = true,dataType = "String")
public Result selectByName(String eventCnName){
List<Event> byName = eventMapper.selectByName(eventCnName);

View File

@ -0,0 +1,52 @@
package com.hisense.monitormanage.controller;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;
@Controller
public class FordController {
@GetMapping("components/**")
public void ford(HttpServletRequest request, HttpServletResponse response)throws Exception{
String imageDomain = "http://10.132.191.48:30080";
String uri = request.getRequestURI();
String fordUrl = imageDomain + uri;
URLConnection con = null;
try {
URL url = new URL(fordUrl);
con = url.openConnection();
//允许写出
con.setDoOutput(true);
//允许读入
con.setDoInput(true);
//不使用缓存
con.setUseCaches(false);
//得到响应流
InputStream inputStream = con.getInputStream();
ServletOutputStream outputStream = response.getOutputStream();
byte[] buffer = new byte[1024];
int len = inputStream.read(buffer);
while (len != -1) {
outputStream.write(buffer, 0, len);
len = inputStream.read(buffer);
}
inputStream.close();
}catch(Exception e) {
e.printStackTrace();
}
}
}

View File

@ -10,7 +10,6 @@ import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;
public interface CameraChannelMapper extends BaseMapper<CameraChannel> {
@ -32,7 +31,7 @@ public interface CameraChannelMapper extends BaseMapper<CameraChannel> {
void updateState(@Param("list") List list);
@Select("select * from t_label")
List<Label> selectAllLabel(Label label);
List<Label> selectAllLabel();
@Select("select * from t_label where label_name like concat('%',#{labelName},'%')")
List<Label> selectByLabelName(String labelName);