Commit 0f8cf67d by tiger

Job Sort

1 parent d74c1cb7
......@@ -115,7 +115,8 @@ public class SopXxlJobUtil {
}
int i = 0;
for (SopInstNode node : sop.getInstNodeMap().values()) {
for (Integer nodeId : sop.getNodeSort()) {
SopInstNode node = sop.getInstNodeMap().get(nodeId);
initSopNodeJob(sop, node, i++);
}
}
......
......@@ -152,14 +152,17 @@ public class SopInstNodeExecuteJobHandler {
// 刷新实例批次快照
SopInstBatch batch = sop.getBatch();
batch.setSnapshot(snapshot);
batch.setUpdateTime(new Date());
if (batch != null) {
batch.setSnapshot(snapshot);
batch.setUpdateTime(new Date());
}
// 刷新实例节点批次快照
SopInstNodeBatch nodeBatch = sop.getNodeBatch();
nodeBatch.setSnapshot(snapshot);
nodeBatch.setUpdateTime(new Date());
if (nodeBatch != null) {
nodeBatch.setSnapshot(snapshot);
nodeBatch.setUpdateTime(new Date());
}
sopService.updateNodeBatch(inst, batch, nodeBatch);
}
......
......@@ -182,11 +182,14 @@ public class SopService {
return curBatch;
}
public void updateNodeBatch(SopInst sopInst, SopInstBatch batch, SopInstNodeBatch nodeBatch) {
instNodeBatchMapper.updateByPrimaryKey(nodeBatch);
if (nodeBatch != null) {
instNodeBatchMapper.updateByPrimaryKey(nodeBatch);
}
instBatchMapper.updateByPrimaryKey(batch);
if (batch != null) {
instBatchMapper.updateByPrimaryKey(batch);
}
instMapper.updateByPrimaryKey(sopInst);
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!