Merge remote-tracking branch 'origin/master'
| | |
| | | |
| | | //省厅前缀 |
| | | public final static String Province = "Province_"; |
| | | |
| | | public final static String County = "County_"; |
| | | //海康访问OSD路径 |
| | | public final static String HK_OSD_PATH = "/ISAPI/System/Video/inputs/channels/1/overlays"; |
| | | //海康访问时间路径 |
| | |
| | | public static final String Status_Use = "0"; |
| | | public static final String Status_Stop = "1"; |
| | | |
| | | /** |
| | | * 车辆同期抓拍量字典表 |
| | | */ |
| | | public final static String DICT_CAR_SNAP = "check_car_snap"; |
| | | /** |
| | | * 人脸同期抓拍量字典表 |
| | | */ |
| | | public final static String DICT_FACE_SNAP = "check_face_snap"; |
| | | /** |
| | | * 2022抓拍数计算倍率 |
| | | */ |
| | | public final static String MultiplyNum = "1.2"; |
| | | } |
| | |
| | | |
| | | |
| | | public class CheckSnapCountConstants { |
| | | /** |
| | | * 2022年同期车辆抓拍量(省厅) |
| | | */ |
| | | public final static String Car_City = "check.snapCount.car.city"; |
| | | /** |
| | | * 2022年同期车辆抓拍量(区县) |
| | | */ |
| | | public final static String Car_County = "check.snapCount.car.county"; |
| | | |
| | | /** |
| | | * 2022年同期人脸抓拍量(省厅) |
| | | */ |
| | | public final static String Face_City = "check.snapCount.face.city"; |
| | | /** |
| | | * 2022年同期人脸抓拍量(区县) |
| | | */ |
| | | public final static String Face_County = "check.snapCount.face.city"; |
| | | |
| | | |
| | | /** |
| | | * 2022抓拍数计算倍率 |
| | | */ |
| | | public final static String Multiply = "1.2"; |
| | | |
| | | /** |
| | | * 区域个数 |
| | | */ |
| | | public final static Integer CountyNum = 7; |
| | | } |
| | |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public static AreaDeptEnum fromDept(Integer deptId) { |
| | | for (AreaDeptEnum type : AreaDeptEnum.values()) { |
| | | if (type.getDeptId().equals(deptId) ) { |
| | | return type; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | |
| | | public String deptName; |
| | | |
| | | /** 考核标签(省厅/市局) */ |
| | | @Excel(name = "考核标签", dictType = "platform_examine_tag") |
| | | // @Excel(name = "考核标签", dictType = "platform_examine_tag") |
| | | @TableField("examine_tag") |
| | | public Short examineTag; |
| | | |
| | | @Excel(name = "考核标签") |
| | | @TableField(exist = false) |
| | | public String examineTagStr; |
| | | |
| | | @TableField(exist = false) |
| | | public List<Integer> deptIds; |
| | | public Long getId() { |
| | |
| | | public void setDeptIds(List<Integer> deptIds) { |
| | | this.deptIds = deptIds; |
| | | } |
| | | |
| | | public String getExamineTagStr() { |
| | | return examineTagStr; |
| | | } |
| | | |
| | | public void setExamineTagStr(String examineTagStr) { |
| | | this.examineTagStr = examineTagStr; |
| | | } |
| | | } |
| | |
| | | private Long id; |
| | | private String date; |
| | | private List<String> quarter; |
| | | private Integer examineTag; |
| | | } |
| | |
| | | package com.ycl.platform.domain.entity; |
| | | |
| | | import annotation.Excel; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ycl.system.entity.BaseEntity; |
| | | import lombok.Data; |
| | |
| | | */ |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @TableName("t_check_template") |
| | | public class CheckTemplate |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | |
| | | osdInfo.read(); |
| | | NET_GBMODE_CUSTOMTITLE_INFO[] stuCustomTitle = osdInfo.stuCustomTitle; |
| | | for (NET_GBMODE_CUSTOMTITLE_INFO title : stuCustomTitle) { |
| | | String position = new String(title.szPositon, StandardCharsets.UTF_8); |
| | | String position = new String(title.szPositon, StandardCharsets.UTF_8).trim(); |
| | | if("LeftDown".equals(position)) { |
| | | NET_TITLE_OSD_INFO[] stuOSD = title.stuOSD; |
| | | for (NET_TITLE_OSD_INFO osd : stuOSD) { |
| | | String osdStr = null; |
| | | osdStr = new String(osd.szText, StandardCharsets.UTF_8).trim(); |
| | | log.info("TEXT:"+osdStr); |
| | | // log.info("TEXT:"+osdStr); |
| | | if (!StringUtils.isEmpty(osdStr)) { |
| | | osdResult.setOSD4(osdStr); |
| | | } |
| | |
| | | for (NET_TITLE_OSD_INFO osd : stuOSD) { |
| | | String osdStr = null; |
| | | osdStr = new String(osd.szText, StandardCharsets.UTF_8).trim(); |
| | | log.info("TEXT:"+osdStr); |
| | | // log.info("TEXT:"+osdStr); |
| | | if (!StringUtils.isEmpty(osdStr)) { |
| | | if(num ==0){ |
| | | osdResult.setOSD1(osdStr); |
| | |
| | | //省份 |
| | | String name = new String(stOSDInfo.stNameOSD.szOSDText, StandardCharsets.UTF_8); |
| | | osdResult.setOSD1(name); |
| | | // log.info("name"+name); |
| | | int num = 0; |
| | | for (NetDEVSDKLib.NETDEV_OSD_TEXT_OVERLAY_S osd : stOSDInfo.astTextOverlay) { |
| | | String text = new String(osd.szOSDText, StandardCharsets.UTF_8).trim(); |
| | | // log.info("num:"+num+",texr:"+text); |
| | | if (num == 0) { |
| | | osdResult.setOSD2(text); |
| | | } else if (num == 1) { |
| | |
| | | import com.ycl.platform.mapper.CheckIndexCarMapper; |
| | | import com.ycl.platform.mapper.TMonitorMapper; |
| | | import com.ycl.platform.service.ICheckIndexCarService; |
| | | import com.ycl.system.entity.SysDictData; |
| | | import com.ycl.system.mapper.SysConfigMapper; |
| | | import com.ycl.system.mapper.SysDeptMapper; |
| | | import com.ycl.system.mapper.SysDictDataMapper; |
| | | import com.ycl.system.mapper.SysDictTypeMapper; |
| | | import com.ycl.utils.DateUtils; |
| | | import constant.ApiConstants; |
| | | import constant.CheckSnapCountConstants; |
| | | import constant.CheckThreadConstants; |
| | | import constant.RedisConstant; |
| | | import constant.*; |
| | | import enumeration.general.AreaDeptEnum; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | |
| | | private ICheckIndexCarService checkIndexCarService; |
| | | @Autowired |
| | | private RedisTemplate redisTemplate; |
| | | |
| | | @Autowired |
| | | private SysDictDataMapper dictDataMapper; |
| | | //区域车辆点位在线指标的内部类 |
| | | private static class AreaStats { |
| | | int totalSites = 0; |
| | |
| | | } |
| | | } |
| | | |
| | | //获取2022同期抓拍平均值 省厅、市局 |
| | | BigDecimal cityCountAvg = getAverageCount(CheckSnapCountConstants.Car_City); |
| | | BigDecimal countyCountAvg = getAverageCount(CheckSnapCountConstants.Car_County); |
| | | |
| | | // //获取2022同期抓拍平均值 省厅、市局 |
| | | // BigDecimal cityCountAvg = getAverageCount(CheckSnapCountConstants.Car_City); |
| | | // BigDecimal countyCountAvg = getAverageCount(CheckSnapCountConstants.Car_County); |
| | | //从字典获取同期抓拍量 |
| | | List<SysDictData> carSnap = dictDataMapper.selectDictDataByType(CheckConstants.DICT_CAR_SNAP); |
| | | // 查询是否index表已经存在今日数据 |
| | | List<CheckIndexCar> checkIndexCarList = checkIndexCarMapper.selectToday(DateUtils.getDate()); |
| | | List<CheckIndexCar> checkIndexCars = new ArrayList<>(); |
| | | areaStatsMap.forEach((key, stats) -> { |
| | | if (stats.totalSites > 0) { |
| | | CheckIndexCar checkIndexCar = createOrUpdateCheckIndexCar(key, stats, cityCountAvg, countyCountAvg, checkIndexCarList); |
| | | CheckIndexCar checkIndexCar = createOrUpdateCheckIndexCar(key, stats, checkIndexCarList,carSnap); |
| | | if (checkIndexCar != null) { |
| | | checkIndexCars.add(checkIndexCar); |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取2022同期抓拍平均值 |
| | | */ |
| | | private BigDecimal getAverageCount(String configKey) { |
| | | String count = sysConfigMapper.checkConfigKeyUnique(configKey).getConfigValue(); |
| | | return new BigDecimal(count) |
| | | .multiply(new BigDecimal(CheckSnapCountConstants.Multiply)) |
| | | .divide(new BigDecimal(CheckSnapCountConstants.CountyNum), 10, RoundingMode.HALF_UP) |
| | | .divide(new BigDecimal(LocalDate.now().getDayOfMonth()), 0, RoundingMode.HALF_UP); |
| | | } |
| | | |
| | | /** |
| | | * 车辆点位在线率和视图库对接稳定性 |
| | | */ |
| | | private CheckIndexCar createOrUpdateCheckIndexCar(String key, AreaStats stats, BigDecimal cityCountAvg, BigDecimal countyCountAvg, List<CheckIndexCar> checkIndexCarList) { |
| | | private CheckIndexCar createOrUpdateCheckIndexCar(String key, AreaStats stats, List<CheckIndexCar> checkIndexCarList,List<SysDictData> carSnap) { |
| | | CheckIndexCar checkIndexCar = getCheckIndex(key, checkIndexCarList, CheckIndexCar.class); |
| | | if (checkIndexCar == null) { |
| | | return null; |
| | |
| | | noDateCount = 0; |
| | | } |
| | | Double deductScore = 0.1 * noDateCount; |
| | | |
| | | if (stats.totalDataSum != 0) { |
| | | BigDecimal avgCount = key.startsWith(ApiConstants.Province) ? cityCountAvg : countyCountAvg; |
| | | Integer deptId = key.startsWith(ApiConstants.Province) ? Integer.parseInt(key.split("_")[1]) : Integer.parseInt(key); |
| | | String dictKey = key.startsWith(ApiConstants.Province) ? ApiConstants.Province+AreaDeptEnum.fromDept(deptId).getCode() : ApiConstants.County+AreaDeptEnum.fromDept(deptId).getCode(); |
| | | String value = carSnap.stream().filter(sysDictData -> sysDictData.getDictLabel().equals(dictKey)).findFirst().get().getDictValue(); |
| | | |
| | | Map<String, Object> viewConnectParam = new HashMap<>(); |
| | | viewConnectParam.put("totalDataSum", stats.totalDataSum); |
| | | viewConnectParam.put("avgCount", avgCount); |
| | | viewConnectParam.put("avgCount", new BigDecimal(value).multiply(new BigDecimal(CheckConstants.MultiplyNum)).divide(new BigDecimal(LocalDate.now().getDayOfMonth()), 0, RoundingMode.HALF_UP)); |
| | | BigDecimal viewConnectStability = viewConnectStability(viewConnectParam); |
| | | viewConnectStability = viewConnectStability.subtract(new BigDecimal(deductScore)).max(BigDecimal.ZERO).min(BigDecimal.ONE); |
| | | checkIndexCar.setViewConnectStability(viewConnectStability); |
| | |
| | | import com.ycl.platform.mapper.TMonitorMapper; |
| | | import com.ycl.platform.service.ICheckIndexFaceService; |
| | | import com.ycl.platform.service.ITMonitorService; |
| | | import com.ycl.system.entity.SysDictData; |
| | | import com.ycl.system.mapper.SysConfigMapper; |
| | | import com.ycl.system.mapper.SysDictDataMapper; |
| | | import constant.*; |
| | | import enumeration.general.AreaDeptEnum; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | |
| | | private TMonitorMapper monitorMapper; |
| | | @Autowired |
| | | private RedisTemplate redisTemplate; |
| | | |
| | | @Autowired |
| | | private SysDictDataMapper dictDataMapper; |
| | | //区域人脸点位在线指标的内部类 |
| | | private static class AreaStats { |
| | | int totalSites = 0; |
| | |
| | | } |
| | | } |
| | | |
| | | //获取2022同期抓拍平均值 省厅、市局 |
| | | BigDecimal cityCountAvg = getAverageCount(CheckSnapCountConstants.Face_City); |
| | | BigDecimal countyCountAvg = getAverageCount(CheckSnapCountConstants.Face_County); |
| | | |
| | | // //获取2022同期抓拍平均值 省厅、市局 |
| | | // BigDecimal cityCountAvg = getAverageCount(CheckSnapCountConstants.Face_City); |
| | | // BigDecimal countyCountAvg = getAverageCount(CheckSnapCountConstants.Face_County); |
| | | //从字典获取同期抓拍量 |
| | | List<SysDictData> faceSnap = dictDataMapper.selectDictDataByType(CheckConstants.DICT_FACE_SNAP); |
| | | // 查询今日数据 |
| | | List<CheckIndexFace> checkIndexFaceList = checkIndexFaceMapper.selectToday(DateUtils.getDate()); |
| | | List<CheckIndexFace> checkIndexFaces = new ArrayList<>(); |
| | | areaStatsMap.forEach((deptId, stats) -> { |
| | | if (stats.totalSites > 0) { |
| | | CheckIndexFace checkIndexFace = createOrUpdateCheckIndexFace(deptId, stats, cityCountAvg, countyCountAvg, checkIndexFaceList); |
| | | CheckIndexFace checkIndexFace = createOrUpdateCheckIndexFace(deptId, stats, checkIndexFaceList,faceSnap); |
| | | if (checkIndexFace != null) { |
| | | checkIndexFaces.add(checkIndexFace); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | //获取2022同期抓拍平均值 |
| | | private BigDecimal getAverageCount(String configKey) { |
| | | String count = sysConfigMapper.checkConfigKeyUnique(configKey).getConfigValue(); |
| | | return new BigDecimal(count) |
| | | .multiply(new BigDecimal(CheckSnapCountConstants.Multiply)) |
| | | .divide(new BigDecimal(CheckSnapCountConstants.CountyNum), 10, RoundingMode.HALF_UP) |
| | | .divide(new BigDecimal(LocalDate.now().getDayOfMonth()), 0, RoundingMode.HALF_UP); |
| | | } |
| | | // //获取2022同期抓拍平均值 |
| | | // private BigDecimal getAverageCount(String configKey) { |
| | | // String count = sysConfigMapper.checkConfigKeyUnique(configKey).getConfigValue(); |
| | | // return new BigDecimal(count) |
| | | // .multiply(new BigDecimal(CheckSnapCountConstants.Multiply)) |
| | | // .divide(new BigDecimal(CheckSnapCountConstants.CountyNum), 10, RoundingMode.HALF_UP) |
| | | // .divide(new BigDecimal(LocalDate.now().getDayOfMonth()), 0, RoundingMode.HALF_UP); |
| | | // } |
| | | |
| | | //车辆点位在线率和视图库对接稳定性 |
| | | private CheckIndexFace createOrUpdateCheckIndexFace(String key, AreaStats stats, BigDecimal cityCountAvg, BigDecimal countyCountAvg, List<CheckIndexFace> checkIndexFaceList) { |
| | | private CheckIndexFace createOrUpdateCheckIndexFace(String key, AreaStats stats, List<CheckIndexFace> checkIndexFaceList,List<SysDictData> faceSnap) { |
| | | CheckIndexFace checkIndexFace = getCheckIndex(key, checkIndexFaceList, CheckIndexFace.class); |
| | | if (checkIndexFace == null) { |
| | | return null; |
| | |
| | | noDateCount = 0; |
| | | } |
| | | Double deductScore = 0.1 * noDateCount; |
| | | log.info("总量:{}",stats.totalDataSum); |
| | | if (stats.totalDataSum != 0) { |
| | | BigDecimal avgCount = key.startsWith(ApiConstants.Province) ? cityCountAvg : countyCountAvg; |
| | | Integer deptId = key.startsWith(ApiConstants.Province) ? Integer.parseInt(key.split("_")[1]) : Integer.parseInt(key); |
| | | String dictKey = key.startsWith(ApiConstants.Province) ? ApiConstants.Province+ AreaDeptEnum.fromDept(deptId).getCode() : ApiConstants.County+AreaDeptEnum.fromDept(deptId).getCode(); |
| | | String value = faceSnap.stream().filter(sysDictData -> sysDictData.getDictLabel().equals(dictKey)).findFirst().get().getDictValue(); |
| | | |
| | | |
| | | Map<String, Object> viewConnectParam = new HashMap<>(); |
| | | viewConnectParam.put("totalDataSum", stats.totalDataSum); |
| | | viewConnectParam.put("avgCount", avgCount); |
| | | viewConnectParam.put("avgCount", new BigDecimal(value).multiply(new BigDecimal(CheckConstants.MultiplyNum)).divide(new BigDecimal(LocalDate.now().getDayOfMonth()), 0, RoundingMode.HALF_UP)); |
| | | BigDecimal viewConnectStability = viewConnectStability(viewConnectParam); |
| | | viewConnectStability = viewConnectStability.subtract(new BigDecimal(deductScore)).max(BigDecimal.ZERO).min(BigDecimal.ONE); |
| | | checkIndexFace.setViewConnectStability(viewConnectStability); |
| | |
| | | |
| | | /** |
| | | * 考核积分明细Mapper接口 |
| | | * |
| | | * |
| | | * @author ruoyi |
| | | * @date 2024-04-22 |
| | | */ |
| | |
| | | { |
| | | /** |
| | | * 查询考核积分明细 |
| | | * |
| | | * |
| | | * @param id 考核积分明细主键 |
| | | * @return 考核积分明细 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 查询考核积分明细列表 |
| | | * |
| | | * |
| | | * @param checkScore 考核积分明细 |
| | | * @return 考核积分明细集合 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 新增考核积分明细 |
| | | * |
| | | * |
| | | * @param checkScore 考核积分明细 |
| | | * @return 结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 修改考核积分明细 |
| | | * |
| | | * |
| | | * @param checkScore 考核积分明细 |
| | | * @return 结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 删除考核积分明细 |
| | | * |
| | | * |
| | | * @param id 考核积分明细主键 |
| | | * @return 结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 批量删除考核积分明细 |
| | | * |
| | | * |
| | | * @param ids 需要删除的数据主键集合 |
| | | * @return 结果 |
| | | */ |
| | |
| | | * @return 数据 |
| | | */ |
| | | List<Map<String, Object>> calculate(Date startDate, Date endDate, String category); |
| | | |
| | | CheckScore getLast(CheckScore checkScore); |
| | | } |
| | |
| | | package com.ycl.platform.service.impl; |
| | | |
| | | import annotation.DataScope; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ycl.platform.domain.dto.CheckScoreDTO; |
| | |
| | | import com.ycl.utils.DateUtils; |
| | | import com.ycl.utils.SecurityUtils; |
| | | import com.ycl.utils.StringUtils; |
| | | import constant.CheckConstants; |
| | | import enumeration.general.PublishType; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | CheckScoreDetailVO checkScoreDetailVO = new CheckScoreDetailVO(); |
| | | //根据id读取score |
| | | CheckScore checkScore = scoreMapper.selectCheckScoreById(checkScoreId); |
| | | Integer templateId = 0; |
| | | //方便切换改为:根据score考核类别和dto考核标签查模板规则和权重,注意同种类同标签只能有一个模板 |
| | | QueryWrapper<CheckTemplate> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("examine_tag",checkScoreIndexDTO.getExamineTag()); |
| | | wrapper.eq("examine_category",checkScore.getExamineCategory()); |
| | | Optional<CheckTemplate> first = templateMapper.selectList(wrapper).stream().findFirst(); |
| | | if(first.isPresent()){ |
| | | CheckTemplate checkTemplate = first.get(); |
| | | templateId = checkTemplate.getId(); |
| | | } |
| | | //读取规则以及权重 |
| | | List<CheckTemplateRule> templateRuleList = templateRuleMapper.selectListByTemplateId(checkScore.getTemplateId()); |
| | | List<CheckTemplateRule> templateRuleList = templateRuleMapper.selectListByTemplateId(templateId); |
| | | |
| | | List<CheckRule> checkRules = new ArrayList<>(); |
| | | //读取模板对应所有规则 |
| | |
| | | .setDate(checkScoreIndexDTO.getDate()) |
| | | .setQuarter(checkScoreIndexDTO.getQuarter()); |
| | | scoreIndexDTO.setParams(checkScoreIndexDTO.getParams()); |
| | | scoreIndexDTO.setExamineTag(checkScore.getExamineTag()); |
| | | scoreIndexDTO.setExamineTag(checkScoreIndexDTO.getExamineTag()); |
| | | //获当月份 |
| | | if (StringUtils.isEmpty(scoreIndexDTO.getDate()) && CollectionUtils.isEmpty(checkScoreIndexDTO.getQuarter())) { |
| | | //如果查询条件不含参数,查询积分对应创建时间 |
| | |
| | | |
| | | // 如果数据为空,则查询之前的数据 |
| | | if (checkScores.isEmpty()) { |
| | | CheckScore one = new LambdaQueryChainWrapper<>(baseMapper).select(CheckScore::getCreateTime).last("order by create_time desc limit 1").one(); |
| | | CheckScore one = scoreMapper.getLast(checkScore); |
| | | if (Objects.nonNull(one)) { |
| | | calendar.setTime(one.getCreateTime()); |
| | | getCheckScore(checkScore, calendar); |
| | |
| | | @Override |
| | | public void exportIndex(HttpServletResponse response, CheckScore checkScoreDTO) throws IOException { |
| | | String date = checkScoreDTO.getDate(); |
| | | Integer examineTag = null; |
| | | //如果请求参数时间为空,查这条记录的时间 |
| | | if (StringUtils.isEmpty(checkScoreDTO.getDate()) && CollectionUtils.isEmpty(checkScoreDTO.getQuarter())) { |
| | | CheckScore checkScore = getById(checkScoreDTO.getId()); |
| | | Date createTime = checkScore.getCreateTime(); |
| | | SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM"); |
| | | date = formatter.format(createTime); |
| | | examineTag = checkScore.getExamineTag(); |
| | | } |
| | | |
| | | /** 导三张sheet */ |
| | |
| | | CheckIndexCar checkIndexCar = new CheckIndexCar(); |
| | | checkIndexCar.setDate(date); |
| | | checkIndexCar.setQuarter(checkScoreDTO.getQuarter()); |
| | | if (examineTag != null) { |
| | | checkIndexCar.setExamineTag(Short.parseShort(examineTag + "")); |
| | | } |
| | | List<CheckIndexCar> checkIndexCars = indexCarService.selectCheckIndexCarList(checkIndexCar); |
| | | for (CheckIndexCar indexCar : checkIndexCars) { |
| | | indexCar.setExamineTagStr(CheckConstants.Examine_Tag_Province.equals(indexCar.getExamineTag()) ? "省厅考核" : "区县考核"); |
| | | } |
| | | ExcelExp e1 = new ExcelExp("车辆考核指标数据", checkIndexCars, CheckIndexCar.class); |
| | | //人脸 |
| | | CheckIndexFace checkIndexFace = new CheckIndexFace(); |
| | | checkIndexFace.setDate(date); |
| | | checkIndexFace.setQuarter(checkScoreDTO.getQuarter()); |
| | | if (examineTag != null) { |
| | | checkIndexFace.setExamineTag(Short.parseShort(examineTag + "")); |
| | | } |
| | | List<CheckIndexFace> checkIndexFaces = indexFaceService.selectCheckIndexFaceList(checkIndexFace); |
| | | for (CheckIndexFace indexFace : checkIndexFaces) { |
| | | indexFace.setExamineTagStr(CheckConstants.Examine_Tag_Province.equals(indexFace.getExamineTag()) ? "省厅考核" : "区县考核"); |
| | | } |
| | | ExcelExp e2 = new ExcelExp("人脸考核指标数据", checkIndexFaces, CheckIndexFace.class); |
| | | //视频 |
| | | CheckIndexVideo checkIndexVideo = new CheckIndexVideo(); |
| | | checkIndexVideo.setDate(date); |
| | | checkIndexVideo.setQuarter(checkScoreDTO.getQuarter()); |
| | | if (examineTag != null) { |
| | | checkIndexVideo.setExamineTag(Short.parseShort(examineTag + "")); |
| | | } |
| | | List<CheckIndexVideo> checkIndexVideos = indexVideoService.selectCheckIndexVideoList(checkIndexVideo); |
| | | for (CheckIndexVideo indexVideo : checkIndexVideos) { |
| | | indexVideo.setExamineTagStr(CheckConstants.Examine_Tag_Province.equals(indexVideo.getExamineTag()) ? "省厅考核" : "区县考核"); |
| | | } |
| | | ExcelExp e3 = new ExcelExp("视频考核指标数据", checkIndexVideos, CheckIndexVideo.class); |
| | | |
| | | List<ExcelExp> mysheet = new ArrayList<>(); |
| | |
| | | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| | | if (!user.isAdmin()) { |
| | | for (SysRole role : roles) { |
| | | if (role.getPermissions().contains("check:score:publish")) { |
| | | if (role.getPermissions().contains("check:score:role:publish")) { |
| | | Map<String, Object> params = checkScore.getParams(); |
| | | params.put("publish", PublishType.PUBLISHED.getCode()); |
| | | } |
| | |
| | | Query query = new Query(Criteria.where("mongoCreateTime").gte(DateUtils.getDayStart(yesterday)).lt(DateUtils.getDayEnd(yesterday))); |
| | | List<MonitorQualifyResult> oneMachineFileResults = mongoTemplate.find(query, MonitorQualifyResult.class); |
| | | //mongo品牌数据 |
| | | Query OSDQuery = new Query(Criteria.where("mongoCreateTime").gte(DateUtils.getDayStart(yesterday)).lt(DateUtils.getDayEnd(yesterday))); |
| | | Query OSDQuery = new Query(Criteria.where("mongoCreateTime").gte(DateUtils.getDayStart(yesterday)).lt(DateUtils.getDayEnd(yesterday)))); |
| | | Map<String, OsdCheckResult> osdMap = mongoTemplate.find(query, OsdCheckResult.class).stream().collect(Collectors.toMap(OsdCheckResult::getDeviceNo, Function.identity())); |
| | | //数据库monitor表数据 |
| | | Map<String, TMonitorVO> monitorVOMap = monitorMapper.selectMonitorVOList().stream().collect(Collectors.toMap(TMonitorVO::getSerialNumber, Function.identity())); |
| | |
| | | host: 51.92.65.49 |
| | | appKey: 29555942 |
| | | appSecret: t9U7tCplCyYHzQPPL7cH |
| | | |
| | | 1111: Hik12345+ |
| | | DH: |
| | | userName: admin |
| | | password: zg@2024dx |
| | |
| | | <?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"> |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ycl.platform.mapper.CheckScoreMapper"> |
| | | |
| | | <resultMap type="com.ycl.platform.domain.entity.CheckScore" id="CheckScoreResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="score" column="score" /> |
| | | <result property="deptId" column="dept_id" /> |
| | | <result property="templateId" column="template_id" /> |
| | | <result property="examineTag" column="examine_tag" /> |
| | | <result property="examineCategory" column="examine_category" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="updateUser" column="update_user" /> |
| | | <result property="publish" column="publish" /> |
| | | <result property="id" column="id"/> |
| | | <result property="score" column="score"/> |
| | | <result property="deptId" column="dept_id"/> |
| | | <result property="templateId" column="template_id"/> |
| | | <result property="examineTag" column="examine_tag"/> |
| | | <result property="examineCategory" column="examine_category"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="updateTime" column="update_time"/> |
| | | <result property="updateUser" column="update_user"/> |
| | | <result property="publish" column="publish"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectCheckScoreVo"> |
| | | select id, score, tcs.dept_id, template_id, examine_tag, examine_category, tcs.create_time,tcs.update_time,tcs.update_user, publish |
| | | select id, score, tcs.dept_id, template_id, examine_tag, examine_category, |
| | | tcs.create_time,tcs.update_time,tcs.update_user, publish |
| | | from t_check_score tcs left join sys_dept d on tcs.dept_id = d.dept_id |
| | | </sql> |
| | | |
| | | <select id="selectCheckScoreList" resultMap="CheckScoreResult"> |
| | | <include refid="selectCheckScoreVo"/> |
| | | <where> |
| | | <if test="score != null "> and score = #{score}</if> |
| | | <if test="templateId != null "> and template_id = #{templateId}</if> |
| | | <if test="createTime != null "> and DATE(tcs.create_time) = #{createTime}</if> |
| | | <if test="date != null "> and date_format(tcs.create_time,'%Y-%m') = #{date}</if> |
| | | <if test="examineTag != null "> and examine_tag = #{examineTag}</if> |
| | | <if test="examineCategory != null "> and examine_category = #{examineCategory}</if> |
| | | <if test="params.publish != null and params.publish != ''"> and publish = #{params.publish}</if> |
| | | <if test="deptId != null "> and tcs.dept_id = #{deptId}</if> |
| | | <if test="score != null ">and score = #{score}</if> |
| | | <if test="templateId != null ">and template_id = #{templateId}</if> |
| | | <if test="createTime != null ">and DATE(tcs.create_time) = #{createTime}</if> |
| | | <if test="date != null ">and date_format(tcs.create_time,'%Y-%m') = #{date}</if> |
| | | <if test="examineTag != null ">and examine_tag = #{examineTag}</if> |
| | | <if test="examineCategory != null ">and examine_category = #{examineCategory}</if> |
| | | <if test="params.publish != null and params.publish != ''">and publish = #{params.publish}</if> |
| | | <if test="deptId != null ">and tcs.dept_id = #{deptId}</if> |
| | | ${params.dataScope} |
| | | </where> |
| | | order by create_time desc |
| | |
| | | <if test="updateTime != null">update_time,</if> |
| | | <if test="updateUser != null">update_user,</if> |
| | | <if test="publish != null">publish,</if> |
| | | </trim> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="score != null">#{score},</if> |
| | | <if test="deptId != null">#{deptId},</if> |
| | |
| | | <if test="updateTime != null">#{updateTime},</if> |
| | | <if test="updateUser != null">#{updateUser},</if> |
| | | <if test="publish != null">#{publish},</if> |
| | | </trim> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateCheckScore" > |
| | | <update id="updateCheckScore"> |
| | | update t_check_score |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="score != null">score = #{score},</if> |
| | |
| | | </select> |
| | | |
| | | <insert id="saveBatch"> |
| | | insert into t_check_score (score,dept_id,template_id,examine_tag,examine_category,create_time) values <foreach collection="scoreList" separator="," item="score"> |
| | | (#{score.score},#{score.deptId},#{score.templateId},#{score.examineTag},#{score.examineCategory},#{score.createTime}) |
| | | </foreach> |
| | | insert into t_check_score (score,dept_id,template_id,examine_tag,examine_category,create_time) values |
| | | <foreach collection="scoreList" separator="," item="score"> |
| | | (#{score.score},#{score.deptId},#{score.templateId},#{score.examineTag},#{score.examineCategory},#{score.createTime}) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | <select id="selectCheckScoreMap" resultType="com.ycl.platform.domain.entity.CheckScore"> |
| | | SELECT |
| | | id, |
| | | tcs.dept_id, |
| | | examine_category, |
| | | ROUND(AVG(score) OVER(PARTITION BY tcs.dept_id, examine_category), 2) AS score, |
| | | tcs.create_time AS createTime |
| | | id, |
| | | tcs.dept_id, |
| | | examine_category, |
| | | ROUND(AVG(score) OVER(PARTITION BY tcs.dept_id, examine_category), 2) AS score, |
| | | tcs.publish, |
| | | tcs.create_time AS createTime |
| | | FROM |
| | | t_check_score tcs |
| | | LEFT JOIN sys_dept d ON tcs.dept_id = d.dept_id |
| | | WHERE |
| | | t_check_score tcs |
| | | LEFT JOIN sys_dept d ON tcs.dept_id = d.dept_id |
| | | <where> |
| | | examine_tag = #{examineTag} |
| | | AND DATE_FORMAT(tcs.create_time, '%Y-%m') BETWEEN DATE_FORMAT(#{startDate}, '%Y-%m') AND DATE_FORMAT(#{endDate}, '%Y-%m') |
| | | GROUP BY tcs.dept_id, examine_category,examine_tag |
| | | </select> |
| | | AND DATE_FORMAT(tcs.create_time, '%Y-%m') BETWEEN DATE_FORMAT(#{startDate}, '%Y-%m') AND DATE_FORMAT(#{endDate}, '%Y-%m') |
| | | <if test="params.publish != null and params.publish != ''">and publish = #{params.publish}</if> |
| | | ${params.dataScope} |
| | | </where> |
| | | GROUP BY tcs.dept_id, tcs.examine_category, tcs.examine_tag |
| | | </select> |
| | | |
| | | <select id="getLast" resultType="com.ycl.platform.domain.entity.CheckScore"> |
| | | select * from t_check_score tcs LEFT JOIN sys_dept d ON tcs.dept_id = d.dept_id |
| | | <where> |
| | | tcs.examine_tag = #{examineTag} |
| | | <if test="params.publish != null and params.publish != ''">and tcs.publish = #{params.publish}</if> |
| | | ${params.dataScope} |
| | | </where> |
| | | order by tcs.create_time desc limit 1 |
| | | </select> |
| | | <select id="home" resultType="java.util.Map"> |
| | | <![CDATA[ |
| | | SELECT |
| | |
| | | |
| | | <select id="calculate" resultType="java.util.Map"> |
| | | SELECT |
| | | area AS deptName, |
| | | ROUND(AVG(score)) AS score |
| | | area AS deptName, |
| | | ROUND(AVG(score)) AS score |
| | | FROM |
| | | t_check_score tcs |
| | | LEFT JOIN sys_dept d ON tcs.dept_id = d.dept_id |
| | | t_check_score tcs |
| | | LEFT JOIN sys_dept d ON tcs.dept_id = d.dept_id |
| | | WHERE |
| | | examine_tag = 1 |
| | | AND examine_category = #{category} |
| | | AND DATE_FORMAT(tcs.create_time, '%Y-%m') BETWEEN DATE_FORMAT(#{startDate}, '%Y-%m') AND DATE_FORMAT(#{endDate}, '%Y-%m') |
| | | examine_tag = 1 |
| | | AND examine_category = #{category} |
| | | AND DATE_FORMAT(tcs.create_time, '%Y-%m') BETWEEN DATE_FORMAT(#{startDate}, '%Y-%m') AND DATE_FORMAT(#{endDate}, |
| | | '%Y-%m') |
| | | GROUP BY tcs.dept_id |
| | | ORDER BY score DESC, tcs.dept_id |
| | | </select> |
| | |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ycl.platform.mapper.CheckTemplateRuleMapper"> |
| | | |
| | | |
| | | <resultMap type="com.ycl.platform.domain.entity.CheckTemplateRule" id="CheckTemplateRuleResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="checkTemplateId" column="check_template_id" /> |
| | |
| | | |
| | | <select id="selectCheckTemplateRuleList" resultMap="CheckTemplateRuleResult"> |
| | | <include refid="selectCheckTemplateRuleVo"/> |
| | | <where> |
| | | <where> |
| | | <if test="checkTemplateId != null "> and check_template_id = #{checkTemplateId}</if> |
| | | <if test="checkRuleId != null "> and check_rule_id = #{checkRuleId}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | |
| | | <select id="selectCheckTemplateRuleById" resultMap="CheckTemplateRuleResult"> |
| | | <include refid="selectCheckTemplateRuleVo"/> |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | |
| | | <insert id="insertCheckTemplateRule" useGeneratedKeys="true" keyProperty="id"> |
| | | insert into t_check_template_rule |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | </delete> |
| | | |
| | | <delete id="deleteCheckTemplateRuleByIds"> |
| | | delete from t_check_template_rule where id in |
| | | delete from t_check_template_rule where id in |
| | | <foreach item="id" collection="array" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | |
| | | <select id="selectListByTemplateId" resultType="com.ycl.platform.domain.entity.CheckTemplateRule"> |
| | | select tctr.*,tcr.rule_name as checkRuleName,tcr.rule_index from t_check_template_rule tctr |
| | | left join t_check_rule tcr on tctr.check_rule_id = tcr.id |
| | | where check_template_id = #{checkTemplateId} |
| | | where tctr.check_template_id = #{checkTemplateId} |
| | | </select> |
| | | |
| | | </mapper> |
| | | </mapper> |