main
黄海 8 months ago
parent 4d530c4135
commit 4cb4f67068

@ -74,22 +74,16 @@ public class A12 {
//只关心发展规模数据的表格
if (!file.getName().contains(fileNameKey)) continue;
//县区名称
String areaName = ru.getCityName(file.getName());
String areaName = ru.getAreaName(file.getName());
//市州名称
//此文件的路径中最后一层的目录名称,应该是带着市州名称 ,把最后一层子目录的名称提出
String parentPathName = file.getParentFile().getName();
String cityName = ru.getAreaName(parentPathName);
if (StrKit.isBlank(cityName) || cityName.equals(areaName)) {
parentPathName = file.getParentFile().getParentFile().getName();
cityName = ru.getAreaName(parentPathName);
}
String cityName = ru.getCityNameByAreaName(areaName);
if (StrKit.isBlank(cityName) || StrKit.isBlank(areaName)) {
System.out.println("发现异常数据,请人工处理:" + file.getName());
System.exit(0);
}
//县区名称
//System.out.println("正在进行" + cityName + "-" + areaName + "的数据填充~");
System.out.println("正在进行" + cityName + "-" + areaName + "的数据填充~");
int chartNumber = 36;
List<List<String>> source36 =
ExcelKit.getChartData(file.getAbsolutePath(), chartNumber - 1, 6);//从2017年开始

@ -559,7 +559,7 @@ public class ExcelKit {
if (CHART_TYPES_LIST.contains(child.getName())) {
transposed.clear();
// 处理barChart或lineChart节点
//System.out.println("找到图表类型:" + child.getName());
System.out.println("找到图表类型:" + child.getName());
String type = child.getName();
xList = root.element("chart").element("plotArea").element(type).element("ser").element("cat")
.element("numRef").element("numCache").elements("pt");

@ -1,6 +1,7 @@
package com.dsideal.base.Tools.Util;
import com.dsideal.base.DataEase.Model.DataEaseModel;
import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Record;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.openxml4j.util.ZipSecureFile;
@ -46,7 +47,7 @@ public class ReadDocxUtil {
//云南省下所有城市
List<String> listCity = getCityNameList();
//城市名称的前两位一样就视为一样
String top2= fileName.substring(0,2);
String top2 = fileName.substring(0, 2);
//判断是哪个城市
boolean found = false;
@ -66,6 +67,7 @@ public class ReadDocxUtil {
/**
*
*
* @param fileName
* @return
*/
@ -76,7 +78,7 @@ public class ReadDocxUtil {
listCity.add(record.getStr("area_name"));
}
//城市名称的前两位一样就视为一样
String top2= fileName.substring(0,2);
String top2 = fileName.substring(0, 2);
//判断是哪个城市
boolean found = false;
@ -94,6 +96,12 @@ public class ReadDocxUtil {
return areaName;
}
public String getCityNameByAreaName(String areaName) {
String sql = "select id,parent_id from t_dm_area where area_name=?";
String parent_id = Db.findFirst(sql, areaName).getStr("parent_id");
return dm.getAreaById(parent_id).getStr("area_name");
}
/**
* wordexcel
*

Loading…
Cancel
Save