dingxin 6 gadus atpakaļ
vecāks
revīzija
2a28aee844

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/SocialController.java Parādīt failu

@@ -333,7 +333,7 @@ public class SocialController extends BaseController {
333 333
         ResponseBean responseBean = new ResponseBean();
334 334
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
335 335
         Integer userId = userElement.getId();
336
-        ResponseBean response = socialServiceI.addAllTransaction(userId, paramets);
336
+        ResponseBean response = socialServiceI.addAllTransaction(userId, paramets,userElement.getUserVerifyId());
337 337
         return response;
338 338
     }
339 339
     

+ 25
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpTransaction.java Parādīt failu

@@ -53,11 +53,36 @@ public class TpTransaction {
53 53
      */
54 54
     private Integer noLikeCount;
55 55
 
56
+    /**
57
+     * 对应app端的角色表,物业端发帖时不维护
58
+     */
59
+    private Integer taUserVerifyId;
60
+
61
+    /**
62
+     * 0为app端,1为物业
63
+     */
64
+    private String releaseIdentity;
65
+
66
+    public void setReleaseIdentity(String releaseIdentity) {
67
+        this.releaseIdentity = releaseIdentity;
68
+    }
69
+
70
+    public String getReleaseIdentity() {
71
+        return releaseIdentity;
72
+    }
73
+
56 74
     /**
57 75
      * 是否已点赞或者踩
58 76
      */
59 77
     private String bel;
60 78
 
79
+    public Integer getTaUserVerifyId() {
80
+        return taUserVerifyId;
81
+    }
82
+
83
+    public void setTaUserVerifyId(Integer taUserVerifyId) {
84
+        this.taUserVerifyId = taUserVerifyId;
85
+    }
61 86
 
62 87
     public String getRoleName() {
63 88
         return roleName;

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/SocialServiceI.java Parādīt failu

@@ -108,7 +108,7 @@ public interface SocialServiceI {
108 108
 	/**
109 109
 	 * 添加二手租赁帖子
110 110
 	 */
111
-    ResponseBean addAllTransaction(Integer userId, String paramets)throws IOException;
111
+    ResponseBean addAllTransaction(Integer userId, String paramets, Integer userVerifyId)throws IOException;
112 112
 
113 113
 
114 114
 	/**

+ 8
- 6
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java Parādīt failu

@@ -316,11 +316,12 @@ public class SocialServiceImpl implements SocialServiceI {
316 316
         List<TpTransaction> tpTransactions= tpTransactionMapper.findAllTransaction(communityId, transactionTitle,type);
317 317
 
318 318
         tpTransactions.stream().forEach(e->{
319
-            // 角色
320
-//            taUserVerifyMapper.selectByPrimaryKey()
321
-            TaSysRole taSysRole = taSysRoleMapper.findRoleByUserId(e.getTaUserId());
322
-            e.setRoleId(taSysRole.getId());
323
-            e.setRoleName(taSysRole.getRoleName());
319
+
320
+            if (null != e.getTaUserVerifyId()){
321
+                TaSysRole taSysRole = taSysRoleMapper.findRoleByUserId(e.getTaUserVerifyId());
322
+                e.setRoleId(taSysRole.getId());
323
+                e.setRoleName(taSysRole.getRoleName());
324
+            }
324 325
             TaUser taUser = taUserMapper.selectByPrimaryKey(e.getTaUserId());
325 326
             e.setCreateUserName(taUser.getUserName());
326 327
         });
@@ -335,7 +336,7 @@ public class SocialServiceImpl implements SocialServiceI {
335 336
 
336 337
     @Transactional
337 338
     @Override
338
-    public ResponseBean addAllTransaction(Integer userId, String paramets) throws IOException {
339
+    public ResponseBean addAllTransaction(Integer userId, String paramets,Integer userVerifyId) throws IOException {
339 340
         ResponseBean response = new ResponseBean();
340 341
         JSONObject jsonObject = JSONObject.parseObject(paramets);
341 342
         String transactionTitle = (String) jsonObject.get("title");
@@ -355,6 +356,7 @@ public class SocialServiceImpl implements SocialServiceI {
355 356
         tpTransaction.setCreateDate(new Date());
356 357
         tpTransaction.setUpdateUser(userId);
357 358
         tpTransaction.setUpdateDate(new Date());
359
+        tpTransaction.setTaUserVerifyId(userVerifyId);
358 360
         tpTransaction.setIsReported("0");
359 361
 
360 362
         //判断身份是否为业主且状态为已停用

+ 23
- 4
CODE/smart-community/app-api/src/main/resources/mapper/TpTransactionMapper.xml Parādīt failu

@@ -16,10 +16,13 @@
16 16
     <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
17 17
     <result column="role_id" property="roleId" jdbcType="INTEGER" />
18 18
     <result column="role_name" property="roleName" jdbcType="VARCHAR" />
19
+    <result column="ta_user_verify_id" property="taUserVerifyId" jdbcType="INTEGER" />
20
+    <result column="release_identity" property="releaseIdentity" jdbcType="VARCHAR" />
21
+
19 22
   </resultMap>
20 23
   <sql id="Base_Column_List" >
21 24
     id, community_id, ta_user_id, transaction_title, transaction_content,
22
-    view_count, status, type, create_user, create_date, update_user, update_date
25
+    view_count, status, type, create_user, create_date, update_user, update_date, ta_user_verify_id, release_identity
23 26
   </sql>
24 27
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="com.community.huiju.model.TpTransaction"  >
25 28
     SELECT
@@ -36,7 +39,9 @@
36 39
 	ttr.update_user,
37 40
 	ttr.update_date,
38 41
 	sr.id AS role_id,
39
-	sr.role_name AS role_name
42
+	sr.role_name AS role_name,
43
+	ttr.release_identity,
44
+	ttr.ta_user_verify_id
40 45
 FROM
41 46
 	tp_transaction ttr
42 47
 LEFT JOIN ta_sys_user_role tsur ON ttr.ta_user_id = tsur.user_id
@@ -48,12 +53,14 @@ LEFT JOIN ta_sys_role sr ON sr.id = tsur.role_id
48 53
     where id = #{id,jdbcType=INTEGER}
49 54
   </delete>
50 55
   <insert id="insert" parameterType="com.community.huiju.model.TpTransaction" >
51
-    insert into tp_transaction (id, community_id, ta_user_id, 
56
+    insert into tp_transaction (id, community_id,release_identity,
57
+      ta_user_verify_id,
58
+      ta_user_id,
52 59
       transaction_title, transaction_content,
53 60
       view_count, status,
54 61
       type, create_user, create_date, 
55 62
       update_user, update_date)
56
-    values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{taUserId,jdbcType=INTEGER}, 
63
+    values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER},#{releaseIdentity,jdbcType=VARCHAR},#{taUserVerifyId,jdbcType=INTEGER}, #{taUserId,jdbcType=INTEGER},
57 64
       #{transactionTitle,jdbcType=VARCHAR}, #{transactionContent,jdbcType=VARCHAR},
58 65
        #{viewCount,jdbcType=INTEGER}, #{status,jdbcType=CHAR},
59 66
       #{type,jdbcType=CHAR}, #{createUser,jdbcType=INTEGER}, #{createDate,jdbcType=TIMESTAMP}, 
@@ -101,6 +108,12 @@ LEFT JOIN ta_sys_role sr ON sr.id = tsur.role_id
101 108
       <if test="updateDate != null" >
102 109
         update_date,
103 110
       </if>
111
+      <if test="taUserVerifyId != null" >
112
+        ta_user_verify_id,
113
+      </if>
114
+      <if test="releaseIdentity != null" >
115
+        release_identity
116
+      </if>
104 117
     </trim>
105 118
     <trim prefix="values (" suffix=")" suffixOverrides="," >
106 119
       <if test="id != null" >
@@ -142,6 +155,12 @@ LEFT JOIN ta_sys_role sr ON sr.id = tsur.role_id
142 155
       <if test="updateDate != null" >
143 156
         #{updateDate,jdbcType=TIMESTAMP},
144 157
       </if>
158
+      <if test="taUserVerifyId != null" >
159
+        #{taUserVerifyId,jdbcType=INTEGER},
160
+      </if>
161
+      <if test="releaseIdentity != null" >
162
+        #{releaseIdentity,jdbcType=VARCHAR},
163
+      </if>
145 164
     </trim>
146 165
   </insert>
147 166
   <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.TpTransaction" >

+ 1
- 1
CODE/smart-community/app-api/src/main/resources/mapper/TpTransactionReplyMapper.xml Parādīt failu

@@ -146,7 +146,7 @@
146 146
     FROM
147 147
         tp_transaction_reply tr
148 148
     WHERE
149
-	tr.community_id = 45
149
+	tr.community_id = #{communityId}
150 150
       <if test="type != null and type != '' and type == 2" >
151 151
       AND (tr.reply_ta_user_id = (SELECT r.id from tp_user r WHERE tr.ta_user_id = r.id )) OR (ta_user_id = (SELECT r.id from tp_user r WHERE tr.ta_user_id = r.id ))
152 152
       </if>