|
@@ -122,6 +122,17 @@ public class TicketServiceImpl implements ITicketService {
|
122
|
122
|
// 设置工单编号
|
123
|
123
|
lastRecordMap.put("tickerId", e.getId());
|
124
|
124
|
TpTicketRecordComment comment = getTicketRecordComment(lastRecordMap);
|
|
125
|
+ List<TpTicketRecord> recordList = tpTicketRecordMapper.getTicketRecordByTicketId(e.getCommunityId()+"",e.getId());
|
|
126
|
+ // 报修类型:0:公共区域 1: 房屋质量 2::户内设施 PS : 报修的情况下才有报修类型
|
|
127
|
+ String repairType = e.getRepairType();
|
|
128
|
+ String repairName = repairType == null?
|
|
129
|
+ null:"0".equals(repairType)?
|
|
130
|
+ "公共区域":"1".equals(repairType)?
|
|
131
|
+ "房屋质量":"2".equals(repairType)?
|
|
132
|
+ "户内设施":null;
|
|
133
|
+ tpTicketVO.setRepairName(repairName);
|
|
134
|
+ tpTicketVO.setStatus(recordList.get(0).getStatus());
|
|
135
|
+ tpTicketVO.setTicketStatusName(recordList.get(0).getTicketStatusName());
|
125
|
136
|
if (null != comment) {
|
126
|
137
|
tpTicketVO.setCommentContent(comment.getContent());
|
127
|
138
|
tpTicketVO.setCommentCreateDate(comment.getCreateDate());
|
|
@@ -176,7 +187,15 @@ public class TicketServiceImpl implements ITicketService {
|
176
|
187
|
List<TpTicketRecordComment> ticketRecordCommentList = tpTicketRecordCommentMapper.selectByTicketRecordId(TpTicketRecord);
|
177
|
188
|
TpTicketRecord.setTicketRecordCommentList(ticketRecordCommentList);
|
178
|
189
|
});
|
|
190
|
+
|
|
191
|
+ Map<String,Object> map = Maps.newHashMap();
|
|
192
|
+ map.put("uuid",ticket.getId());
|
|
193
|
+ map.put("type","service");
|
|
194
|
+ List<TdImages> tdImagesList = tdImagesMapper.getByUUIDAndByType(map);
|
|
195
|
+
|
|
196
|
+ ticket.setTdImagesList(tdImagesList);
|
179
|
197
|
ticket.setTicketRecordList(ticketRecordList);
|
|
198
|
+
|
180
|
199
|
}
|
181
|
200
|
return ticket;
|
182
|
201
|
}
|
|
@@ -185,26 +204,21 @@ public class TicketServiceImpl implements ITicketService {
|
185
|
204
|
public ResponseBean addAiTicketService(Integer userId, String parameter) throws IOException {
|
186
|
205
|
ResponseBean response = new ResponseBean();
|
187
|
206
|
JSONObject jsonObject = JSONObject.parseObject(parameter);
|
188
|
|
- String ticketContent = (String) jsonObject.get("ticketContent");
|
189
|
|
- String ticketTitle = (String) jsonObject.get("ticketTitle");
|
190
|
|
- String repairType = (String) jsonObject.get("repairType");
|
191
|
207
|
String imageUrl = (String) jsonObject.get("imageUrl");
|
192
|
208
|
|
|
209
|
+
|
|
210
|
+ TpTicket tpTicket = JSONObject.parseObject(parameter,TpTicket.class);
|
|
211
|
+
|
193
|
212
|
TaUser user = taUserMapper.selectByPrimaryKey(userId);
|
194
|
213
|
|
195
|
|
- TpTicket tpTicket=new TpTicket();
|
196
|
214
|
tpTicket.setCommunityId(user.getCommunityId());
|
197
|
215
|
tpTicket.setTaUserId(userId);
|
198
|
216
|
tpTicket.setStatus("2");
|
199
|
|
- tpTicket.setRepairType(repairType);
|
200
|
|
- tpTicket.setTicketTitle(ticketTitle);
|
201
|
|
- tpTicket.setTicketContent(ticketContent);
|
202
|
217
|
tpTicket.setCreateUser(userId);
|
203
|
218
|
tpTicket.setCreateDate(new Date());
|
204
|
219
|
tpTicket.setUpdateUser(userId);
|
205
|
220
|
tpTicket.setUpdateDate(new Date());
|
206
|
221
|
|
207
|
|
-
|
208
|
222
|
tpTicketMapper.insertSelective(tpTicket);
|
209
|
223
|
insertTdImage(tpTicket, imageUrl, userId);
|
210
|
224
|
|
|
@@ -223,6 +237,13 @@ public class TicketServiceImpl implements ITicketService {
|
223
|
237
|
return response;
|
224
|
238
|
}
|
225
|
239
|
|
|
240
|
+ /**
|
|
241
|
+ * 存入图片
|
|
242
|
+ * @param tpTicket
|
|
243
|
+ * @param imageUrl
|
|
244
|
+ * @param userId
|
|
245
|
+ * @throws IOException
|
|
246
|
+ */
|
226
|
247
|
private void insertTdImage(TpTicket tpTicket, String imageUrl, Integer userId) throws IOException {
|
227
|
248
|
TdImages tdImages = new TdImages();
|
228
|
249
|
Integer uuId = tpTicket.getId();
|