Commit d89f0e14 authored by fangxinjiang's avatar fangxinjiang

Merge remote-tracking branch 'origin/MVP1.7.21' into MVP1.7.21

parents e784d745 484295d0
...@@ -342,19 +342,49 @@ public class ExcelUtil <T> implements Serializable { ...@@ -342,19 +342,49 @@ public class ExcelUtil <T> implements Serializable {
field.set(data, c); field.set(data, c);
} else if (BigDecimal.class == fieldType) { } else if (BigDecimal.class == fieldType) {
c = c.indexOf('%') != -1 ? c.replace("%", "") : c; c = c.indexOf('%') != -1 ? c.replace("%", "") : c;
try {
field.set(data, BigDecimal.valueOf(Double.valueOf(c))); field.set(data, BigDecimal.valueOf(Double.valueOf(c)));
} catch (NumberFormatException e) {
errorMessageHashMap = initErrorMessage(errorMessageHashMap,
new ErrorMessage(rowNum, attr.name() + ":'" + c + "'不是有效的数字格式"), errorTemp);
continue;
}
} else if (Date.class == fieldType && Common.isNotNull(c.trim())) { } else if (Date.class == fieldType && Common.isNotNull(c.trim())) {
field.set(data, DateUtil.parseDate(c.trim(), Common.isEmpty(attr.dateFormat()) ? DateUtil.ISO_EXPANDED_DATE_FORMAT : attr.dateFormat())); field.set(data, DateUtil.parseDate(c.trim(), Common.isEmpty(attr.dateFormat()) ? DateUtil.ISO_EXPANDED_DATE_FORMAT : attr.dateFormat()));
} else if ((Integer.TYPE == fieldType) || (Integer.class == fieldType)) { } else if ((Integer.TYPE == fieldType) || (Integer.class == fieldType)) {
try {
field.set(data, Integer.parseInt(c)); field.set(data, Integer.parseInt(c));
} catch (NumberFormatException e) {
errorMessageHashMap = initErrorMessage(errorMessageHashMap,
new ErrorMessage(rowNum, attr.name() + ":'" + c + "'不是有效的整数格式"), errorTemp);
continue;
}
} else if ((Long.TYPE == fieldType) || (Long.class == fieldType)) { } else if ((Long.TYPE == fieldType) || (Long.class == fieldType)) {
try {
field.set(data, Long.valueOf(c)); field.set(data, Long.valueOf(c));
} catch (NumberFormatException e) {
errorMessageHashMap = initErrorMessage(errorMessageHashMap,
new ErrorMessage(rowNum, attr.name() + ":'" + c + "'不是有效的长整数格式"), errorTemp);
continue;
}
} else if ((Float.TYPE == fieldType) || (Float.class == fieldType)) { } else if ((Float.TYPE == fieldType) || (Float.class == fieldType)) {
try {
field.set(data, Float.valueOf(c)); field.set(data, Float.valueOf(c));
} catch (NumberFormatException e) {
errorMessageHashMap = initErrorMessage(errorMessageHashMap,
new ErrorMessage(rowNum, attr.name() + ":'" + c + "'不是有效的浮点数格式"), errorTemp);
continue;
}
} else if ((Short.TYPE == fieldType) || (Short.class == fieldType)) { } else if ((Short.TYPE == fieldType) || (Short.class == fieldType)) {
field.set(data, Short.valueOf(c)); field.set(data, Short.valueOf(c));
} else if ((Double.TYPE == fieldType) || (Double.class == fieldType)) { } else if ((Double.TYPE == fieldType) || (Double.class == fieldType)) {
try {
field.set(data, Double.valueOf(c)); field.set(data, Double.valueOf(c));
} catch (NumberFormatException e) {
errorMessageHashMap = initErrorMessage(errorMessageHashMap,
new ErrorMessage(rowNum, attr.name() + ":'" + c + "'不是有效的双精度浮点数格式"), errorTemp);
continue;
}
} else if (Character.TYPE == fieldType) { } else if (Character.TYPE == fieldType) {
if ((c != null) && (c.length() > 0)) { if ((c != null) && (c.length() > 0)) {
field.set(data, Character.valueOf(c.charAt(0))); field.set(data, Character.valueOf(c.charAt(0)));
......
...@@ -205,11 +205,11 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe ...@@ -205,11 +205,11 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
// 此方法是:删除临时文件 // 此方法是:删除临时文件
public void cleanSpireTempFiles() { public void cleanSpireTempFiles() {
try { try {
// 暂停1分钟 // 暂停1分钟:不暂停,删10分钟前的数据
try { /*try {
Thread.sleep(60000); Thread.sleep(60000);
} catch (InterruptedException e) { } catch (InterruptedException e) {
} }*/
String tempDirPath = System.getProperty("java.io.tmpdir"); String tempDirPath = System.getProperty("java.io.tmpdir");
File tempDir = new File(tempDirPath); File tempDir = new File(tempDirPath);
...@@ -222,7 +222,7 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe ...@@ -222,7 +222,7 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
if (spireTempFiles != null && spireTempFiles.length > 0) { if (spireTempFiles != null && spireTempFiles.length > 0) {
int count = 0; int count = 0;
long totalSize = 0; long totalSize = 0;
long oneMinuteAgo = System.currentTimeMillis() - 60000; long oneMinuteAgo = System.currentTimeMillis() - 600000;
long fileSize; long fileSize;
for (File file : spireTempFiles) { for (File file : spireTempFiles) {
if (file.isFile() && file.canWrite()) { if (file.isFile() && file.canWrite()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment