Browse Source

fix(StoreApply):代理验证条件调整

Hu Jie 6 years ago
parent
commit
d73dc996bb

+ 34 - 2
src/main/java/com/uas/platform/b2c/prod/store/facade/impl/StoreApplyFacadeImpl.java

@@ -84,7 +84,7 @@ public class StoreApplyFacadeImpl implements StoreApplyFacade {
 					apply.setBrands(null);
 				}
 			}
-			if (StoreType.AGENCY == apply.getType() || StoreType.ORIGINAL_FACTORY == apply.getType()) {
+			if (StoreType.ORIGINAL_FACTORY == apply.getType()) {
 				if (CollectionUtils.isEmpty(apply.getBrands())) {
 					return new ResultMap(CodeType.NO_INFO, "品牌审核信息不能为空");
 				}
@@ -109,6 +109,22 @@ public class StoreApplyFacadeImpl implements StoreApplyFacade {
 					}
 				}
 			}
+            if (StoreType.AGENCY == apply.getType()) {
+                if (CollectionUtils.isEmpty(apply.getBrands())) {
+                    return new ResultMap(CodeType.NO_INFO, "品牌审核信息不能为空");
+                }
+                for (StoreBrandInfo brandInfo : apply.getBrands()) {
+                    Map map = new HashMap();
+                    map.put("authorizedArea", brandInfo.getAuthorizedArea());
+                    map.put("authorizedDate", brandInfo.getAuthorizedDate());
+                    map.put("authorizedFrom", brandInfo.getAuthorizedFrom());
+                    map.put("authorizedProduct", brandInfo.getAuthorizedProduct());
+                    map.put("authorizedStatus", brandInfo.getAuthorizedStatus());
+                    if (checkIsNull(map)) {
+                        return new ResultMap(CodeType.NO_INFO, "品牌信息不能为空");
+                    }
+                }
+            }
 			storeApply.setReason(null);
 		}
 		if (StoreApply.ApplyStatus.UNPASS == status) {
@@ -184,7 +200,7 @@ public class StoreApplyFacadeImpl implements StoreApplyFacade {
 				apply.setBrands(null);
 			}
 		}
-		if (StoreType.AGENCY == apply.getType() || StoreType.ORIGINAL_FACTORY == apply.getType()) {
+		if (StoreType.ORIGINAL_FACTORY == apply.getType()) {
 			if (CollectionUtils.isEmpty(apply.getBrands())) {
 				return new ResultMap(CodeType.NO_INFO, "品牌审核信息不能为空");
 			}
@@ -201,6 +217,22 @@ public class StoreApplyFacadeImpl implements StoreApplyFacade {
 				}
 			}
 		}
+        if (StoreType.AGENCY == apply.getType()) {
+            if (CollectionUtils.isEmpty(apply.getBrands())) {
+                return new ResultMap(CodeType.NO_INFO, "品牌审核信息不能为空");
+            }
+            for (StoreBrandInfo brandInfo : apply.getBrands()) {
+                Map map = new HashMap();
+                map.put("authorizedArea", brandInfo.getAuthorizedArea());
+                map.put("authorizedDate", brandInfo.getAuthorizedDate());
+                map.put("authorizedFrom", brandInfo.getAuthorizedFrom());
+                map.put("authorizedProduct", brandInfo.getAuthorizedProduct());
+                map.put("authorizedStatus", brandInfo.getAuthorizedStatus());
+                if (checkIsNull(map)) {
+                    return new ResultMap(CodeType.NO_INFO, "品牌信息不能为空");
+                }
+            }
+        }
 		Date date = new Date();
 		storeApply.setReason(null);
 		storeApply.setAuthPerson(user.getUserName());