|
|
@@ -1,6 +1,7 @@
|
|
|
package com.cyksj.service.translations.impl;
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.cyksj.mapper.BackInfoTranslationsMapper;
|
|
|
@@ -37,6 +38,9 @@ public class BackInfoTranslationsServiceImpl extends ServiceImpl<BackInfoTransla
|
|
|
|
|
|
@Override
|
|
|
public void saveOrUpdateBackInfoTranslations(BackInfoTranslations.Type type, Long funcId, Object obj, String lang) {
|
|
|
+ if (StrUtil.isEmpty(lang)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
TranslationsDto translationsDto = new TranslationsDto();
|
|
|
translationsDto.setType(type);
|
|
|
translationsDto.setLang(lang);
|
|
|
@@ -46,10 +50,12 @@ public class BackInfoTranslationsServiceImpl extends ServiceImpl<BackInfoTransla
|
|
|
try {
|
|
|
declaredField.setAccessible(true);
|
|
|
Optional.ofNullable(declaredField.get(obj)).ifPresent(val -> {
|
|
|
- BackInfoTranslations backInfoTranslations = new BackInfoTranslations();
|
|
|
- backInfoTranslations.setFieldName(declaredField.getName());
|
|
|
- backInfoTranslations.setDesp(val.toString());
|
|
|
- fields.add(backInfoTranslations);
|
|
|
+ if (val instanceof String) {
|
|
|
+ BackInfoTranslations backInfoTranslations = new BackInfoTranslations();
|
|
|
+ backInfoTranslations.setFieldName(declaredField.getName());
|
|
|
+ backInfoTranslations.setDesp(val.toString());
|
|
|
+ fields.add(backInfoTranslations);
|
|
|
+ }
|
|
|
});
|
|
|
} catch (IllegalAccessException e) {
|
|
|
}
|