|
@@ -7,9 +7,9 @@ import com.gyee.common.util.SortUtils;
|
|
|
import com.gyee.common.vo.algorithm.LineParameters;
|
|
|
import com.gyee.common.vo.benchmark.Operation;
|
|
|
import com.gyee.common.vo.benchmark.WxsslVo;
|
|
|
+import com.gyee.consumer.api.benching.BenchmarkingApi;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
-import org.springframework.web.client.RestTemplate;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.util.List;
|
|
@@ -23,12 +23,8 @@ import java.util.Map;
|
|
|
*/
|
|
|
@RestController
|
|
|
public class BenchmarkingController {
|
|
|
-
|
|
|
- @Value("${url.benchmaring}")
|
|
|
- private String BENCHMARKING_URL;
|
|
|
-
|
|
|
@Resource
|
|
|
- private RestTemplate restTemplate;
|
|
|
+ private BenchmarkingApi benchmarkingApi;
|
|
|
|
|
|
/**
|
|
|
* 场站列表
|
|
@@ -36,7 +32,7 @@ public class BenchmarkingController {
|
|
|
*/
|
|
|
@GetMapping(value = "/consumer/benchmarking/wplist")
|
|
|
public R wplist(){
|
|
|
- return restTemplate.getForObject(BENCHMARKING_URL+"/benchmarking/wplist",R.class);
|
|
|
+ return benchmarkingApi.wplist();
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -45,7 +41,7 @@ public class BenchmarkingController {
|
|
|
*/
|
|
|
@GetMapping(value = "/consumer/benchmarking/wpgflist")
|
|
|
public R wpGFlist(){
|
|
|
- return restTemplate.getForObject(BENCHMARKING_URL+"/benchmarking/wpgflist",R.class);
|
|
|
+ return benchmarkingApi.wpGFlist();
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -55,7 +51,7 @@ public class BenchmarkingController {
|
|
|
*/
|
|
|
@GetMapping(value = "/consumer/benchmarking/projectList")
|
|
|
public R projectList(@RequestParam(value = "wpids",required = true) String wpids){
|
|
|
- return restTemplate.getForObject(BENCHMARKING_URL+"/benchmarking/projectList?wpids="+wpids,R.class);
|
|
|
+ return benchmarkingApi.projectList(wpids);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -65,7 +61,7 @@ public class BenchmarkingController {
|
|
|
*/
|
|
|
@GetMapping(value = "/consumer/benchmarking/lineList")
|
|
|
public R lineList(@RequestParam(value = "projects",required = true) String projects){
|
|
|
- return restTemplate.getForObject(BENCHMARKING_URL+"/benchmarking/lineList?projects="+projects,R.class);
|
|
|
+ return benchmarkingApi.lineList(projects);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -75,7 +71,7 @@ public class BenchmarkingController {
|
|
|
*/
|
|
|
@GetMapping(value = "/consumer/benchmarking/wtList")
|
|
|
public R wtList(@RequestParam(value = "wpid",required = true) String wpid){
|
|
|
- return restTemplate.getForObject(BENCHMARKING_URL+"/benchmarking/wtList?wpid="+wpid,R.class);
|
|
|
+ return benchmarkingApi.wtList(wpid);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -99,7 +95,7 @@ public class BenchmarkingController {
|
|
|
@RequestParam(value = "type",required = true) String type,
|
|
|
@RequestParam(value = "target",required = true) String target,
|
|
|
@RequestParam(value = "sort",required = true) String sort){
|
|
|
- return restTemplate.getForObject(BENCHMARKING_URL+"/benchmarking/fjjxb?wpids="+wpids+"&projectids="+projectids+"&lineids="+lineids+"&beginDate="+beginDate+"&endDate="+endDate+"&type="+type+"&target="+target+"&sort="+sort,R.class);
|
|
|
+ return benchmarkingApi.fjjxb(wpids,projectids,lineids,beginDate,endDate,type,target,sort);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -123,7 +119,7 @@ public class BenchmarkingController {
|
|
|
@RequestParam(value = "type",required = true) String type,
|
|
|
@RequestParam(value = "target",required = true) String target,
|
|
|
@RequestParam(value = "sort",required = true) String sort){
|
|
|
- return restTemplate.getForObject(BENCHMARKING_URL+"/benchmarking/fjjxbmx?wpids="+wpids+"&projectids="+projectids+"&lineids="+lineids+"&beginDate="+beginDate+"&endDate="+endDate+"&type="+type+"&target="+target+"&sort="+sort,R.class);
|
|
|
+ return benchmarkingApi.fjjxbmx(wpids,projectids,lineids,beginDate,endDate,type,target,sort);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -144,7 +140,7 @@ public class BenchmarkingController {
|
|
|
@RequestParam(value = "target",required = true) String target,
|
|
|
@RequestParam(value = "sort",required = true) String sort
|
|
|
){
|
|
|
- return restTemplate.getForObject(BENCHMARKING_URL+"/benchmarking/wxssl?wpids="+wpids+"&projectids="+projectids+"&lineids="+lineids+"&beginDate="+beginDate+"&endDate="+endDate+"&target="+target+"&sort="+sort,R.class);
|
|
|
+ return benchmarkingApi.wxssl(wpids,projectids,lineids,beginDate,endDate,target,sort);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -161,7 +157,7 @@ public class BenchmarkingController {
|
|
|
@RequestParam(value = "target",required = true) String target,
|
|
|
@RequestParam(value = "sort",required = true) String sort
|
|
|
){
|
|
|
- return restTemplate.getForObject(BENCHMARKING_URL+"/benchmarking/cndb?wpid="+wpid+"&beginDate="+beginDate+"&endDate="+endDate+"&target="+target+"&sort="+sort,R.class);
|
|
|
+ return benchmarkingApi.cndb(wpid,beginDate,endDate,target,sort);
|
|
|
|
|
|
|
|
|
}
|
|
@@ -181,7 +177,7 @@ public class BenchmarkingController {
|
|
|
@RequestParam(value = "sort",required = true) String sort
|
|
|
){
|
|
|
|
|
|
- return restTemplate.getForObject(BENCHMARKING_URL+"/benchmarking/cjdb?wpids="+wpids+"&beginDate="+beginDate+"&endDate="+endDate+"&target="+target+"&sort="+sort,R.class);
|
|
|
+ return benchmarkingApi.cjdb(wpids,beginDate,endDate,target,sort);
|
|
|
|
|
|
|
|
|
}
|
|
@@ -204,7 +200,7 @@ public class BenchmarkingController {
|
|
|
@RequestParam(value = "sort",required = true) String sort
|
|
|
){
|
|
|
|
|
|
- return restTemplate.getForObject(BENCHMARKING_URL+"/benchmarking/xmdb?wpids="+wpids+"&projectids="+projectids+"&beginDate="+beginDate+"&endDate="+endDate+"&target="+target+"&sort="+sort,R.class);
|
|
|
+ return benchmarkingApi.xmdb(wpids,projectids,beginDate,endDate,target,sort);
|
|
|
|
|
|
}
|
|
|
|
|
@@ -228,7 +224,7 @@ public class BenchmarkingController {
|
|
|
@RequestParam(value = "target",required = true) String target,
|
|
|
@RequestParam(value = "sort",required = true) String sort
|
|
|
){
|
|
|
- return restTemplate.getForObject(BENCHMARKING_URL+"/benchmarking/xldb?wpids="+wpids+"&projectids="+projectids+"&lineids"+lineids+"&beginDate="+beginDate+"&endDate="+endDate+"&target="+target+"&sort="+sort,R.class);
|
|
|
+ return benchmarkingApi.xldb(wpids,projectids,lineids,beginDate,endDate,target,sort);
|
|
|
|
|
|
}
|
|
|
|
|
@@ -242,7 +238,7 @@ public class BenchmarkingController {
|
|
|
@GetMapping("/consumer/benchmarking/zjlist")
|
|
|
public R listplus(@RequestParam(value = "beginDate",required = true)String beginDate,
|
|
|
@RequestParam(value = "endDate",required = true)String endDate){
|
|
|
- return restTemplate.getForObject(BENCHMARKING_URL+"/benchmarking/zjlist?beginDate="+beginDate+"&endDate="+endDate,R.class);
|
|
|
+ return benchmarkingApi.listplus(beginDate,endDate);
|
|
|
|
|
|
}
|
|
|
|
|
@@ -259,7 +255,7 @@ public class BenchmarkingController {
|
|
|
@RequestParam(value = "endDate",required = true)String endDate,
|
|
|
@RequestParam(value = "dutyname",required = true)String dutyname,
|
|
|
@RequestParam(value = "direct",required = true)String direct){
|
|
|
- return restTemplate.getForObject(BENCHMARKING_URL+"/benchmarking/zjdrill?beginDate="+beginDate+"&endDate="+endDate+"&dutyname="+dutyname+"&direct="+direct,R.class);
|
|
|
+ return benchmarkingApi.zjdrill(beginDate,endDate,dutyname,direct);
|
|
|
|
|
|
}
|
|
|
|
|
@@ -272,7 +268,7 @@ public class BenchmarkingController {
|
|
|
@GetMapping("/consumer/benchmarking/zjwxssl")
|
|
|
public R zjwxssl(@RequestParam(value = "beginDate",required = true)String beginDate,
|
|
|
@RequestParam(value = "endDate",required = true)String endDate){
|
|
|
- return restTemplate.getForObject(BENCHMARKING_URL+"/benchmarking/zjwxssl?beginDate="+beginDate+"&endDate="+endDate,R.class);
|
|
|
+ return benchmarkingApi.zjwxssl(beginDate,endDate);
|
|
|
|
|
|
}
|
|
|
|
|
@@ -289,7 +285,7 @@ public class BenchmarkingController {
|
|
|
@RequestParam(value = "target",required = true) String target,
|
|
|
@RequestParam(value = "sort",required = true) String sort
|
|
|
){
|
|
|
- return restTemplate.getForObject(BENCHMARKING_URL+"/benchmarking/details?id="+id+"&beginDate="+beginDate+"&endDate="+endDate+"&target="+target+"&sort="+sort,R.class);
|
|
|
+ return benchmarkingApi.details(id,beginDate,endDate,target,sort);
|
|
|
|
|
|
}
|
|
|
|
|
@@ -304,7 +300,7 @@ public class BenchmarkingController {
|
|
|
public R daydjhxdbtop(@RequestParam(value = "wpid",required = true)String wpid,
|
|
|
@RequestParam(value = "wtids",required = true)String wtids,
|
|
|
@RequestParam(value = "date",required = true)String date){
|
|
|
- return restTemplate.getForObject(BENCHMARKING_URL+"/benchmarking/daydjhxdbtop?wpid="+wpid+"&wtids="+wtids+"&date="+date,R.class);
|
|
|
+ return benchmarkingApi.daydjhxdbtop(wpid,wtids,date);
|
|
|
|
|
|
}
|
|
|
|
|
@@ -320,7 +316,7 @@ public class BenchmarkingController {
|
|
|
public R monthdjhxdbtop(@RequestParam(value = "wpid",required = true)String wpid,
|
|
|
@RequestParam(value = "wtids",required = true)String wtids,
|
|
|
@RequestParam(value = "date",required = true)String date){
|
|
|
- return restTemplate.getForObject(BENCHMARKING_URL+"/benchmarking/monthdjhxdbtop?wpid="+wpid+"&wtids="+wtids+"&date="+date,R.class);
|
|
|
+ return benchmarkingApi.monthdjhxdbtop(wpid,wtids,date);
|
|
|
|
|
|
}
|
|
|
|
|
@@ -335,7 +331,7 @@ public class BenchmarkingController {
|
|
|
public R yeardjhxdbtop(@RequestParam(value = "wpid",required = true)String wpid,
|
|
|
@RequestParam(value = "wtids",required = true)String wtids,
|
|
|
@RequestParam(value = "date",required = true)String date){
|
|
|
- return restTemplate.getForObject(BENCHMARKING_URL+"/benchmarking/yeardjhxdbtop?wpid="+wpid+"&wtids="+wtids+"&date="+date,R.class);
|
|
|
+ return benchmarkingApi.yeardjhxdbtop(wpid,wtids,date);
|
|
|
|
|
|
}
|
|
|
|
|
@@ -351,7 +347,7 @@ public class BenchmarkingController {
|
|
|
public R djhxdbbottom(@RequestParam(value = "wpid",required = true)String wpid,
|
|
|
@RequestParam(value = "wtids",required = true)String wtids,
|
|
|
@RequestParam(value = "date",required = true)String date){
|
|
|
- return restTemplate.getForObject(BENCHMARKING_URL+"/benchmarking/djhxdbbottom?wpid="+wpid+"&wtids="+wtids+"&date="+date,R.class);
|
|
|
+ return benchmarkingApi.djhxdbbottom(wpid,wtids,date);
|
|
|
|
|
|
}
|
|
|
|
|
@@ -368,7 +364,7 @@ public class BenchmarkingController {
|
|
|
@CrossOrigin(origins = "*", maxAge = 3600)
|
|
|
public R dbmainbottom(@RequestParam(value = "timetype",required = true)String timetype,
|
|
|
@RequestParam(value = "foreigntype",required = true)String foreigntype) throws Exception {
|
|
|
- return restTemplate.getForObject(BENCHMARKING_URL+"/benchmarking/dbmainbottom?timetype="+timetype+"&foreigntype="+foreigntype,R.class);
|
|
|
+ return benchmarkingApi.dbmainbottom(timetype,foreigntype);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -382,7 +378,7 @@ public class BenchmarkingController {
|
|
|
@GetMapping("/consumer/benchmarking/dbmaintop")
|
|
|
public R dbmaintop(@RequestParam(value = "timetype",required = true)String timetype,
|
|
|
@RequestParam(value = "foreigntype",required = true)String foreigntype) throws Exception {
|
|
|
- return restTemplate.getForObject(BENCHMARKING_URL+"/benchmarking/dbmaintop?timetype="+timetype+"&foreigntype="+foreigntype,R.class);
|
|
|
+ return benchmarkingApi.dbmaintop(timetype,foreigntype);
|
|
|
}
|
|
|
|
|
|
}
|