|
@@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.ArrayUtils;
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
@@ -95,6 +96,32 @@ public class DmpDeviceInfoServiceImpl extends AbstractCrudService<DmpDeviceInfoM
|
|
commandUserName = SecurityUtils.getUsername();
|
|
commandUserName = SecurityUtils.getUsername();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //人员设备权限校验,校验通过,可以下发命令控制设备
|
|
|
|
+ Integer fid = baseMapper.getMeetingFaceData(commandUserId);
|
|
|
|
+ if(fid == null){
|
|
|
|
+ throw new BusinessException("人脸卡号信息未注册");
|
|
|
|
+ }
|
|
|
|
+ Integer[] deviceFid = baseMapper.getMeetingFaceDeviceList(fid);
|
|
|
|
+ if(deviceFid.length == 0){
|
|
|
|
+ throw new BusinessException("人员未绑定设备,请检查");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ LambdaQueryWrapper<DmpDeviceInfo> queryWrapper = Wrappers.lambdaQuery();
|
|
|
|
+ queryWrapper.select(DmpDeviceInfo::getId)
|
|
|
|
+ .eq(DmpDeviceInfo::getProductCode,productCode)
|
|
|
|
+ .eq(DmpDeviceInfo::getDeviceId,deviceId)
|
|
|
|
+ .eq(DmpDeviceInfo::getDeleteFlag,0);
|
|
|
|
+ DmpDeviceInfo one = this.getOne(queryWrapper);
|
|
|
|
+ if(one != null){
|
|
|
|
+ boolean exist = Arrays.asList(deviceFid).contains(one.getId());
|
|
|
|
+ if(!exist){
|
|
|
|
+ throw new BusinessException("暂无权限");
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ throw new BusinessException("设备未注册,请先注册");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
Map<String,Object> map = new HashMap<>();
|
|
Map<String,Object> map = new HashMap<>();
|
|
map.put("method","control");
|
|
map.put("method","control");
|
|
Map<String,Object> map1 = new HashMap<>();
|
|
Map<String,Object> map1 = new HashMap<>();
|
|
@@ -180,11 +207,12 @@ public class DmpDeviceInfoServiceImpl extends AbstractCrudService<DmpDeviceInfoM
|
|
IPage<DmpDeviceInfo> page = new Page<>(pageCurrent,pageSize);
|
|
IPage<DmpDeviceInfo> page = new Page<>(pageCurrent,pageSize);
|
|
|
|
|
|
if(diRequest.getDeviceStatus() != null){
|
|
if(diRequest.getDeviceStatus() != null){
|
|
- if(StringUtils.isNotBlank(diRequest.getDeviceId()) || StringUtils.isNotBlank(diRequest.getDeviceName()) || diRequest.getProductId() != null || diRequest.getServiceStatus() != null){
|
|
|
|
|
|
+ if(StringUtils.isNotBlank(diRequest.getDeviceId()) || StringUtils.isNotBlank(diRequest.getDeviceName()) || diRequest.getProductId() != null || StringUtils.isNotBlank(diRequest.getProductCode()) || diRequest.getServiceStatus() != null){
|
|
LambdaQueryWrapper<DmpDeviceInfo> queryWrapper = Wrappers.lambdaQuery();
|
|
LambdaQueryWrapper<DmpDeviceInfo> queryWrapper = Wrappers.lambdaQuery();
|
|
queryWrapper.eq(StringUtils.isNotBlank(diRequest.getDeviceId()),DmpDeviceInfo::getDeviceId,diRequest.getDeviceId())
|
|
queryWrapper.eq(StringUtils.isNotBlank(diRequest.getDeviceId()),DmpDeviceInfo::getDeviceId,diRequest.getDeviceId())
|
|
.like(StringUtils.isNotBlank(diRequest.getDeviceName()),DmpDeviceInfo::getDeviceName,diRequest.getDeviceName())
|
|
.like(StringUtils.isNotBlank(diRequest.getDeviceName()),DmpDeviceInfo::getDeviceName,diRequest.getDeviceName())
|
|
.eq(diRequest.getProductId() != null,DmpDeviceInfo::getProductId,diRequest.getProductId())
|
|
.eq(diRequest.getProductId() != null,DmpDeviceInfo::getProductId,diRequest.getProductId())
|
|
|
|
+ .like(StringUtils.isNotBlank(diRequest.getProductCode()),DmpDeviceInfo::getProductCode,diRequest.getProductCode())
|
|
.eq(diRequest.getServiceStatus() != null,DmpDeviceInfo::getServiceStatus,diRequest.getServiceStatus())
|
|
.eq(diRequest.getServiceStatus() != null,DmpDeviceInfo::getServiceStatus,diRequest.getServiceStatus())
|
|
.eq(DmpDeviceInfo::getDeleteFlag,0)
|
|
.eq(DmpDeviceInfo::getDeleteFlag,0)
|
|
.eq(DmpDeviceInfo::getTenantId,SecurityUtils.getTenantId())
|
|
.eq(DmpDeviceInfo::getTenantId,SecurityUtils.getTenantId())
|
|
@@ -293,6 +321,7 @@ public class DmpDeviceInfoServiceImpl extends AbstractCrudService<DmpDeviceInfoM
|
|
queryWrapper.eq(StringUtils.isNotBlank(diRequest.getDeviceId()),DmpDeviceInfo::getDeviceId,diRequest.getDeviceId())
|
|
queryWrapper.eq(StringUtils.isNotBlank(diRequest.getDeviceId()),DmpDeviceInfo::getDeviceId,diRequest.getDeviceId())
|
|
.like(StringUtils.isNotBlank(diRequest.getDeviceName()),DmpDeviceInfo::getDeviceName,diRequest.getDeviceName())
|
|
.like(StringUtils.isNotBlank(diRequest.getDeviceName()),DmpDeviceInfo::getDeviceName,diRequest.getDeviceName())
|
|
.eq(diRequest.getProductId() != null,DmpDeviceInfo::getProductId,diRequest.getProductId())
|
|
.eq(diRequest.getProductId() != null,DmpDeviceInfo::getProductId,diRequest.getProductId())
|
|
|
|
+ .like(StringUtils.isNotBlank(diRequest.getProductCode()),DmpDeviceInfo::getProductCode,diRequest.getProductCode())
|
|
.eq(diRequest.getServiceStatus() != null,DmpDeviceInfo::getServiceStatus,diRequest.getServiceStatus())
|
|
.eq(diRequest.getServiceStatus() != null,DmpDeviceInfo::getServiceStatus,diRequest.getServiceStatus())
|
|
.eq(DmpDeviceInfo::getDeleteFlag,0)
|
|
.eq(DmpDeviceInfo::getDeleteFlag,0)
|
|
.eq(DmpDeviceInfo::getTenantId,SecurityUtils.getTenantId())
|
|
.eq(DmpDeviceInfo::getTenantId,SecurityUtils.getTenantId())
|