刘光辉
13 小时以前 34981c30a78e8bbd7791131059a9210f9928b62c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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);
}