Przeglądaj źródła

修复公出时间重复BUG

anderx 3 lat temu
rodzic
commit
3ca5089d46

+ 11 - 1
src/main/java/com/goafanti/weChat/service/impl/PublicReleaseServiceImpl.java

@@ -597,9 +597,19 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		if (is.size()>1) {
 			return true;
 		}else  if(is.size()==1){
-			if (in.getId()!=null && !in.getId().equals(is.get(0))){
+			//如果id为新增那么直接不允许时间重复
+			if (in.getId()==null){
 				return true;
+			}else {
+				//如果有id,与获取id一直,则为当前修改可以
+				if (in.getId().equals(is.get(0))){
+					return false;
+
+				}else {
+					return true;
+				}
 			}
+
 		}
 		return false;
 	}