feat(oa/erp): 新增合同台账报表功能
- 创建ContractLedgerReportController提供查询和导出接口 - 实现IContractLedgerReportService和ContractLedgerReportServiceImpl业务逻辑 - 定义ContractLedgerReportVo数据传输对象支持Excel导出格式 - 配置ContractLedgerReportMapper及XML映射文件实现数据库查询 - 集成ExcelUtil工具类支持报表导出功能dev
parent
7a30f3b174
commit
08c7e7f07f
@ -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<ContractLedgerReportVo> 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<ContractLedgerReportVo> list = reportService.queryContractLedgerAll(bo);
|
||||
ExcelUtil.exportExcel(list, "合同台账报表", ContractLedgerReportVo.class, response);
|
||||
}
|
||||
}
|
||||
@ -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<Long> 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<String, Object> params;
|
||||
}
|
||||
@ -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<ContractLedgerReportVo> selectContractLedgerList(@Param("bo") ContractLedgerReportVo bo);
|
||||
|
||||
}
|
||||
@ -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<ContractLedgerReportVo> queryContractLedgerList(ContractLedgerReportVo bo);
|
||||
|
||||
/**
|
||||
* 查询合同台账全部列表(供导出使用)
|
||||
*/
|
||||
List<ContractLedgerReportVo> queryContractLedgerAll(ContractLedgerReportVo bo);
|
||||
|
||||
}
|
||||
@ -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<ContractLedgerReportVo> queryContractLedgerList(ContractLedgerReportVo bo) {
|
||||
List<ContractLedgerReportVo> list = reportMapper.selectContractLedgerList(bo);
|
||||
return TableDataInfo.build(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ContractLedgerReportVo> queryContractLedgerAll(ContractLedgerReportVo bo) {
|
||||
return reportMapper.selectContractLedgerList(bo);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue