Эх сурвалжийг харах

fix(管理平台): 自助挂失卡片后更新缓存

autumnal_wind 9 сар өмнө
parent
commit
fe9fc609cb

+ 2 - 2
pom.xml

@@ -88,7 +88,7 @@
             </properties>
             </properties>
             <activation>
             <activation>
                 <!-- 默认环境 -->
                 <!-- 默认环境 -->
-                <activeByDefault>false</activeByDefault>
+                <activeByDefault>true</activeByDefault>
             </activation>
             </activation>
         </profile>
         </profile>
         <profile>
         <profile>
@@ -112,7 +112,7 @@
             </properties>
             </properties>
             <activation>
             <activation>
                 <!-- 默认环境 -->
                 <!-- 默认环境 -->
-                <activeByDefault>true</activeByDefault>
+                <activeByDefault>false</activeByDefault>
             </activation>
             </activation>
         </profile>
         </profile>
     </profiles>
     </profiles>

+ 8 - 3
ruoyi-modules/ruoyi-backstage/src/main/java/org/dromara/backstage/business/self/TraineeBusiness.java

@@ -54,6 +54,7 @@ import org.dromara.hotel.api.service.RemoteOrderService;
 import org.dromara.hotel.api.service.RemoteTeamService;
 import org.dromara.hotel.api.service.RemoteTeamService;
 import org.dromara.system.api.RemoteDeptService;
 import org.dromara.system.api.RemoteDeptService;
 import org.dromara.system.api.domain.vo.RemoteDeptVo;
 import org.dromara.system.api.domain.vo.RemoteDeptVo;
+import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
 import java.util.ArrayList;
 import java.util.ArrayList;
@@ -94,6 +95,8 @@ public class TraineeBusiness {
 
 
     private final DefaultConfig defaultConfig;
     private final DefaultConfig defaultConfig;
 
 
+    private final ThreadPoolTaskExecutor threadPoolTaskExecutor;
+
     /**
     /**
      * 获取报到学员信息
      * 获取报到学员信息
      *
      *
@@ -366,9 +369,9 @@ public class TraineeBusiness {
         remoteBo.setOrderStatus(HotelBusinessConstants.ORDER_STATUS_RZ);
         remoteBo.setOrderStatus(HotelBusinessConstants.ORDER_STATUS_RZ);
         remoteBo.setUpdatedBy(Long.valueOf(bo.getUserId()));
         remoteBo.setUpdatedBy(Long.valueOf(bo.getUserId()));
         //todo 自助报到,修改房态时没有租户id,所以暂时写一个默认的租户
         //todo 自助报到,修改房态时没有租户id,所以暂时写一个默认的租户
-        if(StringUtils.isNotEmpty(bo.getTenantId())){
+        if (StringUtils.isNotEmpty(bo.getTenantId())) {
             remoteBo.setTenantId(bo.getTenantId());
             remoteBo.setTenantId(bo.getTenantId());
-        }else{
+        } else {
             remoteBo.setTenantId(defaultConfig.getTenantId());
             remoteBo.setTenantId(defaultConfig.getTenantId());
         }
         }
 
 
@@ -457,7 +460,9 @@ public class TraineeBusiness {
         traineeCheckIn.setPayStatus(true);
         traineeCheckIn.setPayStatus(true);
         traineeCheckIn.setPayDate(DateUtil.format(bo.getCheckInDate(), DefaultConstants.DATE_TIME_FORMAT));
         traineeCheckIn.setPayDate(DateUtil.format(bo.getCheckInDate(), DefaultConstants.DATE_TIME_FORMAT));
 
 
-        kafkaProducer.sendKafkaMessage(KafkaTopicConstants.OLD_SYNC_TOPIC, EventTypeConstants.REGISTER_STATUS, EventSenderConstants.YKT, traineeCheckIn);
+        threadPoolTaskExecutor.execute(() ->
+            kafkaProducer.sendKafkaMessage(KafkaTopicConstants.OLD_SYNC_TOPIC, EventTypeConstants.REGISTER_STATUS, EventSenderConstants.YKT, traineeCheckIn)
+        );
     }
     }
 
 
     public YcLockCardVo queryLockCardInfo(Map<String, Object> mapQuery) {
     public YcLockCardVo queryLockCardInfo(Map<String, Object> mapQuery) {

+ 2 - 0
ruoyi-modules/ruoyi-backstage/src/main/java/org/dromara/backstage/cardCenter/service/impl/PtCardServiceImpl.java

@@ -479,6 +479,8 @@ public class PtCardServiceImpl implements IPtCardService {
             List<PtCardVo> list = this.queryList(bo);
             List<PtCardVo> list = this.queryList(bo);
             remoteCardDataService.lockCard(HexUtil.toHex(bo.getFactoryId()));
             remoteCardDataService.lockCard(HexUtil.toHex(bo.getFactoryId()));
             if (CollectionUtil.isNotEmpty(list)) {
             if (CollectionUtil.isNotEmpty(list)) {
+                // 挂失后需要更新缓存
+                resetCardCache(list.get(0).getCardId());
                 return list.get(0);
                 return list.get(0);
             }
             }
         }
         }