package jnpf.limsService.print;
|
|
import jnpf.limsEntity.LimsPrintTemplateEntity;
|
|
import java.util.Map;
|
|
/**
|
* 打印模板渲染器。每个 template_id 对应一个实现,负责按业务实体 id 拼出
|
* 前端渲染所需的数据结构。
|
*
|
* <p>实现类用 {@link org.springframework.stereotype.Component} 注解后会被
|
* {@link PrintRendererRegistry} 自动按 {@link #getTemplateId()} 注册。
|
*/
|
public interface PrintTemplateRenderer {
|
|
/** 业务唯一 key, 与 lims_print_template.template_id 对齐 */
|
String getTemplateId();
|
|
/**
|
* 拼装渲染数据。
|
*
|
* @param dataId 前端传入的业务实体 id(如 lims_qingyandan_report.f_id)
|
* @param tpl 本模板在 lims_print_template 中的配置(含 config JSON)
|
* @return 前端渲染所需的数据结构(snake_case 由全局 JacksonConfig 处理)
|
*/
|
Map<String, Object> render(String dataId, LimsPrintTemplateEntity tpl);
|
}
|