lyhzzz 1 год назад
Родитель
Сommit
7197f5d051

+ 9 - 0
src/main/java/com/fdkankan/fusion/controller/CaseExtractDetailController.java

@@ -1,6 +1,7 @@
 package com.fdkankan.fusion.controller;
 
 
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.deepoove.poi.XWPFTemplate;
 import com.deepoove.poi.config.Configure;
@@ -76,6 +77,14 @@ public class CaseExtractDetailController {
          * [{"address":"222","name":"111","id":"","workplace":"222"},{"address":"22222","name":"333","id":"","workplace":"444"}]
          * [{"name":"2221","address":"222","phone":"2221","id":"2221"},{"name":"222","address":"2111122","phone":"2","id":"222"}]
          */
+        JSONArray detail = caseExtractDetail.getDetail();
+        Integer index = 0;
+        for (Object object : detail) {
+            index ++;
+            JSONObject jsonObject = (JSONObject) object;
+            jsonObject.put("index",index);
+
+        }
         Configure config = Configure.builder()
                 .bind("detail", policy).bind("extractUser", policy).bind("witnessInfo", policy).build();
 

BIN
src/main/resources/template/extract-template.docx