wangchangsheng 2 роки тому
батько
коміт
34d6eb73d8

+ 6 - 13
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/bmk/BenchmarkingController.java

@@ -177,25 +177,20 @@ public class BenchmarkingController {
         Date date = DateUtils.parseDate(endDate);
         String  beginDate = DateUtils.toDate1(DateUtils.getFirstAndLastDayOfMonth(date));
         List<WxsslVo> dateList = benchmarkingService.cndbthb(companys,type,wpid,beginDate,endDate);
-        WxsslVo vo = null;
         if(dateList != null && dateList.size()>0){
             dateList.get(0).setName("当月");
-        }else {
-            vo = new WxsslVo();
-            vo.setName("当月");
+            resultList.add((dateList != null && dateList.size()>0)?dateList.get(0): null);
         }
-        resultList.add((dateList != null && dateList.size()>0)?dateList.get(0): vo);
+
 
         String yestmonthLastday =  DateUtils.toDate1(DateUtils.getYestmonthLastday(date));
         String  yestmonthbeginday = DateUtils.toDate1(DateUtils.getFirstAndLastDayOfMonth(DateUtils.parseDate(yestmonthLastday)));
         List<WxsslVo> hbList = benchmarkingService.cndbthb(companys,type,wpid,yestmonthbeginday,yestmonthLastday);
         if(hbList != null && hbList.size()>0){
             hbList.get(0).setName("环比");
-        }else {
-            vo = new WxsslVo();
-            vo.setName("环比");
+            resultList.add((hbList != null && hbList.size()>0)?hbList.get(0): null);
         }
-        resultList.add((hbList != null && hbList.size()>0)?hbList.get(0): vo);
+
 
         Date  subOneYear = DateUtils.subOneYear(date);
         String tbbeginDate = DateUtils.toDate1(DateUtils.getMonthFirstZero(DateUtils.toDate1(subOneYear)));
@@ -203,11 +198,9 @@ public class BenchmarkingController {
         List<WxsslVo> tbList = benchmarkingService.cndbthb(companys,type,wpid,tbbeginDate,tbendDate);
         if(tbList != null && tbList.size()>0){
             tbList.get(0).setName("同比");
-        }else {
-            vo = new WxsslVo();
-            vo.setName("同比");
+            resultList.add((tbList != null && tbList.size()>0)?tbList.get(0):  null);
         }
-        resultList.add((tbList != null && tbList.size()>0)?tbList.get(0): vo);
+
 
         SortUtils.sort(resultList,"llfdl",SortUtils.DESC);
         for (int i=0;i<resultList.size();i++){