|
@@ -0,0 +1,80 @@
|
|
|
+package com.gyee.frame.service.peranalysis;
|
|
|
+
|
|
|
+
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.alibaba.fastjson.TypeReference;
|
|
|
+import com.gyee.frame.common.cache.IGlobalCache;
|
|
|
+import com.gyee.frame.model.auto.WindpowerstationPG;
|
|
|
+import com.gyee.frame.model.auto.Windpowerstationpointnew;
|
|
|
+import com.gyee.frame.model.custom.DNAVal;
|
|
|
+import com.gyee.frame.model.custom.EBAPerSisVo;
|
|
|
+import com.gyee.frame.service.WindpowerstationPGService;
|
|
|
+import com.gyee.frame.util.IRealTimeDataBaseUtil;
|
|
|
+import com.gyee.frame.util.RealTimeDataBaseFactory;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import java.util.*;
|
|
|
+
|
|
|
+@Service
|
|
|
+public class EBApersisService {
|
|
|
+
|
|
|
+
|
|
|
+ IRealTimeDataBaseUtil realApiUtil = RealTimeDataBaseFactory.createRealTimeDataBase();
|
|
|
+
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private IGlobalCache globalCache;
|
|
|
+
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private WindpowerstationPGService windpowerstationPGService;
|
|
|
+
|
|
|
+
|
|
|
+ public List<EBAPerSisVo> getElePerAnalysisList(String companyid, String regionid, String station, Date beginDate, Date endDate) throws Exception {
|
|
|
+
|
|
|
+ if(endDate.getTime()>new Date().getTime()){
|
|
|
+ endDate = new Date();
|
|
|
+ }
|
|
|
+
|
|
|
+ Calendar calendar = Calendar.getInstance();
|
|
|
+ calendar.setTime(endDate);
|
|
|
+ calendar.add(Calendar.SECOND, -2);
|
|
|
+ long newend = calendar.getTimeInMillis() / 1000;
|
|
|
+ List<EBAPerSisVo> vos = new ArrayList<>();
|
|
|
+
|
|
|
+ List<WindpowerstationPG> list = windpowerstationPGService.findWindpowerstationPG(companyid, regionid, station);
|
|
|
+ for (WindpowerstationPG wp : list) {
|
|
|
+ EBAPerSisVo vo = new EBAPerSisVo();
|
|
|
+ String wpString = JSONObject.toJSONString(globalCache.get(wp.getId()));
|
|
|
+ Map<String, Windpowerstationpointnew> stringMapMap = JSONObject.parseObject(wpString, new TypeReference<Map<String, Windpowerstationpointnew>>() {
|
|
|
+ });
|
|
|
+
|
|
|
+ String[] points = {stringMapMap.get("YPJFS").getCode(),
|
|
|
+ stringMapMap.get("YFDL").getCode(),
|
|
|
+ stringMapMap.get("GZSSDL").getCode(),
|
|
|
+ stringMapMap.get("WHSSDL").getCode(),
|
|
|
+ stringMapMap.get("XNSSDL").getCode(),
|
|
|
+ stringMapMap.get("XDSSDL").getCode(),
|
|
|
+ stringMapMap.get("SLSSDL").getCode(),
|
|
|
+ stringMapMap.get("YPJFS").getCode() };
|
|
|
+
|
|
|
+ DNAVal[] jkvalues = realApiUtil.getHistMatrix(points, newend);
|
|
|
+ vo.setStation(wp.getId());
|
|
|
+ vo.setName(wp.getName());
|
|
|
+ vo.setFs(jkvalues[0].DValue);
|
|
|
+ vo.setFdl(jkvalues[1].DValue);
|
|
|
+ vo.setGzssdl(jkvalues[2].DValue);//故障损失电量
|
|
|
+ vo.setWhssdl(jkvalues[3].DValue); //维护损失电量
|
|
|
+ vo.setXnssdl(jkvalues[4].DValue); //性能损失电量
|
|
|
+ vo.setXdssdl(jkvalues[5].DValue); //限电损失电量
|
|
|
+ vo.setSlssdl(jkvalues[6].DValue);//受累损失电量
|
|
|
+ vo.setFnlyl(jkvalues[7].DValue);//风能利用率
|
|
|
+ vos.add(vo);
|
|
|
+ }
|
|
|
+
|
|
|
+ return vos;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|