| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.vci.ubcs.code.webservice.mapper.DockingPreClassifyMapper; |
| | | import com.vci.ubcs.code.webservice.service.IDockingPreApplyFormService; |
| | | import com.vci.ubcs.code.webservice.service.IDockingPreAttrMappingService; |
| | | import com.vci.ubcs.code.webservice.service.IDockingPreClassifyService; |
| | | import com.vci.ubcs.code.webservice.service.IDockingPreViewModelService; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | import java.util.Locale; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 上级节点的属性名称 |
| | | */ |
| | | public static final String PARENT_FIELD_NAME = "parentCodeClassifyOid"; |
| | | public static final String PARENT_FIELD_NAME = "pid"; |
| | | /*** |
| | | * 集团分类属性 |
| | | */ |
| | |
| | | @Override |
| | | public List<Tree> treeCompanyGroupClassify(TreeQueryObject treeQueryObject) { |
| | | log.info("获取集团分类树start..."); |
| | | |
| | | Map<String,String> conditionMap= treeQueryObject.getConditionMap(); |
| | | if(conditionMap==null){ |
| | | conditionMap=new HashMap<>(); |
| | | } |
| | | TreeWrapperOptions treeWrapperOptions = new TreeWrapperOptions(PARENT_FIELD_NAME.toLowerCase(Locale.ROOT)); |
| | | treeWrapperOptions.copyFromTreeQuery(treeQueryObject); |
| | | List<DockingPreClassifyVO> dockingPreClassifyVOS= getCompanyGourpClassByParentId(treeQueryObject.getParentOid(),true); |
| | | List<DockingPreClassifyVO> dockingPreClassifyVOS= getCompanyGourpClassByParentId(treeQueryObject.getParentOid(),false); |
| | | List<Tree> tree= revisionModelUtil.doList2Trees(dockingPreClassifyVOS,treeWrapperOptions,(DockingPreClassifyVO s) ->{ |
| | | //可以在这里处理树节点的显示 |
| | | return s.getId() + " " + s.getName();//(FrameworkDataLCStatus.DISABLED.getValue().equalsIgnoreCase(s.getLcStatus()) ? (" 【停用】 ") : ""); |
| | | }); |
| | | |
| | | setTreeConig(tree,conditionMap); |
| | | log.info("获取集团分类树end..."); |
| | | return tree; |
| | | } |
| | | private void setTreeConig(List<Tree> tree,Map<String,String >conditionMap){ |
| | | boolean checkHasChild=false; |
| | | Iterator var6 = tree.listIterator(); |
| | | while(var6.hasNext()){ |
| | | Tree trees = (Tree) var6.next(); |
| | | boolean checkHasChild=dockingPreClassifyMapper.checkHasChild(trees.getOid()); |
| | | List<Tree> childrenList=trees.getChildren(); |
| | | if(childrenList.size()>0){ |
| | | checkHasChild=true; |
| | | } |
| | | boolean checkHas=false; |
| | | //如果与条件传过来的值匹配的上则设置为选中 |
| | | if(conditionMap.containsKey(MdmBtmTypeConstant.CODE_CLASSIFY_OID_FIELD)){ |
| | | String codeClassifyId=conditionMap.get(MdmBtmTypeConstant.CODE_CLASSIFY_OID_FIELD); |
| | | boolean checkHas=dockingPreAttrMappingService.checkHasConfigByTragetCodeclassifyId(codeClassifyId); |
| | | if(checkHas) { |
| | | trees.setChecked(true); |
| | | } |
| | | checkHas = dockingPreAttrMappingService.checkHasConfigByTragetCodeclassifyId(codeClassifyId, trees.getOid()); |
| | | } |
| | | ; |
| | | if (checkHas) { |
| | | trees.setChecked(true); |
| | | } |
| | | if(checkHasChild){ |
| | | trees.setLeaf(false); |
| | | }else{ |
| | | trees.setLeaf(true); |
| | | } |
| | | if(checkHasChild) { |
| | | setTreeConig(childrenList,conditionMap); |
| | | } |
| | | } |
| | | log.info("获取集团分类树end..."); |
| | | return tree; |
| | | |
| | | } |
| | | |
| | | /*** |