Bläddra i källkod

数据双向同步代码语法优化

baiyun 1 år sedan
förälder
incheckning
8e71a3a5df
28 ändrade filer med 69 tillägg och 287 borttagningar
  1. 0 1
      ruoyi-api/ruoyi-api-backstage/src/main/java/org/dromara/backstage/api/RemoteBagService.java
  2. 0 3
      ruoyi-api/ruoyi-api-backstage/src/main/java/org/dromara/backstage/api/RemoteMealTypeService.java
  3. 0 3
      ruoyi-api/ruoyi-api-backstage/src/main/java/org/dromara/backstage/api/RemotePtAccountService.java
  4. 0 2
      ruoyi-api/ruoyi-api-backstage/src/main/java/org/dromara/backstage/api/RemotePtAreaService.java
  5. 1 1
      ruoyi-api/ruoyi-api-backstage/src/main/java/org/dromara/backstage/api/RemotePtRoomService.java
  6. 0 12
      ruoyi-api/ruoyi-api-backstage/src/main/java/org/dromara/backstage/api/RemotePtXfTermService.java
  7. 0 14
      ruoyi-api/ruoyi-api-backstage/src/main/java/org/dromara/backstage/api/RemoteXfDiscountService.java
  8. 1 1
      ruoyi-modules/ruoyi-backstage/src/main/java/org/dromara/backstage/basics/dubbo/RemotePtRoomServiceImpl.java
  9. 1 3
      ruoyi-modules/ruoyi-backstage/src/main/java/org/dromara/backstage/consumption/dubbo/RemoteXfDiscountServiceImpl.java
  10. 6 8
      ruoyi-modules/ruoyi-backstage/src/main/java/org/dromara/backstage/payment/dubbo/RemoteBagServiceImpl.java
  11. 0 3
      ruoyi-server/ruoyi-server-base/src/main/java/org/dromara/server/base/service/yktOperation/SyncRemotePtAccountService.java
  12. 0 6
      ruoyi-server/ruoyi-server-base/src/main/java/org/dromara/server/base/service/yktOperation/SyncRemotePtAreaService.java
  13. 2 18
      ruoyi-server/ruoyi-server-base/src/main/java/org/dromara/server/base/service/yktOperation/SyncRemotePtCardCenterService.java
  14. 0 5
      ruoyi-server/ruoyi-server-base/src/main/java/org/dromara/server/base/service/yktOperation/SyncRemotePtMealTypeService.java
  15. 0 3
      ruoyi-server/ruoyi-server-base/src/main/java/org/dromara/server/base/service/yktOperation/SyncRemotePtParameterService.java
  16. 4 4
      ruoyi-server/ruoyi-server-base/src/main/java/org/dromara/server/base/service/yktOperation/SyncRemotePtRoomService.java
  17. 2 7
      ruoyi-server/ruoyi-server-base/src/main/java/org/dromara/server/base/service/yktOperation/SyncRemotePtUserAccountService.java
  18. 0 10
      ruoyi-server/ruoyi-server-base/src/main/java/org/dromara/server/base/service/yktOperation/SyncRemoteXfDiscountService.java
  19. 4 3
      ruoyi-server/ruoyi-server-base/src/main/java/org/dromara/server/base/service/yktOperation/SyncRemoteXfTermService.java
  20. 4 15
      ruoyi-server/ruoyi-server-mqdata/src/main/java/org/dromara/server/mq/event/kafka/impl/yktOperation/PtAccountEventStrategyImpl.java
  21. 4 16
      ruoyi-server/ruoyi-server-mqdata/src/main/java/org/dromara/server/mq/event/kafka/impl/yktOperation/PtAreaEventStrategyImpl.java
  22. 9 34
      ruoyi-server/ruoyi-server-mqdata/src/main/java/org/dromara/server/mq/event/kafka/impl/yktOperation/PtCardCenterEventStrategyImpl.java
  23. 4 15
      ruoyi-server/ruoyi-server-mqdata/src/main/java/org/dromara/server/mq/event/kafka/impl/yktOperation/PtMealTypeEventStrategyImpl.java
  24. 4 15
      ruoyi-server/ruoyi-server-mqdata/src/main/java/org/dromara/server/mq/event/kafka/impl/yktOperation/PtParameterEventStrategyImpl.java
  25. 5 19
      ruoyi-server/ruoyi-server-mqdata/src/main/java/org/dromara/server/mq/event/kafka/impl/yktOperation/PtRoomEventStrategyImpl.java
  26. 7 27
      ruoyi-server/ruoyi-server-mqdata/src/main/java/org/dromara/server/mq/event/kafka/impl/yktOperation/PtUserAccountEventStrategyImpl.java
  27. 6 22
      ruoyi-server/ruoyi-server-mqdata/src/main/java/org/dromara/server/mq/event/kafka/impl/yktOperation/PtXfDiscountEventStrategyImpl.java
  28. 5 17
      ruoyi-server/ruoyi-server-mqdata/src/main/java/org/dromara/server/mq/event/kafka/impl/yktOperation/PtXfTermEventStrategyImpl.java

+ 0 - 1
ruoyi-api/ruoyi-api-backstage/src/main/java/org/dromara/backstage/api/RemoteBagService.java

@@ -2,7 +2,6 @@ package org.dromara.backstage.api;
 
 import org.dromara.backstage.api.domain.bo.RemoteConsumptionBo;
 import org.dromara.backstage.api.domain.bo.RemotePurseInOutBo;
-import org.dromara.common.core.domain.R;
 
 /**
  * name: RemoteBagService

+ 0 - 3
ruoyi-api/ruoyi-api-backstage/src/main/java/org/dromara/backstage/api/RemoteMealTypeService.java

@@ -1,14 +1,11 @@
 package org.dromara.backstage.api;
 
-import org.dromara.backstage.api.domain.bo.RemotePtAreaBo;
 import org.dromara.backstage.api.domain.bo.RemotePtMealTypeBo;
-import org.dromara.backstage.api.domain.bo.RemotePtParameterBo;
 
 import java.util.Collection;
 
 /**
  * 餐类服务
- *
  * @author bing
  */
 public interface RemoteMealTypeService {

+ 0 - 3
ruoyi-api/ruoyi-api-backstage/src/main/java/org/dromara/backstage/api/RemotePtAccountService.java

@@ -1,7 +1,6 @@
 package org.dromara.backstage.api;
 
 import org.dromara.backstage.api.domain.bo.RemotePtAccountBo;
-import org.dromara.backstage.api.domain.bo.RemotePtAreaBo;
 
 import java.util.Collection;
 
@@ -14,8 +13,6 @@ public interface RemotePtAccountService {
 
     /**
      * 新增结算账户
-     * @param bo
-     * @return
      */
     Boolean insertByBo(RemotePtAccountBo bo) throws Exception;
 

+ 0 - 2
ruoyi-api/ruoyi-api-backstage/src/main/java/org/dromara/backstage/api/RemotePtAreaService.java

@@ -13,8 +13,6 @@ public interface RemotePtAreaService {
 
     /**
      * 新增学校
-     * @param bo
-     * @return
      */
     Boolean insertByBo(RemotePtAreaBo bo);
 

+ 1 - 1
ruoyi-api/ruoyi-api-backstage/src/main/java/org/dromara/backstage/api/RemotePtRoomService.java

@@ -16,5 +16,5 @@ public interface RemotePtRoomService {
 
     Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) throws Exception;
 
-    Boolean batchSet(RemotePtRoomBatchSetBo bo) throws Exception;
+    Boolean batchSet(RemotePtRoomBatchSetBo bo);
 }

+ 0 - 12
ruoyi-api/ruoyi-api-backstage/src/main/java/org/dromara/backstage/api/RemotePtXfTermService.java

@@ -14,33 +14,21 @@ public interface RemotePtXfTermService {
 
     /**
      * 新增设备
-     * @param bo
-     * @return
      */
     Boolean insertByBo(RemoteXfTermBo bo);
 
     /**
      * 修改设备
-     * @param bo
-     * @return
-     * @throws Exception
      */
     Boolean updateByBo(RemoteXfTermBo bo) throws Exception;
 
     /**
      * 删除设备
-     * @param ids
-     * @param isValid
-     * @return
-     * @throws Exception
      */
     Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) throws Exception;
 
     /**
      * 修改设备参数
-     * @param bo
-     * @return
-     * @throws Exception
      */
     Boolean editParam(RemoteXfTermParamBo bo);
 

+ 0 - 14
ruoyi-api/ruoyi-api-backstage/src/main/java/org/dromara/backstage/api/RemoteXfDiscountService.java

@@ -1,7 +1,6 @@
 package org.dromara.backstage.api;
 
 import org.dromara.backstage.api.domain.bo.RemoteXfDiscountBo;
-import org.dromara.backstage.api.domain.bo.RemoteXfDiscountTermBo;
 
 import java.util.Collection;
 import java.util.List;
@@ -15,39 +14,26 @@ public interface RemoteXfDiscountService {
 
     /**
      * 新增消费折扣
-     * @param bo
-     * @return
      */
     Boolean insertByBo(RemoteXfDiscountBo bo) throws Exception;
 
     /**
      * 修改消费折扣
-     * @param bo
-     * @return
-     * @throws Exception
      */
     Boolean updateByBo(RemoteXfDiscountBo bo) throws Exception;
 
     /**
      * 删除消费折扣
-     * @param ids
-     * @param isValid
-     * @return
-     * @throws Exception
      */
     Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) throws Exception;
 
     /**
      * 新增折扣设备
-     * @return
-     * @throws Exception
      */
     Boolean addDiscountTerm(List<Long> ids);
 
     /**
      * 删除折扣设备
-     * @param ids
-     * @return
      */
     Boolean deleteDiscountTerm(List<Long> ids);
 }

+ 1 - 1
ruoyi-modules/ruoyi-backstage/src/main/java/org/dromara/backstage/basics/dubbo/RemotePtRoomServiceImpl.java

@@ -38,7 +38,7 @@ public class RemotePtRoomServiceImpl implements RemotePtRoomService {
     }
 
     @Override
-    public Boolean batchSet(RemotePtRoomBatchSetBo bo) throws Exception {
+    public Boolean batchSet(RemotePtRoomBatchSetBo bo) {
         return iPtRoomService.batchSet(BeanUtil.toBean(bo, PtRoomBatchSetBo.class));
     }
 

+ 1 - 3
ruoyi-modules/ruoyi-backstage/src/main/java/org/dromara/backstage/consumption/dubbo/RemoteXfDiscountServiceImpl.java

@@ -5,9 +5,7 @@ import lombok.RequiredArgsConstructor;
 import org.apache.dubbo.config.annotation.DubboService;
 import org.dromara.backstage.api.RemoteXfDiscountService;
 import org.dromara.backstage.api.domain.bo.RemoteXfDiscountBo;
-import org.dromara.backstage.api.domain.bo.RemoteXfDiscountTermBo;
 import org.dromara.backstage.consumption.domain.bo.XfDiscountBo;
-import org.dromara.backstage.consumption.domain.bo.XfDiscounttermBo;
 import org.dromara.backstage.consumption.service.IXfDiscountService;
 import org.dromara.backstage.consumption.service.IXfDiscounttermService;
 import org.springframework.stereotype.Service;
@@ -17,7 +15,7 @@ import java.util.List;
 
 /**
  * @author Hz
- * @date 2024/11/4
+ * {@code @date} 2024/11/4
  * @description
  */
 

+ 6 - 8
ruoyi-modules/ruoyi-backstage/src/main/java/org/dromara/backstage/payment/dubbo/RemoteBagServiceImpl.java

@@ -18,8 +18,6 @@ import org.dromara.common.core.domain.R;
 import org.dromara.common.core.enums.SystemUseTypeEnum;
 import org.springframework.stereotype.Service;
 
-import java.util.Arrays;
-
 /**
  * name: RemoteBagServiceImpl
  * package: org.dromara.backstage.dubbo
@@ -62,7 +60,7 @@ public class RemoteBagServiceImpl implements RemoteBagService {
 
     @Override
     public Boolean batchRecharge(RemotePurseInOutBo bo, Long[] userIds) {
-        StringBuffer errIds = new StringBuffer();
+        StringBuilder errIds = new StringBuilder();
         boolean flag = true;
         bo.setUseType(SystemUseTypeEnum.CONSUME);
         for(Long userId : userIds) {
@@ -73,14 +71,14 @@ public class RemoteBagServiceImpl implements RemoteBagService {
             }
         }
         if(!flag){
-            log.error("账户批量充值失败,失败用户ID:{}", Arrays.toString(userIds));
+            log.error("账户批量充值失败,失败用户ID:{}", errIds);
         }
         return flag;
     }
 
     @Override
     public Boolean batchRefund(RemotePurseInOutBo bo, Long[] userIds) {
-        StringBuffer errIds = new StringBuffer();
+        StringBuilder errIds = new StringBuilder();
         boolean flag = true;
         bo.setUseType(SystemUseTypeEnum.CONSUME);
         for(Long userId : userIds) {
@@ -91,14 +89,14 @@ public class RemoteBagServiceImpl implements RemoteBagService {
             }
         }
         if(!flag){
-            log.error("账户批量退款失败,失败用户ID:{}", Arrays.toString(userIds));
+            log.error("账户批量退款失败,失败用户ID:{}", errIds);
         }
         return flag;
     }
 
     @Override
     public Boolean batchSetBalance(RemotePurseInOutBo bo, Long[] userIds) {
-        StringBuffer errIds = new StringBuffer();
+        StringBuilder errIds = new StringBuilder();
         boolean flag = true;
         bo.setUseType(SystemUseTypeEnum.CONSUME);
         for(Long userId : userIds) {
@@ -109,7 +107,7 @@ public class RemoteBagServiceImpl implements RemoteBagService {
             }
         }
         if(!flag){
-            log.error("账户批量设置余额失败,失败用户ID:{}", Arrays.toString(userIds));
+            log.error("账户批量设置余额失败,失败用户ID:{}", errIds);
         }
         return flag;
     }

+ 0 - 3
ruoyi-server/ruoyi-server-base/src/main/java/org/dromara/server/base/service/yktOperation/SyncRemotePtAccountService.java

@@ -24,7 +24,6 @@ public class SyncRemotePtAccountService {
 
     /**
      * 远程调用结算账户新增
-     * @param msg
      */
     public void addPtAccount(Object msg) throws Exception{
         boolean flag = accountService.insertByBo(JSONUtil.parseObj(msg).toBean(RemotePtAccountBo.class));
@@ -35,7 +34,6 @@ public class SyncRemotePtAccountService {
 
     /**
      * 远程调用结算账户修改
-     * @param msg
      */
     public void editPtAccount(Object msg) throws Exception{
         boolean flag = accountService.updateByBo(JSONUtil.parseObj(msg).toBean(RemotePtAccountBo.class));
@@ -46,7 +44,6 @@ public class SyncRemotePtAccountService {
 
     /**
      * 远程调用结算账户删除
-     * @param msg
      */
     public void delPtAccount(Object msg) throws Exception{
         Collection<Long> ids = JSONUtil.parseArray(msg).toBean(Collection.class);

+ 0 - 6
ruoyi-server/ruoyi-server-base/src/main/java/org/dromara/server/base/service/yktOperation/SyncRemotePtAreaService.java

@@ -5,10 +5,7 @@ import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.dubbo.config.annotation.DubboReference;
 import org.dromara.backstage.api.RemotePtAreaService;
-import org.dromara.backstage.api.RemotePtRoomService;
 import org.dromara.backstage.api.domain.bo.RemotePtAreaBo;
-import org.dromara.backstage.api.domain.bo.RemotePtRoomBatchSetBo;
-import org.dromara.backstage.api.domain.bo.RemotePtRoomBo;
 import org.dromara.common.core.exception.ServiceException;
 import org.springframework.stereotype.Service;
 
@@ -27,7 +24,6 @@ public class SyncRemotePtAreaService {
 
     /**
      * 远程调用系统参数新增
-     * @param msg
      */
     public void addPtArea(Object msg) {
         boolean flag = areaService.insertByBo(JSONUtil.parseObj(msg).toBean(RemotePtAreaBo.class));
@@ -38,7 +34,6 @@ public class SyncRemotePtAreaService {
 
     /**
      * 远程调用系统参数修改
-     * @param msg
      */
     public void editPtArea(Object msg) throws Exception{
         boolean flag = areaService.updateByBo(JSONUtil.parseObj(msg).toBean(RemotePtAreaBo.class));
@@ -49,7 +44,6 @@ public class SyncRemotePtAreaService {
 
     /**
      * 远程调用系统参数删除
-     * @param msg
      */
     public void delPtArea(Object msg) throws Exception{
         Collection<Long> ids = JSONUtil.parseArray(msg).toBean(Collection.class);

+ 2 - 18
ruoyi-server/ruoyi-server-base/src/main/java/org/dromara/server/base/service/yktOperation/SyncRemotePtCardCenterService.java

@@ -6,15 +6,11 @@ import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.dubbo.config.annotation.DubboReference;
 import org.dromara.backstage.api.RemoteBagService;
-import org.dromara.backstage.api.RemoteMealTypeService;
 import org.dromara.backstage.api.domain.bo.RemoteConsumptionBo;
-import org.dromara.backstage.api.domain.bo.RemotePtMealTypeBo;
 import org.dromara.backstage.api.domain.bo.RemotePurseInOutBo;
 import org.dromara.common.core.exception.ServiceException;
 import org.springframework.stereotype.Service;
 
-import java.util.Collection;
-
 /**
  * 卡务中心卡务操作同步
  */
@@ -28,7 +24,6 @@ public class SyncRemotePtCardCenterService {
 
     /**
      * 远程调用充值
-     * @param msg
      */
     public void recharge(Object msg) throws ServiceException{
         boolean flag = bagService.recharge(JSONUtil.parseObj(msg).toBean(RemotePurseInOutBo.class));
@@ -39,10 +34,9 @@ public class SyncRemotePtCardCenterService {
 
     /**
      * 远程调用退款
-     * @param msg
      */
     public void refund(Object msg) throws ServiceException{
-        boolean flag = bagService.recharge(JSONUtil.parseObj(msg).toBean(RemotePurseInOutBo.class));
+        boolean flag = bagService.refund(JSONUtil.parseObj(msg).toBean(RemotePurseInOutBo.class));
         if (!flag){
             throw new ServiceException("退款失败");
         }
@@ -50,7 +44,6 @@ public class SyncRemotePtCardCenterService {
 
     /**
      * 远程调用错扣补款
-     * @param msg
      */
     public void errFill(Object msg) throws ServiceException{
         boolean flag = bagService.createErrFillRecord(JSONUtil.parseObj(msg).toBean(RemoteConsumptionBo.class));
@@ -60,7 +53,6 @@ public class SyncRemotePtCardCenterService {
     }
     /**
      * 远程调用批量充值
-     * @param msg
      */
     public void batchRecharge(Object msg) throws ServiceException{
         JSONObject msgObj = JSONUtil.parseObj(msg);
@@ -74,8 +66,6 @@ public class SyncRemotePtCardCenterService {
 
     /**
      * 远程调用批量退款
-     * @param msg
-     * @throws ServiceException
      */
     public void batchRefund(Object msg) throws ServiceException{
         JSONObject msgObj = JSONUtil.parseObj(msg);
@@ -89,14 +79,12 @@ public class SyncRemotePtCardCenterService {
 
     /**
      * 远程调用批量设置余额
-     * @param msg
-     * @throws ServiceException
      */
     public void batchSetBalance(Object msg) throws ServiceException{
         JSONObject msgObj = JSONUtil.parseObj(msg);
         RemotePurseInOutBo bo = msgObj.getJSONObject("bo").toBean(RemotePurseInOutBo.class);
         Long[] userIds = (Long[]) msgObj.get("userIds");
-        boolean flag = bagService.batchRecharge(bo, userIds);
+        boolean flag = bagService.batchSetBalance(bo, userIds);
         if (!flag){
             throw new ServiceException("批量设置余额失败");
         }
@@ -104,8 +92,6 @@ public class SyncRemotePtCardCenterService {
 
     /**
      * 远程调用卡片挂失
-     * @param msg
-     * @throws ServiceException
      */
     public void lockCard(Object msg) throws ServiceException{
         boolean flag = bagService.lockCard(JSONUtil.parseObj(msg).getLong("cardId"));
@@ -115,8 +101,6 @@ public class SyncRemotePtCardCenterService {
     }
     /**
      * 远程调用卡片解挂
-     * @param msg
-     * @throws ServiceException
      */
     public void unlockCard(Object msg) throws ServiceException{
         boolean flag = bagService.unlockCard(JSONUtil.parseObj(msg).getLong("cardId"));

+ 0 - 5
ruoyi-server/ruoyi-server-base/src/main/java/org/dromara/server/base/service/yktOperation/SyncRemotePtMealTypeService.java

@@ -5,9 +5,7 @@ import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.dubbo.config.annotation.DubboReference;
 import org.dromara.backstage.api.RemoteMealTypeService;
-import org.dromara.backstage.api.RemotePtParameterService;
 import org.dromara.backstage.api.domain.bo.RemotePtMealTypeBo;
-import org.dromara.backstage.api.domain.bo.RemotePtParameterBo;
 import org.dromara.common.core.exception.ServiceException;
 import org.springframework.stereotype.Service;
 
@@ -26,7 +24,6 @@ public class SyncRemotePtMealTypeService {
 
     /**
      * 远程调用系统参数新增
-     * @param msg
      */
     public void addPtMealType(Object msg) throws Exception{
         boolean flag = mealTypeService.insertByBo(JSONUtil.parseObj(msg).toBean(RemotePtMealTypeBo.class));
@@ -37,7 +34,6 @@ public class SyncRemotePtMealTypeService {
 
     /**
      * 远程调用系统参数修改
-     * @param msg
      */
     public void editPtMealType(Object msg) throws Exception{
         boolean flag = mealTypeService.updateByBo(JSONUtil.parseObj(msg).toBean(RemotePtMealTypeBo.class));
@@ -48,7 +44,6 @@ public class SyncRemotePtMealTypeService {
 
     /**
      * 远程调用系统参数删除
-     * @param msg
      */
     public void delPtMealType(Object msg) throws Exception{
         Collection<Long> ids = JSONUtil.parseArray(msg).toBean(Collection.class);

+ 0 - 3
ruoyi-server/ruoyi-server-base/src/main/java/org/dromara/server/base/service/yktOperation/SyncRemotePtParameterService.java

@@ -24,7 +24,6 @@ public class SyncRemotePtParameterService {
 
     /**
      * 远程调用系统参数新增
-     * @param msg
      */
     public void addPtParameter(Object msg) throws Exception{
         boolean flag = remotePtParameterService.insertByBo(JSONUtil.parseObj(msg).toBean(RemotePtParameterBo.class));
@@ -35,7 +34,6 @@ public class SyncRemotePtParameterService {
 
     /**
      * 远程调用系统参数修改
-     * @param msg
      */
     public void editPtParameter(Object msg) throws Exception{
         boolean flag = remotePtParameterService.updateByBo(JSONUtil.parseObj(msg).toBean(RemotePtParameterBo.class));
@@ -46,7 +44,6 @@ public class SyncRemotePtParameterService {
 
     /**
      * 远程调用系统参数删除
-     * @param msg
      */
     public void delPtParameter(Object msg) throws Exception{
         Collection<Long> ids = JSONUtil.parseArray(msg).toBean(Collection.class);

+ 4 - 4
ruoyi-server/ruoyi-server-base/src/main/java/org/dromara/server/base/service/yktOperation/SyncRemotePtRoomService.java

@@ -25,7 +25,6 @@ public class SyncRemotePtRoomService {
 
     /**
      * 远程调用系统参数新增
-     * @param msg
      */
     public void addPtRoom(Object msg) throws Exception{
         boolean flag = roomService.insertByBo(JSONUtil.parseObj(msg).toBean(RemotePtRoomBo.class));
@@ -36,7 +35,6 @@ public class SyncRemotePtRoomService {
 
     /**
      * 远程调用系统参数修改
-     * @param msg
      */
     public void editPtRoom(Object msg) throws Exception{
         boolean flag = roomService.updateByBo(JSONUtil.parseObj(msg).toBean(RemotePtRoomBo.class));
@@ -47,7 +45,6 @@ public class SyncRemotePtRoomService {
 
     /**
      * 远程调用系统参数删除
-     * @param msg
      */
     public void delPtRoom(Object msg) throws Exception{
         Collection<Long> ids = JSONUtil.parseArray(msg).toBean(Collection.class);
@@ -57,7 +54,10 @@ public class SyncRemotePtRoomService {
         }
     }
 
-    public void batchSet(Object msg) throws Exception{
+    /**
+     * 远程调用房间批量设置
+     */
+    public void batchSet(Object msg) throws ServiceException{
         boolean flag = roomService.batchSet(JSONUtil.parseObj(msg).toBean(RemotePtRoomBatchSetBo.class));
         if (!flag){
             throw new ServiceException("房间批量设置失败");

+ 2 - 7
ruoyi-server/ruoyi-server-base/src/main/java/org/dromara/server/base/service/yktOperation/SyncRemotePtUserAccountService.java

@@ -10,6 +10,8 @@ import org.dromara.backstage.api.domain.bo.RemoteUserAccountBo;
 import org.dromara.common.core.exception.ServiceException;
 import org.springframework.stereotype.Service;
 
+import java.util.Arrays;
+
 /**
  * 结算账户同步
  */
@@ -23,7 +25,6 @@ public class SyncRemotePtUserAccountService {
 
     /**
      * 远程调用开户
-     * @param msg
      */
     public void openUserAccount(Object msg) throws ServiceException{
         Long[] ids = JSONUtil.parseArray(msg).toArray(Long[]::new);
@@ -35,7 +36,6 @@ public class SyncRemotePtUserAccountService {
 
     /**
      * 远程调用结算账户修改
-     * @param msg
      */
     public void closeUserAccount(Object msg) throws ServiceException{
         Long[] ids = JSONUtil.parseArray(msg).toArray(Long[]::new);
@@ -47,7 +47,6 @@ public class SyncRemotePtUserAccountService {
 
     /**
      * 远程调用账户冻结/解冻
-     * @param msg
      */
     public void updateFreezeStatus(Object msg) throws ServiceException{
         JSONObject msgObj = JSONUtil.parseObj(msg);
@@ -61,7 +60,6 @@ public class SyncRemotePtUserAccountService {
 
     /**
      * 远程调用重置有效期
-     * @param msg
      */
     public void resetTime(Object msg) throws ServiceException{
         JSONObject msgObj = JSONUtil.parseObj(msg);
@@ -75,7 +73,6 @@ public class SyncRemotePtUserAccountService {
 
     /**
      * 远程调用重置卡类
-     * @param msg
      */
     public void resetCardType(Object msg) throws ServiceException{
         JSONObject msgObj = JSONUtil.parseObj(msg);
@@ -89,8 +86,6 @@ public class SyncRemotePtUserAccountService {
 
     /**
      * 新增账户
-     * @param msg
-     * @throws ServiceException
      */
     public void addUserAccount(Object msg) throws ServiceException{
        userAccountService.insertByBo(JSONUtil.toBean(msg.toString(), RemoteUserAccountBo.class));

+ 0 - 10
ruoyi-server/ruoyi-server-base/src/main/java/org/dromara/server/base/service/yktOperation/SyncRemoteXfDiscountService.java

@@ -4,11 +4,8 @@ import cn.hutool.json.JSONUtil;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.dubbo.config.annotation.DubboReference;
-import org.dromara.backstage.api.RemotePtAreaService;
 import org.dromara.backstage.api.RemoteXfDiscountService;
-import org.dromara.backstage.api.domain.bo.RemotePtAreaBo;
 import org.dromara.backstage.api.domain.bo.RemoteXfDiscountBo;
-import org.dromara.backstage.api.domain.bo.RemoteXfDiscountTermBo;
 import org.dromara.common.core.exception.ServiceException;
 import org.springframework.stereotype.Service;
 
@@ -27,7 +24,6 @@ public class SyncRemoteXfDiscountService {
 
     /**
      * 远程调用消费折扣新增
-     * @param msg
      */
     public void addXfDiscount(Object msg) throws Exception{
         boolean flag = xfDiscountService.insertByBo(JSONUtil.parseObj(msg).toBean(RemoteXfDiscountBo.class));
@@ -38,7 +34,6 @@ public class SyncRemoteXfDiscountService {
 
     /**
      * 远程调用消费折扣修改
-     * @param msg
      */
     public void editXfDiscount(Object msg) throws Exception{
         boolean flag = xfDiscountService.updateByBo(JSONUtil.parseObj(msg).toBean(RemoteXfDiscountBo.class));
@@ -49,7 +44,6 @@ public class SyncRemoteXfDiscountService {
 
     /**
      * 远程调用消费折扣删除
-     * @param msg
      */
     public void delXfDiscount(Object msg) throws Exception{
         Collection<Long> ids = JSONUtil.parseArray(msg).toBean(Collection.class);
@@ -61,8 +55,6 @@ public class SyncRemoteXfDiscountService {
 
     /**
      * 远程调用消费折扣设备新增
-     * @param msg
-     * @throws ServiceException
      */
     public void addDiscountTerm(Object msg) throws ServiceException{
         boolean flag = xfDiscountService.addDiscountTerm(JSONUtil.parseArray(msg).toList(Long.class));
@@ -72,8 +64,6 @@ public class SyncRemoteXfDiscountService {
     }
     /**
      * 远程调用消费折扣设备删除
-     * @param msg
-     * @throws ServiceException
      */
     public void deleteDiscountTerm(Object msg) throws ServiceException{
         boolean flag = xfDiscountService.deleteDiscountTerm(JSONUtil.parseArray(msg).toList(Long.class));

+ 4 - 3
ruoyi-server/ruoyi-server-base/src/main/java/org/dromara/server/base/service/yktOperation/SyncRemoteXfTermService.java

@@ -25,7 +25,6 @@ public class SyncRemoteXfTermService {
 
     /**
      * 远程调用系统参数新增
-     * @param msg
      */
     public void addPtXfTerm(Object msg) {
         boolean flag = xfTermService.insertByBo(JSONUtil.parseObj(msg).toBean(RemoteXfTermBo.class));
@@ -36,7 +35,6 @@ public class SyncRemoteXfTermService {
 
     /**
      * 远程调用系统参数修改
-     * @param msg
      */
     public void editPtXfTerm(Object msg) throws Exception{
         boolean flag = xfTermService.updateByBo(JSONUtil.parseObj(msg).toBean(RemoteXfTermBo.class));
@@ -47,7 +45,6 @@ public class SyncRemoteXfTermService {
 
     /**
      * 远程调用系统参数删除
-     * @param msg
      */
     public void delPtXfTerm(Object msg) throws Exception{
         Collection<Long> ids = JSONUtil.parseArray(msg).toBean(Collection.class);
@@ -56,6 +53,10 @@ public class SyncRemoteXfTermService {
             throw new ServiceException("区域删除失败");
         }
     }
+
+    /**
+     * 远程调用设备参数修改
+     */
     public void editParam(Object msg) throws ServiceException{
         boolean flag = xfTermService.editParam(JSONUtil.parseObj(msg).toBean(RemoteXfTermParamBo.class));
         if (!flag){

+ 4 - 15
ruoyi-server/ruoyi-server-mqdata/src/main/java/org/dromara/server/mq/event/kafka/impl/yktOperation/PtAccountEventStrategyImpl.java

@@ -22,21 +22,10 @@ public class PtAccountEventStrategyImpl implements IYktEventStrategy {
     public void doMsgHandle(String eventType, Object msg) throws Exception{
 
         switch (eventType) {
-            case MessageEventTypeConstants.ptAccount_ADD:{
-                accountService.addPtAccount(msg);
-            }
-            break;
-            case MessageEventTypeConstants.ptAccount_EDIT:{
-                accountService.editPtAccount(msg);
-            }
-            break;
-            case MessageEventTypeConstants.ptAccount_REMOVE:{
-                accountService.delPtAccount(msg);
-            }
-            break;
-            default:
-                log.info("未知事件");
-
+            case MessageEventTypeConstants.ptAccount_ADD -> accountService.addPtAccount(msg);
+            case MessageEventTypeConstants.ptAccount_EDIT -> accountService.editPtAccount(msg);
+            case MessageEventTypeConstants.ptAccount_REMOVE -> accountService.delPtAccount(msg);
+            default -> log.info("未知事件");
         }
     }
 

+ 4 - 16
ruoyi-server/ruoyi-server-mqdata/src/main/java/org/dromara/server/mq/event/kafka/impl/yktOperation/PtAreaEventStrategyImpl.java

@@ -4,7 +4,6 @@ import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.dromara.common.message.kafka.constant.MessageEventTypeConstants;
 import org.dromara.server.base.service.yktOperation.SyncRemotePtAreaService;
-import org.dromara.server.base.service.yktOperation.SyncRemotePtRoomService;
 import org.dromara.server.mq.event.kafka.IYktEventStrategy;
 import org.springframework.stereotype.Service;
 
@@ -23,21 +22,10 @@ public class PtAreaEventStrategyImpl implements IYktEventStrategy {
     public void doMsgHandle(String eventType, Object msg) throws Exception{
 
         switch (eventType) {
-            case MessageEventTypeConstants.ptArea_ADD:{
-                areaService.addPtArea(msg);
-            }
-            break;
-            case MessageEventTypeConstants.ptArea_EDIT:{
-                areaService.editPtArea(msg);
-            }
-            break;
-            case MessageEventTypeConstants.ptArea_REMOVE:{
-                areaService.delPtArea(msg);
-            }
-            break;
-            default:
-                log.info("未知事件");
-
+            case MessageEventTypeConstants.ptArea_ADD -> areaService.addPtArea(msg);
+            case MessageEventTypeConstants.ptArea_EDIT -> areaService.editPtArea(msg);
+            case MessageEventTypeConstants.ptArea_REMOVE -> areaService.delPtArea(msg);
+            default -> log.info("未知事件");
         }
     }
 

+ 9 - 34
ruoyi-server/ruoyi-server-mqdata/src/main/java/org/dromara/server/mq/event/kafka/impl/yktOperation/PtCardCenterEventStrategyImpl.java

@@ -22,40 +22,15 @@ public class PtCardCenterEventStrategyImpl implements IYktEventStrategy {
     public void doMsgHandle(String eventType, Object msg) throws Exception{
 
         switch (eventType) {
-            case MessageEventTypeConstants.ptCard_CHARGE_EDIT:{
-                cardCenterService.recharge(msg);
-            }
-            break;
-            case MessageEventTypeConstants.ptCard_refund_EDIT:{
-                cardCenterService.refund(msg);
-            }
-            break;
-            case MessageEventTypeConstants.ptCard_supply_EDIT:{
-                cardCenterService.errFill(msg);
-            }
-            break;
-            case MessageEventTypeConstants.ptCard_multicharge_EDIT:{
-                cardCenterService.batchRecharge(msg);
-            }
-            break;
-            case MessageEventTypeConstants.ptCard_multirefund_EDIT:{
-                cardCenterService.batchRefund(msg);
-            }
-            break;
-            case MessageEventTypeConstants.ptCard_multiSet_EDIT:{
-                cardCenterService.batchSetBalance(msg);
-            }
-            break;
-            case MessageEventTypeConstants.ptCard_CARD_LOCK:{
-                cardCenterService.lockCard(msg);
-            }
-            break;
-            case MessageEventTypeConstants.ptCard_CARD_UNLOCK:{
-                cardCenterService.unlockCard(msg);
-            }
-            default:
-                log.info("未知事件");
-
+            case MessageEventTypeConstants.ptCard_CHARGE_EDIT -> cardCenterService.recharge(msg);
+            case MessageEventTypeConstants.ptCard_refund_EDIT -> cardCenterService.refund(msg);
+            case MessageEventTypeConstants.ptCard_supply_EDIT -> cardCenterService.errFill(msg);
+            case MessageEventTypeConstants.ptCard_multicharge_EDIT -> cardCenterService.batchRecharge(msg);
+            case MessageEventTypeConstants.ptCard_multirefund_EDIT -> cardCenterService.batchRefund(msg);
+            case MessageEventTypeConstants.ptCard_multiSet_EDIT -> cardCenterService.batchSetBalance(msg);
+            case MessageEventTypeConstants.ptCard_CARD_LOCK -> cardCenterService.lockCard(msg);
+            case MessageEventTypeConstants.ptCard_CARD_UNLOCK -> cardCenterService.unlockCard(msg);
+            default -> log.info("未知事件");
         }
     }
 

+ 4 - 15
ruoyi-server/ruoyi-server-mqdata/src/main/java/org/dromara/server/mq/event/kafka/impl/yktOperation/PtMealTypeEventStrategyImpl.java

@@ -22,21 +22,10 @@ public class PtMealTypeEventStrategyImpl implements IYktEventStrategy {
     public void doMsgHandle(String eventType, Object msg) throws Exception{
 
         switch (eventType) {
-            case MessageEventTypeConstants.ptMealtype_ADD:{
-                mealTypeService.addPtMealType(msg);
-            }
-            break;
-            case MessageEventTypeConstants.ptMealtype_EDIT:{
-                mealTypeService.editPtMealType(msg);
-            }
-            break;
-            case MessageEventTypeConstants.ptMealtype_REMOVE:{
-                mealTypeService.delPtMealType(msg);
-            }
-            break;
-            default:
-                log.info("未知事件");
-
+            case MessageEventTypeConstants.ptMealtype_ADD -> mealTypeService.addPtMealType(msg);
+            case MessageEventTypeConstants.ptMealtype_EDIT -> mealTypeService.editPtMealType(msg);
+            case MessageEventTypeConstants.ptMealtype_REMOVE -> mealTypeService.delPtMealType(msg);
+            default -> log.info("未知事件");
         }
     }
 

+ 4 - 15
ruoyi-server/ruoyi-server-mqdata/src/main/java/org/dromara/server/mq/event/kafka/impl/yktOperation/PtParameterEventStrategyImpl.java

@@ -22,21 +22,10 @@ public class PtParameterEventStrategyImpl implements IYktEventStrategy {
     public void doMsgHandle(String eventType, Object msg) throws Exception{
 
         switch (eventType) {
-            case MessageEventTypeConstants.ptParameter_ADD :{
-                parameterService.addPtParameter(msg);
-            }
-            break;
-            case MessageEventTypeConstants.ptParameter_EDIT:{
-                parameterService.editPtParameter(msg);
-            }
-            break;
-            case MessageEventTypeConstants.ptParameter_REMOVE:{
-                parameterService.delPtParameter(msg);
-            }
-            break;
-            default:
-                log.info("未知事件");
-
+            case MessageEventTypeConstants.ptParameter_ADD -> parameterService.addPtParameter(msg);
+            case MessageEventTypeConstants.ptParameter_EDIT -> parameterService.editPtParameter(msg);
+            case MessageEventTypeConstants.ptParameter_REMOVE -> parameterService.delPtParameter(msg);
+            default -> log.info("未知事件");
         }
     }
 

+ 5 - 19
ruoyi-server/ruoyi-server-mqdata/src/main/java/org/dromara/server/mq/event/kafka/impl/yktOperation/PtRoomEventStrategyImpl.java

@@ -22,25 +22,11 @@ public class PtRoomEventStrategyImpl implements IYktEventStrategy {
     public void doMsgHandle(String eventType, Object msg) throws Exception{
 
         switch (eventType) {
-            case MessageEventTypeConstants.ptRoom_ADD:{
-                roomService.addPtRoom(msg);
-            }
-            break;
-            case MessageEventTypeConstants.ptRoom_EDIT:{
-                roomService.editPtRoom(msg);
-            }
-            break;
-            case MessageEventTypeConstants.ptRoom_REMOVE:{
-                roomService.delPtRoom(msg);
-            }
-            break;
-            case MessageEventTypeConstants.ptRoom_SET:{
-                roomService.batchSet(msg);
-            }
-            break;
-            default:
-                log.info("未知事件");
-
+            case MessageEventTypeConstants.ptRoom_ADD -> roomService.addPtRoom(msg);
+            case MessageEventTypeConstants.ptRoom_EDIT -> roomService.editPtRoom(msg);
+            case MessageEventTypeConstants.ptRoom_REMOVE -> roomService.delPtRoom(msg);
+            case MessageEventTypeConstants.ptRoom_SET -> roomService.batchSet(msg);
+            default -> log.info("未知事件");
         }
     }
 

+ 7 - 27
ruoyi-server/ruoyi-server-mqdata/src/main/java/org/dromara/server/mq/event/kafka/impl/yktOperation/PtUserAccountEventStrategyImpl.java

@@ -22,33 +22,13 @@ public class PtUserAccountEventStrategyImpl implements IYktEventStrategy {
     public void doMsgHandle(String eventType, Object msg) throws Exception{
 
         switch (eventType) {
-            case MessageEventTypeConstants.ptUserAccount_OPEN_EDIT:{
-                userAccountService.openUserAccount(msg);
-            }
-            break;
-            case MessageEventTypeConstants.ptUserAccount_CLOSE_EDIT:{
-                userAccountService.closeUserAccount(msg);
-            }
-            break;
-            case MessageEventTypeConstants.ptUserAccount_FREEZE_EDIT:{
-                userAccountService.updateFreezeStatus(msg);
-            }
-            break;
-            case MessageEventTypeConstants.ptUserAccount_RESETTIME_EDIT:{
-                userAccountService.resetTime(msg);
-            }
-            break;
-            case MessageEventTypeConstants.ptUserAccount_RESETTYPE_EDIT:{
-                userAccountService.resetCardType(msg);
-            }
-            break;
-            case MessageEventTypeConstants.user_ADD:{
-                userAccountService.addUserAccount(msg);
-            }
-            break;
-            default:
-                log.info("未知事件");
-
+            case MessageEventTypeConstants.ptUserAccount_OPEN_EDIT -> userAccountService.openUserAccount(msg);
+            case MessageEventTypeConstants.ptUserAccount_CLOSE_EDIT -> userAccountService.closeUserAccount(msg);
+            case MessageEventTypeConstants.ptUserAccount_FREEZE_EDIT -> userAccountService.updateFreezeStatus(msg);
+            case MessageEventTypeConstants.ptUserAccount_RESETTIME_EDIT -> userAccountService.resetTime(msg);
+            case MessageEventTypeConstants.ptUserAccount_RESETTYPE_EDIT -> userAccountService.resetCardType(msg);
+            case MessageEventTypeConstants.user_ADD -> userAccountService.addUserAccount(msg);
+            default -> log.info("未知事件");
         }
     }
 

+ 6 - 22
ruoyi-server/ruoyi-server-mqdata/src/main/java/org/dromara/server/mq/event/kafka/impl/yktOperation/PtXfDiscountEventStrategyImpl.java

@@ -3,7 +3,6 @@ package org.dromara.server.mq.event.kafka.impl.yktOperation;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.dromara.common.message.kafka.constant.MessageEventTypeConstants;
-import org.dromara.server.base.service.yktOperation.SyncRemotePtAreaService;
 import org.dromara.server.base.service.yktOperation.SyncRemoteXfDiscountService;
 import org.dromara.server.mq.event.kafka.IYktEventStrategy;
 import org.springframework.stereotype.Service;
@@ -23,27 +22,12 @@ public class PtXfDiscountEventStrategyImpl implements IYktEventStrategy {
     public void doMsgHandle(String eventType, Object msg) throws Exception{
 
         switch (eventType) {
-            case MessageEventTypeConstants.xfDiscount_ADD:{
-                discountService.addXfDiscount(msg);
-            }
-            break;
-            case MessageEventTypeConstants.xfDiscount_EDIT:{
-                discountService.editXfDiscount(msg);
-            }
-            break;
-            case MessageEventTypeConstants.xfDiscount_REMOVE:{
-                discountService.delXfDiscount(msg);
-            }
-            break;
-            case MessageEventTypeConstants.DISCOUNT_TERM_ADD:{
-                discountService.addDiscountTerm(msg);
-            }
-            break;
-            case MessageEventTypeConstants.DISCOUNT_TERM_DEL:{
-                discountService.deleteDiscountTerm(msg);
-            }
-            default:
-                log.info("未知事件");
+            case MessageEventTypeConstants.xfDiscount_ADD -> discountService.addXfDiscount(msg);
+            case MessageEventTypeConstants.xfDiscount_EDIT -> discountService.editXfDiscount(msg);
+            case MessageEventTypeConstants.xfDiscount_REMOVE -> discountService.delXfDiscount(msg);
+            case MessageEventTypeConstants.DISCOUNT_TERM_ADD -> discountService.addDiscountTerm(msg);
+            case MessageEventTypeConstants.DISCOUNT_TERM_DEL -> discountService.deleteDiscountTerm(msg);
+            default -> log.info("未知事件");
 
         }
     }

+ 5 - 17
ruoyi-server/ruoyi-server-mqdata/src/main/java/org/dromara/server/mq/event/kafka/impl/yktOperation/PtXfTermEventStrategyImpl.java

@@ -22,23 +22,11 @@ public class PtXfTermEventStrategyImpl implements IYktEventStrategy {
     public void doMsgHandle(String eventType, Object msg) throws Exception{
 
         switch (eventType) {
-            case MessageEventTypeConstants.xfTerm_ADD:{
-                xfTermService.addPtXfTerm(msg);
-            }
-            break;
-            case MessageEventTypeConstants.xfTerm_EDIT:{
-                xfTermService.editPtXfTerm(msg);
-            }
-            break;
-            case MessageEventTypeConstants.xfTerm_REMOVE:{
-                xfTermService.delPtXfTerm(msg);
-            }
-            break;
-            case MessageEventTypeConstants.xfTerm_param_EDIT:{
-                xfTermService.editParam(msg);
-            }
-            default:
-                log.info("未知事件");
+            case MessageEventTypeConstants.xfTerm_ADD -> xfTermService.addPtXfTerm(msg);
+            case MessageEventTypeConstants.xfTerm_EDIT -> xfTermService.editPtXfTerm(msg);
+            case MessageEventTypeConstants.xfTerm_REMOVE -> xfTermService.delPtXfTerm(msg);
+            case MessageEventTypeConstants.xfTerm_param_EDIT -> xfTermService.editParam(msg);
+            default -> log.info("未知事件");
 
         }
     }