| | |
| | | * @param statusDTOList 要导入的状态的数据传输对象列表 |
| | | * @throws VciBaseException 查询或者执行出错的时候会抛出异常 |
| | | */ |
| | | private void importStatus( Collection<OsStatusDTO> statusDTOList) throws VciBaseException{ |
| | | private void importStatus( Collection<OsStatusDTO> statusDTOList) throws Exception { |
| | | //要导入的状态的所有英文名称 |
| | | List<String> statusIdList = new ArrayList<String>(); |
| | | Iterator<OsStatusDTO> iterator = statusDTOList.iterator(); |
| | |
| | | * @param lifeCycleDTOList 要导入的生命周期数据传输对象列表 |
| | | * @throws VciBaseException 查询或者保存出错的时候,会抛出异常 |
| | | */ |
| | | private void importLifeCycles(Collection<OsLifeCycleDTO> lifeCycleDTOList) throws VciBaseException{ |
| | | private void importLifeCycles(Collection<OsLifeCycleDTO> lifeCycleDTOList) throws VciBaseException, PLException { |
| | | Set<String> existLifeCycleIds = lifeCycleService.selectAllLifeCycleMap().keySet(); |
| | | //生命周期的名称没有转为小写,但是平台又区分大小写 |
| | | List<String> existLifeCycleLowIds = existLifeCycleIds.stream().map(s->s.toLowerCase(Locale.ROOT)).collect(Collectors.toList()); |
| | |
| | | lifeCyle.ts = VciDateUtil.getNowString(VciDateUtil.DateTimeMillFormat); |
| | | lifeCyle.name = lifeCycleDTO.getId(); |
| | | }else { |
| | | lifeCyle = lifeCycleService.lifeCycleVO2DO( allLifeCycleLowMap.get(lifeCycleId)); |
| | | lifeCyle = lifeCycleService.lifeCycleVO2DO(allLifeCycleLowMap.get(lifeCycleId)); |
| | | edit = true; |
| | | } |
| | | lifeCyle.tag = lifeCycleDTO.getName(); |
| | |
| | | OsBtmTypeAttributeVO idAttrVO = new OsBtmTypeAttributeVO(); |
| | | idAttrVO.setId("id"); |
| | | idAttrVO.setName("编号"); |
| | | idAttrVO.setAttrDataType(VciFieldTypeEnum.VTString.name()); |
| | | idAttrVO.setAttributeDataType(VciFieldTypeEnum.VTString.name()); |
| | | idAttrVO.setAttributeLength(50); |
| | | idAttrVO.setNullableFlag(true); |
| | | attributes.add(idAttrVO); |
| | |
| | | OsBtmTypeAttributeVO nameAttrVO = new OsBtmTypeAttributeVO(); |
| | | nameAttrVO.setId("name"); |
| | | nameAttrVO.setName("名称"); |
| | | nameAttrVO.setAttrDataType(VciFieldTypeEnum.VTString.name()); |
| | | nameAttrVO.setAttributeDataType(VciFieldTypeEnum.VTString.name()); |
| | | nameAttrVO.setAttributeLength(50); |
| | | nameAttrVO.setNullableFlag(true); |
| | | attributes.add(nameAttrVO); |
| | |
| | | OsBtmTypeAttributeVO descAttrVO = new OsBtmTypeAttributeVO(); |
| | | descAttrVO.setId("description"); |
| | | descAttrVO.setName("描述"); |
| | | descAttrVO.setAttrDataType(VciFieldTypeEnum.VTString.name()); |
| | | descAttrVO.setAttributeDataType(VciFieldTypeEnum.VTString.name()); |
| | | descAttrVO.setAttributeLength(150); |
| | | descAttrVO.setNullableFlag(true); |
| | | attributes.add(descAttrVO); |
| | |
| | | if(!CollectionUtils.isEmpty(btmTypeVOList)) { |
| | | btmTypeVOList.stream().forEach(btmTypeVO -> { |
| | | String btmId = btmTypeVO.getId(); |
| | | List<OsBtmTypeAttributeVO> attributeVOS = btmService.listAttributeByBtmId(btmId); |
| | | List<OsBtmTypeAttributeVO> attributeVOS = null; |
| | | try { |
| | | attributeVOS = btmService.listAttributeByBtmId(btmId); |
| | | } catch (PLException e) { |
| | | e.printStackTrace(); |
| | | throw new VciBaseException(VciBaseUtil.getExceptionMessage(e)); |
| | | } |
| | | //先是名称 |
| | | int rowIndex = index[0]; |
| | | WriteExcelData idED = new WriteExcelData(rowIndex, 0, btmId); |
| | |
| | | //然后属性的中文名称 |
| | | rowDataList.add(new WriteExcelData(rowIndex, 3, attributeVO.getName())); |
| | | //属性的类型 |
| | | rowDataList.add(new WriteExcelData(rowIndex, 4, VciFieldTypeEnum.getTextByValue(attributeVO.getAttrDataType()))); |
| | | rowDataList.add(new WriteExcelData(rowIndex, 4, VciFieldTypeEnum.getTextByValue(attributeVO.getAttributeDataType()))); |
| | | //是否可以为空 |
| | | rowDataList.add(new WriteExcelData(rowIndex, 5, attributeVO.isNullableFlag() ? "是" : "否")); |
| | | //属性长度 |
| | |
| | | } |
| | | columnData.put(wordFieldProperties.getColumnId(),btmTypeAttributeVO.getId().toLowerCase()); |
| | | columnData.put(wordFieldProperties.getColumnName(),btmTypeAttributeVO.getName()); |
| | | String attrDataType = btmTypeAttributeVO.getAttrDataType(); |
| | | String attrDataType = btmTypeAttributeVO.getAttributeDataType(); |
| | | String columnType = VciFieldTypeEnum.getTextByValue(attrDataType); |
| | | if(StringUtils.isBlank(columnType)){ |
| | | columnType = "字符串"; |
| | |
| | | } else { |
| | | btmItem.verRuleName = 0; |
| | | } |
| | | //包含的属性的数组 |
| | | List<OsBtmTypeLinkAttributesDTO> attributesDTOList = btmTypeDTO.getAttributesDTOList(); |
| | | List<String> attrIdList = new ArrayList<String>(); |
| | | if (!CollectionUtils.isEmpty(attributesDTOList)) { |
| | | for (OsBtmTypeLinkAttributesDTO attr : attributesDTOList) { |
| | | attrIdList.add(attr.getId().toLowerCase()); |
| | | } |
| | | } |
| | | btmItem.apNameArray = attrIdList.toArray(new String[0]); |
| | | //包含的属性名称 |
| | | btmItem.apNameArray = btmTypeDTO.getApNameArray().split(","); |
| | | } |
| | | |
| | | /** |