周玉环 2 өдөр өмнө
parent
commit
e1e2d7144c

+ 24 - 43
xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/controller/seller/admin/AdminOwnStoreController.java

@@ -21,6 +21,7 @@ import com.slodon.b2b2c.seller.pojo.*;
 import com.slodon.b2b2c.system.pojo.Admin;
 import com.slodon.b2b2c.vo.seller.OwnStoreDetailVO;
 import com.slodon.b2b2c.vo.seller.OwnStoreVO;
+import com.slodon.b2b2c.vo.seller.StoreVO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
@@ -34,6 +35,7 @@ import javax.servlet.http.HttpServletRequest;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
+import java.util.Set;
 import java.util.stream.Collectors;
 
 /**
@@ -67,66 +69,44 @@ public class AdminOwnStoreController extends BaseController {
     })
     @GetMapping("list")
     public JsonResult<PageVO<OwnStoreVO>> getList(HttpServletRequest request,
-                                                  @RequestParam(value = "webSite", required = false,defaultValue = "1") String webSite,
+                                                  @RequestParam(value = "webSite", required = false, defaultValue = "1") String webSite,
                                                   @RequestParam(value = "storeName", required = false) String storeName,
                                                   @RequestParam(value = "state", required = false) Integer state,
                                                   @RequestParam(value = "businessState", required = false) Integer businessState) {
         PagerInfo pager = WebUtil.handlerPagerInfo(request);
-
+        List<Store> storeList = new ArrayList<>();
+        List<OwnStoreVO> vos = new ArrayList<>();
         StoreExample storeExample = new StoreExample();
-        if (WebSiteConstant.MEMBER_OVERSEA.equals(webSite)) {
-            storeExample.setStoreNameLike(storeName);
-            storeExample.setBusinessState(businessState);
-        }
+        storeExample.setStoreNameLike(storeName);
+        storeExample.setBusinessState(businessState);
         storeExample.setState(state);
         storeExample.setStateNotEquals(StoreConst.STORE_STATE_DELETE);
         storeExample.setIsOwnStore(StoreConst.IS_OWN_STORE);
         storeExample.setPager(pager);
-        List<Store> storeList = storeModel.getStoreList(storeExample, pager);
-        List<StoreName> storeNameList = Collections.emptyList();
-        List<StoreSiteInfo> storeSiteInfoList = Collections.emptyList();
-        if (!WebSiteConstant.MEMBER_OVERSEA.equals(webSite)) {
-            StoreNameExample storeNameExample = new StoreNameExample();
-            storeNameExample.setStoreNameLike(storeName);
-            storeNameExample.setWebSite(webSite);
-            storeNameList = storeNameModel.getStoreNameList(new StoreNameExample(), null);
-            StoreSiteInfoExample storeSiteInfoExample = new StoreSiteInfoExample();
-            storeSiteInfoExample.setBusinessState(businessState);
-            storeSiteInfoExample.setStoreIdIn(storeNameList.stream().map(StoreName::getStoreId).collect(Collectors.toList()));
-            storeSiteInfoList = storeSiteInfoModel.getStoreSiteInfoList(storeSiteInfoExample, null);
-        }
-        List<OwnStoreVO> vos = new ArrayList<>();
-        if (!WebSiteConstant.MEMBER_OVERSEA.equals(webSite) && CollectionUtils.isEmpty(storeNameList) || CollectionUtils.isEmpty(storeSiteInfoList)) {
-            return SldResponse.success(new PageVO<>(vos, new PagerInfo(10, 1)));
+        if (WebSiteConstant.MEMBER_OVERSEA.equals(webSite)) {
+            storeList = storeModel.getStoreList(storeExample, pager);
+        } else {
+            if (pager != null) {
+                storeList = storeModel.getStoreCnList(storeExample, pager);
+            }
         }
         if (!CollectionUtils.isEmpty(storeList)) {
-            List<StoreName> finalStoreNameList = storeNameList;
             storeList.forEach(store -> {
                 OwnStoreVO vo = new OwnStoreVO(store);
-                if (!WebSiteConstant.MEMBER_OVERSEA.equals(webSite)) {
-                    vo.setStoreName(finalStoreNameList.stream()
-                            .filter(storeNameWebSite -> storeNameWebSite.getStoreId().equals(store.getStoreId()))
-                            .findFirst()
-                            .map(StoreName::getStoreName)
-                            .orElse(""));
-                   StoreSiteInfoExample storeSiteInfoExample = new StoreSiteInfoExample();
-                   storeSiteInfoExample.setStoreId(store.getStoreId());
-                   StoreSiteInfo storeSiteInfo = storeSiteInfoModel.getStoreSiteInfo(storeSiteInfoExample);
-                   vo.setBusinessState(storeSiteInfo != null ? storeSiteInfo.getBusinessState() : StoreConst.STORE_BUSINESS_STATE_DECORATION);
-                }
                 //根据店铺id获取商户账号
                 VendorExample vendorExample = new VendorExample();
                 vendorExample.setStoreId(store.getStoreId());
                 vendorExample.setIsStoreAdmin(VendorConst.IS_STORE_ADMIN_1);
                 List<Vendor> vendorList = vendorModel.getVendorList(vendorExample, null);
-                vo.setVendorName(vendorList.get(0).getVendorName());
-
-                //通过vendorId查询资质表获取联系人电话
-                StoreCertificateExample storeCertificateExample = new StoreCertificateExample();
-                storeCertificateExample.setVendorId(vendorList.get(0).getVendorId());
-                List<StoreCertificate> storeCertificateList = storeCertificateModel.getStoreCertificateList(storeCertificateExample, null);
-                if (!CollectionUtils.isEmpty(storeCertificateList)) {
-                    vo.setContactPhone(CommonUtil.dealMobile(storeCertificateList.get(0).getContactPhone()));
+                if (!CollectionUtils.isEmpty(vendorList)) {
+                    vo.setVendorName(vendorList.get(0).getVendorName());
+                    //通过vendorId查询资质表获取联系人电话
+                    StoreCertificateExample storeCertificateExample = new StoreCertificateExample();
+                    storeCertificateExample.setVendorId(vendorList.get(0).getVendorId());
+                    List<StoreCertificate> storeCertificateList = storeCertificateModel.getStoreCertificateList(storeCertificateExample, null);
+                    if (!CollectionUtils.isEmpty(storeCertificateList)) {
+                        vo.setContactPhone(CommonUtil.dealMobile(storeCertificateList.get(0).getContactPhone()));
+                    }
                 }
                 vos.add(vo);
             });
@@ -134,6 +114,7 @@ public class AdminOwnStoreController extends BaseController {
         return SldResponse.success(new PageVO<>(vos, storeExample.getPager()));
     }
 
+
     @ApiOperation("新增自营店铺")
     @OperationLogger(option = "新增自营店铺")
     @PostMapping("add")
@@ -175,7 +156,7 @@ public class AdminOwnStoreController extends BaseController {
             storeSiteInfoExample.setStoreId(storeId);
             storeSiteInfoExample.setWebSite(webSite);
             StoreSiteInfo storeSiteInfo = storeSiteInfoModel.getStoreSiteInfo(storeSiteInfoExample);
-            vo.setBusinessState(storeSiteInfo != null ? storeSiteInfo.getBusinessState() : 2);
+            vo.setBusinessState(storeSiteInfo != null ? storeSiteInfo.getBusinessState() : StoreConst.STORE_BUSINESS_STATE_DECORATION);
         }
 
         return SldResponse.success(vo);

+ 13 - 33
xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/controller/seller/admin/AdminStoreAuditController.java

@@ -86,11 +86,12 @@ public class AdminStoreAuditController {
                                                     @RequestParam(value = "state", required = false) Integer state) {
         PagerInfo pager = WebUtil.handlerPagerInfo(request);
 
+        List<StoreApplyVO> vos = new ArrayList<>();
+        List<StoreApply> storeApplyList = new ArrayList<>();
+
         StoreApplyExample example = new StoreApplyExample();
-        if (WebSiteConstant.MEMBER_OVERSEA.equals(webSite)) {
-            example.setStoreNameLike(storeName);
-            example.setStoreGradeId(storeGradeId);
-        }
+        example.setStoreNameLike(storeName);
+        example.setStoreGradeId(storeGradeId);
         example.setVendorNameLike(vendorName);
         example.setStoreType(StoreConst.NO_OWN_STORE);
         example.setPager(pager);
@@ -100,25 +101,16 @@ public class AdminStoreAuditController {
         } else {
             example.setStateNotEquals(StoreConst.STATE_4_STORE_OPEN);
         }
-        List<StoreApply> storeApplyList = storeApplyModel.getStoreApplyList(example, pager);
-        List<StoreName> storeNameList = Collections.emptyList();
-        List<StoreSiteInfo> storeSiteInfoList = Collections.emptyList();
-        if (!WebSiteConstant.MEMBER_OVERSEA.equals(webSite)) {
-            StoreNameExample storeNameExample = new StoreNameExample();
-            storeNameExample.setStoreNameLike(storeName);
-            storeNameExample.setWebSite(webSite);
-            storeNameList = storeNameModel.getStoreNameList(new StoreNameExample(), null);
-            StoreSiteInfoExample storeSiteInfoExample = new StoreSiteInfoExample();
-            storeSiteInfoExample.setStoreGradeId(storeGradeId);
-            storeSiteInfoExample.setStoreIdIn(storeNameList.stream().map(StoreName::getStoreId).collect(Collectors.toList()));
-            storeSiteInfoList = storeSiteInfoModel.getStoreSiteInfoList(storeSiteInfoExample, null);
-        }
-        List<StoreApplyVO> vos = new ArrayList<>();
-        if (!WebSiteConstant.MEMBER_OVERSEA.equals(webSite) && CollectionUtils.isEmpty(storeNameList) || CollectionUtils.isEmpty(storeSiteInfoList)) {
-            return SldResponse.success(new PageVO<>(vos, new PagerInfo(10, 1)));
+        if (WebSiteConstant.MEMBER_OVERSEA.equals(webSite)) {
+            storeApplyList = storeApplyModel.getStoreApplyList(example, pager);
+        } else {
+            if (pager!= null){
+                storeApplyList = storeApplyModel.getStoreApplyCnList(example, pager);
+            }
+
         }
         if (!CollectionUtils.isEmpty(storeApplyList)) {
-            List<StoreName> finalStoreNameList = storeNameList;
+
             storeApplyList.forEach(storeApply -> {
                 StoreApplyVO vo = new StoreApplyVO(storeApply);
                 //根据等级id获取等级名称
@@ -126,18 +118,6 @@ public class AdminStoreAuditController {
                 if (storeGrade != null) {
                     vo.setStoreGradeName(storeGrade.getGradeName());
                 }
-                if (!WebSiteConstant.MEMBER_OVERSEA.equals(webSite)) {
-                    vo.setStoreName(finalStoreNameList.stream()
-                            .filter(storeNameWebSite -> storeNameWebSite.getStoreId().equals(storeApply.getStoreId()))
-                            .findFirst()
-                            .map(StoreName::getStoreName)
-                            .orElse(""));
-                    StoreSiteInfoExample storeSiteInfoExample = new StoreSiteInfoExample();
-                    storeSiteInfoExample.setStoreId(storeApply.getStoreId());
-                    storeSiteInfoExample.setWebSite(webSite);
-                    StoreSiteInfo storeSiteInfo = storeSiteInfoModel.getStoreSiteInfo(storeSiteInfoExample);
-                    vo.setStoreGradeName(storeSiteInfo != null ? storeSiteInfo.getStoreGradeName() : vo.getStoreGradeName());
-                }
 
                 //获取联系人名称和电话
                 StoreCertificateExample storeCertificateExample = new StoreCertificateExample();

+ 28 - 43
xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/controller/seller/admin/AdminStoreController.java

@@ -26,6 +26,7 @@ import com.slodon.b2b2c.seller.pojo.*;
 import com.slodon.b2b2c.system.pojo.Admin;
 import com.slodon.b2b2c.system.pojo.Setting;
 import com.slodon.b2b2c.seller.dto.StoreBusinessVO;
+import com.slodon.b2b2c.vo.seller.OwnStoreVO;
 import com.slodon.b2b2c.vo.seller.StoreDetailVO;
 import com.slodon.b2b2c.vo.seller.StoreGoodsCateVO;
 import com.slodon.b2b2c.vo.seller.StoreVO;
@@ -92,54 +93,29 @@ public class AdminStoreController extends BaseController {
                                                @RequestParam(value = "businessState", required = false) Integer businessState) {
 
         PagerInfo pager = WebUtil.handlerPagerInfo(request);
-
+        List<Store> storeList = new ArrayList<>();
+        List<StoreVO> vos = new ArrayList<>();
         StoreExample storeExample = new StoreExample();
-        if (WebSiteConstant.MEMBER_OVERSEA.equals(webSite)) {
-            storeExample.setStoreNameLike(storeName);
-            storeExample.setBusinessState(businessState);
-            storeExample.setStoreGradeId(storeGradeId);
-        }
+
+        storeExample.setStoreNameLike(storeName);
+        storeExample.setBusinessState(businessState);
+        storeExample.setStoreGradeId(storeGradeId);
+
         storeExample.setVendorNameLike(vendorName);
         storeExample.setState(state);
         storeExample.setStateNotEquals(StoreConst.STORE_STATE_DELETE);
         storeExample.setIsOwnStore(StoreConst.NO_OWN_STORE);
         storeExample.setPager(pager);
-        List<Store> storeList = storeModel.getStoreList(storeExample, pager);
-        List<StoreName> storeNameList = Collections.emptyList();
-        List<StoreSiteInfo> storeSiteInfoList = Collections.emptyList();
-        if (!WebSiteConstant.MEMBER_OVERSEA.equals(webSite)) {
-            StoreNameExample storeNameExample = new StoreNameExample();
-            storeNameExample.setStoreNameLike(storeName);
-            storeNameExample.setWebSite(webSite);
-            storeNameList = storeNameModel.getStoreNameList(new StoreNameExample(), null);
-            StoreSiteInfoExample storeSiteInfoExample = new StoreSiteInfoExample();
-            storeSiteInfoExample.setBusinessState(businessState);
-            storeSiteInfoExample.setStoreGradeId(storeGradeId);
-            storeSiteInfoExample.setStoreIdIn(storeNameList.stream().map(StoreName::getStoreId).collect(Collectors.toList()));
-            storeSiteInfoList = storeSiteInfoModel.getStoreSiteInfoList(storeSiteInfoExample, null);
-        }
-        List<StoreVO> vos = new ArrayList<>();
-        if (CollectionUtils.isEmpty(storeNameList) && !WebSiteConstant.MEMBER_OVERSEA.equals(webSite) && CollectionUtils.isEmpty(storeSiteInfoList)) {
-            return SldResponse.success(new PageVO<>(vos, new PagerInfo(10, 1)));
+        if (WebSiteConstant.MEMBER_OVERSEA.equals(webSite)) {
+            storeList = storeModel.getStoreList(storeExample, pager);
+        } else {
+            if (pager != null) {
+                storeList = storeModel.getStoreCnList(storeExample, pager);
+            }
         }
         if (!CollectionUtils.isEmpty(storeList)) {
-            List<StoreName> finalStoreNameList = storeNameList;
             storeList.forEach(store -> {
                 StoreVO vo = new StoreVO(store);
-                if (!WebSiteConstant.MEMBER_OVERSEA.equals(webSite)) {
-                    vo.setStoreName(finalStoreNameList.stream()
-                            .filter(storeNameWebSite -> storeNameWebSite.getStoreId().equals(store.getStoreId()))
-                            .findFirst()
-                            .map(StoreName::getStoreName)
-                            .orElse(""));
-                    StoreSiteInfoExample storeSiteInfoExample = new StoreSiteInfoExample();
-                    storeSiteInfoExample.setStoreId(store.getStoreId());
-                    StoreSiteInfo storeSiteInfo = storeSiteInfoModel.getStoreSiteInfo(storeSiteInfoExample);
-                    vo.setStoreGradeName(storeSiteInfo != null ? storeSiteInfo.getStoreGradeName() : store.getStoreGradeName());
-                    vo.setBusinessState(storeSiteInfo != null ? storeSiteInfo.getBusinessState() : StoreConst.STORE_BUSINESS_STATE_DECORATION);
-                    vo.setCreateTime(storeSiteInfo != null ? storeSiteInfo.getCreateTime() : store.getCreateTime());
-                    vo.setStoreExpireTime(storeSiteInfo != null ? storeSiteInfo.getStoreExpireTime() : store.getStoreExpireTime());
-                }
                 //根据店铺id获取商户账号
                 VendorExample vendorExample = new VendorExample();
                 vendorExample.setStoreId(store.getStoreId());
@@ -432,6 +408,8 @@ public class AdminStoreController extends BaseController {
         return SldResponse.success(Arrays.asList(1, 2, 3));
     }
 
+
+
     /**
      * 获取自营和已入驻的店铺列表 装修使用
      *
@@ -439,15 +417,22 @@ public class AdminStoreController extends BaseController {
      * @return
      */
     @GetMapping("getStoreListByDecorate")
-    public JsonResult<PageVO<StoreVO>> getStoreListByDecorate(HttpServletRequest request,String storeName) {
+    public JsonResult<PageVO<StoreVO>> getStoreListByDecorate(HttpServletRequest request, String storeName, String webSite) {
         PagerInfo pager = WebUtil.handlerPagerInfo(request);
 
+        List<StoreVO> vos = new ArrayList<>();
         StoreExample storeExample = new StoreExample();
-        storeExample.setStoreNameLike(storeName);
         storeExample.setState(StoreConst.STORE_STATE_OPEN);
+        storeExample.setStoreNameLike(storeName);
         storeExample.setPager(pager);
-        List<Store> storeList = storeModel.getStoreList(storeExample, pager);
-        List<StoreVO> vos = new ArrayList<>();
+        List<Store> storeList = new ArrayList<>();
+        if (WebSiteConstant.MEMBER_OVERSEA.equals(webSite)) {
+            storeList = storeModel.getStoreList(storeExample, pager);
+        } else {
+            if (pager != null) {
+                storeList = storeModel.getStoreCnList(storeExample, pager);
+            }
+        }
         if (!CollectionUtils.isEmpty(storeList)) {
             storeList.forEach(store -> {
                 StoreVO vo = new StoreVO(store);
@@ -455,7 +440,7 @@ public class AdminStoreController extends BaseController {
                 if (StringUtils.isEmpty(store.getStoreLogo())) {
                     vo.setStoreLogo(stringRedisTemplate.opsForValue().get("default_image_store_logo"));
                 }
-                vo.setStoreLogo(DomainUrlUtil.SLD_IMAGE_RESOURCES+vo.getStoreLogo());
+                vo.setStoreLogo(DomainUrlUtil.SLD_IMAGE_RESOURCES + vo.getStoreLogo());
                 vos.add(vo);
             });
         }

+ 71 - 69
xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/controller/seller/front/FrontStoreController.java

@@ -113,7 +113,7 @@ public class FrontStoreController {
     public JsonResult<PageVO<FrontStoreListVO>> getList(HttpServletRequest request, Integer categoryId,
                                                         @RequestParam(value = "keyword", required = false) String keyword,
                                                         @RequestParam(value = "sort", required = false, defaultValue = "2") Integer sort) {
-
+        String webSite = WebUtil.getWebSite(request);
         Member member = UserUtil.getUser(request, Member.class);
         PagerInfo pager = WebUtil.handlerPagerInfo(request);
         List<FrontStoreListVO> vos = new ArrayList<>();
@@ -128,47 +128,26 @@ public class FrontStoreController {
 //        storeIdSet.forEach(storeId -> {
 //            storeIds.append(",").append(storeId);
 //        });
-        StoreExample storeExample = new StoreExample();
-        storeExample.setState(StoreConst.STORE_STATE_OPEN);
-//        storeExample.setStoreIdIn(storeIds.substring(1));
-        String webSite = WebUtil.getWebSite(request);
         if (WebSiteConstant.MEMBER_OVERSEA.equals(webSite)) {
+            StoreExample storeExample = new StoreExample();
+            storeExample.setState(StoreConst.STORE_STATE_OPEN);
+//        storeExample.setStoreIdIn(storeIds.substring(1));
+
+
             storeExample.setStoreNameLike(keyword);
             storeExample.setBusinessState(StoreConst.STORE_BUSINESS_STATE_OPEN);
-        }
-        if (sort == 2) {
-            storeExample.setOrderBy("store_look_volume DESC");
-        } else {
-            storeExample.setOrderBy("store_sales_volume DESC");
-        }
 
-        List<Store> storeList = storeModel.getStoreList(storeExample, pager);
-        List<StoreName> storeNameList = new ArrayList<>();
-        List<StoreSiteInfo> storeSiteInfoList = new ArrayList<>();
-        if (WebSiteConstant.MEMBER_DISTRIBUTOR.equals(webSite)) {
-            StoreNameExample storeNameExample = new StoreNameExample();
-            storeNameExample.setStoreNameLike(keyword);
-            storeNameExample.setWebSite(webSite);
-            storeNameList = storeNameModel.getStoreNameList(storeNameExample, null);
-            if (CollectionUtils.isEmpty(storeNameList)) {
-                //没有满足条件的店铺
-                return SldResponse.success(new PageVO<>(vos, pager));
+            if (sort == 2) {
+                storeExample.setOrderBy("store_look_volume DESC");
+            } else {
+                storeExample.setOrderBy("store_sales_volume DESC");
             }
-            StoreSiteInfoExample storeSiteInfoExample = new StoreSiteInfoExample();
-            storeSiteInfoExample.setStoreIdIn(storeNameList.stream().map(StoreName::getStoreId).collect(Collectors.toList()));
-            storeSiteInfoExample.setWebSite(webSite);
-            storeSiteInfoExample.setBusinessState(StoreConst.STORE_BUSINESS_STATE_OPEN);
-            storeSiteInfoList = storeSiteInfoModel.getStoreSiteInfoList(storeSiteInfoExample, null);
-            if (CollectionUtils.isEmpty(storeSiteInfoList)) {
+
+            List<Store> storeList = storeModel.getStoreList(storeExample, pager);
+            if (CollectionUtils.isEmpty(storeList)) {
                 //没有满足条件的店铺
                 return SldResponse.success(new PageVO<>(vos, pager));
             }
-        }
-
-        if (CollectionUtils.isEmpty(storeList)) {
-            //没有满足条件的店铺
-            return SldResponse.success(new PageVO<>(vos, pager));
-        }
 
 //        StringBuilder storeIdIn = new StringBuilder();
 //        storeList.forEach(store -> {
@@ -216,20 +195,20 @@ public class FrontStoreController {
 //            });
 //        }
 
-        for (Store store : storeList) {
-            //默认店铺logo
-            if (StringUtils.isEmpty(store.getStoreLogo())) {
-                store.setStoreLogo(stringRedisTemplate.opsForValue().get("default_image_store_logo"));
-            }
-            //默认店铺背景图片(取移动端横幅)
-            if (StringUtils.isEmpty(store.getStoreBannerMobile())) {
-                store.setStoreBannerMobile(stringRedisTemplate.opsForValue().get("default_image_store_backdrop"));
-            }
-            FrontStoreListVO vo = new FrontStoreListVO(store);
-            //会员是否收藏
+            for (Store store : storeList) {
+                //默认店铺logo
+                if (StringUtils.isEmpty(store.getStoreLogo())) {
+                    store.setStoreLogo(stringRedisTemplate.opsForValue().get("default_image_store_logo"));
+                }
+                //默认店铺背景图片(取移动端横幅)
+                if (StringUtils.isEmpty(store.getStoreBannerMobile())) {
+                    store.setStoreBannerMobile(stringRedisTemplate.opsForValue().get("default_image_store_backdrop"));
+                }
+                FrontStoreListVO vo = new FrontStoreListVO(store);
+                //会员是否收藏
 //            vo.setIsFollow(memberFollowStoreSet.contains(store.getStoreId()) ? "true" : "false");
 
-            //查询店铺内的热销商品
+                //查询店铺内的热销商品
 //            List<StoreGoodsVO> storeGoodsSaleList = storeGoodsSaleMap.getOrDefault(store.getStoreId(), new ArrayList<>());
 //            //按销量倒序
 //            storeGoodsSaleList.sort((o1, o2) -> Integer.compare(o2.getActualSales(), o1.getActualSales()));
@@ -238,35 +217,58 @@ public class FrontStoreController {
 //            //店铺热销商品列表
 //            vo.setGoodsListVOList(storeGoodsSaleList);
 
-            //查询店铺内本月上新商品
+                //查询店铺内本月上新商品
 //            List<StoreGoodsVO> storeGoodsOnlineList = storeGoodsOnlineMap.getOrDefault(store.getStoreId(), new ArrayList<>());
-            //按创建时间倒序
+                //按创建时间倒序
 //            storeGoodsOnlineList.sort((o1, o2) -> o1.getOnlineTime().equals(o2.getOnlineTime()) ? 0 : (o1.getOnlineTime().before(o2.getOnlineTime()) ? 1 : -1));
-            //本月上新商品个数
+                //本月上新商品个数
 //            vo.setNewGoodsNumber(storeGoodsOnlineList.size());
-            //本月上新商品列表
+                //本月上新商品列表
 //            vo.setNewGoodsListVOS(storeGoodsOnlineList);
-            vos.add(vo);
-        }
-        for (StoreSiteInfo storeSiteInfo : storeSiteInfoList) {
-            Store store = storeModel.getStoreByStoreId(storeSiteInfo.getStoreId());
-            if (store != null) {
-                store.setStoreName(storeNameList.stream()
-                        .filter(storeNameWebSite -> storeNameWebSite.getStoreId().equals(storeSiteInfo.getStoreId()))
-                        .findFirst()
-                        .map(StoreName::getStoreName)
-                        .orElse(""));
-                store.setStoreLogo(storeSiteInfo.getStoreLogo());
-                //默认店铺logo
-                if (StringUtils.isEmpty(store.getStoreLogo())) {
-                    store.setStoreLogo(stringRedisTemplate.opsForValue().get("default_image_store_logo"));
+                vos.add(vo);
+            }
+        }else {
+            List<StoreName> storeNameList = new ArrayList<>();
+            List<StoreSiteInfo> storeSiteInfoList = new ArrayList<>();
+            if (WebSiteConstant.MEMBER_DISTRIBUTOR.equals(webSite)) {
+                StoreNameExample storeNameExample = new StoreNameExample();
+                storeNameExample.setStoreNameLike(keyword);
+                storeNameExample.setWebSite(webSite);
+                storeNameList = storeNameModel.getStoreNameList(storeNameExample, pager);
+                if (CollectionUtils.isEmpty(storeNameList)) {
+                    //没有满足条件的店铺
+                    return SldResponse.success(new PageVO<>(vos, pager));
                 }
-                //默认店铺背景图片(取移动端横幅)
-                if (StringUtils.isEmpty(store.getStoreBannerMobile())) {
-                    store.setStoreBannerMobile(stringRedisTemplate.opsForValue().get("default_image_store_backdrop"));
+                StoreSiteInfoExample storeSiteInfoExample = new StoreSiteInfoExample();
+                storeSiteInfoExample.setStoreIdIn(storeNameList.stream().map(StoreName::getStoreId).collect(Collectors.toList()));
+                storeSiteInfoExample.setWebSite(webSite);
+                storeSiteInfoExample.setBusinessState(StoreConst.STORE_BUSINESS_STATE_OPEN);
+                storeSiteInfoList = storeSiteInfoModel.getStoreSiteInfoList(storeSiteInfoExample, null);
+                if (CollectionUtils.isEmpty(storeSiteInfoList)) {
+                    //没有满足条件的店铺
+                    return SldResponse.success(new PageVO<>(vos, pager));
+                }
+            }
+            for (StoreSiteInfo storeSiteInfo : storeSiteInfoList) {
+                Store store = storeModel.getStoreByStoreId(storeSiteInfo.getStoreId());
+                if (store != null) {
+                    store.setStoreName(storeNameList.stream()
+                            .filter(storeNameWebSite -> storeNameWebSite.getStoreId().equals(storeSiteInfo.getStoreId()))
+                            .findFirst()
+                            .map(StoreName::getStoreName)
+                            .orElse(""));
+                    store.setStoreLogo(storeSiteInfo.getStoreLogo());
+                    //默认店铺logo
+                    if (StringUtils.isEmpty(store.getStoreLogo())) {
+                        store.setStoreLogo(stringRedisTemplate.opsForValue().get("default_image_store_logo"));
+                    }
+                    //默认店铺背景图片(取移动端横幅)
+                    if (StringUtils.isEmpty(store.getStoreBannerMobile())) {
+                        store.setStoreBannerMobile(stringRedisTemplate.opsForValue().get("default_image_store_backdrop"));
+                    }
+                    FrontStoreListVO vo = new FrontStoreListVO(store);
+                    vos.add(vo);
                 }
-                FrontStoreListVO vo = new FrontStoreListVO(store);
-                vos.add(vo);
             }
         }
 

+ 3 - 3
xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/controller/seller/seller/SellerStoreController.java

@@ -213,7 +213,7 @@ public class SellerStoreController extends BaseController {
         Store store;
         if (WebSiteConstant.MEMBER_OVERSEA.equals(webSite)) {
             store = storeModel.getStoreByStoreId(vendor.getStoreId());
-            SysSeo seoInfo = storeModel.getRecordByTargetIdAndType(vendor.getStoreId(), SeoTypeConstant.SEO_TYPE_SHOP);
+            SysSeo seoInfo = storeModel.getRecordByTargetIdAndType(vendor.getStoreId(), SeoTypeConstant.SEO_TYPE_SHOP, webSite);
             if (seoInfo != null) {
                 store.setStoreSeoTitle(seoInfo.getTitle());
                 store.setStoreSeoDesc(seoInfo.getRemark());
@@ -221,7 +221,7 @@ public class SellerStoreController extends BaseController {
             }
         } else {
             store = storeSiteInfoModel.getStoreByStoreIdAndWebSite(vendor.getStoreId(), webSite);
-            SysSeo seoInfo = storeModel.getRecordByTargetIdAndType(vendor.getStoreId(), SeoTypeConstant.SEO_TYPE_SHOP + "_" + webSite);
+            SysSeo seoInfo = storeModel.getRecordByTargetIdAndType(vendor.getStoreId(), SeoTypeConstant.SEO_TYPE_SHOP, webSite);
             if (seoInfo != null) {
                 store.setStoreSeoTitle(seoInfo.getTitle());
                 store.setStoreSeoDesc(seoInfo.getRemark());
@@ -417,7 +417,7 @@ public class SellerStoreController extends BaseController {
         String time = simpleDateFormat.format(date);
 
         //判断此条seoId对应的记录是否为空
-        SysSeo seoInfo = storeModel.getRecordByTargetIdAndType(sysSeo.getTargetId(),sysSeo.getType());
+        SysSeo seoInfo = storeModel.getRecordByTargetIdAndType(sysSeo.getTargetId(), sysSeo.getType(), webSite);
         if(seoInfo !=null){
             sysSeo.setUpdateUid(vendor.getVendorId());
             sysSeo.setUpdateTime(time);

+ 4 - 0
xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/dao/read/seller/StoreApplyReadMapper.java

@@ -15,4 +15,8 @@ public interface StoreApplyReadMapper extends BaseReadMapper<StoreApply, StoreAp
      * @return
      */
     List<String> getVendorMobileByStoreApply(@Param("ids") List<String> ids);
+
+    int countCnByExample(@Param("example") StoreApplyExample example);
+
+    List<StoreApply> listCnPageByExample(@Param("example") StoreApplyExample example, @Param("startRow") int startRow, @Param("size") int size);
 }

+ 4 - 0
xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/dao/read/seller/StoreReadMapper.java

@@ -11,4 +11,8 @@ import java.util.List;
 public interface StoreReadMapper extends BaseReadMapper<Store, StoreExample> {
 
     List<StoreStatisticsDTO> getStoreStatisticList(@Param("example") StoreExample example);
+
+    int countCnByExample(@Param("example") StoreExample example);
+
+    List<Store> listCnPageByExample(@Param("example") StoreExample example, @Param("startRow") int startRow, @Param("size") int size);
 }

+ 4 - 0
xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/model/seller/StoreApplyModel.java

@@ -714,4 +714,8 @@ public class StoreApplyModel {
         return storeApplyReadMapper.getVendorMobileByStoreApply(ids);
     }
 
+    public List<StoreApply> getStoreApplyCnList(StoreApplyExample example, PagerInfo pager) {
+        pager.setRowsCount(storeApplyReadMapper.countCnByExample(example));
+        return storeApplyReadMapper.listCnPageByExample(example, pager.getStart(), pager.getPageSize());
+    }
 }

+ 26 - 22
xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/model/seller/StoreModel.java

@@ -315,29 +315,28 @@ public class StoreModel {
             throw new MallException("添加店铺表失败,请重试");
         }
 
-        //插入storeName表和 StoreSiteInfo表
-        if (WebSiteConstant.MEMBER_DISTRIBUTOR.equals(ownStoreAddDTO.getWebSite())) {
-            StoreName storeNameInsert = new StoreName();
-            storeNameInsert.setStoreId(storeId);
-            storeNameInsert.setStoreName(ownStoreAddDTO.getStoreName());
-            storeNameInsert.setWebSite(ownStoreAddDTO.getWebSite());
-            storeNameInsert.setCreateId(0L);
-            storeNameInsert.setCreateTime(new Date());
-            count = storeNameWriteMapper.insert(storeNameInsert);
-            if (count == 0) {
-                throw new MallException("添加店铺名称表失败,请重试");
-            }
-            StoreSiteInfo storeSiteInfo = new StoreSiteInfo();
-            storeSiteInfo.setStoreId(storeId);
-            storeSiteInfo.setWebSite(ownStoreAddDTO.getWebSite());
-            storeSiteInfo.setBusinessState(StoreConst.STORE_BUSINESS_STATE_DECORATION);
-            storeSiteInfo.setCreateId(0L);
-            storeSiteInfo.setCreateTime(new Date());
-            count = storeSiteInfoWriteMapper.insert(storeSiteInfo);
-            if (count == 0) {
-                throw new MallException("添加店铺站点信息表失败,请重试");
-            }
+        //插入storeName表和 StoreSiteInfo表(不管新增国内国外站都默认创建两个站点信息)
+        StoreName storeNameInsert = new StoreName();
+        storeNameInsert.setStoreId(storeId);
+        storeNameInsert.setStoreName(ownStoreAddDTO.getStoreName());
+        storeNameInsert.setWebSite(WebSiteConstant.MEMBER_DISTRIBUTOR);
+        storeNameInsert.setCreateId(0L);
+        storeNameInsert.setCreateTime(new Date());
+        count = storeNameWriteMapper.insert(storeNameInsert);
+        if (count == 0) {
+            throw new MallException("添加店铺名称表失败,请重试");
         }
+        StoreSiteInfo storeSiteInfo = new StoreSiteInfo();
+        storeSiteInfo.setStoreId(storeId);
+        storeSiteInfo.setWebSite(WebSiteConstant.MEMBER_DISTRIBUTOR);
+        storeSiteInfo.setBusinessState(StoreConst.STORE_BUSINESS_STATE_DECORATION);
+        storeSiteInfo.setCreateId(0L);
+        storeSiteInfo.setCreateTime(new Date());
+        count = storeSiteInfoWriteMapper.insert(storeSiteInfo);
+        if (count == 0) {
+            throw new MallException("添加店铺站点信息表失败,请重试");
+        }
+
         //插入vendor表,关联storeId
         Vendor vendor = new Vendor();
 
@@ -1191,4 +1190,9 @@ public class StoreModel {
     public Integer getStoreCount(StoreExample example) {
         return storeReadMapper.countByExample(example);
     }
+
+    public List<Store> getStoreCnList(StoreExample example, PagerInfo pager) {
+        pager.setRowsCount(storeReadMapper.countCnByExample(example));
+        return storeReadMapper.listCnPageByExample(example, pager.getStart(), pager.getPageSize());
+    }
 }

+ 64 - 0
xinkeaboard-server/b2b2c-web/src/main/resources/mapper/read/seller/StoreApplyReadMapper.xml

@@ -240,4 +240,68 @@
       </foreach>
     </if>
   </select>
+    <select id="countCnByExample" resultType="java.lang.Integer">
+      select COUNT(store_apply.apply_id)
+      from store_apply
+      left join store_name on store_apply.store_id = store_name.store_id
+      left join store_site_info on store_name.store_id = store_site_info.store_id
+      <where>
+        <if test="example.storeType != null">
+          and store_apply.store_type = #{example.storeType}
+        </if>
+        <if test="example.vendorNameLike != null">
+          and store_apply.vendor_name like concat('%', #{example.vendorNameLike},'%')
+        </if>
+        <if test="example.state != null">
+          AND store_apply.state = #{example.state}
+        </if>
+        <if test="example.stateNotEquals != null">
+          AND store_apply.state != #{example.stateNotEquals}
+        </if>
+        <if test="example.storeNameLike != null">
+          and store_name.store_name like concat('%',#{example.storeNameLike},'%')
+        </if>
+        <if test="example.storeGradeId != null">
+          and store.site_info.store_grade_id = #{example.storeGradeId}
+        </if>
+      </where>
+    </select>
+  <select id="listCnPageByExample" resultType="com.slodon.b2b2c.seller.pojo.StoreApply">
+    select
+    store_apply.apply_id as applyId,
+    store_apply.vendor_name as vendorName,
+    store_apply.state as state,
+    store_apply.refuse_reason as refuseReason,
+    store_apply.audit_info as auditInfo,
+    store_apply.submit_time as submitTime,
+    store_apply.apply_time as applyTime,
+    store_name.store_name as storeName,
+    store_site_info.store_grade_id as storeGradeId,
+    store_apply.vendor_id as vendorId
+    from store_apply
+    left join store_name on store_apply.store_id = store_name.store_id
+    left join store_site_info on store_name.store_id = store_site_info.store_id
+    <where>
+      <if test="example.storeType != null">
+        and store_apply.store_type = #{example.storeType}
+      </if>
+      <if test="example.vendorNameLike != null">
+        and store_apply.vendor_name like concat('%', #{example.vendorNameLike},'%')
+      </if>
+      <if test="example.state != null">
+        AND store_apply.state = #{example.state}
+      </if>
+      <if test="example.stateNotEquals != null">
+        AND store_apply.state != #{example.stateNotEquals}
+      </if>
+      <if test="example.storeNameLike != null">
+        and store_name.store_name like concat('%',#{example.storeNameLike},'%')
+      </if>
+      <if test="example.storeGradeId != null">
+        and store.site_info.store_grade_id = #{example.storeGradeId}
+      </if>
+    </where>
+    order by store_apply.submit_time desc
+    <include refid="limit"></include>
+  </select>
 </mapper>

+ 4 - 1
xinkeaboard-server/b2b2c-web/src/main/resources/mapper/read/seller/StoreBindCategoryReadMapper.xml

@@ -88,9 +88,12 @@
         <if test="example.goodsCategoryId3 != null">
           AND `goods_category_id3` = #{example.goodsCategoryId3}
         </if>
-        <if test="example.storeNameLike != null">
+        <if test="example.storeNameLike != null and example.webSite=='1'">
           AND `store_id` in (select `store_id` from `store` where `store_name` like concat('%',#{example.storeNameLike},'%'))
         </if>
+        <if test="example.storeNameLike != null and example.webSite=='2'">
+          AND `store_id` in (select `store_id` from `store_name` where `store_name` like concat('%',#{example.storeNameLike},'%') and `web_site` = #{example.webSite})
+        </if>
       </trim>
     </if>
   </sql>

+ 68 - 0
xinkeaboard-server/b2b2c-web/src/main/resources/mapper/read/seller/StoreReadMapper.xml

@@ -339,4 +339,72 @@
       </otherwise>
     </choose>
   </select>
+
+  <select id="countCnByExample" resultType="java.lang.Integer">
+    select COUNT(store_name.store_name)
+    from store
+    left join store_name on store.store_id = store_name.store_id
+    left join store_site_info on store_name.store_id = store_site_info.store_id
+    <where>
+      <if test="example.state != null">
+        and store.state = #{example.state}
+      </if>
+      <if test="example.stateNotEquals != null">
+        and store.state != #{example.stateNotEquals}
+      </if>
+      <if test="example.isOwnStore != null">
+        and store.is_own_store = #{example.isOwnStore}
+      </if>
+      <if test="example.storeNameLike != null">
+        and store_name.store_name like concat('%',#{example.storeNameLike},'%')
+      </if>
+      <if test="example.businessState != null">
+        and store_site_info.business_state = #{example.businessState}
+      </if>
+      <if test="example.storeGradeId != null">
+        and store.site_info.store_grade_id = #{example.storeGradeId}
+      </if>
+    </where>
+  </select>
+
+  <select id="listCnPageByExample" resultType="com.slodon.b2b2c.seller.pojo.Store">
+    select store.store_id as storeId,
+    store_name.store_name as storeName,
+    store_site_info.store_logo as storeLogo,
+    store.state as state,
+    case
+    when store_site_info.business_state is null then 2
+    else store_site_info.business_state
+    end as businessState,
+    store_site_info.store_grade_name as storeGradeName,
+    store_site_info.create_time as createTime,
+    store_site_info.store_expire_time as storeExpireTime,
+    store.bill_type as billType,
+    store.bill_day as billDay
+    from store
+    left join store_name on store.store_id = store_name.store_id
+    left join store_site_info on store_name.store_id = store_site_info.store_id
+    <where>
+      <if test="example.state != null">
+        and store.state = #{example.state}
+      </if>
+      <if test="example.stateNotEquals != null">
+        and store.state != #{example.stateNotEquals}
+      </if>
+      <if test="example.isOwnStore != null">
+        and store.is_own_store = #{example.isOwnStore}
+      </if>
+      <if test="example.storeNameLike != null">
+        and store_name.store_name like concat('%',#{example.storeNameLike},'%')
+      </if>
+      <if test="example.businessState != null">
+        and store_site_info.business_state = #{example.businessState}
+      </if>
+      <if test="example.storeGradeId != null">
+        and store.site_info.store_grade_id = #{example.storeGradeId}
+      </if>
+    </where>
+    order by store_site_info.update_time desc
+    <include refid="limit"/>
+  </select>
 </mapper>