部分视频扬尘
This commit is contained in:
parent
de76ea0333
commit
5ff717e6c6
@ -26,6 +26,12 @@ public class CityAndDistrictDeviceCountVo extends Engineering {
|
||||
@ApiModelProperty("总数")
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
private Integer count;
|
||||
@ApiModelProperty("工程总数")
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
private Integer engineeringCount;
|
||||
@ApiModelProperty("安装了的工程总数")
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
private Integer installEngineeringCount;
|
||||
@ApiModelProperty("在线数量")
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
private Integer onlineCount;
|
||||
|
||||
@ -41,7 +41,7 @@ public class SectorOneVo {
|
||||
|
||||
public static List<SectorOneVo> getSectorOneVosForGovernment(List<SectorOneVo> list, GovernmentMapper governmentMapper) {
|
||||
Map<String, SectorOneVo> map = list.stream().collect(Collectors.toMap(SectorOneVo::getName, Function.identity(), (o1, o2) -> o1));
|
||||
List<Government> myGovernments = governmentMapper.getMyGovernments(SecurityUtil.getUser().getSn());
|
||||
List<Government> myGovernments = governmentMapper.getMyUnderGovernments(SecurityUtil.getUser().getSn());
|
||||
List<SectorOneVo> rtList = new ArrayList<>();
|
||||
for (Government government : myGovernments) {
|
||||
String governmentName = government.getGovernmentName();
|
||||
|
||||
@ -21,7 +21,7 @@ public class TrendVo {
|
||||
|
||||
public static List<TrendVo> getTrendVosForGovernment(List<TrendVo> list, GovernmentMapper governmentMapper) {
|
||||
Map<String, TrendVo> map = list.stream().collect(Collectors.toMap(TrendVo::getX, Function.identity(), (o1, o2) -> o1));
|
||||
List<Government> myGovernments = governmentMapper.getMyGovernments(SecurityUtil.getUser().getSn());
|
||||
List<Government> myGovernments = governmentMapper.getMyUnderGovernments(SecurityUtil.getUser().getSn());
|
||||
List<TrendVo> rtList = new ArrayList<>();
|
||||
for (Government government : myGovernments) {
|
||||
String governmentName = government.getGovernmentName();
|
||||
|
||||
5
src/main/java/com/zhgd/xmgl/constant/CommonConstant.java
Normal file
5
src/main/java/com/zhgd/xmgl/constant/CommonConstant.java
Normal file
@ -0,0 +1,5 @@
|
||||
package com.zhgd.xmgl.constant;
|
||||
|
||||
public interface CommonConstant {
|
||||
public static final String IGNORE_DATA_SCOPE = "ignoreDataScope";
|
||||
}
|
||||
@ -193,7 +193,7 @@ public class DeepExcavationEngineeringServiceImpl extends ServiceImpl<DeepExcava
|
||||
public MultiTrendVo countDeepExcavationDistrict() {
|
||||
MultiTrendVo vo = new MultiTrendVo();
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
List<Government> myGovernments = governmentMapper.getMyGovernments(SecurityUtil.getUser().getSn());
|
||||
List<Government> myGovernments = governmentMapper.getMyUnderGovernments(SecurityUtil.getUser().getSn());
|
||||
List<String> names = myGovernments.stream().map(Government::getGovernmentName).collect(Collectors.toList());
|
||||
vo.setX(names);
|
||||
List<MultiTrendOne> datas = new ArrayList<>();
|
||||
|
||||
@ -3,7 +3,9 @@ package com.zhgd.xmgl.modules.city.dust.controller;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.zhgd.annotation.OperLog;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.xmgl.base.entity.vo.MultiTrendVo;
|
||||
import com.zhgd.xmgl.modules.city.dust.entity.EnvironmentAlarm;
|
||||
import com.zhgd.xmgl.modules.city.dust.entity.vo.EnvironmentAlarmRankVo;
|
||||
import com.zhgd.xmgl.modules.city.dust.entity.vo.EnvironmentAlarmTypeVo;
|
||||
import com.zhgd.xmgl.modules.city.dust.service.IEnvironmentAlarmService;
|
||||
import io.swagger.annotations.Api;
|
||||
@ -18,6 +20,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@ -58,29 +61,6 @@ public class EnvironmentAlarmController {
|
||||
return Result.success(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param environmentAlarm
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "扬尘报警管理", operType = "修改", operDesc = "编辑扬尘报警台账表信息")
|
||||
@ApiOperation(value = "编辑扬尘报警台账表信息", notes = "编辑扬尘报警台账表信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<EnvironmentAlarm> edit(@RequestBody EnvironmentAlarm environmentAlarm) {
|
||||
Result<EnvironmentAlarm> result = new Result<EnvironmentAlarm>();
|
||||
EnvironmentAlarm environmentAlarmEntity = environmentAlarmService.getById(environmentAlarm.getId());
|
||||
if (environmentAlarmEntity == null) {
|
||||
result.error500("未找到对应实体");
|
||||
} else {
|
||||
boolean ok = environmentAlarmService.updateById(environmentAlarm);
|
||||
if (ok) {
|
||||
result.success("修改成功!");
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@OperLog(operModul = "扬尘报警管理", operType = "统计", operDesc = "按类型统计今日预警")
|
||||
@ApiOperation(value = " 按类型统计今日预警", notes = "按类型统计今日预警", httpMethod = "POST")
|
||||
@PostMapping(value = "/countTodayEnvironmentAlarmGroupByType")
|
||||
@ -88,4 +68,27 @@ public class EnvironmentAlarmController {
|
||||
EnvironmentAlarmTypeVo list = environmentAlarmService.countTodayEnvironmentAlarmGroupByType();
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@OperLog(operModul = "扬尘报警管理", operType = "统计", operDesc = "统计监督执法不同区域闭合情况数量")
|
||||
@ApiOperation(value = "统计监督执法不同区域闭合情况数量", notes = "统计监督执法不同区域闭合情况数量", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "year", value = "年份:如2020", paramType = "body", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "month", value = "年份:如2020-11", paramType = "body", required = false, dataType = "String"),
|
||||
})
|
||||
@PostMapping(value = "/countEnvironmentAlarmDistrict")
|
||||
public Result<MultiTrendVo> countEnvironmentAlarmDistrict(@ApiIgnore @RequestBody Map<String, Object> map) {
|
||||
return Result.success(environmentAlarmService.countEnvironmentAlarmDistrict(map));
|
||||
}
|
||||
|
||||
@OperLog(operModul = "扬尘报警管理", operType = "统计", operDesc = "报警工程排名")
|
||||
@ApiOperation(value = "报警工程排名", notes = "报警工程排名", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "engineeringSn", value = "工程SN", paramType = "body", dataType = "String"),
|
||||
@ApiImplicitParam(name = "engineeringName", value = "工程名称", paramType = "body", dataType = "String"),
|
||||
})
|
||||
@PostMapping(value = "/getEnvironmentAlarmRank")
|
||||
public Result<IPage<EnvironmentAlarmRankVo>> getEnvironmentAlarmRank(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
|
||||
return Result.success(environmentAlarmService.getEnvironmentAlarmRank(paramMap));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -11,6 +11,7 @@ import com.zhgd.annotation.OperLog;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||
import com.zhgd.jeecg.common.util.PageUtil;
|
||||
import com.zhgd.xmgl.base.entity.vo.CityAndDistrictDeviceCountVo;
|
||||
import com.zhgd.xmgl.modules.basicdata.constant.ParamConstants;
|
||||
import com.zhgd.xmgl.modules.city.dust.entity.EnvironmentDev;
|
||||
import com.zhgd.xmgl.modules.city.dust.entity.vo.EngineeringAndEnvironmentDevVo;
|
||||
@ -18,8 +19,6 @@ import com.zhgd.xmgl.modules.city.dust.entity.vo.EnvironmentDevCountVo;
|
||||
import com.zhgd.xmgl.modules.city.dust.service.IEnvironmentDevService;
|
||||
import com.zhgd.xmgl.modules.city.engineering.entity.Engineering;
|
||||
import com.zhgd.xmgl.modules.wisdom.dto.EnvironmentDevDto;
|
||||
import com.zhgd.xmgl.security.SecurityUser;
|
||||
import com.zhgd.xmgl.security.SecurityUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
@ -33,6 +32,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -157,5 +157,15 @@ public class EnvironmentDevController {
|
||||
return Result.success(environmentDevService.countEnvironmentDev());
|
||||
}
|
||||
|
||||
@OperLog(operModul = "扬尘管理", operType = "统计", operDesc = "统计市级和区级的扬尘")
|
||||
@ApiOperation(value = "统计市级和区级的扬尘", notes = "统计市级和区级的扬尘", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "showCity", value = "是否查询城市", paramType = "body", required = true, dataType = "Integer"),
|
||||
})
|
||||
@PostMapping(value = "/countCityAndDistrictEnvironmentDev")
|
||||
public Result<List<CityAndDistrictDeviceCountVo>> countCityAndDistrictEnvironmentDev(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
|
||||
List<CityAndDistrictDeviceCountVo> countCityAndDistrictMonitors = environmentDevService.countCityAndDistrictEnvironmentDev(paramMap);
|
||||
return Result.success(countCityAndDistrictMonitors);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,10 @@
|
||||
package com.zhgd.xmgl.modules.city.dust.entity.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class EnvironmentAlarmRankVo {
|
||||
private String engineeringName;
|
||||
private String engineeringSn;
|
||||
private String count;
|
||||
}
|
||||
@ -2,16 +2,22 @@ package com.zhgd.xmgl.modules.city.dust.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zhgd.annotation.DataScope;
|
||||
import com.zhgd.xmgl.base.entity.vo.TrendVo;
|
||||
import com.zhgd.xmgl.modules.city.dust.entity.EnvironmentAlarm;
|
||||
import com.zhgd.xmgl.modules.city.dust.entity.vo.EnvironmentAlarmRankVo;
|
||||
import com.zhgd.xmgl.modules.city.dust.entity.vo.EnvironmentAlarmTypeVo;
|
||||
import com.zhgd.xmgl.modules.city.dust.entity.vo.EnvironmentDevCountVo;
|
||||
import com.zhgd.xmgl.modules.city.project.entity.Project;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 扬尘报警台账表
|
||||
@ -32,4 +38,8 @@ public interface EnvironmentAlarmMapper extends BaseMapper<EnvironmentAlarm> {
|
||||
Integer getCount();
|
||||
|
||||
List<EnvironmentAlarmTypeVo.TypeNum > countTodayEnvironmentAlarmGroupByType();
|
||||
|
||||
IPage<EnvironmentAlarmRankVo> getEnvironmentAlarmRank(Page<Project> page, @Param("param") HashMap<String, Object> paramMap);
|
||||
|
||||
List<TrendVo> countInspectRecordDistrict(Map<String, Object> map);
|
||||
}
|
||||
|
||||
@ -5,11 +5,13 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zhgd.annotation.DataScope;
|
||||
import com.zhgd.xmgl.base.entity.vo.CityAndDistrictDeviceCountVo;
|
||||
import com.zhgd.xmgl.modules.city.dust.entity.EnvironmentDev;
|
||||
import com.zhgd.xmgl.modules.city.monitor.entity.bo.OnlineGroupByProjectBo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -35,4 +37,5 @@ public interface EnvironmentDevMapper extends BaseMapper<EnvironmentDev> {
|
||||
|
||||
List<OnlineGroupByProjectBo> countGroupByProject();
|
||||
|
||||
List<CityAndDistrictDeviceCountVo> countCityAndDistrictEnvironmentDev(HashMap<String, Object> paramMap);
|
||||
}
|
||||
|
||||
@ -32,4 +32,36 @@
|
||||
where ea.create_time >= CURDATE()
|
||||
group by ea.type
|
||||
</select>
|
||||
|
||||
<select id="getEnvironmentAlarmRank" resultType="com.zhgd.xmgl.modules.city.dust.entity.vo.EnvironmentAlarmRankVo">
|
||||
select e.engineering_name, e.engineering_sn, count(d.id) count
|
||||
from engineering e
|
||||
left join environment_alarm d on d.engineering_sn = e.engineering_sn
|
||||
where 1 = 1
|
||||
<if test="param.engineeringSn != null and param.engineeringSn != ''">
|
||||
and e.engineering_sn like concat('%', #{param.engineeringSn}, '%')
|
||||
</if>
|
||||
<if test="param.engineeringName != null and param.engineeringName != ''">
|
||||
and e.engineering_name like concat('%', #{param.engineeringName}, '%')
|
||||
</if>
|
||||
group by e.engineering_sn
|
||||
order by count desc
|
||||
</select>
|
||||
|
||||
<select id="countInspectRecordDistrict" resultType="com.zhgd.xmgl.base.entity.vo.TrendVo">
|
||||
select g.government_name x, count(*) y
|
||||
from environment_alarm r
|
||||
join project p on r.project_sn = p.project_sn
|
||||
join government g on p.government_sn = g.government_sn
|
||||
where 1 = 1
|
||||
<if test="year != null and year != ''">
|
||||
and r.create_time >= #{year}
|
||||
and r.create_time <![CDATA[ < ]]> CAST((#{year} + 1) AS char)
|
||||
</if>
|
||||
<if test="month != null and month != ''">
|
||||
and r.create_time >= #{month}
|
||||
and r.create_time <![CDATA[ < ]]> DATE_ADD(concat(#{month}, '-01'), INTERVAL 1 month)
|
||||
</if>
|
||||
group by g.government_name
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -55,5 +55,23 @@
|
||||
group by md.engineering_sn
|
||||
</select>
|
||||
|
||||
|
||||
<select id="countCityAndDistrictEnvironmentDev"
|
||||
resultType="com.zhgd.xmgl.base.entity.vo.CityAndDistrictDeviceCountVo">
|
||||
SELECT g.government_name,
|
||||
count(md.id) count,
|
||||
ifnull(sum(if(md.state = 1, 1, 0)), 0) onlineCount,
|
||||
ifnull(sum(if(md.state = 0, 1, 0)), 0) offlineCount,
|
||||
count(distinct md.engineering_sn) installEngineeringCount,
|
||||
count(distinct e.engineering_sn) engineeringCount
|
||||
FROM government g
|
||||
left JOIN project p ON g.government_sn = p.government_sn
|
||||
left join engineering e on e.project_sn = p.project_sn
|
||||
left JOIN environment_dev md ON p.project_sn = md.project_sn
|
||||
where 1=1
|
||||
and g.government_sn in
|
||||
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
group by g.government_sn
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -1,11 +1,15 @@
|
||||
package com.zhgd.xmgl.modules.city.dust.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.zhgd.xmgl.base.entity.vo.MultiTrendVo;
|
||||
import com.zhgd.xmgl.modules.city.dust.entity.vo.EnvironmentAlarmRankVo;
|
||||
import com.zhgd.xmgl.modules.city.dust.entity.vo.EnvironmentAlarmTypeVo;
|
||||
import com.zhgd.xmgl.modules.wisdom.dto.MapEnvironAlarmDto;
|
||||
import com.zhgd.xmgl.modules.city.dust.entity.EnvironmentAlarm;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@ -23,4 +27,8 @@ public interface IEnvironmentAlarmService extends IService<EnvironmentAlarm> {
|
||||
boolean checkAlarm(String sn);
|
||||
|
||||
EnvironmentAlarmTypeVo countTodayEnvironmentAlarmGroupByType();
|
||||
|
||||
IPage<EnvironmentAlarmRankVo> getEnvironmentAlarmRank(HashMap<String, Object> paramMap);
|
||||
|
||||
MultiTrendVo countEnvironmentAlarmDistrict(Map<String, Object> map);
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.zhgd.xmgl.base.entity.vo.CityAndDistrictDeviceCountVo;
|
||||
import com.zhgd.xmgl.modules.basicdata.dto.EngineeringDeviceDto;
|
||||
import com.zhgd.xmgl.modules.basicdata.dto.ProjectDeviceDto;
|
||||
import com.zhgd.xmgl.modules.city.dust.entity.vo.EngineeringAndEnvironmentDevVo;
|
||||
@ -14,6 +15,7 @@ import com.zhgd.xmgl.modules.wisdom.dto.EnvironmentDevDto;
|
||||
import com.zhgd.xmgl.modules.wisdom.dto.EnvironmentDevStatDto;
|
||||
import com.zhgd.xmgl.modules.city.dust.entity.EnvironmentDev;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -48,4 +50,6 @@ public interface IEnvironmentDevService extends IService<EnvironmentDev> {
|
||||
IPage<EngineeringAndEnvironmentDevVo> queryEngineeringAndEnvironmentDevPage(Page<Engineering> page, QueryWrapper<Engineering> wrapper);
|
||||
|
||||
EnvironmentDevCountVo countEnvironmentDev();
|
||||
|
||||
List<CityAndDistrictDeviceCountVo> countCityAndDistrictEnvironmentDev(HashMap<String, Object> paramMap);
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@ -11,26 +12,30 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gexin.fastjson.JSON;
|
||||
import com.zhgd.jeecg.common.util.PageUtil;
|
||||
import com.zhgd.redis.lock.RedisRepository;
|
||||
import com.zhgd.xmgl.base.entity.vo.MultiTrendOne;
|
||||
import com.zhgd.xmgl.base.entity.vo.MultiTrendVo;
|
||||
import com.zhgd.xmgl.modules.basicdata.constant.CacheConstants;
|
||||
import com.zhgd.xmgl.modules.basicdata.constant.ParamConstants;
|
||||
import com.zhgd.xmgl.modules.city.dust.entity.DustNoiseData;
|
||||
import com.zhgd.xmgl.modules.city.dust.entity.EnvironmentAlarm;
|
||||
import com.zhgd.xmgl.modules.city.dust.entity.vo.EnvironmentAlarmRankVo;
|
||||
import com.zhgd.xmgl.modules.city.dust.entity.vo.EnvironmentAlarmTypeVo;
|
||||
import com.zhgd.xmgl.modules.city.dust.mapper.EnvironmentAlarmMapper;
|
||||
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.IEnvironmentDevService;
|
||||
import com.zhgd.xmgl.modules.city.government.entity.Government;
|
||||
import com.zhgd.xmgl.modules.city.government.mapper.GovernmentMapper;
|
||||
import com.zhgd.xmgl.modules.city.project.entity.Project;
|
||||
import com.zhgd.xmgl.modules.wisdom.dto.MapEnvironAlarmDto;
|
||||
import com.zhgd.xmgl.security.SecurityUtil;
|
||||
import com.zhgd.xmgl.util.DateUtils;
|
||||
import com.zhgd.xmgl.util.ParamEnum;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@ -52,6 +57,9 @@ public class EnvironmentAlarmServiceImpl extends ServiceImpl<EnvironmentAlarmMap
|
||||
@Autowired
|
||||
private IEnvironmentDevService environmentDevService;
|
||||
|
||||
@Autowired
|
||||
private GovernmentMapper governmentMapper;
|
||||
|
||||
@Override
|
||||
public Page<EnvironmentAlarm> pageList(Map<String, Object> map) {
|
||||
String engineeringSn = MapUtils.getString(map, ParamConstants.ENGINEERING_SN);
|
||||
@ -142,4 +150,23 @@ public class EnvironmentAlarmServiceImpl extends ServiceImpl<EnvironmentAlarmMap
|
||||
return vo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<EnvironmentAlarmRankVo> getEnvironmentAlarmRank(HashMap<String, Object> paramMap) {
|
||||
Page<Project> page = PageUtil.getPage(paramMap);
|
||||
return baseMapper.getEnvironmentAlarmRank(page,paramMap);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MultiTrendVo countEnvironmentAlarmDistrict(Map<String, Object> map) {
|
||||
MultiTrendVo vo = new MultiTrendVo();
|
||||
List<Government> myGovernments = governmentMapper.getMyUnderGovernments(SecurityUtil.getUser().getSn());
|
||||
List<String> names = myGovernments.stream().map(Government::getGovernmentName).collect(Collectors.toList());
|
||||
vo.setX(names);
|
||||
List<MultiTrendOne> datas = new ArrayList<>();
|
||||
map.put("state", 4);
|
||||
datas.add(new MultiTrendOne("报警", MultiTrendVo.fillData(baseMapper.countInspectRecordDistrict(map), names)));
|
||||
vo.setData(datas);
|
||||
return vo;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.zhgd.xmgl.modules.city.dust.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@ -14,6 +15,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gexin.fastjson.JSON;
|
||||
import com.zhgd.jeecg.common.util.PageUtil;
|
||||
import com.zhgd.redis.lock.RedisRepository;
|
||||
import com.zhgd.xmgl.base.entity.vo.CityAndDistrictDeviceCountVo;
|
||||
import com.zhgd.xmgl.constant.CommonConstant;
|
||||
import com.zhgd.xmgl.handler.exception.CustomException;
|
||||
import com.zhgd.xmgl.modules.basicdata.constant.CacheConstants;
|
||||
import com.zhgd.xmgl.modules.basicdata.dto.EngineeringDeviceDto;
|
||||
@ -31,10 +34,13 @@ 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.mapper.EngineeringMapper;
|
||||
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.monitor.entity.bo.OnlineGroupByProjectBo;
|
||||
import com.zhgd.xmgl.modules.city.project.service.IProjectService;
|
||||
import com.zhgd.xmgl.modules.wisdom.dto.EnvironmentDevDto;
|
||||
import com.zhgd.xmgl.modules.wisdom.dto.EnvironmentDevStatDto;
|
||||
import com.zhgd.xmgl.security.SecurityUtil;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -74,6 +80,8 @@ public class EnvironmentDevServiceImpl extends ServiceImpl<EnvironmentDevMapper,
|
||||
private EnvironmentAlarmMapper environmentAlarmMapper;
|
||||
@Autowired
|
||||
private EngineeringMapper engineeringMapper;
|
||||
@Autowired
|
||||
private GovernmentMapper governmentMapper;
|
||||
|
||||
@Override
|
||||
public Page<EnvironmentDev> pageList(Page page, Wrapper<EnvironmentDev> wrapper) {
|
||||
@ -209,4 +217,17 @@ public class EnvironmentDevServiceImpl extends ServiceImpl<EnvironmentDevMapper,
|
||||
return vo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CityAndDistrictDeviceCountVo> countCityAndDistrictEnvironmentDev(HashMap<String, Object> paramMap) {
|
||||
paramMap.put(CommonConstant.IGNORE_DATA_SCOPE, CommonConstant.IGNORE_DATA_SCOPE);
|
||||
List<Government> myUnderGovernments = governmentMapper.getMyUnderGovernments(SecurityUtil.getUser().getSn());
|
||||
if (CollUtil.isEmpty(myUnderGovernments)) {
|
||||
return null;
|
||||
}
|
||||
paramMap.put("list", myUnderGovernments.stream().map(Government::getGovernmentSn).collect(Collectors.toList()));
|
||||
List<CityAndDistrictDeviceCountVo> list = baseMapper.countCityAndDistrictEnvironmentDev(paramMap);
|
||||
CityAndDistrictDeviceCountVo.addCityIf(paramMap, list, governmentMapper);
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -65,6 +65,7 @@ public class EngineeringController {
|
||||
@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "body", required = true, defaultValue = "10", dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "newThisYear", value = "是否今年新增1是0否", paramType = "body", required = false, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "endThisYear", value = "是否今年竣工合格1是0否", paramType = "body", required = false, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "notMonitor", value = "未接入视频工程", paramType = "body", required = false, dataType = "Integer"),
|
||||
})
|
||||
@PostMapping(value = "/page")
|
||||
public Result<IPage<Engineering>> queryPageList(@ApiIgnore @RequestBody Map<String, Object> map) {
|
||||
@ -78,6 +79,15 @@ public class EngineeringController {
|
||||
if (Objects.equals(MapUtils.getInteger(map, "endThisYear"), 1)) {
|
||||
wrapper.ge(RefUtil.fieldNameUlc(Engineering::getEndTime), dateTime);
|
||||
}
|
||||
String existsSql = "(\n" +
|
||||
"\tSELECT\n" +
|
||||
"\t\t* \n" +
|
||||
"\tFROM\n" +
|
||||
"\t\tmonitor_dev d \n" +
|
||||
"WHERE\n" +
|
||||
"\td.engineering_sn = engineering.engineering_sn)";
|
||||
wrapper.notExists(Objects.equals(MapUtils.getInteger(map, "notMonitor"), 1), existsSql);
|
||||
wrapper.exists(Objects.equals(MapUtils.getInteger(map, "notMonitor"), 0), existsSql);
|
||||
IPage<Engineering> pageList = engineeringService.getPageList(page, wrapper);
|
||||
return Result.success(pageList);
|
||||
}
|
||||
|
||||
@ -72,4 +72,5 @@ public interface EngineeringMapper extends BaseMapper<Engineering> {
|
||||
List<SectorOneVo> countEngineeringType();
|
||||
|
||||
List<Engineering> countEngineeringEveryDistrictAndType();
|
||||
|
||||
}
|
||||
|
||||
@ -40,7 +40,7 @@ public class DangerousEngineeringServiceImpl extends ServiceImpl<DangerousEngine
|
||||
public MultiTrendVo countDangerousEngineeringDistrict() {
|
||||
MultiTrendVo vo = new MultiTrendVo();
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
List<Government> myGovernments = governmentMapper.getMyGovernments(SecurityUtil.getUser().getSn());
|
||||
List<Government> myGovernments = governmentMapper.getMyUnderGovernments(SecurityUtil.getUser().getSn());
|
||||
List<String> names = myGovernments.stream().map(Government::getGovernmentName).collect(Collectors.toList());
|
||||
vo.setX(names);
|
||||
List<MultiTrendOne> datas = new ArrayList<>();
|
||||
|
||||
@ -96,7 +96,7 @@ public class EngineeringServiceImpl extends ServiceImpl<EngineeringMapper, Engin
|
||||
|
||||
@Override
|
||||
public Page<Engineering> getPageList(Page page, Wrapper<Engineering> wrapper) {
|
||||
Page<Engineering> pageList = this.page(page, wrapper);
|
||||
Page<Engineering> pageList = page(page, wrapper);
|
||||
List<SystemDictData> engineeringTypes = systemDictDataService.getByType(ParamEnum.SysDictType.ENGINEERING_TYPE.getValue());
|
||||
List<SystemDictData> engineeringStates = systemDictDataService.getByType(ParamEnum.SysDictType.ENGINEERING_STATE.getValue());
|
||||
pageList.getRecords().stream().forEach(s -> {
|
||||
@ -407,7 +407,7 @@ public class EngineeringServiceImpl extends ServiceImpl<EngineeringMapper, Engin
|
||||
@Override
|
||||
public MultiTrendVo countEngineeringEveryDistrictAndType() {
|
||||
List<Engineering> list = baseMapper.countEngineeringEveryDistrictAndType();
|
||||
List<Government> myGovernments = governmentMapper.getMyGovernments(SecurityUtil.getUser().getSn());
|
||||
List<Government> myGovernments = governmentMapper.getMyUnderGovernments(SecurityUtil.getUser().getSn());
|
||||
if (CollUtil.isEmpty(myGovernments)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -14,5 +14,5 @@ import java.util.List;
|
||||
*/
|
||||
@Mapper
|
||||
public interface GovernmentMapper extends BaseMapper<Government> {
|
||||
List<Government> getMyGovernments(String sn);
|
||||
List<Government> getMyUnderGovernments(String sn);
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?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.zhgd.xmgl.modules.city.government.mapper.GovernmentMapper">
|
||||
<select id="getMyGovernments" resultType="com.zhgd.xmgl.modules.city.government.entity.Government">
|
||||
<select id="getMyUnderGovernments" resultType="com.zhgd.xmgl.modules.city.government.entity.Government">
|
||||
select *
|
||||
from `government` g
|
||||
INNER JOIN `government` fg ON g.parent_id = fg.government_id
|
||||
|
||||
@ -161,7 +161,7 @@ public class HighFormworkMeasurePointServiceImpl extends ServiceImpl<HighFormwor
|
||||
@Override
|
||||
public MultiTrendVo countHighFormworkMeasurePointDistrict() {
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
List<Government> myGovernments = governmentMapper.getMyGovernments(SecurityUtil.getUser().getSn());
|
||||
List<Government> myGovernments = governmentMapper.getMyUnderGovernments(SecurityUtil.getUser().getSn());
|
||||
if (CollUtil.isEmpty(myGovernments)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -334,7 +334,7 @@ public class InspectRecordServiceImpl extends ServiceImpl<InspectRecordMapper, I
|
||||
@Override
|
||||
public MultiTrendVo countInspectRecordEveryDistrict(Map<String, Object> map) {
|
||||
MultiTrendVo vo = new MultiTrendVo();
|
||||
List<Government> myGovernments = governmentMapper.getMyGovernments(SecurityUtil.getUser().getSn());
|
||||
List<Government> myGovernments = governmentMapper.getMyUnderGovernments(SecurityUtil.getUser().getSn());
|
||||
List<String> names = myGovernments.stream().map(Government::getGovernmentName).collect(Collectors.toList());
|
||||
vo.setX(names);
|
||||
List<MultiTrendOne> datas = new ArrayList<>();
|
||||
@ -363,7 +363,7 @@ public class InspectRecordServiceImpl extends ServiceImpl<InspectRecordMapper, I
|
||||
@Override
|
||||
public MultiTrendVo countInspectRecordDistrictAndClose(Map<String, Object> map) {
|
||||
MultiTrendVo vo = new MultiTrendVo();
|
||||
List<Government> myGovernments = governmentMapper.getMyGovernments(SecurityUtil.getUser().getSn());
|
||||
List<Government> myGovernments = governmentMapper.getMyUnderGovernments(SecurityUtil.getUser().getSn());
|
||||
List<String> names = myGovernments.stream().map(Government::getGovernmentName).collect(Collectors.toList());
|
||||
vo.setX(names);
|
||||
List<MultiTrendOne> datas = new ArrayList<>();
|
||||
|
||||
@ -11,6 +11,7 @@ import com.zhgd.xmgl.modules.city.monitor.entity.bo.OnlineGroupByProjectBo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -33,7 +34,7 @@ public interface MonitorDevMapper extends BaseMapper<MonitorDev> {
|
||||
|
||||
MonitorDev getByCode(String code, String ignore);
|
||||
|
||||
List<CityAndDistrictDeviceCountVo> countDistrictMonitor();
|
||||
List<CityAndDistrictDeviceCountVo> countDistrictMonitor(HashMap<String, Object> paramMap);
|
||||
|
||||
List<OnlineGroupByProjectBo> countOnlineGroupByProject();
|
||||
|
||||
|
||||
@ -38,12 +38,20 @@
|
||||
<select id="countDistrictMonitor"
|
||||
resultType="com.zhgd.xmgl.base.entity.vo.CityAndDistrictDeviceCountVo">
|
||||
SELECT g.government_name,
|
||||
count(*) count,
|
||||
count(md.monitor_id) count,
|
||||
ifnull(sum(if(md.state = 1, 1, 0)), 0) onlineCount,
|
||||
ifnull(sum(if(md.state = 0, 1, 0)), 0) offlineCount
|
||||
FROM monitor_dev md
|
||||
INNER JOIN project p ON p.project_sn = md.project_sn
|
||||
INNER JOIN `government` g ON g.government_sn = p.government_sn
|
||||
ifnull(sum(if(md.state = 0, 1, 0)), 0) offlineCount,
|
||||
count(distinct md.engineering_sn) installEngineeringCount,
|
||||
count(distinct e.engineering_sn) engineeringCount
|
||||
FROM government g
|
||||
left JOIN project p ON g.government_sn = p.government_sn
|
||||
left join engineering e on e.project_sn = p.project_sn
|
||||
left JOIN monitor_dev md ON p.project_sn = md.project_sn
|
||||
where 1=1
|
||||
and g.government_sn in
|
||||
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
group by g.government_sn
|
||||
</select>
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.zhgd.xmgl.modules.city.monitor.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
@ -12,6 +13,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.zhgd.xmgl.base.entity.vo.CityAndDistrictDeviceCountVo;
|
||||
import com.zhgd.xmgl.constant.CommonConstant;
|
||||
import com.zhgd.xmgl.modules.basicdata.dto.AppIndexDeviceDto;
|
||||
import com.zhgd.xmgl.modules.basicdata.dto.MonitorTreeDto;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.ISystemDictDataService;
|
||||
@ -19,6 +21,7 @@ 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.mapper.EngineeringMapper;
|
||||
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.monitor.entity.MonitorDev;
|
||||
import com.zhgd.xmgl.modules.city.monitor.entity.bo.OnlineGroupByProjectBo;
|
||||
@ -28,6 +31,7 @@ import com.zhgd.xmgl.modules.city.monitor.mapper.MonitorQuestionMapper;
|
||||
import com.zhgd.xmgl.modules.city.monitor.service.IMonitorDevService;
|
||||
import com.zhgd.xmgl.modules.city.project.entity.Project;
|
||||
import com.zhgd.xmgl.modules.wisdom.mapper.AiMonitorDevMapper;
|
||||
import com.zhgd.xmgl.security.SecurityUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@ -174,7 +178,13 @@ public class MonitorDevServiceImpl extends ServiceImpl<MonitorDevMapper, Monitor
|
||||
|
||||
@Override
|
||||
public List<CityAndDistrictDeviceCountVo> countCityAndDistrictMonitor(HashMap<String, Object> paramMap) {
|
||||
List<CityAndDistrictDeviceCountVo> list = baseMapper.countDistrictMonitor();
|
||||
paramMap.put(CommonConstant.IGNORE_DATA_SCOPE, CommonConstant.IGNORE_DATA_SCOPE);
|
||||
List<Government> myUnderGovernments = governmentMapper.getMyUnderGovernments(SecurityUtil.getUser().getSn());
|
||||
if (CollUtil.isEmpty(myUnderGovernments)) {
|
||||
return null;
|
||||
}
|
||||
paramMap.put("list", myUnderGovernments.stream().map(Government::getGovernmentSn).collect(Collectors.toList()));
|
||||
List<CityAndDistrictDeviceCountVo> list = baseMapper.countDistrictMonitor(paramMap);
|
||||
CityAndDistrictDeviceCountVo.addCityIf(paramMap, list, governmentMapper);
|
||||
return list;
|
||||
}
|
||||
|
||||
@ -298,7 +298,7 @@ public class WorkerInfoServiceImpl extends ServiceImpl<WorkerInfoMapper, WorkerI
|
||||
|
||||
@Override
|
||||
public MultiTrendVo countWorkerInfoDistrict(HashMap<String, Object> paramMap) {
|
||||
List<Government> myGovernments = governmentMapper.getMyGovernments(SecurityUtil.getUser().getSn());
|
||||
List<Government> myGovernments = governmentMapper.getMyUnderGovernments(SecurityUtil.getUser().getSn());
|
||||
if (CollUtil.isEmpty(myGovernments)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user