skyline 1 долоо хоног өмнө
parent
commit
c5dff2daf9

+ 3 - 10
car-wash-service/src/main/java/com/kym/service/awoara/event/handle/OrderCloseEventHandler.java

@@ -7,7 +7,6 @@ import com.kym.service.*;
 import com.kym.service.cache.KymCache;
 import com.kym.service.factory.DiscountStrategyFactory;
 import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -30,26 +29,20 @@ public class OrderCloseEventHandler implements AwoaraEventHandler<OrderInfoObjec
     private final WashOrderService washOrderService;
     private final WalletDetailService walletDetailService;
     private final AccountService accountService;
-    private final StationAccountService stationAccountService;
     private final SplitRecordService splitRecordService;
 
     private final MpMsgTemplateService mpMsgTemplateService;
 
-    private final StationAccountRecordService stationAccountRecordService;
 
     public OrderCloseEventHandler(WashOrderService washOrderService, WalletDetailService walletDetailService,
-                                  AccountService accountService, StationAccountService stationAccountService,
-                                  SplitRecordService splitRecordService,
-                                  StationAccountRecordService stationAccountRecordService, MpMsgTemplateService mpMsgTemplateService,
-                                    String domain) {
+                                  AccountService accountService, SplitRecordService splitRecordService,
+                                  MpMsgTemplateService mpMsgTemplateService,String domain) {
         DOMAIN = domain;
         this.washOrderService = washOrderService;
         this.walletDetailService = walletDetailService;
         this.accountService = accountService;
-        this.stationAccountService = stationAccountService;
         this.splitRecordService = splitRecordService;
         this.mpMsgTemplateService = mpMsgTemplateService;
-        this.stationAccountRecordService = stationAccountRecordService;
     }
 
 
@@ -148,7 +141,7 @@ public class OrderCloseEventHandler implements AwoaraEventHandler<OrderInfoObjec
         // 判断消费金额是否达标,达标发送领取停车优惠券消息
         if (orderInfo.getAmount() >= WashOrder.PARKING_COUPON_MIN_AMOUNT) {
             var parkingCouponUrl = KymCache.INSTANCE.getParkingQrCodeUrlByStationId(washOrder.getStationId());
-            // 维码链接做转换防止重复使用,有效期2小时
+            // 维码链接做转换防止重复使用,有效期2小时
             var code = UUID.randomUUID().toString();
             KymCache.INSTANCE.setParkingCouponCode(code, parkingCouponUrl, 3600*2L);
             var url = DOMAIN + "/api/parking-coupon?code=" + code;

+ 2 - 7
car-wash-service/src/main/java/com/kym/service/awoara/factory/AwoaraEventHandlerFactory.java

@@ -22,25 +22,20 @@ public class AwoaraEventHandlerFactory {
     private static WalletDetailService walletDetailService;
     private static AccountService accountService;
 
-    private static StationAccountService stationAccountService;
     private static SplitRecordService splitRecordService;
 
-    private static StationAccountRecordService stationAccountRecordService;
 
     private static MpMsgTemplateService mpMsgTemplateService;
 
     public AwoaraEventHandlerFactory(WashDeviceService washDeviceService, WashOrderService washOrderService, WalletDetailService walletDetailService,
-                                     AccountService accountService, StationAccountService stationAccountService, SplitRecordService splitRecordService,
-                                     StationAccountRecordService stationAccountRecordService, MpMsgTemplateService mpMsgTemplateService,
+                                     AccountService accountService, SplitRecordService splitRecordService, MpMsgTemplateService mpMsgTemplateService,
     @Value("${kym.domain}") String domain) {
         DOMAIN = domain;
         AwoaraEventHandlerFactory.washDeviceService = washDeviceService;
         AwoaraEventHandlerFactory.washOrderService = washOrderService;
         AwoaraEventHandlerFactory.walletDetailService = walletDetailService;
         AwoaraEventHandlerFactory.accountService = accountService;
-        AwoaraEventHandlerFactory.stationAccountService = stationAccountService;
         AwoaraEventHandlerFactory.splitRecordService = splitRecordService;
-        AwoaraEventHandlerFactory.stationAccountRecordService = stationAccountRecordService;
         AwoaraEventHandlerFactory.mpMsgTemplateService = mpMsgTemplateService;
     }
 
@@ -53,7 +48,7 @@ public class AwoaraEventHandlerFactory {
                 case order_create -> new OrderCreateEventHandler(washOrderService);
                 case order_update -> new OrderUpdateEventHandler(washOrderService);
                 case order_close ->
-                        new OrderCloseEventHandler(washOrderService, walletDetailService, accountService, stationAccountService, splitRecordService, stationAccountRecordService, mpMsgTemplateService,DOMAIN);
+                        new OrderCloseEventHandler(washOrderService, walletDetailService, accountService, splitRecordService, mpMsgTemplateService,DOMAIN);
                 case user_login -> new UserLoginEventHandler();
                 case card_event -> new CardEventHandler();
             };