Sfoglia il codice sorgente

完成新增需求

Huanyi 14 ore fa
parent
commit
0cfd9fe66a
13 ha cambiato i file con 42 aggiunte e 12 eliminazioni
  1. 4 1
      ruoyi-common/ruoyi-common-translation/src/main/java/org/dromara/common/translation/core/impl/AreaStationTranslationImpl.java
  2. 4 1
      ruoyi-common/ruoyi-common-translation/src/main/java/org/dromara/common/translation/core/impl/CustomerNameTranslationImpl.java
  3. 3 1
      ruoyi-common/ruoyi-common-translation/src/main/java/org/dromara/common/translation/core/impl/DeptNameTranslationImpl.java
  4. 4 1
      ruoyi-common/ruoyi-common-translation/src/main/java/org/dromara/common/translation/core/impl/FulfillerNameTranslationImpl.java
  5. 4 1
      ruoyi-common/ruoyi-common-translation/src/main/java/org/dromara/common/translation/core/impl/OrderCodeTranslationImpl.java
  6. 3 1
      ruoyi-common/ruoyi-common-translation/src/main/java/org/dromara/common/translation/core/impl/OssUrlTranslationImpl.java
  7. 4 1
      ruoyi-common/ruoyi-common-translation/src/main/java/org/dromara/common/translation/core/impl/StoreNameTranslationImpl.java
  8. 4 1
      ruoyi-common/ruoyi-common-translation/src/main/java/org/dromara/common/translation/core/impl/SubOrderCodeTranslationImpl.java
  9. 4 1
      ruoyi-common/ruoyi-common-translation/src/main/java/org/dromara/common/translation/core/impl/TenantCatergoriesNameTranslationImpl.java
  10. 3 1
      ruoyi-common/ruoyi-common-translation/src/main/java/org/dromara/common/translation/core/impl/TenantNameTranslationImpl.java
  11. 2 1
      ruoyi-common/ruoyi-common-translation/src/main/java/org/dromara/common/translation/core/impl/UserNameTranslationImpl.java
  12. 3 1
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/dubbo/RemoteTenantServiceImpl.java
  13. 0 0
      script/sql/business/maintain/20260604.sql

+ 4 - 1
ruoyi-common/ruoyi-common-translation/src/main/java/org/dromara/common/translation/core/impl/AreaStationTranslationImpl.java

@@ -4,6 +4,7 @@ import cn.hutool.core.convert.Convert;
 import lombok.AllArgsConstructor;
 import org.apache.dubbo.config.annotation.DubboReference;
 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;
@@ -26,7 +27,9 @@ public class AreaStationTranslationImpl implements TranslationInterface<String>
     public String translation(Object key, String other) {
         Long id = Convert.toLong(key);
         Object result = CacheUtils.get(CacheNames.SYS_AREA_STATION_NAME, id);
-        return result != null ? String.valueOf(result) : areaStationService.selectNameById(id);
+        if (result != null) return String.valueOf(result);
+        String remote = areaStationService.selectNameById(id);
+        return StringUtils.isNotBlank(remote) ? remote : null;
     }
 
 }

+ 4 - 1
ruoyi-common/ruoyi-common-translation/src/main/java/org/dromara/common/translation/core/impl/CustomerNameTranslationImpl.java

@@ -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;
     }
 }

+ 3 - 1
ruoyi-common/ruoyi-common-translation/src/main/java/org/dromara/common/translation/core/impl/DeptNameTranslationImpl.java

@@ -6,6 +6,7 @@ import org.dromara.common.translation.core.TranslationInterface;
 import org.dromara.system.api.RemoteDeptService;
 import lombok.AllArgsConstructor;
 import org.apache.dubbo.config.annotation.DubboReference;
+import org.dromara.common.core.utils.StringUtils;
 
 /**
  * 部门翻译实现
@@ -21,6 +22,7 @@ public class DeptNameTranslationImpl implements TranslationInterface<String> {
 
     @Override
     public String translation(Object key, String other) {
-        return remoteDeptService.selectDeptNameByIds(key.toString());
+        String name = remoteDeptService.selectDeptNameByIds(key.toString());
+        return StringUtils.isNotBlank(name) ? name : null;
     }
 }

+ 4 - 1
ruoyi-common/ruoyi-common-translation/src/main/java/org/dromara/common/translation/core/impl/FulfillerNameTranslationImpl.java

@@ -4,6 +4,7 @@ import cn.hutool.core.convert.Convert;
 import lombok.AllArgsConstructor;
 import org.apache.dubbo.config.annotation.DubboReference;
 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;
@@ -26,7 +27,9 @@ public class FulfillerNameTranslationImpl implements TranslationInterface<String
     public String translation(Object key, String other) {
         Long id = Convert.toLong(key);
         Object result = CacheUtils.get(CacheNames.FLF_FULFILLER_NAME, id);
-        return result != null ? String.valueOf(result) : remoteFulfillerService.getNameById(id);
+        if (result != null) return String.valueOf(result);
+        String remote = remoteFulfillerService.getNameById(id);
+        return StringUtils.isNotBlank(remote) ? remote : null;
     }
 }
 

+ 4 - 1
ruoyi-common/ruoyi-common-translation/src/main/java/org/dromara/common/translation/core/impl/OrderCodeTranslationImpl.java

@@ -4,6 +4,7 @@ import cn.hutool.core.convert.Convert;
 import lombok.AllArgsConstructor;
 import org.apache.dubbo.config.annotation.DubboReference;
 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;
@@ -24,7 +25,9 @@ public class OrderCodeTranslationImpl implements TranslationInterface<String> {
     public String translation(Object key, String other) {
         Long id = Convert.toLong(key);
         Object result = CacheUtils.get(CacheNames.SYS_ORDER_CODE, id);
-        return result != null ? String.valueOf(result) : remoteOrderService.getCodeById(id);
+        if (result != null) return String.valueOf(result);
+        String remote = remoteOrderService.getCodeById(id);
+        return StringUtils.isNotBlank(remote) ? remote : null;
     }
 }
 

+ 3 - 1
ruoyi-common/ruoyi-common-translation/src/main/java/org/dromara/common/translation/core/impl/OssUrlTranslationImpl.java

@@ -6,6 +6,7 @@ import org.dromara.common.translation.core.TranslationInterface;
 import org.dromara.resource.api.RemoteFileService;
 import lombok.AllArgsConstructor;
 import org.apache.dubbo.config.annotation.DubboReference;
+import org.dromara.common.core.utils.StringUtils;
 
 /**
  * OSS翻译实现
@@ -21,6 +22,7 @@ public class OssUrlTranslationImpl implements TranslationInterface<String> {
 
     @Override
     public String translation(Object key, String other) {
-        return remoteFileService.selectUrlByIds(key.toString());
+        String url = remoteFileService.selectUrlByIds(key.toString());
+        return StringUtils.isNotBlank(url) ? url : null;
     }
 }

+ 4 - 1
ruoyi-common/ruoyi-common-translation/src/main/java/org/dromara/common/translation/core/impl/StoreNameTranslationImpl.java

@@ -4,6 +4,7 @@ import cn.hutool.core.convert.Convert;
 import lombok.AllArgsConstructor;
 import org.apache.dubbo.config.annotation.DubboReference;
 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;
@@ -24,7 +25,9 @@ public class StoreNameTranslationImpl implements TranslationInterface<String> {
     public String translation(Object key, String other) {
         Long id = Convert.toLong(key);
         Object result = CacheUtils.get(CacheNames.SYS_STORE_NAME, id);
-        return result != null ? String.valueOf(result) : remoteStoreService.getNameById(id);
+        if (result != null) return String.valueOf(result);
+        String remote = remoteStoreService.getNameById(id);
+        return StringUtils.isNotBlank(remote) ? remote : null;
     }
 }
 

+ 4 - 1
ruoyi-common/ruoyi-common-translation/src/main/java/org/dromara/common/translation/core/impl/SubOrderCodeTranslationImpl.java

@@ -4,6 +4,7 @@ import cn.hutool.core.convert.Convert;
 import lombok.AllArgsConstructor;
 import org.apache.dubbo.config.annotation.DubboReference;
 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;
@@ -24,7 +25,9 @@ public class SubOrderCodeTranslationImpl implements TranslationInterface<String>
     public String translation(Object key, String other) {
         Long id = Convert.toLong(key);
         Object result = CacheUtils.get(CacheNames.SYS_SUB_ORDER_CODE, id);
-        return result != null ? String.valueOf(result) : remoteSubOrderService.getCodeById(id);
+        if (result != null) return String.valueOf(result);
+        String remote = remoteSubOrderService.getCodeById(id);
+        return StringUtils.isNotBlank(remote) ? remote : null;
     }
 }
 

+ 4 - 1
ruoyi-common/ruoyi-common-translation/src/main/java/org/dromara/common/translation/core/impl/TenantCatergoriesNameTranslationImpl.java

@@ -4,6 +4,7 @@ import cn.hutool.core.convert.Convert;
 import lombok.AllArgsConstructor;
 import org.apache.dubbo.config.annotation.DubboReference;
 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;
@@ -26,7 +27,9 @@ public class TenantCatergoriesNameTranslationImpl implements TranslationInterfac
     public String translation(Object key, String other) {
         Long id = Convert.toLong(key);
         Object result = CacheUtils.get(CacheNames.SYS_TENANT_CATERGORIES_NAME, id);
-        return result != null ? String.valueOf(result) : tenantCatergoriesService.getNameById(id);
+        if (result != null) return String.valueOf(result);
+        String remote = tenantCatergoriesService.getNameById(id);
+        return StringUtils.isNotBlank(remote) ? remote : null;
     }
 }
 

+ 3 - 1
ruoyi-common/ruoyi-common-translation/src/main/java/org/dromara/common/translation/core/impl/TenantNameTranslationImpl.java

@@ -2,6 +2,7 @@ package org.dromara.common.translation.core.impl;
 
 import lombok.AllArgsConstructor;
 import org.apache.dubbo.config.annotation.DubboReference;
+import org.dromara.common.core.utils.StringUtils;
 import org.dromara.common.translation.annotation.TranslationType;
 import org.dromara.common.translation.constant.TransConstant;
 import org.dromara.common.translation.core.TranslationInterface;
@@ -21,7 +22,8 @@ public class TenantNameTranslationImpl implements TranslationInterface<String> {
 
     @Override
     public String translation(Object key, String other) {
-        return tenantService.queryNameByTenantId(key.toString());
+        String name = tenantService.queryNameByTenantId(key.toString());
+        return StringUtils.isNotBlank(name) ? name : null;
     }
 }
 

+ 2 - 1
ruoyi-common/ruoyi-common-translation/src/main/java/org/dromara/common/translation/core/impl/UserNameTranslationImpl.java

@@ -30,6 +30,7 @@ public class UserNameTranslationImpl implements TranslationInterface<String> {
         if (StringUtils.isNotBlank(username)) {
             return username;
         }
-        return remoteUserService.selectUserNameById(userId);
+        String remote = remoteUserService.selectUserNameById(userId);
+        return StringUtils.isNotBlank(remote) ? remote : null;
     }
 }

+ 3 - 1
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/dubbo/RemoteTenantServiceImpl.java

@@ -15,6 +15,7 @@ import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Optional;
 
 /**
  * @author zhujie
@@ -53,7 +54,8 @@ public class RemoteTenantServiceImpl implements RemoteTenantService {
      */
     @Override
     public String queryNameByTenantId(String tenantId) {
-        return tenantService.queryByTenantId(tenantId).getCompanyName();
+        SysTenantVo vo = tenantService.queryByTenantId(tenantId);
+        return Optional.ofNullable(vo).map(SysTenantVo::getCompanyName).orElse(null);
     }
 
     @Override

+ 0 - 0
script/sql/business/maintain/20260604.sql