Просмотр исходного кода

Merge branch '2.0.0' of http://git.ycjcjy.com/fuxingfan/smartCommunity into 2.0.0

魏熙美 6 лет назад
Родитель
Сommit
5a06f77fdc

+ 8
- 8
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpTransactionLike.java Просмотреть файл

@@ -7,7 +7,7 @@ public class TpTransactionLike {
7 7
 
8 8
     private Integer communityId;
9 9
 
10
-    private Integer taUserId;
10
+    private Integer taUserVerifyId;
11 11
 
12 12
     private Integer transactionId;
13 13
 
@@ -32,15 +32,15 @@ public class TpTransactionLike {
32 32
     public void setCommunityId(Integer communityId) {
33 33
         this.communityId = communityId;
34 34
     }
35
-
36
-    public Integer getTaUserId() {
37
-        return taUserId;
35
+    
36
+    public Integer getTaUserVerifyId() {
37
+        return taUserVerifyId;
38 38
     }
39
-
40
-    public void setTaUserId(Integer taUserId) {
41
-        this.taUserId = taUserId;
39
+    
40
+    public void setTaUserVerifyId(Integer taUserVerifyId) {
41
+        this.taUserVerifyId = taUserVerifyId;
42 42
     }
43
-
43
+    
44 44
     public Integer getTransactionId() {
45 45
         return transactionId;
46 46
     }

+ 3
- 3
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java Просмотреть файл

@@ -603,9 +603,9 @@ public class SocialServiceImpl implements SocialServiceI {
603 603
         ResponseBean response = new ResponseBean();
604 604
         TpTransactionLike tpTransactionLike = JSONObject.parseObject(paramets, TpTransactionLike.class);
605 605
         tpTransactionLike.setCommunityId(userElement.getCommunityId());
606
-        tpTransactionLike.setTaUserId(userElement.getId());
606
+        tpTransactionLike.setTaUserVerifyId(userElement.getUserVerifyId());
607 607
         tpTransactionLike.setCreateDate(new Date());
608
-        TpTransactionLike isUser = tpTransactionLikeMapper.getinvitationId(tpTransactionLike.getTransactionId(), userElement.getCommunityId(), userElement.getId());
608
+        TpTransactionLike isUser = tpTransactionLikeMapper.getinvitationId(tpTransactionLike.getTransactionId(), userElement.getCommunityId(), userElement.getUserVerifyId());
609 609
         if (null != isUser) {
610 610
             response.addError("您已点赞或踩");
611 611
             return response;
@@ -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());

+ 11
- 11
CODE/smart-community/app-api/src/main/resources/mapper/TpTransactionLikeMapper.xml Просмотреть файл

@@ -4,14 +4,14 @@
4 4
   <resultMap id="BaseResultMap" type="com.community.huiju.model.TpTransactionLike" >
5 5
     <id column="id" property="id" jdbcType="INTEGER" />
6 6
     <result column="community_id" property="communityId" jdbcType="INTEGER" />
7
-    <result column="ta_user_id" property="taUserId" jdbcType="INTEGER" />
7
+    <result column="ta_user_verify_id" property="taUserVerifyId" jdbcType="INTEGER" />
8 8
     <result column="transaction_id" property="transactionId" jdbcType="INTEGER" />
9 9
     <result column="like_status" property="likeStatus" jdbcType="VARCHAR" />
10 10
     <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
11 11
     <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
12 12
   </resultMap>
13 13
   <sql id="Base_Column_List" >
14
-    id, community_id, ta_user_id, transaction_id, like_status, create_date, update_date
14
+    id, community_id, ta_user_verify_id, transaction_id, like_status, create_date, update_date
15 15
   </sql>
16 16
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
17 17
     select 
@@ -24,10 +24,10 @@
24 24
     where id = #{id,jdbcType=INTEGER}
25 25
   </delete>
26 26
   <insert id="insert" parameterType="com.community.huiju.model.TpTransactionLike" >
27
-    insert into tp_transaction_like (id, community_id, ta_user_id, 
27
+    insert into tp_transaction_like (id, community_id, ta_user_verify_id,
28 28
       transaction_id, like_status, create_date, 
29 29
       update_date)
30
-    values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{taUserId,jdbcType=INTEGER}, 
30
+    values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{taUserVerifyId,jdbcType=INTEGER},
31 31
       #{transactionId,jdbcType=INTEGER}, #{likeStatus,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP}, 
32 32
       #{updateDate,jdbcType=TIMESTAMP})
33 33
   </insert>
@@ -40,8 +40,8 @@
40 40
       <if test="communityId != null" >
41 41
         community_id,
42 42
       </if>
43
-      <if test="taUserId != null" >
44
-        ta_user_id,
43
+      <if test="taUserVerifyId != null" >
44
+        ta_user_verify_id,
45 45
       </if>
46 46
       <if test="transactionId != null" >
47 47
         transaction_id,
@@ -63,8 +63,8 @@
63 63
       <if test="communityId != null" >
64 64
         #{communityId,jdbcType=INTEGER},
65 65
       </if>
66
-      <if test="taUserId != null" >
67
-        #{taUserId,jdbcType=INTEGER},
66
+      <if test="taUserVerifyId != null" >
67
+        #{taUserVerifyId,jdbcType=INTEGER},
68 68
       </if>
69 69
       <if test="transactionId != null" >
70 70
         #{transactionId,jdbcType=INTEGER},
@@ -86,8 +86,8 @@
86 86
       <if test="communityId != null" >
87 87
         community_id = #{communityId,jdbcType=INTEGER},
88 88
       </if>
89
-      <if test="taUserId != null" >
90
-        ta_user_id = #{taUserId,jdbcType=INTEGER},
89
+      <if test="taUserVerifyId != null" >
90
+        ta_user_verify_id = #{taUserVerifyId,jdbcType=INTEGER},
91 91
       </if>
92 92
       <if test="transactionId != null" >
93 93
         transaction_id = #{transactionId,jdbcType=INTEGER},
@@ -107,7 +107,7 @@
107 107
   <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.TpTransactionLike" >
108 108
     update tp_transaction_like
109 109
     set community_id = #{communityId,jdbcType=INTEGER},
110
-      ta_user_id = #{taUserId,jdbcType=INTEGER},
110
+      ta_user_verify_id = #{taUserVerifyId,jdbcType=INTEGER},
111 111
       transaction_id = #{transactionId,jdbcType=INTEGER},
112 112
       like_status = #{likeStatus,jdbcType=VARCHAR},
113 113
       create_date = #{createDate,jdbcType=TIMESTAMP},

+ 2
- 19
CODE/smart-community/app-api/src/main/resources/mapper/TpTransactionMapper.xml Просмотреть файл

@@ -291,30 +291,13 @@
291 291
       #{reportReasonId,jdbcType=VARCHAR}, #{userId,jdbcType=INTEGER},#{createDate,jdbcType=TIMESTAMP})
292 292
   </insert>
293 293
     <select id="getUserTransactionList" resultMap="BaseResultMap">
294
-
295 294
         SELECT
296 295
         <include refid="Base_Column_List"/>
297 296
         FROM
298 297
         tp_transaction t
299
-        WHERE t.create_user=#{id,jdbcType=INTEGER}
300
-        AND t.community_id=#{communityId,jdbcType=INTEGER}
301
-        UNION ALL
302
-        SELECT
303
-        <include refid="Base_Column_List"/>
304
-        FROM
305
-        tp_transaction t
306
-        INNER JOIN(SELECT
307
-        y.transaction_id
308
-        FROM
309
-        tp_transaction_reply y
310
-        LEFT JOIN tp_transaction t ON y.transaction_id = t.id
311 298
         WHERE
312
-        y.ta_user_id = #{id,jdbcType=INTEGER}
313
-        AND y.community_id = #{communityId,jdbcType=INTEGER}
314
-        AND y.transaction_id NOT IN ( SELECT t.id FROM tp_transaction t WHERE t.create_user = #{id,jdbcType=INTEGER} AND
315
-        t.community_id = #{communityId,jdbcType=INTEGER} )
316
-        GROUP BY
317
-        y.transaction_id) a ON a.transaction_id = t.id
299
+        t.community_id=#{communityId,jdbcType=INTEGER}
300
+        AND t.uuid = #{id} and t.uuid_type = 'app'
318 301
         order by create_date DESC
319 302
     </select>
320 303
 </mapper>

+ 3
- 5
CODE/smart-community/app-api/src/main/resources/mapper/TpTransactionReplyMapper.xml Просмотреть файл

@@ -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 Просмотреть файл

@@ -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);