mitao
2025-01-17 922d7aa03200fa293bbce565d43c58995ec58548
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
package com.zzg.web.controller.state;
 
import com.github.pagehelper.PageInfo;
import com.zzg.common.constant.state.UrlConstants;
import com.zzg.common.core.domain.AjaxResult;
import com.zzg.system.domain.bo.PlacementStatisticsBO;
import com.zzg.system.domain.bo.ProjectStatisticsBO;
import com.zzg.system.domain.vo.*;
import com.zzg.system.service.state.StateDateCenterService;
import lombok.RequiredArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.*;
 
import java.text.ParseException;
import java.util.Date;
import java.util.List;
 
@RestController
@RequiredArgsConstructor
public class StateDataCenterController {
 
    private final StateDateCenterService dateCenterService;
    // 计算最上面顶部统计数据
    @GetMapping(UrlConstants.STATE_DATA_CENTER_SUM)
    public AjaxResult<ProjectAnalysisSumVO> dataCenterSum(
            @RequestParam(required = false) String location,
            @RequestParam(required = false) Integer projectStatus,
            @RequestParam(required = false)
            @DateTimeFormat(pattern = "yyyy-MM-dd") Date projectStartTime
    ) {
        return AjaxResult.success(dateCenterService.projectSumCount(location, projectStatus, projectStartTime));
    }
    // 项目统计-模拟征收超期项目
    @PostMapping(UrlConstants.STATE_DATA_CENTER_SUM_EXPIRED)
    public AjaxResult<PageInfo<ProjectStatusExpiredVO>> sumExpiredAgreement(@RequestBody(required = false) ProjectStatisticsBO statisticsBO) {
        return AjaxResult.success(dateCenterService.expiredProjectStatus(statisticsBO));
    }
 
    // 安置情况 获取数据中心安置情况模块 中间的饼图
    @GetMapping(UrlConstants.STATE_DATA_CENTER_PLACEMENT_STATISTICS)
    public AjaxResult<PlacementStatisticsVO> stateDataCenterPlacementStatistics
    (
            @RequestParam(required = false) String projectStreet,
            @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd") Date projectStartTime,
            @RequestParam(required = false)  Integer type
            //type 首页传1  安置传2
    ) {
        return AjaxResult.success(dateCenterService.placementStatistics(projectStreet, projectStartTime,type));
    }
    // 数据中心-安置情况柱状图
    @GetMapping(UrlConstants.STATE_DATA_CENTER_PLACEMENT_STATISTICS_STREET)
    public AjaxResult<PlacementStreetVO> stateDataCenterPlacementStatisticsStreet(
            @RequestParam(required = false) String projectStreet,
            @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd") Date projectStartTime
    ) {
        return AjaxResult.success(dateCenterService.sumPlacementStreet(projectStreet, projectStartTime));
    }
   // 获取数据中心安置情况模块 下方的分页查询
    @PostMapping(UrlConstants.STATE_DATA_CENTER_PLACEMENT_STATISTICS_PAGE)
    public AjaxResult<PageInfo<TransitionPageVO>> stateDataCenterPlacementStatisticsPage(
            @RequestBody PlacementStatisticsBO placementStatisticsBO
    ) throws ParseException {
        return AjaxResult.success(dateCenterService.placementStatisticsPage(placementStatisticsBO));
    }
 
    //项目资金 数据中心-项目资产统计 左侧数据
    @GetMapping(UrlConstants.STATE_DATA_CENTER_ASSET_SUM_MONEY)
    public AjaxResult<AssetMoneyVO> stateCenterAssetSumMoney(
            @RequestParam(required = false)
            @DateTimeFormat(pattern = "yyyy-MM-dd") Date projectStartTime
    ) {
        return AjaxResult.success(dateCenterService.sumAssetMoney(projectStartTime));
    }
    // 数据中心-项目资产统计 右侧柱状图
    @GetMapping(UrlConstants.STATE_DATA_CENTER_ASSET_SUM_MONEY_GRAPH)
    public AjaxResult<List<AssetGraphVO>> stateCenterAssetSumGraph(
            @RequestParam(required = false)
            @DateTimeFormat(pattern = "yyyy-MM-dd") Date projectStartTime
    ) {
        return AjaxResult.success(dateCenterService.listAssetGraph(projectStartTime));
    }
}