dingxin 6 年 前
コミット
529dd87372

+ 4
- 3
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/VistorController.java ファイルの表示

@@ -73,12 +73,13 @@ public class VistorController extends BaseController {
73 73
 
74 74
     @ApiOperation(value = "查询是否开启了访客邀请的车辆", notes = "查询是否开启了访客邀请的车辆")
75 75
     @ApiImplicitParams({
76
-            @ApiImplicitParam(dataTypeClass = Integer.class, paramType = "query", name = "communityId", value = "小区Id")
76
+            @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token"),
77 77
     })
78 78
     @RequestMapping(value = "/invate_license/bool", method = RequestMethod.GET)
79
-    public ResponseBean invateBool(@RequestParam("communityId") Integer communityId) {
79
+    public ResponseBean invateBool(HttpSession session) {
80 80
         ResponseBean responseBean = new ResponseBean();
81
-        responseBean = vistorServiceI.invateBool(communityId);
81
+        UserElement userElement = getUserElement(session);
82
+        responseBean = vistorServiceI.invateBool(userElement);
82 83
         return responseBean;
83 84
     }
84 85
 

+ 2
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/TaVistorServiceI.java ファイルの表示

@@ -31,8 +31,8 @@ public interface TaVistorServiceI {
31 31
 
32 32
     /**
33 33
      * 查询 邀请访客车辆 是否开启
34
-     * @param communityId
34
+     * @param userElement
35 35
      * @return
36 36
      */
37
-    ResponseBean invateBool(Integer communityId);
37
+    ResponseBean invateBool(UserElement userElement);
38 38
 }

+ 4
- 18
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java ファイルの表示

@@ -568,11 +568,13 @@ public class SocialServiceImpl implements SocialServiceI {
568 568
         if (null != array) {
569 569
             reply = array.toArray(new String[]{});
570 570
         }
571
+        TaUserVerify taUserVerify= taUserVerifyMapper.selectByPrimaryKey(userElement.getUserVerifyId());
571 572
         TpTransactionReply tpTransactionReply = JSONObject.parseObject(paramets, TpTransactionReply.class);
572 573
         tpTransactionReply.setCommunityId(userElement.getCommunityId());
573 574
         tpTransactionReply.setUuid(userElement.getUserVerifyId());
574 575
         tpTransactionReply.setUuidType("app");
575 576
         tpTransactionReply.setUuidName(userElement.getUserName());
577
+        tpTransactionReply.setUuidRole(taSysRoleMapper.selectByPrimaryKey(taUserVerify.getRoleId()).getDescription());
576 578
 
577 579
             // 由于评论帖子和评论对话是同一个接口,当tpTransactionReply.getReplyTaUserId()为空时查询Ta_user里面的名字
578 580
         TpTransactionReply tpTransactionReplyBack = tpTransactionReplyMapper.selectByPrimaryKey(tpTransactionReply.getReplyId());
@@ -581,8 +583,9 @@ public class SocialServiceImpl implements SocialServiceI {
581 583
         tpTransactionReply.setReplyUuid(tpTransactionReplyBack.getUuid());
582 584
         tpTransactionReply.setReplyUuidType(tpTransactionReplyBack.getUuidType());
583 585
         tpTransactionReply.setReplyUuidName(tpTransactionReplyBack.getUuidName());
586
+        tpTransactionReply.setReplyUuidRole(tpTransactionReplyBack.getReplyUuidRole());
584 587
         tpTransactionReply.setReleaseIdentity("0");
585
-        TaUserVerify taUserVerify= taUserVerifyMapper.selectByPrimaryKey(userElement.getUserVerifyId());
588
+        
586 589
         tpTransactionReply.setCreateDate(new Date());
587 590
         tpTransactionReplyMapper.insert(tpTransactionReply);
588 591
 
@@ -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) {

+ 2
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaVistorServiceImpl.java ファイルの表示

@@ -145,9 +145,9 @@ public class TaVistorServiceImpl implements TaVistorServiceI {
145 145
 
146 146
 
147 147
     @Override
148
-    public ResponseBean invateBool(Integer communityId) {
148
+    public ResponseBean invateBool(UserElement userElement) {
149 149
         ResponseBean responseBean = new ResponseBean();
150
-        TaVisitorLicenseSetting taVisitorLicenseSetting = taVisitorLicenseSettingMapper.selectByCommunityId(communityId);
150
+        TaVisitorLicenseSetting taVisitorLicenseSetting = taVisitorLicenseSettingMapper.selectByCommunityId(userElement.getCommunityId());
151 151
         // true 表示启用了访客邀请的车辆, false 表示未启用访客邀请的车辆
152 152
         responseBean.addSuccess(null != taVisitorLicenseSetting ? true : false);
153 153
         return responseBean;

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

+ 17
- 2
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,19 +340,26 @@ 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())
344 355
 					.setUuidType("prop")
345 356
 					.setUuidName(userElement.getUserName())
357
+					.setUuidRole("物业")
346 358
 					.setReplyContent(replyContent)
347 359
 					.setReplyUuid(tpTransaction.getUuid())
348 360
 					.setReplyUuidType(tpTransaction.getUuidType())
349 361
 					.setReplyUuidName(tpTransaction.getUuidName())
362
+					.setReplyUuidRole(replyRole)
350 363
 					.setCreateDate(LocalDateTime.now());
351 364
 		}
352 365
 		if (Type!=1) {
@@ -357,10 +370,12 @@ public class TransactionServiceImpl extends ServiceImpl<TpTransactionMapper, TpT
357 370
 					.setUuid(userElement.getId())
358 371
 					.setUuidType("prop")
359 372
 					.setUuidName(userElement.getUserName())
373
+					.setUuidRole("物业")
360 374
 					.setReplyContent(replyContent)
361 375
 					.setReplyUuid(Reply.getUuid())
362 376
 					.setReplyUuidType("prop")
363 377
 					.setReplyUuidName(Reply.getUuidName())
378
+					.setReplyUuidRole("物业")
364 379
 					.setCreateDate(LocalDateTime.now());
365 380
 		}
366 381
 		transactionReplyMapper.insert(transactionReply);