From a29ebce743945c27df306d217f5597a005e9ae29 Mon Sep 17 00:00:00 2001 From: lpd <1337706942@qq.com> Date: Tue, 26 May 2026 17:04:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=80=83=E6=A0=B8=E4=BA=A7?= =?UTF-8?q?=E5=80=BC=E9=A2=84=E7=AE=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../report/ProjectOutputReportController.java | 8 + .../report/vo/ProjectBudgetPreviewRespVO.java | 158 ++++++++++++++++++ .../report/ProjectOutputReportService.java | 2 + .../ProjectOutputReportServiceImpl.java | 85 +++++++++- 4 files changed, 250 insertions(+), 3 deletions(-) create mode 100644 lyzsys-module-tjt/src/main/java/cn/iocoder/lyzsys/module/tjt/controller/admin/report/vo/ProjectBudgetPreviewRespVO.java diff --git a/lyzsys-module-tjt/src/main/java/cn/iocoder/lyzsys/module/tjt/controller/admin/report/ProjectOutputReportController.java b/lyzsys-module-tjt/src/main/java/cn/iocoder/lyzsys/module/tjt/controller/admin/report/ProjectOutputReportController.java index f669dc2..55fb084 100644 --- a/lyzsys-module-tjt/src/main/java/cn/iocoder/lyzsys/module/tjt/controller/admin/report/ProjectOutputReportController.java +++ b/lyzsys-module-tjt/src/main/java/cn/iocoder/lyzsys/module/tjt/controller/admin/report/ProjectOutputReportController.java @@ -38,6 +38,14 @@ public class ProjectOutputReportController { projectOutputReportService.exportProjectBudgetExcel(response, reqVO); } + @GetMapping("/project-budget/preview") + @Operation(summary = "预览项目考核产值预算表") + @PreAuthorize("@ss.hasAnyPermissions('tjt:report-budget:query', 'tjt:report-budget:export')") + public CommonResult getProjectBudgetPreview( + @Valid ProjectBudgetExportReqVO reqVO) { + return success(projectOutputReportService.getProjectBudgetPreview(reqVO)); + } + @GetMapping("/project-quarter-output/export-excel") @Operation(summary = "导出项目级年度季度计取表") @PreAuthorize("@ss.hasPermission('tjt:report-project-quarter:export')") diff --git a/lyzsys-module-tjt/src/main/java/cn/iocoder/lyzsys/module/tjt/controller/admin/report/vo/ProjectBudgetPreviewRespVO.java b/lyzsys-module-tjt/src/main/java/cn/iocoder/lyzsys/module/tjt/controller/admin/report/vo/ProjectBudgetPreviewRespVO.java new file mode 100644 index 0000000..082f2c6 --- /dev/null +++ b/lyzsys-module-tjt/src/main/java/cn/iocoder/lyzsys/module/tjt/controller/admin/report/vo/ProjectBudgetPreviewRespVO.java @@ -0,0 +1,158 @@ +package cn.iocoder.lyzsys.module.tjt.controller.admin.report.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Collections; +import java.util.List; + +@Schema(description = "管理后台 - 项目考核产值预算表预览 Response VO") +@Data +public class ProjectBudgetPreviewRespVO { + + @Schema(description = "年度", example = "2026") + private Integer year; + + @Schema(description = "工程编号") + private String projectCode; + + @Schema(description = "项目名称") + private String projectName; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "建筑(装饰)工程项目考核产值预算表") + private List budgetRows = Collections.emptyList(); + + @Schema(description = "项目考核产值年度季度预算计取表") + private List quarterBudgetRows = Collections.emptyList(); + + @Schema(description = "建筑(装饰)工程项目考核产值预算表行") + @Data + public static class BudgetRow { + + @Schema(description = "行类型") + private String rowType; + + @Schema(description = "规划 ID") + private Long planningId; + + @Schema(description = "规划内容") + private String planningContent; + + @Schema(description = "设计部位") + private String displayDesignPart; + + @Schema(description = "设计内容/设计类型") + private String displayBuildingType; + + @Schema(description = "内部指导单价") + private BigDecimal internalGuidanceUnitPrice; + + @Schema(description = "设计面积") + private BigDecimal designArea; + + @Schema(description = "栋数/户型数") + private Integer buildingOrUnitCount; + + @Schema(description = "套图系数") + private BigDecimal drawingSetFactor; + + @Schema(description = "规模系数") + private BigDecimal scaleFactor; + + @Schema(description = "修改系数") + private BigDecimal modificationFactor; + + @Schema(description = "复杂系数/复杂等级") + private BigDecimal complexityFactor; + + @Schema(description = "小计") + private BigDecimal subtotalArea; + + @Schema(description = "设计阶段占比") + private BigDecimal currentDesignStageRatio; + + @Schema(description = "考核产值小计,单位:万元") + private BigDecimal assessmentOutputValueWan; + + } + + @Schema(description = "项目考核产值年度季度预算计取表行") + @Data + public static class QuarterBudgetRow { + + @Schema(description = "序号") + private Integer serialNo; + + @Schema(description = "是否合计行") + private Boolean totalRow = false; + + @Schema(description = "产值类型") + private String outputType; + + @Schema(description = "设计内容") + private String designContent; + + @Schema(description = "预算年度") + private Integer budgetYear; + + @Schema(description = "总建筑(精装)设计面积") + private BigDecimal totalDesignArea; + + @Schema(description = "总考核产值面积") + private BigDecimal totalAssessmentArea; + + @Schema(description = "总考核产值,单位:万元") + private BigDecimal totalAssessmentOutputWan; + + @Schema(description = "阶段占比") + private BigDecimal designStageRatio; + + @Schema(description = "设计阶段考核产值,单位:万元") + private BigDecimal designStageOutputWan; + + @Schema(description = "往年已发放比例") + private BigDecimal historicalIssuedRatio; + + @Schema(description = "一季度发放比例") + private BigDecimal quarterOneRatio; + + @Schema(description = "二季度发放比例") + private BigDecimal quarterTwoRatio; + + @Schema(description = "三季度发放比例") + private BigDecimal quarterThreeRatio; + + @Schema(description = "四季度发放比例") + private BigDecimal quarterFourRatio; + + @Schema(description = "本年度小计比例") + private BigDecimal currentYearRatio; + + @Schema(description = "未发放比例") + private BigDecimal pendingRatio; + + @Schema(description = "一季度金额,单位:万元") + private BigDecimal quarterOneAmountWan; + + @Schema(description = "二季度金额,单位:万元") + private BigDecimal quarterTwoAmountWan; + + @Schema(description = "三季度金额,单位:万元") + private BigDecimal quarterThreeAmountWan; + + @Schema(description = "四季度金额,单位:万元") + private BigDecimal quarterFourAmountWan; + + @Schema(description = "本年度小计金额,单位:万元") + private BigDecimal yearTotalAmountWan; + + @Schema(description = "备注") + private String ratioRemark; + + } + +} diff --git a/lyzsys-module-tjt/src/main/java/cn/iocoder/lyzsys/module/tjt/service/report/ProjectOutputReportService.java b/lyzsys-module-tjt/src/main/java/cn/iocoder/lyzsys/module/tjt/service/report/ProjectOutputReportService.java index ad99fa8..95aca4f 100644 --- a/lyzsys-module-tjt/src/main/java/cn/iocoder/lyzsys/module/tjt/service/report/ProjectOutputReportService.java +++ b/lyzsys-module-tjt/src/main/java/cn/iocoder/lyzsys/module/tjt/service/report/ProjectOutputReportService.java @@ -10,6 +10,8 @@ public interface ProjectOutputReportService { void exportProjectBudgetExcel(HttpServletResponse response, ProjectBudgetExportReqVO reqVO) throws IOException; + ProjectBudgetPreviewRespVO getProjectBudgetPreview(ProjectBudgetExportReqVO reqVO); + void exportProjectQuarterOutputExcel(HttpServletResponse response, ProjectQuarterOutputExportReqVO reqVO) throws IOException; diff --git a/lyzsys-module-tjt/src/main/java/cn/iocoder/lyzsys/module/tjt/service/report/ProjectOutputReportServiceImpl.java b/lyzsys-module-tjt/src/main/java/cn/iocoder/lyzsys/module/tjt/service/report/ProjectOutputReportServiceImpl.java index 1da2bad..b968b36 100644 --- a/lyzsys-module-tjt/src/main/java/cn/iocoder/lyzsys/module/tjt/service/report/ProjectOutputReportServiceImpl.java +++ b/lyzsys-module-tjt/src/main/java/cn/iocoder/lyzsys/module/tjt/service/report/ProjectOutputReportServiceImpl.java @@ -109,6 +109,22 @@ public class ProjectOutputReportServiceImpl implements ProjectOutputReportServic throws IOException { ProjectDO project = validateProjectExists(reqVO.getProjectId()); Integer reportYear = resolveExportYear(reqVO.getYear()); + ProjectBudgetExcelBuilder.ExportData data = buildProjectBudgetExportData(project, reportYear); + + projectBudgetExcelBuilder.writeWorkbook(response, + buildFileName(project.getProjectName(), reportYear, "项目考核产值预算表"), + projectBudgetExcelBuilder.build(data)); + } + + @Override + public ProjectBudgetPreviewRespVO getProjectBudgetPreview(ProjectBudgetExportReqVO reqVO) { + ProjectDO project = validateProjectExists(reqVO.getProjectId()); + Integer reportYear = resolveExportYear(reqVO.getYear()); + ProjectBudgetExcelBuilder.ExportData data = buildProjectBudgetExportData(project, reportYear); + return buildProjectBudgetPreviewRespVO(data, reportYear); + } + + private ProjectBudgetExcelBuilder.ExportData buildProjectBudgetExportData(ProjectDO project, Integer reportYear) { List planningList = sortPlanningList(projectPlanningMapper.selectListByProjectId(project.getId())); List rolePersons = projectRolePersonMapper.selectListByProjectId(project.getId()); Map> quarterMap = getQuarterMap(planningList); @@ -144,10 +160,73 @@ public class ProjectOutputReportServiceImpl implements ProjectOutputReportServic data.setTotalAssessmentOutputValueWan(amountToWan(totalAssessmentOutputValue)); data.setQuarterBudgetRows(buildQuarterBudgetRows(planningList, quarterMap, reportYear)); data.setYearRangeText(buildProjectBudgetYearRangeText(planningList, quarterMap)); + return data; + } - projectBudgetExcelBuilder.writeWorkbook(response, - buildFileName(project.getProjectName(), reportYear, "项目考核产值预算表"), - projectBudgetExcelBuilder.build(data)); + private ProjectBudgetPreviewRespVO buildProjectBudgetPreviewRespVO(ProjectBudgetExcelBuilder.ExportData data, + Integer reportYear) { + ProjectBudgetPreviewRespVO respVO = new ProjectBudgetPreviewRespVO(); + respVO.setYear(reportYear); + respVO.setProjectCode(data.getProjectCode()); + respVO.setProjectName(data.getProjectName()); + respVO.setRemark(data.getRemark()); + respVO.setBudgetRows(data.getBudgetRows() == null ? Collections.emptyList() + : data.getBudgetRows().stream().map(this::buildProjectBudgetPreviewBudgetRow) + .collect(Collectors.toList())); + respVO.setQuarterBudgetRows(data.getQuarterBudgetRows() == null ? Collections.emptyList() + : data.getQuarterBudgetRows().stream().map(this::buildProjectBudgetPreviewQuarterRow) + .collect(Collectors.toList())); + return respVO; + } + + private ProjectBudgetPreviewRespVO.BudgetRow buildProjectBudgetPreviewBudgetRow( + ProjectBudgetExcelBuilder.BudgetRow source) { + ProjectBudgetPreviewRespVO.BudgetRow row = new ProjectBudgetPreviewRespVO.BudgetRow(); + row.setRowType(source.getRowType() == null ? null : source.getRowType().name()); + row.setPlanningId(source.getPlanningId()); + row.setPlanningContent(source.getPlanningContent()); + row.setDisplayDesignPart(source.getDisplayDesignPart()); + row.setDisplayBuildingType(source.getDisplayBuildingType()); + row.setInternalGuidanceUnitPrice(source.getInternalGuidanceUnitPrice()); + row.setDesignArea(source.getDesignArea()); + row.setBuildingOrUnitCount(source.getBuildingOrUnitCount()); + row.setDrawingSetFactor(source.getDrawingSetFactor()); + row.setScaleFactor(source.getScaleFactor()); + row.setModificationFactor(source.getModificationFactor()); + row.setComplexityFactor(source.getComplexityFactor()); + row.setSubtotalArea(source.getSubtotalArea()); + row.setCurrentDesignStageRatio(source.getCurrentDesignStageRatio()); + row.setAssessmentOutputValueWan(source.getAssessmentOutputValueWan()); + return row; + } + + private ProjectBudgetPreviewRespVO.QuarterBudgetRow buildProjectBudgetPreviewQuarterRow( + ProjectBudgetExcelBuilder.QuarterBudgetRow source) { + ProjectBudgetPreviewRespVO.QuarterBudgetRow row = new ProjectBudgetPreviewRespVO.QuarterBudgetRow(); + row.setSerialNo(source.getSerialNo()); + row.setTotalRow(source.isTotalRow()); + row.setOutputType(source.getOutputType()); + row.setDesignContent(source.getDesignContent()); + row.setBudgetYear(source.getBudgetYear()); + row.setTotalDesignArea(source.getTotalDesignArea()); + row.setTotalAssessmentArea(source.getTotalAssessmentArea()); + row.setTotalAssessmentOutputWan(source.getTotalAssessmentOutputWan()); + row.setDesignStageRatio(source.getDesignStageRatio()); + row.setDesignStageOutputWan(source.getDesignStageOutputWan()); + row.setHistoricalIssuedRatio(source.getHistoricalIssuedRatio()); + row.setQuarterOneRatio(source.getQuarterOneRatio()); + row.setQuarterTwoRatio(source.getQuarterTwoRatio()); + row.setQuarterThreeRatio(source.getQuarterThreeRatio()); + row.setQuarterFourRatio(source.getQuarterFourRatio()); + row.setCurrentYearRatio(source.getCurrentYearRatio()); + row.setPendingRatio(source.getPendingRatio()); + row.setQuarterOneAmountWan(source.getQuarterOneAmountWan()); + row.setQuarterTwoAmountWan(source.getQuarterTwoAmountWan()); + row.setQuarterThreeAmountWan(source.getQuarterThreeAmountWan()); + row.setQuarterFourAmountWan(source.getQuarterFourAmountWan()); + row.setYearTotalAmountWan(source.getYearTotalAmountWan()); + row.setRatioRemark(source.getRatioRemark()); + return row; } @Override