|
@@ -10,6 +10,8 @@ import com.huiju.estateagents.base.BaseController;
|
10
|
10
|
import com.huiju.estateagents.base.ResponseBean;
|
11
|
11
|
import com.huiju.estateagents.center.sysUser.entity.SysToken;
|
12
|
12
|
import com.huiju.estateagents.center.sysUser.service.ISysTokenService;
|
|
13
|
+import com.huiju.estateagents.center.taUser.entity.TaUser;
|
|
14
|
+import com.huiju.estateagents.center.taUser.service.ITaUserService;
|
13
|
15
|
import com.huiju.estateagents.common.CommConstant;
|
14
|
16
|
import com.huiju.estateagents.common.WxUtils;
|
15
|
17
|
import com.huiju.estateagents.entity.*;
|
|
@@ -58,6 +60,18 @@ public class MiniAppController extends BaseController {
|
58
|
60
|
@Autowired
|
59
|
61
|
private ITaSharePersonFromService taSharePersonFromService;
|
60
|
62
|
|
|
63
|
+ @Autowired
|
|
64
|
+ private ITaBuildingDynamicService buildingDynamicService;
|
|
65
|
+
|
|
66
|
+ @Autowired
|
|
67
|
+ private ITaNewsService newsService;
|
|
68
|
+
|
|
69
|
+ @Autowired
|
|
70
|
+ private ITaUserService userService;
|
|
71
|
+
|
|
72
|
+ @Autowired
|
|
73
|
+ private ITaPersonBuildingService personBuildingService;
|
|
74
|
+
|
61
|
75
|
|
62
|
76
|
|
63
|
77
|
|
|
@@ -149,11 +163,36 @@ public class MiniAppController extends BaseController {
|
149
|
163
|
}else {
|
150
|
164
|
taSharePersonFrom.setSharePerson(recommenderPerson.getPersonId());
|
151
|
165
|
}
|
|
166
|
+ QueryWrapper<TaSharePersonFrom> sharePersonFromQueryWrapper = new QueryWrapper<>();
|
|
167
|
+ sharePersonFromQueryWrapper.eq("person_id",taPerson.getPersonId());
|
152
|
168
|
if(from.equals("dynamic_share")){ // activity_share
|
153
|
169
|
taSharePersonFrom.setStatus(CommConstant.STATUS_UNACCALIMED);
|
|
170
|
+ TaBuildingDynamic buildingDynamic = buildingDynamicService.getById(targetId);
|
|
171
|
+ taSharePersonFrom.setBuildingId(buildingDynamic.getBuildingId());
|
|
172
|
+ sharePersonFromQueryWrapper.eq("building_id",buildingDynamic.getBuildingId());
|
154
|
173
|
}else {
|
155
|
174
|
taSharePersonFrom.setStatus(CommConstant.STATUS_NORMAL);
|
156
|
175
|
}
|
|
176
|
+ if (from.contains("card")){
|
|
177
|
+ QueryWrapper<TaPersonBuilding> personBuildingQueryWrapper = new QueryWrapper<>();
|
|
178
|
+ personBuildingQueryWrapper.eq("user_id",targetId);
|
|
179
|
+ TaPersonBuilding personBuilding = personBuildingService.getOne(personBuildingQueryWrapper);
|
|
180
|
+ taSharePersonFrom.setBuildingId(personBuilding.getBuildingId());
|
|
181
|
+ sharePersonFromQueryWrapper.eq("building_id",personBuilding.getBuildingId());
|
|
182
|
+ }else if (from.contains("news")){
|
|
183
|
+ TaNews news = newsService.getById(targetId);
|
|
184
|
+ taSharePersonFrom.setBuildingId(news.getBuildingId());
|
|
185
|
+ sharePersonFromQueryWrapper.eq("building_id",news.getBuildingId());
|
|
186
|
+ }else if (from.contains("building")){
|
|
187
|
+ taSharePersonFrom.setBuildingId(targetId);
|
|
188
|
+ sharePersonFromQueryWrapper.eq("building_id",targetId);
|
|
189
|
+ }
|
|
190
|
+ Integer isFirstTime = taSharePersonFromService.count(sharePersonFromQueryWrapper);
|
|
191
|
+ if(isFirstTime>0){
|
|
192
|
+ taSharePersonFrom.setIsFirstTime(false);
|
|
193
|
+ }else {
|
|
194
|
+ taSharePersonFrom.setIsFirstTime(true);
|
|
195
|
+ }
|
157
|
196
|
taSharePersonFromService.save(taSharePersonFrom);
|
158
|
197
|
|
159
|
198
|
}
|