Przeglądaj źródła

重构 话题模块 包括帖子的回复

傅行帆 6 lat temu
rodzic
commit
66a78b2cfd
21 zmienionych plików z 2305 dodań i 2052 usunięć
  1. 2
    2
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/SocialController.java
  2. 2
    2
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpTransactionReplyMapper.java
  3. 39
    23
      CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpTransaction.java
  4. 147
    62
      CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpTransactionReply.java
  5. 43
    27
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java
  6. 1
    1
      CODE/smart-community/app-api/src/main/resources/mapper/TpTransactionLikeMapper.xml
  7. 27
    59
      CODE/smart-community/app-api/src/main/resources/mapper/TpTransactionMapper.xml
  8. 21
    17
      CODE/smart-community/app-api/src/main/resources/mapper/TpTransactionReplyMapper.xml
  9. 13
    13
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/impl/CommunityServiceImpl.java
  10. 2
    2
      CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/TransactionController.java
  11. 1
    1
      CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TransactionReplyMapper.java
  12. 13
    9
      CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TpTransaction.java
  13. 38
    18
      CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TransactionReply.java
  14. 4
    6
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/ITransactionService.java
  15. 25
    20
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TransactionServiceImpl.java
  16. 6
    7
      CODE/smart-community/property-api/src/main/resources/mapper/TpTransactionMapper.xml
  17. 18
    27
      CODE/smart-community/property-api/src/main/resources/mapper/TransactionReplyMapper.xml
  18. 5
    2
      VUECODE/smart-property-manage/src/views/social/transaction/index.vue
  19. 2
    2
      VUECODE/smart-property-manage/src/views/social/transaction/reply/transactionreply.vue
  20. 948
    876
      文档/MYSQL/smartCommunity.pdb
  21. 948
    876
      文档/MYSQL/smartCommunity.pdm

+ 2
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/SocialController.java Wyświetl plik

@@ -252,7 +252,7 @@ public class SocialController extends BaseController {
252 252
     public ResponseBean findUsedDetails(@PathVariable(value = "communityId") Integer communityId, @RequestParam("activityId") Integer activityId, HttpSession session) {
253 253
         ResponseBean responseBean = new ResponseBean();
254 254
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
255
-        Integer userId = userElement.getId();
255
+        Integer userId = userElement.getUserVerifyId();
256 256
 
257 257
         if (!check(communityId)) {
258 258
             responseBean.addError("小区不存在");
@@ -379,7 +379,7 @@ public class SocialController extends BaseController {
379 379
     public ResponseBean ubdateTransaction(HttpSession session,@PathVariable("id") String id, @RequestBody String paramets) {
380 380
         ResponseBean responseBean = new ResponseBean();
381 381
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
382
-        Integer userId = userElement.getId();
382
+        Integer userId = userElement.getUserVerifyId();
383 383
         ResponseBean response = socialServiceI.updateTransaction(paramets,userId,Integer.valueOf(id));
384 384
         return response;
385 385
     }

+ 2
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpTransactionReplyMapper.java Wyświetl plik

@@ -25,10 +25,10 @@ public interface TpTransactionReplyMapper {
25 25
      * @param communityId
26 26
      * @param transactionId
27 27
      * @param userID
28
-     * @param founderUserID
28
+     * @param
29 29
      * @return
30 30
      */
31
-    List<TpTransactionReply> getCommunityIdAndTransactionId(@Param("communityId") Integer communityId, @Param("transactionId") Integer transactionId,@Param("userID") Integer userID,@Param("founderUserID") Integer founderUserID,@Param("type")Integer type, @Param("roomNoName")String roomNoName);
31
+    List<TpTransactionReply> getCommunityIdAndTransactionId(@Param("communityId") Integer communityId, @Param("transactionId") Integer transactionId,@Param("userID") Integer userID,@Param("uuid") Integer uuid,@Param("uuidType") String uuidType,@Param("type")Integer type);
32 32
 
33 33
     /**
34 34
      * 查询我回复别人的帖子

+ 39
- 23
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpTransaction.java Wyświetl plik

@@ -8,8 +8,6 @@ public class TpTransaction {
8 8
 
9 9
     private Integer communityId;
10 10
 
11
-    private Integer taUserId;
12
-
13 11
     private String transactionTitle;
14 12
 
15 13
     private String transactionContent;
@@ -29,6 +27,21 @@ public class TpTransaction {
29 27
     private Integer updateUser;
30 28
 
31 29
     private Date updateDate;
30
+    
31
+    /**
32
+     * 身份ID 根据uuid_type区分是物业端TP_USER_ID还是TA_USER_VERIFY_ID
33
+     */
34
+    private Integer uuid;
35
+    
36
+    /**
37
+     * app/prop
38
+     */
39
+    private String uuidType;
40
+    
41
+    /**
42
+     * 话题发布人
43
+     */
44
+    private String uuidName;
32 45
 
33 46
     //返回查询帖子电话
34 47
     private String telephone;
@@ -58,11 +71,6 @@ public class TpTransaction {
58 71
      */
59 72
     private Integer noLikeCount;
60 73
 
61
-    /**
62
-     * 对应app端的角色表,物业端发帖时不维护
63
-     */
64
-    private Integer taUserVerifyId;
65
-
66 74
     /**
67 75
      * 0为app端,1为物业
68 76
      */
@@ -86,14 +94,6 @@ public class TpTransaction {
86 94
      */
87 95
     private String bel;
88 96
 
89
-    public Integer getTaUserVerifyId() {
90
-        return taUserVerifyId;
91
-    }
92
-
93
-    public void setTaUserVerifyId(Integer taUserVerifyId) {
94
-        this.taUserVerifyId = taUserVerifyId;
95
-    }
96
-
97 97
     public String getRoleName() {
98 98
         return roleName;
99 99
     }
@@ -124,14 +124,6 @@ public class TpTransaction {
124 124
         this.communityId = communityId;
125 125
     }
126 126
 
127
-    public Integer getTaUserId() {
128
-        return taUserId;
129
-    }
130
-
131
-    public void setTaUserId(Integer taUserId) {
132
-        this.taUserId = taUserId;
133
-    }
134
-
135 127
     public String getTransactionTitle() {
136 128
         return transactionTitle;
137 129
     }
@@ -274,4 +266,28 @@ public class TpTransaction {
274 266
     public void setRoomNoName(String roomNoName) {
275 267
         this.roomNoName = roomNoName;
276 268
     }
269
+    
270
+    public Integer getUuid() {
271
+        return uuid;
272
+    }
273
+    
274
+    public void setUuid(Integer uuid) {
275
+        this.uuid = uuid;
276
+    }
277
+    
278
+    public String getUuidType() {
279
+        return uuidType;
280
+    }
281
+    
282
+    public void setUuidType(String uuidType) {
283
+        this.uuidType = uuidType;
284
+    }
285
+    
286
+    public String getUuidName() {
287
+        return uuidName;
288
+    }
289
+    
290
+    public void setUuidName(String uuidName) {
291
+        this.uuidName = uuidName;
292
+    }
277 293
 }

+ 147
- 62
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpTransactionReply.java Wyświetl plik

@@ -1,28 +1,81 @@
1 1
 package com.community.huiju.model;
2 2
 
3
+import java.time.LocalDateTime;
3 4
 import java.util.Date;
4 5
 import java.util.List;
5 6
 
6 7
 public class TpTransactionReply {
7
-
8
+    
8 9
     private Integer id;
9
-
10
+    /**
11
+     * 小区id
12
+     */
10 13
     private Integer communityId;
11
-
14
+    
15
+    /**
16
+     * 交易帖子ID
17
+     */
12 18
     private Integer transactionId;
13
-
14
-    private Integer taUserId;
15
-
16
-    private String taUserName;
17
-
19
+    
20
+    /**
21
+     * 回复帖子的ID,根据uuid_type区分物业端app端
22
+     */
23
+    private Integer uuid;
24
+    
25
+    /**
26
+     * app/prop
27
+     */
28
+    private String uuidType;
29
+    
30
+    /**
31
+     * 回复帖子的姓名
32
+     */
33
+    private String uuidName;
34
+    
35
+    /**
36
+     * 回复帖子的角色
37
+     */
38
+    private String uuidRole;
39
+    
40
+    /**
41
+     * 回复内容
42
+     */
18 43
     private String replyContent;
19
-
20
-    private Integer replyTaUserId;
21
-
22
-    private String replyTaUserName;
23
-
44
+    
45
+    /**
46
+     * 被回复的评论内容的用户ID根据uuidtype区分
47
+     */
48
+    private Integer replyUuid;
49
+    
50
+    /**
51
+     * app/prop
52
+     */
53
+    private String replyUuidType;
54
+    
55
+    /**
56
+     * 被回复的评论内容的姓名
57
+     */
58
+    private String replyUuidName;
59
+    
60
+    /**
61
+     * 被回复的评论人的角色
62
+     */
63
+    private String replyUuidRole;
64
+    
65
+    /**
66
+     * 发布者身份
67
+     */
68
+    private String releaseIdentity;
69
+    
70
+    /**
71
+     * 创建时间
72
+     */
24 73
     private Date createDate;
25
-
74
+    
75
+    /**
76
+     * 用户角色
77
+     */
78
+    private String roleName;
26 79
     /**
27 80
      * 住户端 的角色
28 81
      */
@@ -32,25 +85,15 @@ public class TpTransactionReply {
32 85
      * 被回复人 的角色
33 86
      */
34 87
     private String replyRoleName;
88
+    
89
+    private String createUserName;
35 90
 
36 91
     /**
37 92
      * 回复的图片
38 93
      * @return
39 94
      */
40 95
     private List<String> imgList;
41
-
42
-    /**
43
-     *0代表app端用户,1代表物业端用户
44
-     * @return
45
-     */
46
-    private String releaseIdentity;
47
-
48
-    /**
49
-     * 用于查询app端角色,物业端不维护
50
-     * @param releaseIdentity
51
-     */
52
-    private  Integer taUserVerifyId;
53
-
96
+    
54 97
     private String roomNoName;
55 98
 
56 99
     public String getRoomNoName() {
@@ -61,13 +104,7 @@ public class TpTransactionReply {
61 104
         this.roomNoName = roomNoName;
62 105
     }
63 106
 
64
-    public void setTaUserVerifyId(Integer taUserVerifyId) {
65
-        this.taUserVerifyId = taUserVerifyId;
66
-    }
67
-
68
-    public Integer getTaUserVerifyId() {
69
-        return taUserVerifyId;
70
-    }
107
+    
71 108
 
72 109
     public void setReleaseIdentity(String releaseIdentity) {
73 110
         this.releaseIdentity = releaseIdentity;
@@ -108,23 +145,15 @@ public class TpTransactionReply {
108 145
     public void setTransactionId(Integer transactionId) {
109 146
         this.transactionId = transactionId;
110 147
     }
111
-
112
-    public Integer getTaUserId() {
113
-        return taUserId;
148
+    
149
+    public String getRoleName() {
150
+        return roleName;
114 151
     }
115
-
116
-    public void setTaUserId(Integer taUserId) {
117
-        this.taUserId = taUserId;
152
+    
153
+    public void setRoleName(String roleName) {
154
+        this.roleName = roleName;
118 155
     }
119
-
120
-    public String getTaUserName() {
121
-        return taUserName;
122
-    }
123
-
124
-    public void setTaUserName(String taUserName) {
125
-        this.taUserName = taUserName == null ? null : taUserName.trim();
126
-    }
127
-
156
+    
128 157
     public String getReplyContent() {
129 158
         return replyContent;
130 159
     }
@@ -132,23 +161,71 @@ public class TpTransactionReply {
132 161
     public void setReplyContent(String replyContent) {
133 162
         this.replyContent = replyContent == null ? null : replyContent.trim();
134 163
     }
135
-
136
-    public Integer getReplyTaUserId() {
137
-        return replyTaUserId;
164
+    
165
+    public Integer getUuid() {
166
+        return uuid;
138 167
     }
139
-
140
-    public void setReplyTaUserId(Integer replyTaUserId) {
141
-        this.replyTaUserId = replyTaUserId;
168
+    
169
+    public void setUuid(Integer uuid) {
170
+        this.uuid = uuid;
142 171
     }
143
-
144
-    public String getReplyTaUserName() {
145
-        return replyTaUserName;
172
+    
173
+    public String getUuidType() {
174
+        return uuidType;
146 175
     }
147
-
148
-    public void setReplyTaUserName(String replyTaUserName) {
149
-        this.replyTaUserName = replyTaUserName == null ? null : replyTaUserName.trim();
176
+    
177
+    public void setUuidType(String uuidType) {
178
+        this.uuidType = uuidType;
150 179
     }
151
-
180
+    
181
+    public String getUuidName() {
182
+        return uuidName;
183
+    }
184
+    
185
+    public void setUuidName(String uuidName) {
186
+        this.uuidName = uuidName;
187
+    }
188
+    
189
+    public String getUuidRole() {
190
+        return uuidRole;
191
+    }
192
+    
193
+    public void setUuidRole(String uuidRole) {
194
+        this.uuidRole = uuidRole;
195
+    }
196
+    
197
+    public Integer getReplyUuid() {
198
+        return replyUuid;
199
+    }
200
+    
201
+    public void setReplyUuid(Integer replyUuid) {
202
+        this.replyUuid = replyUuid;
203
+    }
204
+    
205
+    public String getReplyUuidType() {
206
+        return replyUuidType;
207
+    }
208
+    
209
+    public void setReplyUuidType(String replyUuidType) {
210
+        this.replyUuidType = replyUuidType;
211
+    }
212
+    
213
+    public String getReplyUuidName() {
214
+        return replyUuidName;
215
+    }
216
+    
217
+    public void setReplyUuidName(String replyUuidName) {
218
+        this.replyUuidName = replyUuidName;
219
+    }
220
+    
221
+    public String getReplyUuidRole() {
222
+        return replyUuidRole;
223
+    }
224
+    
225
+    public void setReplyUuidRole(String replyUuidRole) {
226
+        this.replyUuidRole = replyUuidRole;
227
+    }
228
+    
152 229
     public Date getCreateDate() {
153 230
         return createDate;
154 231
     }
@@ -172,4 +249,12 @@ public class TpTransactionReply {
172 249
     public void setReplyRoleName(String replyRoleName) {
173 250
         this.replyRoleName = replyRoleName;
174 251
     }
252
+    
253
+    public String getCreateUserName() {
254
+        return createUserName;
255
+    }
256
+    
257
+    public void setCreateUserName(String createUserName) {
258
+        this.createUserName = createUserName;
259
+    }
175 260
 }

+ 43
- 27
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java Wyświetl plik

@@ -300,13 +300,15 @@ public class SocialServiceImpl implements SocialServiceI {
300 300
         List<TpTransaction> tpTransactions = tpTransactionMapper.findAllTransaction(communityId, transactionTitle, type);
301 301
 
302 302
         tpTransactions.stream().forEach(e -> {
303
-            if (null != e.getTaUserVerifyId()) {
304
-                TaSysRole taSysRole = taSysRoleMapper.selectByPrimaryKey(e.getTaUserVerifyId());
303
+            if (e.getUuidType().equals("app")) {
304
+                TaSysRole taSysRole = taSysRoleMapper.selectByPrimaryKey(taUserVerifyMapper.selectByPrimaryKey(e.getUuid()).getRoleId());
305 305
                 e.setRoleId(taSysRole.getId());
306 306
                 e.setRoleName(taSysRole.getRoleName());
307 307
             }
308
-            TaUser taUser = taUserMapper.selectByPrimaryKey(e.getTaUserId());
309
-            e.setCreateUserName(taUser.getUserName());
308
+            if (e.getUuidType().equals("prop")) {
309
+                e.setRoleName("物业");
310
+            }
311
+            e.setCreateUserName(e.getUuidName());
310 312
         });
311 313
 
312 314
         parameter.put("list", tpTransactions);
@@ -333,14 +335,15 @@ public class SocialServiceImpl implements SocialServiceI {
333 335
         tpTransaction.setTransactionContent(transactionContent);
334 336
         tpTransaction.setType(type);
335 337
         tpTransaction.setCommunityId(userElement.getCommunityId());
336
-        tpTransaction.setTaUserId(userElement.getId());
338
+        tpTransaction.setUuid(userElement.getUserVerifyId());
339
+        tpTransaction.setUuidType("app");
340
+        tpTransaction.setUuidName(userElement.getUserName());
337 341
         tpTransaction.setCreateUser(userElement.getId());
338 342
         tpTransaction.setStatus("1");
339 343
         tpTransaction.setCreateDate(new Date());
340 344
         tpTransaction.setUpdateUser(userElement.getId());
341 345
         tpTransaction.setUpdateDate(new Date());
342 346
         TaUserVerify taUserVerify= taUserVerifyMapper.selectByPrimaryKey(userElement.getUserVerifyId());
343
-        tpTransaction.setTaUserVerifyId(taUserVerify.getRoleId());
344 347
         tpTransaction.setRoomNoName(taUserVerify.getRoomNoName());
345 348
         tpTransaction.setIsReported("0");
346 349
         // 发布者身份  0 APP  1 物业
@@ -394,7 +397,7 @@ public class SocialServiceImpl implements SocialServiceI {
394 397
 
395 398
         Map<String, Object> parameter = Maps.newHashMap();
396 399
         Page<TpTransaction> pageLsit = PageHelper.startPage(pageNum, paeSize);
397
-        List<TpTransaction> tpTransactions = tpTransactionMapper.selectTransaction(userElement.getId(), userElement.getCommunityId(), type);
400
+        List<TpTransaction> tpTransactions = tpTransactionMapper.selectTransaction(userElement.getUserVerifyId(), userElement.getCommunityId(), type);
398 401
 
399 402
         tpTransactions.stream().forEach(e -> {
400 403
             // 角色
@@ -425,7 +428,7 @@ public class SocialServiceImpl implements SocialServiceI {
425 428
         transaction.setTransactionContent(tpTransaction.getTransactionContent());
426 429
 
427 430
 
428
-        if (null != transaction && userId.equals(transaction.getTaUserId())) {
431
+        if (null != transaction && userId.equals(transaction.getUuid()) && transaction.getUuidType().equals("app")) {
429 432
             tdImagesMapper.deleteTdImages(Integer.valueOf(id), Constant.TRANSACTION);
430 433
 
431 434
             insertTdImage(transaction, imageUrl, userId, Constant.TRANSACTION);
@@ -441,7 +444,7 @@ public class SocialServiceImpl implements SocialServiceI {
441 444
     public ResponseBean deleteransaction(Integer id, UserElement userElement) {
442 445
         ResponseBean responseBean = new ResponseBean();
443 446
         TpTransaction tpTransaction = tpTransactionMapper.getById(Integer.valueOf(id));
444
-        if (null != tpTransaction && userElement.getId().equals(tpTransaction.getTaUserId())) {
447
+        if (null != tpTransaction && userElement.getUserVerifyId().equals(tpTransaction.getUuid()) && tpTransaction.getUuidType().equals("app")) {
445 448
             tpTransaction.setStatus("0");
446 449
             tpTransaction.setUpdateDate(new Date());
447 450
             tpTransactionMapper.updateByPrimaryKeySelective(tpTransaction);
@@ -564,20 +567,19 @@ public class SocialServiceImpl implements SocialServiceI {
564 567
         }
565 568
         TpTransactionReply tpTransactionReply = JSONObject.parseObject(paramets, TpTransactionReply.class);
566 569
         tpTransactionReply.setCommunityId(userElement.getCommunityId());
567
-        tpTransactionReply.setTaUserId(userElement.getId());
568
-        tpTransactionReply.setTaUserName(userElement.getUserName());
570
+        tpTransactionReply.setUuid(userElement.getUserVerifyId());
571
+        tpTransactionReply.setUuidType("app");
572
+        tpTransactionReply.setUuidName(userElement.getUserName());
569 573
 
570 574
             // 由于评论帖子和评论对话是同一个接口,当tpTransactionReply.getReplyTaUserId()为空时查询Ta_user里面的名字
571 575
         TpTransaction tpTransaction= tpTransactionMapper.getById(tpTransactionReply.getTransactionId());
572
-        TaUser taUser= taUserMapper.selectByPrimaryKey(tpTransaction.getTaUserId());
573
-
574
-        tpTransactionReply.setReplyTaUserName(tpTransactionReply.getReplyTaUserId()==null?taUser.getUserName():taUserMapper.selectByPrimaryKey(tpTransactionReply.getReplyTaUserId()).getUserName());
576
+        
575 577
         //  评论帖子取 TpTransaction 的创建人,回复对话取传过来的值
576
-        tpTransactionReply.setReplyTaUserId(tpTransactionReply.getReplyTaUserId()==null?tpTransaction.getCreateUser():tpTransactionReply.getReplyTaUserId());
578
+        tpTransactionReply.setReplyUuid(tpTransaction.getUuid());
579
+        tpTransactionReply.setReplyUuidType(tpTransaction.getUuidType());
580
+        tpTransactionReply.setReplyUuidName(tpTransaction.getUuidName());
577 581
         tpTransactionReply.setReleaseIdentity("0");
578 582
         TaUserVerify taUserVerify= taUserVerifyMapper.selectByPrimaryKey(userElement.getUserVerifyId());
579
-        tpTransactionReply.setTaUserVerifyId(taUserVerify.getRoleId());
580
-        tpTransactionReply.setRoomNoName(taUserVerify.getRoomNoName());
581 583
         tpTransactionReply.setCreateDate(new Date());
582 584
         tpTransactionReplyMapper.insert(tpTransactionReply);
583 585
 
@@ -679,12 +681,12 @@ public class SocialServiceImpl implements SocialServiceI {
679 681
         TpTransactionReply tpTransactionReply = new TpTransactionReply();
680 682
         tpTransactionReply.setCommunityId(userElement.getCommunityId());
681 683
         tpTransactionReply.setTransactionId(transactionId);
682
-        tpTransactionReply.setTaUserId(userElement.getId());
683
-        tpTransactionReply.setTaUserName(userElement.getUserName());
684
+        //tpTransactionReply.setTaUserId(userElement.getId());
685
+        //tpTransactionReply.setTaUserName(userElement.getUserName());
684 686
         tpTransactionReply.setReleaseIdentity("0");
685
-        tpTransactionReply.setReplyContent(replyContent);
686
-        tpTransactionReply.setReplyTaUserId(replyUserId);
687
-        tpTransactionReply.setReplyTaUserName(userName);
687
+        //tpTransactionReply.setReplyContent(replyContent);
688
+        //tpTransactionReply.setReplyTaUserId(replyUserId);
689
+        //tpTransactionReply.setReplyTaUserName(userName);
688 690
         tpTransactionReply.setCreateDate(new Date());
689 691
         response.addSuccess("成功");
690 692
         tpTransactionReplyMapper.insert(tpTransactionReply);
@@ -833,9 +835,15 @@ public class SocialServiceImpl implements SocialServiceI {
833 835
         }
834 836
 
835 837
         TpTransaction tpTransaction = tpTransactionMapper.selectByPrimaryKey(activityId, communityId);
836
-        TaUser taUser = taUserMapper.selectByPrimaryKey(tpTransaction.getTaUserId());
837
-        tpTransaction.setTelephone(taUser.getLoginName());
838
-        tpTransaction.setCreateUserName(taUser.getUserName());
838
+        if (tpTransaction.getUuidType().equals("app")) {
839
+            TaSysRole taSysRole = taSysRoleMapper.selectByPrimaryKey(taUserVerifyMapper.selectByPrimaryKey(tpTransaction.getUuid()).getRoleId());
840
+            tpTransaction.setRoleId(taSysRole.getId());
841
+            tpTransaction.setRoleName(taSysRole.getRoleName());
842
+        }
843
+        if (tpTransaction.getUuidType().equals("prop")) {
844
+            tpTransaction.setRoleName("物业");
845
+        }
846
+        tpTransaction.setCreateUserName(tpTransaction.getUuidName());
839 847
 
840 848
         Map<String, Object> map = Maps.newHashMap();
841 849
         map.put("uuid", tpTransaction.getId());
@@ -908,9 +916,17 @@ public class SocialServiceImpl implements SocialServiceI {
908 916
 
909 917
         PageHelper.startPage(pageNum, pageSize, "create_date " + order);
910 918
         //房间号
911
-         TaUserVerify taUserVerify= taUserVerifyMapper.selectByPrimaryKey(userElement.getUserVerifyId());
912
-        List<TpTransactionReply> replies = tpTransactionReplyMapper.getCommunityIdAndTransactionId(userElement.getCommunityId(), transactionId, userElement.getId(), tpTransaction.getCreateUser(),type,taUserVerify.getRoomNoName());
919
+        TaUserVerify taUserVerify= taUserVerifyMapper.selectByPrimaryKey(userElement.getUserVerifyId());
920
+        List<TpTransactionReply> replies = tpTransactionReplyMapper.getCommunityIdAndTransactionId(userElement.getCommunityId(), transactionId, userElement.getUserVerifyId(), tpTransaction.getUuid(),tpTransaction.getUuidType(),type);
913 921
         for (TpTransactionReply tpTransactionReply : replies) {
922
+            if (tpTransactionReply.getUuidType().equals("app")) {
923
+                TaSysRole taSysRole = taSysRoleMapper.selectByPrimaryKey(taUserVerifyMapper.selectByPrimaryKey(tpTransactionReply.getUuid()).getRoleId());
924
+                tpTransactionReply.setRoleName(taSysRole.getDescription());
925
+            }
926
+            if (tpTransactionReply.getUuidType().equals("prop")) {
927
+                tpTransactionReply.setRoleName("物业");
928
+            }
929
+            tpTransactionReply.setCreateUserName(tpTransactionReply.getUuidName());
914 930
             List<TdImages> tdImagesList = tdImagesMapper.selectImages(tpTransactionReply.getId(), "reply");
915 931
             List<String> list = new ArrayList<>();
916 932
             for (TdImages imageUrl : tdImagesList) {

+ 1
- 1
CODE/smart-community/app-api/src/main/resources/mapper/TpTransactionLikeMapper.xml Wyświetl plik

@@ -134,7 +134,7 @@
134 134
     SELECT * FROM
135 135
     tp_transaction_like
136 136
     WHERE community_id = #{communityId,jdbcType=INTEGER}
137
-    and   ta_user_id = #{userId,jdbcType=INTEGER}
137
+    and   ta_user_verify_id = #{userId,jdbcType=INTEGER}
138 138
     and   transaction_id = #{invitationId,jdbcType=INTEGER}
139 139
   </select>
140 140
 </mapper>

+ 27
- 59
CODE/smart-community/app-api/src/main/resources/mapper/TpTransactionMapper.xml Wyświetl plik

@@ -4,7 +4,9 @@
4 4
     <resultMap id="BaseResultMap" type="com.community.huiju.model.TpTransaction">
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="uuid" property="uuid" jdbcType="INTEGER"/>
8
+        <result column="uuid_name" property="uuidName" jdbcType="VARCHAR"/>
9
+        <result column="uuid_type" property="uuidType" jdbcType="VARCHAR"/>
8 10
         <result column="transaction_title" property="transactionTitle" jdbcType="VARCHAR"/>
9 11
         <result column="transaction_content" property="transactionContent" jdbcType="VARCHAR"/>
10 12
         <result column="sort" property="sort" jdbcType="VARCHAR"/>
@@ -17,38 +19,18 @@
17 19
         <result column="update_date" property="updateDate" jdbcType="TIMESTAMP"/>
18 20
         <result column="role_id" property="roleId" jdbcType="INTEGER"/>
19 21
         <result column="role_name" property="roleName" jdbcType="VARCHAR"/>
20
-        <result column="ta_user_verify_id" property="taUserVerifyId" jdbcType="INTEGER"/>
21 22
         <result column="release_identity" property="releaseIdentity" jdbcType="VARCHAR"/>
22 23
         <result column="room_no_name" property="roomNoName" jdbcType="VARCHAR"/>
23 24
 
24 25
     </resultMap>
25 26
     <sql id="Base_Column_List">
26
-    id, community_id, ta_user_id, transaction_title, transaction_content, sort,
27
-    view_count, status, type, create_user, create_date, update_user, update_date, ta_user_verify_id, release_identity,room_no_name
27
+    id, community_id, transaction_title, transaction_content, sort,uuid,uuid_type,uuid_name,
28
+    view_count, status, type, create_user, create_date, update_user, update_date, release_identity,room_no_name
28 29
   </sql>
29 30
     <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="com.community.huiju.model.TpTransaction">
30
-    SELECT
31
-	ttr.id,
32
-	ttr.community_id,
33
-	ttr.ta_user_id,
34
-	ttr.transaction_title,
35
-	ttr.transaction_content,
36
-	ttr.sort,
37
-	ttr.view_count,
38
-	ttr.STATUS,
39
-	ttr.type,
40
-	ttr.create_user,
41
-	ttr.create_date,
42
-	ttr.update_user,
43
-	ttr.update_date,
44
-	sr.id AS role_id,
45
-	sr.role_name AS role_name,
46
-	ttr.release_identity,
47
-	ttr.ta_user_verify_id
48
-    FROM
49
-        tp_transaction ttr
50
-    LEFT JOIN ta_sys_user_role tsur ON ttr.ta_user_id = tsur.user_id
51
-    LEFT JOIN ta_sys_role sr ON sr.id = tsur.role_id
31
+    select
32
+    <include refid="Base_Column_List"/>
33
+    from tp_transaction ttr
52 34
     where ttr.id = #{id,jdbcType=INTEGER} and ttr.community_id=#{communityId,jdbcType=INTEGER}
53 35
   </select>
54 36
     <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
@@ -80,8 +62,14 @@
80 62
             <if test="communityId != null">
81 63
                 community_id,
82 64
             </if>
83
-            <if test="taUserId != null">
84
-                ta_user_id,
65
+            <if test="uuid != null">
66
+                uuid,
67
+            </if>
68
+            <if test="uuidType != null">
69
+                uuid_type,
70
+            </if>
71
+            <if test="uuidName != null">
72
+                uuid_Name,
85 73
             </if>
86 74
             <if test="transactionTitle != null">
87 75
                 transaction_title,
@@ -116,9 +104,6 @@
116 104
             <if test="updateDate != null">
117 105
                 update_date,
118 106
             </if>
119
-            <if test="taUserVerifyId != null">
120
-                ta_user_verify_id,
121
-            </if>
122 107
             <if test="releaseIdentity != null">
123 108
                 release_identity,
124 109
             </if>
@@ -133,8 +118,14 @@
133 118
             <if test="communityId != null">
134 119
                 #{communityId,jdbcType=INTEGER},
135 120
             </if>
136
-            <if test="taUserId != null">
137
-                #{taUserId,jdbcType=INTEGER},
121
+            <if test="uuid != null">
122
+                #{uuid,jdbcType=INTEGER},
123
+            </if>
124
+            <if test="uuidType != null">
125
+                #{uuidType,jdbcType=INTEGER},
126
+            </if>
127
+            <if test="uuidName != null">
128
+                #{uuidName,jdbcType=INTEGER},
138 129
             </if>
139 130
             <if test="transactionTitle != null">
140 131
                 #{transactionTitle,jdbcType=VARCHAR},
@@ -169,9 +160,6 @@
169 160
             <if test="updateDate != null">
170 161
                 #{updateDate,jdbcType=TIMESTAMP},
171 162
             </if>
172
-            <if test="taUserVerifyId != null">
173
-                #{taUserVerifyId,jdbcType=INTEGER},
174
-            </if>
175 163
             <if test="releaseIdentity != null">
176 164
                 #{releaseIdentity,jdbcType=VARCHAR},
177 165
             </if>
@@ -186,9 +174,6 @@
186 174
             <if test="communityId != null">
187 175
                 community_id = #{communityId,jdbcType=INTEGER},
188 176
             </if>
189
-            <if test="taUserId != null">
190
-                ta_user_id = #{taUserId,jdbcType=INTEGER},
191
-            </if>
192 177
             <if test="transactionTitle != null">
193 178
                 transaction_title = #{transactionTitle,jdbcType=VARCHAR},
194 179
             </if>
@@ -267,36 +252,19 @@
267 252
         <include refid="Base_Column_List"/>
268 253
         FROM
269 254
         tp_transaction t
270
-        WHERE t.create_user=#{id,jdbcType=INTEGER}
271
-        AND t.community_id=#{communityId,jdbcType=INTEGER}
272
-        UNION ALL
273
-        SELECT
274
-        <include refid="Base_Column_List"/>
275
-        FROM
276
-        tp_transaction t
277
-        INNER JOIN(SELECT
278
-        y.transaction_id
279
-        FROM
280
-        tp_transaction_reply y
281
-        LEFT JOIN tp_transaction t ON y.transaction_id = t.id
282 255
         WHERE
283
-        y.ta_user_id = #{id,jdbcType=INTEGER}
256
+          t.community_id=#{communityId,jdbcType=INTEGER}
257
+        AND t.uuid = #{id} and t.uuid_type = 'app'
284 258
         <if test="type != null and type != ''">
285 259
             and t.type = #{type,jdbcType=INTEGER}
286 260
         </if>
287
-        AND y.community_id = #{communityId,jdbcType=INTEGER}
288
-        AND t.status = 1
289
-        AND y.transaction_id NOT IN ( SELECT t.id FROM tp_transaction t WHERE t.create_user = #{id,jdbcType=INTEGER} AND
290
-        t.community_id = #{communityId,jdbcType=INTEGER} )
291
-        GROUP BY
292
-        y.transaction_id) a ON a.transaction_id = t.id
293 261
         order by create_date DESC
294 262
     </select>
295 263
 
296 264
     <update id="updateTransaction" parameterType="com.community.huiju.model.TpTransaction">
297 265
     update tp_transaction
298 266
     set
299
-    ta_user_id = #{userId,jdbcType=INTEGER},
267
+    uuid = #{userId,jdbcType=INTEGER},
300 268
     transaction_title = #{transactionTitle,jdbcType=VARCHAR},
301 269
     transaction_content = #{transactionContent,jdbcType=VARCHAR},
302 270
     update_user = #{userId,jdbcType=INTEGER},

+ 21
- 17
CODE/smart-community/app-api/src/main/resources/mapper/TpTransactionReplyMapper.xml Wyświetl plik

@@ -4,15 +4,16 @@
4 4
   <resultMap id="BaseResultMap" type="com.community.huiju.model.TpTransactionReply" >
5 5
     <id column="id" property="id" jdbcType="INTEGER" />
6 6
     <result column="community_id" property="communityId" jdbcType="INTEGER" />
7
+    <result column="uuid" property="uuid" jdbcType="INTEGER" />
8
+    <result column="uuid_type" property="uuidType" jdbcType="VARCHAR" />
9
+    <result column="uuid_name" property="uuidName" jdbcType="VARCHAR" />
10
+    <result column="reply_uuid" property="replyUuid" jdbcType="INTEGER" />
11
+    <result column="reply_uuid_type" property="replyUuidType" jdbcType="VARCHAR" />
12
+    <result column="reply_uuid_name" property="replyUuidName" jdbcType="VARCHAR" />
7 13
     <result column="transaction_id" property="transactionId" jdbcType="INTEGER" />
8
-    <result column="ta_user_id" property="taUserId" jdbcType="INTEGER" />
9
-    <result column="ta_user_name" property="taUserName" jdbcType="VARCHAR" />
10 14
     <result column="reply_content" property="replyContent" jdbcType="VARCHAR" />
11
-    <result column="reply_ta_user_id" property="replyTaUserId" jdbcType="INTEGER" />
12
-    <result column="reply_ta_user_name" property="replyTaUserName" jdbcType="VARCHAR" />
13 15
     <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
14 16
     <result column="release_identity" property="releaseIdentity" jdbcType="VARCHAR" />
15
-    <result column="ta_user_verify_id" property="taUserVerifyId" jdbcType="INTEGER" />
16 17
     <result column="room_no_name" property="roomNoName" jdbcType="INTEGER" />
17 18
   </resultMap>
18 19
   <sql id="Base_Column_List" >
@@ -30,13 +31,13 @@
30 31
     where id = #{id,jdbcType=INTEGER}
31 32
   </delete>
32 33
   <insert id="insert" parameterType="com.community.huiju.model.TpTransactionReply" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
33
-    insert into tp_transaction_reply (id, community_id, transaction_id,ta_user_verify_id,release_identity,
34
-      ta_user_id, ta_user_name, reply_content, 
35
-      reply_ta_user_id, reply_ta_user_name, create_date,room_no_name
34
+    insert into tp_transaction_reply (id, community_id, transaction_id,uuid,uuid_type,
35
+      uuid_name, reply_content,
36
+      reply_uuid, reply_uuid_type,reply_uuid_name, create_date,release_identity
36 37
       )
37
-    values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{transactionId,jdbcType=INTEGER},#{taUserVerifyId},#{releaseIdentity},
38
-      #{taUserId,jdbcType=INTEGER}, #{taUserName,jdbcType=VARCHAR}, #{replyContent,jdbcType=VARCHAR},
39
-      #{replyTaUserId,jdbcType=INTEGER}, #{replyTaUserName,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP},#{roomNoName,jdbcType=VARCHAR}
38
+    values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{transactionId,jdbcType=INTEGER},#{uuid},#{uuidType},
39
+      #{uuidName,jdbcType=VARCHAR}, #{replyContent,jdbcType=VARCHAR}, #{replyUuid,jdbcType=INTEGER},
40
+      #{replyUuidType,jdbcType=VARCHAR}, #{replyUuidName,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP},#{releaseIdentity,jdbcType=VARCHAR}
40 41
       )
41 42
   </insert>
42 43
   <insert id="insertSelective" parameterType="com.community.huiju.model.TpTransactionReply" >
@@ -163,21 +164,24 @@
163 164
   </update>
164 165
   <select id="getCommunityIdAndTransactionId" resultMap="BaseResultMap">
165 166
     SELECT
166
-	tr.*, (SELECT r.description FROM ta_sys_role r  where r.id = tr.ta_user_verify_id) AS taRoleName,
167
-	      (SELECT tsr.role_name FROM ta_sys_user_role tsur LEFT JOIN ta_sys_role tsr ON tsur.role_id = tsr.id WHERE tsur.user_id = tr.reply_ta_user_id) AS replyRoleName
167
+      *
168 168
     FROM
169
-        tp_transaction_reply tr
169
+    tp_transaction_reply  tr
170 170
     WHERE
171 171
 	tr.community_id = #{communityId}
172 172
     and tr.transaction_id=#{transactionId}
173 173
       <if test="type == 2" >
174
-        AND release_identity=1
174
+        AND tr.uuid_type = "prop"
175 175
       </if>
176 176
       <if test="type == 1" >
177
-        AND  tr.ta_user_id = #{founderUserID}
177
+        AND (tr.uuid = #{uuid} OR tr.reply_uuid = #{uuid})
178
+        AND tr.uuid_type =  #{uuidType}
179
+        AND tr.reply_uuid_type =  #{uuidType}
178 180
       </if>
179 181
       <if test="type == 0" >
180
-        AND (tr.ta_user_id = #{founderUserID} OR tr.reply_ta_user_id = #{founderUserID})
182
+        AND (tr.uuid = #{userID} OR tr.reply_uuid = #{userID})
183
+        AND tr.uuid_type = 'app'
184
+        AND tr.reply_uuid_type = 'app'
181 185
       </if>
182 186
    </select>
183 187
    <select id="selectUserTransactionReply" resultMap="BaseResultMap">

+ 13
- 13
CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/impl/CommunityServiceImpl.java Wyświetl plik

@@ -74,18 +74,18 @@ public class CommunityServiceImpl implements CommunityServiceI {
74 74
 		}
75 75
 
76 76
 
77
-		Map<String,Object> map = Maps.newHashMap();
78
-		map.put("loginName", toCommunities.getLoginName());
79
-		TaUser taUser = taUserMapper.selectByLoginName(map);
80
-		if (null == taUser) {
81
-			//时维护ta_user(发帖需要)
82
-			taUser= new TaUser();
83
-			taUser.setLoginName(toCommunities.getLoginName());
84
-			taUser.setCreateDate(new Date());
85
-			taUser.setUserName(toCommunities.getUserName());
86
-			taUser.setStatus("1");
87
-			taUserMapper.insert(taUser);
88
-		}
77
+		//Map<String,Object> map = Maps.newHashMap();
78
+		//map.put("loginName", toCommunities.getLoginName());
79
+		//TaUser taUser = taUserMapper.selectByLoginName(map);
80
+		//if (null == taUser) {
81
+		//	//时维护ta_user(发帖需要)
82
+		//	taUser= new TaUser();
83
+		//	taUser.setLoginName(toCommunities.getLoginName());
84
+		//	taUser.setCreateDate(new Date());
85
+		//	taUser.setUserName(toCommunities.getUserName());
86
+		//	taUser.setStatus("1");
87
+		//	taUserMapper.insert(taUser);
88
+		//}
89 89
 
90 90
 
91 91
 
@@ -99,7 +99,7 @@ public class CommunityServiceImpl implements CommunityServiceI {
99 99
 		tpUser.setCreateUser(1);
100 100
 		tpUser.setCommunityId(toCommunities.getId());
101 101
 		tpUser.setStatus(Constant.EFFECTIVE);
102
-		tpUser.setTaUserId(taUser.getId());
102
+		//tpUser.setTaUserId(taUser.getId());
103 103
 		//插入用户信息
104 104
 		tpUserMapper.insertSelective(tpUser);
105 105
 		//维护此用户的角色

+ 2
- 2
CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/TransactionController.java Wyświetl plik

@@ -88,7 +88,7 @@ public class TransactionController extends BaseController {
88 88
 	@RequestMapping(value="/transactions/add",method = RequestMethod.POST)
89 89
 	public ResponseBean transactionsAdd(@RequestBody String paramets, HttpSession session){
90 90
 		UserElement userElement = getUserElement(session);
91
-		ResponseBean  addAnnouncement= transactionService.transactionsAdd(paramets,userElement.getCommunityId(),userElement.getId());
91
+		ResponseBean  addAnnouncement= transactionService.transactionsAdd(paramets,userElement);
92 92
 		return addAnnouncement;
93 93
 	}
94 94
 
@@ -122,7 +122,7 @@ public class TransactionController extends BaseController {
122 122
 	@RequestMapping(value="/transactionReplyList",method = RequestMethod.POST)
123 123
 	public ResponseBean transactionReplyList(@RequestBody String paramets, HttpSession session){
124 124
 		UserElement userElement = getUserElement(session);
125
-		ResponseBean  transactionReplyList= transactionService.transactionReplyList(paramets,userElement.getCommunityId(),userElement.getId());
125
+		ResponseBean  transactionReplyList= transactionService.transactionReplyList(paramets,userElement);
126 126
 		return transactionReplyList;
127 127
 	}
128 128
 

+ 1
- 1
CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TransactionReplyMapper.java Wyświetl plik

@@ -24,5 +24,5 @@ public interface TransactionReplyMapper extends BaseMapper<TransactionReply> {
24 24
      * @param id
25 25
      * @return
26 26
      */
27
-    List<TransactionReply> transactionReplyList(Page page, @Param("id") Integer id, @Param("taUserId") Integer taUserId, @Param("status") Integer status,@Param("taUserName") String taUserName, @Param("createDate") Date createDate, @Param("replyTaUserName") String replyTaUserName);
27
+    List<TransactionReply> transactionReplyList(Page page, @Param("id") Integer id, @Param("uuid") Integer uuid,@Param("uuidType") String uuidType,@Param("userId") Integer userId, @Param("status") Integer status,@Param("taUserName") String taUserName, @Param("createDate") Date createDate, @Param("replyTaUserName") String replyTaUserName);
28 28
 }

+ 13
- 9
CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TpTransaction.java Wyświetl plik

@@ -31,11 +31,21 @@ public class TpTransaction implements Serializable {
31 31
      * 小区id
32 32
      */
33 33
     private Integer communityId;
34
-
34
+    
35 35
     /**
36
-     * 住户app的用户id
36
+     * 身份ID 根据uuid_type区分是物业端TP_USER_ID还是TA_USER_VERIFY_ID
37 37
      */
38
-    private Integer taUserId;
38
+    private Integer uuid;
39
+    
40
+    /**
41
+     * app/prop
42
+     */
43
+    private String uuidType;
44
+    
45
+    /**
46
+     * 话题发布人
47
+     */
48
+    private String uuidName;
39 49
 
40 50
     /**
41 51
      * 交易标题
@@ -86,12 +96,6 @@ public class TpTransaction implements Serializable {
86 96
      * 更新时间
87 97
      */
88 98
     private LocalDateTime updateDate;
89
-    
90
-    /**
91
-     * 创建人
92
-     */
93
-    @TableField(exist = false)
94
-    private String userName;
95 99
 
96 100
     /**
97 101
      * 喜欢的总数

+ 38
- 18
CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TransactionReply.java Wyświetl plik

@@ -34,42 +34,62 @@ public class TransactionReply implements Serializable {
34 34
      * 小区id
35 35
      */
36 36
     private Integer communityId;
37
-
37
+    
38 38
     /**
39 39
      * 交易帖子ID
40 40
      */
41 41
     private Integer transactionId;
42
-
42
+    
43 43
     /**
44
-     * 回复帖子的住户APP端的用户ID
44
+     * 回复帖子的ID,根据uuid_type区分物业端app端
45 45
      */
46
-    private Integer taUserId;
47
-
46
+    private Integer uuid;
47
+    
48 48
     /**
49
-     * 回复帖子的住户APP端的用户姓名
49
+     * app/prop
50 50
      */
51
-    private String taUserName;
52
-
51
+    private String uuidType;
52
+    
53 53
     /**
54
-     * 0代表app端用户,1代表物业端用户,
54
+     * 回复帖子的姓名
55 55
      */
56
-    private String releaseIdentity;
57
-
56
+    private String uuidName;
57
+    
58
+    /**
59
+     * 回复帖子的角色
60
+     */
61
+    private String uuidRole;
62
+    
58 63
     /**
59 64
      * 回复内容
60 65
      */
61 66
     private String replyContent;
62
-
67
+    
63 68
     /**
64
-     * 被回复的评论内容的住户App端用户ID
69
+     * 被回复的评论内容的用户ID根据uuidtype区分
65 70
      */
66
-    private Integer replyTaUserId;
67
-
71
+    private Integer replyUuid;
72
+    
68 73
     /**
69
-     * 被回复的评论内容的住户App端用户姓名
74
+     * app/prop
70 75
      */
71
-    private String replyTaUserName;
72
-
76
+    private String replyUuidType;
77
+    
78
+    /**
79
+     * 被回复的评论内容的姓名
80
+     */
81
+    private String replyUuidName;
82
+    
83
+    /**
84
+     * 被回复的评论人的角色
85
+     */
86
+    private String replyUuidRole;
87
+    
88
+    /**
89
+     * 发布者身份
90
+     */
91
+    private String releaseIdentity;
92
+    
73 93
     /**
74 94
      * 创建时间
75 95
      */

+ 4
- 6
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/ITransactionService.java Wyświetl plik

@@ -34,11 +34,10 @@ public interface ITransactionService extends IService<TpTransaction> {
34 34
 	/**
35 35
 	 * 添加二手话题
36 36
 	 * @param paramets
37
-	 * @param communityId
38
-	 * @param id
37
+	 * @param userElement
39 38
 	 * @return
40 39
 	 */
41
-    ResponseBean transactionsAdd(String paramets, Integer communityId, Integer id);
40
+    ResponseBean transactionsAdd(String paramets, UserElement userElement);
42 41
 
43 42
 	/**
44 43
 	 * 修改二手交易
@@ -61,11 +60,10 @@ public interface ITransactionService extends IService<TpTransaction> {
61 60
 	/**
62 61
 	 * 二手帖子评论列表
63 62
 	 * @param paramets
64
-	 * @param communityId
65
-	 * @param id
63
+	 * @param userElement
66 64
 	 * @return
67 65
 	 */
68
-	ResponseBean transactionReplyList(String paramets, Integer communityId, Integer id);
66
+	ResponseBean transactionReplyList(String paramets, UserElement userElement);
69 67
 
70 68
 	/**
71 69
 	 * 删除二手帖子评论

+ 25
- 20
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TransactionServiceImpl.java Wyświetl plik

@@ -151,17 +151,20 @@ public class TransactionServiceImpl extends ServiceImpl<TpTransactionMapper, TpT
151 151
 	}
152 152
 
153 153
 	@Override
154
-	public ResponseBean transactionsAdd(String paramets, Integer communityId, Integer id) {
154
+	public ResponseBean transactionsAdd(String paramets, UserElement userElement) {
155
+		Integer communityId = userElement.getCommunityId();
156
+		Integer id = userElement.getId();
155 157
 		ResponseBean response = new ResponseBean();
156 158
 
157 159
 		JSONObject jsonobject = JSONObject.parseObject(paramets);
158 160
 
159 161
 		TpTransaction tpTransaction = JSONObject.parseObject(paramets, TpTransaction.class);
160 162
 		tpTransaction.setCommunityId(communityId);
161
-		tpTransaction.setTaUserId(userMapper.selectById(id).getTaUserId());
163
+		tpTransaction.setUuid(id);
164
+		tpTransaction.setUuidType("prop");
165
+		tpTransaction.setUuidName(userElement.getUserName());
162 166
 		tpTransaction.setCreateDate(LocalDateTime.now());
163
-		// 必须与ta_user表的id数据同步。
164
-		tpTransaction.setCreateUser(userMapper.selectById(id).getTaUserId());
167
+		tpTransaction.setCreateUser(id);
165 168
 		tpTransaction.setViewCount(0);
166 169
 		tpTransaction.setIsReported("0");
167 170
 		tpTransaction.setReleaseIdentity("1");
@@ -198,10 +201,8 @@ public class TransactionServiceImpl extends ServiceImpl<TpTransactionMapper, TpT
198 201
 
199 202
 		TpTransaction tpTransaction = JSONObject.parseObject(paramets, TpTransaction.class);
200 203
 		tpTransaction.setCommunityId(communityId);
201
-		tpTransaction.setTaUserId(userMapper.selectById(id).getTaUserId());
202 204
 		tpTransaction.setUpdateDate(LocalDateTime.now());
203
-		// 必须与ta_user表的id数据同步。
204
-		tpTransaction.setUpdateUser(userMapper.selectById(id).getTaUserId());
205
+		tpTransaction.setUpdateUser(id);
205 206
 		tpTransactionMapper.updateById(tpTransaction);
206 207
 		JSONArray contentImg = jsonobject.getJSONArray("contentImg");
207 208
 
@@ -259,7 +260,9 @@ public class TransactionServiceImpl extends ServiceImpl<TpTransactionMapper, TpT
259 260
 	}
260 261
 
261 262
 	@Override
262
-	public ResponseBean transactionReplyList(String paramets, Integer communityId, Integer userID) {
263
+	public ResponseBean transactionReplyList(String paramets, UserElement userElement) {
264
+		Integer communityId = userElement.getCommunityId();
265
+		Integer userID = userElement.getId();
263 266
 		ResponseBean responseBean = new ResponseBean();
264 267
 		JSONObject object= JSONObject.parseObject(paramets);
265 268
 		Integer transactionId = object.getInteger("id");
@@ -276,9 +279,9 @@ public class TransactionServiceImpl extends ServiceImpl<TpTransactionMapper, TpT
276 279
 		page.setSize(pageSize == null ? 10 : pageSize);
277 280
 		page.setCurrent(pageNum == null ? 1 : pageNum);
278 281
 		// 获得aap的id
279
-		Integer taUserId= userMapper.selectById(userID).getTaUserId();
282
+		TpTransaction tpTransaction = tpTransactionMapper.selectById(transactionId);
280 283
 		// 分页查询
281
-		List<TransactionReply> TransactionReplylList = transactionReplyMapper.transactionReplyList(page,transactionId,taUserId,status,taUserName,createDate,replyTaUserName);
284
+		List<TransactionReply> TransactionReplylList = transactionReplyMapper.transactionReplyList(page,transactionId,tpTransaction.getUuid(),tpTransaction.getUuidType(),userID,status,taUserName,createDate,replyTaUserName);
282 285
 		//查询帖子评论所带图片
283 286
 
284 287
 		for (TransactionReply transactionReply:TransactionReplylList){
@@ -338,23 +341,25 @@ public class TransactionServiceImpl extends ServiceImpl<TpTransactionMapper, TpT
338 341
 		if (Type==1) {
339 342
 			transactionReply.setCommunityId(userElement.getCommunityId())
340 343
 					.setTransactionId(id)
341
-					.setTaUserId(user.getTaUserId())
342
-					.setTaUserName(userElement.getUserName())
344
+					.setUuid(userElement.getId())
345
+					.setUuidType("prop")
346
+					.setUuidName(userElement.getUserName())
343 347
 					.setReplyContent(replyContent)
344
-					.setReplyTaUserId(tpTransaction.getCreateUser())
345
-					.setReleaseIdentity("1")
346
-					.setReplyTaUserName(taUserMapper.selectById(tpTransaction.getTaUserId()).getUserName())
348
+					.setReplyUuid(tpTransaction.getUuid())
349
+					.setReplyUuidType(tpTransaction.getUuidType())
350
+					.setReplyUuidName(tpTransaction.getUuidName())
347 351
 					.setCreateDate(LocalDateTime.now());
348 352
 		}
349 353
 		if (Type!=1) {
350 354
 			transactionReply.setCommunityId(userElement.getCommunityId())
351 355
 					.setTransactionId(Reply.getTransactionId())
352
-					.setTaUserId(userElement.getId())
353
-					.setTaUserName(userElement.getUserName())
356
+					.setUuid(userElement.getId())
357
+					.setUuidType("prop")
358
+					.setUuidName(userElement.getUserName())
354 359
 					.setReplyContent(replyContent)
355
-					.setReplyTaUserId(Reply.getTaUserId())
356
-					.setReleaseIdentity("1")
357
-					.setReplyTaUserName(Reply.getTaUserName())
360
+					.setReplyUuid(Reply.getUuid())
361
+					.setReplyUuidType("prop")
362
+					.setReplyUuidName(Reply.getReplyUuidName())
358 363
 					.setCreateDate(LocalDateTime.now());
359 364
 		}
360 365
 		transactionReplyMapper.insert(transactionReply);

+ 6
- 7
CODE/smart-community/property-api/src/main/resources/mapper/TpTransactionMapper.xml Wyświetl plik

@@ -12,14 +12,13 @@
12 12
         t.create_user,
13 13
         t.is_reported AS isReported,
14 14
         t.create_date AS createDate,
15
-        ta.user_name AS userName,
16
-        COUNT(li.transaction_id) AS  transactionLikeSum,
17
-        COUNT(re.transaction_id) AS replySum
15
+        t.uuid_name AS uuidName,
16
+        COUNT( li.transaction_id ) AS transactionLikeSum,
17
+        COUNT( re.transaction_id ) AS replySum
18 18
         FROM
19 19
         tp_transaction t
20
-        LEFT JOIN ta_user ta ON  t.ta_user_id = ta.id
21
-        LEFT JOIN ta_visitor v ON ta.id = v.ta_user_id
22
-        LEFT JOIN tp_transaction_like li ON t.id = li.transaction_id AND li.like_status=1
20
+        LEFT JOIN tp_transaction_like li ON t.id = li.transaction_id
21
+        AND li.like_status = 1
23 22
         LEFT JOIN tp_transaction_reply re ON t.id = re.transaction_id
24 23
         WHERE t.community_id =#{communityId}
25 24
         <if test="id != null and id != '' or id ==0">
@@ -32,7 +31,7 @@
32 31
             and t.type = #{status,jdbcType=VARCHAR}
33 32
         </if>
34 33
         <if test="userName != null and userName != ''">
35
-            and ta.user_name like concat('%',#{userName,jdbcType=VARCHAR},'%')
34
+            and t.uuid_name like concat('%',#{userName,jdbcType=VARCHAR},'%')
36 35
         </if>
37 36
         GROUP BY
38 37
         t.id

+ 18
- 27
CODE/smart-community/property-api/src/main/resources/mapper/TransactionReplyMapper.xml Wyświetl plik

@@ -6,44 +6,35 @@
6 6
         re.id,
7 7
         re.community_id,
8 8
         re.transaction_id,
9
-        re.ta_user_id,
10
-        re.ta_user_name,
9
+        re.uuid_name,
11 10
         re.reply_content,
12
-        re.reply_ta_user_id,
13
-        re.reply_ta_user_name,
11
+        re.reply_uuid_name,
14 12
         re.create_date
15 13
     FROM
16
-        tp_transaction tr
17
-    LEFT JOIN tp_transaction_reply re ON tr.id = re.transaction_id
18
-    <if test="status == 1 ">
19
-    LEFT JOIN tp_user u ON re.reply_ta_user_id = u.ta_user_id
20
-    </if>
14
+        tp_transaction_reply re
21 15
     WHERE
22
-        tr.id = #{id}
23
-    <if test="status == 1 ">
24
-     AND  re.reply_ta_user_id = u.ta_user_id
16
+        re.transaction_id = #{id}
17
+    <if test="taUserName != null and taUserName !=''">
18
+        and re.uuid_name like concat('%',#{ taUserName,jdbcType=VARCHAR},'%')
25 19
     </if>
26
-    <if test="status == 0 ">
27
-    AND re.reply_ta_user_id = #{taUserId,jdbcType=INTEGER}
20
+    <if test="replyTaUserName != null and replyTaUserName !=''">
21
+        and re.reply_uuid_name like concat('%',#{ replyTaUserName,jdbcType=VARCHAR},'%')
28 22
     </if>
29
-    <if test="status == 2 ">
30
-    AND re.release_identity = 1
23
+    <if test="createDate != null">
24
+        and  date_format(re.create_date,'%Y%m%d')=date_format(#{createDate},'%Y%m%d')
31 25
     </if>
32
-
33
-    <if test="status == 3 ">
34
-    AND re.ta_user_id = #{taUserId,jdbcType=INTEGER}
26
+    <if test="status == 0 ">
27
+        AND re.reply_uuid = #{userId,jdbcType=INTEGER} and re.reply_uuid_type = "prop"
35 28
     </if>
36
-
37
-    <if test="taUserName != null and taUserName !=''">
38
-        and re.ta_user_name like concat('%',#{ taUserName,jdbcType=VARCHAR},'%')
29
+    <if test="status == 1 ">
30
+        AND  re.reply_uuid_type = "prop"
39 31
     </if>
40
-
41
-    <if test="replyTaUserName != null and replyTaUserName !=''">
42
-        and re.reply_ta_user_name like concat('%',#{ replyTaUserName,jdbcType=VARCHAR},'%')
32
+    <if test="status == 2 ">
33
+        AND re.uuid_type = "prop"
43 34
     </if>
44 35
 
45
-    <if test="createDate != null">
46
-        and  date_format(re.create_date,'%Y%m%d')=date_format(#{createDate},'%Y%m%d')
36
+    <if test="status == 3 ">
37
+        AND re.uuid = #{uuid,jdbcType=INTEGER} and re.uuid_type = #{uuidType,jdbcType=INTEGER}
47 38
     </if>
48 39
     order by re.create_date desc
49 40
     </select>

+ 5
- 2
VUECODE/smart-property-manage/src/views/social/transaction/index.vue Wyświetl plik

@@ -54,9 +54,12 @@
54 54
       <template slot-scope="scope"><a><span style="color: #63B8FF" @click="clickTitle(scope.row.id)">{{ scope.row.transactionTitle }}</span></a></template>
55 55
       </el-table-column>
56 56
       <el-table-column prop="status" label="是否作废" align="center">
57
-      <template slot-scope="scope">{{ scope.row.status=='0'?'已作废':'' }}</template>
57
+      <template slot-scope="scope">
58
+          <span v-if="scope.row.status =='0'">已作废</span>
59
+          <span v-if="scope.row.status =='1'">已发布</span>
60
+      </template>
58 61
       </el-table-column>
59
-      <el-table-column prop="userName" label="发布人" align="center"/>
62
+      <el-table-column prop="uuidName" label="发布人" align="center"/>
60 63
       <el-table-column prop="createDate" label="发布时间" align="center"><template slot-scope="scope">{{ formatDate(scope.row.createDate) }}</template></el-table-column>
61 64
 
62 65
       <el-table-column prop="viewCount" label="查看人数" align="center"/>

+ 2
- 2
VUECODE/smart-property-manage/src/views/social/transaction/reply/transactionreply.vue Wyświetl plik

@@ -46,14 +46,14 @@
46 46
       <el-table-column
47 47
         type="selection"
48 48
         width="55"/>
49
-      <el-table-column prop="taUserName" label="回复人" align="center"/>
49
+      <el-table-column prop="uuidName" label="回复人" align="center"/>
50 50
        <el-table-column prop="replyContent" label="回复内容" align="center"/>
51 51
       <el-table-column prop="transactionTitle" label="回复配图" align="center">
52 52
            <template slot-scope="scope">
53 53
              <img v-for="sr in scope.row.tdImagesLists" :src="sr" preview  width="50" height="50">
54 54
            </template>
55 55
       </el-table-column>
56
-      <el-table-column prop="replyTaUserName" label="被回复人" align="center"/>
56
+      <el-table-column prop="replyUuidName" label="被回复人" align="center"/>
57 57
       <el-table-column prop="createDate" label="时间" align="center"><template slot-scope="scope">{{ formatDate(scope.row.createDate) }}</template></el-table-column>
58 58
       <el-table-column prop="viewCount" label="操作" align="center">
59 59
       <template slot-scope="scope"><a><span style="color: #63B8FF" @click="TransactionReplyOpen(scope.row.id)">{{ '回复此回复' }}</span></a></template>

+ 948
- 876
文档/MYSQL/smartCommunity.pdb
Plik diff jest za duży
Wyświetl plik


+ 948
- 876
文档/MYSQL/smartCommunity.pdm
Plik diff jest za duży
Wyświetl plik