WindresourceanalysisService.java 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531
  1. package com.gyee.runeconomy.service.Windresourceanalysis;
  2. import com.gyee.common.contant.ContantXk;
  3. import com.gyee.common.model.PointData;
  4. import com.gyee.common.model.StringUtils;
  5. import com.gyee.common.util.DateUtils;
  6. import com.gyee.runeconomy.dto.DataVo;
  7. import com.gyee.runeconomy.dto.WindspeedVo;
  8. import com.gyee.runeconomy.dto.pewpVo;
  9. import com.gyee.runeconomy.dto.speed.PowerPointData;
  10. import com.gyee.runeconomy.dto.speed.WindDirectionALG;
  11. import com.gyee.runeconomy.init.CacheContext;
  12. import com.gyee.runeconomy.model.auto.ProBasicPowerstation;
  13. import com.gyee.runeconomy.model.auto.ProBasicPowerstationPoint;
  14. import com.gyee.runeconomy.model.auto.ProBasicWeatherStation;
  15. import com.gyee.runeconomy.service.auto.IProBasicPowerstationPointService;
  16. import com.gyee.runeconomy.service.auto.IProEconPowerstationInfoDay1Service;
  17. import com.gyee.runeconomy.util.realtimesource.IEdosUtil;
  18. import org.springframework.stereotype.Service;
  19. import javax.annotation.Resource;
  20. import java.math.BigDecimal;
  21. import java.math.RoundingMode;
  22. import java.text.SimpleDateFormat;
  23. import java.util.*;
  24. import java.util.stream.Collectors;
  25. @Service
  26. public class WindresourceanalysisService {
  27. @Resource
  28. private IProEconPowerstationInfoDay1Service proEconPowerstationInfoDay1Service;
  29. @Resource
  30. private IProBasicPowerstationPointService proBasicPowerstationPointService;
  31. @Resource
  32. private IEdosUtil edosUtil;
  33. public List<WindspeedVo> Comprehensive(String Data) throws Exception {
  34. List<ProBasicWeatherStation> wplsf = CacheContext.weawpls.stream().filter(w -> w.getWindpowerstationId().endsWith("FDC_STA")).collect(Collectors.toList());
  35. //转换时间为Date类型
  36. SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
  37. Date date = sdf.parse(Data);
  38. Calendar calendar = Calendar.getInstance();
  39. calendar.setTime(date);
  40. calendar.add(Calendar.DAY_OF_MONTH, -1);
  41. calendar.set(Calendar.HOUR_OF_DAY, 23);
  42. calendar.set(Calendar.MINUTE, 59);
  43. calendar.set(Calendar.SECOND, 59);
  44. Date startTime = calendar.getTime();
  45. Calendar calendar1 = Calendar.getInstance();
  46. calendar1.setTime(date);
  47. calendar1.set(Calendar.HOUR_OF_DAY, 23);
  48. calendar1.set(Calendar.MINUTE, 59);
  49. calendar1.set(Calendar.SECOND, 59);
  50. Date endTime = calendar1.getTime();
  51. ProBasicPowerstationPoint pjfs = null;
  52. ProBasicPowerstationPoint pjfx = null;
  53. List<WindspeedVo> vos = new ArrayList<>();
  54. for (ProBasicWeatherStation wp : wplsf) {
  55. if (wp.getId().contains("GJYF02") || wp.getId().contains("GJYF03") || wp.getId().contains("MLJ")) continue;
  56. pjfs = proBasicPowerstationPointService.getPowerstationPoint(wp.getWindpowerstationId(), ContantXk.SSPJFS);
  57. pjfx = proBasicPowerstationPointService.getPowerstationPoint(wp.getId(), ContantXk.FCCFTFX70);
  58. List<ProBasicPowerstation> collect = CacheContext.wplsf.stream().filter(c -> c.getId().equals(wp.getWindpowerstationId())).collect(Collectors.toList());
  59. WindspeedVo vo = new WindspeedVo();
  60. if (pjfs.getNemCode() != null && !pjfs.getNemCode().equals("INITIAL")) {
  61. List<PointData> maxs = edosUtil.getHistStat(pjfs, startTime.getTime() / 1000, endTime.getTime() / 1000, (long) 1, null, 0);
  62. List<PointData> mins = edosUtil.getHistStat(pjfs, startTime.getTime() / 1000, endTime.getTime() / 1000, (long) 1, null, 1);
  63. List<PointData> ave = edosUtil.getHistStat(pjfs, startTime.getTime() / 1000, endTime.getTime() / 1000, (long) 1, null, 2);
  64. double avenum = 0.0;
  65. double maxsnum = 0.0;
  66. double minsnum = 0.0;
  67. if (wp.getId().contains("NJLF01")) {
  68. // avenum = ave.get(0).getPointValueInDouble() / 10;
  69. // maxsnum = maxs.get(0).getPointValueInDouble() / 10;
  70. // minsnum = mins.get(0).getPointValueInDouble() /10;
  71. avenum = (ave != null && !ave.isEmpty()) ? ave.get(0).getPointValueInDouble() : 0.0;
  72. maxsnum = (maxs != null && !maxs.isEmpty()) ? maxs.get(0).getPointValueInDouble() : 0.0;
  73. minsnum = (mins != null && !mins.isEmpty()) ? mins.get(0).getPointValueInDouble() : 0.0;
  74. } else {
  75. avenum = (ave != null && !ave.isEmpty()) ? ave.get(0).getPointValueInDouble() : 0.0;
  76. maxsnum = (maxs != null && !maxs.isEmpty()) ? maxs.get(0).getPointValueInDouble() : 0.0;
  77. minsnum = (mins != null && !mins.isEmpty()) ? mins.get(0).getPointValueInDouble() : 0.0;
  78. }
  79. vo.setWpid(wp.getWindpowerstationId());
  80. vo.setName(collect.get(0).getName());
  81. vo.setPjfs(StringUtils.round(avenum, 2));
  82. vo.setZdfs(StringUtils.round(maxsnum, 2));
  83. vo.setZxfs(StringUtils.round(minsnum, 2));
  84. }
  85. if (pjfx.getNemCode() != null && !pjfs.getNemCode().equals("INITIAL")) {
  86. List<PointData> maxs = edosUtil.getHistStat(pjfx, startTime.getTime() / 1000, endTime.getTime() / 1000, (long) 1, null, 0);
  87. List<PointData> mins = edosUtil.getHistStat(pjfx, startTime.getTime() / 1000, endTime.getTime() / 1000, (long) 1, null, 1);
  88. List<PointData> ave = edosUtil.getHistStat(pjfx, startTime.getTime() / 1000, endTime.getTime() / 1000, (long) 1, null, 2);
  89. double avefx = 0.0;
  90. if (wp.getId().contains("NJLF01")) {
  91. avefx = (ave != null && !ave.isEmpty()) ? ave.get(0).getPointValueInDouble() / 10 : 0.0;
  92. }else {
  93. avefx = (ave != null && !ave.isEmpty()) ? ave.get(0).getPointValueInDouble(): 0.0;
  94. }
  95. vo.setPjfx(StringUtils.round(avefx, 2));
  96. vos.add(vo);
  97. }
  98. }
  99. return vos;
  100. }
  101. public List<pewpVo> gzComprehensive(String Data) throws Exception {
  102. List<ProBasicPowerstation> wplsg = CacheContext.wplsG;
  103. //转换时间为Date类型
  104. SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
  105. Date date = sdf.parse(Data);
  106. // Calendar calendar = Calendar.getInstance();
  107. // calendar.setTime(date);
  108. // calendar.set(Calendar.HOUR_OF_DAY, 0);
  109. // calendar.set(Calendar.MINUTE, 0);
  110. // calendar.set(Calendar.SECOND, 0);
  111. // Date startTime = calendar.getTime();
  112. Calendar calendar = Calendar.getInstance();
  113. calendar.setTime(date);
  114. calendar.add(Calendar.DAY_OF_MONTH, -1);
  115. calendar.set(Calendar.HOUR_OF_DAY, 23);
  116. calendar.set(Calendar.MINUTE, 59);
  117. calendar.set(Calendar.SECOND, 59);
  118. Date startTime = calendar.getTime();
  119. // calendar.set(Calendar.HOUR_OF_DAY, 23);
  120. // calendar.set(Calendar.MINUTE, 59);
  121. // calendar.set(Calendar.SECOND, 59);
  122. //
  123. // Date endTime = calendar.getTime();
  124. Calendar calendar1 = Calendar.getInstance();
  125. calendar1.setTime(date);
  126. calendar1.set(Calendar.HOUR_OF_DAY, 23);
  127. calendar1.set(Calendar.MINUTE, 59);
  128. calendar1.set(Calendar.SECOND, 59);
  129. Date endTime = calendar1.getTime();
  130. ProBasicPowerstationPoint pjfs = null;
  131. List<pewpVo> vos = new ArrayList<>();
  132. for (ProBasicPowerstation wp : wplsg) {
  133. pjfs = proBasicPowerstationPointService.getPowerstationPoint(wp.getId(), ContantXk.GCGZQD);
  134. if (pjfs != null) {
  135. List<PointData> pjfsls = edosUtil.getHistoryDatasRaw(pjfs.getNemCode(), startTime.getTime() / 1000, endTime.getTime() / 1000);
  136. if (pjfsls != null && !pjfsls.isEmpty()) {
  137. List<PointData> filterls = new ArrayList<>();
  138. for (PointData po : pjfsls) {
  139. if (po.getPointValueInDouble() > 10) {
  140. filterls.add(po);
  141. }
  142. }
  143. if (!filterls.isEmpty()) {
  144. Date beginTime1 = new Date(filterls.get(0).getPointTime());
  145. //获取最后一个元素
  146. Date endTime1 = new Date(filterls.get(filterls.size() - 1).getPointTime());
  147. //获取两个时间差
  148. double hours = DateUtils.hoursDiff(beginTime1, endTime1);
  149. DoubleSummaryStatistics summaryStatistics = filterls.stream().mapToDouble(PointData::getPointValueInDouble).summaryStatistics();
  150. double sum = filterls.stream()
  151. .mapToDouble(PointData::getPointValueInDouble)
  152. .sum();
  153. pewpVo vo = new pewpVo();
  154. vo.setWpid(wp.getId());
  155. vo.setName(wp.getName());
  156. //日最大辐照度
  157. vo.setZdfdz(StringUtils.round(summaryStatistics.getMax(), 2));
  158. vo.setRcsj(beginTime1);
  159. vo.setRlsj(endTime1);
  160. //持续
  161. vo.setCxsj(hours);
  162. vos.add(vo);
  163. //日最小风速
  164. // pewp.setRzxfs(StringUtils.round(summaryStatistics.getMin(), 2));
  165. double avg = StringUtils.round(summaryStatistics.getAverage(), 2);
  166. double result = new BigDecimal(avg * hours).divide(new BigDecimal(1000), 2, RoundingMode.HALF_EVEN).doubleValue();
  167. vo.setZfzd(StringUtils.round(result, 2));
  168. //日平均风速
  169. // pewp.setRpjfs(result);
  170. }
  171. }
  172. }
  173. }
  174. return vos;
  175. }
  176. public List<DataVo> GroupRealtimevalue(String wpid, String Data) throws Exception {
  177. List<DataVo> vos = new ArrayList<DataVo>();
  178. //转换时间为Date类型
  179. SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
  180. Date date = sdf.parse(Data);
  181. Calendar calendar = Calendar.getInstance();
  182. calendar.setTime(date);
  183. calendar.add(Calendar.DAY_OF_MONTH, -1);
  184. calendar.set(Calendar.HOUR_OF_DAY, 23);
  185. calendar.set(Calendar.MINUTE, 59);
  186. calendar.set(Calendar.SECOND, 59);
  187. Date startTime = calendar.getTime();
  188. // Calendar calendar1 = Calendar.getInstance();
  189. // calendar1.setTime(date);
  190. // calendar1.set(Calendar.HOUR_OF_DAY, 23);
  191. // calendar1.set(Calendar.MINUTE, 59);
  192. // calendar1.set(Calendar.SECOND, 59);
  193. //
  194. // Date endTime = calendar1.getTime();
  195. Calendar calendar1 = Calendar.getInstance();
  196. calendar1.setTime(date);
  197. // 获取当前日期
  198. Calendar today = Calendar.getInstance();
  199. today.set(Calendar.HOUR_OF_DAY, 0);
  200. today.set(Calendar.MINUTE, 0);
  201. today.set(Calendar.SECOND, 0);
  202. // 判断是否是当天
  203. if (calendar1.get(Calendar.YEAR) == today.get(Calendar.YEAR) &&
  204. calendar1.get(Calendar.DAY_OF_YEAR) == today.get(Calendar.DAY_OF_YEAR)) {
  205. // 当天,设置endTime为当前时间
  206. Date now = new Date();
  207. calendar1.setTime(now);
  208. } else {
  209. // 非当天,设置endTime为传入的date的23:59:59
  210. calendar1.set(Calendar.HOUR_OF_DAY, 23);
  211. calendar1.set(Calendar.MINUTE, 59);
  212. calendar1.set(Calendar.SECOND, 59);
  213. }
  214. Date endTime = calendar1.getTime();
  215. ProBasicPowerstationPoint gzzs = null;
  216. // List<ProBasicPowerstation> wplsG = CacheContext.wplsG.stream().filter(c->c.getOrderNum().equals(15)).collect(Collectors.toList());
  217. gzzs = proBasicPowerstationPointService.getPowerstationPoint(wpid, ContantXk.GCGZQD);
  218. List<PointData> gzzsls = edosUtil.getHistoryDatasRaw(gzzs.getNemCode(), startTime.getTime() / 1000, endTime.getTime() / 1000);
  219. double temp6 = 0;
  220. for (int i = 0; i < gzzsls.size(); i++) {
  221. DataVo vo = new DataVo();
  222. temp6 = gzzsls.get(i).getPointValueInDouble();
  223. vo.setValue6(com.gyee.runeconomy.util.StringUtils.round(temp6, 2));
  224. vo.setTime(gzzsls.get(i).getPointTime());
  225. vos.add(vo);
  226. }
  227. return vos;
  228. }
  229. public List<DataVo> fdGroupRealtimevalue(String wpid, String Data) throws Exception {
  230. List<DataVo> vos = new ArrayList<DataVo>();
  231. //转换时间为Date类型
  232. SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
  233. Date date = sdf.parse(Data);
  234. Calendar calendar = Calendar.getInstance();
  235. calendar.setTime(date);
  236. calendar.add(Calendar.DAY_OF_MONTH, -1);
  237. calendar.set(Calendar.HOUR_OF_DAY, 23);
  238. calendar.set(Calendar.MINUTE, 59);
  239. calendar.set(Calendar.SECOND, 59);
  240. Date startTime = calendar.getTime();
  241. // Calendar calendar1 = Calendar.getInstance();
  242. // calendar1.setTime(date);
  243. // calendar1.set(Calendar.HOUR_OF_DAY, 23);
  244. // calendar1.set(Calendar.MINUTE, 59);
  245. // calendar1.set(Calendar.SECOND, 59);
  246. //
  247. // Date endTime = calendar1.getTime();
  248. Calendar calendar1 = Calendar.getInstance();
  249. calendar1.setTime(date);
  250. // 获取当前日期
  251. Calendar today = Calendar.getInstance();
  252. today.set(Calendar.HOUR_OF_DAY, 0);
  253. today.set(Calendar.MINUTE, 0);
  254. today.set(Calendar.SECOND, 0);
  255. // 判断是否是当天
  256. if (calendar1.get(Calendar.YEAR) == today.get(Calendar.YEAR) &&
  257. calendar1.get(Calendar.DAY_OF_YEAR) == today.get(Calendar.DAY_OF_YEAR)) {
  258. // 当天,设置endTime为当前时间
  259. Date now = new Date();
  260. calendar1.setTime(now);
  261. } else {
  262. // 非当天,设置endTime为传入的date的23:59:59
  263. calendar1.set(Calendar.HOUR_OF_DAY, 23);
  264. calendar1.set(Calendar.MINUTE, 59);
  265. calendar1.set(Calendar.SECOND, 59);
  266. }
  267. Date endTime = calendar1.getTime();
  268. ProBasicPowerstationPoint gzzs = null;
  269. List<ProBasicWeatherStation> wplsf = null;
  270. List<ProBasicPowerstation> wplsf1 = null;
  271. if (wpid.contains("GJY_FDC")) {
  272. // wplsf = CacheContext.weawpls.stream().filter(w -> w.getWindpowerstationId().equals(wpid) && w.getId().contains("GJYF01")).collect(Collectors.toList());
  273. wplsf1 = CacheContext.wplsf.stream().filter(w->wpid.equals(w.getId())).collect(Collectors.toList());
  274. } else {
  275. wplsf = CacheContext.weawpls.stream().filter(w -> w.getWindpowerstationId().equals(wpid)).collect(Collectors.toList());
  276. }
  277. if (wpid.contains("GJY_FDC")) {
  278. gzzs = proBasicPowerstationPointService.getPowerstationPoint(wplsf1.get(0).getId(), ContantXk.SSPJFS);
  279. }else {
  280. gzzs = proBasicPowerstationPointService.getPowerstationPoint(wplsf.get(0).getWindpowerstationId(), ContantXk.SSPJFS);
  281. }
  282. // List<PointData> gzzsls = edosUtil.getHistoryDatasRaw(gzzs.getNemCode(), startTime.getTime() / 1000, endTime.getTime() / 1000);
  283. // List<PointData> gzzsls = edosUtil.getHistoryDatasSnap(gzzs, startTime.getTime() / 1000, endTime.getTime() / 1000, null, 900L);
  284. List<PointData> gzzsls = edosUtil.getHistoryDatasSnap(gzzs, startTime.getTime() / 1000, endTime.getTime() / 1000, null, 60L);
  285. double temp6 = 0;
  286. for (int i = 0; i < gzzsls.size(); i++) {
  287. DataVo vo = new DataVo();
  288. temp6 = gzzsls.get(i).getPointValueInDouble();
  289. vo.setValue6(StringUtils.round(temp6, 2));
  290. vo.setTime(gzzsls.get(i).getPointTime());
  291. vos.add(vo);
  292. }
  293. return vos;
  294. }
  295. /**
  296. * 风向玫瑰图\风向频率玫瑰图
  297. *
  298. * @param wpid 预处理数据的id
  299. * @param mode 0:单台风机 1:多台风机合并
  300. * @return
  301. */
  302. public Object fxRoses(String wpid, int mode, String Data) throws Exception {
  303. List<ProBasicWeatherStation> wplsf = CacheContext.weawpls.stream().filter(w -> w.getWindpowerstationId().equals(wpid)).collect(Collectors.toList());
  304. //转换时间为Date类型
  305. SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
  306. Date date = sdf.parse(Data);
  307. Calendar calendar = Calendar.getInstance();
  308. calendar.setTime(date);
  309. calendar.add(Calendar.DAY_OF_MONTH, -1);
  310. calendar.set(Calendar.HOUR_OF_DAY, 23);
  311. calendar.set(Calendar.MINUTE, 59);
  312. calendar.set(Calendar.SECOND, 59);
  313. Date startTime = calendar.getTime();
  314. Calendar calendar1 = Calendar.getInstance();
  315. calendar1.setTime(date);
  316. // 获取当前日期
  317. Calendar today = Calendar.getInstance();
  318. today.set(Calendar.HOUR_OF_DAY, 0);
  319. today.set(Calendar.MINUTE, 0);
  320. today.set(Calendar.SECOND, 0);
  321. // 判断是否是当天
  322. if (calendar1.get(Calendar.YEAR) == today.get(Calendar.YEAR) &&
  323. calendar1.get(Calendar.DAY_OF_YEAR) == today.get(Calendar.DAY_OF_YEAR)) {
  324. // 当天,设置endTime为当前时间
  325. Date now = new Date();
  326. calendar1.setTime(now);
  327. } else {
  328. // 非当天,设置endTime为传入的date的23:59:59
  329. calendar1.set(Calendar.HOUR_OF_DAY, 23);
  330. calendar1.set(Calendar.MINUTE, 59);
  331. calendar1.set(Calendar.SECOND, 59);
  332. }
  333. Date endTime = calendar1.getTime();
  334. ProBasicPowerstationPoint pjfs = null;
  335. ProBasicPowerstationPoint pjfx = null;
  336. List<WindspeedVo> vos = new ArrayList<>();
  337. for (ProBasicWeatherStation ww : wplsf) {
  338. if (ww.getId().contains("GJYF02")) continue;
  339. pjfs = proBasicPowerstationPointService.getPowerstationPoint(ww.getId(), ContantXk.FCCFTFS70);
  340. pjfx = proBasicPowerstationPointService.getPowerstationPoint(ww.getId(), ContantXk.FCCFTFX70);
  341. List<ProBasicPowerstation> collect = CacheContext.wplsf.stream().filter(c -> c.getId().equals(ww.getWindpowerstationId())).collect(Collectors.toList());
  342. if (pjfs.getNemCode() != null && !pjfs.getNemCode().equals("INITIAL")) {
  343. List<PointData> pjfsls = edosUtil.getHistoryDatasSnap(pjfs, startTime.getTime() / 1000, endTime.getTime() / 1000, null, 900L);
  344. List<PointData> pjfxls = edosUtil.getHistoryDatasSnap(pjfx, startTime.getTime() / 1000, endTime.getTime() / 1000, null, 900L);
  345. double temp1 = 0;
  346. for (int i = 0; i < pjfsls.size(); i++) {
  347. WindspeedVo vo = new WindspeedVo();
  348. temp1 = pjfsls.get(i).getPointValueInDouble();
  349. vo.setWpid(ww.getId());
  350. vo.setHours(pjfsls.get(i).getPointTime());
  351. vo.setPjfs(temp1);
  352. vos.add(vo);
  353. }
  354. if (pjfxls != null && pjfxls.size() > 1) {
  355. vos.stream().forEach(i -> {
  356. Optional<PointData> optional = pjfxls.stream()
  357. .filter(j -> j.getPointTime().equals(i.getHours()))
  358. .findFirst();
  359. if (optional.isPresent()) {
  360. PointData tqinfoday = optional.get();
  361. i.setPjfx(tqinfoday.getPointValueInDouble());
  362. }
  363. });
  364. }
  365. }
  366. }
  367. List<Object> result = new ArrayList<>();
  368. if (mode == 0){
  369. Map<String, Object> map = new HashMap<>();
  370. List<PowerPointData> ls = new ArrayList<>();
  371. for (WindspeedVo v : vos) {
  372. PowerPointData data = new PowerPointData();
  373. data.setFx(v.getPjfx());
  374. data.setSpeed(v.getPjfs());
  375. ls.add(data);
  376. }
  377. map.put("wt", wpid);
  378. map.put("roses", WindDirectionALG.fxRoses(ls));
  379. map.put("count", WindDirectionALG.fxCountRoses(ls));
  380. // map.put("radar", WindDirectionALG.fxRadarRoses(ls));
  381. // map.put("frequency", WindDirectionALG.windDeviationPoint(ls));
  382. result.add(map);
  383. }
  384. if (mode == 1){
  385. List<PowerPointData> ls = new ArrayList<>();
  386. for (WindspeedVo obj : vos)
  387. ls.addAll(csvParse(obj));
  388. Map<String, Object> map = new HashMap<>();
  389. map.put("wt", "merge");
  390. map.put("roses", WindDirectionALG.fxRoses(ls));
  391. map.put("count", WindDirectionALG.fxCountRoses(ls));
  392. // map.put("radar", WindDirectionALG.fxRadarRoses(ls));
  393. // map.put("frequency", WindDirectionALG.windDeviationPoint(ls));
  394. result.add(map);
  395. }
  396. return result;
  397. }
  398. /**
  399. * csv 文件解析成对象
  400. * @param obj
  401. * @return
  402. */
  403. private List<PowerPointData> csvParse(WindspeedVo obj){
  404. List<PowerPointData> ls = new ArrayList<>();
  405. // List<String> content = FileUtil.readFile(obj.getPath(), true);
  406. // for (int i = 1; i < content.size(); i++){
  407. // String[] split = content.get(i).split(",");
  408. PowerPointData data = new PowerPointData();
  409. // if (data.getSpeed() < 0 || data.getPower() < 0)
  410. // continue;
  411. data.setWtId(obj.getWpid());
  412. data.setFx(obj.getPjfx());
  413. data.setSpeed(obj.getPjfs());
  414. ls.add(data);
  415. // }
  416. return ls;
  417. }
  418. }