Commit 0f8cf67d by tiger

Job Sort

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