Explorar el Código

重构话题回复相关模块

傅行帆 hace 6 años
padre
commit
2213cea981

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java Ver fichero

@@ -633,7 +633,7 @@ public class SocialServiceImpl implements SocialServiceI {
633 633
         //拿到我自己所有的帖子
634 634
         Map<String, Object> parameter = Maps.newHashMap();
635 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 638
         parameter.put("list", tpTransactionList);
639 639
         parameter.put("total", pageList.getTotal());

+ 3
- 5
CODE/smart-community/app-api/src/main/resources/mapper/TpTransactionReplyMapper.xml Ver fichero

@@ -171,17 +171,15 @@
171 171
 	tr.community_id = #{communityId}
172 172
     and tr.transaction_id=#{transactionId}
173 173
       <if test="type == 2" >
174
-        AND tr.uuid_type = "prop"
174
+        AND (tr.uuid_type = 'prop' or tr.reply_uuid_type = 'prop')
175 175
       </if>
176 176
       <if test="type == 1" >
177 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 179
       </if>
181 180
       <if test="type == 0" >
182 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 183
       </if>
186 184
    </select>
187 185
    <select id="selectUserTransactionReply" resultMap="BaseResultMap">

+ 4
- 3
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TransactionServiceImpl.java Ver fichero

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