|
|
@@ -3,6 +3,8 @@ package com.uas.platform.b2c.prod.store.service.impl;
|
|
|
import com.uas.platform.b2c.advertise.ad.model.StoreAds;
|
|
|
import com.uas.platform.b2c.advertise.ad.model.StoreAdsType;
|
|
|
import com.uas.platform.b2c.advertise.ad.service.StoreAdsService;
|
|
|
+import com.uas.platform.b2c.common.account.dao.EnterpriseDao;
|
|
|
+import com.uas.platform.b2c.common.account.model.Enterprise;
|
|
|
import com.uas.platform.b2c.core.config.SysConf;
|
|
|
import com.uas.platform.b2c.core.support.SystemSession;
|
|
|
import com.uas.platform.b2c.core.utils.JacksonUtils;
|
|
|
@@ -11,15 +13,11 @@ import com.uas.platform.b2c.prod.commodity.dao.GoodsDao;
|
|
|
import com.uas.platform.b2c.prod.product.component.dao.ComponentDao;
|
|
|
import com.uas.platform.b2c.prod.product.component.modal.Component;
|
|
|
import com.uas.platform.b2c.prod.store.dao.QualificationDao;
|
|
|
+import com.uas.platform.b2c.prod.store.dao.StoreApplyDao;
|
|
|
import com.uas.platform.b2c.prod.store.dao.StoreBrandInfoDao;
|
|
|
import com.uas.platform.b2c.prod.store.dao.StoreInDao;
|
|
|
import com.uas.platform.b2c.prod.store.exception.EmptyParameterException;
|
|
|
-import com.uas.platform.b2c.prod.store.model.Qualification;
|
|
|
-import com.uas.platform.b2c.prod.store.model.StoreApply;
|
|
|
-import com.uas.platform.b2c.prod.store.model.StoreBrandInfo;
|
|
|
-import com.uas.platform.b2c.prod.store.model.StoreIn;
|
|
|
-import com.uas.platform.b2c.prod.store.model.StoreStatus;
|
|
|
-import com.uas.platform.b2c.prod.store.model.StoreType;
|
|
|
+import com.uas.platform.b2c.prod.store.model.*;
|
|
|
import com.uas.platform.b2c.prod.store.service.StoreInService;
|
|
|
import com.uas.platform.b2c.trade.order.dao.PurchaseDao;
|
|
|
import com.uas.platform.b2c.trade.support.ResultMap;
|
|
|
@@ -44,13 +42,7 @@ import javax.persistence.criteria.CriteriaBuilder;
|
|
|
import javax.persistence.criteria.CriteriaQuery;
|
|
|
import javax.persistence.criteria.Predicate;
|
|
|
import javax.persistence.criteria.Root;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Arrays;
|
|
|
-import java.util.Collections;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.HashSet;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Set;
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
|
* 店铺业务实现类
|
|
|
@@ -481,7 +473,54 @@ public class StoreInServiceImpl implements StoreInService {
|
|
|
return store;
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
+ // Deprecated: on
|
|
|
+ @Autowired
|
|
|
+ private StoreApplyDao applyDao;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private EnterpriseDao enterpriseDao;
|
|
|
+
|
|
|
+ @Deprecated
|
|
|
+ @Override
|
|
|
+ public void syncStoreEnterpriseInfo() {
|
|
|
+ // 同步店铺申请信息
|
|
|
+ List<StoreApply> applies = applyDao.findAll();
|
|
|
+ if (!CollectionUtils.isEmpty(applies)) {
|
|
|
+ for (StoreApply apply : applies) {
|
|
|
+ apply.setEnterprise(syncEnterpriseInfo(apply.getEnUU(), apply.getEnterprise()));
|
|
|
+ }
|
|
|
+ applyDao.save(applies);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ // 同步店铺信息
|
|
|
+ List<StoreIn> storeIns = storeDao.findAll();
|
|
|
+ if (!CollectionUtils.isEmpty(storeIns)) {
|
|
|
+ for (StoreIn store : storeIns) {
|
|
|
+ store.setEnterprise(syncEnterpriseInfo(store.getEnUU(), store.getEnterprise()));
|
|
|
+ }
|
|
|
+ storeDao.save(storeIns);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private EnterpriseSimple syncEnterpriseInfo(Long enUU, EnterpriseSimple tmp) {
|
|
|
+ Enterprise enterprise = enterpriseDao.findByUu(enUU);
|
|
|
+
|
|
|
+ if (tmp != null) {
|
|
|
+ if (enterprise != null && !StringUtils.isEmpty(enterprise.getEnEmail())) {
|
|
|
+ tmp.setEnEmail(enterprise.getEnEmail());
|
|
|
+ } else {
|
|
|
+ tmp.setEnEmail(" ");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ tmp = EnterpriseSimple.translateSimple(enterprise);
|
|
|
+ }
|
|
|
+
|
|
|
+ return tmp;
|
|
|
+ }
|
|
|
+ // Deprecated: off
|
|
|
+
|
|
|
+ @Override
|
|
|
public List<StoreIn> findFiveStores(String types, Integer num) {
|
|
|
String[] typeArray = types.split("-");
|
|
|
List<String> typeList = Arrays.asList(typeArray);
|