|
@@ -2,6 +2,7 @@ package com.usky.fire.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
+import com.usky.common.core.exception.BusinessException;
|
|
import com.usky.common.mybatis.core.AbstractCrudService;
|
|
import com.usky.common.mybatis.core.AbstractCrudService;
|
|
import com.usky.common.security.utils.SecurityUtils;
|
|
import com.usky.common.security.utils.SecurityUtils;
|
|
import com.usky.fire.domain.PatrolInspectionArea;
|
|
import com.usky.fire.domain.PatrolInspectionArea;
|
|
@@ -57,6 +58,23 @@ public class PatrolInspectionAreaServiceImpl extends AbstractCrudService<PatrolI
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ public void addPatrolInspectionAreaSon(PatrolInspectionArea patrolInspectionArea) {
|
|
|
|
+ LambdaQueryWrapper<PatrolInspectionArea> queryWrapper = Wrappers.lambdaQuery();
|
|
|
|
+ queryWrapper.eq(PatrolInspectionArea::getEnable, 1)
|
|
|
|
+ .eq(PatrolInspectionArea::getId, patrolInspectionArea.getAreaFid());
|
|
|
|
+ List<PatrolInspectionArea> list = this.list(queryWrapper);
|
|
|
|
+ if (list.size()<=0){
|
|
|
|
+ throw new BusinessException("父级ID不存在");
|
|
|
|
+ }
|
|
|
|
+ patrolInspectionArea.setCompanyId(list.get(0).getCompanyId());
|
|
|
|
+ patrolInspectionArea.setCreator(SecurityUtils.getUsername());
|
|
|
|
+ patrolInspectionArea.setCreateTime(LocalDateTime.now());
|
|
|
|
+ patrolInspectionArea.setEnable(1);
|
|
|
|
+ patrolInspectionArea.setTenantId(SecurityUtils.getTenantId());
|
|
|
|
+ this.save(patrolInspectionArea);
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 巡查自检-巡检区域-编辑
|
|
* 巡查自检-巡检区域-编辑
|
|
*
|
|
*
|