Browse Source

宁夏分公司代码修改

shilin 2 months ago
parent
commit
db321173b3

+ 143 - 4
alarm-web/src/main/java/com/gyee/alarm/controller/ProEconShutdownEvent2Controller.java

@@ -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");
+        }
+    }
 }

+ 16 - 0
alarm-web/src/main/java/com/gyee/alarm/service/auto/IProEconShutdownEvent2Service.java

@@ -5,6 +5,7 @@ import com.gyee.alarm.model.auto.ProEconShutdownEvent2;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 import java.util.Date;
+import java.util.List;
 
 /**
  * <p>
@@ -17,4 +18,19 @@ import java.util.Date;
 public interface IProEconShutdownEvent2Service extends IService<ProEconShutdownEvent2> {
 
     public IPage<ProEconShutdownEvent2> queryShutdownEvent2(String wpId, String wtId, String description, String begin, String end, Integer pageNum, Integer pageSize,String type) ;
+
+    public List<ProEconShutdownEvent2> queryShutdownEvent2ByType(String wpId, String modelId, Date begin, Date end);
+
+
+    public List<ProEconShutdownEvent2> queryShutdownEvent2ByDay(String wpId,String modelId,Date begin, Date end);
+
+
+    public List<ProEconShutdownEvent2> queryShutdownEvent2ByMonth(String wpId,String modelId,Date begin, Date end);
+
+
+    public  List<ProEconShutdownEvent2> queryShutdownEvent2ByJX(String wpId,String modelId,Date begin, Date end);
+
+    public List<ProEconShutdownEvent2> queryShutdownEvent2ByDQ(String wpId,String modelId,Date begin, Date end);
+
+    public List<ProEconShutdownEvent2> queryShutdownEvent2ByOther(String wpId,String modelId,Date begin, Date end);
 }

+ 38 - 0
alarm-web/src/main/java/com/gyee/alarm/service/auto/impl/ProEconShutdownEvent2ServiceImpl.java

@@ -8,12 +8,15 @@ import com.gyee.alarm.mapper.auto.ProEconShutdownEvent2Mapper;
 import com.gyee.alarm.model.auto.ProEconShutdownEvent2;
 import com.gyee.alarm.service.auto.IProEconShutdownEvent2Service;
 import com.gyee.common.model.StringUtils;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.Date;
+import java.util.List;
 
 /**
  * <p>
@@ -62,4 +65,39 @@ public class ProEconShutdownEvent2ServiceImpl extends ServiceImpl<ProEconShutdow
 
         return InputPage;
     }
+
+
+
+    public  List<ProEconShutdownEvent2> queryShutdownEvent2ByType(String wpId,String modelId,Date begin, Date end)
+    {
+        return proEconShutdownEvent2Mapper.queryShutdownEvent2ByType(wpId, modelId, begin,  end);
+    }
+
+
+    public List<ProEconShutdownEvent2> queryShutdownEvent2ByDay(String wpId,String modelId,Date begin, Date end)
+    {
+        return proEconShutdownEvent2Mapper.queryShutdownEvent2ByDay(wpId, modelId, begin,  end);
+    }
+
+
+    public List<ProEconShutdownEvent2> queryShutdownEvent2ByMonth(String wpId,String modelId,Date begin, Date end)
+    {
+        return proEconShutdownEvent2Mapper.queryShutdownEvent2ByMonth(wpId, modelId, begin,  end);
+    }
+
+
+    public  List<ProEconShutdownEvent2> queryShutdownEvent2ByJX(String wpId,String modelId,Date begin, Date end)
+    {
+        return proEconShutdownEvent2Mapper.queryShutdownEvent2ByJX(wpId, modelId, begin,  end);
+    }
+
+    public List<ProEconShutdownEvent2> queryShutdownEvent2ByDQ(String wpId,String modelId,Date begin, Date end)
+    {
+        return proEconShutdownEvent2Mapper.queryShutdownEvent2ByDQ(wpId, modelId, begin,  end);
+    }
+
+    public List<ProEconShutdownEvent2> queryShutdownEvent2ByOther(String wpId,String modelId,Date begin, Date end)
+    {
+        return proEconShutdownEvent2Mapper.queryShutdownEvent2ByOther(wpId, modelId, begin,  end);
+    }
 }