Commit 1c3ea6f3 authored by tangwei's avatar tangwei

修改逆变器报表,电站累计满发小时数

parent db5af22f
package com.yeejoin.amos.boot.module.hygf.api.dto;
import lombok.Data;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
/**
* @description:
* @author: tw
* @createDate: 2023/11/30
*/
@Data
public class DataDto {
String time;
List<String> snCodes;
}
...@@ -263,31 +263,33 @@ public class JpInverterController extends BaseController { ...@@ -263,31 +263,33 @@ public class JpInverterController extends BaseController {
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/jpInverterDayReport") @PostMapping (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,@RequestParam(required = false) String time, @RequestParam(required = false) String snCodes) { public ResponseModel<Page<TdHYGFInverterDayGenerate>> jpInverterDayReport(@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size,
@RequestBody(required = false) DataDto dataDto) {
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)){ if(StringUtils.isEmpty(dataDto.getTime())){
time = DateUtil.format(new Date(),"yyyy-MM-dd"); dataDto.setTime(DateUtil.format(new Date(),"yyyy-MM-dd"));
} }
List<String> dd= snCodes!=null? JSON.parseArray(snCodes,String.class):null; // List<String> dd= snCodes!=null? JSON.parseArray(snCodes,String.class):null;
return ResponseHelper.buildResponse(jpInverterServiceImpl.jpInverterDayReport(current,size,time,dd,stationIds)); return ResponseHelper.buildResponse(jpInverterServiceImpl.jpInverterDayReport(current,size,dataDto.getTime(),dataDto.getSnCodes(),stationIds));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/jpInverterDayReportExport", method = RequestMethod.GET) @RequestMapping(value = "/jpInverterDayReportExport", method = RequestMethod.POST)
@ApiOperation(httpMethod = "GET", value = "逆变器日报表导出", notes = "逆变器日报表导出") @ApiOperation(httpMethod = "GET", value = "逆变器日报表导出", notes = "逆变器日报表导出")
public void jpInverterDayReportExport( @RequestParam(required = false)String time,@RequestParam(required = false) String snCodes, HttpServletResponse response) { public void jpInverterDayReportExport( @RequestBody(required = false) DataDto dataDto, 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)){ if(StringUtils.isEmpty(dataDto.getTime())){
time = DateUtil.format(new Date(),"yyyy-MM-dd"); dataDto.setTime(DateUtil.format(new Date(),"yyyy-MM-dd"));
} }
List<String> dd= snCodes!=null? JSON.parseArray(snCodes,String.class):null; //List<String> dd= snCodes!=null? JSON.parseArray(snCodes,String.class):null;
List<TdHYGFInverterDayGenerate> tdHYGFInverterDayGenerates =jpInverterServiceImpl.jpInverterDayReportExport(time,dd,stationIds); List<TdHYGFInverterDayGenerate> tdHYGFInverterDayGenerates =jpInverterServiceImpl.jpInverterDayReportExport(dataDto.getTime(),dataDto.getSnCodes(),stationIds);
try { try {
setResponseHeadForDowload(response,"逆变器日报表.xls"); setResponseHeadForDowload(response,"逆变器日报表.xls");
EasyExcel.write(response.getOutputStream()).head(TdHYGFInverterDayGenerate.class).excelType(ExcelTypeEnum.XLS).sheet("逆变器日报表").doWrite(tdHYGFInverterDayGenerates); EasyExcel.write(response.getOutputStream()).head(TdHYGFInverterDayGenerate.class).excelType(ExcelTypeEnum.XLS).sheet("逆变器日报表").doWrite(tdHYGFInverterDayGenerates);
...@@ -296,30 +298,32 @@ public class JpInverterController extends BaseController { ...@@ -296,30 +298,32 @@ public class JpInverterController extends BaseController {
} }
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/jpInverterMonthReport") @PostMapping(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,@RequestParam(required = false) String time, @RequestParam(required = false) String snCodes) { public ResponseModel<Page<TdHYGFInverterMonthGenerate>> jpInverterMonthReport(@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size,
@RequestBody(required = false) DataDto dataDto) {
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)){ if(StringUtils.isEmpty(dataDto.getTime())){
time = DateUtil.format(new Date(),"yyyy-MM"); dataDto.setTime(DateUtil.format(new Date(),"yyyy-MM-dd"));
} }
List<String> dd= snCodes!=null? JSON.parseArray(snCodes,String.class):null; // List<String> dd= snCodes!=null? JSON.parseArray(snCodes,String.class):null;
return ResponseHelper.buildResponse(jpInverterServiceImpl.jpInverterMonthReport(current,size,time,dd,stationIds)); return ResponseHelper.buildResponse(jpInverterServiceImpl.jpInverterMonthReport(current,size,dataDto.getTime(),dataDto.getSnCodes(),stationIds));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/jpInverterMonthReportExport", method = RequestMethod.GET) @RequestMapping(value = "/jpInverterMonthReportExport", method = RequestMethod.POST)
@ApiOperation(httpMethod = "GET", value = "逆变器月报表导出", notes = "逆变器月报表导出") @ApiOperation(httpMethod = "GET", value = "逆变器月报表导出", notes = "逆变器月报表导出")
public void jpInverterMonthReportExport( @RequestParam(required = false)String time,@RequestParam(required = false) String snCodes, HttpServletResponse response) { public void jpInverterMonthReportExport( @RequestBody(required = false) DataDto dataDto, 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)){ if(StringUtils.isEmpty(dataDto.getTime())){
time = DateUtil.format(new Date(),"yyyy-MM"); dataDto.setTime(DateUtil.format(new Date(),"yyyy-MM-dd"));
} }
List<String> dd= snCodes!=null? JSON.parseArray(snCodes,String.class):null; // List<String> dd= snCodes!=null? JSON.parseArray(snCodes,String.class):null;
List<TdHYGFInverterMonthGenerate> tdHYGFInverterMonthGenerates =jpInverterServiceImpl.jpInverterMonthReportExport(time,dd,stationIds); List<TdHYGFInverterMonthGenerate> tdHYGFInverterMonthGenerates =jpInverterServiceImpl.jpInverterMonthReportExport(dataDto.getTime(),dataDto.getSnCodes(),stationIds);
try { try {
setResponseHeadForDowload(response,"逆变器月报表.xls"); setResponseHeadForDowload(response,"逆变器月报表.xls");
EasyExcel.write(response.getOutputStream()).head(TdHYGFInverterMonthGenerate.class).excelType(ExcelTypeEnum.XLS).sheet("逆变器月报表").doWrite(tdHYGFInverterMonthGenerates); EasyExcel.write(response.getOutputStream()).head(TdHYGFInverterMonthGenerate.class).excelType(ExcelTypeEnum.XLS).sheet("逆变器月报表").doWrite(tdHYGFInverterMonthGenerates);
...@@ -329,30 +333,32 @@ public class JpInverterController extends BaseController { ...@@ -329,30 +333,32 @@ public class JpInverterController extends BaseController {
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/jpInverterYearReport") @PostMapping(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, @RequestParam(required = false)String time, @RequestParam(required = false) String snCodes) { public ResponseModel<Page<TdHYGFInverterYearGenerate>> jpInverterYearReport(@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size,
@RequestBody(required = false) DataDto dataDto) {
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)){ if(StringUtils.isEmpty(dataDto.getTime())){
time = DateUtil.format(new Date(),"yyyy"); dataDto.setTime(DateUtil.format(new Date(),"yyyy-MM-dd"));
} }
List<String> dd= snCodes!=null? JSON.parseArray(snCodes,String.class):null; // List<String> dd= snCodes!=null? JSON.parseArray(snCodes,String.class):null;
return ResponseHelper.buildResponse(jpInverterServiceImpl.jpInverterYearReport(current,size,time,dd,stationIds)); return ResponseHelper.buildResponse(jpInverterServiceImpl.jpInverterYearReport(current,size,dataDto.getTime(),dataDto.getSnCodes(),stationIds));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/jpInverterYearReportExport", method = RequestMethod.GET) @RequestMapping(value = "/jpInverterYearReportExport", method = RequestMethod.POST)
@ApiOperation(httpMethod = "GET", value = "逆变器年报表导出", notes = "逆变器年报表导出") @ApiOperation(httpMethod = "GET", value = "逆变器年报表导出", notes = "逆变器年报表导出")
public void jpInverterYearReportExport(@RequestParam(required = false) String time,@RequestParam(required = false) String snCodes, HttpServletResponse response) { public void jpInverterYearReportExport(@RequestBody(required = false) DataDto dataDto, 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)){ if(StringUtils.isEmpty(dataDto.getTime())){
time = DateUtil.format(new Date(),"yyyy"); dataDto.setTime(DateUtil.format(new Date(),"yyyy-MM-dd"));
} }
List<String> dd= snCodes!=null? JSON.parseArray(snCodes,String.class):null; // List<String> dd= snCodes!=null? JSON.parseArray(snCodes,String.class):null;
List<TdHYGFInverterYearGenerate> tdHYGFInverterYearGenerates =jpInverterServiceImpl.jpInverterYearReportExport(time,dd,stationIds); List<TdHYGFInverterYearGenerate> tdHYGFInverterYearGenerates =jpInverterServiceImpl.jpInverterYearReportExport(dataDto.getTime(),dataDto.getSnCodes(),stationIds);
try { try {
setResponseHeadForDowload(response,"逆变器年报表.xls"); setResponseHeadForDowload(response,"逆变器年报表.xls");
EasyExcel.write(response.getOutputStream()).head(TdHYGFInverterYearGenerate.class).excelType(ExcelTypeEnum.XLS).sheet("逆变器年报表").doWrite(tdHYGFInverterYearGenerates); EasyExcel.write(response.getOutputStream()).head(TdHYGFInverterYearGenerate.class).excelType(ExcelTypeEnum.XLS).sheet("逆变器年报表").doWrite(tdHYGFInverterYearGenerates);
......
...@@ -456,7 +456,7 @@ public class JpStationServiceImpl extends BaseService<JpStationDto,JpStation,JpS ...@@ -456,7 +456,7 @@ public class JpStationServiceImpl extends BaseService<JpStationDto,JpStation,JpS
hd.setState(jpStation.getState()); hd.setState(jpStation.getState());
hd.setThirdStationId(jpStation.getThirdStationId()); hd.setThirdStationId(jpStation.getThirdStationId());
hd.setAccumulatedPower(jpStation.getAccumulatedPower()!=null?jpStation.getAccumulatedPower()*FD:null); hd.setAccumulatedPower(jpStation.getAccumulatedPower()!=null?jpStation.getAccumulatedPower()*FD:null);
hd.setFullhour(Double.valueOf(String.format("%.2f", jpStation.getAccumulatedPower()*FD/jpStation.getRatedPower()))); hd.setFullhour(Double.valueOf(String.format("%.2f", jpStation.getAccumulatedPower()*FD/jpStation.getCapacity())));
hd.setCumulativeIncome(jpStation.getCumulativeIncome()); hd.setCumulativeIncome(jpStation.getCumulativeIncome());
ld.add(hd); ld.add(hd);
} }
......
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