zhanghua
2023-11-30 fe75330b083aef4694a3c066e77ab08005130232
报警信息优化
4个文件已修改
40 ■■■■ 已修改文件
ycl-platform/src/main/java/com/ycl/controller/platformApi/TranspondDHController.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/ViolationsServiceImpl.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/resources/application-dev.yml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/resources/application-prod.yml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/controller/platformApi/TranspondDHController.java
@@ -28,7 +28,7 @@
@RequestMapping("/API/videoService/eventCenter/messages")
public class TranspondDHController {
    @Value("${videoPoint.url}")
    @Value("${videoPoint.web_url}")
    private String url;
    @Value("${videoPoint.userName}")
@@ -54,21 +54,22 @@
                                  @RequestParam(required = false) Integer msgNum,
                                  @RequestParam(required = false) Integer waitSec) {
        String url = "/videoService/eventCenter/messages/subscribe";
        String param = "?type=" + type + "&msgId=" + msgId + "&msgNum=" + msgNum + "&waitSec=" + waitSec;
        String param = "?type=" + type + "&msgId=" + msgId + "&waitSec=" + waitSec + "&msgNum=" + msgNum;
        return getResult(url, param);
    }
    private CommonResult<?> getResult(String url, String param) {
    private CommonResult<?> getResult(String reqUrl, String param) {
        try {
            String token = getToken();
            System.out.println("定位接口url:" + url + reqUrl + param);
            HttpHeaders deviceHeaders = new HttpHeaders();
            ObjectMapper objectMapper = new ObjectMapper();
            deviceHeaders.add("X-Subject-Token", token);
            HttpEntity<Object> deviceEntity = new HttpEntity<>(deviceHeaders);
            RestTemplate restTemplate = new RestTemplate();
            ResponseEntity<String> exchange = restTemplate.exchange(url + param, HttpMethod.GET, deviceEntity, String.class);
            ResponseEntity<String> exchange = restTemplate.exchange(url + reqUrl + param, HttpMethod.GET, deviceEntity, String.class);
            System.out.println(exchange);
            return CommonResult.success(exchange);
        } catch (Exception ex) {
ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/ViolationsServiceImpl.java
@@ -21,6 +21,7 @@
import com.ycl.service.dict.IDataDictionaryService;
import com.ycl.service.region.ISccgRegionService;
import com.ycl.service.resources.IImageResourcesService;
import com.ycl.service.video.IVideoAlarmReportService;
import com.ycl.service.video.impl.IVideoPointService;
import com.ycl.vo.cockpit.enforcementEvents.VideoAndAreaVO;
import org.springframework.beans.factory.annotation.Autowired;
@@ -49,6 +50,7 @@
    private IDataDictionaryService dataDictionaryService;
    private IImageResourcesService imageResourcesService;
    private ISccgRegionService regionService;
    private IVideoAlarmReportService videoAlarmReportService;
    @Resource
    BaseCaseMapper baseCaseMapper;
@@ -78,6 +80,11 @@
    @Autowired
    public void setRegionService(ISccgRegionService regionService) {
        this.regionService = regionService;
    }
    @Autowired
    public void setVideoAlarmReportService(IVideoAlarmReportService videoAlarmReportService) {
        this.videoAlarmReportService = videoAlarmReportService;
    }
    @Override
@@ -133,10 +140,11 @@
        List<DataDictionary> dataDictionaries = dataDictionaryService.queryByRemark(alarmParam.getSubject());
        Instant instant = Instant.ofEpochMilli(Long.parseLong(alarmParam.getIncidentDate()));
        LocalDateTime alarmTime = LocalDateTime.ofInstant(instant, ZoneId.systemDefault());
        BaseCase baseCase = BaseCase.builder().eventSource(1).category(QuestionCategory.VIOLATION.getCode())
                .code(utilNumber.createCaseCode()).createTime(LocalDateTime.now()).createUser(0L).state(1).
                alarmTime(LocalDateTime.ofInstant(instant, ZoneId.systemDefault())).build();
                alarmTime(alarmTime).build();
        Violations violations = new Violations();
        baseCase.setLatitude(alarmParam.getLatitude());
@@ -159,8 +167,22 @@
        if (videoPoint != null) {
            violations.setVideoPointId(videoPoint.getId());
        }
        baseMapper.insert(violations);
        String[] imgs = alarmParam.getFileUrl().split(",");
        VideoAlarmReport videoAlarmReport = new VideoAlarmReport();
        videoAlarmReport.setPlatResourceId(alarmParam.getEventNumber());
        if (imgs.length > 0) {
            videoAlarmReport.setPicData(imgs[0]);
        }
        videoAlarmReport.setAlarmTime(alarmTime);
        videoAlarmReport.setAlarmId(alarmParam.getEventId());
        videoAlarmReport.setAlgoName(alarmParam.getContact());
        videoAlarmReport.setAlarmName(alarmParam.getSubject());
        videoAlarmReportService.save(videoAlarmReport);
        violations.setVideoAlarmReportId(videoAlarmReport.getId());
        baseMapper.insert(violations);
        try {
            for (int i = 0; i < imgs.length; i++) {
@@ -175,6 +197,7 @@
        } catch (Exception ex) {
        }
    }
    @Override
ycl-platform/src/main/resources/application-dev.yml
@@ -68,6 +68,7 @@
videoPoint:
  url: http://183.245.159.161:8281
  web_url: http://172.28.194.185:8281
  port: 8281
  userName: suichang
  passWord: a12345677
ycl-platform/src/main/resources/application-prod.yml
@@ -67,6 +67,7 @@
videoPoint:
  url: http://172.28.194.180:7901
  web_url: http://172.28.194.185:8281
  port: 7901
  userName: suichang
  passWord: a12345677