mirror of
https://gitee.com/liweiyi/ChestnutCMS.git
synced 2025-12-06 08:28:23 +08:00
bug fixed
This commit is contained in:
parent
0274696789
commit
ce9423cbef
@ -16,6 +16,7 @@
|
||||
package com.chestnut.exmodel.service;
|
||||
|
||||
import com.chestnut.common.utils.NumberUtils;
|
||||
import com.chestnut.common.utils.ObjectUtils;
|
||||
import com.chestnut.contentcore.domain.CmsCatalog;
|
||||
import com.chestnut.contentcore.domain.CmsContent;
|
||||
import com.chestnut.contentcore.service.ICatalogService;
|
||||
@ -79,8 +80,8 @@ public class ExModelService {
|
||||
List<XModelFieldDataDTO> list = new ArrayList<>();
|
||||
metaModel.getFields().forEach(f -> {
|
||||
Object fv = data.get(f.getCode());
|
||||
if(Objects.isNull(fv) || fv.toString().isEmpty()) {
|
||||
fv = f.getDefaultValue();
|
||||
if(Objects.isNull(fv)) {
|
||||
fv = ObjectUtils.nonNullOrElseAsString(f.getDefaultValue(), Object::toString);
|
||||
}
|
||||
XModelFieldDataDTO dto = XModelFieldDataDTO.newInstance(f, fv);
|
||||
list.add(dto);
|
||||
|
||||
@ -209,10 +209,13 @@ public class ModelDataServiceImpl implements IModelDataService {
|
||||
sqlBuilder.eq(pkField.getFieldName(), pkValues.get(pkField.getCode()));
|
||||
}
|
||||
Map<String, Object> map = sqlBuilder.selectOne();
|
||||
if (map == null) {
|
||||
return Map.of();
|
||||
}
|
||||
Map<String, Object> dataMap = new HashMap<>();
|
||||
if (map == null) {
|
||||
model.getFields().forEach(f -> {
|
||||
dataMap.put(f.getCode(), getControlType(f.getControlType()).stringAsValue(StringUtils.EMPTY));
|
||||
});
|
||||
return dataMap;
|
||||
}
|
||||
// 固定字段
|
||||
mmt.getFixedFields().forEach(f -> {
|
||||
Object v = map.get(f.getFieldName());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user