|
@@ -62,12 +62,20 @@ public class PatrolInspectionPlanServiceImpl extends AbstractCrudService<PatrolI
|
|
|
|
|
|
@Override
|
|
|
public List<PatrolInspectionAreaVo> planLeftList() {
|
|
|
+ String userType = SecurityUtils.getLoginUser().getUserType();
|
|
|
LambdaQueryWrapper<PatrolInspectionArea> queryWrapper = Wrappers.lambdaQuery();
|
|
|
- queryWrapper.eq(PatrolInspectionArea::getTenantId, SecurityUtils.getTenantId())
|
|
|
- .eq(PatrolInspectionArea::getEnable, 1);
|
|
|
+ queryWrapper.eq(PatrolInspectionArea::getEnable, 1)
|
|
|
+ .eq(PatrolInspectionArea::getTenantId, SecurityUtils.getTenantId());
|
|
|
+ if ("00".equals(userType)) {
|
|
|
+ queryWrapper.eq(PatrolInspectionArea::getCreator, SecurityUtils.getUsername());
|
|
|
+ }
|
|
|
List<PatrolInspectionArea> patrolInspectionAreaList = patrolInspectionAreaService.list(queryWrapper);
|
|
|
LambdaQueryWrapper<PatrolInspectionPlan> queryWrapperOne = Wrappers.lambdaQuery();
|
|
|
- queryWrapperOne.eq(PatrolInspectionPlan::getEnable, 1).eq(PatrolInspectionPlan::getTenantId, SecurityUtils.getTenantId());
|
|
|
+ queryWrapperOne.eq(PatrolInspectionPlan::getEnable, 1)
|
|
|
+ .eq(PatrolInspectionPlan::getTenantId, SecurityUtils.getTenantId());
|
|
|
+ if ("00".equals(userType)) {
|
|
|
+ queryWrapperOne.eq(PatrolInspectionPlan::getCreator, SecurityUtils.getUsername());
|
|
|
+ }
|
|
|
List<PatrolInspectionPlan> list = this.list(queryWrapperOne);
|
|
|
Map<Integer, List<PatrolInspectionPlan>> grouypByAreaId = list.stream().collect(
|
|
|
Collectors.groupingBy(o -> o.getAreaId())
|
|
@@ -494,9 +502,14 @@ public class PatrolInspectionPlanServiceImpl extends AbstractCrudService<PatrolI
|
|
|
|
|
|
|
|
|
public CommonPage<PatrolInspectionPlanDataVo> patrolInspectionPlanList(String planName, Integer planType, Integer areaId, Integer pageNum, Integer pageSize, Integer id) {
|
|
|
+ String userType = SecurityUtils.getLoginUser().getUserType();
|
|
|
LambdaQueryWrapper<PatrolInspectionPlan> queryWrapper = Wrappers.lambdaQuery();
|
|
|
queryWrapper.eq(PatrolInspectionPlan::getEnable, 1)
|
|
|
.eq(PatrolInspectionPlan::getTenantId, SecurityUtils.getTenantId());
|
|
|
+ if ("00".equals(userType)) {
|
|
|
+ queryWrapper.eq(PatrolInspectionPlan::getCreator, SecurityUtils.getUsername());
|
|
|
+ }
|
|
|
+
|
|
|
if (planName != null && "".equals(planName)) {
|
|
|
queryWrapper.like(PatrolInspectionPlan::getPlanName, planName);
|
|
|
}
|
|
@@ -565,10 +578,14 @@ public class PatrolInspectionPlanServiceImpl extends AbstractCrudService<PatrolI
|
|
|
|
|
|
|
|
|
public List<PatrolInspectionSiteVo> patrolInspectionSiteVoList(Integer planId, Integer areaId) {
|
|
|
+ String userType = SecurityUtils.getLoginUser().getUserType();
|
|
|
LambdaQueryWrapper<PatrolInspectionSite> queryWrapper = Wrappers.lambdaQuery();
|
|
|
queryWrapper.eq(PatrolInspectionSite::getEnable, 1)
|
|
|
.eq(PatrolInspectionSite::getAreaId, areaId)
|
|
|
.eq(PatrolInspectionSite::getTenantId, SecurityUtils.getTenantId());
|
|
|
+ if ("00".equals(userType)) {
|
|
|
+ queryWrapper.eq(PatrolInspectionSite::getCreator, SecurityUtils.getUsername());
|
|
|
+ }
|
|
|
List<PatrolInspectionSite> patrolInspectionSiteList = patrolInspectionSiteService.list();
|
|
|
LambdaQueryWrapper<PlanSite> queryWrapperOne = Wrappers.lambdaQuery();
|
|
|
queryWrapperOne.eq(PlanSite::getPlanId, planId);
|
|
@@ -576,6 +593,9 @@ public class PatrolInspectionPlanServiceImpl extends AbstractCrudService<PatrolI
|
|
|
LambdaQueryWrapper<PatrolInspectionArea> queryWrapperTwo = Wrappers.lambdaQuery();
|
|
|
queryWrapperTwo.eq(PatrolInspectionArea::getEnable, 1)
|
|
|
.eq(PatrolInspectionArea::getTenantId, SecurityUtils.getTenantId());
|
|
|
+ if ("00".equals(userType)) {
|
|
|
+ queryWrapperTwo.eq(PatrolInspectionArea::getCreator, SecurityUtils.getUsername());
|
|
|
+ }
|
|
|
List<PatrolInspectionArea> PatrolInspectionAreaList = patrolInspectionAreaService.list(queryWrapperTwo);
|
|
|
List<PatrolInspectionSiteVo> list = new ArrayList<>();
|
|
|
for (int i = 0; i < patrolInspectionSiteList.size(); i++) {
|