From 8649f81a70fd6b8b26132a203f03eaf570581ade 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: Fri, 22 Dec 2023 16:45:00 +0800
Subject: [PATCH] Fix 3.5.3 (#699)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* Update @rbv
* be: 通知邮件保持 html
* feat: report nref
* be: Bad JSONArray format
* out API Filter
* pageSize max=1000
* fix: DATE DATETIME 比较
* fix: SafeObservable
* v3.5.3
---
@rbv | 2 +-
pom.xml | 2 +-
.../java/com/rebuild/core/Application.java | 8 ++--
.../rebuild/core/service/CommonsService.java | 2 +-
.../rebuild/core/service/SafeObservable.java | 45 +++++++++++++++++++
.../rebuild/core/service/SafeObserver.java | 21 +++++++++
.../datareport/EasyExcelGenerator33.java | 10 ++++-
.../service/datareport/FixsMergeStrategy.java | 1 +
.../core/service/feeds/FeedsService.java | 3 +-
.../files/AttachmentAwareObserver.java | 5 ++-
.../service/general/GeneralEntityService.java | 20 ++-------
.../service/general/ObservableService.java | 30 ++++---------
.../service/general/OperatingObserver.java | 9 ++--
.../service/general/RecordDifference.java | 12 +++++
.../general/RevisionHistoryObserver.java | 5 +++
.../notification/NotificationObserver.java | 5 +++
.../service/project/ProjectTaskService.java | 3 +-
.../service/trigger/RobotTriggerObserver.java | 9 +++-
.../trigger/impl/SendNotification.java | 4 +-
.../support/general/FieldValueHelper.java | 9 +++-
.../core/support/general/QueryParser.java | 5 ++-
.../core/support/integration/SMSender.java | 29 ++++++++----
.../java/com/rebuild/utils/MarkdownUtils.java | 14 +++---
.../com/rebuild/web/RebuildWebConfigurer.java | 2 +-
src/main/resources/web/assets/css/rb-page.css | 6 ++-
.../resources/web/assets/css/view-page.css | 2 +-
.../web/assets/js/admin/apis-manager.js | 2 +-
.../web/assets/js/rb-datalist.common.js | 4 ++
28 files changed, 189 insertions(+), 80 deletions(-)
create mode 100644 src/main/java/com/rebuild/core/service/SafeObservable.java
create mode 100644 src/main/java/com/rebuild/core/service/SafeObserver.java
diff --git a/@rbv b/@rbv
index fecdd9ab1..d3707a301 160000
--- a/@rbv
+++ b/@rbv
@@ -1 +1 @@
-Subproject commit fecdd9ab1897c92ab4a7b5cd1f2d83d197597e7f
+Subproject commit d3707a301a97a0b18e6428607ac836c796b01685
diff --git a/pom.xml b/pom.xml
index 866495241..53db1ab98 100644
--- a/pom.xml
+++ b/pom.xml
@@ -10,7 +10,7 @@
com.rebuild
rebuild
- 3.5.2
+ 3.5.3
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 d9bacd39e..50b7d7172 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.5.2";
+ public static final String VER = "3.5.3";
/**
* Rebuild Build [MAJOR]{1}[MINOR]{2}[PATCH]{2}[BUILD]{2}
*/
- public static final int BUILD = 3050207;
+ public static final int BUILD = 3050308;
static {
// Driver for DB
@@ -373,11 +373,11 @@ public static EntityService getEntityService(int entityCode) {
}
public static GeneralEntityService getGeneralEntityService() {
- return (GeneralEntityService) getContext().getBean("generalEntityService");
+ return (GeneralEntityService) getContext().getBean("rbGeneralEntityService");
}
public static CommonsService getCommonsService() {
- return getBean(CommonsService.class);
+ return (CommonsService) getContext().getBean("rbCommonsService");
}
/**
diff --git a/src/main/java/com/rebuild/core/service/CommonsService.java b/src/main/java/com/rebuild/core/service/CommonsService.java
index 9324eca30..dfcaaeeda 100644
--- a/src/main/java/com/rebuild/core/service/CommonsService.java
+++ b/src/main/java/com/rebuild/core/service/CommonsService.java
@@ -27,7 +27,7 @@
* @author Zixin (RB)
* @since 11/06/2019
*/
-@Service
+@Service("rbCommonsService")
public class CommonsService extends InternalPersistService {
protected CommonsService(PersistManagerFactory aPMFactory) {
diff --git a/src/main/java/com/rebuild/core/service/SafeObservable.java b/src/main/java/com/rebuild/core/service/SafeObservable.java
new file mode 100644
index 000000000..15feba193
--- /dev/null
+++ b/src/main/java/com/rebuild/core/service/SafeObservable.java
@@ -0,0 +1,45 @@
+/*!
+Copyright (c) REBUILD and/or its owners. All rights reserved.
+
+rebuild is dual-licensed under commercial and open source licenses (GPLv3).
+See LICENSE and COMMERCIAL in the project root for license information.
+*/
+
+package com.rebuild.core.service;
+
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.List;
+
+/**
+ * Thread-Safe Observable
+ *
+ * @author devezhao
+ * @since 2023/12/22
+ */
+public class SafeObservable {
+
+ final private List obs;
+
+ public SafeObservable() {
+ obs = new ArrayList<>();
+ }
+
+ public void addObserver(SafeObserver o) {
+ if (o == null) throw new NullPointerException();
+ if (!obs.contains(o)) {
+ obs.add(o);
+ obs.sort(Comparator.comparingInt(SafeObserver::getOrder));
+ }
+ }
+
+ public void notifyObservers(Object arg) {
+ for (SafeObserver o : obs) {
+ o.update(this, arg);
+ }
+ }
+
+ public int countObservers() {
+ return obs.size();
+ }
+}
diff --git a/src/main/java/com/rebuild/core/service/SafeObserver.java b/src/main/java/com/rebuild/core/service/SafeObserver.java
new file mode 100644
index 000000000..23c52482c
--- /dev/null
+++ b/src/main/java/com/rebuild/core/service/SafeObserver.java
@@ -0,0 +1,21 @@
+/*!
+Copyright (c) REBUILD and/or its owners. All rights reserved.
+
+rebuild is dual-licensed under commercial and open source licenses (GPLv3).
+See LICENSE and COMMERCIAL in the project root for license information.
+*/
+
+package com.rebuild.core.service;
+
+/**
+ * Thread-Safe Observer
+ *
+ * @author devezhao
+ * @since 2023/12/22
+ */
+public interface SafeObserver {
+
+ void update(SafeObservable o, Object arg);
+
+ int getOrder();
+}
diff --git a/src/main/java/com/rebuild/core/service/datareport/EasyExcelGenerator33.java b/src/main/java/com/rebuild/core/service/datareport/EasyExcelGenerator33.java
index fc31cf9a9..cc44fc2e7 100644
--- a/src/main/java/com/rebuild/core/service/datareport/EasyExcelGenerator33.java
+++ b/src/main/java/com/rebuild/core/service/datareport/EasyExcelGenerator33.java
@@ -17,6 +17,7 @@
import com.rebuild.core.metadata.MetadataHelper;
import com.rebuild.core.privileges.UserService;
import com.rebuild.core.service.approval.ApprovalHelper;
+import com.rebuild.core.support.general.ProtocolFilterParser;
import com.rebuild.core.support.general.RecordBuilder;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FileUtils;
@@ -88,10 +89,11 @@ protected List