ReportExportService.java 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485
  1. package cn.cslg.pas.service;
  2. import cn.cslg.pas.common.dto.PatentDetailDTO;
  3. import cn.cslg.pas.common.dto.es.EsCustomFieldDTO;
  4. import cn.cslg.pas.common.dto.es.EsCustomFieldValueDTO;
  5. import cn.cslg.pas.common.model.SystemMO;
  6. import cn.cslg.pas.common.utils.DateUtils;
  7. import cn.cslg.pas.common.utils.FileUtils;
  8. import cn.cslg.pas.common.utils.FormatUtil;
  9. import cn.cslg.pas.common.utils.PatentRightUtils;
  10. import cn.cslg.pas.common.vo.AvoidFeaturesVO;
  11. import cn.cslg.pas.common.vo.FieldValueVO;
  12. import cn.cslg.pas.common.vo.PatentRightParams;
  13. import cn.cslg.pas.common.vo.RePatentClaim;
  14. import cn.cslg.pas.common.vo.business.AllCustomFieldVO;
  15. import cn.cslg.pas.common.vo.business.PatentNoVO;
  16. import cn.cslg.pas.domain.business.*;
  17. import cn.cslg.pas.domain.es.Text;
  18. import cn.cslg.pas.exception.XiaoShiException;
  19. import cn.cslg.pas.mapper.AvoidDesignMapper;
  20. import cn.cslg.pas.service.business.CustomFieldService;
  21. import cn.cslg.pas.service.business.ReportProjectService;
  22. import cn.cslg.pas.service.business.TemplateConfigService;
  23. import cn.cslg.pas.service.business.TempleService;
  24. import cn.cslg.pas.service.business.es.EsPatentService;
  25. import cn.cslg.pas.service.business.es.EsService;
  26. import cn.cslg.pas.service.common.FileManagerService;
  27. import cn.hutool.core.util.IdUtil;
  28. import com.alibaba.fastjson.JSON;
  29. import com.alibaba.fastjson.JSONObject;
  30. import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  31. import com.deepoove.poi.XWPFTemplate;
  32. import com.deepoove.poi.config.Configure;
  33. import com.deepoove.poi.data.PictureRenderData;
  34. import com.deepoove.poi.data.PictureType;
  35. import com.deepoove.poi.data.Pictures;
  36. import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
  37. import lombok.extern.slf4j.Slf4j;
  38. import org.apache.poi.ss.usermodel.PictureData;
  39. import org.ddr.poi.html.HtmlRenderPolicy;
  40. import org.joda.time.format.FormatUtils;
  41. import org.springframework.beans.factory.annotation.Autowired;
  42. import org.springframework.stereotype.Service;
  43. import java.io.File;
  44. import java.io.FileInputStream;
  45. import java.io.IOException;
  46. import java.util.*;
  47. import java.util.stream.Collectors;
  48. @Slf4j
  49. @Service
  50. public class ReportExportService {
  51. @Autowired
  52. private TempleService templeService;
  53. @Autowired
  54. private FileUtils fileUtils;
  55. @Autowired
  56. private ReportProjectService reportProjectService;
  57. @Autowired
  58. private FileManagerService fileManagerService;
  59. @Autowired
  60. private EsPatentService esPatentService;
  61. @Autowired
  62. private AvoidDesignMapper avoidDesignMapper;
  63. @Autowired
  64. private TemplateConfigService templateConfigService;
  65. @Autowired
  66. private CustomFieldService customFieldService;
  67. @Autowired
  68. private EsService esService;
  69. /**
  70. * @param projectId
  71. * @param templeId
  72. * @return
  73. * @throws IOException
  74. * @function: 导出报告
  75. */
  76. public String exportReport(Integer projectId, Integer templeId) throws IOException {
  77. //根据模板ID获得模板
  78. ReportTemple reportTemplate = templeService.getById(templeId);
  79. //获得模板路径
  80. String templateFilePath = fileUtils.getPath(reportTemplate.getTemplatePath());
  81. //读取模板后保存生成word的地址
  82. String fileName = IdUtil.simpleUUID() + ".docx";
  83. String directoryName = fileUtils.createDirectory();
  84. String outPath = fileUtils.getSavePath(directoryName) + fileName;
  85. //根据ProjectId 获得报告
  86. LambdaQueryWrapper<ReportProject> queryWrapper = new LambdaQueryWrapper<>();
  87. queryWrapper.eq(ReportProject::getProjectId, projectId);
  88. ReportProject report = reportProjectService.getOne(queryWrapper, false);
  89. if (report == null) {
  90. throw new XiaoShiException("报告不存在");
  91. }
  92. XWPFTemplate template = null;
  93. template = this.avoidDesignTemplate(projectId);
  94. if (report.getReportType() == 0 || report.getReportType() == 2) {
  95. // template = this.getstabilityTemplate(report, filePath);
  96. } else if (report.getReportType() == 3) {
  97. // template = this.FTOtemplate(reportId, filePath, templeId);
  98. } else if (report.getReportType() == 4) {
  99. // template = this.Torttemplate(reportId, filePath, templeId);
  100. } else if (report.getReportType() == 5) {
  101. // template = this.avoidDesignTemplate(reportId, filePath);
  102. } else if (report.getReportType() == 1) {
  103. // template = this.getThirdTemplate(report, filePath);
  104. }
  105. // 读取模板、数据并渲染
  106. // 文件是否已存在,则删除
  107. File file = new File(outPath);
  108. if (file.exists()) {
  109. file.delete();
  110. }
  111. // 生成word保存在指定目录
  112. template.writeToFile(outPath);
  113. template.close();
  114. //导出成功后,导出报告记录入库
  115. // String url = fileUtils.getDirectory2(directoryName) + fileName;
  116. // PersonnelVO personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
  117. // ReportDocument reportDocument = new ReportDocument();
  118. // reportDocument.setReportId(reportId);
  119. // reportDocument.setFileName(fileName);
  120. // reportDocument.setFilePath(url);
  121. // reportDocument.setPersonId(personnelVO.getId());
  122. // reportDocument.setTemplateId(reportTemplate.getId());
  123. // reportDocument.setTemplateName(reportTemplate.getTemplateName());
  124. // reportDocument.setPersonName(personnelVO.getName());
  125. // reportDocument.insert();
  126. // return Response.success(url);
  127. return "";
  128. }
  129. // private XWPFTemplate Torttemplate(Integer reportId, String filePath, Integer templateId) throws IOException {
  130. // //根据报告Id查询标的专利号
  131. // ReportProject report = reportProjectService.getById(reportId);
  132. // String patentNo = report.getSignPatentNo();
  133. //// PatentVO patentVO = new PatentVO();
  134. //// patentVO.setPatentNos(Arrays.asList(patentNo));
  135. //// //根据专利号查询专利详细信息
  136. //// String resBody = outInterfaceService.getPatentDTOListForRMS(patentVO);
  137. //// JSONObject jsonObject = JSONObject.parseObject(resBody);
  138. //// List<JSONObject> patentDTOS = JSON.parseArray(jsonObject.get("data").toString(), JSONObject.class);
  139. //// //装载单个专利的信息
  140. // Map<String, Object> patentMap = new HashMap<>();
  141. //// JSONObject patent = patentDTOS.get(0);
  142. //// List<JSONObject> applicantJSONs = JSON.parseArray(patent.get("applicant").toString(), JSONObject.class);
  143. //// StringBuilder applicants = new StringBuilder();
  144. //// StringBuilder rightPerson = new StringBuilder();
  145. //// applicantJSONs.forEach(tem -> {
  146. //// if (Integer.parseInt(tem.get("dataType").toString()) == 1) {
  147. //// applicants.append(tem.get("name") + "\r");
  148. //// } else {
  149. //// rightPerson.append(tem.get("name") + "\r");
  150. //// }
  151. //// });
  152. //// //装载同族信息
  153. //// JSONObject familys = JSONObject.parseObject(patent.get("family").toString());
  154. //// List<String> patSnaps = JSON.parseArray(familys.get("patSnap").toString(), String.class);
  155. //// List<String> simples = JSON.parseArray(familys.get("simple").toString(), String.class);
  156. //// List<String> inpadocs = JSON.parseArray(familys.get("inpadoc").toString(), String.class);
  157. //// patSnaps.addAll(simples);
  158. //// patSnaps.addAll(inpadocs);
  159. //// String familyStr = StringUtils.join(patSnaps, ",");
  160. //// //装载法律状态
  161. //// StringBuilder affair = new StringBuilder();
  162. //// List<JSONObject> affaires = JSON.parseArray(patent.get("affair").toString(), JSONObject.class);
  163. //// affaires.forEach(item -> {
  164. //// affair.append(item.get("status") + "\r");
  165. //// }
  166. //// );
  167. //// //同族专利
  168. //// patentMap.put("simpleFamilys", familyStr);
  169. //// //引用专利
  170. //// patentMap.put("quotePatents", patent.get("quote"));
  171. //// //申请日
  172. //// patentMap.put("applicationDate", patent.get("applicationDate"));
  173. //// //公开日
  174. //// patentMap.put("publicDate", patent.get("publicDate"));
  175. //// //专利号
  176. //// patentMap.put("publicNo", patent.get("publicNo"));
  177. //// patentMap.put("firstPublicDate", patent.get("firstPublicDate"));
  178. //// patentMap.put("applicant", applicants);
  179. //// patentMap.put("rightPerson", rightPerson);
  180. //// patentMap.put("affair", affair);
  181. //// patentMap.put("name", patent.get("name"));
  182. // //图示
  183. // patentMap.put("abstractPath", "");
  184. // //获得专利对比记录的信息
  185. //// Map<String, Object> temMap = compareMessageService.queryforTemplate(patent.get("patentNo").toString(), reportId);
  186. //// List<CompareMessageVO> compareMessageVOS = (List<CompareMessageVO>) temMap.get("compareMessageVOs");
  187. // //装载对比记录的信息
  188. //// patentMap.put("cM", compareMessageVOS);
  189. //// patentMap.put("rightNum", temMap.get("right"));
  190. //// patentMap.put("mainRightNum", temMap.get("mainRight"));
  191. // Map<String, Object> map = new HashMap<>();
  192. // String date = DateUtils.formatDate(new Date(), DateUtils.YYYY_MM_DD);
  193. // String[] ds = date.split("-");
  194. // map.put("sys", new SystemMO(ds[0], ds[1], ds[2], "", "reportName"));
  195. // map.put("patentMap", patentMap);
  196. // map.put("", patentNo);
  197. // // 为表格的显示绑定行循环
  198. // LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
  199. // HtmlRenderPolicy htmlRenderPolicy = new HtmlRenderPolicy();
  200. // // 将bz设置为行循环绑定的数据源的key,即key是bz的value会在模板中的{{bz}}处进行解析
  201. // Configure configure = Configure.builder().bind("cM", policy).bind("targetDescription", htmlRenderPolicy).build();
  202. // XWPFTemplate template = XWPFTemplate.compile(filePath, configure).render(map);
  203. // return template;
  204. // }
  205. private XWPFTemplate avoidDesignTemplate(Integer projectId) throws IOException {
  206. String filePath = fileUtils.getPath("/11.docx");
  207. log.info("开始处理导出规避设计报告,参数为:{}, {}", projectId, filePath);
  208. LambdaQueryWrapper<ReportProject> queryWrapper = new LambdaQueryWrapper<>();
  209. queryWrapper.eq(ReportProject::getProjectId, projectId);
  210. ReportProject report = reportProjectService.getOne(queryWrapper, false);
  211. String signPatentNo = report.getSignPatentNo();
  212. //装载标的专利信息
  213. Map<String, Object> signPatent = this.signPatentMess(report.getSignPatentNo());
  214. System.out.println(signPatent.get(""));
  215. Map<String, Object> map = new HashMap<>();
  216. //装载标的专利信息
  217. map.put("signPatent", signPatent);
  218. map.put("rights", signPatent.get("rights"));
  219. //装载公开/公告号
  220. map.put("patentNo", signPatentNo);
  221. //装载年月日
  222. String date = DateUtils.formatDate(new Date(), DateUtils.YYYY_MM_DD);
  223. String[] dates = date.split("-");
  224. SystemMO systemMO = new SystemMO()
  225. .setYear(dates[0])
  226. .setMonth(dates[1])
  227. .setDay(dates[2]);
  228. map.put("sys", systemMO);
  229. //
  230. //装载特征、解释、回避设计方向、回避设计总体方向
  231. List<AvoidFeaturesVO> features = avoidDesignMapper.selectAvoidDesign(projectId);
  232. // String wholeDirection = avoidDesignWholeDirectionMapper.selectWholeDirectionByReportId(reportId);
  233. map.put("features", features);
  234. // map.put("wholeDirection", wholeDirection);
  235. //
  236. //绑定政策(绑定集合和元素循环遍历)
  237. LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
  238. //把指定元素内容识别传输成html格式
  239. HtmlRenderPolicy htmlRenderPolicy = new HtmlRenderPolicy();
  240. Configure configure = Configure.builder()
  241. .bind("signPatent.rights", policy)
  242. .bind("features", policy)
  243. .bind("explainText", htmlRenderPolicy)
  244. .bind("littleDirection", htmlRenderPolicy)
  245. .bind("wholeDirection", htmlRenderPolicy)
  246. .build();
  247. XWPFTemplate template = XWPFTemplate.compile(filePath, configure).render(map);
  248. return template;
  249. }
  250. public Map<String, Object> signPatentMess(String patentNo) throws IOException {
  251. // PatentNoVO patentVO = new PatentNoVO();
  252. // patentVO.setPatentNo(patentNo);
  253. // //根据专利号查询专利详细信息
  254. // PatentDetailDTO patentDetailDTO = esPatentService.selectPatentDetail(patentVO);
  255. // //装载单个专利的信息
  256. Map<String, Object> patentMap = new HashMap<>();
  257. // StringBuilder applicants = new StringBuilder();
  258. // StringBuilder rightPerson = new StringBuilder();
  259. //
  260. // //申请日
  261. // patentMap.put("applicationDate", patentDetailDTO.getAppDate());
  262. //
  263. // //公开日
  264. // patentMap.put("publicDate", patentDetailDTO.getPublicDate());
  265. // //公开号
  266. // patentMap.put("publicNo", patentDetailDTO.getPublicNo());
  267. // //专利号
  268. // patentMap.put("patentNo", patentDetailDTO.getPatentNo());
  269. // //专利权人
  270. // patentMap.put("rightPerson", rightPerson);
  271. // //图示
  272. // String guid = FormatUtil.getPictureFormat(patentDetailDTO.getAppNo());
  273. // PictureRenderData pictureData = this.guidToStream(guid);
  274. // if (pictureData != null) {
  275. // patentMap.put("abstractPath", pictureData);
  276. // }
  277. // //获得标题
  278. // if (patentDetailDTO.getTitle() != null && patentDetailDTO.getTitle().size() > 0) {
  279. // Text title = patentDetailDTO.getTitle().stream()
  280. // .filter(item -> item.getIfOrigin().equals(true)).findFirst().orElse(null);
  281. // if (title != null) {
  282. // patentMap.put("name", title.getTextContent());
  283. // }
  284. // }
  285. //
  286. // //获得权要
  287. // List<Map<String, Object>> rights= this.getClaimMaps(patentDetailDTO.getClaim(),patentDetailDTO.getPatentNo());
  288. //
  289. // patentMap.put("rights", rights);
  290. return patentMap;
  291. }
  292. private PictureRenderData guidToStream(String guid) {
  293. PictureRenderData pictureRenderData = null;
  294. byte[] bytes = null;
  295. if (bytes != null) {
  296. try {
  297. bytes = fileManagerService.downloadSystemFileFromFMS(guid);
  298. } catch (Exception e) {
  299. }
  300. }
  301. FileInputStream fileInputStream = FileUtils.byteToFile(bytes);
  302. pictureRenderData = Pictures.ofStream(fileInputStream, PictureType.PNG)
  303. .create();
  304. return pictureRenderData;
  305. }
  306. private List<Map<String, Object>> getClaimMaps(List<Text> claims, String patentNo) {
  307. List<Map<String, Object>> rights = new ArrayList<>();
  308. if (claims == null || claims.size() == 0) {
  309. return rights;
  310. }
  311. Text claim = claims.stream().filter(item -> item.getIfOrigin().equals(true)).findFirst().orElse(null);
  312. if (claim == null) {
  313. return rights;
  314. }
  315. PatentRightParams params = new PatentRightParams();
  316. params.setContent(claim.getTextContent());
  317. params.setPatentNo(patentNo);
  318. List<RePatentClaim> patentRights = PatentRightUtils.formatPatentRight(params);
  319. //给权要进行格式更改
  320. patentRights.forEach(item -> {
  321. Map<String, Object> temMap = new HashMap<>();
  322. temMap.put("rightName", "权" + (item.getSort() + 1));
  323. temMap.put("content", item.getContent());
  324. temMap.put("rightNameLong", "权利要求" + (item.getSort() + 1));
  325. temMap.put("parentSort", item.getParentSort());
  326. temMap.put("sort", item.getSort());
  327. rights.add(temMap);
  328. });
  329. return rights;
  330. }
  331. /**
  332. * @param projectId
  333. * @param filePath
  334. * @return
  335. * @description 装载FTO模板
  336. */
  337. private XWPFTemplate FTOTemplate(Integer projectId, String filePath, Integer templateId) throws IOException {
  338. //根据报告ID获得自定义字段值的信息
  339. //获得模板的配置信息
  340. LambdaQueryWrapper<TemplateConfig> templateConfigWrapper = new LambdaQueryWrapper<TemplateConfig>();
  341. templateConfigWrapper.eq(TemplateConfig::getTemplateId, templateId);
  342. List<TemplateConfig> templateConfigs = templateConfigService.list(templateConfigWrapper);
  343. for (TemplateConfig templateConfig : templateConfigs) {
  344. String value = templateConfig.getValueName();
  345. //根据value 查询专利
  346. List<EsCustomFieldDTO> esCustomFieldDTOS = customFieldService.getCustomFieldByValueName(value,projectId);
  347. if(esCustomFieldDTOS.size()!=0){
  348. }
  349. }
  350. //
  351. List<Map<String, Object>> classifyMaps = new ArrayList<>();
  352. //装载信息
  353. // for (TemplateConfig templateConfig : templateConfigs) {
  354. // Map<String, Object> classifyMap = new HashMap<>();
  355. // classifyMap.put("classify", map.get("CName"));
  356. // //根据自定义字段ID和值Id查询专利号
  357. // List<String> patentNos = reportFieldPatentLinkService.getPatentNos(Integer.parseInt(map.get("FId").toString()), Integer.parseInt(map.get("CId").toString()));
  358. // PatentVO patentVO = new PatentVO();
  359. // patentVO.setPatentNos(patentNos);
  360. // //根据专利号查询专利详细信息
  361. // String resBody = outInterfaceService.getPatentDTOListForRMS(patentVO);
  362. // JSONObject jsonObject = JSONObject.parseObject(resBody);
  363. // List<JSONObject> patentDTOS = JSON.parseArray(jsonObject.get("data").toString(), JSONObject.class);
  364. // //根据专利号和报告Id获得对比记录
  365. // //存放公告专利
  366. // List<Map<String, Object>> announcePatents = new ArrayList<>();
  367. // //存放公开专利
  368. // List<Map<String, Object>> publicPatents = new ArrayList<>();
  369. // //存放失效专利信息
  370. // List<Map<String, Object>> lapsePatents = new ArrayList<>();
  371. // for (JSONObject patent : patentDTOS) {
  372. // List<JSONObject> applicantJSONs = JSON.parseArray(patent.get("applicant").toString(), JSONObject.class);
  373. // StringBuilder applicants = new StringBuilder();
  374. // StringBuilder rightPerson = new StringBuilder();
  375. // applicantJSONs.forEach(tem -> {
  376. // if (Integer.parseInt(tem.get("dataType").toString()) == 1) {
  377. // applicants.append(tem.get("name") + "\r");
  378. // } else {
  379. // rightPerson.append(tem.get("name") + "\r");
  380. // }
  381. // });
  382. // //装载同族信息
  383. // JSONObject familys = JSONObject.parseObject(patent.get("family").toString());
  384. // List<String> patSnaps = JSON.parseArray(familys.get("patSnap").toString(), String.class);
  385. // List<String> simples = JSON.parseArray(familys.get("simple").toString(), String.class);
  386. // List<String> inpadocs = JSON.parseArray(familys.get("inpadoc").toString(), String.class);
  387. // patSnaps.addAll(simples);
  388. // patSnaps.addAll(inpadocs);
  389. // String familyStr = StringUtils.join(patSnaps, ",");
  390. // //装载法律状态
  391. // StringBuilder affair = new StringBuilder();
  392. // List<JSONObject> affaires = JSON.parseArray(patent.get("affair").toString(), JSONObject.class);
  393. // affaires.forEach(item -> {
  394. // affair.append(item.get("status") + "\r");
  395. // }
  396. //
  397. // );
  398. // //装载单个专利的信息
  399. // Map<String, Object> patentMap = new HashMap<>();
  400. // //同族专利
  401. // patentMap.put("simpleFamilys", familyStr);
  402. // //引用专利
  403. // patentMap.put("quotePatents", patent.get("quote"));
  404. // //申请日
  405. // patentMap.put("applicationDate", patent.get("applicationDate"));
  406. // //公开日
  407. // patentMap.put("publicDate", patent.get("publicDate"));
  408. // //专利号
  409. // patentMap.put("publicNo", patent.get("publicNo"));
  410. // patentMap.put("firstPublicDate", patent.get("firstPublicDate"));
  411. // patentMap.put("applicant", applicants);
  412. // patentMap.put("rightPerson", rightPerson);
  413. // patentMap.put("affair", affair);
  414. // //优先权日
  415. // patentMap.put("priorityDate", patent.get("priorityDate"));
  416. // //图示
  417. // patentMap.put("abstractPath", "http://139.224.24.90:8081" + patent.get("abstractPath"));
  418. // //获得专利对比记录的信息
  419. // Map<String, Object> temMap = compareMessageService.queryforTemplate(patent.get("patentNo").toString(), reportId);
  420. // List<CompareMessageVO> compareMessageVOS = (List<CompareMessageVO>) temMap.get("compareMessageVOs");
  421. // //装载对比记录的信息
  422. // patentMap.put("cM", compareMessageVOS);
  423. // patentMap.put("rightNum", temMap.get("right"));
  424. // patentMap.put("mainRightNum", temMap.get("mainRight"));
  425. // Integer status = Integer.parseInt(patent.get("simpleStatusInt").toString());
  426. // if (status == 1 || status == 5 || status == 6) {
  427. // announcePatents.add(patentMap);
  428. // } else if (status == 2) {
  429. // lapsePatents.add(patentMap);
  430. // } else if (status == 3) {
  431. // publicPatents.add(patentMap);
  432. // }
  433. // classifyMap.put("publicPatents", publicPatents);
  434. // classifyMap.put("lapsePatents", lapsePatents);
  435. // classifyMap.put("announcePatents", announcePatents);
  436. // }
  437. // classifyMaps.add(classifyMap);
  438. // }
  439. // Map<String, Object> map = new HashMap<>();
  440. // String date = DateUtils.formatDate(new Date(), DateUtils.YYYY_MM_DD);
  441. // String[] ds = date.split("-");
  442. // map.put("sys", new SystemMO(ds[0], ds[1], ds[2], "", "reportName"));
  443. // map.put("classifys", classifyMaps);
  444. // // 为表格的显示绑定行循环
  445. // LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
  446. // HtmlRenderPolicy htmlRenderPolicy = new HtmlRenderPolicy();
  447. // // 将bz设置为行循环绑定的数据源的key,即key是bz的value会在模板中的{{bz}}处进行解析
  448. // Configure configure = Configure.builder().bind("cM", policy).bind("targetDescription", htmlRenderPolicy).build();
  449. // XWPFTemplate template = XWPFTemplate.compile(filePath, configure).render(map);
  450. // return template;
  451. return null;
  452. }
  453. }