部分视频扬尘
This commit is contained in:
parent
c2e327d9a0
commit
de76ea0333
@ -1,9 +1,19 @@
|
|||||||
package com.zhgd.xmgl.base.entity.vo;
|
package com.zhgd.xmgl.base.entity.vo;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
import com.zhgd.xmgl.modules.city.engineering.entity.Engineering;
|
import com.zhgd.xmgl.modules.city.engineering.entity.Engineering;
|
||||||
|
import com.zhgd.xmgl.modules.city.government.entity.Government;
|
||||||
|
import com.zhgd.xmgl.modules.city.government.mapper.GovernmentMapper;
|
||||||
|
import com.zhgd.xmgl.security.SecurityUser;
|
||||||
|
import com.zhgd.xmgl.security.SecurityUtil;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import org.apache.commons.collections.MapUtils;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class CityAndDistrictDeviceCountVo extends Engineering {
|
public class CityAndDistrictDeviceCountVo extends Engineering {
|
||||||
@ -49,4 +59,23 @@ public class CityAndDistrictDeviceCountVo extends Engineering {
|
|||||||
@ApiModelProperty("超控制")
|
@ApiModelProperty("超控制")
|
||||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
private Integer overControlCount;
|
private Integer overControlCount;
|
||||||
|
|
||||||
|
public static CityAndDistrictDeviceCountVo getCity(List<CityAndDistrictDeviceCountVo> list, GovernmentMapper governmentMapper) {
|
||||||
|
SecurityUser user = SecurityUtil.getUser();
|
||||||
|
Government government = governmentMapper.selectOne(new LambdaQueryWrapper<Government>().eq(Government::getGovernmentSn, user.getSn()));
|
||||||
|
CityAndDistrictDeviceCountVo vo = new CityAndDistrictDeviceCountVo();
|
||||||
|
vo.setGovernmentName(government.getGovernmentName());
|
||||||
|
vo.setCount(list.stream().mapToInt(e -> e.getCount()).sum());
|
||||||
|
vo.setOnlineCount(list.stream().mapToInt(e -> e.getOnlineCount()).sum());
|
||||||
|
vo.setOfflineCount(list.stream().mapToInt(e -> e.getOfflineCount()).sum());
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void addCityIf(HashMap<String, Object> map, List<CityAndDistrictDeviceCountVo> list, GovernmentMapper governmentMapper) {
|
||||||
|
Integer showCity = MapUtils.getInteger(map, "showCity");
|
||||||
|
if (Objects.equals(showCity, 1)) {
|
||||||
|
list.add(0, getCity(list, governmentMapper));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -97,67 +97,8 @@ public class EntMonitorDevController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加
|
|
||||||
*
|
|
||||||
* @param monitorDev
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@OperLog(operModul = "项目视频管理", operType = "新增", operDesc = "添加视频管理表信息")
|
|
||||||
@ApiOperation(value = " 添加视频管理表信息", notes = "添加视频管理表信息", httpMethod = "POST")
|
|
||||||
@PostMapping(value = "/add")
|
|
||||||
public Result<MonitorDev> add(@RequestBody MonitorDev monitorDev) {
|
|
||||||
Result<MonitorDev> result = new Result<MonitorDev>();
|
|
||||||
monitorDevService.saveInfo(monitorDev);
|
|
||||||
result.success("添加成功!");
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 编辑
|
|
||||||
*
|
|
||||||
* @param monitorDev
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@OperLog(operModul = "项目视频管理", operType = "修改", operDesc = "编辑视频管理表信息")
|
|
||||||
@ApiOperation(value = "编辑视频管理表信息", notes = "编辑视频管理表信息", httpMethod = "POST")
|
|
||||||
@PostMapping(value = "/edit")
|
|
||||||
public Result<MonitorDev> edit(@RequestBody MonitorDev monitorDev) {
|
|
||||||
Result<MonitorDev> result = new Result<MonitorDev>();
|
|
||||||
MonitorDev monitorDevEntity = monitorDevService.getById(monitorDev.getMonitorId());
|
|
||||||
if (monitorDevEntity == null) {
|
|
||||||
result.error500("未找到对应实体");
|
|
||||||
} else {
|
|
||||||
boolean ok = monitorDevService.updateInfo(monitorDev);
|
|
||||||
if (ok) {
|
|
||||||
result.success("修改成功!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过id删除
|
|
||||||
* @param monitorDevEntity
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@OperLog(operModul = "项目视频管理", operType = "删除", operDesc = "删除视频管理表信息")
|
|
||||||
@ApiOperation(value = "删除视频管理表信息", notes = "删除视频管理表信息", httpMethod = "POST")
|
|
||||||
@ApiImplicitParam(name = "monitorId", value = "视频管理表ID", paramType = "body", required = true, dataType = "Integer")
|
|
||||||
@PostMapping(value = "/delete")
|
|
||||||
public Result<MonitorDev> delete(@ApiIgnore @RequestBody MonitorDev monitorDevEntity) {
|
|
||||||
Result<MonitorDev> result = new Result<MonitorDev>();
|
|
||||||
MonitorDev monitorDev = monitorDevService.getById(monitorDevEntity.getMonitorId());
|
|
||||||
if (monitorDev == null) {
|
|
||||||
result.error500("未找到对应实体");
|
|
||||||
} else {
|
|
||||||
boolean ok = monitorDevService.removeById(monitorDevEntity.getMonitorId());
|
|
||||||
if (ok) {
|
|
||||||
result.success("删除成功!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过id查询
|
* 通过id查询
|
||||||
|
|||||||
@ -100,69 +100,6 @@ public class EnvironmentDevController {
|
|||||||
return Result.success(list);
|
return Result.success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加
|
|
||||||
*
|
|
||||||
* @param environmentDev
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@OperLog(operModul = "扬尘管理", operType = "新增", operDesc = "添加扬尘设备管理信息")
|
|
||||||
@ApiOperation(value = " 添加扬尘设备管理信息", notes = "添加扬尘设备管理信息", httpMethod = "POST")
|
|
||||||
@PostMapping(value = "/add")
|
|
||||||
public Result<EnvironmentDev> add(@RequestBody EnvironmentDev environmentDev) {
|
|
||||||
Result<EnvironmentDev> result = new Result<EnvironmentDev>();
|
|
||||||
environmentDevService.saveInfo(environmentDev);
|
|
||||||
result.success("添加成功!");
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 编辑
|
|
||||||
*
|
|
||||||
* @param environmentDev
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@OperLog(operModul = "扬尘管理", operType = "修改", operDesc = "编辑扬尘设备管理信息")
|
|
||||||
@ApiOperation(value = "编辑扬尘设备管理信息", notes = "编辑扬尘设备管理信息", httpMethod = "POST")
|
|
||||||
@PostMapping(value = "/edit")
|
|
||||||
public Result<EnvironmentDev> edit(@RequestBody EnvironmentDev environmentDev) {
|
|
||||||
Result<EnvironmentDev> result = new Result<EnvironmentDev>();
|
|
||||||
EnvironmentDev environmentDevEntity = environmentDevService.getById(environmentDev.getId());
|
|
||||||
if (environmentDevEntity == null) {
|
|
||||||
result.error500("未找到对应实体");
|
|
||||||
} else {
|
|
||||||
SecurityUser user = SecurityUtil.getUser();
|
|
||||||
environmentDev.setProjectSn(user.getSn());
|
|
||||||
boolean ok = environmentDevService.updateInfo(environmentDev);
|
|
||||||
if (ok) {
|
|
||||||
result.success("修改成功!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过id删除
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@OperLog(operModul = "扬尘管理", operType = "删除", operDesc = "删除扬尘设备管理信息")
|
|
||||||
@ApiOperation(value = "删除扬尘设备管理信息", notes = "删除扬尘设备管理信息", httpMethod = "POST")
|
|
||||||
@ApiImplicitParam(name = "id", value = "扬尘设备管理ID", paramType = "body", required = true, dataType = "Integer")
|
|
||||||
@PostMapping(value = "/delete")
|
|
||||||
public Result<EnvironmentDev> delete(@ApiIgnore @RequestBody EnvironmentDev environmentDev) {
|
|
||||||
Result<EnvironmentDev> result = new Result<EnvironmentDev>();
|
|
||||||
EnvironmentDev iEnvironmentDev = environmentDevService.getById(environmentDev.getId());
|
|
||||||
if (iEnvironmentDev == null) {
|
|
||||||
result.error500("未找到对应实体");
|
|
||||||
} else {
|
|
||||||
boolean ok = environmentDevService.removeById(environmentDev.getId());
|
|
||||||
if (ok) {
|
|
||||||
result.success("删除成功!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 列表查询
|
* 列表查询
|
||||||
|
|||||||
@ -7,11 +7,13 @@ import lombok.Data;
|
|||||||
public class EnvironmentDevCountVo {
|
public class EnvironmentDevCountVo {
|
||||||
@ApiModelProperty("已监管工程数量")
|
@ApiModelProperty("已监管工程数量")
|
||||||
private Integer supervisedEngineeringCount;
|
private Integer supervisedEngineeringCount;
|
||||||
@ApiModelProperty("已监管生产单位数量")
|
//@ApiModelProperty("已监管生产单位数量")
|
||||||
private Integer supervisedProductionUnitCount;
|
//private Integer supervisedProductionUnitCount;
|
||||||
@ApiModelProperty("扬尘噪声设备数量")
|
@ApiModelProperty("扬尘噪声设备数量")
|
||||||
private Integer dustNoiseEquipmentCount;
|
private Integer dustNoiseEquipmentCount;
|
||||||
@ApiModelProperty("扬尘噪声预警数量")
|
@ApiModelProperty("扬尘噪声报警数量")
|
||||||
private Integer dustAndNoiseWarningCount;
|
private Integer dustAndNoiseAlarmCount;
|
||||||
|
@ApiModelProperty("扬尘噪声监测覆盖率")
|
||||||
|
private Double dustAndNoiseCoverRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,7 +29,7 @@ public interface EnvironmentAlarmMapper extends BaseMapper<EnvironmentAlarm> {
|
|||||||
|
|
||||||
Integer statByEngineering();
|
Integer statByEngineering();
|
||||||
|
|
||||||
EnvironmentDevCountVo count();
|
Integer getCount();
|
||||||
|
|
||||||
List<EnvironmentAlarmTypeVo.TypeNum > countTodayEnvironmentAlarmGroupByType();
|
List<EnvironmentAlarmTypeVo.TypeNum > countTodayEnvironmentAlarmGroupByType();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.core.toolkit.Constants;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.zhgd.annotation.DataScope;
|
import com.zhgd.annotation.DataScope;
|
||||||
import com.zhgd.xmgl.modules.city.dust.entity.EnvironmentDev;
|
import com.zhgd.xmgl.modules.city.dust.entity.EnvironmentDev;
|
||||||
import com.zhgd.xmgl.modules.city.dust.entity.vo.EnvironmentDevCountVo;
|
|
||||||
import com.zhgd.xmgl.modules.city.monitor.entity.bo.OnlineGroupByProjectBo;
|
import com.zhgd.xmgl.modules.city.monitor.entity.bo.OnlineGroupByProjectBo;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
@ -36,7 +35,4 @@ public interface EnvironmentDevMapper extends BaseMapper<EnvironmentDev> {
|
|||||||
|
|
||||||
List<OnlineGroupByProjectBo> countGroupByProject();
|
List<OnlineGroupByProjectBo> countGroupByProject();
|
||||||
|
|
||||||
EnvironmentDevCountVo countInstallEngineering();
|
|
||||||
|
|
||||||
EnvironmentDevCountVo count();
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,8 +20,8 @@
|
|||||||
WHERE engineering_sn != ''
|
WHERE engineering_sn != ''
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="count" resultType="com.zhgd.xmgl.modules.city.dust.entity.vo.EnvironmentDevCountVo">
|
<select id="getCount" resultType="java.lang.Integer">
|
||||||
select count(*) dustAndNoiseWarningCount
|
select count(*)
|
||||||
from environment_alarm
|
from environment_alarm
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|||||||
@ -55,14 +55,5 @@
|
|||||||
group by md.engineering_sn
|
group by md.engineering_sn
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="countInstallEngineering" resultType="com.zhgd.xmgl.modules.city.dust.entity.vo.EnvironmentDevCountVo">
|
|
||||||
select count(*) supervisedEngineeringCount
|
|
||||||
from engineering e
|
|
||||||
where exists(select * from environment_dev ed where ed.engineering_sn = e.engineering_sn)
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="count" resultType="com.zhgd.xmgl.modules.city.dust.entity.vo.EnvironmentDevCountVo">
|
|
||||||
select count(*) dustNoiseEquipmentCount
|
|
||||||
from engineering e
|
|
||||||
</select>
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@ -29,6 +29,7 @@ import com.zhgd.xmgl.modules.city.dust.service.IDustNoiseDataService;
|
|||||||
import com.zhgd.xmgl.modules.city.dust.service.IEnvironmentAlarmService;
|
import com.zhgd.xmgl.modules.city.dust.service.IEnvironmentAlarmService;
|
||||||
import com.zhgd.xmgl.modules.city.dust.service.IEnvironmentDevService;
|
import com.zhgd.xmgl.modules.city.dust.service.IEnvironmentDevService;
|
||||||
import com.zhgd.xmgl.modules.city.engineering.entity.Engineering;
|
import com.zhgd.xmgl.modules.city.engineering.entity.Engineering;
|
||||||
|
import com.zhgd.xmgl.modules.city.engineering.mapper.EngineeringMapper;
|
||||||
import com.zhgd.xmgl.modules.city.engineering.service.IEngineeringService;
|
import com.zhgd.xmgl.modules.city.engineering.service.IEngineeringService;
|
||||||
import com.zhgd.xmgl.modules.city.monitor.entity.bo.OnlineGroupByProjectBo;
|
import com.zhgd.xmgl.modules.city.monitor.entity.bo.OnlineGroupByProjectBo;
|
||||||
import com.zhgd.xmgl.modules.city.project.service.IProjectService;
|
import com.zhgd.xmgl.modules.city.project.service.IProjectService;
|
||||||
@ -40,6 +41,7 @@ import org.springframework.stereotype.Service;
|
|||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@ -70,6 +72,8 @@ public class EnvironmentDevServiceImpl extends ServiceImpl<EnvironmentDevMapper,
|
|||||||
private IEnvironmentAlarmService environmentAlarmService;
|
private IEnvironmentAlarmService environmentAlarmService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private EnvironmentAlarmMapper environmentAlarmMapper;
|
private EnvironmentAlarmMapper environmentAlarmMapper;
|
||||||
|
@Autowired
|
||||||
|
private EngineeringMapper engineeringMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<EnvironmentDev> pageList(Page page, Wrapper<EnvironmentDev> wrapper) {
|
public Page<EnvironmentDev> pageList(Page page, Wrapper<EnvironmentDev> wrapper) {
|
||||||
@ -165,11 +169,11 @@ public class EnvironmentDevServiceImpl extends ServiceImpl<EnvironmentDevMapper,
|
|||||||
public EnvironmentDevStatDto statistics() {
|
public EnvironmentDevStatDto statistics() {
|
||||||
EnvironmentDevStatDto environmentDev = new EnvironmentDevStatDto();
|
EnvironmentDevStatDto environmentDev = new EnvironmentDevStatDto();
|
||||||
/* if (type == 1) {
|
/* if (type == 1) {
|
||||||
int installNum = this.count(Wrappers.<EnvironmentDev>lambdaQuery().isNotNull(EnvironmentDev::getProjectSn));
|
int installNum = this.getCount(Wrappers.<EnvironmentDev>lambdaQuery().isNotNull(EnvironmentDev::getProjectSn));
|
||||||
Integer projectNum = projectService.list(Wrappers.<Project>lambdaQuery().eq(Project::getState, 1)).size();
|
Integer projectNum = projectService.list(Wrappers.<Project>lambdaQuery().eq(Project::getState, 1)).size();
|
||||||
environmentDev.setInstallNum(installNum);
|
environmentDev.setInstallNum(installNum);
|
||||||
environmentDev.setUseRate(projectNum == 0 ? 0 : NumberUtil.round(installNum * 100F / projectNum, 2).floatValue());
|
environmentDev.setUseRate(projectNum == 0 ? 0 : NumberUtil.round(installNum * 100F / projectNum, 2).floatValue());
|
||||||
environmentDev.setTotalAlarm(environmentAlarmService.count(Wrappers.<EnvironmentAlarm>lambdaQuery().isNotNull(EnvironmentAlarm::getProjectSn)));
|
environmentDev.setTotalAlarm(environmentAlarmService.getCount(Wrappers.<EnvironmentAlarm>lambdaQuery().isNotNull(EnvironmentAlarm::getProjectSn)));
|
||||||
} else {*/
|
} else {*/
|
||||||
int installNum = this.statByEngineering();
|
int installNum = this.statByEngineering();
|
||||||
Integer engineeringNum = engineeringService.list(Wrappers.<Engineering>lambdaQuery().eq(Engineering::getExamineState, 3)).size();
|
Integer engineeringNum = engineeringService.list(Wrappers.<Engineering>lambdaQuery().eq(Engineering::getExamineState, 3)).size();
|
||||||
@ -195,9 +199,13 @@ public class EnvironmentDevServiceImpl extends ServiceImpl<EnvironmentDevMapper,
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EnvironmentDevCountVo countEnvironmentDev() {
|
public EnvironmentDevCountVo countEnvironmentDev() {
|
||||||
EnvironmentDevCountVo vo = baseMapper.countInstallEngineering();
|
HashMap<String, Object> map = new HashMap<>();
|
||||||
vo.setDustNoiseEquipmentCount(baseMapper.count().getDustNoiseEquipmentCount());
|
EnvironmentDevCountVo vo = new EnvironmentDevCountVo();
|
||||||
vo.setDustAndNoiseWarningCount(environmentAlarmMapper.count().getDustAndNoiseWarningCount());
|
vo.setDustNoiseEquipmentCount(baseMapper.statByDevNum());
|
||||||
|
vo.setDustAndNoiseAlarmCount(environmentAlarmMapper.getCount());
|
||||||
|
vo.setSupervisedEngineeringCount(baseMapper.statByEngineering());
|
||||||
|
Integer count = engineeringMapper.getCount(map);
|
||||||
|
vo.setDustAndNoiseCoverRate(Double.valueOf(NumberUtil.roundStr((double) vo.getSupervisedEngineeringCount() / Double.valueOf(count) * 100, 2)));
|
||||||
return vo;
|
return vo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -73,10 +73,6 @@ public class Engineering implements Serializable {
|
|||||||
@ApiModelProperty(value = "工程类别(1:房屋建筑;2:市政公用工程;3:轨道交通工程;4:公共建设项目;5:其他)")
|
@ApiModelProperty(value = "工程类别(1:房屋建筑;2:市政公用工程;3:轨道交通工程;4:公共建设项目;5:其他)")
|
||||||
private Integer engineeringType;
|
private Integer engineeringType;
|
||||||
|
|
||||||
@TableField(exist = false)
|
|
||||||
@ApiModelProperty(value = "工程类别名称")
|
|
||||||
private String engineeringTypeName;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工程用途(字典数据)
|
* 工程用途(字典数据)
|
||||||
*/
|
*/
|
||||||
@ -85,9 +81,6 @@ public class Engineering implements Serializable {
|
|||||||
@ApiModelProperty(value = "工程用途(字典数据)")
|
@ApiModelProperty(value = "工程用途(字典数据)")
|
||||||
private Integer engineeringUse;
|
private Integer engineeringUse;
|
||||||
|
|
||||||
@TableField(exist = false)
|
|
||||||
@ApiModelProperty(value = "工程用途名称")
|
|
||||||
private String engineeringUseName;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工程造价(万元)
|
* 工程造价(万元)
|
||||||
@ -284,12 +277,6 @@ public class Engineering implements Serializable {
|
|||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "工程状态(1:未开工;2:在建;3:在建.普通停工;4:在建.处罚停工;5:在建.完工;6:待竣工;7:竣工;8:其他)")
|
@ApiModelProperty(value = "工程状态(1:未开工;2:在建;3:在建.普通停工;4:在建.处罚停工;5:在建.完工;6:待竣工;7:竣工;8:其他)")
|
||||||
private Integer state;
|
private Integer state;
|
||||||
/**
|
|
||||||
* 工程状态名称
|
|
||||||
*/
|
|
||||||
@TableField(exist = false)
|
|
||||||
@ApiModelProperty(value = "工程状态名称")
|
|
||||||
private String stateName;
|
|
||||||
/**
|
/**
|
||||||
* 驳回原因
|
* 驳回原因
|
||||||
*/
|
*/
|
||||||
@ -302,6 +289,21 @@ public class Engineering implements Serializable {
|
|||||||
@ApiModelProperty(value = "工程AI预警信息统计")
|
@ApiModelProperty(value = "工程AI预警信息统计")
|
||||||
private String aiAlarmStat;
|
private String aiAlarmStat;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
@ApiModelProperty(value = "工程类别名称")
|
||||||
|
private String engineeringTypeName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工程状态名称
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
@ApiModelProperty(value = "工程状态名称")
|
||||||
|
private String stateName;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
@ApiModelProperty(value = "工程用途名称")
|
||||||
|
private String engineeringUseName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* AI预警状态(true预警;false正常)
|
* AI预警状态(true预警;false正常)
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -162,6 +162,9 @@
|
|||||||
<if test="engineeringType != null">
|
<if test="engineeringType != null">
|
||||||
and engineering_type = #{engineeringType}
|
and engineering_type = #{engineeringType}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="state != null">
|
||||||
|
and state = #{state}
|
||||||
|
</if>
|
||||||
<if test="engineeringCostBegin != null and engineeringCostBegin != ''">
|
<if test="engineeringCostBegin != null and engineeringCostBegin != ''">
|
||||||
and engineering_cost >= #{engineeringCostBegin}
|
and engineering_cost >= #{engineeringCostBegin}
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
@ -16,9 +16,8 @@ import com.zhgd.xmgl.modules.basicdata.constant.ParamConstants;
|
|||||||
import com.zhgd.xmgl.modules.basicdata.dto.MonitorTreeDto;
|
import com.zhgd.xmgl.modules.basicdata.dto.MonitorTreeDto;
|
||||||
import com.zhgd.xmgl.modules.city.engineering.entity.Engineering;
|
import com.zhgd.xmgl.modules.city.engineering.entity.Engineering;
|
||||||
import com.zhgd.xmgl.modules.city.monitor.entity.MonitorDev;
|
import com.zhgd.xmgl.modules.city.monitor.entity.MonitorDev;
|
||||||
|
import com.zhgd.xmgl.modules.city.monitor.entity.vo.MonitorDevVo;
|
||||||
import com.zhgd.xmgl.modules.city.monitor.service.IMonitorDevService;
|
import com.zhgd.xmgl.modules.city.monitor.service.IMonitorDevService;
|
||||||
import com.zhgd.xmgl.security.SecurityUser;
|
|
||||||
import com.zhgd.xmgl.security.SecurityUtil;
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
@ -32,6 +31,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import springfox.documentation.annotations.ApiIgnore;
|
import springfox.documentation.annotations.ApiIgnore;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@ -140,9 +140,12 @@ public class MonitorDevController {
|
|||||||
|
|
||||||
@OperLog(operModul = "项目视频管理", operType = "统计", operDesc = "统计市级和区级的监控点")
|
@OperLog(operModul = "项目视频管理", operType = "统计", operDesc = "统计市级和区级的监控点")
|
||||||
@ApiOperation(value = "统计市级和区级的监控点", notes = "统计市级和区级的监控点", httpMethod = "POST")
|
@ApiOperation(value = "统计市级和区级的监控点", notes = "统计市级和区级的监控点", httpMethod = "POST")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "showCity", value = "是否查询城市", paramType = "body", required = true, dataType = "Integer"),
|
||||||
|
})
|
||||||
@PostMapping(value = "/countCityAndDistrictMonitor")
|
@PostMapping(value = "/countCityAndDistrictMonitor")
|
||||||
public Result<List<CityAndDistrictDeviceCountVo>> countCityAndDistrictMonitor() {
|
public Result<List<CityAndDistrictDeviceCountVo>> countCityAndDistrictMonitor(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
|
||||||
List<CityAndDistrictDeviceCountVo> countCityAndDistrictMonitors = monitorDevService.countCityAndDistrictMonitor();
|
List<CityAndDistrictDeviceCountVo> countCityAndDistrictMonitors = monitorDevService.countCityAndDistrictMonitor(paramMap);
|
||||||
return Result.success(countCityAndDistrictMonitors);
|
return Result.success(countCityAndDistrictMonitors);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -161,5 +164,10 @@ public class MonitorDevController {
|
|||||||
return Result.success(pageList);
|
return Result.success(pageList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperLog(operModul = "项目视频管理", operType = "统计", operDesc = "统计监控总体概况")
|
||||||
|
@ApiOperation(value = "统计监控总体概况", notes = "统计监控总体概况", httpMethod = "POST")
|
||||||
|
@PostMapping(value = "/countMonitorDev")
|
||||||
|
public Result<MonitorDevVo> countMonitorDev() {
|
||||||
|
return Result.success(monitorDevService.countMonitorDev());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,18 @@
|
|||||||
|
package com.zhgd.xmgl.modules.city.monitor.entity.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class MonitorDevVo {
|
||||||
|
@ApiModelProperty("在监工程(未竣工)数量")
|
||||||
|
private Integer monitorEngineeringCount;
|
||||||
|
@ApiModelProperty("已安装视频工程数量")
|
||||||
|
private Integer installMonitorCount;
|
||||||
|
@ApiModelProperty("视频监控覆盖率")
|
||||||
|
private Double monitorCoverRate;
|
||||||
|
@ApiModelProperty("未安装视频工程数量")
|
||||||
|
private Integer uninstallMonitorEngineeringCount;
|
||||||
|
@ApiModelProperty("累计视频抓拍预警数量")
|
||||||
|
private Integer monitorQuestionWarningCount;
|
||||||
|
}
|
||||||
@ -16,7 +16,7 @@ import java.util.List;
|
|||||||
/**
|
/**
|
||||||
* @Description: 视频管理表
|
* @Description: 视频管理表
|
||||||
* @author: pds
|
* @author: pds
|
||||||
* @date: 2023-02-27
|
* @date: 2023-02-27
|
||||||
* @version: V1.0
|
* @version: V1.0
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
@ -36,4 +36,6 @@ public interface MonitorDevMapper extends BaseMapper<MonitorDev> {
|
|||||||
List<CityAndDistrictDeviceCountVo> countDistrictMonitor();
|
List<CityAndDistrictDeviceCountVo> countDistrictMonitor();
|
||||||
|
|
||||||
List<OnlineGroupByProjectBo> countOnlineGroupByProject();
|
List<OnlineGroupByProjectBo> countOnlineGroupByProject();
|
||||||
|
|
||||||
|
Integer getEngineeringCount();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,4 +28,5 @@ public interface MonitorQuestionMapper extends BaseMapper<MonitorQuestion> {
|
|||||||
Integer statByState();
|
Integer statByState();
|
||||||
|
|
||||||
Integer statByEngineering();
|
Integer statByEngineering();
|
||||||
|
Integer getCount();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -56,4 +56,9 @@
|
|||||||
FROM monitor_dev md
|
FROM monitor_dev md
|
||||||
group by md.engineering_sn
|
group by md.engineering_sn
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getEngineeringCount" resultType="java.lang.Integer">
|
||||||
|
SELECT count(distinct engineering_sn)
|
||||||
|
FROM monitor_dev
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@ -27,4 +27,8 @@
|
|||||||
LEFT JOIN engineering e ON q.engineering_sn = e.engineering_sn
|
LEFT JOIN engineering e ON q.engineering_sn = e.engineering_sn
|
||||||
WHERE q.id = #{id}
|
WHERE q.id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getCount" resultType="java.lang.Integer">
|
||||||
|
select count(*) from monitor_question
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@ -10,8 +10,10 @@ import com.zhgd.xmgl.modules.basicdata.dto.AppIndexDeviceDto;
|
|||||||
import com.zhgd.xmgl.modules.basicdata.dto.MonitorTreeDto;
|
import com.zhgd.xmgl.modules.basicdata.dto.MonitorTreeDto;
|
||||||
import com.zhgd.xmgl.modules.city.engineering.entity.Engineering;
|
import com.zhgd.xmgl.modules.city.engineering.entity.Engineering;
|
||||||
import com.zhgd.xmgl.modules.city.monitor.entity.MonitorDev;
|
import com.zhgd.xmgl.modules.city.monitor.entity.MonitorDev;
|
||||||
|
import com.zhgd.xmgl.modules.city.monitor.entity.vo.MonitorDevVo;
|
||||||
import com.zhgd.xmgl.modules.city.project.entity.Project;
|
import com.zhgd.xmgl.modules.city.project.entity.Project;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -36,11 +38,9 @@ public interface IMonitorDevService extends IService<MonitorDev> {
|
|||||||
|
|
||||||
AppIndexDeviceDto statDevNum();
|
AppIndexDeviceDto statDevNum();
|
||||||
|
|
||||||
boolean saveInfo(MonitorDev monitorDev);
|
List<CityAndDistrictDeviceCountVo> countCityAndDistrictMonitor(HashMap<String, Object> paramMap);
|
||||||
|
|
||||||
boolean updateInfo(MonitorDev monitorDev);
|
|
||||||
|
|
||||||
List<CityAndDistrictDeviceCountVo> countCityAndDistrictMonitor();
|
|
||||||
|
|
||||||
IPage<CityAndDistrictDeviceCountVo> queryEngineeringAndStatusPage(Page<Engineering> page, QueryWrapper<Engineering> wrapper);
|
IPage<CityAndDistrictDeviceCountVo> queryEngineeringAndStatusPage(Page<Engineering> page, QueryWrapper<Engineering> wrapper);
|
||||||
|
|
||||||
|
MonitorDevVo countMonitorDev();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package com.zhgd.xmgl.modules.city.monitor.service.impl;
|
package com.zhgd.xmgl.modules.city.monitor.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.hutool.core.util.NumberUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
@ -11,7 +12,6 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.zhgd.xmgl.base.entity.vo.CityAndDistrictDeviceCountVo;
|
import com.zhgd.xmgl.base.entity.vo.CityAndDistrictDeviceCountVo;
|
||||||
import com.zhgd.xmgl.handler.exception.CustomException;
|
|
||||||
import com.zhgd.xmgl.modules.basicdata.dto.AppIndexDeviceDto;
|
import com.zhgd.xmgl.modules.basicdata.dto.AppIndexDeviceDto;
|
||||||
import com.zhgd.xmgl.modules.basicdata.dto.MonitorTreeDto;
|
import com.zhgd.xmgl.modules.basicdata.dto.MonitorTreeDto;
|
||||||
import com.zhgd.xmgl.modules.basicdata.service.ISystemDictDataService;
|
import com.zhgd.xmgl.modules.basicdata.service.ISystemDictDataService;
|
||||||
@ -19,21 +19,20 @@ import com.zhgd.xmgl.modules.city.dust.mapper.EnvironmentDevMapper;
|
|||||||
import com.zhgd.xmgl.modules.city.engineering.entity.Engineering;
|
import com.zhgd.xmgl.modules.city.engineering.entity.Engineering;
|
||||||
import com.zhgd.xmgl.modules.city.engineering.mapper.EngineeringMapper;
|
import com.zhgd.xmgl.modules.city.engineering.mapper.EngineeringMapper;
|
||||||
import com.zhgd.xmgl.modules.city.engineering.service.IEngineeringService;
|
import com.zhgd.xmgl.modules.city.engineering.service.IEngineeringService;
|
||||||
import com.zhgd.xmgl.modules.city.government.entity.Government;
|
|
||||||
import com.zhgd.xmgl.modules.city.government.mapper.GovernmentMapper;
|
import com.zhgd.xmgl.modules.city.government.mapper.GovernmentMapper;
|
||||||
import com.zhgd.xmgl.modules.city.monitor.entity.MonitorDev;
|
import com.zhgd.xmgl.modules.city.monitor.entity.MonitorDev;
|
||||||
import com.zhgd.xmgl.modules.city.monitor.entity.bo.OnlineGroupByProjectBo;
|
import com.zhgd.xmgl.modules.city.monitor.entity.bo.OnlineGroupByProjectBo;
|
||||||
|
import com.zhgd.xmgl.modules.city.monitor.entity.vo.MonitorDevVo;
|
||||||
import com.zhgd.xmgl.modules.city.monitor.mapper.MonitorDevMapper;
|
import com.zhgd.xmgl.modules.city.monitor.mapper.MonitorDevMapper;
|
||||||
|
import com.zhgd.xmgl.modules.city.monitor.mapper.MonitorQuestionMapper;
|
||||||
import com.zhgd.xmgl.modules.city.monitor.service.IMonitorDevService;
|
import com.zhgd.xmgl.modules.city.monitor.service.IMonitorDevService;
|
||||||
import com.zhgd.xmgl.modules.city.project.entity.Project;
|
import com.zhgd.xmgl.modules.city.project.entity.Project;
|
||||||
import com.zhgd.xmgl.modules.wisdom.mapper.AiMonitorDevMapper;
|
import com.zhgd.xmgl.modules.wisdom.mapper.AiMonitorDevMapper;
|
||||||
import com.zhgd.xmgl.security.SecurityUser;
|
|
||||||
import com.zhgd.xmgl.security.SecurityUtil;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@ -62,6 +61,8 @@ public class MonitorDevServiceImpl extends ServiceImpl<MonitorDevMapper, Monitor
|
|||||||
private ISystemDictDataService systemDictDataService;
|
private ISystemDictDataService systemDictDataService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private GovernmentMapper governmentMapper;
|
private GovernmentMapper governmentMapper;
|
||||||
|
@Autowired
|
||||||
|
private MonitorQuestionMapper monitorQuestionMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<MonitorDev> pageList(Page page, Wrapper<MonitorDev> wrapper) {
|
public Page<MonitorDev> pageList(Page page, Wrapper<MonitorDev> wrapper) {
|
||||||
@ -172,39 +173,13 @@ public class MonitorDevServiceImpl extends ServiceImpl<MonitorDevMapper, Monitor
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean saveInfo(MonitorDev monitorDev) {
|
public List<CityAndDistrictDeviceCountVo> countCityAndDistrictMonitor(HashMap<String, Object> paramMap) {
|
||||||
MonitorDev monitorDevEntity = baseMapper.getByCode(monitorDev.getCode(), "ignoreDataScope");
|
|
||||||
if (monitorDevEntity != null) {
|
|
||||||
throw new CustomException("监控编码已存在,请重新输入!");
|
|
||||||
} else {
|
|
||||||
monitorDev.setCreateTime(new Date());
|
|
||||||
}
|
|
||||||
return this.save(monitorDev);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean updateInfo(MonitorDev monitorDev) {
|
|
||||||
MonitorDev monitorDevEntity = baseMapper.getByCode(monitorDev.getCode(), "ignoreDataScope");
|
|
||||||
if (monitorDevEntity != null && !monitorDevEntity.getMonitorId().equals(monitorDev.getMonitorId())) {
|
|
||||||
throw new CustomException("监控编码已存在,请重新输入!");
|
|
||||||
}
|
|
||||||
return this.updateById(monitorDev);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<CityAndDistrictDeviceCountVo> countCityAndDistrictMonitor() {
|
|
||||||
SecurityUser user = SecurityUtil.getUser();
|
|
||||||
List<CityAndDistrictDeviceCountVo> list = baseMapper.countDistrictMonitor();
|
List<CityAndDistrictDeviceCountVo> list = baseMapper.countDistrictMonitor();
|
||||||
Government government = governmentMapper.selectOne(new LambdaQueryWrapper<Government>().eq(Government::getGovernmentSn, user.getSn()));
|
CityAndDistrictDeviceCountVo.addCityIf(paramMap, list, governmentMapper);
|
||||||
CityAndDistrictDeviceCountVo vo = new CityAndDistrictDeviceCountVo();
|
|
||||||
vo.setGovernmentName(government.getGovernmentName());
|
|
||||||
vo.setCount(list.stream().mapToInt(e -> e.getCount()).sum());
|
|
||||||
vo.setOnlineCount(list.stream().mapToInt(e -> e.getOnlineCount()).sum());
|
|
||||||
vo.setOfflineCount(list.stream().mapToInt(e -> e.getOfflineCount()).sum());
|
|
||||||
list.add(0, vo);
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPage<CityAndDistrictDeviceCountVo> queryEngineeringAndStatusPage(Page<Engineering> page, QueryWrapper<Engineering> wrapper) {
|
public IPage<CityAndDistrictDeviceCountVo> queryEngineeringAndStatusPage(Page<Engineering> page, QueryWrapper<Engineering> wrapper) {
|
||||||
Page<Engineering> pageList = engineeringService.page(page, wrapper);
|
Page<Engineering> pageList = engineeringService.page(page, wrapper);
|
||||||
@ -218,4 +193,18 @@ public class MonitorDevServiceImpl extends ServiceImpl<MonitorDevMapper, Monitor
|
|||||||
});
|
});
|
||||||
return rtPage;
|
return rtPage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MonitorDevVo countMonitorDev() {
|
||||||
|
HashMap<String, Object> map = new HashMap<>();
|
||||||
|
MonitorDevVo vo = new MonitorDevVo();
|
||||||
|
Integer count = engineeringMapper.getCount(map);
|
||||||
|
map.put("state", 2);
|
||||||
|
vo.setMonitorEngineeringCount(engineeringMapper.getCount(map));
|
||||||
|
vo.setInstallMonitorCount(baseMapper.getEngineeringCount());
|
||||||
|
vo.setMonitorCoverRate(Double.valueOf(NumberUtil.roundStr((double) vo.getInstallMonitorCount() / Double.valueOf(count) * 100, 2)));
|
||||||
|
vo.setUninstallMonitorEngineeringCount(count - vo.getInstallMonitorCount());
|
||||||
|
vo.setMonitorQuestionWarningCount(monitorQuestionMapper.getCount());
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -183,7 +183,7 @@ public class FileDealComp {
|
|||||||
.eq(UserFile::getDeleteFlag, 0)
|
.eq(UserFile::getDeleteFlag, 0)
|
||||||
.eq(UserFile::getUserId, sessionUserId)
|
.eq(UserFile::getUserId, sessionUserId)
|
||||||
.groupBy(UserFile::getFilePath, UserFile::getFileName)
|
.groupBy(UserFile::getFilePath, UserFile::getFileName)
|
||||||
.having("count(file_name) >= 2");
|
.having("getCount(file_name) >= 2");
|
||||||
List<UserFile> repeatList = userFileMapper.selectList(lambdaQueryWrapper);
|
List<UserFile> repeatList = userFileMapper.selectList(lambdaQueryWrapper);
|
||||||
|
|
||||||
for (UserFile userFile : repeatList) {
|
for (UserFile userFile : repeatList) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user