Fix 3.7.4 (#783)

* Update @rbv

* 3.7.4

* fix: 记录转换 IAD4G2

* fix: updateRoleAppends 不执行

* fix: submail set
This commit is contained in:
REBUILD 企业管理系统 2024-07-17 19:39:45 +08:00 committed by GitHub
parent a6acdd97ac
commit 608e1b79e4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 39 additions and 21 deletions

2
@rbv

@ -1 +1 @@
Subproject commit b463933d1539174864298f5d3b0a7ef35112a778
Subproject commit e0ddad6f662dfa5c35adf7001d2c1cee936d92e6

View file

@ -10,7 +10,7 @@
</parent>
<groupId>com.rebuild</groupId>
<artifactId>rebuild</artifactId>
<version>3.7.3</version>
<version>3.7.4</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.3";
public static final String VER = "3.7.4";
/**
* Rebuild Build [MAJOR]{1}[MINOR]{2}[PATCH]{2}[BUILD]{2}
*/
public static final int BUILD = 3070309;
public static final int BUILD = 3070410;
static {
// Driver for DB

View file

@ -311,7 +311,9 @@ public class UserService extends BaseService {
super.update(record);
}
if (changed || updateRoleAppends(user, roleAppends)) {
if (updateRoleAppends(user, roleAppends)) changed = true;
if (changed) {
Application.getUserStore().refreshUser(user);
}

View file

@ -49,11 +49,13 @@ public class TransformerPreview37 extends TransformerPreview {
// 兼容
if (detailName == null) return super.buildForm(null);
if (fieldsMapping.get("_") == null) return super.buildForm(detailName);
// 源为明细
if (sourceEntity.getMainEntity() != null) return super.buildForm(detailName);
JSONArray fieldsMappingDetails = transConfig.getJSONArray("fieldsMappingDetails");
if (fieldsMappingDetails == null || fieldsMappingDetails.isEmpty()) return JSONUtils.EMPTY_ARRAY;
if (fieldsMappingDetails == null || fieldsMappingDetails.isEmpty()) {
// 兼容:源为明细
if (sourceEntity.getMainEntity() != null) return super.buildForm(detailName);
else return JSONUtils.EMPTY_ARRAY;
}
Entity targetEntity = MetadataHelper.getEntity(config.getString("target"));
RecordTransfomer transfomer = new RecordTransfomer37(targetEntity, transConfig, false);
@ -69,17 +71,25 @@ public class TransformerPreview37 extends TransformerPreview {
Entity dTargetEntity = fmdEntity[0];
Entity dSourceEntity = fmdEntity[1];
// 指定明细的
// ND 指定明细的
if (!detailName.equalsIgnoreCase(dTargetEntity.getName())) continue;
String sql = String.format(
"select %s from %s where %s = '%s' and (1=1) order by autoId asc",
dSourceEntity.getPrimaryField().getName(), dSourceEntity.getName(),
MetadataHelper.getDetailToMainField(dSourceEntity).getName(), sourceId);
String filter = RecordTransfomer37.appendFilter(fmd);
if (filter != null) sql = sql.replace("(1=1)", filter);
String querySourceSql = "select %s from %s where %s = '%s' and (1=1) order by autoId asc";
// =明细 && 目标=
if (dSourceEntity.getMainEntity() != null && dTargetEntity.getDetailEntity() != null) {
querySourceSql = String.format(querySourceSql,
dSourceEntity.getPrimaryField().getName(), dSourceEntity.getName(),
MetadataHelper.getDetailToMainField(dSourceEntity).getName(), sourceId);
} else {
querySourceSql = String.format(querySourceSql,
dSourceEntity.getPrimaryField().getName(), dSourceEntity.getName(),
dSourceEntity.getPrimaryField().getName(), sourceId);
}
Object[][] dArray = Application.createQueryNoFilter(sql).array();
String filter = RecordTransfomer37.appendFilter(fmd);
if (filter != null) querySourceSql = querySourceSql.replace("(1=1)", filter);
Object[][] dArray = Application.createQueryNoFilter(querySourceSql).array();
ID fakeMainid = EntityHelper.newUnsavedId(sourceEntity.getEntityCode());
FormsBuilderContextHolder.setMainIdOfDetail(fakeMainid);

View file

@ -73,7 +73,7 @@ public class KnownExceptionConverter {
} else if (ex instanceof ConstraintViolationException) {
if (ex.getLocalizedMessage().contains("Duplicate entry")) {
if (exMsg.contains("Duplicate entry")) {
String s = Language.L("数据库字段违反唯一性约束");
String key = matchsColumn(exMsg, PATT_DE);
return key == null ? s : s + ":" + key;

View file

@ -209,7 +209,7 @@ public class ConfigurationController extends BaseController {
@PostMapping("integration/submail")
public RespBody postIntegrationSubmail(@RequestBody JSONObject data) {
String dMailAddr = defaultIfBlank(data, ConfigurationItem.MailAddr);
if (!RegexUtils.isEMail(dMailAddr)) {
if (dMailAddr != null && !RegexUtils.isEMail(dMailAddr)) {
return RespBody.errorl("无效发件人地址");
}

View file

@ -92,7 +92,12 @@ public class TransformConfigController extends BaseController {
mv.getModelMap().put("sourceDetailEntities", sourceDetailEntities);
} else {
// self
mv.getModelMap().put("sourceDetailEntity", buildEntity(sourceEntity, true));
JSONObject self = buildEntity(sourceEntity, true);
mv.getModelMap().put("sourceDetailEntity", self);
JSONArray sourceDetailEntities = new JSONArray();
sourceDetailEntities.add(self);
mv.getModelMap().put("sourceDetailEntities", sourceDetailEntities);
}
mv.getModelMap().put("targetDetailEntity", buildEntity(targetEntity.getDetailEntity(), false));

View file

@ -15,7 +15,7 @@ postBefore = function (data) {
return false
}
} else {
data['MailSmtpServer'] = ''
if (typeof data['MailSmtpServer'] !== 'undefined') data['MailSmtpServer'] = ''
}
return data
}

View file

@ -93,7 +93,8 @@ $(document).ready(() => {
}
$('.J_add-dts').on('click', function () {
renderRbcomp(<DlgAddDts source={wpc.sourceDetailEntities} target={wpc.targetDetailEntities} onConfirm={(s) => _addDts(s)} />)
const _sourceDetailEntities = wpc.sourceDetailEntities
renderRbcomp(<DlgAddDts source={_sourceDetailEntities} target={wpc.targetDetailEntities} onConfirm={(s) => _addDts(s)} />)
})
// 回填