소스 검색

合并本地分支

weiximei 6 년 전
부모
커밋
9dce6d60a5
35개의 변경된 파일1167개의 추가작업 그리고 676개의 파일을 삭제
  1. 9
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/MessageController.java
  2. 29
    7
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/SocialController.java
  3. 15
    17
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/TicketController.java
  4. 22
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TaSysRoleMapper.java
  5. 22
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TaSysUserRoleMapper.java
  6. 2
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpActivityMapper.java
  7. 2
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpMessageMapper.java
  8. 9
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpTicketMapper.java
  9. 8
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpTicketRecordCommentMapper.java
  10. 5
    6
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpTicketRecordMapper.java
  11. 5
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpTransactionMapper.java
  12. 75
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TaSysRole.java
  13. 43
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TaSysUserRole.java
  14. 24
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpTicket.java
  15. 21
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpTicketRecord.java
  16. 8
    8
      CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpTicketRecordComment.java
  17. 8
    9
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/ITicketService.java
  18. 5
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/MessageServiceI.java
  19. 17
    4
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/SocialServiceI.java
  20. 8
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/MessageServiceImpl.java
  21. 111
    25
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java
  22. 22
    61
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TicketServiceImpl.java
  23. 124
    0
      CODE/smart-community/app-api/src/main/resources/mapper/TaSysRoleMapper.xml
  24. 89
    0
      CODE/smart-community/app-api/src/main/resources/mapper/TaSysUserRoleMapper.xml
  25. 3
    3
      CODE/smart-community/app-api/src/main/resources/mapper/TpActivityMapper.xml
  26. 11
    0
      CODE/smart-community/app-api/src/main/resources/mapper/TpMessageMapper.xml
  27. 23
    0
      CODE/smart-community/app-api/src/main/resources/mapper/TpTicketMapper.xml
  28. 23
    12
      CODE/smart-community/app-api/src/main/resources/mapper/TpTicketRecordCommentMapper.xml
  29. 17
    17
      CODE/smart-community/app-api/src/main/resources/mapper/TpTicketRecordMapper.xml
  30. 7
    0
      CODE/smart-community/app-api/src/main/resources/mapper/TpTransactionMapper.xml
  31. 14
    0
      CODE/smart-community/community-common/src/main/java/com/community/commom/constant/Constant.java
  32. BIN
      CODE/smart-community/community-common/target/classes/com/community/commom/constant/Constant.class
  33. 193
    253
      文档/MYSQL/smartCommunity.pdb
  34. 193
    253
      文档/MYSQL/smartCommunity.pdm
  35. BIN
      文档/需求/app接口需求-第二版.xlsx

+ 9
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/MessageController.java 파일 보기

@@ -70,4 +70,13 @@ public class MessageController {
70 70
 		responseBean.addSuccess(upcomingList);
71 71
 		return responseBean;
72 72
 	}
73
+
74
+	@ApiOperation(value = "消息已读接口", notes = "消息已读接口")
75
+	@ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "String", name = "communityId", value = "小区Id")})
76
+	@RequestMapping(value = "/readStatus/{communityId}",method = RequestMethod.POST)
77
+	public ResponseBean allMessageRead(@PathVariable("communityId") Integer communityId){
78
+		ResponseBean responseBean = new ResponseBean();
79
+		messageService.updateMessageReadStatus(communityId);
80
+		return responseBean;
81
+	}
73 82
 }

+ 29
- 7
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/SocialController.java 파일 보기

@@ -2,9 +2,7 @@ package com.community.huiju.controller;
2 2
 
3 3
 import com.community.commom.constant.Constant;
4 4
 import com.community.commom.mode.ResponseBean;
5
-import com.community.huiju.model.TpActivity;
6
-import com.community.huiju.model.TpAnnouncement;
7
-import com.community.huiju.model.TpMessage;
5
+import com.community.huiju.model.*;
8 6
 import com.community.huiju.service.SocialServiceI;
9 7
 import io.swagger.annotations.Api;
10 8
 import io.swagger.annotations.ApiImplicitParam;
@@ -41,11 +39,12 @@ public class SocialController {
41 39
         return responseBean;
42 40
     }
43 41
 
44
-    @RequestMapping(value = "/sign", method = RequestMethod.GET)
42
+    @RequestMapping(value = "/sign/{communityId}", method = RequestMethod.GET)
45 43
     @ApiOperation(value = "活动报名接口", notes = "活动报名接口")
46
-    @ApiImplicitParams({ @ApiImplicitParam(paramType = "query", dataType = "Long", name = "communityId", value = "小区Id") })
47
-    public ResponseBean SignActivity(@PathVariable(value = "communityId")Integer communityId){
48
-        ResponseBean responseBean = new ResponseBean();
44
+    @ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id"),
45
+                         @ApiImplicitParam(paramType = "query", dataType = "integer", name = "activityId", value = "活动Id")})
46
+    public ResponseBean SignActivity(@PathVariable(value = "communityId")Integer communityId, @RequestParam("activityId")Integer activityId){
47
+        ResponseBean responseBean = socialServiceI.findTaUserInfo(activityId, communityId);
49 48
         return responseBean;
50 49
     }
51 50
     
@@ -103,4 +102,27 @@ public class SocialController {
103 102
         return responseBean;
104 103
     }
105 104
 
105
+    @ApiOperation(value = "获取所有的二手租赁帖子", notes = "获取所有的二手租赁帖子")
106
+    @ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id"),
107
+            @ApiImplicitParam(paramType = "query", dataType = "String", name = "type", value = "帖子类型"),
108
+            @ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageNum", value = "分页第几页"),
109
+            @ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageSize", value = "分页每页长度")})
110
+    @RequestMapping(value = "/getAllTransaction/{communityId}", method = RequestMethod.GET)
111
+    public ResponseBean getAllPosts(@PathVariable("communityId")Integer communityId, @RequestParam("type") String type,
112
+                                    @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
113
+                                    @RequestParam(value ="pageSize",defaultValue = "5") Integer pageSize){
114
+        ResponseBean responseBean = new ResponseBean();
115
+        List<TpTransaction> tpTransactions = socialServiceI.findAllTransaction(communityId, type, pageNum, pageSize);
116
+        responseBean.addSuccess(tpTransactions);
117
+        return responseBean;
118
+    }
119
+
120
+    @ApiOperation(value = "报修进度终止", notes = "报修进度终止")
121
+    @ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id"),
122
+            @ApiImplicitParam(paramType = "query", dataType = "integer", name = "ticketId", value = "帖子Id")})
123
+    @RequestMapping(value = "/stopTicket/{communityId}", method = RequestMethod.GET)
124
+    public ResponseBean stopTicket(@PathVariable("communityId")Integer communityId, @RequestParam("ticketId")Integer ticketId){
125
+        ResponseBean responseBean = socialServiceI.stopTpTicketRecord(communityId, ticketId);
126
+        return responseBean;
127
+    }
106 128
 }

+ 15
- 17
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/TicketController.java 파일 보기

@@ -16,6 +16,7 @@ import org.springframework.cloud.context.config.annotation.RefreshScope;
16 16
 import org.springframework.web.bind.annotation.*;
17 17
 
18 18
 import javax.servlet.http.HttpSession;
19
+import java.util.List;
19 20
 
20 21
 @RestController
21 22
 @RefreshScope
@@ -48,7 +49,20 @@ public class TicketController {
48 49
         response = iTicketService.getList(tpTicket,pageNum,pageSize);
49 50
         return response;
50 51
     }
51
-
52
+    
53
+    @ApiOperation(value = "获取报修详情数据",notes = "获取报修详情数据")
54
+    @ApiImplicitParams({
55
+            @ApiImplicitParam(paramType = "path",dataType = "String",name = "communityId",value = "小区编号"),
56
+            @ApiImplicitParam(paramType = "query",dataType = "Integer",name = "ticketId",value = "报修id")
57
+    })
58
+    @RequestMapping(value = "/ticket/schedule/{communityId}", method = RequestMethod.GET)
59
+    public ResponseBean getTicketSchedule(@PathVariable(value = "communityId") String communityId,@RequestParam Integer ticketId){
60
+        ResponseBean responseBean = new ResponseBean();
61
+        TpTicket ticket = iTicketService.getTicketSchedule(communityId,ticketId);
62
+        responseBean.addSuccess(ticket);
63
+        return responseBean;
64
+    }
65
+    
52 66
     @RequestMapping(value = "/tickets/list/{communityId}", method = RequestMethod.GET)
53 67
     @ApiOperation(value = "获取 报修/投诉/联系单 数据列表", notes = "根据 小区编号,工单类型,第几页,一页多少行")
54 68
     @ApiImplicitParams({
@@ -77,20 +91,4 @@ public class TicketController {
77 91
 
78 92
     }
79 93
 
80
-
81
-    @RequestMapping(value = "/tickets/info/{ticketId}", method = RequestMethod.GET)
82
-    @ApiOperation(value = "获取 报修/投诉/联系单 数据详情", notes = "根据 工单ID")
83
-    @ApiImplicitParams({
84
-            @ApiImplicitParam(paramType = "path",dataType = "String",name = "ticketId", value = "小区编号"),
85
-    })
86
-    public ResponseBean getServicesInfo(@PathVariable(value = "ticketId") Integer ticketId,
87
-                                       HttpSession session) {
88
-        ResponseBean responseBean = new ResponseBean();
89
-
90
-        responseBean = iTicketService.getById(ticketId);
91
-
92
-        return responseBean;
93
-
94
-    }
95
-
96 94
 }

+ 22
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TaSysRoleMapper.java 파일 보기

@@ -0,0 +1,22 @@
1
+package com.community.huiju.dao;
2
+
3
+
4
+import com.community.huiju.model.TaSysRole;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+@Mapper
8
+public interface TaSysRoleMapper {
9
+    int deleteByPrimaryKey(Integer id);
10
+
11
+    int insert(TaSysRole record);
12
+
13
+    int insertSelective(TaSysRole record);
14
+
15
+    TaSysRole selectByPrimaryKey(Integer id);
16
+
17
+    int updateByPrimaryKeySelective(TaSysRole record);
18
+
19
+    int updateByPrimaryKey(TaSysRole record);
20
+
21
+    TaSysRole findRoleByUserId(Integer userId);
22
+}

+ 22
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TaSysUserRoleMapper.java 파일 보기

@@ -0,0 +1,22 @@
1
+package com.community.huiju.dao;
2
+
3
+
4
+import com.community.huiju.model.TaSysUserRole;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+@Mapper
8
+public interface TaSysUserRoleMapper {
9
+    int deleteByPrimaryKey(Integer id);
10
+
11
+    int insert(TaSysUserRole record);
12
+
13
+    int insertSelective(TaSysUserRole record);
14
+
15
+    TaSysUserRole selectByPrimaryKey(Integer id);
16
+
17
+    int updateByPrimaryKeySelective(TaSysUserRole record);
18
+
19
+    int updateByPrimaryKey(TaSysUserRole record);
20
+
21
+    Integer findSysUserRoleByUserIdAndRoleId(Integer userId);
22
+}

+ 2
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpActivityMapper.java 파일 보기

@@ -9,13 +9,14 @@ import java.util.List;
9 9
 
10 10
 @Mapper
11 11
 public interface TpActivityMapper {
12
+
12 13
     int deleteByPrimaryKey(Integer id);
13 14
 
14 15
     int insert(TpActivity record);
15 16
 
16 17
     int insertSelective(TpActivity record);
17 18
 
18
-    TpActivity selectByPrimaryKey(@Param("id") Integer id,@Param("communityId") Integer communityId);
19
+    TpActivity selectByPrimaryKey(@Param("id") Integer id, @Param("communityId") Integer communityId);
19 20
 
20 21
     int updateByPrimaryKeySelective(TpActivity record);
21 22
 

+ 2
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpMessageMapper.java 파일 보기

@@ -24,4 +24,6 @@ public interface TpMessageMapper {
24 24
     Map<String, Object> getMessageTotal(@Param(value = "userId") Integer userId,@Param(value = "communityId") Integer communityId);
25 25
     
26 26
     List<TpMessage> getMessages(@Param(value = "userId") Integer userId,@Param(value = "communityId") Integer communityId, @Param(value = "modelType") Integer modelType);
27
+
28
+    void updateReadStatus(Integer communityId);
27 29
 }

+ 9
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpTicketMapper.java 파일 보기

@@ -2,6 +2,7 @@ package com.community.huiju.dao;
2 2
 
3 3
 import com.community.huiju.model.TpTicket;
4 4
 import org.apache.ibatis.annotations.Mapper;
5
+import org.apache.ibatis.annotations.Param;
5 6
 
6 7
 import java.util.List;
7 8
 import java.util.Map;
@@ -26,4 +27,12 @@ public interface TpTicketMapper {
26 27
      * @return
27 28
      */
28 29
     List<TpTicket> selectByCommuniytIdAndByTaUserIdAndByType(Map map);
30
+    
31
+    /**
32
+     * 获取报修进度
33
+     * @param communityId
34
+     * @param ticketId
35
+     * @return
36
+     */
37
+	TpTicket selectByTicketId(@Param("communityId") String communityId,@Param("ticketId") Integer ticketId);
29 38
 }

+ 8
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpTicketRecordCommentMapper.java 파일 보기

@@ -1,5 +1,6 @@
1 1
 package com.community.huiju.dao;
2 2
 
3
+import com.community.huiju.model.TpTicketRecord;
3 4
 import com.community.huiju.model.TpTicketRecordComment;
4 5
 import org.apache.ibatis.annotations.Mapper;
5 6
 
@@ -30,4 +31,11 @@ public interface TpTicketRecordCommentMapper {
30 31
      * @return
31 32
      */
32 33
     List<TpTicketRecordComment> selectByTicketId(Map map);
34
+    
35
+    /**
36
+     * 查询出这个处理撞他下所有的回复数据
37
+     * @param tpTicketRecord
38
+     * @return
39
+     */
40
+	List<TpTicketRecordComment> selectByTicketRecordId(TpTicketRecord tpTicketRecord);
33 41
 }

+ 5
- 6
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpTicketRecordMapper.java 파일 보기

@@ -2,6 +2,9 @@ package com.community.huiju.dao;
2 2
 
3 3
 import com.community.huiju.model.TpTicketRecord;
4 4
 import org.apache.ibatis.annotations.Mapper;
5
+import org.apache.ibatis.annotations.Param;
6
+
7
+import java.util.List;
5 8
 
6 9
 import java.util.List;
7 10
 import java.util.Map;
@@ -20,10 +23,6 @@ public interface TpTicketRecordMapper {
20 23
 
21 24
     int updateByPrimaryKey(TpTicketRecord record);
22 25
 
23
-    /**
24
-     * 根据 小区ID/工单ID/流程状态
25
-     * @param map
26
-     * @return
27
-     */
28
-    List<TpTicketRecord> selectByCommunityIdOrByTicketIdOrByStatus(Map map);
26
+	List<TpTicketRecord> getTicketRecordByTicketId(@Param("communityId") String communityId,@Param("ticketId") Integer ticketId);
27
+
29 28
 }

+ 5
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpTransactionMapper.java 파일 보기

@@ -2,6 +2,9 @@ package com.community.huiju.dao;
2 2
 
3 3
 import com.community.huiju.model.TpTransaction;
4 4
 import org.apache.ibatis.annotations.Mapper;
5
+import org.apache.ibatis.annotations.Param;
6
+
7
+import java.util.List;
5 8
 
6 9
 @Mapper
7 10
 public interface TpTransactionMapper {
@@ -16,4 +19,6 @@ public interface TpTransactionMapper {
16 19
     int updateByPrimaryKeySelective(TpTransaction record);
17 20
 
18 21
     int updateByPrimaryKey(TpTransaction record);
22
+
23
+    List<TpTransaction> findAllTransaction(@Param("communityId") Integer communityId, @Param("type") String type);
19 24
 }

+ 75
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TaSysRole.java 파일 보기

@@ -0,0 +1,75 @@
1
+package com.community.huiju.model;
2
+
3
+import java.util.Date;
4
+
5
+public class TaSysRole {
6
+    private Integer id;
7
+
8
+    private String roleName;
9
+
10
+    private String description;
11
+
12
+    private Integer createUser;
13
+
14
+    private Date createDate;
15
+
16
+    private Integer updateUser;
17
+
18
+    private Date updateDate;
19
+
20
+    public Integer getId() {
21
+        return id;
22
+    }
23
+
24
+    public void setId(Integer id) {
25
+        this.id = id;
26
+    }
27
+
28
+    public String getRoleName() {
29
+        return roleName;
30
+    }
31
+
32
+    public void setRoleName(String roleName) {
33
+        this.roleName = roleName == null ? null : roleName.trim();
34
+    }
35
+
36
+    public String getDescription() {
37
+        return description;
38
+    }
39
+
40
+    public void setDescription(String description) {
41
+        this.description = description == null ? null : description.trim();
42
+    }
43
+
44
+    public Integer getCreateUser() {
45
+        return createUser;
46
+    }
47
+
48
+    public void setCreateUser(Integer createUser) {
49
+        this.createUser = createUser;
50
+    }
51
+
52
+    public Date getCreateDate() {
53
+        return createDate;
54
+    }
55
+
56
+    public void setCreateDate(Date createDate) {
57
+        this.createDate = createDate;
58
+    }
59
+
60
+    public Integer getUpdateUser() {
61
+        return updateUser;
62
+    }
63
+
64
+    public void setUpdateUser(Integer updateUser) {
65
+        this.updateUser = updateUser;
66
+    }
67
+
68
+    public Date getUpdateDate() {
69
+        return updateDate;
70
+    }
71
+
72
+    public void setUpdateDate(Date updateDate) {
73
+        this.updateDate = updateDate;
74
+    }
75
+}

+ 43
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TaSysUserRole.java 파일 보기

@@ -0,0 +1,43 @@
1
+package com.community.huiju.model;
2
+
3
+public class TaSysUserRole {
4
+    private Integer id;
5
+
6
+    private Integer communityId;
7
+
8
+    private Integer userId;
9
+
10
+    private Integer roleId;
11
+
12
+    public Integer getId() {
13
+        return id;
14
+    }
15
+
16
+    public void setId(Integer id) {
17
+        this.id = id;
18
+    }
19
+
20
+    public Integer getCommunityId() {
21
+        return communityId;
22
+    }
23
+
24
+    public void setCommunityId(Integer communityId) {
25
+        this.communityId = communityId;
26
+    }
27
+
28
+    public Integer getUserId() {
29
+        return userId;
30
+    }
31
+
32
+    public void setUserId(Integer userId) {
33
+        this.userId = userId;
34
+    }
35
+
36
+    public Integer getRoleId() {
37
+        return roleId;
38
+    }
39
+
40
+    public void setRoleId(Integer roleId) {
41
+        this.roleId = roleId;
42
+    }
43
+}

+ 24
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpTicket.java 파일 보기

@@ -1,6 +1,7 @@
1 1
 package com.community.huiju.model;
2 2
 
3 3
 import java.util.Date;
4
+import java.util.List;
4 5
 
5 6
 public class TpTicket {
6 7
     private Integer id;
@@ -18,6 +19,11 @@ public class TpTicket {
18 19
     private String type;
19 20
 
20 21
     private String repairType;
22
+    
23
+    /**
24
+     * 报修类型的名字
25
+     */
26
+    private String repairName;
21 27
 
22 28
     private Integer tpUserId;
23 29
 
@@ -32,6 +38,8 @@ public class TpTicket {
32 38
     private Integer updateUser;
33 39
 
34 40
     private Date updateDate;
41
+    
42
+    private List<TpTicketRecord> ticketRecordList;
35 43
 
36 44
     public Integer getId() {
37 45
         return id;
@@ -152,4 +160,20 @@ public class TpTicket {
152 160
     public void setUpdateDate(Date updateDate) {
153 161
         this.updateDate = updateDate;
154 162
     }
163
+    
164
+    public String getRepairName() {
165
+        return repairName;
166
+    }
167
+    
168
+    public void setRepairName(String repairName) {
169
+        this.repairName = repairName;
170
+    }
171
+    
172
+    public List<TpTicketRecord> getTicketRecordList() {
173
+        return ticketRecordList;
174
+    }
175
+    
176
+    public void setTicketRecordList(List<TpTicketRecord> ticketRecordList) {
177
+        this.ticketRecordList = ticketRecordList;
178
+    }
155 179
 }

+ 21
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpTicketRecord.java 파일 보기

@@ -1,6 +1,7 @@
1 1
 package com.community.huiju.model;
2 2
 
3 3
 import java.util.Date;
4
+import java.util.List;
4 5
 
5 6
 public class TpTicketRecord {
6 7
     private Integer id;
@@ -10,10 +11,14 @@ public class TpTicketRecord {
10 11
     private Integer ticketId;
11 12
 
12 13
     private String status;
14
+    
15
+    private String ticketStatusName;
13 16
 
14 17
     private Integer createUser;
15 18
 
16 19
     private Date createDate;
20
+    
21
+    private List<TpTicketRecordComment> ticketRecordCommentList;
17 22
 
18 23
     public Integer getId() {
19 24
         return id;
@@ -62,4 +67,20 @@ public class TpTicketRecord {
62 67
     public void setCreateDate(Date createDate) {
63 68
         this.createDate = createDate;
64 69
     }
70
+    
71
+    public String getTicketStatusName() {
72
+        return ticketStatusName;
73
+    }
74
+    
75
+    public void setTicketStatusName(String ticketStatusName) {
76
+        this.ticketStatusName = ticketStatusName;
77
+    }
78
+    
79
+    public List<TpTicketRecordComment> getTicketRecordCommentList() {
80
+        return ticketRecordCommentList;
81
+    }
82
+    
83
+    public void setTicketRecordCommentList(List<TpTicketRecordComment> ticketRecordCommentList) {
84
+        this.ticketRecordCommentList = ticketRecordCommentList;
85
+    }
65 86
 }

+ 8
- 8
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpTicketRecordComment.java 파일 보기

@@ -7,7 +7,7 @@ public class TpTicketRecordComment {
7 7
 
8 8
     private Integer communityId;
9 9
 
10
-    private Integer tickerId;
10
+    private Integer ticketId;
11 11
 
12 12
     private Integer ticketRecordId;
13 13
 
@@ -38,15 +38,15 @@ public class TpTicketRecordComment {
38 38
     public void setCommunityId(Integer communityId) {
39 39
         this.communityId = communityId;
40 40
     }
41
-
42
-    public Integer getTickerId() {
43
-        return tickerId;
41
+    
42
+    public Integer getTicketId() {
43
+        return ticketId;
44 44
     }
45
-
46
-    public void setTickerId(Integer tickerId) {
47
-        this.tickerId = tickerId;
45
+    
46
+    public void setTicketId(Integer ticketId) {
47
+        this.ticketId = ticketId;
48 48
     }
49
-
49
+    
50 50
     public Integer getTicketRecordId() {
51 51
         return ticketRecordId;
52 52
     }

+ 8
- 9
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/ITicketService.java 파일 보기

@@ -29,13 +29,12 @@ public interface ITicketService {
29 29
      * @return 返回 维修/投诉/联系单 记录列表
30 30
      */
31 31
     ResponseBean getByTypeList(TpTicket tpTicket,Integer pageNum, Integer pageSize);
32
-
33
-    /**
34
-     * 根据 工单ID 查询 维修/投诉/联系单 详情
35
-     * @param ticketId
36
-     * @return 返回 维修/投诉/联系单 详情
37
-     */
38
-    ResponseBean getById(Integer ticketId);
39
-
40
-
32
+	
33
+	/**
34
+	 * 获取报修详情
35
+	 * @param communityId
36
+	 * @param ticketId
37
+	 * @return
38
+	 */
39
+	TpTicket getTicketSchedule(String communityId, Integer ticketId);
41 40
 }

+ 5
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/MessageServiceI.java 파일 보기

@@ -22,4 +22,9 @@ public interface MessageServiceI {
22 22
 	 * @return
23 23
 	 */
24 24
 	List<TpMessage> getMessages(Integer communityId, Integer pageNum, Integer pageSize,Integer modelType);
25
+
26
+	/**
27
+	 * 全部已读
28
+	 */
29
+	void updateMessageReadStatus(Integer communityId);
25 30
 }

+ 17
- 4
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/SocialServiceI.java 파일 보기

@@ -1,10 +1,7 @@
1 1
 package com.community.huiju.service;
2 2
 
3 3
 import com.community.commom.mode.ResponseBean;
4
-import com.community.huiju.model.TaUser;
5
-import com.community.huiju.model.TpActivity;
6
-import com.community.huiju.model.TpAnnouncement;
7
-import com.community.huiju.model.TpSocialView;
4
+import com.community.huiju.model.*;
8 5
 
9 6
 import java.util.List;
10 7
 
@@ -53,4 +50,20 @@ public interface SocialServiceI {
53 50
 	TpActivity findActivityDetail(Integer activityId, Integer communityId);
54 51
 
55 52
 	ResponseBean findTaUserInfo(Integer id, Integer communityId);
53
+
54
+	/**
55
+	 * 获取所有的交易帖子
56
+	 * @param communityId
57
+	 * @param type
58
+	 * @return
59
+	 */
60
+	List<TpTransaction> findAllTransaction(Integer communityId, String type, Integer pageNum, Integer paeSize);
61
+
62
+	/**
63
+	 * 终止报修
64
+	 * @param communityId
65
+	 * @param ticketId
66
+	 * @return
67
+	 */
68
+	ResponseBean stopTpTicketRecord(Integer communityId, Integer ticketId);
56 69
 }

+ 8
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/MessageServiceImpl.java 파일 보기

@@ -50,4 +50,12 @@ public class MessageServiceImpl implements MessageServiceI {
50 50
 		List<TpMessage> messageList = tpMessageMapper.getMessages(userId,communityId, modelType);
51 51
 		return messageList;
52 52
 	}
53
+
54
+	/**
55
+	 * 消息全部已读
56
+	 */
57
+	@Override
58
+	public void updateMessageReadStatus(Integer communityId) {
59
+		tpMessageMapper.updateReadStatus(communityId);
60
+	}
53 61
 }

+ 111
- 25
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java 파일 보기

@@ -2,12 +2,8 @@ package com.community.huiju.service.impl;
2 2
 
3 3
 import com.community.commom.constant.Constant;
4 4
 import com.community.commom.mode.ResponseBean;
5
-import com.community.commom.utils.DateUtils;
6 5
 import com.community.huiju.dao.*;
7
-import com.community.huiju.model.TaUser;
8
-import com.community.huiju.model.TpActivity;
9
-import com.community.huiju.model.TpAnnouncement;
10
-import com.community.huiju.model.TpSocialView;
6
+import com.community.huiju.model.*;
11 7
 import com.community.huiju.service.SocialServiceI;
12 8
 import com.github.pagehelper.PageHelper;
13 9
 import org.springframework.beans.factory.annotation.Autowired;
@@ -39,7 +35,25 @@ public class SocialServiceImpl implements SocialServiceI {
39 35
 
40 36
     @Autowired
41 37
     private TpActivitySignupMapper tpActivitySignupMapper;
42
-    
38
+
39
+    @Autowired
40
+    private TaSysRoleMapper taSysRoleMapper;
41
+
42
+    @Autowired
43
+    private TaUserMapper taUserMapper;
44
+
45
+    @Autowired
46
+    private  TaSysUserRoleMapper taSysUserRoleMapper;
47
+
48
+    @Autowired
49
+    private TpTransactionMapper tpTransactionMapper;
50
+
51
+    @Autowired
52
+    private TpTicketRecordMapper tpTicketRecordMapper;
53
+
54
+    @Autowired
55
+    private TpTicketMapper tpTicketMapper;
56
+
43 57
     @Override
44 58
     @Transactional
45 59
     public TpAnnouncement findAnnouncementDetail(Integer id, Integer communityId) {
@@ -148,24 +162,96 @@ public class SocialServiceImpl implements SocialServiceI {
148 162
     }
149 163
 
150 164
     @Override
151
-    public ResponseBean findTaUserInfo(Integer id, Integer communityId) {
152
-//        ResponseBean responseBean = new ResponseBean();
153
-//        TpActivity tpActivity = tpActivityMapper.selectByPrimaryKey(id);
154
-//        //判断是否已经过了报名截至时间
155
-//        Date registrEndTime = tpActivity.getRegistrationEndTime();
156
-//        if (registrEndTime.compareTo(new Date()) < 0){
157
-//            return responseBean.addError("9999", "已过报名截止时间");
158
-//        }
159
-//
160
-//        //报名是否超过人数上限
161
-//        Integer signUpNum = tpActivitySignupMapper.sumActivitySignUpNum(id, communityId);
162
-//        if (signUpNum > tpActivity.getSignUpMax()){
163
-//            return responseBean.addError("9998", "报名人数已满");
164
-//        }
165
-//
166
-//        //已登陆,身份未知,状态未知
167
-//
168
-//        //身份为业主,状态为已停用
169
-        return null;
165
+    public ResponseBean findTaUserInfo(Integer activityId, Integer communityId) {
166
+        ResponseBean responseBean = new ResponseBean();
167
+        TpActivity tpActivity = tpActivityMapper.selectByPrimaryKey(activityId, communityId);
168
+        //判断是否已经过了报名截至时间
169
+        Date registrEndTime = tpActivity.getRegistrationEndTime();
170
+        if (registrEndTime.compareTo(new Date()) < 0){
171
+             responseBean.addError("9997", "已过报名截止时间");
172
+             return responseBean;
173
+        }
174
+
175
+        //报名是否超过人数上限
176
+        Integer signUpNum = tpActivitySignupMapper.sumActivitySignUpNum(activityId, communityId);
177
+        if (signUpNum > tpActivity.getSignUpMax()){
178
+            responseBean.addError("9998", "报名人数已满");
179
+            return responseBean;
180
+        }
181
+
182
+        //已登陆,身份未知,状态未知
183
+
184
+
185
+
186
+        //判断身份是否为业主且状态为已停用
187
+        //从seession中获取的user_id
188
+        //TODO
189
+        TaSysRole sysRole = taSysRoleMapper.findRoleByUserId(1);
190
+        TaUser taUser = taUserMapper.selectByPrimaryKey(1);
191
+        if (Constant.INVALID.equals(taUser.getStatus())
192
+            && Constant.OWNER.equals(sysRole.getRoleName())){
193
+
194
+            return insertActivitySignUp(tpActivity, communityId);
195
+        }
196
+
197
+        //身份为家属租客,状态为已停用
198
+        if (Constant.INVALID.equals(taUser.getStatus())
199
+            && (Constant.FAMILYMEMBER.equals(sysRole.getRoleName())) || Constant.TENANT.equals(sysRole.getRoleName())){
200
+
201
+            return insertActivitySignUp(tpActivity, communityId);
202
+        }
203
+
204
+        if (Constant.EFFECTIVE.equals(taUser.getStatus())
205
+                && (Constant.FAMILYMEMBER.equals(sysRole.getRoleName()))
206
+                || Constant.TENANT.equals(sysRole.getRoleName())
207
+                || Constant.OWNER.equals(sysRole.getRoleName())){
208
+            return insertActivitySignUp(tpActivity, communityId);
209
+        }
210
+        responseBean.addError("9999", "服务器异常");
211
+        return responseBean;
212
+    }
213
+
214
+    @Override
215
+    public List<TpTransaction> findAllTransaction(Integer communityId, String type, Integer pageNum, Integer paeSize) {
216
+        PageHelper.startPage(pageNum, paeSize);
217
+        return tpTransactionMapper.findAllTransaction(communityId, type);
218
+    }
219
+
220
+    @Transactional
221
+    @Override
222
+    public ResponseBean stopTpTicketRecord(Integer communityId, Integer ticketId) {
223
+        ResponseBean responseBean = new ResponseBean();
224
+        try{
225
+            TpTicket tpTicket = new TpTicket();
226
+            tpTicket.setStatus("6");
227
+            tpTicket.setId(ticketId);
228
+            tpTicketMapper.updateByPrimaryKeySelective(tpTicket);
229
+
230
+            TpTicketRecord tpTicketRecord = new TpTicketRecord();
231
+            tpTicketRecord.setStatus("6");
232
+            tpTicketRecord.setTicketId(ticketId);
233
+            tpTicketRecord.setCommunityId(communityId);
234
+            //TODO
235
+            tpTicketRecord.setCreateUser(1);
236
+            tpTicketRecord.setCreateDate(new Date());
237
+            tpTicketRecordMapper.insertSelective(tpTicketRecord);
238
+            return responseBean;
239
+        }catch(Exception e){
240
+            e.printStackTrace();
241
+            responseBean.addError("服务器异常");
242
+            return responseBean;
243
+        }
244
+    }
245
+
246
+    public ResponseBean insertActivitySignUp(TpActivity tpActivity, Integer communityId){
247
+        ResponseBean responseBean = new ResponseBean();
248
+        TpActivitySignup tpActivitySignup = new TpActivitySignup();
249
+        tpActivitySignup.setActivityId(tpActivity.getId());
250
+        tpActivitySignup.setCommunityId(communityId);
251
+        tpActivitySignup.setTaUserId(1);
252
+        tpActivitySignup.setSignUpTime(new Date());
253
+        tpActivitySignupMapper.insertSelective(tpActivitySignup);
254
+        responseBean.addSuccess("报名成功");
255
+        return responseBean;
170 256
     }
171 257
 }

+ 22
- 61
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TicketServiceImpl.java 파일 보기

@@ -38,12 +38,12 @@ public class TicketServiceImpl implements ITicketService {
38 38
 
39 39
     @Autowired
40 40
     private TpTicketMapper tpTicketMapper;
41
-
41
+    
42 42
     @Autowired
43
-    private TpTicketRecordCommentMapper tpTicketRecordCommentMapper;
43
+    private TpTicketRecordMapper tpTicketRecordMapper;
44 44
 
45 45
     @Autowired
46
-    private TpTicketRecordMapper tpTicketRecordMapper;
46
+    private TpTicketRecordCommentMapper tpTicketRecordCommentMapper;
47 47
 
48 48
     @Override
49 49
     public ResponseBean getList(TpTicket tpTicket,Integer pageNum, Integer pageSize) {
@@ -150,64 +150,25 @@ public class TicketServiceImpl implements ITicketService {
150 150
 
151 151
         return response;
152 152
     }
153
-
153
+    
154
+    /**
155
+     * 获取报修详情
156
+     * @param communityId
157
+     * @param ticketId
158
+     * @return
159
+     */
154 160
     @Override
155
-    public ResponseBean getById(Integer ticketId) {
156
-
157
-        ResponseBean response = new ResponseBean();
158
-
159
-        /**
160
-         * 1.查询 工单
161
-         * 2.查询 工单流程状态记录
162
-         * 3.查询 流程状态的 回复/追答 记录
163
-         */
164
-
165
-        // 工单记录
166
-        TpTicket tpTicket = tpTicketMapper.selectByPrimaryKey(ticketId);
167
-
168
-        // 查询参数
169
-        Map<String,Object> recordMap = Maps.newHashMap();
170
-        recordMap.put("communityId",tpTicket.getCommunityId());
171
-        recordMap.put("ticketId",tpTicket.getId());
172
-
173
-        // 待分配等 记录集合
174
-        List<TpTicketRecord> recordList = tpTicketRecordMapper.selectByCommunityIdOrByTicketIdOrByStatus(recordMap);
175
-
176
-        TpTicketRecordCommentVO tpTicketRecordCommentVO = new TpTicketRecordCommentVO();
177
-        BeanUtils.copyProperties(tpTicket,tpTicketRecordCommentVO);
178
-
179
-        // 转换待分配等 记录集合
180
-        List<TpTicketRecordVO> tpTicketRecordVOList = recordList.stream().map(e->{
181
-            TpTicketRecordVO tpTicketRecordVO = new TpTicketRecordVO();
182
-            BeanUtils.copyProperties(e,tpTicketRecordVO);
183
-            tpTicketRecordVO.setStatus(EnumUtils.getByCode(Integer.valueOf(e.getStatus()), TicketStatusEnum.class).toString());
184
-            return tpTicketRecordVO;
185
-        }).collect(Collectors.toList());
186
-
187
-        tpTicketRecordVOList.stream().map(e->{
188
-            // 查询参数
189
-            Map<String,Object> lastRecordMap = Maps.newHashMap();
190
-            // 表示查询出最新的一条
191
-            lastRecordMap.put("size",100);
192
-            // 设置工单编号
193
-            lastRecordMap.put("tickerId",e.getId());
194
-            List<TpTicketRecordComment> commentList = tpTicketRecordCommentMapper.selectByTicketId(lastRecordMap);
195
-            List<RecordCommentVO> commentVOList = commentList.stream().map(comment->{
196
-                RecordCommentVO commentVO = new RecordCommentVO();
197
-                BeanUtils.copyProperties(comment,commentVO);
198
-                commentVO.setUserType(EnumUtils.getByCode(Integer.valueOf(comment.getUserType()), TicketUserTypeEnum.class).toString());
199
-                return commentVO;
200
-            }).collect(Collectors.toList());
201
-
202
-
203
-            e.setComments(commentVOList);
204
-            return e;
205
-
206
-        }).collect(Collectors.toList());
207
-
208
-
209
-        response.addSuccess(tpTicketRecordVOList);
210
-
211
-        return response;
161
+    public TpTicket getTicketSchedule(String communityId, Integer ticketId) {
162
+        //查看工单详情
163
+        TpTicket ticket = tpTicketMapper.selectByTicketId(communityId,ticketId);
164
+        //工单进度
165
+        List<TpTicketRecord> ticketRecordList = tpTicketRecordMapper.getTicketRecordByTicketId(communityId,ticketId);
166
+        //工单回复
167
+        ticketRecordList.stream().forEach(TpTicketRecord -> {
168
+            List<TpTicketRecordComment> ticketRecordCommentList = tpTicketRecordCommentMapper.selectByTicketRecordId(TpTicketRecord);
169
+            TpTicketRecord.setTicketRecordCommentList(ticketRecordCommentList);
170
+         });
171
+        ticket.setTicketRecordList(ticketRecordList);
172
+        return ticket;
212 173
     }
213 174
 }

+ 124
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TaSysRoleMapper.xml 파일 보기

@@ -0,0 +1,124 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.community.huiju.dao.TaSysRoleMapper" >
4
+  <resultMap id="BaseResultMap" type="com.community.huiju.model.TaSysRole" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="role_name" property="roleName" jdbcType="VARCHAR" />
7
+    <result column="description" property="description" jdbcType="VARCHAR" />
8
+    <result column="create_user" property="createUser" jdbcType="INTEGER" />
9
+    <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
10
+    <result column="update_user" property="updateUser" jdbcType="INTEGER" />
11
+    <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
12
+  </resultMap>
13
+  <sql id="Base_Column_List" >
14
+    id, role_name, description, create_user, create_date, update_user, update_date
15
+  </sql>
16
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
17
+    select 
18
+    <include refid="Base_Column_List" />
19
+    from ta_sys_role
20
+    where id = #{id,jdbcType=INTEGER}
21
+  </select>
22
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
23
+    delete from ta_sys_role
24
+    where id = #{id,jdbcType=INTEGER}
25
+  </delete>
26
+  <insert id="insert" parameterType="com.community.huiju.model.TaSysRole" >
27
+    insert into ta_sys_role (id, role_name, description, 
28
+      create_user, create_date, update_user, 
29
+      update_date)
30
+    values (#{id,jdbcType=INTEGER}, #{roleName,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, 
31
+      #{createUser,jdbcType=INTEGER}, #{createDate,jdbcType=TIMESTAMP}, #{updateUser,jdbcType=INTEGER}, 
32
+      #{updateDate,jdbcType=TIMESTAMP})
33
+  </insert>
34
+  <insert id="insertSelective" parameterType="com.community.huiju.model.TaSysRole" >
35
+    insert into ta_sys_role
36
+    <trim prefix="(" suffix=")" suffixOverrides="," >
37
+      <if test="id != null" >
38
+        id,
39
+      </if>
40
+      <if test="roleName != null" >
41
+        role_name,
42
+      </if>
43
+      <if test="description != null" >
44
+        description,
45
+      </if>
46
+      <if test="createUser != null" >
47
+        create_user,
48
+      </if>
49
+      <if test="createDate != null" >
50
+        create_date,
51
+      </if>
52
+      <if test="updateUser != null" >
53
+        update_user,
54
+      </if>
55
+      <if test="updateDate != null" >
56
+        update_date,
57
+      </if>
58
+    </trim>
59
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
60
+      <if test="id != null" >
61
+        #{id,jdbcType=INTEGER},
62
+      </if>
63
+      <if test="roleName != null" >
64
+        #{roleName,jdbcType=VARCHAR},
65
+      </if>
66
+      <if test="description != null" >
67
+        #{description,jdbcType=VARCHAR},
68
+      </if>
69
+      <if test="createUser != null" >
70
+        #{createUser,jdbcType=INTEGER},
71
+      </if>
72
+      <if test="createDate != null" >
73
+        #{createDate,jdbcType=TIMESTAMP},
74
+      </if>
75
+      <if test="updateUser != null" >
76
+        #{updateUser,jdbcType=INTEGER},
77
+      </if>
78
+      <if test="updateDate != null" >
79
+        #{updateDate,jdbcType=TIMESTAMP},
80
+      </if>
81
+    </trim>
82
+  </insert>
83
+  <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.TaSysRole" >
84
+    update ta_sys_role
85
+    <set >
86
+      <if test="roleName != null" >
87
+        role_name = #{roleName,jdbcType=VARCHAR},
88
+      </if>
89
+      <if test="description != null" >
90
+        description = #{description,jdbcType=VARCHAR},
91
+      </if>
92
+      <if test="createUser != null" >
93
+        create_user = #{createUser,jdbcType=INTEGER},
94
+      </if>
95
+      <if test="createDate != null" >
96
+        create_date = #{createDate,jdbcType=TIMESTAMP},
97
+      </if>
98
+      <if test="updateUser != null" >
99
+        update_user = #{updateUser,jdbcType=INTEGER},
100
+      </if>
101
+      <if test="updateDate != null" >
102
+        update_date = #{updateDate,jdbcType=TIMESTAMP},
103
+      </if>
104
+    </set>
105
+    where id = #{id,jdbcType=INTEGER}
106
+  </update>
107
+  <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.TaSysRole" >
108
+    update ta_sys_role
109
+    set role_name = #{roleName,jdbcType=VARCHAR},
110
+      description = #{description,jdbcType=VARCHAR},
111
+      create_user = #{createUser,jdbcType=INTEGER},
112
+      create_date = #{createDate,jdbcType=TIMESTAMP},
113
+      update_user = #{updateUser,jdbcType=INTEGER},
114
+      update_date = #{updateDate,jdbcType=TIMESTAMP}
115
+    where id = #{id,jdbcType=INTEGER}
116
+  </update>
117
+  <select id="findRoleByUserId" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
118
+    select
119
+    <include refid="Base_Column_List" />
120
+    from ta_sys_role
121
+    	where id = (select role_id from ta_sys_user_role where user_id = #{userId})
122
+  </select>
123
+
124
+</mapper>

+ 89
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TaSysUserRoleMapper.xml 파일 보기

@@ -0,0 +1,89 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.community.huiju.dao.TaSysUserRoleMapper" >
4
+  <resultMap id="BaseResultMap" type="com.community.huiju.model.TaSysUserRole" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="community_id" property="communityId" jdbcType="INTEGER" />
7
+    <result column="user_id" property="userId" jdbcType="INTEGER" />
8
+    <result column="role_id" property="roleId" jdbcType="INTEGER" />
9
+  </resultMap>
10
+  <sql id="Base_Column_List" >
11
+    id, community_id, user_id, role_id
12
+  </sql>
13
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
14
+    select 
15
+    <include refid="Base_Column_List" />
16
+    from ta_sys_user_role
17
+    where id = #{id,jdbcType=INTEGER}
18
+  </select>
19
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
20
+    delete from ta_sys_user_role
21
+    where id = #{id,jdbcType=INTEGER}
22
+  </delete>
23
+  <insert id="insert" parameterType="com.community.huiju.model.TaSysUserRole" >
24
+    insert into ta_sys_user_role (id, community_id, user_id, 
25
+      role_id)
26
+    values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, 
27
+      #{roleId,jdbcType=INTEGER})
28
+  </insert>
29
+  <insert id="insertSelective" parameterType="com.community.huiju.model.TaSysUserRole" >
30
+    insert into ta_sys_user_role
31
+    <trim prefix="(" suffix=")" suffixOverrides="," >
32
+      <if test="id != null" >
33
+        id,
34
+      </if>
35
+      <if test="communityId != null" >
36
+        community_id,
37
+      </if>
38
+      <if test="userId != null" >
39
+        user_id,
40
+      </if>
41
+      <if test="roleId != null" >
42
+        role_id,
43
+      </if>
44
+    </trim>
45
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
46
+      <if test="id != null" >
47
+        #{id,jdbcType=INTEGER},
48
+      </if>
49
+      <if test="communityId != null" >
50
+        #{communityId,jdbcType=INTEGER},
51
+      </if>
52
+      <if test="userId != null" >
53
+        #{userId,jdbcType=INTEGER},
54
+      </if>
55
+      <if test="roleId != null" >
56
+        #{roleId,jdbcType=INTEGER},
57
+      </if>
58
+    </trim>
59
+  </insert>
60
+  <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.TaSysUserRole" >
61
+    update ta_sys_user_role
62
+    <set >
63
+      <if test="communityId != null" >
64
+        community_id = #{communityId,jdbcType=INTEGER},
65
+      </if>
66
+      <if test="userId != null" >
67
+        user_id = #{userId,jdbcType=INTEGER},
68
+      </if>
69
+      <if test="roleId != null" >
70
+        role_id = #{roleId,jdbcType=INTEGER},
71
+      </if>
72
+    </set>
73
+    where id = #{id,jdbcType=INTEGER}
74
+  </update>
75
+  <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.TaSysUserRole" >
76
+    update ta_sys_user_role
77
+    set community_id = #{communityId,jdbcType=INTEGER},
78
+      user_id = #{userId,jdbcType=INTEGER},
79
+      role_id = #{roleId,jdbcType=INTEGER}
80
+    where id = #{id,jdbcType=INTEGER}
81
+  </update>
82
+
83
+  <select id="findSysUserRoleByUserIdAndRoleId" resultType="java.lang.Integer" parameterType="java.lang.Integer" >
84
+    select
85
+    count(*)
86
+    from ta_sys_user_role
87
+    where user_id = #{userId,jdbcType=INTEGER} and role_id = 1
88
+  </select>
89
+</mapper>

+ 3
- 3
CODE/smart-community/app-api/src/main/resources/mapper/TpActivityMapper.xml 파일 보기

@@ -28,11 +28,11 @@
28 28
     activity_start_time, activity_end_time, status, create_user, create_date, update_user, 
29 29
     update_date
30 30
   </sql>
31
-  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
32
-    select 
31
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap">
32
+    select
33 33
     <include refid="Base_Column_List" />
34 34
     from tp_activity
35
-    where id = #{id,jdbcType=INTEGER} and #{communityId,jdbcType=INTEGER}
35
+    where id = #{id,jdbcType=INTEGER} and community_id = #{communityId,jdbcType=INTEGER}
36 36
   </select>
37 37
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
38 38
     delete from tp_activity

+ 11
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TpMessageMapper.xml 파일 보기

@@ -262,4 +262,15 @@
262 262
     ORDER BY
263 263
     create_date DESC
264 264
   </select>
265
+
266
+  <update id="updateReadStatus" parameterType="java.lang.Integer" >
267
+    update tp_message
268
+    set
269
+      read_status = 1
270
+    where community_id = #{communityId}
271
+    and advice_type = 1
272
+    and model_type = 1
273
+    and source = 1
274
+  </update>
275
+
265 276
 </mapper>

+ 23
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TpTicketMapper.xml 파일 보기

@@ -10,6 +10,7 @@
10 10
     <result column="status" property="status" jdbcType="CHAR" />
11 11
     <result column="type" property="type" jdbcType="CHAR" />
12 12
     <result column="repair_type" property="repairType" jdbcType="CHAR" />
13
+    <result column="repair_name" property="repairName" jdbcType="VARCHAR" />
13 14
     <result column="tp_user_id" property="tpUserId" jdbcType="INTEGER" />
14 15
     <result column="score" property="score" jdbcType="VARCHAR" />
15 16
     <result column="comment" property="comment" jdbcType="VARCHAR" />
@@ -224,4 +225,26 @@
224 225
         </if>
225 226
       </trim>
226 227
   </select>
228
+
229
+  <select id="selectByTicketId" resultMap="BaseResultMap" >
230
+     SELECT
231
+        t.id,
232
+        t.community_id,
233
+        t.ticket_title,
234
+        t.ticket_content,
235
+        t.STATUS,
236
+        t.type,
237
+        t.repair_type,
238
+        d.name as repair_name,
239
+        t.score,
240
+        t.COMMENT,
241
+        t.create_date
242
+    FROM
243
+        tp_ticket t
244
+        LEFT JOIN sys_dictionary d ON t.repair_type = d.CODE
245
+        AND d.group_id = ( SELECT id FROM sys_dictionary WHERE CODE = "ticket_repair_type" )
246
+    WHERE
247
+        t.id = #{ticketId,jdbcType=INTEGER}
248
+        AND t.community_id = #{communityId,jdbcType=INTEGER}
249
+  </select>
227 250
 </mapper>

+ 23
- 12
CODE/smart-community/app-api/src/main/resources/mapper/TpTicketRecordCommentMapper.xml 파일 보기

@@ -4,7 +4,7 @@
4 4
   <resultMap id="BaseResultMap" type="com.community.huiju.model.TpTicketRecordComment" >
5 5
     <id column="id" property="id" jdbcType="INTEGER" />
6 6
     <result column="community_id" property="communityId" jdbcType="INTEGER" />
7
-    <result column="ticker_id" property="tickerId" jdbcType="INTEGER" />
7
+    <result column="ticket_id" property="ticketId" jdbcType="INTEGER" />
8 8
     <result column="ticket_record_id" property="ticketRecordId" jdbcType="INTEGER" />
9 9
     <result column="uuid" property="uuid" jdbcType="INTEGER" />
10 10
     <result column="user_type" property="userType" jdbcType="CHAR" />
@@ -14,7 +14,7 @@
14 14
     <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
15 15
   </resultMap>
16 16
   <sql id="Base_Column_List" >
17
-    id, community_id, ticker_id, ticket_record_id, uuid, user_type, content, parent_id, 
17
+    id, community_id, ticket_id, ticket_record_id, uuid, user_type, content, parent_id,
18 18
     user_name, create_date
19 19
   </sql>
20 20
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
@@ -28,11 +28,11 @@
28 28
     where id = #{id,jdbcType=INTEGER}
29 29
   </delete>
30 30
   <insert id="insert" parameterType="com.community.huiju.model.TpTicketRecordComment" >
31
-    insert into tp_ticket_record_comment (id, community_id, ticker_id, 
31
+    insert into tp_ticket_record_comment (id, community_id, ticket_id,
32 32
       ticket_record_id, uuid, user_type, 
33 33
       content, parent_id, user_name, 
34 34
       create_date)
35
-    values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{tickerId,jdbcType=INTEGER}, 
35
+    values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{ticketId,jdbcType=INTEGER},
36 36
       #{ticketRecordId,jdbcType=INTEGER}, #{uuid,jdbcType=INTEGER}, #{userType,jdbcType=CHAR}, 
37 37
       #{content,jdbcType=VARCHAR}, #{parentId,jdbcType=INTEGER}, #{userName,jdbcType=VARCHAR}, 
38 38
       #{createDate,jdbcType=TIMESTAMP})
@@ -46,8 +46,8 @@
46 46
       <if test="communityId != null" >
47 47
         community_id,
48 48
       </if>
49
-      <if test="tickerId != null" >
50
-        ticker_id,
49
+      <if test="ticketId != null" >
50
+        ticket_id,
51 51
       </if>
52 52
       <if test="ticketRecordId != null" >
53 53
         ticket_record_id,
@@ -78,8 +78,8 @@
78 78
       <if test="communityId != null" >
79 79
         #{communityId,jdbcType=INTEGER},
80 80
       </if>
81
-      <if test="tickerId != null" >
82
-        #{tickerId,jdbcType=INTEGER},
81
+      <if test="ticketId != null" >
82
+        #{ticketId,jdbcType=INTEGER},
83 83
       </if>
84 84
       <if test="ticketRecordId != null" >
85 85
         #{ticketRecordId,jdbcType=INTEGER},
@@ -110,8 +110,8 @@
110 110
       <if test="communityId != null" >
111 111
         community_id = #{communityId,jdbcType=INTEGER},
112 112
       </if>
113
-      <if test="tickerId != null" >
114
-        ticker_id = #{tickerId,jdbcType=INTEGER},
113
+      <if test="ticketId != null" >
114
+        ticket_id = #{ticketId,jdbcType=INTEGER},
115 115
       </if>
116 116
       <if test="ticketRecordId != null" >
117 117
         ticket_record_id = #{ticketRecordId,jdbcType=INTEGER},
@@ -140,7 +140,7 @@
140 140
   <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.TpTicketRecordComment" >
141 141
     update tp_ticket_record_comment
142 142
     set community_id = #{communityId,jdbcType=INTEGER},
143
-      ticker_id = #{tickerId,jdbcType=INTEGER},
143
+      ticket_id = #{ticketId,jdbcType=INTEGER},
144 144
       ticket_record_id = #{ticketRecordId,jdbcType=INTEGER},
145 145
       uuid = #{uuid,jdbcType=INTEGER},
146 146
       user_type = #{userType,jdbcType=CHAR},
@@ -155,6 +155,17 @@
155 155
     select ttrc.* from tp_ticket tp
156 156
                 inner join tp_ticket_record ttr on tp.id = ttr.ticket_id
157 157
                 inner join tp_ticket_record_comment ttrc on ttr.ticket_id = ttrc.ticket_record_id
158
-    where tp.id=#{tickerId,jdbcType=INTEGER} order by ttrc.create_date DESC LIMIT #{size,jdbcType=INTEGER}
158
+    where tp.id=#{ticketId,jdbcType=INTEGER} order by ttrc.create_date DESC LIMIT #{size,jdbcType=INTEGER}
159
+  </select>
160
+
161
+  <select id="selectByTicketRecordId" parameterType="com.community.huiju.model.TpTicketRecord" resultMap="BaseResultMap" >
162
+    SELECT
163
+    <include refid="Base_Column_List" />
164
+    FROM
165
+        tp_ticket_record_comment
166
+    WHERE
167
+        community_id = #{communityId,jdbcType=INTEGER}
168
+        AND ticket_id = #{ticketId,jdbcType=INTEGER}
169
+        AND ticket_record_id = #{id,jdbcType=INTEGER}
159 170
   </select>
160 171
 </mapper>

+ 17
- 17
CODE/smart-community/app-api/src/main/resources/mapper/TpTicketRecordMapper.xml 파일 보기

@@ -16,7 +16,7 @@
16 16
     select 
17 17
     <include refid="Base_Column_List" />
18 18
     from tp_ticket_record
19
-    where id = #{id,jdbcType=INTEGER}
19
+    where ticket_id = #{ticketId,jdbcType=INTEGER}
20 20
   </select>
21 21
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
22 22
     delete from tp_ticket_record
@@ -92,7 +92,7 @@
92 92
         create_date = #{createDate,jdbcType=TIMESTAMP},
93 93
       </if>
94 94
     </set>
95
-    where id = #{id,jdbcType=INTEGER}
95
+    where ticket_id = #{ticketId,jdbcType=INTEGER}
96 96
   </update>
97 97
   <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.TpTicketRecord" >
98 98
     update tp_ticket_record
@@ -104,20 +104,20 @@
104 104
     where id = #{id,jdbcType=INTEGER}
105 105
   </update>
106 106
 
107
-  <select id="selectByCommunityIdOrByTicketIdOrByStatus" parameterType="map" resultMap="BaseResultMap" >
108
-    select
109
-    <include refid="Base_Column_List" />
110
-    from tp_ticket_record
111
-    <trim prefix="where" prefixOverrides="and">
112
-      <if test="communityId != null" >
113
-        and community_id = #{communityId,jdbcType=INTEGER}
114
-      </if>
115
-      <if test="ticketId != null" >
116
-        and ticket_id = #{ticketId,jdbcType=INTEGER}
117
-      </if>
118
-      <if test="status != null" >
119
-        and status = #{status,jdbcType=CHAR}
120
-      </if>
121
-    </trim>
107
+
108
+  <select id="getTicketRecordByTicketId" resultType="com.community.huiju.model.TpTicketRecord">
109
+    SELECT
110
+        t.id,
111
+        t.ticket_id AS ticketId,
112
+        t.community_id AS communityId,
113
+        d.NAME AS ticketStatusName
114
+    FROM
115
+        tp_ticket_record t
116
+        LEFT JOIN sys_dictionary d ON t.STATUS = d.CODE
117
+        AND d.group_id = ( SELECT id FROM sys_dictionary WHERE CODE = "ticket_status" )
118
+    WHERE
119
+        community_id = #{communityId,jdbcType=INTEGER}
120
+        AND ticket_id = #{ticketId,jdbcType=INTEGER}
121
+
122 122
   </select>
123 123
 </mapper>

+ 7
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TpTransactionMapper.xml 파일 보기

@@ -232,4 +232,11 @@
232 232
       update_date = #{updateDate,jdbcType=TIMESTAMP}
233 233
     where id = #{id,jdbcType=INTEGER}
234 234
   </update>
235
+
236
+  <select id="findAllTransaction" resultMap="BaseResultMap">
237
+    select
238
+    <include refid="Base_Column_List" />
239
+    from tp_transaction
240
+    where community_id = #{communityId,jdbcType=INTEGER} and type = #{type,jdbcType=VARCHAR}
241
+  </select>
235 242
 </mapper>

+ 14
- 0
CODE/smart-community/community-common/src/main/java/com/community/commom/constant/Constant.java 파일 보기

@@ -45,4 +45,18 @@ public class Constant {
45 45
     /** 社交二手租赁类型**/
46 46
     public static final String LEASE = "lease";
47 47
 
48
+    /**有效状态**/
49
+    public static final Integer EFFECTIVE = 1;
50
+
51
+    /**无效状态**/
52
+    public static final Integer INVALID = 0;
53
+
54
+    /**业主角色**/
55
+    public static final String OWNER = "owner";
56
+
57
+    /**租客角色**/
58
+    public static final String TENANT = "tenant";
59
+
60
+    /**家属角色**/
61
+    public static final String FAMILYMEMBER = "familyMember";
48 62
 }

BIN
CODE/smart-community/community-common/target/classes/com/community/commom/constant/Constant.class 파일 보기


+ 193
- 253
文档/MYSQL/smartCommunity.pdb
파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
파일 보기


+ 193
- 253
文档/MYSQL/smartCommunity.pdm
파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
파일 보기


BIN
文档/需求/app接口需求-第二版.xlsx 파일 보기