AReceiptInfoController.java 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. package com.zksy.controller.property;
  2. import com.zksy.property.domain.AReceiptInfo;
  3. import com.zksy.property.service.AReceiptInfoService;
  4. import com.zksy.utils.AjaxResult;
  5. import io.swagger.annotations.Api;
  6. import io.swagger.annotations.ApiOperation;
  7. import io.swagger.annotations.ApiParam;
  8. import org.springframework.beans.factory.annotation.Autowired;
  9. import org.springframework.web.bind.annotation.*;
  10. import java.time.LocalDateTime;
  11. import java.util.Arrays;
  12. /**
  13. * @author Administrator
  14. * @version 1.0
  15. * @project enterprise-assets-service
  16. * @description 收据控制层
  17. * @date 2025/6/24 14:33:13
  18. */
  19. @RestController
  20. @RequestMapping("/AReceiptInfo")
  21. @Api(tags = "收据信息",description = "收据信息desc")
  22. public class AReceiptInfoController {
  23. @Autowired
  24. private AReceiptInfoService service;
  25. @GetMapping("/findByPage")
  26. @ApiOperation(value = "收据信息查询分页")
  27. public AjaxResult findByPage(long pageNum, long pageSize, String receiptNumber,String payer,String paymentMethod,String generationDate){
  28. return AjaxResult.success(service.findByPage(pageNum, pageSize, receiptNumber,payer,paymentMethod,generationDate));
  29. }
  30. @GetMapping("/findByPageWithContract")
  31. @ApiOperation(value = "收据信息查询分页")
  32. public AjaxResult findByPageWithContract(long pageNum, long pageSize, String receiptNumber,String payer,String paymentMethod,String contractNumber){
  33. return AjaxResult.success(service.findByPageWithContract(pageNum, pageSize, receiptNumber,payer,paymentMethod,contractNumber));
  34. }
  35. @GetMapping("/getAReceiptInfoList")
  36. @ApiOperation(value = "收据信息查询")
  37. public AjaxResult getAReceiptInfoList(String receiptNumber,String payer,String paymentMethod,String generationDate){
  38. return AjaxResult.success(service.getAReceiptInfoList(receiptNumber,payer,paymentMethod,generationDate));
  39. }
  40. @GetMapping("/getById/{id}")
  41. @ApiOperation(value = "根据Id查询收据信息")
  42. public AjaxResult getById(@PathVariable String id){
  43. return AjaxResult.success(service.getById(id));
  44. }
  45. @PostMapping("/save")
  46. @ApiOperation(value = "收据信息保存")
  47. public AjaxResult save(@RequestBody AReceiptInfo entity) {
  48. return service.save(entity) ? AjaxResult.success(entity) : AjaxResult.error("保存失败");
  49. }
  50. @PostMapping("/update")
  51. @ApiOperation(value = "收据信息修改")
  52. public AjaxResult update(@RequestBody AReceiptInfo entity) {
  53. entity.setUpdateTime(LocalDateTime.now());
  54. return service.updateById(entity) ? AjaxResult.success(entity) : AjaxResult.error("修改失败");
  55. }
  56. @PostMapping("/deleteBatch")
  57. @ApiOperation(value = "收据信息删除")
  58. public AjaxResult delete(@RequestBody String[] ids) {
  59. return service.removeBatchByIdsWithUrl(Arrays.asList(ids)) ? AjaxResult.success("删除成功") : AjaxResult.error("删除失败");
  60. }
  61. @GetMapping("/calculateMonthlyStatistics")
  62. @ApiOperation(value = "计算某年每月的收缴金额")
  63. public AjaxResult calculateMonthlyStatistics(int year) {
  64. return AjaxResult.success(service.calculateMonthlyStatistics(year));
  65. }
  66. @GetMapping("/calculateQuarterlyStatistics")
  67. @ApiOperation(value = "计算某年每季度的收缴金额")
  68. public AjaxResult calculateQuarterlyStatistics(int year) {
  69. return AjaxResult.success(service.calculateQuarterlyStatistics(year));
  70. }
  71. @GetMapping("/calculateYearlyStatistics")
  72. @ApiOperation(value = "计算某年的收缴金额")
  73. public AjaxResult calculateYearlyStatistics() {
  74. return AjaxResult.success(service.calculateYearlyStatistics());
  75. }
  76. @GetMapping("/getExistingYears")
  77. @ApiOperation(value = "获取已存在的年份")
  78. public AjaxResult getExistingYears() {
  79. return AjaxResult.success(service.getExistingYears());
  80. }
  81. /**
  82. * 获取收据汇总报表
  83. * @return 汇总数据列表
  84. */
  85. /* @GetMapping("/getReceiptReport")
  86. @ApiOperation("获取收据汇总报表(按年/按月)")
  87. @ApiImplicitParams({
  88. @ApiImplicitParam(name = "year", value = "年份", required = true, dataType = "int", defaultValue = "2025"),
  89. @ApiImplicitParam(name = "month", value = "月份", required = false, dataType = "int", defaultValue = "11")
  90. })
  91. public AjaxResult getReceiptReport(Integer year, Integer month) {
  92. return AjaxResult.success(service.getReceiptReport(year, month));
  93. }*/
  94. @GetMapping("/receipt/stat/year")
  95. @ApiOperation("按年统计收据金额(返回1-12月数据)")
  96. public AjaxResult statByYear(
  97. @ApiParam("年份,如2024") @RequestParam Integer year,
  98. @ApiParam("输入:公租房/创新创业基地/厂房") @RequestParam String assetType) {
  99. return AjaxResult.success(service.statReceiptDetailByYear(year,assetType));
  100. }
  101. @GetMapping("/receipt/stat/month")
  102. @ApiOperation("按月统计收据金额(返回当月所有日期数据)")
  103. public AjaxResult statByMonth(
  104. @ApiParam("年份,如2024") @RequestParam Integer year,
  105. @ApiParam("月份,1-12") @RequestParam Integer month,
  106. @ApiParam("输入:公租房/创新创业基地/厂房") @RequestParam String assetType) {
  107. return AjaxResult.success(service.statReceiptDetailByMonth(year, month,assetType));
  108. }
  109. @GetMapping("/receipt/stat/day")
  110. @ApiOperation("按月统计收据金额(月详情)")
  111. public AjaxResult statByDay(
  112. @ApiParam("年份,如2024") @RequestParam Integer year,
  113. @ApiParam("月份,1-12") @RequestParam Integer month,
  114. @ApiParam("输入:公租房/创新创业基地/厂房") @RequestParam String assetType) {
  115. return AjaxResult.success(service.statReceiptDetailByDay(year, month,assetType));
  116. }
  117. }