Merge remote-tracking branch 'origin/master'
| | |
| | | //车辆、人脸考核,点位在线率,区县不少于40路 |
| | | public final static Integer Check_Car_SiteOnline = 40; |
| | | public final static Integer Check_Face_SiteOnline = 40; |
| | | //车辆、人脸在线率 Redis 每月数据中断次数 Hash key |
| | | public final static String Check_Car_ViewConnect = "CarViewConnectNoData"; |
| | | public final static String Check_Face_ViewConnect = "FaceViewConnectNoData"; |
| | | |
| | | } |
| | |
| | | public class RedisConstant { |
| | | /** 一机一档目录一致率 多出来的设备 Set集合 */ |
| | | public static final String New_Monitor_Set="New_Monitor_Set"; |
| | | //车辆、人脸在线率 Redis 每月数据中断次数 Hash key |
| | | public final static String Check_Car_ViewConnect = "CarViewConnectNoData"; |
| | | public final static String Check_Face_ViewConnect = "FaceViewConnectNoData"; |
| | | } |
New file |
| | |
| | | package com.ycl.platform.domain.entity; |
| | | |
| | | import annotation.Excel; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 合同规则记录对象 t_contract_rule_record |
| | | * |
| | | * @author ruoyi |
| | | * @date 2024-08-21 |
| | | */ |
| | | @Data |
| | | public class ContractRuleRecord |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** $column.columnComment */ |
| | | private Long id; |
| | | |
| | | /** 单位id */ |
| | | @Excel(name = "单位id") |
| | | private Long unitId; |
| | | |
| | | /** 点位在线率 */ |
| | | @Excel(name = "点位在线率") |
| | | private Integer siteOnline; |
| | | |
| | | /** 创建时间 */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | |
| | | private Long deleted; |
| | | } |
| | |
| | | import org.springframework.data.mongodb.core.index.TextIndexed; |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 卡口属性监测结果:车辆(车辆卡口信息采集准确率、) |
| | | * |
| | |
| | | private Integer lalType; |
| | | |
| | | /** |
| | | * 经纬度监测结果,表示经纬度信息的监测状态。 |
| | | * 1:正常 2:经纬度缺失 3:不在辖区 4:精度过低 |
| | | */ |
| | | private String lalTypeText; |
| | | |
| | | /** |
| | | * 国标编码监测结果,表示国标编码的监测状态。 |
| | | * 1:正常 2:编码长度不等于20位 3:前6位不符合标准 4:11至13位不符合标准 |
| | | */ |
| | | private Integer gbCodeType; |
| | | |
| | | /** |
| | | * 国标编码监测结果,表示国标编码的监测状态。 |
| | | * 1:正常 2:编码长度不等于20位 3:前6位不符合标准 4:11至13位不符合标准 |
| | | */ |
| | | private String gbCodeTypeText; |
| | | |
| | | public String getLalTypeText() { |
| | | if (Objects.equals(lalType, 1)) { |
| | | lalTypeText = "正常"; |
| | | } |
| | | if (Objects.equals(lalType, 2)) { |
| | | lalTypeText = "经纬度缺失"; |
| | | } |
| | | if (Objects.equals(lalType, 3)) { |
| | | lalTypeText = "不在辖区"; |
| | | } |
| | | if (Objects.equals(lalType, 4)) { |
| | | lalTypeText = "精度过低"; |
| | | } |
| | | return lalTypeText; |
| | | } |
| | | |
| | | public String getGbCodeTypeText() { |
| | | if (Objects.equals(gbCodeType, 1)) { |
| | | gbCodeTypeText = "正常"; |
| | | } |
| | | if (Objects.equals(gbCodeType, 2)) { |
| | | gbCodeTypeText = "编码长度不等于20位"; |
| | | } |
| | | if (Objects.equals(gbCodeType, 3)) { |
| | | gbCodeTypeText = "前6位不符合标准"; |
| | | } |
| | | if (Objects.equals(gbCodeType, 4)) { |
| | | gbCodeTypeText = "11至13位不符合标准"; |
| | | } |
| | | return gbCodeTypeText; |
| | | } |
| | | } |
| | |
| | | */ |
| | | private Integer snapResult; |
| | | |
| | | /** |
| | | * 抓拍数据量监测结果,1:正常 2:无数据 4:数据量少 |
| | | */ |
| | | private String snapResultText; |
| | | |
| | | // 以下为嵌套对象的字段 |
| | | |
| | | /** |
| | |
| | | */ |
| | | private SnapUnique snapUnique; |
| | | |
| | | public String getSnapResultText() { |
| | | if (snapResult == 1) { |
| | | snapResultText = "正常"; |
| | | } |
| | | if (snapResult == 2) { |
| | | snapResultText = "无数据"; |
| | | } |
| | | if (snapResult == 4) { |
| | | snapResultText = "数据量少"; |
| | | } |
| | | return snapResultText; |
| | | } |
| | | |
| | | // 内嵌对象定义 |
| | | |
| | | @Data |
| | |
| | | private Integer todayClockResult; |
| | | |
| | | /** |
| | | * 当日接收的当日抓拍数据时钟准确性判定结果:1是合格,0是不合格 |
| | | */ |
| | | private String todayClockResultText; |
| | | |
| | | /** |
| | | * 当日接收的全部抓拍数据中时钟准确数据量 |
| | | */ |
| | | private Integer allClockCount; |
| | |
| | | * 当日接收的全部抓拍数据中时钟准确性判定结果:1是合格,0是不合格 |
| | | */ |
| | | private Integer allClockResult; |
| | | |
| | | /** |
| | | * 当日接收的全部抓拍数据中时钟准确性判定结果:1是合格,0是不合格 |
| | | */ |
| | | private String allClockResultText; |
| | | |
| | | public String getTodayClockResultText() { |
| | | if (todayClockResult == 1) { |
| | | todayClockResultText = "合格"; |
| | | } |
| | | if (todayClockResult == 0) { |
| | | todayClockResultText = "不合格"; |
| | | } |
| | | return todayClockResultText; |
| | | } |
| | | |
| | | public String getAllClockResultText() { |
| | | if (allClockResult == 1) { |
| | | allClockResultText = "合格"; |
| | | } |
| | | if (allClockResult == 0) { |
| | | allClockResultText = "不合格"; |
| | | } |
| | | return allClockResultText; |
| | | } |
| | | } |
| | | |
| | | @Data |
| | |
| | | private Integer todayTimelyResult; |
| | | |
| | | /** |
| | | * 当日接收的当日抓拍数据及时性判定结果:1是合格,0是不合格 |
| | | */ |
| | | private String todayTimelyResultText; |
| | | |
| | | /** |
| | | * 当日接收的全部抓拍数据中延迟数据量 |
| | | */ |
| | | private Integer allDelayCount; |
| | |
| | | * 当日接收的全部抓拍数据中及时性判定结果:1是合格,0是不合格 |
| | | */ |
| | | private Integer allTimelyResult; |
| | | |
| | | /** |
| | | * 当日接收的全部抓拍数据中及时性判定结果:1是合格,0是不合格 |
| | | */ |
| | | private String allTimelyResultText; |
| | | |
| | | public String getTodayTimelyResultText() { |
| | | if (todayTimelyResult == 1) { |
| | | todayTimelyResultText = "合格"; |
| | | } |
| | | if (todayTimelyResult == 0) { |
| | | todayTimelyResultText = "不合格"; |
| | | } |
| | | return todayTimelyResultText; |
| | | } |
| | | |
| | | public String getAllTimelyResultText() { |
| | | if (allTimelyResult == 1) { |
| | | allTimelyResultText = "合格"; |
| | | } |
| | | if (allTimelyResult == 0) { |
| | | allTimelyResultText = "不合格"; |
| | | } |
| | | return allTimelyResultText; |
| | | } |
| | | } |
| | | |
| | | @Data |
| | |
| | | import org.springframework.data.mongodb.core.index.TextIndexed; |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 采集设备属性监测结果:人脸(人脸卡口信息采集准确率) |
| | | * |
| | |
| | | private Integer lalType; |
| | | |
| | | /** |
| | | * 经纬度监测结果,表示经纬度信息的监测状态。 |
| | | * 1:正常 2:经纬度缺失 3:不在辖区 4:精度过低 |
| | | */ |
| | | private String lalTypeText; |
| | | |
| | | /** |
| | | * 国标编码监测结果: 1:正常 2:编码长度不等于20位 3:前6位不符合标准 4:11至13位不符合标准 |
| | | */ |
| | | private Integer gbCodeType; |
| | | |
| | | /** |
| | | * 国标编码监测结果,表示国标编码的监测状态。 |
| | | * 1:正常 2:编码长度不等于20位 3:前6位不符合标准 4:11至13位不符合标准 |
| | | */ |
| | | private String gbCodeTypeText; |
| | | |
| | | /** |
| | | * 普通能力集 |
| | |
| | | */ |
| | | private String intelligentSet; |
| | | |
| | | |
| | | public String getLalTypeText() { |
| | | if (Objects.equals(lalType, 1)) { |
| | | lalTypeText = "正常"; |
| | | } |
| | | if (Objects.equals(lalType, 2)) { |
| | | lalTypeText = "经纬度缺失"; |
| | | } |
| | | if (Objects.equals(lalType, 3)) { |
| | | lalTypeText = "不在辖区"; |
| | | } |
| | | if (Objects.equals(lalType, 4)) { |
| | | lalTypeText = "精度过低"; |
| | | } |
| | | return lalTypeText; |
| | | } |
| | | |
| | | public String getGbCodeTypeText() { |
| | | if (Objects.equals(gbCodeType, 1)) { |
| | | gbCodeTypeText = "正常"; |
| | | } |
| | | if (Objects.equals(gbCodeType, 2)) { |
| | | gbCodeTypeText = "编码长度不等于20位"; |
| | | } |
| | | if (Objects.equals(gbCodeType, 3)) { |
| | | gbCodeTypeText = "前6位不符合标准"; |
| | | } |
| | | if (Objects.equals(gbCodeType, 4)) { |
| | | gbCodeTypeText = "11至13位不符合标准"; |
| | | } |
| | | return gbCodeTypeText; |
| | | } |
| | | |
| | | } |
| | |
| | | import org.springframework.data.mongodb.core.index.TextIndexed; |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 抓拍数据量监测结果:车辆(视图库对接稳定性、点位在线率、) |
| | | * |
| | |
| | | */ |
| | | private int resultType; |
| | | |
| | | /** |
| | | * 抓拍数据量监测结果 1:正常 2:无数据 3:数据突降 4:数据量少 |
| | | */ |
| | | private String resultTypeText; |
| | | |
| | | public String getResultTypeText() { |
| | | if (Objects.equals(resultType, 1)) { |
| | | resultTypeText = "正常"; |
| | | } |
| | | if (Objects.equals(resultType, 2)) { |
| | | resultTypeText = "无数据"; |
| | | } |
| | | if (Objects.equals(resultType, 3)) { |
| | | resultTypeText = "数据突降"; |
| | | } |
| | | if (Objects.equals(resultType, 4)) { |
| | | resultTypeText = "数据量少"; |
| | | } |
| | | return resultTypeText; |
| | | } |
| | | } |
| | |
| | | */ |
| | | private Integer snapResult; |
| | | |
| | | /** |
| | | * 抓拍数据量监测结果,1:正常 2:无数据 4:数据量少 |
| | | */ |
| | | private String snapResultText; |
| | | |
| | | // 以下为嵌套对象的字段 |
| | | |
| | | /** |
| | |
| | | */ |
| | | private Integrity integrity; |
| | | |
| | | public String getSnapResultText() { |
| | | if (snapResult == 1) { |
| | | snapResultText = "正常"; |
| | | } |
| | | if (snapResult == 2) { |
| | | snapResultText = "无数据"; |
| | | } |
| | | if (snapResult == 4) { |
| | | snapResultText = "数据量少"; |
| | | } |
| | | return snapResultText; |
| | | } |
| | | |
| | | // 内嵌对象定义 |
| | | |
| | | @Data |
| | |
| | | private Integer todayClockResult; |
| | | |
| | | /** |
| | | * 当日接收的当日抓拍数据时钟准确性判定结果:1是合格,0是不合格 |
| | | */ |
| | | private String todayClockResultText; |
| | | |
| | | /** |
| | | * 当日接收的全部抓拍数据时钟准确数据量 |
| | | */ |
| | | private Integer allClockCount; |
| | |
| | | * 当日接收的全部抓拍数据时钟准确性判定结果:1是合格,0是不合格 |
| | | */ |
| | | private Integer allClockResult; |
| | | |
| | | /** |
| | | * 当日接收的全部抓拍数据时钟准确性判定结果:1是合格,0是不合格 |
| | | */ |
| | | private String allClockResultText; |
| | | |
| | | public String getTodayClockResultText() { |
| | | if (todayClockResult == 1) { |
| | | todayClockResultText = "合格"; |
| | | } |
| | | if (todayClockResult == 0) { |
| | | todayClockResultText = "不合格"; |
| | | } |
| | | return todayClockResultText; |
| | | } |
| | | |
| | | public String getAllClockResultText() { |
| | | if (allClockResult == 1) { |
| | | allClockResultText = "合格"; |
| | | } |
| | | if (allClockResult == 0) { |
| | | allClockResultText = "不合格"; |
| | | } |
| | | return allClockResultText; |
| | | } |
| | | } |
| | | |
| | | @Data |
| | |
| | | private Integer todayTimelyResult; |
| | | |
| | | /** |
| | | * 当日接收的当日抓拍数据数据及时性判定结果:1是合格,0是不合格 |
| | | */ |
| | | private String todayTimelyResultText; |
| | | |
| | | /** |
| | | * 当日接收的全部数据延迟量 |
| | | */ |
| | | private Integer allDelayCount; |
| | |
| | | * 当日接收的全部数据及时性判定结果:1是合格,0是不合格 |
| | | */ |
| | | private Integer allTimelyResult; |
| | | |
| | | /** |
| | | * 当日接收的全部数据及时性判定结果:1是合格,0是不合格 |
| | | */ |
| | | private String allTimelyResultText; |
| | | |
| | | public String getTodayTimelyResultText() { |
| | | if (todayTimelyResult == 1) { |
| | | todayTimelyResultText = "合格"; |
| | | } |
| | | if (todayTimelyResult == 0) { |
| | | todayTimelyResultText = "不合格"; |
| | | } |
| | | return todayTimelyResultText; |
| | | } |
| | | |
| | | public String getAllTimelyResultText() { |
| | | if (allTimelyResult == 1) { |
| | | allTimelyResultText = "合格"; |
| | | } |
| | | if (allTimelyResult == 0) { |
| | | allTimelyResultText = "不合格"; |
| | | } |
| | | return allTimelyResultText; |
| | | } |
| | | } |
| | | |
| | | @Data |
| | |
| | | * 车牌识别异常:结果类型 1:正常 2:识别率低 3:昼夜识别率突变 |
| | | */ |
| | | private Integer recgResult; |
| | | |
| | | /** |
| | | * 车牌识别异常:结果类型 1:正常 2:识别率低 3:昼夜识别率突变 |
| | | */ |
| | | private String recgResultText; |
| | | |
| | | public String getRecgResultText() { |
| | | if (recgResult == 1) { |
| | | recgResultText = "正常"; |
| | | } |
| | | if (recgResult == 2) { |
| | | recgResultText = "识别率低"; |
| | | } |
| | | if (recgResult == 3) { |
| | | recgResultText = "昼夜识别率突变"; |
| | | } |
| | | return recgResultText; |
| | | } |
| | | } |
| | | |
| | | @Data |
| | |
| | | |
| | | import com.ycl.platform.domain.result.BaseResult; |
| | | import lombok.Data; |
| | | import org.apache.commons.lang3.ArrayUtils; |
| | | import org.springframework.data.mongodb.core.index.TextIndexed; |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | import utils.StringUtils; |
| | | |
| | | import java.util.Date; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 一机一档 |
| | |
| | | */ |
| | | private String SSBMHY; |
| | | |
| | | |
| | | public String getJKDWLX() { |
| | | if (Objects.equals(JKDWLX, "1")) { |
| | | this.JKDWLX = "一类视频监控点"; |
| | | } |
| | | if (Objects.equals(JKDWLX, "2")) { |
| | | this.JKDWLX = "二类视频监控点"; |
| | | } |
| | | if (Objects.equals(JKDWLX, "3")) { |
| | | this.JKDWLX = "三类视频监控点"; |
| | | } |
| | | if (Objects.equals(JKDWLX, "4")) { |
| | | this.JKDWLX = "公安内部视频监控点"; |
| | | } |
| | | if (Objects.equals(JKDWLX, "9")) { |
| | | this.JKDWLX = "其他点位"; |
| | | } |
| | | return JKDWLX; |
| | | } |
| | | |
| | | public String getSXJGNLX() { |
| | | List<String> sxjgnlx = new ArrayList<>(); |
| | | if (StringUtils.contains(SXJGNLX, "1")) { |
| | | sxjgnlx.add("视频监控"); |
| | | } |
| | | if (StringUtils.contains(SXJGNLX, "2")) { |
| | | sxjgnlx.add("车辆识别"); |
| | | } |
| | | if (StringUtils.contains(SXJGNLX, "3")) { |
| | | sxjgnlx.add("人员识别"); |
| | | } |
| | | if (!sxjgnlx.isEmpty()) { |
| | | this.SXJGNLX = String.join("/", sxjgnlx); |
| | | } |
| | | return SXJGNLX; |
| | | } |
| | | |
| | | public String getSBZT() { |
| | | if (Objects.equals(SBZT, "1")) { |
| | | this.SBZT = "在用"; |
| | | } |
| | | if (Objects.equals(SBZT, "2")) { |
| | | this.SBZT = "维修"; |
| | | } |
| | | if (Objects.equals(SBZT, "3")) { |
| | | this.SBZT = "拆除"; |
| | | } |
| | | return SBZT; |
| | | } |
| | | |
| | | public String getSBCS() { |
| | | if (Objects.equals(SBCS, "1")) { |
| | | this.SBCS = "海康威视"; |
| | | } |
| | | if (Objects.equals(SBCS, "2")) { |
| | | this.SBCS = "大华"; |
| | | } |
| | | if (Objects.equals(SBCS, "3")) { |
| | | this.SBCS = "天地伟业"; |
| | | } |
| | | if (Objects.equals(SBCS, "4")) { |
| | | this.SBCS = "科达"; |
| | | } |
| | | if (Objects.equals(SBCS, "5")) { |
| | | this.SBCS = "安讯士"; |
| | | } |
| | | if (Objects.equals(SBCS, "6")) { |
| | | this.SBCS = "博世"; |
| | | } |
| | | if (Objects.equals(SBCS, "7")) { |
| | | this.SBCS = "亚安"; |
| | | } |
| | | if (Objects.equals(SBCS, "8")) { |
| | | this.SBCS = "英飞拓"; |
| | | } |
| | | if (Objects.equals(SBCS, "9")) { |
| | | this.SBCS = "宇视"; |
| | | } |
| | | if (Objects.equals(SBCS, "10")) { |
| | | this.SBCS = "海信"; |
| | | } |
| | | if (Objects.equals(SBCS, "11")) { |
| | | this.SBCS = "中星电子"; |
| | | } |
| | | if (Objects.equals(SBCS, "12")) { |
| | | this.SBCS = "明景"; |
| | | } |
| | | if (Objects.equals(SBCS, "13")) { |
| | | this.SBCS = "联想"; |
| | | } |
| | | if (Objects.equals(SBCS, "14")) { |
| | | this.SBCS = "中兴"; |
| | | } |
| | | if (Objects.equals(SBCS, "99")) { |
| | | this.SBCS = "其他"; |
| | | } |
| | | return SBCS; |
| | | } |
| | | |
| | | public String getSXJLX() { |
| | | if (Objects.equals(SXJLX, "1")) { |
| | | this.SXJLX = "球机"; |
| | | } |
| | | if (Objects.equals(SXJLX, "2")) { |
| | | this.SXJLX = "半球"; |
| | | } |
| | | if (Objects.equals(SXJLX, "3")) { |
| | | this.SXJLX = "固定枪机"; |
| | | } |
| | | if (Objects.equals(SXJLX, "4")) { |
| | | this.SXJLX = "遥控枪机"; |
| | | } |
| | | if (Objects.equals(SXJLX, "5")) { |
| | | this.SXJLX = "卡口枪机"; |
| | | } |
| | | if (Objects.equals(SXJLX, "99")) { |
| | | this.SXJLX = "未知"; |
| | | } |
| | | return SXJLX; |
| | | } |
| | | |
| | | |
| | | public String getBGSX() { |
| | | if (Objects.equals(BGSX, "1")) { |
| | | this.BGSX = "无补光"; |
| | | } |
| | | if (Objects.equals(BGSX, "2")) { |
| | | this.BGSX = "红外补光"; |
| | | } |
| | | if (Objects.equals(BGSX, "3")) { |
| | | this.BGSX = "白光补光"; |
| | | } |
| | | if (Objects.equals(BGSX, "9")) { |
| | | this.BGSX = "其他补光"; |
| | | } |
| | | return BGSX; |
| | | } |
| | | |
| | | public String getSXJBMGS() { |
| | | if (Objects.equals(SXJBMGS, "1")) { |
| | | this.SXJBMGS = "MPEG-4"; |
| | | } |
| | | if (Objects.equals(SXJBMGS, "2")) { |
| | | this.SXJBMGS = "H.264"; |
| | | } |
| | | if (Objects.equals(SXJBMGS, "3")) { |
| | | this.SXJBMGS = "SVAC"; |
| | | } |
| | | if (Objects.equals(SXJBMGS, "4")) { |
| | | this.SXJBMGS = "H.265"; |
| | | } |
| | | return SXJBMGS; |
| | | } |
| | | |
| | | public String getSXJWZLX() { |
| | | List<String> wzlx = new ArrayList<>(); |
| | | if (StringUtils.isBlank(SXJWZLX)) { |
| | | return SXJWZLX; |
| | | } |
| | | String[] split = SXJWZLX.split("/"); |
| | | if (ArrayUtils.contains(split, "1")) { |
| | | wzlx.add("省际检查站"); |
| | | } |
| | | if (ArrayUtils.contains(split, "2")) { |
| | | wzlx.add("党政机关"); |
| | | } |
| | | if (ArrayUtils.contains(split, "3")) { |
| | | wzlx.add("车站码头"); |
| | | } |
| | | if (ArrayUtils.contains(split, "4")) { |
| | | wzlx.add("中心广场"); |
| | | } |
| | | if (ArrayUtils.contains(split, "5")) { |
| | | wzlx.add("体育场馆"); |
| | | } |
| | | if (ArrayUtils.contains(split, "6")) { |
| | | wzlx.add("商业中心"); |
| | | } |
| | | if (ArrayUtils.contains(split, "7")) { |
| | | wzlx.add("宗教场所"); |
| | | } |
| | | if (ArrayUtils.contains(split, "8")) { |
| | | wzlx.add("校园周边"); |
| | | } |
| | | if (ArrayUtils.contains(split, "9")) { |
| | | wzlx.add("治安复杂区域"); |
| | | } |
| | | if (ArrayUtils.contains(split, "10")) { |
| | | wzlx.add("交通干线"); |
| | | } |
| | | if (ArrayUtils.contains(split, "11")) { |
| | | wzlx.add("医院周边"); |
| | | } |
| | | if (ArrayUtils.contains(split, "12")) { |
| | | wzlx.add("金融机构周边"); |
| | | } |
| | | if (ArrayUtils.contains(split, "13")) { |
| | | wzlx.add("危险物品场所周边"); |
| | | } |
| | | if (ArrayUtils.contains(split, "14")) { |
| | | wzlx.add("博物馆展览馆"); |
| | | } |
| | | if (ArrayUtils.contains(split, "15")) { |
| | | wzlx.add("重点水域、航道"); |
| | | } |
| | | if (ArrayUtils.contains(split, "96")) { |
| | | wzlx.add("市际公安检查站"); |
| | | } |
| | | if (ArrayUtils.contains(split, "97")) { |
| | | wzlx.add("涉外场所"); |
| | | } |
| | | if (ArrayUtils.contains(split, "98")) { |
| | | wzlx.add("边境沿线"); |
| | | } |
| | | if (ArrayUtils.contains(split, "99")) { |
| | | wzlx.add("旅游景区"); |
| | | } |
| | | this.SXJWZLX = String.join("/", wzlx); |
| | | return SXJWZLX; |
| | | } |
| | | |
| | | public String getJSFW() { |
| | | if (Objects.equals(JSFW, "1")) { |
| | | this.JSFW = "东"; |
| | | } |
| | | if (Objects.equals(JSFW, "2")) { |
| | | this.JSFW = "西"; |
| | | } |
| | | if (Objects.equals(JSFW, "3")) { |
| | | this.JSFW = "南"; |
| | | } |
| | | if (Objects.equals(JSFW, "4")) { |
| | | this.JSFW = "北"; |
| | | } |
| | | if (Objects.equals(JSFW, "5")) { |
| | | this.JSFW = "东南"; |
| | | } |
| | | if (Objects.equals(JSFW, "6")) { |
| | | this.JSFW = "东北"; |
| | | } |
| | | if (Objects.equals(JSFW, "7")) { |
| | | this.JSFW = "西南"; |
| | | } |
| | | if (Objects.equals(JSFW, "8")) { |
| | | this.JSFW = "西北"; |
| | | } |
| | | if (Objects.equals(JSFW, "9")) { |
| | | this.JSFW = "全向"; |
| | | } |
| | | return JSFW; |
| | | } |
| | | |
| | | public String getLWSX() { |
| | | if (Objects.equals(LWSX, "0")) { |
| | | this.LWSX = "已联网"; |
| | | } |
| | | if (Objects.equals(LWSX, "1")) { |
| | | this.LWSX = "未联网"; |
| | | } |
| | | return LWSX; |
| | | } |
| | | |
| | | public String getSSBMHY() { |
| | | List<String> ssbmhy = new ArrayList<>(); |
| | | if (StringUtils.isBlank(SSBMHY)) { |
| | | return SSBMHY; |
| | | } |
| | | String[] split = SSBMHY.split("/"); |
| | | if (ArrayUtils.contains(split, "1")) { |
| | | ssbmhy.add("公安机关"); |
| | | } |
| | | if (ArrayUtils.contains(split, "2")) { |
| | | ssbmhy.add("环保部门"); |
| | | } |
| | | if (ArrayUtils.contains(split, "3")) { |
| | | ssbmhy.add("文博部门"); |
| | | } |
| | | if (ArrayUtils.contains(split, "4")) { |
| | | ssbmhy.add("医疗部门"); |
| | | } |
| | | if (ArrayUtils.contains(split, "5")) { |
| | | ssbmhy.add("旅游管理"); |
| | | } |
| | | if (ArrayUtils.contains(split, "6")) { |
| | | ssbmhy.add("新闻广电"); |
| | | } |
| | | if (ArrayUtils.contains(split, "7")) { |
| | | ssbmhy.add("食品医药监督管理部门"); |
| | | } |
| | | if (ArrayUtils.contains(split, "8")) { |
| | | ssbmhy.add("教育管理部门"); |
| | | } |
| | | if (ArrayUtils.contains(split, "9")) { |
| | | ssbmhy.add("检察院"); |
| | | } |
| | | if (ArrayUtils.contains(split, "10")) { |
| | | ssbmhy.add("法院"); |
| | | } |
| | | if (ArrayUtils.contains(split, "11")) { |
| | | ssbmhy.add("金融部门"); |
| | | } |
| | | if (ArrayUtils.contains(split, "12")) { |
| | | ssbmhy.add("交通部门"); |
| | | } |
| | | if (ArrayUtils.contains(split, "13")) { |
| | | ssbmhy.add("住房和城乡建设部门"); |
| | | } |
| | | if (ArrayUtils.contains(split, "14")) { |
| | | ssbmhy.add("水利部门"); |
| | | } |
| | | if (ArrayUtils.contains(split, "15")) { |
| | | ssbmhy.add("林业部门"); |
| | | } |
| | | if (ArrayUtils.contains(split, "16")) { |
| | | ssbmhy.add("安全生产监督部门"); |
| | | } |
| | | if (ArrayUtils.contains(split, "17")) { |
| | | ssbmhy.add("市政市容委"); |
| | | } |
| | | if (ArrayUtils.contains(split, "18")) { |
| | | ssbmhy.add("国土局"); |
| | | } |
| | | this.SSBMHY = String.join("/", ssbmhy); |
| | | return SSBMHY; |
| | | } |
| | | } |
| | |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | |
| | | import java.util.Date; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 录像可用性 |
| | |
| | | private Integer recordStatus; |
| | | |
| | | /** |
| | | * 录像完整状态,1:完整,0:间歇,-1:异常 |
| | | */ |
| | | private String recordStatusText; |
| | | |
| | | /** |
| | | * 统计时间,格式为日期字符串 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | |
| | | */ |
| | | private String tenantId; |
| | | |
| | | public String getRecordStatusText() { |
| | | if (Objects.equals(recordStatus, 1)) { |
| | | recordStatusText = "完整"; |
| | | } |
| | | if (Objects.equals(recordStatus, 0)) { |
| | | recordStatusText = "间歇"; |
| | | } |
| | | if (Objects.equals(recordStatus, -1)) { |
| | | recordStatusText = "异常"; |
| | | } |
| | | return recordStatusText; |
| | | } |
| | | } |
| | |
| | | */ |
| | | private Integer icmpStatus; |
| | | /** |
| | | * icmp状态 2/1/-1/0 全部/在线/离线/未知 |
| | | */ |
| | | private String icmpStatusText; |
| | | /** |
| | | * 最近icmp时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | |
| | | */ |
| | | private Integer status; |
| | | /** |
| | | * 在线状态 2/1/-1/0 全部/在线/离线/未知 |
| | | */ |
| | | private String statusText; |
| | | /** |
| | | * 省厅标签 |
| | | */ |
| | | private String tagStr; |
| | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date vqdTime; |
| | | |
| | | public String getIcmpStatusText() { |
| | | if (icmpStatus == 2) { |
| | | this.icmpStatusText = "全部"; |
| | | } |
| | | if (icmpStatus == 1) { |
| | | this.icmpStatusText = "在线"; |
| | | } |
| | | if (icmpStatus == -1) { |
| | | this.icmpStatusText = "离线"; |
| | | } |
| | | if (icmpStatus == 0) { |
| | | this.icmpStatusText = "未知"; |
| | | } |
| | | return icmpStatusText; |
| | | } |
| | | |
| | | public String getStatusText() { |
| | | if (status == 2) { |
| | | this.statusText = "全部"; |
| | | } |
| | | if (status == 1) { |
| | | this.statusText = "在线"; |
| | | } |
| | | if (status == -1) { |
| | | this.statusText = "离线"; |
| | | } |
| | | if (status == 0) { |
| | | this.statusText = "未知"; |
| | | } |
| | | return statusText; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ycl.platform.domain.vo; |
| | | |
| | | import enumeration.general.RuleDeductCategoryEnum; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class CalculateRuleVO { |
| | | |
| | | /** |
| | | * id |
| | | */ |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 合同id |
| | | */ |
| | | private Integer contractId; |
| | | |
| | | /** |
| | | * 规则名称 |
| | | */ |
| | | private String ruleName; |
| | | |
| | | /** |
| | | * 规则条件 |
| | | */ |
| | | private String ruleCondition; |
| | | |
| | | /** |
| | | * 违规最小值 |
| | | */ |
| | | private Double min; |
| | | |
| | | /** |
| | | * 违规最大值 |
| | | */ |
| | | private Double max; |
| | | |
| | | /** |
| | | * 扣减方式 扣指定分数/分数乘以数量/除以数量后乘以分数 |
| | | */ |
| | | private RuleDeductCategoryEnum deductCategory; |
| | | |
| | | /** |
| | | * 扣除分数 |
| | | */ |
| | | private Double calcFraction; |
| | | |
| | | /** |
| | | * 当方式为除以时,除以当前字段数量 |
| | | */ |
| | | private Integer calcUnit; |
| | | |
| | | private Date createTime; |
| | | private Date updateTime; |
| | | |
| | | private Integer deleted; |
| | | |
| | | private Integer unitId; |
| | | } |
| | |
| | | import constant.ApiConstants; |
| | | import constant.CheckSnapCountConstants; |
| | | import constant.CheckThreadConstants; |
| | | import constant.RedisConstant; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | |
| | | import java.math.RoundingMode; |
| | | import java.time.LocalDate; |
| | | import java.time.temporal.TemporalAdjusters; |
| | | import java.util.*; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.function.Function; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | // 判断今天是否是本月的第一天 |
| | | if (today.equals(firstDayOfMonth)) { |
| | | // 如果是,则清除Redis中记录中断次数的数据 |
| | | redisTemplate.delete(CheckThreadConstants.Check_Car_ViewConnect); |
| | | redisTemplate.delete(RedisConstant.Check_Car_ViewConnect); |
| | | } |
| | | for (SnapshotDataMonitorResult result : list) { |
| | | TMonitorVO monitor = monitorMap.get(result.getExternalIndexCode()); |
| | |
| | | } |
| | | //视图库对接稳定性 |
| | | //Redis记录该区县当月无数据上传次数 |
| | | Integer noDateCount = (Integer) redisTemplate.opsForHash().get(CheckThreadConstants.Check_Car_ViewConnect, key); |
| | | Integer noDateCount = (Integer) redisTemplate.opsForHash().get(RedisConstant.Check_Car_ViewConnect, key); |
| | | // 如果值为null,则初始化为0 |
| | | if (noDateCount == null) { |
| | | noDateCount = 0; |
| | |
| | | noDateCount++; |
| | | } |
| | | // 将新的值放回Hash中 |
| | | redisTemplate.opsForHash().put(CheckThreadConstants.Check_Car_ViewConnect, key, noDateCount); |
| | | redisTemplate.opsForHash().put(RedisConstant.Check_Car_ViewConnect, key, noDateCount); |
| | | return checkIndexCar; |
| | | } |
| | | } |
| | |
| | | import com.ycl.platform.service.ICheckIndexFaceService; |
| | | import com.ycl.platform.service.ITMonitorService; |
| | | import com.ycl.system.mapper.SysConfigMapper; |
| | | import constant.ApiConstants; |
| | | import constant.CheckConstants; |
| | | import constant.CheckSnapCountConstants; |
| | | import constant.CheckThreadConstants; |
| | | import constant.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | |
| | | // 判断今天是否是本月的第一天 |
| | | if (today.equals(firstDayOfMonth)) { |
| | | // 如果是,则清除Redis中记录中断次数的数据 |
| | | redisTemplate.delete(CheckThreadConstants.Check_Face_ViewConnect); |
| | | redisTemplate.delete(RedisConstant.Check_Face_ViewConnect); |
| | | } |
| | | for (SnapshotDataMonitorResult result : list) { |
| | | TMonitorVO monitor = monitorMap.get(result.getExternalIndexCode()); |
| | |
| | | } |
| | | //视图库对接稳定性 |
| | | //Redis记录该区县当月无数据上传次数 |
| | | Integer noDateCount = (Integer) redisTemplate.opsForHash().get(CheckThreadConstants.Check_Face_ViewConnect, key); |
| | | Integer noDateCount = (Integer) redisTemplate.opsForHash().get(RedisConstant.Check_Face_ViewConnect, key); |
| | | // 如果值为null,则初始化为0 |
| | | if (noDateCount == null) { |
| | | noDateCount = 0; |
| | |
| | | noDateCount++; |
| | | } |
| | | // 将新的值放回Hash中 |
| | | redisTemplate.opsForHash().put(CheckThreadConstants.Check_Face_ViewConnect, key, noDateCount); |
| | | redisTemplate.opsForHash().put(RedisConstant.Check_Face_ViewConnect, key, noDateCount); |
| | | return checkIndexFace; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ycl.platform.mapper; |
| | | |
| | | import com.ycl.platform.domain.entity.ContractRuleRecord; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 合同规则记录Mapper接口 |
| | | * |
| | | * @author ruoyi |
| | | * @date 2024-08-21 |
| | | */ |
| | | public interface ContractRuleRecordMapper |
| | | { |
| | | /** |
| | | * 查询合同规则记录 |
| | | * |
| | | * @param id 合同规则记录主键 |
| | | * @return 合同规则记录 |
| | | */ |
| | | public ContractRuleRecord selectContractRuleRecordById(Long id); |
| | | |
| | | /** |
| | | * 查询合同规则记录列表 |
| | | * |
| | | * @param contractRuleRecord 合同规则记录 |
| | | * @return 合同规则记录集合 |
| | | */ |
| | | public List<ContractRuleRecord> selectContractRuleRecordList(ContractRuleRecord contractRuleRecord); |
| | | |
| | | /** |
| | | * 新增合同规则记录 |
| | | * |
| | | * @param contractRuleRecord 合同规则记录 |
| | | * @return 结果 |
| | | */ |
| | | public int insertContractRuleRecord(ContractRuleRecord contractRuleRecord); |
| | | |
| | | public void insertBatch(@Param("list") List<ContractRuleRecord> list); |
| | | |
| | | /** |
| | | * 修改合同规则记录 |
| | | * |
| | | * @param contractRuleRecord 合同规则记录 |
| | | * @return 结果 |
| | | */ |
| | | public int updateContractRuleRecord(ContractRuleRecord contractRuleRecord); |
| | | |
| | | /** |
| | | * 删除合同规则记录 |
| | | * |
| | | * @param id 合同规则记录主键 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteContractRuleRecordById(Long id); |
| | | |
| | | /** |
| | | * 批量删除合同规则记录 |
| | | * |
| | | * @param ids 需要删除的数据主键集合 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteContractRuleRecordByIds(Long[] ids); |
| | | } |
| | |
| | | import com.ycl.platform.domain.query.ReportQuery; |
| | | import com.ycl.platform.domain.vo.ReportVO; |
| | | import com.ycl.platform.domain.form.ReportForm; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | * @return |
| | | */ |
| | | List<ReportVO> examineRecord(@Param("id") Integer id); |
| | | |
| | | List<String> selectNumberList(String status, String date); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ycl.platform.domain.entity.TContract; |
| | | import com.ycl.platform.domain.query.ContractQuery; |
| | | import com.ycl.platform.domain.vo.CalculateRuleVO; |
| | | import com.ycl.platform.domain.vo.ContractVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | IPage<ContractVO> getPage(IPage page, @Param("query") ContractQuery query); |
| | | |
| | | |
| | | List<CalculateRuleVO> selectByRuleName(String ruleName, String ruleCondition, Date date); |
| | | } |
| | |
| | | package com.ycl.platform.service.impl; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.ExcelWriter; |
| | | import com.alibaba.excel.write.metadata.WriteSheet; |
| | | import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ycl.platform.domain.entity.CalculateRecord; |
| | | import com.ycl.platform.domain.entity.CalculateReport; |
| | | import com.ycl.platform.domain.entity.CalculateRule; |
| | | import com.ycl.platform.domain.excel.CalculateExport; |
| | | import com.ycl.platform.domain.form.CalculateReportBackfillForm; |
| | | import com.ycl.platform.domain.form.CalculateReportForm; |
| | |
| | | import com.ycl.platform.mapper.CalculateRecordMapper; |
| | | import com.ycl.platform.mapper.CalculateReportMapper; |
| | | import com.ycl.platform.service.CalculateReportService; |
| | | import com.ycl.platform.service.ICalculateRuleService; |
| | | import com.ycl.system.Result; |
| | | import com.ycl.system.page.PageUtil; |
| | | import enumeration.general.CalculateReportStatusEnum; |
| | |
| | | @RequiredArgsConstructor |
| | | public class CalculateReportServiceImpl extends ServiceImpl<CalculateReportMapper, CalculateReport> implements CalculateReportService { |
| | | |
| | | private final CalculateReportMapper calculateReportMapper; |
| | | private final ICalculateRuleService calculateRuleService; |
| | | private final CalculateRecordMapper calculateRecordMapper; |
| | | |
| | | /** |
| | |
| | | calculateExport.setNum(list.stream().mapToInt(CalculateExport::getNum).sum()); |
| | | calculateExport.setScore(100 + list.stream().mapToInt(CalculateExport::getScore).sum()); |
| | | list.add(calculateExport); |
| | | // 获取规则 |
| | | List<CalculateRule> ruleList = calculateRuleService.list(new LambdaQueryWrapper<CalculateRule>().eq(CalculateRule::getContractId, contractId)); |
| | | // 输出文件 |
| | | response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); |
| | | response.setCharacterEncoding("utf-8"); |
| | | String fileName = URLEncoder.encode("核算报告", StandardCharsets.UTF_8).replace("\\+", "%20"); |
| | | response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); |
| | | EasyExcel.write(response.getOutputStream(), CalculateExport.class) |
| | | .sheet("核算报告") |
| | | .doWrite(list); |
| | | // 增加sheet |
| | | try (ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream()).build()){ |
| | | WriteSheet sheet = EasyExcel.writerSheet(0, "核算报告").head(CalculateExport.class).build(); |
| | | excelWriter.write(list, sheet); |
| | | WriteSheet sheet2 = EasyExcel.writerSheet(1, "核算规则").head(CalculateRule.class).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()).build(); |
| | | excelWriter.write(ruleList, sheet2); |
| | | } |
| | | } |
| | | } |
| | |
| | | ); |
| | | } |
| | | query.addCriteria(criteria); |
| | | long total = mongoTemplate.count(query, VideoOnlineResult.class); |
| | | query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); |
| | | List<VideoOnlineResult> resultList = mongoTemplate.find(query, VideoOnlineResult.class); |
| | | long total = mongoTemplate.count(query, VideoOnlineResult.class); |
| | | return Result.ok().data(resultList).total(total); |
| | | } |
| | | |
| | |
| | | ); |
| | | } |
| | | query.addCriteria(criteria); |
| | | long total = mongoTemplate.count(query, OneMachineFileResult.class); |
| | | query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); |
| | | List<OneMachineFileResult> resultList = mongoTemplate.find(query, OneMachineFileResult.class); |
| | | long total = mongoTemplate.count(query, OneMachineFileResult.class); |
| | | return Result.ok().data(resultList).total(total); |
| | | } |
| | | |
| | |
| | | ); |
| | | } |
| | | query.addCriteria(criteria); |
| | | long total = mongoTemplate.count(query, MonitorQualifyResult.class); |
| | | query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); |
| | | List<MonitorQualifyResult> resultList = mongoTemplate.find(query, MonitorQualifyResult.class); |
| | | long total = mongoTemplate.count(query, MonitorQualifyResult.class); |
| | | return Result.ok().data(resultList).total(total); |
| | | } |
| | | |
| | |
| | | ); |
| | | } |
| | | query.addCriteria(criteria); |
| | | long total = mongoTemplate.count(query, OneMachineFileResult.class); |
| | | query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); |
| | | List<OneMachineFileResult> resultList = mongoTemplate.find(query, OneMachineFileResult.class); |
| | | long total = mongoTemplate.count(query, OneMachineFileResult.class); |
| | | return Result.ok().data(resultList).total(total); |
| | | } |
| | | |
| | |
| | | ); |
| | | } |
| | | query.addCriteria(criteria); |
| | | long total = mongoTemplate.count(query, RecordMetaDSumResult.class); |
| | | query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); |
| | | List<RecordMetaDSumResult> resultList = mongoTemplate.find(query, RecordMetaDSumResult.class); |
| | | long total = mongoTemplate.count(query, RecordMetaDSumResult.class); |
| | | return Result.ok().data(resultList).total(total); |
| | | } |
| | | |
| | |
| | | ); |
| | | } |
| | | query.addCriteria(criteria); |
| | | long total = mongoTemplate.count(query, RecordMetaDSumResult.class); |
| | | query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); |
| | | List<RecordMetaDSumResult> resultList = mongoTemplate.find(query, RecordMetaDSumResult.class); |
| | | long total = mongoTemplate.count(query, RecordMetaDSumResult.class); |
| | | return Result.ok().data(resultList).total(total); |
| | | } |
| | | |
| | |
| | | ); |
| | | } |
| | | query.addCriteria(criteria); |
| | | long total = mongoTemplate.count(query, OneMachineFileResult.class); |
| | | query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); |
| | | List<OneMachineFileResult> resultList = mongoTemplate.find(query, OneMachineFileResult.class); |
| | | long total = mongoTemplate.count(query, OneMachineFileResult.class); |
| | | return Result.ok().data(resultList).total(total); |
| | | } |
| | | |
| | |
| | | ); |
| | | } |
| | | query.addCriteria(criteria); |
| | | long total = mongoTemplate.count(query, OneMachineFileResult.class); |
| | | query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); |
| | | List<OneMachineFileResult> resultList = mongoTemplate.find(query, OneMachineFileResult.class); |
| | | long total = mongoTemplate.count(query, OneMachineFileResult.class); |
| | | return Result.ok().data(resultList).total(total); |
| | | } |
| | | |
| | |
| | | ); |
| | | } |
| | | query.addCriteria(criteria); |
| | | long total = mongoTemplate.count(query, OneMachineFileResult.class); |
| | | query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); |
| | | List<OneMachineFileResult> resultList = mongoTemplate.find(query, OneMachineFileResult.class); |
| | | long total = mongoTemplate.count(query, OneMachineFileResult.class); |
| | | return Result.ok().data(resultList).total(total); |
| | | } |
| | | |
| | |
| | | ); |
| | | } |
| | | query.addCriteria(criteria); |
| | | long total = mongoTemplate.count(query, OneMachineFileResult.class); |
| | | query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); |
| | | List<OneMachineFileResult> resultList = mongoTemplate.find(query, OneMachineFileResult.class); |
| | | long total = mongoTemplate.count(query, OneMachineFileResult.class); |
| | | return Result.ok().data(resultList).total(total); |
| | | } |
| | | |
| | |
| | | ); |
| | | } |
| | | query.addCriteria(criteria); |
| | | long total = mongoTemplate.count(query, OneMachineFileResult.class); |
| | | query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); |
| | | List<OneMachineFileResult> resultList = mongoTemplate.find(query, OneMachineFileResult.class); |
| | | long total = mongoTemplate.count(query, OneMachineFileResult.class); |
| | | return Result.ok().data(resultList).total(total); |
| | | } |
| | | |
| | |
| | | ); |
| | | } |
| | | query.addCriteria(criteria); |
| | | long total = mongoTemplate.count(query, OneMachineFileResult.class); |
| | | query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); |
| | | List<OneMachineFileResult> resultList = mongoTemplate.find(query, OneMachineFileResult.class); |
| | | long total = mongoTemplate.count(query, OneMachineFileResult.class); |
| | | return Result.ok().data(resultList).total(total); |
| | | } |
| | | |
| | |
| | | ); |
| | | } |
| | | query.addCriteria(criteria); |
| | | long total = mongoTemplate.count(query, SnapshotDataMonitorResult.class); |
| | | query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); |
| | | List<SnapshotDataMonitorResult> resultList = mongoTemplate.find(query, SnapshotDataMonitorResult.class); |
| | | long total = mongoTemplate.count(query, SnapshotDataMonitorResult.class); |
| | | return Result.ok().data(resultList).total(total); |
| | | } |
| | | |
| | |
| | | ); |
| | | } |
| | | query.addCriteria(criteria); |
| | | long total = mongoTemplate.count(query, SnapshotDataMonitorResult.class); |
| | | query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); |
| | | List<SnapshotDataMonitorResult> resultList = mongoTemplate.find(query, SnapshotDataMonitorResult.class); |
| | | long total = mongoTemplate.count(query, SnapshotDataMonitorResult.class); |
| | | return Result.ok().data(resultList).total(total); |
| | | } |
| | | |
| | |
| | | ); |
| | | } |
| | | query.addCriteria(criteria); |
| | | long total = mongoTemplate.count(query, OneMachineFileResult.class); |
| | | query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); |
| | | List<OneMachineFileResult> resultList = mongoTemplate.find(query, OneMachineFileResult.class); |
| | | long total = mongoTemplate.count(query, OneMachineFileResult.class); |
| | | return Result.ok().data(resultList).total(total); |
| | | } |
| | | |
| | |
| | | ); |
| | | } |
| | | query.addCriteria(criteria); |
| | | long total = mongoTemplate.count(query, CrossDetailResult.class); |
| | | query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); |
| | | List<CrossDetailResult> resultList = mongoTemplate.find(query, CrossDetailResult.class); |
| | | long total = mongoTemplate.count(query, CrossDetailResult.class); |
| | | return Result.ok().data(resultList).total(total); |
| | | } |
| | | |
| | |
| | | ); |
| | | } |
| | | query.addCriteria(criteria); |
| | | long total = mongoTemplate.count(query, DataIntegrityMonitoringResult.class); |
| | | query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); |
| | | List<DataIntegrityMonitoringResult> resultList = mongoTemplate.find(query, DataIntegrityMonitoringResult.class); |
| | | long total = mongoTemplate.count(query, DataIntegrityMonitoringResult.class); |
| | | return Result.ok().data(resultList).total(total); |
| | | } |
| | | |
| | |
| | | ); |
| | | } |
| | | query.addCriteria(criteria); |
| | | long total = mongoTemplate.count(query, AttrRecognitionMonitorResult.class); |
| | | query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); |
| | | List<AttrRecognitionMonitorResult> resultList = mongoTemplate.find(query, AttrRecognitionMonitorResult.class); |
| | | long total = mongoTemplate.count(query, AttrRecognitionMonitorResult.class); |
| | | return Result.ok().data(resultList).total(total); |
| | | } |
| | | |
| | |
| | | ); |
| | | } |
| | | query.addCriteria(criteria); |
| | | long total = mongoTemplate.count(query, VehicleDeviceInspectionResult.class); |
| | | query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); |
| | | List<VehicleDeviceInspectionResult> resultList = mongoTemplate.find(query, VehicleDeviceInspectionResult.class); |
| | | long total = mongoTemplate.count(query, VehicleDeviceInspectionResult.class); |
| | | return Result.ok().data(resultList).total(total); |
| | | } |
| | | |
| | |
| | | ); |
| | | } |
| | | query.addCriteria(criteria); |
| | | long total = mongoTemplate.count(query, SnapshotDelayMonitorResult.class); |
| | | query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); |
| | | List<SnapshotDelayMonitorResult> resultList = mongoTemplate.find(query, SnapshotDelayMonitorResult.class); |
| | | long total = mongoTemplate.count(query, SnapshotDelayMonitorResult.class); |
| | | return Result.ok().data(resultList).total(total); |
| | | } |
| | | |
| | |
| | | ); |
| | | } |
| | | query.addCriteria(criteria); |
| | | long total = mongoTemplate.count(query, PicAccessResult.class); |
| | | query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); |
| | | List<PicAccessResult> resultList = mongoTemplate.find(query, PicAccessResult.class); |
| | | long total = mongoTemplate.count(query, PicAccessResult.class); |
| | | return Result.ok().data(resultList).total(total); |
| | | } |
| | | |
| | |
| | | ); |
| | | } |
| | | query.addCriteria(criteria); |
| | | long total = mongoTemplate.count(query, VehicleDeviceSamplingResult.class); |
| | | query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); |
| | | List<VehicleDeviceSamplingResult> resultList = mongoTemplate.find(query, VehicleDeviceSamplingResult.class); |
| | | long total = mongoTemplate.count(query, VehicleDeviceSamplingResult.class); |
| | | return Result.ok().data(resultList).total(total); |
| | | } |
| | | |
| | |
| | | ); |
| | | } |
| | | query.addCriteria(criteria); |
| | | long total = mongoTemplate.count(query, SnapshotDataMonitorResult.class); |
| | | query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); |
| | | List<SnapshotDataMonitorResult> resultList = mongoTemplate.find(query, SnapshotDataMonitorResult.class); |
| | | long total = mongoTemplate.count(query, SnapshotDataMonitorResult.class); |
| | | return Result.ok().data(resultList).total(total); |
| | | } |
| | | |
| | |
| | | ); |
| | | } |
| | | query.addCriteria(criteria); |
| | | long total = mongoTemplate.count(query, SnapshotDataMonitorResult.class); |
| | | query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); |
| | | List<SnapshotDataMonitorResult> resultList = mongoTemplate.find(query, SnapshotDataMonitorResult.class); |
| | | long total = mongoTemplate.count(query, SnapshotDataMonitorResult.class); |
| | | return Result.ok().data(resultList).total(total); |
| | | } |
| | | |
| | |
| | | ); |
| | | } |
| | | query.addCriteria(criteria); |
| | | long total = mongoTemplate.count(query, OneMachineFileResult.class); |
| | | query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); |
| | | List<OneMachineFileResult> resultList = mongoTemplate.find(query, OneMachineFileResult.class); |
| | | long total = mongoTemplate.count(query, OneMachineFileResult.class); |
| | | return Result.ok().data(resultList).total(total); |
| | | } |
| | | |
| | |
| | | ); |
| | | } |
| | | query.addCriteria(criteria); |
| | | long total = mongoTemplate.count(query, CrossDetailResult.class); |
| | | query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); |
| | | List<CrossDetailResult> resultList = mongoTemplate.find(query, CrossDetailResult.class); |
| | | long total = mongoTemplate.count(query, CrossDetailResult.class); |
| | | return Result.ok().data(resultList).total(total); |
| | | } |
| | | |
| | |
| | | ); |
| | | } |
| | | query.addCriteria(criteria); |
| | | long total = mongoTemplate.count(query, MonitoringDetailResult.class); |
| | | query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); |
| | | List<MonitoringDetailResult> resultList = mongoTemplate.find(query, MonitoringDetailResult.class); |
| | | long total = mongoTemplate.count(query, MonitoringDetailResult.class); |
| | | return Result.ok().data(resultList).total(total); |
| | | } |
| | | |
| | |
| | | ); |
| | | } |
| | | query.addCriteria(criteria); |
| | | long total = mongoTemplate.count(query, FaceDeviceInspectionResult.class); |
| | | query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); |
| | | List<FaceDeviceInspectionResult> resultList = mongoTemplate.find(query, FaceDeviceInspectionResult.class); |
| | | long total = mongoTemplate.count(query, FaceDeviceInspectionResult.class); |
| | | return Result.ok().data(resultList).total(total); |
| | | } |
| | | |
| | |
| | | ); |
| | | } |
| | | query.addCriteria(criteria); |
| | | long total = mongoTemplate.count(query, FaceDeviceInspectionResult.class); |
| | | query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); |
| | | List<FaceDeviceInspectionResult> resultList = mongoTemplate.find(query, FaceDeviceInspectionResult.class); |
| | | long total = mongoTemplate.count(query, FaceDeviceInspectionResult.class); |
| | | return Result.ok().data(resultList).total(total); |
| | | } |
| | | |
| | |
| | | ); |
| | | } |
| | | query.addCriteria(criteria); |
| | | long total = mongoTemplate.count(query, FaceDeviceSamplingResult.class); |
| | | query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); |
| | | List<FaceDeviceSamplingResult> resultList = mongoTemplate.find(query, FaceDeviceSamplingResult.class); |
| | | long total = mongoTemplate.count(query, FaceDeviceSamplingResult.class); |
| | | return Result.ok().data(resultList).total(total); |
| | | } |
| | | } |
| | |
| | | package com.ycl.task; |
| | | |
| | | |
| | | import com.ycl.platform.mapper.TContractMapper; |
| | | import com.ycl.platform.mapper.TMonitorMapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.mongodb.client.result.DeleteResult; |
| | | import com.ycl.platform.domain.entity.ContractRuleRecord; |
| | | import com.ycl.platform.domain.entity.Report; |
| | | import com.ycl.platform.domain.entity.TMonitor; |
| | | import com.ycl.platform.domain.entity.YwPoint; |
| | | import com.ycl.platform.domain.result.HK.SnapshotDataMonitorResult; |
| | | import com.ycl.platform.domain.result.UY.VideoOnlineResult; |
| | | import com.ycl.platform.domain.vo.CalculateRuleVO; |
| | | import com.ycl.platform.domain.vo.ContractVO; |
| | | import com.ycl.platform.domain.vo.ReportVO; |
| | | import com.ycl.platform.mapper.*; |
| | | import com.ycl.utils.DateUtils; |
| | | import constant.ApiConstants; |
| | | import constant.RedisConstant; |
| | | import enumeration.ContractRule; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.management.monitor.Monitor; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 合同考核定时任务 |
| | |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Autowired |
| | | private RedisTemplate redisTemplate; |
| | | @Autowired |
| | | private TMonitorMapper monitorMapper; |
| | | @Autowired |
| | | private TContractMapper contractMapper; |
| | | @Autowired |
| | | private YwPointMapper ywPointMapper; |
| | | @Autowired |
| | | private ReportMapper reportMapper; |
| | | @Autowired |
| | | private ContractRuleRecordMapper recordMapper; |
| | | |
| | | private static final Integer Online = 1; |
| | | private static final Integer Offline = -1; |
| | | private static final String AuditStatus_Pass = "1"; |
| | | |
| | | /** |
| | | * 合同考核 在线率每日任务检测 |
| | | * 查生效的合同关联的公司,获取unitId集合 |
| | | * 根据unitId查询对应点位获取各个公司管理的设备Ids |
| | | * 查询三种设备在线不在线情况,封装为一个map<国标码,在线状态> |
| | | * 计算每日每家公司的在线率存入redis |
| | | * 计算每日每家公司的在线率存入mysql |
| | | * 月底计算平均值,根据在线率和合同标准扣减分数 |
| | | */ |
| | | public void onlineCheck() { |
| | | // contractMapper.selectByRuleName(); |
| | | List<CalculateRuleVO> ruleVos = contractMapper.selectByRuleName(ContractRule.CONTRACT_RULE_Online.getName(), null, new Date()); |
| | | List<Integer> unitIds = ruleVos.stream().map(CalculateRuleVO::getUnitId).collect(Collectors.toList()); |
| | | List<YwPoint> ywPoints = ywPointMapper.selectList(new QueryWrapper<YwPoint>().in("unitId", unitIds)); |
| | | //key是unitId value是设备编码集合 |
| | | Map<Long, List<String>> unitMap = ywPoints.stream() |
| | | .collect(Collectors.groupingBy( |
| | | YwPoint::getUnitId, |
| | | Collectors.mapping( |
| | | YwPoint::getSerialNumber, |
| | | Collectors.toList() |
| | | ) |
| | | )); |
| | | Map<String, Integer> onlineStatusMap = new HashMap<>(); |
| | | //查mongo获取设备在线情况 |
| | | Date date = DateUtils.getDay(2024, 7, 13); |
| | | //车辆、人脸 |
| | | Query query = new Query(); |
| | | query.addCriteria(Criteria |
| | | .where("mongoCreateTime").gte(DateUtils.getDayStart(date)).lt(DateUtils.getDayEnd(date))); |
| | | List<SnapshotDataMonitorResult> results = mongoTemplate.find(query, SnapshotDataMonitorResult.class); |
| | | for (SnapshotDataMonitorResult result : results) { |
| | | if (ApiConstants.HK_SnapCount_ResultType_Null != result.getResultType()) { |
| | | onlineStatusMap.put(result.getExternalIndexCode(), Online); |
| | | } else { |
| | | onlineStatusMap.put(result.getExternalIndexCode(), Offline); |
| | | } |
| | | } |
| | | //视频 |
| | | Query videoQuery = new Query(Criteria |
| | | .where("mongoCreateTime").gte(DateUtils.getDayStart(date)).lt(DateUtils.getDayEnd(date))); |
| | | List<VideoOnlineResult> videoOnlineResults = mongoTemplate.find(videoQuery, VideoOnlineResult.class); |
| | | for (VideoOnlineResult videoOnlineResult : videoOnlineResults) { |
| | | onlineStatusMap.put(videoOnlineResult.getDeviceId(), videoOnlineResult.getStatus()); |
| | | } |
| | | //查询报备列表 |
| | | List<String> reportNumbers = reportMapper.selectNumberList(AuditStatus_Pass, DateUtils.getDate()); |
| | | //计算每个公司的点位在线率 |
| | | List<ContractRuleRecord> ruleRecordList = new ArrayList<>(); |
| | | unitMap.forEach((unitId, serialNumberList) -> { |
| | | int totalSite = 0; |
| | | int onlineSite = 0; |
| | | for (String number : serialNumberList) { |
| | | //报备过不纳入计算 |
| | | if (!CollectionUtils.isEmpty(reportNumbers) && reportNumbers.contains(number)) continue; |
| | | Integer status = onlineStatusMap.get(number); |
| | | totalSite++; |
| | | if (Online.equals(status)) { |
| | | onlineSite++; |
| | | } |
| | | } |
| | | ContractRuleRecord contractRuleRecord = new ContractRuleRecord(); |
| | | contractRuleRecord.setSiteOnline( onlineSite / totalSite); |
| | | contractRuleRecord.setCreateTime(new Date()); |
| | | contractRuleRecord.setUnitId(unitId); |
| | | ruleRecordList.add(contractRuleRecord); |
| | | }); |
| | | //存储结果 |
| | | recordMapper.insertBatch(ruleRecordList); |
| | | } |
| | | |
| | | } |
| | |
| | | import enumeration.general.AreaDeptEnum; |
| | | import enumeration.general.PointStatus; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void synchronize() { |
| | | log.info("开始同步mongodb一机一档到数据库"); |
| | | Date date = DateUtils.getDay(2024,7,13); |
| | | Date date = DateUtils.getDay(2024, 7, 13); |
| | | Query query = new Query(Criteria.where("mongoCreateTime").gte(DateUtils.getDayStart(date)).lt(DateUtils.getDayEnd(date))); |
| | | // Query query = new Query(Criteria.where("mongoCreateTime").gte(DateUtils.getDayStart(new Date())).lt(DateUtils.getDayEnd(new Date()))); |
| | | List<MonitorQualifyResult> oneMachineFileResults = mongoTemplate.find(query, MonitorQualifyResult.class); |
| | | //数据库monitor表数据 |
| | | Map<String, TMonitorVO> monitorVOMap = monitorMapper.selectMonitorVOList().stream().collect(Collectors.toMap(TMonitorVO::getSerialNumber, Function.identity())); |
| | | //准备插入设备表的数据 |
| | | List<TMonitor> monitorList = new ArrayList<>(); |
| | | //准备插入点位表的数据 |
| | | List<YwPoint> ywPointList = new ArrayList<>(); |
| | | //新的数据,原数据库中不存在的数据 |
| | | Set<TMonitor> newMonitorList = new HashSet<>(); |
| | | //点位数据 |
| | | Map<String, YwPoint> pointMap = ywPointService.list(new QueryWrapper<YwPoint>()).stream().collect(Collectors.toMap(YwPoint::getSerialNumber, Function.identity())); |
| | | |
| | | //重点点位集合字典(解析SXJCJQY字段) |
| | | SysDictData sysDictData = new SysDictData(); |
| | | sysDictData.setDictType("platform_important_site"); |
| | | List<SysDictData> DictDataList = dictDataService.selectDictDataList(sysDictData); |
| | | //采集区域为重点点位的集合 |
| | | List<String> importantSite = DictDataList.stream().map(SysDictData::getDictValue).collect(Collectors.toList()); |
| | | |
| | | //准备插入设备表的数据 |
| | | List<TMonitor> monitorList = new ArrayList<>(); |
| | | //准备插入点位表的数据 |
| | | List<YwPoint> ywPointList = new ArrayList<>(); |
| | | //新的数据,原数据库中不存在的数据 |
| | | Set<TMonitor> newMonitorList = new HashSet<>(); |
| | | |
| | | //全年留存 |
| | | for (MonitorQualifyResult result : oneMachineFileResults) { |
| | |
| | | newMonitorList.add(monitor); |
| | | } |
| | | } |
| | | //添加老数据 |
| | | List<String> numbers = CollectionUtils.isEmpty(monitorList) ? new ArrayList<>() : monitorList.stream().map(TMonitor::getSerialNumber).collect(Collectors.toList()); |
| | | monitorVOMap.forEach((key, value) -> { |
| | | if (!numbers.contains(key)){ |
| | | TMonitor monitor = new TMonitor(); |
| | | BeanUtils.copyProperties(value,monitor); |
| | | monitorList.add(monitor); |
| | | } |
| | | }); |
| | | List<String> points = CollectionUtils.isEmpty(ywPointList) ? new ArrayList<>() : ywPointList.stream().map(YwPoint::getSerialNumber).collect(Collectors.toList()); |
| | | pointMap.forEach((key, value) -> { |
| | | if (!points.contains(key)){ |
| | | ywPointList.add(value); |
| | | } |
| | | }); |
| | | |
| | | log.info("result集合{},设备集合{},点位集合{}", oneMachineFileResults.size(), monitorList.size(), ywPointList.size()); |
| | | //插入数据库 |
| | | if (!CollectionUtils.isEmpty(monitorList)) { |
| | |
| | | |
| | | <select id="exportData" resultType="com.ycl.platform.domain.excel.CalculateExport"> |
| | | SELECT |
| | | SUBSTRING_INDEX(rule_name, '/', 1) AS rule_name, |
| | | COUNT(*) AS num, |
| | | -SUM(score) AS score |
| | | FROM t_contract_score |
| | | WHERE contract_id = #{contractId} AND auditing_status = 'PASS' AND deleted = 0 |
| | | GROUP BY SUBSTRING_INDEX(rule_name, '/', 1) |
| | | a.rule_name, |
| | | COUNT(b.id) AS num, |
| | | IFNULL(-SUM(score), 0) AS score |
| | | FROM t_calculate_rule a |
| | | LEFT JOIN t_contract_score b ON b.rule_id = a.id AND auditing_status = 'PASS' AND b.deleted = 0 |
| | | WHERE a.contract_id = #{contractId} AND a.deleted = 0 |
| | | GROUP BY a.rule_name |
| | | </select> |
| | | |
| | | </mapper> |
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.platform.mapper.ContractRuleRecordMapper"> |
| | | |
| | | <resultMap type="com.ycl.platform.domain.entity.ContractRuleRecord" id="ContractRuleRecordResult"> |
| | | <result property="id" column="id"/> |
| | | <result property="unitId" column="unit_id"/> |
| | | <result property="siteOnline" column="site_online"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="deleted" column="deleted"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectContractRuleRecordVo"> |
| | | select id, unit_id, site_online, create_time, deleted |
| | | from t_contract_rule_record |
| | | </sql> |
| | | |
| | | <select id="selectContractRuleRecordList" resultMap="ContractRuleRecordResult"> |
| | | <include refid="selectContractRuleRecordVo"/> |
| | | <where> |
| | | <if test="unitId != null ">and unit_id = #{unitId}</if> |
| | | <if test="siteOnline != null ">and site_online = #{siteOnline}</if> |
| | | <if test="deleted != null ">and deleted = #{deleted}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectContractRuleRecordById" resultMap="ContractRuleRecordResult"> |
| | | <include refid="selectContractRuleRecordVo"/> |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertContractRuleRecord" useGeneratedKeys="true" keyProperty="id"> |
| | | insert into t_contract_rule_record |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="unitId != null">unit_id,</if> |
| | | <if test="siteOnline != null">site_online,</if> |
| | | <if test="createTime != null">create_time,</if> |
| | | <if test="deleted != null">deleted,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="unitId != null">#{unitId},</if> |
| | | <if test="siteOnline != null">#{siteOnline},</if> |
| | | <if test="createTime != null">#{createTime},</if> |
| | | <if test="deleted != null">#{deleted},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <insert id="insertBatch"> |
| | | inner into t_contract_rule_record (unit_id,site_online,create_time) |
| | | values |
| | | <foreach collection="list" item="item" separator=","> |
| | | (#{item.unitId},#{item.siteOnline},#{item.createTime}) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | <update id="updateContractRuleRecord"> |
| | | update t_contract_rule_record |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="unitId != null">unit_id = #{unitId},</if> |
| | | <if test="siteOnline != null">site_online = #{siteOnline},</if> |
| | | <if test="createTime != null">create_time = #{createTime},</if> |
| | | <if test="deleted != null">deleted = #{deleted},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteContractRuleRecordById"> |
| | | delete |
| | | from t_contract_rule_record |
| | | where id = #{id} |
| | | </delete> |
| | | |
| | | <delete id="deleteContractRuleRecordByIds"> |
| | | delete from t_contract_rule_record where id in |
| | | <foreach item="id" collection="array" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | </mapper> |
| | |
| | | r.create_time DESC |
| | | </select> |
| | | |
| | | <select id="selectNumberList" resultType="java.lang.String"> |
| | | SELECT yp.serial_number FROM t_report r |
| | | LEFT JOIN t_yw_point yp ON r.point_id = yp.id |
| | | WHERE r.status = #{status} AND |
| | | #{date} between r.begin_create_time and r.end_create_time |
| | | </select> |
| | | </mapper> |
| | |
| | | <select id="getPage" resultType="com.ycl.platform.domain.vo.ContractVO"> |
| | | select a.*, b.unit_name |
| | | from t_contract a |
| | | left join t_yw_unit b on a.unit_id = b.id and b.deleted = 0 |
| | | left join t_yw_unit b on a.unit_id = b.id and b.deleted = 0 |
| | | where a.deleted = 0 |
| | | <if test="query.name != null and query.name != ''"> |
| | | and a.name like concat('%', #{query.name}, '%') |
| | |
| | | <if test="query.status != null and query.status != ''"> |
| | | <choose> |
| | | <when test="query.status == 'ACTIVE'"> |
| | | and a.start_time < sysdate() and a.end_time > sysdate() |
| | | and a.start_time < sysdate() and a.end_time > sysdate() |
| | | </when> |
| | | <when test="query.status == 'NOT_START'"> |
| | | and a.start_time > sysdate() |
| | | and a.start_time > sysdate() |
| | | </when> |
| | | <when test="query.status == 'FINISHED'"> |
| | | and a.end_time < sysdate() |
| | |
| | | order by create_time desc |
| | | </select> |
| | | |
| | | <select id="selectByRuleName" resultType="com.ycl.platform.domain.vo.CalculateRuleVO"> |
| | | select tc.unit_id ,tcr.* |
| | | from t_contract tc |
| | | left join t_calculate_rule tcr on tc.id = tcr.contract_id |
| | | <where> |
| | | tc.deleted =0 and #{time} between tc.start_time and tc.end_time |
| | | <if test="ruleName !=null and ruleName!=''"> |
| | | tcr.rule_name = #{ruleName} |
| | | </if> |
| | | <if test="ruleCondition !=null and ruleCondition!=''"> |
| | | tcr.rule_condition = #{ruleCondition} |
| | | </if> |
| | | </where> |
| | | |
| | | </select> |
| | | </mapper> |