Huanyi 2 недель назад
Родитель
Сommit
198f69cae6
21 измененных файлов с 143 добавлено и 68 удалено
  1. 6 0
      ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/constant/CacheNames.java
  2. 6 0
      ruoyi-common/ruoyi-common-translation/src/main/java/org/dromara/common/translation/constant/TransConstant.java
  3. 4 1
      ruoyi-common/ruoyi-common-translation/src/main/java/org/dromara/common/translation/core/impl/AreaStationTranslationImpl.java
  4. 5 1
      ruoyi-common/ruoyi-common-translation/src/main/java/org/dromara/common/translation/core/impl/CustomerNameTranslationImpl.java
  5. 6 1
      ruoyi-common/ruoyi-common-translation/src/main/java/org/dromara/common/translation/core/impl/FulfillerNameTranslationImpl.java
  6. 10 3
      ruoyi-common/ruoyi-common-translation/src/main/java/org/dromara/common/translation/core/impl/OrderCodeTranslationImpl.java
  7. 9 1
      ruoyi-common/ruoyi-common-translation/src/main/java/org/dromara/common/translation/core/impl/StoreNameTranslationImpl.java
  8. 30 0
      ruoyi-common/ruoyi-common-translation/src/main/java/org/dromara/common/translation/core/impl/SubOrderCodeTranslationImpl.java
  9. 6 1
      ruoyi-common/ruoyi-common-translation/src/main/java/org/dromara/common/translation/core/impl/TenantCatergoriesNameTranslationImpl.java
  10. 1 0
      ruoyi-common/ruoyi-common-translation/src/main/java/org/dromara/common/translation/core/impl/TenantNameTranslationImpl.java
  11. 1 0
      ruoyi-common/ruoyi-common-translation/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
  12. 1 3
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysMapSettingServiceImpl.java
  13. 5 0
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysTenantCategoriesServiceImpl.java
  14. 13 20
      ruoyi-modules/yingpaipay-archieves/src/main/java/org/dromara/archieves/dubbo/RemoteCustomerServiceImpl.java
  15. 1 1
      ruoyi-modules/yingpaipay-fulfiller/src/main/java/org/dromara/fulfiller/domain/vo/FlfComplaintLogVo.java
  16. 4 4
      ruoyi-modules/yingpaipay-fulfiller/src/main/java/org/dromara/fulfiller/service/impl/FlfFlfLevelRightsServiceImpl.java
  17. 3 3
      ruoyi-modules/yingpaipay-fulfiller/src/main/java/org/dromara/fulfiller/service/impl/FlfLevelConfigServiceImpl.java
  18. 3 3
      ruoyi-modules/yingpaipay-order/src/main/java/org/dromara/order/domain/vo/SysSubOrderListPageVo.java
  19. 1 1
      ruoyi-modules/yingpaipay-order/src/main/java/org/dromara/order/dubbo/RemoteSubOrderServiceImpl.java
  20. 4 1
      ruoyi-modules/yingpaipay-order/src/main/java/org/dromara/order/service/impl/SysOrderServiceImpl.java
  21. 24 24
      ruoyi-modules/yingpaipay-order/src/main/java/org/dromara/order/service/impl/SysSubOrderServiceImpl.java

+ 6 - 0
ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/constant/CacheNames.java

@@ -116,6 +116,12 @@ public interface CacheNames {
      */
     String SYS_ORDER_CODE = GlobalConstants.GLOBAL_REDIS_KEY + "sys_order_code#30d";
 
+    /**
+     * 订单号
+     * @Author: Huanyi
+     */
+    String SYS_SUB_ORDER_CODE = GlobalConstants.GLOBAL_REDIS_KEY + "sys_sub_order_code#30d";
+
     /**
      * 服务项目
      * @Author: Huanyi

+ 6 - 0
ruoyi-common/ruoyi-common-translation/src/main/java/org/dromara/common/translation/constant/TransConstant.java

@@ -69,6 +69,12 @@ public interface TransConstant {
      */
     String ORDER_ID_TO_CODE = "order_id_to_code";
 
+    /**
+     * 子订单ID转订单号
+     * @Author: Huanyi
+     */
+    String SUB_ORDER_ID_TO_CODE = "sub_order_id_to_code";
+
     /**
      * 履约者ID转名称
      * @Author: Huanyi

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

@@ -3,6 +3,8 @@ package org.dromara.common.translation.core.impl;
 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.redis.utils.CacheUtils;
 import org.dromara.common.translation.annotation.TranslationType;
 import org.dromara.common.translation.constant.TransConstant;
 import org.dromara.common.translation.core.TranslationInterface;
@@ -23,7 +25,8 @@ public class AreaStationTranslationImpl implements TranslationInterface<String>
     @Override
     public String translation(Object key, String other) {
         Long id = Convert.toLong(key);
-        return areaStationService.selectNameById(id);
+        Object result = CacheUtils.get(CacheNames.SYS_AREA_STATION_NAME, id);
+        return result != null ? String.valueOf(result) : areaStationService.selectNameById(id);
     }
 
 }

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

@@ -4,6 +4,8 @@ import cn.hutool.core.convert.Convert;
 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.redis.utils.CacheUtils;
 import org.dromara.common.translation.annotation.TranslationType;
 import org.dromara.common.translation.constant.TransConstant;
 import org.dromara.common.translation.core.TranslationInterface;
@@ -17,6 +19,8 @@ public class CustomerNameTranslationImpl implements TranslationInterface<String>
 
     @Override
     public String translation(Object key, String other) {
-        return remoteCustomerService.selectNameById(Convert.toLong(key));
+        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));
     }
 }

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

@@ -3,6 +3,8 @@ package org.dromara.common.translation.core.impl;
 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.redis.utils.CacheUtils;
 import org.dromara.common.translation.annotation.TranslationType;
 import org.dromara.common.translation.constant.TransConstant;
 import org.dromara.common.translation.core.TranslationInterface;
@@ -22,6 +24,9 @@ public class FulfillerNameTranslationImpl implements TranslationInterface<String
 
     @Override
     public String translation(Object key, String other) {
-        return remoteFulfillerService.getNameById(Convert.toLong(key));
+        Long id = Convert.toLong(key);
+        Object result = CacheUtils.get(CacheNames.FLF_FULFILLER_NAME, id);
+        return result != null ? String.valueOf(result) : remoteFulfillerService.getNameById(id);
     }
 }
+

+ 10 - 3
ruoyi-common/ruoyi-common-translation/src/main/java/org/dromara/common/translation/core/impl/OrderCodeTranslationImpl.java

@@ -3,21 +3,28 @@ package org.dromara.common.translation.core.impl;
 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.redis.utils.CacheUtils;
 import org.dromara.common.translation.annotation.TranslationType;
 import org.dromara.common.translation.constant.TransConstant;
 import org.dromara.common.translation.core.TranslationInterface;
 import org.dromara.order.api.RemoteOrderService;
-import org.dromara.order.api.RemoteSubOrderService;
 
+/**
+ * 订单ID翻译为订单号
+ */
 @AllArgsConstructor
 @TranslationType(type = TransConstant.ORDER_ID_TO_CODE)
 public class OrderCodeTranslationImpl implements TranslationInterface<String> {
 
     @DubboReference
-    private final RemoteSubOrderService remoteSubOrderService;
+    private final RemoteOrderService remoteOrderService;
 
     @Override
     public String translation(Object key, String other) {
-        return remoteSubOrderService.getCodeById(Convert.toLong(key));
+        Long id = Convert.toLong(key);
+        Object result = CacheUtils.get(CacheNames.SYS_ORDER_CODE, id);
+        return result != null ? String.valueOf(result) : remoteOrderService.getCodeById(id);
     }
 }
+

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

@@ -3,11 +3,16 @@ package org.dromara.common.translation.core.impl;
 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.redis.utils.CacheUtils;
 import org.dromara.common.translation.annotation.TranslationType;
 import org.dromara.common.translation.constant.TransConstant;
 import org.dromara.common.translation.core.TranslationInterface;
 import org.dromara.system.api.RemoteStoreService;
 
+/**
+ * 门店ID翻译为门店名称
+ */
 @AllArgsConstructor
 @TranslationType(type = TransConstant.STORE_ID_TO_NAME)
 public class StoreNameTranslationImpl implements TranslationInterface<String> {
@@ -17,6 +22,9 @@ public class StoreNameTranslationImpl implements TranslationInterface<String> {
 
     @Override
     public String translation(Object key, String other) {
-        return remoteStoreService.getNameById(Convert.toLong(key));
+        Long id = Convert.toLong(key);
+        Object result = CacheUtils.get(CacheNames.SYS_STORE_NAME, id);
+        return result != null ? String.valueOf(result) : remoteStoreService.getNameById(id);
     }
 }
+

+ 30 - 0
ruoyi-common/ruoyi-common-translation/src/main/java/org/dromara/common/translation/core/impl/SubOrderCodeTranslationImpl.java

@@ -0,0 +1,30 @@
+package org.dromara.common.translation.core.impl;
+
+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.redis.utils.CacheUtils;
+import org.dromara.common.translation.annotation.TranslationType;
+import org.dromara.common.translation.constant.TransConstant;
+import org.dromara.common.translation.core.TranslationInterface;
+import org.dromara.order.api.RemoteSubOrderService;
+
+/**
+ * 订单ID翻译为订单号
+ */
+@AllArgsConstructor
+@TranslationType(type = TransConstant.SUB_ORDER_ID_TO_CODE)
+public class SubOrderCodeTranslationImpl implements TranslationInterface<String> {
+
+    @DubboReference
+    private final RemoteSubOrderService remoteSubOrderService;
+
+    @Override
+    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);
+    }
+}
+

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

@@ -3,6 +3,8 @@ package org.dromara.common.translation.core.impl;
 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.redis.utils.CacheUtils;
 import org.dromara.common.translation.annotation.TranslationType;
 import org.dromara.common.translation.constant.TransConstant;
 import org.dromara.common.translation.core.TranslationInterface;
@@ -22,6 +24,9 @@ public class TenantCatergoriesNameTranslationImpl implements TranslationInterfac
 
     @Override
     public String translation(Object key, String other) {
-        return tenantCatergoriesService.getNameById(Convert.toLong(key));
+        Long id = Convert.toLong(key);
+        Object result = CacheUtils.get(CacheNames.SYS_TENANT_CATERGORIES_NAME, id);
+        return result != null ? String.valueOf(result) : tenantCatergoriesService.getNameById(id);
     }
 }
+

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

@@ -24,3 +24,4 @@ public class TenantNameTranslationImpl implements TranslationInterface<String> {
         return tenantService.queryNameByTenantId(key.toString());
     }
 }
+

+ 1 - 0
ruoyi-common/ruoyi-common-translation/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports

@@ -9,5 +9,6 @@ org.dromara.common.translation.core.impl.TenantNameTranslationImpl
 org.dromara.common.translation.core.impl.TenantCatergoriesNameTranslationImpl
 org.dromara.common.translation.core.impl.CustomerNameTranslationImpl
 org.dromara.common.translation.core.impl.OrderCodeTranslationImpl
+org.dromara.common.translation.core.impl.SubOrderCodeTranslationImpl
 org.dromara.common.translation.core.impl.StoreNameTranslationImpl
 org.dromara.common.translation.core.impl.FulfillerNameTranslationImpl

+ 1 - 3
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysMapSettingServiceImpl.java

@@ -28,8 +28,6 @@ public class SysMapSettingServiceImpl implements ISysMapSettingService {
     @Override
     public SysMapSettingVo updateById(SysMapSetting e) {
         baseMapper.updateById(e);
-        SysMapSettingVo vo = baseMapper.selectVoById(e.getId());
-        log.info("实体 : {}\nvo : {}", e, vo);
-        return vo;
+        return baseMapper.selectVoById(e.getId());
     }
 }

+ 5 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysTenantCategoriesServiceImpl.java

@@ -1,5 +1,6 @@
 package org.dromara.system.service.impl;
 
+import org.dromara.common.core.constant.CacheNames;
 import org.dromara.common.core.exception.ServiceException;
 import org.dromara.common.core.utils.MapstructUtils;
 import org.dromara.common.core.utils.StringUtils;
@@ -10,6 +11,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import org.dromara.common.redis.utils.CacheUtils;
 import org.dromara.system.domain.SysStore;
 import org.dromara.system.domain.vo.SysTenantCategoriesOnStoreVo;
 import org.dromara.system.mapper.SysStoreMapper;
@@ -102,6 +104,7 @@ public class SysTenantCategoriesServiceImpl implements ISysTenantCategoriesServi
         if (flag) {
             bo.setId(add.getId());
         }
+        CacheUtils.put(CacheNames.SYS_TENANT_CATERGORIES_NAME, add.getId(), add.getName());
         return flag;
     }
 
@@ -115,6 +118,7 @@ public class SysTenantCategoriesServiceImpl implements ISysTenantCategoriesServi
     public Boolean updateByBo(SysTenantCategoriesBo bo) {
         SysTenantCategories update = MapstructUtils.convert(bo, SysTenantCategories.class);
         validEntityBeforeSave(update);
+        CacheUtils.put(CacheNames.SYS_TENANT_CATERGORIES_NAME, update.getId(), update.getName());
         return baseMapper.updateById(update) > 0;
     }
 
@@ -145,6 +149,7 @@ public class SysTenantCategoriesServiceImpl implements ISysTenantCategoriesServi
         if (exists) {
             throw new ServiceException("存在有门店绑定,不能删除");
         }
+        ids.forEach(id -> CacheUtils.evict(CacheNames.SYS_TENANT_CATERGORIES_NAME, id));
 
         return baseMapper.deleteByIds(ids) > 0;
     }

+ 13 - 20
ruoyi-modules/yingpaipay-archieves/src/main/java/org/dromara/archieves/dubbo/RemoteCustomerServiceImpl.java

@@ -26,22 +26,19 @@ public class RemoteCustomerServiceImpl implements RemoteCustomerService {
     @Override
     public List<Long> selectIdsByName(String name) {
         List<Long> ids = new ArrayList<>();
-        baseMapper.selectList(
-            Wrappers.lambdaQuery(UsrCustomer.class)
+        baseMapper.selectList(Wrappers.lambdaQuery(UsrCustomer.class)
                 .select(UsrCustomer::getId)
-                .like(StringUtils.isNotBlank(name), UsrCustomer::getName, name)
-        ).forEach(e -> ids.add(e.getId()));
+                .like(StringUtils.isNotBlank(name), UsrCustomer::getName, name))
+            .forEach(e -> ids.add(e.getId()));
         return ids;
     }
 
     @Cacheable(cacheNames = CacheNames.USR_CUSTOMER_NAME, key = "#id")
     @Override
     public String selectNameById(Long id) {
-        return baseMapper.selectOne(
-            Wrappers.lambdaQuery(UsrCustomer.class)
+        return baseMapper.selectOne(Wrappers.lambdaQuery(UsrCustomer.class)
                 .select(UsrCustomer::getName)
-                .eq(UsrCustomer::getId, id)
-        ).getName();
+                .eq(UsrCustomer::getId, id)).getName();
     }
 
     @Override
@@ -50,11 +47,10 @@ public class RemoteCustomerServiceImpl implements RemoteCustomerService {
             return Collections.emptyList();
         }
         List<RemoteCustomerVo> vos = new ArrayList<>();
-        baseMapper.selectList(
-            Wrappers.lambdaQuery(UsrCustomer.class)
+        baseMapper.selectList(Wrappers.lambdaQuery(UsrCustomer.class)
                 .select(UsrCustomer::getId, UsrCustomer::getName, UsrCustomer::getAddress, UsrCustomer::getPhone)
-                .in(UsrCustomer::getId, customerIds)
-        ).forEach(e -> {
+                .in(UsrCustomer::getId, customerIds))
+            .forEach(e -> {
             RemoteCustomerVo vo = new RemoteCustomerVo();
             vo.setId(e.getId());
             vo.setName(e.getName());
@@ -68,11 +64,10 @@ public class RemoteCustomerServiceImpl implements RemoteCustomerService {
     @Override
     public List<RemoteCustomerVo> selectListByName(String name) {
         List<RemoteCustomerVo> vos = new ArrayList<>();
-        baseMapper.selectList(
-            Wrappers.lambdaQuery(UsrCustomer.class)
+        baseMapper.selectList(Wrappers.lambdaQuery(UsrCustomer.class)
                 .select(UsrCustomer::getId, UsrCustomer::getName)
-                .like(StringUtils.isNotBlank(name), UsrCustomer::getName, name)
-        ).forEach(e -> {
+                .like(StringUtils.isNotBlank(name), UsrCustomer::getName, name))
+            .forEach(e -> {
             RemoteCustomerVo vo = new RemoteCustomerVo();
             vo.setId(e.getId());
             vo.setName(e.getName());
@@ -84,11 +79,9 @@ public class RemoteCustomerServiceImpl implements RemoteCustomerService {
     @Override
     public List<Long> getIdsByNameAndPhone(String content) {
         List<Long> ids = new ArrayList<>();
-        baseMapper.selectList(
-                Wrappers.lambdaQuery(UsrCustomer.class)
+        baseMapper.selectList(Wrappers.lambdaQuery(UsrCustomer.class)
                     .select(UsrCustomer::getId)
-                    .like(UsrCustomer::getName, content).or().like(UsrCustomer::getPhone, content)
-            )
+                    .like(UsrCustomer::getName, content).or().like(UsrCustomer::getPhone, content))
             .forEach(e -> ids.add(e.getId()));
         return ids;
     }

+ 1 - 1
ruoyi-modules/yingpaipay-fulfiller/src/main/java/org/dromara/fulfiller/domain/vo/FlfComplaintLogVo.java

@@ -47,7 +47,7 @@ public class FlfComplaintLogVo implements Serializable {
      * 关联订单
      */
     @ExcelProperty(value = "关联订单")
-    @Translation(type = TransConstant.ORDER_ID_TO_CODE, mapper = "orderId")
+    @Translation(type = TransConstant.SUB_ORDER_ID_TO_CODE, mapper = "orderId")
     private String orderCode;
     private Long orderId;
 

+ 4 - 4
ruoyi-modules/yingpaipay-fulfiller/src/main/java/org/dromara/fulfiller/service/impl/FlfFlfLevelRightsServiceImpl.java

@@ -28,7 +28,7 @@ public class FlfFlfLevelRightsServiceImpl implements IFlfLevelRightsService {
         return baseMapper.selectVoList();
     }
 
-    @CacheEvict(cacheNames = CacheNames.FLF_CONFIG, key = "'level_right'")
+    @CacheEvict(cacheNames = CacheNames.FLF_CONFIG, key = "'level_right'", beforeInvocation = true)
     @Override
     public boolean insertByBo(FlfLevelRightsBo bo) {
         FlfLevelRights entity = MapstructUtils.convert(bo, FlfLevelRights.class);
@@ -39,7 +39,7 @@ public class FlfFlfLevelRightsServiceImpl implements IFlfLevelRightsService {
         return true;
     }
 
-    @CacheEvict(cacheNames = CacheNames.FLF_CONFIG, key = "'level_right'")
+    @CacheEvict(cacheNames = CacheNames.FLF_CONFIG, key = "'level_right'", beforeInvocation = true)
     @Override
     public boolean updateByBo(FlfLevelRightsBo bo) {
         FlfLevelRights entity = MapstructUtils.convert(bo, FlfLevelRights.class);
@@ -50,13 +50,13 @@ public class FlfFlfLevelRightsServiceImpl implements IFlfLevelRightsService {
         return true;
     }
 
-    @CacheEvict(cacheNames = CacheNames.FLF_CONFIG, key = "'level_right'")
+    @CacheEvict(cacheNames = CacheNames.FLF_CONFIG, key = "'level_right'", beforeInvocation = true)
     @Override
     public boolean deleteById(Long id) {
         return baseMapper.deleteById(id) > 0;
     }
 
-    @CacheEvict(cacheNames = CacheNames.FLF_CONFIG, key = "'level_right'")
+    @CacheEvict(cacheNames = CacheNames.FLF_CONFIG, key = "'level_right'", beforeInvocation = true)
     @Override
     public boolean updateStatus(FlfLevelRightsChangeStatusBo bo) {
         return baseMapper.update(

+ 3 - 3
ruoyi-modules/yingpaipay-fulfiller/src/main/java/org/dromara/fulfiller/service/impl/FlfLevelConfigServiceImpl.java

@@ -48,7 +48,7 @@ public class FlfLevelConfigServiceImpl implements IFlfLevelConfigService {
     }
 
     @Transactional(rollbackFor = Exception.class)
-    @CacheEvict(cacheNames = CacheNames.FLF_CONFIG, key = "'level_config'")
+    @CacheEvict(cacheNames = CacheNames.FLF_CONFIG, key = "'level_config'", beforeInvocation = true)
     @Override
     public boolean insertByBo(FlfLevelConfigBo bo) {
 
@@ -74,7 +74,7 @@ public class FlfLevelConfigServiceImpl implements IFlfLevelConfigService {
     }
 
     @Transactional(rollbackFor = Exception.class)
-    @CacheEvict(cacheNames = CacheNames.FLF_CONFIG, key = "'level_config'")
+    @CacheEvict(cacheNames = CacheNames.FLF_CONFIG, key = "'level_config'", beforeInvocation = true)
     @Override
     public boolean updateByBo(FlfLevelConfigBo bo) {
         FlfLevelConfig config = MapstructUtils.convert(bo, FlfLevelConfig.class);
@@ -104,7 +104,7 @@ public class FlfLevelConfigServiceImpl implements IFlfLevelConfigService {
     }
 
     @Transactional(rollbackFor = Exception.class)
-    @CacheEvict(cacheNames = CacheNames.FLF_CONFIG, key = "'level_config'")
+    @CacheEvict(cacheNames = CacheNames.FLF_CONFIG, key = "'level_config'", beforeInvocation = true)
     @Override
     public boolean deleteById(Long id) {
 

+ 3 - 3
ruoyi-modules/yingpaipay-order/src/main/java/org/dromara/order/domain/vo/SysSubOrderListPageVo.java

@@ -36,19 +36,19 @@ public class SysSubOrderListPageVo implements Serializable {
 
     private Long customer;
 
-//    @Translation(type = TransConstant.CUSTOMER_ID_TO_NAME, mapper = "customer")
+    @Translation(type = TransConstant.CUSTOMER_ID_TO_NAME, mapper = "customer")
     private String customerName;
 
     private Long site;
 
     private Long store;
 
-//    @Translation(type = TransConstant.STORE_ID_TO_NAME, mapper = "store")
+    @Translation(type = TransConstant.STORE_ID_TO_NAME, mapper = "store")
     private String storeName;
 
     private Long placer;
 
-//    @Translation(type = TransConstant.USER_ID_TO_NAME, mapper = "placer")
+    @Translation(type = TransConstant.USER_ID_TO_NAME, mapper = "placer")
     private String placerUsername;
 
     private Date createTime;

+ 1 - 1
ruoyi-modules/yingpaipay-order/src/main/java/org/dromara/order/dubbo/RemoteSubOrderServiceImpl.java

@@ -213,7 +213,7 @@ public class RemoteSubOrderServiceImpl implements RemoteSubOrderService {
         return vos;
     }
 
-    @Cacheable(cacheNames = CacheNames.SYS_ORDER_CODE, key = "#id")
+    @Cacheable(cacheNames = CacheNames.SYS_SUB_ORDER_CODE, key = "#id")
     @Override
     public String getCodeById(Long id) {
         return baseMapper.selectOne(Wrappers.lambdaQuery(SysSubOrder.class)

+ 4 - 1
ruoyi-modules/yingpaipay-order/src/main/java/org/dromara/order/service/impl/SysOrderServiceImpl.java

@@ -138,9 +138,10 @@ public class SysOrderServiceImpl implements ISysOrderService {
             throw new RuntimeException("批量生成子订单失败");
         }
 
-        // TODO 新增操作日志
+        // 新增操作日志 + 缓存订单号
         List<SysSubOrderLog> logs = new ArrayList<>();
         for (SysSubOrder subOrder : subOrders) {
+
             SysSubOrderLog log = new SysSubOrderLog();
             log.setSubOrderId(subOrder.getId());
             log.setActioner(LoginHelper.getUserId());
@@ -152,6 +153,8 @@ public class SysOrderServiceImpl implements ISysOrderService {
             log.setContent(step.getContent());
             log.setTenantId(order.getTenantId());
             logs.add(log);
+
+            CacheUtils.put(CacheNames.SYS_SUB_ORDER_CODE, subOrder.getId(), subOrder.getCode());
         }
         boolean logFlag = subOrderLogMapper.insertBatch(logs);
         if (!logFlag) {

+ 24 - 24
ruoyi-modules/yingpaipay-order/src/main/java/org/dromara/order/service/impl/SysSubOrderServiceImpl.java

@@ -97,28 +97,28 @@ public class SysSubOrderServiceImpl implements ISysSubOrderService {
         );
 
         List<Long> petIds = new ArrayList<>();
-        List<Long> storeIds = new ArrayList<>();
-        List<Long> customerIds = new ArrayList<>();
-        List<Long> userIds = new ArrayList<>();
+//        List<Long> storeIds = new ArrayList<>();
+//        List<Long> customerIds = new ArrayList<>();
+//        List<Long> userIds = new ArrayList<>();
         List<Long> fulfillerIds = new ArrayList<>();
         page.getRecords().forEach(e -> {
             petIds.add(e.getUsrPet());
-            customerIds.add(e.getUsrCustomer());
-            storeIds.add(e.getStore());
-            userIds.add(e.getOrderPlacer());
+//            customerIds.add(e.getUsrCustomer());
+//            storeIds.add(e.getStore());
+//            userIds.add(e.getOrderPlacer());
             if (e.getFulfiller() != null) {
                 fulfillerIds.add(e.getFulfiller());
             }
         });
         Map<Long, RemotePetVo> petMap = new HashMap<>();
-        Map<Long, RemoteStoreVo> storeMap = new HashMap<>();
-        Map<Long, RemoteCustomerVo> customerMap = new HashMap<>();
-        Map<Long, RemoteUserVo> userMap = new HashMap<>();
+//        Map<Long, RemoteStoreVo> storeMap = new HashMap<>();
+//        Map<Long, RemoteCustomerVo> customerMap = new HashMap<>();
+//        Map<Long, RemoteUserVo> userMap = new HashMap<>();
         Map<Long, RemoteFulfillerVo> fulfillerMap = new HashMap<>();
         remotePetService.getByIds(petIds).forEach(e -> petMap.put(e.getId(), e));
-        remoteStoreService.getByIds(storeIds).forEach(e -> storeMap.put(e.getId(), e));
-        remoteUserService.getByIds(userIds).forEach(e -> userMap.put(e.getUserId(), e));
-        remoteCustomerService.getByIds(customerIds).forEach(e -> customerMap.put(e.getId(), e));
+//        remoteStoreService.getByIds(storeIds).forEach(e -> storeMap.put(e.getId(), e));
+//        remoteUserService.getByIds(userIds).forEach(e -> userMap.put(e.getUserId(), e));
+//        remoteCustomerService.getByIds(customerIds).forEach(e -> customerMap.put(e.getId(), e));
         remoteFulfillerService.getByIds(fulfillerIds).forEach(e -> fulfillerMap.put(e.getId(), e));
 
         return TableDataInfo.build(page.convert(e -> {
@@ -136,22 +136,22 @@ public class SysSubOrderServiceImpl implements ISysSubOrderService {
                 vo.setPetBreed(pet.getBreed());
             }
             vo.setCustomer(e.getUsrCustomer());
-            RemoteCustomerVo customer = customerMap.get(e.getUsrCustomer());
-            if (customer != null) {
-                vo.setCustomerName(customer.getName());
-            }
+//            RemoteCustomerVo customer = customerMap.get(e.getUsrCustomer());
+//            if (customer != null) {
+//                vo.setCustomerName(customer.getName());
+//            }
             vo.setToAddress(e.getToAddress());
             vo.setSite(e.getStoreSite());
             vo.setStore(e.getStore());
-            RemoteStoreVo store = storeMap.get(e.getStore());
-            if (store != null) {
-                vo.setStoreName(store.getName());
-            }
+//            RemoteStoreVo store = storeMap.get(e.getStore());
+//            if (store != null) {
+//                vo.setStoreName(store.getName());
+//            }
             vo.setPlacer(e.getOrderPlacer());
-            RemoteUserVo placer = userMap.get(e.getOrderPlacer());
-            if (placer != null) {
-                vo.setPlacerUsername(placer.getUserName());
-            }
+//            RemoteUserVo placer = userMap.get(e.getOrderPlacer());
+//            if (placer != null) {
+//                vo.setPlacerUsername(placer.getUserName());
+//            }
             vo.setCreateTime(e.getCreateTime());
             vo.setStatus(e.getStatus());
             vo.setFulfiller(e.getFulfiller());