zhanghua
2023-04-14 e8a0f05f99f33fa05085536541da6bc27e66a644
ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/BaseCaseServiceImpl.java
@@ -5,6 +5,7 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ycl.bo.AdminUserDetails;
@@ -170,11 +171,12 @@
    }
    @Override
    public Page listViolationsPage(Page page, Integer state, Integer resource, String code, String categoryBig, String categorySmall, Integer street, String site, String startTime, String endTime) {
    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 videoId) {
        Integer type = 01;
        Integer hours = 60;
        Integer day = 24;
        Page<CasePoolViolationVO> violationsPage = baseCaseMapper.listViolationsPage(page, state, type, resource, code, categoryBig, categorySmall, street, site, startTime, endTime);
        Page page = new Page<>().setCurrent(current).setSize(size);
        Page<CasePoolViolationVO> violationsPage = baseCaseMapper.listViolationsPage(page, state, type, resource, code, categoryBig, categorySmall, street, site, startTime, endTime, violationsTypeId, videoId);
        violationsPage.getRecords().stream().forEach(item -> {
            if (item.getCloseTime() == null) {
                Duration duration = Duration.between(item.getAlarmTime(), LocalDateTime.now());
@@ -194,8 +196,9 @@
    }
    @Override
    public Page listIllegalBuilding(Page page, Integer state, Integer resource) {
    public Page listIllegalBuilding(Integer size, Integer current, Integer state, Integer resource) {
        Integer type = 02;
        Page page = new Page<>().setCurrent(current).setSize(size);
        return baseCaseMapper.listIllegalBuildingsPage(page, state, type, resource);
    }
@@ -206,7 +209,7 @@
        Integer value = 1;
        violations.setId(id);
        setDisposeRecord(id, violationParam.getLimitTime());
        return violationsMapper.insert(violations) == value ? true : false;
        return violationsMapper.insert(violations) == value;
    }
    private void setDisposeRecord(Long id, String limitTime) {
@@ -413,8 +416,8 @@
    }
    @Override
    public Page<BaseCaseVO> selectVideoInspection(Integer current) {
        return baseCaseMapper.selectVideoInspection(new Page<>(current, 1));
    public Page<BaseCaseVO> selectVideoInspection(Integer current,Integer pageSize, Long gradeId, Long videoId, String beginTime, String endTime) {
        return baseCaseMapper.selectVideoInspection(new Page<>(current, pageSize), gradeId, videoId, beginTime, endTime);
    }
    @Override
@@ -476,15 +479,22 @@
    }
    @Override
    public List<EventVO> selectEventList(String beginTime, String endTime) {
        return baseCaseMapper.selectEventList(beginTime, endTime);
    public IPage<EventVO> selectEventList(String beginTime, String endTime, Integer pageIndex, Integer pageSize) {
        if (pageIndex == null) {
            pageIndex = 1;
        }
        if (pageSize == null) {
            pageSize = 50;
        }
        IPage<EventVO> page = new Page<>(pageIndex, pageSize);
        return baseCaseMapper.selectEventList(page, beginTime, endTime);
    }
    @Override
    public List<VideoAndAreaVO> areaCount() {
        List<VideoAndAreaVO> areaCountList = baseCaseMapper.areaCount();
        Long allCount = baseCaseMapper.selectCount(new LambdaQueryWrapper<>());
        areaCountList.stream().forEach(item -> item.setRatio(new BigDecimal(item.getCount() * 1.0 / allCount).setScale(2, BigDecimal.ROUND_HALF_UP)));
        areaCountList.stream().forEach(item -> item.setRatio(new BigDecimal(item.getCount() * 1.0 / allCount).setScale(4, BigDecimal.ROUND_HALF_UP)));
        return areaCountList;
    }
@@ -524,7 +534,7 @@
        if (reportLastMonthCount == 0) {
            report.setRatio(null);
        } else {
            report.setRatio(new BigDecimal(v).setScale(2, BigDecimal.ROUND_HALF_UP).abs());
            report.setRatio(new BigDecimal(v).setScale(4, BigDecimal.ROUND_HALF_UP).abs());
        }
        if (v < 0) {
            report.setUp(false);
@@ -546,7 +556,7 @@
        if (disposeLastMonthCount == 0) {
            dispose.setRatio(null);
        } else {
            dispose.setRatio(new BigDecimal(v1).setScale(2, BigDecimal.ROUND_HALF_UP).abs());
            dispose.setRatio(new BigDecimal(v1).setScale(4, BigDecimal.ROUND_HALF_UP).abs());
        }
        if (v1 < 0) {
            dispose.setUp(false);
@@ -562,7 +572,7 @@
        if (onTimeCaseLastMonthCount == 0) {
            onTimeDispose.setRatio(null);
        } else {
            onTimeDispose.setRatio(new BigDecimal(v2).setScale(2, BigDecimal.ROUND_HALF_UP).abs());
            onTimeDispose.setRatio(new BigDecimal(v2).setScale(4, BigDecimal.ROUND_HALF_UP).abs());
        }
        if (v2 < 0) {
            onTimeDispose.setUp(false);
@@ -586,7 +596,7 @@
        if (disposeLastMonthCount == 0) {
            register.setRatio(null);
        } else {
            register.setRatio(new BigDecimal(v3).setScale(2, BigDecimal.ROUND_HALF_UP).abs());
            register.setRatio(new BigDecimal(v3).setScale(4, BigDecimal.ROUND_HALF_UP).abs());
        }
        if (v3 < 0) {
            register.setUp(false);