zhanghua
2023-03-29 88b11c72916d5ce1b6bebc060c234af9bbeee300
功能优化
11个文件已修改
99 ■■■■■ 已修改文件
ycl-platform/src/main/java/com/ycl/controller/caseHandler/BaseCaseController.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/controller/cockpit/aiIot/AIIotController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/controller/platformApi/AlarmController.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/mapper/allot/EfficiencyMapper.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/mapper/caseHandler/BaseCaseMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/service/allot/IEfficiencyService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/service/allot/impl/EfficiencyServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/service/caseHandler/IBaseCaseService.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/BaseCaseServiceImpl.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/resources/mapper/allot/EfficiencyMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/resources/mapper/caseHandler/BaseCaseMapper.xml 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/controller/caseHandler/BaseCaseController.java
@@ -144,9 +144,9 @@
        Page<Object> queryList;
        if (type == 1) {
            queryList = baseCaseService.listViolationsPage(current,size, state, resource, code, categoryBig, categorySmall, street, site, startTime, endTime, violationsTypeId);
            queryList = baseCaseService.listViolationsPage(current, size, state, resource, code, categoryBig, categorySmall, street, site, startTime, endTime, violationsTypeId);
        } else if (type == 2) {
            queryList = baseCaseService.listIllegalBuilding(current,size, state, resource);
            queryList = baseCaseService.listIllegalBuilding(current, size, state, resource);
        } else {
            return CommonResult.failed("bad request url");
        }
@@ -383,8 +383,12 @@
    @GetMapping("/video_inspection")
    @ApiOperation("预警研判")
    public CommonResult searchVideoInspection(@RequestParam Integer current) {
        return CommonResult.success(baseCaseService.selectVideoInspection(current));
    public CommonResult searchVideoInspection(@RequestParam Integer current,
                                              @RequestParam(required = false) Long gradeId,
                                              @RequestParam(required = false) Long videoId,
                                              @RequestParam(required = false) String beginTime,
                                              @RequestParam(required = false) String endTime) {
        return CommonResult.success(baseCaseService.selectVideoInspection(current, gradeId, videoId, beginTime, endTime));
    }
    @GetMapping("/video_inspection/Count")
ycl-platform/src/main/java/com/ycl/controller/cockpit/aiIot/AIIotController.java
@@ -132,7 +132,7 @@
    public CommonResult<List<AIIotStatisticsVO>> statistics(@Validated CockpitVO params) {
        checkApiUtil.cockpit(params);
        List<AIIotStatisticsVO> list = iEfficiencyService.aiMonthList();
        List<AIIotStatisticsVO> list = iEfficiencyService.aiMonthList(params.getBeginTime(), params.getEndTime());
        return CommonResult.success(list);
    }
ycl-platform/src/main/java/com/ycl/controller/platformApi/AlarmController.java
@@ -64,9 +64,11 @@
    @GetMapping(value = "/img", produces = {MediaType.IMAGE_JPEG_VALUE, MediaType.IMAGE_PNG_VALUE})
//    @GetMapping(value = "/img")
    @ResponseBody
    public byte[] getImages(HttpServletResponse response, @RequestParam String fileUrl, @RequestParam String OSSAccessKeyId, @RequestParam String Signature) {
    public byte[] getImages(HttpServletResponse response, @RequestParam String fileUrl,
                            @RequestParam(required = false) String OSSAccessKeyId,
                            @RequestParam(required = false) String Signature) {
        try {
            URL url = new URL(fileUrl + "&OSSAccessKeyId=" + OSSAccessKeyId +"&Signature=" + Signature);
            URL url = new URL(fileUrl);
            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
            conn.setRequestMethod("GET");
            conn.setConnectTimeout(10 * 1000);
@@ -78,6 +80,7 @@
            return data;
        } catch (Exception e) {
            System.out.println("获取图片失败:" + e.getMessage());
            e.printStackTrace();
        }
        return null;
ycl-platform/src/main/java/com/ycl/mapper/allot/EfficiencyMapper.java
@@ -4,13 +4,14 @@
import com.ycl.dto.allot.EfficiencyDto;
import com.ycl.vo.cockpit.aiIot.AIIotStatisticsVO;
import com.ycl.vo.cockpit.aiIot.AIIotVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface EfficiencyMapper extends BaseMapper {
    List<EfficiencyDto> list();
    List<AIIotStatisticsVO> aiMonthList();
    List<AIIotStatisticsVO> aiMonthList(@Param("beginTime") String beginTime, @Param("endTime") String endTime);
    Long getSmokeCustomer();
}
ycl-platform/src/main/java/com/ycl/mapper/caseHandler/BaseCaseMapper.java
@@ -38,7 +38,7 @@
    List<QueryForViolationVO> selectViolationPage(@Param(value = "queryForViolationParam") QueryForViolationParam queryForViolationParam);
    Page<BaseCaseVO> selectVideoInspection(Page<Object> objectPage);
    Page<BaseCaseVO> selectVideoInspection(Page<Object> objectPage, @Param("gradeId") Long gradeId, @Param("videoId") Long videoId, @Param("beginTime") String beginTime, @Param("endTime") String endTime);
    Integer dayCount();
ycl-platform/src/main/java/com/ycl/service/allot/IEfficiencyService.java
@@ -10,7 +10,7 @@
    List<EfficiencyDto> list();
    List<AIIotStatisticsVO> aiMonthList();
    List<AIIotStatisticsVO> aiMonthList(String beginTime, String endTime);
    Long getSmokeCustomer();
}
ycl-platform/src/main/java/com/ycl/service/allot/impl/EfficiencyServiceImpl.java
@@ -21,8 +21,8 @@
    }
    @Override
    public List<AIIotStatisticsVO> aiMonthList() {
        return efficiencyMapper.aiMonthList();
    public List<AIIotStatisticsVO> aiMonthList(String beginTime, String endTime) {
        return efficiencyMapper.aiMonthList(beginTime, endTime);
    }
    @Override
ycl-platform/src/main/java/com/ycl/service/caseHandler/IBaseCaseService.java
@@ -39,9 +39,9 @@
     */
    String uploadEvent(Long caseId);
    Page listViolationsPage(Integer size,Integer current, Integer state, Integer resource, String code, String categoryBig, String categorySmall, Integer street, String site, String startTime, String endTime, Integer violationsTypeId);
    Page listViolationsPage(Integer size, Integer current, Integer state, Integer resource, String code, String categoryBig, String categorySmall, Integer street, String site, String startTime, String endTime, Integer violationsTypeId);
    Page listIllegalBuilding(Integer size,Integer current, Integer state, Integer resource);
    Page listIllegalBuilding(Integer size, Integer current, Integer state, Integer resource);
    Boolean saveViolationCase(ViolationParam violationParam, Long id);
@@ -69,7 +69,7 @@
    List<QueryForViolationVO> selectViolationList(QueryForViolationParam queryForViolationParam);
    Page<BaseCaseVO> selectVideoInspection(Integer current);
    Page<BaseCaseVO> selectVideoInspection(Integer current, Long gradeId, Long videoId, String beginTime, String endTime);
    Map<String, Object> selectCount();
ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/BaseCaseServiceImpl.java
@@ -171,7 +171,7 @@
    }
    @Override
    public Page listViolationsPage(Integer size, Integer current, Integer state, Integer resource, String code, String categoryBig, String categorySmall, Integer street, String site, String startTime, String endTime, Integer violationsTypeId) {
    public Page listViolationsPage(Integer current, Integer size, Integer state, Integer resource, String code, String categoryBig, String categorySmall, Integer street, String site, String startTime, String endTime, Integer violationsTypeId) {
        Integer type = 01;
        Integer hours = 60;
        Integer day = 24;
@@ -416,8 +416,8 @@
    }
    @Override
    public Page<BaseCaseVO> selectVideoInspection(Integer current) {
        return baseCaseMapper.selectVideoInspection(new Page<>(current, 1));
    public Page<BaseCaseVO> selectVideoInspection(Integer current, Long gradeId, Long videoId, String beginTime, String endTime) {
        return baseCaseMapper.selectVideoInspection(new Page<>(current, 1), gradeId, videoId, beginTime, endTime);
    }
    @Override
ycl-platform/src/main/resources/mapper/allot/EfficiencyMapper.xml
@@ -41,8 +41,12 @@
        WHERE
            ubc.category = 1
          AND t4.`name` IS NOT NULL
        <if test="beginTime!=null">
            and  ubc.alarm_time BETWEEN #{beginTime} and #{endTime}
        </if>
        GROUP BY
            t4.id,DATE_FORMAT(alarm_time,'%Y-%m')
        ORDER BY DATE_FORMAT(alarm_time,'%Y-%m') desc ,COUNT(1) desc
    </select>
    <select id="getSmokeCustomer" resultType="java.lang.Long">
        select count(1) total from ums_ods_customer
ycl-platform/src/main/resources/mapper/caseHandler/BaseCaseMapper.xml
@@ -256,27 +256,37 @@
    </select>
    <select id="selectVideoInspection" resultType="com.ycl.vo.casePool.BaseCaseVO">
        SELECT t1.id               as baseId,
               t1.`code`,
               t3.`name`,
               t3.url_address,
               t3.longitude,
               t3.latitude,
               t4.pic_data,
               t5.`name`           as grade,
               t3.address,
               t3.plat_resource_id as platResourceId,
               t3.code             as videoCode,
               t1.alarm_time       as alarmTime,
               t1.alarm_time       as currentAlarmTime,
               t4.algo_name        as algoName
        SELECT t1.id as baseId,
        t1.`code`,
        t3.`name`,
        t3.url_address,
        t3.longitude,
        t3.latitude,
        t4.pic_data,
        t5.`name` as grade,
        t3.address,
        t3.plat_resource_id as platResourceId,
        t3.code as videoCode,
        t1.alarm_time as alarmTime,
        t1.alarm_time as currentAlarmTime,
        t4.algo_name as algoName
        FROM ums_base_case t1
                 LEFT JOIN ums_violations t2 ON t1.id = t2.id
                 LEFT JOIN ums_video_point t3 on t2.video_point_id = t3.id
                 LEFT JOIN ums_video_alarm_report t4 on t4.id = t2.video_alarm_report_id
                 LEFT JOIN ums_data_dictionary t5 on t5.id = t2.grade_id
        LEFT JOIN ums_violations t2 ON t1.id = t2.id
        LEFT JOIN ums_video_point t3 on t2.video_point_id = t3.id
        LEFT JOIN ums_video_alarm_report t4 on t4.id = t2.video_alarm_report_id
        LEFT JOIN ums_data_dictionary t5 on t5.id = t2.grade_id
        WHERE t1.state = 1
        <if test="gradeId!=null">
            and t2.grade_id = #{gradeId}
        </if>
        <if test="videoId!=null">
            and t2.video_point_id = #{videoId}
        </if>
        <if test="beginTime!=null and beginTime!=''">
            and t1.alarm_time between #{beginTime} and #{endTime}
        </if>
        group by t1.id
        order by t1.id desc
    </select>
    <select id="selectRegisterCount" resultType="java.lang.Long">
@@ -319,8 +329,9 @@
        t1.alarm_time,
        t1.longitude,
        t1.latitude,
--         ( CASE WHEN t1.category = 1 THEN "违规" WHEN t1.category = 2 THEN "违建" ELSE "其他" END ) AS type,
--         ( CASE WHEN t1.event_source = 1 THEN "视频巡查" WHEN t1.event_source = 2 THEN "网格巡查" ELSE "其他" END ) AS alarmAdvice,
        -- ( CASE WHEN t1.category = 1 THEN "违规" WHEN t1.category = 2 THEN "违建" ELSE "其他" END ) AS type,
        -- ( CASE WHEN t1.event_source = 1 THEN "视频巡查" WHEN t1.event_source = 2 THEN "网格巡查" ELSE "其他" END ) AS
        alarmAdvice,
        dd.name AS type,
        ( CASE WHEN t1.event_source = 1 THEN "视频巡查" WHEN t1.event_source = 2 THEN "网格巡查" ELSE "其他" END ) AS source,
        t1.site AS address,