废气废水超量未落实排污许可
parent
6d205e80ec
commit
2a25593d8c
|
@ -0,0 +1,120 @@
|
|||
package cn.cecep.talroad.data.analyse.task.execute.report.excess;
|
||||
|
||||
import cn.cecep.talroad.data.analyse.task.execute.report.PollutionDischargeProcessService;
|
||||
import cn.cecep.talroad.domain.AmProblemFi;
|
||||
import cn.cecep.talroad.domain.BMainActionReports;
|
||||
import cn.cecep.talroad.domain.BStatTableZxbgPflAir;
|
||||
import cn.cecep.talroad.domain.PcFactory;
|
||||
import cn.cecep.talroad.mapper.*;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class AirExcessMonthProcessService implements PollutionDischargeProcessService {
|
||||
@Autowired
|
||||
private BStatTableZxbgPflAirMapper statTableZxbgPflAirMapper;
|
||||
|
||||
@Autowired
|
||||
private BMainActionReportsMapper mainActionReportsMapper;
|
||||
|
||||
@Autowired
|
||||
private AmProblemFiMapper amProblemFiMapper;
|
||||
|
||||
@Autowired
|
||||
private PcFactoryMapper factoryMapper;
|
||||
|
||||
/**
|
||||
* 0:月报,1:季报,2:年报
|
||||
*/
|
||||
public static final String zxbgType = "0";
|
||||
|
||||
/**
|
||||
* 1:年报,2:季报,3:月报
|
||||
*/
|
||||
|
||||
public static final String reportsType = "3";
|
||||
|
||||
/**
|
||||
* 污染物来源 1废气、2废水 3 视频 可为空
|
||||
*/
|
||||
public static final String pollutantSource = "1";
|
||||
|
||||
@Override
|
||||
public void process() {
|
||||
|
||||
// todo :缺少查询报告周期条件
|
||||
List<BMainActionReports> report = getReport();
|
||||
|
||||
for (BMainActionReports bMainActionReports : report) {
|
||||
|
||||
LambdaQueryWrapper<BStatTableZxbgPflAir> bStatTableZxbgPflWaterLambdaQueryWrapper = new QueryWrapper<BStatTableZxbgPflAir>().lambda()
|
||||
.eq(BStatTableZxbgPflAir::getZxbgType, zxbgType)
|
||||
.eq(BStatTableZxbgPflAir::getZxbgPeriod, bMainActionReports.getReportsTime())
|
||||
.eq(BStatTableZxbgPflAir::getFactoryId, bMainActionReports.getFactoryId());
|
||||
List<BStatTableZxbgPflAir> bStatTableZxbgPflWaters = statTableZxbgPflAirMapper.selectList(bStatTableZxbgPflWaterLambdaQueryWrapper);
|
||||
|
||||
for (BStatTableZxbgPflAir bStatTableZxbgPflAir : bStatTableZxbgPflWaters) {
|
||||
BigDecimal zxbgYear = new BigDecimal(bStatTableZxbgPflAir.getZxbgDischargeYear());
|
||||
BigDecimal zxbgActual = new BigDecimal(bStatTableZxbgPflAir.getZxbgDischargeActual());
|
||||
if (zxbgActual.doubleValue()>zxbgYear.doubleValue()){
|
||||
addAmProblemFi(bStatTableZxbgPflAir);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void addAmProblemFi(BStatTableZxbgPflAir bStatTableZxbgPflAir){
|
||||
|
||||
PcFactory pcFactory = factoryMapper.selectById(bStatTableZxbgPflAir.getFactoryId());
|
||||
|
||||
if (pcFactory==null){
|
||||
log.warn("企业id不存在 , 企业ID : {}",bStatTableZxbgPflAir.getFactoryId());
|
||||
}
|
||||
|
||||
String problemString = getProblemString(pcFactory.getFactoryName(), bStatTableZxbgPflAir.getZxbgPeriod(), bStatTableZxbgPflAir.getZxbgPollutant());
|
||||
|
||||
AmProblemFi amProblemFi = new AmProblemFi();
|
||||
amProblemFi.setFactoryId(pcFactory.getId());
|
||||
amProblemFi.setAnalyseTime(new Date());
|
||||
amProblemFi.setType(1);
|
||||
amProblemFi.setPollutantSourceAi(pollutantSource);
|
||||
amProblemFi.setDetails(problemString);
|
||||
amProblemFiMapper.insert(amProblemFi);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行报告年报中,实际排放情况及达标判定分析-实际排放量信息-废水模块年度每个污染物排放量合计大于许可排放量要求就算超总量
|
||||
* 报警说明:“企业名称”“执行报告周期(2013年执行报告年报/2013年执行报告第一季度季报。。。)”中“污染物名称”实际排放量大于许可排放量,出现超总量情况。
|
||||
*/
|
||||
public String getProblemString(String factoryName , String zxbgPeriod , String pollutantName){
|
||||
return new StringBuilder()
|
||||
.append(factoryName).append("(").append(zxbgPeriod).append(")")
|
||||
.append("中").append(pollutantName).append("实际排放量大于许可排放量,出现超总量情况。")
|
||||
.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询报告周期
|
||||
* todo :缺少查询报告周期条件
|
||||
* @return
|
||||
*/
|
||||
public List<BMainActionReports> getReport(){
|
||||
LambdaQueryWrapper<BMainActionReports> bMainActionReportsLambdaQueryWrapper = new QueryWrapper<BMainActionReports>().lambda().eq(BMainActionReports::getReportsType, reportsType);
|
||||
List<BMainActionReports> bMainActionReports = mainActionReportsMapper.selectList(bMainActionReportsLambdaQueryWrapper);
|
||||
return bMainActionReports;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,123 @@
|
|||
package cn.cecep.talroad.data.analyse.task.execute.report.excess;
|
||||
|
||||
import cn.cecep.talroad.data.analyse.task.execute.report.PollutionDischargeProcessService;
|
||||
import cn.cecep.talroad.domain.AmProblemFi;
|
||||
import cn.cecep.talroad.domain.BMainActionReports;
|
||||
import cn.cecep.talroad.domain.BStatTableZxbgPflAir;
|
||||
import cn.cecep.talroad.domain.PcFactory;
|
||||
import cn.cecep.talroad.mapper.AmProblemFiMapper;
|
||||
import cn.cecep.talroad.mapper.BMainActionReportsMapper;
|
||||
import cn.cecep.talroad.mapper.BStatTableZxbgPflAirMapper;
|
||||
import cn.cecep.talroad.mapper.PcFactoryMapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class AirExcessQuarterProcessService implements PollutionDischargeProcessService {
|
||||
@Autowired
|
||||
private BStatTableZxbgPflAirMapper statTableZxbgPflAirMapper;
|
||||
|
||||
@Autowired
|
||||
private BMainActionReportsMapper mainActionReportsMapper;
|
||||
|
||||
@Autowired
|
||||
private AmProblemFiMapper amProblemFiMapper;
|
||||
|
||||
@Autowired
|
||||
private PcFactoryMapper factoryMapper;
|
||||
|
||||
/**
|
||||
* 0:月报,1:季报,2:年报
|
||||
*/
|
||||
public static final String zxbgType = "1";
|
||||
|
||||
/**
|
||||
* 1:年报,2:季报,3:月报
|
||||
*/
|
||||
|
||||
public static final String reportsType = "2";
|
||||
|
||||
/**
|
||||
* 污染物来源 1废气、2废水 3 视频 可为空
|
||||
*/
|
||||
public static final String pollutantSource = "1";
|
||||
|
||||
@Override
|
||||
public void process() {
|
||||
|
||||
// todo :缺少查询报告周期条件
|
||||
List<BMainActionReports> report = getReport();
|
||||
|
||||
for (BMainActionReports bMainActionReports : report) {
|
||||
|
||||
LambdaQueryWrapper<BStatTableZxbgPflAir> bStatTableZxbgPflWaterLambdaQueryWrapper = new QueryWrapper<BStatTableZxbgPflAir>().lambda()
|
||||
.eq(BStatTableZxbgPflAir::getZxbgType, zxbgType)
|
||||
.eq(BStatTableZxbgPflAir::getZxbgPeriod, bMainActionReports.getReportsTime())
|
||||
.eq(BStatTableZxbgPflAir::getFactoryId, bMainActionReports.getFactoryId());
|
||||
List<BStatTableZxbgPflAir> bStatTableZxbgPflWaters = statTableZxbgPflAirMapper.selectList(bStatTableZxbgPflWaterLambdaQueryWrapper);
|
||||
|
||||
for (BStatTableZxbgPflAir bStatTableZxbgPflAir : bStatTableZxbgPflWaters) {
|
||||
BigDecimal zxbgYear = new BigDecimal(bStatTableZxbgPflAir.getZxbgDischargeYear());
|
||||
BigDecimal zxbgActual = new BigDecimal(bStatTableZxbgPflAir.getZxbgDischargeActual());
|
||||
if (zxbgActual.doubleValue()>zxbgYear.doubleValue()){
|
||||
addAmProblemFi(bStatTableZxbgPflAir);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void addAmProblemFi(BStatTableZxbgPflAir bStatTableZxbgPflAir){
|
||||
|
||||
PcFactory pcFactory = factoryMapper.selectById(bStatTableZxbgPflAir.getFactoryId());
|
||||
|
||||
if (pcFactory==null){
|
||||
log.warn("企业id不存在 , 企业ID : {}",bStatTableZxbgPflAir.getFactoryId());
|
||||
}
|
||||
|
||||
String problemString = getProblemString(pcFactory.getFactoryName(), bStatTableZxbgPflAir.getZxbgPeriod(), bStatTableZxbgPflAir.getZxbgPollutant());
|
||||
|
||||
AmProblemFi amProblemFi = new AmProblemFi();
|
||||
amProblemFi.setFactoryId(pcFactory.getId());
|
||||
amProblemFi.setAnalyseTime(new Date());
|
||||
amProblemFi.setType(1);
|
||||
amProblemFi.setPollutantSourceAi(pollutantSource);
|
||||
amProblemFi.setDetails(problemString);
|
||||
amProblemFiMapper.insert(amProblemFi);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行报告年报中,实际排放情况及达标判定分析-实际排放量信息-废水模块年度每个污染物排放量合计大于许可排放量要求就算超总量
|
||||
* 报警说明:“企业名称”“执行报告周期(2013年执行报告年报/2013年执行报告第一季度季报。。。)”中“污染物名称”实际排放量大于许可排放量,出现超总量情况。
|
||||
*/
|
||||
public String getProblemString(String factoryName , String zxbgPeriod , String pollutantName){
|
||||
return new StringBuilder()
|
||||
.append(factoryName).append("(").append(zxbgPeriod).append(")")
|
||||
.append("中").append(pollutantName).append("实际排放量大于许可排放量,出现超总量情况。")
|
||||
.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询报告周期
|
||||
* todo :缺少查询报告周期条件
|
||||
* @return
|
||||
*/
|
||||
public List<BMainActionReports> getReport(){
|
||||
LambdaQueryWrapper<BMainActionReports> bMainActionReportsLambdaQueryWrapper = new QueryWrapper<BMainActionReports>().lambda().eq(BMainActionReports::getReportsType, reportsType);
|
||||
List<BMainActionReports> bMainActionReports = mainActionReportsMapper.selectList(bMainActionReportsLambdaQueryWrapper);
|
||||
return bMainActionReports;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,123 @@
|
|||
package cn.cecep.talroad.data.analyse.task.execute.report.excess;
|
||||
|
||||
import cn.cecep.talroad.data.analyse.task.execute.report.PollutionDischargeProcessService;
|
||||
import cn.cecep.talroad.domain.AmProblemFi;
|
||||
import cn.cecep.talroad.domain.BMainActionReports;
|
||||
import cn.cecep.talroad.domain.BStatTableZxbgPflAir;
|
||||
import cn.cecep.talroad.domain.PcFactory;
|
||||
import cn.cecep.talroad.mapper.AmProblemFiMapper;
|
||||
import cn.cecep.talroad.mapper.BMainActionReportsMapper;
|
||||
import cn.cecep.talroad.mapper.BStatTableZxbgPflAirMapper;
|
||||
import cn.cecep.talroad.mapper.PcFactoryMapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class AirExcessYearProcessService implements PollutionDischargeProcessService {
|
||||
@Autowired
|
||||
private BStatTableZxbgPflAirMapper statTableZxbgPflAirMapper;
|
||||
|
||||
@Autowired
|
||||
private BMainActionReportsMapper mainActionReportsMapper;
|
||||
|
||||
@Autowired
|
||||
private AmProblemFiMapper amProblemFiMapper;
|
||||
|
||||
@Autowired
|
||||
private PcFactoryMapper factoryMapper;
|
||||
|
||||
/**
|
||||
* 0:月报,1:季报,2:年报
|
||||
*/
|
||||
public static final String zxbgType = "2";
|
||||
|
||||
/**
|
||||
* 1:年报,2:季报,3:月报
|
||||
*/
|
||||
|
||||
public static final String reportsType = "1";
|
||||
|
||||
/**
|
||||
* 污染物来源 1废气、2废水 3 视频 可为空
|
||||
*/
|
||||
public static final String pollutantSource = "1";
|
||||
|
||||
@Override
|
||||
public void process() {
|
||||
|
||||
// todo :缺少查询报告周期条件
|
||||
List<BMainActionReports> report = getReport();
|
||||
|
||||
for (BMainActionReports bMainActionReports : report) {
|
||||
|
||||
LambdaQueryWrapper<BStatTableZxbgPflAir> bStatTableZxbgPflWaterLambdaQueryWrapper = new QueryWrapper<BStatTableZxbgPflAir>().lambda()
|
||||
.eq(BStatTableZxbgPflAir::getZxbgType, zxbgType)
|
||||
.eq(BStatTableZxbgPflAir::getZxbgPeriod, bMainActionReports.getReportsTime())
|
||||
.eq(BStatTableZxbgPflAir::getFactoryId, bMainActionReports.getFactoryId());
|
||||
List<BStatTableZxbgPflAir> bStatTableZxbgPflWaters = statTableZxbgPflAirMapper.selectList(bStatTableZxbgPflWaterLambdaQueryWrapper);
|
||||
|
||||
for (BStatTableZxbgPflAir bStatTableZxbgPflAir : bStatTableZxbgPflWaters) {
|
||||
BigDecimal zxbgYear = new BigDecimal(bStatTableZxbgPflAir.getZxbgDischargeYear());
|
||||
BigDecimal zxbgActual = new BigDecimal(bStatTableZxbgPflAir.getZxbgDischargeActual());
|
||||
if (zxbgActual.doubleValue()>zxbgYear.doubleValue()){
|
||||
addAmProblemFi(bStatTableZxbgPflAir);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void addAmProblemFi(BStatTableZxbgPflAir bStatTableZxbgPflAir){
|
||||
|
||||
PcFactory pcFactory = factoryMapper.selectById(bStatTableZxbgPflAir.getFactoryId());
|
||||
|
||||
if (pcFactory==null){
|
||||
log.warn("企业id不存在 , 企业ID : {}",bStatTableZxbgPflAir.getFactoryId());
|
||||
}
|
||||
|
||||
String problemString = getProblemString(pcFactory.getFactoryName(), bStatTableZxbgPflAir.getZxbgPeriod(), bStatTableZxbgPflAir.getZxbgPollutant());
|
||||
|
||||
AmProblemFi amProblemFi = new AmProblemFi();
|
||||
amProblemFi.setFactoryId(pcFactory.getId());
|
||||
amProblemFi.setAnalyseTime(new Date());
|
||||
amProblemFi.setType(1);
|
||||
amProblemFi.setPollutantSourceAi(pollutantSource);
|
||||
amProblemFi.setDetails(problemString);
|
||||
amProblemFiMapper.insert(amProblemFi);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行报告年报中,实际排放情况及达标判定分析-实际排放量信息-废水模块年度每个污染物排放量合计大于许可排放量要求就算超总量
|
||||
* 报警说明:“企业名称”“执行报告周期(2013年执行报告年报/2013年执行报告第一季度季报。。。)”中“污染物名称”实际排放量大于许可排放量,出现超总量情况。
|
||||
*/
|
||||
public String getProblemString(String factoryName , String zxbgPeriod , String pollutantName){
|
||||
return new StringBuilder()
|
||||
.append(factoryName).append("(").append(zxbgPeriod).append(")")
|
||||
.append("中").append(pollutantName).append("实际排放量大于许可排放量,出现超总量情况。")
|
||||
.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询报告周期
|
||||
* todo :缺少查询报告周期条件
|
||||
* @return
|
||||
*/
|
||||
public List<BMainActionReports> getReport(){
|
||||
LambdaQueryWrapper<BMainActionReports> bMainActionReportsLambdaQueryWrapper = new QueryWrapper<BMainActionReports>().lambda().eq(BMainActionReports::getReportsType, reportsType);
|
||||
List<BMainActionReports> bMainActionReports = mainActionReportsMapper.selectList(bMainActionReportsLambdaQueryWrapper);
|
||||
return bMainActionReports;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,123 @@
|
|||
package cn.cecep.talroad.data.analyse.task.execute.report.excess;
|
||||
|
||||
import cn.cecep.talroad.data.analyse.task.execute.report.PollutionDischargeProcessService;
|
||||
import cn.cecep.talroad.domain.*;
|
||||
import cn.cecep.talroad.mapper.AmProblemFiMapper;
|
||||
import cn.cecep.talroad.mapper.BMainActionReportsMapper;
|
||||
import cn.cecep.talroad.mapper.BStatTableZxbgPflWaterMapper;
|
||||
import cn.cecep.talroad.mapper.PcFactoryMapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class WaterExcessMonthProcessService implements PollutionDischargeProcessService {
|
||||
|
||||
@Autowired
|
||||
private BStatTableZxbgPflWaterMapper statTableZxbgPflWaterMapper;
|
||||
|
||||
@Autowired
|
||||
private BMainActionReportsMapper mainActionReportsMapper;
|
||||
|
||||
@Autowired
|
||||
private AmProblemFiMapper amProblemFiMapper;
|
||||
|
||||
@Autowired
|
||||
private PcFactoryMapper factoryMapper;
|
||||
|
||||
/**
|
||||
* 0:月报,1:季报,2:年报
|
||||
*/
|
||||
public static final String zxbgType = "0";
|
||||
|
||||
/**
|
||||
* 1:年报,2:季报,3:月报
|
||||
*/
|
||||
|
||||
public static final String reportsType = "3";
|
||||
|
||||
/**
|
||||
* 污染物来源 1废气、2废水 3 视频 可为空
|
||||
*/
|
||||
public static final String pollutantSource = "2";
|
||||
|
||||
@Override
|
||||
public void process() {
|
||||
|
||||
// todo :缺少查询报告周期条件
|
||||
List<BMainActionReports> report = getReport();
|
||||
|
||||
for (BMainActionReports bMainActionReports : report) {
|
||||
|
||||
LambdaQueryWrapper<BStatTableZxbgPflWater> bStatTableZxbgPflWaterLambdaQueryWrapper = new QueryWrapper<BStatTableZxbgPflWater>().lambda()
|
||||
.eq(BStatTableZxbgPflWater::getZxbgType, zxbgType)
|
||||
.eq(BStatTableZxbgPflWater::getZxbgPeriod, bMainActionReports.getReportsTime())
|
||||
.eq(BStatTableZxbgPflWater::getFactoryId, bMainActionReports.getFactoryId());
|
||||
List<BStatTableZxbgPflWater> bStatTableZxbgPflWaters = statTableZxbgPflWaterMapper.selectList(bStatTableZxbgPflWaterLambdaQueryWrapper);
|
||||
|
||||
for (BStatTableZxbgPflWater bStatTableZxbgPflWater : bStatTableZxbgPflWaters) {
|
||||
BigDecimal zxbgYear = new BigDecimal(bStatTableZxbgPflWater.getZxbgDischargeYear());
|
||||
BigDecimal zxbgActual = new BigDecimal(bStatTableZxbgPflWater.getZxbgDischargeActual());
|
||||
if (zxbgActual.doubleValue()>zxbgYear.doubleValue()){
|
||||
//todo 添加报警信息
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void addAmProblemFi(BStatTableZxbgPflAir bStatTableZxbgPflAir){
|
||||
|
||||
PcFactory pcFactory = factoryMapper.selectById(bStatTableZxbgPflAir.getFactoryId());
|
||||
|
||||
if (pcFactory==null){
|
||||
log.warn("企业id不存在 , 企业ID : {}",bStatTableZxbgPflAir.getFactoryId());
|
||||
}
|
||||
|
||||
String problemString = getProblemString(pcFactory.getFactoryName(), bStatTableZxbgPflAir.getZxbgPeriod(), bStatTableZxbgPflAir.getZxbgPollutant());
|
||||
|
||||
AmProblemFi amProblemFi = new AmProblemFi();
|
||||
amProblemFi.setFactoryId(pcFactory.getId());
|
||||
amProblemFi.setAnalyseTime(new Date());
|
||||
amProblemFi.setType(1);
|
||||
amProblemFi.setPollutantSourceAi(pollutantSource);
|
||||
amProblemFi.setDetails(problemString);
|
||||
amProblemFiMapper.insert(amProblemFi);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行报告年报中,实际排放情况及达标判定分析-实际排放量信息-废水模块年度每个污染物排放量合计大于许可排放量要求就算超总量
|
||||
* 报警说明:“企业名称”“执行报告周期(2013年执行报告年报/2013年执行报告第一季度季报。。。)”中“污染物名称”实际排放量大于许可排放量,出现超总量情况。
|
||||
*/
|
||||
public String getProblemString(String factoryName , String zxbgPeriod , String pollutantName){
|
||||
return new StringBuilder()
|
||||
.append(factoryName).append("(").append(zxbgPeriod).append(")")
|
||||
.append("中").append(pollutantName).append("实际排放量大于许可排放量,出现超总量情况。")
|
||||
.toString();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询报告周期
|
||||
* todo :缺少查询报告周期条件
|
||||
* @return
|
||||
*/
|
||||
public List<BMainActionReports> getReport(){
|
||||
LambdaQueryWrapper<BMainActionReports> bMainActionReportsLambdaQueryWrapper = new QueryWrapper<BMainActionReports>().lambda().eq(BMainActionReports::getReportsType, reportsType);
|
||||
List<BMainActionReports> bMainActionReports = mainActionReportsMapper.selectList(bMainActionReportsLambdaQueryWrapper);
|
||||
return bMainActionReports;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,121 @@
|
|||
package cn.cecep.talroad.data.analyse.task.execute.report.excess;
|
||||
|
||||
import cn.cecep.talroad.data.analyse.task.execute.report.PollutionDischargeProcessService;
|
||||
import cn.cecep.talroad.domain.*;
|
||||
import cn.cecep.talroad.mapper.AmProblemFiMapper;
|
||||
import cn.cecep.talroad.mapper.BMainActionReportsMapper;
|
||||
import cn.cecep.talroad.mapper.BStatTableZxbgPflWaterMapper;
|
||||
import cn.cecep.talroad.mapper.PcFactoryMapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class WaterExcessQuarterProcessService implements PollutionDischargeProcessService {
|
||||
|
||||
@Autowired
|
||||
private BStatTableZxbgPflWaterMapper statTableZxbgPflWaterMapper;
|
||||
|
||||
@Autowired
|
||||
private BMainActionReportsMapper mainActionReportsMapper;
|
||||
|
||||
@Autowired
|
||||
private AmProblemFiMapper amProblemFiMapper;
|
||||
|
||||
@Autowired
|
||||
private PcFactoryMapper factoryMapper;
|
||||
|
||||
/**
|
||||
* 0:月报,1:季报,2:年报
|
||||
*/
|
||||
public static final String zxbgType = "1";
|
||||
|
||||
/**
|
||||
* 1:年报,2:季报,3:月报
|
||||
*/
|
||||
|
||||
public static final String reportsType = "2";
|
||||
|
||||
/**
|
||||
* 污染物来源 1废气、2废水 3 视频 可为空
|
||||
*/
|
||||
public static final String pollutantSource = "2";
|
||||
|
||||
@Override
|
||||
public void process() {
|
||||
|
||||
// todo :缺少查询报告周期条件
|
||||
List<BMainActionReports> report = getReport();
|
||||
|
||||
for (BMainActionReports bMainActionReports : report) {
|
||||
|
||||
LambdaQueryWrapper<BStatTableZxbgPflWater> bStatTableZxbgPflWaterLambdaQueryWrapper = new QueryWrapper<BStatTableZxbgPflWater>().lambda()
|
||||
.eq(BStatTableZxbgPflWater::getZxbgType, zxbgType)
|
||||
.eq(BStatTableZxbgPflWater::getZxbgPeriod, bMainActionReports.getReportsTime())
|
||||
.eq(BStatTableZxbgPflWater::getFactoryId, bMainActionReports.getFactoryId());
|
||||
List<BStatTableZxbgPflWater> bStatTableZxbgPflWaters = statTableZxbgPflWaterMapper.selectList(bStatTableZxbgPflWaterLambdaQueryWrapper);
|
||||
|
||||
for (BStatTableZxbgPflWater bStatTableZxbgPflWater : bStatTableZxbgPflWaters) {
|
||||
BigDecimal zxbgYear = new BigDecimal(bStatTableZxbgPflWater.getZxbgDischargeYear());
|
||||
BigDecimal zxbgActual = new BigDecimal(bStatTableZxbgPflWater.getZxbgDischargeActual());
|
||||
if (zxbgActual.doubleValue()>zxbgYear.doubleValue()){
|
||||
//todo 添加报警信息
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void addAmProblemFi(BStatTableZxbgPflAir bStatTableZxbgPflAir){
|
||||
|
||||
PcFactory pcFactory = factoryMapper.selectById(bStatTableZxbgPflAir.getFactoryId());
|
||||
|
||||
if (pcFactory==null){
|
||||
log.warn("企业id不存在 , 企业ID : {}",bStatTableZxbgPflAir.getFactoryId());
|
||||
}
|
||||
|
||||
String problemString = getProblemString(pcFactory.getFactoryName(), bStatTableZxbgPflAir.getZxbgPeriod(), bStatTableZxbgPflAir.getZxbgPollutant());
|
||||
|
||||
AmProblemFi amProblemFi = new AmProblemFi();
|
||||
amProblemFi.setFactoryId(pcFactory.getId());
|
||||
amProblemFi.setAnalyseTime(new Date());
|
||||
amProblemFi.setType(1);
|
||||
amProblemFi.setPollutantSourceAi(pollutantSource);
|
||||
amProblemFi.setDetails(problemString);
|
||||
amProblemFiMapper.insert(amProblemFi);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行报告年报中,实际排放情况及达标判定分析-实际排放量信息-废水模块年度每个污染物排放量合计大于许可排放量要求就算超总量
|
||||
* 报警说明:“企业名称”“执行报告周期(2013年执行报告年报/2013年执行报告第一季度季报。。。)”中“污染物名称”实际排放量大于许可排放量,出现超总量情况。
|
||||
*/
|
||||
public String getProblemString(String factoryName , String zxbgPeriod , String pollutantName){
|
||||
return new StringBuilder()
|
||||
.append(factoryName).append("(").append(zxbgPeriod).append(")")
|
||||
.append("中").append(pollutantName).append("实际排放量大于许可排放量,出现超总量情况。")
|
||||
.toString();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询报告周期
|
||||
* todo :缺少查询报告周期条件
|
||||
* @return
|
||||
*/
|
||||
public List<BMainActionReports> getReport(){
|
||||
LambdaQueryWrapper<BMainActionReports> bMainActionReportsLambdaQueryWrapper = new QueryWrapper<BMainActionReports>().lambda().eq(BMainActionReports::getReportsType, reportsType);
|
||||
List<BMainActionReports> bMainActionReports = mainActionReportsMapper.selectList(bMainActionReportsLambdaQueryWrapper);
|
||||
return bMainActionReports;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,121 @@
|
|||
package cn.cecep.talroad.data.analyse.task.execute.report.excess;
|
||||
|
||||
import cn.cecep.talroad.data.analyse.task.execute.report.PollutionDischargeProcessService;
|
||||
import cn.cecep.talroad.domain.*;
|
||||
import cn.cecep.talroad.mapper.AmProblemFiMapper;
|
||||
import cn.cecep.talroad.mapper.BMainActionReportsMapper;
|
||||
import cn.cecep.talroad.mapper.BStatTableZxbgPflWaterMapper;
|
||||
import cn.cecep.talroad.mapper.PcFactoryMapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class WaterExcessYearProcessService implements PollutionDischargeProcessService {
|
||||
|
||||
@Autowired
|
||||
private BStatTableZxbgPflWaterMapper statTableZxbgPflWaterMapper;
|
||||
|
||||
@Autowired
|
||||
private BMainActionReportsMapper mainActionReportsMapper;
|
||||
|
||||
@Autowired
|
||||
private AmProblemFiMapper amProblemFiMapper;
|
||||
|
||||
@Autowired
|
||||
private PcFactoryMapper factoryMapper;
|
||||
|
||||
/**
|
||||
* 0:月报,1:季报,2:年报
|
||||
*/
|
||||
public static final String zxbgType = "2";
|
||||
|
||||
/**
|
||||
* 1:年报,2:季报,3:月报
|
||||
*/
|
||||
|
||||
public static final String reportsType = "1";
|
||||
|
||||
/**
|
||||
* 污染物来源 1废气、2废水 3 视频 可为空
|
||||
*/
|
||||
public static final String pollutantSource = "2";
|
||||
|
||||
@Override
|
||||
public void process() {
|
||||
|
||||
// todo :缺少查询报告周期条件
|
||||
List<BMainActionReports> report = getReport();
|
||||
|
||||
for (BMainActionReports bMainActionReports : report) {
|
||||
|
||||
LambdaQueryWrapper<BStatTableZxbgPflWater> bStatTableZxbgPflWaterLambdaQueryWrapper = new QueryWrapper<BStatTableZxbgPflWater>().lambda()
|
||||
.eq(BStatTableZxbgPflWater::getZxbgType, zxbgType)
|
||||
.eq(BStatTableZxbgPflWater::getZxbgPeriod, bMainActionReports.getReportsTime())
|
||||
.eq(BStatTableZxbgPflWater::getFactoryId, bMainActionReports.getFactoryId());
|
||||
List<BStatTableZxbgPflWater> bStatTableZxbgPflWaters = statTableZxbgPflWaterMapper.selectList(bStatTableZxbgPflWaterLambdaQueryWrapper);
|
||||
|
||||
for (BStatTableZxbgPflWater bStatTableZxbgPflWater : bStatTableZxbgPflWaters) {
|
||||
BigDecimal zxbgYear = new BigDecimal(bStatTableZxbgPflWater.getZxbgDischargeYear());
|
||||
BigDecimal zxbgActual = new BigDecimal(bStatTableZxbgPflWater.getZxbgDischargeActual());
|
||||
if (zxbgActual.doubleValue()>zxbgYear.doubleValue()){
|
||||
//todo 添加报警信息
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void addAmProblemFi(BStatTableZxbgPflAir bStatTableZxbgPflAir){
|
||||
|
||||
PcFactory pcFactory = factoryMapper.selectById(bStatTableZxbgPflAir.getFactoryId());
|
||||
|
||||
if (pcFactory==null){
|
||||
log.warn("企业id不存在 , 企业ID : {}",bStatTableZxbgPflAir.getFactoryId());
|
||||
}
|
||||
|
||||
String problemString = getProblemString(pcFactory.getFactoryName(), bStatTableZxbgPflAir.getZxbgPeriod(), bStatTableZxbgPflAir.getZxbgPollutant());
|
||||
|
||||
AmProblemFi amProblemFi = new AmProblemFi();
|
||||
amProblemFi.setFactoryId(pcFactory.getId());
|
||||
amProblemFi.setAnalyseTime(new Date());
|
||||
amProblemFi.setType(1);
|
||||
amProblemFi.setPollutantSourceAi(pollutantSource);
|
||||
amProblemFi.setDetails(problemString);
|
||||
amProblemFiMapper.insert(amProblemFi);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行报告年报中,实际排放情况及达标判定分析-实际排放量信息-废水模块年度每个污染物排放量合计大于许可排放量要求就算超总量
|
||||
* 报警说明:“企业名称”“执行报告周期(2013年执行报告年报/2013年执行报告第一季度季报。。。)”中“污染物名称”实际排放量大于许可排放量,出现超总量情况。
|
||||
*/
|
||||
public String getProblemString(String factoryName , String zxbgPeriod , String pollutantName){
|
||||
return new StringBuilder()
|
||||
.append(factoryName).append("(").append(zxbgPeriod).append(")")
|
||||
.append("中").append(pollutantName).append("实际排放量大于许可排放量,出现超总量情况。")
|
||||
.toString();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询报告周期
|
||||
* todo :缺少查询报告周期条件
|
||||
* @return
|
||||
*/
|
||||
public List<BMainActionReports> getReport(){
|
||||
LambdaQueryWrapper<BMainActionReports> bMainActionReportsLambdaQueryWrapper = new QueryWrapper<BMainActionReports>().lambda().eq(BMainActionReports::getReportsType, reportsType);
|
||||
List<BMainActionReports> bMainActionReports = mainActionReportsMapper.selectList(bMainActionReportsLambdaQueryWrapper);
|
||||
return bMainActionReports;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,96 @@
|
|||
package cn.cecep.talroad.task;
|
||||
|
||||
import cn.cecep.talroad.data.analyse.task.execute.report.excess.*;
|
||||
import io.swagger.annotations.Api;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@Api(tags = "执行报告中出现废水废气超总量排污行为,未有效落实排污许可制度")
|
||||
@RestController
|
||||
@RequestMapping("/report/excess")
|
||||
@Slf4j
|
||||
public class ReportExcessController {
|
||||
|
||||
@Autowired
|
||||
private AirExcessMonthProcessService airExcessMonthProcessService;
|
||||
|
||||
@Autowired
|
||||
private AirExcessQuarterProcessService airExcessQuarterProcessService;
|
||||
|
||||
@Autowired
|
||||
private AirExcessYearProcessService airExcessYearProcessService;
|
||||
|
||||
@Autowired
|
||||
private WaterExcessMonthProcessService waterExcessMonthProcessService;
|
||||
|
||||
@Autowired
|
||||
private WaterExcessQuarterProcessService waterExcessQuarterProcessService;
|
||||
|
||||
@Autowired
|
||||
private WaterExcessYearProcessService waterExcessYearProcessService;
|
||||
|
||||
|
||||
@GetMapping("/airExcessMonth")
|
||||
public void airExcessMonth() {
|
||||
try {
|
||||
airExcessMonthProcessService.process();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.info("废气超量未落实排污许可 , 按月 . 原因:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("/airExcessQuarter")
|
||||
public void airExcessQuarter() {
|
||||
try {
|
||||
airExcessQuarterProcessService.process();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.info("废气超量未落实排污许可 , 按季度 . 原因:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("/airExcessYear")
|
||||
public void airExcessYear() {
|
||||
try {
|
||||
airExcessYearProcessService.process();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.info("废气超量未落实排污许可 , 按年 . 原因:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("/waterExcessMonth")
|
||||
public void waterExcessMonth() {
|
||||
try {
|
||||
waterExcessMonthProcessService.process();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.info("废水超量未落实排污许可 , 按月 . 原因:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("/waterExcessQuarter")
|
||||
public void waterExcessQuarter() {
|
||||
try {
|
||||
waterExcessQuarterProcessService.process();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.info("废水超量未落实排污许可 , 按季度 . 原因:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("/waterExcessYear")
|
||||
public void waterExcessYear() {
|
||||
try {
|
||||
waterExcessYearProcessService.process();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.info("废水超量未落实排污许可 , 按年 . 原因:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue