|
|
|
@ -4,6 +4,7 @@ import cn.hutool.core.io.FileUtil;
|
|
|
|
|
import com.dsideal.base.Tools.FillData.ExcelKit.ExcelKit;
|
|
|
|
|
import com.dsideal.base.Tools.Util.LocalMysqlConnectUtil;
|
|
|
|
|
import com.dsideal.base.Tools.Util.ReadDocxUtil;
|
|
|
|
|
import com.jfinal.kit.StrKit;
|
|
|
|
|
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
|
|
|
|
|
import org.apache.poi.openxml4j.util.ZipSecureFile;
|
|
|
|
|
import org.apache.poi.ss.usermodel.Row;
|
|
|
|
@ -86,7 +87,9 @@ public class C2 {
|
|
|
|
|
Row outRow = outSheet.createRow(++rowIndex);
|
|
|
|
|
// 导出数据
|
|
|
|
|
//年份,总量分类,区域分类,总量数值,区域数值,行政区划,上级行政区划
|
|
|
|
|
ExcelKit.putData(outRow, new ArrayList<>(Arrays.asList(r.getFirst(), c2, "", r.get(4), "", cityName, "云南省")), dataStyle);
|
|
|
|
|
double xvalue = Double.parseDouble(r.get(4));
|
|
|
|
|
String value = String.format("%.2f", xvalue);
|
|
|
|
|
ExcelKit.putData(outRow, new ArrayList<>(Arrays.asList(r.getFirst().split("\\.")[0], c2, "", value, "", cityName, "云南省")), dataStyle);
|
|
|
|
|
}
|
|
|
|
|
//2022年基数:遍历source2
|
|
|
|
|
for (int i = 0; i < source2.size(); i++) {
|
|
|
|
@ -94,7 +97,9 @@ public class C2 {
|
|
|
|
|
Row outRow = outSheet.createRow(++rowIndex);
|
|
|
|
|
// 导出数据
|
|
|
|
|
//年份,总量分类,区域分类,总量数值,区域数值,行政区划,上级行政区划
|
|
|
|
|
ExcelKit.putData(outRow, new ArrayList<>(Arrays.asList(r.getFirst(), "2022年基数", "", source2.getFirst().get(4),
|
|
|
|
|
double xvalue = Double.parseDouble(source2.getFirst().get(4));
|
|
|
|
|
String value = String.format("%.2f", xvalue);
|
|
|
|
|
ExcelKit.putData(outRow, new ArrayList<>(Arrays.asList(r.getFirst().split("\\.")[0], "2022年基数", "", value,
|
|
|
|
|
"", cityName, "云南省")), dataStyle);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -111,16 +116,24 @@ public class C2 {
|
|
|
|
|
List<String> r = source1.get(i);
|
|
|
|
|
Row outRow = outSheet.createRow(++rowIndex);
|
|
|
|
|
//年份,总量分类,区域分类,总量数值,区域数值,行政区划,上级行政区划
|
|
|
|
|
ExcelKit.putData(outRow, new ArrayList<>(Arrays.asList(r.getFirst(), "", areaName, "",
|
|
|
|
|
r.get(k + 1), cityName, "云南省")), dataStyle);
|
|
|
|
|
String q = r.get(k + 1);
|
|
|
|
|
if (StrKit.isBlank(q)) q = "0";
|
|
|
|
|
double xvalue = Double.parseDouble(q);
|
|
|
|
|
String value = String.format("%.2f", xvalue);
|
|
|
|
|
ExcelKit.putData(outRow, new ArrayList<>(Arrays.asList(r.getFirst().split("\\.")[0], "", areaName, "",
|
|
|
|
|
value, cityName, "云南省")), dataStyle);
|
|
|
|
|
}
|
|
|
|
|
for (int i = 0; i < source2.size(); i++) {
|
|
|
|
|
if (i == 0) continue;
|
|
|
|
|
List<String> r = source2.get(i);
|
|
|
|
|
Row outRow = outSheet.createRow(++rowIndex);
|
|
|
|
|
//年份,总量分类,区域分类,总量数值,区域数值,行政区划,上级行政区划
|
|
|
|
|
ExcelKit.putData(outRow, new ArrayList<>(Arrays.asList(r.getFirst(), "", areaName, "",
|
|
|
|
|
r.get(k + 1), cityName, "云南省")), dataStyle);
|
|
|
|
|
String q = r.get(k + 1);
|
|
|
|
|
if (StrKit.isBlank(q)) q = "0";
|
|
|
|
|
double xvalue = Double.parseDouble(q);
|
|
|
|
|
String value = String.format("%.2f", xvalue);
|
|
|
|
|
ExcelKit.putData(outRow, new ArrayList<>(Arrays.asList(r.getFirst().split("\\.")[0], "", areaName, "",
|
|
|
|
|
value, cityName, "云南省")), dataStyle);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|