Browse Source

Merge branch 'han' of uskycloud/usky-modules into server-165

hanzhengyi 8 months ago
parent
commit
e6a6ffd5ab

+ 6 - 1
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionAreaServiceImpl.java

@@ -3,6 +3,8 @@ package com.usky.fire.service.impl;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.ruoyi.common.datascope.annotation.DataScope;
+import com.ruoyi.common.datascope.context.DataScopeContextHolder;
 import com.usky.common.core.exception.BusinessException;
 import com.usky.common.mybatis.core.AbstractCrudService;
 import com.usky.common.security.utils.SecurityUtils;
@@ -21,6 +23,7 @@ import java.time.LocalDateTime;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 
 /**
  * <p>
@@ -180,6 +183,7 @@ public class PatrolInspectionAreaServiceImpl extends AbstractCrudService<PatrolI
      * @return
      */
     @Override
+    @DataScope
     public List<PatrolInspectionArea> patrolInspectionAreaList(Integer id, String areaName) {
         LoginUser loginUser = SecurityUtils.getLoginUser();
         String userType = null;
@@ -188,7 +192,8 @@ public class PatrolInspectionAreaServiceImpl extends AbstractCrudService<PatrolI
         }
         LambdaQueryWrapper<PatrolInspectionArea> queryWrapper = Wrappers.lambdaQuery();
         queryWrapper.eq(PatrolInspectionArea::getEnable, 1)
-                .eq(PatrolInspectionArea::getTenantId, SecurityUtils.getTenantId());
+                .eq(PatrolInspectionArea::getTenantId, SecurityUtils.getTenantId())
+                .apply(Objects.nonNull(DataScopeContextHolder.getDataScopeSql()),DataScopeContextHolder.getDataScopeSql());
         if ("00".equals(userType)) {
             queryWrapper.eq(PatrolInspectionArea::getCreator, SecurityUtils.getUsername());
         }

+ 6 - 1
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionPersonnelServiceImpl.java

@@ -3,6 +3,8 @@ package com.usky.fire.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.annotation.DataScope;
+import com.ruoyi.common.datascope.context.DataScopeContextHolder;
 import com.usky.common.core.bean.ApiResult;
 import com.usky.common.core.bean.CommonPage;
 import com.usky.common.core.exception.BusinessException;
@@ -29,6 +31,7 @@ import java.time.LocalDateTime;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import java.util.stream.Collectors;
 
 /**
@@ -174,6 +177,7 @@ public class PatrolInspectionPersonnelServiceImpl extends AbstractCrudService<Pa
 
 
     @Override
+    @DataScope
     public List<PatrolInspectionAreaVo> personnelLeftList() {
         LoginUser loginUser = SecurityUtils.getLoginUser();
         String userType = null;
@@ -182,7 +186,8 @@ public class PatrolInspectionPersonnelServiceImpl extends AbstractCrudService<Pa
         }
         LambdaQueryWrapper<PatrolInspectionArea> queryWrapper = Wrappers.lambdaQuery();
         queryWrapper.eq(PatrolInspectionArea::getEnable, 1)
-                .eq(PatrolInspectionArea::getTenantId, SecurityUtils.getTenantId());
+                .eq(PatrolInspectionArea::getTenantId, SecurityUtils.getTenantId())
+                .apply(Objects.nonNull(DataScopeContextHolder.getDataScopeSql()),DataScopeContextHolder.getDataScopeSql());
         if ("00".equals(userType)) {
             queryWrapper.eq(PatrolInspectionArea::getCreator, SecurityUtils.getUsername());
         }

+ 6 - 1
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionSiteServiceImpl.java

@@ -3,6 +3,8 @@ package com.usky.fire.service.impl;
 import com.alibaba.nacos.common.utils.CollectionUtils;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.ruoyi.common.datascope.annotation.DataScope;
+import com.ruoyi.common.datascope.context.DataScopeContextHolder;
 import com.usky.common.core.bean.CommonPage;
 import com.usky.common.core.exception.BusinessException;
 import com.usky.common.mybatis.core.AbstractCrudService;
@@ -27,6 +29,7 @@ import java.time.format.DateTimeFormatter;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import java.util.stream.Collectors;
 
 /**
@@ -50,6 +53,7 @@ public class PatrolInspectionSiteServiceImpl extends AbstractCrudService<PatrolI
     private PatrolInspectionPlanSiteService planSiteService;
 
     @Override
+    @DataScope
     public List<PatrolInspectionAreaVo> areaLeftList() {
         DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
         LoginUser loginUser = SecurityUtils.getLoginUser();
@@ -59,7 +63,8 @@ public class PatrolInspectionSiteServiceImpl extends AbstractCrudService<PatrolI
         }
         LambdaQueryWrapper<PatrolInspectionArea> queryWrapper = Wrappers.lambdaQuery();
         queryWrapper.eq(PatrolInspectionArea::getEnable, 1)
-                .eq(PatrolInspectionArea::getTenantId, SecurityUtils.getTenantId());
+                .eq(PatrolInspectionArea::getTenantId, SecurityUtils.getTenantId())
+                .apply(Objects.nonNull(DataScopeContextHolder.getDataScopeSql()),DataScopeContextHolder.getDataScopeSql());
         if ("00".equals(userType)) {
             queryWrapper.eq(PatrolInspectionArea::getCreator, SecurityUtils.getUsername());
         }