dingxin 6 年前
父节点
当前提交
b02f0663b1

+ 4
- 8
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/SocialController.java 查看文件

64
                                      @RequestParam(value = "remark", required = false) String remark,
64
                                      @RequestParam(value = "remark", required = false) String remark,
65
                                      @RequestParam("activityId") Integer activityId,
65
                                      @RequestParam("activityId") Integer activityId,
66
                                      HttpSession session) {
66
                                      HttpSession session) {
67
-        UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
68
-        Integer userId = userElement.getId();
69
-
67
+        UserElement userElement = getUserElement(session);
70
         ResponseBean responseBean = new ResponseBean();
68
         ResponseBean responseBean = new ResponseBean();
71
 
69
 
72
         if (!check(communityId)) {
70
         if (!check(communityId)) {
74
             return responseBean;
72
             return responseBean;
75
         }
73
         }
76
 
74
 
77
-        responseBean = socialServiceI.findTaUserInfo(userElement, activityId, communityId, userId,remark);
75
+        responseBean = socialServiceI.findTaUserInfo(userElement, activityId, communityId ,remark);
78
         return responseBean;
76
         return responseBean;
79
     }
77
     }
80
     
78
     
332
 
330
 
333
         ResponseBean responseBean = new ResponseBean();
331
         ResponseBean responseBean = new ResponseBean();
334
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
332
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
335
-        Integer userId = userElement.getId();
336
-        ResponseBean response = socialServiceI.addAllTransaction(userId, paramets,userElement.getUserVerifyId());
333
+        ResponseBean response = socialServiceI.addAllTransaction(userElement, paramets);
337
         return response;
334
         return response;
338
     }
335
     }
339
     
336
     
368
                                              @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize) {
365
                                              @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize) {
369
         ResponseBean responseBean = new ResponseBean();
366
         ResponseBean responseBean = new ResponseBean();
370
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
367
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
371
-        Integer userId = userElement.getId();
372
-        ResponseBean response = socialServiceI.selectAllTransaction(userId, pageNum, pageSize,type,userElement.getCommunityId());
368
+        ResponseBean response = socialServiceI.selectAllTransaction(userElement, pageNum, pageSize,type);
373
         return response;
369
         return response;
374
     }
370
     }
375
 
371
 

+ 1
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/TicketController.java 查看文件

161
     public ResponseBean addTransaction(@RequestBody String paramets, HttpSession session) throws IOException {
161
     public ResponseBean addTransaction(@RequestBody String paramets, HttpSession session) throws IOException {
162
         ResponseBean responseBean = new ResponseBean();
162
         ResponseBean responseBean = new ResponseBean();
163
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
163
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
164
-        Integer userId = userElement.getId();
165
-        ResponseBean response = iTicketService.addAiTicketService(userId, paramets);
164
+        ResponseBean response = iTicketService.addAiTicketService(userElement, paramets);
166
         return response;
165
         return response;
167
     }
166
     }
168
 
167
 

+ 13
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpTransaction.java 查看文件

63
      */
63
      */
64
     private String releaseIdentity;
64
     private String releaseIdentity;
65
 
65
 
66
+    /**
67
+     * 权重
68
+     */
69
+    private String sort;
70
+
66
     public void setReleaseIdentity(String releaseIdentity) {
71
     public void setReleaseIdentity(String releaseIdentity) {
67
         this.releaseIdentity = releaseIdentity;
72
         this.releaseIdentity = releaseIdentity;
68
     }
73
     }
248
     public void setBel(String bel) {
253
     public void setBel(String bel) {
249
         this.bel = bel;
254
         this.bel = bel;
250
     }
255
     }
256
+
257
+    public String getSort() {
258
+        return sort;
259
+    }
260
+
261
+    public void setSort(String sort) {
262
+        this.sort = sort;
263
+    }
251
 }
264
 }

+ 3
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/ITicketService.java 查看文件

1
 package com.community.huiju.service;
1
 package com.community.huiju.service;
2
 
2
 
3
 import com.community.commom.mode.ResponseBean;
3
 import com.community.commom.mode.ResponseBean;
4
+import com.community.commom.session.UserElement;
4
 import com.community.huiju.model.TpTicket;
5
 import com.community.huiju.model.TpTicket;
5
 import com.community.huiju.model.TpTicketRecordComment;
6
 import com.community.huiju.model.TpTicketRecordComment;
6
 import com.community.huiju.vo.TpTicketVO;
7
 import com.community.huiju.vo.TpTicketVO;
43
 
44
 
44
 	/**
45
 	/**
45
 	 * 添加 维修/投诉/联系单
46
 	 * 添加 维修/投诉/联系单
46
-	 * @param userId
47
+	 * @param userElement
47
 	 * @param parameter
48
 	 * @param parameter
48
 	 * @return
49
 	 * @return
49
 	 */
50
 	 */
50
-    ResponseBean addAiTicketService(Integer userId,String parameter) throws IOException;
51
+    ResponseBean addAiTicketService(UserElement userElement, String parameter) throws IOException;
51
 	
52
 	
52
 	/**
53
 	/**
53
 	 * 回复工单
54
 	 * 回复工单

+ 7
- 5
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/SocialServiceI.java 查看文件

64
 	 * 活动报名
64
 	 * 活动报名
65
 	 * @param activityId
65
 	 * @param activityId
66
 	 * @param communityId
66
 	 * @param communityId
67
-	 * @param userId
68
 	 * @param remark
67
 	 * @param remark
69
 	 * @return
68
 	 * @return
70
 	 */
69
 	 */
71
-	ResponseBean findTaUserInfo(UserElement userElement, Integer activityId, Integer communityId, Integer userId, String remark);
70
+	ResponseBean findTaUserInfo(UserElement userElement, Integer activityId, Integer communityId, String remark);
72
 
71
 
73
 	/**
72
 	/**
74
 	 * 修改活动报名
73
 	 * 修改活动报名
108
 	/**
107
 	/**
109
 	 * 添加二手租赁帖子
108
 	 * 添加二手租赁帖子
110
 	 */
109
 	 */
111
-    ResponseBean addAllTransaction(Integer userId, String paramets, Integer userVerifyId)throws IOException;
110
+    ResponseBean addAllTransaction(UserElement userElement, String paramets);
112
 
111
 
113
 
112
 
114
 	/**
113
 	/**
115
 	 * 获取当前用户发布所有的帖子
114
 	 * 获取当前用户发布所有的帖子
116
-	 * @param userId
115
+	 * @param userElement
116
+	 * @param pageNum
117
+	 * @param pageSize
118
+	 * @param type
117
 	 * @return
119
 	 * @return
118
 	 */
120
 	 */
119
-	ResponseBean selectAllTransaction(Integer userId,Integer pageNum,Integer pageSize,Integer type,Integer communityId);
121
+	ResponseBean selectAllTransaction(UserElement userElement,Integer pageNum,Integer pageSize,Integer type);
120
 
122
 
121
 	/**
123
 	/**
122
 	 * 修改当前帖子
124
 	 * 修改当前帖子

+ 206
- 260
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java 查看文件

7
 import com.community.commom.session.UserElement;
7
 import com.community.commom.session.UserElement;
8
 import com.community.huiju.dao.*;
8
 import com.community.huiju.dao.*;
9
 import com.community.huiju.model.*;
9
 import com.community.huiju.model.*;
10
+import com.community.huiju.service.ITaUserService;
10
 import com.community.huiju.service.ImageServiceI;
11
 import com.community.huiju.service.ImageServiceI;
11
 import com.community.huiju.service.SocialServiceI;
12
 import com.community.huiju.service.SocialServiceI;
12
 import com.github.pagehelper.Page;
13
 import com.github.pagehelper.Page;
60
     private TaUserMapper taUserMapper;
61
     private TaUserMapper taUserMapper;
61
 
62
 
62
     @Autowired
63
     @Autowired
63
-    private  TaSysUserRoleMapper taSysUserRoleMapper;
64
+    private TaSysUserRoleMapper taSysUserRoleMapper;
64
 
65
 
65
     @Autowired
66
     @Autowired
66
     private TpTicketRecordMapper tpTicketRecordMapper;
67
     private TpTicketRecordMapper tpTicketRecordMapper;
84
     private TpTransactionReportMapper tpTransactionReportMapper;
85
     private TpTransactionReportMapper tpTransactionReportMapper;
85
 
86
 
86
     @Autowired
87
     @Autowired
87
-    private ToCommunitiesMapper  toCommunitiesMapper;
88
+    private ToCommunitiesMapper toCommunitiesMapper;
88
 
89
 
89
     @Autowired
90
     @Autowired
90
     private TpTransactionReplyMapper tpTransactionReplyMapper;
91
     private TpTransactionReplyMapper tpTransactionReplyMapper;
91
 
92
 
92
     @Autowired
93
     @Autowired
93
-    private  TpTransactionLikeMapper tpTransactionLikeMapper;
94
+    private TpTransactionLikeMapper tpTransactionLikeMapper;
94
 
95
 
95
     @Autowired
96
     @Autowired
96
     private TaUserVerifyMapper taUserVerifyMapper;
97
     private TaUserVerifyMapper taUserVerifyMapper;
99
     private TpBuildingOwnerInfoMapper tpBuildingOwnerInfoMapper;
100
     private TpBuildingOwnerInfoMapper tpBuildingOwnerInfoMapper;
100
 
101
 
101
     @Autowired
102
     @Autowired
102
-    private  TpActivitySignInMapper tpActivitySignInMapper;
103
+    private TpActivitySignInMapper tpActivitySignInMapper;
104
+
105
+    @Autowired
106
+    private ITaUserService iTaUserService;
103
 
107
 
104
     @Override
108
     @Override
105
     @Transactional
109
     @Transactional
106
     public TpAnnouncement findAnnouncementDetail(Integer id, Integer communityId, Integer userId) {
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
             tpAnnouncementMapper.updateByPrimaryKeySelective(id, allViewNum);
114
             tpAnnouncementMapper.updateByPrimaryKeySelective(id, allViewNum);
111
         }
115
         }
112
         TpAnnouncement tpAnnouncement = tpAnnouncementMapper.selectByPrimaryKey(id, communityId);
116
         TpAnnouncement tpAnnouncement = tpAnnouncementMapper.selectByPrimaryKey(id, communityId);
113
         tpAnnouncement.setUserName(tpUserMapper.selectByPrimaryKey(tpAnnouncement.getCreateUser()).getUserName());
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
         List<TdImages> tdImagesList = tdImagesMapper.getByUUIDAndByType(map);
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
         tpAnnouncement.setImgList(imgList);
125
         tpAnnouncement.setImgList(imgList);
122
         return tpAnnouncement;
126
         return tpAnnouncement;
123
     }
127
     }
124
 
128
 
125
     /**
129
     /**
126
      * 分页获取公告列表
130
      * 分页获取公告列表
131
+     *
127
      * @param communityId
132
      * @param communityId
128
      * @param title
133
      * @param title
129
      * @param pageNum
134
      * @param pageNum
132
      */
137
      */
133
     @Override
138
     @Override
134
     public ResponseBean getAnnouncements(Integer communityId, String title, Integer pageNum, Integer pageSize) {
139
     public ResponseBean getAnnouncements(Integer communityId, String title, Integer pageNum, Integer pageSize) {
135
-        ResponseBean responseBean=new ResponseBean();
140
+        ResponseBean responseBean = new ResponseBean();
136
         Map<String, Object> parameter = Maps.newHashMap();
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
         responseBean.addSuccess(parameter);
148
         responseBean.addSuccess(parameter);
144
         return responseBean;
149
         return responseBean;
145
     }
150
     }
151
+
146
     /**
152
     /**
147
      * 根据当前小区ID查出轮播图
153
      * 根据当前小区ID查出轮播图
154
+     *
148
      * @param communityId 当前小区ID
155
      * @param communityId 当前小区ID
149
      * @return
156
      * @return
150
      */
157
      */
151
     @Override
158
     @Override
152
     public List<TpAnnouncement> getAnnouncement(Integer communityId) {
159
     public List<TpAnnouncement> getAnnouncement(Integer communityId) {
153
-        Integer num=tpCarouselSettingMapper.getcarouselNum(Constant.ANNOUNCEMENT, communityId);
160
+        Integer num = tpCarouselSettingMapper.getcarouselNum(Constant.ANNOUNCEMENT, communityId);
154
         if (null == num) {
161
         if (null == num) {
155
             num = 0;
162
             num = 0;
156
         }
163
         }
157
-        List<TpAnnouncement> listAnnouncement=tpAnnouncementMapper.getAnnouncement(communityId,num);
164
+        List<TpAnnouncement> listAnnouncement = tpAnnouncementMapper.getAnnouncement(communityId, num);
158
         return listAnnouncement;
165
         return listAnnouncement;
159
     }
166
     }
160
 
167
 
161
-    
168
+
162
     /**
169
     /**
163
      * 分页获取活动列表
170
      * 分页获取活动列表
171
+     *
164
      * @param communityId
172
      * @param communityId
165
      * @param title
173
      * @param title
166
      * @param pageNum
174
      * @param pageNum
169
      */
177
      */
170
     @Override
178
     @Override
171
     public ResponseBean getActivitys(Integer communityId, String title, Integer pageNum, Integer pageSize) {
179
     public ResponseBean getActivitys(Integer communityId, String title, Integer pageNum, Integer pageSize) {
172
-        ResponseBean responseBean= new ResponseBean();
180
+        ResponseBean responseBean = new ResponseBean();
173
         Map<String, Object> result = Maps.newHashMap();
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
         responseBean.addSuccess(result);
188
         responseBean.addSuccess(result);
181
         return responseBean;
189
         return responseBean;
182
     }
190
     }
183
-    
191
+
184
     /**
192
     /**
185
      * 获取活动帖子详情
193
      * 获取活动帖子详情
194
+     *
186
      * @param activityId
195
      * @param activityId
187
      * @param communityId
196
      * @param communityId
188
      * @return
197
      * @return
190
     @Override
199
     @Override
191
     public TpActivity findActivityDetail(Integer activityId, Integer communityId, Integer userId) {
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
             TpActivity activity = new TpActivity();
204
             TpActivity activity = new TpActivity();
196
             activity.setId(activityId);
205
             activity.setId(activityId);
197
             activity.setViewCount(allViewNum);
206
             activity.setViewCount(allViewNum);
198
             tpActivityMapper.updateByPrimaryKeySelective(activity);
207
             tpActivityMapper.updateByPrimaryKeySelective(activity);
199
         }
208
         }
200
 
209
 
201
-        TpActivity tpActivity = tpActivityMapper.selectByPrimaryKey(activityId,communityId);
210
+        TpActivity tpActivity = tpActivityMapper.selectByPrimaryKey(activityId, communityId);
202
         TpUser tpUser = tpUserMapper.selectByPrimaryKey(tpActivity.getCreateUser());
211
         TpUser tpUser = tpUserMapper.selectByPrimaryKey(tpActivity.getCreateUser());
203
         if (null != tpUser) {
212
         if (null != tpUser) {
204
             tpActivity.setUserName(tpUser.getUserName());
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
         tpActivity.setSignType(signType);
218
         tpActivity.setSignType(signType);
210
 
219
 
211
         //返回报名状态
220
         //返回报名状态
212
         Integer signNum = tpActivitySignupMapper.findTpActivetitySignByUserId(tpActivity.getId(), communityId, userId);
221
         Integer signNum = tpActivitySignupMapper.findTpActivetitySignByUserId(tpActivity.getId(), communityId, userId);
213
         String signStatus = signNum != 0 ? Constant.STATUS_SIGNED : Constant.STATUS_UNSIGN;
222
         String signStatus = signNum != 0 ? Constant.STATUS_SIGNED : Constant.STATUS_UNSIGN;
214
         tpActivity.setSignStatus(signStatus);
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
         List<TdImages> tdImagesList = tdImagesMapper.getByUUIDAndByType(map);
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
         tpActivity.setImgList(imgList);
231
         tpActivity.setImgList(imgList);
223
 
232
 
224
         return tpActivity;
233
         return tpActivity;
225
     }
234
     }
226
-    
235
+
227
     /**
236
     /**
228
      * 更新此用户的查看次数操作
237
      * 更新此用户的查看次数操作
238
+     *
229
      * @param userId
239
      * @param userId
230
      * @param socialType
240
      * @param socialType
231
      * @param communityId
241
      * @param communityId
232
      * @param uuid
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
         TpSocialView tpSocialView = new TpSocialView();
246
         TpSocialView tpSocialView = new TpSocialView();
237
         tpSocialView.setTaUserId(userId);
247
         tpSocialView.setTaUserId(userId);
239
         tpSocialView.setCommunityId(communityId);
249
         tpSocialView.setCommunityId(communityId);
240
         tpSocialView.setUuid(uuid);
250
         tpSocialView.setUuid(uuid);
241
         Integer viewNum = tpSocialViewMapper.selectViewNum(tpSocialView);
251
         Integer viewNum = tpSocialViewMapper.selectViewNum(tpSocialView);
242
-    
252
+
243
         //查看过的话查看次数加一
253
         //查看过的话查看次数加一
244
-        if (viewNum == 0){
254
+        if (viewNum == 0) {
245
             tpSocialView.setCreateDate(new Date());
255
             tpSocialView.setCreateDate(new Date());
246
             tpSocialViewMapper.insertSelective(tpSocialView);
256
             tpSocialViewMapper.insertSelective(tpSocialView);
247
             tpSocialView.setTaUserId(null);
257
             tpSocialView.setTaUserId(null);
252
     }
262
     }
253
 
263
 
254
     @Override
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
         ResponseBean responseBean = new ResponseBean();
266
         ResponseBean responseBean = new ResponseBean();
257
         TpActivity tpActivity = tpActivityMapper.selectByPrimaryKey(activityId, communityId);
267
         TpActivity tpActivity = tpActivityMapper.selectByPrimaryKey(activityId, communityId);
258
         //判断是否已经过了报名截至时间
268
         //判断是否已经过了报名截至时间
259
         Date registrEndTime = tpActivity.getRegistrationEndTime();
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
         Integer signUpNum = tpActivitySignupMapper.sumActivitySignUpNum(activityId, communityId);
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
             responseBean.addError("9998", "报名人数已满");
278
             responseBean.addError("9998", "报名人数已满");
269
             return responseBean;
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
         if (taUser.getId().intValue() == -1) {
284
         if (taUser.getId().intValue() == -1) {
279
             responseBean.addError("9996", "游客不能报名");
285
             responseBean.addError("9996", "游客不能报名");
280
             return responseBean;
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
     @Override
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
         Map<String, Object> parameter = Maps.newHashMap();
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
                 TaSysRole taSysRole = taSysRoleMapper.findRoleByUserId(e.getTaUserVerifyId());
305
                 TaSysRole taSysRole = taSysRoleMapper.findRoleByUserId(e.getTaUserVerifyId());
322
                 e.setRoleId(taSysRole.getId());
306
                 e.setRoleId(taSysRole.getId());
323
                 e.setRoleName(taSysRole.getRoleName());
307
                 e.setRoleName(taSysRole.getRoleName());
326
             e.setCreateUserName(taUser.getUserName());
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
         responseBean.addSuccess(parameter);
315
         responseBean.addSuccess(parameter);
332
         return responseBean;
316
         return responseBean;
333
 
317
 
334
     }
318
     }
335
 
319
 
336
 
320
 
337
-    @Transactional
321
+    @Transactional(rollbackFor = Exception.class)
338
     @Override
322
     @Override
339
-    public ResponseBean addAllTransaction(Integer userId, String paramets,Integer userVerifyId) throws IOException {
323
+    public ResponseBean addAllTransaction(UserElement userElement, String paramets) {
340
         ResponseBean response = new ResponseBean();
324
         ResponseBean response = new ResponseBean();
341
         JSONObject jsonObject = JSONObject.parseObject(paramets);
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
         TpTransaction tpTransaction = new TpTransaction();
332
         TpTransaction tpTransaction = new TpTransaction();
349
         tpTransaction.setTransactionTitle(transactionTitle);
333
         tpTransaction.setTransactionTitle(transactionTitle);
350
         tpTransaction.setTransactionContent(transactionContent);
334
         tpTransaction.setTransactionContent(transactionContent);
351
         tpTransaction.setType(type);
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
         tpTransaction.setStatus("1");
339
         tpTransaction.setStatus("1");
356
         tpTransaction.setCreateDate(new Date());
340
         tpTransaction.setCreateDate(new Date());
357
-        tpTransaction.setUpdateUser(userId);
341
+        tpTransaction.setUpdateUser(userElement.getId());
358
         tpTransaction.setUpdateDate(new Date());
342
         tpTransaction.setUpdateDate(new Date());
359
-        tpTransaction.setTaUserVerifyId(userVerifyId);
343
+        tpTransaction.setTaUserVerifyId(userElement.getUserVerifyId());
360
         tpTransaction.setIsReported("0");
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
         return response;
356
         return response;
357
+
389
     }
358
     }
390
 
359
 
391
     /**
360
     /**
392
      * 图片入库
361
      * 图片入库
362
+     *
393
      * @param tpTransaction
363
      * @param tpTransaction
394
-     * @param imageUrl 多个图片都好分割
364
+     * @param imageUrl      多个图片都好分割
395
      * @param userId
365
      * @param userId
396
-     * @param type 服务:service, 公告:announcement , 活动:activity  租赁 : transaction
366
+     * @param type          服务:service, 公告:announcement , 活动:activity  租赁 : transaction
397
      * @throws IOException
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
         if (null == imageUrl || "".equals(imageUrl)) {
370
         if (null == imageUrl || "".equals(imageUrl)) {
401
             return;
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
             TdImages tdImages = new TdImages();
375
             TdImages tdImages = new TdImages();
406
             Integer uuId = tpTransaction.getId();
376
             Integer uuId = tpTransaction.getId();
407
             tdImages.setImageUrl(url);
377
             tdImages.setImageUrl(url);
412
             tdImagesMapper.insertSelective(tdImages);
382
             tdImagesMapper.insertSelective(tdImages);
413
         }
383
         }
414
     }
384
     }
385
+
415
     @Override
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
         ResponseBean responseBean = new ResponseBean();
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
         return responseBean;
410
         return responseBean;
458
     }
411
     }
459
 
412
 
460
     @Override
413
     @Override
461
     @Transactional(rollbackFor = Exception.class)
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
         ResponseBean response = new ResponseBean();
416
         ResponseBean response = new ResponseBean();
464
         JSONObject jsonObject = JSONObject.parseObject(paramets);
417
         JSONObject jsonObject = JSONObject.parseObject(paramets);
465
-        String imageUrl = (String) jsonObject.get("imageUrl");
418
+        String imageUrl = jsonObject.getString("imageUrl");
466
 
419
 
467
         TpTransaction tpTransaction = JSONObject.parseObject(paramets, TpTransaction.class);
420
         TpTransaction tpTransaction = JSONObject.parseObject(paramets, TpTransaction.class);
468
         TpTransaction transaction = tpTransactionMapper.getById(id);
421
         TpTransaction transaction = tpTransactionMapper.getById(id);
472
 
425
 
473
         if (null != transaction && userId.equals(transaction.getTaUserId())) {
426
         if (null != transaction && userId.equals(transaction.getTaUserId())) {
474
             tdImagesMapper.deleteTdImages(Integer.valueOf(id), Constant.TRANSACTION);
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
             tpTransactionMapper.updateTransaction(Integer.valueOf(id), transaction.getTransactionTitle(), transaction.getTransactionContent(), userId);
430
             tpTransactionMapper.updateTransaction(Integer.valueOf(id), transaction.getTransactionTitle(), transaction.getTransactionContent(), userId);
482
             response.addSuccess("修改成功");
431
             response.addSuccess("修改成功");
483
             return response;
432
             return response;
484
-
485
         }
433
         }
486
         response.addError("操作失败");
434
         response.addError("操作失败");
487
         return response;
435
         return response;
489
 
437
 
490
     @Override
438
     @Override
491
     public ResponseBean deleteransaction(Integer id, UserElement userElement) {
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
             tpTransaction.setStatus("0");
443
             tpTransaction.setStatus("0");
496
             tpTransaction.setUpdateDate(new Date());
444
             tpTransaction.setUpdateDate(new Date());
497
             tpTransactionMapper.updateByPrimaryKeySelective(tpTransaction);
445
             tpTransactionMapper.updateByPrimaryKeySelective(tpTransaction);
498
             responseBean.addSuccess("删除成功");
446
             responseBean.addSuccess("删除成功");
499
 
447
 
500
 
448
 
501
-
502
             // 把消息变为无效
449
             // 把消息变为无效
503
             Map<String, Object> map = new HashMap<>();
450
             Map<String, Object> map = new HashMap<>();
504
             map.put("communityId", userElement.getCommunityId());
451
             map.put("communityId", userElement.getCommunityId());
516
             }
463
             }
517
 
464
 
518
 
465
 
519
-
520
-        }else {
466
+        } else {
521
             responseBean.addSuccess("当前ID不存在");
467
             responseBean.addSuccess("当前ID不存在");
522
         }
468
         }
523
         return responseBean;
469
         return responseBean;
524
-        }
525
-    
470
+    }
471
+
526
     /**
472
     /**
527
      * 获取举报原因列表
473
      * 获取举报原因列表
528
      *
474
      *
532
     public List<Map<String, Object>> getReportReasons() {
478
     public List<Map<String, Object>> getReportReasons() {
533
         return tpTransactionMapper.getReportReasons();
479
         return tpTransactionMapper.getReportReasons();
534
     }
480
     }
535
-    
481
+
536
     /**
482
     /**
537
      * 举报二手交易帖子
483
      * 举报二手交易帖子
538
      *
484
      *
547
         Integer transactionId = jsonObject.getInteger("transactionId");
493
         Integer transactionId = jsonObject.getInteger("transactionId");
548
         String reportReasonId = jsonObject.getString("reportReasonId");
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
             responseBean.addError("举报的交易不存在");
498
             responseBean.addError("举报的交易不存在");
553
             return responseBean;
499
             return responseBean;
554
         }
500
         }
559
             return responseBean;
505
             return responseBean;
560
         }
506
         }
561
         //插入举报表
507
         //插入举报表
562
-        tpTransactionMapper.saveReportReason(userId,communityId,transactionId,reportReasonId);
508
+        tpTransactionMapper.saveReportReason(userId, communityId, transactionId, reportReasonId);
563
         //更新交易表的举报状态为被举报
509
         //更新交易表的举报状态为被举报
564
         TpTransaction record = new TpTransaction();
510
         TpTransaction record = new TpTransaction();
565
         record.setId(transactionId);
511
         record.setId(transactionId);
566
         record.setIsReported("1");
512
         record.setIsReported("1");
567
         Integer size = tpTransactionMapper.updateByPrimaryKeySelective(record);
513
         Integer size = tpTransactionMapper.updateByPrimaryKeySelective(record);
568
-        if (size > 0){
514
+        if (size > 0) {
569
 
515
 
570
             // 举报人
516
             // 举报人
571
             TaUser taUser = taUserMapper.selectByPrimaryKey(userId);
517
             TaUser taUser = taUserMapper.selectByPrimaryKey(userId);
584
             message.setAdviceType("4");
530
             message.setAdviceType("4");
585
             message.setModelType("1");
531
             message.setModelType("1");
586
             //超级管理员
532
             //超级管理员
587
-            Integer userID= toCommunitiesMapper.selectAndmin(communityId);
533
+            Integer userID = toCommunitiesMapper.selectAndmin(communityId);
588
             message.setUuid(userID);
534
             message.setUuid(userID);
589
             message.setModelType("1");
535
             message.setModelType("1");
590
             message.setUuidType("2");
536
             message.setUuidType("2");
591
             message.setSource("1");
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
             message.setStatus("1");
539
             message.setStatus("1");
594
             message.setReadStatus("0");
540
             message.setReadStatus("0");
595
             message.setTransactionId(transactionId);
541
             message.setTransactionId(transactionId);
598
             tpMessageMapper.insertSelective(message);
544
             tpMessageMapper.insertSelective(message);
599
 
545
 
600
 
546
 
601
-
602
             responseBean.addSuccess(size);
547
             responseBean.addSuccess(size);
603
             return responseBean;
548
             return responseBean;
604
         }
549
         }
608
 
553
 
609
     @Override
554
     @Override
610
     public ResponseBean addTransactionReply(String paramets, UserElement userElement) {
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
         String[] reply = null;
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
         tpTransactionReply.setCommunityId(userElement.getCommunityId());
564
         tpTransactionReply.setCommunityId(userElement.getCommunityId());
620
         tpTransactionReply.setTaUserId(userElement.getId());
565
         tpTransactionReply.setTaUserId(userElement.getId());
621
         tpTransactionReply.setTaUserName(userElement.getUserName());
566
         tpTransactionReply.setTaUserName(userElement.getUserName());
622
         //获取被回复的姓名
567
         //获取被回复的姓名
623
-        if("".equals(tpTransactionReply.getReplyTaUserId())) {
568
+        if ("".equals(tpTransactionReply.getReplyTaUserId())) {
624
             tpTransactionReply.setReplyTaUserId(null);
569
             tpTransactionReply.setReplyTaUserId(null);
625
         }
570
         }
626
-        if(null!=tpTransactionReply.getReplyTaUserId()&!"".equals(tpTransactionReply.getReplyTaUserId())) {
571
+        if (null != tpTransactionReply.getReplyTaUserId() & !"".equals(tpTransactionReply.getReplyTaUserId())) {
627
             tpTransactionReply.setReplyTaUserName(taUserMapper.selectByPrimaryKey(tpTransactionReply.getReplyTaUserId()).getUserName());
572
             tpTransactionReply.setReplyTaUserName(taUserMapper.selectByPrimaryKey(tpTransactionReply.getReplyTaUserId()).getUserName());
628
         }
573
         }
629
         tpTransactionReply.setReleaseIdentity("0");
574
         tpTransactionReply.setReleaseIdentity("0");
631
         tpTransactionReply.setCreateDate(new Date());
576
         tpTransactionReply.setCreateDate(new Date());
632
         tpTransactionReplyMapper.insert(tpTransactionReply);
577
         tpTransactionReplyMapper.insert(tpTransactionReply);
633
 
578
 
634
-        if (null!=array) {
579
+        if (null != array) {
635
             for (String img : reply) {
580
             for (String img : reply) {
636
                 TdImages tdImages = new TdImages();
581
                 TdImages tdImages = new TdImages();
637
                 tdImages.setImageUrl(img);
582
                 tdImages.setImageUrl(img);
648
 
593
 
649
     @Override
594
     @Override
650
     public ResponseBean addTransactionLike(String paramets, UserElement userElement) {
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
         tpTransactionLike.setCommunityId(userElement.getCommunityId());
598
         tpTransactionLike.setCommunityId(userElement.getCommunityId());
654
         tpTransactionLike.setTaUserId(userElement.getId());
599
         tpTransactionLike.setTaUserId(userElement.getId());
655
         tpTransactionLike.setCreateDate(new Date());
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
             response.addError("您已点赞或踩");
603
             response.addError("您已点赞或踩");
659
             return response;
604
             return response;
660
         }
605
         }
664
     }
609
     }
665
 
610
 
666
     @Override
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
         Map<String, Object> parameter = Maps.newHashMap();
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
         responseBean.addSuccess(parameter);
619
         responseBean.addSuccess(parameter);
675
         return responseBean;
620
         return responseBean;
676
     }
621
     }
677
 
622
 
678
     @Override
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
         Map<String, Object> parameter = Maps.newHashMap();
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
         responseBean.addSuccess(parameter);
633
         responseBean.addSuccess(parameter);
689
         return responseBean;
634
         return responseBean;
690
     }
635
     }
691
 
636
 
692
     @Override
637
     @Override
693
     public ResponseBean tpActivitySignInAdd(String paramets, UserElement userElement) {
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
         tpActivitySignIn.setActivityId(activityId);
642
         tpActivitySignIn.setActivityId(activityId);
698
         tpActivitySignIn.setCommunityId(userElement.getCommunityId());
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
         tpActivitySignIn.setUserRole(description);
648
         tpActivitySignIn.setUserRole(description);
704
         tpActivitySignIn.setUserName(userElement.getUserName());
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
         tpActivitySignIn.setBuildingInfo(bu);
652
         tpActivitySignIn.setBuildingInfo(bu);
708
         tpActivitySignIn.setTaUserId(userElement.getId());
653
         tpActivitySignIn.setTaUserId(userElement.getId());
709
         tpActivitySignIn.setUserTel(userElement.getLoginName());
654
         tpActivitySignIn.setUserTel(userElement.getLoginName());
717
 
662
 
718
     @Override
663
     @Override
719
     public ResponseBean replyAdd(String paramets, UserElement userElement) {
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
         tpTransactionReply.setCommunityId(userElement.getCommunityId());
675
         tpTransactionReply.setCommunityId(userElement.getCommunityId());
731
         tpTransactionReply.setTransactionId(transactionId);
676
         tpTransactionReply.setTransactionId(transactionId);
732
         tpTransactionReply.setTaUserId(userElement.getId());
677
         tpTransactionReply.setTaUserId(userElement.getId());
739
         response.addSuccess("成功");
684
         response.addSuccess("成功");
740
         tpTransactionReplyMapper.insert(tpTransactionReply);
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
             tdImages.setImageUrl(img);
689
             tdImages.setImageUrl(img);
745
             tdImages.setType("reply");
690
             tdImages.setType("reply");
746
             tdImages.setUuid(tpTransactionReply.getId());
691
             tdImages.setUuid(tpTransactionReply.getId());
774
         TpMessage message = new TpMessage();
719
         TpMessage message = new TpMessage();
775
         message.setCommunityId(communityId);
720
         message.setCommunityId(communityId);
776
         message.setTicketId(tpTicket.getId());
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
         message.setMessageType(tic.getType());
723
         message.setMessageType(tic.getType());
779
         message.setAdviceType("4");
724
         message.setAdviceType("4");
780
         message.setModelType("1");
725
         message.setModelType("1");
781
-        Integer createUser=tpTicketMapper.selectRecordStatus(communityId,tpTicket.getId());
726
+        Integer createUser = tpTicketMapper.selectRecordStatus(communityId, tpTicket.getId());
782
         message.setUuid(createUser);
727
         message.setUuid(createUser);
783
         message.setUuidType("2");
728
         message.setUuidType("2");
784
         message.setSource("2");
729
         message.setSource("2");
785
-        message.setMessageContent("工单“"+tic.getTicketTitle() +"”已经验收并评价,点击查看评分");
730
+        message.setMessageContent("工单“" + tic.getTicketTitle() + "”已经验收并评价,点击查看评分");
786
         message.setStatus("1");
731
         message.setStatus("1");
787
         message.setReadStatus("0");
732
         message.setReadStatus("0");
788
         message.setCreateUser(userId);
733
         message.setCreateUser(userId);
796
         if (null == num) {
741
         if (null == num) {
797
             num = 0;
742
             num = 0;
798
         }
743
         }
799
-        List<TpActivity> listActivity=tpActivityMapper.getActivity(communityId,num);
744
+        List<TpActivity> listActivity = tpActivityMapper.getActivity(communityId, num);
800
         return listActivity;
745
         return listActivity;
801
     }
746
     }
802
-    
747
+
803
     /**
748
     /**
804
      * 取消报名接口
749
      * 取消报名接口
805
      *
750
      *
817
         tpActivitySignup.setTaUserId(userId);
762
         tpActivitySignup.setTaUserId(userId);
818
         tpActivitySignupMapper.deleteSignUp(tpActivitySignup);
763
         tpActivitySignupMapper.deleteSignUp(tpActivitySignup);
819
         //更新报名人数
764
         //更新报名人数
820
-        updateActivitySignUpNum(communityId,activityId);
765
+        updateActivitySignUpNum(communityId, activityId);
821
         responseBean.addSuccess("取消报名成功");
766
         responseBean.addSuccess("取消报名成功");
822
         return responseBean;
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
         ResponseBean responseBean = new ResponseBean();
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
             responseBean.addError("9996", "您已报名,请勿重复报名");
776
             responseBean.addError("9996", "您已报名,请勿重复报名");
832
             return responseBean;
777
             return responseBean;
833
         }
778
         }
835
         TpActivitySignup tpActivitySignup = new TpActivitySignup();
780
         TpActivitySignup tpActivitySignup = new TpActivitySignup();
836
         tpActivitySignup.setActivityId(tpActivity.getId());
781
         tpActivitySignup.setActivityId(tpActivity.getId());
837
         tpActivitySignup.setCommunityId(communityId);
782
         tpActivitySignup.setCommunityId(communityId);
838
-        tpActivitySignup.setTaUserId(userId);
783
+        tpActivitySignup.setTaUserId(userElement.getId());
839
         tpActivitySignup.setSignUpTime(new Date());
784
         tpActivitySignup.setSignUpTime(new Date());
840
         tpActivitySignup.setRemark(remark);
785
         tpActivitySignup.setRemark(remark);
841
 
786
 
847
 
792
 
848
         tpActivitySignupMapper.insertSelective(tpActivitySignup);
793
         tpActivitySignupMapper.insertSelective(tpActivitySignup);
849
         //更新报名人数
794
         //更新报名人数
850
-        updateActivitySignUpNum(communityId,tpActivity.getId());
795
+        updateActivitySignUpNum(communityId, tpActivity.getId());
851
         responseBean.addSuccess("报名成功");
796
         responseBean.addSuccess("报名成功");
852
         return responseBean;
797
         return responseBean;
853
     }
798
     }
854
-    
799
+
855
     /**
800
     /**
856
      * 更新报名人数
801
      * 更新报名人数
802
+     *
857
      * @param communityId
803
      * @param communityId
858
      * @param activityId
804
      * @param activityId
859
      * @return
805
      * @return
860
      */
806
      */
861
-    private Integer updateActivitySignUpNum(Integer communityId,Integer activityId) {
807
+    private Integer updateActivitySignUpNum(Integer communityId, Integer activityId) {
862
         TpActivitySignup tpActivitySignup = new TpActivitySignup();
808
         TpActivitySignup tpActivitySignup = new TpActivitySignup();
863
         tpActivitySignup.setActivityId(activityId);
809
         tpActivitySignup.setActivityId(activityId);
864
         tpActivitySignup.setCommunityId(communityId);
810
         tpActivitySignup.setCommunityId(communityId);
873
     @Transactional
819
     @Transactional
874
     @Override
820
     @Override
875
     public TpTransaction findUsedDetails(Integer activityId, Integer communityId, Integer userId) {
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
             TpTransaction transaction = new TpTransaction();
824
             TpTransaction transaction = new TpTransaction();
879
             transaction.setId(activityId);
825
             transaction.setId(activityId);
880
             transaction.setViewCount(num);
826
             transaction.setViewCount(num);
881
             tpTransactionMapper.updateByPrimaryKeySelective(transaction);
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
         tpTransaction.setTelephone(taUser.getLoginName());
832
         tpTransaction.setTelephone(taUser.getLoginName());
887
         tpTransaction.setCreateUserName(taUser.getUserName());
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
         List<TdImages> tdImagesList = tdImagesMapper.getByUUIDAndByType(map);
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
         tpTransaction.setImgList(imgList);
841
         tpTransaction.setImgList(imgList);
896
 
842
 
897
         /**
843
         /**
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
         tpTransaction.setLikeCount(likeCount == null ? 0 : likeCount);
852
         tpTransaction.setLikeCount(likeCount == null ? 0 : likeCount);
907
         tpTransaction.setNoLikeCount(noLikeCount == null ? 0 : noLikeCount);
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
             tpTransaction.setBel(isUser.getLikeStatus());
858
             tpTransaction.setBel(isUser.getLikeStatus());
913
         }
859
         }
914
 
860
 
921
     public ResponseBean updateActivtiySignUp(Integer activityId, Integer communityId, Integer userId, String remark) {
867
     public ResponseBean updateActivtiySignUp(Integer activityId, Integer communityId, Integer userId, String remark) {
922
         ResponseBean responseBean = new ResponseBean();
868
         ResponseBean responseBean = new ResponseBean();
923
         TpActivitySignup tpActivitySignup = tpActivitySignupMapper.selectTpActivetitySignByUserId(activityId, communityId, userId);
869
         TpActivitySignup tpActivitySignup = tpActivitySignupMapper.selectTpActivetitySignByUserId(activityId, communityId, userId);
924
-        if (null == tpActivitySignup){
870
+        if (null == tpActivitySignup) {
925
             responseBean.addError("9996", "您未报名!");
871
             responseBean.addError("9996", "您未报名!");
926
             return responseBean;
872
             return responseBean;
927
         }
873
         }
939
 
885
 
940
         ResponseBean responseBean = new ResponseBean();
886
         ResponseBean responseBean = new ResponseBean();
941
         TpActivitySignup tpActivitySignup = tpActivitySignupMapper.selectTpActivetitySignByUserId(activityId, communityId, userId);
887
         TpActivitySignup tpActivitySignup = tpActivitySignupMapper.selectTpActivetitySignByUserId(activityId, communityId, userId);
942
-        if (null == tpActivitySignup){
888
+        if (null == tpActivitySignup) {
943
             responseBean.addError("9996", "您未报名!");
889
             responseBean.addError("9996", "您未报名!");
944
             return responseBean;
890
             return responseBean;
945
         }
891
         }
950
     }
896
     }
951
 
897
 
952
     @Override
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
         ResponseBean responseBean = new ResponseBean();
900
         ResponseBean responseBean = new ResponseBean();
955
         //拿到当前帖子的创建人
901
         //拿到当前帖子的创建人
956
-        Integer CreateUser= tpTransactionMapper.getById(transactionId).getCreateUser();
902
+        Integer CreateUser = tpTransactionMapper.getById(transactionId).getCreateUser();
957
 
903
 
958
         PageHelper.startPage(pageNum, pageSize, "create_date " + order);
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
                 list.add(imageUrl.getImageUrl());
910
                 list.add(imageUrl.getImageUrl());
965
                 tpTransactionReply.setImgList(list);
911
                 tpTransactionReply.setImgList(list);
966
             }
912
             }

+ 25
- 21
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TicketServiceImpl.java 查看文件

5
 import com.alibaba.fastjson.JSONObject;
5
 import com.alibaba.fastjson.JSONObject;
6
 import com.community.commom.constant.Constant;
6
 import com.community.commom.constant.Constant;
7
 import com.community.commom.mode.ResponseBean;
7
 import com.community.commom.mode.ResponseBean;
8
+import com.community.commom.session.UserElement;
8
 import com.community.huiju.dao.*;
9
 import com.community.huiju.dao.*;
9
 import com.community.huiju.model.*;
10
 import com.community.huiju.model.*;
10
 import com.community.huiju.service.ITicketService;
11
 import com.community.huiju.service.ITicketService;
58
     @Autowired
59
     @Autowired
59
     private  ToCommunitiesMapper toCommunitiesMapper;
60
     private  ToCommunitiesMapper toCommunitiesMapper;
60
 
61
 
62
+    @Autowired
63
+    private TaUserVerifyMapper taUserVerifyMapper;
64
+
61
     @Override
65
     @Override
62
     public ResponseBean getList(TpTicket tpTicket, Integer pageNum, Integer pageSize) {
66
     public ResponseBean getList(TpTicket tpTicket, Integer pageNum, Integer pageSize) {
63
 
67
 
260
 
264
 
261
     @Override
265
     @Override
262
     @Transactional(rollbackFor = Exception.class)
266
     @Transactional(rollbackFor = Exception.class)
263
-    public ResponseBean addAiTicketService(Integer userId, String parameter) throws IOException {
267
+    public ResponseBean addAiTicketService(UserElement userElement, String parameter) throws IOException {
264
         ResponseBean response = new ResponseBean();
268
         ResponseBean response = new ResponseBean();
265
         JSONObject jsonObject = JSONObject.parseObject(parameter);
269
         JSONObject jsonObject = JSONObject.parseObject(parameter);
266
         String imageUrl = (String) jsonObject.get("imageUrl");
270
         String imageUrl = (String) jsonObject.get("imageUrl");
273
          * 依次插入相关数据, 该工单默认的第一条数据(待分配), 是工单标题,
277
          * 依次插入相关数据, 该工单默认的第一条数据(待分配), 是工单标题,
274
          */
278
          */
275
 
279
 
276
-
277
-        TaUser user = taUserMapper.selectByPrimaryKey(userId);
278
-
279
-        tpTicket.setCommunityId(user.getCommunityId());
280
-        tpTicket.setTaUserId(userId);
280
+        tpTicket.setCommunityId(userElement.getCommunityId());
281
+        tpTicket.setTaUserId(userElement.getId());
281
         // 默认待分配
282
         // 默认待分配
282
         tpTicket.setStatus("0");
283
         tpTicket.setStatus("0");
283
-        tpTicket.setCreateUser(userId);
284
+        tpTicket.setCreateUser(userElement.getId());
284
         tpTicket.setCreateDate(new Date());
285
         tpTicket.setCreateDate(new Date());
285
-        tpTicket.setUpdateUser(userId);
286
+        tpTicket.setUpdateUser(userElement.getId());
286
 //        tpTicket.setUpdateDate(new Date());
287
 //        tpTicket.setUpdateDate(new Date());
287
         // 插入工单
288
         // 插入工单
288
         tpTicketMapper.insertSelective(tpTicket);
289
         tpTicketMapper.insertSelective(tpTicket);
289
-        insertTdImage(tpTicket, imageUrl, userId);
290
+        insertTdImage(tpTicket, imageUrl, userElement.getId());
290
 
291
 
291
         Integer id = tpTicket.getId();
292
         Integer id = tpTicket.getId();
292
         TpTicketRecord tpTicketRecord = new TpTicketRecord();
293
         TpTicketRecord tpTicketRecord = new TpTicketRecord();
293
         //获取当前插入的信息,维护工单记录表
294
         //获取当前插入的信息,维护工单记录表
294
         TpTicket tpTicketReco = tpTicketMapper.selectByPrimaryKey(id);
295
         TpTicket tpTicketReco = tpTicketMapper.selectByPrimaryKey(id);
295
-        tpTicketRecord.setCommunityId(user.getCommunityId());
296
+        tpTicketRecord.setCommunityId(userElement.getCommunityId());
296
         tpTicketRecord.setTicketId(tpTicketReco.getId());
297
         tpTicketRecord.setTicketId(tpTicketReco.getId());
297
         // 1:投诉   2:报修 3:联系物业
298
         // 1:投诉   2:报修 3:联系物业
298
         String typeName = "2".equals(tpTicket.getType()) ? "报修" : "1".equals(tpTicket.getType()) ? "投诉" : "3".equals(tpTicket.getType()) ? "联系工单" : "未知类型";
299
         String typeName = "2".equals(tpTicket.getType()) ? "报修" : "1".equals(tpTicket.getType()) ? "投诉" : "3".equals(tpTicket.getType()) ? "联系工单" : "未知类型";
299
         tpTicketRecord.setContent("您的" + typeName + "正在分配物业处理人员, 若长时间无人处理, 请联系物业! 联系物业号码簿 >");
300
         tpTicketRecord.setContent("您的" + typeName + "正在分配物业处理人员, 若长时间无人处理, 请联系物业! 联系物业号码簿 >");
300
         tpTicketRecord.setStatus(tpTicketReco.getStatus());
301
         tpTicketRecord.setStatus(tpTicketReco.getStatus());
301
-        tpTicketRecord.setCreateUser(userId);
302
+        tpTicketRecord.setCreateUser(userElement.getId());
302
         tpTicketRecord.setCreateDate(new Date());
303
         tpTicketRecord.setCreateDate(new Date());
303
         // 插入工单处理表
304
         // 插入工单处理表
304
         tpTicketRecordMapper.insertSelective(tpTicketRecord);
305
         tpTicketRecordMapper.insertSelective(tpTicketRecord);
308
 //        insertTicketMessage(tpTicket, userId);
309
 //        insertTicketMessage(tpTicket, userId);
309
         //1.5版本维护消息推送
310
         //1.5版本维护消息推送
310
         TpMessage message = new TpMessage();
311
         TpMessage message = new TpMessage();
311
-        message.setCommunityId(user.getCommunityId());
312
+        message.setCommunityId(userElement.getCommunityId());
312
         message.setTicketId(tpTicket.getId());
313
         message.setTicketId(tpTicket.getId());
313
         message.setModelType("1");
314
         message.setModelType("1");
314
         message.setMessageType(tpTicket.getType());
315
         message.setMessageType(tpTicket.getType());
316
         message.setUuidType("2");
317
         message.setUuidType("2");
317
         message.setSource("1");
318
         message.setSource("1");
318
         //当前插入为超级管理员
319
         //当前插入为超级管理员
319
-         Integer uuserID= toCommunitiesMapper.selectAndmin(user.getCommunityId());
320
+         Integer uuserID= toCommunitiesMapper.selectAndmin(userElement.getCommunityId());
320
          message.setUuid(uuserID);
321
          message.setUuid(uuserID);
321
-         TaSysUserRole taSysUserRole= taSysUserRoleMapper.selectRole(user.getCommunityId(), userId);
322
-         String userName = null;
323
-         if (null != taSysUserRole) {
324
-             if(1 == taSysUserRole.getRoleId().intValue()){userName="业主"; }
325
-             if(2 == taSysUserRole.getRoleId().intValue()){userName="家属" ;}
326
-             if(3 == taSysUserRole.getRoleId().intValue()){userName="租客" ;}
327
-             message.setMessageContent(userName+user.getUserName()+"发起了一个工单“"+tpTicket.getTicketTitle()+"”,点击受理分配给合适的人处理");
322
+
323
+        TaUserVerify userVerify = taUserVerifyMapper.selectByPrimaryKey(userElement.getUserVerifyId());
324
+        TaUser taUser = taUserMapper.selectByPrimaryKey(userElement.getId());
325
+
326
+        String userName = null;
327
+         if (null != userVerify) {
328
+             if(1 == userVerify.getRoleId().intValue()){userName="业主"; }
329
+             if(2 == userVerify.getRoleId().intValue()){userName="家属" ;}
330
+             if(3 == userVerify.getRoleId().intValue()){userName="租客" ;}
331
+             message.setMessageContent(userName+ taUser.getUserName()+"发起了一个工单“"+tpTicket.getTicketTitle()+"”,点击受理分配给合适的人处理");
328
              message.setStatus("1");
332
              message.setStatus("1");
329
              message.setReadStatus("0");
333
              message.setReadStatus("0");
330
-             message.setCreateUser(userId);
334
+             message.setCreateUser(userElement.getId());
331
              message.setCreateDate(new Date());
335
              message.setCreateDate(new Date());
332
              tpMessageMapper.insert(message);
336
              tpMessageMapper.insert(message);
333
          }
337
          }

+ 259
- 243
CODE/smart-community/app-api/src/main/resources/mapper/TpTransactionMapper.xml 查看文件

1
 <?xml version="1.0" encoding="UTF-8" ?>
1
 <?xml version="1.0" encoding="UTF-8" ?>
2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
-<mapper namespace="com.community.huiju.dao.TpTransactionMapper" >
4
-  <resultMap id="BaseResultMap" type="com.community.huiju.model.TpTransaction" >
5
-    <id column="id" property="id" jdbcType="INTEGER" />
6
-    <result column="community_id" property="communityId" jdbcType="INTEGER" />
7
-    <result column="ta_user_id" property="taUserId" jdbcType="INTEGER" />
8
-    <result column="transaction_title" property="transactionTitle" jdbcType="VARCHAR" />
9
-    <result column="transaction_content" property="transactionContent" jdbcType="VARCHAR" />
10
-    <result column="view_count" property="viewCount" jdbcType="INTEGER" />
11
-    <result column="status" property="status" jdbcType="CHAR" />
12
-    <result column="type" property="type" jdbcType="CHAR" />
13
-    <result column="create_user" property="createUser" jdbcType="INTEGER" />
14
-    <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
15
-    <result column="update_user" property="updateUser" jdbcType="INTEGER" />
16
-    <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
17
-    <result column="role_id" property="roleId" jdbcType="INTEGER" />
18
-    <result column="role_name" property="roleName" jdbcType="VARCHAR" />
19
-    <result column="ta_user_verify_id" property="taUserVerifyId" jdbcType="INTEGER" />
20
-    <result column="release_identity" property="releaseIdentity" jdbcType="VARCHAR" />
3
+<mapper namespace="com.community.huiju.dao.TpTransactionMapper">
4
+    <resultMap id="BaseResultMap" type="com.community.huiju.model.TpTransaction">
5
+        <id column="id" property="id" jdbcType="INTEGER"/>
6
+        <result column="community_id" property="communityId" jdbcType="INTEGER"/>
7
+        <result column="ta_user_id" property="taUserId" jdbcType="INTEGER"/>
8
+        <result column="transaction_title" property="transactionTitle" jdbcType="VARCHAR"/>
9
+        <result column="transaction_content" property="transactionContent" jdbcType="VARCHAR"/>
10
+        <result column="sort" property="sort" jdbcType="VARCHAR"/>
11
+        <result column="view_count" property="viewCount" jdbcType="INTEGER"/>
12
+        <result column="status" property="status" jdbcType="CHAR"/>
13
+        <result column="type" property="type" jdbcType="CHAR"/>
14
+        <result column="create_user" property="createUser" jdbcType="INTEGER"/>
15
+        <result column="create_date" property="createDate" jdbcType="TIMESTAMP"/>
16
+        <result column="update_user" property="updateUser" jdbcType="INTEGER"/>
17
+        <result column="update_date" property="updateDate" jdbcType="TIMESTAMP"/>
18
+        <result column="role_id" property="roleId" jdbcType="INTEGER"/>
19
+        <result column="role_name" property="roleName" jdbcType="VARCHAR"/>
20
+        <result column="ta_user_verify_id" property="taUserVerifyId" jdbcType="INTEGER"/>
21
+        <result column="release_identity" property="releaseIdentity" jdbcType="VARCHAR"/>
21
 
22
 
22
-  </resultMap>
23
-  <sql id="Base_Column_List" >
24
-    id, community_id, ta_user_id, transaction_title, transaction_content,
23
+    </resultMap>
24
+    <sql id="Base_Column_List">
25
+    id, community_id, ta_user_id, transaction_title, transaction_content, sort,
25
     view_count, status, type, create_user, create_date, update_user, update_date, ta_user_verify_id, release_identity
26
     view_count, status, type, create_user, create_date, update_user, update_date, ta_user_verify_id, release_identity
26
   </sql>
27
   </sql>
27
-  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="com.community.huiju.model.TpTransaction"  >
28
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="com.community.huiju.model.TpTransaction">
28
     SELECT
29
     SELECT
29
 	ttr.id,
30
 	ttr.id,
30
 	ttr.community_id,
31
 	ttr.community_id,
31
 	ttr.ta_user_id,
32
 	ttr.ta_user_id,
32
 	ttr.transaction_title,
33
 	ttr.transaction_title,
33
 	ttr.transaction_content,
34
 	ttr.transaction_content,
35
+	ttr.sort,
34
 	ttr.view_count,
36
 	ttr.view_count,
35
 	ttr.STATUS,
37
 	ttr.STATUS,
36
 	ttr.type,
38
 	ttr.type,
48
 LEFT JOIN ta_sys_role sr ON sr.id = tsur.role_id
50
 LEFT JOIN ta_sys_role sr ON sr.id = tsur.role_id
49
     where ttr.id = #{id,jdbcType=INTEGER} and ttr.community_id=#{communityId,jdbcType=INTEGER}
51
     where ttr.id = #{id,jdbcType=INTEGER} and ttr.community_id=#{communityId,jdbcType=INTEGER}
50
   </select>
52
   </select>
51
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
53
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
52
     delete from tp_transaction
54
     delete from tp_transaction
53
     where id = #{id,jdbcType=INTEGER}
55
     where id = #{id,jdbcType=INTEGER}
54
   </delete>
56
   </delete>
55
-  <insert id="insert" parameterType="com.community.huiju.model.TpTransaction" >
57
+    <insert id="insert" parameterType="com.community.huiju.model.TpTransaction">
56
     insert into tp_transaction (id, community_id,release_identity,
58
     insert into tp_transaction (id, community_id,release_identity,
57
-      ta_user_verify_id
59
+      ta_user_verify_id,
58
       ta_user_id,
60
       ta_user_id,
59
       transaction_title, transaction_content,
61
       transaction_title, transaction_content,
62
+      sort,
60
       view_count, status,
63
       view_count, status,
61
       type, create_user, create_date, 
64
       type, create_user, create_date, 
62
       update_user, update_date)
65
       update_user, update_date)
63
     values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER},#{releaseIdentity,jdbcType=VARCHAR},#{taUserVerifyId,jdbcType=INTEGER}, #{taUserId,jdbcType=INTEGER},
66
     values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER},#{releaseIdentity,jdbcType=VARCHAR},#{taUserVerifyId,jdbcType=INTEGER}, #{taUserId,jdbcType=INTEGER},
64
-      #{transactionTitle,jdbcType=VARCHAR}, #{transactionContent,jdbcType=VARCHAR},
67
+      #{transactionTitle,jdbcType=VARCHAR}, #{transactionContent,jdbcType=VARCHAR}, #{sort,jdbcType=VARCHAR},
65
        #{viewCount,jdbcType=INTEGER}, #{status,jdbcType=CHAR},
68
        #{viewCount,jdbcType=INTEGER}, #{status,jdbcType=CHAR},
66
       #{type,jdbcType=CHAR}, #{createUser,jdbcType=INTEGER}, #{createDate,jdbcType=TIMESTAMP}, 
69
       #{type,jdbcType=CHAR}, #{createUser,jdbcType=INTEGER}, #{createDate,jdbcType=TIMESTAMP}, 
67
       #{updateUser,jdbcType=INTEGER}, #{updateDate,jdbcType=TIMESTAMP})
70
       #{updateUser,jdbcType=INTEGER}, #{updateDate,jdbcType=TIMESTAMP})
68
   </insert>
71
   </insert>
69
-  <insert id="insertSelective" useGeneratedKeys="true" keyProperty="id"  parameterType="com.community.huiju.model.TpTransaction" >
70
-    insert into tp_transaction
71
-    <trim prefix="(" suffix=")" suffixOverrides="," >
72
-      <if test="id != null" >
73
-        id,
74
-      </if>
75
-      <if test="communityId != null" >
76
-        community_id,
77
-      </if>
78
-      <if test="taUserId != null" >
79
-        ta_user_id,
80
-      </if>
81
-      <if test="transactionTitle != null" >
82
-        transaction_title,
83
-      </if>
84
-      <if test="transactionContent != null" >
85
-        transaction_content,
86
-      </if>
87
-      <if test="viewCount != null" >
88
-        view_count,
89
-      </if>
90
-      <if test="status != null" >
91
-        status,
92
-      </if>
93
-      <if test="type != null" >
94
-        type,
95
-      </if>
96
-      <if test="isReported != null" >
97
-        is_reported,
98
-      </if>
99
-      <if test="createUser != null" >
100
-        create_user,
101
-      </if>
102
-      <if test="createDate != null" >
103
-        create_date,
104
-      </if>
105
-      <if test="updateUser != null" >
106
-        update_user,
107
-      </if>
108
-      <if test="updateDate != null" >
109
-        update_date,
110
-      </if>
111
-      <if test="taUserVerifyId != null" >
112
-        ta_user_verify_id,
113
-      </if>
114
-      <if test="releaseIdentity != null" >
115
-        release_identity
116
-      </if>
117
-    </trim>
118
-    <trim prefix="values (" suffix=")" suffixOverrides="," >
119
-      <if test="id != null" >
120
-        #{id,jdbcType=INTEGER},
121
-      </if>
122
-      <if test="communityId != null" >
123
-        #{communityId,jdbcType=INTEGER},
124
-      </if>
125
-      <if test="taUserId != null" >
126
-        #{taUserId,jdbcType=INTEGER},
127
-      </if>
128
-      <if test="transactionTitle != null" >
129
-        #{transactionTitle,jdbcType=VARCHAR},
130
-      </if>
131
-      <if test="transactionContent != null" >
132
-        #{transactionContent,jdbcType=VARCHAR},
133
-      </if>
134
-      <if test="viewCount != null" >
135
-        #{viewCount,jdbcType=INTEGER},
136
-      </if>
137
-      <if test="status != null" >
138
-        #{status,jdbcType=CHAR},
139
-      </if>
140
-      <if test="type != null" >
141
-        #{type,jdbcType=CHAR},
142
-      </if>
143
-      <if test="isReported != null" >
144
-        #{isReported,jdbcType=CHAR},
145
-      </if>
146
-      <if test="createUser != null" >
147
-        #{createUser,jdbcType=INTEGER},
148
-      </if>
149
-      <if test="createDate != null" >
150
-        #{createDate,jdbcType=TIMESTAMP},
151
-      </if>
152
-      <if test="updateUser != null" >
153
-        #{updateUser,jdbcType=INTEGER},
154
-      </if>
155
-      <if test="updateDate != null" >
156
-        #{updateDate,jdbcType=TIMESTAMP},
157
-      </if>
158
-      <if test="taUserVerifyId != null" >
159
-        #{taUserVerifyId,jdbcType=INTEGER},
160
-      </if>
161
-      <if test="releaseIdentity != null" >
162
-        #{releaseIdentity,jdbcType=VARCHAR},
163
-      </if>
164
-    </trim>
165
-  </insert>
166
-  <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.TpTransaction" >
167
-    update tp_transaction
168
-    <set >
169
-      <if test="communityId != null" >
170
-        community_id = #{communityId,jdbcType=INTEGER},
171
-      </if>
172
-      <if test="taUserId != null" >
173
-        ta_user_id = #{taUserId,jdbcType=INTEGER},
174
-      </if>
175
-      <if test="transactionTitle != null" >
176
-        transaction_title = #{transactionTitle,jdbcType=VARCHAR},
177
-      </if>
178
-      <if test="transactionContent != null" >
179
-        transaction_content = #{transactionContent,jdbcType=VARCHAR},
180
-      </if>
181
-      <if test="viewCount != null" >
182
-        view_count = #{viewCount,jdbcType=INTEGER},
183
-      </if>
184
-      <if test="isReported != null and isReported !=''" >
185
-        is_reported = #{isReported,jdbcType=CHAR},
186
-      </if>
187
-      <if test="status != null" >
188
-        status = #{status,jdbcType=CHAR},
189
-      </if>
190
-      <if test="type != null" >
191
-        type = #{type,jdbcType=CHAR},
192
-      </if>
193
-      <if test="createUser != null" >
194
-        create_user = #{createUser,jdbcType=INTEGER},
195
-      </if>
196
-      <if test="createDate != null" >
197
-        create_date = #{createDate,jdbcType=TIMESTAMP},
198
-      </if>
199
-      <if test="updateUser != null" >
200
-        update_user = #{updateUser,jdbcType=INTEGER},
201
-      </if>
202
-      <if test="updateDate != null" >
203
-        update_date = #{updateDate,jdbcType=TIMESTAMP},
204
-      </if>
205
-    </set>
206
-    where id = #{id,jdbcType=INTEGER}
207
-  </update>
208
-  <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.TpTransaction" >
72
+    <insert id="insertSelective" useGeneratedKeys="true" keyProperty="id"
73
+            parameterType="com.community.huiju.model.TpTransaction">
74
+        insert into tp_transaction
75
+        <trim prefix="(" suffix=")" suffixOverrides=",">
76
+            <if test="id != null">
77
+                id,
78
+            </if>
79
+            <if test="communityId != null">
80
+                community_id,
81
+            </if>
82
+            <if test="taUserId != null">
83
+                ta_user_id,
84
+            </if>
85
+            <if test="transactionTitle != null">
86
+                transaction_title,
87
+            </if>
88
+            <if test="transactionContent != null">
89
+                transaction_content,
90
+            </if>
91
+            <if test="sort != null">
92
+                sort,
93
+            </if>
94
+            <if test="viewCount != null">
95
+                view_count,
96
+            </if>
97
+            <if test="status != null">
98
+                status,
99
+            </if>
100
+            <if test="type != null">
101
+                type,
102
+            </if>
103
+            <if test="isReported != null">
104
+                is_reported,
105
+            </if>
106
+            <if test="createUser != null">
107
+                create_user,
108
+            </if>
109
+            <if test="createDate != null">
110
+                create_date,
111
+            </if>
112
+            <if test="updateUser != null">
113
+                update_user,
114
+            </if>
115
+            <if test="updateDate != null">
116
+                update_date,
117
+            </if>
118
+            <if test="taUserVerifyId != null">
119
+                ta_user_verify_id,
120
+            </if>
121
+            <if test="releaseIdentity != null">
122
+                release_identity
123
+            </if>
124
+        </trim>
125
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
126
+            <if test="id != null">
127
+                #{id,jdbcType=INTEGER},
128
+            </if>
129
+            <if test="communityId != null">
130
+                #{communityId,jdbcType=INTEGER},
131
+            </if>
132
+            <if test="taUserId != null">
133
+                #{taUserId,jdbcType=INTEGER},
134
+            </if>
135
+            <if test="transactionTitle != null">
136
+                #{transactionTitle,jdbcType=VARCHAR},
137
+            </if>
138
+            <if test="transactionContent != null">
139
+                #{transactionContent,jdbcType=VARCHAR},
140
+            </if>
141
+            <if test="sort != null">
142
+                #{sort,jdbcType=VARCHAR},
143
+            </if>
144
+            <if test="viewCount != null">
145
+                #{viewCount,jdbcType=INTEGER},
146
+            </if>
147
+            <if test="status != null">
148
+                #{status,jdbcType=CHAR},
149
+            </if>
150
+            <if test="type != null">
151
+                #{type,jdbcType=CHAR},
152
+            </if>
153
+            <if test="isReported != null">
154
+                #{isReported,jdbcType=CHAR},
155
+            </if>
156
+            <if test="createUser != null">
157
+                #{createUser,jdbcType=INTEGER},
158
+            </if>
159
+            <if test="createDate != null">
160
+                #{createDate,jdbcType=TIMESTAMP},
161
+            </if>
162
+            <if test="updateUser != null">
163
+                #{updateUser,jdbcType=INTEGER},
164
+            </if>
165
+            <if test="updateDate != null">
166
+                #{updateDate,jdbcType=TIMESTAMP},
167
+            </if>
168
+            <if test="taUserVerifyId != null">
169
+                #{taUserVerifyId,jdbcType=INTEGER},
170
+            </if>
171
+            <if test="releaseIdentity != null">
172
+                #{releaseIdentity,jdbcType=VARCHAR},
173
+            </if>
174
+        </trim>
175
+    </insert>
176
+    <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.TpTransaction">
177
+        update tp_transaction
178
+        <set>
179
+            <if test="communityId != null">
180
+                community_id = #{communityId,jdbcType=INTEGER},
181
+            </if>
182
+            <if test="taUserId != null">
183
+                ta_user_id = #{taUserId,jdbcType=INTEGER},
184
+            </if>
185
+            <if test="transactionTitle != null">
186
+                transaction_title = #{transactionTitle,jdbcType=VARCHAR},
187
+            </if>
188
+            <if test="transactionContent != null">
189
+                transaction_content = #{transactionContent,jdbcType=VARCHAR},
190
+            </if>
191
+            <if test="sort != null">
192
+                sort = #{sort,jdbcType=VARCHAR},
193
+            </if>
194
+            <if test="viewCount != null">
195
+                view_count = #{viewCount,jdbcType=INTEGER},
196
+            </if>
197
+            <if test="isReported != null and isReported !=''">
198
+                is_reported = #{isReported,jdbcType=CHAR},
199
+            </if>
200
+            <if test="status != null">
201
+                status = #{status,jdbcType=CHAR},
202
+            </if>
203
+            <if test="type != null">
204
+                type = #{type,jdbcType=CHAR},
205
+            </if>
206
+            <if test="createUser != null">
207
+                create_user = #{createUser,jdbcType=INTEGER},
208
+            </if>
209
+            <if test="createDate != null">
210
+                create_date = #{createDate,jdbcType=TIMESTAMP},
211
+            </if>
212
+            <if test="updateUser != null">
213
+                update_user = #{updateUser,jdbcType=INTEGER},
214
+            </if>
215
+            <if test="updateDate != null">
216
+                update_date = #{updateDate,jdbcType=TIMESTAMP},
217
+            </if>
218
+        </set>
219
+        where id = #{id,jdbcType=INTEGER}
220
+    </update>
221
+    <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.TpTransaction">
209
     update tp_transaction
222
     update tp_transaction
210
     set community_id = #{communityId,jdbcType=INTEGER},
223
     set community_id = #{communityId,jdbcType=INTEGER},
211
       ta_user_id = #{taUserId,jdbcType=INTEGER},
224
       ta_user_id = #{taUserId,jdbcType=INTEGER},
212
       transaction_title = #{transactionTitle,jdbcType=VARCHAR},
225
       transaction_title = #{transactionTitle,jdbcType=VARCHAR},
213
       transaction_content = #{transactionContent,jdbcType=VARCHAR},
226
       transaction_content = #{transactionContent,jdbcType=VARCHAR},
227
+      sort = #{sort,jdbcType=VARCHAR},
214
       view_count = #{viewCount,jdbcType=INTEGER},
228
       view_count = #{viewCount,jdbcType=INTEGER},
215
       status = #{status,jdbcType=CHAR},
229
       status = #{status,jdbcType=CHAR},
216
       type = #{type,jdbcType=CHAR},
230
       type = #{type,jdbcType=CHAR},
221
     where id = #{id,jdbcType=INTEGER}
235
     where id = #{id,jdbcType=INTEGER}
222
   </update>
236
   </update>
223
 
237
 
224
-  <select id="findAllTransaction" resultMap="BaseResultMap">
225
-    select
226
-    <include refid="Base_Column_List" />
227
-    from tp_transaction
228
-    where community_id = #{communityId,jdbcType=INTEGER}
229
-    <if test="type != null and type != ''">
230
-      and type = #{type,jdbcType=VARCHAR}
231
-    </if>
232
-    <if test="transactionTitle != null and transactionTitle !=''">
233
-      and transaction_title LIKE concat('%',#{transactionTitle,jdbcType=VARCHAR},'%')
234
-    </if>
235
-    and status = 1
236
-    order by update_date DESC, create_date DESC
237
-  </select>
238
+    <select id="findAllTransaction" resultMap="BaseResultMap">
239
+        select
240
+        <include refid="Base_Column_List"/>
241
+        from tp_transaction
242
+        where community_id = #{communityId,jdbcType=INTEGER}
243
+        <if test="type != null and type != ''">
244
+            and type = #{type,jdbcType=VARCHAR}
245
+        </if>
246
+        <if test="transactionTitle != null and transactionTitle !=''">
247
+            and transaction_title LIKE concat('%',#{transactionTitle,jdbcType=VARCHAR},'%')
248
+        </if>
249
+        and status = 1
250
+        order by update_date DESC, create_date DESC
251
+    </select>
238
 
252
 
239
-  <select id="selectTransaction" resultMap="BaseResultMap">
240
-    SELECT
241
-    <include refid="Base_Column_List" />
242
-    FROM
243
-    tp_transaction t
244
-    WHERE t.create_user=#{id,jdbcType=INTEGER}
245
-    AND t.community_id=#{communityId,jdbcType=INTEGER}
246
-    UNION ALL
247
-    SELECT
248
-    <include refid="Base_Column_List" />
249
-    FROM
250
-    tp_transaction t
251
-    INNER JOIN(SELECT
252
-    y.transaction_id
253
-    FROM
254
-    tp_transaction_reply y
255
-    LEFT JOIN tp_transaction t ON y.transaction_id = t.id
256
-    WHERE
257
-    y.ta_user_id = #{id,jdbcType=INTEGER}
258
-    <if test="type != null and type != ''">
259
-      and  t.type = #{type,jdbcType=INTEGER}
260
-    </if>
261
-    AND y.community_id = #{communityId,jdbcType=INTEGER}
262
-    AND y.transaction_id NOT IN ( SELECT t.id FROM tp_transaction t WHERE t.create_user = #{id,jdbcType=INTEGER} AND t.community_id = #{communityId,jdbcType=INTEGER}  )
263
-    GROUP BY
264
-    y.transaction_id) a ON a.transaction_id = t.id
265
-    order by create_date DESC
266
-  </select>
253
+    <select id="selectTransaction" resultMap="BaseResultMap">
254
+        SELECT
255
+        <include refid="Base_Column_List"/>
256
+        FROM
257
+        tp_transaction t
258
+        WHERE t.create_user=#{id,jdbcType=INTEGER}
259
+        AND t.community_id=#{communityId,jdbcType=INTEGER}
260
+        UNION ALL
261
+        SELECT
262
+        <include refid="Base_Column_List"/>
263
+        FROM
264
+        tp_transaction t
265
+        INNER JOIN(SELECT
266
+        y.transaction_id
267
+        FROM
268
+        tp_transaction_reply y
269
+        LEFT JOIN tp_transaction t ON y.transaction_id = t.id
270
+        WHERE
271
+        y.ta_user_id = #{id,jdbcType=INTEGER}
272
+        <if test="type != null and type != ''">
273
+            and t.type = #{type,jdbcType=INTEGER}
274
+        </if>
275
+        AND y.community_id = #{communityId,jdbcType=INTEGER}
276
+        AND y.transaction_id NOT IN ( SELECT t.id FROM tp_transaction t WHERE t.create_user = #{id,jdbcType=INTEGER} AND
277
+        t.community_id = #{communityId,jdbcType=INTEGER} )
278
+        GROUP BY
279
+        y.transaction_id) a ON a.transaction_id = t.id
280
+        order by create_date DESC
281
+    </select>
267
 
282
 
268
-  <update id="updateTransaction" parameterType="com.community.huiju.model.TpTransaction" >
283
+    <update id="updateTransaction" parameterType="com.community.huiju.model.TpTransaction">
269
     update tp_transaction
284
     update tp_transaction
270
     set
285
     set
271
     ta_user_id = #{userId,jdbcType=INTEGER},
286
     ta_user_id = #{userId,jdbcType=INTEGER},
276
     where id = #{id,jdbcType=INTEGER}
291
     where id = #{id,jdbcType=INTEGER}
277
   </update>
292
   </update>
278
 
293
 
279
-  <select id="getById" resultMap="BaseResultMap" parameterType="com.community.huiju.model.TpTransaction">
280
-    select
281
-    <include refid="Base_Column_List" />
282
-    from tp_transaction
283
-    where id = #{id,jdbcType=INTEGER} and status = 1
284
-    order by create_date DESC
285
-  </select>
294
+    <select id="getById" resultMap="BaseResultMap" parameterType="com.community.huiju.model.TpTransaction">
295
+        select
296
+        <include refid="Base_Column_List"/>
297
+        from tp_transaction
298
+        where id = #{id,jdbcType=INTEGER} and status = 1
299
+        order by create_date DESC
300
+    </select>
286
 
301
 
287
-  <select id="getReportReasons" resultType="java.util.Map">
302
+    <select id="getReportReasons" resultType="java.util.Map">
288
     SELECT id,reason FROM sys_report_reason ORDER BY sort
303
     SELECT id,reason FROM sys_report_reason ORDER BY sort
289
   </select>
304
   </select>
290
 
305
 
291
-  <insert id="saveReportReason">
306
+    <insert id="saveReportReason">
292
     insert into tp_transaction_report (community_id, transaction_id,
307
     insert into tp_transaction_report (community_id, transaction_id,
293
       report_reason_id, reporter_id)
308
       report_reason_id, reporter_id)
294
     values (#{communityId,jdbcType=INTEGER}, #{transactionId,jdbcType=INTEGER},
309
     values (#{communityId,jdbcType=INTEGER}, #{transactionId,jdbcType=INTEGER},
295
       #{reportReasonId,jdbcType=VARCHAR}, #{userId,jdbcType=INTEGER})
310
       #{reportReasonId,jdbcType=VARCHAR}, #{userId,jdbcType=INTEGER})
296
   </insert>
311
   </insert>
297
-  <select id="getUserTransactionList" resultMap="BaseResultMap">
312
+    <select id="getUserTransactionList" resultMap="BaseResultMap">
298
 
313
 
299
-SELECT
300
-    <include refid="Base_Column_List" />
301
-    FROM
302
-      tp_transaction t
303
-    WHERE t.create_user=#{id,jdbcType=INTEGER}
304
-    AND t.community_id=#{communityId,jdbcType=INTEGER}
305
-    UNION ALL
306
-    SELECT
307
-        <include refid="Base_Column_List" />
308
-    FROM
309
-      tp_transaction t
310
-    INNER JOIN(SELECT
311
-      y.transaction_id
312
-    FROM
313
-      tp_transaction_reply y
314
-      LEFT JOIN tp_transaction t ON y.transaction_id = t.id
315
-    WHERE
316
-      y.ta_user_id = #{id,jdbcType=INTEGER}
317
-      AND y.community_id = #{communityId,jdbcType=INTEGER}
318
-      AND y.transaction_id NOT IN ( SELECT t.id FROM tp_transaction t WHERE t.create_user = #{id,jdbcType=INTEGER} AND t.community_id = #{communityId,jdbcType=INTEGER}  )
319
-    GROUP BY
320
-      y.transaction_id) a ON a.transaction_id = t.id
321
-    order by create_date DESC
322
-  </select>
314
+        SELECT
315
+        <include refid="Base_Column_List"/>
316
+        FROM
317
+        tp_transaction t
318
+        WHERE t.create_user=#{id,jdbcType=INTEGER}
319
+        AND t.community_id=#{communityId,jdbcType=INTEGER}
320
+        UNION ALL
321
+        SELECT
322
+        <include refid="Base_Column_List"/>
323
+        FROM
324
+        tp_transaction t
325
+        INNER JOIN(SELECT
326
+        y.transaction_id
327
+        FROM
328
+        tp_transaction_reply y
329
+        LEFT JOIN tp_transaction t ON y.transaction_id = t.id
330
+        WHERE
331
+        y.ta_user_id = #{id,jdbcType=INTEGER}
332
+        AND y.community_id = #{communityId,jdbcType=INTEGER}
333
+        AND y.transaction_id NOT IN ( SELECT t.id FROM tp_transaction t WHERE t.create_user = #{id,jdbcType=INTEGER} AND
334
+        t.community_id = #{communityId,jdbcType=INTEGER} )
335
+        GROUP BY
336
+        y.transaction_id) a ON a.transaction_id = t.id
337
+        order by create_date DESC
338
+    </select>
323
 </mapper>
339
 </mapper>

+ 1
- 1
CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/impl/ToBannerServiceImpl.java 查看文件

208
             // TODO banner位置名称
208
             // TODO banner位置名称
209
             //SysDictionary sysDictionary = sysDictionaryMapper.selectByPrimaryKey(e.getBannerPosition());
209
             //SysDictionary sysDictionary = sysDictionaryMapper.selectByPrimaryKey(e.getBannerPosition());
210
             //toBannerVO.setBannerPositionName(sysDictionary.getName());
210
             //toBannerVO.setBannerPositionName(sysDictionary.getName());
211
-            toBannerVO.setBannerPositionName(e.getBannerPosition() == 1?"首页banner":"服务banner");
211
+            toBannerVO.setBannerPositionName(e.getBannerPosition() == 1?"首页banner": e.getBannerPosition() == 2 ? "服务banner" : "广告banner");
212
 
212
 
213
             ToUser toUser = toUserMapper.selectByPrimaryKey(e.getUpdateUser());
213
             ToUser toUser = toUserMapper.selectByPrimaryKey(e.getUpdateUser());
214
             if (null != toUser) {
214
             if (null != toUser) {

+ 2
- 2
VUECODE/smart-operate-manage/src/views/banner/addBanner/index.vue 查看文件

167
     })
167
     })
168
   },
168
   },
169
   created() {
169
   created() {
170
-    this.listQuery = this.$route.params.listQuery
170
+    this.listQuery = this.$route.query.listQuery
171
     this.getCommuniryList()
171
     this.getCommuniryList()
172
   },
172
   },
173
   methods: {
173
   methods: {
201
     },
201
     },
202
     dialogForm(isVaule) {
202
     dialogForm(isVaule) {
203
       if (isVaule === '0') {
203
       if (isVaule === '0') {
204
-        this.$router.push({ name: 'banner-index', params: { listQuery: this.listQuery }})
204
+        this.$router.push({ name: 'banner-index', query: { listQuery: this.listQuery }})
205
       } else {
205
       } else {
206
         this.createData()
206
         this.createData()
207
         // console.log('添加banner的数据: ', this.addForm)
207
         // console.log('添加banner的数据: ', this.addForm)

+ 3
- 3
VUECODE/smart-operate-manage/src/views/banner/ediBanner/index.vue 查看文件

171
   },
171
   },
172
   created() {
172
   created() {
173
     this.getCommuniryList()
173
     this.getCommuniryList()
174
-    this.getByBannerId(this.$route.params.id)
175
-    this.listQuery = this.$route.params.listQuery
174
+    this.getByBannerId(this.$route.query.id)
175
+    this.listQuery = this.$route.query.listQuery
176
   },
176
   },
177
   updated() {
177
   updated() {
178
     // console.log('$ref: ', this.$refs.refEditor)
178
     // console.log('$ref: ', this.$refs.refEditor)
209
     },
209
     },
210
     dialogForm(isVaule) {
210
     dialogForm(isVaule) {
211
       if (isVaule === '0') {
211
       if (isVaule === '0') {
212
-        this.$router.push({ name: 'banner-index', params: { listQuery: this.listQuery }})
212
+        this.$router.push({ name: 'banner-index', query: { listQuery: this.listQuery }})
213
       } else {
213
       } else {
214
         this.updateData()
214
         this.updateData()
215
       }
215
       }

+ 8
- 9
VUECODE/smart-operate-manage/src/views/banner/index.vue 查看文件

175
     })
175
     })
176
   },
176
   },
177
   created() {
177
   created() {
178
-    const query = this.$route.params.listQuery
178
+    const query = this.$route.query.listQuery
179
     if (query !== undefined) {
179
     if (query !== undefined) {
180
-      this.listQuery = this.$route.params.listQuery
180
+      this.listQuery = this.$route.query.listQuery
181
     }
181
     }
182
     this.getList()
182
     this.getList()
183
     this.getCommuniryList()
183
     this.getCommuniryList()
225
       })
225
       })
226
     },
226
     },
227
     dialogAddForm() {
227
     dialogAddForm() {
228
-      this.$router.push({ name: 'banner-add', params: { listQuery: this.listQuery }})
228
+      this.$router.push({ name: 'banner-add', query: { listQuery: this.listQuery }})
229
     },
229
     },
230
     updateBanner(bannerId) {
230
     updateBanner(bannerId) {
231
-      this.$router.push({ name: 'banner-edi', params: { id: bannerId, listQuery: this.listQuery }})
231
+      this.$router.push({ name: 'banner-edi', query: { id: bannerId, listQuery: this.listQuery }})
232
     },
232
     },
233
     infoBanner(bannerId) {
233
     infoBanner(bannerId) {
234
-      this.$router.push({ name: 'banner-info', params: { id: bannerId, listQuery: this.listQuery }})
234
+      this.$router.push({ name: 'banner-info', query: { id: bannerId, listQuery: this.listQuery }})
235
     },
235
     },
236
     handleSizeChange(val) {
236
     handleSizeChange(val) {
237
       // console.log(`每页 ${val} 条`);
237
       // console.log(`每页 ${val} 条`);
259
       this.$store.dispatch('GetBanner', this.listQuery).then(response => {
259
       this.$store.dispatch('GetBanner', this.listQuery).then(response => {
260
         this.list = response.item
260
         this.list = response.item
261
         this.total = response.total
261
         this.total = response.total
262
-        // Just to simulate the time of the request
263
-        setTimeout(() => {
264
-          this.listLoading = false
265
-        }, 1.5 * 1000)
262
+        this.listLoading = false
263
+      }).catch(() => {
264
+        this.listLoading = false
266
       })
265
       })
267
     },
266
     },
268
     getCommuniryList() {
267
     getCommuniryList() {

+ 8
- 7
VUECODE/smart-operate-manage/src/views/banner/infoBanner/index.vue 查看文件

131
       showURLVisible: true,
131
       showURLVisible: true,
132
       bannerPositionArr: [
132
       bannerPositionArr: [
133
         { id: 1, value: '首页banner' },
133
         { id: 1, value: '首页banner' },
134
-        { id: 2, value: '服务banner' }
134
+        { id: 2, value: '服务banner' },
135
+        { id: 3, value: '广告banner' }
135
       ]
136
       ]
136
     }
137
     }
137
   },
138
   },
142
   },
143
   },
143
   created() {
144
   created() {
144
     this.getCommuniryList()
145
     this.getCommuniryList()
145
-    this.getByBannerId(this.$route.params.id)
146
-    this.listQuery = this.$route.params.listQuery
146
+    this.getByBannerId(this.$route.query.id)
147
+    this.listQuery = this.$route.query.listQuery
147
   },
148
   },
148
   mounted() {
149
   mounted() {
149
     window.addEventListener('beforeunload', e => {
150
     window.addEventListener('beforeunload', e => {
150
-      this.$router.push({ name: 'banner-index', params: { listQuery: this.listQuery }})
151
+      this.$router.push({ name: 'banner-index', query: { listQuery: this.listQuery }})
151
     })
152
     })
152
   },
153
   },
153
   methods: {
154
   methods: {
181
     },
182
     },
182
     dialogForm(isVaule) {
183
     dialogForm(isVaule) {
183
       if (isVaule === '0') {
184
       if (isVaule === '0') {
184
-        this.$router.push({ name: 'banner-index', params: { listQuery: this.listQuery }})
185
+        this.$router.push({ name: 'banner-index', query: { listQuery: this.listQuery }})
185
       } else {
186
       } else {
186
         this.updateData()
187
         this.updateData()
187
       }
188
       }
196
       }
197
       }
197
     },
198
     },
198
     updateBanner() {
199
     updateBanner() {
199
-      this.$router.push({ name: 'banner-edi', params: { id: this.form.id, listQuery: this.listQuery }})
200
+      this.$router.push({ name: 'banner-edi', query: { id: this.form.id, listQuery: this.listQuery }})
200
     },
201
     },
201
     updateData() {
202
     updateData() {
202
       this.$refs['form'].validate((valid) => {
203
       this.$refs['form'].validate((valid) => {
207
                 message: res.message,
208
                 message: res.message,
208
                 type: 'success'
209
                 type: 'success'
209
               })
210
               })
210
-              this.$router.push({ name: 'banner-index', params: { listQuery: this.listQuery }})
211
+              this.$router.push({ name: 'banner-index', query: { listQuery: this.listQuery }})
211
             } else {
212
             } else {
212
               this.$message({
213
               this.$message({
213
                 message: res.message,
214
                 message: res.message,

+ 1
- 1
VUECODE/smart-operate-manage/src/views/community/communityTable.vue 查看文件

44
           <span>{{ scope.row.propertyNum }}</span>
44
           <span>{{ scope.row.propertyNum }}</span>
45
         </template>
45
         </template>
46
       </el-table-column>
46
       </el-table-column>
47
-      <el-table-column label="已核主数量" align="center">
47
+      <el-table-column label="已核主数量" align="center">
48
         <template slot-scope="scope">
48
         <template slot-scope="scope">
49
           <span>{{ scope.row.verifyOwnerNum }}</span>
49
           <span>{{ scope.row.verifyOwnerNum }}</span>
50
         </template>
50
         </template>