|
|
@@ -1,6 +1,10 @@
|
|
|
package com.github.zuihou.business.edgeLibrary.service.impl;
|
|
|
|
|
|
+import cn.hutool.core.collection.CollectionUtil;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.github.zuihou.authority.service.auth.UserService;
|
|
|
import com.github.zuihou.base.service.SuperCacheServiceImpl;
|
|
|
import com.github.zuihou.business.edgeLibrary.dao.ShelvesMapper;
|
|
|
import com.github.zuihou.business.edgeLibrary.dao.StorgeTypeMapper;
|
|
|
@@ -13,12 +17,16 @@ import com.github.zuihou.business.edgeLibrary.entity.StorgeType;
|
|
|
import com.github.zuihou.business.edgeLibrary.service.ShelvesService;
|
|
|
import com.github.zuihou.business.edgeLibrary.service.StorgeTypeService;
|
|
|
import com.github.zuihou.business.modelingCenter.entity.MModuleField;
|
|
|
+import com.github.zuihou.context.BaseContextHandler;
|
|
|
+import com.github.zuihou.database.mybatis.auth.DataScope;
|
|
|
import com.github.zuihou.database.mybatis.conditions.Wraps;
|
|
|
import com.github.zuihou.database.mybatis.conditions.query.LbqWrapper;
|
|
|
import com.github.zuihou.injection.annonation.InjectionResult;
|
|
|
import com.github.zuihou.utils.BeanPlusUtil;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.compress.utils.Lists;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
@@ -44,6 +52,9 @@ import static com.github.zuihou.utils.BizAssert.isFalse;
|
|
|
|
|
|
public class ShelvesServiceImpl extends SuperCacheServiceImpl<ShelvesMapper, Shelves> implements ShelvesService {
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private UserService userService;
|
|
|
+
|
|
|
@Override
|
|
|
protected String getRegion() {
|
|
|
return TENANT;
|
|
|
@@ -115,8 +126,12 @@ public class ShelvesServiceImpl extends SuperCacheServiceImpl<ShelvesMapper, She
|
|
|
public List<Shelves> shelvesTreeList(){
|
|
|
//[{id=xx,name=xx,children=[{id=xx,name=xx}]}]
|
|
|
List<Shelves> returnList = new ArrayList<Shelves>();
|
|
|
- List<Shelves> list = baseMapper.selectList(Wraps.<Shelves>lbQ().eq(Shelves::getStatus,1).orderByAsc(Shelves::getWeight));
|
|
|
+ LbqWrapper<Shelves> queryWrapper = Wraps.<Shelves>lbQ();
|
|
|
+ queryWrapper.eq(Shelves::getStatus,1).orderByAsc(Shelves::getWeight);
|
|
|
|
|
|
+ IPage<Shelves> shelves = baseMapper.shelvesTreeList(new Page<Shelves>(1L,50), queryWrapper, new DataScope());
|
|
|
+ //Map shelvesIPage = baseMapper.shelvesTreeList(, new DataScope());
|
|
|
+ List<Shelves> list = (shelves!=null)? (List<Shelves>)shelves.getRecords() : Lists.newArrayList();
|
|
|
for(Shelves map:list){
|
|
|
//一级
|
|
|
if(0 == (map.getParentId()==null?0:map.getParentId().longValue())) {
|