Commit 8f59001e by zhiwj

导购code判断

parent fca04ea4
......@@ -11,9 +11,12 @@ import com.gic.store.dao.mapper.TabStoreInfoMapper;
import com.gic.store.dao.mapper.TabStoreMapper;
import com.gic.store.dao.mapper.TabStorePhotoMapper;
import com.gic.store.dto.StoreDTO;
import com.gic.store.dto.StoreExtendDTO;
import com.gic.store.dto.StoreSearchDBDTO;
import com.gic.store.entity.TabStore;
import com.gic.store.entity.TabStoreField;
import com.gic.store.entity.TabStoreInfo;
import com.gic.store.service.StoreFieldService;
import com.gic.store.service.StoreService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
......@@ -45,6 +48,8 @@ public class StoreServiceImpl implements StoreService {
TabStorePhotoMapper tabStorePhotoMapper;
@Autowired
private TabStoreMapper tabStoreMapper;
@Autowired
private StoreFieldService storeFieldService;
@Override
public Integer save(StoreDTO copy) {
......@@ -187,12 +192,21 @@ public class StoreServiceImpl implements StoreService {
@Override
public Integer checkCompleteStatus(StoreDTO storeDTO) {
List<StoreExtendDTO> storeExtendList = storeDTO.getStoreExtendList();
for (StoreExtendDTO storeExtendDTO : storeExtendList) {
TabStoreField field = storeFieldService.getStoreFieldById(storeExtendDTO.getStoreFieldId());
if (field != null) {
if (StringUtils.isNotBlank(field.getStoreFieldDetail()) && field.getStoreFieldDetail().contains("\"isMust\":1") && StringUtils.isBlank(storeExtendDTO.getValue())) {
return GlobalInfo.DATA_STATUS_DELETE;
}
}
}
return StringUtils.isNotBlank(storeDTO.getStoreName()) &&
storeDTO.getRegionId() != null &&
StringUtils.isNotBlank(storeDTO.getStoreCode()) &&
CollectionUtils.isNotEmpty(storeDTO.getPhotoList()) &&
// storeDTO.getStoreType() != null &&
// storeDTO.getErpStatus() != null &&
storeDTO.getStoreType() != null &&
storeDTO.getErpStatus() != null &&
StringUtils.isNotBlank(storeDTO.getConactsPhone()) &&
CollectionUtils.isNotEmpty(storeDTO.getBusinessTimeList()) &&
StringUtils.isNotBlank(storeDTO.getBusinessTimeList().get(0).getWeekday()) &&
......
......@@ -81,8 +81,18 @@ public class ClerkApiServiceImpl implements ClerkApiService {
}
// 校验参数
if (StringUtils.isBlank(clerkDTO.getClerkCode())) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "门店下导购代码不能为空");
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "导购代码不可为空");
}
if (StringUtils.isBlank(clerkDTO.getClerkName())) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "导购姓名不可为空");
}
if ("null".equals(clerkDTO.getClerkCode().toLowerCase())) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "导购代码不可为null");
}
if (!clerkDTO.getClerkCode().matches("^[\\w\\d]{1,30}$")) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "导购代码仅支持数字和英文字符");
}
try {
RedisUtil.lock("enterprise:clerk:position:" + clerkDTO.getStoreInfoId(), 3L, TimeUnit.SECONDS, 3L);
......
......@@ -217,7 +217,7 @@ public class StoreImportApiServiceImpl implements StoreImportApiService {
List<String> rowNameList = new ArrayList<>();
Collections.addAll(rowNameList, rowName);
String[] description = { "", "不能超过20个字", "必填,不能超过20个字符,为erp系统中门店唯一识别码", "门店类型描述", "门店状态描述", "门店电话描述", "门店在GIC的所属分组描述", "门店在GIC的所属店招品牌", "省描述", "市描述", "区县描述", "门店地址(不包括省市区)描述", "", "" };
String[] description = { "", "不能超过20个字", "必填,不能超过20个字符,为erp系统中门店唯一识别码", "门店字段管理中勾选的门店类型", "门店字段管理中勾选的门店状态", "不超过15位,仅支持数字和“-”", "门店在GIC的所属分组描述", "门店在GIC的所属店招品牌", "省描述", "市描述", "区县描述", "门店地址(不包括省市区)描述", "经度", "纬度" };
List<String> descriptionList = new ArrayList<>();
Collections.addAll(descriptionList, description);
......
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