feat(oa): 项目台账报表中添加进度信息

dev
Yangk 5 days ago
parent 28fab73c1b
commit 17c9f30f71

@ -113,6 +113,114 @@ public class ProjectLedgerReportVo implements Serializable {
@ExcelProperty(value = "累计工时")
private BigDecimal totalHours;
// --- 启动阶段 ---
@ExcelProperty(value = "启动计划开始时间")
private String startupPlanStartTime;
@ExcelProperty(value = "启动计划结束时间")
private String startupPlanEndTime;
@ExcelProperty(value = "启动实际开始时间")
private String startupRealStartTime;
@ExcelProperty(value = "启动实际结束时间")
private String startupRealEndTime;
@ExcelProperty(value = "启动原因说明")
private String startupReasonsExplanation;
// --- 设计阶段 ---
@ExcelProperty(value = "设计计划开始时间")
private String designPlanStartTime;
@ExcelProperty(value = "设计计划结束时间")
private String designPlanEndTime;
@ExcelProperty(value = "设计实际开始时间")
private String designRealStartTime;
@ExcelProperty(value = "设计实际结束时间")
private String designRealEndTime;
@ExcelProperty(value = "设计原因说明")
private String designReasonsExplanation;
// --- 采购阶段 ---
@ExcelProperty(value = "采购计划开始时间")
private String purchasePlanStartTime;
@ExcelProperty(value = "采购计划结束时间")
private String purchasePlanEndTime;
@ExcelProperty(value = "采购实际开始时间")
private String purchaseRealStartTime;
@ExcelProperty(value = "采购实际结束时间")
private String purchaseRealEndTime;
@ExcelProperty(value = "采购原因说明")
private String purchaseReasonsExplanation;
// --- 发货阶段 ---
@ExcelProperty(value = "发货计划开始时间")
private String shipmentPlanStartTime;
@ExcelProperty(value = "发货计划结束时间")
private String shipmentPlanEndTime;
@ExcelProperty(value = "发货实际开始时间")
private String shipmentRealStartTime;
@ExcelProperty(value = "发货实际结束时间")
private String shipmentRealEndTime;
@ExcelProperty(value = "发货原因说明")
private String shipmentReasonsExplanation;
// --- 实施阶段 ---
@ExcelProperty(value = "实施计划开始时间")
private String implementPlanStartTime;
@ExcelProperty(value = "实施计划结束时间")
private String implementPlanEndTime;
@ExcelProperty(value = "实施实际开始时间")
private String implementRealStartTime;
@ExcelProperty(value = "实施实际结束时间")
private String implementRealEndTime;
@ExcelProperty(value = "实施原因说明")
private String implementReasonsExplanation;
// --- 调试阶段 ---
@ExcelProperty(value = "调试计划开始时间")
private String debugPlanStartTime;
@ExcelProperty(value = "调试计划结束时间")
private String debugPlanEndTime;
@ExcelProperty(value = "调试实际开始时间")
private String debugRealStartTime;
@ExcelProperty(value = "调试实际结束时间")
private String debugRealEndTime;
@ExcelProperty(value = "调试原因说明")
private String debugReasonsExplanation;
// --- 试运行阶段 ---
@ExcelProperty(value = "试运行计划开始时间")
private String pilotRunPlanStartTime;
@ExcelProperty(value = "试运行计划结束时间")
private String pilotRunPlanEndTime;
@ExcelProperty(value = "试运行实际开始时间")
private String pilotRunRealStartTime;
@ExcelProperty(value = "试运行实际结束时间")
private String pilotRunRealEndTime;
@ExcelProperty(value = "试运行原因说明")
private String pilotRunReasonsExplanation;
// --- 验收阶段 ---
@ExcelProperty(value = "验收计划开始时间")
private String acceptancePlanStartTime;
@ExcelProperty(value = "验收计划结束时间")
private String acceptancePlanEndTime;
@ExcelProperty(value = "验收实际开始时间")
private String acceptanceRealStartTime;
@ExcelProperty(value = "验收实际结束时间")
private String acceptanceRealEndTime;
@ExcelProperty(value = "验收原因说明")
private String acceptanceReasonsExplanation;
// --- 质保阶段 ---
@ExcelProperty(value = "质保计划开始时间")
private String warrantyPlanStartTime;
@ExcelProperty(value = "质保计划结束时间")
private String warrantyPlanEndTime;
@ExcelProperty(value = "质保实际开始时间")
private String warrantyRealStartTime;
@ExcelProperty(value = "质保实际结束时间")
private String warrantyRealEndTime;
@ExcelProperty(value = "质保原因说明")
private String warrantyReasonsExplanation;
/** 业务方向(查询条件用) */
private String businessDirection;

@ -32,7 +32,53 @@
<!-- 累计工时 -->
hours_sub.total_hours,
<!-- 产品数量 -->
mat_sub.product_amount
mat_sub.product_amount,
<!-- 进度信息 (子查询 Pivot) -->
stages_sub.startup_plan_start_time,
stages_sub.startup_plan_end_time,
stages_sub.startup_real_start_time,
stages_sub.startup_real_end_time,
stages_sub.startup_reasons_explanation,
stages_sub.design_plan_start_time,
stages_sub.design_plan_end_time,
stages_sub.design_real_start_time,
stages_sub.design_real_end_time,
stages_sub.design_reasons_explanation,
stages_sub.purchase_plan_start_time,
stages_sub.purchase_plan_end_time,
stages_sub.purchase_real_start_time,
stages_sub.purchase_real_end_time,
stages_sub.purchase_reasons_explanation,
stages_sub.shipment_plan_start_time,
stages_sub.shipment_plan_end_time,
stages_sub.shipment_real_start_time,
stages_sub.shipment_real_end_time,
stages_sub.shipment_reasons_explanation,
stages_sub.implement_plan_start_time,
stages_sub.implement_plan_end_time,
stages_sub.implement_real_start_time,
stages_sub.implement_real_end_time,
stages_sub.implement_reasons_explanation,
stages_sub.debug_plan_start_time,
stages_sub.debug_plan_end_time,
stages_sub.debug_real_start_time,
stages_sub.debug_real_end_time,
stages_sub.debug_reasons_explanation,
stages_sub.pilot_run_plan_start_time,
stages_sub.pilot_run_plan_end_time,
stages_sub.pilot_run_real_start_time,
stages_sub.pilot_run_real_end_time,
stages_sub.pilot_run_reasons_explanation,
stages_sub.acceptance_plan_start_time,
stages_sub.acceptance_plan_end_time,
stages_sub.acceptance_real_start_time,
stages_sub.acceptance_real_end_time,
stages_sub.acceptance_reasons_explanation,
stages_sub.warranty_plan_start_time,
stages_sub.warranty_plan_end_time,
stages_sub.warranty_real_start_time,
stages_sub.warranty_real_end_time,
stages_sub.warranty_reasons_explanation
FROM
erp_project_info p
LEFT JOIN erp_project_type t1 ON t1.project_type_id = p.project_type_id
@ -67,6 +113,68 @@
WHERE del_flag = '0'
GROUP BY contract_id
) mat_sub ON p.contract_id = mat_sub.contract_id
<!-- 进度信息 Pivot 子查询 -->
LEFT JOIN (
SELECT
s.project_id,
MAX(CASE WHEN d.dict_label = '启动' THEN s.plan_start_time END) AS startup_plan_start_time,
MAX(CASE WHEN d.dict_label = '启动' THEN s.plan_end_time END) AS startup_plan_end_time,
MAX(CASE WHEN d.dict_label = '启动' THEN s.real_start_time END) AS startup_real_start_time,
MAX(CASE WHEN d.dict_label = '启动' THEN s.real_end_time END) AS startup_real_end_time,
MAX(CASE WHEN d.dict_label = '启动' THEN s.reasons_explanation END) AS startup_reasons_explanation,
MAX(CASE WHEN d.dict_label = '设计' THEN s.plan_start_time END) AS design_plan_start_time,
MAX(CASE WHEN d.dict_label = '设计' THEN s.plan_end_time END) AS design_plan_end_time,
MAX(CASE WHEN d.dict_label = '设计' THEN s.real_start_time END) AS design_real_start_time,
MAX(CASE WHEN d.dict_label = '设计' THEN s.real_end_time END) AS design_real_end_time,
MAX(CASE WHEN d.dict_label = '设计' THEN s.reasons_explanation END) AS design_reasons_explanation,
MAX(CASE WHEN d.dict_label = '采购' THEN s.plan_start_time END) AS purchase_plan_start_time,
MAX(CASE WHEN d.dict_label = '采购' THEN s.plan_end_time END) AS purchase_plan_end_time,
MAX(CASE WHEN d.dict_label = '采购' THEN s.real_start_time END) AS purchase_real_start_time,
MAX(CASE WHEN d.dict_label = '采购' THEN s.real_end_time END) AS purchase_real_end_time,
MAX(CASE WHEN d.dict_label = '采购' THEN s.reasons_explanation END) AS purchase_reasons_explanation,
MAX(CASE WHEN d.dict_label = '发货' THEN s.plan_start_time END) AS shipment_plan_start_time,
MAX(CASE WHEN d.dict_label = '发货' THEN s.plan_end_time END) AS shipment_plan_end_time,
MAX(CASE WHEN d.dict_label = '发货' THEN s.real_start_time END) AS shipment_real_start_time,
MAX(CASE WHEN d.dict_label = '发货' THEN s.real_end_time END) AS shipment_real_end_time,
MAX(CASE WHEN d.dict_label = '发货' THEN s.reasons_explanation END) AS shipment_reasons_explanation,
MAX(CASE WHEN d.dict_label = '实施' THEN s.plan_start_time END) AS implement_plan_start_time,
MAX(CASE WHEN d.dict_label = '实施' THEN s.plan_end_time END) AS implement_plan_end_time,
MAX(CASE WHEN d.dict_label = '实施' THEN s.real_start_time END) AS implement_real_start_time,
MAX(CASE WHEN d.dict_label = '实施' THEN s.real_end_time END) AS implement_real_end_time,
MAX(CASE WHEN d.dict_label = '实施' THEN s.reasons_explanation END) AS implement_reasons_explanation,
MAX(CASE WHEN d.dict_label = '调试' THEN s.plan_start_time END) AS debug_plan_start_time,
MAX(CASE WHEN d.dict_label = '调试' THEN s.plan_end_time END) AS debug_plan_end_time,
MAX(CASE WHEN d.dict_label = '调试' THEN s.real_start_time END) AS debug_real_start_time,
MAX(CASE WHEN d.dict_label = '调试' THEN s.real_end_time END) AS debug_real_end_time,
MAX(CASE WHEN d.dict_label = '调试' THEN s.reasons_explanation END) AS debug_reasons_explanation,
MAX(CASE WHEN d.dict_label = '试运行' THEN s.plan_start_time END) AS pilot_run_plan_start_time,
MAX(CASE WHEN d.dict_label = '试运行' THEN s.plan_end_time END) AS pilot_run_plan_end_time,
MAX(CASE WHEN d.dict_label = '试运行' THEN s.real_start_time END) AS pilot_run_real_start_time,
MAX(CASE WHEN d.dict_label = '试运行' THEN s.real_end_time END) AS pilot_run_real_end_time,
MAX(CASE WHEN d.dict_label = '试运行' THEN s.reasons_explanation END) AS pilot_run_reasons_explanation,
MAX(CASE WHEN d.dict_label = '验收' THEN s.plan_start_time END) AS acceptance_plan_start_time,
MAX(CASE WHEN d.dict_label = '验收' THEN s.plan_end_time END) AS acceptance_plan_end_time,
MAX(CASE WHEN d.dict_label = '验收' THEN s.real_start_time END) AS acceptance_real_start_time,
MAX(CASE WHEN d.dict_label = '验收' THEN s.real_end_time END) AS acceptance_real_end_time,
MAX(CASE WHEN d.dict_label = '验收' THEN s.reasons_explanation END) AS acceptance_reasons_explanation,
MAX(CASE WHEN d.dict_label = '质保' THEN s.plan_start_time END) AS warranty_plan_start_time,
MAX(CASE WHEN d.dict_label = '质保' THEN s.plan_end_time END) AS warranty_plan_end_time,
MAX(CASE WHEN d.dict_label = '质保' THEN s.real_start_time END) AS warranty_real_start_time,
MAX(CASE WHEN d.dict_label = '质保' THEN s.real_end_time END) AS warranty_real_end_time,
MAX(CASE WHEN d.dict_label = '质保' THEN s.reasons_explanation END) AS warranty_reasons_explanation
FROM erp_project_plan_stage s
LEFT JOIN sys_dict_data d ON s.project_phases = d.dict_value AND d.dict_type = 'project_phases'
WHERE s.del_flag = '0'
GROUP BY s.project_id
) stages_sub ON p.project_id = stages_sub.project_id
<where>
p.del_flag = '0'
AND p.project_category &lt;&gt; '9'

Loading…
Cancel
Save