| | |
| | | import com.vci.starter.poi.constant.ExcelLangCodeConstant; |
| | | import com.vci.starter.poi.util.ExcelUtil; |
| | | import com.vci.starter.web.annotation.log.VciUnLog; |
| | | import com.vci.starter.web.constant.QueryOptionConstant; |
| | | import com.vci.starter.web.enumpck.BooleanEnum; |
| | | import com.vci.starter.web.exception.VciBaseException; |
| | | import com.vci.starter.web.pagemodel.BaseResult; |
| | |
| | | * @return 属性的内容 |
| | | */ |
| | | @Override |
| | | public List<OsBtmTypeAttributeVO> listAttributeByBtmId(String btmId) { |
| | | public List<OsBtmTypeAttributeVO> listAttributeByBtmId(String btmId) throws PLException { |
| | | VciBaseUtil.alertNotNull(btmId,"业务类型的编号"); |
| | | OsBtmTypeVO btmTypeVO = getBtmById(btmId); |
| | | BizType[] bizTypes = platformClientUtil.getBtmService().getBizTypes(btmId); |
| | | if(Func.isEmpty(bizTypes)){ |
| | | return new ArrayList<>(); |
| | | } |
| | | BizType bizType = bizTypes[0]; |
| | | OsBtmTypeVO btmTypeVO = btmDO2VO(bizType); |
| | | List<OsBtmTypeAttributeVO> attributes = btmTypeVO.getAttributes(); |
| | | if(attributes == null){ |
| | | attributes = new ArrayList<>(); |
| | |
| | | * @return 属性的内容 |
| | | */ |
| | | @Override |
| | | public List<OsBtmTypeAttributeVO> listAttributeByBtmIdHasDefault(String btmId) { |
| | | public List<OsBtmTypeAttributeVO> listAttributeByBtmIdHasDefault(String btmId) throws PLException { |
| | | List<OsBtmTypeAttributeVO> attrVOs = listAttributeByBtmId(btmId); |
| | | if(attrVOs == null){ |
| | | attrVOs = new ArrayList<>(); |
| | |
| | | btmName = ""; |
| | | } |
| | | return platformClientUtil.getBtmService().getBizTypes(btmName); |
| | | } |
| | | |
| | | /** |
| | | * 业务类型列表查询,非树结构:用于UI定义左侧业务类型查询,只返回name和lable |
| | | * @param btmName |
| | | * @return |
| | | * @throws PLException |
| | | */ |
| | | @Override |
| | | public Tree getBizTree(String btmName) throws PLException { |
| | | if(null == btmName){ |
| | | btmName = ""; |
| | | } |
| | | Tree returnTree = new Tree(); |
| | | BizType[] bizTypes = platformClientUtil.getBtmService().getBizTypes(btmName); |
| | | if(Func.isEmpty(bizTypes)){ |
| | | return returnTree; |
| | | } |
| | | returnTree.setOid(""); |
| | | returnTree.setText("业务类型"); |
| | | returnTree.setLeaf(false); |
| | | List<Tree> trees = new ArrayList<>(); |
| | | Arrays.stream(bizTypes).forEach(bizType -> { |
| | | Tree tree = new Tree(); |
| | | tree.setText(bizType.name + " " +bizType.label); |
| | | tree.setOid(bizType.oid); |
| | | tree.setLeaf(true); |
| | | tree.setParentName(bizType.fName); |
| | | Map<String, String> atrrMap = new HashMap<>(); |
| | | atrrMap.put("name",bizType.name); |
| | | atrrMap.put("lable",bizType.label); |
| | | tree.setAttributes(atrrMap); |
| | | trees.add(tree); |
| | | }); |
| | | returnTree.setChildren(trees); |
| | | return returnTree; |
| | | } |
| | | |
| | | /** |
| | |
| | | public boolean addIndex(List<IndexObject> indexObjectList) throws PLException { |
| | | VciBaseUtil.alertNotNull(indexObjectList,"新增的索引信息"); |
| | | String btmName = indexObjectList.get(0).getTypeName(); |
| | | String indexNames = indexObjectList.stream().map(IndexObject::getIndexName).collect(Collectors.joining()); |
| | | String indexNames = indexObjectList.stream().map(IndexObject::getIndexName).collect(Collectors.joining(",")); |
| | | String[] oldindexAttr = {indexNames}; |
| | | BusinessObject bo; |
| | | List<BusinessObject> boList = new ArrayList<>(); |
| | | //先查询当前添加索引是否已经存在,如果存在就先删除再新增实现替换操作 |
| | | Map<String, String> conditionMap = new HashMap<>(); |
| | | conditionMap.put("typename",btmName); |
| | | //先这样处理,前端现在只做了单次保存,所以不用in |
| | | conditionMap.put("indexname", indexNames); |
| | | List<IndexObject> indexObjects = getIndexByCondition(conditionMap); |
| | | if(indexObjects!=null && indexObjects.size()>0){ |
| | | //索引不存在时删除就会报错索引不存在,所以这里有索引才去删除 |