From bbf34989894913f3db3f785c79d30069397ce11e Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期三, 31 七月 2024 15:02:07 +0800
Subject: [PATCH] 属性池、状态池、枚举导出列名调整,可通过变量控制导出的列名是否和导入模板的一致;版本管理查询、查看应用范围接口上传。

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

diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsAttributeServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsAttributeServiceImpl.java
index 8b6c442..0f92bad 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsAttributeServiceImpl.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsAttributeServiceImpl.java
@@ -7,6 +7,7 @@
 import com.vci.client.mw.ClientSessionUtility;
 import com.vci.corba.common.PLException;
 import com.vci.corba.omd.atm.AttributeDef;
+import com.vci.corba.omd.vrm.VersionRule;
 import com.vci.dto.OsAttributeDTO;
 import com.vci.dto.OsEnumDTO;
 import com.vci.dto.OsEnumItemDTO;
@@ -866,22 +867,18 @@
 	 * 瀵煎嚭閫変腑鐨勫睘鎬�
 	 * @param exportFileName 瀵煎嚭鐨勬枃浠跺悕
 	 * @param attrNames 闇�瑕佸鍑虹殑灞炴�у悕绉�
+	 * @param flag 鎺у埗瀵煎嚭鐨勫垪鍚嶆槸鍚﹀拰瀵煎叆妯℃澘涓�鑷�
 	 * @return
 	 */
 	@Override
-	public String exportAttributes(String exportFileName, String attrNames) throws PLException {
+	public String exportAttributes(String exportFileName, String attrNames,boolean flag/*鎺у埗瀵煎嚭鐨勫垪鍚嶆槸鍚﹀拰瀵煎叆妯℃澘涓�鑷�*/) throws PLException {
 		if(Func.isBlank(attrNames)){
 			throw new PLException("500",new String[]{"璇峰嬀閫夎瀵煎嚭鐨勫睘鎬�!"});
 		}
 		//鐣岄潰娌′紶鍚嶇О锛屼娇鐢ㄩ粯璁ゅ鍑哄悕绉�
 		exportFileName = Func.isBlank(exportFileName) ?  "灞炴�ф睜涓睘鎬у鍑篲" + Func.format(new Date(),"yyyy-MM-dd HHmmss.sss"):exportFileName;
 		//璁剧疆鍒楀悕
-		List<String> columns = new ArrayList<>(
-				Arrays.asList("灞炴�у悕", "鏍囩", "鎻忚堪",
-						"灞炴�х被鍨�", "鍏佽涓虹┖", "榛樿鍊�", "浣跨敤鐨勬灇涓捐嫳鏂囧悕绉�(鏋氫妇鍚�)",
-						"浣跨敤鐨勬灇涓句腑鏂囧悕绉�(鏍囩)", "鍙傜収鐨勪笟鍔$被鍨嬬紪鍙�", "鍙傜収鐨勪笟鍔$被鍨嬪悕绉�",
-						"鍙傜収鐨勯摼鎺ョ被鍨嬪悕绉�","鐗堟湰鐗堟","灞炴�ч暱搴�", "灏忔暟绮惧害浣嶆暟","灏忔暟鍒诲害浣嶆暟","鍙栧�艰寖鍥�","鍒涘缓鏃堕棿")
-		);
+		List<String> columns = this.getCloumns(flag);
 
 		//鍐檈xcel
 		String excelPath = LocalFileUtil.getDefaultTempFolder() + File.separator + exportFileName +  ".xls";
@@ -913,21 +910,46 @@
 				excelDataList.add(new WriteExcelData(i+1,4, osAttributeVO.isNullableFlag()));
 				excelDataList.add(new WriteExcelData(i+1,5, osAttributeVO.getDefaultValue()));
 				excelDataList.add(new WriteExcelData(i+1,6, osAttributeVO.getEnumId()));
-				excelDataList.add(new WriteExcelData(i+1,7, osAttributeVO.getEnumName()));
-				excelDataList.add(new WriteExcelData(i+1,8, osAttributeVO.getBtmTypeId()));
-				excelDataList.add(new WriteExcelData(i+1,9, osAttributeVO.getBtmTypeName()));
-				excelDataList.add(new WriteExcelData(i+1,10, osAttributeVO.getAttrLength()));
-				excelDataList.add(new WriteExcelData(i+1,11, osAttributeVO.getLinkTypeName()));
-				excelDataList.add(new WriteExcelData(i+1,12, osAttributeVO.getVersion()));
-				excelDataList.add(new WriteExcelData(i+1,13, osAttributeVO.getPrecisionLength()));
-				excelDataList.add(new WriteExcelData(i+1,14, osAttributeVO.getScaleLength()));
-				excelDataList.add(new WriteExcelData(i+1,15, osAttributeVO.getRange()));
-				excelDataList.add(new WriteExcelData(i+1,16, osAttributeVO.getCreateTime()));
+				//excelDataList.add(new WriteExcelData(i+1,7, osAttributeVO.getEnumName()));
+				excelDataList.add(new WriteExcelData(i+1,7, osAttributeVO.getBtmTypeId()));
+				//excelDataList.add(new WriteExcelData(i+1,9, osAttributeVO.getBtmTypeName()));
+				excelDataList.add(new WriteExcelData(i+1,8, osAttributeVO.getAttrLength()));
+				excelDataList.add(new WriteExcelData(i+1,9, osAttributeVO.getLinkTypeName()));
+				excelDataList.add(new WriteExcelData(i+1,10, osAttributeVO.getVersion()));
+				excelDataList.add(new WriteExcelData(i+1,11, osAttributeVO.getPrecisionLength()));
+				excelDataList.add(new WriteExcelData(i+1,12, osAttributeVO.getScaleLength()));
+				excelDataList.add(new WriteExcelData(i+1,13, osAttributeVO.getRange()));
+				if(!flag){
+					excelDataList.add(new WriteExcelData(i+1,14, Func.format(osAttributeVO.getCreateTime(),"yyyy骞碝M鏈坉d鏃� hh:mm:ss")));
+				}
 			}
 		}
 		WriteExcelOption excelOption = new WriteExcelOption(excelDataList);
 		ExcelUtil.writeDataToFile(excelPath, excelOption);
 		return excelPath;
+	}
+
+	/**
+	 * 鑾峰彇瀵煎嚭鎴栧鍏ユā鏉跨殑鍒楀悕
+	 * @param flag 鏄惁鑾峰彇瀵煎叆妯℃澘鍒楀悕
+	 * @return
+	 */
+	private List<String> getCloumns(boolean flag){
+		if(flag){
+			return new ArrayList<>(
+					Arrays.asList("灞炴�у悕", "鏍囩", "鎻忚堪",
+							"灞炴�х被鍨�(鍙傜収鏂板鐣岄潰鐨勫睘鎬х被鍨嬪VTString)", "鍏佽涓虹┖(鏄�/鍚�)", "榛樿鍊�", "浣跨敤鐨勬灇涓捐嫳鏂囧悕绉�"
+							, "鍙傜収鐨勪笟鍔$被鍨嬬紪鍙�","鍙傜収鐨勯摼鎺ョ被鍨嬬紪鍙�","鐗堟湰鐗堟","灞炴�ч暱搴�", "灏忔暟绮惧害浣嶆暟","灏忔暟鍒诲害浣嶆暟"
+							,"鍙栧�艰寖鍥�"
+					)
+			);
+		}
+		return new ArrayList<>(
+				Arrays.asList("灞炴�у悕", "鏍囩", "鎻忚堪",
+						"灞炴�х被鍨�", "鍏佽涓虹┖", "榛樿鍊�", "浣跨敤鐨勬灇涓捐嫳鏂囧悕绉�(鏋氫妇鍚�)",
+						"鍙傜収鐨勪笟鍔$被鍨嬬紪鍙�", "鍙傜収鐨勯摼鎺ョ被鍨嬬紪鍙�","鐗堟湰鐗堟","灞炴�ч暱搴�",
+						"灏忔暟绮惧害浣嶆暟","灏忔暟鍒诲害浣嶆暟","鍙栧�艰寖鍥�","鍒涘缓鏃堕棿")
+		);
 	}
 
 	/**
@@ -941,11 +963,7 @@
 		//鐣岄潰娌′紶鍚嶇О锛屼娇鐢ㄩ粯璁ゅ鍑哄悕绉�
 		exportFileName = Func.isBlank(exportFileName) ?  "灞炴�ф睜瀵煎叆妯℃澘_" + Func.format(new Date(),"yyyy-MM-dd HHmmss.sss"):exportFileName;
 		//璁剧疆鍒楀悕
-		List<String> columns = new ArrayList<>(
-				Arrays.asList("灞炴�у悕", "鏍囩", "鎻忚堪",
-						"灞炴�х被鍨�(璇峰弬鐓ф柊澧炵晫闈㈢殑灞炴�х被鍨嬪~鍐�)", "鍏佽涓虹┖(鏄�/鍚�)", "榛樿鍊�", "浣跨敤鐨勬灇涓捐嫳鏂囧悕绉�", "鍙傜収鐨勪笟鍔$被鍨嬬紪鍙�",
-						"鍙傜収鐨勯摼鎺ョ被鍨嬬紪鍙�","鐗堟湰鐗堟","灞炴�ч暱搴�", "灏忔暟绮惧害浣嶆暟","灏忔暟鍒诲害浣嶆暟","鍙栧�艰寖鍥�")
-		);
+		List<String> columns = this.getCloumns(true);
 		//璁剧疆蹇呭~鍒�
 		ColumnNameisRed.clear();
 		ColumnNameisRed.add(0);

--
Gitblit v1.9.3