|
@@ -5,11 +5,7 @@ import com.gyee.frame.common.spring.InitialRunner;
|
|
|
import com.gyee.frame.model.auto.*;
|
|
|
import com.gyee.frame.model.custom.*;
|
|
|
import com.gyee.frame.service.*;
|
|
|
-import com.gyee.frame.util.DateUtils;
|
|
|
-import com.gyee.frame.util.IRealTimeDataBaseUtil;
|
|
|
-import com.gyee.frame.util.MathUtil;
|
|
|
-import com.gyee.frame.util.StringUtils;
|
|
|
-import com.gyee.frame.util.golden.EdosUtil;
|
|
|
+import com.gyee.frame.util.*;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
@@ -48,7 +44,7 @@ public class HealthSubService {
|
|
|
private final int digit = 2;
|
|
|
private final double NUM = 3.6;
|
|
|
private final double XZNUM = 1.25;
|
|
|
- IRealTimeDataBaseUtil realApiUtil = new EdosUtil();
|
|
|
+ IRealTimeDataBaseUtil realApiUtil = RealTimeDataBaseFactory.createRealTimeDataBase();
|
|
|
/*********************************************风机明细页面******************************************************/
|
|
|
|
|
|
/**
|
|
@@ -787,7 +783,7 @@ public class HealthSubService {
|
|
|
zzstrs[1] = "液压";
|
|
|
phstrs[1] = "偏航";
|
|
|
jcstrs[1] = "机舱";
|
|
|
- bpqstrs[1] ="变桨";
|
|
|
+ bpqstrs[1] ="变频器";
|
|
|
|
|
|
|
|
|
if (StringUtils.notEmp(wtId)) {
|
|
@@ -1229,4 +1225,738 @@ public class HealthSubService {
|
|
|
|
|
|
return mapstatus;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /************************************************************风机健康状态列表***********************************************************************/
|
|
|
+ public ActivityVo getWTChart(String wtId) throws Exception {
|
|
|
+ ActivityVo vo = new ActivityVo();
|
|
|
+ List<DatasetsVo> datasets = new ArrayList<DatasetsVo>();
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ SimpleDateFormat sdfs = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
+ Date currentDate = DateUtils.now();
|
|
|
+ Date endDate = sdfs.parse(sdf.format(DateUtils.addDays(currentDate, 1)) + " 00:00:00");
|
|
|
+ Date beginDate = sdfs.parse(sdf.format(currentDate) + " 00:00:00");
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ WindTurbineTestingPointAi2 clx = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wtId, Constant.CLXJKZT);
|
|
|
+ WindTurbineTestingPointAi2 fdj = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wtId, Constant.FDJJKZT);
|
|
|
+ WindTurbineTestingPointAi2 bj = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wtId, Constant.BJJKZT);
|
|
|
+ WindTurbineTestingPointAi2 zk = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wtId, Constant.ZKJKZT);
|
|
|
+
|
|
|
+
|
|
|
+ if (null != clx) {
|
|
|
+ List<PointData> clxls = realApiUtil.getHistoryDatasSnap(clx, beginDate.getTime() / 1000,
|
|
|
+ endDate.getTime() / 1000, (long) 96, 900L);
|
|
|
+ List<Long> xData = new ArrayList<Long>();
|
|
|
+ List<Double> data = new ArrayList<Double>();
|
|
|
+ DatasetsVo dvo = new DatasetsVo();
|
|
|
+ dvo.setUnit("");
|
|
|
+ dvo.setName("齿轮箱");
|
|
|
+ dvo.setType("line");
|
|
|
+ dvo.setValueDecimals(2);
|
|
|
+ datasets.add(dvo);
|
|
|
+ for (int i = 0; i < clxls.size(); i++) {
|
|
|
+
|
|
|
+ xData.add(clxls.get(i).getPointTime() * 1000);
|
|
|
+ // data.add(clxls.get(i).getPointValueInDouble());
|
|
|
+
|
|
|
+ if (clxls.get(i).getPointTime() * 1000 <= DateUtils.now().getTime()) {
|
|
|
+ data.add(StringUtils.round(clxls.get(i).getPointValueInDouble(), 2));
|
|
|
+ // data.add(clxls.get(i).getPointValueInDouble());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ dvo.setData(data);
|
|
|
+ vo.setxData(xData);
|
|
|
+ }
|
|
|
+ if (null != fdj) {
|
|
|
+ List<PointData> fdjls = realApiUtil.getHistoryDatasSnap(fdj, beginDate.getTime() / 1000,
|
|
|
+ endDate.getTime() / 1000, (long) 96, 900L);
|
|
|
+
|
|
|
+ List<Long> xData = new ArrayList<Long>();
|
|
|
+ List<Double> data = new ArrayList<Double>();
|
|
|
+
|
|
|
+ DatasetsVo dvo = new DatasetsVo();
|
|
|
+ dvo.setUnit("");
|
|
|
+ dvo.setName("发电机");
|
|
|
+ dvo.setType("line");
|
|
|
+ dvo.setValueDecimals(2);
|
|
|
+ datasets.add(dvo);
|
|
|
+ for (int i = 0; i < fdjls.size(); i++) {
|
|
|
+
|
|
|
+ xData.add(fdjls.get(i).getPointTime() * 1000);
|
|
|
+
|
|
|
+ System.out.println(DateUtils.format(new Date(fdjls.get(i).getPointTime() * 1000)));
|
|
|
+ if (fdjls.get(i).getPointTime() * 1000 <= DateUtils.now().getTime()) {
|
|
|
+ data.add(StringUtils.round(fdjls.get(i).getPointValueInDouble(), 2));
|
|
|
+ // data.add(fdjls.get(i).getPointValueInDouble());
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ dvo.setData(data);
|
|
|
+ vo.setxData(xData);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (null != bj) {
|
|
|
+ List<PointData> kzysls = realApiUtil.getHistoryDatasSnap(bj, beginDate.getTime() / 1000,
|
|
|
+ endDate.getTime() / 1000, (long) 96, 900L);
|
|
|
+
|
|
|
+ List<Long> xData = new ArrayList<Long>();
|
|
|
+ List<Double> data = new ArrayList<Double>();
|
|
|
+
|
|
|
+ DatasetsVo dvo = new DatasetsVo();
|
|
|
+ dvo.setUnit("");
|
|
|
+ dvo.setName("变桨系统");
|
|
|
+ dvo.setType("line");
|
|
|
+ dvo.setValueDecimals(2);
|
|
|
+ datasets.add(dvo);
|
|
|
+ for (int i = 0; i < kzysls.size(); i++) {
|
|
|
+
|
|
|
+ xData.add(kzysls.get(i).getPointTime() * 1000);
|
|
|
+ // data.add(kzysls.get(i).getPointValueInDouble());
|
|
|
+ if (kzysls.get(i).getPointTime() * 1000 <= DateUtils.now().getTime()) {
|
|
|
+ data.add(StringUtils.round(kzysls.get(i).getPointValueInDouble(), 2));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ dvo.setData(data);
|
|
|
+ vo.setxData(xData);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (null != zk) {
|
|
|
+ List<PointData> jcxtls = realApiUtil.getHistoryDatasSnap(zk, beginDate.getTime() / 1000,
|
|
|
+ endDate.getTime() / 1000, (long) 96, 900L);
|
|
|
+
|
|
|
+ List<Long> xData = new ArrayList<Long>();
|
|
|
+ List<Double> data = new ArrayList<Double>();
|
|
|
+ DatasetsVo dvo = new DatasetsVo();
|
|
|
+ dvo.setUnit("");
|
|
|
+ dvo.setName("主控系统");
|
|
|
+ dvo.setType("line");
|
|
|
+ dvo.setValueDecimals(2);
|
|
|
+ datasets.add(dvo);
|
|
|
+ for (int i = 0; i < jcxtls.size(); i++) {
|
|
|
+
|
|
|
+ xData.add(jcxtls.get(i).getPointTime() * 1000);
|
|
|
+ // data.add(jcxtls.get(i).getPointValueInDouble());
|
|
|
+ if (jcxtls.get(i).getPointTime() * 1000 <= DateUtils.now().getTime()) {
|
|
|
+ data.add(StringUtils.round(jcxtls.get(i).getPointValueInDouble(), 2));
|
|
|
+ // data.add(jcxtls.get(i).getPointValueInDouble());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ dvo.setData(data);
|
|
|
+ vo.setxData(xData);
|
|
|
+ }
|
|
|
+ vo.setDatasets(datasets);
|
|
|
+ return vo;
|
|
|
+ }
|
|
|
+
|
|
|
+/************************************************************齿轮箱健康状态列表***********************************************************************/
|
|
|
+ /**
|
|
|
+ * 齿轮箱系统图表
|
|
|
+ *
|
|
|
+ * @param wtId
|
|
|
+ * @return
|
|
|
+ * @throws Exception
|
|
|
+ */
|
|
|
+ public ActivityVo getClxChart(String wtId) throws Exception {
|
|
|
+ ActivityVo vo = new ActivityVo();
|
|
|
+ List<DatasetsVo> datasets = new ArrayList<DatasetsVo>();
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ SimpleDateFormat sdfs = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
+ Date currentDate = DateUtils.now();
|
|
|
+ Date endDate = sdfs.parse(sdf.format(DateUtils.addDays(currentDate, 1)) + " 00:00:00");
|
|
|
+ Date beginDate = sdfs.parse(sdf.format(currentDate) + " 00:00:00");
|
|
|
+
|
|
|
+ WindTurbineTestingPointAi2 clxsrzc = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wtId, "AI038");
|
|
|
+ WindTurbineTestingPointAi2 clxsczc = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wtId, "AI039");
|
|
|
+ WindTurbineTestingPointAi2 clxrkyw = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wtId, "AI040");
|
|
|
+ WindTurbineTestingPointAi2 clxyw = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wtId, "AI041");
|
|
|
+
|
|
|
+
|
|
|
+ if (null != clxsrzc && StringUtils.notEmp(clxsrzc.getId())) {
|
|
|
+ List<PointData> clxsrzcls = realApiUtil.getHistoryDatasSnap(clxsrzc, beginDate.getTime() / 1000,
|
|
|
+ endDate.getTime() / 1000, (long) 96, 900L);
|
|
|
+ if (!clxsrzcls.isEmpty()) {
|
|
|
+ List<Long> xData = new ArrayList<Long>();
|
|
|
+ List<Double> data = new ArrayList<Double>();
|
|
|
+ DatasetsVo dvo = new DatasetsVo();
|
|
|
+ dvo.setUnit("");
|
|
|
+ dvo.setName("齿轮箱输入轴油温(最大值95,最小值0)");
|
|
|
+ dvo.setType("line");
|
|
|
+ dvo.setValueDecimals(2);
|
|
|
+ datasets.add(dvo);
|
|
|
+ for (int i = 0; i < clxsrzcls.size(); i++) {
|
|
|
+
|
|
|
+ xData.add(clxsrzcls.get(i).getPointTime() * 1000);
|
|
|
+ // data.add(clxls.get(i).getPointValueInDouble());
|
|
|
+
|
|
|
+ if (clxsrzcls.get(i).getPointTime() * 1000 <= DateUtils.now().getTime()) {
|
|
|
+ data.add(MathUtil.twoBit(clxsrzcls.get(i).getPointValueInDouble()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ dvo.setData(data);
|
|
|
+ vo.setxData(xData);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ if (null != clxsczc && StringUtils.notEmp(clxsczc.getId())) {
|
|
|
+ List<PointData> clxsczcls = realApiUtil.getHistoryDatasSnap(clxsczc, beginDate.getTime() / 1000,
|
|
|
+ endDate.getTime() / 1000, (long) 96, 900L);
|
|
|
+ if (!clxsczcls.isEmpty()) {
|
|
|
+ List<Long> xData = new ArrayList<Long>();
|
|
|
+ List<Double> data = new ArrayList<Double>();
|
|
|
+
|
|
|
+ DatasetsVo dvo = new DatasetsVo();
|
|
|
+ dvo.setUnit("");
|
|
|
+ dvo.setName("齿轮箱输出轴油温(最大值95,最小值0)");
|
|
|
+ dvo.setType("line");
|
|
|
+ dvo.setValueDecimals(2);
|
|
|
+ datasets.add(dvo);
|
|
|
+ for (int i = 0; i < clxsczcls.size(); i++) {
|
|
|
+
|
|
|
+ xData.add(clxsczcls.get(i).getPointTime() * 1000);
|
|
|
+
|
|
|
+ // System.out.println(DateUtils.toDate1(new
|
|
|
+ // Date(fdjls.get(i).getPointTime() * 1000)));
|
|
|
+ if (clxsczcls.get(i).getPointTime() * 1000 <= DateUtils.now().getTime()) {
|
|
|
+ data.add(MathUtil.twoBit(clxsczcls.get(i).getPointValueInDouble()));
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ dvo.setData(data);
|
|
|
+ vo.setxData(xData);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ if (null != clxrkyw && StringUtils.notEmp(clxrkyw.getId())) {
|
|
|
+ List<PointData> clxrkywls = realApiUtil.getHistoryDatasSnap(clxrkyw, beginDate.getTime() / 1000,
|
|
|
+ endDate.getTime() / 1000, (long) 96, 900L);
|
|
|
+
|
|
|
+ if (!clxrkywls.isEmpty()) {
|
|
|
+ List<Long> xData = new ArrayList<Long>();
|
|
|
+ List<Double> data = new ArrayList<Double>();
|
|
|
+
|
|
|
+ DatasetsVo dvo = new DatasetsVo();
|
|
|
+ dvo.setUnit("");
|
|
|
+ dvo.setName("齿轮箱入口油温(最大值80,最小值0)");
|
|
|
+ dvo.setType("line");
|
|
|
+ dvo.setValueDecimals(2);
|
|
|
+ datasets.add(dvo);
|
|
|
+ for (int i = 0; i < clxrkywls.size(); i++) {
|
|
|
+
|
|
|
+ xData.add(clxrkywls.get(i).getPointTime() * 1000);
|
|
|
+ // data.add(kzysls.get(i).getPointValueInDouble());
|
|
|
+ if (clxrkywls.get(i).getPointTime() * 1000 <= DateUtils.now().getTime()) {
|
|
|
+ data.add(MathUtil.twoBit(clxrkywls.get(i).getPointValueInDouble()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ dvo.setData(data);
|
|
|
+ vo.setxData(xData);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ if (null != clxyw && StringUtils.notEmp(clxyw.getId())) {
|
|
|
+ List<PointData> clxywls = realApiUtil.getHistoryDatasSnap(clxyw, beginDate.getTime() / 1000,
|
|
|
+ endDate.getTime() / 1000, (long) 96, 900L);
|
|
|
+ if (!clxywls.isEmpty()) {
|
|
|
+ List<Long> xData = new ArrayList<Long>();
|
|
|
+ List<Double> data = new ArrayList<Double>();
|
|
|
+
|
|
|
+ DatasetsVo dvo = new DatasetsVo();
|
|
|
+ dvo.setUnit("");
|
|
|
+ dvo.setName("齿轮箱油温(最大值80,最佳范围最大值76,最佳范围最小值14,最小值10)");
|
|
|
+ dvo.setType("line");
|
|
|
+ dvo.setValueDecimals(2);
|
|
|
+ datasets.add(dvo);
|
|
|
+ for (int i = 0; i < clxywls.size(); i++) {
|
|
|
+
|
|
|
+ xData.add(clxywls.get(i).getPointTime() * 1000);
|
|
|
+ // data.add(kzysls.get(i).getPointValueInDouble());
|
|
|
+ if (clxywls.get(i).getPointTime() * 1000 <= DateUtils.now().getTime()) {
|
|
|
+ data.add(MathUtil.twoBit(clxywls.get(i).getPointValueInDouble()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ dvo.setData(data);
|
|
|
+ vo.setxData(xData);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ vo.setDatasets(datasets);
|
|
|
+ return vo;
|
|
|
+ }
|
|
|
+/************************************************************发电机健康状态列表***********************************************************************/
|
|
|
+ /**
|
|
|
+ * 发电机系统图表
|
|
|
+ *
|
|
|
+ * @param wtId
|
|
|
+ * @return
|
|
|
+ * @throws Exception
|
|
|
+ */
|
|
|
+ public ActivityVo getFdjChart(String wtId) throws Exception {
|
|
|
+ ActivityVo vo = new ActivityVo();
|
|
|
+ List<DatasetsVo> datasets = new ArrayList<DatasetsVo>();
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ SimpleDateFormat sdfs = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
+ Date currentDate = DateUtils.now();
|
|
|
+ Date endDate = sdfs.parse(sdf.format(DateUtils.addDays(currentDate, 1)) + " 00:00:00");
|
|
|
+ Date beginDate = sdfs.parse(sdf.format(currentDate) + " 00:00:00");
|
|
|
+
|
|
|
+
|
|
|
+ WindTurbineTestingPointAi2 fdjzca = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wtId, "AI052");
|
|
|
+ WindTurbineTestingPointAi2 fdjzcb = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wtId, "AI053");
|
|
|
+ WindTurbineTestingPointAi2 fdjrzu = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wtId, "AI045");
|
|
|
+ WindTurbineTestingPointAi2 fdjrzv = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wtId, "AI047");
|
|
|
+ WindTurbineTestingPointAi2 fdjrzw = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wtId, "AI049");
|
|
|
+ WindTurbineTestingPointAi2 fdjlqf = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wtId, "AI054");
|
|
|
+
|
|
|
+
|
|
|
+ if (null != fdjzca && StringUtils.notEmp(fdjzca.getId())) {
|
|
|
+ List<PointData> fdjzcals = realApiUtil.getHistoryDatasSnap(fdjzca, beginDate.getTime() / 1000,
|
|
|
+ endDate.getTime() / 1000, (long) 96, 900L);
|
|
|
+ if (!fdjzcals.isEmpty()) {
|
|
|
+ List<Long> xData = new ArrayList<Long>();
|
|
|
+ List<Double> data = new ArrayList<Double>();
|
|
|
+ DatasetsVo dvo = new DatasetsVo();
|
|
|
+ dvo.setUnit("");
|
|
|
+ dvo.setName("发电机轴承a温度(最大值95,最小值0)");
|
|
|
+ dvo.setType("line");
|
|
|
+ dvo.setValueDecimals(2);
|
|
|
+ datasets.add(dvo);
|
|
|
+ for (int i = 0; i < fdjzcals.size(); i++) {
|
|
|
+
|
|
|
+ xData.add(fdjzcals.get(i).getPointTime() * 1000);
|
|
|
+ // data.add(clxls.get(i).getPointValueInDouble());
|
|
|
+
|
|
|
+ if (fdjzcals.get(i).getPointTime() * 1000 <= DateUtils.now().getTime()) {
|
|
|
+ data.add(MathUtil.twoBit(fdjzcals.get(i).getPointValueInDouble()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ dvo.setData(data);
|
|
|
+ vo.setxData(xData);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ if (null != fdjzcb && StringUtils.notEmp(fdjzcb.getId())) {
|
|
|
+ List<PointData> fdjzcbls = realApiUtil.getHistoryDatasSnap(fdjzcb, beginDate.getTime() / 1000,
|
|
|
+ endDate.getTime() / 1000, (long) 96, 900L);
|
|
|
+ if (!fdjzcbls.isEmpty()) {
|
|
|
+
|
|
|
+ List<Long> xData = new ArrayList<Long>();
|
|
|
+ List<Double> data = new ArrayList<Double>();
|
|
|
+
|
|
|
+ DatasetsVo dvo = new DatasetsVo();
|
|
|
+ dvo.setUnit("");
|
|
|
+ dvo.setName("发电机轴承b温度(最大值95,最小值0)");
|
|
|
+ dvo.setType("line");
|
|
|
+ dvo.setValueDecimals(2);
|
|
|
+ datasets.add(dvo);
|
|
|
+ for (int i = 0; i < fdjzcbls.size(); i++) {
|
|
|
+
|
|
|
+ xData.add(fdjzcbls.get(i).getPointTime() * 1000);
|
|
|
+
|
|
|
+ // System.out.println(DateUtils.toDate1(new
|
|
|
+ // Date(fdjls.get(i).getPointTime() * 1000)));
|
|
|
+ if (fdjzcbls.get(i).getPointTime() * 1000 <= DateUtils.now().getTime()) {
|
|
|
+ data.add(MathUtil.twoBit(fdjzcbls.get(i).getPointValueInDouble()));
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ dvo.setData(data);
|
|
|
+ vo.setxData(xData);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (null != fdjrzu && StringUtils.notEmp(fdjrzu.getId())) {
|
|
|
+ List<PointData> fdjrzuls = realApiUtil.getHistoryDatasSnap(fdjrzu, beginDate.getTime() / 1000,
|
|
|
+ endDate.getTime() / 1000, (long) 96, 900L);
|
|
|
+ if (!fdjrzuls.isEmpty()) {
|
|
|
+ List<Long> xData = new ArrayList<Long>();
|
|
|
+ List<Double> data = new ArrayList<Double>();
|
|
|
+
|
|
|
+ DatasetsVo dvo = new DatasetsVo();
|
|
|
+ dvo.setUnit("");
|
|
|
+ dvo.setName("发电机u项绕组温度(最大值150,最小值0)");
|
|
|
+ dvo.setType("line");
|
|
|
+ dvo.setValueDecimals(2);
|
|
|
+ datasets.add(dvo);
|
|
|
+ for (int i = 0; i < fdjrzuls.size(); i++) {
|
|
|
+
|
|
|
+ xData.add(fdjrzuls.get(i).getPointTime() * 1000);
|
|
|
+ // data.add(kzysls.get(i).getPointValueInDouble());
|
|
|
+ if (fdjrzuls.get(i).getPointTime() * 1000 <= DateUtils.now().getTime()) {
|
|
|
+ data.add(MathUtil.twoBit(fdjrzuls.get(i).getPointValueInDouble()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ dvo.setData(data);
|
|
|
+ vo.setxData(xData);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ if (null != fdjrzv && StringUtils.notEmp(fdjrzv.getId())) {
|
|
|
+ List<PointData> fdjrzvls = realApiUtil.getHistoryDatasSnap(fdjrzv, beginDate.getTime() / 1000,
|
|
|
+ endDate.getTime() / 1000, (long) 96, 900L);
|
|
|
+ if (!fdjrzvls.isEmpty()) {
|
|
|
+ List<Long> xData = new ArrayList<Long>();
|
|
|
+ List<Double> data = new ArrayList<Double>();
|
|
|
+ DatasetsVo dvo = new DatasetsVo();
|
|
|
+ dvo.setUnit("");
|
|
|
+ dvo.setName("发电机v项绕组温度(最大值150,最小值0)");
|
|
|
+ dvo.setType("line");
|
|
|
+ dvo.setValueDecimals(2);
|
|
|
+ datasets.add(dvo);
|
|
|
+ for (int i = 0; i < fdjrzvls.size(); i++) {
|
|
|
+
|
|
|
+ xData.add(fdjrzvls.get(i).getPointTime() * 1000);
|
|
|
+ // data.add(jcxtls.get(i).getPointValueInDouble());
|
|
|
+ if (fdjrzvls.get(i).getPointTime() * 1000 <= DateUtils.now().getTime()) {
|
|
|
+ data.add(MathUtil.twoBit(fdjrzvls.get(i).getPointValueInDouble()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ dvo.setData(data);
|
|
|
+ vo.setxData(xData);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ if (null != fdjrzw && StringUtils.notEmp(fdjrzw.getId())) {
|
|
|
+ List<PointData> fdjrzwls = realApiUtil.getHistoryDatasSnap(fdjrzw, beginDate.getTime() / 1000,
|
|
|
+ endDate.getTime() / 1000, (long) 96, 900L);
|
|
|
+ if (!fdjrzwls.isEmpty()) {
|
|
|
+ List<Long> xData = new ArrayList<Long>();
|
|
|
+ List<Double> data = new ArrayList<Double>();
|
|
|
+
|
|
|
+ DatasetsVo dvo = new DatasetsVo();
|
|
|
+ dvo.setUnit("");
|
|
|
+ dvo.setName("发电机w项绕组温度(最大值150,最小值0)");
|
|
|
+ dvo.setType("line");
|
|
|
+ dvo.setValueDecimals(2);
|
|
|
+ datasets.add(dvo);
|
|
|
+ for (int i = 0; i < fdjrzwls.size(); i++) {
|
|
|
+
|
|
|
+ xData.add(fdjrzwls.get(i).getPointTime() * 1000);
|
|
|
+ // data.add(kzysls.get(i).getPointValueInDouble());
|
|
|
+ if (fdjrzwls.get(i).getPointTime() * 1000 <= DateUtils.now().getTime()) {
|
|
|
+ data.add(MathUtil.twoBit(fdjrzwls.get(i).getPointValueInDouble()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ dvo.setData(data);
|
|
|
+ vo.setxData(xData);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ if (null != fdjlqf && StringUtils.notEmp(fdjlqf.getId())) {
|
|
|
+ List<PointData> fdjlqfls = realApiUtil.getHistoryDatasSnap(fdjlqf, beginDate.getTime() / 1000,
|
|
|
+ endDate.getTime() / 1000, (long) 96, 900L);
|
|
|
+ if (!fdjlqfls.isEmpty()) {
|
|
|
+ List<Long> xData = new ArrayList<Long>();
|
|
|
+ List<Double> data = new ArrayList<Double>();
|
|
|
+ DatasetsVo dvo = new DatasetsVo();
|
|
|
+ dvo.setUnit("");
|
|
|
+ dvo.setName("发电机冷却风温度(最大值70,最小值0)");
|
|
|
+ dvo.setType("line");
|
|
|
+ dvo.setValueDecimals(2);
|
|
|
+ datasets.add(dvo);
|
|
|
+ for (int i = 0; i < fdjlqfls.size(); i++) {
|
|
|
+
|
|
|
+ xData.add(fdjlqfls.get(i).getPointTime() * 1000);
|
|
|
+ // data.add(jcxtls.get(i).getPointValueInDouble());
|
|
|
+ if (fdjlqfls.get(i).getPointTime() * 1000 <= DateUtils.now().getTime()) {
|
|
|
+ data.add(MathUtil.twoBit(fdjlqfls.get(i).getPointValueInDouble()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ dvo.setData(data);
|
|
|
+ vo.setxData(xData);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ vo.setDatasets(datasets);
|
|
|
+ return vo;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+/************************************************************变桨健康状态列表***********************************************************************/
|
|
|
+ /**
|
|
|
+ * 变桨系统图表
|
|
|
+ *
|
|
|
+ * @param wtId
|
|
|
+ * @return
|
|
|
+ * @throws Exception
|
|
|
+ */
|
|
|
+ public ActivityVo getKzysChart(String wtId) throws Exception {
|
|
|
+ ActivityVo vo = new ActivityVo();
|
|
|
+ List<DatasetsVo> datasets = new ArrayList<DatasetsVo>();
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ SimpleDateFormat sdfs = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
+ Date currentDate = DateUtils.now();
|
|
|
+ Date endDate = sdfs.parse(sdf.format(DateUtils.addDays(currentDate, 1)) + " 00:00:00");
|
|
|
+ Date beginDate = sdfs.parse(sdf.format(currentDate) + " 00:00:00");
|
|
|
+
|
|
|
+ WindTurbineTestingPointAi2 bjdrqwd = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wtId, "AI113");
|
|
|
+ WindTurbineTestingPointAi2 bjdrqdy = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wtId, "AI236");
|
|
|
+ WindTurbineTestingPointAi2 bjblwd = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wtId, "AI239");
|
|
|
+ WindTurbineTestingPointAi2 bjdjwd = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wtId, "AI103");
|
|
|
+ WindTurbineTestingPointAi2 bjkzgwd = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wtId, "AI233");
|
|
|
+
|
|
|
+
|
|
|
+ if (null != bjdrqwd && StringUtils.notEmp(bjdrqwd.getId())) {
|
|
|
+ List<PointData> bjdrqwdls = realApiUtil.getHistoryDatasSnap(bjdrqwd, beginDate.getTime() / 1000,
|
|
|
+ endDate.getTime() / 1000, (long) 96, 900L);
|
|
|
+ if (!bjdrqwdls.isEmpty()) {
|
|
|
+ List<Long> xData = new ArrayList<Long>();
|
|
|
+ List<Double> data = new ArrayList<Double>();
|
|
|
+ DatasetsVo dvo = new DatasetsVo();
|
|
|
+ dvo.setUnit("");
|
|
|
+ dvo.setName("变桨电容器温度(最大值65,最小值0)");
|
|
|
+ dvo.setType("line");
|
|
|
+ dvo.setValueDecimals(2);
|
|
|
+ datasets.add(dvo);
|
|
|
+ for (int i = 0; i < bjdrqwdls.size(); i++) {
|
|
|
+
|
|
|
+ xData.add(bjdrqwdls.get(i).getPointTime() * 1000);
|
|
|
+ // data.add(clxls.get(i).getPointValueInDouble());
|
|
|
+
|
|
|
+ if (bjdrqwdls.get(i).getPointTime() * 1000 <= DateUtils.now().getTime()) {
|
|
|
+ data.add(MathUtil.twoBit(bjdrqwdls.get(i).getPointValueInDouble()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ dvo.setData(data);
|
|
|
+ vo.setxData(xData);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ if (null != bjdrqdy && StringUtils.notEmp(bjdrqdy.getId())) {
|
|
|
+ List<PointData> bjdrqdyls = realApiUtil.getHistoryDatasSnap(bjdrqdy, beginDate.getTime() / 1000,
|
|
|
+ endDate.getTime() / 1000, (long) 96, 900L);
|
|
|
+ if (!bjdrqdyls.isEmpty()) {
|
|
|
+ List<Long> xData = new ArrayList<Long>();
|
|
|
+ List<Double> data = new ArrayList<Double>();
|
|
|
+
|
|
|
+ DatasetsVo dvo = new DatasetsVo();
|
|
|
+ dvo.setUnit("");
|
|
|
+ dvo.setName("变桨电容电压(最大值63,最佳范围最大值60,最佳范围最小值56,最小值53)");
|
|
|
+ dvo.setType("line");
|
|
|
+ dvo.setValueDecimals(2);
|
|
|
+ datasets.add(dvo);
|
|
|
+ for (int i = 0; i < bjdrqdyls.size(); i++) {
|
|
|
+
|
|
|
+ xData.add(bjdrqdyls.get(i).getPointTime() * 1000);
|
|
|
+
|
|
|
+ // System.out.println(DateUtils.toDate1(new
|
|
|
+ // Date(fdjls.get(i).getPointTime() * 1000)));
|
|
|
+ if (bjdrqdyls.get(i).getPointTime() * 1000 <= DateUtils.now().getTime()) {
|
|
|
+ data.add(MathUtil.twoBit(bjdrqdyls.get(i).getPointValueInDouble()));
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ dvo.setData(data);
|
|
|
+ vo.setxData(xData);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ if (null != bjblwd && StringUtils.notEmp(bjblwd.getId())) {
|
|
|
+ List<PointData> bjblwdls = realApiUtil.getHistoryDatasSnap(bjblwd, beginDate.getTime() / 1000,
|
|
|
+ endDate.getTime() / 1000, (long) 96, 900L);
|
|
|
+ if (!bjblwdls.isEmpty()) {
|
|
|
+ List<Long> xData = new ArrayList<Long>();
|
|
|
+ List<Double> data = new ArrayList<Double>();
|
|
|
+
|
|
|
+ DatasetsVo dvo = new DatasetsVo();
|
|
|
+ dvo.setUnit("");
|
|
|
+ dvo.setName("变桨变流器温度(最大值75,最小值0)");
|
|
|
+ dvo.setType("line");
|
|
|
+ dvo.setValueDecimals(2);
|
|
|
+ datasets.add(dvo);
|
|
|
+ for (int i = 0; i < bjblwdls.size(); i++) {
|
|
|
+
|
|
|
+ xData.add(bjblwdls.get(i).getPointTime() * 1000);
|
|
|
+ // data.add(kzysls.get(i).getPointValueInDouble());
|
|
|
+ if (bjblwdls.get(i).getPointTime() * 1000 <= DateUtils.now().getTime()) {
|
|
|
+ data.add(MathUtil.twoBit(bjblwdls.get(i).getPointValueInDouble()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ dvo.setData(data);
|
|
|
+ vo.setxData(xData);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ if (null != bjdjwd && StringUtils.notEmp(bjdjwd.getId())) {
|
|
|
+ List<PointData> bjdjwdls = realApiUtil.getHistoryDatasSnap(bjdjwd, beginDate.getTime() / 1000,
|
|
|
+ endDate.getTime() / 1000, (long) 96, 900L);
|
|
|
+ if (!bjdjwdls.isEmpty()) {
|
|
|
+ List<Long> xData = new ArrayList<Long>();
|
|
|
+ List<Double> data = new ArrayList<Double>();
|
|
|
+ DatasetsVo dvo = new DatasetsVo();
|
|
|
+ dvo.setUnit("");
|
|
|
+ dvo.setName("变桨电机温度(最大值135,最小值0)");
|
|
|
+ dvo.setType("line");
|
|
|
+ dvo.setValueDecimals(2);
|
|
|
+ datasets.add(dvo);
|
|
|
+ for (int i = 0; i < bjdjwdls.size(); i++) {
|
|
|
+
|
|
|
+ xData.add(bjdjwdls.get(i).getPointTime() * 1000);
|
|
|
+ // data.add(jcxtls.get(i).getPointValueInDouble());
|
|
|
+ if (bjdjwdls.get(i).getPointTime() * 1000 <= DateUtils.now().getTime()) {
|
|
|
+ data.add(MathUtil.twoBit(bjdjwdls.get(i).getPointValueInDouble()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ dvo.setData(data);
|
|
|
+ vo.setxData(xData);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ if (null != bjkzgwd && StringUtils.notEmp(bjkzgwd.getId())) {
|
|
|
+ List<PointData> bjkzgwdls = realApiUtil.getHistoryDatasSnap(bjkzgwd, beginDate.getTime() / 1000,
|
|
|
+ endDate.getTime() / 1000, (long) 96, 900L);
|
|
|
+ if (!bjkzgwdls.isEmpty()) {
|
|
|
+ List<Long> xData = new ArrayList<Long>();
|
|
|
+ List<Double> data = new ArrayList<Double>();
|
|
|
+ DatasetsVo dvo = new DatasetsVo();
|
|
|
+ dvo.setUnit("");
|
|
|
+ dvo.setName("变桨控制柜温度(最大值65,最小值0)");
|
|
|
+ dvo.setType("line");
|
|
|
+ dvo.setValueDecimals(2);
|
|
|
+ datasets.add(dvo);
|
|
|
+ for (int i = 0; i < bjkzgwdls.size(); i++) {
|
|
|
+
|
|
|
+ xData.add(bjkzgwdls.get(i).getPointTime() * 1000);
|
|
|
+ // data.add(jcxtls.get(i).getPointValueInDouble());
|
|
|
+ if (bjkzgwdls.get(i).getPointTime() * 1000 <= DateUtils.now().getTime()) {
|
|
|
+ data.add(MathUtil.twoBit(bjkzgwdls.get(i).getPointValueInDouble()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ dvo.setData(data);
|
|
|
+ vo.setxData(xData);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ vo.setDatasets(datasets);
|
|
|
+ return vo;
|
|
|
+ }
|
|
|
+/************************************************************主控健康状态列表***********************************************************************/
|
|
|
+ /**
|
|
|
+ * 主控系统图表
|
|
|
+ *
|
|
|
+ * @param wtId
|
|
|
+ * @return
|
|
|
+ * @throws Exception
|
|
|
+ */
|
|
|
+ public ActivityVo getJcxtChart(String wtId) throws Exception {
|
|
|
+ ActivityVo vo = new ActivityVo();
|
|
|
+ List<DatasetsVo> datasets = new ArrayList<DatasetsVo>();
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ SimpleDateFormat sdfs = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
+ Date currentDate = DateUtils.now();
|
|
|
+ Date endDate = sdfs.parse(sdf.format(DateUtils.addDays(currentDate, 1)) + " 00:00:00");
|
|
|
+ Date beginDate = sdfs.parse(sdf.format(currentDate) + " 00:00:00");
|
|
|
+
|
|
|
+
|
|
|
+ WindTurbineTestingPointAi2 tdgwd = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wtId, "AI069");
|
|
|
+ WindTurbineTestingPointAi2 tdkzgwd = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wtId, "AI070");
|
|
|
+
|
|
|
+
|
|
|
+ if (null != tdgwd && StringUtils.notEmp(tdgwd.getId())) {
|
|
|
+ List<PointData> tdgwdls = realApiUtil.getHistoryDatasSnap(tdgwd, beginDate.getTime() / 1000,
|
|
|
+ endDate.getTime() / 1000, (long) 96, 900L);
|
|
|
+ if (!tdgwdls.isEmpty()) {
|
|
|
+ List<Long> xData = new ArrayList<Long>();
|
|
|
+ List<Double> data = new ArrayList<Double>();
|
|
|
+ DatasetsVo dvo = new DatasetsVo();
|
|
|
+ dvo.setUnit("");
|
|
|
+ dvo.setName("塔底柜温度(最大值50,最小值0)");
|
|
|
+ dvo.setType("line");
|
|
|
+ dvo.setValueDecimals(2);
|
|
|
+ datasets.add(dvo);
|
|
|
+ for (int i = 0; i < tdgwdls.size(); i++) {
|
|
|
+
|
|
|
+ xData.add(tdgwdls.get(i).getPointTime() * 1000);
|
|
|
+ // data.add(clxls.get(i).getPointValueInDouble());
|
|
|
+
|
|
|
+ if (tdgwdls.get(i).getPointTime() * 1000 <= DateUtils.now().getTime()) {
|
|
|
+ data.add(MathUtil.twoBit(tdgwdls.get(i).getPointValueInDouble()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ dvo.setData(data);
|
|
|
+ vo.setxData(xData);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ if (null != tdkzgwd && StringUtils.notEmp(tdkzgwd.getId())) {
|
|
|
+ List<PointData> tdkzgwdls = realApiUtil.getHistoryDatasSnap(tdkzgwd, beginDate.getTime() / 1000,
|
|
|
+ endDate.getTime() / 1000, (long) 96, 900L);
|
|
|
+ if (!tdkzgwdls.isEmpty()) {
|
|
|
+ List<Long> xData = new ArrayList<Long>();
|
|
|
+ List<Double> data = new ArrayList<Double>();
|
|
|
+
|
|
|
+ DatasetsVo dvo = new DatasetsVo();
|
|
|
+ dvo.setUnit("");
|
|
|
+ dvo.setName("塔顶机舱柜温度(最大值75,最小值0)");
|
|
|
+ dvo.setType("line");
|
|
|
+ dvo.setValueDecimals(2);
|
|
|
+ datasets.add(dvo);
|
|
|
+ for (int i = 0; i < tdkzgwdls.size(); i++) {
|
|
|
+
|
|
|
+ xData.add(tdkzgwdls.get(i).getPointTime() * 1000);
|
|
|
+
|
|
|
+ // System.out.println(DateUtils.toDate1(new
|
|
|
+ // Date(fdjls.get(i).getPointTime() * 1000)));
|
|
|
+ if (tdkzgwdls.get(i).getPointTime() * 1000 <= DateUtils.now().getTime()) {
|
|
|
+ data.add(MathUtil.twoBit(tdkzgwdls.get(i).getPointValueInDouble()));
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ dvo.setData(data);
|
|
|
+ vo.setxData(xData);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ vo.setDatasets(datasets);
|
|
|
+ return vo;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public Double getrealValue(String wtId, String type) {
|
|
|
+
|
|
|
+
|
|
|
+ String pointid = null;
|
|
|
+ if (type.equals("1")) {
|
|
|
+ WindTurbineTestingPointAi2 pointAi2 = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wtId, "JKZT001");
|
|
|
+ pointid = pointAi2.getId();
|
|
|
+ } else if (type.equals("2")) {
|
|
|
+ WindTurbineTestingPointAi2 pointAi2 = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wtId, "JKZT002");
|
|
|
+ pointid = pointAi2.getId();
|
|
|
+ } else if (type.equals("3")) {
|
|
|
+ WindTurbineTestingPointAi2 pointAi2 = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wtId, "JKZT003");
|
|
|
+ pointid = pointAi2.getId();
|
|
|
+ } else if (type.equals("4")) {
|
|
|
+ WindTurbineTestingPointAi2 pointAi2 = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wtId, "JKZT004");
|
|
|
+ pointid = pointAi2.getId();
|
|
|
+ } else if (type.equals("5")) {
|
|
|
+ WindTurbineTestingPointAi2 pointAi2 = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wtId, "JKZT005");
|
|
|
+ pointid =pointAi2.getId();
|
|
|
+ }
|
|
|
+
|
|
|
+ try {
|
|
|
+
|
|
|
+ PointData vo = realApiUtil.getRealData(pointid);
|
|
|
+
|
|
|
+ return vo.getPointValueInDouble();
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+
|
|
|
+ }
|
|
|
+ return 0.0;
|
|
|
+ }
|
|
|
}
|