|
@@ -164,6 +164,14 @@ public class ExtendContentController extends BaseController {
|
164
|
164
|
})
|
165
|
165
|
@RequestMapping(value="/admin/extendContent",method= RequestMethod.POST)
|
166
|
166
|
public ResponseBean extendContentAdd(@RequestBody ExtendContent extendContent, HttpServletRequest request){
|
|
167
|
+ ResponseBean responseBean = new ResponseBean();
|
|
168
|
+ //一个城市只能有一个开屏广告
|
|
169
|
+ boolean existFlag = iExtendContentService.advertistExistFlag(extendContent, getOrgId(request));
|
|
170
|
+ if (!existFlag){
|
|
171
|
+ responseBean.addError("该城市已有开屏广告,请勿再次上架");
|
|
172
|
+ return responseBean;
|
|
173
|
+ }
|
|
174
|
+
|
167
|
175
|
if (extendContent.getCityId() == null){
|
168
|
176
|
Integer cityId = iTaBuildingService.getCityById(extendContent.getBuildingId());
|
169
|
177
|
extendContent.setCityId(cityId);
|
|
@@ -173,9 +181,9 @@ public class ExtendContentController extends BaseController {
|
173
|
181
|
if (StringUtils.isEmpty(extendContent.getContentType())){
|
174
|
182
|
extendContent.setContentType("nothing");
|
175
|
183
|
}
|
176
|
|
- ResponseBean responseBean= iExtendContentService.extendContentAdd(extendContent);
|
177
|
|
- responseBean.addSuccess(extendContent);
|
178
|
|
- return responseBean;
|
|
184
|
+ responseBean = iExtendContentService.extendContentAdd(extendContent);
|
|
185
|
+ responseBean.addSuccess(extendContent);
|
|
186
|
+ return responseBean;
|
179
|
187
|
}
|
180
|
188
|
|
181
|
189
|
/**
|
|
@@ -227,8 +235,6 @@ public class ExtendContentController extends BaseController {
|
227
|
235
|
}
|
228
|
236
|
extendContent.setOrgId(getOrgId(request));
|
229
|
237
|
|
230
|
|
- iExtendContentService.judgleRelationBuildAndActivity(extendContent);
|
231
|
|
-
|
232
|
238
|
if (extendContent.getStatus() == 1){
|
233
|
239
|
boolean publishFlag = iExtendContentService.judgleRelationBuildAndActivity(extendContent);
|
234
|
240
|
if (!publishFlag){
|
|
@@ -238,21 +244,12 @@ public class ExtendContentController extends BaseController {
|
238
|
244
|
}
|
239
|
245
|
|
240
|
246
|
//一个城市只能有一个开屏广告
|
241
|
|
- if (extendContent.getStatus() == 1 && CommConstant.OPEN_SCREEN.equals(extendContent.getShowType())){
|
242
|
|
- QueryWrapper<ExtendContent> taExtendContentQueryWrapper = new QueryWrapper<>();
|
243
|
|
- taExtendContentQueryWrapper.eq("city_id", extendContent.getCityId());
|
244
|
|
- taExtendContentQueryWrapper.eq("org_id", getOrgId(request));
|
245
|
|
- taExtendContentQueryWrapper.eq("status", 1);
|
246
|
|
- taExtendContentQueryWrapper.eq("show_type", extendContent.getShowType());
|
247
|
|
- taExtendContentQueryWrapper.ne("content_id", extendContent.getTargetId());
|
248
|
|
- List<ExtendContent> extContentInfo = iExtendContentService.list(taExtendContentQueryWrapper);
|
249
|
|
- if (!Collections.isEmpty(extContentInfo)){
|
250
|
|
- responseBean.addError("该城市已有开屏广告,请勿再次上架");
|
251
|
|
- return responseBean;
|
252
|
|
- }
|
|
247
|
+ boolean existFlag = iExtendContentService.advertistExistFlag(extendContent, getOrgId(request));
|
|
248
|
+ if (!existFlag){
|
|
249
|
+ responseBean.addError("该城市已有开屏广告,请勿再次上架");
|
|
250
|
+ return responseBean;
|
253
|
251
|
}
|
254
|
252
|
|
255
|
|
-
|
256
|
253
|
if (iExtendContentService.updateById(extendContent)){
|
257
|
254
|
responseBean.addSuccess(extendContent);
|
258
|
255
|
}else {
|