|
@@ -1,11 +1,14 @@
|
|
|
package com.platform.rest.controller.store;
|
|
|
|
|
|
import com.platform.common.util.R;
|
|
|
+import com.platform.dao.dto.sb.SbTypeDTO;
|
|
|
import com.platform.dao.dto.store.StoreDTO;
|
|
|
import com.platform.dao.entity.store.Store;
|
|
|
+import com.platform.dao.enums.StoreLevelEnum;
|
|
|
import com.platform.dao.util.TreeUtil;
|
|
|
import com.platform.dao.vo.query.store.InStoreFormVO;
|
|
|
import com.platform.dao.vo.query.store.StoreVO;
|
|
|
+import com.platform.dao.vo.sb.SbTypeVO;
|
|
|
import com.platform.service.store.StoreService;
|
|
|
import com.platform.dao.util.ExcelUtil;
|
|
|
import com.platform.dao.vo.export.store.ExportStoreVO;
|
|
@@ -21,6 +24,7 @@ import com.platform.common.bean.AbstractPageResultBean;
|
|
|
import com.platform.rest.log.annotation.SysLog;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
@@ -181,4 +185,31 @@ public class StoreController {
|
|
|
public R queryTree(StoreDTO storeDTO) {
|
|
|
return new R<>(TreeUtil.buildStoreTree(storeService.getModelListByDTO(storeDTO), ""));
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取设备tables tree
|
|
|
+ *
|
|
|
+ * @param storeDTO 仓库DTO
|
|
|
+ * @return R
|
|
|
+ */
|
|
|
+ @GetMapping("tableTree")
|
|
|
+ public R queryTableTree(StoreDTO storeDTO) {
|
|
|
+
|
|
|
+ List<Store> typeList= storeService.getModelListByDTO(storeDTO);
|
|
|
+ List<Store> parentList = new ArrayList<Store>();
|
|
|
+ for(Store type: typeList){
|
|
|
+ if(type.getLevel().equals(StoreLevelEnum.ZONGCANG.getValue())){
|
|
|
+ Store parent = type;
|
|
|
+ List<Store> children = new ArrayList<Store>();
|
|
|
+ for(Store child: typeList){
|
|
|
+ if(type.getId().equals(child.getParentId())){
|
|
|
+ children.add(child);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ parent.setChildren(children);
|
|
|
+ parentList.add(parent);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return new R<>(parentList);
|
|
|
+ }
|
|
|
}
|