From a471b20fe8075a663f32b3a2ee0cd70c1c63baf7 Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期四, 21 十一月 2024 21:59:42 +0800
Subject: [PATCH] 业务类型查询:树查询修改,数据列表查询接口修改(处理模板套模板情况下freemarker表达式的替换处理)。

---
 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebBtmIOServiceImpl.java |   59 ++++++++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 40 insertions(+), 19 deletions(-)

diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebBtmIOServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebBtmIOServiceImpl.java
index 95693ac..43a3303 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebBtmIOServiceImpl.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebBtmIOServiceImpl.java
@@ -735,7 +735,7 @@
                 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);
@@ -743,7 +743,7 @@
                 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);
@@ -751,7 +751,7 @@
                 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);
@@ -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);
                     });
@@ -851,7 +865,13 @@
         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);
@@ -894,7 +914,7 @@
                     //鐒跺悗灞炴�х殑涓枃鍚嶇О
                     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() ? "鏄�" : "鍚�"));
                     //灞炴�ч暱搴�
@@ -914,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);
@@ -1057,14 +1085,14 @@
      * @param index 绱㈠紩
      * @return 鏁版嵁鏄犲皠,key 鏄痺ord閲岀殑鍩熷瓧娈碉紝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);
         }
         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 = "瀛楃涓�";
@@ -1194,15 +1222,8 @@
         } else {
             btmItem.verRuleName = 0;
         }
-        //鍖呭惈鐨勫睘鎬х殑鏁扮粍
-        List<OsBtmTypeLinkAttributesDTO> attributesDTOList = btmTypeDTO.getAttributes();
-        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(",");
     }
 
     /**

--
Gitblit v1.9.3