|
|
|
@ -3,6 +3,7 @@ package com.dsideal.base.DataEase.Model;
|
|
|
|
|
import com.dsideal.base.BaseApplication;
|
|
|
|
|
import com.dsideal.base.Util.ExcelCommonUtil;
|
|
|
|
|
import com.jfinal.kit.Kv;
|
|
|
|
|
import com.jfinal.kit.StrKit;
|
|
|
|
|
import com.jfinal.plugin.activerecord.Db;
|
|
|
|
|
import com.jfinal.plugin.activerecord.Record;
|
|
|
|
|
import com.jfinal.plugin.activerecord.SqlPara;
|
|
|
|
@ -66,7 +67,15 @@ public class DataEaseModel {
|
|
|
|
|
} else if (colName.equals("上级行政区划")) {
|
|
|
|
|
record.set(colName, parent_area_name);
|
|
|
|
|
} else {
|
|
|
|
|
record.set(colName, value);
|
|
|
|
|
if (StrKit.isBlank(value.trim()) && colName.equals("数值")) {
|
|
|
|
|
record.set(colName, 0);
|
|
|
|
|
} else if (isInteger(value)) {
|
|
|
|
|
record.set(colName, Integer.parseInt(value));
|
|
|
|
|
} else if (isDouble(value)) {
|
|
|
|
|
record.set(colName, Double.parseDouble(value));
|
|
|
|
|
} else {
|
|
|
|
|
record.set(colName, value);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
list.add(record);
|
|
|
|
@ -74,6 +83,23 @@ public class DataEaseModel {
|
|
|
|
|
Db.use(DB_NAME).batchSave(tableName, list, 100);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public boolean isInteger(String str) {
|
|
|
|
|
try {
|
|
|
|
|
Integer.parseInt(str);
|
|
|
|
|
return true;
|
|
|
|
|
} catch (NumberFormatException e) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public boolean isDouble(String str) {
|
|
|
|
|
try {
|
|
|
|
|
Double.parseDouble(str);
|
|
|
|
|
return true;
|
|
|
|
|
} catch (NumberFormatException e) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取指定大屏中的地图配置信息
|
|
|
|
|