From 82e51fe46cd645dd27eb5066c61f6b6a262cacd7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?REBUILD=20=E4=BC=81=E4=B8=9A=E7=AE=A1=E7=90=86=E7=B3=BB?=
=?UTF-8?q?=E7=BB=9F?= <42044143+getrebuild@users.noreply.github.com>
Date: Tue, 13 Aug 2024 19:20:34 +0800
Subject: [PATCH] Fix 3.7.7 (#797)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* 3.7.7
* fix: Excel列表无法导出审批相关字段
* Update @rbv
---
@rbv | 2 +-
pom.xml | 2 +-
.../java/com/rebuild/core/Application.java | 4 +-
.../service/datareport/TemplateExtractor.java | 2 +-
.../service/general/ObservableService.java | 2 +-
.../trigger/aviator/OverDateOperator.java | 42 ++++++++++++-------
6 files changed, 32 insertions(+), 22 deletions(-)
diff --git a/@rbv b/@rbv
index 0f64bea1c..fb639d01a 160000
--- a/@rbv
+++ b/@rbv
@@ -1 +1 @@
-Subproject commit 0f64bea1ce3d94152e7ad6716cdb1bdc3565336a
+Subproject commit fb639d01abceb0dbb85760e475a153e2f69237b5
diff --git a/pom.xml b/pom.xml
index 68e7be5e7..f16ab99d3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -10,7 +10,7 @@
com.rebuild
rebuild
- 3.7.6
+ 3.7.7
rebuild
Building your business-systems freely!
https://getrebuild.com/
diff --git a/src/main/java/com/rebuild/core/Application.java b/src/main/java/com/rebuild/core/Application.java
index b3ca65b48..d4f81456f 100644
--- a/src/main/java/com/rebuild/core/Application.java
+++ b/src/main/java/com/rebuild/core/Application.java
@@ -74,11 +74,11 @@ public class Application implements ApplicationListener
/**
* Rebuild Version
*/
- public static final String VER = "3.7.6";
+ public static final String VER = "3.7.7";
/**
* Rebuild Build [MAJOR]{1}[MINOR]{2}[PATCH]{2}[BUILD]{2}
*/
- public static final int BUILD = 3070612;
+ public static final int BUILD = 3070713;
static {
// Driver for DB
diff --git a/src/main/java/com/rebuild/core/service/datareport/TemplateExtractor.java b/src/main/java/com/rebuild/core/service/datareport/TemplateExtractor.java
index bb976afab..968f399a7 100644
--- a/src/main/java/com/rebuild/core/service/datareport/TemplateExtractor.java
+++ b/src/main/java/com/rebuild/core/service/datareport/TemplateExtractor.java
@@ -97,7 +97,7 @@ public class TemplateExtractor {
String listField = varName.substring(1);
// 审批流程
- if (varName.startsWith(APPROVAL_PREFIX)) {
+ if (!this.isListType && varName.startsWith(APPROVAL_PREFIX)) {
String stepNodeField = listField.substring(APPROVAL_PREFIX.length());
if (approvalEntity != null && MetadataHelper.getLastJoinField(approvalEntity, stepNodeField) != null) {
map.put(varName, stepNodeField);
diff --git a/src/main/java/com/rebuild/core/service/general/ObservableService.java b/src/main/java/com/rebuild/core/service/general/ObservableService.java
index 1934a9f88..aaa5ddfc1 100644
--- a/src/main/java/com/rebuild/core/service/general/ObservableService.java
+++ b/src/main/java/com/rebuild/core/service/general/ObservableService.java
@@ -50,7 +50,7 @@ public abstract class ObservableService extends SafeObservable implements Servic
@Override
public void addObserver(SafeObserver o) {
- log.info("Add observer : {} for [ {} ] ", o, getEntityCode() == 0 ? "*" : getEntityCode());
+ log.info("Add observer : {} for [ {} ]", o, getEntityCode() == 0 ? "*" : getEntityCode());
super.addObserver(o);
}
diff --git a/src/main/java/com/rebuild/core/service/trigger/aviator/OverDateOperator.java b/src/main/java/com/rebuild/core/service/trigger/aviator/OverDateOperator.java
index 42527459c..e0193c7f6 100644
--- a/src/main/java/com/rebuild/core/service/trigger/aviator/OverDateOperator.java
+++ b/src/main/java/com/rebuild/core/service/trigger/aviator/OverDateOperator.java
@@ -41,8 +41,8 @@ public class OverDateOperator {
@Override
public AviatorObject call(Map env, AviatorObject arg1, AviatorObject arg2) {
- Object $argv1 = arg1.getValue(env);
- Object $argv2 = arg2.getValue(env);
+ Object $argv1 = convertIfDate(arg1.getValue(env));
+ Object $argv2 = convertIfDate(arg2.getValue(env));
if ($argv1 instanceof Date && $argv2 instanceof Number) {
return opDate((Date) $argv1, ((Number) $argv2).intValue());
@@ -66,8 +66,8 @@ public class OverDateOperator {
@Override
public AviatorObject call(Map env, AviatorObject arg1, AviatorObject arg2) {
- Object $argv1 = arg1.getValue(env);
- Object $argv2 = arg2.getValue(env);
+ Object $argv1 = convertIfDate(arg1.getValue(env));
+ Object $argv2 = convertIfDate(arg2.getValue(env));
if ($argv1 instanceof Date && $argv2 instanceof Number) {
return opDate((Date) $argv1, -((Number) $argv2).intValue());
@@ -101,8 +101,8 @@ public class OverDateOperator {
@Override
public AviatorObject call(Map env, AviatorObject arg1, AviatorObject arg2) {
- Object $argv1 = arg1.getValue(env);
- Object $argv2 = arg2.getValue(env);
+ Object $argv1 = convertIfDate(arg1.getValue(env));
+ Object $argv2 = convertIfDate(arg2.getValue(env));
if ($argv1 instanceof Date && $argv2 instanceof Date) {
long v1 = ((Date) $argv1).getTime();
@@ -127,8 +127,8 @@ public class OverDateOperator {
@Override
public AviatorObject call(Map env, AviatorObject arg1, AviatorObject arg2) {
- Object $argv1 = arg1.getValue(env);
- Object $argv2 = arg2.getValue(env);
+ Object $argv1 = convertIfDate(arg1.getValue(env));
+ Object $argv2 = convertIfDate(arg2.getValue(env));
if ($argv1 instanceof Date && $argv2 instanceof Date) {
long v1 = ((Date) $argv1).getTime();
@@ -153,8 +153,8 @@ public class OverDateOperator {
@Override
public AviatorObject call(Map env, AviatorObject arg1, AviatorObject arg2) {
- Object $argv1 = arg1.getValue(env);
- Object $argv2 = arg2.getValue(env);
+ Object $argv1 = convertIfDate(arg1.getValue(env));
+ Object $argv2 = convertIfDate(arg2.getValue(env));
if ($argv1 instanceof Date && $argv2 instanceof Date) {
long v1 = ((Date) $argv1).getTime();
@@ -179,8 +179,8 @@ public class OverDateOperator {
@Override
public AviatorObject call(Map env, AviatorObject arg1, AviatorObject arg2) {
- Object $argv1 = arg1.getValue(env);
- Object $argv2 = arg2.getValue(env);
+ Object $argv1 = convertIfDate(arg1.getValue(env));
+ Object $argv2 = convertIfDate(arg2.getValue(env));
if ($argv1 instanceof Date && $argv2 instanceof Date) {
long v1 = ((Date) $argv1).getTime();
@@ -205,8 +205,8 @@ public class OverDateOperator {
@Override
public AviatorObject call(Map env, AviatorObject arg1, AviatorObject arg2) {
- Object $argv1 = arg1.getValue(env);
- Object $argv2 = arg2.getValue(env);
+ Object $argv1 = convertIfDate(arg1.getValue(env));
+ Object $argv2 = convertIfDate(arg2.getValue(env));
if ($argv1 instanceof Date && $argv2 instanceof Date) {
long v1 = ((Date) $argv1).getTime();
@@ -231,8 +231,8 @@ public class OverDateOperator {
@Override
public AviatorObject call(Map env, AviatorObject arg1, AviatorObject arg2) {
- Object $argv1 = arg1.getValue(env);
- Object $argv2 = arg2.getValue(env);
+ Object $argv1 = convertIfDate(arg1.getValue(env));
+ Object $argv2 = convertIfDate(arg2.getValue(env));
if ($argv1 instanceof Date && $argv2 instanceof Date) {
long v1 = ((Date) $argv1).getTime();
@@ -244,4 +244,14 @@ public class OverDateOperator {
}
}
}
+
+ // 转换为日期
+ static Object convertIfDate(Object d) {
+ if (d instanceof Date) return d;
+ if (d instanceof String) {
+ Date date = CalendarUtils.parse((String) d);
+ return date == null ? d : date;
+ }
+ return d;
+ }
}