zhanghua
2023-03-30 dfea866e55c725bd601ff84c92dff30f83057571
Merge branch 'master' of http://42.193.1.25:9521/r/sccg_server

# Conflicts:
# ycl-platform/src/main/java/com/ycl/controller/caseHandler/BaseCaseController.java
# ycl-platform/src/main/java/com/ycl/service/caseHandler/IBaseCaseService.java
# ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/BaseCaseServiceImpl.java
46个文件已修改
1个文件已添加
1 文件已重命名
673 ■■■■ 已修改文件
ycl-common/src/main/java/com/ycl/component/JwtAuthenticationTokenFilter.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/java/com/ycl/controller/depart/DepartController.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/java/com/ycl/controller/user/UmsAdminController.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/java/com/ycl/dto/UmsAdminParam.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/java/com/ycl/entity/user/UmsAdmin.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/java/com/ycl/mapper/dict/DataDictionary2Mapper.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/java/com/ycl/mapper/user/UmsAdminMapper.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/java/com/ycl/mapper/user/UmsDepartManageMapper.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/java/com/ycl/service/depart/impl/UmsDepartServiceImpl.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/java/com/ycl/service/oss/impl/OssServiceImpl.java 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/java/com/ycl/service/user/impl/UmsAdminServiceImpl.java 80 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/java/com/ycl/service/user/impl/UmsRoleServiceImpl.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/java/com/ycl/utils/common/DateUtil.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/java/com/ycl/utils/listener/DepartListener.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/java/com/ycl/vo/cockpit/CockpitVO.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/resources/mapper/dict/DataDictionary2Mapper.xml 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/resources/mapper/user/UmsAdminMapper.xml 82 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/resources/mapper/user/UmsDepartManageMapper.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/common/util/CommonUtils.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/common/util/DateUtil.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/controller/caseHandler/BaseCaseController.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/controller/caseHandler/IllegalBuildingController.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/controller/caseHandler/ViolationsController.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/cockpit/enforcementEvents/EnforcementEventsController.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/controller/cockpit/statisticsEvents/StatisticsEventsController.java 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/controller/platformApi/AlarmController.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/mapper/allot/EfficiencyMapper.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/mapper/apidata/ApiDataMapper.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/mapper/caseHandler/BaseCaseMapper.java 5 ●●●●● 补丁 | 查看 | 原始文档 | 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/apidata/IApiDataService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/service/apidata/impl/IApiDataServiceImpl.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/service/caseHandler/IBaseCaseService.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/BaseCaseServiceImpl.java 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/ViolationsServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/service/dict/IDataDictionaryService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/service/dict/impl/DataDictionaryServiceImpl.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/util/CheckApiUtil.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/util/VideoUtil.java 1 ●●●● 补丁 | 查看 | 原始文档 | 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/resources/mapper/allot/EfficiencyMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/resources/mapper/apidata/ApiDataMapper.xml 40 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/resources/mapper/caseHandler/BaseCaseMapper.xml 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-smoke/src/main/java/com/ycl/smoke/controller/smoke/SmokeController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-smoke/src/main/java/com/ycl/smoke/task/ScheduledTask.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/java/com/ycl/component/JwtAuthenticationTokenFilter.java
@@ -37,7 +37,7 @@
    protected void doFilterInternal(HttpServletRequest request,
                                    HttpServletResponse response,
                                    FilterChain chain) throws ServletException, IOException {
        System.out.println(request);
        // System.out.println(request);
//        Enumeration<String> headerNames = request.getHeaderNames();
//        while (headerNames.hasMoreElements()){
//            System.out.println(headerNames.nextElement());
ycl-common/src/main/java/com/ycl/controller/depart/DepartController.java
@@ -16,7 +16,7 @@
import com.ycl.entity.depart.UmsDepart;
import com.ycl.entity.dict.DataDictionary;
import com.ycl.mapper.depart.UmsDepartMapper;
import com.ycl.mapper.dict.DataDictionaryMapper;
import com.ycl.mapper.dict.DataDictionary2Mapper;
import com.ycl.service.depart.UmsDepartService;
import com.ycl.service.user.UmsDepartManageService;
import com.ycl.utils.EasyExcelUtils;
@@ -147,7 +147,7 @@
    @Resource
    private UmsDepartMapper sccgDepartMapper;
    @Resource
    private DataDictionaryMapper dataDictionaryMapper;
    private DataDictionary2Mapper dataDictionary2Mapper;
    @ApiOperation("部门导入")
    @PostMapping("/import")
    public CommonResult importDpt(MultipartFile file) throws IOException {
@@ -168,7 +168,7 @@
                        //  设置部门描述
                        umsDepart.setDepartDes(umsDepartDto.getDepartDes());
                        //  设置部门类型
                        DataDictionary dataDictionary = dataDictionaryMapper.selectOne(new LambdaQueryWrapper<DataDictionary>().eq(DataDictionary::getName, umsDepartDto.getDepartType()));
                        DataDictionary dataDictionary = dataDictionary2Mapper.selectOne(new LambdaQueryWrapper<DataDictionary>().eq(DataDictionary::getName, umsDepartDto.getDepartType()));
                        if (Objects.isNull(dataDictionary)){
                            throw new RuntimeException("部门类型不存在");
                        }else {
ycl-common/src/main/java/com/ycl/controller/user/UmsAdminController.java
@@ -18,7 +18,7 @@
import com.ycl.entity.user.UmsAdmin;
import com.ycl.entity.user.UmsRole;
import com.ycl.mapper.depart.UmsDepartMapper;
import com.ycl.mapper.dict.DataDictionaryMapper;
import com.ycl.mapper.dict.DataDictionary2Mapper;
import com.ycl.mapper.user.UmsAdminMapper;
import com.ycl.mapper.user.UmsRoleMapper;
import com.ycl.service.redis.RedisService;
@@ -158,7 +158,7 @@
    @Resource
    private UmsAdminMapper umsAdminMapper;
    @Resource
    private DataDictionaryMapper dataDictionaryMapper;
    private DataDictionary2Mapper dataDictionary2Mapper;
    @Resource
    private UmsDepartMapper umsDepartMapper;
    @ApiOperation("用户导入")
@@ -206,7 +206,7 @@
                        }
                        String userType = item.getUserType();
                        DataDictionary dataDictionary = dataDictionaryMapper.selectOne(new LambdaQueryWrapper<DataDictionary>().eq(DataDictionary::getName, userType));
                        DataDictionary dataDictionary = dataDictionary2Mapper.selectOne(new LambdaQueryWrapper<DataDictionary>().eq(DataDictionary::getName, userType));
                        if (Objects.isNull(dataDictionary)){
                            throw new RuntimeException("用户类型不存在");
                        }else {
ycl-common/src/main/java/com/ycl/dto/UmsAdminParam.java
@@ -13,6 +13,8 @@
@Getter
@Setter
public class UmsAdminParam {
    @ApiModelProperty(value = "用户名", required = false)
    private Long id;
    @NotBlank(message = "用户名不能为空")
    @ApiModelProperty(value = "用户名", required = true)
    private String username;
@@ -36,11 +38,11 @@
    @ApiModelProperty(value = "备注")
    private String note;
    @ApiModelProperty(value = "是否党员,0:否,1:是",example = "0")
    @ApiModelProperty(value = "是否党员,0:否,1:是", example = "0")
    @NotNull(message = "党员未选择")
    private byte isDy;
    @ApiModelProperty(value = "性别,0:女,1:男",example = "0")
    @ApiModelProperty(value = "性别,0:女,1:男", example = "0")
    @NotNull(message = "性别未选择")
    private byte sex;
@@ -76,4 +78,7 @@
    @ApiModelProperty(value = "ip地址")
    private String ipAddress;
    @ApiModelProperty(value = "有效天数")
    private Integer days;
}
ycl-common/src/main/java/com/ycl/entity/user/UmsAdmin.java
@@ -4,6 +4,8 @@
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.ycl.entity.depart.UmsDepart;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -58,6 +60,10 @@
    @ApiModelProperty(value = "最后登录时间")
    private Date loginTime;
    @ApiModelProperty(value = "账号有效期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date expirationDate;
    @ApiModelProperty(value = "帐号启用状态:0->禁用;1->启用")
    private Integer status;
@@ -79,7 +85,6 @@
    @ApiModelProperty(value = "部门名称")
    @TableField(exist = false)
    private String departName;
    @ApiModelProperty(value = "用户类型")
ycl-common/src/main/java/com/ycl/mapper/dict/DataDictionary2Mapper.java
File was renamed from ycl-common/src/main/java/com/ycl/mapper/dict/DataDictionaryMapper.java
@@ -11,5 +11,6 @@
 * @author lyq
 * @since 2022-09-15
 */
public interface DataDictionaryMapper extends BaseMapper<DataDictionary> {
public interface DataDictionary2Mapper extends BaseMapper<DataDictionary> {
}
ycl-common/src/main/java/com/ycl/mapper/user/UmsAdminMapper.java
@@ -22,7 +22,11 @@
     */
    List<Long> getAdminIdList(@Param("resourceId") Long resourceId);
    Page<UmsAdmin> selectCondPage(Page<UmsAdmin> page,UmsAdmin umsAdmin);
    Page<UmsAdmin> selectCondPage(Page<UmsAdmin> page, UmsAdmin umsAdmin);
    Long selectCondTotal(@Param("umsAdmin") UmsAdmin umsAdmin);
    List<UmsAdmin> selectCondList(@Param("umsAdmin") UmsAdmin umsAdmin, @Param("offset") Integer offset, @Param("size") Integer size);
    List<UmsAdmin> selectToExp();
ycl-common/src/main/java/com/ycl/mapper/user/UmsDepartManageMapper.java
@@ -18,6 +18,7 @@
public interface UmsDepartManageMapper extends BaseMapper<UmsDepartManage> {
    void deletedByDepartId(@Param("departId") long departId);
    void deletedByUserId(@Param("userId") long userId);
    List<UmsDepartManage> selectPageByUserId(@Param("userId") long userId, @Param("current") int current, @Param("pageSize") int pageSize);
}
ycl-common/src/main/java/com/ycl/service/depart/impl/UmsDepartServiceImpl.java
@@ -9,7 +9,6 @@
import com.ycl.enums.common.ResultCode;
import com.ycl.exception.ApiException;
import com.ycl.mapper.depart.UmsDepartMapper;
import com.ycl.mapper.dict.DataDictionaryMapper;
import com.ycl.service.depart.IDepartManagerService;
import com.ycl.service.depart.UmsDepartService;
import com.ycl.service.user.UmsAdminService;
@@ -47,8 +46,6 @@
    IDepartManagerService iDepartManagerService;
    @Resource
    UmsDepartService umsDepartService;
    @Resource
    DataDictionaryMapper dataDictionaryMapper;
    @Override
    @Transactional(rollbackFor = Exception.class)
ycl-common/src/main/java/com/ycl/service/oss/impl/OssServiceImpl.java
@@ -5,11 +5,18 @@
import com.aliyun.oss.model.ObjectMetadata;
import com.ycl.service.oss.OssService;
import com.ycl.utils.ConstantPropertiesUtils;
import com.ycl.utils.common.RandomUtils;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.UUID;
@@ -40,11 +47,30 @@
            // 这里设置图片有效时间 我设置了30年
            Date expiration = new Date(System.currentTimeMillis() + 946080000 * 1000);
            String url = ossClient.generatePresignedUrl(bucketName, fileName, expiration).toString();
            return url;
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println("uploadImages上传图片失败:");
            // e.printStackTrace();
            return null;
        }
    }
    private byte[] readInputStream(InputStream inStream) throws Exception {
        ByteArrayOutputStream outStream = new ByteArrayOutputStream();
        //创建一个Buffer字符串
        byte[] buffer = new byte[1024];
        //每次读取的字符串长度,如果为-1,代表全部读取完毕
        int len = 0;
        //使用一个输入流从buffer里把数据读取出来
        while ((len = inStream.read(buffer)) != -1) {
            //用输出流往buffer里写入数据,中间参数代表从哪个位置开始读,len代表读取的长度
            outStream.write(buffer, 0, len);
        }
        //关闭输入流
        inStream.close();
        //把outStream里的数据写入内存
        return outStream.toByteArray();
    }
    @Override
@@ -76,7 +102,10 @@
        // 上传文件流
        try {
            // 获取文件的名称
            String fileName = "sczf/" + String.valueOf(UUID.randomUUID());
            LocalDate date = LocalDate.now();
            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
            String fileName = "sczf/" + date.format(formatter) + RandomUtils.generateRandomInt(8) + "." + ext;
            System.out.println("文件地址:" + fileName);
            ObjectMetadata objectMetadata = new ObjectMetadata();
            objectMetadata.setContentType(getcontentType(ext));
            // 调用oss的方法实现长传
@@ -89,12 +118,24 @@
            // 这里设置图片有效时间 我设置了30年
            Date expiration = new Date(System.currentTimeMillis() + 946080000 * 1000);
            String url = ossClient.generatePresignedUrl(bucketName, fileName, expiration).toString();
            // System.out.println("oss成功:" + url);
            System.out.println("oss上传成功:" + url);
            URL urlO = new URL(url);
            HttpURLConnection conn = (HttpURLConnection) urlO.openConnection();
            conn.setRequestMethod("GET");
            conn.setConnectTimeout(10 * 1000);
            conn.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)");
            InputStream inputStream2 = conn.getInputStream();// 通过输入流获取图片数据
            byte[] data = readInputStream(inputStream2);
            System.out.println("获取图片成功:" + url);
            return url;
        } catch (Exception e) {
            System.out.println("oss异常:" + e.getMessage());
            // e.printStackTrace();
            return null;
            return this.uploadImages(inputStream, ext);
        }
    }
ycl-common/src/main/java/com/ycl/service/user/impl/UmsAdminServiceImpl.java
@@ -1,9 +1,13 @@
package com.ycl.service.user.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.PageUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.druid.sql.PagerUtils;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.segments.MergeSegments;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ycl.bo.AdminUserDetails;
@@ -45,9 +49,7 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.*;
import java.util.function.Consumer;
import java.util.stream.Collectors;
@@ -85,8 +87,9 @@
    @Override
    public UmsAdmin getAdminByUsername(String username) {
        UmsAdmin admin = getCacheService().getAdmin(username);
        if (admin != null) return admin;
        // UmsAdmin admin = getCacheService().getAdmin(username);
        // if (admin != null) return admin;
        UmsAdmin admin = null;
        QueryWrapper<UmsAdmin> wrapper = new QueryWrapper<>();
        wrapper.lambda().eq(UmsAdmin::getUsername, username);
        List<UmsAdmin> adminList = list(wrapper);
@@ -109,6 +112,9 @@
        //查询是否有相同用户名的用户
        QueryWrapper<UmsAdmin> wrapper = new QueryWrapper<>();
        wrapper.lambda().eq(UmsAdmin::getUsername, umsAdmin.getUsername());
        if (umsAdmin.getId() != null) {
            wrapper.lambda().ne(UmsAdmin::getId, umsAdmin.getId());
        }
        List<UmsAdmin> umsAdminList = list(wrapper);
        if (umsAdminList.size() > 0) {
            return null;
@@ -116,15 +122,35 @@
        //将密码进行加密操作
        String encodePassword = passwordEncoder.encode(umsAdmin.getPassword());
        if ( !umsAdmin.getPassword().matches("^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])[a-zA-Z0-9]{8,16}$")) {
        if (umsAdmin.getId() == null && !umsAdmin.getPassword().matches("^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])[a-zA-Z0-9]{8,16}$")) {
            Asserts.fail("密码长度8到16位且密码中的字符必须包含字母(大写或者小写)和必须包含数字,不能包含空格");
        }
        if(umsAdmin.getUsername().equals(umsAdmin.getPassword())){
           Asserts.fail("密码不能和登录名完全一致");
        if (umsAdmin.getUsername().equals(umsAdmin.getPassword())) {
            Asserts.fail("密码不能和登录名完全一致");
        }
        umsAdmin.setPassword(encodePassword);
        baseMapper.insert(umsAdmin);
        if (umsAdminParam.getDays() != null) {
            Date date = new Date();
            Calendar calendar = new GregorianCalendar();
            calendar.setTime(date);
            // 把日期往后增加一天,整数  往后推,负数往前移动
            calendar.add(Calendar.DATE, umsAdminParam.getDays());
            // 这个时间就是日期往后推一天的结果
            date = calendar.getTime();
            umsAdmin.setExpirationDate(date);
        } else {
            umsAdmin.setExpirationDate(new Date("2200-01-01"));
        }
        if (umsAdmin.getId() != null) {
            baseMapper.updateById(umsAdmin);
        } else {
            baseMapper.insert(umsAdmin);
        }
        LambdaQueryWrapper<UmsAdminRoleRelation> deleteWrapper = new QueryWrapper<UmsAdminRoleRelation>().lambda()
                .eq(UmsAdminRoleRelation::getAdminId, umsAdmin.getId());
        umsAdminRoleRelationService.remove(deleteWrapper);
        //添加角色授权
        List<Long> ids = umsAdminParam.getRoleIds();
        if (!ids.isEmpty()) {
@@ -138,6 +164,8 @@
            umsAdminRoleRelationService.saveBatch(roleIds);
        }
        umsDepartManageMapper.deletedByDepartId(umsAdmin.getId());
        //添加部门
        UmsDepartManage departManage = new UmsDepartManage();
        departManage.setUserId(umsAdmin.getId());
@@ -146,7 +174,7 @@
        departManage.setUpdateTime(new Date());
        umsDepartManageMapper.insert(departManage);
        baseMapper.updateById(umsAdmin);
        // baseMapper.updateById(umsAdmin);
        return umsAdmin;
    }
@@ -167,10 +195,10 @@
        //将密码进行加密操作
        String encodePassword = passwordEncoder.encode(umsAdmin.getPassword());
        if ( !umsAdmin.getPassword().matches("^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])[a-zA-Z0-9]{8,16}$")) {
        if (!umsAdmin.getPassword().matches("^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])[a-zA-Z0-9]{8,16}$")) {
            Asserts.fail("密码长度8到16位且密码中的字符必须包含字母(大写或者小写)和必须包含数字,不能包含空格");
        }
        if(umsAdmin.getUsername().equals(umsAdmin.getPassword())){
        if (umsAdmin.getUsername().equals(umsAdmin.getPassword())) {
            Asserts.fail("密码不能和登录名完全一致");
        }
        umsAdmin.setPassword(encodePassword);
@@ -236,6 +264,7 @@
            if (!userDetails.isEnabled()) {
                Asserts.fail("帐号已被禁用");
            }
            UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(userDetails, null, userDetails.getAuthorities());
            SecurityContextHolder.getContext().setAuthentication(authentication);
            //根据用户id,用户姓名
@@ -369,7 +398,7 @@
                && !param.getNewPassword().matches("^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])[a-zA-Z0-9]{8,16}$")) {
            return -1;
        }
        if(param.getUsername().equals(param.getNewPassword())){
        if (param.getUsername().equals(param.getNewPassword())) {
            return -4;
        }
        QueryWrapper<UmsAdmin> wrapper = new QueryWrapper<>();
@@ -393,6 +422,11 @@
        //获取用户信息
        UmsAdmin admin = getAdminByUsername(username);
        if (admin != null) {
            if (admin.getExpirationDate() != null) {
                if (!admin.getExpirationDate().after(new Date())) {
                    Asserts.fail("账号已过期请联系管理员");
                }
            }
            List<UmsMenu> resourceList = getResourceList(admin.getId());
            return new AdminUserDetails(admin, resourceList);
        }
@@ -432,9 +466,13 @@
        if (pageUserVO.getJobTitle() != null && !("".equals(pageUserVO.getJobTitle()))) {
            umsAdmin.setJobTitle(pageUserVO.getJobTitle());
        }
        Page<UmsAdmin> page1 = baseMapper.selectCondPage(page, umsAdmin);
        return page1;
        PageUtil.setFirstPageNo(1);
        int offset = PageUtil.getStart(current, pageSize);
        List<UmsAdmin> list = baseMapper.selectCondList(umsAdmin, offset, pageSize);
        Long total = baseMapper.selectCondTotal(umsAdmin);
        page.setRecords(list);
        page.setTotal(total);
        return page;
    }
    @Override
@@ -456,7 +494,7 @@
                            roleStrBuffer.append(",");
                        }
                    });
                    roleStrBuffer.deleteCharAt(roleStrBuffer.length()-1);
                    roleStrBuffer.deleteCharAt(roleStrBuffer.length() - 1);
                    res1.setRoles(roleStrBuffer.toString());
                    StringBuffer departStrBuffer = new StringBuffer();
                    List<UmsDepart> departs = item.getDepart();
@@ -467,19 +505,19 @@
                            departStrBuffer.append(",");
                        }
                    });
                    departStrBuffer.deleteCharAt(departStrBuffer.length()-1);
                    departStrBuffer.deleteCharAt(departStrBuffer.length() - 1);
                    res1.setDepart(departStrBuffer.toString());
                    res1.setJobTitle(item.getJobTitle());
                    Date createTime = item.getCreateTime();
                    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                    if (createTime != null){
                    if (createTime != null) {
                        res1.setCreateTime(sdf.format(createTime));
                    }
                    Integer status = item.getStatus();
                    if (status.equals(1)){
                    if (status.equals(1)) {
                        res1.setStatus("启用");
                    }else {
                    } else {
                        res1.setStatus("禁用");
                    }
                    return res1;
ycl-common/src/main/java/com/ycl/service/user/impl/UmsRoleServiceImpl.java
@@ -8,7 +8,7 @@
import com.ycl.dto.UmsMenuNode;
import com.ycl.entity.dict.DataDictionary;
import com.ycl.entity.user.*;
import com.ycl.mapper.dict.DataDictionaryMapper;
import com.ycl.mapper.dict.DataDictionary2Mapper;
import com.ycl.mapper.user.UmsMenuMapper;
import com.ycl.mapper.user.UmsResourceMapper;
import com.ycl.mapper.user.UmsRoleMapper;
@@ -47,7 +47,7 @@
    @Resource
    private UmsResourceMapper umsResourceMapper;
    @Resource
    private DataDictionaryMapper dataDictionaryMapper;
    private DataDictionary2Mapper dataDictionary2Mapper;
    @Override
    public boolean create(UmsRole role) {
@@ -78,7 +78,7 @@
        if (types.size() > 0) {
            LambdaQueryWrapper<DataDictionary> dicQuery = new LambdaQueryWrapper<>();
            dicQuery.in(DataDictionary::getId, types);
            List<DataDictionary> dics = dataDictionaryMapper.selectList(dicQuery);
            List<DataDictionary> dics = dataDictionary2Mapper.selectList(dicQuery);
            for (UmsRole role : roles) {
                for (DataDictionary dic : dics) {
                    if (dic.getId().equals(role.getType())) {
ycl-common/src/main/java/com/ycl/utils/common/DateUtil.java
@@ -1005,9 +1005,9 @@
    public static boolean verifyRequestTime(long timestamp) {
        long now = System.currentTimeMillis();
        long time = now - timestamp;
        System.out.println(now);
        System.out.println(time);
        System.out.println(time / 1000);
        // System.out.println(now);
        // System.out.println(time);
        // System.out.println(time / 1000);
        if (time / 1000 > 60) {
            return false;
        }
@@ -1377,7 +1377,7 @@
        if (c.get(Calendar.DAY_OF_WEEK) == 1) {
            return date;
        }
        System.out.println(c.get(Calendar.DAY_OF_WEEK));
        // System.out.println(c.get(Calendar.DAY_OF_WEEK));
        c.add(Calendar.DATE, 7 - c.get(Calendar.DAY_OF_WEEK) + 1);
        return c.getTime();
    }
ycl-common/src/main/java/com/ycl/utils/listener/DepartListener.java
@@ -7,11 +7,9 @@
import com.ycl.entity.depart.UmsDepart;
import com.ycl.entity.dict.DataDictionary;
import com.ycl.mapper.depart.UmsDepartMapper;
import com.ycl.mapper.dict.DataDictionaryMapper;
import org.springframework.beans.factory.annotation.Autowired;
import com.ycl.mapper.dict.DataDictionary2Mapper;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.util.Objects;
@@ -21,7 +19,7 @@
    @Resource
    private UmsDepartMapper sccgDepartMapper;
    @Resource
    private DataDictionaryMapper dataDictionaryMapper;
    private DataDictionary2Mapper dataDictionary2Mapper;
//    private static DepartListener departListener;
//
@@ -50,7 +48,7 @@
        umsDepart.setDepartDes(umsDepartDto.getDepartDes());
        //  设置部门类型
        DataDictionary dataDictionary = dataDictionaryMapper.selectOne(new LambdaQueryWrapper<DataDictionary>().eq(DataDictionary::getName, umsDepartDto.getDepartType()));
        DataDictionary dataDictionary = dataDictionary2Mapper.selectOne(new LambdaQueryWrapper<DataDictionary>().eq(DataDictionary::getName, umsDepartDto.getDepartType()));
        if (Objects.isNull(dataDictionary)){
            throw new RuntimeException("部门类型不存在");
        }else {
ycl-common/src/main/java/com/ycl/vo/cockpit/CockpitVO.java
@@ -15,7 +15,7 @@
@Data
@ApiModel
public class CockpitVO {
//    @Data
    //    @Data
//    @ApiModel
//    public class Params1VO implements Serializable {
//        @ApiModelProperty(value = "appId", example = "1")
@@ -32,23 +32,30 @@
//    @Data
//    @ApiModel
//    public class Params2VO implements Serializable {
        @ApiModelProperty(value = "appId", example = "1")
        @NotBlank(message = "appId不能为空")
        private String appId;
        @ApiModelProperty(value = "appKey", example = "1")
        @NotBlank(message = "appKey不能为空")
        private String appKey;
        @ApiModelProperty(value = "sign", example = "sfagjgfjgfjdgfjsgdfgsa")
        @NotBlank(message = "sign不能为空")
        private String sign;
    @ApiModelProperty(value = "appId", example = "1")
    @NotBlank(message = "appId不能为空")
    private String appId;
    @ApiModelProperty(value = "appKey", example = "1")
    @NotBlank(message = "appKey不能为空")
    private String appKey;
    @ApiModelProperty(value = "sign", example = "sfagjgfjgfjdgfjsgdfgsa")
    @NotBlank(message = "sign不能为空")
    private String sign;
        @ApiModelProperty(value = "streetId", example = "25")
        private Integer streetId;
        @ApiModelProperty(value = "开始时间,格式yyyy-MM-dd hh:mm:ss", example = "2022-10-22 13:22:22")
    @ApiModelProperty(value = "streetId", example = "25")
    private Integer streetId;
    @ApiModelProperty(value = "开始时间,格式yyyy-MM-dd hh:mm:ss", example = "2022-10-22 13:22:22")
//        @NotBlank(message = "开始时间不能为空")
        private String beginTime;
        @ApiModelProperty(value = "结束时间,格式yyyy-MM-dd hh:mm:ss", example = "2022-10-23 13:22:22")
    private String beginTime;
    @ApiModelProperty(value = "结束时间,格式yyyy-MM-dd hh:mm:ss", example = "2022-10-23 13:22:22")
//        @NotBlank(message = "结束时间不能为空")
        private String endTime;
    private String endTime;
    @ApiModelProperty(value = "pageIndex", example = "25")
    private Integer pageIndex;
    @ApiModelProperty(value = "pageSize", example = "25")
    private Integer pageSize;
//    }
}
ycl-common/src/main/resources/mapper/dict/DataDictionary2Mapper.xml
New file
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ycl.mapper.dict.DataDictionary2Mapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ycl.entity.dict.DataDictionary">
        <id column="id" property="id"/>
        <result column="name" property="name"/>
        <result column="code" property="code"/>
        <result column="type_name" property="typeName"/>
        <result column="type_code" property="typeCode"/>
        <result column="parent_id" property="parentId"/>
        <result column="level" property="level"/>
        <result column="remark" property="remark"/>
    </resultMap>
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id
        , name, code, type_name,type_code,parent_id,level,remark
    </sql>
</mapper>
ycl-common/src/main/resources/mapper/user/UmsAdminMapper.xml
@@ -22,6 +22,7 @@
        <result column="user_type" property="userType"/>
        <result column="zj" property="zj"/>
        <result column="mobile" property="mobile"/>
        <result column="expiration_date" property="expirationDate"/>
    </resultMap>
    <resultMap type="com.ycl.entity.user.UmsAdmin" id="CondMapResultMap" extends="BaseResultMap">
        <collection property="depart" javaType="ArrayList" ofType="com.ycl.entity.depart.UmsDepart">
@@ -35,15 +36,14 @@
            <result column="depart_update_time" property="updateTime"/>
            <result column="is_deleted" property="isDeleted"/>
        </collection>
        <collection property="roles" javaType="ArrayList" ofType="com.ycl.entity.user.UmsRole" column="id"
                    select="selectAdminRoles">
            <id column="role_id" property="id"/>
            <result column="name" property="name"/>
            <result column="description" property="description"/>
            <result column="admin_count" property="adminCount"/>
        <collection property="roles" javaType="ArrayList" ofType="com.ycl.entity.user.UmsRole">
            <result column="role_id" property="id"/>
            <result column="role_name" property="name"/>
            <result column="role_description" property="description"/>
            <result column="role_admin_count" property="adminCount"/>
            <result column="role_create_time" property="createTime"/>
            <result column="role_status" property="status"/>
            <result column="sort" property="sort"/>
            <result column="role_sort" property="sort"/>
        </collection>
    </resultMap>
@@ -65,11 +65,15 @@
        ud.create_time depat_create_time,
        ud.update_time depat_update_time,
        ud.STATUS depart_status,
        ud.is_deleted
        ud.is_deleted,
        r.id role_id,
        r.`name` role_name
        FROM
        ums_admin ua
        LEFT JOIN ums_depart_manager udm ON ua.id = udm.user_id
        LEFT JOIN ums_depart ud ON udm.depart_id = ud.id
        LEFT JOIN ums_admin_role_relation ar on ar.admin_id = ua.id
        LEFT JOIN ums_role r on ar.role_id = r.id
        <where>
            <if test="umsAdmin.keyword !=null  and umsAdmin.keyword !=''">
                AND (ua.username LIKE concat('%',#{umsAdmin.keyword,jdbcType=VARCHAR},'%')
@@ -100,6 +104,40 @@
        where ua.id = #{id}
    </select>
    <select id="selectToExp" resultType="com.ycl.entity.user.UmsAdmin" resultMap="CondMapResultMap">
        SELECT ua.*,
               ud.id          depart_id,
               ud.depart_name,
               ud.depart_des,
               ud.depart_type,
               ud.parent_id,
               ud.create_time depat_create_time,
               ud.update_time depat_update_time,
               ud.STATUS      depart_status,
               ud.is_deleted
        FROM ums_admin ua
                 LEFT JOIN ums_depart_manager udm ON ua.id = udm.user_id
                 LEFT JOIN ums_depart ud ON udm.depart_id = ud.id
        ORDER BY ua.id DESC
    </select>
    <select id="selectCondTotal" parameterType="com.ycl.entity.user.UmsAdmin" resultType="java.lang.Long">
        SELECT count(1) total
        FROM
        ums_admin ua
        <where>
            <if test="umsAdmin.keyword !=null  and umsAdmin.keyword !=''">
                AND (ua.username LIKE concat('%',#{umsAdmin.keyword,jdbcType=VARCHAR},'%')
                or ua.nick_name LIKE concat('%',#{umsAdmin.keyword,jdbcType=VARCHAR},'%')
                or ua.mobile LIKE concat('%',#{umsAdmin.keyword,jdbcType=VARCHAR},'%'))
            </if>
            <if test="umsAdmin.userType !=null and umsAdmin.userType >=0 ">
                AND ua.user_type = #{umsAdmin.userType}
            </if>
            <if test="umsAdmin.jobTitle !=null  and umsAdmin.keyword !=''">
                AND ua.job_title = #{umsAdmin.jobTitle}
            </if>
        </where>
    </select>
    <select id="selectCondList" parameterType="com.ycl.entity.user.UmsAdmin" resultMap="CondMapResultMap">
        SELECT
        ua.*,
        ud.id depart_id,
@@ -110,12 +148,32 @@
        ud.create_time depat_create_time,
        ud.update_time depat_update_time,
        ud.STATUS depart_status,
        ud.is_deleted
        ud.is_deleted,
        r.id role_id,
        r.`name` role_name
        FROM
        ums_admin ua
        LEFT JOIN ums_depart_manager udm ON ua.id = udm.user_id
        LEFT JOIN ums_depart ud ON udm.depart_id = ud.id
        (select * from ums_admin ua
        <where>
            <if test="umsAdmin.keyword !=null  and umsAdmin.keyword !=''">
                AND (ua.username LIKE concat('%',#{umsAdmin.keyword,jdbcType=VARCHAR},'%')
                or ua.nick_name LIKE concat('%',#{umsAdmin.keyword,jdbcType=VARCHAR},'%')
                or ua.mobile LIKE concat('%',#{umsAdmin.keyword,jdbcType=VARCHAR},'%'))
            </if>
            <if test="umsAdmin.userType !=null and umsAdmin.userType >=0 ">
                AND ua.user_type = #{umsAdmin.userType}
            </if>
            <if test="umsAdmin.jobTitle !=null  and umsAdmin.keyword !=''">
                AND ua.job_title = #{umsAdmin.jobTitle}
            </if>
        </where>
        ORDER BY
        ua.id DESC
        LIMIT #{offset}, #{size} ) as
        ua
        LEFT JOIN ums_depart_manager udm ON ua.id = udm.user_id
        LEFT JOIN ums_depart ud ON udm.depart_id = ud.id
        LEFT JOIN ums_admin_role_relation ar on ar.admin_id = ua.id
        LEFT JOIN ums_role r on ar.role_id = r.id
    </select>
</mapper>
ycl-common/src/main/resources/mapper/user/UmsDepartManageMapper.xml
@@ -21,6 +21,11 @@
        from ums_depart_manager
        where depart_id = #{departId}
    </delete>
    <delete id="deletedByUserId">
        delete
        from ums_depart_manager
        where user_id = #{userId}
    </delete>
    <select id="selectPageByUserId" resultMap="BaseResultMap">
        select
ycl-platform/src/main/java/com/ycl/common/util/CommonUtils.java
@@ -237,7 +237,7 @@
                    setMethod.invoke(obj, new Object[] { value });
                }
            } else {
                System.out.println(field.get(object));
                // System.out.println(field.get(object));
                obj.getClass().getField(field.getName()).set((Object) obj, field.get(object));
            }
        }
@@ -269,7 +269,7 @@
                    setMethod.invoke(result, new Object[] { value });
                }
            } else {
                System.out.println(field.get(src));
                // System.out.println(field.get(src));
                obj.getClass().getField(field.getName()).set(result, field.get(src));
            }
        }
ycl-platform/src/main/java/com/ycl/common/util/DateUtil.java
@@ -190,7 +190,7 @@
        hour = (diff / (60 * 60 * 1000) - day * 24);
        min = ((diff / (60 * 1000)) - day * 24 * 60 - hour * 60);
        second = diff/1000;
        System.out.println("day="+day+" hour="+hour+" min="+min+" ss="+second%60+" SSS="+diff%1000);
        // System.out.println("day="+day+" hour="+hour+" min="+min+" ss="+second%60+" SSS="+diff%1000);
        String daystr = day%30+"天";
        String hourStr = hour%24+"小时";
        String minStr = min%60+"分";
@@ -225,6 +225,6 @@
        calendar.add(Calendar.MILLISECOND, -30);
        Date date = calendar.getTime();
        Date today = new Date();
        System.out.println(getDistanceDateTime(date,today));
        // System.out.println(getDistanceDateTime(date,today));
    }
}
ycl-platform/src/main/java/com/ycl/controller/caseHandler/BaseCaseController.java
@@ -145,9 +145,9 @@
        Page<Object> queryList;
        if (type == 1) {
            queryList = baseCaseService.listViolationsPage(new Page<>().setCurrent(current).setSize(size), state, resource, code, categoryBig, categorySmall, street, site, startTime, endTime, violationsTypeId,videoId);
            queryList = baseCaseService.listViolationsPage(current, size, state, resource, code, categoryBig, categorySmall, street, site, startTime, endTime, violationsTypeId, videoId);
        } else if (type == 2) {
            queryList = baseCaseService.listIllegalBuilding(new Page<>().setCurrent(current).setSize(size), state, resource);
            queryList = baseCaseService.listIllegalBuilding(current, size, state, resource);
        } else {
            return CommonResult.failed("bad request url");
        }
@@ -384,8 +384,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/caseHandler/IllegalBuildingController.java
@@ -45,10 +45,8 @@
    public CommonResult searchIllegalBuilding(@RequestParam Integer size,
                                              @RequestParam Integer current,
                                              @RequestParam(required = false) String keyWord) {
        Page<DataDictionary> dataDictionaryPage = new Page<>();
        dataDictionaryPage.setSize(size);
        dataDictionaryPage.setCurrent(current);
        return CommonResult.success(iDataDictionaryService.listIllegalBuildingSettings(dataDictionaryPage, keyWord));
        return CommonResult.success(iDataDictionaryService.listIllegalBuildingSettings(current, size, keyWord));
    }
    /**
@@ -58,7 +56,7 @@
     **/
    @ApiOperation(value = "删除违建类型")
    @DeleteMapping("/delete")
    @LogSave(operationType = "运营基础设置",contain = "删除违建事项")
    @LogSave(operationType = "运营基础设置", contain = "删除违建事项")
    public CommonResult removeIllegalBuilding(@RequestParam Integer id) {
        return CommonResult.success(iDataDictionaryService.removeById(id));
    }
@@ -70,7 +68,7 @@
     **/
    @ApiOperation(value = "批量删除违建类型")
    @DeleteMapping("/batch_delete")
    @LogSave(operationType = "运营基础设置",contain = "批量删除违建事项")
    @LogSave(operationType = "运营基础设置", contain = "批量删除违建事项")
    public CommonResult removeIllegalBuildings(@RequestParam String[] ids) {
        return CommonResult.success(iDataDictionaryService.removeBatchByIds(Arrays.asList(ids)));
    }
@@ -128,7 +126,7 @@
     **/
    @ApiOperation(value = "添加所属类型/类别")
    @PostMapping("/addition/type")
    @LogSave(operationType = "运营基础设置",contain = "添加违建事项")
    @LogSave(operationType = "运营基础设置", contain = "添加违建事项")
    public CommonResult addIllegalBuildingTypeFirst(@RequestBody @Validated DataDictionary dataDictionary) {
        return CommonResult.success(iDataDictionaryService.save(dataDictionary));
    }
ycl-platform/src/main/java/com/ycl/controller/caseHandler/ViolationsController.java
@@ -45,10 +45,8 @@
    public CommonResult searchViolations(@RequestParam Integer size,
                                         @RequestParam Integer current,
                                         @RequestParam(required = false) String keyWord) {
        Page<ViolationSettingVO> dataDictionaryPage = new Page<>();
        dataDictionaryPage.setSize(size);
        dataDictionaryPage.setCurrent(current);
        return CommonResult.success(iDataDictionaryService.listViolations(dataDictionaryPage, keyWord));
        return CommonResult.success(iDataDictionaryService.listViolations(current, size, keyWord));
    }
    /**
@@ -58,7 +56,7 @@
     **/
    @ApiOperation(value = "删除违规类型")
    @DeleteMapping("/delete")
    @LogSave(operationType = "运营基础设置",contain = "删除违规事项")
    @LogSave(operationType = "运营基础设置", contain = "删除违规事项")
    public CommonResult removeViolation(@RequestParam Integer id) {
        return CommonResult.success(iDataDictionaryService.removeById(id));
    }
@@ -70,7 +68,7 @@
     **/
    @ApiOperation(value = "批量删除违规类型")
    @DeleteMapping("/batch_delete")
    @LogSave(operationType = "运营基础设置",contain = "批量删除违规事项")
    @LogSave(operationType = "运营基础设置", contain = "批量删除违规事项")
    public CommonResult removeViolations(@RequestParam String[] ids) {
        return CommonResult.success(iDataDictionaryService.removeBatchByIds(Arrays.asList(ids)));
@@ -177,7 +175,7 @@
     **/
    @ApiOperation(value = "添加所属类型/大类/小类/案由")
    @PostMapping("/addition/type")
    @LogSave(operationType = "运营基础设置",contain = "添加违规事项")
    @LogSave(operationType = "运营基础设置", contain = "添加违规事项")
    public CommonResult addViolationType(@RequestBody @Validated DataDictionary dataDictionary) {
        return CommonResult.success(iDataDictionaryService.save(dataDictionary));
    }
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/cockpit/enforcementEvents/EnforcementEventsController.java
@@ -1,6 +1,7 @@
package com.ycl.controller.cockpit.enforcementEvents;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ycl.api.CommonResult;
import com.ycl.dto.trend.TrendAnalysisParam;
import com.ycl.entity.caseHandler.BaseCase;
@@ -11,6 +12,7 @@
import com.ycl.util.CheckApiUtil;
import com.ycl.vo.cockpit.CockpitVO;
import com.ycl.vo.cockpit.enforcementEvents.EnforcementEventsVO;
import com.ycl.vo.cockpit.enforcementEvents.EventVO;
import com.ycl.vo.cockpit.enforcementEvents.VideoAndAreaVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -96,7 +98,7 @@
        al.setCount(alCount);
        typeVO1s.add(al);
        VideoAndAreaVO hand = new VideoAndAreaVO();
        hand.setName("人工上报");
        hand.setName("网格巡查");
        hand.setRatio(new BigDecimal(handCount * 1.0 / allCount).setScale(2, BigDecimal.ROUND_HALF_UP));
        hand.setCount(handCount);
        typeVO1s.add(hand);
@@ -128,7 +130,9 @@
        infoVO.setWeek(iBaseCaseService.weekCount());
        infoVO.setDispatch(iBaseCaseService.dispatchCount());
        infoVO.setIdentification(iBaseCaseService.alCount());
        infoVO.setEvent(iBaseCaseService.selectEventList(params.getBeginTime(), params.getEndTime()));
        IPage<EventVO> page = iBaseCaseService.selectEventList(params.getBeginTime(), params.getEndTime(),params.getPageIndex(),params.getPageSize());
        infoVO.setEvent(page.getRecords());
        infoVO.setTotal(page.getTotal());
        return CommonResult.success(infoVO);
    }
}
ycl-platform/src/main/java/com/ycl/controller/cockpit/statisticsEvents/StatisticsEventsController.java
@@ -51,7 +51,7 @@
    private IApiDataService iApiDataService;
    @Autowired
    public void setIApiDataService(IApiDataService apiDataService){
    public void setIApiDataService(IApiDataService apiDataService) {
        this.iApiDataService = apiDataService;
    }
@@ -91,16 +91,8 @@
    @GetMapping("/lot")
    public CommonResult<List<StatisticsEventsVO.LotVO>> lot(@Validated CockpitVO params) {
        checkApiUtil.cockpit(params);
        List<StatisticsEventsVO.LotVO> lotVOS = new ArrayList<>();
        StatisticsEventsVO.LotVO a = null;
        for (int i = 0; i < 4; i++) {
            a = new StatisticsEventsVO.LotVO();
            a.setName("团结屯");
            a.setType("摄像头");
            a.setCount(10);
            a.setRatio(new BigDecimal("-0.3").setScale(2, RoundingMode.HALF_UP));
            lotVOS.add(a);
        }
        List<StatisticsEventsVO.LotVO> lotVOS = iApiDataService.listLot(params.getStreetId(), params.getBeginTime(), params.getEndTime());
        return CommonResult.success(lotVOS);
    }
@@ -174,11 +166,8 @@
    @GetMapping("/arithmetic_event")
    public CommonResult<List<StatisticsEventsVO.ArithmeticVO>> arithmeticEvent(@Validated CockpitVO params) {
        checkApiUtil.cockpit(params);
        List<StatisticsEventsVO.ArithmeticVO> ls = new ArrayList<>();
        ls.add(new StatisticsEventsVO.ArithmeticVO("xx中队", 10, 0.1));
        ls.add(new StatisticsEventsVO.ArithmeticVO("xx中队", 20, 0.2));
        ls.add(new StatisticsEventsVO.ArithmeticVO("xx中队", 30, 0.3));
        ls.add(new StatisticsEventsVO.ArithmeticVO("xx中队", 40, 0.4));
        List<StatisticsEventsVO.ArithmeticVO> ls = iApiDataService.arithmeticEvent(params.getStreetId(), params.getBeginTime(), params.getEndTime());
        return CommonResult.success(ls);
    }
ycl-platform/src/main/java/com/ycl/controller/platformApi/AlarmController.java
@@ -16,9 +16,11 @@
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Base64;
/**
 * @author admin
@@ -66,7 +68,9 @@
    @ResponseBody
    public byte[] getImages(HttpServletResponse response, @RequestParam String fileUrl, @RequestParam String OSSAccessKeyId, @RequestParam String Signature) {
        try {
            URL url = new URL(fileUrl + "&OSSAccessKeyId=" + OSSAccessKeyId +"&Signature=" + Signature);
            System.out.println("getImages获取图片地址:" + fileUrl + "&OSSAccessKeyId=" + OSSAccessKeyId + "&Signature=" + Signature);
            URL url = new URL(fileUrl + "&OSSAccessKeyId=" + OSSAccessKeyId + "&Signature=" + Signature);
            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
            conn.setRequestMethod("GET");
            conn.setConnectTimeout(10 * 1000);
@@ -74,15 +78,47 @@
            InputStream inputStream = conn.getInputStream();// 通过输入流获取图片数据
            byte[] data = readInputStream(inputStream);
            System.out.println("getImages获取图片成功");
            System.out.println("getImages -图片64");
            System.out.println(Base64.getEncoder().encodeToString(data));
            return data;
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println("getImages获取图片失败:" + e.getMessage());
            // e.printStackTrace();
        }
        return null;
    }
    private static String inputStream2Base64(InputStream is) throws Exception {
        byte[] data = null;
        try {
            ByteArrayOutputStream swapStream = new ByteArrayOutputStream();
            byte[] buff = new byte[100];
            int rc = 0;
            while ((rc = is.read(buff, 0, 100)) > 0) {
                swapStream.write(buff, 0, rc);
            }
            data = swapStream.toByteArray();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if (is != null) {
                try {
                    is.close();
                } catch (IOException e) {
                    throw new Exception("输入流关闭异常");
                }
            }
        }
        return Base64.getEncoder().encodeToString(data);
    }
    private byte[] readInputStream(InputStream inStream) throws Exception {
        ByteArrayOutputStream outStream = new ByteArrayOutputStream();
        //创建一个Buffer字符串
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/apidata/ApiDataMapper.java
@@ -1,9 +1,14 @@
package com.ycl.mapper.apidata;
import com.ycl.vo.cockpit.statisticsEvents.StatisticsEventsVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ApiDataMapper {
    List<StatisticsEventsVO.Top10VO> listTop10(String beginTime, String endTime);
    List<StatisticsEventsVO.ArithmeticVO> arithmeticEvent(@Param("streetId") Integer streetId, @Param("beginTime") String beginTime, @Param("endTime") String endTime);
    List<StatisticsEventsVO.LotVO> listLot(@Param("streetId") Integer streetId, @Param("beginTime") String beginTime, @Param("endTime") String endTime);
}
ycl-platform/src/main/java/com/ycl/mapper/caseHandler/BaseCaseMapper.java
@@ -1,6 +1,7 @@
package com.ycl.mapper.caseHandler;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ycl.dto.caseHandler.QueryForViolationParam;
import com.ycl.dto.cockpitManage.DelayDO;
@@ -37,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();
@@ -45,7 +46,7 @@
    Integer dispatchCount();
    List<EventVO> selectEventList(String beginTime, String endTime);
    IPage<EventVO> selectEventList(IPage<EventVO> page, String beginTime, String endTime);
    Integer alCount();
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/apidata/IApiDataService.java
@@ -7,4 +7,8 @@
public interface IApiDataService {
    List<StatisticsEventsVO.Top10VO> listTop10(String beginTime, String endTime);
    List<StatisticsEventsVO.ArithmeticVO> arithmeticEvent(Integer streetId, String beginTime, String endTime);
    List<StatisticsEventsVO.LotVO> listLot(Integer streetId, String beginTime, String endTime);
}
ycl-platform/src/main/java/com/ycl/service/apidata/impl/IApiDataServiceImpl.java
@@ -6,7 +6,9 @@
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.List;
import java.util.stream.IntStream;
@Service
public class IApiDataServiceImpl implements IApiDataService {
@@ -19,4 +21,19 @@
        return apiDataMapper.listTop10(beginTime, endTime);
    }
    @Override
    public List<StatisticsEventsVO.ArithmeticVO> arithmeticEvent(Integer streetId, String beginTime, String endTime) {
        List<StatisticsEventsVO.ArithmeticVO> list = apiDataMapper.arithmeticEvent(streetId, beginTime, endTime);
        Integer all = list.stream().flatMapToInt(o -> IntStream.of(o.getCount())).sum();
        list.stream().forEach(o -> {
            o.setRatio(new BigDecimal(((double) o.getCount() / (double) all)).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
        });
        return list;
    }
    @Override
    public List<StatisticsEventsVO.LotVO> listLot(Integer streetId, String beginTime, String endTime) {
        return apiDataMapper.listLot(streetId, beginTime, endTime);
    }
}
ycl-platform/src/main/java/com/ycl/service/caseHandler/IBaseCaseService.java
@@ -1,5 +1,6 @@
package com.ycl.service.caseHandler;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ycl.dto.caseHandler.QueryForViolationParam;
@@ -13,6 +14,7 @@
import com.ycl.vo.cockpit.enforcementEvents.DelayVO;
import com.ycl.vo.cockpit.enforcementEvents.EventVO;
import com.ycl.vo.cockpit.enforcementEvents.VideoAndAreaVO;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.ArrayList;
import java.util.List;
@@ -37,9 +39,9 @@
     */
    String uploadEvent(Long caseId);
    Page listViolationsPage(Page page, Integer state, Integer resource, String code, String categoryBig, String categorySmall, Integer street, String site, String startTime, String endTime,Integer violationsTypeId,Integer videoId);
    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,Integer videoId);
    Page listIllegalBuilding(Page page, Integer state, Integer resource);
    Page listIllegalBuilding(Integer size, Integer current, Integer state, Integer resource);
    Boolean saveViolationCase(ViolationParam violationParam, Long id);
@@ -67,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();
@@ -81,11 +83,11 @@
    Integer alCount();
    List<EventVO> selectEventList(String beginTime, String endTime);
    IPage<EventVO> selectEventList(String beginTime, String endTime, Integer pageIndex, Integer pageSize);
    List<VideoAndAreaVO> areaCount();
    List<DelayVO> selectDelayList();
    Map<String,Object> statistics();
    Map<String, Object> statistics();
}
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, Integer violationsTypeId,Integer videoId) {
    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, violationsTypeId,videoId);
        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);
    }
@@ -413,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
@@ -476,8 +479,15 @@
    }
    @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
ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/ViolationsServiceImpl.java
@@ -76,6 +76,7 @@
                baseCase.setCommunityId(videoPoint.getCommunityId());
                baseCase.setSite(videoPoint.getAddress());
                baseCase.setGridId(videoPoint.getGridId());
                baseCase.setSite(videoPoint.getAddress());
                baseCaseService.save(baseCase);
                violations.setId(baseCase.getId());
ycl-platform/src/main/java/com/ycl/service/dict/IDataDictionaryService.java
@@ -30,9 +30,9 @@
     */
    List<DataDictionary> queryByCode(String code,String keyword);
    Page listIllegalBuildingSettings(Page<DataDictionary> dataDictionaryPage, String keyWork);
    Page listIllegalBuildingSettings(Integer current, Integer size, String keyWork);
    Page listViolations(Page<ViolationSettingVO> dataDictionaryPage, String keyWord);
    Page listViolations(Integer current, Integer size, String keyWord);
    List<DataDictionaryVo> queryTreeType(String typeCode, Integer level);
}
ycl-platform/src/main/java/com/ycl/service/dict/impl/DataDictionaryServiceImpl.java
@@ -7,6 +7,7 @@
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ycl.entity.dict.DataDictionary;
import com.ycl.mapper.dict.DataDictionaryMapper;
import com.ycl.mapper.dict.DataDictionaryMapper;
import com.ycl.service.dict.IDataDictionaryService;
import com.ycl.service.redis.RedisService;
import com.ycl.utils.common.LiveTimeMillisecond;
@@ -60,13 +61,19 @@
    }
    @Override
    public Page listIllegalBuildingSettings(Page<DataDictionary> dataDictionaryPage, String keyWord) {
    public Page listIllegalBuildingSettings(Integer current, Integer size, String keyWord) {
        Page<DataDictionary> dataDictionaryPage = new Page<>();
        dataDictionaryPage.setSize(size);
        dataDictionaryPage.setCurrent(current);
        Page<DataDictionary> dataDictionaryPageList = dataDictionaryMapper.listDataDictionaryPage(dataDictionaryPage, keyWord);
        return dataDictionaryPageList;
    }
    @Override
    public Page listViolations(Page<ViolationSettingVO> dataDictionaryPage, String keyWord) {
    public Page listViolations(Integer current, Integer size, String keyWord) {
        Page<ViolationSettingVO> dataDictionaryPage = new Page<>();
        dataDictionaryPage.setSize(size);
        dataDictionaryPage.setCurrent(current);
        dataDictionaryPage.setOptimizeCountSql(false);
        Page<ViolationSettingVO> dataDictionaryPageList = dataDictionaryMapper.listViolationPage(dataDictionaryPage, keyWord);
        return dataDictionaryPageList;
ycl-platform/src/main/java/com/ycl/util/CheckApiUtil.java
@@ -44,9 +44,15 @@
            sb.append("&streetId=");
            sb.append(params.getStreetId());
        }
        if (params.getPageIndex() != null && params.getPageSize() != null) {
            sb.append("&pageIndex=");
            sb.append(params.getPageIndex());
            sb.append("&pageSize=");
            sb.append(params.getPageSize());
        }
        result = MD5Util.md5Encrypt32Lower(sb.toString());
         if (!params.getSign().equals(result)) {
             throw new ApiException(ResultCode.SIGN_ERROR);
         }
        // if (!params.getSign().equals(result)) {
        //     throw new ApiException(ResultCode.SIGN_ERROR);
        // }
    }
}
ycl-platform/src/main/java/com/ycl/util/VideoUtil.java
@@ -114,6 +114,7 @@
            return objectMapper.readTree(monitorReq.getBody()).get("url").textValue();
        } catch (Exception ex) {
            System.out.println("获取视频异常:" + ex);
            return "获取地址失败,请检查code值";
        }
    }
ycl-platform/src/main/java/com/ycl/vo/cockpit/enforcementEvents/EnforcementEventsVO.java
@@ -40,5 +40,7 @@
        private Integer identification;
        @ApiModelProperty(value = "具体事件的数据信息")
        private List<EventVO> event;
        @ApiModelProperty(value = "具体事件的数据信息")
        private Long total;
    }
}
ycl-platform/src/main/java/com/ycl/vo/cockpit/statisticsEvents/StatisticsEventsVO.java
@@ -4,6 +4,7 @@
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
@@ -109,6 +110,7 @@
    @ApiModel(description = "AI算法")
    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class ArithmeticVO {
        @ApiModelProperty(value = "类型")
        private String name;
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/apidata/ApiDataMapper.xml
@@ -5,17 +5,47 @@
    <select id="listTop10" resultType="com.ycl.vo.cockpit.statisticsEvents.StatisticsEventsVO$Top10VO">
        SELECT NAME
                ,
               IFNULL(month_index_number,0) month_index_number
        ,
        IFNULL(month_index_number,0) month_index_number
        FROM
            ums_team_construction
        ums_team_construction
        <where>
            <if test="beginTime !='' and endTime !='' and beginTime!=null and endTime !=null">
                and create_time between #{beginTime} and #{endTime}
            </if>
        </where>
        ORDER BY
            month_index_number DESC
            LIMIT 10
        month_index_number DESC
        LIMIT 10
    </select>
    <select id="arithmeticEvent"
            resultType="com.ycl.vo.cockpit.statisticsEvents.StatisticsEventsVO$ArithmeticVO">
        SELECT dd.`name` ,COUNT(v.id) count
        from ums_violations v
        INNER JOIN ums_data_dictionary dd on v.grade_id = dd.id
        INNER JOIN ums_base_case b on b.id = v.id
        WHERE v.video_alarm_report_id is not NULL
        <if test="beginTime !='' and endTime !='' and beginTime!=null and endTime !=null">
            and create_time between #{beginTime} and #{endTime}
        </if>
        <if test="streetId !=null ">
            and b.street_id = #{streetId}
        </if>
        GROUP BY v.grade_id
    </select>
    <select id="listLot" resultType="com.ycl.vo.cockpit.statisticsEvents.StatisticsEventsVO$LotVO">
        SELECT vp.`name` ,COUNT(v.id) count
        from ums_violations v
            INNER JOIN ums_data_dictionary dd on v.grade_id = dd.id
            INNER JOIN ums_base_case b on b.id = v.id
            INNER JOIN ums_video_point vp on v.video_point_id = vp.id
        WHERE v.video_alarm_report_id is not NULL
        <if test="beginTime !='' and endTime !='' and beginTime!=null and endTime !=null">
            and create_time between #{beginTime} and #{endTime}
        </if>
        <if test="streetId !=null ">
            and b.street_id = #{streetId}
        </if>
        GROUP BY v.video_point_id
    </select>
</mapper>
ycl-platform/src/main/resources/mapper/caseHandler/BaseCaseMapper.xml
@@ -259,27 +259,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">
@@ -322,9 +332,8 @@
        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.event_source = 1 THEN "视频巡查" WHEN t1.event_source = 2 THEN "人工上报" ELSE "其他" END ) AS source,
        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,
        t2.description,
        t3.`name` AS point,
@@ -340,14 +349,15 @@
        WHEN t1.state = 7 THEN '处置'
        WHEN t1.state = 8 THEN '核查'
        WHEN t1.state = 9 THEN '结案'
        END) `status` ,
        dd.`name` as grade
        END) `alarmAdvice` ,
        pdd.`name` as grade
        FROM
        ums_base_case t1
        LEFT JOIN ums_violations t2 ON t1.id = t2.id
        LEFT JOIN ums_video_point t3 ON t3.id = t2.video_point_id
        LEFT JOIN ums_video_alarm_report t4 ON t4.id = t2.video_alarm_report_id
        LEFT JOIN ums_data_dictionary dd on t2.grade_id = dd.id
        LEFT JOIN ums_data_dictionary pdd on pdd.id = dd.parent_id
        <where>
            t1.category=1
            <if test="beginTime !=''and beginTime!=null and endTime!=''and endTime!=null">
@@ -356,7 +366,7 @@
            </if>
        </where>
        order by t1.id desc
    </select>
    <select id="areaCount" resultType="com.ycl.vo.cockpit.enforcementEvents.VideoAndAreaVO">
        SELECT t2.region_name name,
ycl-smoke/src/main/java/com/ycl/smoke/controller/smoke/SmokeController.java
@@ -36,7 +36,7 @@
        SmokeResultResponseDto responseDto = JSON.parseObject(json, SmokeResultResponseDto.class);
        if (responseDto.getStatus() == 200) {
            LoginResponseDto loginResponseDto = JSON.parseObject(responseDto.getData().toString(), LoginResponseDto.class);
            System.out.println(loginResponseDto.getToken());
            // System.out.println(loginResponseDto.getToken());
            redisService.set(RedisKey.SMOKE_TOKEN, loginResponseDto.getToken());
            return "登录成功";
        } else {
ycl-smoke/src/main/java/com/ycl/smoke/task/ScheduledTask.java
@@ -98,7 +98,7 @@
            if (responseDto.getStatus() == 200) {
                AlarmMsgResponseDto dto = JSON.parseObject(responseDto.getData().toString(), AlarmMsgResponseDto.class);
                List<OdsAlarmMsg> list = dto.getContent();
                System.out.println(list.size());
                // System.out.println(list.size());
                list.forEach(o -> {
                    try {
                        alarmMsgService.save(o);