|
@@ -9,6 +9,7 @@ import com.gyee.runeconomy.model.auto.*;
|
|
|
import com.gyee.runeconomy.service.auto.IProBasicEquipmentPointService;
|
|
|
import com.gyee.runeconomy.service.auto.IProBasicPowerstationPointService;
|
|
|
import com.gyee.runeconomy.service.auto.IProBasicProjectPlanService;
|
|
|
+import com.gyee.runeconomy.util.DateUtils;
|
|
|
import com.gyee.runeconomy.util.MathUtil;
|
|
|
import com.gyee.runeconomy.util.StringUtils;
|
|
|
import com.gyee.runeconomy.util.realtimesource.IEdosUtil;
|
|
@@ -1362,24 +1363,32 @@ public class MonitorService {
|
|
|
//利用小时
|
|
|
public List<PowercurveVo> hoursvalue(String wpId, String timetype) throws Exception {
|
|
|
|
|
|
-// Date year = com.gyee.common.util.DateUtils.getYearFirstZero(); //当年第一天0点
|
|
|
-// Integer endDate = com.gyee.common.util.DateUtils.getCurrentYear(); //当前时间
|
|
|
-//
|
|
|
-// Calendar cal = Calendar.getInstance();
|
|
|
-// cal.setTime(new Date());
|
|
|
-// Integer year = cal.get(Calendar.YEAR) - 2;
|
|
|
-// Integer month = cal.get(Calendar.MONTH) + 1;
|
|
|
|
|
|
- SimpleDateFormat format = new SimpleDateFormat("yyyy");
|
|
|
+ Calendar twoyear = Calendar.getInstance();
|
|
|
+ twoyear.add(Calendar.YEAR, -2);
|
|
|
+ Date twoDate = twoyear.getTime();
|
|
|
+// Date beginDate = DateUtils.truncate(beginDate1);
|
|
|
|
|
|
- Calendar cal = Calendar.getInstance();
|
|
|
- cal.add(Calendar.YEAR, -2);
|
|
|
- Date beginDate = cal.getTime();
|
|
|
+ Calendar oneyear = Calendar.getInstance();
|
|
|
+ oneyear.add(Calendar.YEAR, -1);
|
|
|
+ Date oneDate = oneyear.getTime();
|
|
|
+
|
|
|
+ Calendar currentyear = Calendar.getInstance();
|
|
|
+ currentyear.add(Calendar.YEAR, 1);
|
|
|
+ Date currentDate = currentyear.getTime();
|
|
|
|
|
|
- Calendar call = Calendar.getInstance();
|
|
|
- cal.add(Calendar.YEAR, 1);
|
|
|
+ Calendar twomonth = Calendar.getInstance();
|
|
|
+ twomonth.add(Calendar.MONTH, -2);
|
|
|
+ Date twoDatemonth = twomonth.getTime();
|
|
|
+
|
|
|
+ Calendar onemonth = Calendar.getInstance();
|
|
|
+ onemonth.add(Calendar.MONTH, -1);
|
|
|
+ Date oneDatemonth = onemonth.getTime();
|
|
|
+
|
|
|
+ Calendar currentmonth = Calendar.getInstance();
|
|
|
+ currentmonth.add(Calendar.MONTH, 1);
|
|
|
+ Date currentDatemonth = currentmonth.getTime();
|
|
|
|
|
|
- Date endDate = call.getTime();
|
|
|
|
|
|
double zjrl = 0.0;
|
|
|
|
|
@@ -1432,10 +1441,12 @@ public class MonitorService {
|
|
|
zjrlmap.put("zjrl", zjrl);
|
|
|
|
|
|
|
|
|
- for (int i = 0; i < 24; i++) {
|
|
|
+ for (int i = 0; i < 3; i++) {
|
|
|
PowercurveVo vo = new PowercurveVo();
|
|
|
vo.setLlgl(0.0); //理论功率
|
|
|
vo.setRfdl(0.0); //日发电量
|
|
|
+ vo.setYfdl(0.0); //月发电量
|
|
|
+ vo.setNfdl(0.0); //年发电量
|
|
|
vo.setBzgl(0.0); //保证功率
|
|
|
vo.setSjgl(0.0); //实际功率
|
|
|
vo.setSsfs(0.0); //实时风速
|
|
@@ -1446,16 +1457,71 @@ public class MonitorService {
|
|
|
vos.add(vo);
|
|
|
}
|
|
|
|
|
|
- ProBasicPowerstationPoint rfdl = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.RFDL);
|
|
|
+
|
|
|
+ Map<String, Map<String, ProBasicPowerstationPoint>> pointwpmap = CacheContext.pointwpmap;
|
|
|
+ Map<String, ProBasicPowerstationPoint> wtpointmap = pointwpmap.get(wpId);
|
|
|
+
|
|
|
+ List<String> year = new ArrayList<>();
|
|
|
+ year.add(wtpointmap.get(ContantXk.NFDL).getNemCode());
|
|
|
+ List<String> month = new ArrayList<>();
|
|
|
+ month.add(wtpointmap.get(ContantXk.YFDL).getNemCode());
|
|
|
|
|
|
if (timetype.contains("year")) {
|
|
|
|
|
|
- List<PointData> rfdlls = edosUtil.getHistoryDatasSnap(rfdl, beginDate.getTime() / 1000, endDate.getTime() / 1000, null, 3600L);
|
|
|
+ List<PointData> currentls = edosUtil.getHistMatrix(year, currentDate.getTime() / 1000);
|
|
|
+ List<PointData> onels = edosUtil.getHistMatrix(year, oneDate.getTime() / 1000);
|
|
|
+ List<PointData> twols = edosUtil.getHistMatrix(year, twoDate.getTime() / 1000);
|
|
|
+
|
|
|
+ List<PointData> sj = new ArrayList<>();
|
|
|
+ if(!currentls.isEmpty() && !onels.isEmpty() && !twols.isEmpty())
|
|
|
+ {
|
|
|
+ sj.add(currentls.get(0));
|
|
|
+ sj.add(onels.get(0));
|
|
|
+ sj.add(twols.get(0));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ double temp0 = 0;
|
|
|
+ double temp1 = 0;
|
|
|
+ double temp2 = 0;
|
|
|
+
|
|
|
+ if (!sj.isEmpty() && sj.size()==3) {
|
|
|
+ temp0 = sj.get(0).getPointValueInDouble();
|
|
|
+ temp1 = sj.get(1).getPointValueInDouble();
|
|
|
+ temp2 = sj.get(2).getPointValueInDouble();
|
|
|
+ vos.get(0).setNfdl(StringUtils.round(temp0 / zjrl, 2));
|
|
|
+ vos.get(1).setNfdl(StringUtils.round(temp1 / zjrl, 2));
|
|
|
+ vos.get(2).setNfdl(StringUtils.round(temp2 / zjrl, 2));
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ if (timetype.contains("month")) {
|
|
|
+
|
|
|
+ List<PointData> currentls = edosUtil.getHistMatrix(month, currentDatemonth.getTime() / 1000);
|
|
|
+ List<PointData> onels = edosUtil.getHistMatrix(month, oneDatemonth.getTime() / 1000);
|
|
|
+ List<PointData> twols = edosUtil.getHistMatrix(month, twoDatemonth.getTime() / 1000);
|
|
|
+
|
|
|
+ List<PointData> sj = new ArrayList<>();
|
|
|
+ if(!currentls.isEmpty() && !onels.isEmpty() && !twols.isEmpty())
|
|
|
+ {
|
|
|
+ sj.add(currentls.get(0));
|
|
|
+ sj.add(onels.get(0));
|
|
|
+ sj.add(twols.get(0));
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
+ double temp0 = 0;
|
|
|
double temp1 = 0;
|
|
|
- for (int i = 0; i < rfdlls.size(); i++) {
|
|
|
- temp1 = rfdlls.get(i).getPointValueInDouble();
|
|
|
- vos.get(i).setSjgl(StringUtils.round(temp1, 2));
|
|
|
+ double temp2 = 0;
|
|
|
+
|
|
|
+ if (!sj.isEmpty() && sj.size()==3) {
|
|
|
+ temp0 = sj.get(0).getPointValueInDouble();
|
|
|
+ temp1 = sj.get(1).getPointValueInDouble();
|
|
|
+ temp2 = sj.get(2).getPointValueInDouble();
|
|
|
+ vos.get(0).setYfdl(StringUtils.round(temp0 / zjrl, 2));
|
|
|
+ vos.get(1).setYfdl(StringUtils.round(temp1 / zjrl, 2));
|
|
|
+ vos.get(2).setYfdl(StringUtils.round(temp2 / zjrl, 2));
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -1464,6 +1530,13 @@ public class MonitorService {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ //计划电量
|
|
|
+ public List<PowercurveVo> planvalue(String wpId, String timetype) throws Exception {
|
|
|
+ return null;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/**********************************************计划电量统计**********************************************************/
|
|
|
private void setPlanInfoByType
|
|
|
(Map<String, Map<String, Double>> gxkmap, List<ProBasicProjectPlan> planls, String wpId) {
|