| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- package com.zksy.controller.property;
- import com.zksy.property.domain.AReceiptInfo;
- import com.zksy.property.service.AReceiptInfoService;
- import com.zksy.utils.AjaxResult;
- 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.*;
- import java.time.LocalDateTime;
- import java.util.Arrays;
- /**
- * @author Administrator
- * @version 1.0
- * @project enterprise-assets-service
- * @description 收据控制层
- * @date 2025/6/24 14:33:13
- */
- @RestController
- @RequestMapping("/AReceiptInfo")
- @Api(tags = "收据信息",description = "收据信息desc")
- public class AReceiptInfoController {
- @Autowired
- private AReceiptInfoService service;
- @GetMapping("/findByPage")
- @ApiOperation(value = "收据信息查询分页")
- public AjaxResult findByPage(long pageNum, long pageSize, String receiptNumber,String payer,String paymentMethod,String generationDate){
- return AjaxResult.success(service.findByPage(pageNum, pageSize, receiptNumber,payer,paymentMethod,generationDate));
- }
- @GetMapping("/findByPageWithContract")
- @ApiOperation(value = "收据信息查询分页")
- public AjaxResult findByPageWithContract(long pageNum, long pageSize, String receiptNumber,String payer,String paymentMethod,String contractNumber){
- return AjaxResult.success(service.findByPageWithContract(pageNum, pageSize, receiptNumber,payer,paymentMethod,contractNumber));
- }
- @GetMapping("/getAReceiptInfoList")
- @ApiOperation(value = "收据信息查询")
- public AjaxResult getAReceiptInfoList(String receiptNumber,String payer,String paymentMethod,String generationDate){
- return AjaxResult.success(service.getAReceiptInfoList(receiptNumber,payer,paymentMethod,generationDate));
- }
- @GetMapping("/getById/{id}")
- @ApiOperation(value = "根据Id查询收据信息")
- public AjaxResult getById(@PathVariable String id){
- return AjaxResult.success(service.getById(id));
- }
- @PostMapping("/save")
- @ApiOperation(value = "收据信息保存")
- public AjaxResult save(@RequestBody AReceiptInfo entity) {
- return service.save(entity) ? AjaxResult.success(entity) : AjaxResult.error("保存失败");
- }
- @PostMapping("/update")
- @ApiOperation(value = "收据信息修改")
- public AjaxResult update(@RequestBody AReceiptInfo entity) {
- entity.setUpdateTime(LocalDateTime.now());
- return service.updateById(entity) ? AjaxResult.success(entity) : AjaxResult.error("修改失败");
- }
- @PostMapping("/deleteBatch")
- @ApiOperation(value = "收据信息删除")
- public AjaxResult delete(@RequestBody String[] ids) {
- return service.removeBatchByIdsWithUrl(Arrays.asList(ids)) ? AjaxResult.success("删除成功") : AjaxResult.error("删除失败");
- }
- @GetMapping("/calculateMonthlyStatistics")
- @ApiOperation(value = "计算某年每月的收缴金额")
- public AjaxResult calculateMonthlyStatistics(int year) {
- return AjaxResult.success(service.calculateMonthlyStatistics(year));
- }
- @GetMapping("/calculateQuarterlyStatistics")
- @ApiOperation(value = "计算某年每季度的收缴金额")
- public AjaxResult calculateQuarterlyStatistics(int year) {
- return AjaxResult.success(service.calculateQuarterlyStatistics(year));
- }
- @GetMapping("/calculateYearlyStatistics")
- @ApiOperation(value = "计算某年的收缴金额")
- public AjaxResult calculateYearlyStatistics() {
- return AjaxResult.success(service.calculateYearlyStatistics());
- }
- @GetMapping("/getExistingYears")
- @ApiOperation(value = "获取已存在的年份")
- public AjaxResult getExistingYears() {
- return AjaxResult.success(service.getExistingYears());
- }
- /**
- * 获取收据汇总报表
- * @return 汇总数据列表
- */
- /* @GetMapping("/getReceiptReport")
- @ApiOperation("获取收据汇总报表(按年/按月)")
- @ApiImplicitParams({
- @ApiImplicitParam(name = "year", value = "年份", required = true, dataType = "int", defaultValue = "2025"),
- @ApiImplicitParam(name = "month", value = "月份", required = false, dataType = "int", defaultValue = "11")
- })
- public AjaxResult getReceiptReport(Integer year, Integer month) {
- return AjaxResult.success(service.getReceiptReport(year, month));
- }*/
- @GetMapping("/receipt/stat/year")
- @ApiOperation("按年统计收据金额(返回1-12月数据)")
- public AjaxResult statByYear(
- @ApiParam("年份,如2024") @RequestParam Integer year,
- @ApiParam("输入:公租房/创新创业基地/厂房") @RequestParam String assetType) {
- return AjaxResult.success(service.statReceiptDetailByYear(year,assetType));
- }
- @GetMapping("/receipt/stat/month")
- @ApiOperation("按月统计收据金额(返回当月所有日期数据)")
- public AjaxResult statByMonth(
- @ApiParam("年份,如2024") @RequestParam Integer year,
- @ApiParam("月份,1-12") @RequestParam Integer month,
- @ApiParam("输入:公租房/创新创业基地/厂房") @RequestParam String assetType) {
- return AjaxResult.success(service.statReceiptDetailByMonth(year, month,assetType));
- }
- @GetMapping("/receipt/stat/day")
- @ApiOperation("按月统计收据金额(月详情)")
- public AjaxResult statByDay(
- @ApiParam("年份,如2024") @RequestParam Integer year,
- @ApiParam("月份,1-12") @RequestParam Integer month,
- @ApiParam("输入:公租房/创新创业基地/厂房") @RequestParam String assetType) {
- return AjaxResult.success(service.statReceiptDetailByDay(year, month,assetType));
- }
- }
|