|
@@ -1,6 +1,9 @@
|
|
|
package com.gyee.runeconomy.service.goodness;
|
|
|
|
|
|
+import cn.hutool.core.date.DateUtil;
|
|
|
+import cn.hutool.core.util.NumberUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.gyee.common.contant.ContantXk;
|
|
|
import com.gyee.common.model.PointData;
|
|
@@ -13,6 +16,7 @@ import com.gyee.runeconomy.init.CacheContext;
|
|
|
import com.gyee.runeconomy.model.auto.*;
|
|
|
import com.gyee.runeconomy.service.auto.IProEconEquipmentInfoDay6Service;
|
|
|
import com.gyee.runeconomy.service.auto.IProEconWindturbineGoodnessService;
|
|
|
+import com.gyee.runeconomy.service.auto.ITurbineInfoMinService;
|
|
|
import com.gyee.runeconomy.util.DateUtils;
|
|
|
import com.gyee.runeconomy.util.StringUtils;
|
|
|
import com.gyee.runeconomy.util.realtimesource.IEdosUtil;
|
|
@@ -40,6 +44,9 @@ public class WindturbinegoodnessService {
|
|
|
@Resource
|
|
|
private IEdosUtil edosUtil;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private ITurbineInfoMinService iTurbineInfoMinService;
|
|
|
+
|
|
|
public Page<ProEconWindturbineGoodness> windturbinegoodnessList(Integer pageNum, Integer pageSize, String cmId, String type, String wpId, String recorddate) {
|
|
|
|
|
|
if (StringUtils.empty(pageNum)) {
|
|
@@ -552,7 +559,7 @@ public class WindturbinegoodnessService {
|
|
|
return String.valueOf(temp);
|
|
|
}
|
|
|
|
|
|
- public List<DataVo> findRealPowerCharBy24(String wtId, Date recorddate) throws Exception {
|
|
|
+ public List<DataVo> findRealPowerCharBy24bak(String wtId, Date recorddate) throws Exception {
|
|
|
List<DataVo> vos = new ArrayList<DataVo>();
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
SimpleDateFormat sdfs = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
@@ -876,6 +883,127 @@ public class WindturbinegoodnessService {
|
|
|
return vos;
|
|
|
}
|
|
|
|
|
|
+ public List<DataVo> findRealPowerCharBy24(String wtId, Date recorddate) throws Exception {
|
|
|
+ List<DataVo> vos = new ArrayList<DataVo>();
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ SimpleDateFormat sdfs = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
+
|
|
|
+ Date endDate = sdfs.parse(sdf.format(DateUtils.addDays(recorddate, 1)) + " 00:0:00");
|
|
|
+ Date beginDate = sdfs.parse(sdf.format(recorddate) + " 00:00:00");
|
|
|
+
|
|
|
+ int length = 24;
|
|
|
+ for (int i = 0; i < length; i++) {
|
|
|
+ DataVo vo = new DataVo();
|
|
|
+
|
|
|
+ vo.setValue1(0.0);// scada发电量
|
|
|
+ vo.setValue2(0.0);// 维护损失
|
|
|
+ vo.setValue3(0.0);// 故障损失
|
|
|
+ vo.setValue4(0.0);// 限电损失
|
|
|
+ vo.setValue5(0.0);// 欠发损失
|
|
|
+ vo.setValue6(0.0);// 风速
|
|
|
+
|
|
|
+ vos.add(vo);
|
|
|
+ }
|
|
|
+ Map<String, ProBasicEquipmentPoint> wtpointmap = CacheContext.wtpAimap.get(wtId);
|
|
|
+
|
|
|
+
|
|
|
+ ProBasicEquipmentPoint fdl = wtpointmap.get(ContantXk.RFDL);
|
|
|
+ ProBasicEquipmentPoint fs = wtpointmap.get(ContantXk.CJ_SSFS);
|
|
|
+
|
|
|
+ try {
|
|
|
+ if (null != fdl) {
|
|
|
+ List<PointData> fdlls = edosUtil.getHistoryDatasSnap(fdl, beginDate.getTime() / 1000, endDate.getTime() / 1000, (long) length, 3600L);
|
|
|
+ int count = 0;
|
|
|
+ double temp1 = 0;
|
|
|
+ for (int i = 0; i < length; i++) {
|
|
|
+
|
|
|
+ if (i < fdlls.size() && StringUtils.notEmp(fdlls.get(i + 1).getPointTime())) {
|
|
|
+
|
|
|
+ vos.get(i).setTime(fdlls.get(i + 1).getPointTime());
|
|
|
+ if (vos.get(i).getTime() <= DateUtils.now().getTime()) {
|
|
|
+
|
|
|
+ if (i != 0) {
|
|
|
+ temp1 = fdlls.get(i + 1).getPointValueInDouble();
|
|
|
+ double temp2 = fdlls.get(i).getPointValueInDouble();
|
|
|
+ temp1 = temp1 - temp2;
|
|
|
+ vos.get(i).setValue1(StringUtils.round(temp1 * 1000, 2));// 发电量
|
|
|
+
|
|
|
+ } else {
|
|
|
+ temp1 = fdlls.get(i + 1).getPointValueInDouble();
|
|
|
+ vos.get(i).setValue1(StringUtils.round(temp1 * 1000, 2));// 发电量
|
|
|
+ }
|
|
|
+ count++;
|
|
|
+ } else {
|
|
|
+ vos.get(i).setTime(fdlls.get(i).getPointTime());
|
|
|
+ vos.get(i).setValue1(0d);// 发电量
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ // TODO: handle exception
|
|
|
+ }
|
|
|
+ /*
|
|
|
+ * 维护损失
|
|
|
+ */
|
|
|
+ try {
|
|
|
+ QueryWrapper<TurbineInfoMin> qw = new QueryWrapper<>();
|
|
|
+ qw.lambda().eq(TurbineInfoMin::getTurbineId, wtId)
|
|
|
+ .between(TurbineInfoMin::getRecordDate, beginDate, endDate)
|
|
|
+ .isNotNull(TurbineInfoMin::getGzss)
|
|
|
+ .orderByAsc(TurbineInfoMin::getRecordDate);
|
|
|
+ List<TurbineInfoMin> turbineMins = iTurbineInfoMinService.list(qw);
|
|
|
+ for (int i = 0; i < length; i++) {
|
|
|
+ if (i < turbineMins.size()) {
|
|
|
+ TurbineInfoMin tm = turbineMins.get(i);
|
|
|
+ Date recordDate = tm.getRecordDate();
|
|
|
+ int hour = DateUtil.hour(recordDate, true);
|
|
|
+ if (i == hour) {
|
|
|
+ vos.get(i).setValue2(NumberUtil.round(tm.getJhjxss() + tm.getFjhjxss(), 2).doubleValue());
|
|
|
+ vos.get(i).setValue3(NumberUtil.round(tm.getGzss(), 2).doubleValue());
|
|
|
+ vos.get(i).setValue4(NumberUtil.round(tm.getXdss(), 2).doubleValue());
|
|
|
+ vos.get(i).setValue4(NumberUtil.round(tm.getXnss(), 2).doubleValue());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ // TODO: handle exception
|
|
|
+ }
|
|
|
+ /*
|
|
|
+ * 风速
|
|
|
+ */
|
|
|
+ try {
|
|
|
+ if (null != fs) {
|
|
|
+ List<PointData> fsls = edosUtil.getHistoryDatasSnap(fs, beginDate.getTime() / 1000, endDate.getTime() / 1000, (long) length, 3600L);
|
|
|
+
|
|
|
+ int count = 0;
|
|
|
+ double temp1 = 0;
|
|
|
+ for (int i = 0; i < 24; i++) {
|
|
|
+
|
|
|
+ if (i < fsls.size() && StringUtils.notEmp(fsls.get(i + 1).getPointTime())) {
|
|
|
+
|
|
|
+ vos.get(i).setTime(fsls.get(i + 1).getPointTime());
|
|
|
+ if (vos.get(i).getTime() <= DateUtils.now().getTime()) {
|
|
|
+
|
|
|
+ temp1 = fsls.get(i + 1).getPointValueInDouble();
|
|
|
+ vos.get(i).setValue6(StringUtils.round(temp1, 2));// 风速
|
|
|
+ count++;
|
|
|
+
|
|
|
+ } else {
|
|
|
+ vos.get(i).setValue6(0d);// 风速
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ // TODO: handle exception
|
|
|
+ }
|
|
|
+
|
|
|
+ return vos;
|
|
|
+ }
|
|
|
+
|
|
|
public List<PvVo> pvgoodness(String companys, String wpid, String recorddate, String target, String sort) {
|
|
|
|
|
|
Map<String, ProEconEquipmentmodel> modelMap = CacheContext.modelMap;
|