08bdd8bd 康伟

kangwei :修改reportUtils工具类

1 个父辈 62269c2c
......@@ -72,9 +72,9 @@ public class ReportViewUtil {
if(!StringUtils.isEmpty(itemIds)) {
itemIds = itemIds.substring(1);
}
sb.append("`a`.`depart_id` AS `depart_id`,`a`.`data_id` AS `id`,`a`.`data_time` AS `time` from (( ");
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 1=1 ");
sb.append(" SELECT data_id,reit_id,item_value,data_time,depart_id FROM f_report_itemv v WHERE 1=1 ");
if(StringUtils.isNotEmpty(departIds)){
sb.append(" and depart_id in ("+inSqlPart+") ");
}
......@@ -141,16 +141,16 @@ public class ReportViewUtil {
itemIds = itemIds.substring(1);
}
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 WHERE 1=1 ");
sb.append(" SELECT data_id,reit_id,item_value,data_time,depart_id FROM f_report_itemv WHERE 1=1 ");
if(StringUtils.isNotEmpty(departIds)){
sb.append("and depart_id in ("+inSqlPart+")");
sb.append(" and depart_id in ("+inSqlPart+")");
}
if(!StringUtils.isEmpty(dataTime)) {
sb.append("and data_time like'"+dataTime+"%'");
}
sb.append("and reit_id in ("+itemIds+")");
sb.append(" and reit_id in ("+itemIds+")");
sb.append(") `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(" ) `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();
}
......@@ -204,17 +204,17 @@ public class ReportViewUtil {
sb.append("SELECT data_id,reit_id,item_value,data_time,depart_id FROM f_report_itemv WHERE 1=1 ");
if(!StringUtils.isEmpty(departIds)) {
sb.append(" and depart_id in ("+inSqlPart+")");
sb.append(" and depart_id in ("+inSqlPart+") ");
}
if(!StringUtils.isEmpty(startTime)) {
sb.append("and data_time >='"+startTime+"'");
sb.append(" and data_time >='"+startTime+"' ");
}
if(!StringUtils.isEmpty(endTime)) {
sb.append("and data_time <='"+endTime+"'");
sb.append(" and data_time <='"+endTime+"' ");
}
sb.append("and reit_id in ("+itemIds+")");
sb.append(" and reit_id in ("+itemIds+") ");
sb.append(") `a` left join `f_report_item` `d` on((`a`.`reit_id` = `d`.`id`))) where 1=1 group by `a`.`depart_id`)");
sb.append(") `a` left join `f_report_item` `d` on((`a`.`reit_id` = `d`.`id`))) where 1=1 group by `a`.`depart_id`) ");
return sb.toString();
}
......
......@@ -64,15 +64,16 @@ public class DateVO {
this.nowYear = Integer.parseInt(DateUtils.dateformat(currentDate,"yyyy"));
//同比时间
this.lastYear = nowYear -1 ;//去年
this.lastYearMonth = DateUtils.getHbMonth(currentDate);
System.out.println(" lastYearMonth "+lastYearMonth);
this.lastYearMonth = DateUtils.getTbMonth(this.nowMonth);
//System.out.println(" lastYearMonth "+lastYearMonth);
this.lastYearMonthStartTime = lastYearMonth+"-01";
this.lastYearMonthStartTime = lastYearMonth+"-31";
this.lastYearMonthEndTime = lastYearMonth+"-31";
this.lastYearStartDate = this.lastYear+"-01-01";
this.lastYearEndDate = this.lastYear+"-12-31";
//环比时间
this.lastMonth = DateUtils.getHbMonth(currentDate);//
this.lastMonth = DateUtils.getHbMonth(this.nowMonth);//
System.out.println(" lastMonth "+lastMonth);
this.lastMonthStartTime = lastMonth+"-01";
this.lastMonthEndTime = lastMonth+"-31";
......
......@@ -51,6 +51,7 @@ public class DigitalUtils {
if(StringUtils.isNotEmpty(val2)){
BigDecimal num2 = new BigDecimal(val2);
result = result.add( num2 );
result = result.multiply( num2).setScale(2, BigDecimal.ROUND_HALF_UP);
}
return result.toString();
}
......
......@@ -19,23 +19,51 @@ import java.util.regex.Pattern;
*/
public class JSUtils {
// 表达式字符合法性校验正则模式,静态常量化可以降低每次使用都要编译地消耗
private static final Pattern EXPRESSION_PATTERN = Pattern.compile("[0-9\\.+-/*()= ]+");
// 运算符优先级map
private static final Map<String, Integer> OPT_PRIORITY_MAP = new HashMap<String, Integer>() {
private static final long serialVersionUID = 6968472606692771458L;
{
put("(", 0);
put("+", 2);
put("-", 2);
put("*", 3);
put("/", 3);
put(")", 7);
put("=", 20);
public static String add(Object obj1 , Object obj2){
String expression = obj1+ "+" + obj2;
return executeExpression(expression,"0.00");
}
public static String subtract(Object obj1 , Object obj2){
String expression = obj1+ "-" + obj2;
return executeExpression(expression,"0.00");
}
public static String multiply(Object obj1 , Object obj2){
String expression = obj1+ "*" + obj2;
return executeExpression(expression,"0.00");
}
public static String divide(Object obj1 , Object obj2){
String expression = obj1+ "/" + obj2;
return executeExpression(expression,"0.00");
}
};
/***
* 格式化结果,保留两位小数
* @param obj1
* @return
*/
public static String format(Object obj1 ){
return format(obj1,null);
}
/***
* 格式化结果,指定格式,默认保留两位小数
* @param obj1
* @param decimalFormat
* @return
*/
public static String format(Object obj1 , String decimalFormat){
String result = null;
try{
if(obj1 != null ){
if(decimalFormat == null ) decimalFormat = "0.00";
DecimalFormat df = new DecimalFormat(decimalFormat);
result = df.format(Double.parseDouble(obj1.toString()));
}
}catch(Exception e){
e.printStackTrace();
}
return result;
}
/**
* 输入加减乘除表达式字符串,返回计算结果
*
......@@ -54,6 +82,25 @@ public class JSUtils {
}
return result;
}
// 表达式字符合法性校验正则模式,静态常量化可以降低每次使用都要编译地消耗
private static final Pattern EXPRESSION_PATTERN = Pattern.compile("[0-9\\.+-/*()= ]+");
// 运算符优先级map
private static final Map<String, Integer> OPT_PRIORITY_MAP = new HashMap<String, Integer>() {
private static final long serialVersionUID = 6968472606692771458L;
{
put("(", 0);
put("+", 2);
put("-", 2);
put("*", 3);
put("/", 3);
put(")", 7);
put("=", 20);
}
};
public static double executeExpression(String expression) {
// 非空校验
if (null == expression || "".equals(expression.trim())) {
......
package com.skua.modules.algorithm.controller;
import com.skua.common.report.ReportViewUtil;
import com.skua.core.api.vo.Result;
import com.skua.core.aspect.annotation.AutoLog;
import com.skua.core.context.BaseContextHandler;
import com.skua.core.context.SpringContextUtils;
import com.skua.modules.algorithm.service.ICommandCentreService;
import com.skua.modules.algorithm.service.impl.ReportItemvService;
import com.skua.modules.algorithm.vo.*;
import com.skua.modules.common.vo.DateVO;
import com.skua.modules.guest.util.DateUtil;
import com.skua.modules.report.entity.FReportItemv;
import com.skua.modules.report.vo.*;
import com.skua.modules.system.service.ISysConfigService;
import com.skua.modules.system.service.ISysFactoryInfoService;
import com.skua.tool.util.DateUtils;
import com.skua.tool.util.DigitalUtils;
import com.skua.tool.util.JSUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -33,12 +40,12 @@ import java.util.*;
public class SysCommandCentreController {
@Autowired
private ISysFactoryInfoService factoryInfoService;
@Autowired
private ICommandCentreService commandCentreService;
@Autowired
private ISysConfigService sysConfigService;
@Autowired
private ReportItemvService reportItemvService;
/**
* 分页列表查询
......@@ -232,96 +239,33 @@ public class SysCommandCentreController {
@GetMapping(value = "/statisticsByElectricity")
public Result<List<FRportlCommandCenterVO>> statisticsByElectricity( ReportItemvParam reportItemvParam) throws Exception {
Result<List<FRportlCommandCenterVO>> result = new Result<>();
//将jsonObject转sysAlgorithmStatisticsLibraryVO对象
//SysAlgorithmStatisticsLibraryVO sysAlgorithmLibraryVO = JSONObject.toJavaObject(jsonObject, SysAlgorithmStatisticsLibraryVO.class);
// String reportId = "3a243d5715b9e1a3753c180872ca0df9";//报表编号
// String reportItemCode = "DLHJ";//查询字段
//报表数据项值
String reitId = sysConfigService.queryValueByKey("REIT_ID_DLHJ");
//reportItemvParam.setReportItemCode(reportItemCode);
// reportItemvParam.setReportId(reportId);
reportItemvParam.initData(reitId ,reportItemvParam.getStartDate() ,reportItemvParam.getEndDate());
//ReportItemvParam reportItemvParam = new ReportItemvParam(reportId,reportItemCode ,sysAlgorithmLibraryVO.getStartDate() ,sysAlgorithmLibraryVO.getEndDate());
List<FRportlCommandCenterVO> fReportItemvList = new ArrayList<>();//返回集合对象
//月统计
FRportlCommandCenterVO reportMonthData = commandCentreService.getReportItemvMonthDataByReitId(reportItemvParam );
fReportItemvList.add( reportMonthData );
FRportlCommandCenterVO reportDayData = commandCentreService.getReportItemvDayDataByReitId(reportItemvParam );
fReportItemvList.add( reportDayData );
//单位换算
if(fReportItemvList != null && !fReportItemvList.isEmpty()){
String value = null ;
String valueHb = null;
String valueTb = null;
for( FRportlCommandCenterVO reportDayData3 : fReportItemvList){
value = DigitalUtils.division(reportDayData3.getValue(),"1");
reportDayData3.setValue( value );
valueHb = DigitalUtils.division(reportDayData3.getValueHb(),"1");
reportDayData3.setValueHb(valueHb );
valueTb = DigitalUtils.division(reportDayData3.getValueTb(),"1");
reportDayData3.setValueTb( valueTb );
}
}
/* FReportItemv currenteportItemv = commandCentreService.getReportItemvByReitIdAndDate(reportId, reportItemCode,startDate , endDate );
//上月数据
FReportItemv lastMonthReportItemv = commandCentreService.getReportItemvByReitIdAndDate(reportId, reportItemCode,reportItemvParam.getLastMonthStartDate() , reportItemvParam.getLastMonthEndDate() );
//去年数据
FReportItemv lastYearReportItemv = commandCentreService.getReportItemvByReitIdAndDate(reportId, reportItemCode, reportItemvParam.getLastYearStartDate() , reportItemvParam.getLastYearEndDate() );
//整理数据
// SysCommandCentreResultVO commandCentreResultVO = convertSysAlgorithmStatisticsResultNumberVO(currenteportItemv , lastMonthReportItemv,lastYearReportItemv);
List<FRportlCommandCenterVO> fReportItemvList = arrangeFRportlCommandCenterVO(currenteportItemv , lastMonthReportItemv,lastYearReportItemv);*/
//
// FReportItemv waterCurrenteportItemv = ifReportItemvService.getReportItemvByReitIdAndDate(reportId, reportItemCode,startDate , endDate );
//commandCentreResultVO.setTotalData( factoryInfoService.querySumProScale() );
//出水量 月统计、上月统计、去年同期统计
String waterReportId = "2119ecbf53a1d2d0708258ff67cfd9e1";//报表编号
String waterReportItemCode = "CSL";//查询字段
reportItemvParam.setReitId(waterReportId); reportItemvParam.setReportItemCode(waterReportItemCode);
// 出水量 月统计
FRportlCommandCenterVO waterReportMonthData = commandCentreService.getReportItemvMonthDataByReitId(reportItemvParam );
FRportlCommandCenterVO statisticsData = new FRportlCommandCenterVO("0.0","0.0","0.0");
//需要查询统计数据 = 公式== 电量 / 出水量
if(reportMonthData != null && waterReportMonthData != null){
waterReportMonthData.setValue( DigitalUtils.division( reportMonthData.getValue() , waterReportMonthData.getValue() )); // 当月统计 污泥量 / 出水量
waterReportMonthData.setValueTb( DigitalUtils.division( reportMonthData.getValueTb() , waterReportMonthData.getValueTb() )); // 上月同期 统计
waterReportMonthData.setValueHb(DigitalUtils.division( reportMonthData.getValueHb() , waterReportMonthData.getValueHb() ) ); //去年同期 统计
}
fReportItemvList.add(statisticsData);
/* String startDate = sysAlgorithmLibraryVO.getStartDate();
String endDate = sysAlgorithmLibraryVO.getEndDate();
FReportItemv currenteportItemv = commandCentreService.getReportItemvByReitIdAndDate(reportId, reportItemCode,startDate , endDate );
//上月数据
FReportItemv lastMonthReportItemv = commandCentreService.getReportItemvByReitIdAndDate(reportId, reportItemCode,reportItemvParam.getLastMonthStartDate() , reportItemvParam.getLastMonthEndDate() );
//去年数据
FReportItemv lastYearReportItemv = commandCentreService.getReportItemvByReitIdAndDate(reportId, reportItemCode, reportItemvParam.getLastYearStartDate() , reportItemvParam.getLastYearEndDate() );
//整理数据
//SysCommandCentreResultVO commandCentreResultVO = convertSysAlgorithmStatisticsResultNumberVO(currenteportItemv , lastMonthReportItemv,lastYearReportItemv);
List<FRportlCommandCenterVO> fReportItemvList = arrangeFRportlCommandCenterVO(currenteportItemv , lastMonthReportItemv,lastYearReportItemv);
// FReportItemv waterCurrenteportItemv = ifReportItemvService.getReportItemvByReitIdAndDate(reportId, reportItemCode,startDate , endDate );
//commandCentreResultVO.setTotalData( factoryInfoService.querySumProScale() );
FRportlCommandCenterVO statisticsData = new FRportlCommandCenterVO();
//需要查询统计数据
fReportItemvList.add(statisticsData);*/
List<FRportlCommandCenterVO> fRportlCommandCenterVOList = new ArrayList<>();
DateVO dateVO = new DateVO(reportItemvParam.getStartDate());
//电耗
String nowMonthValue = reportItemvService.getSumDLHJ(null,dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate());
String lastMonthValue = reportItemvService.getSumDLHJ(null, dateVO.getLastMonthStartTime(),dateVO.getLastMonthEndTime());
String lastYearValue = reportItemvService.getSumDLHJ(null, dateVO.getLastYearMonthStartTime(),dateVO.getLastYearMonthEndTime());
//出水量
String nowMonthCSL = reportItemvService.getSumCSL(null,dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate());
String lastMonthCSL = reportItemvService.getSumCSL(null, dateVO.getLastMonthStartTime(),dateVO.getLastMonthEndTime());
String lastYearCSL = reportItemvService.getSumCSL(null, dateVO.getLastYearMonthStartTime(),dateVO.getLastYearMonthEndTime());
long nowDifferDay = DateUtils.differenceDay(dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate());
long lastMonthDifferDay = DateUtils.differenceDay(dateVO.getLastMonthStartTime(),dateVO.getLastMonthEndTime());
long lastYearDifferDay = DateUtils.differenceDay(dateVO.getLastYearMonthStartTime(),dateVO.getLastYearMonthEndTime());
//当月数据/环比、同比
FRportlCommandCenterVO nowMonthVO = new FRportlCommandCenterVO("月总电耗(", JSUtils.format(nowMonthValue), JSUtils.format(lastMonthValue), JSUtils.format(lastYearValue));
//日均数据:/环比/同比
FRportlCommandCenterVO lastMonthVO = new FRportlCommandCenterVO("日均电耗",JSUtils.divide( nowMonthValue ,nowDifferDay ) ,JSUtils.divide( lastMonthValue ,lastMonthDifferDay ),JSUtils.divide( lastYearValue ,lastYearDifferDay ) );
//吨水消耗
FRportlCommandCenterVO lastYearVo = new FRportlCommandCenterVO("吨水电耗",JSUtils.divide( nowMonthValue ,nowMonthCSL ) ,JSUtils.divide( lastMonthValue ,lastMonthCSL ),JSUtils.divide( lastYearValue ,lastYearCSL ));
fRportlCommandCenterVOList.add( nowMonthVO) ;
fRportlCommandCenterVOList.add( lastMonthVO) ;
fRportlCommandCenterVOList.add( lastYearVo) ;
//todo 演示暂时注释
result.setSuccess(true);
result.setResult(fReportItemvList);
result.setResult(fRportlCommandCenterVOList);
return result;
}
......@@ -522,29 +466,7 @@ public class SysCommandCentreController {
return result;
}
/**
* 获取时间之间的月份
* @param start
* @param end
* @return
*/
public static List<String> getMonthsBetween(String start, String end) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
// 解析日期
LocalDate startDate = LocalDate.parse(start, formatter);
LocalDate endDate = LocalDate.parse(end, formatter);
List<String> months = new ArrayList<>();
// 获取起始和结束月份
YearMonth startMonth = YearMonth.from(startDate);
YearMonth endMonth = YearMonth.from(endDate);
// 遍历月份并添加到列表
YearMonth currentMonth = startMonth;
while (!currentMonth.isAfter(endMonth)) {
months.add(currentMonth.toString()); // 格式化为 yyyy-MM
currentMonth = currentMonth.plusMonths(1);
}
return months;
}
@AutoLog(value = "指挥中心-药剂趋势")
@ApiOperation(value="指挥中心-药剂趋势", notes="指挥中心-药剂趋势")
......@@ -569,4 +491,28 @@ public class SysCommandCentreController {
return result;
}
/**
* 获取时间之间的月份
* @param start
* @param end
* @return
*/
private List<String> getMonthsBetween(String start, String end) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
// 解析日期
LocalDate startDate = LocalDate.parse(start, formatter);
LocalDate endDate = LocalDate.parse(end, formatter);
List<String> months = new ArrayList<>();
// 获取起始和结束月份
YearMonth startMonth = YearMonth.from(startDate);
YearMonth endMonth = YearMonth.from(endDate);
// 遍历月份并添加到列表
YearMonth currentMonth = startMonth;
while (!currentMonth.isAfter(endMonth)) {
months.add(currentMonth.toString()); // 格式化为 yyyy-MM
currentMonth = currentMonth.plusMonths(1);
}
return months;
}
}
......
package com.skua.modules.algorithm.service.impl;
import com.skua.common.report.ReportViewUtil;
import com.skua.core.context.SpringContextUtils;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
/**
* @auther kangwei
* @create 2024-11-01-10:09
*/
@Service("reportItemvService")
public class ReportItemvService {
String view2119 = "2119ecbf53a1d2d0708258ff67cfd9e1";// 水 COD TP TN NH3H
String view3a24 = "3a243d5715b9e1a3753c180872ca0df9";//能耗报表
String view4411 = "4411ed3d78634bcdcd700f6e33724025";//生产运营周报
private JdbcTemplate getJdbcTemplate(){
//主库数据源
JdbcTemplate masterDB = (JdbcTemplate) SpringContextUtils.getBean("master");
return masterDB;
}
public String getSumCSL(String departId ,String startTime ,String endTime){
String dataViewName2119 = ReportViewUtil.buildViewLike(view2119,"CSL", departId, startTime,endTime);
String sql = "select sum(aaa.CSL) from " + dataViewName2119+ "aaa";
String csl = getJdbcTemplate().queryForObject(sql,String.class);
return csl;
}
/* public List<Map<String,Object>> getDeptCSL(String departId , String startTime , String endTime){
}*/
public String getSumDLHJ(String departId ,String startTime ,String endTime){
String dataViewName3a24 = ReportViewUtil.buildViewLike(view3a24,"DLHJ", departId, startTime,endTime);
String sql = "select sum(aaa.DLHJ) from " + dataViewName3a24+ "aaa";
String dlhj = getJdbcTemplate().queryForObject(sql,String.class);
return dlhj;
}
/* public List<Map<String,Object>> getDeptDLHJ(String departId , String startTime , String endTime){
}*/
}
......@@ -23,13 +23,12 @@ import javax.servlet.http.HttpServletRequest;
* @create 2024-10-14-16:46
*/
@Slf4j
@Api(tags="在线考试-试卷")
@Api(tags="测试报表")
@RestController("testReportController")
@RequestMapping("/web/edu/paper")
public class TestReportSqlController {
@AutoLog(value = "在线考试--构造填报报表视图")
@ApiOperation(value="在线考试-构造填报报表视图", notes="在线考试-构造填报报表视图")
@AutoLog(value = "测试报表")
@ApiOperation(value="测试报表", notes="测试报表")
@GetMapping(value = "/testReportSql")
public Result<String> testReportSql(
@RequestParam(name="reportId") String reportId,
......
......@@ -89,8 +89,6 @@ public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService {
}
// resultMap.put(ConvertUtils.getString(dataMap.get("id")), ConvertUtils.getString(dataMap.get("create_by"))+""+ConvertUtils.getString(dataMap.get("title")));
}
factoryInfoVOList = new ArrayList(factoryInfoMap.values());
// 添加:中冶数据
......@@ -239,9 +237,12 @@ public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService {
StringBuffer sql = new StringBuffer("select round(aaa.CSL,2) 'csl',round(( aaa.JSCOD - aaa.CSCOD ),2) 'codxjl', round(( aaa.JSAD -aaa.CSAD ),2) 'adxjl' from ");
sql.append(" "+dataViewName2119 +" aaa ");
System.out.println(sql.toString());
waterQualityVO = getJdbcTemplate().queryForObject(sql.toString(),new BeanPropertyRowMapper<WaterQualityVO>(WaterQualityVO.class));
List<WaterQualityVO> waterQualityVOList = getJdbcTemplate().query(sql.toString(),new BeanPropertyRowMapper<WaterQualityVO>(WaterQualityVO.class));
if(waterQualityVOList != null && !waterQualityVOList.isEmpty()){
waterQualityVO = waterQualityVOList.get(0);
}else{
waterQualityVO = new WaterQualityVO();
}
// if(waterQualityVO == null )waterQualityVO = new WaterQualityVO();
//负荷率 CSL/设计规模 ()
String factoryProScaleSql = "select round( ("+waterQualityVO.getCsl() +"/(pro_scale * 100) ),2) fhl from sys_factory_info where depart_id = '"+departId+"'";
......@@ -257,10 +258,15 @@ public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService {
sql2.append( " "+dataViewName3a24+" aaa ");
System.out.println("sql2 = "+sql2.toString());
WaterQualityVO waterQualityVOTemp = getJdbcTemplate().queryForObject( sql2.toString(), new BeanPropertyRowMapper<WaterQualityVO>(WaterQualityVO.class));
waterQualityVOList = getJdbcTemplate().query( sql2.toString(), new BeanPropertyRowMapper<WaterQualityVO>(WaterQualityVO.class));
if(waterQualityVOList != null && !waterQualityVOList.isEmpty() ){
WaterQualityVO waterQualityVOTemp = waterQualityVOList.get(0);
waterQualityVO.setTnl(waterQualityVOTemp.getTnl() );
waterQualityVO.setDsdh(waterQualityVOTemp.getDsdh());
waterQualityVO.setDsyh(waterQualityVOTemp.getDsyh());
}
return waterQualityVO;
}
......
......@@ -33,7 +33,7 @@ public class OperationReportServiceImpl implements IOperationReportService {
String view2119 = "2119ecbf53a1d2d0708258ff67cfd9e1";// 水 COD TP TN NH3H
String view3a24 = "3a243d5715b9e1a3753c180872ca0df9";//能耗报表
String view4411 = "4411ed3d78634bcdcd700f6e33724025";
String view4411 = "4411ed3d78634bcdcd700f6e33724025";//生产运营周报
private JdbcTemplate getJdbcTemplate(){
JdbcTemplate masterDB = (JdbcTemplate) SpringContextUtils.getBean("master");
......
......@@ -34,4 +34,10 @@ public class FRportlCommandCenterVO implements Serializable {
this.valueTb = valueTb;
this.valueHb = valueHb;
}
public FRportlCommandCenterVO(String title ,String value, String valueTb, String valueHb) {
this.title = title;
this.value = value;
this.valueTb = valueTb;
this.valueHb = valueHb;
}
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!