ShutdowneventServiceTest.java 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. package test;
  2. import com.github.pagehelper.PageInfo;
  3. import com.gyee.SpringbootStart;
  4. import com.gyee.frame.common.spring.SpringUtils;
  5. import com.gyee.frame.model.custom.ShutdowneventVo;
  6. import com.gyee.frame.model.custom.Tablepar;
  7. import com.gyee.frame.service.ShutdowneventService;
  8. import lombok.SneakyThrows;
  9. import org.springframework.boot.SpringApplication;
  10. import java.util.Calendar;
  11. import java.util.Date;
  12. import java.util.List;
  13. public class ShutdowneventServiceTest {
  14. @SneakyThrows
  15. public static void main(String[] args) {
  16. SpringApplication.run(SpringbootStart.class, args);
  17. // String wtId="MG01_03";
  18. String wpId="MHS_FDC";
  19. String year="2021";
  20. String month="1";
  21. ShutdowneventService shutdowneventService= SpringUtils.getBean("shutdowneventService");
  22. // List<String> wtids=new ArrayList<>();
  23. //
  24. // for(Windturbine wt: InitialRunner.wtls)
  25. // {
  26. // wtids.add(wt.getId());
  27. // }
  28. // Map<String,Object> map = shutdowneventService.queryMttrAndMtbf(wtids);
  29. //
  30. //
  31. // System.out.println(map.size());
  32. // List<SimpleVo> ls = shutdowneventService.countStopByWp();
  33. // List<SimpleVo> ls1 = shutdowneventService.countStopByPj();
  34. Tablepar tablepar=new Tablepar();
  35. tablepar.setPageNum(1);
  36. tablepar.setPageSize(10);
  37. tablepar.setOrderByColumn(null);
  38. tablepar.setIsAsc(null);
  39. Calendar c = Calendar.getInstance();
  40. c.set(Calendar.HOUR_OF_DAY, 0);
  41. c.set(Calendar.MINUTE, 0);
  42. c.set(Calendar.SECOND, 0);
  43. c.set(Calendar.DAY_OF_MONTH,1);
  44. c.set(Calendar.MONTH,0);
  45. c.set(Calendar.YEAR,2021);
  46. Date beginDate = c.getTime();
  47. c.add(Calendar.DAY_OF_MONTH,1);
  48. Date endDate = c.getTime();
  49. PageInfo<ShutdowneventVo> result= shutdowneventService.getShutdownevent(tablepar,wpId,null, beginDate, endDate,"2");
  50. List<ShutdowneventVo> ls=result.getList();
  51. System.out.println(ls.size());
  52. // AjaxResult ar = singleAnalysisController.singleanalysisSub(wtId,year,month);
  53. //
  54. // Map<String,Object> map=( Map<String,Object>)ar.get("data");
  55. // for(SingleAnalysisVo wtd:vos)
  56. // {
  57. // System.out.println(wtd.getXfqr()+"----------------"+wtd.getXfqrhgl());
  58. // }
  59. //
  60. // AjaxResult ar = singleAnalysisController.singleanalysisChart(wtId,year,month);
  61. //
  62. // Map<String, List<SingleAnalysisVo>> map=( Map<String,List<SingleAnalysisVo>>)ar.get("data");
  63. // List<SingleAnalysisVo> vos=map.get("ff");
  64. // for(SingleAnalysisVo wtd:vos)
  65. // {
  66. // System.out.println(wtd.getFdl()+"----------------"+wtd.getFs());
  67. // }
  68. //
  69. // System.out.println("---------------------------------------------------------------------------------");
  70. // vos=map.get("ws");
  71. // for(SingleAnalysisVo wtd:vos)
  72. // {
  73. // System.out.println(wtd.getGzss()+"----------------"+wtd.getJxss()+"----------------"+wtd.getXdss()
  74. // +"----------------"+wtd.getXnss()+"----------------"+wtd.getSlss());
  75. // }
  76. // System.out.println("---------------------------------------------------------------------------------");
  77. // vos=map.get("jd");
  78. // for(SingleAnalysisVo wtd:vos)
  79. // {
  80. // System.out.println(wtd.getJfpl()+"----------------"+wtd.getTjxs());
  81. // }
  82. //
  83. //
  84. //
  85. }
  86. }