Quellcode durchsuchen

解禁用户校验用户已被其他监听解锁

marxjaw vor 2 Monaten
Ursprung
Commit
d0a389aa38

+ 6 - 1
yt-risk/risk-manage/src/main/java/com/ytpm/dao/RiskManageMapper.java

@@ -1,6 +1,5 @@
 package com.ytpm.dao;
 
-import com.ytpm.agent.model.YtAppUser;
 import com.ytpm.agent.model.YtPlatformBanned;
 import com.ytpm.agent.model.YtPlatformDeblocking;
 import com.ytpm.risk.param.RiskBannedListParam;
@@ -25,6 +24,12 @@ public interface RiskManageMapper {
      */
     List<RiskDeblockingListView> getDeblockingList(RiskDeblockingListParam param);
 
+    /**
+     * 查询封禁时间之后的解禁记录
+     */
+    List<RiskDeblockingListView> getDeblockByBanned(@Param("bannedId")String bannedId,@Param("userId")String userId
+            ,@Param("bannedTime")Date bannedTime);
+
     /**
      * 查询用户最新的封禁记录
      */

+ 5 - 0
yt-risk/risk-manage/src/main/java/com/ytpm/service/impl/RiskServiceImpl.java

@@ -822,6 +822,11 @@ public class RiskServiceImpl extends ReflectUtil implements RiskService {
     public void addDeblockingRecord(String userId) {
         YtPlatformBanned lastBanned = riskManageMapper.getLastBanned(userId);
         if(Objects.isNull(lastBanned))return;
+        //查询封禁是否有解,有解则无需再解
+        List<RiskDeblockingListView> deblockByBanned =
+                riskManageMapper.getDeblockByBanned(lastBanned.getBannedId(), lastBanned.getUserId(), lastBanned.getBannedTime());
+        if(CollUtil.isNotEmpty(deblockByBanned))return;
+
         YtPlatformDeblocking deblocking = new YtPlatformDeblocking();
         deblocking.setDeblockingId(IdUtil.fastSimpleUUID());
         deblocking.setAgentId(lastBanned.getAgentId());

+ 6 - 0
yt-risk/risk-manage/src/main/resources/mapper/RiskManageMapper.xml

@@ -216,6 +216,12 @@
         where user_id = #{userId}
         and DATE(deblocking_time) = CURRENT_DATE()
     </select>
+    <select id="getDeblockByBanned" resultType="com.ytpm.risk.view.RiskDeblockingListView">
+        select
+            deblocking_id, banned_id, user_id, app_id, channel_id, agent_id, deblocking_time, deblocking_reason, operator, operator_name
+        from yt_platform_deblocking
+        where user_id = #{userId} and banned_id = #{bannedId} and deblocking_time > #{bannedTime}
+    </select>
 
 
 </mapper>