|
|
@@ -48,11 +48,15 @@ public class WorkOrderFrontServiceImpl implements WorkOrderFrontService {
|
|
|
User user = userService.getById(userId);
|
|
|
if (user == null) throw BusinessRuntimeException.getGatewayApiCode(GatewayApiCode.CMS_TOKEN_VALID);
|
|
|
String content = workOrderReq.getContent();
|
|
|
+ String imgs = workOrderReq.getImgs();
|
|
|
+ if (StrUtil.isEmpty(content) && StrUtil.isEmpty(imgs)) {
|
|
|
+ throw BusinessRuntimeException.getInstance("请输入相关内容");
|
|
|
+ }
|
|
|
String topic = workOrderReq.getTopic();
|
|
|
if (topic.length() > 32) {
|
|
|
throw BusinessRuntimeException.getInstance("标题最多输入30字数以内");
|
|
|
}
|
|
|
- if (content.length() > 200) {
|
|
|
+ if (StrUtil.isNotBlank(content) && content.length() > 200) {
|
|
|
throw BusinessRuntimeException.getInstance("问题描述最多输入200字数以内");
|
|
|
}
|
|
|
List<Long> userIds = userService.getRelationUserIdList(userId, user);
|
|
|
@@ -75,7 +79,6 @@ public class WorkOrderFrontServiceImpl implements WorkOrderFrontService {
|
|
|
workOrderChatHistory.setUserId(userId);
|
|
|
workOrderChatHistory.setWorkOrderId(workOrder.getId());
|
|
|
workOrderChatHistory.setContent(content);
|
|
|
- String imgs = workOrderReq.getImgs();
|
|
|
if (StrUtil.isNotBlank(imgs)) {
|
|
|
if (!imgs.contains("[") && !imgs.contains("]")) {
|
|
|
imgs = String.format("[\"%s\"]", imgs);
|
|
|
@@ -98,8 +101,13 @@ public class WorkOrderFrontServiceImpl implements WorkOrderFrontService {
|
|
|
List<Long> userIds = userService.getRelationUserIdList(userId, user);
|
|
|
if (!userIds.contains(workOrder.getUserId())) throw BusinessRuntimeException.getInstance("网络错误");
|
|
|
String content = history.getContent();
|
|
|
- if (content.length() > 200) throw BusinessRuntimeException.getInstance("回复内容最多200字数以内");
|
|
|
String imgs = history.getImgs();
|
|
|
+ if (StrUtil.isEmpty(content) && StrUtil.isEmpty(imgs)) {
|
|
|
+ throw BusinessRuntimeException.getInstance("请回复相关内容");
|
|
|
+ }
|
|
|
+ if (StrUtil.isNotBlank(content) && content.length() > 200)
|
|
|
+ throw BusinessRuntimeException.getInstance("回复内容最多200字数以内");
|
|
|
+
|
|
|
if (StrUtil.isNotBlank(imgs)) {
|
|
|
if (!imgs.contains("[") && !imgs.contains("]")) {
|
|
|
imgs = String.format("[\"%s\"]", imgs);
|