From 79120a1740872fbb20a79d0cde0a3fa9f55ec285 Mon Sep 17 00:00:00 2001 From: ludc Date: 星期三, 31 七月 2024 17:29:12 +0800 Subject: [PATCH] 版本规则新增、修改接口上传。 --- Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsStatusServiceImpl.java | 24 +++++++++++++----------- 1 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsStatusServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsStatusServiceImpl.java index f8abe1d..13dfada 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsStatusServiceImpl.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsStatusServiceImpl.java @@ -280,17 +280,19 @@ public boolean addSave(OsStatusDTO statusDTO) throws Exception { VciBaseUtil.alertNotNull( statusDTO,"鐘舵�佺殑淇℃伅", - statusDTO.getId(),"鐘舵�佺殑鑻辨枃鍚嶇О", - statusDTO.getName(),"鐘舵�佺殑涓枃鍚嶇О" + statusDTO.getId(),"鐘舵�佺殑鑻辨枃鍚嶇О" ); - StatePool dbStatePool = platformClientUtil.getStatePoolService().getStatePool(statusDTO.getId()); - if (Func.isNotEmpty(dbStatePool) && Func.isNotBlank(dbStatePool.oid)) { - throw new PLException("500",new String[]{"鍚嶇О閲嶅璇锋洿鎹㈠悕绉帮紒"}); + if (statusDTO.getId().length()>50) { + throw new PLException("500",new String[]{"鐘舵�佽嫳鏂囧悕绉颁笉鑳借秴杩�50涓瓧绗︼紒"}); } // 鐘舵�佹睜鍚嶇О鍙兘涓鸿嫳鏂囧瓧姣� String regex = "[a-z A-Z]*"; - if ((!statusDTO.getId().matches(regex))) { + if (!statusDTO.getId().matches(regex)) { throw new PLException("500",new String[]{"鍚嶇О鍙兘涓鸿嫳鏂囷紒"}); + } + StatePool dbStatePool = platformClientUtil.getStatePoolService().getStatePool(statusDTO.getId()); + if (Func.isNotEmpty(dbStatePool) && Func.isNotBlank(dbStatePool.oid)) { + throw new PLException("500",new String[]{"鍚嶇О閲嶅璇锋洿鎹㈠悕绉帮紒"}); } //铏界劧浼氳嚜鍔ㄧ敓鎴恛id锛屼絾鏄繖鍎胯缃富閿紝閬垮厤鏀惧叆缂撳瓨鐨勬暟鎹槸娌℃湁oid鐨� statusDTO.setOid(VciBaseUtil.getPk().toUpperCase(Locale.ROOT)); @@ -351,21 +353,21 @@ for(OsStatusDTO statusDTO : osStatusDTOS){ //oid鍜宼s鍒ょ┖ String oid = statusDTO.getOid(); - //name涓昏鐢ㄦ潵瀵圭紦瀛樻暟鎹垹闄� - String name = statusDTO.getName(); + //id涓昏鐢ㄦ潵瀵圭紦瀛樻暟鎹垹闄� + String id = statusDTO.getId(); //鍚庡彴浼氱敤ts杩涜鏁版嵁涓�鑷存�ф牎楠� Date ts = statusDTO.getTs(); - if(Func.isBlank(oid) || Func.isBlank(name) || Func.isEmpty(ts)){ + if(Func.isBlank(oid) || Func.isBlank(id) || Func.isEmpty(ts)){ throw new PLException("500",new String[]{"寰呭垹闄ょ殑鐘舵�佸垪琛ㄤ腑涓婚敭銆恛id銆戙�佽皟鏁存椂闂淬�恡s銆戙�佺姸鎬佸悕绉般�恘ame銆戜笉鑳戒负绌猴紒"}); } StatePool statePool = new StatePool(); statePool.oid = oid; - statePool.name = name; + statePool.name = id; statePool.ts = Func.format(ts,VciDateUtil.DateTimeMillFormat); statePoolList.add(statePool); boolean res = platformClientUtil.getStatePoolService().deleteStatePool(statePool); if(!res){ - throw new PLException("500",new String[]{"鍒犻櫎鐘舵�佸悕绉颁负銆�" + name + "銆戠殑鏁版嵁鏃跺嚭鐜伴敊璇�!"}); + throw new PLException("500",new String[]{"鍒犻櫎鐘舵�佸悕绉颁负銆�" + id + "銆戠殑鏁版嵁鏃跺嚭鐜伴敊璇�!"}); } } //clearCache(); -- Gitblit v1.9.3