ludc
2024-11-15 600c2ebb55b18d687ff848cb6c9d9a61b8bfa307
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebBtmIOServiceImpl.java
@@ -762,7 +762,14 @@
                    attributes.stream().forEach( t -> {
                        int index = indexMap.get("index");
                        Map<String,Object> columnData = attributeToWordMap(t,index);
                        Map<String,Object> columnData = null;
                        try {
                            columnData = attributeToWordMap(t,index);
                        } catch (PLException e) {
                            e.printStackTrace();
                            String exceptionMessage = "将属性对象拷贝到word数据对象中时出现错误,原因:"+VciBaseUtil.getExceptionMessage(e);
                            logger.error(exceptionMessage);
                        }
                        indexMap.put("index",index+1);
                        columnDataList.add(columnData);
                    });
@@ -804,7 +811,14 @@
                    indexMap.put("index",1);
                    attributes.stream().forEach( t -> {
                        int index = indexMap.get("index");
                        Map<String,Object> columnData = attributeToWordMap(t,index);
                        Map<String,Object> columnData = null;
                        try {
                            columnData = attributeToWordMap(t,index);
                        } catch (PLException e) {
                            e.printStackTrace();
                            String exceptionMessage = "将属性对象拷贝到word数据对象中时出现错误,原因:"+VciBaseUtil.getExceptionMessage(e);
                            logger.error(exceptionMessage);
                        }
                        indexMap.put("index",index+1);
                        columnDataList.add(columnData);
                    });
@@ -920,7 +934,15 @@
        if(!CollectionUtils.isEmpty(linkTypeVOList)){
            linkTypeVOList.stream().forEach(linkTypeVO->{
                String linkTypeId = linkTypeVO.getId();
                List<OsLinkTypeAttributeVO> attributeVOS = linkTypeService.listAttributeByLinkId(linkTypeId);
                List<OsLinkTypeAttributeVO> attributeVOS = null;
                try {
                    attributeVOS = linkTypeService.listAttributeByLinkId(linkTypeId);
                } catch (PLException e) {
                    e.printStackTrace();
                    String errorLog = "查询链接类型时出现错误,原因:"+VciBaseUtil.getExceptionMessage(e);
                    logger.error(errorLog);
                    throw new VciBaseException(errorLog);
                }
                //先是名称
                int rowIndex = index[0];
                WriteExcelData idED = new WriteExcelData(rowIndex, 0, linkTypeId);
@@ -1063,7 +1085,7 @@
     * @param index 索引
     * @return 数据映射,key 是word里的域字段,value是对应的值
     */
    private  Map<String,Object> attributeToWordMap(OsBtmTypeAttributeVO btmTypeAttributeVO,int index){
    private  Map<String,Object> attributeToWordMap(OsBtmTypeAttributeVO btmTypeAttributeVO,int index) throws PLException {
        Map<String,Object> columnData = new HashMap<>();
        if(StringUtils.isNotBlank(wordFieldProperties.getColumnIndex())) {
            columnData.put(wordFieldProperties.getColumnIndex(), index);