魏超 5 年之前
父節點
當前提交
a2efa54e07
共有 1 個檔案被更改,包括 11 行新增3 行删除
  1. 11
    3
      src/main/java/com/huiju/estateagents/controller/ExtendContentController.java

+ 11
- 3
src/main/java/com/huiju/estateagents/controller/ExtendContentController.java 查看文件

@@ -6,12 +6,14 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6 6
 import com.huiju.estateagents.base.BaseController;
7 7
 import com.huiju.estateagents.base.ResponseBean;
8 8
 import com.huiju.estateagents.center.taUser.entity.TaUser;
9
+import com.huiju.estateagents.common.CommConstant;
9 10
 import com.huiju.estateagents.common.MD5Utils;
10 11
 import com.huiju.estateagents.entity.*;
11 12
 import com.huiju.estateagents.service.IExtendContentService;
12 13
 import com.huiju.estateagents.service.ITaBuildingDynamicService;
13 14
 import com.huiju.estateagents.service.ITaBuildingService;
14 15
 import com.huiju.estateagents.service.ITdCityService;
16
+import io.jsonwebtoken.lang.Collections;
15 17
 import io.swagger.annotations.Api;
16 18
 import io.swagger.annotations.ApiImplicitParam;
17 19
 import io.swagger.annotations.ApiImplicitParams;
@@ -30,6 +32,8 @@ import org.springframework.web.bind.annotation.RestController;
30 32
 
31 33
 import javax.servlet.http.HttpServletRequest;
32 34
 import java.time.LocalDateTime;
35
+import java.util.Collection;
36
+import java.util.List;
33 37
 
34 38
 /**
35 39
  * <p>
@@ -158,6 +162,9 @@ public class ExtendContentController extends BaseController {
158 162
         }
159 163
         extendContent.setCreateDate(LocalDateTime.now());
160 164
         extendContent.setOrgId(getOrgId(request));
165
+        if (StringUtils.isEmpty(extendContent.getContentType())){
166
+            extendContent.setContentType("nothing");
167
+        }
161 168
         ResponseBean  responseBean= iExtendContentService.extendContentAdd(extendContent);
162 169
           responseBean.addSuccess(extendContent);
163 170
           return responseBean;
@@ -212,13 +219,14 @@ public class ExtendContentController extends BaseController {
212 219
             }
213 220
             extendContent.setOrgId(getOrgId(request));
214 221
 
215
-            if (extendContent.getStatus() == 1){
222
+            if (extendContent.getStatus() == 1 && CommConstant.OPEN_SCREEN.equals(extendContent.getShowType())){
216 223
                 QueryWrapper<ExtendContent> taExtendContentQueryWrapper = new QueryWrapper<>();
217 224
                 taExtendContentQueryWrapper.eq("city_id", extendContent.getCityId());
218 225
                 taExtendContentQueryWrapper.eq("org_id", getOrgId(request));
219 226
                 taExtendContentQueryWrapper.eq("status", 1);
220
-                ExtendContent extContentInfo = iExtendContentService.getOne(taExtendContentQueryWrapper);
221
-                if (extContentInfo != null){
227
+                taExtendContentQueryWrapper.eq("show_type", extendContent.getShowType());
228
+                List<ExtendContent> extContentInfo = iExtendContentService.list(taExtendContentQueryWrapper);
229
+                if (!Collections.isEmpty(extContentInfo)){
222 230
                     responseBean.addError("该城市已有开屏广告,请勿再次上架");
223 231
                     return responseBean;
224 232
                 }