OutputSpeedController.java 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. package com.gyee.runeconomy.controller;
  2. import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
  3. import com.gyee.backconfig.model.auto.ProBasicOrganizeTree;
  4. import com.gyee.runeconomy.dto.R;
  5. import com.gyee.runeconomy.dto.ResultMsg;
  6. import com.gyee.runeconomy.init.CacheContext;
  7. import com.gyee.runeconomy.model.auto.ProEconInOrOutSpeedTotal;
  8. import com.gyee.runeconomy.service.outputspeed.OutputSpeedService;
  9. import io.swagger.annotations.Api;
  10. import io.swagger.annotations.ApiImplicitParam;
  11. import io.swagger.annotations.ApiImplicitParams;
  12. import io.swagger.annotations.ApiOperation;
  13. import org.springframework.stereotype.Controller;
  14. import org.springframework.web.bind.annotation.PostMapping;
  15. import org.springframework.web.bind.annotation.RequestMapping;
  16. import org.springframework.web.bind.annotation.ResponseBody;
  17. import javax.annotation.Resource;
  18. @Controller
  19. @RequestMapping("/outputspeed")
  20. @Api(value = "切入切出管理",tags = "切入切出管理")
  21. public class OutputSpeedController {
  22. @Resource
  23. private OutputSpeedService outputSpeedService;
  24. /**切入切出列表**/
  25. @PostMapping("/outputSpeedlist")
  26. @ResponseBody
  27. @ApiOperation(value = "切入切出列表", notes = "切入切出列表")
  28. @ApiImplicitParams({
  29. @ApiImplicitParam(name = "pageNum", value = "页码", required = true, dataType = "Integer", paramType = "query"),
  30. @ApiImplicitParam(name = "pageSize", value = "每页数量", required = true, dataType = "Integer", paramType = "query"),
  31. @ApiImplicitParam(name = "cmId", value = "公司编号或者区域编号", required = true, dataType = "string", paramType = "query"),
  32. @ApiImplicitParam(name = "type", value = "0全部、光伏(-2)、风场(-1)", required = true, dataType = "string", paramType = "query"),
  33. @ApiImplicitParam(name = "wpId", value = "风场编号", required = false, dataType = "string", paramType = "query"),
  34. @ApiImplicitParam(name = "recorddate", value = "日期", required = true, dataType = "string", paramType = "query")})
  35. public R outputSpeedlist( Integer pageNum, Integer pageSize,String cmId,String type, String wpId, String recorddate) {
  36. Page<ProEconInOrOutSpeedTotal> pageInfo=outputSpeedService.outputSpeedlist(pageNum,pageSize,cmId,type,wpId,recorddate);
  37. if(pageInfo!=null && !pageInfo.getRecords().isEmpty())
  38. {
  39. for(ProEconInOrOutSpeedTotal pwg:pageInfo.getRecords())
  40. {
  41. if(CacheContext.wtmap.containsKey(pwg.getWindturbineId()))
  42. {
  43. ProBasicOrganizeTree wt= CacheContext.wtmap.get(pwg.getWindturbineId());
  44. pwg.setWtcode(wt.getAname());
  45. pwg.setModelId(wt.getModelId());
  46. }
  47. }
  48. }
  49. return R.data(ResultMsg.ok(pageInfo));
  50. }
  51. /**切入切出历史列表**/
  52. @PostMapping("/outputspeedhistorylist")
  53. @ResponseBody
  54. @ApiOperation(value = "切入切出历史列表", notes = "切入切出历史列表")
  55. @ApiImplicitParams({
  56. @ApiImplicitParam(name = "pageNum", value = "页码", required = true, dataType = "Integer", paramType = "query"),
  57. @ApiImplicitParam(name = "pageSize", value = "每页数量", required = true, dataType = "Integer", paramType = "query"),
  58. @ApiImplicitParam(name = "cmId", value = "公司编号或者区域编号", required = true, dataType = "string", paramType = "query"),
  59. @ApiImplicitParam(name = "type", value = "0全部、光伏(-2)、风场(-1)", required = true, dataType = "string", paramType = "query"),
  60. @ApiImplicitParam(name = "wpId", value = "风场编号", required = false, dataType = "string", paramType = "query"),
  61. @ApiImplicitParam(name = "wtId", value = "风机编号", required = false, dataType = "string", paramType = "query"),
  62. @ApiImplicitParam(name = "beginDate", value = "开始日期", required = true, dataType = "string", paramType = "query"),
  63. @ApiImplicitParam(name = "endDate", value = "结束日期", required = true, dataType = "string", paramType = "query")})
  64. public R outputspeedhistorylist(Integer pageNum, Integer pageSize,String cmId,String type, String wpId,String wtId, String beginDate,String endDate) {
  65. Page<ProEconInOrOutSpeedTotal> pageInfo=outputSpeedService.outputspeedhistorylist(pageNum,pageSize,cmId,type,wpId,wtId,beginDate,endDate);
  66. if(pageInfo!=null && !pageInfo.getRecords().isEmpty())
  67. {
  68. for(ProEconInOrOutSpeedTotal pwg:pageInfo.getRecords())
  69. {
  70. if(CacheContext.wtmap.containsKey(pwg.getWindturbineId()))
  71. {
  72. ProBasicOrganizeTree wt= CacheContext.wtmap.get(pwg.getWindturbineId());
  73. pwg.setWtcode(wt.getAname());
  74. pwg.setModelId(wt.getModelId());
  75. }
  76. }
  77. }
  78. return R.data(ResultMsg.ok(pageInfo));
  79. // return AjaxResult.successData(ResultCode.SUCCESS, pageInfo);
  80. }
  81. }