|
|
|
@ -542,7 +542,7 @@ public class HuiYaModel {
|
|
|
|
|
*/
|
|
|
|
|
public static List<Record> wxGetCostTimeList = new ArrayList<>();
|
|
|
|
|
public static DateTime wxGetCostTimeListBeginTime = DateTime.now();
|
|
|
|
|
public static Map<Integer, Integer> wxGetCostMap = new HashMap<>();
|
|
|
|
|
public static Map<Integer, Long> wxGetCostMap = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
public void wxGetCostTimeMap() {
|
|
|
|
|
long between = wxGetCostTimeListBeginTime.between(DateTime.now(), DateUnit.MINUTE);//计算相差时长
|
|
|
|
@ -554,11 +554,13 @@ public class HuiYaModel {
|
|
|
|
|
SqlPara sqlPara = Db.getSqlPara("HuiYa.wxGetCostTime");
|
|
|
|
|
wxGetCostTimeList = Db.find(sqlPara);
|
|
|
|
|
wxGetCostTimeListBeginTime = DateTime.now();
|
|
|
|
|
wxGetCostTimeList.forEach(record -> {
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < wxGetCostTimeList.size(); i++) {
|
|
|
|
|
Record record = wxGetCostTimeList.get(i);
|
|
|
|
|
int model_id = record.getInt("model_id");
|
|
|
|
|
int seconds_difference = record.getInt("seconds_difference");
|
|
|
|
|
long seconds_difference = record.getLong("seconds_difference");
|
|
|
|
|
wxGetCostMap.put(model_id, seconds_difference);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -578,19 +580,19 @@ public class HuiYaModel {
|
|
|
|
|
for (int i = 0; i < list.size(); i++) {
|
|
|
|
|
Record record = list.get(i);
|
|
|
|
|
model_id = record.getInt("model_id");
|
|
|
|
|
int seconds_difference = 60;//如果前面的某个模型没有最后一次的执行耗时,那么默认是1分钟
|
|
|
|
|
long seconds_difference = 60;//如果前面的某个模型没有最后一次的执行耗时,那么默认是1分钟
|
|
|
|
|
if (wxGetCostMap.containsKey(model_id)) {
|
|
|
|
|
seconds_difference = wxGetCostMap.get(model_id);
|
|
|
|
|
}
|
|
|
|
|
secondsToAdd += seconds_difference;
|
|
|
|
|
}
|
|
|
|
|
//再加上当前任务的生成时间
|
|
|
|
|
int current_task_seconds = 60;
|
|
|
|
|
long current_task_seconds = 60;
|
|
|
|
|
if (wxGetCostMap.containsKey(model_id)) {
|
|
|
|
|
current_task_seconds = wxGetCostMap.get(model_id);
|
|
|
|
|
}
|
|
|
|
|
int m = (secondsToAdd + current_task_seconds) / 60;
|
|
|
|
|
int s = (secondsToAdd + current_task_seconds) % 60;
|
|
|
|
|
long m = (secondsToAdd + current_task_seconds) / 60;
|
|
|
|
|
long s = (secondsToAdd + current_task_seconds) % 60;
|
|
|
|
|
if (s > 0) {
|
|
|
|
|
res = "约" + m + "分" + s + "秒后到作品中查看。";
|
|
|
|
|
} else {
|
|
|
|
|