zhanghua
2023-08-17 c8ace3182393d64990e11b4bc05ce9e53203b393
ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/BaseCaseServiceImpl.java
@@ -132,33 +132,29 @@
    @Override
    public String uploadEvent(Long caseId) {
        BaseCase baseCase = this.getById(caseId);
        baseCase.setState(BaseCaseStatus.WAIT_REPORT);
        this.updateById(baseCase);
        return null;
        // Violations violations = violationsService.getById(caseId);
        // String medias = "";
        // String eventDesc = "";
        // if (violations != null) {
        //     eventDesc = violations.getDescription();
        //     VideoAlarmReport videoAlarmReport = videoAlarmReportService.getById(violations.getVideoAlarmReportId());
        //     if (videoAlarmReport != null) {
        //         StringBuilder stringBuilder = new StringBuilder().append("[{'mediaURL':'").append(fileUrl).append(videoAlarmReport.getPicData()).append("'}]");
        //         medias = stringBuilder.toString();
        //     }
        // }
        // EventAddParamDto dto = EventAddParamDto.builder().y84(baseCase.getLatitude() != null ? baseCase.getLatitude().toString() : "").x84(baseCase.getLongitude() != null ? baseCase.getLongitude().toString() : "").source(11).address(baseCase.getSite()).eventDesc(eventDesc).eventSign(baseCase.getCode()).medias(medias).build();
        // String msg = cityPlatformService.addEvent(dto);
        // ResultResponseDto result = JSONObject.parseObject(msg, ResultResponseDto.class);
        // if (result.getCode() == 0) {
        //     EventAddResponseDto responseDto = JSONObject.parseObject(result.getResult(), EventAddResponseDto.class);
        //     baseCase.setTaskCode(responseDto.getTaskcode());
        //     this.updateById(baseCase);
        //     return null;
        // } else {
        //     return result.getMsg();
        // }
        Violations violations = violationsService.getById(caseId);
        String medias = "";
        String eventDesc = "";
        if (violations != null) {
            eventDesc = violations.getDescription();
            VideoAlarmReport videoAlarmReport = videoAlarmReportService.getById(violations.getVideoAlarmReportId());
            if (videoAlarmReport != null) {
                StringBuilder stringBuilder = new StringBuilder().append("[{'mediaURL':'").append(fileUrl).append(videoAlarmReport.getPicData()).append("'}]");
                medias = stringBuilder.toString();
            }
        }
        eventDesc += "[大华视频接入测试]";
        EventAddParamDto dto = EventAddParamDto.builder().y84(baseCase.getLatitude() != null ? baseCase.getLatitude().toString() : "").x84(baseCase.getLongitude() != null ? baseCase.getLongitude().toString() : "").source(11).address(baseCase.getSite()).eventDesc(eventDesc).eventSign(baseCase.getCode()).medias(medias).build();
        String msg = cityPlatformService.addEvent(dto);
        ResultResponseDto result = JSONObject.parseObject(msg, ResultResponseDto.class);
        if (result.getCode() == 0) {
//            EventAddResponseDto responseDto = JSONObject.parseObject(result.getResult(), EventAddResponseDto.class);
            baseCase.setTaskCode(result.getResult());
            this.updateById(baseCase);
            return null;
        } else {
            return result.getMsg();
        }
    }
    @Override