新增打印模板管理功能,包含免密接口和实时通知机制,支持桌面端打印模板的查询和列表展示。更新相关控制器、服务和视图,优化用户体验并增强系统的实时数据同步能力。
This commit is contained in:
@@ -198,6 +198,36 @@ public class PrintTemplateController extends JeecgController<PrintTemplate, IPri
|
||||
return Result.OK(t);
|
||||
}
|
||||
|
||||
// ═══════════════════════════ 桌面端免密接口 ═══════════════════════════
|
||||
|
||||
/**
|
||||
* 免密-通过编码查询(供 WPF 桌面端匿名调用)
|
||||
*/
|
||||
@Operation(summary = "打印模板-免密通过编码查询(桌面端)")
|
||||
@GetMapping(value = "/anon/queryByCode")
|
||||
public Result<PrintTemplate> anonQueryByCode(@RequestParam(name = "code") String code) {
|
||||
PrintTemplate t = service.getByCode(code);
|
||||
if (t == null) {
|
||||
return Result.error("未找到模板: " + code);
|
||||
}
|
||||
return Result.OK(t);
|
||||
}
|
||||
|
||||
/**
|
||||
* 免密-分页列表(供 WPF 桌面端匿名调用,用于打印设置页选择模板)
|
||||
*/
|
||||
@Operation(summary = "打印模板-免密分页列表(桌面端)")
|
||||
@GetMapping(value = "/anon/list")
|
||||
public Result<IPage<PrintTemplate>> anonList(PrintTemplate query,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "100") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<PrintTemplate> qw = QueryGenerator.initQueryWrapper(query, req.getParameterMap());
|
||||
qw.orderByAsc("template_code");
|
||||
Page<PrintTemplate> page = new Page<>(pageNo, pageSize);
|
||||
return Result.OK(service.page(page, qw));
|
||||
}
|
||||
|
||||
@AutoLog(value = "打印模板-图片分析生成原生JSON")
|
||||
@Operation(summary = "打印模板-上传图片分析为原生模板JSON(前端传 imageBase64;可接 OpenAI 兼容视觉模型)")
|
||||
@PostMapping(value = "/analyzeImageForNative")
|
||||
|
||||
@@ -70,6 +70,11 @@ public class MesXslStompNotifyService {
|
||||
publish("/topic/sync/mes-warehouse-areas", "MES_WAREHOUSE_AREA_CHANGED", "warehouseAreaId", warehouseAreaId, action);
|
||||
}
|
||||
|
||||
/** 广播打印模板变更事件到 /topic/sync/print-templates */
|
||||
public void publishPrintTemplateChanged(String action, String templateId) {
|
||||
publish("/topic/sync/print-templates", "PRINT_TEMPLATE_CHANGED", "templateId", templateId, action);
|
||||
}
|
||||
|
||||
// ─────────────────────────── 私有辅助 ────────────────────────────
|
||||
|
||||
private void publish(String topic, String cmd, String idKey, String idValue, String action) {
|
||||
|
||||
Reference in New Issue
Block a user