| | |
| | | import com.vci.starter.web.annotation.log.VciUnLog; |
| | | import com.vci.starter.web.enumpck.BooleanEnum; |
| | | import com.vci.starter.web.exception.VciBaseException; |
| | | import com.vci.starter.web.pagemodel.BaseResult; |
| | | import com.vci.starter.web.pagemodel.DataGrid; |
| | | import com.vci.starter.web.pagemodel.PageHelper; |
| | | import com.vci.starter.web.pagemodel.Tree; |
| | | import com.vci.starter.web.util.BeanUtil; |
| | | import com.vci.starter.web.util.VciBaseUtil; |
| | | import com.vci.starter.web.util.VciDateUtil; |
| | |
| | | import com.vci.web.util.ConcurrentDateFormat; |
| | | import com.vci.web.util.Func; |
| | | import com.vci.web.util.PlatformClientUtil; |
| | | import com.vci.web.util.WebUtil; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | ervo.setTabRelViewList(relationVOList); |
| | | return ervo; |
| | | } |
| | | /** |
| | | * 获取所有业务类型(树形结构) |
| | | * @return 查询结果 |
| | | */ |
| | | @Override |
| | | public BaseResult<List<Tree>> getTreeBizTypes() throws PLException { |
| | | List<Tree> rootTreeList = new ArrayList<>(); |
| | | BizType[] bizTypes = getBizTypes(""); |
| | | BizType btItem = null; |
| | | for(int i = 0; i < bizTypes.length; i++){ |
| | | btItem = bizTypes[i]; |
| | | if(btItem.fName.equals("")){ |
| | | Tree tree = new Tree(); |
| | | tree.setOid(btItem.oid); |
| | | tree.setParentName(null); |
| | | tree.setParentId(null); |
| | | tree.setLeaf(true); |
| | | tree.setText(btItem.description); |
| | | tree.setAttributes(WebUtil.objectToMapString(btItem)); |
| | | tree.setChildren(getChildren(bizTypes,btItem)); |
| | | rootTreeList.add(tree); |
| | | } |
| | | } |
| | | |
| | | return BaseResult.success(rootTreeList); |
| | | } |
| | | |
| | | private List<Tree> getChildren(BizType[] bizTypes,BizType parentBIzType){ |
| | | List<Tree> trees= new ArrayList<>(); |
| | | for (BizType bizType : bizTypes) { |
| | | if(StringUtils.isBlank(bizType.fName)){ |
| | | continue; |
| | | } |
| | | if(bizType.fName.equals(parentBIzType.name)){ |
| | | Tree tree = new Tree(); |
| | | tree.setOid(bizType.oid); |
| | | tree.setParentName(parentBIzType.fName); |
| | | tree.setParentId(parentBIzType.oid); |
| | | tree.setLeaf(true); |
| | | tree.setText(bizType.description); |
| | | tree.setAttributes(WebUtil.objectToMapString(bizType)); |
| | | tree.setChildren(getChildren(bizTypes,bizType)); |
| | | trees.add(tree); |
| | | } |
| | | } |
| | | return trees; |
| | | } |
| | | |
| | | /** |
| | | * 将业务类型拼接json |