PAl应用启动后事件 报告生成器列表数据状态变更 执行中->失败
This commit is contained in:
parent
860ed6e216
commit
d9c9af0cd1
Binary file not shown.
@ -255,6 +255,23 @@ public final class OutputTask extends DaoObject<OutputTaskModel> {
|
|||||||
return DBSql.getObject(sql, rowMapper());
|
return DBSql.getObject(sql, rowMapper());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<OutputTaskModel> getModelListByStatus(int status) {
|
||||||
|
String sql = "select * from " + entityName() + " where TASKSTATE='" + status + "'";
|
||||||
|
return DBSql.query(sql, rowMapper());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void batchUpdateTaskModelStatus(List<OutputTaskModel> taskModels) {
|
||||||
|
String sql = "update " + entityName() + " set TASKSTATE=:taskState where ID=:id";
|
||||||
|
List<Map<String, ?>> paramList = new ArrayList<>();
|
||||||
|
for (OutputTaskModel taskModel : taskModels) {
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
map.put("taskState", taskModel.getTaskState());
|
||||||
|
map.put("id", taskModel.getId());
|
||||||
|
paramList.add(map);
|
||||||
|
}
|
||||||
|
DBSql.batchUpdate(sql, paramList);
|
||||||
|
}
|
||||||
|
|
||||||
public boolean delTaskByWsid(String wsid) {
|
public boolean delTaskByWsid(String wsid) {
|
||||||
String sql = "delete from " + entityName() + " where WSID='" + wsid + "'";
|
String sql = "delete from " + entityName() + " where WSID='" + wsid + "'";
|
||||||
return DBSql.update(sql) > 0;
|
return DBSql.update(sql) > 0;
|
||||||
|
|||||||
@ -16,6 +16,8 @@ import com.actionsoft.apps.coe.pal.pal.method.cache.PALMethodCache;
|
|||||||
import com.actionsoft.apps.coe.pal.pal.method.extend.MethodAppManager;
|
import com.actionsoft.apps.coe.pal.pal.method.extend.MethodAppManager;
|
||||||
import com.actionsoft.apps.coe.pal.pal.method.model.PALMethodAttributeModel;
|
import com.actionsoft.apps.coe.pal.pal.method.model.PALMethodAttributeModel;
|
||||||
import com.actionsoft.apps.coe.pal.pal.method.model.PALMethodModel;
|
import com.actionsoft.apps.coe.pal.pal.method.model.PALMethodModel;
|
||||||
|
import com.actionsoft.apps.coe.pal.pal.output.dao.OutputTask;
|
||||||
|
import com.actionsoft.apps.coe.pal.pal.output.model.OutputTaskModel;
|
||||||
import com.actionsoft.apps.coe.pal.pal.repository.PALRepositoryQueryAPIManager;
|
import com.actionsoft.apps.coe.pal.pal.repository.PALRepositoryQueryAPIManager;
|
||||||
import com.actionsoft.apps.coe.pal.pal.repository.cache.*;
|
import com.actionsoft.apps.coe.pal.pal.repository.cache.*;
|
||||||
import com.actionsoft.apps.coe.pal.pal.repository.dao.*;
|
import com.actionsoft.apps.coe.pal.pal.repository.dao.*;
|
||||||
@ -65,6 +67,7 @@ import com.actionsoft.sdk.local.SDK;
|
|||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.dom4j.Document;
|
import org.dom4j.Document;
|
||||||
import org.dom4j.Element;
|
import org.dom4j.Element;
|
||||||
|
|
||||||
@ -97,6 +100,9 @@ public class StartListener implements AppListener{
|
|||||||
// updatesPublishData(getPublishData());
|
// updatesPublishData(getPublishData());
|
||||||
// 批量调整APP_ACT_COE_PAL_SHAPE_RLAT中文件属性(前置流程,后置流程)
|
// 批量调整APP_ACT_COE_PAL_SHAPE_RLAT中文件属性(前置流程,后置流程)
|
||||||
correctFileRelationPropData(null);
|
correctFileRelationPropData(null);
|
||||||
|
|
||||||
|
// 报告生成器列表数据状态变更 执行中->失败
|
||||||
|
handleOutputTaskStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -536,4 +542,20 @@ public class StartListener implements AppListener{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void handleOutputTaskStatus() {
|
||||||
|
// 0: 就绪 1: 正在执行 2: 成功 3: 失败
|
||||||
|
OutputTask outputTask = new OutputTask();
|
||||||
|
List<OutputTaskModel> taskModels = outputTask.getModelListByStatus(1);
|
||||||
|
if (!CollectionUtils.isEmpty(taskModels)) {
|
||||||
|
SDK.getLogAPI().consoleInfo("[报告生成器]列表数据状态变更[执行中->失败]处理[开始]-数据量" + taskModels.size());
|
||||||
|
taskModels.forEach(model -> model.setTaskState(3));
|
||||||
|
try {
|
||||||
|
outputTask.batchUpdateTaskModelStatus(taskModels);
|
||||||
|
SDK.getLogAPI().consoleInfo("[报告生成器]列表数据状态变更[执行中->失败]处理[结束]");
|
||||||
|
} catch (Exception e) {
|
||||||
|
SDK.getLogAPI().consoleInfo("[报告生成器]列表数据状态变更[执行中->失败]处理[异常] " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user