|
|
@@ -2,6 +2,8 @@ package com.uas.search.console.b2b.service.impl;
|
|
|
|
|
|
import java.io.File;
|
|
|
import java.io.FileNotFoundException;
|
|
|
+import java.io.IOException;
|
|
|
+import java.io.NotSerializableException;
|
|
|
import java.io.PrintWriter;
|
|
|
import java.lang.reflect.InvocationTargetException;
|
|
|
import java.lang.reflect.Method;
|
|
|
@@ -32,6 +34,7 @@ import com.uas.search.console.b2b.service.InnerSearchService;
|
|
|
import com.uas.search.console.b2b.service.UpdateVirtualColumnService;
|
|
|
import com.uas.search.console.b2b.util.ClassAndTableNameUtils;
|
|
|
import com.uas.search.console.b2b.util.FileUtils;
|
|
|
+import com.uas.search.console.b2b.util.ObjectUtil;
|
|
|
import com.uas.search.console.b2b.util.SearchUtils;
|
|
|
|
|
|
/**
|
|
|
@@ -145,8 +148,8 @@ public class UpdateVirtualColumnServiceImpl implements UpdateVirtualColumnServic
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public <T> DailyTaskInformation newDailyTask(final Class<T> clazz, final Map<String, Class<?>> fields, Integer hour,
|
|
|
- Integer minute, Integer second) {
|
|
|
+ public <T> DailyTaskInformation newDailyTask(final Class<T> clazz, Map<String, Class<?>> fields, Integer hour,
|
|
|
+ Integer minute, Integer second) throws NotSerializableException, ClassNotFoundException, IOException {
|
|
|
if (hour == null || minute == null || second == null) {
|
|
|
throw new NullPointerException();
|
|
|
}
|
|
|
@@ -155,10 +158,12 @@ public class UpdateVirtualColumnServiceImpl implements UpdateVirtualColumnServic
|
|
|
}
|
|
|
|
|
|
String title = "更新虚拟列索引" + fields + ":" + ClassAndTableNameUtils.toTableName(clazz).value().toLowerCase();
|
|
|
+ // 必须对fields进行克隆,否则,当execute真正运行时,fields可能已被外部方法更改了
|
|
|
+ final Map<String, Class<?>> cloneFields = ObjectUtil.clone(fields);
|
|
|
Executable command = new Executable() {
|
|
|
@Override
|
|
|
public String execute() {
|
|
|
- updateVirtualColumn(clazz, fields);
|
|
|
+ updateVirtualColumn(clazz, cloneFields);
|
|
|
return "success";
|
|
|
}
|
|
|
};
|