Fix 3.7.3 (#782)

* v

* fix: ND 丢失

* fix: 高级查询当前用户使用 getReplacedUser

* be

* be style v35

* be

* fix: 空值重复

* Update @rbv

* be

* Update @rbv

* Update @rbv

* fix

* Update NavBuilder.java

* Update GeneralEntityService.java
This commit is contained in:
REBUILD 企业管理系统 2024-07-11 21:43:19 +08:00 committed by GitHub
parent db0c0fbf0e
commit 1b2eb3b421
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 55 additions and 41 deletions

2
@rbv

@ -1 +1 @@
Subproject commit 9167b256a0cd21808387808346b4d76595ef0661
Subproject commit b463933d1539174864298f5d3b0a7ef35112a778

View file

@ -10,7 +10,7 @@
</parent>
<groupId>com.rebuild</groupId>
<artifactId>rebuild</artifactId>
<version>3.7.2</version>
<version>3.7.3</version>
<name>rebuild</name>
<description>Building your business-systems freely!</description>
<url>https://getrebuild.com/</url>

View file

@ -75,11 +75,11 @@ public class Application implements ApplicationListener<ApplicationStartedEvent>
/**
* Rebuild Version
*/
public static final String VER = "3.7.2";
public static final String VER = "3.7.3";
/**
* Rebuild Build [MAJOR]{1}[MINOR]{2}[PATCH]{2}[BUILD]{2}
*/
public static final int BUILD = 3070207;
public static final int BUILD = 3070308;
static {
// Driver for DB

View file

@ -162,7 +162,7 @@ public class NavBuilder extends NavManager {
} else if (NAV_FEEDS.equals(value) || NAV_FILEMRG.equals(value) || NAV_PROJECT.equals(value)) {
return false;
} else if (!MetadataHelper.containsEntity(value)) {
log.warn("Unknown entity in nav : " + value);
log.warn("Unknown entity in nav : {}", value);
return true;
}

View file

@ -539,7 +539,8 @@ public class ApprovalProcessor extends SetUser {
String nodeNo = (String) group.get(0)[6];
FlowNode flowNode = null;
if (FlowNode.NODE_REVOKED.equals(nodeNo) || FlowNode.NODE_CANCELED.equals(nodeNo)) {
if (FlowNode.NODE_REVOKED.equals(nodeNo) || FlowNode.NODE_CANCELED.equals(nodeNo)
|| FlowNode.NODE_AUTOAPPROVAL.equals(nodeNo)) {
// 特殊节点
} else {
flowNode = getFlowNode(nodeNo);

View file

@ -742,23 +742,29 @@ public class GeneralEntityService extends ObservableService implements EntitySer
if (checkFields.isEmpty()) return Collections.emptyList();
boolean allNull = true;
// OR AND
final String orAnd = StringUtils.defaultString(
EasyMetaFactory.valueOf(entity).getExtraAttr(EasyEntityConfigProps.REPEAT_FIELDS_CHECK_MODE), "or");
EasyMetaFactory.valueOf(entity).getExtraAttr(EasyEntityConfigProps.REPEAT_FIELDS_CHECK_MODE), "or").toLowerCase();
StringBuilder checkSql = new StringBuilder("select ")
.append(entity.getPrimaryField().getName()).append(", ") // 增加一个主键列
.append(StringUtils.join(checkFields.keySet().iterator(), ", "))
.append(" from ")
.append(entity.getName())
.append(" where ( ");
.append(entity.getName());
List<String> checkSqlWhere = new ArrayList<>();
for (Map.Entry<String, Object> e : checkFields.entrySet()) {
checkSql.append(e.getKey());
if (NullValue.isNull(e.getValue())) checkSql.append(" is null ");
else checkSql.append(" = ? ");
checkSql.append(orAnd).append(" ");
if (NullValue.isNull(e.getValue())) {
if ("and".equals(orAnd)) checkSqlWhere.add(String.format(" %s is null ", e.getKey()));
} else {
checkSqlWhere.add(String.format(" %s = ? ", e.getKey()));
allNull = false;
}
}
checkSql.delete(checkSql.length() - 4, checkSql.length()).append(" )");
// 全空值则不检查
if (allNull) return Collections.emptyList();
checkSql.append(" where (").append(StringUtils.join(checkSqlWhere, orAnd)).append(")");
// 排除自己
if (checkRecord.getPrimary() != null) {

View file

@ -325,7 +325,7 @@ public class AdvFilterParser extends SetUser {
else if (isN2NUsers) {
if (ParseHelper.SFU.equalsIgnoreCase(op)) {
op = ParseHelper.IN;
value = getUser().toLiteral();
value = UserContextHolder.getReplacedUser().toLiteral();
}
if (ParseHelper.IN.equals(op) || ParseHelper.NIN.equals(op)) {
@ -335,7 +335,7 @@ public class AdvFilterParser extends SetUser {
}
else if (ParseHelper.SFB.equalsIgnoreCase(op)) {
op = ParseHelper.IN;
value = Objects.requireNonNull(UserHelper.getDepartment(getUser())).getIdentity().toString();
value = Objects.requireNonNull(UserHelper.getDepartment(UserContextHolder.getReplacedUser())).getIdentity().toString();
inWhere = String.format("select userId from User where deptId = '%s'", value);
}
}
@ -559,9 +559,9 @@ public class AdvFilterParser extends SetUser {
}
// 部门/用户
else if (ParseHelper.SFU.equalsIgnoreCase(op)) {
value = getUser().toLiteral();
value = UserContextHolder.getReplacedUser().toLiteral();
} else if (ParseHelper.SFB.equalsIgnoreCase(op)) {
Department dept = UserHelper.getDepartment(getUser());
Department dept = UserHelper.getDepartment(UserContextHolder.getReplacedUser());
if (dept != null) {
value = dept.getIdentity().toString();
int ref = lastFieldMeta.getReferenceEntity().getEntityCode();
@ -574,7 +574,7 @@ public class AdvFilterParser extends SetUser {
}
}
} else if (ParseHelper.SFD.equalsIgnoreCase(op)) {
Department dept = UserHelper.getDepartment(getUser());
Department dept = UserHelper.getDepartment(UserContextHolder.getReplacedUser());
if (dept != null) {
int refe = lastFieldMeta.getReferenceEntity().getEntityCode();
if (refe == EntityHelper.Department) {
@ -806,9 +806,9 @@ public class AdvFilterParser extends SetUser {
} else if (dt == DisplayType.REFERENCE) {
if (queryField.getReferenceEntity().getEntityCode() == EntityHelper.User) {
useValue = UserContextHolder.getUser();
useValue = UserContextHolder.getReplacedUser();
} else if (queryField.getReferenceEntity().getEntityCode() == EntityHelper.Department) {
Department dept = UserHelper.getDepartment(UserContextHolder.getUser());
Department dept = UserHelper.getDepartment(UserContextHolder.getReplacedUser());
if (dept != null) useValue = dept.getIdentity();
}
} else {
@ -819,7 +819,7 @@ public class AdvFilterParser extends SetUser {
// {@CURRENT.} for USER
if (fieldName.startsWith(CURRENT_ANY + ".")) {
String userField = fieldName.substring(CURRENT_ANY.length() + 1);
Object[] o = Application.getQueryFactory().uniqueNoFilter(getUser(), userField);
Object[] o = Application.getQueryFactory().uniqueNoFilter(UserContextHolder.getReplacedUser(), userField);
if (o == null || o[0] == null) {
log.warn("Cannot use `{}` in `{}` (No value found)", value, queryField);
return new VarFieldNoValue37(value);

View file

@ -39,9 +39,14 @@ public class KnownExceptionConverter {
return ex.getLocalizedMessage();
}
final Throwable cause = ex.getCause();
final String exMsg = cause == null ? "" : cause.getLocalizedMessage();
log.error("DBERR: {}", exMsg);
String dbMsg = convert2DbErrorMsg(ex);
if (dbMsg != null) log.error("DBERR: {}", ex.getCause() == null ? ex : ex.getCause().getLocalizedMessage());
return dbMsg;
}
static String convert2DbErrorMsg(Throwable ex) {
Throwable cause = ex.getCause();
String exMsg = cause == null ? "" : cause.getLocalizedMessage();
if (cause instanceof DataTruncation) {

View file

@ -71,8 +71,8 @@
<table class="table table-hover table-striped table-fixed tablesort">
<thead>
<tr>
<th>[[${bundle.L('名称')}]]</th>
<th width="20%">[[${bundle.L('应用实体')}]]</th>
<th width="30%">[[${bundle.L('名称')}]]</th>
<th>[[${bundle.L('应用实体')}]]</th>
<th class="no-sort">[[${bundle.L('使用条件')}]]</th>
<th width="80" class="no-sort">[[${bundle.L('启用')}]]</th>
<th width="120" class="no-sort">[[${bundle.L('修改时间')}]]</th>

View file

@ -42,7 +42,12 @@
<div class="main-content container-fluid pt-1">
<ul th:if="${detailEntity != null}" class="nav nav-tabs nav-tabs-classic">
<li th:class="nav-item" th:data-name="${mainEntity}"><a th:href="|../${mainEntity}/base|" class="nav-link">[[${bundle.L('主实体')}]]</a></li>
<li th:class="nav-item" th:data-name="${detailEntity}"><a th:href="|../${detailEntity}/base|" class="nav-link J_for-details">[[${bundle.L('明细实体')}]]</a></li>
<li th:class="nav-item" th:data-name="${detailEntity}">
<a th:href="|../${detailEntity}/base|" class="nav-link J_for-details">[[${bundle.L('明细实体')}]]</a>
<div th:if="${detailEntities.length > 1}" class="dropdown-menu J_details">
<a th:each="e : ${detailEntities}" th:href="|../${e[1]}/base|" th:data-name="${e[1]}" class="dropdown-item"><i th:class="|icon zmdi zmdi-${e[3]}|"></i> [[${e[2]}]]</a>
</div>
</li>
</ul>
<div class="card mb-0">
<div class="card-body pt-4">

View file

@ -205,6 +205,6 @@
<script th:src="@{/assets/js/metadata/field-valueset.js}" type="text/babel"></script>
<script th:src="@{/assets/js/metadata/field-formula.js}" type="text/babel"></script>
<script th:src="@{/assets/js/trigger/trigger-design.js}" type="text/babel"></script>
<script th:src="|${baseUrl}/assets/js/trigger/trigger.${actionType}.js?v=${AppBuild ?:'2.10'}|" type="text/babel"></script>
<script th:src="|${baseUrl}/assets/js/trigger/trigger.${actionType}.js?v=${AppBuild ?:'3.7'}|" type="text/babel"></script>
</body>
</html>

View file

@ -23252,14 +23252,4 @@ div.table-responsive > div.dataTables_wrapper > div.row > div[class^='col-']:las
border-radius: 50%;
opacity: 0;
animation: spinner-grow 0.75s linear infinite;
}
/* EXT */
.rb-error.v35 .error-container {
background: #fff url(../img/browser-bar.png) 0 0 no-repeat;
max-width: 888px;
margin: 60px auto;
padding: 80px 20px 35px;
border-radius: 6px 6px 0 0;
}
}

View file

@ -3713,6 +3713,13 @@ form {
display: none;
}
.modal.select-list .modal-body li > a > .mdi,
.modal.select-list .modal-body li > a > .zmdi {
position: absolute;
right: 6px;
margin-top: 1px;
}
.modal.select-list .modal-body li a > .mdi {
font-size: 1.231rem;
}

View file

@ -40,7 +40,7 @@
</style>
</head>
<body class="rb-splash-screen">
<div class="rb-wrapper rb-error v35">
<div class="rb-wrapper rb-error">
<div class="rb-content m-0">
<div class="main-content container">
<div class="error-container">