From 1b223b109ec65a2934e283bb0be2c0e116b013e4 Mon Sep 17 00:00:00 2001 From: ludc Date: 星期二, 30 七月 2024 15:47:40 +0800 Subject: [PATCH] 状态池相关接口上传(已测试待联调) --- Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsAttributeServiceImpl.java | 29 +++++++++++++++++++++++++++-- 1 files changed, 27 insertions(+), 2 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 7a4ac81..8b6c442 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 @@ -33,6 +33,7 @@ import com.vci.web.properties.UsedNames; import com.vci.web.service.OsAttributeServiceI; import com.vci.web.service.OsBaseServiceI; +import com.vci.web.service.OsEnumServiceI; import com.vci.web.service.OsLinkTypeServiceI; import com.vci.web.util.Func; import com.vci.web.util.PlatformClientUtil; @@ -111,6 +112,13 @@ @Autowired(required = false) @Lazy private OsBtmServiceImpl osBtmService; + + /** + * 鏋氫妇鐨勬湇鍔� + */ + @Autowired + @Lazy + private OsEnumServiceI enumService; /** * 蹇呭~鍒� @@ -600,6 +608,7 @@ if(StringUtils.isNotBlank(osAttributeDTO.getLinkTypeName())){ //鍙傜収閾炬帴绫诲瀷 sb.append(LINKTYPENAME).append(" = ").append(osAttributeDTO.getLinkTypeName()).append(";"); + sb.append(VERSION).append(" = ").append(osAttributeDTO.getVersion()).append(";"); } sb.append(LENGTH).append(" = ").append(length > osAttributeDTO.getAttrLength()?length:osAttributeDTO.getAttrLength()).append(";"); if (StringUtils.isNotBlank(osAttributeDTO.getEnumId())) { @@ -812,7 +821,7 @@ if(Func.isBlank(oid) || Func.isBlank(name) || Func.isEmpty(ts)){ throw new PLException("500",new String[]{"寰呭垹闄ょ殑灞炴�у垪琛ㄤ腑涓婚敭銆恛id銆戙�佽皟鏁存椂闂淬�恡s銆戙�佸睘鎬у悕銆恘ame銆戜笉鑳戒负绌猴紒"}); } - //鍒ゆ柇鏋氫妇鏄惁鏈夎寮曠敤 + //鍒ゆ柇灞炴�ф槸鍚︽湁琚紩鐢� List<Map<String, String>> usedAttrList = this.getUsedAttributeList(name); if(Func.isNotEmpty(usedAttrList)){ throw new PLException("500",new String[]{"鍒犻櫎鐨勫睘鎬т腑锛屽睘鎬у悕绉颁负锛氥��" + name + "銆�,宸茶寮曠敤锛�"}); @@ -934,7 +943,7 @@ //璁剧疆鍒楀悕 List<String> columns = new ArrayList<>( Arrays.asList("灞炴�у悕", "鏍囩", "鎻忚堪", - "灞炴�х被鍨�", "鍏佽涓虹┖(鏄�/鍚�)", "榛樿鍊�", "浣跨敤鐨勬灇涓捐嫳鏂囧悕绉�", "鍙傜収鐨勪笟鍔$被鍨嬬紪鍙�", + "灞炴�х被鍨�(璇峰弬鐓ф柊澧炵晫闈㈢殑灞炴�х被鍨嬪~鍐�)", "鍏佽涓虹┖(鏄�/鍚�)", "榛樿鍊�", "浣跨敤鐨勬灇涓捐嫳鏂囧悕绉�", "鍙傜収鐨勪笟鍔$被鍨嬬紪鍙�", "鍙傜収鐨勯摼鎺ョ被鍨嬬紪鍙�","鐗堟湰鐗堟","灞炴�ч暱搴�", "灏忔暟绮惧害浣嶆暟","灏忔暟鍒诲害浣嶆暟","鍙栧�艰寖鍥�") ); //璁剧疆蹇呭~鍒� @@ -1010,6 +1019,22 @@ //灞炴�у悕excel涓垽閲嶅鐞� excelReapeat.put(osAttributePO.getId(),osAttributePO.getRowIndex()); OsAttributeDTO osAttributeDTO = new OsAttributeDTO(); + //鏌ヨ鏋氫妇鏄惁瀛樺湪锛屽~鍐欎簡鏋氫妇浣嗘病濉啓鍙栧�艰寖鍥达紝杩欐椂鍊欑洿鎺ヤ娇鐢ㄦ灇涓鹃」鍊间綔涓洪粯璁ょ殑range + if(Func.isNotBlank(osAttributePO.getEnumId()) && Func.isBlank(osAttributePO.getRange())){ + try { + OsEnumVO enumVO = enumService.getEnumTypeById(osAttributePO.getEnumId()); + if(Func.isEmpty(enumVO)){ + throw new VciBaseException("绗��" + osAttributePO.getRowIndex() + "銆戣鏁版嵁,閫氳繃鏋氫妇鍚嶇О銆�" + osAttributePO.getEnumId() + + "銆戞湭鑾峰彇鍒版灇涓句俊鎭�!"); + } + String itemValues = enumVO.getItemMaps().values().stream().collect(Collectors.joining(";")); + osAttributeDTO.setRange(itemValues); + } catch (PLException e) { + e.printStackTrace(); + throw new VciBaseException("鏋氫妇鏌ヨ澶辫触锛屽師鍥狅細"+e.getMessage()); + } + osAttributeDTO.setBtmTypeId(osAttributePO.getEnumId()); + } osAttributeDTO.setOid(VciBaseUtil.getPk().toUpperCase(Locale.ROOT)); osAttributeDTO.setId(osAttributePO.getId()); osAttributeDTO.setName(osAttributePO.getName()); -- Gitblit v1.9.3