dd5e9c3a 康伟

kangwei : 能环保态势大屏-后端接口

1 个父辈 6c6700aa
正在显示 20 个修改的文件 包含 743 行增加155 行删除
......@@ -29,12 +29,17 @@ public class ReportViewUtil {
*/
public static String buildView(String reportId,String fields,String departIds,String startTime,String endTime) {
String[] departIdArray = departIds.split(",");
String inSqlPart = "";
String inItemSqlPart = "";
for(String departId : departIdArray) {
inSqlPart = inSqlPart + ",'"+departId+"'";
if(StringUtils.isNotEmpty(departIds)){
String[] departIdArray = departIds.split(",");
for(String departId : departIdArray) {
inSqlPart = inSqlPart + ",'"+departId+"'";
}
inSqlPart = inSqlPart.substring(1);
}
if(!StringUtils.isEmpty(fields)) {
String[] fieldArray = fields.split(",");
for(String field : fieldArray) {
......@@ -49,7 +54,7 @@ public class ReportViewUtil {
}
inItemSqlPart = inItemSqlPart.substring(1);
}
inSqlPart = inSqlPart.substring(1);
JdbcTemplate masterDB = (JdbcTemplate)SpringContextUtils.getBean("master");
String itemSql = "select item_code,id from f_report_item where report_id = '"+reportId+"' and required = 1 ";
if(!StringUtils.isEmpty(inItemSqlPart)) {
......@@ -71,11 +76,14 @@ public class ReportViewUtil {
}
sb.append("`a`.`depart_id` AS `depart_id`,`a`.`data_id` AS `id`,`a`.`data_time` AS `time` from (( ");
sb.append("SELECT data_id,reit_id,item_value,data_time,depart_id FROM f_report_itemv v WHERE depart_id in ("+inSqlPart+") ");
sb.append("SELECT data_id,reit_id,item_value,data_time,depart_id FROM f_report_itemv v WHERE 1=1 ");
if(StringUtils.isNotEmpty(inSqlPart)){
sb.append(" depart_id in (\"+inSqlPart+\") ");
}
if(!StringUtils.isEmpty(startTime)) {
sb.append("and data_time>='"+startTime+"' and data_time<='"+endTime+"' ");
sb.append(" and data_time>='"+startTime+"' and data_time<='"+endTime+"' ");
}
sb.append("and reit_id in ("+itemIds+")) `a` left join `f_report_item` `d` on((`a`.`reit_id` = `d`.`id`))) where 1=1 group by `a`.`data_id`,`a`.`depart_id`,`a`.`data_time` order by `a`.`data_time`)");
sb.append(" and reit_id in ("+itemIds+")) `a` left join `f_report_item` `d` on((`a`.`reit_id` = `d`.`id`))) where 1=1 group by `a`.`data_id`,`a`.`depart_id`,`a`.`data_time` order by `a`.`data_time`)");
return sb.toString();
}
......@@ -146,11 +154,14 @@ public class ReportViewUtil {
public static String buildViewLike(String reportId,String fields,String departIds,String startTime,String endTime) {
String[] departIdArray = departIds.split(",");
String inSqlPart = "";
String inItemSqlPart = "";
for(String departId : departIdArray) {
inSqlPart = inSqlPart + ",'"+departId+"'";
if(StringUtils.isNotEmpty(departIds)){
String[] departIdArray = departIds.split(",");
for(String departId : departIdArray) {
inSqlPart = inSqlPart + ",'"+departId+"'";
}
inSqlPart = inSqlPart.substring(1);
}
if(!StringUtils.isEmpty(fields)) {
String[] fieldArray = fields.split(",");
......@@ -166,7 +177,7 @@ public class ReportViewUtil {
}
inItemSqlPart = inItemSqlPart.substring(1);
}
inSqlPart = inSqlPart.substring(1);
JdbcTemplate masterDB = (JdbcTemplate)SpringContextUtils.getBean("master");
String itemSql = "select item_code,id from f_report_item where report_id = '"+reportId+"' and required = 1 ";
if(!StringUtils.isEmpty(inItemSqlPart)) {
......
package com.skua.tool.util;
import org.apache.commons.lang3.StringUtils;
import org.bytedeco.libfreenect2.Logger;
import java.math.BigDecimal;
import java.math.RoundingMode;
......@@ -42,15 +43,16 @@ public class DigitalUtils {
* @return
*/
public static String add(String val1 , String val2){
String resultStr = "0";
if(val1 != null ){
BigDecimal original = new BigDecimal(val1);
BigDecimal num2 = new BigDecimal(val2);
BigDecimal result = BigDecimal.ZERO;
if(StringUtils.isNotEmpty(val1)){
result = new BigDecimal(val1);
// BigDecimal rounded = original.multiply( num2).setScale(2, BigDecimal.ROUND_HALF_UP);
resultStr = original.add( num2 ).toString();
}
return resultStr;
if(StringUtils.isNotEmpty(val2)){
BigDecimal num2 = new BigDecimal(val2);
result = result.add( num2 );
}
return result.toString();
}
......@@ -66,9 +68,38 @@ public class DigitalUtils {
// BigDecimal rounded = original.multiply( num2).setScale(2, BigDecimal.ROUND_HALF_UP);
resultStr = original.multiply( num2 ).toString();
}
return resultStr;
}
public static String subtract(String num1 , String num2){
String resultStr = null ;
if(StringUtils.isNotEmpty(num1) && StringUtils.isNotEmpty(num2) ){
BigDecimal num1_b = new BigDecimal(num1);
BigDecimal num2_b = new BigDecimal(num2);
// BigDecimal rounded = original.multiply( num2).setScale(2, BigDecimal.ROUND_HALF_UP);
resultStr = num1_b.subtract( num2_b ).toString();
}
return resultStr;
}
/***
* 比较两个数
* @param num1
* @param num2
* @return comparisonResult=0 相等; 大于返回1 ,小于返回-1
*/
public static Integer compareTo(String num1 , String num2){
Integer comparisonResult = null ;
if(StringUtils.isNotEmpty(num1) && StringUtils.isNotEmpty(num2) ){
BigDecimal num1_b = new BigDecimal(num1);
BigDecimal num2_b = new BigDecimal(num2);
// BigDecimal rounded = original.multiply( num2).setScale(2, BigDecimal.ROUND_HALF_UP);
comparisonResult = num1_b.compareTo( num2_b );
}
return comparisonResult ;
}
/**
* 除法 保留两位小数
* @param dividend 请输入被除数
......@@ -76,17 +107,18 @@ public class DigitalUtils {
* @return
*/
public static String division(String dividend , String divisor ){
String resultStr = dividend;
if( dividend != null && dividend.length()>0 && divisor != null && divisor.length()>0){
double dividendD = Double.parseDouble(dividend);
double divisorD = Double.parseDouble(divisor);
if(divisorD != 0 ){
double result = dividendD /divisorD;
BigDecimal bd = new BigDecimal(result);
BigDecimal roundedResult = bd.setScale(2, BigDecimal.ROUND_HALF_UP);
resultStr = roundedResult.toString();
String resultStr = null;
try{
if( isNumber(dividend) && isNumber( divisor) && Double.parseDouble(divisor) != 0 ){
BigDecimal dividend_BD = new BigDecimal(dividend);
BigDecimal divisor_BD = new BigDecimal(divisor);
BigDecimal result = dividend_BD.divide(divisor_BD).setScale(2, RoundingMode.HALF_UP);
resultStr = result.toString();
}
}catch(Exception e){
e.printStackTrace();
}
//System.out.print("请输入被除数:");double dividend =scanner.nextDouble();
// System.out.print("请输入除数:");double divisor =scanner.nextDouble();
......@@ -100,16 +132,31 @@ public class DigitalUtils {
* @return
*/
public static boolean isNumeric(String str) {
Pattern pattern = Pattern.compile("-?[0-9]+.?[0-9]*");
// 科学计数法
Pattern pattern2 = Pattern.compile("^[+-]?[\\d]+([.][\\d]*)?([Ee][+-]?[\\d]+)?$");
if (StringUtils.isEmpty(str)) {
return false;
} else {
Matcher isNum = pattern.matcher(str);
Matcher isNum2 = pattern2.matcher(str);
return isNum.matches() || isNum2.matches();
if(org.apache.commons.lang.StringUtils.isNotEmpty(str) ){
Pattern pattern = Pattern.compile("-?[0-9]+.?[0-9]*");
// 科学计数法
Pattern pattern2 = Pattern.compile("^[+-]?[\\d]+([.][\\d]*)?([Ee][+-]?[\\d]+)?$");
if (StringUtils.isEmpty(str)) {
return false;
} else {
Matcher isNum = pattern.matcher(str);
Matcher isNum2 = pattern2.matcher(str);
return isNum.matches() || isNum2.matches();
}
}
return false;
}
public static boolean isNumber(String str) {
// Pattern pattern = Pattern.compile("^(([1-9]{1}\\d*)|([0]{1}))(\\.(\\d){0,2})?$"); // 判断小数点后2位的数字的正则表达式
if(org.apache.commons.lang.StringUtils.isNotEmpty(str) ){
String reg = "^(\\-|\\+)?\\d+(\\.\\d+)?$";
Pattern pattern = Pattern.compile(reg);
Matcher match = pattern.matcher(str);
return match.matches();
}
return false;
}
}
......
package com.skua.modules.edu.controller;
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.skua.common.report.ReportViewUtil;
import com.skua.core.api.vo.Result;
import com.skua.core.aspect.annotation.AutoLog;
import com.skua.core.query.QueryGenerator;
import com.skua.modules.edu.entity.Paper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
/**
* @auther kangwei
* @create 2024-10-14-16:46
*/
@Slf4j
@Api(tags="在线考试-试卷")
@RestController("testReportController")
@RequestMapping("/web/edu/paper")
public class TestReportSqlController {
@AutoLog(value = "在线考试--构造填报报表视图")
@ApiOperation(value="在线考试-构造填报报表视图", notes="在线考试-构造填报报表视图")
@GetMapping(value = "/testReportSql")
public Result<String> testReportSql(
@RequestParam(name="reportId") String reportId,
@RequestParam(name="fields") String fields,
@RequestParam(name="departIds") String departIds ,
@RequestParam(name="startTime") String startTime,
@RequestParam(name="endTime") String endTime,
HttpServletRequest req) {
Result<String> result = new Result();
String dataViewName2 = ReportViewUtil.buildViewLike(reportId,fields,departIds, startTime, endTime);
//String dataViewName3 = ReportViewUtil.buildViewByStatistics("3a243d5715b9e1a3753c180872ca0df9","DLHJ,GFFDL,QY,WNL,WNHSL,GFCZL,WFCSL,WFCZL", startTime, endTime);
result.setSuccess(true);
result.setResult(dataViewName2);
return result;
}
}
......@@ -127,7 +127,7 @@ mybatis-plus:
configuration:
call-setters-on-nulls: true
# 这个配置会将执行的sql打印出来,在开发或测试的时候可以用
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
#log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
#数矿专用配置
skua:
web-url: http://103.85.171.27:8096
......
......@@ -6,6 +6,8 @@ import java.util.Map;
import com.baomidou.mybatisplus.extension.service.IService;
import com.skua.modules.custom.entity.FCustomReportDataset;
import com.skua.modules.custom.vo.FCustomReportDatasetVO;
import com.skua.modules.report.vo.DataVO;
import com.skua.modules.report.vo.JnhbLargeScreenVO;
import com.skua.modules.report.vo.JnhbReportData;
/**
......@@ -104,4 +106,10 @@ public interface IFCustomReportDatasetService extends IService<FCustomReportData
//节能环保统计报表明细
Map<String, Object> jnhbReportDetails(String departId, String month);
/**
* 节能环保 大屏展示
* @return
*/
JnhbLargeScreenVO jnhbLargeScreenShow(DataVO dataVO);
}
......
......@@ -15,10 +15,9 @@ import java.time.temporal.WeekFields;
import java.util.*;
import java.util.stream.Collectors;
import com.skua.modules.report.vo.JnhbReportData;
import com.skua.modules.report.vo.JnhbReportDetailsDy;
import com.skua.modules.report.vo.JnhbReportDetailsHj;
import com.skua.modules.report.vo.JnhbReportDetailsJs;
import com.skua.modules.report.vo.*;
import com.skua.modules.report.vo.largeScreen.*;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
......@@ -277,6 +276,122 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
return map;
}
//节能环保 大屏展示
public JnhbLargeScreenVO jnhbLargeScreenShow(DataVO dataVO){
JnhbLargeScreenVO largeScreenVO = new JnhbLargeScreenVO();
//当月数据
String dataViewName2 = ReportViewUtil.buildView("2119ecbf53a1d2d0708258ff67cfd9e1","CSL", null, dataVO.getNowStartTime(), dataVO.getNowEndTime());
String dataViewName3 = ReportViewUtil.buildView("3a243d5715b9e1a3753c180872ca0df9","DLHJ,GFFDL,QY,WNL,WNHSL,GFCZL,WFCSL,WFCZL", null, dataVO.getNowStartTime(), dataVO.getNowEndTime());
List<JnhbReportData> jnhbReportDataList = mapper.getJnhbReport(dataViewName2, dataViewName3, dataVO.getNowStartTime(), dataVO.getNowEndTime());
// 上月数据 同比
dataViewName2 = ReportViewUtil.buildView("2119ecbf53a1d2d0708258ff67cfd9e1","CSL", null, dataVO.getLastMonthStartTime(), dataVO.getLastMonthEndTime());
dataViewName3 = ReportViewUtil.buildView("3a243d5715b9e1a3753c180872ca0df9","DLHJ,GFFDL,QY,WNL,WNHSL,GFCZL,WFCSL,WFCZL", null, dataVO.getLastMonthStartTime(), dataVO.getLastMonthEndTime());
List<JnhbReportData> lastMonthReportDataList = mapper.getJnhbReport(dataViewName2, dataViewName3, dataVO.getLastMonthStartTime(), dataVO.getLastMonthEndTime());
Map<String,JnhbReportData> lastMonthMapData= convertJnhbReportDataMap(lastMonthReportDataList);
// 去年数据 环比
dataViewName2 = ReportViewUtil.buildView("2119ecbf53a1d2d0708258ff67cfd9e1","CSL", null, dataVO.getLastYearStartTime(), dataVO.getLastYearEndTime());
dataViewName3 = ReportViewUtil.buildView("3a243d5715b9e1a3753c180872ca0df9","DLHJ,GFFDL,QY,WNL,WNHSL,GFCZL,WFCSL,WFCZL", null, dataVO.getLastYearStartTime(), dataVO.getLastYearEndTime());
List<JnhbReportData> lastYearReportDataList = mapper.getJnhbReport(dataViewName2, dataViewName3, dataVO.getLastYearStartTime(), dataVO.getLastYearEndTime());
Map<String,JnhbReportData> lastYearMapData= convertJnhbReportDataMap(lastYearReportDataList);
LoadRateVO loadRateVO = null;
PowerConsumeVO powerConsumeVO = null;
ResultNumberVO c02NumberVO = null;//CO2排放对象
ResultNumberVO cod_NumberVO = null;//COD
ResultNumberVO nh3n_NumberVO = null;//NH3-N
ResultNumberVO tp_NumberVO = null;//TP
ResultNumberVO tn_NumberVO = null;//TN
JnhbReportData lastMonthReportDataTemp ;//lastMonthMapData
JnhbReportData lastYearReportDataTemp ;//lastYearMapData
ResultChartsVO energyConsumeChart = null;
for(JnhbReportData reportData : jnhbReportDataList){
//头部-数据统计:污水处理量、系统负荷率、电耗、汽油、薪水、综合能耗、C02,吨水
largeScreenVO.setHeadStatisticsValue( reportData);
lastMonthReportDataTemp = lastMonthMapData.get(reportData.getDepartId());
lastYearReportDataTemp = lastYearMapData.get(reportData.getDepartId());
//各站点系统负荷率排名:
loadRateVO = new LoadRateVO(reportData.getDepartId(),reportData.getDepartName(),reportData.getWsclgm(),reportData.getWssjcll(),reportData.getWsfhl());
//各站点能源消耗排名:
powerConsumeVO = new PowerConsumeVO(reportData.getDepartId(),reportData.getDepartName(),reportData.getDh(), reportData.getGffdl(), reportData.getQy(), reportData.getZhnyxhl() , reportData.getEyhtpfl() , reportData.getDsdh() );
c02NumberVO = new ResultNumberVO();
c02NumberVO.setValue( reportData.getCodxjl() );
cod_NumberVO = new ResultNumberVO();cod_NumberVO.setValue(reportData.getCodxjl());
nh3n_NumberVO = new ResultNumberVO();nh3n_NumberVO.setValue(reportData.getTnxjl());
tp_NumberVO = new ResultNumberVO();tp_NumberVO.setValue(reportData.getTpxjl());
tn_NumberVO = new ResultNumberVO();tn_NumberVO.setValue(reportData.getTnxjl());
/*************同比环比数据设置****************/
if ( lastMonthReportDataTemp != null ){
//头部-数据统计:污水处理量、系统负荷率、电耗、汽油、薪水、综合能耗、C02,吨水
largeScreenVO.setHeadStatisticsValueHB( lastMonthReportDataTemp);
loadRateVO.setValueHb(lastMonthReportDataTemp.getWsfhl() );
powerConsumeVO.setValueHb(lastMonthReportDataTemp.getDsdh() );
c02NumberVO.setValueHb(lastMonthReportDataTemp.getCodxjl() );
cod_NumberVO.setValueHb(reportData.getCodxjl());
nh3n_NumberVO.setValueHb(reportData.getTnxjl());
tp_NumberVO.setValueHb(reportData.getTpxjl());
tn_NumberVO.setValueHb(reportData.getTnxjl());
}
if ( lastYearReportDataTemp != null ){
//头部-数据统计:污水处理量、系统负荷率、电耗、汽油、薪水、综合能耗、C02,吨水
largeScreenVO.setHeadStatisticsValueTB( lastYearReportDataTemp);
loadRateVO.setValueHb(lastYearReportDataTemp.getWsfhl() );
powerConsumeVO.setValueHb(lastYearReportDataTemp.getDsdh() );
c02NumberVO.setValueHb(lastYearReportDataTemp.getCodxjl() );
cod_NumberVO.setValueHb(reportData.getCodxjl());
nh3n_NumberVO.setValueHb(reportData.getTnxjl());
tp_NumberVO.setValueHb(reportData.getTpxjl());
tn_NumberVO.setValueHb(reportData.getTnxjl());
}
//loadRateVO.setValue(reportData.getWsfhl(),valueHb,valueTb );
largeScreenVO.getLoadRateVOList().add(loadRateVO );
largeScreenVO.getPowerConsumeVOList().add( powerConsumeVO );
//ESG减排趋势
energyConsumeChart = new ResultChartsVO();
energyConsumeChart.setData(reportData);
largeScreenVO.getEsgChartsList().add(energyConsumeChart);
//吨消减能耗
largeScreenVO.getEnergyConsumeChartsList().add( energyConsumeChart ) ;
//消减量统计
largeScreenVO.setReduceStatistics(1,cod_NumberVO);
largeScreenVO.setReduceStatistics(2,nh3n_NumberVO);
largeScreenVO.setReduceStatistics(3,tp_NumberVO);
largeScreenVO.setReduceStatistics(4,tn_NumberVO);
//CO2排放排名
largeScreenVO.getCo2DataList().add( c02NumberVO ) ;
//排放指标
// String ybgfcsl, String ybgfczl, String jgwnl, String wfcsl, String wfczl
largeScreenVO.getWasteMaterialList().add( new WasteMaterialVO( reportData.getDepartId(),reportData.getDepartName(),reportData.getYbgfcsl(),reportData.getYbgfczl(),reportData.getJgwnl(),reportData.getWfcsl(),reportData.getWfczl() ) ) ;
}
//主库数据源
JdbcTemplate masterDB = (JdbcTemplate) SpringContextUtils.getBean("master");
int count1 = masterDB.queryForObject("select count(1) from equipment_info where energy_level = 1",Integer.class);
largeScreenVO.setEquipmentL1( count1 );
int count2 = masterDB.queryForObject("select count(1) from equipment_info where energy_level = 2",Integer.class);
largeScreenVO.setEquipmentL2( count2 );
return largeScreenVO;
}
/**转换为Map<部门编号,JnhbReportData> */
private Map<String,JnhbReportData> convertJnhbReportDataMap(List<JnhbReportData> dataList){// Map<部门编号,JnhbReportData>
Map<String,JnhbReportData> dataMap = new HashMap<>();
for(JnhbReportData reportData : dataList){
dataMap.put( reportData.getDepartId(),reportData );
}
return dataMap;
}
@Override
public Map<String, Object> reportWeekShow(String dataTime, String week) {
Map<String, Object> map = new HashMap<>();
......
......@@ -9,6 +9,8 @@ import com.skua.core.util.ConvertUtils;
import com.skua.core.util.DateUtils;
import com.skua.modules.custom.service.IFCustomReportDatasetService;
import com.skua.modules.report.service.IReportDataService;
import com.skua.modules.report.vo.DataVO;
import com.skua.modules.report.vo.JnhbLargeScreenVO;
import com.skua.modules.report.vo.JnhbReportData;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -187,4 +189,14 @@ public class ReportDataController {
return result;
}
@AutoLog(value = "节能环保:大屏展示")
@ApiOperation(value = "节能环保:大屏展示", notes = "节能环保:大屏展示(time:yyyy-MM)")
@GetMapping(value = "/jnhbLargeScreenShow")
public Result<JnhbLargeScreenVO> jnhbLargeScreenShow( @RequestParam(name="time") String time) { //time
Result<JnhbLargeScreenVO> result = new Result<>();
DataVO dataVO = new DataVO(time);
JnhbLargeScreenVO jnhbLargeScreenVO = fCustomReportDatasetService.jnhbLargeScreenShow(dataVO);
result.setResult(jnhbLargeScreenVO);
return result;
}
}
......
......@@ -5,7 +5,7 @@
<!-- -->
<select id="queryReportMonthData" resultType="com.skua.modules.report.vo.FReportMonthDataVO">
SELECT
a.depart_id,tc.target_water,tc. target_power,tc.target_drug ,tc.target_charge_water,
a.depart_id,tc.target_water,tc. target_power,tc.target_drug,
(select t.depart_name from sys_depart t where t.id = a.depart_id ) 'depart_name',
(
select sum(fiv.item_value)/10000 from f_report_itemv fiv ,f_report_item fi
......
......@@ -4,6 +4,7 @@ import com.skua.core.context.SpringContextUtils;
import com.skua.modules.report.mapper.OperationReportMapper;
import com.skua.modules.report.service.IOperationReportService;
import com.skua.modules.report.vo.*;
import com.skua.tool.util.DigitalUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
......@@ -35,7 +36,7 @@ public class OperationReportServiceImpl implements IOperationReportService {
SeasonTimeVO lastSeasonTimeVO = new SeasonTimeVO(lastYear ,season );
//水务公司总数
String sql = "select * from sys_depart where depart_type = 1";
String sql = "select count(1) from sys_depart where depart_type = 1";
String deptartCount = queryForString(sql);
productDataVO.setDeptartCount( deptartCount );
......@@ -59,45 +60,44 @@ public class OperationReportServiceImpl implements IOperationReportService {
private void handeReportMonthData(ProductDataVO productDataVO,List<FReportMonthDataVO> reportMonthDataVOList,String disparityDay){
// 遍历月数据报表获取
BigDecimal chargeWaterVolume = BigDecimal.ZERO;//收费水量 总量
BigDecimal lastYearChargeWaterVolume = BigDecimal.ZERO;//去年收费水量 总量
BigDecimal ysjslWaterVolume = BigDecimal.ZERO;//月实际水量 总量
BigDecimal tqysjslWaterVolume = BigDecimal.ZERO;//同期月实际水量 总量
BigDecimal targetWater = BigDecimal.ZERO;;//水目标
String chargeWaterVolume = "0";//收费水量 总量
String lastYearChargeWaterVolume = "0";//去年收费水量 总量
String ysjslWaterVolume = "0";//月实际水量 总量
String tqysjslWaterVolume = "0";//同期月实际水量 总量
String targetWater = "0";//水目标
FReportWaterMonthDataVO reportMonthItemDataVO = null;
FReportPowerMonthDataVO reportPowerMonthDataVO = null;
//同期月实际水量
if(reportMonthDataVOList != null && !reportMonthDataVOList.isEmpty()){
for(FReportMonthDataVO monthDataVO : reportMonthDataVOList){
/**********************收费水量********************************/
if(StringUtils.isNotEmpty(monthDataVO.getYsfsl())){//ysfsl 月收费水量
chargeWaterVolume = chargeWaterVolume.add(new BigDecimal(monthDataVO.getYsfsl()));
chargeWaterVolume = DigitalUtils.add( chargeWaterVolume , monthDataVO.getYsfsl());
}
if(StringUtils.isNotEmpty(monthDataVO.getQntqsfsl())){//qntqsfsl 去年同期收费水量
lastYearChargeWaterVolume = lastYearChargeWaterVolume.add(new BigDecimal(monthDataVO.getQntqsfsl()));
lastYearChargeWaterVolume = DigitalUtils.add( lastYearChargeWaterVolume , monthDataVO.getQntqsfsl());
}
if(StringUtils.isNotEmpty(monthDataVO.getTargetWater())){//ysfsl 收费水量目标
targetWater = targetWater.add(new BigDecimal(monthDataVO.getTargetWater()));
targetWater = DigitalUtils.add( targetWater , monthDataVO.getTargetWater());
}
/********************实际水量**********************************/
if(StringUtils.isNotEmpty(monthDataVO.getYsjsl())){//ysjsl 月实际水量
ysjslWaterVolume = ysjslWaterVolume.add(new BigDecimal(monthDataVO.getYsjsl()));
ysjslWaterVolume = DigitalUtils.add( ysjslWaterVolume , monthDataVO.getYsjsl());
}
if(StringUtils.isNotEmpty(monthDataVO.getQntqsfsl())){//qntqsfsl 去年同期收费水量
tqysjslWaterVolume = tqysjslWaterVolume.add(new BigDecimal(monthDataVO.getQntqsfsl()));
tqysjslWaterVolume = DigitalUtils.add( tqysjslWaterVolume , monthDataVO.getQntqsfsl());
}
//同比下降的部门
int comparisonResult = ysjslWaterVolume.compareTo(tqysjslWaterVolume );
if(comparisonResult < 0){//同比下降
Integer comparisonResult_water = DigitalUtils.compareTo(ysjslWaterVolume , tqysjslWaterVolume) ;
if(comparisonResult_water != null && comparisonResult_water < 0 ){//同比下降
// 部门名称,下降比例,下降原因
BigDecimal ratio = ysjslWaterVolume.divide( tqysjslWaterVolume ,2, RoundingMode.HALF_UP).multiply( BigDecimal.valueOf(100));
String ratio = DigitalUtils.division( ysjslWaterVolume ,tqysjslWaterVolume ) ;
ratio = DigitalUtils.multiply( ratio , "100");
reportMonthItemDataVO = new FReportWaterMonthDataVO(monthDataVO.getDeptartName(),ratio,monthDataVO.getYsjsldyqntqyy()) ;
productDataVO.getWaterDeptartList().add( reportMonthItemDataVO );
}
/********************电**********************************/
String consume = checkPowerConsume(monthDataVO.getYdh(),monthDataVO.getYsjsl() ,monthDataVO.getTargetPower());//部门电耗
if(consume != null){
......@@ -107,13 +107,10 @@ public class OperationReportServiceImpl implements IOperationReportService {
/********************药剂**********************************/
productDataVO.setTargetDrug(monthDataVO.getTargetDrug() );//目标药剂
if(StringUtils.isNotEmpty(monthDataVO.getYyf()) && StringUtils.isNotEmpty(monthDataVO.getYsjsl()) ){
Double ysjslD = Double.parseDouble(monthDataVO.getYsjsl() );
if( ysjslD.doubleValue() > 0 ){
Double drugCost = Double.parseDouble(monthDataVO.getYyf()) / ysjslD;
Double targetDrugD = Double.parseDouble(monthDataVO.getTargetDrug());
if( drugCost.longValue() > targetDrugD.longValue()){
productDataVO.getDrugDeptartList().add( new FReportPowerMonthDataVO( monthDataVO.getDeptartName(), monthDataVO.getTargetDrug(),drugCost.toString(),monthDataVO.getYhcyqyy() ) );
}
String drugCost = DigitalUtils.division( monthDataVO.getYyf() , monthDataVO.getYsjsl() );
Integer comparison_drug = DigitalUtils.compareTo( drugCost , monthDataVO.getTargetDrug() ) ;
if(comparison_drug != null && comparison_drug > 0){
productDataVO.getDrugDeptartList().add( new FReportPowerMonthDataVO( monthDataVO.getDeptartName(), monthDataVO.getTargetDrug(),drugCost.toString(),monthDataVO.getYhcyqyy() ) );
}
}
}
......@@ -155,28 +152,25 @@ public class OperationReportServiceImpl implements IOperationReportService {
* @param tqysjslWaterVolume
* @param disparityDay
*/
public void setChargeWater(ProductDataVO productDataVO,BigDecimal chargeWaterVolume, BigDecimal tqysjslWaterVolume,BigDecimal targetChargeWater, String disparityDay) {
public void setChargeWater(ProductDataVO productDataVO,String chargeWaterVolume, String tqysjslWaterVolume,String targetChargeWater, String disparityDay) {
productDataVO.setChargeWaterVolume(chargeWaterVolume);//收费水量 总量
// 除法运算,保留两位小数
BigDecimal avgDayWaterVolume = chargeWaterVolume.divide( new BigDecimal(disparityDay) , 2, RoundingMode.HALF_UP);
String avgDayWaterVolume = DigitalUtils.division(chargeWaterVolume ,disparityDay );
productDataVO.setAvgDayWaterVolume( avgDayWaterVolume );//收费水量 日均值
//完成年度目标
if(targetChargeWater != null ){
BigDecimal completeRatio = chargeWaterVolume.divide( targetChargeWater ,2, RoundingMode.HALF_UP).multiply( BigDecimal.valueOf(100));
String completeRatio = DigitalUtils.division(chargeWaterVolume ,targetChargeWater );
productDataVO.setCompleteRatio( completeRatio );//完成年度目标
int comparisonResult = completeRatio.compareTo(BigDecimal.valueOf(25) );
int comparisonResult = DigitalUtils.compareTo(completeRatio ,"25" );
if(comparisonResult > 0 ){
productDataVO.setSequentialProgress("超额完成时序进度");
} else {
productDataVO.setSequentialProgress("基本满足时序进度");
}
}
if(tqysjslWaterVolume != null ){ //增长率
BigDecimal chargeWaterRatio = chargeWaterVolume.divide( tqysjslWaterVolume ,2, RoundingMode.HALF_UP);
productDataVO.setChargeWaterRatio( chargeWaterRatio );
}
String chargeWaterRatio = DigitalUtils.division(chargeWaterVolume , tqysjslWaterVolume ) ; //增长率
productDataVO.setChargeWaterRatio( chargeWaterRatio );
}
/***
......@@ -185,26 +179,22 @@ public class OperationReportServiceImpl implements IOperationReportService {
* @param tqysjslWaterVolume
* @param disparityDay
*/
public void setYsjslWater(ProductDataVO productDataVO,BigDecimal ysjslWaterVolume, BigDecimal tqysjslWaterVolume, String disparityDay) {
public void setYsjslWater(ProductDataVO productDataVO,String ysjslWaterVolume, String tqysjslWaterVolume, String disparityDay) {
productDataVO.setYsjslWaterVolume( ysjslWaterVolume );//实际水量
// 除法运算,保留两位小数
BigDecimal avgDayWaterVolume = ysjslWaterVolume.divide( new BigDecimal(disparityDay) , 2, RoundingMode.HALF_UP);
String avgDayWaterVolume = DigitalUtils.division(ysjslWaterVolume ,disparityDay );
productDataVO.setAvgDayWaterVolume( avgDayWaterVolume );//实际水量 日均值
//增长率
if(tqysjslWaterVolume != null ){
BigDecimal chargeWaterRatio = ysjslWaterVolume.divide( tqysjslWaterVolume ,2, RoundingMode.HALF_UP);
String chargeWaterRatio = DigitalUtils.division(ysjslWaterVolume ,tqysjslWaterVolume );
productDataVO.setYsjslWaterRatio( chargeWaterRatio );//完成年度目标
}
}
/***
* 执行查询sql语句返回一个结果
* @param sql
......
package com.skua.modules.report.vo;
import com.skua.core.util.DateUtils;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @auther kangwei
* @create 2024-10-15-9:45
*/
@Data
public class DataVO {
@ApiModelProperty(value = "当月(yyyy-MM)")
private String nowMonth;
@ApiModelProperty(value = "去年(yyyy-MM)")
private String lastYear;
@ApiModelProperty(value = "上月(yyyy-MM)")
private String lastMonth;
@ApiModelProperty(value = "当月的开始时间(yyyy-MM-dd)")
private String nowStartTime;
@ApiModelProperty(value = "当月的结束时间(yyyy-MM-dd)")
private String nowEndTime;
@ApiModelProperty(value = "上月的开始时间(yyyy-MM-dd)")
private String lastMonthStartTime;
@ApiModelProperty(value = "上月的结束时间(yyyy-MM-dd)")
private String lastMonthEndTime;
@ApiModelProperty(value = "去年的开始时间(yyyy-MM-dd)")
private String lastYearStartTime;
@ApiModelProperty(value = "去年的结束时间(yyyy-MM-dd)")
private String lastYearEndTime;
public DataVO(String nowMonth) {
this.nowMonth = nowMonth;
this.lastYear = DateUtils.getLastYearMonthOfMonth(nowMonth);
this.lastMonth = DateUtils.getLastMonthOfMonth(nowMonth);
this.nowStartTime = nowMonth+"-01";
this.nowEndTime = nowMonth+"-31";
this.lastMonthStartTime = lastMonth+"-01";
this.lastMonthEndTime = lastMonth+"-31";
this.lastYearStartTime = lastYear+"-01";
this.lastYearEndTime = lastYear +"-31";
}
}
......@@ -14,12 +14,12 @@ public class FReportWaterMonthDataVO {
private String deptartName;
@ApiModelProperty(value = "比例")
private BigDecimal ratio;
private String ratio;
@ApiModelProperty(value = "原因分析")
private String causeAnalysis;
public FReportWaterMonthDataVO(String deptartName, BigDecimal ratio, String causeAnalysis) {
public FReportWaterMonthDataVO(String deptartName, String ratio, String causeAnalysis) {
this.deptartName = deptartName;
this.ratio = ratio;
this.causeAnalysis = causeAnalysis;
......
package com.skua.modules.report.vo;
import com.skua.modules.report.vo.largeScreen.*;
import com.skua.tool.util.DigitalUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
/**
* 月度生产数据报表
*/
@Data
@ApiModel(value="生产运营--大屏对象", description="生产运营--月度生产数据报表")
public class JnhbLargeScreenVO {
@ApiModelProperty(value = "头部统计数值")
private List<ResultNumberVO> headStatisticsList = new ArrayList<>(8);
@ApiModelProperty(value = "各站点能源消耗排名")
private List<PowerConsumeVO> powerConsumeVOList = new ArrayList();
@ApiModelProperty(value = "负荷率对象")
private List<LoadRateVO> loadRateVOList = new ArrayList<>();
@ApiModelProperty(value = "CO2排放排名")
private List<ResultNumberVO> co2DataList = new ArrayList<>();
@ApiModelProperty(value = "消减量统计")
private List<ResultNumberVO> reduceStatisticsList = new ArrayList<>(4);
@ApiModelProperty(value = "ESG减排趋势")
private List<ResultChartsVO> esgChartsList= new ArrayList<>();
@ApiModelProperty(value = "吨消减能耗")
private List<ResultChartsVO> energyConsumeChartsList= new ArrayList<>();
@ApiModelProperty(value = "废物处理对象集合")
private List<WasteMaterialVO> wasteMaterialList = new ArrayList<>();//废物处理对象集合
@ApiModelProperty(value = "一级能耗设备数量")
private Integer equipmentL1;
@ApiModelProperty(value = "二级能耗设备")
private Integer equipmentL2;
/***
* 设置消减统计记录
*/
public void setHeadStatisticsValue(JnhbReportData reportData){
// wssjcll, wsfhl, dh, qy, xinshui, zhnyxhl, eyhtpfl, dsdh
////水处理量,系统负荷率,电耗,汽油,新水,综合能耗,C02,吨水
this.getHeadStatisticsList().get(0).setValue( reportData.getWssjcll() );
this.getHeadStatisticsList().get(1).setValue( reportData.getWsfhl() );
this.getHeadStatisticsList().get(2).setValue( reportData.getDh() );
this.getHeadStatisticsList().get(3).setValue( reportData.getQy() );
//this.getHeadStatisticsList().get(4).setValue( reportData.getWssjcll() );
this.getHeadStatisticsList().get(5).setValue( reportData.getZhnyxhl() );
this.getHeadStatisticsList().get(6).setValue( reportData.getEyhtpfl() );
this.getHeadStatisticsList().get(7).setValue( reportData.getDsdh() );
}
public void setHeadStatisticsValueTB(JnhbReportData reportData){
// wssjcll, wsfhl, dh, qy, xinshui, zhnyxhl, eyhtpfl, dsdh
////水处理量,系统负荷率,电耗,汽油,新水,综合能耗,C02,吨水
this.getHeadStatisticsList().get(0).setValueTb( reportData.getWssjcll() );
this.getHeadStatisticsList().get(1).setValueTb( reportData.getWsfhl() );
this.getHeadStatisticsList().get(2).setValueTb( reportData.getDh() );
this.getHeadStatisticsList().get(3).setValueTb( reportData.getQy() );
//this.getHeadStatisticsList().get(4).setValueTb( reportData.getWssjcll() );
this.getHeadStatisticsList().get(5).setValueTb( reportData.getZhnyxhl() );
this.getHeadStatisticsList().get(6).setValueTb( reportData.getEyhtpfl() );
this.getHeadStatisticsList().get(7).setValueTb( reportData.getDsdh() );
}
public void setHeadStatisticsValueHB(JnhbReportData reportData){
// wssjcll, wsfhl, dh, qy, xinshui, zhnyxhl, eyhtpfl, dsdh
////水处理量,系统负荷率,电耗,汽油,新水,综合能耗,C02,吨水
this.getHeadStatisticsList().get(0).setValueHb( reportData.getWssjcll() );
this.getHeadStatisticsList().get(1).setValueHb( reportData.getWsfhl() );
this.getHeadStatisticsList().get(2).setValueHb( reportData.getDh() );
this.getHeadStatisticsList().get(3).setValueHb( reportData.getQy() );
//this.getHeadStatisticsList().get(4).setValueHb( reportData.getWssjcll() );
this.getHeadStatisticsList().get(5).setValueHb( reportData.getZhnyxhl() );
this.getHeadStatisticsList().get(6).setValueHb( reportData.getEyhtpfl() );
this.getHeadStatisticsList().get(7).setValueHb( reportData.getDsdh() );
}
/***
* 设置消减统计记录
*/
public void setReduceStatistics(int index , ResultNumberVO resultNumberVO){
ResultNumberVO resultNumberVOTemp = reduceStatisticsList.get( index - 1);
resultNumberVOTemp.setValue(DigitalUtils.add(resultNumberVOTemp.getValue() , resultNumberVO.getValue() ) );
resultNumberVOTemp.setValueHb( DigitalUtils.add(resultNumberVOTemp.getValueHb() , resultNumberVO.getValueHb() ) );
resultNumberVOTemp.setValueTb( DigitalUtils.add(resultNumberVOTemp.getValueTb() , resultNumberVO.getValueTb() ) );
}
public JnhbLargeScreenVO(){
//头部数值统计
String names = "污水处理量,系统负荷率,电耗,汽油,新水,综合能耗,C02,吨水";
String[] nameList = names.split(",");
ResultNumberVO numberVO = null;
for(String name : nameList){
numberVO = new ResultNumberVO();
numberVO.setName( name);
this.getHeadStatisticsList().add(numberVO) ;
}
//消减量统计
names= "COD,NH3-N,TP,TN";
nameList = names.split(",");
for(String name : nameList){
numberVO = new ResultNumberVO();
numberVO.setName( name);
this.getReduceStatisticsList().add(numberVO) ;
}
/**所属厂区*/
@ApiModelProperty(value = "所属厂区")
private String departId;
/**厂区名称*/
@ApiModelProperty(value = "厂区名称")
private String departName;
/**污水处理量规模*/
@ApiModelProperty(value = "污水处理量规模(万吨)")
private String wsclgm;
/**实际污水处理量*/
@ApiModelProperty(value = "实际污水处理量(万吨)")
private String wssjcll;
/**系统负荷率*/
@ApiModelProperty(value = "系统负荷率(%)")
private String wsfhl;
/**电耗*/
@ApiModelProperty(value = "电耗(万千瓦时)")
private String dh;
/**光伏发电量(万千瓦时)*/
@ApiModelProperty(value = "光伏发电量(万千瓦时)")
private String gffdl;
/**汽油*/
@ApiModelProperty(value = "汽油(吨)")
private String qy;
/**综合能源消费量*/
@ApiModelProperty(value = "综合能源消费量(吨标准煤)")
private String zhnyxhl;
/**二氧化碳排放量*/
@ApiModelProperty(value = "二氧化碳排放量(吨CO2当量)")
private String eyhtpfl;
/**吨水电耗*/
@ApiModelProperty(value = "吨水电耗(千瓦时/吨)")
private String dsdh;
/**COD消减量*/
@ApiModelProperty(value = "COD消减量(吨)")
private String codxjl;
/**NH3-N消减量*/
@ApiModelProperty(value = "NH3-N消减量(吨)")
private String adxjl;
/**TP消减量*/
@ApiModelProperty(value = "TP消减量(吨)")
private String tpxjl;
/**TN消减量*/
@ApiModelProperty(value = "TN消减量(吨)")
private String tnxjl;
/**一般固废产生量*/
@ApiModelProperty(value = "一般固废产生量(吨)")
private String ybgfcsl;
/**一般固废处置量*/
@ApiModelProperty(value = "一般固废处置量(吨)")
private String ybgfczl;
/**绝干泥量*/
@ApiModelProperty(value = "绝干泥量(吨)")
private String jgwnl;
/**危险废物产生量*/
@ApiModelProperty(value = "危险废物产生量(吨)")
private String wfcsl;
/**危险废物处置量*/
@ApiModelProperty(value = "危险废物处置量(吨)")
private String wfczl;
}
}
......
......@@ -15,6 +15,8 @@ public class JnhbReportData {
/**厂区名称*/
@ApiModelProperty(value = "厂区名称")
private String departName;
/**污水处理量规模*/
@ApiModelProperty(value = "污水处理量规模(万吨)")
private String wsclgm;
......
......@@ -4,7 +4,6 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
......@@ -19,24 +18,24 @@ public class ProductDataVO {
@ApiModelProperty(value = "水务厂站数量")
private String deptartCount;
@ApiModelProperty(value = "收费水量")
private BigDecimal chargeWaterVolume;//收费水量9854.012552万吨
private String chargeWaterVolume;//收费水量9854.012552万吨
@ApiModelProperty(value = "收费水量-日均值")
private BigDecimal avgDayWaterVolume;//平均108.29万吨/天
private String avgDayWaterVolume;//平均108.29万吨/天
@ApiModelProperty(value = "收费水量-同比增长")
private BigDecimal chargeWaterRatio;
private String chargeWaterRatio;
@ApiModelProperty(value = "收费水量-完成率")
private BigDecimal completeRatio;
private String completeRatio;
@ApiModelProperty(value = "序时进度")
private String sequentialProgress;
@ApiModelProperty(value = "实际处理水量")
private BigDecimal ysjslWaterVolume;
private String ysjslWaterVolume;
@ApiModelProperty(value = "实际处理水量-日均值")
private BigDecimal avgYsjslWaterVolume;//平均99.76万吨/天
private String avgYsjslWaterVolume;//平均99.76万吨/天
@ApiModelProperty(value = "实际处理水量--同比增长")
private BigDecimal ysjslWaterRatio;
private String ysjslWaterRatio;
@ApiModelProperty(value = "药量目标")
......@@ -73,7 +72,7 @@ public class ProductDataVO {
public String getWaterDeptartName() {
return getDeptName(waterDeptartList);
return getDeptName(waterDeptartList);
}
public String getPowerDeptartName() {
......@@ -104,5 +103,4 @@ public class ProductDataVO {
}
return deptName;
}
}
......
package com.skua.modules.report.vo.largeScreen;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @auther kangwei
* @create 2024-10-15-14:19
*/
@Data
public class ChartData {
@ApiModelProperty(value = "机构名称或日期")
public String name;
@ApiModelProperty(value = "数值")
public List<String> data;
}
package com.skua.modules.report.vo.largeScreen;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value="统计结果接收对象-负荷率对象", description="统计结果接收对象-负荷率对象")
public class LoadRateVO extends ResultNumberVO{
/**所属厂区*/
@ApiModelProperty(value = "所属厂区")
private String departId;
/**厂区名称*/
@ApiModelProperty(value = "厂区名称")
private String departName;
/**污水处理量规模*/
@ApiModelProperty(value = "污水处理量规模(万吨)")
private String wsclgm;
/**实际污水处理量*/
@ApiModelProperty(value = "实际污水处理量(万吨)")
private String wssjcll;
/**系统负荷率*/
@ApiModelProperty(value = "系统负荷率(%)")
private String wsfhl;
public LoadRateVO(){
}
public LoadRateVO( String departId, String departName, String wsclgm, String wssjcll, String wsfhl) {
this.departId = departId;
this.departName = departName;
this.wsclgm = wsclgm;
this.wssjcll = wssjcll;
this.wsfhl = wsfhl;
}
}
package com.skua.modules.report.vo.largeScreen;
/**
* 电耗统计
*/
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value="统计结果接收对象-各站点能源消耗排名", description="统计结果接收对象-各站点能源消耗排名")
public class PowerConsumeVO extends ResultNumberVO{
/**所属厂区*/
@ApiModelProperty(value = "所属厂区")
private String departId;
/**厂区名称*/
@ApiModelProperty(value = "厂区名称")
private String departName;
/**电耗*/
@ApiModelProperty(value = "电耗(万千瓦时)")
private String dh;
/**光伏发电量(万千瓦时)*/
@ApiModelProperty(value = "光伏发电量(万千瓦时)")
private String gffdl;
/**汽油*/
@ApiModelProperty(value = "汽油(吨)")
private String qy;
/**综合能源消费量*/
@ApiModelProperty(value = "综合能源消费量(吨标准煤)")
private String zhnyxhl;
/**二氧化碳排放量*/
@ApiModelProperty(value = "二氧化碳排放量(吨CO2当量)")
private String eyhtpfl;
/**吨水电耗*/
@ApiModelProperty(value = "吨水电耗(千瓦时/吨)")
private String dsdh;
public PowerConsumeVO( String departId, String departName, String dh, String gffdl, String qy, String zhnyxhl, String eyhtpfl, String dsdh) {
this.departId = departId;
this.departName = departName;
this.dh = dh;
this.gffdl = gffdl;
this.qy = qy;
this.zhnyxhl = zhnyxhl;
this.eyhtpfl = eyhtpfl;
this.dsdh = dsdh;
}
}
package com.skua.modules.report.vo.largeScreen;
import com.skua.modules.report.vo.JnhbReportData;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 统计功能配置表
*/
@Data
@ApiModel(value="统计结果接收对象-图表型", description="统计结果接收对象-图表型")
public class ResultChartsVO {
@ApiModelProperty(value = "x轴")
private List<String> xLine = new ArrayList<>();
@ApiModelProperty(value = "COD数据集合")
private List<String> codDataList = new ArrayList<>();//COD、NH3-N、TP、TN
@ApiModelProperty(value = "NH3-N数据集合")
private List<String> nh3DataList = new ArrayList<>();//COD、NH3-N、TP、TN
@ApiModelProperty(value = "TP数据集合")
private List<String> tpDataList = new ArrayList<>();//COD、NH3-N、TP、TN
@ApiModelProperty(value = "TN数据集合")
private List<String> tnDataList = new ArrayList<>();//COD、NH3-N、TP、TN
//X轴 data: ['A厂','B厂','C厂','D厂','E厂','F厂']
//Y轴 data: [name: 'COD',data: [120, 200, 150, 80, 70, 110, 130], type: 'bar',stack: "check",}]
public void setData(JnhbReportData reportData ){
this.getXLine().add( reportData.getDepartName() ) ;
this.getCodDataList().add( reportData.getCodxjl() ) ;
this.getNh3DataList().add( reportData.getTnxjl() ) ;
this.getTpDataList().add( reportData.getTpxjl() ) ;
this.getTnDataList().add( reportData.getTnxjl() ) ;
}
}
package com.skua.modules.report.vo.largeScreen;
import com.skua.tool.util.DigitalUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 统计功能配置表
*/
@Data
@ApiModel(value="统计对象--同比、环比数据", description="统计对象--同比、环比数据")
public class ResultNumberVO {
@ApiModelProperty(value = "名称")
private String name;
@ApiModelProperty(value = "结果")
private String value;
@ApiModelProperty(value = "同比(去年同期)")
private String valueTb;
@ApiModelProperty(value = "环比(上月)")
private String valueHb;
@ApiModelProperty(value = "同比(去年同期)排名")
private String valueTbRank;
@ApiModelProperty(value = "环比(上月)排名")
private String valueHbRank;
@ApiModelProperty(value = "同比比例")
private String valueTbRatio;
@ApiModelProperty(value = "环比比例")
private String valueHbRatio;
public String getValueTbRatio() {
this.valueTbRatio = DigitalUtils.division( this.value , this.valueTb) ;
return valueTbRatio;
}
public String getValueHbRatio() {
this.valueHbRatio = DigitalUtils.division( this.value , this.valueHb) ;
return valueHbRatio;
}
}
package com.skua.modules.report.vo.largeScreen;
import com.skua.tool.util.DigitalUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 统计功能配置表
*/
@Data
@ApiModel(value="统计结果接收对象-废物处理对象", description="统计结果接收对象-废物处理对象")
public class WasteMaterialVO {
/**所属厂区*/
@ApiModelProperty(value = "所属厂区")
private String departId;
/**厂区名称*/
@ApiModelProperty(value = "厂区名称")
private String departName;
/**一般固废产生量*/
@ApiModelProperty(value = "一般固废产生量(吨)")
private String ybgfcsl;
/**一般固废处置量*/
@ApiModelProperty(value = "一般固废处置量(吨)")
private String ybgfczl;
/**绝干泥量*/
@ApiModelProperty(value = "绝干泥量(吨)")
private String jgwnl;
/**危险废物产生量*/
@ApiModelProperty(value = "危险废物产生量(吨)")
private String wfcsl;
/**危险废物处置量*/
@ApiModelProperty(value = "危险废物处置量(吨)")
private String wfczl;
@ApiModelProperty(value = "一般固废产生处理率")
private String ybgfcslRate;
@ApiModelProperty(value = "危险废物-处理率")
private String wfcslRate;
public WasteMaterialVO(String departId, String departName, String ybgfcsl, String ybgfczl, String jgwnl, String wfcsl, String wfczl) {
this.departId = departId;
this.departName = departName;
this.ybgfcsl = ybgfcsl;
this.ybgfczl = ybgfczl;
this.jgwnl = jgwnl;
this.wfcsl = wfcsl;
this.wfczl = wfczl;
ybgfcslRate = DigitalUtils.division( ybgfczl,ybgfcsl );
wfcslRate = DigitalUtils.division( wfczl,wfcsl );
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!