|
@@ -4,6 +4,7 @@ package com.gyee.runeconomy.controller.bmk;/*
|
|
|
*/
|
|
|
|
|
|
import com.gyee.common.model.StringUtils;
|
|
|
+import com.gyee.common.util.DateUtils;
|
|
|
import com.gyee.common.vo.benchmark.FjjxbVo;
|
|
|
import com.gyee.common.vo.benchmark.FjjxbmxVo;
|
|
|
import com.gyee.common.vo.benchmark.WxsslVo;
|
|
@@ -19,6 +20,8 @@ import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
|
@RestController
|
|
@@ -160,6 +163,48 @@ public class BenchmarkingController {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ @GetMapping("/cndbthb")
|
|
|
+ @ResponseBody
|
|
|
+ @ApiOperation(value = "场内对标同环比", notes = "场内对标同环比")
|
|
|
+ public R cndbthb(@RequestParam(value = "companys",required = true) String companys,
|
|
|
+ @RequestParam(value = "type",required = true) String type,
|
|
|
+ @RequestParam(value = "wpid",required = true) String wpid
|
|
|
+ ) throws Exception {
|
|
|
+ List<WxsslVo> resultList = new ArrayList<>();
|
|
|
+ //获取当前时间
|
|
|
+ String endDate = DateUtils.toDate1(new Date());
|
|
|
+ Date date = DateUtils.parseDate(endDate);
|
|
|
+ String beginDate = DateUtils.toDate1(DateUtils.getFirstAndLastDayOfMonth(date));
|
|
|
+ List<WxsslVo> dateList = benchmarkingService.cndbthb(companys,type,wpid,beginDate,endDate);
|
|
|
+ if(dateList != null && dateList.size()>0){
|
|
|
+ dateList.get(0).setName("当月");
|
|
|
+ }
|
|
|
+ resultList.add((dateList != null && dateList.size()>0)?dateList.get(0): null);
|
|
|
+
|
|
|
+ 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("环比");
|
|
|
+ }
|
|
|
+ resultList.add((hbList != null && hbList.size()>0)?hbList.get(0): null);
|
|
|
+
|
|
|
+ Date subOneYear = DateUtils.subOneYear(date);
|
|
|
+ String tbbeginDate = DateUtils.toDate1(DateUtils.getMonthFirstZero(DateUtils.toDate1(subOneYear)));
|
|
|
+ String tbendDate = DateUtils.toDate1(DateUtils.getMonthLast(subOneYear));
|
|
|
+ List<WxsslVo> tbList = benchmarkingService.cndbthb(companys,type,wpid,tbbeginDate,tbendDate);
|
|
|
+ if(tbList != null && tbList.size()>0){
|
|
|
+ tbList.get(0).setName("同比");
|
|
|
+ }
|
|
|
+ resultList.add((tbList != null && tbList.size()>0)?tbList.get(0): null);
|
|
|
+ if (StringUtils.isNotNull(resultList)) {
|
|
|
+ return R.data(ResultMsg.ok(resultList));
|
|
|
+ } else {
|
|
|
+ return R.error(ResultMsg.error());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
@GetMapping("/cjdb")
|
|
|
@ResponseBody
|
|
|
@ApiOperation(value = "场际对标", notes = "场际对标")
|