소스 검색

Merge branch '2.0.0' of http://git.ycjcjy.com/fuxingfan/smartCommunity into 2.0.0

魏熙美 6 년 전
부모
커밋
1cd2153881

+ 0
- 1
CODE/smart-community/operate-api/src/main/java/com/community/huiju/model/ToBanner.java 파일 보기

@@ -49,7 +49,6 @@ public class ToBanner {
49 49
     private String bannerContent;
50 50
     
51 51
     //@Min(value = 0,message = "请选择有效的投放社区!")
52
-    @NotNull(message = "投放社区不能为空!")
53 52
     private List<Integer> communityIds;
54 53
 
55 54
     public Integer getId() {

+ 10
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/impl/ToBannerServiceImpl.java 파일 보기

@@ -107,6 +107,11 @@ public class ToBannerServiceImpl implements IToBannerService {
107 107
         banner.setUpdateDate(new Date());
108 108
         banner.setUpdateUser(toUser.getId());
109 109
 
110
+        if (banner.getCommunityIds().size() < 1){
111
+            response.addError("投放社区不能为空!");
112
+            return response;
113
+        }
114
+        
110 115
         try {
111 116
             for (Integer communityId : banner.getCommunityIds()){
112 117
                 banner.setCommunityId(communityId);
@@ -179,6 +184,11 @@ public class ToBannerServiceImpl implements IToBannerService {
179 184
             response.addError("失效时间不能小于或等于生效时间!");
180 185
             return response;
181 186
         }
187
+    
188
+        if (null == banner.getCommunityId()){
189
+            response.addError("投放社区不能为空!");
190
+            return response;
191
+        }
182 192
 
183 193
         ToUser toUser = toUserMapper.selectByPrimaryKey(currentUserId);
184 194