|
@@ -19,10 +19,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.text.ParseException;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -81,4 +80,144 @@ public class ProEconShutdownEvent2Controller {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ @GetMapping(value = "/queryShutdownEvent2ByType")
|
|
|
+ @ApiOperation(value = "停机记录按分类统计", notes = "停机记录按分类统计")
|
|
|
+ @ApiImplicitParams({
|
|
|
+
|
|
|
+ @ApiImplicitParam(name = "wpId", value = "风场编号", required = true, dataType = "string", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "modelId", value = "型号", required = false, dataType = "string", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "begin", value = "开始时间", required = true, dataType = "string", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "end", value = "结束时间", required = true, dataType = "string", paramType = "query")
|
|
|
+
|
|
|
+
|
|
|
+ })
|
|
|
+ public AjaxResult queryShutdownEvent2ByType(String wpId, String modelId,String begin,String end) throws ParseException {
|
|
|
+
|
|
|
+ List<ProEconShutdownEvent2> vos=new ArrayList();
|
|
|
+
|
|
|
+
|
|
|
+ if (StringUtils.notEmp(begin) && StringUtils.notEmp(end) ) {
|
|
|
+
|
|
|
+ Date beginDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(begin);
|
|
|
+ Date endDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(end);
|
|
|
+ vos=proEconShutdownEvent2Service.queryShutdownEvent2ByType(wpId, modelId,beginDate, endDate);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (StringUtils.notEmp(vos)) {
|
|
|
+
|
|
|
+ return AjaxResult.successData(AjaxStatus.success.code, vos);
|
|
|
+ } else {
|
|
|
+ return AjaxResult.successData(AjaxStatus.loginexpire.code, "error");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @GetMapping(value = "/queryShutdownEvent2ByDay")
|
|
|
+ @ApiOperation(value = "停机记录按日期统计", notes = "停机记录按日期统计")
|
|
|
+ @ApiImplicitParams({
|
|
|
+
|
|
|
+ @ApiImplicitParam(name = "wpId", value = "风场编号", required = true, dataType = "string", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "modelId", value = "型号", required = false, dataType = "string", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "begin", value = "开始时间", required = true, dataType = "string", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "end", value = "结束时间", required = true, dataType = "string", paramType = "query")
|
|
|
+
|
|
|
+
|
|
|
+ })
|
|
|
+ public AjaxResult queryShutdownEvent2ByDay(String wpId, String modelId,String begin,String end) throws ParseException {
|
|
|
+
|
|
|
+ List<ProEconShutdownEvent2> vos=new ArrayList();
|
|
|
+
|
|
|
+
|
|
|
+ if (StringUtils.notEmp(begin) && StringUtils.notEmp(end) ) {
|
|
|
+
|
|
|
+ Date beginDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(begin);
|
|
|
+ Date endDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(end);
|
|
|
+ vos=proEconShutdownEvent2Service.queryShutdownEvent2ByDay(wpId, modelId,beginDate, endDate);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (StringUtils.notEmp(vos)) {
|
|
|
+
|
|
|
+ return AjaxResult.successData(AjaxStatus.success.code, vos);
|
|
|
+ } else {
|
|
|
+ return AjaxResult.successData(AjaxStatus.loginexpire.code, "error");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @GetMapping(value = "/queryShutdownEvent2ByMonth")
|
|
|
+ @ApiOperation(value = "停机记录按日期统计", notes = "停机记录按日期统计")
|
|
|
+ @ApiImplicitParams({
|
|
|
+
|
|
|
+ @ApiImplicitParam(name = "wpId", value = "风场编号", required = true, dataType = "string", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "modelId", value = "型号", required = false, dataType = "string", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "begin", value = "开始时间", required = true, dataType = "string", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "end", value = "结束时间", required = true, dataType = "string", paramType = "query")
|
|
|
+
|
|
|
+
|
|
|
+ })
|
|
|
+ public AjaxResult queryShutdownEvent2ByMonth(String wpId, String modelId,String begin,String end) throws ParseException {
|
|
|
+
|
|
|
+ List<ProEconShutdownEvent2> vos=new ArrayList();
|
|
|
+
|
|
|
+
|
|
|
+ if (StringUtils.notEmp(begin) && StringUtils.notEmp(end) ) {
|
|
|
+
|
|
|
+ Date beginDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(begin);
|
|
|
+ Date endDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(end);
|
|
|
+ vos=proEconShutdownEvent2Service.queryShutdownEvent2ByMonth(wpId, modelId,beginDate, endDate);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (StringUtils.notEmp(vos)) {
|
|
|
+
|
|
|
+ return AjaxResult.successData(AjaxStatus.success.code, vos);
|
|
|
+ } else {
|
|
|
+ return AjaxResult.successData(AjaxStatus.loginexpire.code, "error");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @GetMapping(value = "/queryShutdownEvent2ByMap")
|
|
|
+ @ApiOperation(value = "非停机记录按统计", notes = "非停机记录按统计")
|
|
|
+ @ApiImplicitParams({
|
|
|
+
|
|
|
+ @ApiImplicitParam(name = "wpId", value = "风场编号", required = true, dataType = "string", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "modelId", value = "型号", required = false, dataType = "string", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "begin", value = "开始时间", required = true, dataType = "string", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "end", value = "结束时间", required = true, dataType = "string", paramType = "query")
|
|
|
+
|
|
|
+
|
|
|
+ })
|
|
|
+ public AjaxResult queryShutdownEvent2ByMap(String wpId, String modelId,String begin,String end) throws ParseException {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ Map<String,List<ProEconShutdownEvent2>> map=new HashMap<>();
|
|
|
+
|
|
|
+ if (StringUtils.notEmp(begin) && StringUtils.notEmp(end) ) {
|
|
|
+
|
|
|
+ Date beginDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(begin);
|
|
|
+ Date endDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(end);
|
|
|
+ List<ProEconShutdownEvent2> vos=new ArrayList();
|
|
|
+
|
|
|
+ vos=proEconShutdownEvent2Service.queryShutdownEvent2ByJX(wpId, modelId,beginDate, endDate);
|
|
|
+ map.put("机械故障",vos);
|
|
|
+ vos=proEconShutdownEvent2Service.queryShutdownEvent2ByDQ(wpId, modelId,beginDate, endDate);
|
|
|
+ map.put("电气故障",vos);
|
|
|
+ vos=proEconShutdownEvent2Service.queryShutdownEvent2ByOther(wpId, modelId,beginDate, endDate);
|
|
|
+ map.put("其它",vos);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (StringUtils.notEmp(map)) {
|
|
|
+
|
|
|
+ return AjaxResult.successData(AjaxStatus.success.code, map);
|
|
|
+ } else {
|
|
|
+ return AjaxResult.successData(AjaxStatus.loginexpire.code, "error");
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|