|
@@ -7,12 +7,14 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.gyee.common.contant.ContantXk;
|
|
|
import com.gyee.common.model.PointData;
|
|
|
import com.gyee.common.util.DateUtils;
|
|
|
+import com.gyee.common.vo.benchmark.FjjxbVo;
|
|
|
import com.gyee.runeconomy.init.CacheContext;
|
|
|
import com.gyee.runeconomy.model.auto.ProBasicPowerstation;
|
|
|
import com.gyee.runeconomy.model.auto.ProBasicPowerstationPoint;
|
|
|
import com.gyee.runeconomy.model.auto.ProEconPowerstationInfoDay5;
|
|
|
import com.gyee.runeconomy.service.auto.IProEconPowerstationInfoDay1Service;
|
|
|
import com.gyee.runeconomy.service.auto.IProEconPowerstationInfoDay5Service;
|
|
|
+import com.gyee.runeconomy.service.bmk.BenchmarkingService;
|
|
|
import com.gyee.runeconomy.util.MathUtil;
|
|
|
import com.gyee.runeconomy.util.realtimesource.IEdosUtil;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -20,6 +22,7 @@ import org.springframework.stereotype.Service;
|
|
|
import javax.annotation.Resource;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.math.RoundingMode;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
|
|
|
@Service
|
|
@@ -32,7 +35,65 @@ public class StationMonitorService {
|
|
|
@Resource
|
|
|
private IProEconPowerstationInfoDay5Service proEconPowerstationInfoDay5Service;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private BenchmarkingService benchmarkingService;
|
|
|
+
|
|
|
public Map<String, Object> caldata(String wpid) throws Exception {
|
|
|
+
|
|
|
+ String getype="-2";
|
|
|
+ if(wpid.contains("FDC"))
|
|
|
+ {
|
|
|
+ getype="-1";
|
|
|
+ }
|
|
|
+ Calendar cale = Calendar.getInstance();
|
|
|
+
|
|
|
+ SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+
|
|
|
+ cale.set(Calendar.DAY_OF_MONTH, 1);
|
|
|
+
|
|
|
+ Date begin=DateUtils.truncate(cale.getTime());
|
|
|
+
|
|
|
+ String beginDates = formatter.format(begin.getTime());
|
|
|
+
|
|
|
+ cale = Calendar.getInstance();
|
|
|
+
|
|
|
+ Date end=DateUtils.truncate(cale.getTime());
|
|
|
+
|
|
|
+ String endDates = formatter.format(end.getTime());
|
|
|
+
|
|
|
+ List<FjjxbVo> monthvos= benchmarkingService.performance(null, getype, "1", beginDates, endDates, wpid, null, null, null, null);
|
|
|
+ Map <String,FjjxbVo> monthvomap=new HashMap<>();
|
|
|
+ if(!monthvos.isEmpty())
|
|
|
+ {
|
|
|
+ for(FjjxbVo vo:monthvos)
|
|
|
+ {
|
|
|
+ monthvomap.put(vo.getId(),vo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ cale = Calendar.getInstance();
|
|
|
+
|
|
|
+ cale.set(Calendar.MONTH,0);
|
|
|
+ cale.set(Calendar.DAY_OF_MONTH, 1);
|
|
|
+
|
|
|
+ begin=DateUtils.truncate(cale.getTime());
|
|
|
+
|
|
|
+ beginDates = formatter.format(begin.getTime());
|
|
|
+
|
|
|
+ cale = Calendar.getInstance();
|
|
|
+
|
|
|
+ end=DateUtils.truncate(cale.getTime());
|
|
|
+
|
|
|
+ endDates = formatter.format(end.getTime());
|
|
|
+
|
|
|
+ List<FjjxbVo> yearvos= benchmarkingService.performance(null, getype, "1", beginDates, endDates, wpid, null, null, null, null);
|
|
|
+ Map <String,FjjxbVo> yearvomap=new HashMap<>();
|
|
|
+ if(!yearvos.isEmpty())
|
|
|
+ {
|
|
|
+ for(FjjxbVo vo:yearvos)
|
|
|
+ {
|
|
|
+ yearvomap.put(vo.getId(),vo);
|
|
|
+ }
|
|
|
+ }
|
|
|
Map<String, Object> resultMap = new HashMap<>();
|
|
|
Map<String, ProBasicPowerstation> wpmap = CacheContext.wpmap;
|
|
|
Map<String, ProBasicPowerstationPoint> powerstationPointMap = CacheContext.wppointmap.get(wpid);
|
|
@@ -292,7 +353,20 @@ public class StationMonitorService {
|
|
|
double yslssdl = realData.get(52).getPointValueInDouble() + realData.get(53).getPointValueInDouble();
|
|
|
yslssdl = new BigDecimal(yslssdl).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
resultMap.put("yslssdl", yslssdl);
|
|
|
-
|
|
|
+ if(monthvomap.containsKey(wpid))
|
|
|
+ {
|
|
|
+ FjjxbVo vo=monthvomap.get(wpid);
|
|
|
+ resultMap.put("ygzssdl", vo.getFjhjx());
|
|
|
+ ygzssdl =vo.getFjhjx();
|
|
|
+ resultMap.put("ywhssdl", vo.getJhjx());
|
|
|
+ ywhssdl =vo.getJhjx();
|
|
|
+ resultMap.put("yxnssdl", vo.getXn());
|
|
|
+ yxnssdl =vo.getXn();
|
|
|
+ resultMap.put("yxdssdl", vo.getXd());
|
|
|
+ yxdssdl =vo.getXd();
|
|
|
+ resultMap.put("yslssdl", vo.getSl());
|
|
|
+ yslssdl =vo.getSl();
|
|
|
+ }
|
|
|
double ngzssdl = realData.get(54).getPointValueInDouble() + realData.get(55).getPointValueInDouble();
|
|
|
ngzssdl = new BigDecimal(ngzssdl).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
resultMap.put("ngzssdl", ngzssdl);
|
|
@@ -309,6 +383,20 @@ public class StationMonitorService {
|
|
|
nslssdl = new BigDecimal(nslssdl).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
resultMap.put("nslssdl", nslssdl);
|
|
|
|
|
|
+ if(yearvomap.containsKey(wpid))
|
|
|
+ {
|
|
|
+ FjjxbVo vo=yearvomap.get(wpid);
|
|
|
+ resultMap.put("ngzssdl", vo.getFjhjx());
|
|
|
+
|
|
|
+ resultMap.put("nwhssdl", vo.getJhjx());
|
|
|
+
|
|
|
+ resultMap.put("nxnssdl", vo.getXn());
|
|
|
+
|
|
|
+ resultMap.put("nxdssdl", vo.getXd());
|
|
|
+
|
|
|
+ resultMap.put("nslssdl", vo.getSl());
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
double llfdl = yfdl1.doubleValue()+ygzssdl+ywhssdl+yxnssdl+yxdssdl+yslssdl;
|
|
|
double yfgnlyl=0.0;
|