95a8b818 康伟

kangwei: 解决bug:运营季报公式

1 个父辈 3cd805b1
正在显示 18 个修改的文件 包含 220 行增加280 行删除
......@@ -38,6 +38,8 @@
WHERE
d.depart_type = 1
AND r.report_date LIKE CONCAT(#{year},'%')
order by r.report_date desc
</select>
<select id="getMapData" resultType="com.skua.modules.emergency.vo.MapDatabaseResult">
......
......@@ -152,7 +152,7 @@ public class EmergencyRiskEventServiceImpl extends ServiceImpl<EmergencyRiskEven
@Override
public List<RiskDatabaseResult> getRiskList(String year) {
if(year==null){
if(StringUtils.isEmpty(year)){
year = String.valueOf(DateUtils.getYear());
}
List<RiskDatabaseResult> list = emergencyRiskEventMapper.getRiskList(year);
......@@ -161,7 +161,7 @@ public class EmergencyRiskEventServiceImpl extends ServiceImpl<EmergencyRiskEven
@Override
public List<DangerDatabaseResult> getDangerList(String year) {
if(year==null){
if(StringUtils.isEmpty(year)){
year = String.valueOf(DateUtils.getYear());
}
List<DangerDatabaseResult> list = emergencyRiskEventMapper.getDangerList(year);
......@@ -170,7 +170,7 @@ public class EmergencyRiskEventServiceImpl extends ServiceImpl<EmergencyRiskEven
@Override
public List<MapDatabaseResult> getMapData(String year) {
if(year==null){
if(StringUtils.isEmpty(year)){
year = String.valueOf(DateUtils.getYear());
}
List<DangerDatabaseResult> dangerList = emergencyRiskEventMapper.getDangerList(year);
......
......@@ -2,6 +2,7 @@ package com.skua.modules.dataAnalysis.controller;
import com.skua.core.api.vo.Result;
import com.skua.core.aspect.annotation.AutoLog;
import com.skua.core.context.BaseContextHandler;
import com.skua.core.util.DateUtils;
import com.skua.modules.dataAnalysis.service.IPowerAnalysisNewService;
import com.skua.modules.dataAnalysis.vo.OperationMonthVO;
......@@ -148,7 +149,8 @@ public class PowerAnalysisNewController {
@GetMapping(value = "/powerCutDownAllList")
public Result powerCutDownAllList(String time) {
Result result = new Result();
Map<String, Object> resultMap = operationMonthService.powerCutDownAllList(time);
String departIds = BaseContextHandler.getDeparts();
Map<String, Object> resultMap = operationMonthService.powerCutDownAllList(departIds,time);
result.setSuccess(true);
result.setResult(resultMap);
return result;
......
......@@ -376,7 +376,7 @@
<select id="querySixMonthPowerConsumption" resultType="map">
SELECT
ROUND(SUM(IFNULL(v2.CSL,0))/10000,2) AS totalBYCLSL,
ROUND(IFNULL(v3.DLHJ,0),2) AS totalBYYDL,
ROUND(IFNULL(v3.DLHJ,0)/10000,2) AS totalBYYDL,
ROUND(IFNULL(v3.DLHJ,0)/SUM(v2.CSL),2) AS dsdh,
LEFT(v2.time,7) AS time
from ${dataViewName2119} v2
......@@ -795,8 +795,8 @@
</select>
<select id="queryHDLAndSLByFac" resultType="java.util.Map">
SELECT
ROUND(SUM(v2.CSL),2) AS totalBYCLSL,
IFNULL(v3.DLHJ,0) AS totalBYYDL,
ROUND(SUM(IFNULL(v2.CSL,0))/10000,2) AS totalBYCLSL,
ROUND(IFNULL(v3.DLHJ,0)/10000,2) AS totalBYYDL,
ROUND(IFNULL(v3.DLHJ,0)/SUM(v2.CSL),2) AS dsdh,
LEFT(v2.time,7) AS time
from ${dataViewName2119} v2
......
......@@ -6,9 +6,9 @@ import java.util.List;
import java.util.Map;
public interface IFactoryOperateCenterService {
//厂区统计数据
Map<String, Object> getData(String departId,String month);
//厂区报表统计数据
Map<String, Object> getReportData(String departId, String month);
List<EquipAlarmVO> getEquipAlarm(String departId, String month);
......
......@@ -24,7 +24,6 @@ public interface IPowerAnalysisNewService {
Map<String, Object> powerDSDHCurve(String id, String type, String time);
/**
*
* @Description 电耗分析单位污染物削减电耗
* @Date 2021-06-03 16:37
* @Param [time]
......@@ -35,7 +34,6 @@ public interface IPowerAnalysisNewService {
Map<String, Object> powerConsumptionDistributionList(String type, String time);
/**
*
* @Description 根据厂站获取单位污染物削减电耗历史趋势
* @Date 2021-06-04 15:05
* @Param [startTime, endTime, factoryId]
......@@ -44,13 +42,12 @@ public interface IPowerAnalysisNewService {
Map<String, Object> powerCutDownByFac(String startTime, String endTime, String departId);
/**
*
* @Description 电耗分析获取所有单位污染物削减电耗列表
* @Date 2021-06-04 18:33
* @Param [time]
* @return java.util.Map<java.lang.String, java.lang.Object>
**/
Map<String, Object> powerCutDownAllList(String time);
Map<String, Object> powerCutDownAllList(String departIds,String time);
/**
*
......
......@@ -33,7 +33,7 @@ public class FactoryOperateCenterServiceImpl implements IFactoryOperateCenterSer
private FactoryOperateCenterMapper factoryOperateCenterMapper;
@Resource
private ReportTargetConfigMapper reportTargetMapper;
//厂区统计数据
@Override
public Map<String, Object> getData(String departId, String month) {
DecimalFormat df = new DecimalFormat("#.##");
......@@ -156,6 +156,7 @@ public class FactoryOperateCenterServiceImpl implements IFactoryOperateCenterSer
map.put("nclsl",new HashMap<>());
Map<String, Object> nclslMap = new HashMap<>();
nclslMap.put("nsjsl", yearClsl);
nclslMap.put("nsjsl", yearClslMb);
nclslMap.put("wcbfb", df.format(100*yearClsl/yearClslMb));
nclslMap.put("nmb", yearClslMb);
nclslMap.put("nmbTb", df.format((yearClslMb-yearTbClslMb)/yearClslMb));
......@@ -170,7 +171,7 @@ public class FactoryOperateCenterServiceImpl implements IFactoryOperateCenterSer
map.put("yclsl",new HashMap<>());
Map<String, Object> yclslMap = new HashMap<>();
yclslMap.put("ysjsl", monthClsl);
yclslMap.put("wcbfb", df.format(100*monthClsl/(yearClslMb/12)));
yclslMap.put("wcbfb", df.format(100*monthClsl/(yearClslMb/12)));//较上月
yclslMap.put("ymb", df.format(yearClslMb/12));
yclslMap.put("ymbTb", "0");
yclslMap.put("ywcd", df.format(100*monthClsl/(yearClslMb/12)));
......@@ -320,7 +321,7 @@ public class FactoryOperateCenterServiceImpl implements IFactoryOperateCenterSer
return monthDataVOList;
}
//厂区报表统计数据
@Override
public Map<String, Object> getReportData(String departId, String month) {
int dayCount = DateUtils.getDayCountByMonth(month);
......
......@@ -5,19 +5,20 @@ import com.google.common.collect.Maps;
import com.skua.common.constant.ReportConstant;
import com.skua.common.report.ReportViewUtil;
import com.skua.core.context.BaseContextHandler;
import com.skua.core.context.SpringContextUtils;
import com.skua.core.util.DateUtils;
import com.skua.core.util.DoubleOperaUtils;
import com.skua.modules.custom.service.IFCustomReportDatasetService;
import com.skua.modules.dataAnalysis.mapper.PowerAnalysisNewMapper;
import com.skua.modules.dataAnalysis.mapper.WaterCountAnalysisNewMapper;
import com.skua.modules.dataAnalysis.service.IPowerAnalysisNewService;
import com.skua.modules.dataAnalysis.vo.OperationMonthVO;
import com.skua.modules.dataAnalysis.vo.PowerCutDownVO;
import com.skua.tool.util.JSUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
......@@ -512,131 +513,54 @@ public class PowerAnalysisNewServiceImpl implements IPowerAnalysisNewService {
}
@Override
public Map<String, Object> powerCutDownAllList(String time) {
String departIds = BaseContextHandler.getDeparts();
// String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,"DLHJ", departIds, time);
String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL,JSCOD,CSCOD,JSZL,CSZL,JSZD,CSTN,JSAD,CSAD", departIds, time);
DecimalFormat df = new DecimalFormat("#.##");
public Map<String, Object> powerCutDownAllList(String departIds ,String time) {
String startTime = time+"-01";
String endTime = time+"-31";
//耗电量/((进水COD-出水COD)*处理水量)
//CSL,JSCOD,CSCOD,JSZL,CSZL,JSZD,CSTN,JSAD,CSAD
String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,ReportConstant.fieldClsl +","+ReportConstant.fieldSz, departIds, startTime,endTime);
//System.out.println("dataViewName2119 ="+dataViewName2119);
String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,ReportConstant.fieldDl, departIds, startTime,endTime);
//System.out.println("dataViewName3a24 ="+dataViewName3a24);
String sql = "select bbb.depart_id ,IFNULL(ccc.DLHJ,0) as hdl, IFNULL(round (IFNULL(ccc.DLHJ,0) / bbb.codValue ,2),0) 'codValue',IFNULL(round (IFNULL(ccc.DLHJ,0) / bbb.nh3nValue,2),0) 'nh3nValue',";
sql += " IFNULL(round (IFNULL(ccc.DLHJ,0) / bbb.tpValue,2),0) 'tpValue',IFNULL(round (IFNULL(ccc.DLHJ,0) / bbb.tnValue,2),0) 'tnValue' from ( ";
sql += " select aaa.depart_id,SUM(aaa.CSL) clsl,sum(IFNULL(aaa.JSCOD,0)) 'JSCOD',sum(aaa.CSCOD) 'CSCOD',round( (sum(IFNULL(aaa.JSCOD,0)) - sum(IFNULL(aaa.CSCOD,0)) ) * sum(IFNULL(aaa.CSL,0)) *1000/1000000 ,2) 'codValue',";
sql += " round( (sum(IFNULL(aaa.JSAD,0)) - sum(IFNULL(aaa.CSAD,0)) ) * sum(IFNULL(aaa.CSL,0)) *1000/1000000 ,2) 'nh3nValue', round( (sum(IFNULL(aaa.JSZL,0)) - sum(IFNULL(aaa.CSZL,0)) ) * sum(IFNULL(aaa.CSL,0)) *1000/1000000 ,2) 'tpValue', ";
sql += " round( (sum(IFNULL(aaa.JSZD,0)) - sum(IFNULL(aaa.CSTN,0)) ) * sum(IFNULL(aaa.CSL,0)) *1000/1000000 ,2) 'tnValue' from "+dataViewName2119+" aaa group by aaa.depart_id";
sql += " )bbb left join "+dataViewName3a24 +" ccc on bbb.depart_id = ccc.depart_id ";
List<PowerCutDownVO> dateList = getJdbcTemplate().query(sql,new BeanPropertyRowMapper<PowerCutDownVO>(PowerCutDownVO.class));
Map<String, Object> result = Maps.newHashMap();
List<Map<String, Object>> facLists = waterCountAnalysisNewMapper.queryFacLists("", departIds);
Map<String, List<Map<String, Double>>> tmp = Maps.newHashMap();
// List<Map<String, Object>> data3 = fCustomReportDatasetService.queryReportValue(dataViewName3a24,null,null, departIds);
List<Map<String, Object>> data2 = fCustomReportDatasetService.queryReportValue(dataViewName2119,null,null, departIds);
if (data2 != null && data2.size() > 0) {
for (Map<String, Object> datum : data2) {
String departId = datum.get("depart_id").toString();
double cscod =0.00d;
if (!ObjectUtils.isEmpty(datum.get("CSCOD"))&&!StringUtils.isEmpty(datum.get("CSCOD").toString())) {
cscod = this.getValue(datum.get("CSCOD").toString());
}
double jscod =0.00d;
if (!ObjectUtils.isEmpty(datum.get("JSCOD"))&&!StringUtils.isEmpty(datum.get("JSCOD").toString())) {
jscod = this.getValue(datum.get("JSCOD").toString());
}
double csad = 0.00d;
if (!ObjectUtils.isEmpty(datum.get("CSAD"))&&!StringUtils.isEmpty(datum.get("CSAD").toString())) {
csad = this.getValue(datum.get("CSAD").toString());
}
double jsad = 0.00d;
if (!ObjectUtils.isEmpty(datum.get("JSAD"))&&!StringUtils.isEmpty(datum.get("JSAD").toString())) {
jsad = this.getValue(datum.get("JSAD").toString());
}
double cstn = 0.00d;
if (!ObjectUtils.isEmpty(datum.get("CSTN"))&&!StringUtils.isEmpty(datum.get("CSTN").toString())) {
cstn = this.getValue(datum.get("CSTN").toString());
}
double jstn = 0.00d;
if (!ObjectUtils.isEmpty(datum.get("JSZD"))&&!StringUtils.isEmpty(datum.get("JSZD").toString())) {
jstn = this.getValue(datum.get("JSZD").toString());
}
double jstp = 0.00d;
if (!ObjectUtils.isEmpty(datum.get("JSZL"))&&!StringUtils.isEmpty(datum.get("JSZL").toString())) {
jstp = this.getValue(datum.get("JSZL").toString());
}
double cstp = 0.00d;
if (!ObjectUtils.isEmpty(datum.get("CSZL"))&&!StringUtils.isEmpty(datum.get("CSZL").toString())) {
cstp = this.getValue(datum.get("CSZL").toString());
sql = " SELECT sd.id factoryId,sd.depart_name factoryName,sa.area_name areaName ";
sql += " FROM sys_factory_info sfi";
sql += " LEFT JOIN sys_depart sd ON sd.id = sfi.depart_id ";
sql += " LEFT JOIN sys_area sa ON sa.id = sfi.pro_county ";
sql += " where sd.depart_type = '1' ";
if(org.apache.commons.lang.StringUtils.isNotEmpty(departIds)){
sql += " and sfi.depart_id in ("+ JSUtils.quoteEach(departIds,",") +") ";
}
/* if(StringUtils.isNotEmpty(factoryId)){
sql += " and sfi.depart_id='"+factoryId+" ' ";
}*/
List<Map<String, Object>> facLists = getJdbcTemplate().queryForList(sql );
for (Map<String, Object> facList : facLists) {
String factoryId = (String) facList.get("factoryId");
for(PowerCutDownVO powerCutDownVO : dateList ){
if(factoryId.equals( powerCutDownVO.getDepartId())){
facList.put("data", powerCutDownVO);
break;
}
double hdl = 0.00d;
if (!ObjectUtils.isEmpty(datum.get("ydh"))&&!StringUtils.isEmpty(datum.get("ydh").toString())&&!datum.containsValue("-")) {
hdl = this.getValue(datum.get("ydh").toString());
}
double clsl = 0.00d;
if (!ObjectUtils.isEmpty(datum.get("CSL"))&&!StringUtils.isEmpty(datum.get("CSL").toString())&&!datum.containsValue("-")) {
clsl = this.getValue(datum.get("CSL").toString());
}
double cod = DoubleOperaUtils.bigDecimalRound((jscod-cscod),2);
double ad = DoubleOperaUtils.bigDecimalRound((jsad-csad),2);
double tn = DoubleOperaUtils.bigDecimalRound((jstn-cstn),2);
double tp = DoubleOperaUtils.bigDecimalRound((jstp-cstp),2);
clsl = DoubleOperaUtils.bigDecimalRound(clsl,2);
cod = cod<0? 0:cod;
ad = ad<0? 0:ad;
tn = tn<0? 0:tn;
tp = tp<0? 0:tp;
List<Map<String, Double>> list = tmp.get(departId);
if (CollectionUtils.isEmpty(list)){
Map<String,Double> map = new HashMap<>();
map.put("nh3nValue",ad);
map.put("tnValue",tn);
map.put("tpValue",tp);
map.put("codValue",cod);
map.put("clsl",clsl);
map.put("hdl",hdl);
map.put("num",1.0);
tmp.put(departId,Lists.newArrayList(map));
}else{
Map<String, Double> dataMap = list.get(0);
dataMap.put("nh3nValue",dataMap.get("nh3nValue")+ad);
dataMap.put("tnValue",dataMap.get("tnValue")+tn);
dataMap.put("tpValue",dataMap.get("tpValue")+tp);
dataMap.put("codValue",dataMap.get("codValue")+cod);
dataMap.put("clsl",dataMap.get("clsl")+clsl);
dataMap.put("hdl",dataMap.get("hdl")+hdl);
dataMap.put("num",dataMap.get("num")+1);
result.put("data", facLists);
return result;
}
public JdbcTemplate getJdbcTemplate(){
JdbcTemplate masterDB = (JdbcTemplate) SpringContextUtils.getBean("master");
return masterDB;
}
}
for (Map<String, Object> facList : facLists) {
String factoryId = (String) facList.get("factoryId");
List<Map<String, Double>> maps = tmp.get(factoryId);
if (!CollectionUtils.isEmpty(maps)) {
Map<String, Double> dataMap = maps.get(0);
Double num = dataMap.get("num");
Double nh3nValue = dataMap.get("nh3nValue")/num;
Double tnValue = dataMap.get("tnValue")/num;
Double tpValue = dataMap.get("tpValue")/num;
Double codValue = dataMap.get("codValue")/num;
Double hdl = dataMap.get("hdl");
Double clsl = dataMap.get("clsl");
nh3nValue = DoubleOperaUtils.bigDecimalRound(hdl/nh3nValue/clsl,2);
tnValue = DoubleOperaUtils.bigDecimalRound(hdl/tnValue/clsl,2);
tpValue = DoubleOperaUtils.bigDecimalRound(hdl/tpValue/clsl,2);
codValue = DoubleOperaUtils.bigDecimalRound(hdl/codValue/clsl,2);
dataMap.put("nh3nValue",nh3nValue);
dataMap.put("tnValue",tnValue);
dataMap.put("tpValue",tpValue);
dataMap.put("codValue",codValue);
}
facList.put("data", maps);
}
result.put("data", facLists);
return result;
}
private static Double getValue(String v){
......@@ -914,7 +838,6 @@ public class PowerAnalysisNewServiceImpl implements IPowerAnalysisNewService {
return maps;
}
private static String getLastDate(String date,SimpleDateFormat type,long time){
try{
Date parse = type.parse(date);
......
package com.skua.modules.dataAnalysis.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @auther kangwei
* @create 2024-12-19-10:19
*/
@Data
@ApiModel(value="能耗分析:单位污染物削减耗电量对象", description="能耗分析:单位污染物削减耗电量对象")
public class PowerCutDownVO {
@ApiModelProperty(value = "部门编号")
public String departId ;
@ApiModelProperty(value = "名称")
public String clsl ;
@ApiModelProperty(value = "名称")
public String codValue;
@ApiModelProperty(value = "名称")
public String hdl;
@ApiModelProperty(value = "名称")
public String nh3nValue;
@ApiModelProperty(value = "名称")
public String num;
@ApiModelProperty(value = "名称")
public String tnValue;
@ApiModelProperty(value = "名称")
public String tpValue;
}
......@@ -7,8 +7,6 @@ import com.skua.modules.report.vo.ProductDataVO;
* @create 2024-10-14-9:11
*/
public interface IOperationReportService {
/***
* 处理月季度数据
* @param year
......
......@@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
* 月度电费报表
*/
public interface IReportElectricCostService extends IService<ReportElectricCost> {
//月度电费报表-分页列表查询
IPage<ReportElectricCost> getPage(Page<ReportElectricCost> page, ReportElectricCost reportElectricCost);
}
......
......@@ -2,6 +2,7 @@ package com.skua.modules.report.service.impl;
import com.skua.common.constant.ReportConstant;
import com.skua.common.report.ReportViewUtil;
import com.skua.core.context.BaseContextHandler;
import com.skua.core.context.SpringContextUtils;
import com.skua.core.util.ConvertUtils;
import com.skua.modules.report.mapper.OperationReportMapper;
......@@ -10,7 +11,7 @@ import com.skua.modules.report.vo.*;
import com.skua.tool.util.DateUtils;
import com.skua.tool.util.DigitalUtils;
import com.skua.tool.util.JSUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
......@@ -57,88 +58,81 @@ public class OperationReportServiceImpl implements IOperationReportService {
String deptartCount = getJdbcTemplate().queryForObject(sql,String.class);
productDataVO.setDeptartCount( deptartCount );
String departId = null;
// ysfsl:月收费水量 ; yyf:月药费 ; ysjsl:月实际水量
String dataViewName4411 = ReportViewUtil.buildViewLike(ReportConstant.view4411,"ysfsl,ysjsl,yyf", departId, seasonTimeVO.getStartTime(),seasonTimeVO.getEndTime());
sql = "select round(sum( aaa.ysfsl ),2) 'ysfsl' , round(sum( aaa.ysjsl ),2) 'ysjsl' , round(sum(tc.target_water ),2) 'target_water', round(sum(tc.target_drug ),2) 'target_drug' ,round((sum( aaa.ysfsl ) *100 / sum(tc.target_water )),2) as 'completeRatio' from "+dataViewName4411+" aaa";
sql += " left join report_target_config tc on (tc.depart_id = aaa.depart_id and tc.target_year = '"+year+"')";
List<Map<String, Object>> mapList = getJdbcTemplate().queryForList(sql);
productDataVO.setDayNum( DateUtils.differenceDay(seasonTimeVO.getStartTime(),seasonTimeVO.getEndTime()) );//相差天数
Double target_drug = null;//药吨水药耗
Double drugCost = 0d;//药剂实际费用
Double completeRatio = null;
Double ysjsl = null;//实际处理水量
if(mapList != null ){
for(Map<String,Object> map : mapList){
productDataVO.setChargeWaterVolume( JSUtils.format( map.get("ysfsl")) ); //收费水量
productDataVO.setYsjslWaterVolume(JSUtils.format(map.get("ysjsl")) );//实际处理水量
productDataVO.setCompleteRatio( JSUtils.format( map.get("completeRatio")) );//收费水量-完成率
completeRatio = ConvertUtils.getDouble(map.get("completeRatio"),0d);
target_drug = ConvertUtils.getDouble( map.get("target_drug"),0d);
ysjsl = ConvertUtils.getDouble( map.get("ysjsl"),0d);
if(ysjsl.doubleValue() != 0 ){
drugCost = formatDouble(ConvertUtils.getDouble( map.get("yyf"),0d) / ysjsl);
}
}
}
productDataVO.setDrugCost( drugCost );
productDataVO.setTargetDrug( target_drug );
long dayNum = DateUtils.differenceDay(seasonTimeVO.getStartTime(),seasonTimeVO.getEndTime());//天数
String departId = BaseContextHandler.getDeparts();
productDataVO.setSequentialProgress("基本满足时序进度");
if(completeRatio.doubleValue() > 25){
productDataVO.setSequentialProgress("超额完成时序进度");
}
// 去年水数据:月收费水量、月实际水量
// ysfsl:月收费水量 ; yyf:月药费 ; ysjsl:月实际水量
dataViewName4411 = ReportViewUtil.buildViewLike(ReportConstant.view4411,"ysfsl,ysjsl", departId, lastSeasonTimeVO.getStartTime(),lastSeasonTimeVO.getEndTime());
sql = "select round(sum( aaa.ysfsl ),2) 'ysfsl' , round(sum( aaa.ysjsl ),2) 'ysjsl' from "+dataViewName4411+" aaa";
String dataViewName4411 = ReportViewUtil.buildView(ReportConstant.view4411,"ysfsl,ysjsl,yyf", departId, seasonTimeVO.getStartTime(),seasonTimeVO.getEndTime());
sql = "select sum(aaa.ysfsl) 'ysfsl' , sum(aaa.yyf) 'yyf' ,sum(aaa.ysjsl) 'ysjsl' from "+ dataViewName4411 + " aaa";
String ysfsl = null;//月收费水量 ;
String ysjsl = null;//月实际水量;
Map<String, Object> dataMap = getJdbcTemplate().queryForMap(sql);
if(dataMap != null){
ysfsl = ConvertUtils.getString(dataMap.get("ysfsl") , "0");
ysjsl = ConvertUtils.getString(dataMap.get("ysjsl") , "0");
if(mapList != null ){
for(Map<String,Object> map : mapList){
Double qn_ysfsl = ConvertUtils.getDouble( map.get("ysfsl"),0d);// 去年:收费水量
Double qn_ysjsl = ConvertUtils.getDouble( map.get("ysjsl"),0d);// 去年:月实际水量
if(qn_ysfsl.doubleValue() != 0){//去年:收费水量
productDataVO.setChargeWaterRatio( formatDouble((ConvertUtils.getDouble( productDataVO.getChargeWaterVolume() ,0d) - qn_ysfsl)*100 / qn_ysfsl ));
productDataVO.setChargeWaterVolume( ysfsl ); //收费水量
productDataVO.setYsjslWaterVolume(ysjsl );//实际处理水量
}
if(qn_ysjsl.doubleValue() != 0){//去年:月实际水量
productDataVO.setYsjslWaterRatio( formatDouble(( ConvertUtils.getDouble( productDataVO.getYsjslWaterVolume() ,0d) - qn_ysjsl ) *100/ qn_ysjsl ) );
//目标水量
sql = "select sum(ifnull(target_water,0)) target_water from report_target_config where 1=1 ";
if(StringUtils.isNotEmpty(departId)){
sql += " and depart_id in ("+JSUtils.quoteEach(departId,",")+")";
}
String target_water = getJdbcTemplate().queryForObject(sql,String.class);
productDataVO.setAvgDayWaterVolume( JSUtils.divide(ysfsl, dayNum) );
String completeRatio = JSUtils.multiply( JSUtils.divide(ysfsl,target_water),100);
productDataVO.setCompleteRatio( completeRatio);//完成率
if( Double.parseDouble(completeRatio )> 25){
productDataVO.setSequentialProgress("超额完成时序进度");
}
/****************去年同期数据处理************************/
dataViewName4411 = ReportViewUtil.buildView(ReportConstant.view4411,"ysfsl,ysjsl,yyf", departId, DateUtils.getTbDate(seasonTimeVO.getStartTime()), DateUtils.getTbDate(seasonTimeVO.getEndTime()));
sql = "select sum(aaa.ysfsl) 'ysfsl' , sum(aaa.yyf) 'yyf' ,sum(aaa.ysjsl) 'ysjsl' from "+ dataViewName4411 + " aaa";
String ysfslTB = null;//月收费水量 ;
String ysjslTB = null;//月实际水量;
dataMap = getJdbcTemplate().queryForMap(sql);
if(dataMap != null){
ysfslTB = ConvertUtils.getString(dataMap.get("ysfsl") , "0");
ysjslTB = ConvertUtils.getString(dataMap.get("ysjsl") , "0");
}
//实际水量同比下降水务公司原因分析一览表
//ysjsldyqntqyy 月实际水量低于去年同期原因
//tqysjsl 同期月实际水量
//ysjsl 月实际水量
// fields = "ysjsl,tqysjsl,ysjsldyqntqyy";
dataViewName4411 = ReportViewUtil.buildView(ReportConstant.view4411,"ysjsl,tqysjsl,ysjsldyqntqyy", departId, seasonTimeVO.getStartTime(),seasonTimeVO.getEndTime());
// sql = "select sum( aaa.ysfsl ) 'ysfsl' , sum( aaa.ysjsl ) 'ysjsl' , sum(tc.target_water ) 'target_water' , sum(tc.target_power) 'target_power' ,round((sum( aaa.ysfsl ) *100 / sum(tc.target_water )),2) as 'completeRatio' from "+dataViewName4411+" aaa";
sql = " select bbb.* , d.depart_name from (";
sql += "select aaa.depart_id, round( (aaa.tqysjsl - aaa.ysjsl ) / aaa.tqysjsl ,2 ) 'ratio' , aaa.tqysjsl , aaa.ysjsl , aaa.ysjsldyqntqyy 'causeAnalysis' from "+dataViewName4411 +" aaa where aaa.tqysjsl > aaa.ysjsl )bbb";
sql += " left join sys_depart d on d.id = bbb.depart_id ";
String expression = " 100 * ( "+ysfsl+" - "+ysfslTB+")/ "+ysfslTB;
productDataVO.setChargeWaterRatio(JSUtils.executeExpression(expression,"0"));
productDataVO.setAvgYsjslWaterVolume(JSUtils.divide(ysjsl,DateUtils.differenceDay(DateUtils.getTbDate(seasonTimeVO.getStartTime()),DateUtils.getTbDate(seasonTimeVO.getEndTime()))));//实际处理水量-日均值
expression = " 100 * ( "+ysjsl+" - "+ysjslTB+")/ "+ysjslTB;
productDataVO.setYsjslWaterRatio( JSUtils.executeExpression(expression,"0"));//实际处理水量--同比增长
/***************** 实际水量同比下降水务公司原因分析一览表************************/
dataViewName4411 = ReportViewUtil.buildView(ReportConstant.view4411,"ysjsl,tqysjsl,ysjsldyqntqyy", departId, seasonTimeVO.getStartTime(), seasonTimeVO.getEndTime());
sql = " select aaa.depart_id , d.depart_name departName, round(100*(sum(ifnull(aaa.ysjsl,0)) - sum(ifnull(aaa.tqysjsl,0)) )/ sum(ifnull(aaa.tqysjsl,0)),2) 'ratio', ";
sql += " round( sum(ifnull(aaa.ysjsl,0)),2 ) 'ysjsl' ,round( sum(ifnull(aaa.tqysjsl,0)),2 ) 'tqysjsl' ,GROUP_CONCAT(aaa.ysjsldyqntqyy) 'causeAnalysis' from "+ dataViewName4411+" aaa";
sql += " left join sys_depart d on d.id = aaa.depart_id";
sql += " group by aaa.depart_id HAVING sum(ifnull(aaa.ysjsl,0)) < sum(ifnull(aaa.tqysjsl,0)) ";
List<FReportWaterMonthDataVO> waterMonthDataList = getJdbcTemplate().query(sql,new BeanPropertyRowMapper<FReportWaterMonthDataVO>(FReportWaterMonthDataVO.class));
productDataVO.setWaterDeptartList(waterMonthDataList);
//水电耗高于控制目标--水务公司列表
dataViewName4411 = ReportViewUtil.buildViewLike(ReportConstant.view4411,"ydh,qntqdh,dhgyqntqyy", departId, seasonTimeVO.getStartTime(),seasonTimeVO.getEndTime(),"max");
sql = "select aaa.dhgyqntqyy 'causeAnalysis' , aaa.qntqdh ,aaa.ydh 'realConsume' ,d.depart_name 'deptartName' , IFNULL(tc.target_power,'-') 'targetConsume' from " + dataViewName4411 + " aaa ";
sql += " left join report_target_config tc on (tc.depart_id = aaa.depart_id and tc.target_year ="+year+")";
dataViewName4411 = ReportViewUtil.buildView(ReportConstant.view4411,"ydh,dhcmbzyy", departId, seasonTimeVO.getStartTime(), seasonTimeVO.getEndTime());
sql = "select * from ( ";
sql += " select d.depart_name 'departName', aaa.depart_id , avg(aaa.ydh) realConsume , IFNULL(tc.target_power,2) 'targetConsume' ,GROUP_CONCAT(aaa.dhcmbzyy) 'causeAnalysis' from "+ dataViewName4411+" aaa";;
sql += " left join report_target_config tc on (tc.depart_id = aaa.depart_id and tc.target_year='2024')";
sql += " left join sys_depart d on d.id = aaa.depart_id ";
sql += " where aaa.ydh > IFNULL(tc.target_power,0)";
List<FReportPowerMonthDataVO> powerMonthDataVOList = getJdbcTemplate().query(sql,new BeanPropertyRowMapper<FReportPowerMonthDataVO>(FReportPowerMonthDataVO.class));
productDataVO.setPowerDeptartList(powerMonthDataVOList);
sql += " group by aaa.depart_id )bbb where bbb.realConsume > bbb.targetConsume ";
List<FReportPowerMonthDataVO> dhMonthDataList = getJdbcTemplate().query(sql,new BeanPropertyRowMapper<FReportPowerMonthDataVO>(FReportPowerMonthDataVO.class));
productDataVO.setPowerDeptartList(dhMonthDataList);
/** ysjsl:月实际水量 ; 月药耗 yyh; 去年同期药耗 qntqyh; 月药费 yyf;药耗高于去年同期原因 yhgyqntqyy;药耗超预期原因 yhcyqyy; 本年实际药耗 bnsjyh; 本年药耗目标 bnyhmb*/
//药剂成本高于控制目标--水务公司列表
dataViewName4411 = ReportViewUtil.buildViewLike(ReportConstant.view4411,"ysjsl,yyh,qntqyh,qntqyh,yhgyqntqyy,bnsjyh,bnyhmb", departId, seasonTimeVO.getStartTime(),seasonTimeVO.getEndTime(),"max");
// sql = "select round((aaa.yyh/aaa.ysjsl),2) 'realConsume',aaa.ysjsl,aaa.qntqyh,aaa.qntqyh,aaa.yhgyqntqyy '',aaa.bnsjyh,aaa.bnyhmb,aaa.depart_id ,d.depart_name ,IFNULL(tc.target_drug,'-') 'targetConsume' from " + dataViewName4411 + " aaa ";
sql = " select bbb.* , d.depart_name 'deptartName' from (";
sql += "select aaa.depart_id , IFNULL(tc.target_drug,0) target_drug, round((aaa.yyh/aaa.ysjsl),2) 'realConsume', aaa.yhgyqntqyy 'causeAnalysis', IFNULL(tc.target_drug,'-') 'targetConsume' from " + dataViewName4411 + " aaa ";
sql += " left join report_target_config tc on (tc.depart_id = aaa.depart_id and tc.target_year ="+year+")";
sql += ") bbb";
sql+= " left join sys_depart d on d.id = bbb.depart_id ";
sql += " where bbb.realConsume > bbb.target_drug";
List<FReportPowerMonthDataVO> drugDataList = getJdbcTemplate().query(sql,new BeanPropertyRowMapper<FReportPowerMonthDataVO>(FReportPowerMonthDataVO.class));
productDataVO.setDrugDeptartList(drugDataList);
dataViewName4411 = ReportViewUtil.buildView(ReportConstant.view4411,"yyh,yhcyqyy", departId, seasonTimeVO.getStartTime(), seasonTimeVO.getEndTime());
sql = "select * from ( ";
sql += " select d.depart_name 'departName', aaa.depart_id , avg(aaa.yyh) realConsume , IFNULL(tc.target_power,2) 'targetConsume' ,GROUP_CONCAT(aaa.yhcyqyy) 'causeAnalysis' from "+ dataViewName4411+" aaa";;
sql += " left join report_target_config tc on (tc.depart_id = aaa.depart_id and tc.target_year='2024')";
sql += " left join sys_depart d on d.id = aaa.depart_id ";
sql += " group by aaa.depart_id )bbb where bbb.realConsume > bbb.targetConsume ";
List<FReportPowerMonthDataVO> yyhMonthDataList = getJdbcTemplate().query(sql,new BeanPropertyRowMapper<FReportPowerMonthDataVO>(FReportPowerMonthDataVO.class));
productDataVO.setDrugDeptartList(yyhMonthDataList);
//隐患排查完成情况
List<String> deptNameList = operationReportMapper.queryDepatNameList();
......@@ -147,6 +141,7 @@ public class OperationReportServiceImpl implements IOperationReportService {
productDataVO.setDangerDeptCount( deptNameList.size());
productDataVO.setDangerDeptNames(String.join(",",deptNameList));
}
return productDataVO;
}
......
......@@ -6,6 +6,7 @@ import com.skua.core.context.BaseContextHandler;
import com.skua.modules.report.entity.ReportElectricCost;
import com.skua.modules.report.mapper.ReportElectricCostMapper;
import com.skua.modules.report.service.IReportElectricCostService;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -23,10 +24,10 @@ public class ReportElectricCostServiceImpl extends ServiceImpl<ReportElectricCos
@Resource
private ReportElectricCostMapper reportElectricCostMapper;
//月度电费报表-分页列表查询
@Override
public IPage<ReportElectricCost> getPage(Page<ReportElectricCost> page, ReportElectricCost reportElectricCost) {
if(reportElectricCost.getDepartId()==null){
if(StringUtils.isEmpty(reportElectricCost.getDepartId())){
reportElectricCost.setDepartId(BaseContextHandler.getDeparts());
}
// if(reportElectricCost.getMonth()!=null){
......
......@@ -11,7 +11,7 @@ import java.math.BigDecimal;
public class FReportPowerMonthDataVO {
@ApiModelProperty(value = "所属厂站名称")
private String deptartName;
private String departName;
@ApiModelProperty(value = "目标消耗")
private String targetConsume;
......@@ -26,8 +26,8 @@ public class FReportPowerMonthDataVO {
}
public FReportPowerMonthDataVO(String deptartName, String targetConsume, String realConsume , String causeAnalysis) {
this.deptartName = deptartName;
public FReportPowerMonthDataVO(String departName, String targetConsume, String realConsume , String causeAnalysis) {
this.departName = departName;
this.targetConsume = targetConsume;
this.realConsume = realConsume;
this.causeAnalysis = causeAnalysis;
......
......@@ -11,7 +11,7 @@ import java.math.BigDecimal;
public class FReportWaterMonthDataVO {
@ApiModelProperty(value = "所属厂站名称")
private String deptartName;
private String departName;
@ApiModelProperty(value = "比例")
private String ratio;
......@@ -23,8 +23,8 @@ public class FReportWaterMonthDataVO {
}
public FReportWaterMonthDataVO(String deptartName, String ratio, String causeAnalysis) {
this.deptartName = deptartName;
public FReportWaterMonthDataVO(String departName, String ratio, String causeAnalysis) {
this.departName = departName;
this.ratio = ratio;
this.causeAnalysis = causeAnalysis;
}
......
......@@ -26,15 +26,12 @@ public class ProductDataVO {
@ApiModelProperty(value = "水务厂站数量")
private String deptartCount;
@ApiModelProperty(value = "相差天数")
private Long dayNum;
@ApiModelProperty(value = "收费水量")
private String chargeWaterVolume;//收费水量9854.012552万吨
@ApiModelProperty(value = "收费水量-日均值")
private String avgDayWaterVolume;//平均108.29万吨/天
@ApiModelProperty(value = "收费水量-同比增长")
private Double chargeWaterRatio;
private String chargeWaterRatio;
@ApiModelProperty(value = "收费水量-完成率")
private String completeRatio;
@ApiModelProperty(value = "序时进度")
......@@ -47,7 +44,7 @@ public class ProductDataVO {
@ApiModelProperty(value = "实际处理水量-日均值")
private String avgYsjslWaterVolume;//平均99.76万吨/天
@ApiModelProperty(value = "实际处理水量--同比增长")
private Double ysjslWaterRatio;
private String ysjslWaterRatio;
@ApiModelProperty(value = "药量目标")
......@@ -65,12 +62,13 @@ public class ProductDataVO {
@ApiModelProperty(value = "水电耗高于控制目标--水务公司列表")
private List<FReportPowerMonthDataVO> powerDeptartList = new ArrayList<>();
@ApiModelProperty(value = "水电耗高于控制目标--水务公司列表")
@ApiModelProperty(value = "水电耗高于控制目标--水务公司名称")
private String powerDeptartName;
@ApiModelProperty(value = "药剂成本高于控制目标--水务公司列表")
private List<FReportPowerMonthDataVO> drugDeptartList = new ArrayList<>();
@ApiModelProperty(value = "药剂成本高于控制目标--水务公司列表")
@ApiModelProperty(value = "药剂成本高于控制目标--水务公司名称")
private String drugDeptartName;
@ApiModelProperty(value = "季度最后一天")
......@@ -82,17 +80,6 @@ public class ProductDataVO {
@ApiModelProperty(value = "隐患部门名称")
private String dangerDeptNames;
//收费水量-日均值
public String getAvgDayWaterVolume() {
avgDayWaterVolume = JSUtils.divide(chargeWaterVolume , dayNum ) ;
return avgDayWaterVolume;
}
//实际处理水量-日均值
public String getAvgYsjslWaterVolume() {
// avgYsjslWaterVolume = ConvertUtils.getDouble(ysjslWaterVolume,0) / dayNum;
avgYsjslWaterVolume = JSUtils.divide(ysjslWaterVolume , dayNum ) ;
return avgYsjslWaterVolume;
}
public String getWaterDeptartName() {
return getDeptName(waterDeptartList);
......@@ -111,8 +98,8 @@ public class ProductDataVO {
if( deptartList != null && !deptartList.isEmpty() ){
for(FReportWaterMonthDataVO dataVO : deptartList){
if(deptName.length() > 0 ) deptName+="、";
if(StringUtils.isNotEmpty(dataVO.getDeptartName())){
deptName += dataVO.getDeptartName();
if(StringUtils.isNotEmpty(dataVO.getDepartName())){
deptName += dataVO.getDepartName();
}
}
......@@ -124,8 +111,8 @@ public class ProductDataVO {
if( deptartList != null && !deptartList.isEmpty() ){
for(FReportPowerMonthDataVO dataVO : deptartList){
if(deptName.length() > 0 ) deptName+="、";
if(StringUtils.isNotEmpty(dataVO.getDeptartName())){
deptName += dataVO.getDeptartName();
if(StringUtils.isNotEmpty(dataVO.getDepartName())){
deptName += dataVO.getDepartName();
}
}
}
......
......@@ -2,6 +2,7 @@ package com.skua.modules.equipment.service.impl;
import com.skua.common.constant.ReportConstant;
import com.skua.common.report.ReportViewUtil;
import com.skua.common.report.vo.ReportItemVO;
import com.skua.core.context.SpringContextUtils;
import com.skua.core.util.ConvertUtils;
import com.skua.modules.common.vo.DateVO;
......@@ -38,20 +39,18 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly
//数据展示
public DrugConsumptionDisplayVO dataDisplay(String time, String departId){
DrugConsumptionDisplayVO displayVO = null;
DateVO dateVO = new DateVO(time);//转换后的时间参数
//出水量
Double CSL = getCSL(departId, dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate());//出水量
//同比-上月出水量
Double tbsyCsl = getCSL(departId, dateVO.getLastMonthStartTime(),dateVO.getLastMonthEndTime());//出水量
//环比--去年出水量
Double tbqnCsl = getCSL(departId, dateVO.getLastYearMonthStartTime(),dateVO.getLastYearMonthEndTime());//出水量
String startTime = time+"-01";
String endTime = time +"-31";
// DateVO dateVO = new DateVO(time);//转换后的时间参数
//出水量:+同比+环比
ReportItemVO csl_reportVO = ReportViewUtil.getSumValueByTBHB(ReportConstant.view2119,ReportConstant.field_CSL, departId, startTime, endTime);
//总药耗:value ; 同比 环比
ReportItemVO zyhReportVO = ReportViewUtil.getSumValueByTBHB( ReportConstant.view3a24,ReportConstant.fieldYj, departId, startTime,endTime);
//计算药耗
Double zyh = countDSYH(departId ,dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate());//总药耗
Double tbqnzyh = countDSYH(departId ,dateVO.getLastYearMonthStartTime(),dateVO.getLastYearMonthEndTime() );//去年同比总药耗
Double hbsyzyh = countDSYH(departId ,dateVO.getLastMonthStartTime(),dateVO.getLastMonthEndTime() );//环比上月总药耗
displayVO = new DrugConsumptionDisplayVO(ConvertUtils.getDouble(csl_reportVO.getValue(),0d) , ConvertUtils.getDouble(csl_reportVO.getValueHb(),0d), ConvertUtils.getDouble(csl_reportVO.getValueTb(),0d),
ConvertUtils.getDouble(zyhReportVO.getValue(),0d), ConvertUtils.getDouble(zyhReportVO.getValueHb(),0d), ConvertUtils.getDouble(zyhReportVO.getValueTb(),0d));
displayVO = new DrugConsumptionDisplayVO( CSL, tbqnCsl, tbsyCsl, zyh, hbsyzyh, tbqnzyh);
//历史最低吨水药耗???
String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,ReportConstant.fieldClsl, departId, null,null);
......
package com.skua.modules.equipment.vo;
import com.skua.core.util.ConvertUtils;
import com.skua.tool.util.JSUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -84,39 +86,32 @@ public class DrugConsumptionDisplayVO {
this.CSL = CSL;
this.tbqnCsl = tbqnCsl;
this.hbsyCsl = hbsyCsl;
this.zyh = zyh;
this.zyh = ConvertUtils.getDouble(zyh,0d);
this.hbsyzyh = hbsyzyh;
this.tbqnzyh = tbqnzyh;
if(this.zyh != null ){
//计算吨水药耗
//药耗量[kg] / 处理水量[吨]
if(this.CSL != null && Double.compare(this.CSL, 0.0) != 0) {
this.dsyh = this.getValue(this.zyh /this.CSL );
}
// 计算吨水药耗: 药耗量[kg] / 处理水量[吨]
this.dsyh = Double.parseDouble(JSUtils.divide(zyh, CSL));
//同比总药耗
if(this.tbqnzyh != null){
this.tbqnzyhsl = this.getValue(this.zyh - this.tbqnzyh);
this.tbqnzyhbl = this.getValue(((this.zyh - this.tbqnzyh)/this.tbqnzyh)*100) ;
//计算吨水药耗 //同比吨水药耗
if(this.tbqnCsl != null && Double.compare(this.tbqnCsl, 0.0) != 0) this.tbqndsyh = this.getValue(this.tbqnzyh /this.tbqnCsl );
if(this.tbqndsyh != null && this.dsyh != null ){
this.tbqndsyhsl = this.getValue(dsyh-tbqndsyh);
this.tbqndsyhbl = this.getValue((dsyh-tbqndsyh)/tbqndsyh*100);
}
}
//环比总药耗
if(this.hbsyzyh != null ){
this.hbsyzyhsl = this.getValue(this.zyh - this.hbsyzyh);
this.hbsyzyhbl = this.getValue(((this.zyh - this.hbsyzyh)/this.hbsyzyh)*100) ;
//环比-吨水药耗
if(this.hbsyCsl != null && Double.compare(this.hbsyCsl, 0.0) != 0) this.hbsydsyh = this.getValue(this.hbsyzyh /this.hbsyCsl );
if(this.hbsydsyh != null && this.dsyh != null){
this.tbqnzyhsl = Double.parseDouble(JSUtils.subtract( zyh, tbqnzyh));
String expression = "100*( "+zyh+" - "+tbqnzyh+") / "+tbqnzyh;
this.tbqnzyhbl = Double.parseDouble(JSUtils.executeExpression(expression,"0") );
//同比吨水药耗
this.tbqndsyh = Double.parseDouble( JSUtils.divide(tbqnzyh ,tbqnCsl));
this.tbqndsyhsl = this.getValue(this.dsyh - this.tbqndsyh);
expression = "100*( "+this.dsyh+" - "+this.tbqndsyh+") / "+this.tbqnzyh;
this.tbqndsyhbl = Double.parseDouble( JSUtils.executeExpression( expression, "0"));
//环比 总药耗
this.hbsyzyhsl = Double.parseDouble(JSUtils.subtract( this.zyh ,this.hbsyzyh));
expression = "100*( "+this.zyh+" - "+this.hbsyzyh+") / "+this.hbsyzyh;
this.hbsyzyhbl = Double.parseDouble(JSUtils.executeExpression(expression,"0") );
//环比 吨水药耗
this.hbsydsyh = Double.parseDouble( JSUtils.divide(this.hbsyzyh ,this.hbsyCsl));
this.hbsydsyhsl = this.getValue(this.dsyh - this.hbsydsyh);
this.hbsydsyhbl = this.getValue((this.dsyh - this.hbsydsyh) / this.hbsydsyh*100);
}
}
}
expression = "100*( "+this.dsyh+" - "+this.hbsydsyh+") / "+this.hbsydsyh;
this.hbsydsyhbl = Double.parseDouble( JSUtils.executeExpression( expression, "0"));
}
private Double getValue(Double d) {
try{
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!