Kaynağa Gözat

合并本地分支

weiximei 6 yıl önce
ebeveyn
işleme
19e0b87ed1

+ 9
- 4
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/BillController.java Dosyayı Görüntüle

@@ -1,6 +1,8 @@
1 1
 package com.community.huiju.controller;
2 2
 
3
+import com.community.commom.constant.Constant;
3 4
 import com.community.commom.mode.ResponseBean;
5
+import com.community.huiju.config.entity.UserElement;
4 6
 import com.community.huiju.service.BillServiceI;
5 7
 import io.swagger.annotations.Api;
6 8
 import io.swagger.annotations.ApiImplicitParam;
@@ -14,6 +16,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
14 16
 import org.springframework.web.bind.annotation.RequestParam;
15 17
 import org.springframework.web.bind.annotation.RestController;
16 18
 
19
+import javax.servlet.http.HttpSession;
17 20
 import java.util.List;
18 21
 import java.util.Map;
19 22
 
@@ -37,11 +40,13 @@ public class BillController {
37 40
 			@ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageSize", value = "分页每页长度")})
38 41
 	@RequestMapping(value = "/bills/{communityId}/{payType}",method = RequestMethod.GET)
39 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 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 50
 		responseBean.addSuccess(billsList);
46 51
 		return responseBean;
47 52
 	}

+ 14
- 6
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/MessageController.java Dosyayı Görüntüle

@@ -2,6 +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.config.entity.UserElement;
5 6
 import com.community.huiju.model.ToCommunities;
6 7
 import com.community.huiju.model.TpMessage;
7 8
 import com.community.huiju.service.MessageServiceI;
@@ -17,6 +18,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
17 18
 import org.springframework.web.bind.annotation.RequestParam;
18 19
 import org.springframework.web.bind.annotation.RestController;
19 20
 
21
+import javax.servlet.http.HttpSession;
20 22
 import java.util.List;
21 23
 import java.util.Map;
22 24
 
@@ -36,9 +38,11 @@ public class MessageController {
36 38
 	@ApiOperation(value = "按小区获取消息总数", notes = "按小区获取个人消息总数")
37 39
 	@ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "String", name = "communityId", value = "小区Id") })
38 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 44
 		ResponseBean responseBean = new ResponseBean();
41
-		Map<String,Object> totalMap = messageService.getMessageTotal(communityId);
45
+		Map<String,Object> totalMap = messageService.getMessageTotal(communityId, userId);
42 46
 		responseBean.addSuccess(totalMap);
43 47
 		return responseBean;
44 48
 	}
@@ -50,9 +54,11 @@ public class MessageController {
50 54
 	@RequestMapping(value = "/message/{communityId}/news",method = RequestMethod.GET)
51 55
 	public ResponseBean getNews(@PathVariable Integer communityId,
52 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 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 62
 		responseBean.addSuccess(newsList);
57 63
 		return responseBean;
58 64
 	}
@@ -64,9 +70,11 @@ public class MessageController {
64 70
 	@RequestMapping(value = "/message/{communityId}/upcoming",method = RequestMethod.GET)
65 71
 	public ResponseBean getUpcoming(@PathVariable Integer communityId,
66 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 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 78
 		responseBean.addSuccess(upcomingList);
71 79
 		return responseBean;
72 80
 	}

+ 23
- 14
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/SocialController.java Dosyayı Görüntüle

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

+ 5
- 3
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/TicketController.java Dosyayı Görüntüle

@@ -100,10 +100,12 @@ public class TicketController {
100 100
     @ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id"),
101 101
             @ApiImplicitParam(name = "tpTicketRecordComment", value = "回复记录参数", paramType ="body")})
102 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 106
         ResponseBean responseBean = new ResponseBean();
105 107
         tpTicketRecordComment.setCommunityId(communityId);
106
-        Integer size = iTicketService.updateTicketsReply(tpTicketRecordComment);
108
+        Integer size = iTicketService.updateTicketsReply(tpTicketRecordComment, userId);
107 109
         if (size > 0){
108 110
             responseBean.addSuccess(size);
109 111
         }else{
@@ -124,7 +126,7 @@ public class TicketController {
124 126
     public ResponseBean addTransaction(TpTicket tpTicket, HttpSession session){
125 127
         ResponseBean responseBean = new ResponseBean();
126 128
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
127
-        Integer userId=userElement.getId();
129
+        Integer userId = userElement.getId();
128 130
         ResponseBean response=iTicketService.addAiTicketService(userId,tpTicket);
129 131
         return response;
130 132
     }

+ 4
- 3
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/UserController.java Dosyayı Görüntüle

@@ -76,10 +76,11 @@ public class UserController {
76 76
 
77 77
     @ApiOperation(value = "查看房屋成员列表", notes = "查看房屋成员列表")
78 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 82
         ResponseBean responseBean = new ResponseBean();
81
-        //todo
82
-        List<TaUser> taUserList = iTaUserService.getAllRoomUserList(1);
83
+        List<TaUser> taUserList = iTaUserService.getAllRoomUserList(userId);
83 84
         responseBean.addSuccess(taUserList);
84 85
         return responseBean;
85 86
     }

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/BillServiceI.java Dosyayı Görüntüle

@@ -12,7 +12,7 @@ public interface BillServiceI {
12 12
 	 * @param pageSize
13 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 Dosyayı Görüntüle

@@ -53,5 +53,5 @@ public interface ITicketService {
53 53
 	 * @param tpTicketRecordComment
54 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 Dosyayı Görüntüle

@@ -11,7 +11,7 @@ public interface MessageServiceI {
11 11
 	 * @param communityId
12 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,7 +21,7 @@ public interface MessageServiceI {
21 21
 	 * @param modelType
22 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 Dosyayı Görüntüle

@@ -11,7 +11,7 @@ import java.util.List;
11 11
  * @date 2018/10/23
12 12
  */
13 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,9 +47,9 @@ public interface SocialServiceI {
47 47
 	 * @param communityId
48 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,7 +72,7 @@ public interface SocialServiceI {
72 72
 	 * @param ticketId
73 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,5 +101,5 @@ public interface SocialServiceI {
101 101
 	 * @param tpTicket
102 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 Dosyayı Görüntüle

@@ -28,12 +28,10 @@ public class BillServiceImpl implements BillServiceI {
28 28
 	 * @return
29 29
 	 */
30 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 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 35
 		return billsList;
38 36
 	}
39 37
 	

+ 2
- 6
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/MessageServiceImpl.java Dosyayı Görüntüle

@@ -26,9 +26,7 @@ public class MessageServiceImpl implements MessageServiceI {
26 26
 	 * @return
27 27
 	 */
28 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 30
 		return tpMessageMapper.getMessageTotal(userId,communityId);
33 31
 	}
34 32
 	
@@ -41,9 +39,7 @@ public class MessageServiceImpl implements MessageServiceI {
41 39
 	 * @return
42 40
 	 */
43 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 44
 		PageHelper.startPage(pageNum, pageSize);
49 45
 		// 获取数据

+ 14
- 20
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java Dosyayı Görüntüle

@@ -59,9 +59,7 @@ public class SocialServiceImpl implements SocialServiceI {
59 59
 
60 60
     @Override
61 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 64
         Integer allViewNum = updateSocialView(userId,Constant.ANNOUNCEMENT,communityId,id);
67 65
         if (null != allViewNum){
@@ -123,9 +121,7 @@ public class SocialServiceImpl implements SocialServiceI {
123 121
      * @return
124 122
      */
125 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 126
         Integer allViewNum = updateSocialView(userId,Constant.ACTIVITY,communityId,activityId);
131 127
         if (null != allViewNum){
@@ -165,7 +161,7 @@ public class SocialServiceImpl implements SocialServiceI {
165 161
     }
166 162
 
167 163
     @Override
168
-    public ResponseBean findTaUserInfo(Integer activityId, Integer communityId) {
164
+    public ResponseBean findTaUserInfo(Integer activityId, Integer communityId, Integer userId) {
169 165
         ResponseBean responseBean = new ResponseBean();
170 166
         TpActivity tpActivity = tpActivityMapper.selectByPrimaryKey(activityId, communityId);
171 167
         //判断是否已经过了报名截至时间
@@ -187,28 +183,26 @@ public class SocialServiceImpl implements SocialServiceI {
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 188
         if (Constant.INVALID.equals(taUser.getStatus())
195 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 195
         if (Constant.INVALID.equals(taUser.getStatus())
202 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 201
         if (Constant.EFFECTIVE.equals(taUser.getStatus())
208 202
                 && (Constant.FAMILYMEMBER.equals(sysRole.getRoleName()))
209 203
                 || Constant.TENANT.equals(sysRole.getRoleName())
210 204
                 || Constant.OWNER.equals(sysRole.getRoleName())){
211
-            return insertActivitySignUp(tpActivity, communityId);
205
+            return insertActivitySignUp(tpActivity, communityId, userId);
212 206
         }
213 207
         responseBean.addError("9999", "服务器异常");
214 208
         return responseBean;
@@ -222,7 +216,7 @@ public class SocialServiceImpl implements SocialServiceI {
222 216
 
223 217
     @Transactional
224 218
     @Override
225
-    public ResponseBean stopTpTicketRecord(Integer communityId, Integer ticketId) {
219
+    public ResponseBean stopTpTicketRecord(Integer communityId, Integer ticketId, Integer userId) {
226 220
         ResponseBean responseBean = new ResponseBean();
227 221
         try{
228 222
             TpTicket tpTicket = new TpTicket();
@@ -235,7 +229,7 @@ public class SocialServiceImpl implements SocialServiceI {
235 229
             tpTicketRecord.setTicketId(ticketId);
236 230
             tpTicketRecord.setCommunityId(communityId);
237 231
             //TODO
238
-            tpTicketRecord.setCreateUser(1);
232
+            tpTicketRecord.setCreateUser(userId);
239 233
             tpTicketRecord.setCreateDate(new Date());
240 234
             tpTicketRecordMapper.insertSelective(tpTicketRecord);
241 235
             return responseBean;
@@ -296,7 +290,7 @@ public class SocialServiceImpl implements SocialServiceI {
296 290
     }
297 291
 
298 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 295
         tpTicket.setId(Integer.valueOf(ticketId));
302 296
         tpTicket.setStatus("5");
@@ -308,16 +302,16 @@ public class SocialServiceImpl implements SocialServiceI {
308 302
         record.setTicketId(Integer.valueOf(ticketId));
309 303
         record.setStatus("5");
310 304
         //todo
311
-        record.setCreateUser(1);
305
+        record.setCreateUser(userId);
312 306
         record.setCreateDate(new Date());
313 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 311
         ResponseBean responseBean = new ResponseBean();
318 312
         //判断是否已经报名
319 313
         //todo
320
-        Integer signNum = tpActivitySignupMapper.findTpActivetitySignByUserId(tpActivity.getId(), communityId, 1);
314
+        Integer signNum = tpActivitySignupMapper.findTpActivetitySignByUserId(tpActivity.getId(), communityId, userId);
321 315
         if (signNum != 0){
322 316
             responseBean.addError("9996", "您已报名,请勿重复报名");
323 317
             return responseBean;

+ 1
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TicketServiceImpl.java Dosyayı Görüntüle

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