dingxin 6 年之前
父節點
當前提交
b4ced4be86

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/SocialController.java 查看文件

@@ -430,7 +430,7 @@ public class SocialController extends BaseController {
430 430
     @ApiOperation(value = "二手帖子对话", notes = "二手帖子对话")
431 431
     @ApiImplicitParams({
432 432
             @ApiImplicitParam(paramType = "body", dataType = "String", name = "paramets", value =
433
-                    "transactionId:当前帖子ID,replyContent:回复内容,replyId:被回复的评论ID,imgArr:可多张[]"),
433
+                    "transactionId:当前帖子ID,replyContent:回复内容,replyId:被回复的评论ID,imgArr:可多张[],state:此参数用于判断是否是物业"),
434 434
             @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token")
435 435
     })
436 436
     @RequestMapping(value = "/addTransactionReply", method = RequestMethod.POST)

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

@@ -583,19 +583,31 @@ public class SocialServiceImpl implements SocialServiceI {
583 583
     public ResponseBean addTransactionReply(String paramets, UserElement userElement) {
584 584
         ResponseBean response = new ResponseBean();
585 585
         JSONObject object = JSONObject.parseObject(paramets);
586
+        Integer state = object.getInteger("state");
587
+        TpUser tpUser = tpUserMapper.selectLoginName(userElement.getLoginName(),userElement.getCommunityId());
586 588
         JSONArray array = object.getJSONArray("imgArr");
587 589
         String[] reply = null;
588 590
         if (null != array) {
589 591
             reply = array.toArray(new String[]{});
590 592
         }
591 593
         TaUserVerify taUserVerify= taUserVerifyMapper.selectByPrimaryKey(userElement.getUserVerifyId());
592
-        TpTransactionReply tpTransactionReply = JSONObject.parseObject(paramets, TpTransactionReply.class);
593
-        tpTransactionReply.setCommunityId(userElement.getCommunityId());
594
-        tpTransactionReply.setUuid(userElement.getUserVerifyId());
595
-        tpTransactionReply.setUuidType("app");
596
-        tpTransactionReply.setUuidName(userElement.getUserName());
597
-        tpTransactionReply.setUuidRole(taSysRoleMapper.selectByPrimaryKey(taUserVerify.getRoleId()).getDescription());
598 594
 
595
+        TpTransactionReply tpTransactionReply = JSONObject.parseObject(paramets, TpTransactionReply.class);
596
+        // 我1时代表物业端身份评论
597
+        int current = state.intValue();
598
+        if (1==current){
599
+            tpTransactionReply.setCommunityId(userElement.getCommunityId());
600
+            tpTransactionReply.setUuid( tpUser.getId());
601
+            tpTransactionReply.setUuidType("prop");
602
+            tpTransactionReply.setUuidName(tpUser.getUserName());
603
+            tpTransactionReply.setUuidRole("物业");
604
+        }else {
605
+            tpTransactionReply.setCommunityId(userElement.getCommunityId());
606
+            tpTransactionReply.setUuid(userElement.getUserVerifyId());
607
+            tpTransactionReply.setUuidType("app");
608
+            tpTransactionReply.setUuidName(userElement.getUserName());
609
+            tpTransactionReply.setUuidRole(taSysRoleMapper.selectByPrimaryKey(taUserVerify.getRoleId()).getDescription());
610
+        }
599 611
         TpTransactionReply tpTransactionReplyBack = new TpTransactionReply();
600 612
         TpTransaction tpTransaction = new TpTransaction();
601 613
         //replyId为空的情况下被回复人就是帖子的创建人

+ 15
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TicketServiceImpl.java 查看文件

@@ -460,6 +460,21 @@ public class TicketServiceImpl implements ITicketService {
460 460
             tpTicketRecord.setCreateUser(userId);
461 461
             tpTicketRecord.setCreateDate(new Date());
462 462
             tpTicketRecordMapper.insertSelective(tpTicketRecord);
463
+            // 终止后维护tp_ticket_record_comment对话
464
+            Integer createUser= tpTicketMapper.selectByPrimaryKey(ticketId).getCreateUser();
465
+            TaUserVerify taUserVerify= taUserVerifyMapper.selectByPrimaryKey(createUser);
466
+
467
+            TaUser taUser= taUserMapper.selectByPrimaryKey(taUserVerify.getUserId());
468
+            TpTicketRecordComment tpTicketRecordComment = new TpTicketRecordComment();
469
+            tpTicketRecordComment.setCommunityId(communityId);
470
+            tpTicketRecordComment.setTicketId(ticketId);
471
+            tpTicketRecordComment.setTicketRecordId(tpTicketRecord.getId());
472
+            tpTicketRecordComment.setUuid(userId);
473
+            tpTicketRecordComment.setUuid(taUserVerify.getId());
474
+            tpTicketRecordComment.setUserName(taUser.getUserName());
475
+            tpTicketRecordComment.setCreateDate(new Date());
476
+            tpTicketRecordCommentMapper.insertSelective(tpTicketRecordComment);
477
+
463 478
             //1.5版本需求推送消息
464 479
             TpMessage tpMessage= new TpMessage();
465 480
                       tpMessage.setTicketId(ticketId);

+ 2
- 2
CODE/smart-community/app-api/src/main/resources/mapper/TpTicketRecordMapper.xml 查看文件

@@ -23,7 +23,7 @@
23 23
     delete from tp_ticket_record
24 24
     where id = #{id,jdbcType=INTEGER}
25 25
   </delete>
26
-  <insert id="insert" parameterType="com.community.huiju.model.TpTicketRecord" >
26
+  <insert id="insert" parameterType="com.community.huiju.model.TpTicketRecord" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
27 27
     insert into tp_ticket_record (id, community_id, ticket_id, content,
28 28
       status, create_user, create_date
29 29
       )
@@ -31,7 +31,7 @@
31 31
       #{content,jdbcType=VARCHAR}, #{status,jdbcType=CHAR}, #{createUser,jdbcType=INTEGER}, #{createDate,jdbcType=TIMESTAMP}
32 32
       )
33 33
   </insert>
34
-  <insert id="insertSelective" parameterType="com.community.huiju.model.TpTicketRecord" >
34
+  <insert id="insertSelective" parameterType="com.community.huiju.model.TpTicketRecord" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
35 35
     insert into tp_ticket_record
36 36
     <trim prefix="(" suffix=")" suffixOverrides="," >
37 37
       <if test="id != null" >