mirror of
https://github.com/getrebuild/rebuild.git
synced 2024-09-20 07:25:54 +08:00
Fix 3.7.4 (#783)
* Update @rbv * 3.7.4 * fix: 记录转换 IAD4G2 * fix: updateRoleAppends 不执行 * fix: submail set
This commit is contained in:
parent
a6acdd97ac
commit
608e1b79e4
2
@rbv
2
@rbv
|
@ -1 +1 @@
|
|||
Subproject commit b463933d1539174864298f5d3b0a7ef35112a778
|
||||
Subproject commit e0ddad6f662dfa5c35adf7001d2c1cee936d92e6
|
2
pom.xml
2
pom.xml
|
@ -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>
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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("无效发件人地址");
|
||||
}
|
||||
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -15,7 +15,7 @@ postBefore = function (data) {
|
|||
return false
|
||||
}
|
||||
} else {
|
||||
data['MailSmtpServer'] = ''
|
||||
if (typeof data['MailSmtpServer'] !== 'undefined') data['MailSmtpServer'] = ''
|
||||
}
|
||||
return data
|
||||
}
|
||||
|
|
|
@ -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)} />)
|
||||
})
|
||||
|
||||
// 回填
|
||||
|
|
Loading…
Reference in a new issue