|
@@ -7,6 +7,7 @@ import com.huiju.estateagents.common.CommConstant;
|
7
|
7
|
import com.huiju.estateagents.entity.ExtendContent;
|
8
|
8
|
import com.huiju.estateagents.mapper.ExtendContentMapper;
|
9
|
9
|
import com.huiju.estateagents.service.IExtendContentService;
|
|
10
|
+import org.apache.commons.lang3.StringUtils;
|
10
|
11
|
import org.springframework.beans.factory.annotation.Autowired;
|
11
|
12
|
import org.springframework.stereotype.Service;
|
12
|
13
|
|
|
@@ -33,7 +34,7 @@ public class ExtendContentServiceImpl extends ServiceImpl<ExtendContentMapper, E
|
33
|
34
|
}else if("2".equals(extendContent.getContentType())){
|
34
|
35
|
extendContent.setContentType(CommConstant.CAROUSEL_PROJECT);
|
35
|
36
|
}else if ("3".equals(extendContent.getContentType())){
|
36
|
|
- extendContent.setContentType(CommConstant.CAROUSEL_INFORMATION);
|
|
37
|
+ extendContent.setContentType(CommConstant.CAROUSEL_NEWS);
|
37
|
38
|
}
|
38
|
39
|
extendContentMapper.insert(extendContent);
|
39
|
40
|
responseBean.addSuccess("成功");
|
|
@@ -41,13 +42,16 @@ public class ExtendContentServiceImpl extends ServiceImpl<ExtendContentMapper, E
|
41
|
42
|
}
|
42
|
43
|
|
43
|
44
|
@Override
|
44
|
|
- public ResponseBean selectExtendContentList(ExtendContent extendContent) {
|
|
45
|
+ @Deprecated
|
|
46
|
+ public ResponseBean selectExtendContentList(String contentType, String buildingId) {
|
45
|
47
|
ResponseBean responseBean = new ResponseBean<>();
|
46
|
48
|
// 查询轮播图
|
47
|
49
|
QueryWrapper<ExtendContent> extendContentQuery= new QueryWrapper<>();
|
|
50
|
+ // banner 或 screen(首屏广告) ,这里是 banner
|
48
|
51
|
extendContentQuery.eq("show_position",CommConstant.CAROUSEL);
|
49
|
|
- extendContentQuery.eq("content_type",extendContent.getContentType());
|
50
|
|
- extendContentQuery.eq("building_id",extendContent.getBuildingId());
|
|
52
|
+ // activity(活动) 或 project(项目) 或 news(咨迅)
|
|
53
|
+ extendContentQuery.eq("content_type",contentType);
|
|
54
|
+ extendContentQuery.eq("building_id",buildingId);
|
51
|
55
|
extendContentQuery.eq("status","1");
|
52
|
56
|
List<ExtendContent> taExtendContent = extendContentMapper.selectList(extendContentQuery);
|
53
|
57
|
responseBean.addSuccess(taExtendContent);
|
|
@@ -55,13 +59,18 @@ public class ExtendContentServiceImpl extends ServiceImpl<ExtendContentMapper, E
|
55
|
59
|
}
|
56
|
60
|
|
57
|
61
|
@Override
|
58
|
|
- public ResponseBean selectExtendContentListShowType(ExtendContent extendContent) {
|
|
62
|
+ public ResponseBean selectExtendContentListShowType(String showType, String showPosition, String targetId, String contentType, String buildingId, String contentId) {
|
59
|
63
|
ResponseBean responseBean= new ResponseBean<>();
|
60
|
64
|
// 开屏
|
61
|
65
|
QueryWrapper<ExtendContent> extendContentQuery= new QueryWrapper<>();
|
62
|
|
- extendContentQuery.eq("show_type",CommConstant.OPEN_SCREEN);
|
63
|
|
- extendContentQuery.eq("content_type",extendContent.getContentType());
|
64
|
|
- extendContentQuery.eq("building_id",extendContent.getBuildingId());
|
|
66
|
+ // banner 或 screen(首屏广告) ,这里是 screen
|
|
67
|
+ extendContentQuery.eq("show_type",showType);
|
|
68
|
+ extendContentQuery.eq(StringUtils.isNotBlank(showPosition), "show_position",showPosition);
|
|
69
|
+ extendContentQuery.eq(StringUtils.isNotBlank(targetId), "target_id",targetId);
|
|
70
|
+ extendContentQuery.eq(StringUtils.isNotBlank(contentId), "content_id",contentId);
|
|
71
|
+ // activity(活动) 或 project(项目) 或 news(咨迅)
|
|
72
|
+ extendContentQuery.eq(StringUtils.isNotBlank(contentType), "content_type",contentType);
|
|
73
|
+ extendContentQuery.eq(StringUtils.isNotBlank(buildingId), "building_id",buildingId);
|
65
|
74
|
extendContentQuery.eq("status","1");
|
66
|
75
|
ExtendContent taExtendContent = extendContentMapper.selectOne(extendContentQuery);
|
67
|
76
|
responseBean.addSuccess(taExtendContent);
|