Explorar o código

店铺审核修改

Hu Jie %!s(int64=7) %!d(string=hai) anos
pai
achega
5767a84b8a

+ 7 - 7
src/main/java/com/uas/platform/b2c/prod/store/facade/StoreApplyFacade.java

@@ -30,13 +30,13 @@ public interface StoreApplyFacade {
 	ResultMap confirmOpenStore(String uuid, StoreApply storeApply);
 
 
-	/**
-	 * 自动确认开铺
-	 *
-	 * @param uuid			店铺申请信息编号
-	 * @param storeApply	更新的店铺信息
-	 */
-	ResultMap autoConfirmOpenStore(String uuid, StoreApply storeApply);
+//	/**
+//	 * 自动确认开铺
+//	 *
+//	 * @param uuid			店铺申请信息编号
+//	 * @param storeApply	更新的店铺信息
+//	 */
+//	ResultMap autoConfirmOpenStore(String uuid, StoreApply storeApply);
 
 	/**
 	 * 保存店铺申请信息

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

@@ -43,6 +43,13 @@ public class StoreApplyFacadeImpl implements StoreApplyFacade {
 
 	@Override
 	public ResultMap handlerApply(String uuid, StoreApply.ApplyStatus status, StoreApply apply) {
+		// 通过uuid找到店铺申请信息
+		Date date = new Date();
+		StoreApply storeApply = storeApplyService.findByUuid(uuid);
+		User user = SystemSession.getUser();
+		if (user == null || user.getEnterprise() == null) {
+			return new ResultMap(CodeType.NOT_PERMIT, "请进行用户登录操作");
+		}
 		// 验证参数合法性
 		if (StringUtils.isEmpty(uuid) || status == null) {
 			return new ResultMap(CodeType.NO_INFO, "店铺申请UUID或状态信息不存在");
@@ -53,18 +60,6 @@ public class StoreApplyFacadeImpl implements StoreApplyFacade {
 		if (apply == null) {
 			return new ResultMap(CodeType.NO_INFO, "店铺申请信息不能为空");
 		}
-
-		Date date = new Date();
-		StoreApply storeApply = storeApplyService.findByUuid(uuid);
-
-		User user = SystemSession.getUser();
-		if (user == null || user.getEnterprise() == null) {
-			return new ResultMap(CodeType.NOT_PERMIT, "请进行用户登录操作");
-		}
-		storeApply.setAuthPerson(user.getUserName());
-		storeApply.setAuthTime(date);
-		storeApply.setStatus(status);
-
 		// 检测资质信息
 		if (StoreApply.ApplyStatus.PASS == status) {
 			// TODO 检测企业信息以及品牌信息
@@ -101,23 +96,29 @@ public class StoreApplyFacadeImpl implements StoreApplyFacade {
 			}
 			storeApply.setReason(null);
 		}
-
 		if (StoreApply.ApplyStatus.UNPASS == status) {
 			if (StringUtils.isEmpty(apply.getReason())) {
 				return new ResultMap(CodeType.NO_INFO, "审核不通过后,不通过原因不能为空");
 			}
 			storeApply.setReason(apply.getReason());
 		}
-
+		// 保存审核时的审核人信息和是否通过状态
+		storeApply.setAuthPerson(user.getUserName());
+		storeApply.setAuthTime(date);
+		storeApply.setStatus(status);
 		// 保存审核时的企业信息
 		storeApply.setEnType(apply.getEnType());
 		storeApply.setEnQualification(apply.getEnQualification());
 		storeApply.setBrands(apply.getBrands());
-
-		storeApplyService.handlerApply(storeApply);
-		//自动确认开通店铺;
-		if (StoreApply.ApplyStatus.PASS == status) {
-			this.autoConfirmOpenStore(uuid, storeApply);
+		// 不通过保存申请信息,通过则进行自动确认开通店铺操作
+		if (StoreApply.ApplyStatus.UNPASS == status) {
+			storeApplyService.handlerApply(storeApply);
+		} else {
+			storeApply.setBannerUrl("http://dfs.ubtob.com/group1/M00/19/BF/CgpkyFlSBRmAcascAANK5vkByag940.jpg");
+			storeApply.setLogoUrl("https://dfs.ubtob.com/group1/M00/88/4D/CgpkyFrMEHeAbmFgAAAVUSwA8go871.png");
+			StoreApply savedApply = storeApplyService.handlerApply(storeApply);
+			StoreIn storeIn = storeService.createByStoreApplyAndSave(savedApply);
+			return ResultMap.success(storeIn.getUuid());
 		}
 		return ResultMap.success(null);
 	}
@@ -177,66 +178,6 @@ public class StoreApplyFacadeImpl implements StoreApplyFacade {
 		return ResultMap.success(storeIn.getUuid());
 	}
 
-
-
-	public ResultMap autoConfirmOpenStore(String uuid, StoreApply storeApply) {
-		Date date = new Date();
-		// 验证
-		if (StringUtils.isEmpty(uuid) || storeApply == null) {
-			return new ResultMap(CodeType.NO_INFO, "开铺申请和编号信息不能为空");
-		}
-		storeApply.setBannerUrl("http://dfs.ubtob.com/group1/M00/19/BF/CgpkyFlSBRmAcascAANK5vkByag940.jpg");
-		storeApply.setLogoUrl("https://dfs.ubtob.com/group1/M00/88/4D/CgpkyFrMEHeAbmFgAAAVUSwA8go871.png");
-		if ( StringUtils.isEmpty(storeApply.getLogoUrl())
-				|| StringUtils.isEmpty(storeApply.getBannerUrl())) {
-			return new ResultMap(CodeType.NOT_COMPLETE_INFO, "LOGO或横幅广告不能为空");
-		}
-		// 更新店铺申请信息
-		StoreApply apply = storeApplyService.findByUuid(uuid);
-		if (apply == null) {
-			return new ResultMap(CodeType.NOT_EXiST, "该店铺申请信息不存在");
-		}
-		if (StringUtils.hasText(storeApply.getStoreUuid())) {
-			apply.setStoreUuid(storeApply.getStoreUuid().toLowerCase());
-		}
-		apply.setLogoUrl(storeApply.getLogoUrl());
-		apply.setBannerUrl(storeApply.getBannerUrl());
-/*		if (storeApply.getEnterprise() != null) {
-			EnterpriseSimple enterprise = apply.getEnterprise();
-			enterprise.setEnUrl(storeApply.getEnterprise().getEnUrl());
-			enterprise.setAddress(storeApply.getEnterprise().getAddress());
-			enterprise.setEnTel(storeApply.getEnterprise().getEnTel());
-			enterprise.setEnFax(storeApply.getEnterprise().getEnFax());
-			// 更新企业信息JSON字符串
-			apply.setEnterprise(enterprise);
-		}
-
-		User user  = SystemSession.getUser();
-		if (user == null || user.getEnterprise() == null) {
-			return new ResultMap(CodeType.ERROR_STATE, "用户没有登录或账户信息异常");
-		}
-
-		// 添加资质信息
-		List<Qualification> qualifications = storeApply.getQualifications();
-		List<Qualification> existQualifications = apply.getQualifications();
-		for (Qualification qualification : qualifications) {
-			qualification.setEnUU(user.getEnterprise().getUu());
-			qualification.setUploaderUU(user.getUserUU());
-			qualification.setCreateTime(date);
-			qualification.setUpdateTime(date);
-			existQualifications.add(qualification);
-		}
-		// 更新资质信息JSON字符串
-		apply.setQualifications(existQualifications);*/
-		User user  = SystemSession.getUser();
-		if (user == null || user.getEnterprise() == null) {
-			return new ResultMap(CodeType.ERROR_STATE, "用户没有登录或账户信息异常");
-		}
-		storeApply = storeApplyService.handlerApply(apply);
-		StoreIn storeIn = storeService.createByStoreApplyAndSave(storeApply);
-		return ResultMap.success(storeIn.getUuid());
-	}
-
 	@Override
 	public ResultMap saveUpdateOfApply(String uuid, StoreApply apply) {
 		// 验证参数合法性

+ 1 - 1
src/main/java/com/uas/platform/b2c/prod/store/service/impl/StoreApplyServiceImpl.java

@@ -196,7 +196,7 @@ public class StoreApplyServiceImpl implements StoreApplyService {
 	}
 
 	@Override
-	@Transactional
+	@Transactional(rollbackFor = Exception.class)
 	public StoreApply handlerApply(StoreApply shopApply) {
 		if (shopApply == null || StringUtils.isEmpty(shopApply.getUuid()) || shopApply.getId() == null) {
 			return null;

+ 1 - 1
src/main/java/com/uas/platform/b2c/prod/store/service/impl/StoreInServiceImpl.java

@@ -121,7 +121,7 @@ public class StoreInServiceImpl implements StoreInService {
 	}
 
 	@Override
-	@Transactional
+	@Transactional(rollbackFor = Exception.class)
 	public StoreIn createByStoreApplyAndSave(StoreApply storeApply) {
 		if (storeApply == null || storeApply.getEnUU() == null) {
 			return null;