|
@@ -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
|