mirror of
https://github.com/getrebuild/rebuild.git
synced 2024-09-20 07:25:54 +08:00
parent
934ff20e8e
commit
ba912dcb7a
2
pom.xml
2
pom.xml
|
@ -10,7 +10,7 @@
|
|||
</parent>
|
||||
<groupId>com.rebuild</groupId>
|
||||
<artifactId>rebuild</artifactId>
|
||||
<version>3.6.3</version>
|
||||
<version>3.6.4</version>
|
||||
<name>rebuild</name>
|
||||
<description>Building your business-systems freely!</description>
|
||||
<url>https://getrebuild.com/</url>
|
||||
|
|
|
@ -74,11 +74,11 @@ public class Application implements ApplicationListener<ApplicationStartedEvent>
|
|||
/**
|
||||
* Rebuild Version
|
||||
*/
|
||||
public static final String VER = "3.6.3";
|
||||
public static final String VER = "3.6.4";
|
||||
/**
|
||||
* Rebuild Build [MAJOR]{1}[MINOR]{2}[PATCH]{2}[BUILD]{2}
|
||||
*/
|
||||
public static final int BUILD = 3060308;
|
||||
public static final int BUILD = 3060409;
|
||||
|
||||
static {
|
||||
// Driver for DB
|
||||
|
|
|
@ -50,7 +50,7 @@ public class PerHourJob extends DistributedJobLock {
|
|||
|
||||
final int hour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY);
|
||||
|
||||
if (hour == 0 && RebuildConfiguration.getBool((ConfigurationItem.DBBackupsEnable))) {
|
||||
if (hour == 0) {
|
||||
doBackups();
|
||||
} else if (hour == 1) {
|
||||
doCleanTempFiles();
|
||||
|
@ -68,6 +68,13 @@ public class PerHourJob extends DistributedJobLock {
|
|||
* 执行备份
|
||||
*/
|
||||
protected void doBackups() {
|
||||
// 未开启备份
|
||||
if (!RebuildConfiguration.getBool((ConfigurationItem.DBBackupsEnable))) {
|
||||
SysbaseHeartbeat.setItem(SysbaseHeartbeat.DatabaseBackupFail, null);
|
||||
SysbaseHeartbeat.setItem(SysbaseHeartbeat.DataFileBackupFail, null);
|
||||
return;
|
||||
}
|
||||
|
||||
File backups = RebuildConfiguration.getFileOfData("_backups");
|
||||
if (!backups.exists()) {
|
||||
try {
|
||||
|
@ -82,7 +89,7 @@ public class PerHourJob extends DistributedJobLock {
|
|||
new DatabaseBackup().backup(backups);
|
||||
SysbaseHeartbeat.setItem(SysbaseHeartbeat.DatabaseBackupFail, null);
|
||||
} catch (Exception e) {
|
||||
log.error("Executing [DatabaseBackup] failed!", e);
|
||||
log.error("Executing [DatabaseBackup] fails", e);
|
||||
SysbaseHeartbeat.setItem(SysbaseHeartbeat.DatabaseBackupFail, e.getLocalizedMessage());
|
||||
}
|
||||
|
||||
|
@ -90,7 +97,7 @@ public class PerHourJob extends DistributedJobLock {
|
|||
new DatafileBackup().backup(backups);
|
||||
SysbaseHeartbeat.setItem(SysbaseHeartbeat.DataFileBackupFail, null);
|
||||
} catch (Exception e) {
|
||||
log.error("Executing [DataFileBackup] failed!", e);
|
||||
log.error("Executing [DataFileBackup] fails", e);
|
||||
SysbaseHeartbeat.setItem(SysbaseHeartbeat.DataFileBackupFail, e.getLocalizedMessage());
|
||||
}
|
||||
|
||||
|
|
|
@ -632,32 +632,43 @@ public class ApprovalProcessor extends SetUser {
|
|||
if (FlowNode.NODE_ROOT.equals(currentNode)) return JSONUtils.EMPTY_ARRAY;
|
||||
|
||||
FlowParser flowParser = getFlowParser();
|
||||
LinkedList<String[]> set = new LinkedList<>();
|
||||
LinkedList<String[]> backedNodes = new LinkedList<>();
|
||||
while (currentNode != null) {
|
||||
FlowNode node = flowParser.getNode(currentNode);
|
||||
if (FlowNode.TYPE_APPROVER.equals(node.getType())) {
|
||||
set.addFirst(new String[] { node.getNodeId(), node.getDataMap().getString("nodeName") });
|
||||
backedNodes.addFirst(new String[]{node.getNodeId(), node.getNodeName()});
|
||||
}
|
||||
|
||||
currentNode = node.prevNodes;
|
||||
// 有多个节点(分支),取最近的那个
|
||||
if (currentNode.contains("|")) {
|
||||
String[] nodes = currentNode.split("\\|");
|
||||
String recNodeSql = String.format(
|
||||
"select node from RobotApprovalStep where recordId = ? and isCanceled = 'F' and state = ?" +
|
||||
" and node in ('%s') order by createdOn desc", StringUtils.join(nodes, "','"));
|
||||
Object[] recNode = Application.createQueryNoFilter(recNodeSql)
|
||||
.setParameter(1, this.recordId)
|
||||
.setParameter(2, ApprovalState.APPROVED.getState())
|
||||
.unique();
|
||||
|
||||
currentNode = recNode == null ? nodes[0] : (String) recNode[0];
|
||||
}
|
||||
|
||||
if (FlowNode.NODE_ROOT.equals(currentNode)) currentNode = null;
|
||||
}
|
||||
if (set.size() < 2) return JSONUtils.EMPTY_ARRAY;
|
||||
if (backedNodes.size() < 2) return JSONUtils.EMPTY_ARRAY;
|
||||
|
||||
// 移除当前步骤
|
||||
set.removeLast();
|
||||
backedNodes.removeLast();
|
||||
|
||||
JSONArray back = new JSONArray();
|
||||
JSONArray res = new JSONArray();
|
||||
int nodeIndex = 0;
|
||||
for (String[] s : set) {
|
||||
for (String[] s : backedNodes) {
|
||||
nodeIndex++;
|
||||
|
||||
if (StringUtils.isBlank(s[1])) {
|
||||
s[1] = Language.L("审批人") + "#" + nodeIndex;
|
||||
}
|
||||
back.add(JSONUtils.toJSONObject(new String[] { "node", "nodeName" }, s ));
|
||||
if (StringUtils.isBlank(s[1])) s[1] = Language.L("审批人") + "#" + nodeIndex;
|
||||
res.add(JSONUtils.toJSONObject(new String[]{"node", "nodeName"}, s ));
|
||||
}
|
||||
return back;
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -87,6 +87,13 @@ public class FlowNode {
|
|||
this.dataMap = dataMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
public String getNodeName() {
|
||||
return getDataMap().getString("nodeName");
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue