From 93cfe891a02766e0c56c5781eb6ca8a5cc5fb16f Mon Sep 17 00:00:00 2001 From: 田源 <lastanimals@163.com> Date: 星期三, 31 七月 2024 11:43:13 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsAttributeServiceImpl.java | 37 +++++++++++++++++++++++++++++++------ 1 files changed, 31 insertions(+), 6 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 2d0e461..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; /** * 蹇呭~鍒� @@ -511,7 +519,7 @@ if(hasInstance && !compatible){ throw new PLException("500",new String[]{"鏃犳晥鍙樻洿, 涓嶅吋瀹瑰凡浜х敓鐨勬暟鎹紒"}); } - String userId = "developer";//WebThreadLocalUtil.getCurrentUserSessionInfoInThread().getUserId(); + String userId = WebThreadLocalUtil.getCurrentUserSessionInfoInThread().getUserId(); osAttributeDTO.setLastModifier(userId); osAttributeDTO.setCreator(osAttributeVO.getCreator()); osAttributeDTO.setCreateTime(osAttributeVO.getCreateTime()); @@ -557,9 +565,9 @@ attributeDef.rage = osAttributeDTO.getRange().replace("<","<"); } attributeDef.ts = Func.format((Func.isNotEmpty(osAttributeDTO.getTs()) ? osAttributeDTO.getTs():new Date()),VciDateUtil.DateTimeMillFormat); - attributeDef.creator = "developer";//Func.isBlank(osAttributeDTO.getCreator()) ? WebThreadLocalUtil.getCurrentUserSessionInfoInThread().getUserId():osAttributeDTO.getCreator(); + attributeDef.creator = Func.isBlank(osAttributeDTO.getCreator()) ? WebThreadLocalUtil.getCurrentUserSessionInfoInThread().getUserId():osAttributeDTO.getCreator(); attributeDef.createTime = Func.isEmpty(osAttributeDTO.getCreateTime()) ? System.currentTimeMillis():osAttributeDTO.getCreateTime().getTime(); - attributeDef.modifier = "developer";//Func.isBlank(osAttributeDTO.getLastModifier()) ? WebThreadLocalUtil.getCurrentUserSessionInfoInThread().getUserId():osAttributeDTO.getLastModifier(); + attributeDef.modifier = Func.isBlank(osAttributeDTO.getLastModifier()) ? WebThreadLocalUtil.getCurrentUserSessionInfoInThread().getUserId():osAttributeDTO.getLastModifier(); attributeDef.modifyTime = System.currentTimeMillis(); //other闇�瑕佽嚜琛屽鐞� StringBuffer sb = new StringBuffer(); @@ -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()); @@ -1045,7 +1070,7 @@ } } catch (PLException e) { e.printStackTrace(); - throw new VciBaseException("鎵ц淇濆瓨鏃跺嚭鐜伴敊璇紝閿欒灞炴�у璞″悕涓猴細銆�" + dto.getId() + "銆戯紝鍘熷洜锛�"+e.getMessage()); + throw new VciBaseException("鎵ц淇濆瓨鏃跺嚭鐜伴敊璇紝閿欒灞炴�у璞″悕涓猴細銆�" + dto.getId() + "銆戯紝鍘熷洜锛�"+VciBaseUtil.getExceptionMessage(e)); } }); }catch (Exception e){ -- Gitblit v1.9.3