|
|
@@ -5,6 +5,7 @@ import lombok.AllArgsConstructor;
|
|
|
import org.apache.dubbo.config.annotation.DubboReference;
|
|
|
import org.dromara.api.RemoteCustomerService;
|
|
|
import org.dromara.common.core.constant.CacheNames;
|
|
|
+import org.dromara.common.core.utils.StringUtils;
|
|
|
import org.dromara.common.redis.utils.CacheUtils;
|
|
|
import org.dromara.common.translation.annotation.TranslationType;
|
|
|
import org.dromara.common.translation.constant.TransConstant;
|
|
|
@@ -21,6 +22,8 @@ public class CustomerNameTranslationImpl implements TranslationInterface<String>
|
|
|
public String translation(Object key, String other) {
|
|
|
Long id = Convert.toLong(key);
|
|
|
Object result = CacheUtils.get(CacheNames.USR_CUSTOMER_NAME, id);
|
|
|
- return result != null ? String.valueOf(result) : remoteCustomerService.selectNameById(Convert.toLong(key));
|
|
|
+ if (result != null) return String.valueOf(result);
|
|
|
+ String remote = remoteCustomerService.selectNameById(id);
|
|
|
+ return StringUtils.isNotBlank(remote) ? remote : null;
|
|
|
}
|
|
|
}
|