freemaker实现自定义变量
public String jsonTranslateHtml(String json, String templateNo, String watermark, FreemakerHandler handler) throws Exception { //TODO method 获取fileName Sao TemplateDetail templateDetailPO = templateDetailDAO.findByTemplateNo(templateNo); String fileName = templateDetailPO.getFileId(); log.info("================>>fileName:" + fileName); String html = null; File file = new File(fileName); String xml = FileUtils.readFileToString(file, "UTF-8"); // xml 转 json JSONObject obj = XML.toJSONObject(xml); String tpJson = obj.toString(); try { Map<String, Object> db = (Map<String, Object>) JSON.parse(json); Map<String, Object> tp = (Map<String, Object>) JSON.parseObject(tpJson).get("Report"); JsonReplaceHandle.mapDisplay(db, tp); Map<