docs: 完善单位转换系统使用文档,添加Feign跨模块调用示例
- 补充Feign客户端接口定义示例 - 补充跨服务调用的具体实现示例 - 修正常见问题Q1中的API端点路径为正确的 /unt-info/page 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,72 @@
|
|||||||
|
package com.zt.plat.module.base.service.doctemplate;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文档渲染API服务
|
||||||
|
* 供业务模块调用,支持多种渲染方式
|
||||||
|
*
|
||||||
|
* @author system
|
||||||
|
*/
|
||||||
|
public interface DocumentRenderApiService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据模板ID渲染 (方式1:直接模板渲染)
|
||||||
|
*
|
||||||
|
* @param templateId 模板ID
|
||||||
|
* @param dataMap 数据Map
|
||||||
|
* @return 渲染后的HTML
|
||||||
|
*/
|
||||||
|
String renderByTemplate(Long templateId, Map<String, Object> dataMap);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据实例ID渲染 (方式2:实例渲染)
|
||||||
|
* 优先使用实例的editedContent,如果为空则使用模板内容
|
||||||
|
*
|
||||||
|
* @param instanceId 实例ID
|
||||||
|
* @param dataMap 数据Map
|
||||||
|
* @return 渲染后的HTML
|
||||||
|
*/
|
||||||
|
String renderByInstance(Long instanceId, Map<String, Object> dataMap);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据业务类型渲染 (方式3:业务接入渲染)
|
||||||
|
* 业务系统可根据业务类型自定义数据集和渲染逻辑
|
||||||
|
*
|
||||||
|
* @param instanceId 实例ID
|
||||||
|
* @param businessType 业务类型 (如: 'PURCHASE_ORDER', 'SALES_ORDER' 等)
|
||||||
|
* @param businessDataMap 业务数据Map (由业务系统自己组织)
|
||||||
|
* @return 渲染后的HTML
|
||||||
|
*/
|
||||||
|
String renderByBusinessType(Long instanceId, String businessType, Map<String, Object> businessDataMap);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据直接内容渲染 (方式4:前端预览)
|
||||||
|
* 用于前端编辑时的实时预览,使用标签默认值
|
||||||
|
*
|
||||||
|
* @param content 模板内容 (HTML/Velocity语法)
|
||||||
|
* @param dataMap 数据Map (标签默认值)
|
||||||
|
* @return 渲染后的HTML
|
||||||
|
*/
|
||||||
|
String renderByContent(String content, Map<String, Object> dataMap);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将HTML导出为Word文档
|
||||||
|
*
|
||||||
|
* @param html HTML内容
|
||||||
|
* @param fileName 文件名 (不需要后缀,自动添加.docx)
|
||||||
|
* @return Word文件字节数组
|
||||||
|
*/
|
||||||
|
byte[] exportToWord(String html, String fileName);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 渲染并导出为Word (一步完成)
|
||||||
|
*
|
||||||
|
* @param instanceId 实例ID
|
||||||
|
* @param dataMap 数据Map
|
||||||
|
* @param fileName 导出文件名
|
||||||
|
* @return Word文件字节数组
|
||||||
|
*/
|
||||||
|
byte[] renderAndExportToWord(Long instanceId, Map<String, Object> dataMap, String fileName);
|
||||||
|
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
224
单位转换系统使用文档.md
Normal file
224
单位转换系统使用文档.md
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user