3.9 KiB
3.9 KiB
Reports
Progress:
- Calculated in real time from the external survey DB.
- Never use
t_report_final_data. - Backend calculates 7-point and 100-point scores.
- The backend owns the MyBatis Mapper interface, DTO contract, SQL, service call, and response assembly. The approved external survey source is fixed to
PKEY = '2605040_A', excludesSURVEY_TYPE = 'TEST', and requiresStatus = 10. - Use only
ReportHeaderType.CURRENTheaders. A nonblankkon_qidmaps to$.{prefix}.{kon_qid}, whereprefixis the substring before_, or the full value when_is absent. - Header
1001is a special composite score with nokon_qid; calculate it in the external survey SQL and return it through the same metric contract. - The source variables used by the
1001formula are assumed to be non-null values in the1..7range. Do not add null or range conditions to that special calculation.
Final:
- Read pre-calculated values from
t_report_final_data. - Do not recalculate during normal requests.
- Admin imports final data through an Excel upload.
- Upsert only the Centers represented by uploaded rows and retain all other Centers' existing final data.
- Store
completeCountint_center.center_final_sample. - Treat blank cells and
-as absent values and delete the matching existingt_report_final_datavalue for that uploaded Center. - Excel columns are
centerCd,completeCount, followed byreport_header_idvalues used as column headers. - Use only
ReportHeaderType.FINALheaders for Final responses and Excel validation. - Validate every header ID, Center code, row shape, and value before applying the workbook atomically.
Header hierarchy:
report_header_group → variable_group → variable_name → report_header_label
- Order by
report_header_order. - 7-point/100-point share one logical header.
- Report endpoints are not paginated.
- The initial and currently supported report filter is optional
centerCd; keep the request boundary extensible for future filters. - For Progress, Admin requests with absent
centerCdorcenterCd = 0return the aggregate row followed by all Centers. A specific AdmincenterCdreturns only that Center. Center users receive only their own Center. - For Final, Admin requests with absent
centerCdorcenterCd = 0return the aggregate row followed by all Centers. A specific AdmincenterCdreturns the aggregate row followed by that Center. Center users receive the aggregate row followed by their own Center. - Return
headersandcontent. Each content row containscenterCd,centerName,targetCount,completeCount, and orderedvalues. - For the aggregate
centerCd = 0row, calculate counts at query time instead of using the stored aggregate-row values.targetCountis the sum ofcenter_quotaacross all nonzero Centers. ProgresscompleteCountis the external survey query's aggregate count, while FinalcompleteCountis the sum ofcenter_final_sampleacross all nonzero Centers. - Each value contains
headerId, nullablevalue7, and nullablevalue100. - Progress returns the available 7-point and 100-point values from MyBatis. Final returns
value7 = nulland the stored final value asvalue100.
Excel
- Do not implement backend Excel-download endpoints.
- The frontend will export the current screen query/filter result after the backend APIs are complete.
- Final Report Excel upload remains a backend Admin capability as defined in the Reports rules.
Report Code Enums
- Manage
report_header_typeasReportHeaderType implements CodeEnum<Short>with1 = CURRENT,2 = FINAL. - Persist
ReportHeaderTypethrough an explicit JPA code converter so the existingsmallintschema remains unchanged. report_value_type,round_point, andkon_deny_valuehave been removed fromt_report_header.report_value_typeandround_pointhave also been removed from the report API header response;kon_deny_valuewas not exposed by the API.