瀏覽代碼

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

魏熙美 6 年之前
父節點
當前提交
ed45f3ef08

+ 6
- 20
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java 查看文件

@@ -206,8 +206,11 @@ public class SocialServiceImpl implements SocialServiceI {
206 206
             activity.setViewCount(allViewNum);
207 207
             tpActivityMapper.updateByPrimaryKeySelective(activity);
208 208
         }
209
-
210
-        TpActivity tpActivity = tpActivityMapper.selectByPrimaryKey(activityId, communityId);
209
+        TpActivity  tpActivity=new TpActivity();
210
+         tpActivity = tpActivityMapper.selectByPrimaryKey(activityId, communityId);
211
+        if(null == tpActivity){
212
+            tpActivity = tpActivityMapper.selectActivity(activityId);
213
+        }
211 214
         TpUser tpUser = tpUserMapper.selectByPrimaryKey(tpActivity.getCreateUser());
212 215
         if (null != tpUser) {
213 216
             tpActivity.setUserName(tpUser.getUserName());
@@ -623,7 +626,7 @@ public class SocialServiceImpl implements SocialServiceI {
623 626
         ResponseBean responseBean = new ResponseBean();
624 627
         Map<String, Object> parameter = Maps.newHashMap();
625 628
         Page<TpActivity> pageList = PageHelper.startPage(pageNum, paeSize);
626
-        List<TpActivity> tpActivity = tpActivityMapper.selecttpActivity(userElement.getId(), userElement.getCommunityId());
629
+        List<TpActivity> tpActivity = tpActivityMapper.selecttpActivity(userElement.getUserVerifyId(), userElement.getCommunityId());
627 630
         parameter.put("list", tpActivity);
628 631
         parameter.put("total", pageList.getTotal());
629 632
         responseBean.addSuccess(parameter);
@@ -864,15 +867,6 @@ public class SocialServiceImpl implements SocialServiceI {
864 867
         }
865 868
 
866 869
         TpTransaction tpTransaction = tpTransactionMapper.selectByPrimaryKey(activityId, communityId);
867
-        if (tpTransaction.getUuidType().equals("app")) {
868
-            TaSysRole taSysRole = taSysRoleMapper.selectByPrimaryKey(taUserVerifyMapper.selectByPrimaryKey(tpTransaction.getUuid()).getRoleId());
869
-            tpTransaction.setRoleId(taSysRole.getId());
870
-            tpTransaction.setRoleName(taSysRole.getRoleName());
871
-        }
872
-        if (tpTransaction.getUuidType().equals("prop")) {
873
-            tpTransaction.setRoleName("物业");
874
-        }
875
-        tpTransaction.setCreateUserName(tpTransaction.getUuidName());
876 870
 
877 871
         Map<String, Object> map = Maps.newHashMap();
878 872
         map.put("uuid", tpTransaction.getId());
@@ -948,14 +942,6 @@ public class SocialServiceImpl implements SocialServiceI {
948 942
         TaUserVerify taUserVerify= taUserVerifyMapper.selectByPrimaryKey(userElement.getUserVerifyId());
949 943
         List<TpTransactionReply> replies = tpTransactionReplyMapper.getCommunityIdAndTransactionId(userElement.getCommunityId(), transactionId, userElement.getUserVerifyId(), tpTransaction.getUuid(),tpTransaction.getUuidType(),type);
950 944
         for (TpTransactionReply tpTransactionReply : replies) {
951
-            if (tpTransactionReply.getUuidType().equals("app")) {
952
-                TaSysRole taSysRole = taSysRoleMapper.selectByPrimaryKey(taUserVerifyMapper.selectByPrimaryKey(tpTransactionReply.getUuid()).getRoleId());
953
-                tpTransactionReply.setRoleName(taSysRole.getDescription());
954
-            }
955
-            if (tpTransactionReply.getUuidType().equals("prop")) {
956
-                tpTransactionReply.setRoleName("物业");
957
-            }
958
-            tpTransactionReply.setCreateUserName(tpTransactionReply.getUuidName());
959 945
             List<TdImages> tdImagesList = tdImagesMapper.selectImages(tpTransactionReply.getId(), "reply");
960 946
             List<String> list = new ArrayList<>();
961 947
             for (TdImages imageUrl : tdImagesList) {

+ 20
- 4
CODE/smart-community/app-api/src/main/resources/mapper/TpTransactionMapper.xml 查看文件

@@ -292,12 +292,28 @@
292 292
   </insert>
293 293
     <select id="getUserTransactionList" resultMap="BaseResultMap">
294 294
         SELECT
295
-        <include refid="Base_Column_List"/>
295
+          <include refid="Base_Column_List"/>
296 296
         FROM
297
-        tp_transaction t
297
+          tp_transaction t
298 298
         WHERE
299
-        t.community_id=#{communityId,jdbcType=INTEGER}
299
+          t.community_id=#{communityId,jdbcType=INTEGER}
300 300
         AND t.uuid = #{id} and t.uuid_type = 'app'
301
-        order by create_date DESC
301
+        UNION
302
+        SELECT
303
+          <include refid="Base_Column_List"/>
304
+        FROM
305
+          tp_transaction
306
+        WHERE
307
+        id IN (
308
+        SELECT DISTINCT
309
+          t.transaction_id
310
+        FROM
311
+          tp_transaction_reply t
312
+        WHERE
313
+          t.community_id=#{communityId,jdbcType=INTEGER}
314
+        AND t.uuid = #{id} and t.uuid_type = 'app'
315
+        )
316
+        ORDER BY
317
+        create_date DESC
302 318
     </select>
303 319
 </mapper>

+ 5
- 3
CODE/smart-community/app-api/src/main/resources/mapper/TpTransactionReplyMapper.xml 查看文件

@@ -7,9 +7,11 @@
7 7
     <result column="uuid" property="uuid" jdbcType="INTEGER" />
8 8
     <result column="uuid_type" property="uuidType" jdbcType="VARCHAR" />
9 9
     <result column="uuid_name" property="uuidName" jdbcType="VARCHAR" />
10
+    <result column="uuid_role" property="uuidRole" jdbcType="VARCHAR" />
10 11
     <result column="reply_uuid" property="replyUuid" jdbcType="INTEGER" />
11 12
     <result column="reply_uuid_type" property="replyUuidType" jdbcType="VARCHAR" />
12 13
     <result column="reply_uuid_name" property="replyUuidName" jdbcType="VARCHAR" />
14
+    <result column="reply_uuid_role" property="replyUuidRole" jdbcType="VARCHAR" />
13 15
     <result column="transaction_id" property="transactionId" jdbcType="INTEGER" />
14 16
     <result column="reply_content" property="replyContent" jdbcType="VARCHAR" />
15 17
     <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
@@ -17,7 +19,7 @@
17 19
     <result column="room_no_name" property="roomNoName" jdbcType="INTEGER" />
18 20
   </resultMap>
19 21
   <sql id="Base_Column_List" >
20
-    id, community_id, transaction_id,uuid,uuid_type,
22
+    id, community_id, transaction_id,uuid,uuid_type,uuid_role,reply_uuid_role,
21 23
       uuid_name, reply_content,
22 24
       reply_uuid, reply_uuid_type,reply_uuid_name, create_date,release_identity
23 25
   </sql>
@@ -32,11 +34,11 @@
32 34
     where id = #{id,jdbcType=INTEGER}
33 35
   </delete>
34 36
   <insert id="insert" parameterType="com.community.huiju.model.TpTransactionReply" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
35
-    insert into tp_transaction_reply (id, community_id, transaction_id,uuid,uuid_type,
37
+    insert into tp_transaction_reply (id, community_id, transaction_id,uuid,uuid_type,uuid_role,reply_uuid_role,
36 38
       uuid_name, reply_content,
37 39
       reply_uuid, reply_uuid_type,reply_uuid_name, create_date,release_identity
38 40
       )
39
-    values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{transactionId,jdbcType=INTEGER},#{uuid},#{uuidType},
41
+    values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{transactionId,jdbcType=INTEGER},#{uuid},#{uuidType},#{uuidRole},#{replyUuidRole},
40 42
       #{uuidName,jdbcType=VARCHAR}, #{replyContent,jdbcType=VARCHAR}, #{replyUuid,jdbcType=INTEGER},
41 43
       #{replyUuidType,jdbcType=VARCHAR}, #{replyUuidName,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP},#{releaseIdentity,jdbcType=VARCHAR}
42 44
       )

+ 15
- 3
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TransactionServiceImpl.java 查看文件

@@ -54,6 +54,12 @@ public class TransactionServiceImpl extends ServiceImpl<TpTransactionMapper, TpT
54 54
 
55 55
 	@Autowired
56 56
 	private TaUserMapper taUserMapper;
57
+	
58
+	@Autowired
59
+	private TaUserVerifyMapper taUserVerifyMapper;
60
+	
61
+	@Autowired
62
+	private TaSysRoleMapper taSysRoleMapper;
57 63
 
58 64
 
59 65
 	@Override
@@ -334,10 +340,15 @@ public class TransactionServiceImpl extends ServiceImpl<TpTransactionMapper, TpT
334 340
 		TpTransaction tpTransaction= tpTransactionMapper.selectById(id);
335 341
 		
336 342
 		TransactionReply transactionReply= new TransactionReply();
337
-		// 查询回复的ta_userID
338
-		 User user= userMapper.selectById(userElement.getId());
343
+		
339 344
 		int Type=replyType.intValue();
340 345
 		if (Type==1) {
346
+			// 查询回复的角色信息
347
+			String replyRole = "物业";
348
+			if (tpTransaction.getUuidType().equals("app")){
349
+				TaUserVerify taUserVerify= taUserVerifyMapper.selectById(tpTransaction.getUuid());
350
+				replyRole = taSysRoleMapper.selectByPrimaryKey(taUserVerify.getRoleId()).getDescription();
351
+			}
341 352
 			transactionReply.setCommunityId(userElement.getCommunityId())
342 353
 					.setTransactionId(id)
343 354
 					.setUuid(userElement.getId())
@@ -348,6 +359,7 @@ public class TransactionServiceImpl extends ServiceImpl<TpTransactionMapper, TpT
348 359
 					.setReplyUuid(tpTransaction.getUuid())
349 360
 					.setReplyUuidType(tpTransaction.getUuidType())
350 361
 					.setReplyUuidName(tpTransaction.getUuidName())
362
+					.setReplyUuidRole(replyRole)
351 363
 					.setCreateDate(LocalDateTime.now());
352 364
 		}
353 365
 		if (Type!=1) {
@@ -363,7 +375,7 @@ public class TransactionServiceImpl extends ServiceImpl<TpTransactionMapper, TpT
363 375
 					.setReplyUuid(Reply.getUuid())
364 376
 					.setReplyUuidType("prop")
365 377
 					.setReplyUuidName(Reply.getUuidName())
366
-					.setUuidRole("物业")
378
+					.setReplyUuidRole("物业")
367 379
 					.setCreateDate(LocalDateTime.now());
368 380
 		}
369 381
 		transactionReplyMapper.insert(transactionReply);