Commit bcc041f8 authored by huyuchen's avatar huyuchen

优化修改

parent cdabf289
...@@ -64,8 +64,8 @@ public class ValidityConstants { ...@@ -64,8 +64,8 @@ public class ValidityConstants {
public static final String PATTERN_50 = "^.{1,50}$"; public static final String PATTERN_50 = "^.{1,50}$";
/** 最多60位 规则 */ /** 最多60位 规则 */
public static final String PATTERN_60 = "^.{1,60}$"; public static final String PATTERN_60 = "^.{1,60}$";
/** 最多200位 规则 */ /** 最多2048位 规则 */
public static final String PATTERN_200 = "[\\s\\S]{1,200}$"; public static final String PATTERN_2048 = "[\\s\\S]{1,2048}$";
public static String NUMBER_OF_DECIMAL_PLACE= "^[1-9]\\d*\\.\\d*|0\\.\\d*[1-9]\\d*$"; public static String NUMBER_OF_DECIMAL_PLACE= "^[1-9]\\d*\\.\\d*|0\\.\\d*[1-9]\\d*$";
......
...@@ -79,9 +79,9 @@ public class OrderConstants { ...@@ -79,9 +79,9 @@ public class OrderConstants {
*/ */
public static final String ORDER_CONTENT_IS_EMPTY = "订单内容不能为空"; public static final String ORDER_CONTENT_IS_EMPTY = "订单内容不能为空";
/** /**
* 订单内容,200字以内 * 订单内容,2048字以内
*/ */
public static final String ORDER_CONTENT_MORE_THAN_200 = "订单内容,200字以内"; public static final String ORDER_CONTENT_MORE_THAN_2048 = "订单内容,2048字以内";
/** /**
* 处理人不能为空 * 处理人不能为空
*/ */
...@@ -99,9 +99,9 @@ public class OrderConstants { ...@@ -99,9 +99,9 @@ public class OrderConstants {
*/ */
public static final String REPLY_CONTENT_AND_ENCLOSURE_IS_EMPTY = "回复内容和附件,两者必填其一"; public static final String REPLY_CONTENT_AND_ENCLOSURE_IS_EMPTY = "回复内容和附件,两者必填其一";
/** /**
* “回复内容”,200字以内 * “回复内容”,2048字以内
*/ */
public static final String REPLY_CONTENT_MORE_THAN_200 = "“回复内容”,200字以内"; public static final String REPLY_CONTENT_MORE_THAN_2048 = "“回复内容”,2048字以内";
/** /**
* 非法的附件类型 * 非法的附件类型
*/ */
......
...@@ -17,10 +17,10 @@ public class ValidityUtil { ...@@ -17,10 +17,10 @@ public class ValidityUtil {
* @param str * @param str
* @return {@link boolean} * @return {@link boolean}
*/ */
public static boolean validate200(final String str){ public static boolean validate2048(final String str){
if(Common.isEmpty(str)){ if(Common.isEmpty(str)){
return Boolean.FALSE; return Boolean.FALSE;
} }
return str.matches(ValidityConstants.PATTERN_200) ; return str.matches(ValidityConstants.PATTERN_2048) ;
} }
} }
...@@ -285,9 +285,9 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme ...@@ -285,9 +285,9 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
if (Common.isEmpty(replyContent) && ArrayUtils.isEmpty(file)){ if (Common.isEmpty(replyContent) && ArrayUtils.isEmpty(file)){
return R.failed(OrderConstants.REPLY_CONTENT_AND_ENCLOSURE_IS_EMPTY); return R.failed(OrderConstants.REPLY_CONTENT_AND_ENCLOSURE_IS_EMPTY);
} }
// 校验回复内容200字以内 // 校验回复内容2048字以内
if (!Common.isEmpty(replyContent) && !ValidityUtil.validate200(replyContent)){ if (!Common.isEmpty(replyContent) && !ValidityUtil.validate2048(replyContent)){
return R.failed(OrderConstants.REPLY_CONTENT_MORE_THAN_200); return R.failed(OrderConstants.REPLY_CONTENT_MORE_THAN_2048);
} }
if (ArrayUtils.isNotEmpty(file)){ if (ArrayUtils.isNotEmpty(file)){
...@@ -427,8 +427,8 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme ...@@ -427,8 +427,8 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
if (Common.isEmpty(vo.getOrderContent())){ if (Common.isEmpty(vo.getOrderContent())){
return R.failed(OrderConstants.ORDER_CONTENT_IS_EMPTY); return R.failed(OrderConstants.ORDER_CONTENT_IS_EMPTY);
} }
if (!Common.isEmpty(vo.getOrderContent()) && !ValidityUtil.validate200(vo.getOrderContent())){ if (!Common.isEmpty(vo.getOrderContent()) && !ValidityUtil.validate2048(vo.getOrderContent())){
return R.failed(OrderConstants.ORDER_CONTENT_MORE_THAN_200); return R.failed(OrderConstants.ORDER_CONTENT_MORE_THAN_2048);
} }
if (CollectionUtils.isEmpty(vo.getHandleUserList())){ if (CollectionUtils.isEmpty(vo.getHandleUserList())){
return R.failed(OrderConstants.HANDLE_USER_IS_EMPTY); return R.failed(OrderConstants.HANDLE_USER_IS_EMPTY);
...@@ -528,9 +528,9 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme ...@@ -528,9 +528,9 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
if (Common.isEmpty(vo.getReplyContent()) && ArrayUtils.isEmpty(vo.getFile())){ if (Common.isEmpty(vo.getReplyContent()) && ArrayUtils.isEmpty(vo.getFile())){
return R.failed(OrderConstants.REPLY_CONTENT_AND_ENCLOSURE_IS_EMPTY); return R.failed(OrderConstants.REPLY_CONTENT_AND_ENCLOSURE_IS_EMPTY);
} }
// 校验回复内容200字以内 // 校验回复内容2048字以内
if (!Common.isEmpty(vo.getReplyContent()) && !ValidityUtil.validate200(vo.getReplyContent())){ if (!Common.isEmpty(vo.getReplyContent()) && !ValidityUtil.validate2048(vo.getReplyContent())){
return R.failed(OrderConstants.REPLY_CONTENT_MORE_THAN_200); return R.failed(OrderConstants.REPLY_CONTENT_MORE_THAN_2048);
} }
if (ArrayUtils.isNotEmpty(vo.getFile())){ if (ArrayUtils.isNotEmpty(vo.getFile())){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment