|
@@ -23,6 +23,7 @@ import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
* 店铺申请外观实现类
|
|
@@ -78,6 +79,16 @@ public class StoreApplyFacadeImpl implements StoreApplyFacade {
|
|
|
if (StringUtils.isEmpty(apply.getEnQualification())) {
|
|
|
return new ResultMap(CodeType.NO_INFO, "公司资质信息不能为空");
|
|
|
}
|
|
|
+ if (StoreType.AGENCY != apply.getType() && StoreType.DISTRIBUTION != apply.getType()
|
|
|
+ && StoreType.ORIGINAL_FACTORY != apply.getType()) {
|
|
|
+ return new ResultMap(CodeType.ERROR_STATE, "请选择正确的的店铺类型");
|
|
|
+ }
|
|
|
+ if (!storeApply.getType().equals(apply.getType())) {
|
|
|
+ storeApply.setType(apply.getType());
|
|
|
+ if (StoreType.DISTRIBUTION.equals(storeApply.getType())) {
|
|
|
+ apply.setBrands(null);
|
|
|
+ }
|
|
|
+ }
|
|
|
if (StoreType.AGENCY == apply.getType() || StoreType.ORIGINAL_FACTORY == apply.getType()) {
|
|
|
if (CollectionUtils.isEmpty(apply.getBrands())) {
|
|
|
return new ResultMap(CodeType.NO_INFO, "品牌审核信息不能为空");
|
|
@@ -111,6 +122,11 @@ public class StoreApplyFacadeImpl implements StoreApplyFacade {
|
|
|
}
|
|
|
storeApply.setReason(apply.getReason());
|
|
|
}
|
|
|
+ List<Qualification> qualifications = apply.getQualifications();
|
|
|
+ qualifications.stream().filter(qualification -> StringUtils.isEmpty(qualification.getResourceUrl())).collect(Collectors.toList());
|
|
|
+ if (CollectionUtils.isEmpty(qualifications)) {
|
|
|
+ return new ResultMap(CodeType.NOT_PERMIT, "公司资质信息不能为空");
|
|
|
+ }
|
|
|
|
|
|
storeApply.setFinalPerson(user.getUserName());
|
|
|
storeApply.setStatus(status);
|
|
@@ -150,6 +166,16 @@ public class StoreApplyFacadeImpl implements StoreApplyFacade {
|
|
|
if (StringUtils.isEmpty(apply.getEnQualification())) {
|
|
|
return new ResultMap(CodeType.NO_INFO, "公司资质信息不能为空");
|
|
|
}
|
|
|
+ if (StoreType.AGENCY != apply.getType() && StoreType.DISTRIBUTION != apply.getType()
|
|
|
+ && StoreType.ORIGINAL_FACTORY != apply.getType()) {
|
|
|
+ return new ResultMap(CodeType.ERROR_STATE, "请选择正确的的店铺类型");
|
|
|
+ }
|
|
|
+ if (!storeApply.getType().equals(apply.getType())) {
|
|
|
+ storeApply.setType(apply.getType());
|
|
|
+ if (StoreType.DISTRIBUTION.equals(storeApply.getType())) {
|
|
|
+ apply.setBrands(null);
|
|
|
+ }
|
|
|
+ }
|
|
|
if (StoreType.AGENCY == apply.getType() || StoreType.ORIGINAL_FACTORY == apply.getType()) {
|
|
|
if (CollectionUtils.isEmpty(apply.getBrands())) {
|
|
|
return new ResultMap(CodeType.NO_INFO, "品牌审核信息不能为空");
|
|
@@ -167,6 +193,7 @@ public class StoreApplyFacadeImpl implements StoreApplyFacade {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ storeApply.setQualificationsJson(apply.getQualificationsJson());
|
|
|
Date date = new Date();
|
|
|
storeApply.setReason(null);
|
|
|
storeApply.setAuthPerson(user.getUserName());
|
|
@@ -188,7 +215,6 @@ public class StoreApplyFacadeImpl implements StoreApplyFacade {
|
|
|
if (entry.getValue() == null || "".equals(entry.getValue())) {
|
|
|
return true;
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
return false;
|
|
|
}
|