|
@@ -1,10 +1,12 @@
|
|
|
package org.jeecg.modules.baogao.util;
|
|
|
|
|
|
import cn.hutool.core.io.FileUtil;
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.deepoove.poi.XWPFTemplate;
|
|
|
import com.deepoove.poi.config.Configure;
|
|
|
import com.deepoove.poi.config.ConfigureBuilder;
|
|
|
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
|
|
|
+import org.apache.commons.collections4.ListUtils;
|
|
|
import org.apache.commons.lang3.time.DateUtils;
|
|
|
import org.jeecg.modules.Itdmgongdanshuju.entity.ItdmGongdanShuju;
|
|
|
import org.jeecg.modules.baogao.common.BGType;
|
|
@@ -32,21 +34,11 @@ public class PoiTiUtils {
|
|
|
builder.buildGramer("{", "}");
|
|
|
builder.bind("g", policy);
|
|
|
builder.bind("g1", policy);
|
|
|
-
|
|
|
XWPFTemplate template = XWPFTemplate.compile(templateDocx, builder.build()).render(map);
|
|
|
template.writeAndClose(outputStream);
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
public static Map<String, Object> getWeituoYangplList(List<ItdmWeituoYangpin> yweituoInfo, List<ItdmWeituoYangpinExtend> extendList) {
|
|
|
|
|
|
List<Map<String, String>> g1maMapList = new ArrayList<>();
|
|
@@ -116,8 +108,8 @@ public class PoiTiUtils {
|
|
|
|
|
|
public static Map<String, Object> getBaogaoImage(List<String> list) {
|
|
|
|
|
|
- List<Map<String, Object>> mapList=list.stream().map(
|
|
|
- i->{
|
|
|
+ List<Map<String, Object>> mapList = list.stream().map(
|
|
|
+ i -> {
|
|
|
Map<String, Object> map1 = new HashMap<>();
|
|
|
map1.put("path", i);
|
|
|
map1.put("name", FileUtil.mainName(i));
|
|
@@ -134,7 +126,6 @@ public class PoiTiUtils {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
public static Map<String, Object> getJIanceyiju(List<ItdmWeituoYangpinExtend> extendList) {
|
|
|
|
|
|
|
|
@@ -147,7 +138,6 @@ public class PoiTiUtils {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
public static Map<String, Object> getWeituoInfo(ItdmWeituoInfo wweotuo) throws ParseException {
|
|
|
|
|
|
|
|
@@ -192,7 +182,6 @@ public class PoiTiUtils {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
public static Map<String, Object> getYuanshijilShebeiList(List<ItdmDevice> deviceList) {
|
|
|
|
|
|
|
|
@@ -227,13 +216,10 @@ public class PoiTiUtils {
|
|
|
}
|
|
|
|
|
|
|
|
|
- public static Map<String, Object> getYSjlInfo(ItdmWeituoInfo weituoInfo,List<ItdmWeituoYangpin> yweituoInfo, List<ItdmWeituoYangpinExtend> extendList) {
|
|
|
+ public static Map<String, Object> getYSjlInfo(ItdmWeituoInfo weituoInfo, List<ItdmWeituoYangpin> yweituoInfo, List<ItdmWeituoYangpinExtend> extendList) {
|
|
|
int sum = yweituoInfo.stream().mapToInt(i -> Integer.parseInt(i.getSampleQuantities())).sum();
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
String componentNo = sum > 1 ? weituoInfo.getWeituoNo() + "-001~" + String.format("%03d", sum) : weituoInfo.getWeituoNo();
|
|
|
|
|
@@ -266,31 +252,57 @@ public class PoiTiUtils {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
- }
|
|
|
+ return map;
|
|
|
+ }
|
|
|
|
|
|
|
|
|
+ public static Map<String, Object> getYSdata(List<Map<String, Object>> list) {
|
|
|
+ Map<String, Object> returnMap = new HashMap<>();
|
|
|
|
|
|
|
|
|
- return map;
|
|
|
- }
|
|
|
+ for (int i = 0; i < 69; i++) {
|
|
|
|
|
|
|
|
|
- public static Map<String, Object> getYSdata(List<String> shuju) {
|
|
|
- Map<String, Object> map = new HashMap<>();
|
|
|
+ if (i < list.size()) {
|
|
|
+ returnMap.put("yd"+i, list.get(i).get("shiyan_time"));
|
|
|
+ returnMap.put("yw"+i, list.get(i).get("shiyan_wendu"));
|
|
|
+ returnMap.put("ys"+i, list.get(i).get("shiyan_shidu"));
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ return returnMap;
|
|
|
+
|
|
|
|
|
|
- // todo
|
|
|
|
|
|
- return map;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
public static void main(String[] args) throws ParseException, IOException {
|
|
|
|
|
|
- System.out.println(FileUtil.mainName("D://123.txt"));
|
|
|
+ List<Map<String, Object>> list = new ArrayList<>();
|
|
|
+ for (int i = 0; i < 72; i++) {
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ map.put("key", "key" + i);
|
|
|
+ map.put("value", "value" + i);
|
|
|
+ list.add(map);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
}
|