package cn.cetc54.platform.zhyl.api; import cn.cetc54.platform.core.common.utils.ResultUtil; import cn.cetc54.platform.core.common.vo.Result; import cn.cetc54.platform.zhyl.service.ISubsidyLogService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; 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.RestController; import java.util.HashMap; import java.util.Map; /** * @author xfei * @date 2020/12/10 */ @Slf4j @RestController @Api(description = "补贴页面接口") @RequestMapping("/api/subsidy") public class SubsidyAPIController { @Autowired private ISubsidyLogService iSubsidyLogService; @GetMapping("/getTotalStatistics") @ApiOperation(value = "获取总统计数据") public Result getTotalStatistics(String areaId,Integer type){ int totalPersonNum = iSubsidyLogService.getTotalNum(areaId,type);//获取补贴的总人数 double totalMoney = iSubsidyLogService.getTotalMoney(areaId,type);//获取总金额 Map resMap = new HashMap<>(); resMap.put("totalPersonNum",totalPersonNum); resMap.put("totalMoney",totalMoney); return ResultUtil.data(resMap); } @GetMapping("/getStatistics") @ApiOperation(value = "年度月度统计数据") public Result getStatistics(String areaId,Integer type){ Map resMap = new HashMap<>(); resMap.put("monthStatistics",iSubsidyLogService.getMonthTotal(areaId,type)); resMap.put("yearStatistics",iSubsidyLogService.getYearTotal(areaId,type)); return ResultUtil.data(resMap); } }