|
@@ -8,13 +8,15 @@ import com.slodon.b2b2c.core.response.SldResponse;
|
|
import com.slodon.b2b2c.core.util.AssertUtil;
|
|
import com.slodon.b2b2c.core.util.AssertUtil;
|
|
import com.slodon.b2b2c.core.util.FileUrlUtil;
|
|
import com.slodon.b2b2c.core.util.FileUrlUtil;
|
|
import com.slodon.b2b2c.core.util.UserUtil;
|
|
import com.slodon.b2b2c.core.util.UserUtil;
|
|
|
|
+import com.slodon.b2b2c.enums.WebSiteConstant;
|
|
|
|
+import com.slodon.b2b2c.goods.example.GoodsCategoryExample;
|
|
import com.slodon.b2b2c.goods.pojo.GoodsCategory;
|
|
import com.slodon.b2b2c.goods.pojo.GoodsCategory;
|
|
import com.slodon.b2b2c.model.goods.GoodsCategoryModel;
|
|
import com.slodon.b2b2c.model.goods.GoodsCategoryModel;
|
|
import com.slodon.b2b2c.model.seller.*;
|
|
import com.slodon.b2b2c.model.seller.*;
|
|
-import com.slodon.b2b2c.seller.example.StoreApplyExample;
|
|
|
|
-import com.slodon.b2b2c.seller.example.StoreBindCategoryExample;
|
|
|
|
-import com.slodon.b2b2c.seller.example.StoreCertificateExample;
|
|
|
|
|
|
+import com.slodon.b2b2c.model.system.SettingModel;
|
|
|
|
+import com.slodon.b2b2c.seller.example.*;
|
|
import com.slodon.b2b2c.seller.pojo.*;
|
|
import com.slodon.b2b2c.seller.pojo.*;
|
|
|
|
+import com.slodon.b2b2c.system.pojo.Setting;
|
|
import com.slodon.b2b2c.system.pojo.SysSeo;
|
|
import com.slodon.b2b2c.system.pojo.SysSeo;
|
|
import com.slodon.b2b2c.vo.seller.StoreDetailVO;
|
|
import com.slodon.b2b2c.vo.seller.StoreDetailVO;
|
|
import com.slodon.b2b2c.vo.seller.StoreGoodsCateVO;
|
|
import com.slodon.b2b2c.vo.seller.StoreGoodsCateVO;
|
|
@@ -49,6 +51,12 @@ public class SellerStoreController extends BaseController {
|
|
@Resource
|
|
@Resource
|
|
private StoreModel storeModel;
|
|
private StoreModel storeModel;
|
|
@Resource
|
|
@Resource
|
|
|
|
+ private StoreSiteInfoModel storeSiteInfoModel;
|
|
|
|
+ @Resource
|
|
|
|
+ private StoreNameModel storeNameModel;
|
|
|
|
+ @Resource
|
|
|
|
+ private SettingModel settingModel;
|
|
|
|
+ @Resource
|
|
private StoreApplyModel storeApplyModel;
|
|
private StoreApplyModel storeApplyModel;
|
|
@Resource
|
|
@Resource
|
|
private StoreCertificateModel storeCertificateModel;
|
|
private StoreCertificateModel storeCertificateModel;
|
|
@@ -66,11 +74,19 @@ public class SellerStoreController extends BaseController {
|
|
|
|
|
|
@ApiOperation("查看店铺信息")
|
|
@ApiOperation("查看店铺信息")
|
|
@GetMapping("detail")
|
|
@GetMapping("detail")
|
|
- public JsonResult<StoreDetailVO> getDetail(HttpServletRequest request) {
|
|
|
|
|
|
+ @ApiImplicitParam(name = "webSite", value = "站点", paramType = "query")
|
|
|
|
+ public JsonResult<StoreDetailVO> getDetail(HttpServletRequest request, @RequestParam(value = "webSite", required = false, defaultValue = "1") String webSite) {
|
|
|
|
|
|
Vendor vendor = UserUtil.getUser(request, Vendor.class);
|
|
Vendor vendor = UserUtil.getUser(request, Vendor.class);
|
|
//根据vendor获取店铺信息
|
|
//根据vendor获取店铺信息
|
|
Store store = storeModel.getStoreByStoreId(vendor.getStoreId());
|
|
Store store = storeModel.getStoreByStoreId(vendor.getStoreId());
|
|
|
|
+ if (!WebSiteConstant.MEMBER_OVERSEA.equals(webSite)) {
|
|
|
|
+ store = storeSiteInfoModel.getStoreByStoreIdAndWebSite(store.getStoreId(), webSite);
|
|
|
|
+ StoreNameExample storeNameExample = new StoreNameExample();
|
|
|
|
+ storeNameExample.setStoreId(store.getStoreId());
|
|
|
|
+ List<StoreName> storeNameList = storeNameModel.getStoreNameList(storeNameExample, null);
|
|
|
|
+ store.setStoreName(CollectionUtils.isEmpty(storeNameList) ? store.getStoreName() : storeNameList.get(0).getStoreName());
|
|
|
|
+ }
|
|
AssertUtil.notNull(store, "未获取到店铺信息");
|
|
AssertUtil.notNull(store, "未获取到店铺信息");
|
|
AssertUtil.isTrue(!vendor.getStoreId().equals(store.getStoreId()), "非法操作");
|
|
AssertUtil.isTrue(!vendor.getStoreId().equals(store.getStoreId()), "非法操作");
|
|
|
|
|
|
@@ -102,18 +118,23 @@ public class SellerStoreController extends BaseController {
|
|
//获取经营类目信息
|
|
//获取经营类目信息
|
|
StoreBindCategoryExample storeBindCategoryExample = new StoreBindCategoryExample();
|
|
StoreBindCategoryExample storeBindCategoryExample = new StoreBindCategoryExample();
|
|
storeBindCategoryExample.setStoreId(storeApply.getStoreId());
|
|
storeBindCategoryExample.setStoreId(storeApply.getStoreId());
|
|
|
|
+ storeBindCategoryExample.setWebSite(webSite);
|
|
storeBindCategoryExample.setState(StoreConst.STORE_CATEGORY_STATE_PASS);
|
|
storeBindCategoryExample.setState(StoreConst.STORE_CATEGORY_STATE_PASS);
|
|
List<StoreBindCategory> storeBindCategoryList = storeBindCategoryModel.getStoreBindCategoryList(storeBindCategoryExample, null);
|
|
List<StoreBindCategory> storeBindCategoryList = storeBindCategoryModel.getStoreBindCategoryList(storeBindCategoryExample, null);
|
|
|
|
+
|
|
|
|
+ List<Setting> webSiteList = settingModel.getSiteSetting();
|
|
|
|
+
|
|
|
|
+ GoodsCategoryExample goodsCategoryExample = new GoodsCategoryExample();
|
|
|
|
+ List<GoodsCategory> goodsCategoryList = goodsCategoryModel.getGoodsCategoryList(goodsCategoryExample, null);
|
|
|
|
+
|
|
List<StoreGoodsCateVO> storeGoodsCateVOList = new ArrayList<>();
|
|
List<StoreGoodsCateVO> storeGoodsCateVOList = new ArrayList<>();
|
|
if (!CollectionUtils.isEmpty(storeBindCategoryList)) {
|
|
if (!CollectionUtils.isEmpty(storeBindCategoryList)) {
|
|
storeBindCategoryList.forEach(storeBindCategory -> {
|
|
storeBindCategoryList.forEach(storeBindCategory -> {
|
|
StoreGoodsCateVO storeGoodsCateVO = new StoreGoodsCateVO(storeBindCategory);
|
|
StoreGoodsCateVO storeGoodsCateVO = new StoreGoodsCateVO(storeBindCategory);
|
|
- GoodsCategory goodsCategory1 = goodsCategoryModel.getGoodsCategoryByCategoryId(storeBindCategory.getGoodsCategoryId1());
|
|
|
|
- storeGoodsCateVO.setGoodsCateName1(goodsCategory1.getCategoryName());
|
|
|
|
- GoodsCategory goodsCategory2 = goodsCategoryModel.getGoodsCategoryByCategoryId(storeBindCategory.getGoodsCategoryId2());
|
|
|
|
- storeGoodsCateVO.setGoodsCateName2(goodsCategory2.getCategoryName());
|
|
|
|
- GoodsCategory goodsCategory3 = goodsCategoryModel.getGoodsCategoryByCategoryId(storeBindCategory.getGoodsCategoryId3());
|
|
|
|
- storeGoodsCateVO.setGoodsCateName3(goodsCategory3.getCategoryName());
|
|
|
|
|
|
+ storeGoodsCateVO.setWebSiteName(webSiteList.stream().filter(setting -> setting.getValue().equals(storeBindCategory.getWebSite())).findFirst().map(Setting::getTitle).orElse(""));
|
|
|
|
+ storeGoodsCateVO.setGoodsCateName1(goodsCategoryList.stream().filter(goodsCategory -> goodsCategory.getCategoryId().equals(storeBindCategory.getGoodsCategoryId1())).findFirst().map(GoodsCategory::getCategoryName).orElse(""));
|
|
|
|
+ storeGoodsCateVO.setGoodsCateName2(goodsCategoryList.stream().filter(goodsCategory -> goodsCategory.getCategoryId().equals(storeBindCategory.getGoodsCategoryId2())).findFirst().map(GoodsCategory::getCategoryName).orElse(""));
|
|
|
|
+ storeGoodsCateVO.setGoodsCateName3(goodsCategoryList.stream().filter(goodsCategory -> goodsCategory.getCategoryId().equals(storeBindCategory.getGoodsCategoryId3())).findFirst().map(GoodsCategory::getCategoryName).orElse(""));
|
|
storeGoodsCateVOList.add(storeGoodsCateVO);
|
|
storeGoodsCateVOList.add(storeGoodsCateVO);
|
|
});
|
|
});
|
|
vo.setStoreGoodsCateVOList(storeGoodsCateVOList);
|
|
vo.setStoreGoodsCateVOList(storeGoodsCateVOList);
|
|
@@ -168,17 +189,32 @@ public class SellerStoreController extends BaseController {
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation("获取店铺设置信息接口")
|
|
@ApiOperation("获取店铺设置信息接口")
|
|
|
|
+ @ApiImplicitParam(name = "webSite", value = "站点", paramType = "query")
|
|
@GetMapping("settingDetail")
|
|
@GetMapping("settingDetail")
|
|
- public JsonResult<StoreSettingVO> settingDetail(HttpServletRequest request) {
|
|
|
|
|
|
+ public JsonResult<StoreSettingVO> settingDetail(HttpServletRequest request, @RequestParam(value = "webSite", required = false, defaultValue = "1") String webSite) {
|
|
Vendor vendor = UserUtil.getUser(request, Vendor.class);
|
|
Vendor vendor = UserUtil.getUser(request, Vendor.class);
|
|
|
|
|
|
- Store store = storeModel.getStoreByStoreId(vendor.getStoreId());
|
|
|
|
- SysSeo seoInfo = storeModel.getRecordByTargetIdAndType(vendor.getStoreId(),SeoTypeConstant.SEO_TYPE_SHOP);
|
|
|
|
- if(seoInfo!=null){
|
|
|
|
- store.setStoreSeoTitle(seoInfo.getTitle());
|
|
|
|
- store.setStoreSeoDesc(seoInfo.getRemark());
|
|
|
|
- store.setStoreSeoKeyword(seoInfo.getKeywords());
|
|
|
|
|
|
+ Store store;
|
|
|
|
+ if (WebSiteConstant.MEMBER_OVERSEA.equals(webSite)) {
|
|
|
|
+ store = storeModel.getStoreByStoreId(vendor.getStoreId());
|
|
|
|
+ SysSeo seoInfo = storeModel.getRecordByTargetIdAndType(vendor.getStoreId(), SeoTypeConstant.SEO_TYPE_SHOP);
|
|
|
|
+ if (seoInfo != null) {
|
|
|
|
+ store.setStoreSeoTitle(seoInfo.getTitle());
|
|
|
|
+ store.setStoreSeoDesc(seoInfo.getRemark());
|
|
|
|
+ store.setStoreSeoKeyword(seoInfo.getKeywords());
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ store = storeSiteInfoModel.getStoreByStoreIdAndWebSite(vendor.getStoreId(), webSite);
|
|
|
|
+ SysSeo seoInfo = storeModel.getRecordByTargetIdAndType(vendor.getStoreId(), SeoTypeConstant.SEO_TYPE_SHOP + "_" + webSite);
|
|
|
|
+ if (seoInfo != null) {
|
|
|
|
+ store.setStoreSeoTitle(seoInfo.getTitle());
|
|
|
|
+ store.setStoreSeoDesc(seoInfo.getRemark());
|
|
|
|
+ store.setStoreSeoKeyword(seoInfo.getKeywords());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
//查询店铺简介内容表里是否存在这笔数据
|
|
//查询店铺简介内容表里是否存在这笔数据
|
|
// StoreProfileTextList storeProfileTextInfo = storeProfileTextListModel.getList(vendor.getStoreId());
|
|
// StoreProfileTextList storeProfileTextInfo = storeProfileTextListModel.getList(vendor.getStoreId());
|
|
// if(storeProfileTextInfo!=null){
|
|
// if(storeProfileTextInfo!=null){
|
|
@@ -191,6 +227,7 @@ public class SellerStoreController extends BaseController {
|
|
|
|
|
|
@ApiOperation("编辑店铺设置接口")
|
|
@ApiOperation("编辑店铺设置接口")
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParams({
|
|
|
|
+ @ApiImplicitParam(name = "webSite", value = "站点", paramType = "query"),
|
|
@ApiImplicitParam(name = "mainBusiness", value = "店铺主营商品名称,用','分隔,例如'男装,女装,童装'"),
|
|
@ApiImplicitParam(name = "mainBusiness", value = "店铺主营商品名称,用','分隔,例如'男装,女装,童装'"),
|
|
@ApiImplicitParam(name = "storeLogo", value = "店铺logo"),
|
|
@ApiImplicitParam(name = "storeLogo", value = "店铺logo"),
|
|
@ApiImplicitParam(name = "servicePhone", value = "店铺客服电话"),
|
|
@ApiImplicitParam(name = "servicePhone", value = "店铺客服电话"),
|
|
@@ -209,6 +246,7 @@ public class SellerStoreController extends BaseController {
|
|
@VendorLogger(option = "编辑店铺设置接口")
|
|
@VendorLogger(option = "编辑店铺设置接口")
|
|
@PostMapping("updateSetting")
|
|
@PostMapping("updateSetting")
|
|
public JsonResult<Integer> updateStoreSetting(HttpServletRequest request,
|
|
public JsonResult<Integer> updateStoreSetting(HttpServletRequest request,
|
|
|
|
+ @RequestParam(value = "webSite", required = false, defaultValue = "1") String webSite,
|
|
@RequestParam(value = "mainBusiness", required = false) String mainBusiness,
|
|
@RequestParam(value = "mainBusiness", required = false) String mainBusiness,
|
|
@RequestParam(value = "storeLogo", required = false) String storeLogo,
|
|
@RequestParam(value = "storeLogo", required = false) String storeLogo,
|
|
@RequestParam(value = "servicePhone", required = false) String servicePhone,
|
|
@RequestParam(value = "servicePhone", required = false) String servicePhone,
|
|
@@ -227,25 +265,56 @@ public class SellerStoreController extends BaseController {
|
|
|
|
|
|
String logMsg = "店铺id:" + vendor.getStoreId();
|
|
String logMsg = "店铺id:" + vendor.getStoreId();
|
|
|
|
|
|
- Store store = new Store();
|
|
|
|
- store.setStoreId(vendor.getStoreId());
|
|
|
|
- store.setMainBusiness(mainBusiness);
|
|
|
|
- store.setStoreLogo(storeLogo);
|
|
|
|
- store.setServicePhone(servicePhone);
|
|
|
|
- store.setAddress(address);
|
|
|
|
- store.setEmail(email);
|
|
|
|
- store.setStoreBannerPc(storeBannerPc);
|
|
|
|
- store.setStoreBannerMobile(storeBannerMobile);
|
|
|
|
- store.setStoreBackdrop(storeBackdrop);
|
|
|
|
- store.setStoreMapInfo(storeMapInfo);
|
|
|
|
- store.setStoreMapInfoW(storeMapInfoW);
|
|
|
|
-
|
|
|
|
- storeModel.updateStore(store);
|
|
|
|
|
|
+ if (WebSiteConstant.MEMBER_OVERSEA.equals(webSite)) {
|
|
|
|
+ Store store = new Store();
|
|
|
|
+ store.setStoreId(vendor.getStoreId());
|
|
|
|
+ store.setMainBusiness(mainBusiness);
|
|
|
|
+ store.setStoreLogo(storeLogo);
|
|
|
|
+ store.setServicePhone(servicePhone);
|
|
|
|
+ store.setAddress(address);
|
|
|
|
+ store.setEmail(email);
|
|
|
|
+ store.setStoreBannerPc(storeBannerPc);
|
|
|
|
+ store.setStoreBannerMobile(storeBannerMobile);
|
|
|
|
+ store.setStoreBackdrop(storeBackdrop);
|
|
|
|
+ store.setStoreMapInfo(storeMapInfo);
|
|
|
|
+ store.setStoreMapInfoW(storeMapInfoW);
|
|
|
|
+ storeModel.updateStore(store);
|
|
|
|
+ }else {
|
|
|
|
+ StoreSiteInfoExample storeSiteInfoExample = new StoreSiteInfoExample();
|
|
|
|
+ storeSiteInfoExample.setStoreId(vendor.getStoreId());
|
|
|
|
+ storeSiteInfoExample.setWebSite(webSite);
|
|
|
|
+ Store store = storeSiteInfoModel.getStoreByStoreIdAndWebSite(vendor.getStoreId(), webSite);
|
|
|
|
+
|
|
|
|
+ StoreSiteInfo storeSiteInfo = new StoreSiteInfo();
|
|
|
|
+ storeSiteInfo.setStoreId(vendor.getStoreId());
|
|
|
|
+ storeSiteInfo.setWebSite(webSite);
|
|
|
|
+ storeSiteInfo.setStoreLogo(storeLogo);
|
|
|
|
+ storeSiteInfo.setServicePhone(servicePhone);
|
|
|
|
+ storeSiteInfo.setAddress(address);
|
|
|
|
+ storeSiteInfo.setEmail(email);
|
|
|
|
+ storeSiteInfo.setStoreBannerPc(storeBannerPc);
|
|
|
|
+ storeSiteInfo.setStoreMapInfo(storeMapInfo);
|
|
|
|
+ storeSiteInfo.setStoreMapInfoW(storeMapInfoW);
|
|
|
|
+
|
|
|
|
+ if (store == null) {
|
|
|
|
+ storeSiteInfo.setCreateId(vendor.getVendorId());
|
|
|
|
+ storeSiteInfo.setCreateTime(new Date());
|
|
|
|
+ storeSiteInfoModel.saveStoreSiteInfo(storeSiteInfo);
|
|
|
|
+ } else {
|
|
|
|
+ storeSiteInfo.setUpdateId(vendor.getVendorId());
|
|
|
|
+ storeSiteInfo.setUpdateTime(new Date());
|
|
|
|
+ storeSiteInfoModel.updateStoreSiteInfo(storeSiteInfo);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
//以下为新增SEO表
|
|
//以下为新增SEO表
|
|
SysSeo sysSeo = new SysSeo();
|
|
SysSeo sysSeo = new SysSeo();
|
|
sysSeo.setTenant(0L);
|
|
sysSeo.setTenant(0L);
|
|
sysSeo.setType(SeoTypeConstant.SEO_TYPE_SHOP);
|
|
sysSeo.setType(SeoTypeConstant.SEO_TYPE_SHOP);
|
|
|
|
+ if (!WebSiteConstant.MEMBER_OVERSEA.equals(webSite)) {
|
|
|
|
+ sysSeo.setType(SeoTypeConstant.SEO_TYPE_SHOP + "_" + webSite);
|
|
|
|
+ }
|
|
sysSeo.setName("店铺SEO");
|
|
sysSeo.setName("店铺SEO");
|
|
// sysSeo.setCode(SeoTypeConstant.SEO_TYPE_SHOP+"_"+vendor.getStoreId());
|
|
// sysSeo.setCode(SeoTypeConstant.SEO_TYPE_SHOP+"_"+vendor.getStoreId());
|
|
sysSeo.setTargetId(vendor.getStoreId());
|
|
sysSeo.setTargetId(vendor.getStoreId());
|