소스 검색

合并本地分支

weiximei 6 년 전
부모
커밋
19e0b87ed1

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

1
 package com.community.huiju.controller;
1
 package com.community.huiju.controller;
2
 
2
 
3
+import com.community.commom.constant.Constant;
3
 import com.community.commom.mode.ResponseBean;
4
 import com.community.commom.mode.ResponseBean;
5
+import com.community.huiju.config.entity.UserElement;
4
 import com.community.huiju.service.BillServiceI;
6
 import com.community.huiju.service.BillServiceI;
5
 import io.swagger.annotations.Api;
7
 import io.swagger.annotations.Api;
6
 import io.swagger.annotations.ApiImplicitParam;
8
 import io.swagger.annotations.ApiImplicitParam;
14
 import org.springframework.web.bind.annotation.RequestParam;
16
 import org.springframework.web.bind.annotation.RequestParam;
15
 import org.springframework.web.bind.annotation.RestController;
17
 import org.springframework.web.bind.annotation.RestController;
16
 
18
 
19
+import javax.servlet.http.HttpSession;
17
 import java.util.List;
20
 import java.util.List;
18
 import java.util.Map;
21
 import java.util.Map;
19
 
22
 
37
 			@ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageSize", value = "分页每页长度")})
40
 			@ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageSize", value = "分页每页长度")})
38
 	@RequestMapping(value = "/bills/{communityId}/{payType}",method = RequestMethod.GET)
41
 	@RequestMapping(value = "/bills/{communityId}/{payType}",method = RequestMethod.GET)
39
 	public ResponseBean getBillInvoice(@PathVariable Integer communityId,
42
 	public ResponseBean getBillInvoice(@PathVariable Integer communityId,
40
-	                                   @PathVariable Integer payType,
41
-	                                   @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
42
-	                                   @RequestParam(value ="pageSize",defaultValue = "5") Integer pageSize){
43
+									   @PathVariable Integer payType,
44
+									   @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
45
+									   @RequestParam(value ="pageSize",defaultValue = "5") Integer pageSize, HttpSession session){
46
+		UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
47
+		Integer userId = userElement.getId();
43
 		ResponseBean responseBean = new ResponseBean();
48
 		ResponseBean responseBean = new ResponseBean();
44
-		List<Map<String,Object>> billsList = billServiceI.getBillsList(communityId,payType,pageNum,pageSize);
49
+		List<Map<String,Object>> billsList = billServiceI.getBillsList(communityId, payType, userId, pageNum, pageSize);
45
 		responseBean.addSuccess(billsList);
50
 		responseBean.addSuccess(billsList);
46
 		return responseBean;
51
 		return responseBean;
47
 	}
52
 	}

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

2
 
2
 
3
 import com.community.commom.constant.Constant;
3
 import com.community.commom.constant.Constant;
4
 import com.community.commom.mode.ResponseBean;
4
 import com.community.commom.mode.ResponseBean;
5
+import com.community.huiju.config.entity.UserElement;
5
 import com.community.huiju.model.ToCommunities;
6
 import com.community.huiju.model.ToCommunities;
6
 import com.community.huiju.model.TpMessage;
7
 import com.community.huiju.model.TpMessage;
7
 import com.community.huiju.service.MessageServiceI;
8
 import com.community.huiju.service.MessageServiceI;
17
 import org.springframework.web.bind.annotation.RequestParam;
18
 import org.springframework.web.bind.annotation.RequestParam;
18
 import org.springframework.web.bind.annotation.RestController;
19
 import org.springframework.web.bind.annotation.RestController;
19
 
20
 
21
+import javax.servlet.http.HttpSession;
20
 import java.util.List;
22
 import java.util.List;
21
 import java.util.Map;
23
 import java.util.Map;
22
 
24
 
36
 	@ApiOperation(value = "按小区获取消息总数", notes = "按小区获取个人消息总数")
38
 	@ApiOperation(value = "按小区获取消息总数", notes = "按小区获取个人消息总数")
37
 	@ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "String", name = "communityId", value = "小区Id") })
39
 	@ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "String", name = "communityId", value = "小区Id") })
38
 	@RequestMapping(value = "/message/{communityId}/total",method = RequestMethod.GET)
40
 	@RequestMapping(value = "/message/{communityId}/total",method = RequestMethod.GET)
39
-	public ResponseBean getMessageTotal(@PathVariable Integer communityId){
41
+	public ResponseBean getMessageTotal(@PathVariable Integer communityId, HttpSession session){
42
+		UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
43
+		Integer userId = userElement.getId();
40
 		ResponseBean responseBean = new ResponseBean();
44
 		ResponseBean responseBean = new ResponseBean();
41
-		Map<String,Object> totalMap = messageService.getMessageTotal(communityId);
45
+		Map<String,Object> totalMap = messageService.getMessageTotal(communityId, userId);
42
 		responseBean.addSuccess(totalMap);
46
 		responseBean.addSuccess(totalMap);
43
 		return responseBean;
47
 		return responseBean;
44
 	}
48
 	}
50
 	@RequestMapping(value = "/message/{communityId}/news",method = RequestMethod.GET)
54
 	@RequestMapping(value = "/message/{communityId}/news",method = RequestMethod.GET)
51
 	public ResponseBean getNews(@PathVariable Integer communityId,
55
 	public ResponseBean getNews(@PathVariable Integer communityId,
52
 	                            @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
56
 	                            @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
53
-	                            @RequestParam(value ="pageSize",defaultValue = "5") Integer pageSize){
57
+	                            @RequestParam(value ="pageSize",defaultValue = "5") Integer pageSize, HttpSession session){
58
+		UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
59
+		Integer userId = userElement.getId();
54
 		ResponseBean responseBean = new ResponseBean();
60
 		ResponseBean responseBean = new ResponseBean();
55
-		List<TpMessage> newsList = messageService.getMessages(communityId,pageNum,pageSize, Constant.MODEL_TYPE_NEWS);
61
+		List<TpMessage> newsList = messageService.getMessages(communityId,pageNum,pageSize, Constant.MODEL_TYPE_NEWS, userId);
56
 		responseBean.addSuccess(newsList);
62
 		responseBean.addSuccess(newsList);
57
 		return responseBean;
63
 		return responseBean;
58
 	}
64
 	}
64
 	@RequestMapping(value = "/message/{communityId}/upcoming",method = RequestMethod.GET)
70
 	@RequestMapping(value = "/message/{communityId}/upcoming",method = RequestMethod.GET)
65
 	public ResponseBean getUpcoming(@PathVariable Integer communityId,
71
 	public ResponseBean getUpcoming(@PathVariable Integer communityId,
66
 	                                @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
72
 	                                @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
67
-	                                @RequestParam(value ="pageSize",defaultValue = "5") Integer pageSize){
73
+	                                @RequestParam(value ="pageSize",defaultValue = "5") Integer pageSize, HttpSession session){
74
+		UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
75
+		Integer userId = userElement.getId();
68
 		ResponseBean responseBean = new ResponseBean();
76
 		ResponseBean responseBean = new ResponseBean();
69
-		List<TpMessage> upcomingList = messageService.getMessages(communityId,pageNum,pageSize,Constant.MODEL_TYPE_UPCOMING);
77
+		List<TpMessage> upcomingList = messageService.getMessages(communityId,pageNum,pageSize,Constant.MODEL_TYPE_UPCOMING, userId);
70
 		responseBean.addSuccess(upcomingList);
78
 		responseBean.addSuccess(upcomingList);
71
 		return responseBean;
79
 		return responseBean;
72
 	}
80
 	}

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

5
 import com.community.huiju.config.entity.UserElement;
5
 import com.community.huiju.config.entity.UserElement;
6
 import com.community.huiju.model.TpActivity;
6
 import com.community.huiju.model.TpActivity;
7
 import com.community.huiju.model.TpAnnouncement;
7
 import com.community.huiju.model.TpAnnouncement;
8
-import com.community.huiju.model.TpMessage;
8
+import com.community.huiju.model.TpTicket;
9
 import com.community.huiju.model.TpTransaction;
9
 import com.community.huiju.model.TpTransaction;
10
-import com.community.huiju.model.*;
11
 import com.community.huiju.service.SocialServiceI;
10
 import com.community.huiju.service.SocialServiceI;
12
 import io.swagger.annotations.Api;
11
 import io.swagger.annotations.Api;
13
 import io.swagger.annotations.ApiImplicitParam;
12
 import io.swagger.annotations.ApiImplicitParam;
38
     @ApiOperation(value = "论坛公告帖子详情", notes = "获取论坛公告帖子详情")
37
     @ApiOperation(value = "论坛公告帖子详情", notes = "获取论坛公告帖子详情")
39
     @ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id"),
38
     @ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id"),
40
             @ApiImplicitParam(paramType = "query", dataType = "integer", name = "id", value = "公告帖子id")})
39
             @ApiImplicitParam(paramType = "query", dataType = "integer", name = "id", value = "公告帖子id")})
41
-    public ResponseBean findAnnouncementDetail(@PathVariable(value = "communityId")Integer communityId, @RequestParam("id") Integer id){
40
+    public ResponseBean findAnnouncementDetail(@PathVariable(value = "communityId")Integer communityId, @RequestParam("id") Integer id, HttpSession session){
41
+        UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
42
+        Integer userId = userElement.getId();
42
         ResponseBean responseBean = new ResponseBean();
43
         ResponseBean responseBean = new ResponseBean();
43
-        TpAnnouncement tpAnnouncement = socialServiceI.findAnnouncementDetail(id, communityId);
44
+        TpAnnouncement tpAnnouncement = socialServiceI.findAnnouncementDetail(id, communityId, userId);
44
         responseBean.addSuccess(tpAnnouncement);
45
         responseBean.addSuccess(tpAnnouncement);
45
         return responseBean;
46
         return responseBean;
46
     }
47
     }
49
     @ApiOperation(value = "活动报名接口", notes = "活动报名接口")
50
     @ApiOperation(value = "活动报名接口", notes = "活动报名接口")
50
     @ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id"),
51
     @ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id"),
51
                          @ApiImplicitParam(paramType = "query", dataType = "integer", name = "activityId", value = "活动Id")})
52
                          @ApiImplicitParam(paramType = "query", dataType = "integer", name = "activityId", value = "活动Id")})
52
-    public ResponseBean SignActivity(@PathVariable(value = "communityId")Integer communityId, @RequestParam("activityId")Integer activityId){
53
-        ResponseBean responseBean = socialServiceI.findTaUserInfo(activityId, communityId);
53
+    public ResponseBean SignActivity(@PathVariable(value = "communityId")Integer communityId, @RequestParam("activityId")Integer activityId, HttpSession session){
54
+        UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
55
+        Integer userId = userElement.getId();
56
+        ResponseBean responseBean = socialServiceI.findTaUserInfo(activityId, communityId, userId);
54
         return responseBean;
57
         return responseBean;
55
     }
58
     }
56
     
59
     
101
     @ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id"),
104
     @ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id"),
102
             @ApiImplicitParam(paramType = "query", dataType = "integer", name = "activityId", value = "活动帖子id")})
105
             @ApiImplicitParam(paramType = "query", dataType = "integer", name = "activityId", value = "活动帖子id")})
103
     @RequestMapping(value = "/activity/{communityId}", method = RequestMethod.GET)
106
     @RequestMapping(value = "/activity/{communityId}", method = RequestMethod.GET)
104
-    public ResponseBean findActivityDetail(@PathVariable(value = "communityId")Integer communityId, @RequestParam("activityId") Integer activityId){
107
+    public ResponseBean findActivityDetail(@PathVariable(value = "communityId")Integer communityId, @RequestParam("activityId") Integer activityId, HttpSession session){
108
+        UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
109
+        Integer userId = userElement.getId();
105
         ResponseBean responseBean = new ResponseBean();
110
         ResponseBean responseBean = new ResponseBean();
106
-        TpActivity activity = socialServiceI.findActivityDetail(activityId, communityId);
111
+        TpActivity activity = socialServiceI.findActivityDetail(activityId, communityId, userId);
107
         responseBean.addSuccess(activity);
112
         responseBean.addSuccess(activity);
108
         return responseBean;
113
         return responseBean;
109
     }
114
     }
115
     public ResponseBean findUsedDetails(@PathVariable(value = "communityId")Integer communityId, @RequestParam("activityId") Integer activityId, HttpSession session){
120
     public ResponseBean findUsedDetails(@PathVariable(value = "communityId")Integer communityId, @RequestParam("activityId") Integer activityId, HttpSession session){
116
         ResponseBean responseBean = new ResponseBean();
121
         ResponseBean responseBean = new ResponseBean();
117
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
122
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
118
-        Integer userId=userElement.getId();
123
+        Integer userId = userElement.getId();
119
         TpTransaction activity = socialServiceI.findUsedDetails(activityId, communityId,userId);
124
         TpTransaction activity = socialServiceI.findUsedDetails(activityId, communityId,userId);
120
         responseBean.addSuccess(activity);
125
         responseBean.addSuccess(activity);
121
         return responseBean;
126
         return responseBean;
140
     @ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id"),
145
     @ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id"),
141
             @ApiImplicitParam(paramType = "query", dataType = "integer", name = "ticketId", value = "帖子Id")})
146
             @ApiImplicitParam(paramType = "query", dataType = "integer", name = "ticketId", value = "帖子Id")})
142
     @RequestMapping(value = "/stopTicket/{communityId}", method = RequestMethod.GET)
147
     @RequestMapping(value = "/stopTicket/{communityId}", method = RequestMethod.GET)
143
-    public ResponseBean stopTicket(@PathVariable("communityId")Integer communityId, @RequestParam("ticketId")Integer ticketId){
144
-        ResponseBean responseBean = socialServiceI.stopTpTicketRecord(communityId, ticketId);
148
+    public ResponseBean stopTicket(@PathVariable("communityId")Integer communityId, @RequestParam("ticketId")Integer ticketId, HttpSession session){
149
+        UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
150
+        Integer userId = userElement.getId();
151
+        ResponseBean responseBean = socialServiceI.stopTpTicketRecord(communityId, ticketId, userId);
145
         return responseBean;
152
         return responseBean;
146
     }
153
     }
147
 
154
 
166
     public ResponseBean addTransaction(TpTransaction tpTransaction, HttpSession session){
173
     public ResponseBean addTransaction(TpTransaction tpTransaction, HttpSession session){
167
         ResponseBean responseBean = new ResponseBean();
174
         ResponseBean responseBean = new ResponseBean();
168
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
175
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
169
-        Integer userId=userElement.getId();
176
+        Integer userId = userElement.getId();
170
         ResponseBean response=socialServiceI.addAllTransaction(userId,tpTransaction);
177
         ResponseBean response=socialServiceI.addAllTransaction(userId,tpTransaction);
171
         return response;
178
         return response;
172
     }
179
     }
205
             @ApiImplicitParam(name = "tpTicket", value = "报修", required = true, dataType ="TpTicket"),
212
             @ApiImplicitParam(name = "tpTicket", value = "报修", required = true, dataType ="TpTicket"),
206
             @ApiImplicitParam(paramType = "query", dataType = "integer", name = "ticketId", value = "工单Id")})
213
             @ApiImplicitParam(paramType = "query", dataType = "integer", name = "ticketId", value = "工单Id")})
207
     @RequestMapping(value = "/accessTicket/{communityId}", method = RequestMethod.POST)
214
     @RequestMapping(value = "/accessTicket/{communityId}", method = RequestMethod.POST)
208
-    public ResponseBean accessTicket(@PathVariable("communityId")Integer communityId, @RequestBody TpTicket tpTicket, @RequestParam("ticketId")String ticketId){
215
+    public ResponseBean accessTicket(@PathVariable("communityId")Integer communityId, @RequestBody TpTicket tpTicket, @RequestParam("ticketId")String ticketId, HttpSession session){
216
+        UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
217
+        Integer userId = userElement.getId();
209
         ResponseBean responseBean = new ResponseBean();
218
         ResponseBean responseBean = new ResponseBean();
210
-        socialServiceI.accessTicket(communityId, tpTicket, ticketId);
219
+        socialServiceI.accessTicket(communityId, tpTicket, ticketId, userId);
211
         return responseBean;
220
         return responseBean;
212
     }
221
     }
213
 }
222
 }

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

100
     @ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id"),
100
     @ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id"),
101
             @ApiImplicitParam(name = "tpTicketRecordComment", value = "回复记录参数", paramType ="body")})
101
             @ApiImplicitParam(name = "tpTicketRecordComment", value = "回复记录参数", paramType ="body")})
102
     @RequestMapping(value = "/ticket/reply/{communityId}", method = RequestMethod.POST)
102
     @RequestMapping(value = "/ticket/reply/{communityId}", method = RequestMethod.POST)
103
-    public ResponseBean updateTicketsReply(@PathVariable(value = "communityId") Integer communityId, @RequestBody TpTicketRecordComment tpTicketRecordComment){
103
+    public ResponseBean updateTicketsReply(@PathVariable(value = "communityId") Integer communityId, @RequestBody TpTicketRecordComment tpTicketRecordComment, HttpSession session){
104
+        UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
105
+        Integer userId = userElement.getId();
104
         ResponseBean responseBean = new ResponseBean();
106
         ResponseBean responseBean = new ResponseBean();
105
         tpTicketRecordComment.setCommunityId(communityId);
107
         tpTicketRecordComment.setCommunityId(communityId);
106
-        Integer size = iTicketService.updateTicketsReply(tpTicketRecordComment);
108
+        Integer size = iTicketService.updateTicketsReply(tpTicketRecordComment, userId);
107
         if (size > 0){
109
         if (size > 0){
108
             responseBean.addSuccess(size);
110
             responseBean.addSuccess(size);
109
         }else{
111
         }else{
124
     public ResponseBean addTransaction(TpTicket tpTicket, HttpSession session){
126
     public ResponseBean addTransaction(TpTicket tpTicket, HttpSession session){
125
         ResponseBean responseBean = new ResponseBean();
127
         ResponseBean responseBean = new ResponseBean();
126
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
128
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
127
-        Integer userId=userElement.getId();
129
+        Integer userId = userElement.getId();
128
         ResponseBean response=iTicketService.addAiTicketService(userId,tpTicket);
130
         ResponseBean response=iTicketService.addAiTicketService(userId,tpTicket);
129
         return response;
131
         return response;
130
     }
132
     }

+ 4
- 3
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/UserController.java 파일 보기

76
 
76
 
77
     @ApiOperation(value = "查看房屋成员列表", notes = "查看房屋成员列表")
77
     @ApiOperation(value = "查看房屋成员列表", notes = "查看房屋成员列表")
78
     @RequestMapping(value = "/roomUserList", method = RequestMethod.GET)
78
     @RequestMapping(value = "/roomUserList", method = RequestMethod.GET)
79
-    public ResponseBean accessTicket(){
79
+    public ResponseBean accessTicket(HttpSession session){
80
+        UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
81
+        Integer userId = userElement.getId();
80
         ResponseBean responseBean = new ResponseBean();
82
         ResponseBean responseBean = new ResponseBean();
81
-        //todo
82
-        List<TaUser> taUserList = iTaUserService.getAllRoomUserList(1);
83
+        List<TaUser> taUserList = iTaUserService.getAllRoomUserList(userId);
83
         responseBean.addSuccess(taUserList);
84
         responseBean.addSuccess(taUserList);
84
         return responseBean;
85
         return responseBean;
85
     }
86
     }

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/BillServiceI.java 파일 보기

12
 	 * @param pageSize
12
 	 * @param pageSize
13
 	 * @return
13
 	 * @return
14
 	 */
14
 	 */
15
-	List<Map<String, Object>> getBillsList(Integer communityId, Integer payType, Integer pageNum, Integer pageSize);
15
+	List<Map<String, Object>> getBillsList(Integer communityId, Integer payType, Integer userId ,Integer pageNum, Integer pageSize);
16
 	
16
 	
17
 	/**
17
 	/**
18
 	 * 获取账单的详细信息
18
 	 * 获取账单的详细信息

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

53
 	 * @param tpTicketRecordComment
53
 	 * @param tpTicketRecordComment
54
 	 * @return
54
 	 * @return
55
 	 */
55
 	 */
56
-	Integer updateTicketsReply(TpTicketRecordComment tpTicketRecordComment);
56
+	Integer updateTicketsReply(TpTicketRecordComment tpTicketRecordComment, Integer userId);
57
 }
57
 }

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

11
 	 * @param communityId
11
 	 * @param communityId
12
 	 * @return
12
 	 * @return
13
 	 */
13
 	 */
14
-	Map<String, Object> getMessageTotal(Integer communityId);
14
+	Map<String, Object> getMessageTotal(Integer communityId, Integer userId);
15
 	
15
 	
16
 	/**
16
 	/**
17
 	 * 分页获取消息或待办
17
 	 * 分页获取消息或待办
21
 	 * @param modelType
21
 	 * @param modelType
22
 	 * @return
22
 	 * @return
23
 	 */
23
 	 */
24
-	List<TpMessage> getMessages(Integer communityId, Integer pageNum, Integer pageSize,Integer modelType);
24
+	List<TpMessage> getMessages(Integer communityId, Integer pageNum, Integer pageSize,Integer modelType, Integer userId);
25
 
25
 
26
 	/**
26
 	/**
27
 	 * 全部已读
27
 	 * 全部已读

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

11
  * @date 2018/10/23
11
  * @date 2018/10/23
12
  */
12
  */
13
 public interface SocialServiceI {
13
 public interface SocialServiceI {
14
-    TpAnnouncement findAnnouncementDetail(Integer id, Integer communityId);
14
+    TpAnnouncement findAnnouncementDetail(Integer id, Integer communityId, Integer userId);
15
 
15
 
16
 
16
 
17
 	/**
17
 	/**
47
 	 * @param communityId
47
 	 * @param communityId
48
 	 * @return
48
 	 * @return
49
 	 */
49
 	 */
50
-	TpActivity findActivityDetail(Integer activityId, Integer communityId);
50
+	TpActivity findActivityDetail(Integer activityId, Integer communityId, Integer userId);
51
 
51
 
52
-	ResponseBean findTaUserInfo(Integer id, Integer communityId);
52
+	ResponseBean findTaUserInfo(Integer id, Integer communityId, Integer userId);
53
 
53
 
54
 	/**
54
 	/**
55
 	 * 获取二手租赁详情
55
 	 * 获取二手租赁详情
72
 	 * @param ticketId
72
 	 * @param ticketId
73
 	 * @return
73
 	 * @return
74
 	 */
74
 	 */
75
-	ResponseBean stopTpTicketRecord(Integer communityId, Integer ticketId);
75
+	ResponseBean stopTpTicketRecord(Integer communityId, Integer ticketId, Integer userId);
76
 
76
 
77
 	/**
77
 	/**
78
 	 * 添加二手租赁帖子
78
 	 * 添加二手租赁帖子
101
 	 * @param tpTicket
101
 	 * @param tpTicket
102
 	 * @param ticketId
102
 	 * @param ticketId
103
 	 */
103
 	 */
104
-	void accessTicket(Integer communityId, TpTicket tpTicket, String ticketId);
104
+	void accessTicket(Integer communityId, TpTicket tpTicket, String ticketId, Integer userId);
105
 }
105
 }

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

28
 	 * @return
28
 	 * @return
29
 	 */
29
 	 */
30
 	@Override
30
 	@Override
31
-	public List<Map<String, Object>> getBillsList(Integer communityId, Integer payType, Integer pageNum, Integer pageSize) {
32
-		//todo
33
-		Integer userId = 1;
31
+	public List<Map<String, Object>> getBillsList(Integer communityId, Integer payType, Integer userId ,Integer pageNum, Integer pageSize) {
34
 		//使用分页插件
32
 		//使用分页插件
35
 		PageHelper.startPage(pageNum, pageSize);
33
 		PageHelper.startPage(pageNum, pageSize);
36
-		List<Map<String,Object>> billsList = tpBillInvoiceMapper.getBillsList(communityId,userId,payType);
34
+		List<Map<String,Object>> billsList = tpBillInvoiceMapper.getBillsList(communityId, userId, payType);
37
 		return billsList;
35
 		return billsList;
38
 	}
36
 	}
39
 	
37
 	

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

26
 	 * @return
26
 	 * @return
27
 	 */
27
 	 */
28
 	@Override
28
 	@Override
29
-	public Map<String, Object> getMessageTotal(Integer communityId) {
30
-		//todo
31
-		Integer userId = 1;
29
+	public Map<String, Object> getMessageTotal(Integer communityId, Integer userId) {
32
 		return tpMessageMapper.getMessageTotal(userId,communityId);
30
 		return tpMessageMapper.getMessageTotal(userId,communityId);
33
 	}
31
 	}
34
 	
32
 	
41
 	 * @return
39
 	 * @return
42
 	 */
40
 	 */
43
 	@Override
41
 	@Override
44
-	public List<TpMessage> getMessages(Integer communityId, Integer pageNum, Integer pageSize,Integer modelType) {
45
-		//todo
46
-		Integer userId = 1;
42
+	public List<TpMessage> getMessages(Integer communityId, Integer pageNum, Integer pageSize,Integer modelType, Integer userId) {
47
 		//使用分页插件
43
 		//使用分页插件
48
 		PageHelper.startPage(pageNum, pageSize);
44
 		PageHelper.startPage(pageNum, pageSize);
49
 		// 获取数据
45
 		// 获取数据

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

59
 
59
 
60
     @Override
60
     @Override
61
     @Transactional
61
     @Transactional
62
-    public TpAnnouncement findAnnouncementDetail(Integer id, Integer communityId) {
63
-        //TODO
64
-        Integer userId = 1;
62
+    public TpAnnouncement findAnnouncementDetail(Integer id, Integer communityId, Integer userId) {
65
         //更新此用户的查看次数操作
63
         //更新此用户的查看次数操作
66
         Integer allViewNum = updateSocialView(userId,Constant.ANNOUNCEMENT,communityId,id);
64
         Integer allViewNum = updateSocialView(userId,Constant.ANNOUNCEMENT,communityId,id);
67
         if (null != allViewNum){
65
         if (null != allViewNum){
123
      * @return
121
      * @return
124
      */
122
      */
125
     @Override
123
     @Override
126
-    public TpActivity findActivityDetail(Integer activityId, Integer communityId) {
127
-        //TODO
128
-        Integer userId = 1;
124
+    public TpActivity findActivityDetail(Integer activityId, Integer communityId, Integer userId) {
129
         //更新查看次数
125
         //更新查看次数
130
         Integer allViewNum = updateSocialView(userId,Constant.ACTIVITY,communityId,activityId);
126
         Integer allViewNum = updateSocialView(userId,Constant.ACTIVITY,communityId,activityId);
131
         if (null != allViewNum){
127
         if (null != allViewNum){
165
     }
161
     }
166
 
162
 
167
     @Override
163
     @Override
168
-    public ResponseBean findTaUserInfo(Integer activityId, Integer communityId) {
164
+    public ResponseBean findTaUserInfo(Integer activityId, Integer communityId, Integer userId) {
169
         ResponseBean responseBean = new ResponseBean();
165
         ResponseBean responseBean = new ResponseBean();
170
         TpActivity tpActivity = tpActivityMapper.selectByPrimaryKey(activityId, communityId);
166
         TpActivity tpActivity = tpActivityMapper.selectByPrimaryKey(activityId, communityId);
171
         //判断是否已经过了报名截至时间
167
         //判断是否已经过了报名截至时间
187
 
183
 
188
 
184
 
189
         //判断身份是否为业主且状态为已停用
185
         //判断身份是否为业主且状态为已停用
190
-        //从seession中获取的user_id
191
-        //TODO
192
-        TaSysRole sysRole = taSysRoleMapper.findRoleByUserId(1);
193
-        TaUser taUser = taUserMapper.selectByPrimaryKey(1);
186
+        TaSysRole sysRole = taSysRoleMapper.findRoleByUserId(userId);
187
+        TaUser taUser = taUserMapper.selectByPrimaryKey(userId);
194
         if (Constant.INVALID.equals(taUser.getStatus())
188
         if (Constant.INVALID.equals(taUser.getStatus())
195
             && Constant.OWNER.equals(sysRole.getRoleName())){
189
             && Constant.OWNER.equals(sysRole.getRoleName())){
196
 
190
 
197
-            return insertActivitySignUp(tpActivity, communityId);
191
+            return insertActivitySignUp(tpActivity, communityId, userId);
198
         }
192
         }
199
 
193
 
200
         //身份为家属租客,状态为已停用
194
         //身份为家属租客,状态为已停用
201
         if (Constant.INVALID.equals(taUser.getStatus())
195
         if (Constant.INVALID.equals(taUser.getStatus())
202
             && (Constant.FAMILYMEMBER.equals(sysRole.getRoleName())) || Constant.TENANT.equals(sysRole.getRoleName())){
196
             && (Constant.FAMILYMEMBER.equals(sysRole.getRoleName())) || Constant.TENANT.equals(sysRole.getRoleName())){
203
 
197
 
204
-            return insertActivitySignUp(tpActivity, communityId);
198
+            return insertActivitySignUp(tpActivity, communityId, userId);
205
         }
199
         }
206
 
200
 
207
         if (Constant.EFFECTIVE.equals(taUser.getStatus())
201
         if (Constant.EFFECTIVE.equals(taUser.getStatus())
208
                 && (Constant.FAMILYMEMBER.equals(sysRole.getRoleName()))
202
                 && (Constant.FAMILYMEMBER.equals(sysRole.getRoleName()))
209
                 || Constant.TENANT.equals(sysRole.getRoleName())
203
                 || Constant.TENANT.equals(sysRole.getRoleName())
210
                 || Constant.OWNER.equals(sysRole.getRoleName())){
204
                 || Constant.OWNER.equals(sysRole.getRoleName())){
211
-            return insertActivitySignUp(tpActivity, communityId);
205
+            return insertActivitySignUp(tpActivity, communityId, userId);
212
         }
206
         }
213
         responseBean.addError("9999", "服务器异常");
207
         responseBean.addError("9999", "服务器异常");
214
         return responseBean;
208
         return responseBean;
222
 
216
 
223
     @Transactional
217
     @Transactional
224
     @Override
218
     @Override
225
-    public ResponseBean stopTpTicketRecord(Integer communityId, Integer ticketId) {
219
+    public ResponseBean stopTpTicketRecord(Integer communityId, Integer ticketId, Integer userId) {
226
         ResponseBean responseBean = new ResponseBean();
220
         ResponseBean responseBean = new ResponseBean();
227
         try{
221
         try{
228
             TpTicket tpTicket = new TpTicket();
222
             TpTicket tpTicket = new TpTicket();
235
             tpTicketRecord.setTicketId(ticketId);
229
             tpTicketRecord.setTicketId(ticketId);
236
             tpTicketRecord.setCommunityId(communityId);
230
             tpTicketRecord.setCommunityId(communityId);
237
             //TODO
231
             //TODO
238
-            tpTicketRecord.setCreateUser(1);
232
+            tpTicketRecord.setCreateUser(userId);
239
             tpTicketRecord.setCreateDate(new Date());
233
             tpTicketRecord.setCreateDate(new Date());
240
             tpTicketRecordMapper.insertSelective(tpTicketRecord);
234
             tpTicketRecordMapper.insertSelective(tpTicketRecord);
241
             return responseBean;
235
             return responseBean;
296
     }
290
     }
297
 
291
 
298
     @Override
292
     @Override
299
-    public void accessTicket(Integer communityId, TpTicket tpTicket, String ticketId) {
293
+    public void accessTicket(Integer communityId, TpTicket tpTicket, String ticketId, Integer userId) {
300
         //修改工单内容和评分
294
         //修改工单内容和评分
301
         tpTicket.setId(Integer.valueOf(ticketId));
295
         tpTicket.setId(Integer.valueOf(ticketId));
302
         tpTicket.setStatus("5");
296
         tpTicket.setStatus("5");
308
         record.setTicketId(Integer.valueOf(ticketId));
302
         record.setTicketId(Integer.valueOf(ticketId));
309
         record.setStatus("5");
303
         record.setStatus("5");
310
         //todo
304
         //todo
311
-        record.setCreateUser(1);
305
+        record.setCreateUser(userId);
312
         record.setCreateDate(new Date());
306
         record.setCreateDate(new Date());
313
         tpTicketRecordMapper.insertSelective(record);
307
         tpTicketRecordMapper.insertSelective(record);
314
     }
308
     }
315
 
309
 
316
-    public ResponseBean insertActivitySignUp(TpActivity tpActivity, Integer communityId){
310
+    public ResponseBean insertActivitySignUp(TpActivity tpActivity, Integer communityId, Integer userId){
317
         ResponseBean responseBean = new ResponseBean();
311
         ResponseBean responseBean = new ResponseBean();
318
         //判断是否已经报名
312
         //判断是否已经报名
319
         //todo
313
         //todo
320
-        Integer signNum = tpActivitySignupMapper.findTpActivetitySignByUserId(tpActivity.getId(), communityId, 1);
314
+        Integer signNum = tpActivitySignupMapper.findTpActivetitySignByUserId(tpActivity.getId(), communityId, userId);
321
         if (signNum != 0){
315
         if (signNum != 0){
322
             responseBean.addError("9996", "您已报名,请勿重复报名");
316
             responseBean.addError("9996", "您已报名,请勿重复报名");
323
             return responseBean;
317
             return responseBean;

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

203
      * @return
203
      * @return
204
      */
204
      */
205
     @Override
205
     @Override
206
-    public Integer updateTicketsReply(TpTicketRecordComment tpTicketRecordComment) {
207
-        Integer userId = 1;
206
+    public Integer updateTicketsReply(TpTicketRecordComment tpTicketRecordComment, Integer userId) {
208
         //查询用户名
207
         //查询用户名
209
         TaUser taUser = taUserMapper.selectByPrimaryKey(userId);
208
         TaUser taUser = taUserMapper.selectByPrimaryKey(userId);
210
         
209