Commit cc7a5d84 authored by caotao's avatar caotao

1.逆变器日、月、年增加缺省值处理

parent fa46f6f3
...@@ -5,6 +5,7 @@ import com.alibaba.excel.EasyExcel; ...@@ -5,6 +5,7 @@ import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.support.ExcelTypeEnum; import com.alibaba.excel.support.ExcelTypeEnum;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto; import com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.ReviewDto; import com.yeejoin.amos.boot.module.hygf.api.dto.ReviewDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.*; import com.yeejoin.amos.boot.module.hygf.api.entity.*;
...@@ -240,18 +241,24 @@ public class JpInverterController extends BaseController { ...@@ -240,18 +241,24 @@ public class JpInverterController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/jpInverterDayReport") @GetMapping(value = "/jpInverterDayReport")
@ApiOperation(httpMethod = "GET", value = "逆变器日报表", notes = "逆变器日报表") @ApiOperation(httpMethod = "GET", value = "逆变器日报表", notes = "逆变器日报表")
public ResponseModel<Page<TdHYGFInverterDayGenerate>> jpInverterDayReport(@RequestParam(value = "current") int current, @RequestParam(value = "size") int size, String time, @RequestParam(required = false) List<String> snCodes) { public ResponseModel<Page<TdHYGFInverterDayGenerate>> jpInverterDayReport(@RequestParam(value = "current") int current, @RequestParam(value = "size") int size,@RequestParam(required = false) String time, @RequestParam(required = false) List<String> snCodes) {
List<JpStation> jpStation=jpStationServiceImpl.getJpStation(new JpStationDto()); List<JpStation> jpStation=jpStationServiceImpl.getJpStation(new JpStationDto());
List<String> stationIds = jpStation.stream().map(jpStation1 -> jpStation1.getThirdStationId()).collect(Collectors.toList()); List<String> stationIds = jpStation.stream().map(jpStation1 -> jpStation1.getThirdStationId()).collect(Collectors.toList());
if(StringUtils.isEmpty(time)){
time = DateUtil.format(new Date(),"yyyy-MM-dd");
}
return ResponseHelper.buildResponse(jpInverterServiceImpl.jpInverterDayReport(current,size,time,snCodes,stationIds)); return ResponseHelper.buildResponse(jpInverterServiceImpl.jpInverterDayReport(current,size,time,snCodes,stationIds));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/jpInverterDayReportExport", method = RequestMethod.GET) @RequestMapping(value = "/jpInverterDayReportExport", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "逆变器日报表导出", notes = "逆变器日报表导出") @ApiOperation(httpMethod = "GET", value = "逆变器日报表导出", notes = "逆变器日报表导出")
public void jpInverterDayReportExport( String time,@RequestParam(required = false) List<String> snCodes, HttpServletResponse response) { public void jpInverterDayReportExport( @RequestParam(required = false)String time,@RequestParam(required = false) List<String> snCodes, HttpServletResponse response) {
List<JpStation> jpStation=jpStationServiceImpl.getJpStation(new JpStationDto()); List<JpStation> jpStation=jpStationServiceImpl.getJpStation(new JpStationDto());
List<String> stationIds = jpStation.stream().map(jpStation1 -> jpStation1.getThirdStationId()).collect(Collectors.toList()); List<String> stationIds = jpStation.stream().map(jpStation1 -> jpStation1.getThirdStationId()).collect(Collectors.toList());
if(StringUtils.isEmpty(time)){
time = DateUtil.format(new Date(),"yyyy-MM-dd");
}
List<TdHYGFInverterDayGenerate> tdHYGFInverterDayGenerates =jpInverterServiceImpl.jpInverterDayReportExport(time,snCodes,stationIds); List<TdHYGFInverterDayGenerate> tdHYGFInverterDayGenerates =jpInverterServiceImpl.jpInverterDayReportExport(time,snCodes,stationIds);
try { try {
setResponseHeadForDowload(response,"逆变器日报表.xls"); setResponseHeadForDowload(response,"逆变器日报表.xls");
...@@ -263,18 +270,24 @@ public class JpInverterController extends BaseController { ...@@ -263,18 +270,24 @@ public class JpInverterController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/jpInverterMonthReport") @GetMapping(value = "/jpInverterMonthReport")
@ApiOperation(httpMethod = "GET", value = "逆变器月报表", notes = "逆变器月报表") @ApiOperation(httpMethod = "GET", value = "逆变器月报表", notes = "逆变器月报表")
public ResponseModel<Page<TdHYGFInverterMonthGenerate>> jpInverterMonthReport(@RequestParam(value = "current") int current, @RequestParam(value = "size") int size, String time, @RequestParam(required = false) List<String> snCodes) { public ResponseModel<Page<TdHYGFInverterMonthGenerate>> jpInverterMonthReport(@RequestParam(value = "current") int current, @RequestParam(value = "size") int size,@RequestParam(required = false) String time, @RequestParam(required = false) List<String> snCodes) {
List<JpStation> jpStation=jpStationServiceImpl.getJpStation(new JpStationDto()); List<JpStation> jpStation=jpStationServiceImpl.getJpStation(new JpStationDto());
List<String> stationIds = jpStation.stream().map(jpStation1 -> jpStation1.getThirdStationId()).collect(Collectors.toList()); List<String> stationIds = jpStation.stream().map(jpStation1 -> jpStation1.getThirdStationId()).collect(Collectors.toList());
if(StringUtils.isEmpty(time)){
time = DateUtil.format(new Date(),"yyyy-MM");
}
return ResponseHelper.buildResponse(jpInverterServiceImpl.jpInverterMonthReport(current,size,time,snCodes,stationIds)); return ResponseHelper.buildResponse(jpInverterServiceImpl.jpInverterMonthReport(current,size,time,snCodes,stationIds));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/jpInverterMonthReportExport", method = RequestMethod.GET) @RequestMapping(value = "/jpInverterMonthReportExport", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "逆变器月报表导出", notes = "逆变器月报表导出") @ApiOperation(httpMethod = "GET", value = "逆变器月报表导出", notes = "逆变器月报表导出")
public void jpInverterMonthReportExport( String time,@RequestParam(required = false) List<String> snCodes, HttpServletResponse response) { public void jpInverterMonthReportExport( @RequestParam(required = false)String time,@RequestParam(required = false) List<String> snCodes, HttpServletResponse response) {
List<JpStation> jpStation=jpStationServiceImpl.getJpStation(new JpStationDto()); List<JpStation> jpStation=jpStationServiceImpl.getJpStation(new JpStationDto());
List<String> stationIds = jpStation.stream().map(jpStation1 -> jpStation1.getThirdStationId()).collect(Collectors.toList()); List<String> stationIds = jpStation.stream().map(jpStation1 -> jpStation1.getThirdStationId()).collect(Collectors.toList());
if(StringUtils.isEmpty(time)){
time = DateUtil.format(new Date(),"yyyy-MM");
}
List<TdHYGFInverterMonthGenerate> tdHYGFInverterMonthGenerates =jpInverterServiceImpl.jpInverterMonthReportExport(time,snCodes,stationIds); List<TdHYGFInverterMonthGenerate> tdHYGFInverterMonthGenerates =jpInverterServiceImpl.jpInverterMonthReportExport(time,snCodes,stationIds);
try { try {
setResponseHeadForDowload(response,"逆变器月报表.xls"); setResponseHeadForDowload(response,"逆变器月报表.xls");
...@@ -287,18 +300,24 @@ public class JpInverterController extends BaseController { ...@@ -287,18 +300,24 @@ public class JpInverterController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/jpInverterYearReport") @GetMapping(value = "/jpInverterYearReport")
@ApiOperation(httpMethod = "GET", value = "逆变器年报表", notes = "逆变器年报表") @ApiOperation(httpMethod = "GET", value = "逆变器年报表", notes = "逆变器年报表")
public ResponseModel<Page<TdHYGFInverterYearGenerate>> jpInverterYearReport(@RequestParam(value = "current") int current, @RequestParam(value = "size") int size, String time, @RequestParam(required = false) List<String> snCodes) { public ResponseModel<Page<TdHYGFInverterYearGenerate>> jpInverterYearReport(@RequestParam(value = "current") int current, @RequestParam(value = "size") int size, @RequestParam(required = false)String time, @RequestParam(required = false) List<String> snCodes) {
List<JpStation> jpStation=jpStationServiceImpl.getJpStation(new JpStationDto()); List<JpStation> jpStation=jpStationServiceImpl.getJpStation(new JpStationDto());
List<String> stationIds = jpStation.stream().map(jpStation1 -> jpStation1.getThirdStationId()).collect(Collectors.toList()); List<String> stationIds = jpStation.stream().map(jpStation1 -> jpStation1.getThirdStationId()).collect(Collectors.toList());
if(StringUtils.isEmpty(time)){
time = DateUtil.format(new Date(),"yyyy");
}
return ResponseHelper.buildResponse(jpInverterServiceImpl.jpInverterYearReport(current,size,time,snCodes,stationIds)); return ResponseHelper.buildResponse(jpInverterServiceImpl.jpInverterYearReport(current,size,time,snCodes,stationIds));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/jpInverterYearReportExport", method = RequestMethod.GET) @RequestMapping(value = "/jpInverterYearReportExport", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "逆变器年报表导出", notes = "逆变器年报表导出") @ApiOperation(httpMethod = "GET", value = "逆变器年报表导出", notes = "逆变器年报表导出")
public void jpInverterYearReportExport( String time,@RequestParam(required = false) List<String> snCodes, HttpServletResponse response) { public void jpInverterYearReportExport(@RequestParam(required = false) String time,@RequestParam(required = false) List<String> snCodes, HttpServletResponse response) {
List<JpStation> jpStation=jpStationServiceImpl.getJpStation(new JpStationDto()); List<JpStation> jpStation=jpStationServiceImpl.getJpStation(new JpStationDto());
List<String> stationIds = jpStation.stream().map(jpStation1 -> jpStation1.getThirdStationId()).collect(Collectors.toList()); List<String> stationIds = jpStation.stream().map(jpStation1 -> jpStation1.getThirdStationId()).collect(Collectors.toList());
if(StringUtils.isEmpty(time)){
time = DateUtil.format(new Date(),"yyyy");
}
List<TdHYGFInverterYearGenerate> tdHYGFInverterYearGenerates =jpInverterServiceImpl.jpInverterYearReportExport(time,snCodes,stationIds); List<TdHYGFInverterYearGenerate> tdHYGFInverterYearGenerates =jpInverterServiceImpl.jpInverterYearReportExport(time,snCodes,stationIds);
try { try {
setResponseHeadForDowload(response,"逆变器年报表.xls"); setResponseHeadForDowload(response,"逆变器年报表.xls");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment