diff --git a/jero-boot-incoming-payment/src/main/java/com/jero/index/contoller/IndexController.java b/jero-boot-incoming-payment/src/main/java/com/jero/index/contoller/IndexController.java index b54e5e80..9045dcb4 100644 --- a/jero-boot-incoming-payment/src/main/java/com/jero/index/contoller/IndexController.java +++ b/jero-boot-incoming-payment/src/main/java/com/jero/index/contoller/IndexController.java @@ -4,23 +4,17 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.jero.common.api.vo.Result; import com.jero.common.aspect.annotation.DictPoint; -import com.jero.common.system.api.ISysBaseAPI; -import com.jero.common.util.oConvertUtils; import com.jero.index.service.IndexService; import com.jero.index.vo.*; -import com.jero.project.service.IPayWorkingGroupService; -import com.jero.statistics.entity.AllMoney; import com.jero.statistics.entity.AllProjectStatistics; import com.jero.statistics.entity.AllProjectStatisticsOther; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.ObjectUtils; import org.jeecgframework.poi.excel.def.NormalExcelConstants; import org.jeecgframework.poi.excel.entity.ExportParams; import org.jeecgframework.poi.excel.entity.enmus.ExcelType; import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; @@ -28,7 +22,6 @@ import org.springframework.web.bind.annotation.RestController; import org.springframework.web.servlet.ModelAndView; import javax.annotation.Resource; -import java.text.DecimalFormat; import java.util.HashMap; import java.util.List; import java.util.Objects; @@ -54,8 +47,8 @@ public class IndexController { @ApiOperation(value = "折线图列表") @GetMapping(value = "/lineChartList") - public Result> lineChartList() { - List list = indexService.lineChartList(); + public Result> lineChartList(@RequestParam(name = "year",required = false) String year) { + List list = indexService.lineChartList(year); return Result.OK(list); } @@ -68,15 +61,15 @@ public class IndexController { @ApiOperation(value = "累计图列表") @GetMapping(value = "/cumulativeGraphList") - public Result> cumulativeGraphList() { - List list = indexService.cumulativeGraphList(); + public Result> cumulativeGraphList(@RequestParam(name = "year",required = false) String year) { + List list = indexService.cumulativeGraphList(year); return Result.OK(list); } @ApiOperation(value = "科室总体统计") @GetMapping(value = "/overallDepartmentStatistics") - public Result> overallDepartmentStatistics() { - List histogramVOS = indexService.overallDepartmentStatistics(); + public Result> overallDepartmentStatistics(@RequestParam(name = "year",required = false) String year) { + List histogramVOS = indexService.overallDepartmentStatistics(year); return Result.OK(histogramVOS); } diff --git a/jero-boot-incoming-payment/src/main/java/com/jero/index/service/IndexService.java b/jero-boot-incoming-payment/src/main/java/com/jero/index/service/IndexService.java index deddf745..6aeba295 100644 --- a/jero-boot-incoming-payment/src/main/java/com/jero/index/service/IndexService.java +++ b/jero-boot-incoming-payment/src/main/java/com/jero/index/service/IndexService.java @@ -60,8 +60,10 @@ public class IndexService { } - public List lineChartList() { - String year = String.valueOf(DateUtil.year(new DateTime())); + public List lineChartList(String year) { + if(StringUtils.isBlank(year)){ + year = String.valueOf(DateUtil.year(new DateTime())); + } AllProjectStatisticsSearch allProjectStatisticsSearch = new AllProjectStatisticsSearch(); allProjectStatisticsSearch.setPaymentYear(year); List list = payWorkingGroupService.queryListAllProjectMoney(allProjectStatisticsSearch, null); @@ -140,8 +142,10 @@ public class IndexService { return lineChartVO; } - public List cumulativeGraphList() { - String year = String.valueOf(DateUtil.year(new DateTime())); + public List cumulativeGraphList(String year) { + if(StringUtils.isBlank(year)){ + year = String.valueOf(DateUtil.year(new DateTime())); + } AllProjectStatisticsSearch allProjectStatisticsSearch = new AllProjectStatisticsSearch(); allProjectStatisticsSearch.setPaymentYear(year); List list = payWorkingGroupService.cumulativeListAllProjectMoney(allProjectStatisticsSearch); @@ -189,9 +193,10 @@ public class IndexService { return list; } - public List overallDepartmentStatistics() { - - String year = String.valueOf(DateUtil.year(new DateTime())); + public List overallDepartmentStatistics(String year) { + if(StringUtils.isBlank(year)){ + year = String.valueOf(DateUtil.year(new DateTime())); + } List records = payWorkingGroupMapper.overallDepartmentStatistics(year); List all = payWorkingGroupMapper.allDepartmentStatistics(year); for (DepartStatistics a : all) {