From 08c7e7f07f2a55c3d439a2d3b3645edf4ec571c7 Mon Sep 17 00:00:00 2001 From: Yangk Date: Tue, 24 Mar 2026 15:30:04 +0800 Subject: [PATCH] =?UTF-8?q?feat(oa/erp):=20=E6=96=B0=E5=A2=9E=E5=90=88?= =?UTF-8?q?=E5=90=8C=E5=8F=B0=E8=B4=A6=E6=8A=A5=E8=A1=A8=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 创建ContractLedgerReportController提供查询和导出接口 - 实现IContractLedgerReportService和ContractLedgerReportServiceImpl业务逻辑 - 定义ContractLedgerReportVo数据传输对象支持Excel导出格式 - 配置ContractLedgerReportMapper及XML映射文件实现数据库查询 - 集成ExcelUtil工具类支持报表导出功能 --- .../ContractLedgerReportController.java | 50 ++++++++ .../erp/domain/vo/ContractLedgerReportVo.java | 119 ++++++++++++++++++ .../mapper/ContractLedgerReportMapper.java | 18 +++ .../service/IContractLedgerReportService.java | 23 ++++ .../impl/ContractLedgerReportServiceImpl.java | 32 +++++ .../oa/erp/ContractLedgerReportMapper.xml | 79 ++++++++++++ 6 files changed, 321 insertions(+) create mode 100644 ruoyi-modules/ruoyi-oa/src/main/java/org/dromara/oa/erp/controller/ContractLedgerReportController.java create mode 100644 ruoyi-modules/ruoyi-oa/src/main/java/org/dromara/oa/erp/domain/vo/ContractLedgerReportVo.java create mode 100644 ruoyi-modules/ruoyi-oa/src/main/java/org/dromara/oa/erp/mapper/ContractLedgerReportMapper.java create mode 100644 ruoyi-modules/ruoyi-oa/src/main/java/org/dromara/oa/erp/service/IContractLedgerReportService.java create mode 100644 ruoyi-modules/ruoyi-oa/src/main/java/org/dromara/oa/erp/service/impl/ContractLedgerReportServiceImpl.java create mode 100644 ruoyi-modules/ruoyi-oa/src/main/resources/mapper/oa/erp/ContractLedgerReportMapper.xml 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 new file mode 100644 index 00000000..866e008f --- /dev/null +++ b/ruoyi-modules/ruoyi-oa/src/main/java/org/dromara/oa/erp/controller/ContractLedgerReportController.java @@ -0,0 +1,50 @@ +package org.dromara.oa.erp.controller; + +import jakarta.servlet.http.HttpServletResponse; +import lombok.RequiredArgsConstructor; +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.web.core.BaseController; +import org.dromara.oa.erp.domain.vo.ContractLedgerReportVo; +import org.dromara.oa.erp.service.IContractLedgerReportService; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * 合同台账报表 Controller + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/erp/contractLedgerReport") +public class ContractLedgerReportController extends BaseController { + + private final IContractLedgerReportService reportService; + + /** + * 查询合同台账报表列表 + */ +// @SaCheckPermission("oa:erp:contractLedgerReport:list") + @GetMapping("/list") + public TableDataInfo list(ContractLedgerReportVo bo) { + return reportService.queryContractLedgerList(bo); + } + + /** + * 导出合同台账报表 + */ +// @SaCheckPermission("oa:erp:contractLedgerReport:export") + @Log(title = "合同台账报表", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(ContractLedgerReportVo bo, HttpServletResponse response) { + List list = reportService.queryContractLedgerAll(bo); + ExcelUtil.exportExcel(list, "合同台账报表", ContractLedgerReportVo.class, response); + } +} 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 new file mode 100644 index 00000000..dc88da07 --- /dev/null +++ b/ruoyi-modules/ruoyi-oa/src/main/java/org/dromara/oa/erp/domain/vo/ContractLedgerReportVo.java @@ -0,0 +1,119 @@ +package org.dromara.oa.erp.domain.vo; + +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; +import cn.idev.excel.annotation.ExcelProperty; +import cn.idev.excel.annotation.write.style.ColumnWidth; +import lombok.Data; +import java.io.Serial; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Map; +import java.util.List; + +/** + * 合同台账报表 VO + */ +@Data +@ColumnWidth(18) +@ExcelIgnoreUnannotated +public class ContractLedgerReportVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + private Long contractId; + + private List contractIdList; + + @ExcelProperty({"月份", "月份"}) + private String month; + + /** + * ================== 合同信息 ================== + */ + @ExcelProperty({"合同信息", "海威SAP订单号"}) + @ColumnWidth(20) + private String internalContractCode; + + @ExcelProperty({"合同信息", "海威合同归档编号"}) + @ColumnWidth(25) + private String externalContractCode; + + @ExcelProperty({"合同信息", "客户合同编号"}) + @ColumnWidth(20) + private String customerContractCode; + + @ExcelProperty({"合同信息", "签订时间"}) + private String contractDate; + + @ExcelProperty({"合同信息", "软控SAP订单号"}) + @ColumnWidth(20) + private String orderContractCode; + + @ExcelProperty({"合同信息", "软控SAP项目号"}) + @ColumnWidth(20) + private String projectContractCode; + + @ExcelProperty({"合同信息", "客户名称"}) + @ColumnWidth(25) + private String customerName; + + @ExcelProperty({"合同信息", "产品名称"}) + @ColumnWidth(25) + private String productName; + + @ExcelProperty({"合同信息", "软控合同额(元)"}) + @ColumnWidth(20) + private BigDecimal mesnacContractPrice; + + @ExcelProperty({"合同信息", "海威合同额(元)"}) + @ColumnWidth(20) + private BigDecimal totalPrice; + + @ExcelProperty({"合同信息", "付款方式"}) + @ColumnWidth(20) + private String paymentMethod; + + @ExcelProperty({"合同信息", "交货期"}) + private Integer deliveryStart; + + @ExcelProperty({"合同信息", "质保期"}) + private Integer warrantyPeriod; + + @ExcelProperty({"合同信息", "签订人"}) + private String contractManagerName; + + @ExcelProperty({"合同信息", "部门"}) + private String contractDeptName; + + @ExcelProperty(value = {"合同信息", "业务方向"}, converter = org.dromara.common.excel.convert.ExcelDictConvert.class) + @org.dromara.common.excel.annotation.ExcelDictFormat(dictType = "business_direction") + private String businessDirection; + + /** + * ================== 项目基本信息 ================== + */ + @ExcelProperty({"项目基本信息", "项目编号"}) + @ColumnWidth(20) + private String projectCode; + + @ExcelProperty({"项目基本信息", "项目名称"}) + @ColumnWidth(25) + private String projectName; + + @ExcelProperty({"项目基本信息", "项目经理"}) + private String managerName; + + @ExcelProperty({"项目基本信息", "项目类型"}) + private String typeName; + + /** + * ================== 备注 ================== + */ + @ExcelProperty({"备注", "最终客户"}) + @ColumnWidth(25) + private String finalCustomerName; + + /** 搜索参数预留 */ + private Map params; +} 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 new file mode 100644 index 00000000..ce44b3d5 --- /dev/null +++ b/ruoyi-modules/ruoyi-oa/src/main/java/org/dromara/oa/erp/mapper/ContractLedgerReportMapper.java @@ -0,0 +1,18 @@ +package org.dromara.oa.erp.mapper; + +import org.apache.ibatis.annotations.Param; +import org.dromara.oa.erp.domain.vo.ContractLedgerReportVo; + +import java.util.List; + +/** + * 合同台账报表 Mapper 接口 + */ +public interface ContractLedgerReportMapper { + + /** + * 查询合同台账报表列表 + */ + List selectContractLedgerList(@Param("bo") ContractLedgerReportVo bo); + +} 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 new file mode 100644 index 00000000..847fbfae --- /dev/null +++ b/ruoyi-modules/ruoyi-oa/src/main/java/org/dromara/oa/erp/service/IContractLedgerReportService.java @@ -0,0 +1,23 @@ +package org.dromara.oa.erp.service; + +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.oa.erp.domain.vo.ContractLedgerReportVo; + +import java.util.List; + +/** + * 合同台账报表Service接口 + */ +public interface IContractLedgerReportService { + + /** + * 查询合同台账分页列表 + */ + TableDataInfo queryContractLedgerList(ContractLedgerReportVo bo); + + /** + * 查询合同台账全部列表(供导出使用) + */ + List queryContractLedgerAll(ContractLedgerReportVo bo); + +} 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 new file mode 100644 index 00000000..498523b9 --- /dev/null +++ b/ruoyi-modules/ruoyi-oa/src/main/java/org/dromara/oa/erp/service/impl/ContractLedgerReportServiceImpl.java @@ -0,0 +1,32 @@ +package org.dromara.oa.erp.service.impl; + +import lombok.RequiredArgsConstructor; +import org.dromara.common.mybatis.core.page.PageQuery; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.oa.erp.domain.vo.ContractLedgerReportVo; +import org.dromara.oa.erp.mapper.ContractLedgerReportMapper; +import org.dromara.oa.erp.service.IContractLedgerReportService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 合同台账报表Service业务层处理 + */ +@RequiredArgsConstructor +@Service +public class ContractLedgerReportServiceImpl implements IContractLedgerReportService { + + private final ContractLedgerReportMapper reportMapper; + + @Override + public TableDataInfo queryContractLedgerList(ContractLedgerReportVo bo) { + List list = reportMapper.selectContractLedgerList(bo); + return TableDataInfo.build(list); + } + + @Override + public List queryContractLedgerAll(ContractLedgerReportVo bo) { + return reportMapper.selectContractLedgerList(bo); + } +} diff --git a/ruoyi-modules/ruoyi-oa/src/main/resources/mapper/oa/erp/ContractLedgerReportMapper.xml b/ruoyi-modules/ruoyi-oa/src/main/resources/mapper/oa/erp/ContractLedgerReportMapper.xml new file mode 100644 index 00000000..b14febee --- /dev/null +++ b/ruoyi-modules/ruoyi-oa/src/main/resources/mapper/oa/erp/ContractLedgerReportMapper.xml @@ -0,0 +1,79 @@ + + + + + +