Quellcode durchsuchen

合并本地分支

weiximei vor 6 Jahren
Ursprung
Commit
4210a8b156
15 geänderte Dateien mit 192 neuen und 160 gelöschten Zeilen
  1. 0
    8
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/AgreementController.java
  2. 66
    58
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/SocialController.java
  3. 38
    22
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/TicketController.java
  4. 1
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/UserController.java
  5. 1
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TaUserMapper.java
  6. 2
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpTransactionMapper.java
  7. 1
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/ITaUserService.java
  8. 2
    2
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/ITicketService.java
  9. 2
    4
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/SocialServiceI.java
  10. 5
    12
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java
  11. 2
    2
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaUserServiceImpl.java
  12. 58
    47
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TicketServiceImpl.java
  13. 1
    1
      CODE/smart-community/app-api/src/main/resources/mapper/TaUserMapper.xml
  14. 1
    1
      CODE/smart-community/app-api/src/main/resources/mapper/TpTicketMapper.xml
  15. 12
    0
      CODE/smart-community/app-api/src/main/resources/mapper/TpTransactionMapper.xml

+ 0
- 8
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/AgreementController.java Datei anzeigen

@@ -42,13 +42,5 @@ public class AgreementController {
42 42
         return responseBean;
43 43
     }
44 44
 
45
-    @ApiOperation(value = "物业,门卫,领导电话", notes = "物业,门卫,领导电话")
46
-    @RequestMapping(value = "/allTpAnnouncementTel",method = RequestMethod.GET)
47
-    public ResponseBean getTpAnnouncementTel(){
48
-        ResponseBean responseBean = new ResponseBean();
49
-        ResponseBean agreement = agreementService.getTpAnnouncementTel();
50
-        responseBean.addSuccess(agreement);
51
-        return responseBean;
52
-    }
53 45
 
54 46
 }

+ 66
- 58
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/SocialController.java Datei anzeigen

@@ -35,9 +35,9 @@ public class SocialController {
35 35
 
36 36
     @RequestMapping(value = "/announcement/{communityId}", method = RequestMethod.GET)
37 37
     @ApiOperation(value = "论坛公告帖子详情", notes = "获取论坛公告帖子详情")
38
-    @ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id"),
38
+    @ApiImplicitParams({@ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id"),
39 39
             @ApiImplicitParam(paramType = "query", dataType = "integer", name = "id", value = "公告帖子id")})
40
-    public ResponseBean findAnnouncementDetail(@PathVariable(value = "communityId")Integer communityId, @RequestParam("id") Integer id, HttpSession session){
40
+    public ResponseBean findAnnouncementDetail(@PathVariable(value = "communityId") Integer communityId, @RequestParam("id") Integer id, HttpSession session) {
41 41
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
42 42
         Integer userId = userElement.getId();
43 43
         ResponseBean responseBean = new ResponseBean();
@@ -48,63 +48,64 @@ public class SocialController {
48 48
 
49 49
     @RequestMapping(value = "/sign/{communityId}", method = RequestMethod.GET)
50 50
     @ApiOperation(value = "活动报名接口", notes = "活动报名接口")
51
-    @ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id"),
52
-                         @ApiImplicitParam(paramType = "query", dataType = "integer", name = "activityId", value = "活动Id")})
53
-    public ResponseBean SignActivity(@PathVariable(value = "communityId")Integer communityId, @RequestParam("activityId")Integer activityId, HttpSession session){
51
+
52
+
53
+    @ApiImplicitParams({@ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id"),
54
+            @ApiImplicitParam(paramType = "query", dataType = "integer", name = "activityId", value = "活动Id")})
55
+    public ResponseBean SignActivity(@PathVariable(value = "communityId") Integer communityId, @RequestParam("activityId") Integer activityId, HttpSession session) {
54 56
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
55 57
         Integer userId = userElement.getId();
56 58
         ResponseBean responseBean = socialServiceI.findTaUserInfo(activityId, communityId, userId);
57 59
         return responseBean;
58 60
     }
59
-    
61
+
60 62
     @ApiOperation(value = "按小区获取分页公告列表", notes = "按小区获取分页公告列表,公告标题模糊查询")
61
-    @ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "String", name = "communityId", value = "小区Id"),
63
+    @ApiImplicitParams({@ApiImplicitParam(paramType = "path", dataType = "String", name = "communityId", value = "小区Id"),
62 64
             @ApiImplicitParam(paramType = "query", dataType = "String", name = "title", value = "公告标题"),
63 65
             @ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageNum", value = "分页第几页"),
64 66
             @ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageSize", value = "分页每页长度")})
65
-    @RequestMapping(value = "/announcements/{communityId}",method = RequestMethod.GET)
66
-    public ResponseBean getAnnouncements(@PathVariable Integer communityId,@RequestParam String title,
67
-                                         @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
68
-                                         @RequestParam(value ="pageSize",defaultValue = "5") Integer pageSize){
67
+    @RequestMapping(value = "/announcements/{communityId}", method = RequestMethod.GET)
68
+    public ResponseBean getAnnouncements(@PathVariable Integer communityId, @RequestParam String title,
69
+                                         @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
70
+                                         @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize) {
69 71
         ResponseBean responseBean = new ResponseBean();
70
-        List<TpAnnouncement> announcementList = socialServiceI.getAnnouncements(communityId,title,pageNum,pageSize);
72
+        List<TpAnnouncement> announcementList = socialServiceI.getAnnouncements(communityId, title, pageNum, pageSize);
71 73
         responseBean.addSuccess(announcementList);
72 74
         return responseBean;
73 75
     }
74 76
 
75 77
     @ApiOperation(value = "获取公告轮播图", notes = "获取公告轮播图")
76 78
     @ApiImplicitParams({
77
-            @ApiImplicitParam(paramType = "path",dataType = "String",name = "communityId",value = "小区id")
79
+            @ApiImplicitParam(paramType = "path", dataType = "String", name = "communityId", value = "小区id")
78 80
     })
79
-    @RequestMapping(value = "/announcement/Img/{communityId}",method = RequestMethod.GET)
80
-    public ResponseBean getAnnouncement(@PathVariable(value = "communityId")Integer communityId ){
81
+    @RequestMapping(value = "/announcement/Img/{communityId}", method = RequestMethod.GET)
82
+    public ResponseBean getAnnouncement(@PathVariable(value = "communityId") Integer communityId) {
81 83
         ResponseBean responseBean = new ResponseBean();
82 84
         List<TpAnnouncement> agreement = socialServiceI.getAnnouncement(communityId);
83 85
         responseBean.addSuccess(agreement);
84 86
         return responseBean;
85 87
     }
86 88
 
87
-    
89
+
88 90
     @ApiOperation(value = "按小区获取分页活动列表", notes = "按小区获取分页活动列表,公告标题模糊查询")
89
-    @ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "String", name = "communityId", value = "小区Id"),
91
+    @ApiImplicitParams({@ApiImplicitParam(paramType = "path", dataType = "String", name = "communityId", value = "小区Id"),
90 92
             @ApiImplicitParam(paramType = "query", dataType = "String", name = "title", value = "活动标题"),
91 93
             @ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageNum", value = "分页第几页"),
92 94
             @ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageSize", value = "分页每页长度")})
93
-    @RequestMapping(value = "/activitys/{communityId}",method = RequestMethod.GET)
94
-    public ResponseBean getActivitys(@PathVariable Integer communityId,@RequestParam String title,
95
-                                     @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
96
-                                     @RequestParam(value ="pageSize",defaultValue = "5") Integer pageSize){
95
+    @RequestMapping(value = "/activitys/{communityId}", method = RequestMethod.GET)
96
+    public ResponseBean getActivitys(@PathVariable Integer communityId, @RequestParam String title,
97
+                                     @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
98
+                                     @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize) {
97 99
         ResponseBean responseBean = new ResponseBean();
98
-        List<TpActivity> activityList = socialServiceI.getActivitys(communityId,title,pageNum,pageSize);
100
+        List<TpActivity> activityList = socialServiceI.getActivitys(communityId, title, pageNum, pageSize);
99 101
         responseBean.addSuccess(activityList);
100 102
         return responseBean;
101 103
     }
102
-    
104
+
103 105
     @ApiOperation(value = "论坛活动帖子详情", notes = "获取论坛活动帖子详情")
104
-    @ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id"),
106
+    @ApiImplicitParams({@ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id"),
105 107
             @ApiImplicitParam(paramType = "query", dataType = "integer", name = "activityId", value = "活动帖子id")})
106
-    @RequestMapping(value = "/activity/{communityId}", method = RequestMethod.GET)
107
-    public ResponseBean findActivityDetail(@PathVariable(value = "communityId")Integer communityId, @RequestParam("activityId") Integer activityId, HttpSession session){
108
+    public ResponseBean findActivityDetail(@PathVariable(value = "communityId") Integer communityId, @RequestParam("activityId") Integer activityId, HttpSession session) {
108 109
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
109 110
         Integer userId = userElement.getId();
110 111
         ResponseBean responseBean = new ResponseBean();
@@ -114,27 +115,27 @@ public class SocialController {
114 115
     }
115 116
 
116 117
     @ApiOperation(value = "二手租赁详情", notes = "二手租赁详情")
117
-    @ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id"),
118
+    @ApiImplicitParams({@ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id"),
118 119
             @ApiImplicitParam(paramType = "query", dataType = "integer", name = "activityId", value = "活动帖子id")})
119 120
     @RequestMapping(value = "/secondHand/{communityId}", method = RequestMethod.GET)
120
-    public ResponseBean findUsedDetails(@PathVariable(value = "communityId")Integer communityId, @RequestParam("activityId") Integer activityId, HttpSession session){
121
+    public ResponseBean findUsedDetails(@PathVariable(value = "communityId") Integer communityId, @RequestParam("activityId") Integer activityId, HttpSession session) {
121 122
         ResponseBean responseBean = new ResponseBean();
122 123
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
123 124
         Integer userId = userElement.getId();
124
-        TpTransaction activity = socialServiceI.findUsedDetails(activityId, communityId,userId);
125
+        TpTransaction activity = socialServiceI.findUsedDetails(activityId, communityId, userId);
125 126
         responseBean.addSuccess(activity);
126 127
         return responseBean;
127 128
     }
128 129
 
129 130
     @ApiOperation(value = "获取所有的二手租赁帖子", notes = "获取所有的二手租赁帖子")
130
-    @ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id"),
131
+    @ApiImplicitParams({@ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id"),
131 132
             @ApiImplicitParam(paramType = "query", dataType = "String", name = "type", value = "帖子类型"),
132 133
             @ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageNum", value = "分页第几页"),
133 134
             @ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageSize", value = "分页每页长度")})
134 135
     @RequestMapping(value = "/getAllTransaction/{communityId}", method = RequestMethod.GET)
135
-    public ResponseBean getAllPosts(@PathVariable("communityId")Integer communityId, @RequestParam("type") String type,
136
-                                    @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
137
-                                    @RequestParam(value ="pageSize",defaultValue = "5") Integer pageSize){
136
+    public ResponseBean getAllPosts(@PathVariable("communityId") Integer communityId, @RequestParam("type") String type,
137
+                                    @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
138
+                                    @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize) {
138 139
         ResponseBean responseBean = new ResponseBean();
139 140
         List<TpTransaction> tpTransactions = socialServiceI.findAllTransaction(communityId, type, pageNum, pageSize);
140 141
         responseBean.addSuccess(tpTransactions);
@@ -142,10 +143,10 @@ public class SocialController {
142 143
     }
143 144
 
144 145
     @ApiOperation(value = "报修进度终止", notes = "报修进度终止")
145
-    @ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id"),
146
+    @ApiImplicitParams({@ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id"),
146 147
             @ApiImplicitParam(paramType = "query", dataType = "integer", name = "ticketId", value = "帖子Id")})
147 148
     @RequestMapping(value = "/stopTicket/{communityId}", method = RequestMethod.GET)
148
-    public ResponseBean stopTicket(@PathVariable("communityId")Integer communityId, @RequestParam("ticketId")Integer ticketId, HttpSession session){
149
+    public ResponseBean stopTicket(@PathVariable("communityId") Integer communityId, @RequestParam("ticketId") Integer ticketId, HttpSession session) {
149 150
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
150 151
         Integer userId = userElement.getId();
151 152
         ResponseBean responseBean = socialServiceI.stopTpTicketRecord(communityId, ticketId, userId);
@@ -153,11 +154,11 @@ public class SocialController {
153 154
     }
154 155
 
155 156
     @ApiOperation(value = "修改报修内容", notes = "修改报修内容")
156
-    @ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "integer", name = "ticketId", value = "工单Id"),
157
-                         @ApiImplicitParam(name = "tpTicket", value = "报修", required = true, dataType ="TpTicket"),
158
-                         @ApiImplicitParam(paramType = "query", dataType = "integer", name = "type", value = "工单类型")})
157
+    @ApiImplicitParams({@ApiImplicitParam(paramType = "path", dataType = "integer", name = "ticketId", value = "工单Id"),
158
+            @ApiImplicitParam(name = "tpTicket", value = "报修", required = true, dataType = "TpTicket"),
159
+            @ApiImplicitParam(paramType = "query", dataType = "integer", name = "type", value = "工单类型")})
159 160
     @RequestMapping(value = "/updateTicket/{ticketId}", method = RequestMethod.POST)
160
-    public ResponseBean updateTicketContent(@PathVariable("ticketId")Integer ticketId, @RequestBody TpTicket tpTicket, @RequestParam("type")String type){
161
+    public ResponseBean updateTicketContent(@PathVariable("ticketId") Integer ticketId, @RequestBody TpTicket tpTicket, @RequestParam("type") String type) {
161 162
         ResponseBean responseBean = new ResponseBean();
162 163
         socialServiceI.updateTicketContent(ticketId, tpTicket, type);
163 164
         return responseBean;
@@ -165,16 +166,17 @@ public class SocialController {
165 166
 
166 167
     @ApiOperation(value = "添加二手租赁帖子", notes = "添加二手租赁帖子")
167 168
     @ApiImplicitParams({
168
-            @ApiImplicitParam(paramType = "query",dataType = "String",name = "transactionTitle",value = "交易标题"),
169
-            @ApiImplicitParam(paramType = "query",dataType = "String",name = "transactionContent",value = "交易内容"),
170
-            @ApiImplicitParam(paramType = "query",dataType = "String",name = "type",value = "0:二手 1:求购  2:租赁"),
169
+            @ApiImplicitParam(paramType = "query", dataType = "String", name = "transactionTitle", value = "交易标题"),
170
+            @ApiImplicitParam(paramType = "query", dataType = "String", name = "transactionContent", value = "交易内容"),
171
+            @ApiImplicitParam(paramType = "query", dataType = "String", name = "type", value = "0:二手 1:求购  2:租赁"),
171 172
     })
172
-    @RequestMapping(value = "/addAllTransaction",method = RequestMethod.POST)
173
-    public ResponseBean addTransaction(TpTransaction tpTransaction, HttpSession session){
173
+    @RequestMapping(value = "/addTransaction", method = RequestMethod.POST)
174
+    @ResponseBody
175
+    public ResponseBean addTransaction(TpTransaction tpTransaction, HttpSession session) {
174 176
         ResponseBean responseBean = new ResponseBean();
175 177
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
176 178
         Integer userId = userElement.getId();
177
-        ResponseBean response=socialServiceI.addAllTransaction(userId,tpTransaction);
179
+        ResponseBean response = socialServiceI.addAllTransaction(userId, tpTransaction);
178 180
         return response;
179 181
     }
180 182
 
@@ -183,36 +185,42 @@ public class SocialController {
183 185
             @ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageNum", value = "分页第几页"),
184 186
             @ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageSize", value = "分页每页长度")
185 187
     })
186
-    @RequestMapping(value = "/selectAllTransaction",method = RequestMethod.POST)
187
-    public ResponseBean selectAllTransaction( HttpSession session,
188
-                                              @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
189
-                                              @RequestParam(value ="pageSize",defaultValue = "5") Integer pageSize){
188
+    @RequestMapping(value = "/selectAllTransaction", method = RequestMethod.GET)
189
+    public ResponseBean selectAllTransaction(HttpSession session,
190
+                                             @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
191
+                                             @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize) {
190 192
         ResponseBean responseBean = new ResponseBean();
191 193
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
192
-        Integer userId=userElement.getId();
193
-        ResponseBean response=socialServiceI.selectAllTransaction(userId,pageNum, pageSize);
194
+        Integer userId = userElement.getId();
195
+        ResponseBean response = socialServiceI.selectAllTransaction(userId, pageNum, pageSize);
194 196
         return response;
195 197
     }
196 198
 
197 199
     @ApiOperation(value = "修改二手租赁帖子", notes = "修改二手租赁帖子")
198 200
     @ApiImplicitParams({
199
-            @ApiImplicitParam(paramType = "query", dataType = "integer", name = "ticketId", value = "二手租赁帖子Id")
201
+            @ApiImplicitParam(paramType = "query", dataType = "integer", name = "ticketId", value = "二手租赁帖子Id"),
202
+            @ApiImplicitParam(paramType = "query", dataType = "String", name = "transactionTitle", value = "小区标题"),
203
+            @ApiImplicitParam(paramType = "body", dataType = "String", name = "transactionContent", value = "交易内容"),
204
+            @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "Type", value = "0 代表,1求购,2租赁"),
200 205
     })
201
-    @RequestMapping(value = "/ubDateAllTransaction",method = RequestMethod.PUT)
202
-    public ResponseBean ubdateTransaction( HttpSession session, TpTransaction tpTransaction) {
206
+    @RequestMapping(value = "/upDateTransaction/{Id}", method = RequestMethod.PUT)
207
+    public ResponseBean ubdateTransaction(HttpSession session, @PathVariable(value = "Id") Integer Id,
208
+                                          @RequestParam(value = "transactionTitle") String transactionTitle,
209
+                                          @RequestParam(value = "transactionContent") String transactionContent,
210
+                                          @RequestParam(value = "Type") Integer Type) {
203 211
         ResponseBean responseBean = new ResponseBean();
204 212
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
205 213
         Integer userId = userElement.getId();
206
-        ResponseBean response = socialServiceI.updateTransaction(tpTransaction, userId);
214
+        ResponseBean response = socialServiceI.updateTransaction(Id, transactionTitle, transactionContent, userId, Type);
207 215
         return response;
208 216
     }
209 217
 
210 218
     @ApiOperation(value = "评价工单内容以及评分", notes = "评价工单内容以及评分")
211
-    @ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id"),
212
-            @ApiImplicitParam(name = "tpTicket", value = "报修", required = true, dataType ="TpTicket"),
219
+    @ApiImplicitParams({@ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id"),
220
+            @ApiImplicitParam(name = "tpTicket", value = "报修", required = true, dataType = "TpTicket"),
213 221
             @ApiImplicitParam(paramType = "query", dataType = "integer", name = "ticketId", value = "工单Id")})
214 222
     @RequestMapping(value = "/accessTicket/{communityId}", method = RequestMethod.POST)
215
-    public ResponseBean accessTicket(@PathVariable("communityId")Integer communityId, @RequestBody TpTicket tpTicket, @RequestParam("ticketId")String ticketId, HttpSession session){
223
+    public ResponseBean accessTicket(@PathVariable("communityId") Integer communityId, @RequestBody TpTicket tpTicket, @RequestParam("ticketId") String ticketId, HttpSession session) {
216 224
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
217 225
         Integer userId = userElement.getId();
218 226
         ResponseBean responseBean = new ResponseBean();

+ 38
- 22
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/TicketController.java Datei anzeigen

@@ -7,6 +7,7 @@ import com.community.huiju.model.TaUser;
7 7
 import com.community.huiju.model.TpTicket;
8 8
 import com.community.huiju.model.TpTransaction;
9 9
 import com.community.huiju.model.TpTicketRecordComment;
10
+import com.community.huiju.service.AgreementServicel;
10 11
 import com.community.huiju.service.ITicketService;
11 12
 import io.swagger.annotations.Api;
12 13
 import io.swagger.annotations.ApiImplicitParam;
@@ -31,8 +32,11 @@ public class TicketController {
31 32
     @Autowired
32 33
     private ITicketService iTicketService;
33 34
 
34
-    @RequestMapping(value = "/tickets/{communityId}",method = RequestMethod.GET)
35
-    @ApiOperation(value = "获取 报修/投诉/联系单 各3条数据",notes = "根据 小区编号,第几页,一页多少行")
35
+    @Autowired
36
+    private AgreementServicel agreementServicel;
37
+
38
+    @RequestMapping(value = "/tickets/{communityId}", method = RequestMethod.GET)
39
+    @ApiOperation(value = "获取 报修/投诉/联系单 各3条数据", notes = "根据 小区编号,第几页,一页多少行")
36 40
     @ApiImplicitParams({
37 41
             @ApiImplicitParam(paramType = "path",dataType = "String",name = "communityId",value = "小区编号"),
38 42
             @ApiImplicitParam(paramType = "query",dataType = "Integer",name = "pageNum",value = "第几页"),
@@ -40,8 +44,8 @@ public class TicketController {
40 44
             @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token"),
41 45
     })
42 46
     public ResponseBean getService(@PathVariable(value = "communityId") String communityId,
43
-                                   @RequestParam(value = "pageNum",defaultValue = "1") Integer pageNum,
44
-                                   @RequestParam(value = "pageSize",defaultValue = "3") Integer pageSize,
47
+                                   @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
48
+                                   @RequestParam(value = "pageSize", defaultValue = "3") Integer pageSize,
45 49
                                    HttpSession session) {
46 50
         ResponseBean response = new ResponseBean();
47 51
 
@@ -51,23 +55,23 @@ public class TicketController {
51 55
         tpTicket.setCommunityId(Integer.valueOf(communityId));
52 56
         tpTicket.setTaUserId(userElement.getId());
53 57
 
54
-        response = iTicketService.getList(tpTicket,pageNum,pageSize);
58
+        response = iTicketService.getList(tpTicket, pageNum, pageSize);
55 59
         return response;
56 60
     }
57
-    
58
-    @ApiOperation(value = "获取报修/投诉/联系单进度详情数据",notes = "获取报修/投诉/联系单进度详情数据")
61
+
62
+    @ApiOperation(value = "获取报修/投诉/联系单进度详情数据", notes = "获取报修/投诉/联系单进度详情数据")
59 63
     @ApiImplicitParams({
60
-            @ApiImplicitParam(paramType = "path",dataType = "String",name = "communityId",value = "小区编号"),
61
-            @ApiImplicitParam(paramType = "query",dataType = "Integer",name = "ticketId",value = "报修id")
64
+            @ApiImplicitParam(paramType = "path", dataType = "String", name = "communityId", value = "小区编号"),
65
+            @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "ticketId", value = "报修id")
62 66
     })
63 67
     @RequestMapping(value = "/ticket/schedule/{communityId}", method = RequestMethod.GET)
64
-    public ResponseBean getTicketSchedule(@PathVariable(value = "communityId") String communityId,@RequestParam Integer ticketId){
68
+    public ResponseBean getTicketSchedule(@PathVariable(value = "communityId") String communityId, @RequestParam Integer ticketId) {
65 69
         ResponseBean responseBean = new ResponseBean();
66
-        TpTicket ticket = iTicketService.getTicketSchedule(communityId,ticketId);
70
+        TpTicket ticket = iTicketService.getTicketSchedule(communityId, ticketId);
67 71
         responseBean.addSuccess(ticket);
68 72
         return responseBean;
69 73
     }
70
-    
74
+
71 75
     @RequestMapping(value = "/tickets/list/{communityId}", method = RequestMethod.GET)
72 76
     @ApiOperation(value = "获取 报修/投诉/联系单 数据列表", notes = "根据 小区编号,工单类型,第几页,一页多少行")
73 77
     @ApiImplicitParams({
@@ -76,10 +80,11 @@ public class TicketController {
76 80
             @ApiImplicitParam(paramType = "query",dataType = "Integer",name = "pageSize", value = "一页多少数据"),
77 81
             @ApiImplicitParam(paramType = "query",dataType = "String",name = "type", value = "工单类型 (0报修/1投诉/2联系单)"),
78 82
             @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token"),
83
+
79 84
     })
80 85
     public ResponseBean getServiceList(@PathVariable(value = "communityId") String communityId,
81
-                                       @RequestParam(value = "pageNum",defaultValue = "1") Integer pageNum,
82
-                                       @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize,
86
+                                       @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
87
+                                       @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
83 88
                                        @RequestParam(value = "type") String type,
84 89
                                        HttpSession session) {
85 90
         ResponseBean responseBean = new ResponseBean();
@@ -91,14 +96,15 @@ public class TicketController {
91 96
         tpTicket.setTaUserId(userElement.getId());
92 97
         tpTicket.setType(type);
93 98
 
94
-        responseBean = iTicketService.getByTypeList(tpTicket,pageNum,pageSize);
99
+        responseBean = iTicketService.getByTypeList(tpTicket, pageNum, pageSize);
95 100
 
96 101
         return responseBean;
97 102
 
98 103
     }
104
+
99 105
     @ApiOperation(value = "回复 报修/投诉/联系单 追问接口", notes = "回复 报修/投诉/联系单 追问接口")
100
-    @ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id"),
101
-            @ApiImplicitParam(name = "tpTicketRecordComment", value = "回复记录参数", paramType ="body")})
106
+    @ApiImplicitParams({@ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id"),
107
+            @ApiImplicitParam(name = "tpTicketRecordComment", value = "回复记录参数", paramType = "body")})
102 108
     @RequestMapping(value = "/ticket/reply/{communityId}", method = RequestMethod.POST)
103 109
     public ResponseBean updateTicketsReply(@PathVariable(value = "communityId") Integer communityId, @RequestBody TpTicketRecordComment tpTicketRecordComment, HttpSession session){
104 110
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
@@ -108,7 +114,7 @@ public class TicketController {
108 114
         Integer size = iTicketService.updateTicketsReply(tpTicketRecordComment, userId);
109 115
         if (size > 0){
110 116
             responseBean.addSuccess(size);
111
-        }else{
117
+        } else {
112 118
             responseBean.addError("更新失败");
113 119
         }
114 120
         return responseBean;
@@ -116,20 +122,30 @@ public class TicketController {
116 122
 
117 123
     @ApiOperation(value = "添加报修", notes = "添加报修")
118 124
     @ApiImplicitParams({
125
+
119 126
             @ApiImplicitParam(paramType = "query",dataType = "String",name = "ticketContent",value = "工单内容"),
120 127
             @ApiImplicitParam(paramType = "query",dataType = "String",name = "ticketTitle",value = "工单标题"),
121 128
             @ApiImplicitParam(paramType = "query",dataType = "String",name = "repairType",value = "报修房屋类型"),
122 129
             @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token"),
123 130
     })
124
-    @RequestMapping(value = "/addAlltpTicket",method = RequestMethod.POST)
131
+    @RequestMapping(value = "/addAlltpTicket", method = RequestMethod.POST)
125 132
     @ResponseBody
126
-    public ResponseBean addTransaction(TpTicket tpTicket, HttpSession session){
133
+    public ResponseBean addTransaction(@RequestBody String parameter, HttpSession session) {
127 134
         ResponseBean responseBean = new ResponseBean();
128 135
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
129 136
         Integer userId = userElement.getId();
130
-        ResponseBean response=iTicketService.addAiTicketService(userId,tpTicket);
137
+        ResponseBean response = iTicketService.addAiTicketService(userId, parameter);
131 138
         return response;
132 139
     }
133 140
 
134
-
141
+    @ApiOperation(value = "物业,门卫,领导电话", notes = "物业,门卫,领导电话")
142
+    @RequestMapping(value = "/allTpAnnouncementTel", method = RequestMethod.GET)
143
+    public ResponseBean getTpAnnouncementTel() {
144
+        ResponseBean responseBean = new ResponseBean();
145
+        ResponseBean agreement = agreementServicel.getTpAnnouncementTel();
146
+                responseBean.addSuccess(agreement);
147
+        return responseBean;
148
+    }
135 149
 }
150
+
151
+

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/UserController.java Datei anzeigen

@@ -70,7 +70,7 @@ public class UserController {
70 70
         ResponseBean responseBean = new ResponseBean();
71 71
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
72 72
         Integer userId=userElement.getId();
73
-        ResponseBean response=iTaUserService.udDateloginName(userId,paramets);
73
+        ResponseBean response=iTaUserService.upDateloginName(userId,paramets);
74 74
         return response;
75 75
     }
76 76
 

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TaUserMapper.java Datei anzeigen

@@ -39,7 +39,7 @@ public interface TaUserMapper {
39 39
      * @param record
40 40
      * @return
41 41
      */
42
-    TaUser ubdateLongName(TaUser record);
42
+    TaUser updateLongName(TaUser record);
43 43
 
44 44
     /**
45 45
      * 查询房屋成员列表

+ 2
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpTransactionMapper.java Datei anzeigen

@@ -23,4 +23,6 @@ public interface TpTransactionMapper {
23 23
     List<TpTransaction> findAllTransaction(@Param("communityId") Integer communityId, @Param("type") String type);
24 24
 
25 25
     List<TpTransaction> selectTransaction(@Param("userId")Integer userId, @Param("communityId")Integer communityId);
26
+
27
+    void updateTransaction(@Param("id")Integer id, @Param("transactionTitle")String transactionTitle, @Param("transactionContent")String transactionContent, @Param("userId")Integer userId,@Param("Type")Integer Type);
26 28
 }

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/ITaUserService.java Datei anzeigen

@@ -39,7 +39,7 @@ public interface ITaUserService {
39 39
      * @param id
40 40
      * @return
41 41
      */
42
-    ResponseBean udDateloginName(Integer id, String paramets);
42
+    ResponseBean upDateloginName(Integer id, String paramets);
43 43
 
44 44
     /**
45 45
      * 获取房屋成员列表

+ 2
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/ITicketService.java Datei anzeigen

@@ -43,10 +43,10 @@ public interface ITicketService {
43 43
 	/**
44 44
 	 * 添加报修
45 45
 	 * @param userId
46
-	 * @param tpTicket
46
+	 * @param parameter
47 47
 	 * @return
48 48
 	 */
49
-    ResponseBean addAiTicketService(Integer userId, TpTicket tpTicket);
49
+    ResponseBean addAiTicketService(Integer userId,String parameter);
50 50
 	
51 51
 	/**
52 52
 	 * 回复工单

+ 2
- 4
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/SocialServiceI.java Datei anzeigen

@@ -88,11 +88,9 @@ public interface SocialServiceI {
88 88
 
89 89
 	/**
90 90
 	 * 修改当前帖子
91
-	 * @param tpTransaction
92
-	 * @param userId
93
-	 * @return
94 91
 	 */
95
-	ResponseBean updateTransaction(TpTransaction tpTransaction,Integer userId);
92
+	ResponseBean updateTransaction(Integer Id,String transactionTitle,String transactionContent,Integer userId,Integer Type);
93
+
96 94
 	void updateTicketContent(Integer ticketId, TpTicket tpTicket, String type);
97 95
 
98 96
 	/**

+ 5
- 12
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java Datei anzeigen

@@ -246,7 +246,7 @@ public class SocialServiceImpl implements SocialServiceI {
246 246
         tpTicket.setType(type);
247 247
         tpTicketMapper.updateByPrimaryKeySelective(tpTicket);
248 248
     }
249
-
249
+    @Transactional
250 250
     @Override
251 251
     public ResponseBean addAllTransaction(Integer userId, TpTransaction tpTransaction) {
252 252
         ResponseBean response = new ResponseBean();
@@ -254,10 +254,11 @@ public class SocialServiceImpl implements SocialServiceI {
254 254
         tpTransaction.setCommunityId(user.getCommunityId());
255 255
         tpTransaction.setTaUserId(userId);
256 256
         tpTransaction.setCreateUser(userId);
257
+        tpTransaction.setStatus("1");
257 258
         tpTransaction.setCreateDate(new Date());
258 259
         tpTransaction.setUpdateUser(userId);
259 260
         tpTransaction.setUpdateDate(new Date());
260
-        tpTransactionMapper.insert(tpTransaction);
261
+        tpTransactionMapper.insertSelective(tpTransaction);
261 262
         response.addSuccess("发布成功");
262 263
         return response;
263 264
     }
@@ -274,17 +275,9 @@ public class SocialServiceImpl implements SocialServiceI {
274 275
     }
275 276
 
276 277
     @Override
277
-    public ResponseBean updateTransaction(TpTransaction tpTransaction,Integer userId) {
278
+    public ResponseBean updateTransaction(Integer Id,String transactionTitle,String transactionContent,Integer userId,Integer Type) {
278 279
         ResponseBean response = new ResponseBean();
279
-        TaUser user=taUserMapper.selectByPrimaryKey(userId);
280
-        tpTransaction.setCommunityId(user.getCommunityId());
281
-        tpTransaction.setTaUserId(userId);
282
-        tpTransaction.setCreateUser(userId);
283
-        tpTransaction.setStatus("2");
284
-        tpTransaction.setCreateDate(new Date());
285
-        tpTransaction.setUpdateUser(userId);
286
-        tpTransaction.setUpdateDate(new Date());
287
-        tpTransactionMapper.updateByPrimaryKey(tpTransaction);
280
+        tpTransactionMapper.updateTransaction(Id,transactionTitle,transactionContent,userId,Type);
288 281
         response.addSuccess("修改成功");
289 282
         return response;
290 283
     }

+ 2
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaUserServiceImpl.java Datei anzeigen

@@ -158,7 +158,7 @@ public class TaUserServiceImpl implements ITaUserService {
158 158
     }
159 159
     @Transactional
160 160
     @Override
161
-    public ResponseBean udDateloginName(Integer id, String paramets) {
161
+    public ResponseBean upDateloginName(Integer id, String paramets) {
162 162
         ResponseBean response = new ResponseBean();
163 163
 
164 164
         JSONObject jsonObject = JSONObject.parseObject(paramets);
@@ -174,7 +174,7 @@ public class TaUserServiceImpl implements ITaUserService {
174 174
             TaUser taUser=new TaUser();
175 175
             taUser.setLoginName(phone);
176 176
             taUser.setId(user.getId());
177
-            taUserMapper.ubdateLongName(taUser);
177
+            taUserMapper.updateLongName(taUser);
178 178
              response.addSuccess("修改成功");
179 179
             AppkeyCache.setCache(user.getLoginName(),"null");
180 180
             return response;

+ 58
- 47
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TicketServiceImpl.java Datei anzeigen

@@ -1,16 +1,14 @@
1 1
 package com.community.huiju.service.impl;
2 2
 
3 3
 
4
+import com.alibaba.fastjson.JSONObject;
4 5
 import com.community.commom.constant.Constant;
5 6
 import com.community.commom.mode.ResponseBean;
6 7
 import com.community.huiju.dao.TaUserMapper;
7 8
 import com.community.huiju.dao.TpTicketMapper;
8 9
 import com.community.huiju.dao.TpTicketRecordCommentMapper;
9 10
 import com.community.huiju.dao.TpTicketRecordMapper;
10
-import com.community.huiju.model.TaUser;
11
-import com.community.huiju.model.TpTicket;
12
-import com.community.huiju.model.TpTicketRecord;
13
-import com.community.huiju.model.TpTicketRecordComment;
11
+import com.community.huiju.model.*;
14 12
 import com.community.huiju.service.ITicketService;
15 13
 import com.community.huiju.vo.TpTicketVO;
16 14
 import com.github.pagehelper.PageHelper;
@@ -35,54 +33,54 @@ public class TicketServiceImpl implements ITicketService {
35 33
 
36 34
     @Autowired
37 35
     private TpTicketMapper tpTicketMapper;
38
-    
36
+
39 37
     @Autowired
40 38
     private TpTicketRecordMapper tpTicketRecordMapper;
41 39
 
42 40
     @Autowired
43 41
     private TpTicketRecordCommentMapper tpTicketRecordCommentMapper;
44
-    
42
+
45 43
     @Autowired
46 44
     private TaUserMapper taUserMapper;
47 45
 
48 46
     @Override
49
-    public ResponseBean getList(TpTicket tpTicket,Integer pageNum, Integer pageSize) {
47
+    public ResponseBean getList(TpTicket tpTicket, Integer pageNum, Integer pageSize) {
50 48
 
51
-        ResponseBean<Map<String,Object>> responseBean = new ResponseBean();
49
+        ResponseBean<Map<String, Object>> responseBean = new ResponseBean();
52 50
         // 最终返回值
53
-        Map<String,Object> result = Maps.newHashMap();
51
+        Map<String, Object> result = Maps.newHashMap();
54 52
 
55
-        Map<String,Object> parameter = Maps.newHashMap();
56
-        parameter.put("communityId",tpTicket.getCommunityId());
57
-        parameter.put("taUserId",tpTicket.getTaUserId());
53
+        Map<String, Object> parameter = Maps.newHashMap();
54
+        parameter.put("communityId", tpTicket.getCommunityId());
55
+        parameter.put("taUserId", tpTicket.getTaUserId());
58 56
 
59 57
         //  0 代表 报修  1 代表 投诉  2代表 联系单
60
-        parameter.put("type",0);
58
+        parameter.put("type", 0);
61 59
         // 报修
62
-        PageHelper.startPage(pageNum,pageSize);
60
+        PageHelper.startPage(pageNum, pageSize);
63 61
         List<TpTicket> tpTicketRepairsList = tpTicketMapper.selectByCommuniytIdAndByTaUserIdAndByType(parameter);
64 62
         List<TpTicketVO> repairsList = Lists.newArrayList();
65
-        tpTicketVOConvert(tpTicketRepairsList,repairsList);
63
+        tpTicketVOConvert(tpTicketRepairsList, repairsList);
66 64
 
67 65
         // 投诉
68 66
         //  0 代表 报修  1 代表 投诉  2代表 联系单
69
-        parameter.put("type",1);
70
-        PageHelper.startPage(pageNum,pageSize);
67
+        parameter.put("type", 1);
68
+        PageHelper.startPage(pageNum, pageSize);
71 69
         List<TpTicket> tpTicketComplaintList = tpTicketMapper.selectByCommuniytIdAndByTaUserIdAndByType(parameter);
72 70
         List<TpTicketVO> complaintList = Lists.newArrayList();
73 71
         tpTicketVOConvert(tpTicketComplaintList, complaintList);
74 72
 
75 73
         // 联系工单
76 74
         //  0 代表 报修  1 代表 投诉  2代表 联系单
77
-        parameter.put("type",2);
78
-        PageHelper.startPage(pageNum,pageSize);
75
+        parameter.put("type", 2);
76
+        PageHelper.startPage(pageNum, pageSize);
79 77
         List<TpTicket> tpTicketLiaisonList = tpTicketMapper.selectByCommuniytIdAndByTaUserIdAndByType(parameter);
80 78
         List<TpTicketVO> liaisonList = Lists.newArrayList();
81 79
         tpTicketVOConvert(tpTicketLiaisonList, liaisonList);
82 80
 
83
-        result.put("repairs",repairsList);
84
-        result.put("complaint",complaintList);
85
-        result.put("liaison",liaisonList);
81
+        result.put("repairs", repairsList);
82
+        result.put("complaint", complaintList);
83
+        result.put("liaison", liaisonList);
86 84
 
87 85
         responseBean.addSuccess(result);
88 86
         return responseBean;
@@ -90,34 +88,36 @@ public class TicketServiceImpl implements ITicketService {
90 88
 
91 89
     /**
92 90
      * 公共方法, 获取一条数据
91
+     *
93 92
      * @param map
94 93
      * @return
95 94
      */
96
-    private TpTicketRecordComment getTicketRecordComment(Map map){
95
+    private TpTicketRecordComment getTicketRecordComment(Map map) {
97 96
         List<TpTicketRecordComment> list = tpTicketRecordCommentMapper.selectByTicketId(map);
98
-        return null==list
99
-                ?null:list.size()==0
100
-                ?null:list.get(0);
97
+        return null == list
98
+                ? null : list.size() == 0
99
+                ? null : list.get(0);
101 100
     }
102 101
 
103 102
     /**
104 103
      * 数据转换,并填充数据
104
+     *
105 105
      * @param target
106 106
      * @param source
107 107
      * @return
108 108
      */
109
-    public void tpTicketVOConvert(List<TpTicket> source, List<TpTicketVO> target){
109
+    public void tpTicketVOConvert(List<TpTicket> source, List<TpTicketVO> target) {
110 110
 
111 111
         // 查询参数
112
-        Map<String,Object> lastRecordMap = Maps.newHashMap();
112
+        Map<String, Object> lastRecordMap = Maps.newHashMap();
113 113
         // 表示查询出最新的一条
114
-        lastRecordMap.put("size",1);
114
+        lastRecordMap.put("size", 1);
115 115
 
116
-        source.stream().forEach(e->{
116
+        source.stream().forEach(e -> {
117 117
             TpTicketVO tpTicketVO = new TpTicketVO();
118
-            BeanUtils.copyProperties(e,tpTicketVO);
118
+            BeanUtils.copyProperties(e, tpTicketVO);
119 119
             // 设置工单编号
120
-            lastRecordMap.put("tickerId",e.getId());
120
+            lastRecordMap.put("tickerId", e.getId());
121 121
             TpTicketRecordComment comment = getTicketRecordComment(lastRecordMap);
122 122
             if (null != comment) {
123 123
                 tpTicketVO.setCommentContent(comment.getContent());
@@ -133,26 +133,27 @@ public class TicketServiceImpl implements ITicketService {
133 133
 
134 134
         ResponseBean response = new ResponseBean();
135 135
 
136
-        Map<String,Object> parameter = Maps.newHashMap();
137
-        parameter.put("communityId",tpTicket.getCommunityId());
138
-        parameter.put("taUserId",tpTicket.getTaUserId());
136
+        Map<String, Object> parameter = Maps.newHashMap();
137
+        parameter.put("communityId", tpTicket.getCommunityId());
138
+        parameter.put("taUserId", tpTicket.getTaUserId());
139 139
 
140 140
         //  0 代表 报修  1 代表 投诉  2代表 联系单
141
-        parameter.put("type",tpTicket.getType());
141
+        parameter.put("type", tpTicket.getType());
142 142
 
143
-        PageHelper.startPage(pageNum,pageSize);
143
+        PageHelper.startPage(pageNum, pageSize);
144 144
         List<TpTicket> tpTicketList = tpTicketMapper.selectByCommuniytIdAndByTaUserIdAndByType(parameter);
145 145
 
146 146
         List<TpTicketVO> tpTicketVOList = Lists.newArrayList();
147
-        tpTicketVOConvert(tpTicketList,tpTicketVOList);
147
+        tpTicketVOConvert(tpTicketList, tpTicketVOList);
148 148
 
149 149
         response.addSuccess(tpTicketVOList);
150 150
 
151 151
         return response;
152 152
     }
153
-    
153
+
154 154
     /**
155 155
      * 获取报修详情
156
+     *
156 157
      * @param communityId
157 158
      * @param ticketId
158 159
      * @return
@@ -160,10 +161,10 @@ public class TicketServiceImpl implements ITicketService {
160 161
     @Override
161 162
     public TpTicket getTicketSchedule(String communityId, Integer ticketId) {
162 163
         //查看工单详情
163
-        TpTicket ticket = tpTicketMapper.selectByTicketId(communityId,ticketId);
164
-        if (null != ticket){
164
+        TpTicket ticket = tpTicketMapper.selectByTicketId(communityId, ticketId);
165
+        if (null != ticket) {
165 166
             //工单进度
166
-            List<TpTicketRecord> ticketRecordList = tpTicketRecordMapper.getTicketRecordByTicketId(communityId,ticketId);
167
+            List<TpTicketRecord> ticketRecordList = tpTicketRecordMapper.getTicketRecordByTicketId(communityId, ticketId);
167 168
             //工单回复
168 169
             ticketRecordList.stream().forEach(TpTicketRecord -> {
169 170
                 List<TpTicketRecordComment> ticketRecordCommentList = tpTicketRecordCommentMapper.selectByTicketRecordId(TpTicketRecord);
@@ -175,25 +176,35 @@ public class TicketServiceImpl implements ITicketService {
175 176
     }
176 177
 
177 178
     @Override
178
-    public ResponseBean addAiTicketService(Integer userId, TpTicket tpTicket) {
179
+    public ResponseBean addAiTicketService(Integer userId, String parameter) {
179 180
         ResponseBean response = new ResponseBean();
181
+        JSONObject jsonObject = JSONObject.parseObject(parameter);
182
+        String ticketContent = (String) jsonObject.get("ticketContent");
183
+        String ticketTitle = (String) jsonObject.get("ticketTitle");
184
+        String repairType = (String) jsonObject.get("repairType");
180 185
         TaUser user = taUserMapper.selectByPrimaryKey(userId);
186
+        TpTicket tpTicket=new TpTicket();
181 187
         tpTicket.setCommunityId(user.getCommunityId());
182 188
         tpTicket.setTaUserId(userId);
183
-        tpTicket.setTpUserId(userId);
189
+        tpTicket.setStatus("2");
190
+        tpTicket.setRepairType(repairType);
191
+        tpTicket.setTicketTitle(ticketTitle);
192
+        tpTicket.setTicketContent(ticketContent);
184 193
         tpTicket.setCreateUser(userId);
185 194
         tpTicket.setCreateDate(new Date());
186 195
         tpTicket.setUpdateUser(userId);
187 196
         tpTicket.setUpdateDate(new Date());
188
-        tpTicketMapper.insert(tpTicket);
197
+        tpTicketMapper.insertSelective(tpTicket);
198
+        Integer id=tpTicket.getId();
189 199
         TpTicketRecord tpTicketRecord = new TpTicketRecord();
190 200
         //获取当前插入的信息,维护工单记录表
191
-        TpTicket tpTicketReco = tpTicketMapper.getById(userId, user.getCommunityId());
201
+        TpTicket tpTicketReco = tpTicketMapper.selectByPrimaryKey(id);
192 202
         tpTicketRecord.setCommunityId(user.getCommunityId());
193 203
         tpTicketRecord.setTicketId(tpTicketReco.getId());
204
+        tpTicketRecord.setStatus(tpTicketReco.getStatus());
194 205
         tpTicketRecord.setCreateUser(userId);
195 206
         tpTicketRecord.setCreateDate(new Date());
196
-        tpTicketRecordMapper.insert(tpTicketRecord);
207
+        tpTicketRecordMapper.insertSelective(tpTicketRecord);
197 208
         response.addSuccess("新增成功");
198 209
         return response;
199 210
     }

+ 1
- 1
CODE/smart-community/app-api/src/main/resources/mapper/TaUserMapper.xml Datei anzeigen

@@ -260,7 +260,7 @@
260 260
     where login_name=#{loginName,jdbcType=VARCHAR}
261 261
   </select>
262 262
 
263
-  <select id="ubdateLongName" parameterType="com.community.huiju.model.TaUser" resultMap="BaseResultMap">
263
+  <select id="updateLongName" parameterType="com.community.huiju.model.TaUser" resultMap="BaseResultMap">
264 264
     update ta_user
265 265
     set
266 266
     login_name = #{loginName,jdbcType=VARCHAR}

+ 1
- 1
CODE/smart-community/app-api/src/main/resources/mapper/TpTicketMapper.xml Datei anzeigen

@@ -45,7 +45,7 @@
45 45
       #{comment,jdbcType=VARCHAR}, #{createUser,jdbcType=INTEGER}, #{createDate,jdbcType=TIMESTAMP}, 
46 46
       #{updateUser,jdbcType=INTEGER}, #{updateDate,jdbcType=TIMESTAMP})
47 47
   </insert>
48
-  <insert id="insertSelective" parameterType="com.community.huiju.model.TpTicket" >
48
+  <insert id="insertSelective" useGeneratedKeys="true" keyProperty="id" parameterType="com.community.huiju.model.TpTicket" >
49 49
     insert into tp_ticket
50 50
     <trim prefix="(" suffix=")" suffixOverrides="," >
51 51
       <if test="id != null" >

+ 12
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TpTransactionMapper.xml Datei anzeigen

@@ -188,4 +188,16 @@
188 188
     from tp_transaction
189 189
     where community_id = #{communityId,jdbcType=INTEGER} and ta_user_id = #{userId,jdbcType=INTEGER}
190 190
   </select>
191
+
192
+  <update id="updateTransaction" parameterType="com.community.huiju.model.TpTransaction" >
193
+    update tp_transaction
194
+    set
195
+    ta_user_id = #{userId,jdbcType=INTEGER},
196
+    transaction_title = #{transactionTitle,jdbcType=VARCHAR},
197
+    transaction_content = #{transactionContent,jdbcType=VARCHAR},
198
+     type = #{Type,jdbcType=CHAR},
199
+    update_user = #{userId,jdbcType=INTEGER},
200
+    update_date = now()
201
+    where id = #{id,jdbcType=INTEGER}
202
+  </update>
191 203
 </mapper>