Browse Source

类型转换

zhaomiao 4 years ago
parent
commit
06f1fe0b4c

+ 49 - 21
src/main/java/com/gyee/frame/controller/compare/CompareController.java

@@ -47,10 +47,14 @@ public class CompareController {
     /**查询日横向对比下方图表**/
     @GetMapping("/compareDayChat")
     @ResponseBody
-    public AjaxResult compareDayChat(String windturbineid,Date date) {
-
+    public AjaxResult compareDayChat(String windturbineid,String date) {
+        Date beginDate_d=null;
+        if (StringUtils.isNotEmpty(date))
+        {
+            beginDate_d= DateUtils.parseDate(date);
+        }
 
-        AjaxResult ajaxResult=compareService.compareDayChat(windturbineid,date) ;
+        AjaxResult ajaxResult=compareService.compareDayChat(windturbineid,beginDate_d) ;
 
         return ajaxResult;
 
@@ -60,10 +64,14 @@ public class CompareController {
     /**查询月横向对比列表**/
     @GetMapping("/compareMonthList")
     @ResponseBody
-    public AjaxResult compareMonthList(String windturbineid,Date date) {
-
+    public AjaxResult compareMonthList(String windturbineid,String date) {
+        Date beginDate_d=null;
+        if (StringUtils.isNotEmpty(date))
+        {
+            beginDate_d= DateUtils.parseDate(date);
+        }
 
-        AjaxResult ajaxResult=compareService.compareMonthList(windturbineid,date) ;
+        AjaxResult ajaxResult=compareService.compareMonthList(windturbineid,beginDate_d) ;
 
         return ajaxResult;
 
@@ -71,10 +79,14 @@ public class CompareController {
     /**创建月风资源图表**/
     @GetMapping("/fzyMonth")
     @ResponseBody
-    public AjaxResult fzyMonth(String windturbineid,Date date) {
-
+    public AjaxResult fzyMonth(String windturbineid,String date) {
+        Date beginDate_d=null;
+        if (StringUtils.isNotEmpty(date))
+        {
+            beginDate_d= DateUtils.parseDate(date);
+        }
 
-        AjaxResult ajaxResult=compareService.fzyMonth(windturbineid,date) ;
+        AjaxResult ajaxResult=compareService.fzyMonth(windturbineid,beginDate_d) ;
 
         return ajaxResult;
 
@@ -82,10 +94,14 @@ public class CompareController {
     /**查询月横向对比下方图表**/
     @GetMapping("/compareMonthChat")
     @ResponseBody
-    public AjaxResult compareMonthChat(String windturbineid,Date date) {
-
+    public AjaxResult compareMonthChat(String windturbineid,String date) {
 
-        AjaxResult ajaxResult=compareService.compareMonthChat(windturbineid,date) ;
+        Date beginDate_d=null;
+        if (StringUtils.isNotEmpty(date))
+        {
+            beginDate_d= DateUtils.parseDate(date);
+        }
+        AjaxResult ajaxResult=compareService.compareMonthChat(windturbineid,beginDate_d) ;
 
         return ajaxResult;
 
@@ -97,10 +113,14 @@ public class CompareController {
     /**查询年横向对比列表**/
     @GetMapping("/compareYearList")
     @ResponseBody
-    public AjaxResult compareYearList(String windturbineid,Date date) {
+    public AjaxResult compareYearList(String windturbineid,String date) {
 
-
-        AjaxResult ajaxResult=compareService.compareYearList(windturbineid,date) ;
+        Date beginDate_d=null;
+        if (StringUtils.isNotEmpty(date))
+        {
+            beginDate_d= DateUtils.parseDate(date);
+        }
+        AjaxResult ajaxResult=compareService.compareYearList(windturbineid,beginDate_d) ;
 
         return ajaxResult;
 
@@ -108,10 +128,14 @@ public class CompareController {
     /**创建年风资源图表**/
     @GetMapping("/fzyYear")
     @ResponseBody
-    public AjaxResult fzyYear(String windturbineid,Date date) {
+    public AjaxResult fzyYear(String windturbineid,String date) {
 
-
-        AjaxResult ajaxResult=compareService.fzyYear(windturbineid,date) ;
+        Date beginDate_d=null;
+        if (StringUtils.isNotEmpty(date))
+        {
+            beginDate_d= DateUtils.parseDate(date);
+        }
+        AjaxResult ajaxResult=compareService.fzyYear(windturbineid,beginDate_d) ;
 
         return ajaxResult;
 
@@ -119,10 +143,14 @@ public class CompareController {
     /**查询年横向对比下方图表**/
     @GetMapping("/compareYearChat")
     @ResponseBody
-    public AjaxResult compareYearChat(String windturbineid,Date date) {
-
+    public AjaxResult compareYearChat(String windturbineid,String date) {
+        Date beginDate_d=null;
+        if (StringUtils.isNotEmpty(date))
+        {
+            beginDate_d= DateUtils.parseDate(date);
+        }
 
-        AjaxResult ajaxResult=compareService.compareYearChat(windturbineid,date) ;
+        AjaxResult ajaxResult=compareService.compareYearChat(windturbineid,beginDate_d) ;
 
         return ajaxResult;
 

+ 49 - 12
src/main/java/com/gyee/frame/controller/leaderboard/LeaderboardController.java

@@ -9,6 +9,7 @@ import com.gyee.frame.model.custom.StatisticalAnalysisTopVo;
 import com.gyee.frame.model.custom.StatisticalAnalysisWarningTopVo;
 import com.gyee.frame.model.custom.Tablepar;
 import com.gyee.frame.service.leaderboard.LeaderboardService;
+import com.gyee.frame.util.DateUtils;
 import com.gyee.frame.util.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
@@ -27,10 +28,19 @@ public class LeaderboardController {
     /**查询拟合优度列表**/
     @GetMapping("/fittingtoplist")
     @ResponseBody
-    public AjaxResult fittingtoplist(Tablepar tablepar, String wpIps, Date beginDate, Date endDate) {
+    public AjaxResult fittingtoplist(Tablepar tablepar, String wpIps, String beginDate, String endDate) {
 
-
-        List<StatisticalAnalysisTopVo> vos= leaderboardService.getRnewTopDate(wpIps, beginDate, endDate);
+        Date beginDate_d=null;
+        Date endDate_d=null;
+        if (StringUtils.isNotEmpty(beginDate))
+        {
+            beginDate_d= DateUtils.parseDate(beginDate);
+        }
+        if (StringUtils.isNotEmpty(endDate))
+        {
+            endDate_d= DateUtils.parseDate(endDate);
+        }
+        List<StatisticalAnalysisTopVo> vos= leaderboardService.getRnewTopDate(wpIps, beginDate_d, endDate_d);
 
         for (StatisticalAnalysisTopVo vo : vos) {
             if (vo.getPower() > 1) {
@@ -86,11 +96,20 @@ public class LeaderboardController {
     /**查询拟合优度图表**/
     @GetMapping("/fittingtopchart")
     @ResponseBody
-    public AjaxResult fittingtopchart(String wtIds, Date beginDate, Date endDate) throws Exception {
-
+    public AjaxResult fittingtopchart(String wtIds, String beginDate, String endDate) throws Exception {
+        Date beginDate_d=null;
+        Date endDate_d=null;
+        if (StringUtils.isNotEmpty(beginDate))
+        {
+            beginDate_d= DateUtils.parseDate(beginDate);
+        }
+        if (StringUtils.isNotEmpty(endDate))
+        {
+            endDate_d= DateUtils.parseDate(endDate);
+        }
         Map<String, List> map =new HashMap<>();
         if (StringUtils.notEmp(wtIds) && StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate)) {
-            map = leaderboardService.fittingtopchart(wtIds, beginDate, endDate);
+            map = leaderboardService.fittingtopchart(wtIds, beginDate_d, endDate_d);
         }
 
         if (map != null && !map.isEmpty()) {
@@ -103,10 +122,19 @@ public class LeaderboardController {
     /**查询总发电量排行列表**/
     @GetMapping("/totalPowerCapacityTopList")
     @ResponseBody
-    public AjaxResult totalPowerCapacityTopList(Tablepar tablepar, String wpIps, Date beginDate, Date endDate) {
+    public AjaxResult totalPowerCapacityTopList(Tablepar tablepar, String wpIps, String beginDate, String endDate) {
 
-
-        List<StatisticalAnalysisTopVo> vos= leaderboardService.totalPowerCapacityTopList(wpIps, beginDate, endDate);
+        Date beginDate_d=null;
+        Date endDate_d=null;
+        if (StringUtils.isNotEmpty(beginDate))
+        {
+            beginDate_d= DateUtils.parseDate(beginDate);
+        }
+        if (StringUtils.isNotEmpty(endDate))
+        {
+            endDate_d= DateUtils.parseDate(endDate);
+        }
+        List<StatisticalAnalysisTopVo> vos= leaderboardService.totalPowerCapacityTopList(wpIps, beginDate_d, endDate_d);
 
 
         if (tablepar.getOrderByColumn().equals("power")) {
@@ -191,10 +219,19 @@ public class LeaderboardController {
     /**查询损失率排行榜列表**/
     @GetMapping("/lossList")
     @ResponseBody
-    public AjaxResult lossList(Tablepar tablepar, String wpId, Date beginDate, Date endDate,String type) {
+    public AjaxResult lossList(Tablepar tablepar, String wpId, String beginDate, String endDate,String type) {
 
-
-        List<Windturbineinfoday3> vos= leaderboardService.lossList(tablepar, wpId, beginDate, endDate, type);
+        Date beginDate_d=null;
+        Date endDate_d=null;
+        if (StringUtils.isNotEmpty(beginDate))
+        {
+            beginDate_d= DateUtils.parseDate(beginDate);
+        }
+        if (StringUtils.isNotEmpty(endDate))
+        {
+            endDate_d= DateUtils.parseDate(endDate);
+        }
+        List<Windturbineinfoday3> vos= leaderboardService.lossList(tablepar, wpId, beginDate_d, endDate_d, type);
 
 
         if (vos != null && !vos.isEmpty()) {