ÎļþÃû´Ó lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/base/util/FindsBaseFactorysChildrenUtil.java ÐÞ¸Ä |
| | |
| | | package org.jeecg.modules.eam.base.util; |
| | | package org.jeecg.modules.system.util; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.modules.eam.base.entity.BaseFactory; |
| | | import org.jeecg.modules.eam.base.model.EamBaseFactoryTreeModel; |
| | | import org.jeecg.modules.eam.base.model.WorkShopIdModel; |
| | | import org.jeecg.modules.system.entity.BaseFactory; |
| | | import org.jeecg.modules.system.model.EamBaseFactoryIdModel; |
| | | import org.jeecg.modules.system.model.EamBaseFactoryTreeModel; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | |
| | | * è¯¥æ¹æ³æ¯så°BaseFactoryç±»åçlistéåè½¬æ¢æEamBaseFactoryTreeModelç±»åçéå |
| | | */ |
| | | public static List<EamBaseFactoryTreeModel> wrapTreeDataToTreeList(List<BaseFactory> recordList) { |
| | | List<WorkShopIdModel> idList = new ArrayList<>(); |
| | | List<EamBaseFactoryIdModel> idList = new ArrayList<>(); |
| | | List<EamBaseFactoryTreeModel> records = new ArrayList<>(); |
| | | for (int i = 0; i < recordList.size(); i++) { |
| | | BaseFactory BaseFactory = recordList.get(i); |
| | |
| | | * queryTreeListçåæ¹æ³ ====1===== |
| | | * è¯¥æ¹æ³æ¯æ¾å°å¹¶å°è£
顶级ç¶ç±»çèç¹å°TreeListéå |
| | | */ |
| | | public static List<EamBaseFactoryTreeModel> findChildren(List<EamBaseFactoryTreeModel> recordList, List<WorkShopIdModel> workShopIdModelList) { |
| | | public static List<EamBaseFactoryTreeModel> findChildren(List<EamBaseFactoryTreeModel> recordList, List<EamBaseFactoryIdModel> EamBaseFactoryIdModelList) { |
| | | List<EamBaseFactoryTreeModel> treeList = new ArrayList<>(); |
| | | for (int i = 0; i < recordList.size(); i++) { |
| | | EamBaseFactoryTreeModel branch = recordList.get(i); |
| | | if (oConvertUtils.isEmpty(branch.getParentId())) { |
| | | treeList.add(branch); |
| | | WorkShopIdModel WorkShopIdModel = new WorkShopIdModel().convert(branch); |
| | | workShopIdModelList.add(WorkShopIdModel); |
| | | EamBaseFactoryIdModel EamBaseFactoryIdModel = new EamBaseFactoryIdModel().convert(branch); |
| | | EamBaseFactoryIdModelList.add(EamBaseFactoryIdModel); |
| | | } |
| | | } |
| | | getGrandChildren(treeList, recordList, workShopIdModelList); |
| | | getGrandChildren(treeList, recordList, EamBaseFactoryIdModelList); |
| | | return treeList; |
| | | } |
| | | |
| | |
| | | * queryTreeListçåæ¹æ³====3==== |
| | | *è¯¥æ¹æ³æ¯æ¾å°é¡¶çº§ç¶ç±»ä¸çææåèç¹éåå¹¶å°è£
å°TreeListéå |
| | | */ |
| | | private static void getGrandChildren(List<EamBaseFactoryTreeModel> treeList, List<EamBaseFactoryTreeModel> recordList, List<WorkShopIdModel> idList) { |
| | | private static void getGrandChildren(List<EamBaseFactoryTreeModel> treeList, List<EamBaseFactoryTreeModel> recordList, List<EamBaseFactoryIdModel> idList) { |
| | | for (int i = 0; i < treeList.size(); i++) { |
| | | EamBaseFactoryTreeModel model = treeList.get(i); |
| | | WorkShopIdModel idModel = idList.get(i); |
| | | EamBaseFactoryIdModel idModel = idList.get(i); |
| | | for (int i1 = 0; i1 < recordList.size(); i1++) { |
| | | EamBaseFactoryTreeModel m = recordList.get(i1); |
| | | if (m.getParentId() != null && m.getParentId().equals(model.getId())) { |
| | | model.getChildren().add(m); |
| | | WorkShopIdModel pim = new WorkShopIdModel().convert(m); |
| | | EamBaseFactoryIdModel pim = new EamBaseFactoryIdModel().convert(m); |
| | | idModel.setSelectable(false); |
| | | idModel.getChildren().add(pim); |
| | | } |
| | |
| | | /** |
| | | * è·å DepartIdModel |
| | | */ |
| | | public static List<WorkShopIdModel> wrapTreeDataToProductionIdTreeList(List<BaseFactory> recordList) { |
| | | List<WorkShopIdModel> idList = new ArrayList<>(); |
| | | public static List<EamBaseFactoryIdModel> wrapTreeDataToProductionIdTreeList(List<BaseFactory> recordList) { |
| | | List<EamBaseFactoryIdModel> idList = new ArrayList<>(); |
| | | List<EamBaseFactoryTreeModel> records = new ArrayList<>(); |
| | | for (int i = 0; i < recordList.size(); i++) { |
| | | BaseFactory BaseFactory = recordList.get(i); |