废气废水均值监测超量未落实排污许可

main
xuxin 2023-08-13 02:15:27 +08:00
parent 2a25593d8c
commit a85cb25fa0
7 changed files with 823 additions and 0 deletions

View File

@ -0,0 +1,124 @@
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.*;
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 AirExcessMonthAvgProcessService implements PollutionDischargeProcessService {
@Autowired
//b_stat_table_zxbg_gas_emission
private BStatTableZxbgGasEmissionMapper bStatTableZxbgGasEmissionMapper;
@Autowired
private BMainActionReportsMapper mainActionReportsMapper;
@Autowired
private AmProblemFiMapper amProblemFiMapper;
@Autowired
private PcFactoryMapper factoryMapper;
@Autowired
private PcOutletMapper pcOutletMapper;
/**
* 012
*/
public static final String zxbgType = "0";
/**
* 123
*/
public static final String reportsType = "3";
/**
* 12 3
*/
public static final String pollutantSource = "1";
@Override
public void process() {
// todo :缺少查询报告周期条件
List<BMainActionReports> report = getReport();
for (BMainActionReports bMainActionReports : report) {
LambdaQueryWrapper<BStatTableZxbgGasEmission> bStatTableZxbgGasEmissionLambdaQueryWrapper = new QueryWrapper<BStatTableZxbgGasEmission>().lambda()
.eq(BStatTableZxbgGasEmission::getZxbgType, zxbgType)
.eq(BStatTableZxbgGasEmission::getZxbgPeriod, bMainActionReports.getReportsTime())
.eq(BStatTableZxbgGasEmission::getFactoryId, bMainActionReports.getFactoryId());
List<BStatTableZxbgGasEmission> bStatTableZxbgPflWaters = bStatTableZxbgGasEmissionMapper.selectList(bStatTableZxbgGasEmissionLambdaQueryWrapper);
for (BStatTableZxbgGasEmission bStatTableZxbgGasEmission : bStatTableZxbgPflWaters) {
BigDecimal folds = new BigDecimal(bStatTableZxbgGasEmission.getFoldsAvgHour());
BigDecimal emiss = new BigDecimal(bStatTableZxbgGasEmission.getEmissionConcentration());
if (emiss.doubleValue()>folds.doubleValue()){
addAmProblemFi(bStatTableZxbgGasEmission);
}
}
}
}
public void addAmProblemFi(BStatTableZxbgGasEmission bStatTableZxbgPflAir){
PcFactory pcFactory = factoryMapper.selectById(bStatTableZxbgPflAir.getFactoryId());
if (pcFactory==null){
log.warn("企业id不存在 , 企业ID : {}",bStatTableZxbgPflAir.getFactoryId());
}
LambdaQueryWrapper<PcOutlet> eq = new QueryWrapper<PcOutlet>().lambda().eq(PcOutlet::getOutletCode, bStatTableZxbgPflAir.getOutletCode());
PcOutlet pcOutlet = pcOutletMapper.selectOne(eq);
String problemString = getProblemString(pcFactory.getFactoryName() , pcOutlet.getOutletCode() , pcOutlet.getOutletName(), bStatTableZxbgPflAir.getZxbgPeriod(), bStatTableZxbgPflAir.getPollutantName());
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 outletCode , String outletName , String zxbgPeriod , String pollutantName){
return new StringBuilder()
.append("企业名称").append(factoryName).append("(").append(zxbgPeriod).append(")")
.append("中").append(outletCode).append(outletName).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;
}
}

View File

@ -0,0 +1,124 @@
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.*;
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 AirExcessQuarterAvgProcessService implements PollutionDischargeProcessService {
@Autowired
//b_stat_table_zxbg_gas_emission
private BStatTableZxbgGasEmissionMapper bStatTableZxbgGasEmissionMapper;
@Autowired
private BMainActionReportsMapper mainActionReportsMapper;
@Autowired
private AmProblemFiMapper amProblemFiMapper;
@Autowired
private PcFactoryMapper factoryMapper;
@Autowired
private PcOutletMapper pcOutletMapper;
/**
* 012
*/
public static final String zxbgType = "1";
/**
* 123
*/
public static final String reportsType = "2";
/**
* 12 3
*/
public static final String pollutantSource = "1";
@Override
public void process() {
// todo :缺少查询报告周期条件
List<BMainActionReports> report = getReport();
for (BMainActionReports bMainActionReports : report) {
LambdaQueryWrapper<BStatTableZxbgGasEmission> bStatTableZxbgGasEmissionLambdaQueryWrapper = new QueryWrapper<BStatTableZxbgGasEmission>().lambda()
.eq(BStatTableZxbgGasEmission::getZxbgType, zxbgType)
.eq(BStatTableZxbgGasEmission::getZxbgPeriod, bMainActionReports.getReportsTime())
.eq(BStatTableZxbgGasEmission::getFactoryId, bMainActionReports.getFactoryId());
List<BStatTableZxbgGasEmission> bStatTableZxbgPflWaters = bStatTableZxbgGasEmissionMapper.selectList(bStatTableZxbgGasEmissionLambdaQueryWrapper);
for (BStatTableZxbgGasEmission bStatTableZxbgGasEmission : bStatTableZxbgPflWaters) {
BigDecimal folds = new BigDecimal(bStatTableZxbgGasEmission.getFoldsAvgHour());
BigDecimal emiss = new BigDecimal(bStatTableZxbgGasEmission.getEmissionConcentration());
if (emiss.doubleValue()>folds.doubleValue()){
addAmProblemFi(bStatTableZxbgGasEmission);
}
}
}
}
public void addAmProblemFi(BStatTableZxbgGasEmission bStatTableZxbgPflAir){
PcFactory pcFactory = factoryMapper.selectById(bStatTableZxbgPflAir.getFactoryId());
if (pcFactory==null){
log.warn("企业id不存在 , 企业ID : {}",bStatTableZxbgPflAir.getFactoryId());
}
LambdaQueryWrapper<PcOutlet> eq = new QueryWrapper<PcOutlet>().lambda().eq(PcOutlet::getOutletCode, bStatTableZxbgPflAir.getOutletCode());
PcOutlet pcOutlet = pcOutletMapper.selectOne(eq);
String problemString = getProblemString(pcFactory.getFactoryName() , pcOutlet.getOutletCode() , pcOutlet.getOutletName(), bStatTableZxbgPflAir.getZxbgPeriod(), bStatTableZxbgPflAir.getPollutantName());
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 outletCode , String outletName , String zxbgPeriod , String pollutantName){
return new StringBuilder()
.append("企业名称").append(factoryName).append("(").append(zxbgPeriod).append(")")
.append("中").append(outletCode).append(outletName).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;
}
}

View File

@ -0,0 +1,124 @@
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.*;
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 AirExcessYearAvgProcessService implements PollutionDischargeProcessService {
@Autowired
//b_stat_table_zxbg_gas_emission
private BStatTableZxbgGasEmissionMapper bStatTableZxbgGasEmissionMapper;
@Autowired
private BMainActionReportsMapper mainActionReportsMapper;
@Autowired
private AmProblemFiMapper amProblemFiMapper;
@Autowired
private PcFactoryMapper factoryMapper;
@Autowired
private PcOutletMapper pcOutletMapper;
/**
* 012
*/
public static final String zxbgType = "2";
/**
* 123
*/
public static final String reportsType = "1";
/**
* 12 3
*/
public static final String pollutantSource = "1";
@Override
public void process() {
// todo :缺少查询报告周期条件
List<BMainActionReports> report = getReport();
for (BMainActionReports bMainActionReports : report) {
LambdaQueryWrapper<BStatTableZxbgGasEmission> bStatTableZxbgGasEmissionLambdaQueryWrapper = new QueryWrapper<BStatTableZxbgGasEmission>().lambda()
.eq(BStatTableZxbgGasEmission::getZxbgType, zxbgType)
.eq(BStatTableZxbgGasEmission::getZxbgPeriod, bMainActionReports.getReportsTime())
.eq(BStatTableZxbgGasEmission::getFactoryId, bMainActionReports.getFactoryId());
List<BStatTableZxbgGasEmission> bStatTableZxbgPflWaters = bStatTableZxbgGasEmissionMapper.selectList(bStatTableZxbgGasEmissionLambdaQueryWrapper);
for (BStatTableZxbgGasEmission bStatTableZxbgGasEmission : bStatTableZxbgPflWaters) {
BigDecimal folds = new BigDecimal(bStatTableZxbgGasEmission.getFoldsAvgHour());
BigDecimal emiss = new BigDecimal(bStatTableZxbgGasEmission.getEmissionConcentration());
if (emiss.doubleValue()>folds.doubleValue()){
addAmProblemFi(bStatTableZxbgGasEmission);
}
}
}
}
public void addAmProblemFi(BStatTableZxbgGasEmission bStatTableZxbgPflAir){
PcFactory pcFactory = factoryMapper.selectById(bStatTableZxbgPflAir.getFactoryId());
if (pcFactory==null){
log.warn("企业id不存在 , 企业ID : {}",bStatTableZxbgPflAir.getFactoryId());
}
LambdaQueryWrapper<PcOutlet> eq = new QueryWrapper<PcOutlet>().lambda().eq(PcOutlet::getOutletCode, bStatTableZxbgPflAir.getOutletCode());
PcOutlet pcOutlet = pcOutletMapper.selectOne(eq);
String problemString = getProblemString(pcFactory.getFactoryName() , pcOutlet.getOutletCode() , pcOutlet.getOutletName(), bStatTableZxbgPflAir.getZxbgPeriod(), bStatTableZxbgPflAir.getPollutantName());
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 outletCode , String outletName , String zxbgPeriod , String pollutantName){
return new StringBuilder()
.append("企业名称").append(factoryName).append("(").append(zxbgPeriod).append(")")
.append("中").append(outletCode).append(outletName).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;
}
}

View File

@ -0,0 +1,124 @@
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.*;
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 WaterExcessMonthAvgProcessService implements PollutionDischargeProcessService {
@Autowired
//b_stat_table_zxbg_water_emission
private BStatTableZxbgWaterEmissionMapper bStatTableZxbgWaterEmissionMapper;
@Autowired
private BMainActionReportsMapper mainActionReportsMapper;
@Autowired
private AmProblemFiMapper amProblemFiMapper;
@Autowired
private PcFactoryMapper factoryMapper;
@Autowired
private PcOutletMapper pcOutletMapper;
/**
* 012
*/
public static final String zxbgType = "0";
/**
* 123
*/
public static final String reportsType = "3";
/**
* 12 3
*/
public static final String pollutantSource = "1";
@Override
public void process() {
// todo :缺少查询报告周期条件
List<BMainActionReports> report = getReport();
for (BMainActionReports bMainActionReports : report) {
LambdaQueryWrapper<BStatTableZxbgWaterEmission> bStatTableZxbgGasEmissionLambdaQueryWrapper = new QueryWrapper<BStatTableZxbgWaterEmission>().lambda()
.eq(BStatTableZxbgWaterEmission::getZxbgType, zxbgType)
.eq(BStatTableZxbgWaterEmission::getZxbgPeriod, bMainActionReports.getReportsTime())
.eq(BStatTableZxbgWaterEmission::getFactoryId, bMainActionReports.getFactoryId());
List<BStatTableZxbgWaterEmission> bStatTableZxbgPflWaters = bStatTableZxbgWaterEmissionMapper.selectList(bStatTableZxbgGasEmissionLambdaQueryWrapper);
for (BStatTableZxbgWaterEmission bStatTableZxbgGasEmission : bStatTableZxbgPflWaters) {
BigDecimal folds = new BigDecimal(bStatTableZxbgGasEmission.getDetectionAvgDay());
BigDecimal emiss = new BigDecimal(bStatTableZxbgGasEmission.getEmissionConcentration());
if (emiss.doubleValue()>folds.doubleValue()){
addAmProblemFi(bStatTableZxbgGasEmission);
}
}
}
}
public void addAmProblemFi(BStatTableZxbgWaterEmission bStatTableZxbgPflAir){
PcFactory pcFactory = factoryMapper.selectById(bStatTableZxbgPflAir.getFactoryId());
if (pcFactory==null){
log.warn("企业id不存在 , 企业ID : {}",bStatTableZxbgPflAir.getFactoryId());
}
LambdaQueryWrapper<PcOutlet> eq = new QueryWrapper<PcOutlet>().lambda().eq(PcOutlet::getOutletCode, bStatTableZxbgPflAir.getOutletCode());
PcOutlet pcOutlet = pcOutletMapper.selectOne(eq);
String problemString = getProblemString(pcFactory.getFactoryName() , pcOutlet.getOutletCode() , pcOutlet.getOutletName(), bStatTableZxbgPflAir.getZxbgPeriod(), bStatTableZxbgPflAir.getPollutantName());
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 outletCode , String outletName , String zxbgPeriod , String pollutantName){
return new StringBuilder()
.append("企业名称").append(factoryName).append("(").append(zxbgPeriod).append(")")
.append("中").append(outletCode).append(outletName).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;
}
}

View File

@ -0,0 +1,124 @@
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.*;
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 WaterExcessQuarterAvgProcessService implements PollutionDischargeProcessService {
@Autowired
//b_stat_table_zxbg_water_emission
private BStatTableZxbgWaterEmissionMapper bStatTableZxbgWaterEmissionMapper;
@Autowired
private BMainActionReportsMapper mainActionReportsMapper;
@Autowired
private AmProblemFiMapper amProblemFiMapper;
@Autowired
private PcFactoryMapper factoryMapper;
@Autowired
private PcOutletMapper pcOutletMapper;
/**
* 012
*/
public static final String zxbgType = "1";
/**
* 123
*/
public static final String reportsType = "2";
/**
* 12 3
*/
public static final String pollutantSource = "1";
@Override
public void process() {
// todo :缺少查询报告周期条件
List<BMainActionReports> report = getReport();
for (BMainActionReports bMainActionReports : report) {
LambdaQueryWrapper<BStatTableZxbgWaterEmission> bStatTableZxbgGasEmissionLambdaQueryWrapper = new QueryWrapper<BStatTableZxbgWaterEmission>().lambda()
.eq(BStatTableZxbgWaterEmission::getZxbgType, zxbgType)
.eq(BStatTableZxbgWaterEmission::getZxbgPeriod, bMainActionReports.getReportsTime())
.eq(BStatTableZxbgWaterEmission::getFactoryId, bMainActionReports.getFactoryId());
List<BStatTableZxbgWaterEmission> bStatTableZxbgPflWaters = bStatTableZxbgWaterEmissionMapper.selectList(bStatTableZxbgGasEmissionLambdaQueryWrapper);
for (BStatTableZxbgWaterEmission bStatTableZxbgGasEmission : bStatTableZxbgPflWaters) {
BigDecimal folds = new BigDecimal(bStatTableZxbgGasEmission.getDetectionAvgDay());
BigDecimal emiss = new BigDecimal(bStatTableZxbgGasEmission.getEmissionConcentration());
if (emiss.doubleValue()>folds.doubleValue()){
addAmProblemFi(bStatTableZxbgGasEmission);
}
}
}
}
public void addAmProblemFi(BStatTableZxbgWaterEmission bStatTableZxbgPflAir){
PcFactory pcFactory = factoryMapper.selectById(bStatTableZxbgPflAir.getFactoryId());
if (pcFactory==null){
log.warn("企业id不存在 , 企业ID : {}",bStatTableZxbgPflAir.getFactoryId());
}
LambdaQueryWrapper<PcOutlet> eq = new QueryWrapper<PcOutlet>().lambda().eq(PcOutlet::getOutletCode, bStatTableZxbgPflAir.getOutletCode());
PcOutlet pcOutlet = pcOutletMapper.selectOne(eq);
String problemString = getProblemString(pcFactory.getFactoryName() , pcOutlet.getOutletCode() , pcOutlet.getOutletName(), bStatTableZxbgPflAir.getZxbgPeriod(), bStatTableZxbgPflAir.getPollutantName());
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 outletCode , String outletName , String zxbgPeriod , String pollutantName){
return new StringBuilder()
.append("企业名称").append(factoryName).append("(").append(zxbgPeriod).append(")")
.append("中").append(outletCode).append(outletName).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;
}
}

View File

@ -0,0 +1,124 @@
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.*;
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 WaterExcessYearAvgProcessService implements PollutionDischargeProcessService {
@Autowired
//b_stat_table_zxbg_water_emission
private BStatTableZxbgWaterEmissionMapper bStatTableZxbgWaterEmissionMapper;
@Autowired
private BMainActionReportsMapper mainActionReportsMapper;
@Autowired
private AmProblemFiMapper amProblemFiMapper;
@Autowired
private PcFactoryMapper factoryMapper;
@Autowired
private PcOutletMapper pcOutletMapper;
/**
* 012
*/
public static final String zxbgType = "2";
/**
* 123
*/
public static final String reportsType = "1";
/**
* 12 3
*/
public static final String pollutantSource = "1";
@Override
public void process() {
// todo :缺少查询报告周期条件
List<BMainActionReports> report = getReport();
for (BMainActionReports bMainActionReports : report) {
LambdaQueryWrapper<BStatTableZxbgWaterEmission> bStatTableZxbgGasEmissionLambdaQueryWrapper = new QueryWrapper<BStatTableZxbgWaterEmission>().lambda()
.eq(BStatTableZxbgWaterEmission::getZxbgType, zxbgType)
.eq(BStatTableZxbgWaterEmission::getZxbgPeriod, bMainActionReports.getReportsTime())
.eq(BStatTableZxbgWaterEmission::getFactoryId, bMainActionReports.getFactoryId());
List<BStatTableZxbgWaterEmission> bStatTableZxbgPflWaters = bStatTableZxbgWaterEmissionMapper.selectList(bStatTableZxbgGasEmissionLambdaQueryWrapper);
for (BStatTableZxbgWaterEmission bStatTableZxbgGasEmission : bStatTableZxbgPflWaters) {
BigDecimal folds = new BigDecimal(bStatTableZxbgGasEmission.getDetectionAvgDay());
BigDecimal emiss = new BigDecimal(bStatTableZxbgGasEmission.getEmissionConcentration());
if (emiss.doubleValue()>folds.doubleValue()){
addAmProblemFi(bStatTableZxbgGasEmission);
}
}
}
}
public void addAmProblemFi(BStatTableZxbgWaterEmission bStatTableZxbgPflAir){
PcFactory pcFactory = factoryMapper.selectById(bStatTableZxbgPflAir.getFactoryId());
if (pcFactory==null){
log.warn("企业id不存在 , 企业ID : {}",bStatTableZxbgPflAir.getFactoryId());
}
LambdaQueryWrapper<PcOutlet> eq = new QueryWrapper<PcOutlet>().lambda().eq(PcOutlet::getOutletCode, bStatTableZxbgPflAir.getOutletCode());
PcOutlet pcOutlet = pcOutletMapper.selectOne(eq);
String problemString = getProblemString(pcFactory.getFactoryName() , pcOutlet.getOutletCode() , pcOutlet.getOutletName(), bStatTableZxbgPflAir.getZxbgPeriod(), bStatTableZxbgPflAir.getPollutantName());
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 outletCode , String outletName , String zxbgPeriod , String pollutantName){
return new StringBuilder()
.append("企业名称").append(factoryName).append("(").append(zxbgPeriod).append(")")
.append("中").append(outletCode).append(outletName).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;
}
}

View File

@ -32,6 +32,24 @@ public class ReportExcessController {
@Autowired @Autowired
private WaterExcessYearProcessService waterExcessYearProcessService; private WaterExcessYearProcessService waterExcessYearProcessService;
@Autowired
private AirExcessMonthAvgProcessService airExcessMonthAvgProcessService;
@Autowired
private AirExcessQuarterAvgProcessService airExcessQuarterAvgProcessService;
@Autowired
private AirExcessYearAvgProcessService airExcessYearAvgProcessService;
@Autowired
private WaterExcessMonthAvgProcessService waterExcessMonthAvgProcessService;
@Autowired
private WaterExcessQuarterAvgProcessService waterExcessQuarterAvgProcessService;
@Autowired
private WaterExcessYearAvgProcessService waterExcessYearAvgProcessService;
@GetMapping("/airExcessMonth") @GetMapping("/airExcessMonth")
public void airExcessMonth() { public void airExcessMonth() {
@ -93,4 +111,65 @@ public class ReportExcessController {
} }
} }
/////
@GetMapping("/airAvgExcessMonth")
public void airAvgExcessMonth() {
try {
airExcessMonthAvgProcessService.process();
} catch (Exception e) {
e.printStackTrace();
log.info("废气均值监测超量未落实排污许可 , 按月 . 原因:" + e.getMessage());
}
}
@GetMapping("/airAvgExcessQuarter")
public void airAvgExcessQuarter() {
try {
airExcessQuarterAvgProcessService.process();
} catch (Exception e) {
e.printStackTrace();
log.info("废气均值监测超量未落实排污许可 , 按季度 . 原因:" + e.getMessage());
}
}
@GetMapping("/airAvgExcessYear")
public void airAvgExcessYear() {
try {
airExcessYearAvgProcessService.process();
} catch (Exception e) {
e.printStackTrace();
log.info("废气均值监测超量未落实排污许可 , 按年 . 原因:" + e.getMessage());
}
}
@GetMapping("/waterAvgExcessMonth")
public void waterAvgExcessMonth() {
try {
waterExcessMonthAvgProcessService.process();
} catch (Exception e) {
e.printStackTrace();
log.info("废水均值监测超量未落实排污许可 , 按月 . 原因:" + e.getMessage());
}
}
@GetMapping("/waterAvgExcessQuarter")
public void waterAvgExcessQuarter() {
try {
waterExcessQuarterAvgProcessService.process();
} catch (Exception e) {
e.printStackTrace();
log.info("废水均值监测超量未落实排污许可 , 按季度 . 原因:" + e.getMessage());
}
}
@GetMapping("/waterAvgExcessYear")
public void waterAvgExcessYear() {
try {
waterExcessYearAvgProcessService.process();
} catch (Exception e) {
e.printStackTrace();
log.info("废水均值监测超量未落实排污许可 , 按年 . 原因:" + e.getMessage());
}
}
} }