Browse Source

增加hhlocal设备获取黑名单列表逻辑

王鑫刚 2 months ago
parent
commit
8f2ded470a

+ 1 - 0
src/main/java/cn/hanghui/outapi/platform/tenant/entity/enums/DeviceTypeEnum.java

@@ -19,6 +19,7 @@ public enum DeviceTypeEnum {
     HH_CULTURE(1, "HH_CULTURE"),
     HH_FKJ(2, "访客机"),
     HH_IDENTITY_PROOF(3, "临证"),
+    HH_LOCAL(4, "HH_LOCAL"),
     ;
 
     public static DeviceTypeEnum queryEnumByCode(Integer code) {

+ 16 - 5
src/main/java/cn/hanghui/outapi/platform/tenant/service/impl/UserBlacklistServiceImpl.java

@@ -6,11 +6,9 @@ import cn.hanghui.outapi.platform.common.exception.BusinessException;
 import cn.hanghui.outapi.platform.common.utils.Preconditions;
 import cn.hanghui.outapi.platform.tenant.entity.dto.blacklist.*;
 import cn.hanghui.outapi.platform.tenant.entity.enums.DeviceTypeEnum;
-import cn.hanghui.outapi.platform.tenant.entity.po.Device;
-import cn.hanghui.outapi.platform.tenant.entity.po.Purchaser;
-import cn.hanghui.outapi.platform.tenant.entity.po.UserBlacklist;
-import cn.hanghui.outapi.platform.tenant.entity.po.UserBlacklistTask;
+import cn.hanghui.outapi.platform.tenant.entity.po.*;
 import cn.hanghui.outapi.platform.tenant.mapper.DeviceMapper;
+import cn.hanghui.outapi.platform.tenant.mapper.HhLocalDeviceMapper;
 import cn.hanghui.outapi.platform.tenant.mapper.UserBlacklistMapper;
 import cn.hanghui.outapi.platform.tenant.mapper.UserBlacklistTaskMapper;
 import cn.hanghui.outapi.platform.tenant.service.UserBlacklistService;
@@ -46,7 +44,8 @@ public class UserBlacklistServiceImpl implements UserBlacklistService {
 
     @Resource
     private UserBlacklistTaskMapper userBlacklistTaskMapper;
-
+    @Resource
+    private HhLocalDeviceMapper hhLocalDeviceMapper;
     @Resource
     private UserBlacklistMapper userBlacklistMapper;
 
@@ -175,12 +174,24 @@ public class UserBlacklistServiceImpl implements UserBlacklistService {
             case 3:
                 //TODO。。。临时证明
                 break;
+            case 4:
+                //HHlocal
+                taskIds = queryTaskIdByHhLocalSn(dto.getSn());
+                break;
             default:
                 throw new IllegalStateException("Unexpected value: " + deviceType);
         }
         return taskIds;
     }
 
+    private List<Long> queryTaskIdByHhLocalSn(String sn) {
+        HhLocalDevice device = hhLocalDeviceMapper.selectOne(Wrappers.lambdaQuery(HhLocalDevice.class).eq(HhLocalDevice::getSn, sn).eq(HhLocalDevice::getStatus, Boolean.TRUE).isNotNull(HhLocalDevice::getUserBlacklistOfflineTaskId));
+        if (Preconditions.isBlank(device)) {
+            return null;
+        }
+        return device.getUserBlacklistOfflineTaskId();
+    }
+
     private List<Long> queryTaskIdByHhFaceSn(String sn) {
         Device device = deviceMapper.selectOne(Wrappers.lambdaQuery(Device.class).eq(Device::getSn, sn).eq(Device::getStatus, Boolean.TRUE).isNotNull(Device::getUserBlacklistOfflineTaskId));
         if (Preconditions.isBlank(device)) {