|
@@ -3,15 +3,23 @@ package com.usky.iot.service.impl;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
+import com.ruoyi.common.datascope.context.DataScopeContextHolder;
|
|
|
+import com.usky.common.log.annotation.Log;
|
|
|
import com.usky.common.security.utils.SecurityUtils;
|
|
|
import com.usky.iot.domain.PmReceive;
|
|
|
import com.usky.iot.mapper.PmReceiveMapper;
|
|
|
+import com.usky.iot.mapper.SysUserMapper;
|
|
|
import com.usky.iot.service.PmReceiveService;
|
|
|
import com.usky.common.mybatis.core.AbstractCrudService;
|
|
|
+import com.usky.system.domain.SysUser;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
+import java.util.Collections;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Objects;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -21,12 +29,16 @@ import java.time.LocalDateTime;
|
|
|
* @author han
|
|
|
* @since 2024-07-09
|
|
|
*/
|
|
|
+@Slf4j
|
|
|
@Service
|
|
|
public class PmReceiveServiceImpl extends AbstractCrudService<PmReceiveMapper, PmReceive> implements PmReceiveService {
|
|
|
|
|
|
@Autowired
|
|
|
private PmReceiveMapper pmReceiveMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private SysUserMapper sysUserMapper;
|
|
|
+
|
|
|
@Override
|
|
|
public void add(PmReceive receive) {
|
|
|
|
|
@@ -44,4 +56,16 @@ public class PmReceiveServiceImpl extends AbstractCrudService<PmReceiveMapper, P
|
|
|
.eq(PmReceive::getReceiverId, userId);
|
|
|
pmReceiveMapper.update(null, updateWrapper);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<SysUser> test() {
|
|
|
+ String dataScopeSql = DataScopeContextHolder.getDataScopeSql();
|
|
|
+ log.info("DataScopeContextHolder: "+ dataScopeSql);
|
|
|
+ LambdaQueryWrapper<SysUser> usersQuery = Wrappers.lambdaQuery();
|
|
|
+ usersQuery.apply(Objects.nonNull(dataScopeSql), dataScopeSql);
|
|
|
+ return sysUserMapper.selectList(usersQuery);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|