From 28ca3d9f9e6e7eeeb7a7f2a7f50012350f3934c3 Mon Sep 17 00:00:00 2001 From: ludc Date: 星期三, 13 十一月 2024 18:07:11 +0800 Subject: [PATCH] 优化业务数据的查询接口;修改业务数据保存和编辑接口没有保存基础默认属性问题。 --- Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsEnumServiceImpl.java | 178 +++++++++++++++++++++++++++++++++++++++++------------------ 1 files changed, 123 insertions(+), 55 deletions(-) diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsEnumServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsEnumServiceImpl.java index 05f3a5c..3af82b5 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsEnumServiceImpl.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsEnumServiceImpl.java @@ -1,18 +1,18 @@ package com.vci.web.service.impl; import com.alibaba.fastjson.JSON; +import com.vci.client.common.providers.ClientServiceProvider; import com.vci.corba.common.PLException; -import com.vci.corba.common.data.UserEntityInfo; +import com.vci.corba.omd.atm.AttributeDef; import com.vci.corba.omd.data.BusinessObject; import com.vci.corba.omd.etm.EnumItem; import com.vci.corba.omd.etm.EnumType; import com.vci.dto.OsEnumDTO; import com.vci.dto.OsEnumItemDTO; -import com.vci.dto.SmUserDTO; +import com.vci.omd.objects.OtherInfo; import com.vci.omd.utils.ObjectTool; import com.vci.pagemodel.*; import com.vci.po.OsEnumPO; -import com.vci.po.SmUserPO; import com.vci.starter.poi.bo.ReadExcelOption; import com.vci.starter.poi.bo.WriteExcelData; import com.vci.starter.poi.bo.WriteExcelOption; @@ -89,7 +89,7 @@ /** * 蹇呭~鍒� */ - private ArrayList<Integer> ColumnNameisRed = new ArrayList<Integer>(); + private List<Integer> ColumnNameisRed = new ArrayList<Integer>(); /** * 鏃ュ織 @@ -253,18 +253,18 @@ if(Func.isBlank(enumName)){ throw new PLException("500",new String[]{"璇烽�夋嫨瑕佹煡璇㈠簲鐢ㄨ寖鍥寸殑鏋氫妇!"}); } - String[] attrubyteNames = platformClientUtil.getAttributeService().getAttrubyteNamesByEMName(enumName); - if(Func.isEmpty(attrubyteNames)){ + String[] attrubuteNames = platformClientUtil.getAttributeService().getAttrubyteNamesByEMName(enumName); + if(Func.isEmpty(attrubuteNames)){ return new ArrayList<>(); } - List<Map<String,String>> attrubyteMapList = new ArrayList<>(); - Arrays.stream(attrubyteNames).forEach(attrName->{ + List<Map<String,String>> attrubuteMapList = new ArrayList<>(); + Arrays.stream(attrubuteNames).forEach(attrName->{ Map<String, String> itemMap = new HashMap<>(); itemMap.put("enumName",enumName); itemMap.put("source",attrName); - attrubyteMapList.add(itemMap); + attrubuteMapList.add(itemMap); }); - return attrubyteMapList; + return attrubuteMapList; } /** @@ -362,12 +362,12 @@ String name = osEnumDTO.getName(); Date ts = osEnumDTO.getTs(); if(Func.isBlank(oid) || Func.isBlank(name) || Func.isEmpty(ts)){ - throw new PLException("500",new String[]{"寰呭垹闄ょ殑鏋氫妇鍒楄〃涓富閿�恛id銆戝拰璋冩暣鏃堕棿銆恡s銆戜笉鑳戒负绌猴紒"}); + throw new PLException("500",new String[]{"寰呭垹闄ょ殑鏋氫妇鍒楄〃涓富閿�恛id銆戙�佽皟鏁存椂闂淬�恡s銆戙�佸睘鎬у悕銆恘ame銆戜笉鑳戒负绌猴紒"}); } //鍒ゆ柇鏋氫妇鏄惁鏈夎寮曠敤 List<Map<String, String>> usedEnumList = this.getUsedEnumList(name); if(Func.isNotEmpty(usedEnumList)){ - throw new PLException("500",new String[]{"鍒犻櫎鐨勬灇涓句腑銆�" + name + "銆�,宸茶寮曠敤锛�"}); + throw new PLException("500",new String[]{"鍒犻櫎鐨勬灇涓句腑锛屾灇涓惧悕绉颁负锛氥��" + name + "銆�,宸茶寮曠敤锛�"}); } EnumType enumType = new EnumType(); enumType.oid = oid; @@ -388,14 +388,14 @@ * @return */ @Override - public String exportEnumTypes(String exportFileName,String enumNames) throws PLException { + public String exportEnumTypes(String exportFileName,String enumNames,boolean flag/*鎺у埗瀵煎嚭鐨勫垪鍚嶆槸鍚﹀拰瀵煎叆妯℃澘涓�鑷�*/) throws PLException { if(Func.isBlank(enumNames)){ 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"; @@ -421,39 +421,54 @@ if(Func.isEmpty(osEnumVO) && Func.isBlank(osEnumVO.getOid())){ throw new PLException("500",new String[]{"鏈煡璇㈠埌鏋氫妇鍚嶄负銆�" + enumNameList.get(i) + "銆戠殑鏋氫妇锛岃鍒锋柊鍚庨噸鏂板鍑�!"}); } - //鏋氫妇椤逛笉涓虹┖鏃堕渶瑕佽�冭檻鍚堝苟琛岄棶棰� + //鎸夌収瀵煎嚭鍒楀悕鎺у埗鍙橀噺鍜屾灇涓鹃」涓嶄负绌烘椂鍐冲畾鏄惁闇�瑕佽�冭檻鍚堝苟琛岄棶棰� List<OsEnumItemVO> enumVOItems = osEnumVO.getItems(); - //鏋氫妇椤逛笉涓虹┖鏃堕渶瑕佽繘琛屽悎骞惰澶勭悊 - if(Func.isNotEmpty(enumVOItems) || enumVOItems.size() > 1){ - //excelDataList.add(new WriteExcelData(startRow,(enumVOItems.size()+startRow)-1,true,true,0, osEnumVO.getOid())); - excelDataList.add(new WriteExcelData(startRow,(enumVOItems.size()+startRow)-1,true,true,0, osEnumVO.getId())); - excelDataList.add(new WriteExcelData(startRow,(enumVOItems.size()+startRow)-1,true,true,1, osEnumVO.getName())); - excelDataList.add(new WriteExcelData(startRow,(enumVOItems.size()+startRow)-1,true,true,2, osEnumVO.getEnumValueDataType()+"("+osEnumVO.getEnumValueDataTypeText()+")")); - excelDataList.add(new WriteExcelData(startRow,(enumVOItems.size()+startRow)-1,true,true,3, osEnumVO.getLength())); - //excelDataList.add(new WriteExcelData(startRow,(enumVOItems.size()+startRow)-1,true,true,5, osEnumVO.getCreator())); - excelDataList.add(new WriteExcelData(startRow,(enumVOItems.size()+startRow)-1,true,true,4, Func.format(osEnumVO.getCreateTime(),"yyyy骞碝M鏈坉d鏃� hh:mm:ss"))); - - //澶勭悊鏋氫妇椤瑰啓鍏� + //鍒ゆ柇鏄寜鐓т粈涔堝垪鍚嶅鍑� + if(flag){ for (int j = 0; j < enumVOItems.size(); j++) { OsEnumItemVO osEnumItemVO = enumVOItems.get(j); - excelDataList.add(new WriteExcelData(startRow+j,7, true,osEnumItemVO.getName())); - excelDataList.add(new WriteExcelData(startRow+j,8, true, osEnumItemVO.getValue())); - excelDataList.add(new WriteExcelData(startRow+j,9, true, osEnumItemVO.getDescription())); - } + excelDataList.add(new WriteExcelData(i+j+1,0, osEnumVO.getId())); + excelDataList.add(new WriteExcelData(i+j+1,1, osEnumVO.getName())); + excelDataList.add(new WriteExcelData(i+j+1,2, osEnumVO.getEnumValueDataType())); + excelDataList.add(new WriteExcelData(i+j+1,3, osEnumVO.getLength())); - startRow += enumVOItems.size(); + excelDataList.add(new WriteExcelData(i+j+1,4,osEnumItemVO.getName())); + excelDataList.add(new WriteExcelData(i+j+1,5, osEnumItemVO.getValue())); + excelDataList.add(new WriteExcelData(i+j+1,6, osEnumItemVO.getDescription())); + } }else{ - //鏋氫妇椤逛负绌烘椂灏变笉闇�瑕佸悎骞惰 - //excelDataList.add(new WriteExcelData(startRow,0, true,osEnumVO.getOid())); - excelDataList.add(new WriteExcelData(startRow,0, true, osEnumVO.getId())); - excelDataList.add(new WriteExcelData(startRow,1, true, osEnumVO.getName())); - excelDataList.add(new WriteExcelData(startRow,1, true, osEnumVO.getEnumValueDataType()+"("+osEnumVO.getEnumValueDataTypeText()+")")); - excelDataList.add(new WriteExcelData(startRow,3, true, osEnumVO.getLength())); - //excelDataList.add(new WriteExcelData(startRow,5, true, osEnumVO.getCreator())); - excelDataList.add(new WriteExcelData(startRow,4, true, Func.format(osEnumVO.getCreateTime(),"yyyy骞碝M鏈坉d鏃� hh:mm:ss"))); + //鏋氫妇椤逛笉涓虹┖鏃堕渶瑕佽繘琛屽悎骞惰澶勭悊 + if(Func.isNotEmpty(enumVOItems) || enumVOItems.size() > 1){ + //excelDataList.add(new WriteExcelData(startRow,(enumVOItems.size()+startRow)-1,true,true,0, osEnumVO.getOid())); + excelDataList.add(new WriteExcelData(startRow,(enumVOItems.size()+startRow)-1,true,true,0, osEnumVO.getId())); + excelDataList.add(new WriteExcelData(startRow,(enumVOItems.size()+startRow)-1,true,true,1, osEnumVO.getName())); + excelDataList.add(new WriteExcelData(startRow,(enumVOItems.size()+startRow)-1,true,true,2, osEnumVO.getEnumValueDataType()+"("+osEnumVO.getEnumValueDataTypeText()+")")); + excelDataList.add(new WriteExcelData(startRow,(enumVOItems.size()+startRow)-1,true,true,3, osEnumVO.getLength())); + //excelDataList.add(new WriteExcelData(startRow,(enumVOItems.size()+startRow)-1,true,true,5, osEnumVO.getCreator())); + excelDataList.add(new WriteExcelData(startRow,(enumVOItems.size()+startRow)-1,true,true,4, Func.format(osEnumVO.getCreateTime(),"yyyy骞碝M鏈坉d鏃� hh:mm:ss"))); + + //澶勭悊鏋氫妇椤瑰啓鍏� + for (int j = 0; j < enumVOItems.size(); j++) { + OsEnumItemVO osEnumItemVO = enumVOItems.get(j); + excelDataList.add(new WriteExcelData(startRow+j,5, true,osEnumItemVO.getName())); + excelDataList.add(new WriteExcelData(startRow+j,6, true, osEnumItemVO.getValue())); + excelDataList.add(new WriteExcelData(startRow+j,7, true, osEnumItemVO.getDescription())); + } + + startRow += enumVOItems.size(); + }else{ + //鏋氫妇椤逛负绌烘椂灏变笉闇�瑕佸悎骞惰 + //excelDataList.add(new WriteExcelData(startRow,0, true,osEnumVO.getOid())); + excelDataList.add(new WriteExcelData(startRow,0, true, osEnumVO.getId())); + excelDataList.add(new WriteExcelData(startRow,1, true, osEnumVO.getName())); + excelDataList.add(new WriteExcelData(startRow,1, true, osEnumVO.getEnumValueDataType()+"("+osEnumVO.getEnumValueDataTypeText()+")")); + excelDataList.add(new WriteExcelData(startRow,3, true, osEnumVO.getLength())); + //excelDataList.add(new WriteExcelData(startRow,5, true, osEnumVO.getCreator())); + excelDataList.add(new WriteExcelData(startRow,4, true, Func.format(osEnumVO.getCreateTime(),"yyyy骞碝M鏈坉d鏃� hh:mm:ss"))); + } + //璁板綍涓嬩笂涓�缁勬暟鎹粨鏉熸椂鐨勮鍙凤紝鏂逛究鐢ㄥ仛鍚堝苟琛岀殑璧峰琛� + startRow += 1; } - //璁板綍涓嬩笂涓�缁勬暟鎹粨鏉熸椂鐨勮鍙凤紝鏂逛究鐢ㄥ仛鍚堝苟琛岀殑璧峰琛� - startRow += 1; } WriteExcelOption excelOption = new WriteExcelOption(excelDataList); ExcelUtil.writeDataToFile(excelPath, excelOption); @@ -470,7 +485,7 @@ //鐣岄潰娌′紶鍚嶇О锛屼娇鐢ㄩ粯璁ゅ鍑哄悕绉� exportFileName = Func.isBlank(exportFileName) ? "鏋氫妇瀵煎叆妯℃澘_" + Func.format(new Date(),"yyyy-MM-dd HHmmss.sss"):exportFileName; //璁剧疆鍒楀悕 - List<String> columns = new ArrayList<>(Arrays.asList("鏋氫妇鍚嶇О", "鏍囩", "杩斿洖绫诲瀷", "闀垮害", "鏋氫妇椤瑰悕绉�(褰撳墠鏋氫妇涓嬫湁鏋氫妇椤规椂蹇呭~)", "鏋氫妇鍊�(褰撳墠鏋氫妇涓嬫湁鏋氫妇椤规椂蹇呭~)", "鎻忚堪","*娉ㄦ剰*:绗簩琛屽紑濮嬬殑鏁版嵁涓虹ず渚嬫暟鎹紝瀵煎叆鍓嶈灏嗗叾鍒犻櫎锛屽綋瀵煎叆鐨勬灇涓句笅鍏峰澶氫釜鏋氫妇椤规椂锛屽簲鎸夌収绀轰緥enum2鐨勫啓娉�")); + List<String> columns = this.getCloumns(true); //鍐檈xcel String excelPath = LocalFileUtil.getDefaultTempFolder() + File.separator + exportFileName + ".xls"; //璁剧疆蹇呭~鍒� @@ -517,6 +532,27 @@ 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("鏋氫妇鍚嶇О", "鏍囩", "杩斿洖绫诲瀷", "闀垮害", "鏋氫妇椤瑰悕绉�(褰撳墠鏋氫妇涓嬫湁鏋氫妇椤规椂蹇呭~)", + "鏋氫妇鍊�(褰撳墠鏋氫妇涓嬫湁鏋氫妇椤规椂蹇呭~)", "鎻忚堪","*娉ㄦ剰*:绗簩琛屽紑濮嬬殑鏁版嵁涓虹ず渚嬫暟鎹紝瀵煎叆鍓嶈灏嗗叾鍒犻櫎锛�" + + "褰撳鍏ョ殑鏋氫妇涓嬪叿澶囧涓灇涓鹃」鏃讹紝搴旀寜鐓хず渚媏numb鐨勫啓娉�" + ) + ); + } + return new ArrayList<>( + Arrays.asList("鏋氫妇鍚嶇О", "鏍囩", "杩斿洖绫诲瀷", "闀垮害", + "鍒涘缓鏃堕棿", "鏋氫妇椤瑰悕绉�", "鏋氫妇鍊�", "鎻忚堪" + ) + ); } /** @@ -570,9 +606,9 @@ if(Func.isNotEmpty(osEnumVOList)){ repeatEnumId = osEnumVOList.stream().map(OsEnumVO::getId).collect(Collectors.toList()); } - //褰撳墠excel涓槸鍚﹂噸澶嶇敤鐨勫垽閲峂ap:锛坘ey锛氳处鍙凤紝value锛氳鍙凤級 + //褰撳墠excel涓槸鍚﹂噸澶嶇敤鐨勫垽閲峂ap:锛坘ey锛氬垽閲嶅睘鎬э紝value锛氳鍙凤級 Map<String, String> excelReapeat = new HashMap<>(); - //鍒ゆ柇蹇呭~灞炴�ф槸鍚︿负绌猴紝鐢ㄦ埛鏄惁宸插瓨鍦紝浠ュ強閮ㄩ棬鏄惁濉敊绛夋牎楠岄�昏緫 + //鍒ゆ柇蹇呭~灞炴�ф槸鍚︿负绌虹瓑绛� List<String> finalRepeatEnumId = repeatEnumId; newPOList.stream().forEach(osEnumPO -> { if(Func.isBlank(osEnumPO.getId())){//鏋氫妇鍚� @@ -585,10 +621,10 @@ throw new VciBaseException("绗��"+osEnumPO.getRowIndex()+"銆戣鏁版嵁锛屾灇涓惧悕绉板彧鑳戒负鑻辨枃瀛楁瘝"); }else if(excelReapeat.containsKey(osEnumPO.getId())){//鏋氫妇鍚嶈〃鏍间腑鍒ら噸 throw new VciBaseException("绗��"+excelReapeat.get(osEnumPO.getId())+"銆戣鍜岀銆�"+osEnumPO.getRowIndex()+"銆戣鏁版嵁锛屾灇涓惧悕閲嶅"); - }else if (Func.isNotEmpty(osEnumVOList) && finalRepeatEnumId.contains(osEnumPO.getId())){//2銆佸垽鏂灇涓惧悕鏄惁涓庣郴缁熶腑閲嶅 + }else if (Func.isNotEmpty(finalRepeatEnumId) && finalRepeatEnumId.contains(osEnumPO.getId())){//2銆佸垽鏂灇涓惧悕鏄惁涓庣郴缁熶腑閲嶅 throw new VciBaseException("绗��"+osEnumPO.getRowIndex()+"銆戣锛屾灇涓惧悕鍦ㄧ郴缁熶腑宸茬粡瀛樺湪,璇蜂慨鏀�!"); } - //鍏堝蹇呭~灞炴�у垽绌哄鐞� + //鍏堝鏋氫妇鍚峞xcel涓渶瑕佸垽閲嶅鐞� excelReapeat.put(osEnumPO.getId(),osEnumPO.getRowIndex()); }); //淇濆瓨閫昏緫 @@ -609,7 +645,7 @@ } }catch (Exception e){ if(logger.isErrorEnabled()){ - logger.error("璇诲彇excel鍐呭鏃舵垨淇濆瓨鐢ㄦ埛淇℃伅鏃跺嚭鐜颁簡閿欒锛屽叿浣撳師鍥狅細",VciBaseUtil.getExceptionMessage(e)); + logger.error("璇诲彇excel鍐呭鏃舵垨淇濆瓨鏋氫妇鏃跺嚭鐜颁簡閿欒锛屽叿浣撳師鍥狅細",VciBaseUtil.getExceptionMessage(e)); } e.printStackTrace(); return BaseResult.fail(VciBaseUtil.getExceptionMessage(e),new String[]{},e); @@ -617,18 +653,12 @@ return BaseResult.success("鏋氫妇瀵煎叆鎴愬姛锛�"); } - /* private OsEnumVO getTestJson(int i){ - String testJosn = "[{\"createTime\":\"2024-07-17 17:06:30.170\",\"creator\":\"developer\",\"enumValueDataType\":\"String\",\"enumValueDataTypeText\":\"瀛楃涓瞈",\"id\":\"test\",\"items\":[{\"description\":\"\",\"name\":\"1\",\"value\":\"11\"},{\"description\":\"\",\"name\":\"1\",\"value\":\"11\"}],\"lastModifier\":\"developer\",\"lastModifyTime\":\"2024-07-17 17:06:30.170\",\"length\":2,\"name\":\"test1\",\"oid\":\"4F9B4094-A4F5-E3CD-AC7C-1F33AA65F1E7\",\"ts\":\"2024-07-18 09:40:52.512\"},{\"createTime\":\"2024-07-17 09:49:31.592\",\"creator\":\"developer\",\"description\":null,\"enumValueDataType\":\"String\",\"enumValueDataTypeText\":\"瀛楃涓瞈",\"id\":\"testString\",\"items\":[{\"description\":\"11\",\"name\":\"11\",\"value\":\"11\"},{\"description\":\"\",\"name\":\"test1\",\"value\":\"1\"},,{\"description\":\"\",\"name\":\"test1\",\"value\":\"1\"}],\"lastModifier\":\"developer\",\"lastModifyTime\":\"2024-07-17 09:49:31.592\",\"length\":6,\"name\":\"testString\",\"oid\":\"AB3A7718-55C6-555E-A1FD-934763ACA3F2\",\"ts\":\"2024-07-17 16:47:33.038\"}]"; - List<OsEnumVO> OsEnumVOs = JSON.parseArray(testJosn,OsEnumVO.class); - return OsEnumVOs.get(i); - }*/ - /** * 鑾峰彇瀵煎叆妯℃澘鐨勭ず渚嬫暟鎹� * @return */ private List<OsEnumVO> getExportEnumTempExample(){ - String testJosn = "[{\"enumValueDataType\":\"String\",\"id\":\"enum1\",\"items\":[{\"description\":\"enumitem1.1\",\"name\":\"enumitem1.1\",\"value\":\"1\"},{\"description\":\"enumitem1.2\",\"name\":\"enumitem1.2\",\"value\":\"2\"}],\"length\":2,\"name\":\"enum1\"},{\"enumValueDataType\":\"String\",\"id\":\"enum2\",\"items\":[{\"description\":\"enumitem2.1\",\"name\":\"enumitem2.1\",\"value\":\"1\"},{\"description\":\"enumitem2.2\",\"name\":\"enumitem2.2\",\"value\":\"2\"},{\"description\":\"enumitem2.3\",\"name\":\"enumitem2.3\",\"value\":\"3\"}],\"length\":6,\"name\":\"enum2\"}]"; + String testJosn = "[{\"enumValueDataType\":\"String\",\"id\":\"enuma\",\"items\":[{\"description\":\"enumitem1.1\",\"name\":\"enumitem1.1\",\"value\":\"1\"},{\"description\":\"enumitem1.2\",\"name\":\"enumitem1.2\",\"value\":\"2\"}],\"length\":2,\"name\":\"enuma\"},{\"enumValueDataType\":\"String\",\"id\":\"enumb\",\"items\":[{\"description\":\"enumitem2.1\",\"name\":\"enumitem2.1\",\"value\":\"1\"},{\"description\":\"enumitem2.2\",\"name\":\"enumitem2.2\",\"value\":\"2\"},{\"description\":\"enumitem2.3\",\"name\":\"enumitem2.3\",\"value\":\"3\"}],\"length\":6,\"name\":\"enumb\"}]"; List<OsEnumVO> OsEnumVOs = JSON.parseArray(testJosn,OsEnumVO.class); return OsEnumVOs; } @@ -671,7 +701,7 @@ private EnumType osEnumDTO2EnumType(OsEnumDTO osEnumDTO){ EnumType enumType = new EnumType(); enumType.oid = osEnumDTO.getOid(); - enumType.name = osEnumDTO.getId(); + enumType.name = osEnumDTO.getId();//osEnumDTO.getId().toLowerCase(Locale.ROOT); enumType.label = osEnumDTO.getName(); enumType.length = osEnumDTO.getLength(); enumType.creator = osEnumDTO.getCreator(); @@ -937,6 +967,44 @@ } /** + * 鏍规嵁鏋氫妇绫诲瀷鏌ヨ鏋氫妇锛氭灇涓惧悕 , 鏋氫妇 + * @param enumType锛歋tring, Integer + * @return + */ + public List<Map<String,List<String>>> getEnumMapByType(String enumType){ + List<Map<String,List<String>>> enumMapList = new ArrayList<>(); + EnumType[] emArray = null; + try { + emArray = platformClientUtil.getEnumService().getEnumTypesByType(enumType); + } catch (PLException e) { + e.printStackTrace(); + } + if(emArray == null || emArray.length == 0){ + return null; + } + EnumType emItem; + for(int i = 0; i < emArray.length; i++){ + emItem = emArray[i]; + EnumItem[] emChildren = emItem.items; + ArrayList<String> valueList = new ArrayList<String>(); + for(int k = 0; k < emChildren.length; k++){ + EnumItem emChild = emChildren[k]; + String value = emChild.value; + String symbol = ""; + //褰撲负Integer鏃堕渶瑕佸皢鏋氫妇椤瑰�兼嫾鎺ヤ笂= + if("Integer".equals(enumType)){ + symbol = "="; + } + valueList.add(symbol + value); + } + Map<String, List<String>> enumMap = new HashMap<>(); + enumMap.put(emItem.name, valueList); + enumMapList.add(enumMap); + } + return enumMapList; + } + + /** * 娓呴櫎缂撳瓨 */ @Override -- Gitblit v1.9.3