weiximei 6 lat temu
rodzic
commit
46873ef66a

+ 29
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/SocialController.java Wyświetl plik

266
         return responseBean;
266
         return responseBean;
267
     }
267
     }
268
 
268
 
269
+
270
+    @ApiOperation(value = "查询二手租赁回复", notes = "查询二手租赁回复")
271
+    @ApiImplicitParams({
272
+            @ApiImplicitParam(paramType = "query", dataType = "integer", name = "activityId", value = "活动帖子id"),
273
+            @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token"),
274
+            @ApiImplicitParam(paramType = "query", dataTypeClass = Integer.class, name = "pageNum", value = "第几页"),
275
+            @ApiImplicitParam(paramType = "query", dataTypeClass = Integer.class, name = "pageSize", value = "一页多少行"),
276
+            @ApiImplicitParam(paramType = "query", dataTypeClass = String.class, name = "order", value = "asc 正序(默认), desc倒序")
277
+    })
278
+    @RequestMapping(value = "/getTransactionReply", method = RequestMethod.GET)
279
+    public ResponseBean findUsedDetailsReply(@RequestParam("activityId") Integer activityId,
280
+                                             @RequestParam(value = "order", defaultValue = "asc") String order,
281
+                                             @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
282
+                                             @RequestParam(value = "pageSize", defaultValue = "10")Integer pageSize,
283
+                                             HttpSession session) {
284
+        ResponseBean responseBean = new ResponseBean();
285
+        UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
286
+
287
+        if (!check(userElement.getCommunityId())) {
288
+            responseBean.addError("小区不存在");
289
+            return responseBean;
290
+        }
291
+
292
+        responseBean = socialServiceI.findUsedDetailsReply(activityId, userElement, order, pageNum, pageSize);
293
+        return responseBean;
294
+    }
295
+
296
+
297
+
269
     @ApiOperation(value = "获取所有的二手租赁帖子", notes = "获取所有的二手租赁帖子")
298
     @ApiOperation(value = "获取所有的二手租赁帖子", notes = "获取所有的二手租赁帖子")
270
     @ApiImplicitParams({@ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id"),
299
     @ApiImplicitParams({@ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id"),
271
             @ApiImplicitParam(paramType = "query", dataType = "String", name = "type", value = "帖子类型"),
300
             @ApiImplicitParam(paramType = "query", dataType = "String", name = "type", value = "帖子类型"),

+ 0
- 9
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpTransaction.java Wyświetl plik

44
 
44
 
45
     private  String roleName;
45
     private  String roleName;
46
 
46
 
47
-    // 帖子的回复集合
48
-    private List<TpTransactionReply> replies;
49
 
47
 
50
     public String getRoleName() {
48
     public String getRoleName() {
51
         return roleName;
49
         return roleName;
188
         this.createUserName = createUserName;
186
         this.createUserName = createUserName;
189
     }
187
     }
190
 
188
 
191
-    public List<TpTransactionReply> getReplies() {
192
-        return replies;
193
-    }
194
-
195
-    public void setReplies(List<TpTransactionReply> replies) {
196
-        this.replies = replies;
197
-    }
198
 }
189
 }

+ 11
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/SocialServiceI.java Wyświetl plik

168
 	 * @return
168
 	 * @return
169
 	 */
169
 	 */
170
 	ResponseBean reportTransaction(Integer userId,Integer communityId, String paramets);
170
 	ResponseBean reportTransaction(Integer userId,Integer communityId, String paramets);
171
+
172
+	/**
173
+	 * 查询 二手交易帖子的回复
174
+	 * @param activityId 帖子id
175
+	 * @param userElement 用户信息体
176
+	 * @param order asc 正序  desc 倒序
177
+	 * @param pageNum
178
+	 * @param pageSize
179
+	 * @return
180
+	 */
181
+	ResponseBean findUsedDetailsReply(Integer activityId, UserElement userElement, String order, Integer pageNum, Integer pageSize);
171
 }
182
 }

+ 11
- 4
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java Wyświetl plik

716
         List<String> imgList = tdImagesList.stream().map(e->new String(e.getImageUrl())).collect(Collectors.toList());
716
         List<String> imgList = tdImagesList.stream().map(e->new String(e.getImageUrl())).collect(Collectors.toList());
717
         tpTransaction.setImgList(imgList);
717
         tpTransaction.setImgList(imgList);
718
 
718
 
719
-        // 查询回复信息
720
-        List<TpTransactionReply> transactionReplies = tpTransactionReplyMapper.getCommunityIdAndTransactionId(communityId, tpTransaction.getId());
721
-        tpTransaction.setReplies(transactionReplies);
722
-
723
         return tpTransaction;
719
         return tpTransaction;
724
 
720
 
725
     }
721
     }
756
 
752
 
757
         return responseBean;
753
         return responseBean;
758
     }
754
     }
755
+
756
+    @Override
757
+    public ResponseBean findUsedDetailsReply(Integer activityId, UserElement userElement, String order, Integer pageNum, Integer pageSize) {
758
+        ResponseBean responseBean = new ResponseBean();
759
+
760
+        PageHelper.startPage(pageNum, pageSize, "create_date " + order);
761
+        List<TpTransactionReply> replies = tpTransactionReplyMapper.getCommunityIdAndTransactionId(userElement.getCommunityId(), activityId);
762
+
763
+        responseBean.addSuccess(replies);
764
+        return responseBean;
765
+    }
759
 }
766
 }