Browse Source

Merge remote-tracking branch 'origin/dev-mysql' into account_autoOpenStore

# Conflicts:
#	src/main/java/com/uas/platform/b2c/prod/store/facade/impl/StoreInFacadeImpl.java
zhaohongpeng 7 years ago
parent
commit
a13bf46f1f

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

@@ -61,7 +61,8 @@ public class StoreInFacadeImpl implements StoreInFacade {
 		if (store == null) {
 			return new ResultMap(CodeType.ERROR_STATE, String.format("编号%s对应的店铺不存在", uuid));
 		}
-
+//		store.setEnterpriseJson(newStoreInfo.getEnterpriseJson());
+//		store.setEnterprise(newStoreInfo.getEnterprise());
 		ResultMap resultMap = setStoreInfoByKind(store, newStoreInfo, kind);
 		if (resultMap != null) {
 			return resultMap;
@@ -77,17 +78,17 @@ public class StoreInFacadeImpl implements StoreInFacade {
 				iterator.hasNext();
 			}
 		}
-		if ("BASIC_INFO".equals(kind)) {
-			Enterprise enter = enterpriseDao.findByUu(store.getEnUU());
-			enter.setEnAddress(store.getEnterprise().getEnAddress());
-			enter.setEnTel(store.getEnterprise().getEnTel());
-			enter.setEnFax(store.getEnterprise().getEnFax());
-			enter.setEnPhone(store.getEnterprise().getEnPhone());
-			enter.setEnWeixin(store.getEnterprise().getEnWeixin());
-			enter.setEnQQ(store.getEnterprise().getEnQQ());
-			enterpriseDao.save(enter);
-		}
 		store.setQualifications(qualifications);
+        if ("BASIC_INFO".equals(kind)) {
+            Enterprise enter = enterpriseDao.findByUu(store.getEnUU());
+            enter.setEnAddress(store.getEnterprise().getEnAddress());
+            enter.setEnTel(store.getEnterprise().getEnTel());
+            enter.setEnFax(store.getEnterprise().getEnFax());
+            enter.setEnPhone(store.getEnterprise().getEnPhone());
+            enter.setEnWeixin(store.getEnterprise().getEnWeixin());
+            enter.setEnQQ(store.getEnterprise().getEnQQ());
+            enterpriseDao.save(enter);
+        }
         store = storeInDao.save(store);
 		Set<Qualification> qualificationsSort = storeInService.getQualificationsSort();
 		Set<Qualification> qualificationsPo= store.getQualifications();
@@ -112,13 +113,14 @@ public class StoreInFacadeImpl implements StoreInFacade {
 			store.setStoreName(StringUtils.hasText(newStoreInfo.getStoreName()) ? newStoreInfo.getStoreName() : null);
 			store.setDescription(newStoreInfo.getDescription());
 			EnterpriseSimple enterprise = store.getEnterprise();
-			enterprise.setEnUrl(newStoreInfo.getEnterprise().getEnUrl());
-			enterprise.setAddress(newStoreInfo.getEnterprise().getAddress());
-			enterprise.setEnTel(newStoreInfo.getEnterprise().getEnTel());
-			enterprise.setEnFax(newStoreInfo.getEnterprise().getEnFax());
-			enterprise.setEnQQ(newStoreInfo.getEnterprise().getEnQQ());
-			enterprise.setEnPhone(newStoreInfo.getEnterprise().getEnPhone());
-			enterprise.setEnWeixin(newStoreInfo.getEnterprise().getEnWeixin());
+            EnterpriseSimple newEnterprise = newStoreInfo.getEnterprise();
+			enterprise.setEnUrl(newEnterprise.getEnUrl());
+			enterprise.setAddress(newEnterprise.getAddress());
+			enterprise.setEnTel(newEnterprise.getEnTel());
+			enterprise.setEnFax(newEnterprise.getEnFax());
+            enterprise.setEnPhone(newEnterprise.getEnPhone());
+            enterprise.setEnWeixin(newEnterprise.getEnWeixin());
+            enterprise.setEnQQ(newEnterprise.getEnQQ());
 			store.setEnterprise(enterprise);
 			return null;
 		}