|
@@ -6,17 +6,13 @@ import com.gyee.frame.model.auto.WindPowerStationTestingPoint2;
|
|
|
import com.gyee.frame.model.auto.Windpowerstation;
|
|
|
import com.gyee.frame.model.custom.PointData;
|
|
|
import com.gyee.frame.model.enumeration.Messagetype;
|
|
|
-import com.gyee.frame.netty.websocket.util.SocketToolController;
|
|
|
import com.gyee.frame.netty.websocket.util.SocketToolService;
|
|
|
import com.gyee.frame.util.DateUtils;
|
|
|
import com.gyee.frame.util.golden.EdosUtil;
|
|
|
import com.gyee.frame.util.golden.IEdosUtil;
|
|
|
-import com.gyee.frame.util.mongodb.IMongodbUtil;
|
|
|
-import com.gyee.frame.util.mongodb.MongodbUtilImpl;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
-import javax.swing.text.html.parser.Entity;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.math.RoundingMode;
|
|
|
import java.text.SimpleDateFormat;
|
|
@@ -159,4 +155,48 @@ public class Windspeedpowercurvedetail extends SocketToolService {
|
|
|
}
|
|
|
this.pushToWeb("pageNumber_7","functionNumber_4",windpowerstationpointDataMap, Messagetype.MESSAGE);
|
|
|
}
|
|
|
+ public <T> void windpowerstationdetail_sevendaycolumn_target() throws Exception {
|
|
|
+ Map<String, Map<String, WindPowerStationTestingPoint2>> stationPointmap = InitialRunner.stationPointmap;
|
|
|
+ String rfdl = Constant.TPOINT_WP_RFDL;
|
|
|
+ List<Windpowerstation> wpls = new ArrayList<>();
|
|
|
+ for (Windpowerstation wp : InitialRunner.wpls) {
|
|
|
+ wpls.add(wp);
|
|
|
+ }
|
|
|
+ Windpowerstation windpowerstationAll = new Windpowerstation();
|
|
|
+ windpowerstationAll.setId("0");
|
|
|
+ wpls.add(windpowerstationAll);
|
|
|
+ Map<String, Map<String,List<PointData>>> windpowerstationpointDataMap = new HashMap();
|
|
|
+
|
|
|
+ IEdosUtil mongodb = new EdosUtil();
|
|
|
+ for (Windpowerstation windpowerstation : wpls) {
|
|
|
+ Map<String,List<PointData>> map = new HashMap<>();
|
|
|
+ windpowerstationpointDataMap.put(windpowerstation.getId(),map);
|
|
|
+ List<PointData> listPointData = new ArrayList<>();
|
|
|
+
|
|
|
+ try {
|
|
|
+ //发电量柱状图,发电量
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH");
|
|
|
+ Date nowTime = DateUtils.getNowDate();
|
|
|
+ Date endTime = sdf.parse(sdf.format(nowTime));
|
|
|
+ SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ Date beginTime = DateUtils.addDays(endTime, -7);
|
|
|
+ WindPowerStationTestingPoint2 point = stationPointmap.get(windpowerstation.getId()).get(rfdl);
|
|
|
+ listPointData = mongodb.getHistoryDatasSnap(point,
|
|
|
+ beginTime.getTime() / 1000, endTime.getTime() / 1000 + 3600L*24,
|
|
|
+ 8L, 3600 * 24L);
|
|
|
+ for (int i = 0; i < listPointData.size(); i++) {
|
|
|
+ listPointData.get(i).setPointTime(listPointData.get(i).getPointTime() - 24 * 3600);
|
|
|
+ listPointData.get(i).setPointValueInDouble(this.decimal(2,listPointData.get(i).getPointValueInDouble()));
|
|
|
+ }
|
|
|
+
|
|
|
+ if(listPointData.size()>0) {
|
|
|
+ listPointData.remove(0);
|
|
|
+ }
|
|
|
+ map.put("rfdl",listPointData);
|
|
|
+ } catch (Exception e) {
|
|
|
+ System.out.println(e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.pushToWeb("pageNumber_7","functionNumber_5",windpowerstationpointDataMap, Messagetype.MESSAGE);
|
|
|
+ }
|
|
|
}
|