|
@@ -14,10 +14,9 @@ import com.ruoyi.common.utils.StringUtils;
|
|
|
import com.ruoyi.gas.domain.*;
|
|
|
import com.ruoyi.gas.domain.bo.GAreaBo;
|
|
|
import com.ruoyi.gas.domain.bo.GAreaPhotoBo;
|
|
|
-import com.ruoyi.gas.domain.vo.GAreaVo;
|
|
|
-import com.ruoyi.gas.domain.vo.GImportVo;
|
|
|
-import com.ruoyi.gas.domain.vo.GPressureRegulatingBoxVo;
|
|
|
-import com.ruoyi.gas.domain.vo.GUserVo;
|
|
|
+import com.ruoyi.gas.domain.bo.GNetworkRelationBo;
|
|
|
+import com.ruoyi.gas.domain.bo.GRegulatorBoxRelationBo;
|
|
|
+import com.ruoyi.gas.domain.vo.*;
|
|
|
import com.ruoyi.gas.mapper.GAreaMapper;
|
|
|
import com.ruoyi.gas.mapper.GBuildingMapper;
|
|
|
import com.ruoyi.gas.service.IGAreaPhotoService;
|
|
@@ -28,6 +27,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.ObjectUtils;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
@@ -187,7 +187,7 @@ public class GAreaServiceImpl extends ServicePlusImpl<GAreaMapper, GArea, GAreaV
|
|
|
}
|
|
|
|
|
|
@Autowired
|
|
|
- private GUserServiceImpl gUserService;
|
|
|
+ private IGNetworkRelationService networkRelationService;
|
|
|
|
|
|
@Override
|
|
|
public TableDataInfo<GAreaVo> queryPageList(GAreaBo bo) {
|
|
@@ -216,6 +216,14 @@ public class GAreaServiceImpl extends ServicePlusImpl<GAreaMapper, GArea, GAreaV
|
|
|
lqw.like(StringUtils.isNotBlank(bo.getUserId()), GArea::getUserId, bo.getUserId());
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getDistrict()), GArea::getDistrict, bo.getDistrict());
|
|
|
lqw.orderByDesc(GArea::getCreateTime);
|
|
|
+ if (!ObjectUtils.isEmpty(bo.getJobNum())){
|
|
|
+ GNetworkRelationBo entity = new GNetworkRelationBo();
|
|
|
+ entity.setUserId(bo.getJobNum());
|
|
|
+ List<Long> ids = networkRelationService.queryList(entity).stream().map(GNetworkRelationVo::getRegulatorBoxId).collect(Collectors.toList());
|
|
|
+ if (!ObjectUtils.isEmpty(ids)) {
|
|
|
+ lqw.notIn(GArea::getId,ids);
|
|
|
+ }
|
|
|
+ }
|
|
|
return lqw;
|
|
|
}
|
|
|
|
|
@@ -281,10 +289,14 @@ public class GAreaServiceImpl extends ServicePlusImpl<GAreaMapper, GArea, GAreaV
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
|
|
if (isValid) {
|
|
|
//TODO 做一些业务上的校验,判断是否需要校验
|
|
|
}
|
|
|
+ QueryWrapper<GNetworkRelation> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.lambda().in(GNetworkRelation::getRegulatorBoxId,ids);
|
|
|
+ networkRelationService.remove(queryWrapper);
|
|
|
return removeByIds(ids);
|
|
|
}
|
|
|
@Autowired
|