|
@@ -1,6 +1,7 @@
|
|
|
package com.cyksj.service.user.impl;
|
|
package com.cyksj.service.user.impl;
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
import com.cyksj.common.exception.BusinessRuntimeException;
|
|
import com.cyksj.common.exception.BusinessRuntimeException;
|
|
|
import com.cyksj.enums.GatewayApiCode;
|
|
import com.cyksj.enums.GatewayApiCode;
|
|
|
import com.cyksj.mapper.manage.sys.WorkOrderChatHistoryMapper;
|
|
import com.cyksj.mapper.manage.sys.WorkOrderChatHistoryMapper;
|
|
@@ -74,6 +75,14 @@ public class WorkOrderFrontServiceImpl implements WorkOrderFrontService {
|
|
|
workOrderChatHistory.setUserId(userId);
|
|
workOrderChatHistory.setUserId(userId);
|
|
|
workOrderChatHistory.setWorkOrderId(workOrder.getId());
|
|
workOrderChatHistory.setWorkOrderId(workOrder.getId());
|
|
|
workOrderChatHistory.setContent(content);
|
|
workOrderChatHistory.setContent(content);
|
|
|
|
|
+ String imgs = workOrderReq.getImgs();
|
|
|
|
|
+ if (StrUtil.isNotBlank(imgs)) {
|
|
|
|
|
+ if (!imgs.contains("[") && !imgs.contains("]")) {
|
|
|
|
|
+ imgs = String.format("[\"%s\"]", imgs);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (imgs.length() > 2000) throw BusinessRuntimeException.getInstance("选择图片过多");
|
|
|
|
|
+ workOrderChatHistory.setImgs(imgs);
|
|
|
|
|
+ }
|
|
|
historyMapper.insert(workOrderChatHistory);
|
|
historyMapper.insert(workOrderChatHistory);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -90,6 +99,13 @@ public class WorkOrderFrontServiceImpl implements WorkOrderFrontService {
|
|
|
if (!userIds.contains(workOrder.getUserId())) throw BusinessRuntimeException.getInstance("网络错误");
|
|
if (!userIds.contains(workOrder.getUserId())) throw BusinessRuntimeException.getInstance("网络错误");
|
|
|
String content = history.getContent();
|
|
String content = history.getContent();
|
|
|
if (content.length() > 200) throw BusinessRuntimeException.getInstance("回复内容最多200字数以内");
|
|
if (content.length() > 200) throw BusinessRuntimeException.getInstance("回复内容最多200字数以内");
|
|
|
|
|
+ String imgs = history.getImgs();
|
|
|
|
|
+ if (StrUtil.isNotBlank(imgs)) {
|
|
|
|
|
+ if (!imgs.contains("[") && !imgs.contains("]")) {
|
|
|
|
|
+ imgs = String.format("[\"%s\"]", imgs);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (imgs.length() > 2000) throw BusinessRuntimeException.getInstance("选择图片过多");
|
|
|
|
|
+ }
|
|
|
history.setFrom(WorkOrderChatHistory.Messenger.user);
|
|
history.setFrom(WorkOrderChatHistory.Messenger.user);
|
|
|
history.setTo(WorkOrderChatHistory.Messenger.root);
|
|
history.setTo(WorkOrderChatHistory.Messenger.root);
|
|
|
historyMapper.insert(history);
|
|
historyMapper.insert(history);
|