Commit 0bae98fb by 陶光胜

导购信息长度限制

parent 6bee3179
package com.gic.store.dto; package com.gic.store.dto;
import org.hibernate.validator.constraints.Length;
import java.io.Serializable; import java.io.Serializable;
/** /**
...@@ -17,11 +19,13 @@ public class ClerkDTO implements Serializable { ...@@ -17,11 +19,13 @@ public class ClerkDTO implements Serializable {
/** /**
* 店员名称 * 店员名称
*/ */
@Length(max = 32, message = "导购名称最大长度为32位")
private String clerkName; private String clerkName;
/** /**
* 店员编码 * 店员编码
*/ */
@Length(max = 32, message = "导购code最大长度为32位")
private String clerkCode; private String clerkCode;
/** /**
...@@ -53,6 +57,7 @@ public class ClerkDTO implements Serializable { ...@@ -53,6 +57,7 @@ public class ClerkDTO implements Serializable {
/** /**
* 电话号码 * 电话号码
*/ */
@Length(max = 11, message = "导购手机号最大长度为11位")
private String phoneNumber; private String phoneNumber;
/** /**
......
...@@ -24,6 +24,7 @@ import com.gic.store.dto.clerk.ProcessBatchClerkDTO; ...@@ -24,6 +24,7 @@ import com.gic.store.dto.clerk.ProcessBatchClerkDTO;
import com.gic.store.entity.TabClerk; import com.gic.store.entity.TabClerk;
import com.gic.store.entity.TabStoreRegion; import com.gic.store.entity.TabStoreRegion;
import com.gic.store.service.*; import com.gic.store.service.*;
import com.gic.store.utils.valid.ValidUtil;
import com.gic.weimob.api.dto.WeimobGuiderSynDTO; import com.gic.weimob.api.dto.WeimobGuiderSynDTO;
import com.gic.weimob.api.service.WeimobStoreSiteService; import com.gic.weimob.api.service.WeimobStoreSiteService;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
...@@ -77,6 +78,10 @@ public class ClerkApiServiceImpl implements ClerkApiService { ...@@ -77,6 +78,10 @@ public class ClerkApiServiceImpl implements ClerkApiService {
@Override @Override
public ServiceResponse saveOrUpdate(ClerkDTO clerkDTO) { public ServiceResponse saveOrUpdate(ClerkDTO clerkDTO) {
ServiceResponse paramResult = ValidUtil.allCheckValidate(clerkDTO);
if (!paramResult.isSuccess()) {
return paramResult;
}
if (validStoreIsOther(clerkDTO.getEnterpriseId(), clerkDTO.getStoreInfoId())) { if (validStoreIsOther(clerkDTO.getEnterpriseId(), clerkDTO.getStoreInfoId())) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "权限不足"); return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "权限不足");
} }
......
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