Huanyi 2 týždňov pred
rodič
commit
8af22e72d4

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

@@ -90,101 +90,101 @@ public interface CacheNames {
      * 区域站点名
      * @Author: Huanyi
      */
-    String SYS_AREA_STATION_NAME = "sys_area_station_name#30d";
+    String SYS_AREA_STATION_NAME = GlobalConstants.GLOBAL_REDIS_KEY + "sys_area_station_name#30d";
 
     /**
      * 商户分类名
      * @Author: Huanyi
      */
-    String SYS_TENANT_CATERGORIES_NAME = "sys_tenant_catergories_name#30d";
+    String SYS_TENANT_CATERGORIES_NAME = GlobalConstants.GLOBAL_REDIS_KEY + "sys_tenant_catergories_name#30d";
 
     /**
      * 门店名
      * @Author: Huanyi
      */
-    String SYS_STORE_NAME = "sys_store_name#30d";
+    String SYS_STORE_NAME = GlobalConstants.GLOBAL_REDIS_KEY + "sys_store_name#30d";
 
     /**
      * 宠物用户名
      * @Author: Huanyi
      */
-    String USR_CUSTOMER_NAME = "usr_customer_name#30d";
+    String USR_CUSTOMER_NAME = GlobalConstants.GLOBAL_REDIS_KEY + "usr_customer_name#30d";
 
     /**
      * 订单号
      * @Author: Huanyi
      */
-    String SYS_ORDER_CODE = "sys_order_code#30d";
+    String SYS_ORDER_CODE = GlobalConstants.GLOBAL_REDIS_KEY + "sys_order_code#30d";
 
     /**
      * 服务项目
      * @Author: Huanyi
      */
-    String SYS_SERVICE = "sys_service#30d";
+    String SYS_SERVICE = GlobalConstants.GLOBAL_REDIS_KEY + "sys_service#30d";
 
     /**
      * 履约者名称
      * @Author: Huanyi
      */
-    String FLF_FULFILLER_NAME = "flf_fulfiller_name#30d";
+    String FLF_FULFILLER_NAME = GlobalConstants.GLOBAL_REDIS_KEY + "flf_fulfiller_name#30d";
 
     /**
      * 履约者配置
      * @Author: Huanyi
      */
-    String FLF_CONFIG = "flf_config#30d";
+    String FLF_CONFIG = GlobalConstants.GLOBAL_REDIS_KEY + "flf_config#30d";
 
     /**
      * 标签
      * @Author: Huanyi
      */
-    String SYS_TAG = "sys_tag#30d";
+    String SYS_TAG = GlobalConstants.GLOBAL_REDIS_KEY + "sys_tag#30d";
 
     /**
      * 区域站点列表
      * @Author: Huanyi
      */
-    String SYS_AREA_STATION = "sys_area_station#30d";
+    String SYS_AREA_STATION = GlobalConstants.GLOBAL_REDIS_KEY + "sys_area_station#30d";
 
     /**
      * 协议
      * @Author: Huanyi
      */
-    String SYS_AGREEMENT = "sys_agreement#30d";
+    String SYS_AGREEMENT = GlobalConstants.GLOBAL_REDIS_KEY + "sys_agreement#30d";
 
     /**
      * 网站配置
      * @Author: Huanyi
      */
-    String SYS_WEBSITE_SETTING = "sys_website_setting#30d";
+    String SYS_WEBSITE_SETTING = GlobalConstants.GLOBAL_REDIS_KEY + "sys_website_setting#30d";
 
     /**
      * 地图配置
      * @Author: Huanyi
      */
-    String SYS_MAP_SETTING = "sys_map_setting#30d";
+    String SYS_MAP_SETTING = GlobalConstants.GLOBAL_REDIS_KEY + "sys_map_setting#30d";
 
     /**
      * APP配置
      * @Author: Huanyi
      */
-    String SYS_APP_SETTING = "sys_app_setting#30d";
+    String SYS_APP_SETTING = GlobalConstants.GLOBAL_REDIS_KEY + "sys_app_setting#30d";
 
     /**
      * 订单配置
      * @Author: Huanyi
      */
-    String SYS_ORDER_SETTING = "sys_order_setting#30d";
+    String SYS_ORDER_SETTING = GlobalConstants.GLOBAL_REDIS_KEY + "sys_order_setting#30d";
 
     /**
      * 客服配置
      * @Author: Huanyi
      */
-    String SYS_CUSTOMER_SERVICE_SETTING = "sys_customer_service_setting#30d";
+    String SYS_CUSTOMER_SERVICE_SETTING = GlobalConstants.GLOBAL_REDIS_KEY + "sys_customer_service_setting#30d";
 
     /**
      * 服务类型分类
      * @Author: Huanyi
      */
-    String SYS_SERVICE_CLASSIFICATION = "sys_service_classification#30d";
+    String SYS_SERVICE_CLASSIFICATION = GlobalConstants.GLOBAL_REDIS_KEY + "sys_service_classification#30d";
 }

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

@@ -77,7 +77,7 @@ public class SysAreaStationServiceImpl implements ISysAreaStationService {
      * @param bo 区域站点
      * @return 是否新增成功
      */
-    @CacheEvict(cacheNames = CacheNames.SYS_AREA_STATION, key = "'all'")
+    @CacheEvict(cacheNames = CacheNames.SYS_AREA_STATION, key = "'all'", beforeInvocation = true)
     @Override
     public Boolean insertByBo(SysAreaStationBo bo) {
         SysAreaStation add = MapstructUtils.convert(bo, SysAreaStation.class);
@@ -96,7 +96,7 @@ public class SysAreaStationServiceImpl implements ISysAreaStationService {
      * @param bo 区域站点
      * @return 是否修改成功
      */
-    @CacheEvict(cacheNames = CacheNames.SYS_AREA_STATION, key = "'all'")
+    @CacheEvict(cacheNames = CacheNames.SYS_AREA_STATION, key = "'all'", beforeInvocation = true)
     @Override
     public Boolean updateByBo(SysAreaStationBo bo) {
         SysAreaStation update = MapstructUtils.convert(bo, SysAreaStation.class);
@@ -119,7 +119,7 @@ public class SysAreaStationServiceImpl implements ISysAreaStationService {
      * @param isValid 是否进行有效性校验
      * @return 是否删除成功
      */
-    @CacheEvict(cacheNames = CacheNames.SYS_AREA_STATION, key = "'all'")
+    @CacheEvict(cacheNames = CacheNames.SYS_AREA_STATION, key = "'all'", beforeInvocation = true)
     @Override
     public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
         if(isValid){

+ 2 - 1
ruoyi-modules/yingpaipay-service/src/main/java/org/dromara/service/controller/SysServiceClassificationController.java

@@ -100,6 +100,7 @@ public class SysServiceClassificationController extends BaseController {
 
     @GetMapping("/listAll")
     public R<List<SysServiceClassificationVo>> listAll() {
-        return R.ok(sysServiceClassificationService.listAll());
+        List<SysServiceClassificationVo> all = sysServiceClassificationService.listAll();
+        return R.ok(all);
     }
 }

+ 2 - 2
ruoyi-modules/yingpaipay-service/src/main/java/org/dromara/service/controller/SysServiceController.java

@@ -77,7 +77,7 @@ public class SysServiceController extends BaseController {
     @RepeatSubmit()
     @PostMapping()
     public R<Void> add(@Validated(AddGroup.class) @RequestBody SysServiceBo bo) {
-        return toAjax(sysServiceService.insertByBo(bo) != null);
+        return toAjax(sysServiceService.insertByBo(bo));
     }
 
     /**
@@ -88,7 +88,7 @@ public class SysServiceController extends BaseController {
     @RepeatSubmit()
     @PutMapping()
     public R<Void> edit(@Validated(EditGroup.class) @RequestBody SysServiceBo bo) {
-        return toAjax(sysServiceService.updateByBo(bo) != null);
+        return toAjax(sysServiceService.updateByBo(bo));
     }
 
     /**

+ 2 - 2
ruoyi-modules/yingpaipay-service/src/main/java/org/dromara/service/service/ISysServiceService.java

@@ -51,7 +51,7 @@ public interface ISysServiceService {
      * @param bo 服务列表
      * @return 是否新增成功
      */
-    SysServiceVo insertByBo(SysServiceBo bo);
+    boolean insertByBo(SysServiceBo bo);
 
     /**
      * 修改服务列表
@@ -59,7 +59,7 @@ public interface ISysServiceService {
      * @param bo 服务列表
      * @return 是否修改成功
      */
-    SysServiceVo updateByBo(SysServiceBo bo);
+    boolean updateByBo(SysServiceBo bo);
 
     /**
      * 校验并批量删除服务列表信息

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

@@ -89,7 +89,7 @@ public class SysServiceClassificationServiceImpl implements ISysServiceClassific
      * @param bo 服务分类
      * @return 是否新增成功
      */
-    @CacheEvict(cacheNames = CacheNames.SYS_SERVICE_CLASSIFICATION, key = "'all'")
+    @CacheEvict(cacheNames = CacheNames.SYS_SERVICE_CLASSIFICATION, key = "'all'", beforeInvocation = true)
     @Override
     public Boolean insertByBo(SysServiceClassificationBo bo) {
         SysServiceClassification add = MapstructUtils.convert(bo, SysServiceClassification.class);
@@ -107,7 +107,7 @@ public class SysServiceClassificationServiceImpl implements ISysServiceClassific
      * @param bo 服务分类
      * @return 是否修改成功
      */
-    @CacheEvict(cacheNames = CacheNames.SYS_SERVICE_CLASSIFICATION, key = "'all'")
+    @CacheEvict(cacheNames = CacheNames.SYS_SERVICE_CLASSIFICATION, key = "'all'", beforeInvocation = true)
     @Override
     public Boolean updateByBo(SysServiceClassificationBo bo) {
         SysServiceClassification update = MapstructUtils.convert(bo, SysServiceClassification.class);
@@ -129,7 +129,7 @@ public class SysServiceClassificationServiceImpl implements ISysServiceClassific
      * @param isValid 是否进行有效性校验
      * @return 是否删除成功
      */
-    @CacheEvict(cacheNames = CacheNames.SYS_SERVICE_CLASSIFICATION, key = "'all'")
+    @CacheEvict(cacheNames = CacheNames.SYS_SERVICE_CLASSIFICATION, key = "'all'", beforeInvocation = true)
     @Override
     public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
         if(isValid){
@@ -138,7 +138,7 @@ public class SysServiceClassificationServiceImpl implements ISysServiceClassific
         return baseMapper.deleteByIds(ids) > 0;
     }
 
-    @Cacheable(cacheNames = CacheNames.SYS_SERVICE_CLASSIFICATION, key = "'all'")
+    @Cacheable(cacheNames = CacheNames.SYS_SERVICE_CLASSIFICATION)
     @Override
     public List<SysServiceClassificationVo> listAll() {
         return baseMapper.selectVoList();

+ 7 - 13
ruoyi-modules/yingpaipay-service/src/main/java/org/dromara/service/service/impl/SysServiceServiceImpl.java

@@ -98,18 +98,14 @@ public class SysServiceServiceImpl implements ISysServiceService {
      * @param bo 服务列表
      * @return 是否新增成功
      */
-    @CacheEvict(cacheNames = CacheNames.SYS_SERVICE, key = "'all'")
+    @CacheEvict(cacheNames = CacheNames.SYS_SERVICE, key = "'all'", beforeInvocation = true)
     @Override
-    public SysServiceVo insertByBo(SysServiceBo bo) {
+    public boolean insertByBo(SysServiceBo bo) {
         SysService add = MapstructUtils.convert(bo, SysService.class);
         add.setIntroduction(new String(Base64.getDecoder().decode(bo.getIntroduction()), StandardCharsets.UTF_8));
         add.setOrderInstruction(new String(Base64.getDecoder().decode(bo.getOrderInstruction()), StandardCharsets.UTF_8));
         validEntityBeforeSave(add);
-        boolean flag = baseMapper.insert(add) > 0;
-        if (flag) {
-            bo.setId(add.getId());
-        }
-        return baseMapper.selectVoById(bo.getId());
+        return baseMapper.insert(add) > 0;
     }
 
     /**
@@ -118,16 +114,14 @@ public class SysServiceServiceImpl implements ISysServiceService {
      * @param bo 服务列表
      * @return 是否修改成功
      */
-    @CacheEvict(cacheNames = CacheNames.SYS_SERVICE, key = "'all'")
+    @CacheEvict(cacheNames = CacheNames.SYS_SERVICE, key = "'all'", beforeInvocation = true)
     @Override
-    public SysServiceVo updateByBo(SysServiceBo bo) {
+    public boolean updateByBo(SysServiceBo bo) {
         SysService update = MapstructUtils.convert(bo, SysService.class);
         update.setIntroduction(new String(Base64.getDecoder().decode(bo.getIntroduction()), StandardCharsets.UTF_8));
         update.setOrderInstruction(new String(Base64.getDecoder().decode(bo.getOrderInstruction()), StandardCharsets.UTF_8));
         validEntityBeforeSave(update);
-        boolean flag = baseMapper.updateById(update) > 0;
-        if (flag) {}
-        return baseMapper.selectVoById(bo.getId());
+        return baseMapper.updateById(update) > 0;
     }
 
     /**
@@ -144,7 +138,7 @@ public class SysServiceServiceImpl implements ISysServiceService {
      * @param isValid 是否进行有效性校验
      * @return 是否删除成功
      */
-    @CacheEvict(cacheNames = CacheNames.SYS_SERVICE, key = "'all'")
+    @CacheEvict(cacheNames = CacheNames.SYS_SERVICE, key = "'all'", beforeInvocation = true)
     @Override
     public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
         if(isValid){