|
@@ -7,6 +7,7 @@ import com.community.commom.mode.ResponseBean;
|
7
|
7
|
import com.community.commom.session.UserElement;
|
8
|
8
|
import com.community.huiju.dao.*;
|
9
|
9
|
import com.community.huiju.model.*;
|
|
10
|
+import com.community.huiju.service.ITaUserService;
|
10
|
11
|
import com.community.huiju.service.ImageServiceI;
|
11
|
12
|
import com.community.huiju.service.SocialServiceI;
|
12
|
13
|
import com.github.pagehelper.Page;
|
|
@@ -60,7 +61,7 @@ public class SocialServiceImpl implements SocialServiceI {
|
60
|
61
|
private TaUserMapper taUserMapper;
|
61
|
62
|
|
62
|
63
|
@Autowired
|
63
|
|
- private TaSysUserRoleMapper taSysUserRoleMapper;
|
|
64
|
+ private TaSysUserRoleMapper taSysUserRoleMapper;
|
64
|
65
|
|
65
|
66
|
@Autowired
|
66
|
67
|
private TpTicketRecordMapper tpTicketRecordMapper;
|
|
@@ -84,13 +85,13 @@ public class SocialServiceImpl implements SocialServiceI {
|
84
|
85
|
private TpTransactionReportMapper tpTransactionReportMapper;
|
85
|
86
|
|
86
|
87
|
@Autowired
|
87
|
|
- private ToCommunitiesMapper toCommunitiesMapper;
|
|
88
|
+ private ToCommunitiesMapper toCommunitiesMapper;
|
88
|
89
|
|
89
|
90
|
@Autowired
|
90
|
91
|
private TpTransactionReplyMapper tpTransactionReplyMapper;
|
91
|
92
|
|
92
|
93
|
@Autowired
|
93
|
|
- private TpTransactionLikeMapper tpTransactionLikeMapper;
|
|
94
|
+ private TpTransactionLikeMapper tpTransactionLikeMapper;
|
94
|
95
|
|
95
|
96
|
@Autowired
|
96
|
97
|
private TaUserVerifyMapper taUserVerifyMapper;
|
|
@@ -99,31 +100,35 @@ public class SocialServiceImpl implements SocialServiceI {
|
99
|
100
|
private TpBuildingOwnerInfoMapper tpBuildingOwnerInfoMapper;
|
100
|
101
|
|
101
|
102
|
@Autowired
|
102
|
|
- private TpActivitySignInMapper tpActivitySignInMapper;
|
|
103
|
+ private TpActivitySignInMapper tpActivitySignInMapper;
|
|
104
|
+
|
|
105
|
+ @Autowired
|
|
106
|
+ private ITaUserService iTaUserService;
|
103
|
107
|
|
104
|
108
|
@Override
|
105
|
109
|
@Transactional
|
106
|
110
|
public TpAnnouncement findAnnouncementDetail(Integer id, Integer communityId, Integer userId) {
|
107
|
111
|
//更新此用户的查看次数操作
|
108
|
|
- Integer allViewNum = updateSocialView(userId,Constant.ANNOUNCEMENT,communityId,id);
|
109
|
|
- if (null != allViewNum){
|
|
112
|
+ Integer allViewNum = updateSocialView(userId, Constant.ANNOUNCEMENT, communityId, id);
|
|
113
|
+ if (null != allViewNum) {
|
110
|
114
|
tpAnnouncementMapper.updateByPrimaryKeySelective(id, allViewNum);
|
111
|
115
|
}
|
112
|
116
|
TpAnnouncement tpAnnouncement = tpAnnouncementMapper.selectByPrimaryKey(id, communityId);
|
113
|
117
|
tpAnnouncement.setUserName(tpUserMapper.selectByPrimaryKey(tpAnnouncement.getCreateUser()).getUserName());
|
114
|
118
|
|
115
|
|
- Map<String,Object> map = Maps.newHashMap();
|
116
|
|
- map.put("uuid",tpAnnouncement.getId());
|
117
|
|
- map.put("type",Constant.ANNOUNCEMENT);
|
|
119
|
+ Map<String, Object> map = Maps.newHashMap();
|
|
120
|
+ map.put("uuid", tpAnnouncement.getId());
|
|
121
|
+ map.put("type", Constant.ANNOUNCEMENT);
|
118
|
122
|
// 查询图片
|
119
|
123
|
List<TdImages> tdImagesList = tdImagesMapper.getByUUIDAndByType(map);
|
120
|
|
- List<String> imgList = tdImagesList.stream().map(e->new String(e.getImageUrl())).collect(Collectors.toList());
|
|
124
|
+ List<String> imgList = tdImagesList.stream().map(e -> new String(e.getImageUrl())).collect(Collectors.toList());
|
121
|
125
|
tpAnnouncement.setImgList(imgList);
|
122
|
126
|
return tpAnnouncement;
|
123
|
127
|
}
|
124
|
128
|
|
125
|
129
|
/**
|
126
|
130
|
* 分页获取公告列表
|
|
131
|
+ *
|
127
|
132
|
* @param communityId
|
128
|
133
|
* @param title
|
129
|
134
|
* @param pageNum
|
|
@@ -132,35 +137,38 @@ public class SocialServiceImpl implements SocialServiceI {
|
132
|
137
|
*/
|
133
|
138
|
@Override
|
134
|
139
|
public ResponseBean getAnnouncements(Integer communityId, String title, Integer pageNum, Integer pageSize) {
|
135
|
|
- ResponseBean responseBean=new ResponseBean();
|
|
140
|
+ ResponseBean responseBean = new ResponseBean();
|
136
|
141
|
Map<String, Object> parameter = Maps.newHashMap();
|
137
|
142
|
//使用分页插件
|
138
|
|
- Page<TpAnnouncement> pageannouncementList=PageHelper.startPage(pageNum, pageSize);
|
|
143
|
+ Page<TpAnnouncement> pageannouncementList = PageHelper.startPage(pageNum, pageSize);
|
139
|
144
|
// 获取数据
|
140
|
|
- List<TpAnnouncement> announcementList = tpAnnouncementMapper.getAnnouncements(communityId,title);
|
141
|
|
- parameter.put("total",pageannouncementList.getTotal());
|
142
|
|
- parameter.put("list",announcementList);
|
|
145
|
+ List<TpAnnouncement> announcementList = tpAnnouncementMapper.getAnnouncements(communityId, title);
|
|
146
|
+ parameter.put("total", pageannouncementList.getTotal());
|
|
147
|
+ parameter.put("list", announcementList);
|
143
|
148
|
responseBean.addSuccess(parameter);
|
144
|
149
|
return responseBean;
|
145
|
150
|
}
|
|
151
|
+
|
146
|
152
|
/**
|
147
|
153
|
* 根据当前小区ID查出轮播图
|
|
154
|
+ *
|
148
|
155
|
* @param communityId 当前小区ID
|
149
|
156
|
* @return
|
150
|
157
|
*/
|
151
|
158
|
@Override
|
152
|
159
|
public List<TpAnnouncement> getAnnouncement(Integer communityId) {
|
153
|
|
- Integer num=tpCarouselSettingMapper.getcarouselNum(Constant.ANNOUNCEMENT, communityId);
|
|
160
|
+ Integer num = tpCarouselSettingMapper.getcarouselNum(Constant.ANNOUNCEMENT, communityId);
|
154
|
161
|
if (null == num) {
|
155
|
162
|
num = 0;
|
156
|
163
|
}
|
157
|
|
- List<TpAnnouncement> listAnnouncement=tpAnnouncementMapper.getAnnouncement(communityId,num);
|
|
164
|
+ List<TpAnnouncement> listAnnouncement = tpAnnouncementMapper.getAnnouncement(communityId, num);
|
158
|
165
|
return listAnnouncement;
|
159
|
166
|
}
|
160
|
167
|
|
161
|
|
-
|
|
168
|
+
|
162
|
169
|
/**
|
163
|
170
|
* 分页获取活动列表
|
|
171
|
+ *
|
164
|
172
|
* @param communityId
|
165
|
173
|
* @param title
|
166
|
174
|
* @param pageNum
|
|
@@ -169,20 +177,21 @@ public class SocialServiceImpl implements SocialServiceI {
|
169
|
177
|
*/
|
170
|
178
|
@Override
|
171
|
179
|
public ResponseBean getActivitys(Integer communityId, String title, Integer pageNum, Integer pageSize) {
|
172
|
|
- ResponseBean responseBean= new ResponseBean();
|
|
180
|
+ ResponseBean responseBean = new ResponseBean();
|
173
|
181
|
Map<String, Object> result = Maps.newHashMap();
|
174
|
182
|
//使用分页插件
|
175
|
|
- Page<TpActivity> pageactivityList=PageHelper.startPage(pageNum, pageSize);
|
|
183
|
+ Page<TpActivity> pageactivityList = PageHelper.startPage(pageNum, pageSize);
|
176
|
184
|
// 获取数据
|
177
|
|
- List<TpActivity> activityList = tpActivityMapper.getActivitys(communityId,title);
|
178
|
|
- result.put("list",activityList);
|
179
|
|
- result.put("total",pageactivityList.getTotal());
|
|
185
|
+ List<TpActivity> activityList = tpActivityMapper.getActivitys(communityId, title);
|
|
186
|
+ result.put("list", activityList);
|
|
187
|
+ result.put("total", pageactivityList.getTotal());
|
180
|
188
|
responseBean.addSuccess(result);
|
181
|
189
|
return responseBean;
|
182
|
190
|
}
|
183
|
|
-
|
|
191
|
+
|
184
|
192
|
/**
|
185
|
193
|
* 获取活动帖子详情
|
|
194
|
+ *
|
186
|
195
|
* @param activityId
|
187
|
196
|
* @param communityId
|
188
|
197
|
* @return
|
|
@@ -190,48 +199,49 @@ public class SocialServiceImpl implements SocialServiceI {
|
190
|
199
|
@Override
|
191
|
200
|
public TpActivity findActivityDetail(Integer activityId, Integer communityId, Integer userId) {
|
192
|
201
|
//更新查看次数
|
193
|
|
- Integer allViewNum = updateSocialView(userId,Constant.ACTIVITY,communityId,activityId);
|
194
|
|
- if (null != allViewNum){
|
|
202
|
+ Integer allViewNum = updateSocialView(userId, Constant.ACTIVITY, communityId, activityId);
|
|
203
|
+ if (null != allViewNum) {
|
195
|
204
|
TpActivity activity = new TpActivity();
|
196
|
205
|
activity.setId(activityId);
|
197
|
206
|
activity.setViewCount(allViewNum);
|
198
|
207
|
tpActivityMapper.updateByPrimaryKeySelective(activity);
|
199
|
208
|
}
|
200
|
209
|
|
201
|
|
- TpActivity tpActivity = tpActivityMapper.selectByPrimaryKey(activityId,communityId);
|
|
210
|
+ TpActivity tpActivity = tpActivityMapper.selectByPrimaryKey(activityId, communityId);
|
202
|
211
|
TpUser tpUser = tpUserMapper.selectByPrimaryKey(tpActivity.getCreateUser());
|
203
|
212
|
if (null != tpUser) {
|
204
|
213
|
tpActivity.setUserName(tpUser.getUserName());
|
205
|
214
|
}
|
206
|
215
|
//查看当前人是否签到
|
207
|
|
- TpActivitySignIn tpActivitySignIn= tpActivitySignInMapper.selectSing(activityId,userId);
|
208
|
|
- Integer signType=tpActivitySignIn==null?0:1;
|
|
216
|
+ TpActivitySignIn tpActivitySignIn = tpActivitySignInMapper.selectSing(activityId, userId);
|
|
217
|
+ Integer signType = tpActivitySignIn == null ? 0 : 1;
|
209
|
218
|
tpActivity.setSignType(signType);
|
210
|
219
|
|
211
|
220
|
//返回报名状态
|
212
|
221
|
Integer signNum = tpActivitySignupMapper.findTpActivetitySignByUserId(tpActivity.getId(), communityId, userId);
|
213
|
222
|
String signStatus = signNum != 0 ? Constant.STATUS_SIGNED : Constant.STATUS_UNSIGN;
|
214
|
223
|
tpActivity.setSignStatus(signStatus);
|
215
|
|
-
|
216
|
|
- Map<String,Object> map = Maps.newHashMap();
|
217
|
|
- map.put("uuid",tpActivity.getId());
|
218
|
|
- map.put("type",Constant.ACTIVITY);
|
|
224
|
+
|
|
225
|
+ Map<String, Object> map = Maps.newHashMap();
|
|
226
|
+ map.put("uuid", tpActivity.getId());
|
|
227
|
+ map.put("type", Constant.ACTIVITY);
|
219
|
228
|
// 查询图片
|
220
|
229
|
List<TdImages> tdImagesList = tdImagesMapper.getByUUIDAndByType(map);
|
221
|
|
- List<String> imgList = tdImagesList.stream().map(e->new String(e.getImageUrl())).collect(Collectors.toList());
|
|
230
|
+ List<String> imgList = tdImagesList.stream().map(e -> new String(e.getImageUrl())).collect(Collectors.toList());
|
222
|
231
|
tpActivity.setImgList(imgList);
|
223
|
232
|
|
224
|
233
|
return tpActivity;
|
225
|
234
|
}
|
226
|
|
-
|
|
235
|
+
|
227
|
236
|
/**
|
228
|
237
|
* 更新此用户的查看次数操作
|
|
238
|
+ *
|
229
|
239
|
* @param userId
|
230
|
240
|
* @param socialType
|
231
|
241
|
* @param communityId
|
232
|
242
|
* @param uuid
|
233
|
243
|
*/
|
234
|
|
- private Integer updateSocialView(Integer userId,String socialType,Integer communityId,Integer uuid) {
|
|
244
|
+ private Integer updateSocialView(Integer userId, String socialType, Integer communityId, Integer uuid) {
|
235
|
245
|
//检查是否查看过这个帖子
|
236
|
246
|
TpSocialView tpSocialView = new TpSocialView();
|
237
|
247
|
tpSocialView.setTaUserId(userId);
|
|
@@ -239,9 +249,9 @@ public class SocialServiceImpl implements SocialServiceI {
|
239
|
249
|
tpSocialView.setCommunityId(communityId);
|
240
|
250
|
tpSocialView.setUuid(uuid);
|
241
|
251
|
Integer viewNum = tpSocialViewMapper.selectViewNum(tpSocialView);
|
242
|
|
-
|
|
252
|
+
|
243
|
253
|
//查看过的话查看次数加一
|
244
|
|
- if (viewNum == 0){
|
|
254
|
+ if (viewNum == 0) {
|
245
|
255
|
tpSocialView.setCreateDate(new Date());
|
246
|
256
|
tpSocialViewMapper.insertSelective(tpSocialView);
|
247
|
257
|
tpSocialView.setTaUserId(null);
|
|
@@ -252,72 +262,46 @@ public class SocialServiceImpl implements SocialServiceI {
|
252
|
262
|
}
|
253
|
263
|
|
254
|
264
|
@Override
|
255
|
|
- public ResponseBean findTaUserInfo(UserElement userElement, Integer activityId, Integer communityId, Integer userId,String remark) {
|
|
265
|
+ public ResponseBean findTaUserInfo(UserElement userElement, Integer activityId, Integer communityId, String remark) {
|
256
|
266
|
ResponseBean responseBean = new ResponseBean();
|
257
|
267
|
TpActivity tpActivity = tpActivityMapper.selectByPrimaryKey(activityId, communityId);
|
258
|
268
|
//判断是否已经过了报名截至时间
|
259
|
269
|
Date registrEndTime = tpActivity.getRegistrationEndTime();
|
260
|
|
- if (registrEndTime.compareTo(new Date()) < 0){
|
261
|
|
- responseBean.addError("9997", "已过报名截止时间");
|
262
|
|
- return responseBean;
|
|
270
|
+ if (registrEndTime.compareTo(new Date()) < 0) {
|
|
271
|
+ responseBean.addError("9997", "已过报名截止时间");
|
|
272
|
+ return responseBean;
|
263
|
273
|
}
|
264
|
274
|
|
265
|
275
|
//报名是否超过人数上限
|
266
|
276
|
Integer signUpNum = tpActivitySignupMapper.sumActivitySignUpNum(activityId, communityId);
|
267
|
|
- if (signUpNum >= tpActivity.getSignUpMax() && tpActivity.getSignUpMax().intValue() != 0 ){
|
|
277
|
+ if (signUpNum >= tpActivity.getSignUpMax() && tpActivity.getSignUpMax().intValue() != 0) {
|
268
|
278
|
responseBean.addError("9998", "报名人数已满");
|
269
|
279
|
return responseBean;
|
270
|
280
|
}
|
271
|
281
|
|
272
|
|
- //已登陆,身份未知,状态未知
|
273
|
|
-
|
274
|
|
-
|
275
|
|
-
|
276
|
282
|
//判断身份是否为业主且状态为已停用
|
277
|
|
- TaUser taUser = taUserMapper.selectByPrimaryKey(userId);
|
|
283
|
+ TaUser taUser = taUserMapper.selectByPrimaryKey(userElement.getId());
|
278
|
284
|
if (taUser.getId().intValue() == -1) {
|
279
|
285
|
responseBean.addError("9996", "游客不能报名");
|
280
|
286
|
return responseBean;
|
281
|
287
|
}
|
282
|
|
- TaSysRole sysRole = taSysRoleMapper.findRoleByUserId(userId);
|
283
|
|
- if (Constant.INVALID.equals(taUser.getStatus())
|
284
|
|
- && Constant.OWNER.equals(sysRole.getRoleName())){
|
285
|
288
|
|
286
|
|
- responseBean.addError("9996", "您的身份已停用,请联系物业");
|
287
|
|
- return responseBean;
|
288
|
|
- }
|
|
289
|
+ // 校验用户
|
|
290
|
+ iTaUserService.checkBlacklistStatusUser(taUser);
|
289
|
291
|
|
290
|
|
- //身份为家属租客,状态为已停用
|
291
|
|
- if (Constant.INVALID.equals(taUser.getStatus())
|
292
|
|
- && (Constant.RELATION.equals(sysRole.getRoleName()) || Constant.TENANT.equals(sysRole.getRoleName()))){
|
293
|
|
-
|
294
|
|
- responseBean.addError("9996", "您的身份已停用,请联系物业");
|
295
|
|
- return responseBean;
|
296
|
|
- }
|
297
|
|
-
|
298
|
|
- if (Constant.EFFECTIVE.equals(taUser.getVerifyStatus())
|
299
|
|
- && Constant.EFFECTIVE.equals(taUser.getStatus())
|
300
|
|
- && (Constant.RELATION.equals(sysRole.getRoleName())
|
301
|
|
- || Constant.TENANT.equals(sysRole.getRoleName())
|
302
|
|
- || Constant.OWNER.equals(sysRole.getRoleName()))){
|
303
|
|
-
|
304
|
|
-
|
305
|
|
- return insertActivitySignUp(userElement, tpActivity, communityId, userId, remark);
|
306
|
|
- }
|
307
|
|
- responseBean.addError("9995", "无法确认您的身份,请联系物业");
|
308
|
|
- return responseBean;
|
|
292
|
+ return insertActivitySignUp(userElement, tpActivity, communityId, remark);
|
309
|
293
|
}
|
310
|
294
|
|
311
|
295
|
@Override
|
312
|
|
- public ResponseBean findAllTransaction(Integer communityId,String transactionTitle, String type, Integer pageNum, Integer paeSize) {
|
|
296
|
+ public ResponseBean findAllTransaction(Integer communityId, String transactionTitle, String type, Integer pageNum, Integer paeSize) {
|
313
|
297
|
Map<String, Object> parameter = Maps.newHashMap();
|
314
|
|
- ResponseBean responseBean= new ResponseBean();
|
315
|
|
- Page<TpTransaction> pageList=PageHelper.startPage(pageNum, paeSize);
|
316
|
|
- List<TpTransaction> tpTransactions= tpTransactionMapper.findAllTransaction(communityId, transactionTitle,type);
|
|
298
|
+ ResponseBean responseBean = new ResponseBean();
|
|
299
|
+ Page<TpTransaction> pageList = PageHelper.startPage(pageNum, paeSize);
|
|
300
|
+ List<TpTransaction> tpTransactions = tpTransactionMapper.findAllTransaction(communityId, transactionTitle, type);
|
317
|
301
|
|
318
|
|
- tpTransactions.stream().forEach(e->{
|
|
302
|
+ tpTransactions.stream().forEach(e -> {
|
319
|
303
|
|
320
|
|
- if (null != e.getTaUserVerifyId()){
|
|
304
|
+ if (null != e.getTaUserVerifyId()) {
|
321
|
305
|
TaSysRole taSysRole = taSysRoleMapper.findRoleByUserId(e.getTaUserVerifyId());
|
322
|
306
|
e.setRoleId(taSysRole.getId());
|
323
|
307
|
e.setRoleName(taSysRole.getRoleName());
|
|
@@ -326,82 +310,68 @@ public class SocialServiceImpl implements SocialServiceI {
|
326
|
310
|
e.setCreateUserName(taUser.getUserName());
|
327
|
311
|
});
|
328
|
312
|
|
329
|
|
- parameter.put("list",tpTransactions);
|
330
|
|
- parameter.put("total",pageList.getTotal());
|
|
313
|
+ parameter.put("list", tpTransactions);
|
|
314
|
+ parameter.put("total", pageList.getTotal());
|
331
|
315
|
responseBean.addSuccess(parameter);
|
332
|
316
|
return responseBean;
|
333
|
317
|
|
334
|
318
|
}
|
335
|
319
|
|
336
|
320
|
|
337
|
|
- @Transactional
|
|
321
|
+ @Transactional(rollbackFor = Exception.class)
|
338
|
322
|
@Override
|
339
|
|
- public ResponseBean addAllTransaction(Integer userId, String paramets,Integer userVerifyId) throws IOException {
|
|
323
|
+ public ResponseBean addAllTransaction(UserElement userElement, String paramets) {
|
340
|
324
|
ResponseBean response = new ResponseBean();
|
341
|
325
|
JSONObject jsonObject = JSONObject.parseObject(paramets);
|
342
|
|
- String transactionTitle = (String) jsonObject.get("title");
|
343
|
|
- String transactionContent = (String) jsonObject.get("content");
|
344
|
|
- String type= (String) jsonObject.get("type");
|
345
|
|
- String imageUrl = (String) jsonObject.get("imageUrl");
|
|
326
|
+ String transactionTitle = jsonObject.getString("title");
|
|
327
|
+ String transactionContent = jsonObject.getString("content");
|
|
328
|
+ String type = jsonObject.getString("type");
|
|
329
|
+ String imageUrl = jsonObject.getString("imageUrl");
|
346
|
330
|
|
347
|
|
- TaUser user=taUserMapper.selectByPrimaryKey(userId);
|
|
331
|
+ TaUser user = taUserMapper.selectByPrimaryKey(userElement.getId());
|
348
|
332
|
TpTransaction tpTransaction = new TpTransaction();
|
349
|
333
|
tpTransaction.setTransactionTitle(transactionTitle);
|
350
|
334
|
tpTransaction.setTransactionContent(transactionContent);
|
351
|
335
|
tpTransaction.setType(type);
|
352
|
|
- tpTransaction.setCommunityId(user.getCommunityId());
|
353
|
|
- tpTransaction.setTaUserId(userId);
|
354
|
|
- tpTransaction.setCreateUser(userId);
|
|
336
|
+ tpTransaction.setCommunityId(userElement.getCommunityId());
|
|
337
|
+ tpTransaction.setTaUserId(userElement.getId());
|
|
338
|
+ tpTransaction.setCreateUser(userElement.getId());
|
355
|
339
|
tpTransaction.setStatus("1");
|
356
|
340
|
tpTransaction.setCreateDate(new Date());
|
357
|
|
- tpTransaction.setUpdateUser(userId);
|
|
341
|
+ tpTransaction.setUpdateUser(userElement.getId());
|
358
|
342
|
tpTransaction.setUpdateDate(new Date());
|
359
|
|
- tpTransaction.setTaUserVerifyId(userVerifyId);
|
|
343
|
+ tpTransaction.setTaUserVerifyId(userElement.getUserVerifyId());
|
360
|
344
|
tpTransaction.setIsReported("0");
|
|
345
|
+ // 发布者身份 0 APP 1 物业
|
|
346
|
+ tpTransaction.setReleaseIdentity("0");
|
|
347
|
+ tpTransaction.setViewCount(0);
|
|
348
|
+ tpTransaction.setSort("1");
|
361
|
349
|
|
362
|
|
- //判断身份是否为业主且状态为已停用
|
363
|
|
- TaSysRole sysRole = taSysRoleMapper.findRoleByUserId(userId);
|
364
|
|
- TaUser taUser = taUserMapper.selectByPrimaryKey(userId);
|
365
|
|
- if (Constant.INVALID.equals(taUser.getStatus())
|
366
|
|
- && Constant.OWNER.equals(sysRole.getRoleName())){
|
367
|
|
-
|
368
|
|
- response.addError("9996", "您的身份已停用,请联系物业");
|
369
|
|
- return response;
|
370
|
|
- }
|
371
|
|
-
|
372
|
|
- //身份为家属租客,状态为已停用
|
373
|
|
- if (Constant.INVALID.equals(taUser.getStatus())
|
374
|
|
- && ((Constant.RELATION.equals(sysRole.getRoleName())) || Constant.TENANT.equals(sysRole.getRoleName()))){
|
|
350
|
+ //判断身份状态是否为已停用
|
|
351
|
+ iTaUserService.checkBlacklistStatusUser(user);
|
375
|
352
|
|
376
|
|
- response.addError("9996", "您的身份已停用,请联系物业");
|
377
|
|
- return response;
|
378
|
|
- }
|
379
|
|
-
|
380
|
|
- if (Constant.EFFECTIVE.equals(taUser.getStatus()) && (Constant.RELATION.equals(sysRole.getRoleName()) || Constant.TENANT.equals(sysRole.getRoleName()) || Constant.OWNER.equals(sysRole.getRoleName()))){
|
381
|
|
- tpTransactionMapper.insertSelective(tpTransaction);
|
382
|
|
- insertTdImage(tpTransaction, imageUrl, userId,Constant.TRANSACTION);
|
383
|
|
- TpTransaction tpTransaction1=tpTransactionMapper.getById(tpTransaction.getId());
|
384
|
|
- response.addSuccess(tpTransaction1);
|
385
|
|
- return response;
|
386
|
|
- }
|
387
|
|
- response.addError("9995", "无法确认您的身份,请联系物业");
|
|
353
|
+ tpTransactionMapper.insertSelective(tpTransaction);
|
|
354
|
+ insertTdImage(tpTransaction, imageUrl, userElement.getId(), Constant.TRANSACTION);
|
|
355
|
+ response.addSuccess(tpTransaction);
|
388
|
356
|
return response;
|
|
357
|
+
|
389
|
358
|
}
|
390
|
359
|
|
391
|
360
|
/**
|
392
|
361
|
* 图片入库
|
|
362
|
+ *
|
393
|
363
|
* @param tpTransaction
|
394
|
|
- * @param imageUrl 多个图片都好分割
|
|
364
|
+ * @param imageUrl 多个图片都好分割
|
395
|
365
|
* @param userId
|
396
|
|
- * @param type 服务:service, 公告:announcement , 活动:activity 租赁 : transaction
|
|
366
|
+ * @param type 服务:service, 公告:announcement , 活动:activity 租赁 : transaction
|
397
|
367
|
* @throws IOException
|
398
|
368
|
*/
|
399
|
|
- private void insertTdImage(TpTransaction tpTransaction, String imageUrl, Integer userId,String type) throws IOException {
|
|
369
|
+ private void insertTdImage(TpTransaction tpTransaction, String imageUrl, Integer userId, String type) {
|
400
|
370
|
if (null == imageUrl || "".equals(imageUrl)) {
|
401
|
371
|
return;
|
402
|
372
|
}
|
403
|
|
- String [] imgArr = imageUrl.split(",");
|
404
|
|
- for (String url : imgArr) {
|
|
373
|
+ String[] imgArr = imageUrl.split(",");
|
|
374
|
+ for (String url : imgArr) {
|
405
|
375
|
TdImages tdImages = new TdImages();
|
406
|
376
|
Integer uuId = tpTransaction.getId();
|
407
|
377
|
tdImages.setImageUrl(url);
|
|
@@ -412,57 +382,40 @@ public class SocialServiceImpl implements SocialServiceI {
|
412
|
382
|
tdImagesMapper.insertSelective(tdImages);
|
413
|
383
|
}
|
414
|
384
|
}
|
|
385
|
+
|
415
|
386
|
@Override
|
416
|
|
- public ResponseBean selectAllTransaction(Integer userId,Integer pageNum,Integer paeSize,Integer type,Integer communityId) {
|
|
387
|
+ public ResponseBean selectAllTransaction(UserElement userElement, Integer pageNum, Integer paeSize, Integer type) {
|
417
|
388
|
ResponseBean responseBean = new ResponseBean();
|
418
|
|
- TaUser user=taUserMapper.selectByPrimaryKey(userId);
|
|
389
|
+ TaUser user = taUserMapper.selectByPrimaryKey(userElement.getId());
|
419
|
390
|
|
420
|
|
- //判断身份是否为业主且状态为已停用
|
421
|
|
- TaSysRole sysRole = taSysRoleMapper.findRoleByUserId(userId);
|
422
|
|
- TaUser taUser = taUserMapper.selectByPrimaryKey(userId);
|
423
|
|
- if (Constant.INVALID.equals(taUser.getStatus())
|
424
|
|
- && Constant.OWNER.equals(sysRole.getRoleName())){
|
425
|
|
-
|
426
|
|
- responseBean.addError("9996", "您的身份已停用,请联系物业");
|
427
|
|
- return responseBean;
|
428
|
|
- }
|
429
|
|
-
|
430
|
|
- //身份为家属租客,状态为已停用
|
431
|
|
- if (Constant.INVALID.equals(taUser.getStatus())
|
432
|
|
- && ((Constant.RELATION.equals(sysRole.getRoleName())) || Constant.TENANT.equals(sysRole.getRoleName()))){
|
433
|
|
-
|
434
|
|
- responseBean.addError("9996", "您的身份已停用,请联系物业");
|
435
|
|
- return responseBean;
|
436
|
|
- }
|
|
391
|
+ //判断状态是否为已停用
|
|
392
|
+ iTaUserService.checkBlacklistStatusUser(user);
|
437
|
393
|
|
438
|
|
- if (Constant.EFFECTIVE.equals(taUser.getStatus()) && (Constant.RELATION.equals(sysRole.getRoleName()) || Constant.TENANT.equals(sysRole.getRoleName()) || Constant.OWNER.equals(sysRole.getRoleName()))){
|
439
|
|
- Map<String, Object> parameter = Maps.newHashMap();
|
440
|
|
- Page<TpTransaction> pageLsit=PageHelper.startPage(pageNum, paeSize);
|
441
|
|
- List<TpTransaction> tpTransactions=tpTransactionMapper.selectTransaction(userId,communityId,type);
|
|
394
|
+ Map<String, Object> parameter = Maps.newHashMap();
|
|
395
|
+ Page<TpTransaction> pageLsit = PageHelper.startPage(pageNum, paeSize);
|
|
396
|
+ List<TpTransaction> tpTransactions = tpTransactionMapper.selectTransaction(userElement.getId(), userElement.getCommunityId(), type);
|
|
397
|
+
|
|
398
|
+ tpTransactions.stream().forEach(e -> {
|
|
399
|
+ // 角色
|
|
400
|
+ TaSysRole taSysRole = taSysRoleMapper.findRoleByUserId(user.getId());
|
|
401
|
+ e.setRoleId(taSysRole.getId());
|
|
402
|
+ e.setRoleName(taSysRole.getRoleName());
|
|
403
|
+ e.setCreateUserName(user.getUserName());
|
|
404
|
+ });
|
442
|
405
|
|
443
|
|
- tpTransactions.stream().forEach(e->{
|
444
|
|
- // 角色
|
445
|
|
- TaSysRole taSysRole = taSysRoleMapper.findRoleByUserId(user.getId());
|
446
|
|
- e.setRoleId(taSysRole.getId());
|
447
|
|
- e.setRoleName(taSysRole.getRoleName());
|
448
|
|
- e.setCreateUserName(taUser.getUserName());
|
449
|
|
- });
|
|
406
|
+ parameter.put("list", tpTransactions);
|
|
407
|
+ parameter.put("total", pageLsit.getTotal());
|
|
408
|
+ responseBean.addSuccess(parameter);
|
450
|
409
|
|
451
|
|
- parameter.put("list",tpTransactions);
|
452
|
|
- parameter.put("total",pageLsit.getTotal());
|
453
|
|
- responseBean.addSuccess(parameter);
|
454
|
|
- return responseBean;
|
455
|
|
- }
|
456
|
|
- responseBean.addError("9995", "无法确认您的身份,请联系物业");
|
457
|
410
|
return responseBean;
|
458
|
411
|
}
|
459
|
412
|
|
460
|
413
|
@Override
|
461
|
414
|
@Transactional(rollbackFor = Exception.class)
|
462
|
|
- public ResponseBean updateTransaction(String paramets,Integer userId,Integer id) {
|
|
415
|
+ public ResponseBean updateTransaction(String paramets, Integer userId, Integer id) {
|
463
|
416
|
ResponseBean response = new ResponseBean();
|
464
|
417
|
JSONObject jsonObject = JSONObject.parseObject(paramets);
|
465
|
|
- String imageUrl = (String) jsonObject.get("imageUrl");
|
|
418
|
+ String imageUrl = jsonObject.getString("imageUrl");
|
466
|
419
|
|
467
|
420
|
TpTransaction tpTransaction = JSONObject.parseObject(paramets, TpTransaction.class);
|
468
|
421
|
TpTransaction transaction = tpTransactionMapper.getById(id);
|
|
@@ -472,16 +425,11 @@ public class SocialServiceImpl implements SocialServiceI {
|
472
|
425
|
|
473
|
426
|
if (null != transaction && userId.equals(transaction.getTaUserId())) {
|
474
|
427
|
tdImagesMapper.deleteTdImages(Integer.valueOf(id), Constant.TRANSACTION);
|
475
|
|
- try {
|
476
|
|
- insertTdImage(transaction, imageUrl, userId, Constant.TRANSACTION);
|
477
|
|
- } catch (IOException e) {
|
478
|
|
- e.printStackTrace();
|
479
|
|
- throw new RuntimeException("图片修改异常");
|
480
|
|
- }
|
|
428
|
+
|
|
429
|
+ insertTdImage(transaction, imageUrl, userId, Constant.TRANSACTION);
|
481
|
430
|
tpTransactionMapper.updateTransaction(Integer.valueOf(id), transaction.getTransactionTitle(), transaction.getTransactionContent(), userId);
|
482
|
431
|
response.addSuccess("修改成功");
|
483
|
432
|
return response;
|
484
|
|
-
|
485
|
433
|
}
|
486
|
434
|
response.addError("操作失败");
|
487
|
435
|
return response;
|
|
@@ -489,16 +437,15 @@ public class SocialServiceImpl implements SocialServiceI {
|
489
|
437
|
|
490
|
438
|
@Override
|
491
|
439
|
public ResponseBean deleteransaction(Integer id, UserElement userElement) {
|
492
|
|
- ResponseBean responseBean= new ResponseBean();
|
493
|
|
- TpTransaction tpTransaction=tpTransactionMapper.getById(Integer.valueOf(id));
|
494
|
|
- if(null!= tpTransaction && userElement.getId().equals(tpTransaction.getTaUserId())) {
|
|
440
|
+ ResponseBean responseBean = new ResponseBean();
|
|
441
|
+ TpTransaction tpTransaction = tpTransactionMapper.getById(Integer.valueOf(id));
|
|
442
|
+ if (null != tpTransaction && userElement.getId().equals(tpTransaction.getTaUserId())) {
|
495
|
443
|
tpTransaction.setStatus("0");
|
496
|
444
|
tpTransaction.setUpdateDate(new Date());
|
497
|
445
|
tpTransactionMapper.updateByPrimaryKeySelective(tpTransaction);
|
498
|
446
|
responseBean.addSuccess("删除成功");
|
499
|
447
|
|
500
|
448
|
|
501
|
|
-
|
502
|
449
|
// 把消息变为无效
|
503
|
450
|
Map<String, Object> map = new HashMap<>();
|
504
|
451
|
map.put("communityId", userElement.getCommunityId());
|
|
@@ -516,13 +463,12 @@ public class SocialServiceImpl implements SocialServiceI {
|
516
|
463
|
}
|
517
|
464
|
|
518
|
465
|
|
519
|
|
-
|
520
|
|
- }else {
|
|
466
|
+ } else {
|
521
|
467
|
responseBean.addSuccess("当前ID不存在");
|
522
|
468
|
}
|
523
|
469
|
return responseBean;
|
524
|
|
- }
|
525
|
|
-
|
|
470
|
+ }
|
|
471
|
+
|
526
|
472
|
/**
|
527
|
473
|
* 获取举报原因列表
|
528
|
474
|
*
|
|
@@ -532,7 +478,7 @@ public class SocialServiceImpl implements SocialServiceI {
|
532
|
478
|
public List<Map<String, Object>> getReportReasons() {
|
533
|
479
|
return tpTransactionMapper.getReportReasons();
|
534
|
480
|
}
|
535
|
|
-
|
|
481
|
+
|
536
|
482
|
/**
|
537
|
483
|
* 举报二手交易帖子
|
538
|
484
|
*
|
|
@@ -547,8 +493,8 @@ public class SocialServiceImpl implements SocialServiceI {
|
547
|
493
|
Integer transactionId = jsonObject.getInteger("transactionId");
|
548
|
494
|
String reportReasonId = jsonObject.getString("reportReasonId");
|
549
|
495
|
//校验举报的帖子存不存在
|
550
|
|
- TpTransaction tpTransaction = tpTransactionMapper.selectByPrimaryKey(transactionId,communityId);
|
551
|
|
- if (null == tpTransaction){
|
|
496
|
+ TpTransaction tpTransaction = tpTransactionMapper.selectByPrimaryKey(transactionId, communityId);
|
|
497
|
+ if (null == tpTransaction) {
|
552
|
498
|
responseBean.addError("举报的交易不存在");
|
553
|
499
|
return responseBean;
|
554
|
500
|
}
|
|
@@ -559,13 +505,13 @@ public class SocialServiceImpl implements SocialServiceI {
|
559
|
505
|
return responseBean;
|
560
|
506
|
}
|
561
|
507
|
//插入举报表
|
562
|
|
- tpTransactionMapper.saveReportReason(userId,communityId,transactionId,reportReasonId);
|
|
508
|
+ tpTransactionMapper.saveReportReason(userId, communityId, transactionId, reportReasonId);
|
563
|
509
|
//更新交易表的举报状态为被举报
|
564
|
510
|
TpTransaction record = new TpTransaction();
|
565
|
511
|
record.setId(transactionId);
|
566
|
512
|
record.setIsReported("1");
|
567
|
513
|
Integer size = tpTransactionMapper.updateByPrimaryKeySelective(record);
|
568
|
|
- if (size > 0){
|
|
514
|
+ if (size > 0) {
|
569
|
515
|
|
570
|
516
|
// 举报人
|
571
|
517
|
TaUser taUser = taUserMapper.selectByPrimaryKey(userId);
|
|
@@ -584,12 +530,12 @@ public class SocialServiceImpl implements SocialServiceI {
|
584
|
530
|
message.setAdviceType("4");
|
585
|
531
|
message.setModelType("1");
|
586
|
532
|
//超级管理员
|
587
|
|
- Integer userID= toCommunitiesMapper.selectAndmin(communityId);
|
|
533
|
+ Integer userID = toCommunitiesMapper.selectAndmin(communityId);
|
588
|
534
|
message.setUuid(userID);
|
589
|
535
|
message.setModelType("1");
|
590
|
536
|
message.setUuidType("2");
|
591
|
537
|
message.setSource("1");
|
592
|
|
- message.setMessageContent("{" + taUser.getUserName() + "}举报了{" + createUser.getUserName() + "}发布的帖子:{" + tpTransaction.getTransactionTitle() + "},举报原因:{" + sysReportReason.getReason() + "},点击责令发布人修改或直接作废帖子");
|
|
538
|
+ message.setMessageContent("{" + taUser.getUserName() + "}举报了{" + createUser.getUserName() + "}发布的帖子:{" + tpTransaction.getTransactionTitle() + "},举报原因:{" + sysReportReason.getReason() + "},点击责令发布人修改或直接作废帖子");
|
593
|
539
|
message.setStatus("1");
|
594
|
540
|
message.setReadStatus("0");
|
595
|
541
|
message.setTransactionId(transactionId);
|
|
@@ -598,7 +544,6 @@ public class SocialServiceImpl implements SocialServiceI {
|
598
|
544
|
tpMessageMapper.insertSelective(message);
|
599
|
545
|
|
600
|
546
|
|
601
|
|
-
|
602
|
547
|
responseBean.addSuccess(size);
|
603
|
548
|
return responseBean;
|
604
|
549
|
}
|
|
@@ -608,22 +553,22 @@ public class SocialServiceImpl implements SocialServiceI {
|
608
|
553
|
|
609
|
554
|
@Override
|
610
|
555
|
public ResponseBean addTransactionReply(String paramets, UserElement userElement) {
|
611
|
|
- ResponseBean response= new ResponseBean();
|
612
|
|
- JSONObject object= JSONObject.parseObject(paramets);
|
613
|
|
- JSONArray array= object.getJSONArray("imgArr");
|
|
556
|
+ ResponseBean response = new ResponseBean();
|
|
557
|
+ JSONObject object = JSONObject.parseObject(paramets);
|
|
558
|
+ JSONArray array = object.getJSONArray("imgArr");
|
614
|
559
|
String[] reply = null;
|
615
|
|
- if (null!=array) {
|
616
|
|
- reply= array.toArray(new String[]{});
|
|
560
|
+ if (null != array) {
|
|
561
|
+ reply = array.toArray(new String[]{});
|
617
|
562
|
}
|
618
|
|
- TpTransactionReply tpTransactionReply= JSONObject.parseObject(paramets,TpTransactionReply.class);
|
|
563
|
+ TpTransactionReply tpTransactionReply = JSONObject.parseObject(paramets, TpTransactionReply.class);
|
619
|
564
|
tpTransactionReply.setCommunityId(userElement.getCommunityId());
|
620
|
565
|
tpTransactionReply.setTaUserId(userElement.getId());
|
621
|
566
|
tpTransactionReply.setTaUserName(userElement.getUserName());
|
622
|
567
|
//获取被回复的姓名
|
623
|
|
- if("".equals(tpTransactionReply.getReplyTaUserId())) {
|
|
568
|
+ if ("".equals(tpTransactionReply.getReplyTaUserId())) {
|
624
|
569
|
tpTransactionReply.setReplyTaUserId(null);
|
625
|
570
|
}
|
626
|
|
- if(null!=tpTransactionReply.getReplyTaUserId()&!"".equals(tpTransactionReply.getReplyTaUserId())) {
|
|
571
|
+ if (null != tpTransactionReply.getReplyTaUserId() & !"".equals(tpTransactionReply.getReplyTaUserId())) {
|
627
|
572
|
tpTransactionReply.setReplyTaUserName(taUserMapper.selectByPrimaryKey(tpTransactionReply.getReplyTaUserId()).getUserName());
|
628
|
573
|
}
|
629
|
574
|
tpTransactionReply.setReleaseIdentity("0");
|
|
@@ -631,7 +576,7 @@ public class SocialServiceImpl implements SocialServiceI {
|
631
|
576
|
tpTransactionReply.setCreateDate(new Date());
|
632
|
577
|
tpTransactionReplyMapper.insert(tpTransactionReply);
|
633
|
578
|
|
634
|
|
- if (null!=array) {
|
|
579
|
+ if (null != array) {
|
635
|
580
|
for (String img : reply) {
|
636
|
581
|
TdImages tdImages = new TdImages();
|
637
|
582
|
tdImages.setImageUrl(img);
|
|
@@ -648,13 +593,13 @@ public class SocialServiceImpl implements SocialServiceI {
|
648
|
593
|
|
649
|
594
|
@Override
|
650
|
595
|
public ResponseBean addTransactionLike(String paramets, UserElement userElement) {
|
651
|
|
- ResponseBean response = new ResponseBean();
|
652
|
|
- TpTransactionLike tpTransactionLike= JSONObject.parseObject(paramets,TpTransactionLike.class);
|
|
596
|
+ ResponseBean response = new ResponseBean();
|
|
597
|
+ TpTransactionLike tpTransactionLike = JSONObject.parseObject(paramets, TpTransactionLike.class);
|
653
|
598
|
tpTransactionLike.setCommunityId(userElement.getCommunityId());
|
654
|
599
|
tpTransactionLike.setTaUserId(userElement.getId());
|
655
|
600
|
tpTransactionLike.setCreateDate(new Date());
|
656
|
|
- TpTransactionLike isUser= tpTransactionLikeMapper.getinvitationId(tpTransactionLike.getTransactionId(),userElement.getCommunityId(),userElement.getId());
|
657
|
|
- if (null!=isUser) {
|
|
601
|
+ TpTransactionLike isUser = tpTransactionLikeMapper.getinvitationId(tpTransactionLike.getTransactionId(), userElement.getCommunityId(), userElement.getId());
|
|
602
|
+ if (null != isUser) {
|
658
|
603
|
response.addError("您已点赞或踩");
|
659
|
604
|
return response;
|
660
|
605
|
}
|
|
@@ -664,46 +609,46 @@ public class SocialServiceImpl implements SocialServiceI {
|
664
|
609
|
}
|
665
|
610
|
|
666
|
611
|
@Override
|
667
|
|
- public ResponseBean userActivityList( UserElement userElement,Integer pageNum,Integer paeSize) {
|
668
|
|
- ResponseBean responseBean= new ResponseBean();
|
|
612
|
+ public ResponseBean userActivityList(UserElement userElement, Integer pageNum, Integer paeSize) {
|
|
613
|
+ ResponseBean responseBean = new ResponseBean();
|
669
|
614
|
Map<String, Object> parameter = Maps.newHashMap();
|
670
|
|
- Page<TpActivity> pageList= PageHelper.startPage(pageNum, paeSize);
|
671
|
|
- List<TpActivity> tpActivity= tpActivityMapper.selecttpActivity(userElement.getId(),userElement.getCommunityId());
|
672
|
|
- parameter.put("list",tpActivity);
|
673
|
|
- parameter.put("total",pageList.getTotal());
|
|
615
|
+ Page<TpActivity> pageList = PageHelper.startPage(pageNum, paeSize);
|
|
616
|
+ List<TpActivity> tpActivity = tpActivityMapper.selecttpActivity(userElement.getId(), userElement.getCommunityId());
|
|
617
|
+ parameter.put("list", tpActivity);
|
|
618
|
+ parameter.put("total", pageList.getTotal());
|
674
|
619
|
responseBean.addSuccess(parameter);
|
675
|
620
|
return responseBean;
|
676
|
621
|
}
|
677
|
622
|
|
678
|
623
|
@Override
|
679
|
|
- public ResponseBean userTransactionList(UserElement userElement,Integer pageNum,Integer paeSize) {
|
680
|
|
- ResponseBean responseBean= new ResponseBean();
|
|
624
|
+ public ResponseBean userTransactionList(UserElement userElement, Integer pageNum, Integer paeSize) {
|
|
625
|
+ ResponseBean responseBean = new ResponseBean();
|
681
|
626
|
//拿到我自己所有的帖子
|
682
|
627
|
Map<String, Object> parameter = Maps.newHashMap();
|
683
|
|
- Page<TpTransaction> pageList=PageHelper.startPage(pageNum, paeSize);
|
684
|
|
- List<TpTransaction> tpTransactionList = tpTransactionMapper.getUserTransactionList(userElement.getId(),userElement.getCommunityId());
|
685
|
|
-
|
686
|
|
- parameter.put("list",tpTransactionList);
|
687
|
|
- parameter.put("total",pageList.getTotal());
|
|
628
|
+ Page<TpTransaction> pageList = PageHelper.startPage(pageNum, paeSize);
|
|
629
|
+ List<TpTransaction> tpTransactionList = tpTransactionMapper.getUserTransactionList(userElement.getId(), userElement.getCommunityId());
|
|
630
|
+
|
|
631
|
+ parameter.put("list", tpTransactionList);
|
|
632
|
+ parameter.put("total", pageList.getTotal());
|
688
|
633
|
responseBean.addSuccess(parameter);
|
689
|
634
|
return responseBean;
|
690
|
635
|
}
|
691
|
636
|
|
692
|
637
|
@Override
|
693
|
638
|
public ResponseBean tpActivitySignInAdd(String paramets, UserElement userElement) {
|
694
|
|
- ResponseBean responseBean= new ResponseBean();
|
695
|
|
- Integer activityId= JSONObject.parseObject(paramets).getInteger("activityId");
|
696
|
|
- TpActivitySignIn tpActivitySignIn= new TpActivitySignIn();
|
|
639
|
+ ResponseBean responseBean = new ResponseBean();
|
|
640
|
+ Integer activityId = JSONObject.parseObject(paramets).getInteger("activityId");
|
|
641
|
+ TpActivitySignIn tpActivitySignIn = new TpActivitySignIn();
|
697
|
642
|
tpActivitySignIn.setActivityId(activityId);
|
698
|
643
|
tpActivitySignIn.setCommunityId(userElement.getCommunityId());
|
699
|
644
|
|
700
|
|
- TaUserVerify taUserVerify= taUserVerifyMapper.selectByPrimaryKey(userElement.getUserVerifyId());
|
|
645
|
+ TaUserVerify taUserVerify = taUserVerifyMapper.selectByPrimaryKey(userElement.getUserVerifyId());
|
701
|
646
|
|
702
|
|
- String description= taSysRoleMapper.selectByPrimaryKey(taUserVerify.getRoleId()).getDescription();
|
|
647
|
+ String description = taSysRoleMapper.selectByPrimaryKey(taUserVerify.getRoleId()).getDescription();
|
703
|
648
|
tpActivitySignIn.setUserRole(description);
|
704
|
649
|
tpActivitySignIn.setUserName(userElement.getUserName());
|
705
|
650
|
//期/栋/单/层/户
|
706
|
|
- String bu=taUserVerify.getPhaseName()+"期"+taUserVerify.getBuildingName()+"栋"+taUserVerify.getUnitName()+"单"+taUserVerify.getLevelName()+"层"+taUserVerify.getRoomNoName()+"户";
|
|
651
|
+ String bu = taUserVerify.getPhaseName() + "期" + taUserVerify.getBuildingName() + "栋" + taUserVerify.getUnitName() + "单" + taUserVerify.getLevelName() + "层" + taUserVerify.getRoomNoName() + "户";
|
707
|
652
|
tpActivitySignIn.setBuildingInfo(bu);
|
708
|
653
|
tpActivitySignIn.setTaUserId(userElement.getId());
|
709
|
654
|
tpActivitySignIn.setUserTel(userElement.getLoginName());
|
|
@@ -717,16 +662,16 @@ public class SocialServiceImpl implements SocialServiceI {
|
717
|
662
|
|
718
|
663
|
@Override
|
719
|
664
|
public ResponseBean replyAdd(String paramets, UserElement userElement) {
|
720
|
|
- ResponseBean response= new ResponseBean();
|
|
665
|
+ ResponseBean response = new ResponseBean();
|
721
|
666
|
|
722
|
|
- JSONObject object= JSONObject.parseObject(paramets);
|
723
|
|
- Integer transactionId= object.getInteger("transactionId");
|
724
|
|
- String replyContent= object.getString("replyContent");
|
725
|
|
- Integer replyUserId= object.getInteger("replyUserId");
|
726
|
|
- String[] imgArr= object.getJSONArray("imgArr").toArray(new String[]{});
|
|
667
|
+ JSONObject object = JSONObject.parseObject(paramets);
|
|
668
|
+ Integer transactionId = object.getInteger("transactionId");
|
|
669
|
+ String replyContent = object.getString("replyContent");
|
|
670
|
+ Integer replyUserId = object.getInteger("replyUserId");
|
|
671
|
+ String[] imgArr = object.getJSONArray("imgArr").toArray(new String[]{});
|
727
|
672
|
|
728
|
|
- String userName= taUserMapper.selectByPrimaryKey(replyUserId).getUserName();
|
729
|
|
- TpTransactionReply tpTransactionReply= new TpTransactionReply();
|
|
673
|
+ String userName = taUserMapper.selectByPrimaryKey(replyUserId).getUserName();
|
|
674
|
+ TpTransactionReply tpTransactionReply = new TpTransactionReply();
|
730
|
675
|
tpTransactionReply.setCommunityId(userElement.getCommunityId());
|
731
|
676
|
tpTransactionReply.setTransactionId(transactionId);
|
732
|
677
|
tpTransactionReply.setTaUserId(userElement.getId());
|
|
@@ -739,8 +684,8 @@ public class SocialServiceImpl implements SocialServiceI {
|
739
|
684
|
response.addSuccess("成功");
|
740
|
685
|
tpTransactionReplyMapper.insert(tpTransactionReply);
|
741
|
686
|
//添加评论图片
|
742
|
|
- for(String img:imgArr){
|
743
|
|
- TdImages tdImages= new TdImages();
|
|
687
|
+ for (String img : imgArr) {
|
|
688
|
+ TdImages tdImages = new TdImages();
|
744
|
689
|
tdImages.setImageUrl(img);
|
745
|
690
|
tdImages.setType("reply");
|
746
|
691
|
tdImages.setUuid(tpTransactionReply.getId());
|
|
@@ -774,15 +719,15 @@ public class SocialServiceImpl implements SocialServiceI {
|
774
|
719
|
TpMessage message = new TpMessage();
|
775
|
720
|
message.setCommunityId(communityId);
|
776
|
721
|
message.setTicketId(tpTicket.getId());
|
777
|
|
- TpTicket tic= tpTicketMapper.selectByTicketId(String.valueOf(communityId),Integer.valueOf(ticketId));
|
|
722
|
+ TpTicket tic = tpTicketMapper.selectByTicketId(String.valueOf(communityId), Integer.valueOf(ticketId));
|
778
|
723
|
message.setMessageType(tic.getType());
|
779
|
724
|
message.setAdviceType("4");
|
780
|
725
|
message.setModelType("1");
|
781
|
|
- Integer createUser=tpTicketMapper.selectRecordStatus(communityId,tpTicket.getId());
|
|
726
|
+ Integer createUser = tpTicketMapper.selectRecordStatus(communityId, tpTicket.getId());
|
782
|
727
|
message.setUuid(createUser);
|
783
|
728
|
message.setUuidType("2");
|
784
|
729
|
message.setSource("2");
|
785
|
|
- message.setMessageContent("工单“"+tic.getTicketTitle() +"”已经验收并评价,点击查看评分");
|
|
730
|
+ message.setMessageContent("工单“" + tic.getTicketTitle() + "”已经验收并评价,点击查看评分");
|
786
|
731
|
message.setStatus("1");
|
787
|
732
|
message.setReadStatus("0");
|
788
|
733
|
message.setCreateUser(userId);
|
|
@@ -796,10 +741,10 @@ public class SocialServiceImpl implements SocialServiceI {
|
796
|
741
|
if (null == num) {
|
797
|
742
|
num = 0;
|
798
|
743
|
}
|
799
|
|
- List<TpActivity> listActivity=tpActivityMapper.getActivity(communityId,num);
|
|
744
|
+ List<TpActivity> listActivity = tpActivityMapper.getActivity(communityId, num);
|
800
|
745
|
return listActivity;
|
801
|
746
|
}
|
802
|
|
-
|
|
747
|
+
|
803
|
748
|
/**
|
804
|
749
|
* 取消报名接口
|
805
|
750
|
*
|
|
@@ -817,17 +762,17 @@ public class SocialServiceImpl implements SocialServiceI {
|
817
|
762
|
tpActivitySignup.setTaUserId(userId);
|
818
|
763
|
tpActivitySignupMapper.deleteSignUp(tpActivitySignup);
|
819
|
764
|
//更新报名人数
|
820
|
|
- updateActivitySignUpNum(communityId,activityId);
|
|
765
|
+ updateActivitySignUpNum(communityId, activityId);
|
821
|
766
|
responseBean.addSuccess("取消报名成功");
|
822
|
767
|
return responseBean;
|
823
|
768
|
}
|
824
|
769
|
|
825
|
770
|
|
826
|
|
- public ResponseBean insertActivitySignUp(UserElement userElement, TpActivity tpActivity, Integer communityId, Integer userId,String remark){
|
|
771
|
+ public ResponseBean insertActivitySignUp(UserElement userElement, TpActivity tpActivity, Integer communityId, String remark) {
|
827
|
772
|
ResponseBean responseBean = new ResponseBean();
|
828
|
773
|
//判断是否已经报名
|
829
|
|
- Integer signNum = tpActivitySignupMapper.findTpActivetitySignByUserId(tpActivity.getId(), communityId, userId);
|
830
|
|
- if (signNum != 0){
|
|
774
|
+ Integer signNum = tpActivitySignupMapper.findTpActivetitySignByUserId(tpActivity.getId(), communityId, userElement.getId());
|
|
775
|
+ if (signNum != 0) {
|
831
|
776
|
responseBean.addError("9996", "您已报名,请勿重复报名");
|
832
|
777
|
return responseBean;
|
833
|
778
|
}
|
|
@@ -835,7 +780,7 @@ public class SocialServiceImpl implements SocialServiceI {
|
835
|
780
|
TpActivitySignup tpActivitySignup = new TpActivitySignup();
|
836
|
781
|
tpActivitySignup.setActivityId(tpActivity.getId());
|
837
|
782
|
tpActivitySignup.setCommunityId(communityId);
|
838
|
|
- tpActivitySignup.setTaUserId(userId);
|
|
783
|
+ tpActivitySignup.setTaUserId(userElement.getId());
|
839
|
784
|
tpActivitySignup.setSignUpTime(new Date());
|
840
|
785
|
tpActivitySignup.setRemark(remark);
|
841
|
786
|
|
|
@@ -847,18 +792,19 @@ public class SocialServiceImpl implements SocialServiceI {
|
847
|
792
|
|
848
|
793
|
tpActivitySignupMapper.insertSelective(tpActivitySignup);
|
849
|
794
|
//更新报名人数
|
850
|
|
- updateActivitySignUpNum(communityId,tpActivity.getId());
|
|
795
|
+ updateActivitySignUpNum(communityId, tpActivity.getId());
|
851
|
796
|
responseBean.addSuccess("报名成功");
|
852
|
797
|
return responseBean;
|
853
|
798
|
}
|
854
|
|
-
|
|
799
|
+
|
855
|
800
|
/**
|
856
|
801
|
* 更新报名人数
|
|
802
|
+ *
|
857
|
803
|
* @param communityId
|
858
|
804
|
* @param activityId
|
859
|
805
|
* @return
|
860
|
806
|
*/
|
861
|
|
- private Integer updateActivitySignUpNum(Integer communityId,Integer activityId) {
|
|
807
|
+ private Integer updateActivitySignUpNum(Integer communityId, Integer activityId) {
|
862
|
808
|
TpActivitySignup tpActivitySignup = new TpActivitySignup();
|
863
|
809
|
tpActivitySignup.setActivityId(activityId);
|
864
|
810
|
tpActivitySignup.setCommunityId(communityId);
|
|
@@ -873,25 +819,25 @@ public class SocialServiceImpl implements SocialServiceI {
|
873
|
819
|
@Transactional
|
874
|
820
|
@Override
|
875
|
821
|
public TpTransaction findUsedDetails(Integer activityId, Integer communityId, Integer userId) {
|
876
|
|
- Integer num = updateSocialView(userId,Constant.LEASE,communityId,activityId);
|
877
|
|
- if (null != num){
|
|
822
|
+ Integer num = updateSocialView(userId, Constant.LEASE, communityId, activityId);
|
|
823
|
+ if (null != num) {
|
878
|
824
|
TpTransaction transaction = new TpTransaction();
|
879
|
825
|
transaction.setId(activityId);
|
880
|
826
|
transaction.setViewCount(num);
|
881
|
827
|
tpTransactionMapper.updateByPrimaryKeySelective(transaction);
|
882
|
828
|
}
|
883
|
829
|
|
884
|
|
- TpTransaction tpTransaction = tpTransactionMapper.selectByPrimaryKey(activityId,communityId);
|
885
|
|
- TaUser taUser=taUserMapper.selectByPrimaryKey(tpTransaction.getTaUserId());
|
|
830
|
+ TpTransaction tpTransaction = tpTransactionMapper.selectByPrimaryKey(activityId, communityId);
|
|
831
|
+ TaUser taUser = taUserMapper.selectByPrimaryKey(tpTransaction.getTaUserId());
|
886
|
832
|
tpTransaction.setTelephone(taUser.getLoginName());
|
887
|
833
|
tpTransaction.setCreateUserName(taUser.getUserName());
|
888
|
834
|
|
889
|
|
- Map<String,Object> map = Maps.newHashMap();
|
890
|
|
- map.put("uuid",tpTransaction.getId());
|
891
|
|
- map.put("type",Constant.TRANSACTION);
|
|
835
|
+ Map<String, Object> map = Maps.newHashMap();
|
|
836
|
+ map.put("uuid", tpTransaction.getId());
|
|
837
|
+ map.put("type", Constant.TRANSACTION);
|
892
|
838
|
// 查询图片
|
893
|
839
|
List<TdImages> tdImagesList = tdImagesMapper.getByUUIDAndByType(map);
|
894
|
|
- List<String> imgList = tdImagesList.stream().map(e->new String(e.getImageUrl())).collect(Collectors.toList());
|
|
840
|
+ List<String> imgList = tdImagesList.stream().map(e -> new String(e.getImageUrl())).collect(Collectors.toList());
|
895
|
841
|
tpTransaction.setImgList(imgList);
|
896
|
842
|
|
897
|
843
|
/**
|
|
@@ -900,15 +846,15 @@ public class SocialServiceImpl implements SocialServiceI {
|
900
|
846
|
|
901
|
847
|
|
902
|
848
|
//统计点赞人数的次数
|
903
|
|
- Integer likeCount= tpTransactionLikeMapper.likeCount(activityId, communityId);
|
|
849
|
+ Integer likeCount = tpTransactionLikeMapper.likeCount(activityId, communityId);
|
904
|
850
|
//不喜欢的人数
|
905
|
|
- Integer noLikeCount= tpTransactionLikeMapper.nolikeCount(activityId, communityId);
|
|
851
|
+ Integer noLikeCount = tpTransactionLikeMapper.nolikeCount(activityId, communityId);
|
906
|
852
|
tpTransaction.setLikeCount(likeCount == null ? 0 : likeCount);
|
907
|
853
|
tpTransaction.setNoLikeCount(noLikeCount == null ? 0 : noLikeCount);
|
908
|
854
|
|
909
|
855
|
// 查询是 点赞 还是 踩
|
910
|
|
- TpTransactionLike isUser= tpTransactionLikeMapper.getinvitationId(activityId,communityId, userId);
|
911
|
|
- if (null!=isUser){
|
|
856
|
+ TpTransactionLike isUser = tpTransactionLikeMapper.getinvitationId(activityId, communityId, userId);
|
|
857
|
+ if (null != isUser) {
|
912
|
858
|
tpTransaction.setBel(isUser.getLikeStatus());
|
913
|
859
|
}
|
914
|
860
|
|
|
@@ -921,7 +867,7 @@ public class SocialServiceImpl implements SocialServiceI {
|
921
|
867
|
public ResponseBean updateActivtiySignUp(Integer activityId, Integer communityId, Integer userId, String remark) {
|
922
|
868
|
ResponseBean responseBean = new ResponseBean();
|
923
|
869
|
TpActivitySignup tpActivitySignup = tpActivitySignupMapper.selectTpActivetitySignByUserId(activityId, communityId, userId);
|
924
|
|
- if (null == tpActivitySignup){
|
|
870
|
+ if (null == tpActivitySignup) {
|
925
|
871
|
responseBean.addError("9996", "您未报名!");
|
926
|
872
|
return responseBean;
|
927
|
873
|
}
|
|
@@ -939,7 +885,7 @@ public class SocialServiceImpl implements SocialServiceI {
|
939
|
885
|
|
940
|
886
|
ResponseBean responseBean = new ResponseBean();
|
941
|
887
|
TpActivitySignup tpActivitySignup = tpActivitySignupMapper.selectTpActivetitySignByUserId(activityId, communityId, userId);
|
942
|
|
- if (null == tpActivitySignup){
|
|
888
|
+ if (null == tpActivitySignup) {
|
943
|
889
|
responseBean.addError("9996", "您未报名!");
|
944
|
890
|
return responseBean;
|
945
|
891
|
}
|
|
@@ -950,17 +896,17 @@ public class SocialServiceImpl implements SocialServiceI {
|
950
|
896
|
}
|
951
|
897
|
|
952
|
898
|
@Override
|
953
|
|
- public ResponseBean findUsedDetailsReply(Integer transactionId, UserElement userElement, String order, Integer pageNum, Integer pageSize,Integer type) {
|
|
899
|
+ public ResponseBean findUsedDetailsReply(Integer transactionId, UserElement userElement, String order, Integer pageNum, Integer pageSize, Integer type) {
|
954
|
900
|
ResponseBean responseBean = new ResponseBean();
|
955
|
901
|
//拿到当前帖子的创建人
|
956
|
|
- Integer CreateUser= tpTransactionMapper.getById(transactionId).getCreateUser();
|
|
902
|
+ Integer CreateUser = tpTransactionMapper.getById(transactionId).getCreateUser();
|
957
|
903
|
|
958
|
904
|
PageHelper.startPage(pageNum, pageSize, "create_date " + order);
|
959
|
|
- List<TpTransactionReply> replies = tpTransactionReplyMapper.getCommunityIdAndTransactionId(userElement.getCommunityId(), transactionId,userElement.getUnitId(),CreateUser,type);
|
960
|
|
- for (TpTransactionReply tpTransactionReply:replies){
|
961
|
|
- List<TdImages> tdImagesList= tdImagesMapper.selectImages(tpTransactionReply.getId(),"reply");
|
962
|
|
- List<String> list= new ArrayList<>();
|
963
|
|
- for (TdImages imageUrl:tdImagesList){
|
|
905
|
+ List<TpTransactionReply> replies = tpTransactionReplyMapper.getCommunityIdAndTransactionId(userElement.getCommunityId(), transactionId, userElement.getUnitId(), CreateUser, type);
|
|
906
|
+ for (TpTransactionReply tpTransactionReply : replies) {
|
|
907
|
+ List<TdImages> tdImagesList = tdImagesMapper.selectImages(tpTransactionReply.getId(), "reply");
|
|
908
|
+ List<String> list = new ArrayList<>();
|
|
909
|
+ for (TdImages imageUrl : tdImagesList) {
|
964
|
910
|
list.add(imageUrl.getImageUrl());
|
965
|
911
|
tpTransactionReply.setImgList(list);
|
966
|
912
|
}
|