废气废水均值监测超量未落实排污许可
parent
2a25593d8c
commit
a85cb25fa0
|
@ -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;
|
||||
|
||||
/**
|
||||
* 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<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;
|
||||
}
|
||||
|
||||
}
|
|
@ -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;
|
||||
|
||||
/**
|
||||
* 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<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;
|
||||
}
|
||||
|
||||
}
|
|
@ -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;
|
||||
|
||||
/**
|
||||
* 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<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;
|
||||
}
|
||||
|
||||
}
|
|
@ -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;
|
||||
|
||||
/**
|
||||
* 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<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;
|
||||
}
|
||||
|
||||
}
|
|
@ -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;
|
||||
|
||||
/**
|
||||
* 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<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;
|
||||
}
|
||||
|
||||
}
|
|
@ -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;
|
||||
|
||||
/**
|
||||
* 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<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;
|
||||
}
|
||||
|
||||
}
|
|
@ -32,6 +32,24 @@ public class ReportExcessController {
|
|||
@Autowired
|
||||
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")
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue