大屏项目初始化
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
package com.mini.mybigscreen.biz.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.mini.mybigscreen.Model.PageResult;
|
||||
import com.mini.mybigscreen.Model.Result;
|
||||
import com.mini.mybigscreen.biz.domain.ErpTransactionFlow;
|
||||
import com.mini.mybigscreen.biz.service.ErpTransactionFlowService;
|
||||
import com.mini.mybigscreen.utils.PageUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 收支流水总表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author gaoxq
|
||||
* @since 2026-02-27
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/biz/erpTransactionFlow")
|
||||
public class ErpTransactionFlowController {
|
||||
|
||||
@Resource
|
||||
private ErpTransactionFlowService flowService;
|
||||
|
||||
|
||||
@GetMapping("list")
|
||||
public Result<?> getList(Integer pageNum, Integer pageSize,
|
||||
String accountId, String flowName, String transactionType, String categoryId) {
|
||||
QueryWrapper<ErpTransactionFlow> query = new QueryWrapper<>();
|
||||
query.like(StrUtil.isNotBlank(flowName), "flow_name", flowName)
|
||||
.eq(StrUtil.isNotBlank(accountId), "account_id", accountId)
|
||||
.eq(StrUtil.isNotBlank(categoryId), "category_id", categoryId)
|
||||
.eq(StrUtil.isNotBlank(transactionType), "transaction_type", transactionType)
|
||||
.orderByDesc("create_time");
|
||||
List<ErpTransactionFlow> flowList = flowService.list(query);
|
||||
PageUtil<ErpTransactionFlow> pageUtil = new PageUtil<>(pageNum, pageSize, flowList);
|
||||
List<ErpTransactionFlow> pageData = pageUtil.OkData();
|
||||
PageResult<ErpTransactionFlow> result = new PageResult<>();
|
||||
result.setList(pageData); // 当前页数据
|
||||
result.setCurrentPage(pageNum); // 当前页码
|
||||
result.setPageSize(pageSize); // 每页条数
|
||||
result.setTotal(flowList.size()); // 总条数
|
||||
return Result.success(result);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user