瀏覽代碼

Merge branch 'develop' of http://git.ycjcjy.com/fuxingfan/smartCommunity into develop

傅行帆 6 年之前
父節點
當前提交
f7d50d4529

+ 3
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/TicketController.java 查看文件

@@ -21,6 +21,7 @@ import org.springframework.cloud.context.config.annotation.RefreshScope;
21 21
 import org.springframework.web.bind.annotation.*;
22 22
 
23 23
 import javax.servlet.http.HttpSession;
24
+import java.io.IOException;
24 25
 import java.util.List;
25 26
 
26 27
 @RestController
@@ -125,12 +126,12 @@ public class TicketController {
125 126
     @ApiOperation(value = "添加报修", notes = "添加报修")
126 127
     @ApiImplicitParams({
127 128
             @ApiImplicitParam(paramType = "body", dataType = "String", name = "paramets", value =
128
-                    "ticketTitle:工单内容,ticketContent:小区标题,repairType:0:公共区域  1: 房屋质量  2:户内设施 "),
129
+                    "ticketTitle:工单内容,ticketContent:小区标题,repairType:0:公共区域  1: 房屋质量  2:户内设施, imageUrl:图片地址 "),
129 130
             @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token")
130 131
     })
131 132
     @RequestMapping(value = "/addtpTicket", method = RequestMethod.POST)
132 133
     @ResponseBody
133
-    public ResponseBean addTransaction(@RequestBody String paramets, HttpSession session) {
134
+    public ResponseBean addTransaction(@RequestBody String paramets, HttpSession session) throws IOException {
134 135
         ResponseBean responseBean = new ResponseBean();
135 136
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
136 137
         Integer userId = userElement.getId();

+ 2
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/ITicketService.java 查看文件

@@ -5,6 +5,7 @@ import com.community.huiju.model.TpTicket;
5 5
 import com.community.huiju.model.TpTicketRecordComment;
6 6
 import com.community.huiju.vo.TpTicketVO;
7 7
 
8
+import java.io.IOException;
8 9
 import java.util.List;
9 10
 
10 11
 /**
@@ -46,7 +47,7 @@ public interface ITicketService {
46 47
 	 * @param parameter
47 48
 	 * @return
48 49
 	 */
49
-    ResponseBean addAiTicketService(Integer userId,String parameter);
50
+    ResponseBean addAiTicketService(Integer userId,String parameter) throws IOException;
50 51
 	
51 52
 	/**
52 53
 	 * 回复工单

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

@@ -271,7 +271,7 @@ public class SocialServiceImpl implements SocialServiceI {
271 271
 
272 272
         if (Constant.EFFECTIVE.equals(taUser.getStatus()) && (Constant.RELATION.equals(sysRole.getRoleName()) || Constant.TENANT.equals(sysRole.getRoleName()) || Constant.OWNER.equals(sysRole.getRoleName()))){
273 273
             tpTransactionMapper.insertSelective(tpTransaction);
274
-            insertTdImage(tpTransaction, imageUrl, type, userId);
274
+            insertTdImage(tpTransaction, imageUrl, userId);
275 275
 
276 276
             TpTransaction tpTransaction1=tpTransactionMapper.getById(tpTransaction.getId());
277 277
             response.addSuccess(tpTransaction1);
@@ -281,11 +281,11 @@ public class SocialServiceImpl implements SocialServiceI {
281 281
         return response;
282 282
     }
283 283
 
284
-    private void insertTdImage(TpTransaction tpTransaction, String imageUrl, String type, Integer userId) throws IOException {
284
+    private void insertTdImage(TpTransaction tpTransaction, String imageUrl, Integer userId) throws IOException {
285 285
         TdImages tdImages = new TdImages();
286 286
         Integer uuId = tpTransaction.getId();
287 287
         tdImages.setImageUrl(imageUrl);
288
-        tdImages.setType(type);
288
+        tdImages.setType(Constant.SOCIAL);
289 289
         tdImages.setUuid(uuId);
290 290
         tdImages.setCreateUser(userId);
291 291
         tdImages.setCreateTime(new Date());

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

@@ -4,10 +4,7 @@ package com.community.huiju.service.impl;
4 4
 import com.alibaba.fastjson.JSONObject;
5 5
 import com.community.commom.constant.Constant;
6 6
 import com.community.commom.mode.ResponseBean;
7
-import com.community.huiju.dao.TaUserMapper;
8
-import com.community.huiju.dao.TpTicketMapper;
9
-import com.community.huiju.dao.TpTicketRecordCommentMapper;
10
-import com.community.huiju.dao.TpTicketRecordMapper;
7
+import com.community.huiju.dao.*;
11 8
 import com.community.huiju.model.*;
12 9
 import com.community.huiju.service.ITicketService;
13 10
 import com.community.huiju.vo.TpTicketVO;
@@ -20,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired;
20 17
 import org.springframework.stereotype.Service;
21 18
 import org.springframework.transaction.annotation.Transactional;
22 19
 
20
+import java.io.IOException;
23 21
 import java.util.Date;
24 22
 import java.util.List;
25 23
 import java.util.Map;
@@ -44,6 +42,9 @@ public class TicketServiceImpl implements ITicketService {
44 42
     @Autowired
45 43
     private TaUserMapper taUserMapper;
46 44
 
45
+    @Autowired
46
+    private TdImagesMapper tdImagesMapper;
47
+
47 48
     @Override
48 49
     public ResponseBean getList(TpTicket tpTicket, Integer pageNum, Integer pageSize) {
49 50
 
@@ -177,12 +178,13 @@ public class TicketServiceImpl implements ITicketService {
177 178
     }
178 179
 
179 180
     @Override
180
-    public ResponseBean addAiTicketService(Integer userId, String parameter) {
181
+    public ResponseBean addAiTicketService(Integer userId, String parameter) throws IOException {
181 182
         ResponseBean response = new ResponseBean();
182 183
         JSONObject jsonObject = JSONObject.parseObject(parameter);
183 184
         String ticketContent = (String) jsonObject.get("ticketContent");
184 185
         String ticketTitle = (String) jsonObject.get("ticketTitle");
185 186
         String repairType = (String) jsonObject.get("repairType");
187
+        String imageUrl = (String) jsonObject.get("imageUrl");
186 188
 
187 189
         TaUser user = taUserMapper.selectByPrimaryKey(userId);
188 190
 
@@ -198,7 +200,10 @@ public class TicketServiceImpl implements ITicketService {
198 200
         tpTicket.setUpdateUser(userId);
199 201
         tpTicket.setUpdateDate(new Date());
200 202
 
203
+
201 204
         tpTicketMapper.insertSelective(tpTicket);
205
+        insertTdImage(tpTicket, imageUrl, userId);
206
+
202 207
         Integer id=tpTicket.getId();
203 208
         TpTicketRecord tpTicketRecord = new TpTicketRecord();
204 209
         //获取当前插入的信息,维护工单记录表
@@ -213,6 +218,18 @@ public class TicketServiceImpl implements ITicketService {
213 218
         response.addSuccess(tpTicketReco);
214 219
         return response;
215 220
     }
221
+
222
+    private void insertTdImage(TpTicket tpTicket, String imageUrl, Integer userId) throws IOException {
223
+        TdImages tdImages = new TdImages();
224
+        Integer uuId = tpTicket.getId();
225
+        tdImages.setImageUrl(imageUrl);
226
+        tdImages.setType(Constant.SERVICE);
227
+        tdImages.setUuid(uuId);
228
+        tdImages.setCreateUser(userId);
229
+        tdImages.setCreateTime(new Date());
230
+        tdImagesMapper.insertSelective(tdImages);
231
+    }
232
+
216 233
     /**
217 234
      * 回复工单
218 235
      * @param tpTicketRecordComment

+ 5
- 0
CODE/smart-community/community-common/src/main/java/com/community/commom/constant/Constant.java 查看文件

@@ -87,4 +87,9 @@ public class Constant {
87 87
     /** banner的类型 文章 **/
88 88
     public static final String BANNER_TYPE_ARTICLE = "2";
89 89
 
90
+    /**图片社交类型**/
91
+    public static final String SOCIAL = "social";
92
+
93
+    /**图片服务类型**/
94
+    public static final String SERVICE = "service";
90 95
 }