|
|
|
@ -15,9 +15,7 @@ import com.da.dangan.service.IDaCatalogService;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.Iterator;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
@ -27,8 +25,7 @@ import java.util.stream.Collectors;
|
|
|
|
* @date 2024-05-08
|
|
|
|
* @date 2024-05-08
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Service
|
|
|
|
@Service
|
|
|
|
public class DaCatalogServiceImpl implements IDaCatalogService
|
|
|
|
public class DaCatalogServiceImpl implements IDaCatalogService {
|
|
|
|
{
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private DaCatalogMapper daCatalogMapper;
|
|
|
|
private DaCatalogMapper daCatalogMapper;
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
@ -45,6 +42,7 @@ public class DaCatalogServiceImpl implements IDaCatalogService
|
|
|
|
private DaZfnyhkcgMapper daZfnyhkcgMapper;
|
|
|
|
private DaZfnyhkcgMapper daZfnyhkcgMapper;
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private DaZqzMapper daZqzMapper;
|
|
|
|
private DaZqzMapper daZqzMapper;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 查询档案目录
|
|
|
|
* 查询档案目录
|
|
|
|
*
|
|
|
|
*
|
|
|
|
@ -52,8 +50,7 @@ public class DaCatalogServiceImpl implements IDaCatalogService
|
|
|
|
* @return 档案目录
|
|
|
|
* @return 档案目录
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public DaCatalog selectDaCatalogById(Long id)
|
|
|
|
public DaCatalog selectDaCatalogById(Long id) {
|
|
|
|
{
|
|
|
|
|
|
|
|
return daCatalogMapper.selectDaCatalogById(id);
|
|
|
|
return daCatalogMapper.selectDaCatalogById(id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -75,22 +72,18 @@ public class DaCatalogServiceImpl implements IDaCatalogService
|
|
|
|
* @return 树结构列表
|
|
|
|
* @return 树结构列表
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<DaCatalog> buildCatalogTree(List<DaCatalog> catalogs)
|
|
|
|
public List<DaCatalog> buildCatalogTree(List<DaCatalog> catalogs) {
|
|
|
|
{
|
|
|
|
|
|
|
|
List<DaCatalog> returnList = new ArrayList<>();
|
|
|
|
List<DaCatalog> returnList = new ArrayList<>();
|
|
|
|
List<Long> tempList = catalogs.stream().map(DaCatalog::getId).collect(Collectors.toList());
|
|
|
|
List<Long> tempList = catalogs.stream().map(DaCatalog::getId).collect(Collectors.toList());
|
|
|
|
for (Iterator<DaCatalog> iterator = catalogs.iterator(); iterator.hasNext();)
|
|
|
|
for (Iterator<DaCatalog> iterator = catalogs.iterator(); iterator.hasNext(); ) {
|
|
|
|
{
|
|
|
|
|
|
|
|
DaCatalog catalog = iterator.next();
|
|
|
|
DaCatalog catalog = iterator.next();
|
|
|
|
// 如果是顶级节点, 遍历该父节点的所有子节点
|
|
|
|
// 如果是顶级节点, 遍历该父节点的所有子节点
|
|
|
|
if (!tempList.contains(catalog.getPid()))
|
|
|
|
if (!tempList.contains(catalog.getPid())) {
|
|
|
|
{
|
|
|
|
|
|
|
|
recursionFn(catalogs, catalog);
|
|
|
|
recursionFn(catalogs, catalog);
|
|
|
|
returnList.add(catalog);
|
|
|
|
returnList.add(catalog);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (returnList.isEmpty())
|
|
|
|
if (returnList.isEmpty()) {
|
|
|
|
{
|
|
|
|
|
|
|
|
returnList = catalogs;
|
|
|
|
returnList = catalogs;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return returnList;
|
|
|
|
return returnList;
|
|
|
|
@ -98,6 +91,7 @@ public class DaCatalogServiceImpl implements IDaCatalogService
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 查询所有目录列表
|
|
|
|
* 查询所有目录列表
|
|
|
|
|
|
|
|
*
|
|
|
|
* @param daCatalog
|
|
|
|
* @param daCatalog
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@ -113,16 +107,30 @@ public class DaCatalogServiceImpl implements IDaCatalogService
|
|
|
|
* @return 档案目录
|
|
|
|
* @return 档案目录
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<DaCatalog> selectDaCatalogList(DaCatalog daCatalog, LoginUser loginUser)
|
|
|
|
public List<DaCatalog> selectDaCatalogList(DaCatalog daCatalog, LoginUser loginUser) {
|
|
|
|
{
|
|
|
|
|
|
|
|
List<DaCatalog> catalogList;
|
|
|
|
List<DaCatalog> catalogList;
|
|
|
|
// 超管及角色为管理员显示所有目录信息
|
|
|
|
// 超管及角色为管理员显示所有目录信息
|
|
|
|
if (SysUser.isAdmin(loginUser.getUserId())||
|
|
|
|
if (SysUser.isAdmin(loginUser.getUserId()) ||
|
|
|
|
loginUser.getUser().getRoles().stream().anyMatch(sysRole -> sysRole.getRoleKey().equals("sysAdmin")))
|
|
|
|
loginUser.getUser().getRoles().stream().anyMatch(sysRole -> sysRole.getRoleKey().equals("sysAdmin"))) {
|
|
|
|
{
|
|
|
|
|
|
|
|
catalogList = daCatalogMapper.selectDaCatalogList(daCatalog);
|
|
|
|
catalogList = daCatalogMapper.selectDaCatalogList(daCatalog);
|
|
|
|
} else
|
|
|
|
} else { //根据用户权限显示目录信息
|
|
|
|
{ //根据用户权限显示目录信息
|
|
|
|
daCatalog.getParams().put("userId", loginUser.getUserId());
|
|
|
|
|
|
|
|
catalogList = daCatalogMapper.selectDaCatalogListByUserId(daCatalog);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return catalogList;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 根据档案目录列表统计已识别
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public List<DaCatalog> selectDaCatalogListAndcount(DaCatalog daCatalog, LoginUser loginUser) {
|
|
|
|
|
|
|
|
List<DaCatalog> catalogList;
|
|
|
|
|
|
|
|
// 超管及角色为管理员显示所有目录信息
|
|
|
|
|
|
|
|
if (SysUser.isAdmin(loginUser.getUserId()) ||
|
|
|
|
|
|
|
|
loginUser.getUser().getRoles().stream().anyMatch(sysRole -> sysRole.getRoleKey().equals("sysAdmin"))) {
|
|
|
|
|
|
|
|
catalogList = daCatalogMapper.selectDaCatalogList(daCatalog);
|
|
|
|
|
|
|
|
} else { //根据用户权限显示目录信息
|
|
|
|
daCatalog.getParams().put("userId", loginUser.getUserId());
|
|
|
|
daCatalog.getParams().put("userId", loginUser.getUserId());
|
|
|
|
catalogList = daCatalogMapper.selectDaCatalogListByUserId(daCatalog);
|
|
|
|
catalogList = daCatalogMapper.selectDaCatalogListByUserId(daCatalog);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -173,9 +181,79 @@ public class DaCatalogServiceImpl implements IDaCatalogService
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//第二种方式
|
|
|
|
|
|
|
|
/*Map<String, List<DaCatalog>> mapCollect = catalogList.stream().collect(Collectors.groupingBy(DaCatalog::getYwType));
|
|
|
|
|
|
|
|
//将map集合转为set集合遍历
|
|
|
|
|
|
|
|
Set<Map.Entry<String, List<DaCatalog>>> entries = mapCollect.entrySet();
|
|
|
|
|
|
|
|
for (Map.Entry<String, List<DaCatalog>> m : entries) {
|
|
|
|
|
|
|
|
List<Long> counts = new ArrayList<>();//存储结果
|
|
|
|
|
|
|
|
List<List<Long>> idsList = new ArrayList<>();//存储参数
|
|
|
|
|
|
|
|
for (int i = 0; i < m.getValue().size(); i++) {
|
|
|
|
|
|
|
|
List<Long> ids = new ArrayList<>();
|
|
|
|
|
|
|
|
//查询子目录的所有id集合
|
|
|
|
|
|
|
|
ids=daCatalogMapper.selectContainIdsById(m.getValue().get(i).getId().toString());
|
|
|
|
|
|
|
|
ids.add(m.getValue().get(i).getId());
|
|
|
|
|
|
|
|
idsList.add(ids);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (m.getKey()) {
|
|
|
|
|
|
|
|
case "option1": //常住人口登记表1
|
|
|
|
|
|
|
|
//break;
|
|
|
|
|
|
|
|
case "option2": //常住卡
|
|
|
|
|
|
|
|
// break;
|
|
|
|
|
|
|
|
case "option3": //常住人口登记表2
|
|
|
|
|
|
|
|
//break;
|
|
|
|
|
|
|
|
case "option9": //常住人口登记表3
|
|
|
|
|
|
|
|
counts = daCzrkdjMapper.selectCountByMuIds2(idsList);
|
|
|
|
|
|
|
|
for (int i = 0, j = 0; i < m.getValue().size(); i++, j++) {
|
|
|
|
|
|
|
|
m.getValue().get(i).setSbCount(counts.get(j));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "option4":
|
|
|
|
|
|
|
|
//出生医学证明
|
|
|
|
|
|
|
|
counts = daBirthDjMapper.selectCountByMuIds2(idsList);
|
|
|
|
|
|
|
|
for (int i = 0, j = 0; i < m.getValue().size(); i++, j++) {
|
|
|
|
|
|
|
|
m.getValue().get(i).setSbCount(counts.get(j));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "option5":
|
|
|
|
|
|
|
|
//迁移证
|
|
|
|
|
|
|
|
counts = daQyzMapper.selectCountByMuIds2(idsList);
|
|
|
|
|
|
|
|
for (int i = 0, j = 0; i < m.getValue().size(); i++, j++) {
|
|
|
|
|
|
|
|
m.getValue().get(i).setSbCount(counts.get(j));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "option6":
|
|
|
|
|
|
|
|
//一胎证明
|
|
|
|
|
|
|
|
counts = daYtzmMapper.selectCountByMuIds2(idsList);
|
|
|
|
|
|
|
|
for (int i = 0, j = 0; i < m.getValue().size(); i++, j++) {
|
|
|
|
|
|
|
|
m.getValue().get(i).setSbCount(counts.get(j));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "option7":
|
|
|
|
|
|
|
|
//转非农业人口批复存根
|
|
|
|
|
|
|
|
counts = daZfnyhkcgMapper.selectCountByMuIds2(idsList);
|
|
|
|
|
|
|
|
for (int i = 0, j = 0; i < m.getValue().size(); i++, j++) {
|
|
|
|
|
|
|
|
m.getValue().get(i).setSbCount(counts.get(j));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "option8":
|
|
|
|
|
|
|
|
//准迁证
|
|
|
|
|
|
|
|
counts = daZqzMapper.selectCountByMuIds2(idsList);
|
|
|
|
|
|
|
|
for (int i = 0, j = 0; i < m.getValue().size(); i++, j++) {
|
|
|
|
|
|
|
|
m.getValue().get(i).setSbCount(counts.get(j));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}*/
|
|
|
|
return catalogList;
|
|
|
|
return catalogList;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public Integer selectNumByPid(Long id) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return daCatalogMapper.selectNumByPid(id);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 新增档案目录
|
|
|
|
* 新增档案目录
|
|
|
|
*
|
|
|
|
*
|
|
|
|
@ -183,16 +261,14 @@ public class DaCatalogServiceImpl implements IDaCatalogService
|
|
|
|
* @return 结果
|
|
|
|
* @return 结果
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public int insertDaCatalog(DaCatalog daCatalog)
|
|
|
|
public int insertDaCatalog(DaCatalog daCatalog) {
|
|
|
|
{
|
|
|
|
|
|
|
|
daCatalog.setCreateTime(DateUtils.getNowDate());
|
|
|
|
daCatalog.setCreateTime(DateUtils.getNowDate());
|
|
|
|
if(daCatalog.getPid()==0){ //代表添加的是主目录
|
|
|
|
if (daCatalog.getPid() == 0) { //代表添加的是主目录
|
|
|
|
daCatalog.setAncestors(daCatalog.getPid().toString());
|
|
|
|
daCatalog.setAncestors(daCatalog.getPid().toString());
|
|
|
|
}else{
|
|
|
|
} else {
|
|
|
|
DaCatalog info = daCatalogMapper.selectDaCatalogById(daCatalog.getPid());
|
|
|
|
DaCatalog info = daCatalogMapper.selectDaCatalogById(daCatalog.getPid());
|
|
|
|
// 如果父节点不为正常状态,则不允许新增子节点
|
|
|
|
// 如果父节点不为正常状态,则不允许新增子节点
|
|
|
|
if (!UserConstants.DEPT_NORMAL.equals(info.getStatus()))
|
|
|
|
if (!UserConstants.DEPT_NORMAL.equals(info.getStatus())) {
|
|
|
|
{
|
|
|
|
|
|
|
|
throw new ServiceException("此目录停用,不允许新增");
|
|
|
|
throw new ServiceException("此目录停用,不允许新增");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
daCatalog.setAncestors(info.getAncestors() + "," + daCatalog.getPid());
|
|
|
|
daCatalog.setAncestors(info.getAncestors() + "," + daCatalog.getPid());
|
|
|
|
@ -208,8 +284,7 @@ public class DaCatalogServiceImpl implements IDaCatalogService
|
|
|
|
* @return 结果
|
|
|
|
* @return 结果
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public int updateDaCatalog(DaCatalog daCatalog)
|
|
|
|
public int updateDaCatalog(DaCatalog daCatalog) {
|
|
|
|
{
|
|
|
|
|
|
|
|
daCatalog.setUpdateTime(DateUtils.getNowDate());
|
|
|
|
daCatalog.setUpdateTime(DateUtils.getNowDate());
|
|
|
|
return daCatalogMapper.updateDaCatalog(daCatalog);
|
|
|
|
return daCatalogMapper.updateDaCatalog(daCatalog);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -221,24 +296,23 @@ public class DaCatalogServiceImpl implements IDaCatalogService
|
|
|
|
* @return 结果
|
|
|
|
* @return 结果
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public AjaxResult deleteDaCatalogById(Long id)
|
|
|
|
public AjaxResult deleteDaCatalogById(Long id) {
|
|
|
|
{
|
|
|
|
|
|
|
|
DaCatalog catalog = new DaCatalog();
|
|
|
|
DaCatalog catalog = new DaCatalog();
|
|
|
|
catalog.setPid(id);
|
|
|
|
catalog.setPid(id);
|
|
|
|
//有子级目录的不能删除
|
|
|
|
//有子级目录的不能删除
|
|
|
|
List<DaCatalog> daCatalogs = daCatalogMapper.selectDaCatalogList(catalog);
|
|
|
|
List<DaCatalog> daCatalogs = daCatalogMapper.selectDaCatalogList(catalog);
|
|
|
|
if(daCatalogs!=null&&daCatalogs.size()>0){
|
|
|
|
if (daCatalogs != null && daCatalogs.size() > 0) {
|
|
|
|
return AjaxResult.error("有子级目录,不能删除");
|
|
|
|
return AjaxResult.error("有子级目录,不能删除");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//目录下已有上传图片的 不能删除
|
|
|
|
//目录下已有上传图片的 不能删除
|
|
|
|
DaPicturesRecard picturesRecard = new DaPicturesRecard();
|
|
|
|
DaPicturesRecard picturesRecard = new DaPicturesRecard();
|
|
|
|
picturesRecard.setMuId(id);
|
|
|
|
picturesRecard.setMuId(id);
|
|
|
|
List<DaPicturesRecard> daPicturesRecards = daPicturesRecardMapper.selectDaPicturesRecardList(picturesRecard);
|
|
|
|
List<DaPicturesRecard> daPicturesRecards = daPicturesRecardMapper.selectDaPicturesRecardList(picturesRecard);
|
|
|
|
if(daPicturesRecards!=null&&daPicturesRecards.size()>0){
|
|
|
|
if (daPicturesRecards != null && daPicturesRecards.size() > 0) {
|
|
|
|
return AjaxResult.error("目录下有已上传的图片,不能删除");
|
|
|
|
return AjaxResult.error("目录下有已上传的图片,不能删除");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
int i= daCatalogMapper.deleteDaCatalogById(id);
|
|
|
|
int i = daCatalogMapper.deleteDaCatalogById(id);
|
|
|
|
if(i>0){
|
|
|
|
if (i > 0) {
|
|
|
|
return AjaxResult.success();
|
|
|
|
return AjaxResult.success();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return AjaxResult.error();
|
|
|
|
return AjaxResult.error();
|
|
|
|
@ -251,8 +325,7 @@ public class DaCatalogServiceImpl implements IDaCatalogService
|
|
|
|
* @return 结果
|
|
|
|
* @return 结果
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public int deleteDaCatalogByIds(Long[] ids)
|
|
|
|
public int deleteDaCatalogByIds(Long[] ids) {
|
|
|
|
{
|
|
|
|
|
|
|
|
return daCatalogMapper.deleteDaCatalogByIds(ids);
|
|
|
|
return daCatalogMapper.deleteDaCatalogByIds(ids);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -260,8 +333,7 @@ public class DaCatalogServiceImpl implements IDaCatalogService
|
|
|
|
public boolean checkDaCatalogNameUnique(DaCatalog daCatalog) {
|
|
|
|
public boolean checkDaCatalogNameUnique(DaCatalog daCatalog) {
|
|
|
|
Long daCatalogId = StringUtils.isNull(daCatalog.getId()) ? -1L : daCatalog.getId();
|
|
|
|
Long daCatalogId = StringUtils.isNull(daCatalog.getId()) ? -1L : daCatalog.getId();
|
|
|
|
DaCatalog info = daCatalogMapper.checkDaCatalogNameUnique(daCatalog.getMuName(), daCatalog.getPid());
|
|
|
|
DaCatalog info = daCatalogMapper.checkDaCatalogNameUnique(daCatalog.getMuName(), daCatalog.getPid());
|
|
|
|
if (StringUtils.isNotNull(info) && info.getId().longValue() != daCatalogId.longValue())
|
|
|
|
if (StringUtils.isNotNull(info) && info.getId().longValue() != daCatalogId.longValue()) {
|
|
|
|
{
|
|
|
|
|
|
|
|
return UserConstants.NOT_UNIQUE;
|
|
|
|
return UserConstants.NOT_UNIQUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return UserConstants.UNIQUE;
|
|
|
|
return UserConstants.UNIQUE;
|
|
|
|
@ -273,15 +345,12 @@ public class DaCatalogServiceImpl implements IDaCatalogService
|
|
|
|
* @param list 分类表
|
|
|
|
* @param list 分类表
|
|
|
|
* @param t 子节点
|
|
|
|
* @param t 子节点
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private void recursionFn(List<DaCatalog> list, DaCatalog t)
|
|
|
|
private void recursionFn(List<DaCatalog> list, DaCatalog t) {
|
|
|
|
{
|
|
|
|
|
|
|
|
// 得到子节点列表
|
|
|
|
// 得到子节点列表
|
|
|
|
List<DaCatalog> childList = getChildList(list, t);
|
|
|
|
List<DaCatalog> childList = getChildList(list, t);
|
|
|
|
t.setChildren(childList);
|
|
|
|
t.setChildren(childList);
|
|
|
|
for (DaCatalog tChild : childList)
|
|
|
|
for (DaCatalog tChild : childList) {
|
|
|
|
{
|
|
|
|
if (hasChild(list, tChild)) {
|
|
|
|
if (hasChild(list, tChild))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
recursionFn(list, tChild);
|
|
|
|
recursionFn(list, tChild);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -290,15 +359,12 @@ public class DaCatalogServiceImpl implements IDaCatalogService
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 得到子节点列表
|
|
|
|
* 得到子节点列表
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private List<DaCatalog> getChildList(List<DaCatalog> list, DaCatalog t)
|
|
|
|
private List<DaCatalog> getChildList(List<DaCatalog> list, DaCatalog t) {
|
|
|
|
{
|
|
|
|
|
|
|
|
List<DaCatalog> tlist = new ArrayList<DaCatalog>();
|
|
|
|
List<DaCatalog> tlist = new ArrayList<DaCatalog>();
|
|
|
|
Iterator<DaCatalog> it = list.iterator();
|
|
|
|
Iterator<DaCatalog> it = list.iterator();
|
|
|
|
while (it.hasNext())
|
|
|
|
while (it.hasNext()) {
|
|
|
|
{
|
|
|
|
|
|
|
|
DaCatalog n = (DaCatalog) it.next();
|
|
|
|
DaCatalog n = (DaCatalog) it.next();
|
|
|
|
if (n.getPid().longValue() == t.getId().longValue())
|
|
|
|
if (n.getPid().longValue() == t.getId().longValue()) {
|
|
|
|
{
|
|
|
|
|
|
|
|
tlist.add(n);
|
|
|
|
tlist.add(n);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -308,8 +374,7 @@ public class DaCatalogServiceImpl implements IDaCatalogService
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 判断是否有子节点
|
|
|
|
* 判断是否有子节点
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private boolean hasChild(List<DaCatalog> list, DaCatalog t)
|
|
|
|
private boolean hasChild(List<DaCatalog> list, DaCatalog t) {
|
|
|
|
{
|
|
|
|
|
|
|
|
return getChildList(list, t).size() > 0;
|
|
|
|
return getChildList(list, t).size() > 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|