|
|
@@ -1,12 +1,6 @@
|
|
|
package com.xunmei.system.service.impl;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Collections;
|
|
|
import java.util.List;
|
|
|
-
|
|
|
-import com.alibaba.nacos.shaded.org.checkerframework.checker.units.qual.A;
|
|
|
-import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
-import com.sun.org.apache.bcel.internal.generic.NEW;
|
|
|
import com.xunmei.common.core.exception.ServiceException;
|
|
|
import com.xunmei.common.core.utils.DateUtils;
|
|
|
import com.xunmei.common.security.utils.SecurityUtils;
|
|
|
@@ -18,11 +12,7 @@ import com.xunmei.system.mapper.SysAreaCheckMapper;
|
|
|
import com.xunmei.system.mapper.SysDictDataMapper;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
-import com.xunmei.system.service.ISysOrgService;
|
|
|
-
|
|
|
-import java.util.Arrays;
|
|
|
import java.util.stream.Collectors;
|
|
|
-
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
@@ -62,8 +52,8 @@ public class SysAreaServiceImpl extends ServiceImpl<ISysAreaMapper, SysArea> imp
|
|
|
//查询条件
|
|
|
QueryWrapper<SysArea> query = new QueryWrapper<>(sysArea);
|
|
|
//下穿
|
|
|
- if (sysArea.getCheckSub()) {
|
|
|
- // List<Long> ids = orgService.selectCheckSubOrgIdList(sysArea.getOrgType());
|
|
|
+ Boolean checkSub = sysArea.getCheckSub();
|
|
|
+ if (checkSub) {
|
|
|
List<SysDictData> sysDictData = sysDictDataMapper.selectDictDataByType(sysArea.getOrgType());
|
|
|
List<String> ids = sysDictData.stream().map(e -> e.getDictValue()).collect(Collectors.toList());
|
|
|
//清空前端传递的org_id
|
|
|
@@ -155,9 +145,8 @@ public class SysAreaServiceImpl extends ServiceImpl<ISysAreaMapper, SysArea> imp
|
|
|
SysAreaCheck sysAreaCheck = new SysAreaCheck();
|
|
|
QueryWrapper<SysAreaCheck> query = new QueryWrapper<>(sysAreaCheck);
|
|
|
query.eq("del_flag", "0");
|
|
|
- List<SysAreaCheck> sysAreaChecks = new ArrayList<>();
|
|
|
query.in("area_id", ids);
|
|
|
- sysAreaChecks = sysAreaCheckMapper.selectList(query);
|
|
|
+ List<SysAreaCheck> sysAreaChecks = sysAreaCheckMapper.selectList(query);
|
|
|
if (null == sysAreaChecks || sysAreaChecks.size() > 0) {
|
|
|
throw new ServiceException("数据使用中,不能删除");
|
|
|
}
|
|
|
@@ -186,9 +175,8 @@ public class SysAreaServiceImpl extends ServiceImpl<ISysAreaMapper, SysArea> imp
|
|
|
SysAreaCheck sysAreaCheck = new SysAreaCheck();
|
|
|
QueryWrapper<SysAreaCheck> query = new QueryWrapper<>(sysAreaCheck);
|
|
|
query.eq("del_flag", "0");
|
|
|
- List<SysAreaCheck> sysAreaChecks = new ArrayList<>();
|
|
|
query.eq("area_id", id);
|
|
|
- sysAreaChecks = sysAreaCheckMapper.selectList(query);
|
|
|
+ List<SysAreaCheck> sysAreaChecks = sysAreaCheckMapper.selectList(query);
|
|
|
if (null == sysAreaChecks || sysAreaChecks.size() > 0) {
|
|
|
throw new ServiceException("数据使用中,不能删除");
|
|
|
}
|