浏览代码

重构话题回复相关模块

傅行帆 6 年前
父节点
当前提交
2213cea981

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

633
         //拿到我自己所有的帖子
633
         //拿到我自己所有的帖子
634
         Map<String, Object> parameter = Maps.newHashMap();
634
         Map<String, Object> parameter = Maps.newHashMap();
635
         Page<TpTransaction> pageList = PageHelper.startPage(pageNum, paeSize);
635
         Page<TpTransaction> pageList = PageHelper.startPage(pageNum, paeSize);
636
-        List<TpTransaction> tpTransactionList = tpTransactionMapper.getUserTransactionList(userElement.getId(), userElement.getCommunityId());
636
+        List<TpTransaction> tpTransactionList = tpTransactionMapper.getUserTransactionList(userElement.getUserVerifyId(), userElement.getCommunityId());
637
 
637
 
638
         parameter.put("list", tpTransactionList);
638
         parameter.put("list", tpTransactionList);
639
         parameter.put("total", pageList.getTotal());
639
         parameter.put("total", pageList.getTotal());

+ 3
- 5
CODE/smart-community/app-api/src/main/resources/mapper/TpTransactionReplyMapper.xml 查看文件

171
 	tr.community_id = #{communityId}
171
 	tr.community_id = #{communityId}
172
     and tr.transaction_id=#{transactionId}
172
     and tr.transaction_id=#{transactionId}
173
       <if test="type == 2" >
173
       <if test="type == 2" >
174
-        AND tr.uuid_type = "prop"
174
+        AND (tr.uuid_type = 'prop' or tr.reply_uuid_type = 'prop')
175
       </if>
175
       </if>
176
       <if test="type == 1" >
176
       <if test="type == 1" >
177
         AND (tr.uuid = #{uuid} OR tr.reply_uuid = #{uuid})
177
         AND (tr.uuid = #{uuid} OR tr.reply_uuid = #{uuid})
178
-        AND tr.uuid_type =  #{uuidType}
179
-        AND tr.reply_uuid_type =  #{uuidType}
178
+        AND (tr.uuid_type =  #{uuidType} or tr.reply_uuid_type =  #{uuidType})
180
       </if>
179
       </if>
181
       <if test="type == 0" >
180
       <if test="type == 0" >
182
         AND (tr.uuid = #{userID} OR tr.reply_uuid = #{userID})
181
         AND (tr.uuid = #{userID} OR tr.reply_uuid = #{userID})
183
-        AND tr.uuid_type = 'app'
184
-        AND tr.reply_uuid_type = 'app'
182
+        AND (tr.uuid_type = 'app' or tr.reply_uuid_type = 'app')
185
       </if>
183
       </if>
186
    </select>
184
    </select>
187
    <select id="selectUserTransactionReply" resultMap="BaseResultMap">
185
    <select id="selectUserTransactionReply" resultMap="BaseResultMap">

+ 4
- 3
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TransactionServiceImpl.java 查看文件

332
 
332
 
333
 		 // 查询帖子信息
333
 		 // 查询帖子信息
334
 		TpTransaction tpTransaction= tpTransactionMapper.selectById(id);
334
 		TpTransaction tpTransaction= tpTransactionMapper.selectById(id);
335
-		// 查询评论信息
336
-		TransactionReply  Reply= transactionReplyMapper.selectById(id);
335
+		
337
 		TransactionReply transactionReply= new TransactionReply();
336
 		TransactionReply transactionReply= new TransactionReply();
338
 		// 查询回复的ta_userID
337
 		// 查询回复的ta_userID
339
 		 User user= userMapper.selectById(userElement.getId());
338
 		 User user= userMapper.selectById(userElement.getId());
351
 					.setCreateDate(LocalDateTime.now());
350
 					.setCreateDate(LocalDateTime.now());
352
 		}
351
 		}
353
 		if (Type!=1) {
352
 		if (Type!=1) {
353
+			// 查询评论信息
354
+			TransactionReply  Reply= transactionReplyMapper.selectById(id);
354
 			transactionReply.setCommunityId(userElement.getCommunityId())
355
 			transactionReply.setCommunityId(userElement.getCommunityId())
355
 					.setTransactionId(Reply.getTransactionId())
356
 					.setTransactionId(Reply.getTransactionId())
356
 					.setUuid(userElement.getId())
357
 					.setUuid(userElement.getId())
359
 					.setReplyContent(replyContent)
360
 					.setReplyContent(replyContent)
360
 					.setReplyUuid(Reply.getUuid())
361
 					.setReplyUuid(Reply.getUuid())
361
 					.setReplyUuidType("prop")
362
 					.setReplyUuidType("prop")
362
-					.setReplyUuidName(Reply.getReplyUuidName())
363
+					.setReplyUuidName(Reply.getUuidName())
363
 					.setCreateDate(LocalDateTime.now());
364
 					.setCreateDate(LocalDateTime.now());
364
 		}
365
 		}
365
 		transactionReplyMapper.insert(transactionReply);
366
 		transactionReplyMapper.insert(transactionReply);