Browse Source

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

魏熙美 6 years ago
parent
commit
5a06f77fdc

+ 8
- 8
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpTransactionLike.java View File

7
 
7
 
8
     private Integer communityId;
8
     private Integer communityId;
9
 
9
 
10
-    private Integer taUserId;
10
+    private Integer taUserVerifyId;
11
 
11
 
12
     private Integer transactionId;
12
     private Integer transactionId;
13
 
13
 
32
     public void setCommunityId(Integer communityId) {
32
     public void setCommunityId(Integer communityId) {
33
         this.communityId = communityId;
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
     public Integer getTransactionId() {
44
     public Integer getTransactionId() {
45
         return transactionId;
45
         return transactionId;
46
     }
46
     }

+ 3
- 3
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java View File

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

+ 11
- 11
CODE/smart-community/app-api/src/main/resources/mapper/TpTransactionLikeMapper.xml View File

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

+ 2
- 19
CODE/smart-community/app-api/src/main/resources/mapper/TpTransactionMapper.xml View File

291
       #{reportReasonId,jdbcType=VARCHAR}, #{userId,jdbcType=INTEGER},#{createDate,jdbcType=TIMESTAMP})
291
       #{reportReasonId,jdbcType=VARCHAR}, #{userId,jdbcType=INTEGER},#{createDate,jdbcType=TIMESTAMP})
292
   </insert>
292
   </insert>
293
     <select id="getUserTransactionList" resultMap="BaseResultMap">
293
     <select id="getUserTransactionList" resultMap="BaseResultMap">
294
-
295
         SELECT
294
         SELECT
296
         <include refid="Base_Column_List"/>
295
         <include refid="Base_Column_List"/>
297
         FROM
296
         FROM
298
         tp_transaction t
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
         WHERE
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
         order by create_date DESC
301
         order by create_date DESC
319
     </select>
302
     </select>
320
 </mapper>
303
 </mapper>

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

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 View File

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