add 首页统计-》 科室总体统计,前十统计
This commit is contained in:
+6
-3
@@ -2,6 +2,7 @@ package com.jero.index.contoller;
|
||||
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.index.service.IndexService;
|
||||
import com.jero.index.vo.HistogramVO;
|
||||
import com.jero.index.vo.LineChartListVO;
|
||||
import com.jero.index.vo.LineChartVO;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -56,8 +57,9 @@ public class IndexController {
|
||||
|
||||
@ApiOperation(value = "科室总体统计")
|
||||
@GetMapping(value = "/overallDepartmentStatistics")
|
||||
public Result<?> overallDepartmentStatistics() {
|
||||
return Result.OK();
|
||||
public Result<List<HistogramVO>> overallDepartmentStatistics() {
|
||||
List<HistogramVO> histogramVOS = indexService.overallDepartmentStatistics();
|
||||
return Result.OK(histogramVOS);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "总金额分类统计")
|
||||
@@ -75,6 +77,7 @@ public class IndexController {
|
||||
@ApiOperation(value = "前十统计")
|
||||
@GetMapping(value = "/top10Statistics")
|
||||
public Result<?> top10Statistics() {
|
||||
return Result.OK();
|
||||
List<HistogramVO> histogramVOS = indexService.top10Statistics();
|
||||
return Result.OK(histogramVOS);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
package com.jero.index.service;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.jero.index.vo.HistogramVO;
|
||||
import com.jero.index.vo.LineChartListVO;
|
||||
import com.jero.index.vo.LineChartVO;
|
||||
import com.jero.project.service.IPayWorkingGroupService;
|
||||
import com.jero.statistics.entity.AllProjectStatistics;
|
||||
import com.jero.statistics.entity.AllProjectStatisticsSearch;
|
||||
import com.jero.statistics.entity.*;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -149,4 +151,57 @@ public class IndexService {
|
||||
return list;
|
||||
}
|
||||
|
||||
public List<HistogramVO> overallDepartmentStatistics() {
|
||||
String year = String.valueOf(DateUtil.year(new DateTime()));
|
||||
DepartStatisticsSearch departStatisticsSearch = new DepartStatisticsSearch();
|
||||
departStatisticsSearch.setPaymentYear(year);
|
||||
Page<DepartStatistics> page = new Page<>(-1, -1);
|
||||
IPage<DepartStatistics> pageList = payWorkingGroupService.queryPageListDepartment(page, departStatisticsSearch, new ArrayList<>());
|
||||
List<DepartStatistics> records = pageList.getRecords();
|
||||
|
||||
return convertDepartStatistics(records);
|
||||
}
|
||||
|
||||
private List<HistogramVO> convertDepartStatistics(List<DepartStatistics> list){
|
||||
List<HistogramVO> histogramVOlist=Lists.newArrayList();
|
||||
for (DepartStatistics departStatistics :list) {
|
||||
HistogramVO histogramVO = new HistogramVO();
|
||||
histogramVO.setName(departStatistics.getDepartName());
|
||||
histogramVO.setConfirmAmount(departStatistics.getConfirmAmount());
|
||||
histogramVO.setAllMoney(departStatistics.getAllMoney());
|
||||
histogramVOlist.add(histogramVO);
|
||||
}
|
||||
return histogramVOlist;
|
||||
}
|
||||
|
||||
public List<HistogramVO> top10Statistics() {
|
||||
String year = String.valueOf(DateUtil.year(new DateTime()));
|
||||
Page<CompanyComeMoneyList> page = new Page<>(1, 10);
|
||||
CompanyComeMoneySearch companyComeMoneySearch = new CompanyComeMoneySearch();
|
||||
companyComeMoneySearch.setYear(year);
|
||||
companyComeMoneySearch.setColumn("allMoney");
|
||||
companyComeMoneySearch.setOrder("desc");
|
||||
IPage<CompanyComeMoneyList> pageList = payWorkingGroupService.queryPageListForCompany(page, companyComeMoneySearch, null);
|
||||
List<CompanyComeMoneyList> records = pageList.getRecords();
|
||||
|
||||
return convertCompanyComeMoneyList(records);
|
||||
}
|
||||
|
||||
private List<HistogramVO> convertCompanyComeMoneyList(List<CompanyComeMoneyList> list) {
|
||||
List<HistogramVO> histogramVOlist=Lists.newArrayList();
|
||||
for (CompanyComeMoneyList companyComeMoneyList :list) {
|
||||
histogramVOlist.add(convertFromCompanyComeMoneyList(companyComeMoneyList));
|
||||
}
|
||||
return histogramVOlist;
|
||||
}
|
||||
|
||||
private HistogramVO convertFromCompanyComeMoneyList(CompanyComeMoneyList companyComeMoneyList) {
|
||||
HistogramVO histogramVO = new HistogramVO();
|
||||
histogramVO.setAllMoney(companyComeMoneyList.getAllMoney());
|
||||
histogramVO.setConfirmAmount(companyComeMoneyList.getConfirmAmount());
|
||||
histogramVO.setName(companyComeMoneyList.getChargeCompanyName());
|
||||
return histogramVO;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.jero.index.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author liJiaRao
|
||||
* @date 2022-09-02 10:45
|
||||
*/
|
||||
@Data
|
||||
public class HistogramVO {
|
||||
@ApiModelProperty(value = "合同金额")
|
||||
private String allMoney;
|
||||
|
||||
@ApiModelProperty(value = "确认收入金额")
|
||||
private String confirmAmount;
|
||||
|
||||
@ApiModelProperty(value = "名字")
|
||||
private String name;
|
||||
}
|
||||
Reference in New Issue
Block a user