|
@@ -14,7 +14,7 @@ import com.fjhx.utils.TreeUtil;
|
|
|
import com.fjhx.utils.wrapperUtil.IWrapper;
|
|
|
import org.springblade.core.log.exception.ServiceException;
|
|
|
import org.springblade.core.tool.utils.Func;
|
|
|
-import org.springblade.core.tool.utils.SpringUtil;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
@@ -32,7 +32,8 @@ import java.util.Map;
|
|
|
@Service
|
|
|
public class ClassifyServiceImpl extends ServiceImpl<ClassifyMapper, Classify> implements ClassifyService {
|
|
|
|
|
|
- private MaterialService materialService = SpringUtil.getBean(MaterialService.class);
|
|
|
+ @Autowired
|
|
|
+ private MaterialService materialService;
|
|
|
|
|
|
@Override
|
|
|
public Page<Classify> getPage(Map<String, Object> condition) {
|
|
@@ -63,7 +64,7 @@ public class ClassifyServiceImpl extends ServiceImpl<ClassifyMapper, Classify> i
|
|
|
@Override
|
|
|
public void delete(ClassifyVo classifyVo) {
|
|
|
//查询是否存在子级
|
|
|
- List<Classify> list = lambdaQuery().apply("FIND_IN_SET(" + classifyVo.getId() + ", role_id)").list();
|
|
|
+ List<Classify> list = lambdaQuery().apply("FIND_IN_SET(" + classifyVo.getId() + ", parent_id_set)").list();
|
|
|
if (Func.isNotEmpty(list)) {
|
|
|
throw new ServiceException("存在子级,无法删除!");
|
|
|
} else {
|