Merge branch 'main' of http://192.168.0.56:3000/haozq/jjsp_service
This commit is contained in:
commit
8328b9fb88
|
|
@ -0,0 +1,89 @@
|
|||
package com.sercurityControl.proteam.supplement.controller;
|
||||
|
||||
import com.securityControl.common.core.web.domain.AjaxResult;
|
||||
import com.securityControl.common.log.annotation.SysLog;
|
||||
import com.securityControl.common.log.enums.OperaType;
|
||||
import com.sercurityControl.proteam.supplement.domain.dto.ParamsDto;
|
||||
import com.sercurityControl.proteam.supplement.service.MonitoringCoverageService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @className:MonitoringCoverageController
|
||||
* @author:cwchen
|
||||
* @date:2024-12-11-9:17
|
||||
* @version:1.0
|
||||
* @description:监控覆盖-controller
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/pot/monitoringCoverage/")
|
||||
@Slf4j
|
||||
public class MonitoringCoverageController {
|
||||
|
||||
@Resource(name = "MonitoringCoverageService")
|
||||
private MonitoringCoverageService service;
|
||||
|
||||
@ApiOperation(value = "监控活跃度分析")
|
||||
@SysLog(title = "监控覆盖", model = "安全风险->监控覆盖", operaType = OperaType.QUERY, details = "监控覆盖",logType = 1)
|
||||
@GetMapping("getHyd")
|
||||
public AjaxResult getHyd(ParamsDto dto){
|
||||
AjaxResult res = service.getHyd(dto);
|
||||
return res;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "监控覆盖度分析")
|
||||
@GetMapping("getFgd")
|
||||
public AjaxResult getFgd(ParamsDto dto){
|
||||
AjaxResult res = service.getFgd(dto);
|
||||
return res;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "地图球机")
|
||||
@GetMapping("getMap")
|
||||
public AjaxResult getMap(ParamsDto dto){
|
||||
AjaxResult res = service.getMap(dto);
|
||||
return res;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "球机异常数量")
|
||||
@GetMapping("getErrorNum")
|
||||
public AjaxResult getErrorNum(ParamsDto dto){
|
||||
AjaxResult res = service.getErrorNum(dto);
|
||||
return res;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "下行观看分析")
|
||||
@GetMapping("getWatchNum")
|
||||
public AjaxResult getWatchNum(ParamsDto dto){
|
||||
AjaxResult res = service.getWatchNum(dto);
|
||||
return res;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "风险球机覆盖度")
|
||||
@GetMapping("getCoverRate")
|
||||
public AjaxResult getCoverRate(ParamsDto dto){
|
||||
AjaxResult res = service.getCoverRate(dto);
|
||||
return res;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "球机速率正常/异常数量")
|
||||
@GetMapping("getSpeedNum")
|
||||
public AjaxResult getSpeedNum(ParamsDto dto){
|
||||
AjaxResult res = service.getSpeedNum(dto);
|
||||
return res;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "监控活跃度分析-列表")
|
||||
@PostMapping(value = "getMonitoringHydList")
|
||||
@SysLog(title = "监控活跃度分析详情", model = "监控覆盖->监控活跃度分析", operaType = OperaType.QUERY, details = "监控活跃度分析详情",logType = 1)
|
||||
public Map<String, Object> getMonitoringHydList(ParamsDto dto) {
|
||||
return service.getMonitoringHydList(dto);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,9 @@
|
|||
package com.sercurityControl.proteam.supplement.controller;
|
||||
|
||||
import com.securityControl.common.log.annotation.Log;
|
||||
import com.securityControl.common.log.annotation.SysLog;
|
||||
import com.securityControl.common.log.enums.BusinessType;
|
||||
import com.securityControl.common.log.enums.OperaType;
|
||||
import com.sercurityControl.proteam.supplement.domain.dto.ParamsDto;
|
||||
import com.sercurityControl.proteam.supplement.service.ProVioService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
|
@ -30,7 +32,7 @@ public class ProVioController {
|
|||
|
||||
@ApiOperation(value = "工程违章统计-列表")
|
||||
@PostMapping(value = "getProVioList")
|
||||
@Log(title = "工程违章统计", menu = "值班任务->工程违章统计", businessType = BusinessType.QUERY, details = "工程违章统计")
|
||||
@SysLog(title = "工程违章统计", model = "值班任务->工程违章统计", operaType = OperaType.QUERY, details = "工程违章统计",logType = 1)
|
||||
public Map<String, Object> getProVioList(ParamsDto dto) {
|
||||
return service.getProVioList(dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
package com.sercurityControl.proteam.supplement.controller;
|
||||
|
||||
import com.securityControl.common.log.annotation.Log;
|
||||
import com.securityControl.common.log.annotation.SysLog;
|
||||
import com.securityControl.common.log.enums.BusinessType;
|
||||
import com.securityControl.common.log.enums.OperaType;
|
||||
import com.sercurityControl.proteam.supplement.domain.dto.ParamsDto;
|
||||
import com.sercurityControl.proteam.supplement.service.RiskCostService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
|
@ -30,7 +32,7 @@ public class RiskCostController {
|
|||
|
||||
@ApiOperation(value = "风险成本影响分析-列表")
|
||||
@PostMapping(value = "getRiskCostList")
|
||||
@Log(title = "风险成本影响分析", menu = "值班任务->风险时段分析", businessType = BusinessType.QUERY, details = "风险成本影响分析")
|
||||
@SysLog(title = "风险成本影响分析", model = "值班任务->风险时段分析", operaType = OperaType.QUERY, details = "风险成本影响分析",logType = 1)
|
||||
public Map<String, Object> getRiskCostList(ParamsDto dto) {
|
||||
return service.getRiskCostList(dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,9 @@ package com.sercurityControl.proteam.supplement.controller;
|
|||
|
||||
import com.securityControl.common.core.web.domain.AjaxResult;
|
||||
import com.securityControl.common.log.annotation.Log;
|
||||
import com.securityControl.common.log.annotation.SysLog;
|
||||
import com.securityControl.common.log.enums.BusinessType;
|
||||
import com.securityControl.common.log.enums.OperaType;
|
||||
import com.sercurityControl.proteam.supplement.domain.dto.ParamsDto;
|
||||
import com.sercurityControl.proteam.supplement.service.ProVioService;
|
||||
import com.sercurityControl.proteam.supplement.service.RiskRectService;
|
||||
|
|
@ -32,14 +34,14 @@ public class RiskRectController {
|
|||
|
||||
@ApiOperation(value = "风险整改分析-列表")
|
||||
@PostMapping(value = "getRiskRectList")
|
||||
@Log(title = "风险整改分析", menu = "值班任务->风险整改分析", businessType = BusinessType.QUERY, details = "风险整改分析")
|
||||
@SysLog(title = "风险整改分析", model = "值班任务->风险整改分析", operaType = OperaType.QUERY, details = "风险整改分析",logType = 1)
|
||||
public Map<String, Object> getRiskRectList(ParamsDto dto) {
|
||||
return service.getRiskRectList(dto);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "风险整改分析-整改详情")
|
||||
@PostMapping(value = "getRiskRectDetail")
|
||||
@Log(title = "风险整改分析整改详情", menu = "值班任务->风险整改分析", businessType = BusinessType.QUERY, details = "整改详情")
|
||||
@SysLog(title = "风险整改分析整改详情", model = "值班任务->风险整改分析", operaType = OperaType.QUERY, details = "整改详情",logType = 1)
|
||||
public AjaxResult getRiskRectDetail(ParamsDto dto) {
|
||||
return service.getRiskRectDetail(dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
package com.sercurityControl.proteam.supplement.controller;
|
||||
|
||||
import com.securityControl.common.log.annotation.Log;
|
||||
import com.securityControl.common.log.annotation.SysLog;
|
||||
import com.securityControl.common.log.enums.BusinessType;
|
||||
import com.securityControl.common.log.enums.OperaType;
|
||||
import com.sercurityControl.proteam.supplement.domain.dto.ParamsDto;
|
||||
import com.sercurityControl.proteam.supplement.service.RiskTimeService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
|
@ -30,7 +32,7 @@ public class RiskTimeController {
|
|||
|
||||
@ApiOperation(value = "风险时段分析-列表")
|
||||
@PostMapping(value = "getRiskTimeList")
|
||||
@Log(title = "风险时段分析", menu = "值班任务->风险时段分析", businessType = BusinessType.QUERY, details = "风险时段分析")
|
||||
@SysLog(title = "风险时段分析", model = "值班任务->风险时段分析", operaType = OperaType.QUERY, details = "风险时段分析",logType = 1)
|
||||
public Map<String, Object> getRiskTimeList(ParamsDto dto) {
|
||||
return service.getRiskTimeList(dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,24 @@ public class ParamsDto {
|
|||
private String startDay;
|
||||
/**结束日期*/
|
||||
private String endDay;
|
||||
/**班组长*/
|
||||
private String workManager;
|
||||
/**班组名称*/
|
||||
private String teamName;
|
||||
/**建管单位*/
|
||||
private String org;
|
||||
/**名称*/
|
||||
private String name;
|
||||
|
||||
/**1.监控活跃度分析 2.监控覆盖度分析 3.下行观看分析*/
|
||||
private int type;
|
||||
|
||||
/**1.速率正常 2.速率异常*/
|
||||
private int operType;
|
||||
|
||||
/**1.球机正常 2.异常掉线 3.画面不清晰 4.不流畅 5.信号弱 6.人为遮挡*/
|
||||
private String errorType;
|
||||
|
||||
|
||||
private int page;
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,60 @@
|
|||
package com.sercurityControl.proteam.supplement.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @className:MonitoringCoverageVo
|
||||
* @author:cwchen
|
||||
* @date:2024-12-11-10:11
|
||||
* @version:1.0
|
||||
* @description:监控覆盖
|
||||
*/
|
||||
@Data
|
||||
public class MonitoringCoverageVo {
|
||||
|
||||
private int num;
|
||||
|
||||
private String id;
|
||||
|
||||
private String name;
|
||||
|
||||
private String runTime;
|
||||
|
||||
private String time;
|
||||
|
||||
private long timeValue;
|
||||
|
||||
/**观看次数*/
|
||||
private int watchTime;
|
||||
|
||||
/**风险等级*/
|
||||
private String riskLevel;
|
||||
|
||||
/**站班会地址*/
|
||||
private String address;
|
||||
|
||||
/**经度*/
|
||||
private String lon;
|
||||
/**纬度*/
|
||||
private String lat;
|
||||
|
||||
/**二级风险数量*/
|
||||
private int twoRiskNum;
|
||||
/**三级风险数量*/
|
||||
private int threeRiskNum;
|
||||
/**四级风险数量*/
|
||||
private int fourRiskNum;
|
||||
/**五级风险数量*/
|
||||
private int fiveRiskNum;
|
||||
private int totalRiskNum;
|
||||
|
||||
private double twoRate;
|
||||
private double threeRate;
|
||||
private double fourRate;
|
||||
private double fiveRate;
|
||||
|
||||
/**视频设备视频速率正常数量*/
|
||||
private int errorNum;
|
||||
/**视频设备视频速率异常数量*/
|
||||
private int normalNum;
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
package com.sercurityControl.proteam.supplement.domain.vo;
|
||||
|
||||
import com.securityControl.common.core.annotation.Sensitive;
|
||||
import com.securityControl.common.core.enums.SensitizedType;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @className:MonitoringDetailVo
|
||||
* @author:cwchen
|
||||
* @date:2024-12-11-16:42
|
||||
* @version:1.0
|
||||
* @description:监控覆盖详情-vo
|
||||
*/
|
||||
@Data
|
||||
public class MonitoringDetailVo {
|
||||
private int num;
|
||||
/**id*/
|
||||
private String id;
|
||||
/**球机编号*/
|
||||
private String name;
|
||||
/**工程名称*/
|
||||
private String proName;
|
||||
/**班组长*/
|
||||
private String workManager;
|
||||
/**班组长手机号*/
|
||||
@Sensitive(SensitizedType.MOBILE_PHONE)
|
||||
private String workManagerPhone;
|
||||
/**风险等级*/
|
||||
private String riskLevel;
|
||||
/**建管单位*/
|
||||
private String org;
|
||||
/**班组名称*/
|
||||
private String teamName;
|
||||
/**经度*/
|
||||
private String lon;
|
||||
/**纬度*/
|
||||
private String lat;
|
||||
/**初次运行日期*/
|
||||
private String time;
|
||||
/**运行时长 时分秒*/
|
||||
private String timeValue;
|
||||
/**运行时长 秒*/
|
||||
private long timeValue2;
|
||||
/**观看次数*/
|
||||
private int watchTime;
|
||||
/**异常类型*/
|
||||
private String errorName;
|
||||
}
|
||||
|
|
@ -33,7 +33,7 @@ public class RiskCostVo {
|
|||
private String workSite;
|
||||
/**工序*/
|
||||
private String gx;
|
||||
/**时间*/
|
||||
private String time;
|
||||
/**风险成本*/
|
||||
private String riskCost;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,90 @@
|
|||
package com.sercurityControl.proteam.supplement.mapper;
|
||||
|
||||
import com.sercurityControl.proteam.supplement.domain.dto.ParamsDto;
|
||||
import com.sercurityControl.proteam.supplement.domain.vo.MonitoringCoverageVo;
|
||||
import com.sercurityControl.proteam.supplement.domain.vo.MonitoringDetailVo;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className:MonitoringCoverageMapper
|
||||
* @author:cwchen
|
||||
* @date:2024-12-11-9:18
|
||||
* @version:1.0
|
||||
* @description:监控覆盖-mapper
|
||||
*/
|
||||
@Repository("MonitoringCoverageMapper")
|
||||
public interface MonitoringCoverageMapper {
|
||||
/**
|
||||
* 监控覆盖-活跃度分析
|
||||
* @param dto
|
||||
* @return List<MonitoringCoverageVo>
|
||||
* @author cwchen
|
||||
* @date 2024/12/11 10:23
|
||||
*/
|
||||
List<MonitoringCoverageVo> getHyd(ParamsDto dto);
|
||||
|
||||
/**
|
||||
* 监控覆盖-覆盖度分析
|
||||
* @param dto
|
||||
* @return List<MonitoringCoverageVo>
|
||||
* @author cwchen
|
||||
* @date 2024/12/11 13:10
|
||||
*/
|
||||
List<MonitoringCoverageVo> getFgd(ParamsDto dto);
|
||||
|
||||
/**
|
||||
* 地图球机
|
||||
* @param dto
|
||||
* @return List<MonitoringCoverageVo>
|
||||
* @author cwchen
|
||||
* @date 2024/12/11 13:26
|
||||
*/
|
||||
List<MonitoringCoverageVo> getMap(ParamsDto dto);
|
||||
|
||||
/**
|
||||
* 球机异常数量
|
||||
* @param dto
|
||||
* @return List<MonitoringCoverageVo>
|
||||
* @author cwchen
|
||||
* @date 2024/12/11 14:11
|
||||
*/
|
||||
List<MonitoringCoverageVo> getErrorNum(ParamsDto dto);
|
||||
|
||||
/**
|
||||
* 下行观看分析
|
||||
* @param dto
|
||||
* @return List<MonitoringCoverageVo>
|
||||
* @author cwchen
|
||||
* @date 2024/12/11 14:23
|
||||
*/
|
||||
List<MonitoringCoverageVo> getWatchNum(ParamsDto dto);
|
||||
|
||||
/**
|
||||
* 风险球机覆盖度
|
||||
* @param dto
|
||||
* @return List<MonitoringCoverageVo>
|
||||
* @author cwchen
|
||||
* @date 2024/12/11 14:33
|
||||
*/
|
||||
List<MonitoringCoverageVo> getCoverRate(ParamsDto dto);
|
||||
|
||||
/**
|
||||
* 球机速率正常/异常数量
|
||||
* @param dto
|
||||
* @return List<MonitoringCoverageVo>
|
||||
* @author cwchen
|
||||
* @date 2024/12/11 14:53
|
||||
*/
|
||||
List<MonitoringCoverageVo> getSpeedNum(ParamsDto dto);
|
||||
|
||||
/**
|
||||
* 监控活跃度分析详情
|
||||
* @param dto
|
||||
* @return List<MonitoringDetailVo>
|
||||
* @author cwchen
|
||||
* @date 2024/12/11 16:45
|
||||
*/
|
||||
List<MonitoringDetailVo> getMonitoringHydList(ParamsDto dto);
|
||||
}
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
package com.sercurityControl.proteam.supplement.service;
|
||||
|
||||
import com.securityControl.common.core.web.domain.AjaxResult;
|
||||
import com.sercurityControl.proteam.supplement.domain.dto.ParamsDto;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @className:MonitoringCoverageService
|
||||
* @author:cwchen
|
||||
* @date:2024-12-11-9:17
|
||||
* @version:1.0
|
||||
* @description:监控覆盖-service
|
||||
*/
|
||||
public interface MonitoringCoverageService {
|
||||
/**
|
||||
* 监控覆盖-活跃度分析
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @author cwchen
|
||||
* @date 2024/12/11 10:21
|
||||
*/
|
||||
AjaxResult getHyd(ParamsDto dto);
|
||||
|
||||
/**
|
||||
* 监控覆盖-覆盖度分析
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @author cwchen
|
||||
* @date 2024/12/11 13:08
|
||||
*/
|
||||
AjaxResult getFgd(ParamsDto dto);
|
||||
|
||||
/**
|
||||
* 地图球机
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @author cwchen
|
||||
* @date 2024/12/11 13:26
|
||||
*/
|
||||
AjaxResult getMap(ParamsDto dto);
|
||||
|
||||
/**
|
||||
* 球机异常数量
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @author cwchen
|
||||
* @date 2024/12/11 14:10
|
||||
*/
|
||||
AjaxResult getErrorNum(ParamsDto dto);
|
||||
|
||||
/**
|
||||
* 下行观看分析
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @author cwchen
|
||||
* @date 2024/12/11 14:22
|
||||
*/
|
||||
AjaxResult getWatchNum(ParamsDto dto);
|
||||
|
||||
/**
|
||||
* 风险球机覆盖度
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @author cwchen
|
||||
* @date 2024/12/11 14:32
|
||||
*/
|
||||
AjaxResult getCoverRate(ParamsDto dto);
|
||||
|
||||
/**
|
||||
* 球机速率正常/异常数量
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @author cwchen
|
||||
* @date 2024/12/11 14:53
|
||||
*/
|
||||
AjaxResult getSpeedNum(ParamsDto dto);
|
||||
|
||||
/**
|
||||
* 监控活跃度分析详情
|
||||
* @param dto
|
||||
* @return Map<String,Object>
|
||||
* @author cwchen
|
||||
* @date 2024/12/11 16:41
|
||||
*/
|
||||
Map<String, Object> getMonitoringHydList(ParamsDto dto);
|
||||
}
|
||||
|
|
@ -0,0 +1,174 @@
|
|||
package com.sercurityControl.proteam.supplement.service.impl;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.securityControl.common.core.constant.HttpStatus;
|
||||
import com.securityControl.common.core.web.domain.AjaxResult;
|
||||
import com.sercurityControl.proteam.supplement.domain.dto.ParamsDto;
|
||||
import com.sercurityControl.proteam.supplement.domain.vo.MonitoringCoverageVo;
|
||||
import com.sercurityControl.proteam.supplement.domain.vo.MonitoringDetailVo;
|
||||
import com.sercurityControl.proteam.supplement.domain.vo.ProVioVo;
|
||||
import com.sercurityControl.proteam.supplement.mapper.MonitoringCoverageMapper;
|
||||
import com.sercurityControl.proteam.supplement.service.MonitoringCoverageService;
|
||||
import com.sercurityControl.proteam.util.DateTimeHelper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @className:MonitoringCoverageServiceImpl
|
||||
* @author:cwchen
|
||||
* @date:2024-12-11-9:18
|
||||
* @version:1.0
|
||||
* @description:监控覆盖-impl
|
||||
*/
|
||||
@Service("MonitoringCoverageService")
|
||||
@Slf4j
|
||||
public class MonitoringCoverageServiceImpl implements MonitoringCoverageService {
|
||||
|
||||
@Resource(name = "MonitoringCoverageMapper")
|
||||
private MonitoringCoverageMapper mapper;
|
||||
|
||||
@Override
|
||||
public AjaxResult getHyd(ParamsDto dto) {
|
||||
List<MonitoringCoverageVo> list = null;
|
||||
try {
|
||||
list = mapper.getHyd(dto);
|
||||
int num = 0;
|
||||
Date endDate = new Date();
|
||||
for (MonitoringCoverageVo vo : list) {
|
||||
num ++;
|
||||
vo.setNum(num);
|
||||
Date runTime = DateTimeHelper.parse(vo.getRunTime(), "yyyy-MM-dd HH:mm:ss");
|
||||
String gapTime = DateTimeHelper.getGapTime(endDate, runTime);
|
||||
long timeValue = DateTimeHelper.getGapTime2(endDate, runTime);
|
||||
vo.setTime(gapTime);
|
||||
vo.setTimeValue(timeValue);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getFgd(ParamsDto dto) {
|
||||
List<MonitoringCoverageVo> list = null;
|
||||
try {
|
||||
list = mapper.getFgd(dto);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getMap(ParamsDto dto) {
|
||||
List<MonitoringCoverageVo> list = null;
|
||||
try {
|
||||
list = mapper.getMap(dto);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getErrorNum(ParamsDto dto) {
|
||||
List<MonitoringCoverageVo> list = null;
|
||||
try {
|
||||
list = mapper.getErrorNum(dto);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getWatchNum(ParamsDto dto) {
|
||||
List<MonitoringCoverageVo> list = null;
|
||||
try {
|
||||
list = mapper.getWatchNum(dto);
|
||||
int num = 0;
|
||||
for (MonitoringCoverageVo vo : list) {
|
||||
num ++;
|
||||
vo.setNum(num);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getCoverRate(ParamsDto dto) {
|
||||
List<MonitoringCoverageVo> list = null;
|
||||
try {
|
||||
list = mapper.getCoverRate(dto);
|
||||
for (MonitoringCoverageVo vo : list) {
|
||||
vo.setTwoRate(handleRate(vo.getTwoRiskNum(), vo.getTotalRiskNum()));
|
||||
vo.setThreeRate(handleRate(vo.getThreeRiskNum(), vo.getTotalRiskNum()));
|
||||
vo.setFourRate(handleRate(vo.getFourRiskNum(), vo.getTotalRiskNum()));
|
||||
vo.setFiveRate(handleRate(vo.getFiveRiskNum(), vo.getTotalRiskNum()));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
public static double handleRate(int a, int b) {
|
||||
if (a == 0 || b == 0) {
|
||||
return 0.0;
|
||||
}
|
||||
double ratio = (double) (a * 100) / b;
|
||||
return Double.valueOf(String.format("%.2f", ratio));
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getSpeedNum(ParamsDto dto) {
|
||||
List<MonitoringCoverageVo> list = null;
|
||||
try {
|
||||
list = mapper.getSpeedNum(dto);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getMonitoringHydList(ParamsDto dto) {
|
||||
PageHelper.startPage(dto.getPage(), dto.getLimit());
|
||||
Map<String, Object> map = new HashMap<>(16);
|
||||
List<MonitoringDetailVo> list = null;
|
||||
try {
|
||||
list = mapper.getMonitoringHydList(dto);
|
||||
int num = 0;
|
||||
Date endDate = new Date();
|
||||
for (MonitoringDetailVo vo : list) {
|
||||
num ++;
|
||||
vo.setNum(num);
|
||||
Date runTime = DateTimeHelper.parse(vo.getTime(), "yyyy-MM-dd HH:mm:ss");
|
||||
String gapTime = DateTimeHelper.getGapTime(endDate, runTime);
|
||||
long timeValue = DateTimeHelper.getGapTime2(endDate, runTime);
|
||||
vo.setTimeValue(gapTime);
|
||||
vo.setTimeValue2(timeValue);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
PageInfo<MonitoringDetailVo> pageInfo = new PageInfo<>(list);
|
||||
map.put("code", HttpStatus.SUCCESS);
|
||||
map.put("msg", "获取数据成功");
|
||||
map.put("count", pageInfo.getTotal());
|
||||
map.put("curr", dto.getPage());
|
||||
map.put("limit", dto.getLimit());
|
||||
map.put("data", pageInfo.getList());
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
|
@ -242,7 +242,6 @@ public class DateTimeHelper {
|
|||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -646,4 +645,42 @@ public class DateTimeHelper {
|
|||
String time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
|
||||
return time;
|
||||
}
|
||||
|
||||
public static String getGapTime(Date date1, Date date2) {
|
||||
// 相差的毫秒值
|
||||
Long milliseconds = date1.getTime() - date2.getTime();
|
||||
|
||||
long nd = 1000 * 24 * 60 * 60;// 一天的毫秒数
|
||||
long nh = 1000 * 60 * 60;// 一小时的毫秒数
|
||||
long nm = 1000 * 60;// 一分钟的毫秒数
|
||||
long ns = 1000;// 一秒钟的毫秒数
|
||||
|
||||
long day = milliseconds / nd; // 计算相差多少天
|
||||
long hour = milliseconds % nd / nh; // 计算相差剩余多少小时
|
||||
long min = milliseconds % nd % nh / nm; // 计算相差剩余多少分钟
|
||||
long sec = milliseconds % nd % nh % nm / ns; // 计算相差剩余多少秒
|
||||
// System.out.println("时间相差:" + day + "天" + hour + "小时" + min + "分钟" + sec + "秒");
|
||||
|
||||
|
||||
long hourAll = milliseconds / nh; // 计算相差多少小时
|
||||
// System.out.println("时间相差:" + hourAll + "小时" + min + "分钟" + sec + "秒");
|
||||
|
||||
|
||||
long min2 = milliseconds / nm; // 计算相差多少分钟
|
||||
// System.out.println("时间相差:" + min2 + "分钟" + sec + "秒");
|
||||
|
||||
String overTime = hourAll + "小时" + min + "分" + sec + "秒";
|
||||
return overTime;
|
||||
}
|
||||
|
||||
public static long getGapTime2(Date date1, Date date2) {
|
||||
// 相差的毫秒值
|
||||
Long milliseconds = date1.getTime() - date2.getTime();
|
||||
long nd = 1000 * 24 * 60 * 60;// 一天的毫秒数
|
||||
long nh = 1000 * 60 * 60;// 一小时的毫秒数
|
||||
long nm = 1000 * 60;// 一分钟的毫秒数
|
||||
long ns = 1000;// 一秒钟的毫秒数
|
||||
long sec = milliseconds / ns; // 计算相差剩余多少秒
|
||||
return sec;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,143 @@
|
|||
<?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.sercurityControl.proteam.supplement.mapper.MonitoringCoverageMapper">
|
||||
|
||||
<!--监控覆盖-活跃度分析-->
|
||||
<select id="getHyd" resultType="com.sercurityControl.proteam.supplement.domain.vo.MonitoringCoverageVo">
|
||||
SELECT jjmc.class_id AS id,
|
||||
td.mac_id AS name,
|
||||
DATE_FORMAT(jjmc.run_time,'%Y-%m-%d %H:%i:%s') AS runTime
|
||||
FROM jj_monitoring_coverage jjmc
|
||||
LEFT JOIN t_device td ON jjmc.camera_no = td.t_code
|
||||
ORDER BY jjmc.run_time
|
||||
</select>
|
||||
<!--监控覆盖-覆盖度分析-->
|
||||
<select id="getFgd" resultType="com.sercurityControl.proteam.supplement.domain.vo.MonitoringCoverageVo">
|
||||
SELECT so.city_name AS name,
|
||||
a.num,
|
||||
so.org_id AS id
|
||||
FROM sys_org so
|
||||
LEFT JOIN (
|
||||
SELECT jjcm.build_unit_code AS org,
|
||||
COUNT(jjcm.build_unit_code) AS num
|
||||
FROM jj_monitoring_coverage jjmc
|
||||
LEFT JOIN jj_class_meetting jjcm ON jjmc.class_id = jjcm.id
|
||||
GROUP BY jjcm.build_unit_code
|
||||
) a ON so.org_id = a.org
|
||||
ORDER BY IFNULL(a.num,0) DESC
|
||||
</select>
|
||||
<!--地图球机-->
|
||||
<select id="getMap" resultType="com.sercurityControl.proteam.supplement.domain.vo.MonitoringCoverageVo">
|
||||
SELECT jjcm.re_assessment_risk_level AS riskLevel,
|
||||
jjcm.tool_box_talk_address AS address,
|
||||
td.mac_id AS name,
|
||||
jjcm.tool_box_talk_longitude AS lon,
|
||||
jjcm.tool_box_talk_Latitude AS lat
|
||||
FROM jj_monitoring_coverage jjmc
|
||||
LEFT JOIN jj_class_meetting jjcm ON jjmc.class_id = jjcm.id
|
||||
LEFT JOIN t_device td ON jjmc.camera_no = td.t_code
|
||||
</select>
|
||||
<!--球机异常数量-->
|
||||
<select id="getErrorNum"
|
||||
resultType="com.sercurityControl.proteam.supplement.domain.vo.MonitoringCoverageVo">
|
||||
SELECT jjmc.error_type AS name,COUNT(jjmc.error_type) AS num
|
||||
FROM jj_monitoring_coverage jjmc
|
||||
WHERE jjmc.error_type IN ('1','2','3','4','5','6')
|
||||
GROUP BY jjmc.error_type
|
||||
</select>
|
||||
<!--下行观看分析-->
|
||||
<select id="getWatchNum"
|
||||
resultType="com.sercurityControl.proteam.supplement.domain.vo.MonitoringCoverageVo">
|
||||
SELECT td.mac_id AS name,
|
||||
jjmc.watch_time AS watchTime,
|
||||
jjmc.class_id AS id
|
||||
FROM jj_monitoring_coverage jjmc
|
||||
LEFT JOIN t_device td ON jjmc.camera_no = td.t_code
|
||||
ORDER BY jjmc.watch_time DESC
|
||||
</select>
|
||||
<!--风险球机覆盖度-->
|
||||
<select id="getCoverRate"
|
||||
resultType="com.sercurityControl.proteam.supplement.domain.vo.MonitoringCoverageVo">
|
||||
SELECT COUNT(IF(jjcm.re_assessment_risk_level = '2',1,null)) AS twoRiskNum,
|
||||
COUNT(IF(jjcm.re_assessment_risk_level = '3',1,null)) AS threeRiskNum,
|
||||
COUNT(IF(jjcm.re_assessment_risk_level = '4',1,null)) AS fourRiskNum,
|
||||
COUNT(IF(jjcm.re_assessment_risk_level = '5',1,null)) AS fiveRiskNum,
|
||||
COUNT(jjcm.re_assessment_risk_level) AS totalRiskNum
|
||||
FROM jj_monitoring_coverage jjmc
|
||||
LEFT JOIN jj_class_meetting jjcm ON jjcm.id = jjmc.class_id
|
||||
</select>
|
||||
<!--球机速率正常/异常数量-->
|
||||
<select id="getSpeedNum"
|
||||
resultType="com.sercurityControl.proteam.supplement.domain.vo.MonitoringCoverageVo">
|
||||
SELECT COUNT(IF(jjmc.error_type = '7',1,null)) AS errorNum,
|
||||
COUNT(IF(jjmc.error_type != '7',1,null)) AS normalNum
|
||||
FROM jj_monitoring_coverage jjmc
|
||||
</select>
|
||||
<!--监控活跃度分析、监控覆盖度分析、下行观看分析详情-->
|
||||
<select id="getMonitoringHydList"
|
||||
resultType="com.sercurityControl.proteam.supplement.domain.vo.MonitoringDetailVo">
|
||||
SELECT jjcm.id AS id,
|
||||
jjcm.bidding_section_name AS proName,
|
||||
jjcm.re_assessment_risk_level AS riskLevel,
|
||||
jjcmi.work_manage AS workManager,
|
||||
jjcmi.work_manage_phone AS workManagerPhone,
|
||||
jjcm.tool_box_talk_longitude AS lon,
|
||||
jjcm.tool_box_talk_Latitude AS lat,
|
||||
so.city_name AS org,
|
||||
jjcmi.team_name AS teamName,
|
||||
td.mac_id AS name,
|
||||
DATE_FORMAT(jjmc.run_time,'%Y-%m-%d %H:%i:%s') AS time,
|
||||
jjmc.watch_time AS watchTime,
|
||||
CASE jjmc.error_type
|
||||
WHEN '1' THEN '球机正常'
|
||||
WHEN '2' THEN '异常掉线'
|
||||
WHEN '3' THEN '画面不清晰'
|
||||
WHEN '4' THEN '不流畅'
|
||||
WHEN '5' THEN '信号弱'
|
||||
WHEN '6' THEN '人为遮挡'
|
||||
END AS errorName
|
||||
FROM jj_monitoring_coverage jjmc
|
||||
LEFT JOIN t_device td ON jjmc.camera_no = td.t_code
|
||||
LEFT JOIN jj_class_meetting jjcm ON jjmc.class_id = jjcm.id
|
||||
LEFT JOIN jj_class_metting_info jjcmi ON jjcm.id = jjcmi.class_id
|
||||
LEFT JOIN sys_org so ON jjcm.build_unit_code = so.org_id
|
||||
<where>
|
||||
<if test="id!=null and id!=''">
|
||||
AND jjmc.class_id = #{id}
|
||||
</if>
|
||||
<if test="proName!=null and proName!=''">
|
||||
AND INSTR(jjcm.bidding_section_name,#{proName}) > 0
|
||||
</if>
|
||||
<if test="org!=null and org!=''">
|
||||
AND jjcm.build_unit_code = #{org}
|
||||
</if>
|
||||
<if test="riskLevel!=null and riskLevel!=''">
|
||||
AND jjcm.re_assessment_risk_level = #{riskLevel}
|
||||
</if>
|
||||
<if test="teamName!=null and teamName!=''">
|
||||
AND INSTR(jjcmi.team_name,#{teamName}) > 0
|
||||
</if>
|
||||
<if test="workManager!=null and workManager!=''">
|
||||
AND INSTR(jjcmi.work_manage,#{workManager}) > 0
|
||||
</if>
|
||||
<if test="operType == 1">
|
||||
AND jjmc.error_type NOT IN ('7')
|
||||
</if>
|
||||
<if test="operType == 2">
|
||||
AND jjmc.error_type = '7'
|
||||
</if>
|
||||
<if test="errorType!='' and errorType!=null">
|
||||
AND jjmc.error_type = #{errorType}
|
||||
</if>
|
||||
<if test="errorType==null or errorType == ''">
|
||||
AND jjmc.error_type NOT IN ('7')
|
||||
</if>
|
||||
</where>
|
||||
<if test="type == 1">
|
||||
ORDER BY jjmc.run_time
|
||||
</if>
|
||||
<if test="type == 3">
|
||||
ORDER BY jjmc.watch_time DESC
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
jjcmi.work_manage_phone AS workManagerPhone,
|
||||
jjcmi.work_gx AS gx,
|
||||
jjcmi.work_site AS workSite,
|
||||
jjcm.current_constr_date AS time
|
||||
jjcmi.main_risk AS riskCost
|
||||
FROM jj_class_meetting jjcm
|
||||
LEFT JOIN jj_class_metting_info jjcmi ON jjcm.id = jjcmi.class_id
|
||||
LEFT JOIN jj_ticket jjt ON jjcm.ticket_id = jjt.id
|
||||
|
|
@ -27,7 +27,7 @@
|
|||
<if test="startDay!=null and startDay!='' and endDay!=null and endDay!=''">
|
||||
AND jjcm.current_constr_date BETWEEN #{startDay} AND #{endDay}
|
||||
</if>
|
||||
AND jjcm.delete_flag = '0'
|
||||
AND jjcm.delete_flag = 0
|
||||
</where>
|
||||
ORDER BY jjcm.create_time DESC
|
||||
</select>
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
<if test="startDay!=null and startDay!='' and endDay!=null and endDay!=''">
|
||||
AND jjcm.current_constr_date BETWEEN #{startDay} AND #{endDay}
|
||||
</if>
|
||||
AND jjcm.delete_flag = '0'
|
||||
AND jjcm.delete_flag = 0
|
||||
</where>
|
||||
ORDER BY jjcm.create_time DESC
|
||||
</select>
|
||||
|
|
|
|||
Loading…
Reference in New Issue