dingxin 6 years ago
parent
commit
529dd87372

+ 4
- 3
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/VistorController.java View File

73
 
73
 
74
     @ApiOperation(value = "查询是否开启了访客邀请的车辆", notes = "查询是否开启了访客邀请的车辆")
74
     @ApiOperation(value = "查询是否开启了访客邀请的车辆", notes = "查询是否开启了访客邀请的车辆")
75
     @ApiImplicitParams({
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
     @RequestMapping(value = "/invate_license/bool", method = RequestMethod.GET)
78
     @RequestMapping(value = "/invate_license/bool", method = RequestMethod.GET)
79
-    public ResponseBean invateBool(@RequestParam("communityId") Integer communityId) {
79
+    public ResponseBean invateBool(HttpSession session) {
80
         ResponseBean responseBean = new ResponseBean();
80
         ResponseBean responseBean = new ResponseBean();
81
-        responseBean = vistorServiceI.invateBool(communityId);
81
+        UserElement userElement = getUserElement(session);
82
+        responseBean = vistorServiceI.invateBool(userElement);
82
         return responseBean;
83
         return responseBean;
83
     }
84
     }
84
 
85
 

+ 2
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/TaVistorServiceI.java View File

31
 
31
 
32
     /**
32
     /**
33
      * 查询 邀请访客车辆 是否开启
33
      * 查询 邀请访客车辆 是否开启
34
-     * @param communityId
34
+     * @param userElement
35
      * @return
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 View File

568
         if (null != array) {
568
         if (null != array) {
569
             reply = array.toArray(new String[]{});
569
             reply = array.toArray(new String[]{});
570
         }
570
         }
571
+        TaUserVerify taUserVerify= taUserVerifyMapper.selectByPrimaryKey(userElement.getUserVerifyId());
571
         TpTransactionReply tpTransactionReply = JSONObject.parseObject(paramets, TpTransactionReply.class);
572
         TpTransactionReply tpTransactionReply = JSONObject.parseObject(paramets, TpTransactionReply.class);
572
         tpTransactionReply.setCommunityId(userElement.getCommunityId());
573
         tpTransactionReply.setCommunityId(userElement.getCommunityId());
573
         tpTransactionReply.setUuid(userElement.getUserVerifyId());
574
         tpTransactionReply.setUuid(userElement.getUserVerifyId());
574
         tpTransactionReply.setUuidType("app");
575
         tpTransactionReply.setUuidType("app");
575
         tpTransactionReply.setUuidName(userElement.getUserName());
576
         tpTransactionReply.setUuidName(userElement.getUserName());
577
+        tpTransactionReply.setUuidRole(taSysRoleMapper.selectByPrimaryKey(taUserVerify.getRoleId()).getDescription());
576
 
578
 
577
             // 由于评论帖子和评论对话是同一个接口,当tpTransactionReply.getReplyTaUserId()为空时查询Ta_user里面的名字
579
             // 由于评论帖子和评论对话是同一个接口,当tpTransactionReply.getReplyTaUserId()为空时查询Ta_user里面的名字
578
         TpTransactionReply tpTransactionReplyBack = tpTransactionReplyMapper.selectByPrimaryKey(tpTransactionReply.getReplyId());
580
         TpTransactionReply tpTransactionReplyBack = tpTransactionReplyMapper.selectByPrimaryKey(tpTransactionReply.getReplyId());
581
         tpTransactionReply.setReplyUuid(tpTransactionReplyBack.getUuid());
583
         tpTransactionReply.setReplyUuid(tpTransactionReplyBack.getUuid());
582
         tpTransactionReply.setReplyUuidType(tpTransactionReplyBack.getUuidType());
584
         tpTransactionReply.setReplyUuidType(tpTransactionReplyBack.getUuidType());
583
         tpTransactionReply.setReplyUuidName(tpTransactionReplyBack.getUuidName());
585
         tpTransactionReply.setReplyUuidName(tpTransactionReplyBack.getUuidName());
586
+        tpTransactionReply.setReplyUuidRole(tpTransactionReplyBack.getReplyUuidRole());
584
         tpTransactionReply.setReleaseIdentity("0");
587
         tpTransactionReply.setReleaseIdentity("0");
585
-        TaUserVerify taUserVerify= taUserVerifyMapper.selectByPrimaryKey(userElement.getUserVerifyId());
588
+        
586
         tpTransactionReply.setCreateDate(new Date());
589
         tpTransactionReply.setCreateDate(new Date());
587
         tpTransactionReplyMapper.insert(tpTransactionReply);
590
         tpTransactionReplyMapper.insert(tpTransactionReply);
588
 
591
 
864
         }
867
         }
865
 
868
 
866
         TpTransaction tpTransaction = tpTransactionMapper.selectByPrimaryKey(activityId, communityId);
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
         Map<String, Object> map = Maps.newHashMap();
871
         Map<String, Object> map = Maps.newHashMap();
878
         map.put("uuid", tpTransaction.getId());
872
         map.put("uuid", tpTransaction.getId());
948
         TaUserVerify taUserVerify= taUserVerifyMapper.selectByPrimaryKey(userElement.getUserVerifyId());
942
         TaUserVerify taUserVerify= taUserVerifyMapper.selectByPrimaryKey(userElement.getUserVerifyId());
949
         List<TpTransactionReply> replies = tpTransactionReplyMapper.getCommunityIdAndTransactionId(userElement.getCommunityId(), transactionId, userElement.getUserVerifyId(), tpTransaction.getUuid(),tpTransaction.getUuidType(),type);
943
         List<TpTransactionReply> replies = tpTransactionReplyMapper.getCommunityIdAndTransactionId(userElement.getCommunityId(), transactionId, userElement.getUserVerifyId(), tpTransaction.getUuid(),tpTransaction.getUuidType(),type);
950
         for (TpTransactionReply tpTransactionReply : replies) {
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
             List<TdImages> tdImagesList = tdImagesMapper.selectImages(tpTransactionReply.getId(), "reply");
945
             List<TdImages> tdImagesList = tdImagesMapper.selectImages(tpTransactionReply.getId(), "reply");
960
             List<String> list = new ArrayList<>();
946
             List<String> list = new ArrayList<>();
961
             for (TdImages imageUrl : tdImagesList) {
947
             for (TdImages imageUrl : tdImagesList) {

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

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

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

292
   </insert>
292
   </insert>
293
     <select id="getUserTransactionList" resultMap="BaseResultMap">
293
     <select id="getUserTransactionList" resultMap="BaseResultMap">
294
         SELECT
294
         SELECT
295
-        <include refid="Base_Column_List"/>
295
+          <include refid="Base_Column_List"/>
296
         FROM
296
         FROM
297
-        tp_transaction t
297
+          tp_transaction t
298
         WHERE
298
         WHERE
299
-        t.community_id=#{communityId,jdbcType=INTEGER}
299
+          t.community_id=#{communityId,jdbcType=INTEGER}
300
         AND t.uuid = #{id} and t.uuid_type = 'app'
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
     </select>
318
     </select>
303
 </mapper>
319
 </mapper>

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

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

54
 
54
 
55
 	@Autowired
55
 	@Autowired
56
 	private TaUserMapper taUserMapper;
56
 	private TaUserMapper taUserMapper;
57
+	
58
+	@Autowired
59
+	private TaUserVerifyMapper taUserVerifyMapper;
60
+	
61
+	@Autowired
62
+	private TaSysRoleMapper taSysRoleMapper;
57
 
63
 
58
 
64
 
59
 	@Override
65
 	@Override
334
 		TpTransaction tpTransaction= tpTransactionMapper.selectById(id);
340
 		TpTransaction tpTransaction= tpTransactionMapper.selectById(id);
335
 		
341
 		
336
 		TransactionReply transactionReply= new TransactionReply();
342
 		TransactionReply transactionReply= new TransactionReply();
337
-		// 查询回复的ta_userID
338
-		 User user= userMapper.selectById(userElement.getId());
343
+		
339
 		int Type=replyType.intValue();
344
 		int Type=replyType.intValue();
340
 		if (Type==1) {
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
 			transactionReply.setCommunityId(userElement.getCommunityId())
352
 			transactionReply.setCommunityId(userElement.getCommunityId())
342
 					.setTransactionId(id)
353
 					.setTransactionId(id)
343
 					.setUuid(userElement.getId())
354
 					.setUuid(userElement.getId())
344
 					.setUuidType("prop")
355
 					.setUuidType("prop")
345
 					.setUuidName(userElement.getUserName())
356
 					.setUuidName(userElement.getUserName())
357
+					.setUuidRole("物业")
346
 					.setReplyContent(replyContent)
358
 					.setReplyContent(replyContent)
347
 					.setReplyUuid(tpTransaction.getUuid())
359
 					.setReplyUuid(tpTransaction.getUuid())
348
 					.setReplyUuidType(tpTransaction.getUuidType())
360
 					.setReplyUuidType(tpTransaction.getUuidType())
349
 					.setReplyUuidName(tpTransaction.getUuidName())
361
 					.setReplyUuidName(tpTransaction.getUuidName())
362
+					.setReplyUuidRole(replyRole)
350
 					.setCreateDate(LocalDateTime.now());
363
 					.setCreateDate(LocalDateTime.now());
351
 		}
364
 		}
352
 		if (Type!=1) {
365
 		if (Type!=1) {
357
 					.setUuid(userElement.getId())
370
 					.setUuid(userElement.getId())
358
 					.setUuidType("prop")
371
 					.setUuidType("prop")
359
 					.setUuidName(userElement.getUserName())
372
 					.setUuidName(userElement.getUserName())
373
+					.setUuidRole("物业")
360
 					.setReplyContent(replyContent)
374
 					.setReplyContent(replyContent)
361
 					.setReplyUuid(Reply.getUuid())
375
 					.setReplyUuid(Reply.getUuid())
362
 					.setReplyUuidType("prop")
376
 					.setReplyUuidType("prop")
363
 					.setReplyUuidName(Reply.getUuidName())
377
 					.setReplyUuidName(Reply.getUuidName())
378
+					.setReplyUuidRole("物业")
364
 					.setCreateDate(LocalDateTime.now());
379
 					.setCreateDate(LocalDateTime.now());
365
 		}
380
 		}
366
 		transactionReplyMapper.insert(transactionReply);
381
 		transactionReplyMapper.insert(transactionReply);