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 文件已重命名
| | |
| | | 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()); |
| | |
| | | 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; |
| | |
| | | @Resource |
| | | private UmsDepartMapper sccgDepartMapper; |
| | | @Resource |
| | | private DataDictionaryMapper dataDictionaryMapper; |
| | | private DataDictionary2Mapper dataDictionary2Mapper; |
| | | @ApiOperation("部门导入") |
| | | @PostMapping("/import") |
| | | public CommonResult importDpt(MultipartFile file) throws IOException { |
| | |
| | | // 设置部门描述 |
| | | 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 { |
| | |
| | | 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; |
| | |
| | | @Resource |
| | | private UmsAdminMapper umsAdminMapper; |
| | | @Resource |
| | | private DataDictionaryMapper dataDictionaryMapper; |
| | | private DataDictionary2Mapper dataDictionary2Mapper; |
| | | @Resource |
| | | private UmsDepartMapper umsDepartMapper; |
| | | @ApiOperation("用户导入") |
| | |
| | | } |
| | | |
| | | 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 { |
| | |
| | | @Getter |
| | | @Setter |
| | | public class UmsAdminParam { |
| | | @ApiModelProperty(value = "用户名", required = false) |
| | | private Long id; |
| | | @NotBlank(message = "用户名不能为空") |
| | | @ApiModelProperty(value = "用户名", required = true) |
| | | private String username; |
| | |
| | | @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; |
| | | |
| | |
| | | |
| | | @ApiModelProperty(value = "ip地址") |
| | | private String ipAddress; |
| | | |
| | | @ApiModelProperty(value = "有效天数") |
| | | private Integer days; |
| | | } |
| | |
| | | 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; |
| | |
| | | @ApiModelProperty(value = "最后登录时间") |
| | | private Date loginTime; |
| | | |
| | | @ApiModelProperty(value = "账号有效期") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date expirationDate; |
| | | |
| | | @ApiModelProperty(value = "帐号启用状态:0->禁用;1->启用") |
| | | private Integer status; |
| | | |
| | |
| | | @ApiModelProperty(value = "部门名称") |
| | | @TableField(exist = false) |
| | | private String departName; |
| | | |
| | | |
| | | |
| | | @ApiModelProperty(value = "用户类型") |
File was renamed from ycl-common/src/main/java/com/ycl/mapper/dict/DataDictionaryMapper.java |
| | |
| | | * @author lyq |
| | | * @since 2022-09-15 |
| | | */ |
| | | public interface DataDictionaryMapper extends BaseMapper<DataDictionary> { |
| | | public interface DataDictionary2Mapper extends BaseMapper<DataDictionary> { |
| | | |
| | | } |
| | |
| | | */ |
| | | 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(); |
| | | |
| | |
| | | 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); |
| | | } |
| | |
| | | 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; |
| | |
| | | IDepartManagerService iDepartManagerService; |
| | | @Resource |
| | | UmsDepartService umsDepartService; |
| | | @Resource |
| | | DataDictionaryMapper dataDictionaryMapper; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | 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; |
| | | |
| | |
| | | // 这里设置图片有效时间 我设置了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 |
| | |
| | | // 上传文件流 |
| | | 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的方法实现长传 |
| | |
| | | // 这里设置图片有效时间 我设置了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); |
| | | } |
| | | } |
| | | |
| | |
| | | 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; |
| | |
| | | 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; |
| | | |
| | |
| | | |
| | | @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); |
| | |
| | | //查询是否有相同用户名的用户 |
| | | 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; |
| | |
| | | //将密码进行加密操作 |
| | | 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()) { |
| | |
| | | umsAdminRoleRelationService.saveBatch(roleIds); |
| | | } |
| | | |
| | | umsDepartManageMapper.deletedByDepartId(umsAdmin.getId()); |
| | | |
| | | //添加部门 |
| | | UmsDepartManage departManage = new UmsDepartManage(); |
| | | departManage.setUserId(umsAdmin.getId()); |
| | |
| | | departManage.setUpdateTime(new Date()); |
| | | umsDepartManageMapper.insert(departManage); |
| | | |
| | | baseMapper.updateById(umsAdmin); |
| | | // baseMapper.updateById(umsAdmin); |
| | | return umsAdmin; |
| | | } |
| | | |
| | |
| | | //将密码进行加密操作 |
| | | 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); |
| | |
| | | if (!userDetails.isEnabled()) { |
| | | Asserts.fail("帐号已被禁用"); |
| | | } |
| | | |
| | | UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(userDetails, null, userDetails.getAuthorities()); |
| | | SecurityContextHolder.getContext().setAuthentication(authentication); |
| | | //根据用户id,用户姓名 |
| | |
| | | && !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<>(); |
| | |
| | | //获取用户信息 |
| | | 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); |
| | | } |
| | |
| | | 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 |
| | |
| | | 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(); |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | @Resource |
| | | private UmsResourceMapper umsResourceMapper; |
| | | @Resource |
| | | private DataDictionaryMapper dataDictionaryMapper; |
| | | private DataDictionary2Mapper dataDictionary2Mapper; |
| | | |
| | | @Override |
| | | public boolean create(UmsRole role) { |
| | |
| | | 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())) { |
| | |
| | | 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; |
| | | } |
| | |
| | | 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(); |
| | | } |
| | |
| | | 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; |
| | | |
| | |
| | | @Resource |
| | | private UmsDepartMapper sccgDepartMapper; |
| | | @Resource |
| | | private DataDictionaryMapper dataDictionaryMapper; |
| | | private DataDictionary2Mapper dataDictionary2Mapper; |
| | | |
| | | // private static DepartListener departListener; |
| | | // |
| | |
| | | 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 { |
| | |
| | | @Data |
| | | @ApiModel |
| | | public class CockpitVO { |
| | | // @Data |
| | | // @Data |
| | | // @ApiModel |
| | | // public class Params1VO implements Serializable { |
| | | // @ApiModelProperty(value = "appId", example = "1") |
| | |
| | | // @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; |
| | | // } |
| | | } |
New file |
| | |
| | | <?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> |
| | |
| | | <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"> |
| | |
| | | <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> |
| | | |
| | |
| | | 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},'%') |
| | |
| | | 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, |
| | |
| | | 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> |
| | |
| | | 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 |
| | |
| | | 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)); |
| | | } |
| | | } |
| | |
| | | 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)); |
| | | } |
| | | } |
| | |
| | | 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+"分"; |
| | |
| | | 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)); |
| | | } |
| | | } |
| | |
| | | |
| | | 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"); |
| | | } |
| | |
| | | |
| | | @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") |
| | |
| | | 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)); |
| | | } |
| | | |
| | | /** |
| | |
| | | **/ |
| | | @ApiOperation(value = "删除违建类型") |
| | | @DeleteMapping("/delete") |
| | | @LogSave(operationType = "运营基础设置",contain = "删除违建事项") |
| | | @LogSave(operationType = "运营基础设置", contain = "删除违建事项") |
| | | public CommonResult removeIllegalBuilding(@RequestParam Integer id) { |
| | | return CommonResult.success(iDataDictionaryService.removeById(id)); |
| | | } |
| | |
| | | **/ |
| | | @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))); |
| | | } |
| | |
| | | **/ |
| | | @ApiOperation(value = "添加所属类型/类别") |
| | | @PostMapping("/addition/type") |
| | | @LogSave(operationType = "运营基础设置",contain = "添加违建事项") |
| | | @LogSave(operationType = "运营基础设置", contain = "添加违建事项") |
| | | public CommonResult addIllegalBuildingTypeFirst(@RequestBody @Validated DataDictionary dataDictionary) { |
| | | return CommonResult.success(iDataDictionaryService.save(dataDictionary)); |
| | | } |
| | |
| | | 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)); |
| | | } |
| | | |
| | | /** |
| | |
| | | **/ |
| | | @ApiOperation(value = "删除违规类型") |
| | | @DeleteMapping("/delete") |
| | | @LogSave(operationType = "运营基础设置",contain = "删除违规事项") |
| | | @LogSave(operationType = "运营基础设置", contain = "删除违规事项") |
| | | public CommonResult removeViolation(@RequestParam Integer id) { |
| | | return CommonResult.success(iDataDictionaryService.removeById(id)); |
| | | } |
| | |
| | | **/ |
| | | @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))); |
| | |
| | | **/ |
| | | @ApiOperation(value = "添加所属类型/大类/小类/案由") |
| | | @PostMapping("/addition/type") |
| | | @LogSave(operationType = "运营基础设置",contain = "添加违规事项") |
| | | @LogSave(operationType = "运营基础设置", contain = "添加违规事项") |
| | | public CommonResult addViolationType(@RequestBody @Validated DataDictionary dataDictionary) { |
| | | return CommonResult.success(iDataDictionaryService.save(dataDictionary)); |
| | | } |
| | |
| | | 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); |
| | | } |
| | | |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | 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); |
| | |
| | | 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); |
| | | } |
| | | } |
| | |
| | | private IApiDataService iApiDataService; |
| | | |
| | | @Autowired |
| | | public void setIApiDataService(IApiDataService apiDataService){ |
| | | public void setIApiDataService(IApiDataService apiDataService) { |
| | | this.iApiDataService = apiDataService; |
| | | } |
| | | |
| | |
| | | @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); |
| | | } |
| | | |
| | |
| | | @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); |
| | | } |
| | | |
| | |
| | | |
| | | 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 |
| | |
| | | @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); |
| | |
| | | |
| | | 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字符串 |
| | |
| | | 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(); |
| | | } |
| | |
| | | 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); |
| | | } |
| | |
| | | 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; |
| | |
| | | |
| | | 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(); |
| | | |
| | |
| | | |
| | | Integer dispatchCount(); |
| | | |
| | | List<EventVO> selectEventList(String beginTime, String endTime); |
| | | IPage<EventVO> selectEventList(IPage<EventVO> page, String beginTime, String endTime); |
| | | |
| | | Integer alCount(); |
| | | |
| | |
| | | |
| | | List<EfficiencyDto> list(); |
| | | |
| | | List<AIIotStatisticsVO> aiMonthList(); |
| | | List<AIIotStatisticsVO> aiMonthList(String beginTime, String endTime); |
| | | |
| | | Long getSmokeCustomer(); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<AIIotStatisticsVO> aiMonthList() { |
| | | return efficiencyMapper.aiMonthList(); |
| | | public List<AIIotStatisticsVO> aiMonthList(String beginTime, String endTime) { |
| | | return efficiencyMapper.aiMonthList(beginTime, endTime); |
| | | } |
| | | |
| | | @Override |
| | |
| | | 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); |
| | | } |
| | |
| | | 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 { |
| | |
| | | |
| | | 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); |
| | | } |
| | | } |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | */ |
| | | 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); |
| | | |
| | |
| | | |
| | | 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(); |
| | | |
| | |
| | | |
| | | 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(); |
| | | } |
| | |
| | | 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; |
| | |
| | | } |
| | | |
| | | @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()); |
| | |
| | | } |
| | | |
| | | @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); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @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 |
| | |
| | | } |
| | | |
| | | @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 |
| | |
| | | baseCase.setCommunityId(videoPoint.getCommunityId()); |
| | | baseCase.setSite(videoPoint.getAddress()); |
| | | baseCase.setGridId(videoPoint.getGridId()); |
| | | baseCase.setSite(videoPoint.getAddress()); |
| | | |
| | | baseCaseService.save(baseCase); |
| | | violations.setId(baseCase.getId()); |
| | |
| | | */ |
| | | 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); |
| | | } |
| | |
| | | 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; |
| | |
| | | } |
| | | |
| | | @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; |
| | |
| | | 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); |
| | | // } |
| | | } |
| | | } |
| | |
| | | return objectMapper.readTree(monitorReq.getBody()).get("url").textValue(); |
| | | |
| | | } catch (Exception ex) { |
| | | System.out.println("获取视频异常:" + ex); |
| | | return "获取地址失败,请检查code值"; |
| | | } |
| | | } |
| | |
| | | private Integer identification; |
| | | @ApiModelProperty(value = "具体事件的数据信息") |
| | | private List<EventVO> event; |
| | | @ApiModelProperty(value = "具体事件的数据信息") |
| | | private Long total; |
| | | } |
| | | } |
| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | |
| | | @ApiModel(description = "AI算法") |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public static class ArithmeticVO { |
| | | @ApiModelProperty(value = "类型") |
| | | private String name; |
| | |
| | | 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 |
| | |
| | | |
| | | <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> |
| | |
| | | </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"> |
| | |
| | | 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, |
| | |
| | | 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"> |
| | |
| | | </if> |
| | | |
| | | </where> |
| | | |
| | | order by t1.id desc |
| | | </select> |
| | | <select id="areaCount" resultType="com.ycl.vo.cockpit.enforcementEvents.VideoAndAreaVO"> |
| | | SELECT t2.region_name name, |
| | |
| | | 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 { |
| | |
| | | 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); |