|
@@ -4,8 +4,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
4
|
4
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
5
|
5
|
import com.huiju.estateagents.base.ResponseBean;
|
6
|
6
|
import com.huiju.estateagents.common.CommConstant;
|
7
|
|
-import com.huiju.estateagents.entity.ExtendContent;
|
8
|
|
-import com.huiju.estateagents.mapper.ExtendContentMapper;
|
|
7
|
+import com.huiju.estateagents.entity.*;
|
|
8
|
+import com.huiju.estateagents.mapper.*;
|
9
|
9
|
import com.huiju.estateagents.service.IExtendContentService;
|
10
|
10
|
import org.apache.commons.lang3.StringUtils;
|
11
|
11
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -26,6 +26,17 @@ public class ExtendContentServiceImpl extends ServiceImpl<ExtendContentMapper, E
|
26
|
26
|
|
27
|
27
|
@Autowired
|
28
|
28
|
private ExtendContentMapper extendContentMapper;
|
|
29
|
+ @Autowired
|
|
30
|
+ private TaBuildingMapper taBuildingMapper;
|
|
31
|
+ @Autowired
|
|
32
|
+ private TaBuildingDynamicMapper taBuildingDynamicMapper;
|
|
33
|
+ @Autowired
|
|
34
|
+ private TaNewsMapper taNewsMapper;
|
|
35
|
+ @Autowired
|
|
36
|
+ private HelpActivityMapper helpActivityMapper;
|
|
37
|
+ @Autowired
|
|
38
|
+ private TaShareActivityMapper taShareActivityMapper;
|
|
39
|
+
|
29
|
40
|
@Override
|
30
|
41
|
public ResponseBean extendContentAdd(ExtendContent extendContent) {
|
31
|
42
|
ResponseBean responseBean= new ResponseBean<>();
|
|
@@ -87,4 +98,58 @@ public class ExtendContentServiceImpl extends ServiceImpl<ExtendContentMapper, E
|
87
|
98
|
extendContentMapper.updateById(extendContent);
|
88
|
99
|
}
|
89
|
100
|
}
|
|
101
|
+
|
|
102
|
+ @Override
|
|
103
|
+ public boolean judgleRelationBuildAndActivity(ExtendContent extendContent) {
|
|
104
|
+ //判断已关联的项目或者活动是否取消发布
|
|
105
|
+ if (StringUtils.isNotEmpty(extendContent.getBuildingId())){
|
|
106
|
+ QueryWrapper<TaBuilding> taBuildingQueryWrapper = new QueryWrapper<>();
|
|
107
|
+ taBuildingQueryWrapper.eq("building_id", extendContent.getBuildingId());
|
|
108
|
+ TaBuilding taBuilding = taBuildingMapper.selectOne(taBuildingQueryWrapper);
|
|
109
|
+ if (taBuilding.getStatus() == 0){
|
|
110
|
+ return false;
|
|
111
|
+ }
|
|
112
|
+ }
|
|
113
|
+
|
|
114
|
+ if (CommConstant.CAROUSEL_ACTIVITY.equals(extendContent.getContentType())
|
|
115
|
+ && StringUtils.isNotEmpty(extendContent.getTargetId())){
|
|
116
|
+ QueryWrapper<TaBuildingDynamic> taBuildingDynamicQueryWrapper = new QueryWrapper<>();
|
|
117
|
+ taBuildingDynamicQueryWrapper.eq("dynamic_id", extendContent.getTargetId());
|
|
118
|
+ TaBuildingDynamic taBuildingDynamic = taBuildingDynamicMapper.selectOne(taBuildingDynamicQueryWrapper);
|
|
119
|
+ if (taBuildingDynamic.getStatus() == 0){
|
|
120
|
+ return false;
|
|
121
|
+ }
|
|
122
|
+ }
|
|
123
|
+
|
|
124
|
+ if (CommConstant.CAROUSEL_NEWS.equals(extendContent.getContentType())
|
|
125
|
+ && StringUtils.isNotEmpty(extendContent.getTargetId())){
|
|
126
|
+ QueryWrapper<TaNews> taNewsQueryWrapper = new QueryWrapper<>();
|
|
127
|
+ taNewsQueryWrapper.eq("news_id", extendContent.getTargetId());
|
|
128
|
+ TaNews taNews = taNewsMapper.selectOne(taNewsQueryWrapper);
|
|
129
|
+ if (taNews.getNewsStatus() == 1){
|
|
130
|
+ return false;
|
|
131
|
+ }
|
|
132
|
+ }
|
|
133
|
+
|
|
134
|
+ if (CommConstant.POINTS_CHANGE_HELP.equals(extendContent.getContentType())
|
|
135
|
+ && StringUtils.isNotEmpty(extendContent.getTargetId())){
|
|
136
|
+ QueryWrapper<HelpActivity> helpActivityQueryWrapper = new QueryWrapper<>();
|
|
137
|
+ helpActivityQueryWrapper.eq("help_activity_id", extendContent.getTargetId());
|
|
138
|
+ HelpActivity helpActivity = helpActivityMapper.selectOne(helpActivityQueryWrapper);
|
|
139
|
+ if (helpActivity.getStatus() == -1){
|
|
140
|
+ return false;
|
|
141
|
+ }
|
|
142
|
+ }
|
|
143
|
+
|
|
144
|
+ if (CommConstant.POINTS_CHANGE_GROUP.equals(extendContent.getContentType())
|
|
145
|
+ && StringUtils.isNotEmpty(extendContent.getTargetId())){
|
|
146
|
+ QueryWrapper<TaShareActivity> taShareActivityQueryWrapper = new QueryWrapper<>();
|
|
147
|
+ taShareActivityQueryWrapper.eq("group_activity_id", extendContent.getTargetId());
|
|
148
|
+ TaShareActivity taShareActivity = taShareActivityMapper.selectOne(taShareActivityQueryWrapper);
|
|
149
|
+ if (taShareActivity.getStatus() == -1){
|
|
150
|
+ return false;
|
|
151
|
+ }
|
|
152
|
+ }
|
|
153
|
+ return true;
|
|
154
|
+ }
|
90
|
155
|
}
|