| | |
| | | package com.ruoyi.account.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.dto.ReportDateDto; |
| | | import com.ruoyi.account.bean.dto.ReportDateDto; |
| | | import com.ruoyi.account.pojo.AccountExpense; |
| | | import com.ruoyi.account.service.AccountExpenseService; |
| | | import com.ruoyi.account.service.AccountIncomeService; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.dto.DateQueryDto; |
| | | import com.ruoyi.framework.security.LoginUser; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import jakarta.annotation.Resource; |
| | |
| | | @RestController |
| | | @RequestMapping("/account/accountExpense") |
| | | @Tag(name = "财务管理--支出管理") |
| | | public class AccountExpenseController { |
| | | public class AccountExpenseController extends BaseController { |
| | | |
| | | @Resource |
| | | private AccountExpenseService accountExpenseService; |
| | |
| | | */ |
| | | @PostMapping("/add") |
| | | @Operation(summary = "新增") |
| | | public AjaxResult add(@RequestBody AccountExpense accountExpense) { |
| | | public R<?> add(@RequestBody AccountExpense accountExpense) { |
| | | accountExpense.setInputTime(new Date()); |
| | | LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | accountExpense.setInputUser(loginUser.getNickName()); |
| | | return AjaxResult.success(accountExpenseService.save(accountExpense)); |
| | | return R.ok(accountExpenseService.save(accountExpense)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @DeleteMapping("/del") |
| | | @Operation(summary = "删除") |
| | | public AjaxResult delQualityInspect(@RequestBody List<Integer> ids) { |
| | | public R<?> delQualityInspect(@RequestBody List<Integer> ids) { |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | return AjaxResult.error("请选择至少一条数据"); |
| | | return R.fail("请选择至少一条数据"); |
| | | } |
| | | //删除检验单 |
| | | return AjaxResult.success(accountExpenseService.removeBatchByIds(ids)); |
| | | return R.ok(accountExpenseService.removeBatchByIds(ids)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @PostMapping("/update") |
| | | @Operation(summary = "修改") |
| | | public AjaxResult update(@RequestBody AccountExpense accountExpense) { |
| | | return AjaxResult.success(accountExpenseService.updateById(accountExpense)); |
| | | public R<?> update(@RequestBody AccountExpense accountExpense) { |
| | | return R.ok(accountExpenseService.updateById(accountExpense)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @GetMapping("/listPage") |
| | | @Operation(summary = "分页查询") |
| | | public AjaxResult accountExpenseListPage(Page page, AccountExpense accountExpense) { |
| | | return AjaxResult.success(accountExpenseService.accountExpenseListPage(page, accountExpense)); |
| | | public R<?> accountExpenseListPage(Page page, AccountExpense accountExpense) { |
| | | return R.ok(accountExpenseService.accountExpenseListPage(page, accountExpense)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @GetMapping("/{id}") |
| | | @Operation(summary = "详情") |
| | | public AjaxResult accountExpenseDetail(@PathVariable("id") Integer id) { |
| | | return AjaxResult.success(accountExpenseService.getById(id)); |
| | | public R<?> accountExpenseDetail(@PathVariable("id") Integer id) { |
| | | return R.ok(accountExpenseService.getById(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @GetMapping("/report/forms") |
| | | @Operation(summary = "财务报表图表查询") |
| | | public AjaxResult report(DateQueryDto dateQueryDto) { |
| | | return AjaxResult.success(accountExpenseService.report(dateQueryDto)); |
| | | public R<?> report(DateQueryDto dateQueryDto) { |
| | | return R.ok(accountExpenseService.report(dateQueryDto)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @GetMapping("/report/analysis") |
| | | @Operation(summary = "财务报表-财务分析") |
| | | public AjaxResult analysis() { |
| | | return AjaxResult.success(accountExpenseService.analysis()); |
| | | public R<?> analysis() { |
| | | return R.ok(accountExpenseService.analysis()); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @GetMapping("/report/income") |
| | | @Operation(summary = "财务报表图表收入年度查询") |
| | | public AjaxResult reportIncome(ReportDateDto reportDateDto) { |
| | | return AjaxResult.success(accountIncomeService.reportIncome(reportDateDto)); |
| | | public R<?> reportIncome(ReportDateDto reportDateDto) { |
| | | return R.ok(accountIncomeService.reportIncome(reportDateDto)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @GetMapping("/report/expense") |
| | | @Operation(summary = "财务报表图表支出年度查询") |
| | | public AjaxResult reportExpense(ReportDateDto reportDateDto) { |
| | | return AjaxResult.success(accountExpenseService.reportExpense(reportDateDto)); |
| | | public R<?> reportExpense(ReportDateDto reportDateDto) { |
| | | return R.ok(accountExpenseService.reportExpense(reportDateDto)); |
| | | } |
| | | |
| | | |