|
@@ -1,7 +1,10 @@
|
|
|
package com.gyee.frame.service.app.targetdetail;
|
|
|
|
|
|
+import com.gyee.frame.common.spring.Constant;
|
|
|
+import com.gyee.frame.common.spring.InitialRunner;
|
|
|
import com.gyee.frame.model.auto.Weatherfd;
|
|
|
import com.gyee.frame.model.auto.Weatherfh;
|
|
|
+import com.gyee.frame.model.auto.WindPowerStationTestingPoint2;
|
|
|
import com.gyee.frame.model.auto.Windpowerinfoday;
|
|
|
import com.gyee.frame.model.custom.PointData;
|
|
|
import com.gyee.frame.model.enumeration.Messagetype;
|
|
@@ -272,19 +275,44 @@ public class TargetdetailService extends SocketToolService {
|
|
|
}else if(pointid.indexOf("divq")!=-1)
|
|
|
{
|
|
|
pointid=pointid.substring(5);
|
|
|
- Long count = (endTime.getTime() - beginTime.getTime()) / 1000L / 3600L;
|
|
|
- List<PointData> ls = mongodb.getHistoryDatasSnap(pointid,
|
|
|
- beginTime.getTime() / 1000, endTime.getTime() / 1000 + 3600L,
|
|
|
- (long) count+1, 3600L);
|
|
|
- for (int i = 0; i < ls.size(); i++) {
|
|
|
- ls.get(i).setPointTime(ls.get(i).getPointTime() - 3600);
|
|
|
- double temp= new BigDecimal(ls.get(i).getPointValueInDouble()).divide(new BigDecimal(1000), 2, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
- ls.get(i).setPointValueInDouble(temp);
|
|
|
- }
|
|
|
- if(ls.size()>0) {
|
|
|
- ls.remove(0);
|
|
|
- }
|
|
|
- vos=ls;
|
|
|
+
|
|
|
+ if(pointid.equals("JSFW.NX_GD_XXX_XX_XX_XXX_XXX_CI0193"))
|
|
|
+ {
|
|
|
+ Long count = (endTime.getTime() - beginTime.getTime()) / 1000L / 3600L;
|
|
|
+ List<PointData> ls = mongodb.getHistoryDatasSnap(pointid,
|
|
|
+ beginTime.getTime() / 1000, endTime.getTime() / 1000 + 3600L,
|
|
|
+ (long) count+1, 3600L);
|
|
|
+ WindPowerStationTestingPoint2 gfsjglpoint= InitialRunner.stationPointmap.get("-2").get(Constant.TPOINT_WP_SJGL);
|
|
|
+ List<PointData> gfls = mongodb.getHistoryDatasSnap(gfsjglpoint,
|
|
|
+ beginTime.getTime() / 1000, endTime.getTime() / 1000 + 3600L,
|
|
|
+ (long) count+1, 3600L);
|
|
|
+ for (int i = 0; i < ls.size(); i++) {
|
|
|
+ ls.get(i).setPointTime(ls.get(i).getPointTime() - 3600);
|
|
|
+ double llgl=this.decimal(2,ls.get(i).getPointValueInDouble());
|
|
|
+ llgl= new BigDecimal(llgl).divide(new BigDecimal(1000), 2, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
+ ls.get(i).setPointValueInDouble(StringUtils.round(llgl+gfls.get(i).getPointValueInDouble(),2));
|
|
|
+ }
|
|
|
+ if(ls.size()>0) {
|
|
|
+ ls.remove(0);
|
|
|
+ }
|
|
|
+ vos=ls;
|
|
|
+ }else
|
|
|
+ {
|
|
|
+ Long count = (endTime.getTime() - beginTime.getTime()) / 1000L / 3600L;
|
|
|
+ List<PointData> ls = mongodb.getHistoryDatasSnap(pointid,
|
|
|
+ beginTime.getTime() / 1000, endTime.getTime() / 1000 + 3600L,
|
|
|
+ (long) count+1, 3600L);
|
|
|
+ for (int i = 0; i < ls.size(); i++) {
|
|
|
+ ls.get(i).setPointTime(ls.get(i).getPointTime() - 3600);
|
|
|
+ double temp= new BigDecimal(ls.get(i).getPointValueInDouble()).divide(new BigDecimal(1000), 2, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
+ ls.get(i).setPointValueInDouble(temp);
|
|
|
+ }
|
|
|
+ if(ls.size()>0) {
|
|
|
+ ls.remove(0);
|
|
|
+ }
|
|
|
+ vos=ls;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}else if(pointid.indexOf("divw")!=-1)
|
|
|
{
|
|
@@ -317,6 +345,7 @@ public class TargetdetailService extends SocketToolService {
|
|
|
ls.remove(0);
|
|
|
}
|
|
|
vos=ls;
|
|
|
+
|
|
|
}
|
|
|
return vos;
|
|
|
}
|
|
@@ -345,18 +374,42 @@ public class TargetdetailService extends SocketToolService {
|
|
|
}else if(pointid.indexOf("divq")!=-1)
|
|
|
{
|
|
|
pointid=pointid.substring(5);
|
|
|
- List<PointData> ls = mongodb.getHistoryDatasSnap(pointid,
|
|
|
- beginTime.getTime() / 1000, endTime.getTime() / 1000 + 3600L*24,
|
|
|
- 8L, 3600 * 24L);
|
|
|
- for (int i = 0; i < ls.size(); i++) {
|
|
|
- ls.get(i).setPointTime(ls.get(i).getPointTime() - 24 * 3600);
|
|
|
- double temp= new BigDecimal(ls.get(i).getPointValueInDouble()).divide(new BigDecimal(1000), 2, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
- ls.get(i).setPointValueInDouble(temp);
|
|
|
- }
|
|
|
- if(ls.size()>0) {
|
|
|
- ls.remove(0);
|
|
|
+
|
|
|
+ if(pointid.equals("JSFW.NX_GD_XXX_XX_XX_XXX_XXX_CI0193"))
|
|
|
+ {
|
|
|
+ Long count = (endTime.getTime() - beginTime.getTime()) / 1000L / 3600L;
|
|
|
+ List<PointData> ls = mongodb.getHistoryDatasSnap(pointid,
|
|
|
+ beginTime.getTime() / 1000, endTime.getTime() / 1000 + 3600L*24,
|
|
|
+ 8L, 3600 * 24L);
|
|
|
+ WindPowerStationTestingPoint2 gfsjglpoint= InitialRunner.stationPointmap.get("-2").get(Constant.TPOINT_WP_SJGL);
|
|
|
+ List<PointData> gfls = mongodb.getHistoryDatasSnap(gfsjglpoint,
|
|
|
+ beginTime.getTime() / 1000, endTime.getTime() / 1000 + 3600L*24,
|
|
|
+ 8L, 3600 * 24L);
|
|
|
+ for (int i = 0; i < ls.size(); i++) {
|
|
|
+ ls.get(i).setPointTime(ls.get(i).getPointTime() - 24*3600);
|
|
|
+ double llgl=this.decimal(2,ls.get(i).getPointValueInDouble());
|
|
|
+ llgl= new BigDecimal(llgl).divide(new BigDecimal(1000), 2, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
+ ls.get(i).setPointValueInDouble(StringUtils.round(llgl+gfls.get(i).getPointValueInDouble(),2));
|
|
|
+ }
|
|
|
+ if(ls.size()>0) {
|
|
|
+ ls.remove(0);
|
|
|
+ }
|
|
|
+ vos=ls;
|
|
|
+ }else {
|
|
|
+ List<PointData> ls = mongodb.getHistoryDatasSnap(pointid,
|
|
|
+ beginTime.getTime() / 1000, endTime.getTime() / 1000 + 3600L*24,
|
|
|
+ 8L, 3600 * 24L);
|
|
|
+ for (int i = 0; i < ls.size(); i++) {
|
|
|
+ ls.get(i).setPointTime(ls.get(i).getPointTime() - 24 * 3600);
|
|
|
+ double temp= new BigDecimal(ls.get(i).getPointValueInDouble()).divide(new BigDecimal(1000), 2, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
+ ls.get(i).setPointValueInDouble(temp);
|
|
|
+ }
|
|
|
+ if(ls.size()>0) {
|
|
|
+ ls.remove(0);
|
|
|
+ }
|
|
|
+ vos=ls;
|
|
|
}
|
|
|
- vos=ls;
|
|
|
+
|
|
|
|
|
|
}else if(pointid.indexOf("divw")!=-1)
|
|
|
{
|
|
@@ -387,6 +440,7 @@ public class TargetdetailService extends SocketToolService {
|
|
|
ls.remove(0);
|
|
|
}
|
|
|
vos=ls;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
return vos;
|