main
黄海 1 year ago
parent 0eec831522
commit f25e76c4e6

Binary file not shown.

After

Width:  |  Height:  |  Size: 616 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 616 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 616 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 616 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 616 KiB

@ -31,7 +31,7 @@
FROM FROM
RankedTasks RankedTasks
WHERE WHERE
rn = 1 order by model_id; rn = 1 and seconds_difference>0 order by model_id;
#end #end
-- 显示日志 -- 显示日志
#sql("wxGetJournal") #sql("wxGetJournal")

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

Loading…
Cancel
Save