添加考核产值预算表
This commit is contained in:
@@ -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<ProjectBudgetPreviewRespVO> 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')")
|
||||
|
||||
@@ -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<BudgetRow> budgetRows = Collections.emptyList();
|
||||
|
||||
@Schema(description = "项目考核产值年度季度预算计取表")
|
||||
private List<QuarterBudgetRow> 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;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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<ProjectPlanningDO> planningList = sortPlanningList(projectPlanningMapper.selectListByProjectId(project.getId()));
|
||||
List<ProjectRolePersonDO> rolePersons = projectRolePersonMapper.selectListByProjectId(project.getId());
|
||||
Map<Long, List<ProjectPlanningQuarterDO>> 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
|
||||
|
||||
Reference in New Issue
Block a user