huminmin
6 天以前 d06ef3f44d6dc19dae223ab420165369ea13cc16
src/main/java/com/ruoyi/account/controller/AccountExpenseController.java
@@ -8,7 +8,8 @@
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;
@@ -25,7 +26,7 @@
@RestController
@RequestMapping("/account/accountExpense")
@Tag(name = "财务管理--支出管理")
public class AccountExpenseController {
public class AccountExpenseController extends BaseController {
    @Resource
    private AccountExpenseService accountExpenseService;
@@ -41,11 +42,11 @@
     */
    @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));
    }
    /**
@@ -55,12 +56,12 @@
     */
    @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));
    }
    /**
@@ -70,8 +71,8 @@
     */
    @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));
    }
    /**
@@ -82,8 +83,8 @@
     */
    @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));
    }
    /**
@@ -93,8 +94,8 @@
     */
    @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));
    }
    /**
@@ -115,8 +116,8 @@
     */
    @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));
    }
    /**
@@ -125,8 +126,8 @@
     */
    @GetMapping("/report/analysis")
    @Operation(summary = "财务报表-财务分析")
    public AjaxResult analysis() {
        return AjaxResult.success(accountExpenseService.analysis());
    public R<?> analysis() {
        return R.ok(accountExpenseService.analysis());
    }
    /**
@@ -136,8 +137,8 @@
     */
    @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));
    }
    /**
@@ -147,8 +148,8 @@
     */
    @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));
    }