|
@@ -1,23 +1,19 @@
|
|
|
package com.usky.system.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
-import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
-import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
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.security.utils.SecurityUtils;
|
|
|
import com.usky.system.domain.HceArticle;
|
|
|
import com.usky.system.domain.HceCategory;
|
|
|
import com.usky.system.domain.SysUser;
|
|
|
import com.usky.system.mapper.HceArticleMapper;
|
|
|
import com.usky.system.mapper.HceCategoryMapper;
|
|
|
-import com.usky.system.service.HceArticleService;
|
|
|
import com.usky.system.service.HceCategoryService;
|
|
|
-import com.usky.common.mybatis.core.AbstractCrudService;
|
|
|
import com.usky.system.service.ISysUserService;
|
|
|
import com.usky.system.service.vo.HceCategoryListVO;
|
|
|
import com.usky.system.service.vo.HceCategoryVO;
|
|
|
-import org.apache.tomcat.jni.Local;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -109,15 +105,15 @@ public class HceCategoryServiceImpl extends AbstractCrudService<HceCategoryMappe
|
|
|
}
|
|
|
|
|
|
//新增栏目时校验对应上级栏目是否存在,不存在要先新增上级栏目后再新增本栏目
|
|
|
- Integer pid = baseMapper.selectPidByMenuid(hceCategory.getMenuId());
|
|
|
- if(pid != null && pid != 0){
|
|
|
- LambdaQueryWrapper<HceCategory> queryWrapper2 = Wrappers.lambdaQuery();
|
|
|
- queryWrapper2.eq(HceCategory::getMenuId,pid);
|
|
|
- List<HceCategory> list2 = this.list(queryWrapper2);
|
|
|
- if(list2.size() <= 0){
|
|
|
- throw new BusinessException("上级栏目不存在,请先添加上级栏目");
|
|
|
- }
|
|
|
- }
|
|
|
+// Integer pid = baseMapper.selectPidByMenuid(hceCategory.getMenuId());
|
|
|
+// if(pid != null && pid != 0){
|
|
|
+// LambdaQueryWrapper<HceCategory> queryWrapper2 = Wrappers.lambdaQuery();
|
|
|
+// queryWrapper2.eq(HceCategory::getMenuId,pid);
|
|
|
+// List<HceCategory> list2 = this.list(queryWrapper2);
|
|
|
+// if(list2.size() <= 0){
|
|
|
+// throw new BusinessException("上级栏目不存在,请先添加上级栏目");
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
hceCategory.setCreatedate(LocalDateTime.now());
|
|
|
this.save(hceCategory);
|
|
@@ -152,13 +148,13 @@ public class HceCategoryServiceImpl extends AbstractCrudService<HceCategoryMappe
|
|
|
if(list.size() > 0){
|
|
|
throw new BusinessException("该栏目存在栏目内容不可删除");
|
|
|
}
|
|
|
- LambdaQueryWrapper<HceCategory> queryWrapper1 = Wrappers.lambdaQuery();
|
|
|
- queryWrapper1.eq(HceCategory::getPid,id)
|
|
|
- .eq(HceCategory::getStatus,1);
|
|
|
- List<HceCategory> list1 = this.list(queryWrapper1);
|
|
|
- if(list1.size()>0){
|
|
|
- throw new BusinessException("该栏目存在子栏目不可删除");
|
|
|
- }
|
|
|
+// LambdaQueryWrapper<HceCategory> queryWrapper1 = Wrappers.lambdaQuery();
|
|
|
+// queryWrapper1.eq(HceCategory::getPid,id)
|
|
|
+// .eq(HceCategory::getStatus,1);
|
|
|
+// List<HceCategory> list1 = this.list(queryWrapper1);
|
|
|
+// if(list1.size()>0){
|
|
|
+// throw new BusinessException("该栏目存在子栏目不可删除");
|
|
|
+// }
|
|
|
this.removeById(id);
|
|
|
|
|
|
}
|