package com.huaxu.controller; import com.huaxu.dto.MonthRevenueDto; import com.huaxu.dto.generalView.DeviceWaterSupply; import com.huaxu.model.AjaxMessage; import com.huaxu.model.ResultStatus; import com.huaxu.service.AppPageReportService; import com.huaxu.service.HomePageReportService; import com.huaxu.service.RevenueService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import java.time.LocalDate; import java.util.ArrayList; import java.util.List; /** * @description * @auto wangbo * @data 2021/3/18 10:50 */ @RestController @RequestMapping("/appPageReport") @Api(tags = "App总览报表") public class AppPageReportController { @Autowired private AppPageReportService appPageReportService; @Autowired private RevenueService revenueService; /** * App生产总览数据-本月数据 * @param companyOrgId * @return */ @RequestMapping(value = "getProductionDataForSameMonth",method = RequestMethod.GET) @ApiOperation(value = "App总览——生产数据(本月)") public AjaxMessage> getProductionDataForMonth( @ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Integer companyOrgId){ List result = new ArrayList(); result.addAll(appPageReportService.deviceWaterReportForMonth(companyOrgId,"水源",4,1)); result.addAll(appPageReportService.deviceWaterReportForMonth(companyOrgId,"水厂",3,1)); result.addAll(appPageReportService.deviceSellerWaterReportForMonth(companyOrgId,1)); return new AjaxMessage<>(ResultStatus.OK,result); } /** * App生产总览数据-本年数据 * @param companyOrgId * @return */ @RequestMapping(value = "getProductionDataForSameYear",method = RequestMethod.GET) @ApiOperation(value = "App总览——生产数据(本月)") public AjaxMessage> getProductionDataForSameYear( @ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Integer companyOrgId){ LocalDate localDate = LocalDate.now(); List result = new ArrayList(); result.addAll(appPageReportService.deviceWaterReportForMonth(companyOrgId,"水源",4,localDate.getMonthValue())); result.addAll(appPageReportService.deviceWaterReportForMonth(companyOrgId,"水厂",3,localDate.getMonthValue())); result.addAll(appPageReportService.deviceSellerWaterReportForMonth(companyOrgId,localDate.getMonthValue())); return new AjaxMessage<>(ResultStatus.OK,result); } /** * App生产总览数据-近一年数据 * @param companyOrgId * @return */ @RequestMapping(value = "getProductionDataFor12Month",method = RequestMethod.GET) @ApiOperation(value = "App总览——生产数据(本月)") public AjaxMessage> getProductionDataFor12Month( @ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Integer companyOrgId){ List result = new ArrayList(); result.addAll(appPageReportService.deviceWaterReportForMonth(companyOrgId,"水源",4,12)); result.addAll(appPageReportService.deviceWaterReportForMonth(companyOrgId,"水厂",3,12)); result.addAll(appPageReportService.deviceSellerWaterReportForMonth(companyOrgId,12)); return new AjaxMessage<>(ResultStatus.OK,result); } }