zhanghua
2022-11-01 61f871eb172a3444b999c872dd3a9525f51fbfc4
Merge branch 'master' of http://42.193.1.25:9521/r/sccg_server
6个文件已修改
70 ■■■■■ 已修改文件
ycl-platform/src/main/java/com/ycl/controller/cockpit/aiIot/AIIotController.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/controller/cockpit/enforcementEvents/EnforcementEventsController.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/controller/cockpit/statisticsEvents/StatisticsEventsController.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/util/CheckApiUtil.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/vo/cockpit/enforcementEvents/EnforcementEventsVO.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/vo/cockpit/statisticsEvents/StatisticsEventsVO.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/controller/cockpit/aiIot/AIIotController.java
@@ -5,10 +5,12 @@
import com.ycl.vo.cockpit.CockpitVO;
import com.ycl.vo.cockpit.aiIot.AIIotVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
@@ -33,7 +35,7 @@
    @ApiOperation(value = "监测数据")
    @GetMapping("/detection")
    public CommonResult<AIIotVO.DetectionVO> detection(@Validated CockpitVO.Params1VO params) {
        checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), null, null);
        checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), null, null,null);
        AIIotVO.DetectionVO detectionVO = new AIIotVO.DetectionVO();
        detectionVO.setVideo(121);
        detectionVO.setIndividual(20);
@@ -45,8 +47,9 @@
    @ApiOperation(value = "实时视频监控")
    @GetMapping("/video")
    public CommonResult<List<AIIotVO.VideoVO>> video(@Validated CockpitVO.Params1VO params) {
        checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), null, null);
    @ApiImplicitParam(name = "regionId",value = "地区Id",required = true,dataType = "String")
    public CommonResult<List<AIIotVO.VideoVO>> video(@Validated CockpitVO.Params1VO params, @RequestParam(required = true)String regionId) {
        checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), null, null,regionId);
        List<AIIotVO.VideoVO> videoVOS = new ArrayList<>();
        AIIotVO.VideoVO a = null;
        for (int i = 0; i < 4; i++) {
@@ -67,7 +70,7 @@
    @ApiOperation(value = "AI算法效能")
    @GetMapping("/efficiency")
    public CommonResult<List<AIIotVO.EfficiencyVO>> efficiency(@Validated CockpitVO.Params2VO params) {
        checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), params.getBeginTime(), params.getEndTime());
        checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), params.getBeginTime(), params.getEndTime(),null);
        List<AIIotVO.EfficiencyVO> efficiencyVOS = new ArrayList<>();
        AIIotVO.EfficiencyVO a = null;
        for (int i = 0; i < 4; i++) {
@@ -83,7 +86,7 @@
    @ApiOperation(value = "渣土联动")
    @GetMapping("/slag_car")
    public CommonResult<AIIotVO.SlagCarVO> slagCar(@Validated CockpitVO.Params1VO params) {
        checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), null, null);
        checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), null, null,null);
        AIIotVO.SlagCarVO slagCarVO = new AIIotVO.SlagCarVO();
        slagCarVO.setCar(236);
        slagCarVO.setTeam(20);
@@ -93,7 +96,7 @@
    @ApiOperation(value = "AI事件统计")
    @GetMapping("/event_statistics")
    public CommonResult<List<AIIotVO.StatisticsVO>> statistics(@Validated CockpitVO.Params2VO params) {
        checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), params.getBeginTime(), params.getEndTime());
        checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), params.getBeginTime(), params.getEndTime(),null);
        List<AIIotVO.StatisticsVO> statisticsVOS = new ArrayList<>();
        List<AIIotVO.Statistics1VO> statistics1VOS = new ArrayList<>();
        AIIotVO.StatisticsVO a = null;
ycl-platform/src/main/java/com/ycl/controller/cockpit/enforcementEvents/EnforcementEventsController.java
@@ -34,7 +34,7 @@
    @ApiOperation(value = "执法事件统计")
    @GetMapping("/statistics")
    public CommonResult<Map<String, Object>> statistics(@Validated CockpitVO.Params2VO params) {
        checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), params.getBeginTime(), params.getEndTime());
        checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), params.getBeginTime(), params.getEndTime(),null);
        Map<String, Object> map = new HashMap<>();
        EnforcementEventsVO.StatisticsEventVO eventVO = new EnforcementEventsVO.StatisticsEventVO();
        eventVO.setCount(10);
@@ -49,7 +49,7 @@
    @ApiOperation(value = "事件类型")
    @GetMapping("/type")
    public CommonResult<EnforcementEventsVO.TypeAndSourceVO> type(@Validated CockpitVO.Params2VO params) {
        checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), params.getBeginTime(), params.getEndTime());
        checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), params.getBeginTime(), params.getEndTime(),null);
        List<EnforcementEventsVO.TypeAndSourceVO1> typeVO1s = new ArrayList<>();
        EnforcementEventsVO.TypeAndSourceVO typeVO = new EnforcementEventsVO.TypeAndSourceVO();
        EnforcementEventsVO.TypeAndSourceVO1 typeVO1 = null;
@@ -68,13 +68,14 @@
    @ApiOperation(value = "视频抓拍告发点位")
    @GetMapping("/video")
    public CommonResult<List<EnforcementEventsVO.VideoAndAreaVO>> video(@Validated CockpitVO.Params2VO params) {
        checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), params.getBeginTime(), params.getEndTime());
        checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), params.getBeginTime(), params.getEndTime(),null);
        List<EnforcementEventsVO.VideoAndAreaVO> videoVOS = new ArrayList<>();
        EnforcementEventsVO.VideoAndAreaVO videoVO = null;
        for (int i = 0; i < 4; i++) {
            videoVO = new EnforcementEventsVO.VideoAndAreaVO();
            videoVO.setName("团结屯");
            videoVO.setCount(10);
            videoVO.setRatio(new BigDecimal("0.65").setScale(2, RoundingMode.HALF_UP));
            videoVOS.add(videoVO);
        }
        return CommonResult.success(videoVOS);
@@ -83,7 +84,7 @@
    @ApiOperation(value = "事件来源")
    @GetMapping("/source")
    public CommonResult<EnforcementEventsVO.TypeAndSourceVO> source(@Validated CockpitVO.Params2VO params) {
        checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), params.getBeginTime(), params.getEndTime());
        checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), params.getBeginTime(), params.getEndTime(),null);
        List<EnforcementEventsVO.TypeAndSourceVO1> typeVO1s = new ArrayList<>();
        EnforcementEventsVO.TypeAndSourceVO typeVO = new EnforcementEventsVO.TypeAndSourceVO();
        EnforcementEventsVO.TypeAndSourceVO1 typeVO1 = null;
@@ -102,7 +103,7 @@
    @ApiOperation(value = "事件区域统计")
    @GetMapping("/area")
    public CommonResult<List<EnforcementEventsVO.VideoAndAreaVO>> area(@Validated CockpitVO.Params2VO params) {
        checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), params.getBeginTime(), params.getEndTime());
        checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), params.getBeginTime(), params.getEndTime(),null);
        List<EnforcementEventsVO.VideoAndAreaVO> videoVOS = new ArrayList<>();
        EnforcementEventsVO.VideoAndAreaVO videoVO = null;
        for (int i = 0; i < 4; i++) {
@@ -117,7 +118,7 @@
    @ApiOperation(value = "延误事件")
    @GetMapping("/delay")
    public CommonResult<List<EnforcementEventsVO.DelayVO>> delay(@Validated CockpitVO.Params2VO params) {
        checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), params.getBeginTime(), params.getEndTime());
        checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), params.getBeginTime(), params.getEndTime(),null);
        List<EnforcementEventsVO.DelayVO> delayVOS = new ArrayList<>();
        EnforcementEventsVO.DelayVO delayVO = null;
        for (int i = 0; i < 4; i++) {
@@ -133,7 +134,7 @@
    @ApiOperation(value = "事件信息")
    @GetMapping("/info")
    public CommonResult<EnforcementEventsVO.InfoVO> info(@Validated CockpitVO.Params2VO params) {
        checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), params.getBeginTime(), params.getEndTime());
        checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), params.getBeginTime(), params.getEndTime(),null);
        EnforcementEventsVO.InfoVO infoVO = new EnforcementEventsVO.InfoVO();
        EnforcementEventsVO.EventVO eventVO = new EnforcementEventsVO.EventVO();
        infoVO.setToday(5);
ycl-platform/src/main/java/com/ycl/controller/cockpit/statisticsEvents/StatisticsEventsController.java
@@ -5,10 +5,12 @@
import com.ycl.vo.cockpit.CockpitVO;
import com.ycl.vo.cockpit.statisticsEvents.StatisticsEventsVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
@@ -31,8 +33,9 @@
    @ApiOperation(value = "执法事件")
    @GetMapping("/law_enforcement_event")
    public CommonResult<List<StatisticsEventsVO.LawEnforcementEventVO>> detection(@Validated CockpitVO.Params2VO params) {
        checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), params.getBeginTime(), params.getEndTime());
    @ApiImplicitParam(name = "regionId",value = "地区Id",required = true,dataType = "String")
    public CommonResult<List<StatisticsEventsVO.LawEnforcementEventVO>> detection(@Validated CockpitVO.Params2VO params, @RequestParam(required = true)String regionId) {
        checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), params.getBeginTime(), params.getEndTime(),regionId);
        List<StatisticsEventsVO.LawEnforcementEventVO> lawEnforcementEventVOS = new ArrayList<>();
        StatisticsEventsVO.LawEnforcementEventVO a = null;
        for (int i = 0; i < 4; i++) {
@@ -48,8 +51,9 @@
    @ApiOperation(value = "物联感知")
    @GetMapping("/lot")
    public CommonResult<List<StatisticsEventsVO.LotVO>> lot(@Validated CockpitVO.Params1VO params) {
        checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), null, null);
    @ApiImplicitParam(name = "regionId",value = "地区Id",required = true,dataType = "String")
    public CommonResult<List<StatisticsEventsVO.LotVO>> lot(@Validated CockpitVO.Params1VO params,@RequestParam(required = true)String regionId) {
        checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), null, null,regionId);
        List<StatisticsEventsVO.LotVO> lotVOS = new ArrayList<>();
        StatisticsEventsVO.LotVO a = null;
        for (int i = 0; i < 4; i++) {
@@ -57,6 +61,7 @@
            a.setName("团结屯");
            a.setType("摄像头");
            a.setCount(10);
            a.setRatio(new BigDecimal("-0.3").setScale(2, RoundingMode.HALF_UP));
            lotVOS.add(a);
        }
        return CommonResult.success(lotVOS);
@@ -65,7 +70,7 @@
    @ApiOperation(value = "执法队伍")
    @GetMapping("/team")
    public CommonResult<StatisticsEventsVO.TeamVO> team(@Validated CockpitVO.Params1VO params) {
        checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), null, null);
        checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), null, null,null);
        StatisticsEventsVO.TeamVO teamVO = new StatisticsEventsVO.TeamVO();
        teamVO.setAll(30);
        teamVO.setAssistant(10);
@@ -79,7 +84,7 @@
    @ApiOperation(value = "网格员")
    @GetMapping("/grid_member")
    public CommonResult<List<StatisticsEventsVO.GridMemberVO>> gridMember(@Validated CockpitVO.Params1VO params) {
        checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), null, null);
        checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), null, null,null);
        List<StatisticsEventsVO.GridMemberVO> gridMemberVOS = new ArrayList<>();
        StatisticsEventsVO.GridMemberVO a = null;
        for (int i = 0; i < 4; i++) {
@@ -95,7 +100,7 @@
    @ApiOperation(value = "指数体征")
    @GetMapping("/index_signs")
    public CommonResult<StatisticsEventsVO.IndexSignsVO> indexSigns(@Validated CockpitVO.Params1VO params) {
        checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), null, null);
        checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), null, null,null);
        StatisticsEventsVO.IndexSignsVO indexSignsVO = new StatisticsEventsVO.IndexSignsVO();
        indexSignsVO.setEvent(1);
        indexSignsVO.setGridMember(20);
ycl-platform/src/main/java/com/ycl/util/CheckApiUtil.java
@@ -23,14 +23,14 @@
    /**
     * 驾驶舱
     *
     * @param appId
     * @param appKey
     * @param sign
     * @param name
     * @param beginTime
     * @param endTime
     * @param appId     appId
     * @param appKey    appKey
     * @param sign      sign
     * @param beginTime 开始时间
     * @param endTime   结束时间
     * @param regionId  区域Id
     */
    public void cockpit(String appId, String appKey, String sign, String beginTime, String endTime) {
    public void cockpit(String appId, String appKey, String sign, String beginTime, String endTime, String regionId) {
        apiKeyService.checkIsExist(appId, appKey, "驾驶仓");
        StringBuffer sb = new StringBuffer();
        sb.append(appId);
@@ -40,6 +40,9 @@
            sb.append(beginTime);
            sb.append(endTime);
        }
        if (!StringUtils.isBlank(regionId)) {
            sb.append(regionId);
        }
        result = MD5Util.md5Encrypt32Lower(sb.toString());
        if (!sign.equals(result)) {
            throw new ApiException(ResultCode.SIGN_ERROR);
ycl-platform/src/main/java/com/ycl/vo/cockpit/enforcementEvents/EnforcementEventsVO.java
@@ -53,6 +53,8 @@
        private String name;
        @ApiModelProperty(value = "次数")
        private Integer count;
        @ApiModelProperty(value = "数据占比")
        private BigDecimal ratio;
    }
    @Data
ycl-platform/src/main/java/com/ycl/vo/cockpit/statisticsEvents/StatisticsEventsVO.java
@@ -36,6 +36,8 @@
        private String name;
        @ApiModelProperty(value = "数量")
        private Integer count;
        @ApiModelProperty(value = "比例")
        private BigDecimal ratio;
    }
    @ApiModel(description = "执法队伍")