diff --git a/ruoyi-modules/ruoyi-oa/src/main/java/org/dromara/oa/erp/controller/ContractLedgerReportController.java b/ruoyi-modules/ruoyi-oa/src/main/java/org/dromara/oa/erp/controller/ContractLedgerReportController.java index 866e008f..7921990e 100644 --- a/ruoyi-modules/ruoyi-oa/src/main/java/org/dromara/oa/erp/controller/ContractLedgerReportController.java +++ b/ruoyi-modules/ruoyi-oa/src/main/java/org/dromara/oa/erp/controller/ContractLedgerReportController.java @@ -6,6 +6,7 @@ import org.dromara.common.excel.utils.ExcelUtil; import org.dromara.common.log.annotation.Log; import org.dromara.common.log.enums.BusinessType; import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; import org.dromara.common.web.core.BaseController; import org.dromara.oa.erp.domain.vo.ContractLedgerReportVo; import org.dromara.oa.erp.service.IContractLedgerReportService; @@ -33,8 +34,8 @@ public class ContractLedgerReportController extends BaseController { */ // @SaCheckPermission("oa:erp:contractLedgerReport:list") @GetMapping("/list") - public TableDataInfo list(ContractLedgerReportVo bo) { - return reportService.queryContractLedgerList(bo); + public TableDataInfo list(ContractLedgerReportVo bo, PageQuery pageQuery) { + return reportService.queryContractLedgerList(bo, pageQuery); } /** diff --git a/ruoyi-modules/ruoyi-oa/src/main/java/org/dromara/oa/erp/domain/vo/ContractLedgerReportVo.java b/ruoyi-modules/ruoyi-oa/src/main/java/org/dromara/oa/erp/domain/vo/ContractLedgerReportVo.java index dc88da07..e2fde3b2 100644 --- a/ruoyi-modules/ruoyi-oa/src/main/java/org/dromara/oa/erp/domain/vo/ContractLedgerReportVo.java +++ b/ruoyi-modules/ruoyi-oa/src/main/java/org/dromara/oa/erp/domain/vo/ContractLedgerReportVo.java @@ -25,6 +25,9 @@ public class ContractLedgerReportVo implements Serializable { private List contractIdList; + @ExcelProperty({"序号", "序号"}) + private Integer index; + @ExcelProperty({"月份", "月份"}) private String month; diff --git a/ruoyi-modules/ruoyi-oa/src/main/java/org/dromara/oa/erp/mapper/ContractLedgerReportMapper.java b/ruoyi-modules/ruoyi-oa/src/main/java/org/dromara/oa/erp/mapper/ContractLedgerReportMapper.java index 81fb96b5..e02aba98 100644 --- a/ruoyi-modules/ruoyi-oa/src/main/java/org/dromara/oa/erp/mapper/ContractLedgerReportMapper.java +++ b/ruoyi-modules/ruoyi-oa/src/main/java/org/dromara/oa/erp/mapper/ContractLedgerReportMapper.java @@ -1,8 +1,9 @@ package org.dromara.oa.erp.mapper; import org.apache.ibatis.annotations.Param; -import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.github.yulichang.wrapper.MPJLambdaWrapper; import org.dromara.oa.erp.domain.ErpContractInfo; import org.dromara.oa.erp.domain.vo.ContractLedgerReportVo; @@ -13,9 +14,14 @@ import java.util.List; */ public interface ContractLedgerReportMapper { + /** + * 查询合同台账报表分页列表 + */ + Page selectContractLedgerList(@Param("page") Page page, @Param(Constants.WRAPPER) MPJLambdaWrapper wrapper); + /** * 查询合同台账报表列表 */ - List selectContractLedgerList(@Param(Constants.WRAPPER) Wrapper wrapper); + List selectContractLedgerList(@Param(Constants.WRAPPER) MPJLambdaWrapper wrapper); } diff --git a/ruoyi-modules/ruoyi-oa/src/main/java/org/dromara/oa/erp/service/IContractLedgerReportService.java b/ruoyi-modules/ruoyi-oa/src/main/java/org/dromara/oa/erp/service/IContractLedgerReportService.java index 847fbfae..a08357de 100644 --- a/ruoyi-modules/ruoyi-oa/src/main/java/org/dromara/oa/erp/service/IContractLedgerReportService.java +++ b/ruoyi-modules/ruoyi-oa/src/main/java/org/dromara/oa/erp/service/IContractLedgerReportService.java @@ -1,5 +1,6 @@ package org.dromara.oa.erp.service; +import org.dromara.common.mybatis.core.page.PageQuery; import org.dromara.common.mybatis.core.page.TableDataInfo; import org.dromara.oa.erp.domain.vo.ContractLedgerReportVo; @@ -13,7 +14,7 @@ public interface IContractLedgerReportService { /** * 查询合同台账分页列表 */ - TableDataInfo queryContractLedgerList(ContractLedgerReportVo bo); + TableDataInfo queryContractLedgerList(ContractLedgerReportVo bo, PageQuery pageQuery); /** * 查询合同台账全部列表(供导出使用) diff --git a/ruoyi-modules/ruoyi-oa/src/main/java/org/dromara/oa/erp/service/impl/ContractLedgerReportServiceImpl.java b/ruoyi-modules/ruoyi-oa/src/main/java/org/dromara/oa/erp/service/impl/ContractLedgerReportServiceImpl.java index 08c72c15..48b0aa9c 100644 --- a/ruoyi-modules/ruoyi-oa/src/main/java/org/dromara/oa/erp/service/impl/ContractLedgerReportServiceImpl.java +++ b/ruoyi-modules/ruoyi-oa/src/main/java/org/dromara/oa/erp/service/impl/ContractLedgerReportServiceImpl.java @@ -15,6 +15,8 @@ import org.springframework.stereotype.Service; import java.util.List; import java.util.Map; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; + /** * 合同台账报表Service业务层处理 */ @@ -51,15 +53,23 @@ public class ContractLedgerReportServiceImpl implements IContractLedgerReportSer } @Override - public TableDataInfo queryContractLedgerList(ContractLedgerReportVo bo) { + public TableDataInfo queryContractLedgerList(ContractLedgerReportVo bo, PageQuery pageQuery) { MPJLambdaWrapper lqw = buildQueryWrapper(bo); - List list = reportMapper.selectContractLedgerList(lqw); - return TableDataInfo.build(list); + Page result = reportMapper.selectContractLedgerList(pageQuery.build(), lqw); + List list = result.getRecords(); + for (int i = 0; i < list.size(); i++) { + list.get(i).setIndex((int) ((pageQuery.getPageNum() - 1) * pageQuery.getPageSize() + i + 1)); + } + return TableDataInfo.build(result); } @Override public List queryContractLedgerAll(ContractLedgerReportVo bo) { MPJLambdaWrapper lqw = buildQueryWrapper(bo); - return reportMapper.selectContractLedgerList(lqw); + List list = reportMapper.selectContractLedgerList(lqw); + for (int i = 0; i < list.size(); i++) { + list.get(i).setIndex(i + 1); + } + return list; } }