|
@@ -1,5 +1,6 @@
|
|
|
package com.slodon.b2b2c.model.seller;
|
|
|
|
|
|
+import cn.hutool.core.collection.CollectionUtil;
|
|
|
import com.gexin.fastjson.JSON;
|
|
|
import com.slodon.b2b2c.core.constant.*;
|
|
|
import com.slodon.b2b2c.core.exception.MallException;
|
|
@@ -12,14 +13,19 @@ import com.slodon.b2b2c.dao.read.goods.GoodsCategoryReadMapper;
|
|
|
import com.slodon.b2b2c.dao.read.seller.StoreApplyReadMapper;
|
|
|
import com.slodon.b2b2c.dao.read.seller.StoreCertificateReadMapper;
|
|
|
import com.slodon.b2b2c.dao.read.seller.StoreGradeReadMapper;
|
|
|
+import com.slodon.b2b2c.dao.read.seller.StoreNameReadMapper;
|
|
|
import com.slodon.b2b2c.dao.write.seller.StoreApplyWriteMapper;
|
|
|
import com.slodon.b2b2c.dao.write.seller.StoreBindCategoryWriteMapper;
|
|
|
import com.slodon.b2b2c.dao.write.seller.StoreCertificateWriteMapper;
|
|
|
+import com.slodon.b2b2c.dao.write.seller.StoreNameWriteMapper;
|
|
|
+import com.slodon.b2b2c.enums.WebSiteConstant;
|
|
|
import com.slodon.b2b2c.goods.pojo.GoodsCategory;
|
|
|
import com.slodon.b2b2c.seller.dto.StoreApplyDTO;
|
|
|
+import com.slodon.b2b2c.seller.dto.StoreSiteCategoryInfoDTO;
|
|
|
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.seller.example.StoreNameExample;
|
|
|
import com.slodon.b2b2c.seller.pojo.*;
|
|
|
import com.slodon.b2b2c.sms.DySmsSender;
|
|
|
import com.slodon.b2b2c.sms.base.SmsSender;
|
|
@@ -34,6 +40,7 @@ import org.springframework.util.StringUtils;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.util.Collections;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
@@ -44,6 +51,10 @@ public class StoreApplyModel {
|
|
|
@Resource
|
|
|
private StoreApplyReadMapper storeApplyReadMapper;
|
|
|
@Resource
|
|
|
+ private StoreNameReadMapper storeNameReadMapper;
|
|
|
+ @Resource
|
|
|
+ private StoreNameWriteMapper storeNameWriteMapper;
|
|
|
+ @Resource
|
|
|
private StoreApplyWriteMapper storeApplyWriteMapper;
|
|
|
@Resource
|
|
|
private StoreGradeReadMapper storeGradeReadMapper;
|
|
@@ -92,32 +103,59 @@ public class StoreApplyModel {
|
|
|
int count = storeCertificateReadMapper.countByExample(example);
|
|
|
AssertUtil.isTrue(count > 0, "公司名称已存在");
|
|
|
}
|
|
|
- //重复判断:店铺名称不能重复
|
|
|
- String storeName = storeApplyDTO.getStoreName().trim();
|
|
|
- StoreApplyExample example = new StoreApplyExample();
|
|
|
- example.setStoreName(storeName);
|
|
|
- int count = storeApplyReadMapper.countByExample(example);
|
|
|
- AssertUtil.isTrue(count > 0, "店铺名称已存在");
|
|
|
-
|
|
|
- //插入store_apply表
|
|
|
- StoreApply storeApply = new StoreApply();
|
|
|
- storeApply.setVendorId(vendor.getVendorId());
|
|
|
- storeApply.setVendorName(vendor.getVendorName());
|
|
|
- storeApply.setStoreName(storeName);
|
|
|
- storeApply.setState(StoreConst.STATE_1_SEND_APPLY);
|
|
|
-// storeApply.setApplyYear(storeApplyDTO.getApplyYear());
|
|
|
-// storeApply.setStoreGradeId(storeApplyDTO.getStoreGradeId());
|
|
|
- storeApply.setApplyYear(NumConstant.ONE);
|
|
|
- storeApply.setStoreGradeId(StoreConst.STORE_CRADE_1);
|
|
|
- storeApply.setSubmitTime(new Date());
|
|
|
- storeApply.setStoreId(SmartId.nextId(BizTypeConst.STORE));
|
|
|
- storeApply.setStoreType(StoreConst.NO_OWN_STORE);
|
|
|
- //根据gradeId查询收费标准
|
|
|
- StoreGrade storeGrade = storeGradeReadMapper.getByPrimaryKey(StoreConst.STORE_CRADE_1);
|
|
|
-// storeApply.setPayAmount(new BigDecimal(storeGrade.getPrice()).multiply(new BigDecimal(storeApplyDTO.getApplyYear())));
|
|
|
- count = storeApplyWriteMapper.insert(storeApply);
|
|
|
- if (count == 0) {
|
|
|
- throw new MallException("店铺申请表添加失败,请重试");
|
|
|
+
|
|
|
+ Long storeId = SmartId.nextId(BizTypeConst.STORE);
|
|
|
+ if (CollectionUtil.isEmpty(storeApplyDTO.getSiteInfoList())){
|
|
|
+ throw new MallException("请选择经营信息");
|
|
|
+ }
|
|
|
+
|
|
|
+ for (StoreSiteCategoryInfoDTO siteCategoryInfoDTO : storeApplyDTO.getSiteInfoList()) {
|
|
|
+ //重复判断:店铺名称不能重复
|
|
|
+ String storeName = siteCategoryInfoDTO.getStoreName().trim();
|
|
|
+ if (WebSiteConstant.MEMBER_OVERSEA.equals(siteCategoryInfoDTO.getWebSite())) {
|
|
|
+ StoreApplyExample example = new StoreApplyExample();
|
|
|
+ example.setStoreName(storeName);
|
|
|
+ int count = storeApplyReadMapper.countByExample(example);
|
|
|
+ AssertUtil.isTrue(count > 0, "店铺名称已存在");
|
|
|
+ //插入store_apply表
|
|
|
+ StoreApply storeApply = new StoreApply();
|
|
|
+ storeApply.setVendorId(vendor.getVendorId());
|
|
|
+ storeApply.setVendorName(vendor.getVendorName());
|
|
|
+ storeApply.setStoreName(storeName);
|
|
|
+ storeApply.setState(StoreConst.STATE_1_SEND_APPLY);
|
|
|
+// storeApply.setApplyYear(storeApplyDTO.getApplyYear());
|
|
|
+// storeApply.setStoreGradeId(storeApplyDTO.getStoreGradeId());
|
|
|
+ storeApply.setApplyYear(NumConstant.ONE);
|
|
|
+ storeApply.setStoreGradeId(StoreConst.STORE_CRADE_1);
|
|
|
+ storeApply.setSubmitTime(new Date());
|
|
|
+ storeApply.setStoreId(storeId);
|
|
|
+ storeApply.setStoreType(StoreConst.NO_OWN_STORE);
|
|
|
+ //根据gradeId查询收费标准
|
|
|
+ StoreGrade storeGrade = storeGradeReadMapper.getByPrimaryKey(StoreConst.STORE_CRADE_1);
|
|
|
+// storeApply.setPayAmount(new BigDecimal(storeGrade.getPrice()).multiply(new BigDecimal(storeApplyDTO.getApplyYear())));
|
|
|
+ count = storeApplyWriteMapper.insert(storeApply);
|
|
|
+ if (count == 0) {
|
|
|
+ throw new MallException("店铺申请表添加失败,请重试");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ StoreNameExample example = new StoreNameExample();
|
|
|
+ example.setStoreName(storeName);
|
|
|
+ example.setWebSite(siteCategoryInfoDTO.getWebSite());
|
|
|
+ int count = storeNameReadMapper.countByExample(example);
|
|
|
+ AssertUtil.isTrue(count > 0, "店铺名称已存在");
|
|
|
+ StoreName name = new StoreName();
|
|
|
+ name.setStoreName(storeName);
|
|
|
+ name.setWebSite(siteCategoryInfoDTO.getWebSite());
|
|
|
+ name.setStoreId(storeId);
|
|
|
+ name.setCreateId(vendor.getVendorId());
|
|
|
+ name.setCreateTime(new Date());
|
|
|
+ name.setUpdateId(vendor.getVendorId());
|
|
|
+ name.setUpdateTime(new Date());
|
|
|
+ count = storeNameWriteMapper.insert(name);
|
|
|
+ if (count == 0) {
|
|
|
+ throw new MallException("店铺名称表添加失败,请重试");
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//插入store_certificate表
|
|
@@ -128,40 +166,44 @@ public class StoreApplyModel {
|
|
|
storeCertificate.setVendorName(vendor.getVendorName());
|
|
|
storeCertificate.setCompanyName(companyName);
|
|
|
|
|
|
- count = storeCertificateWriteMapper.insert(storeCertificate);
|
|
|
+ int count = storeCertificateWriteMapper.insert(storeCertificate);
|
|
|
if (count == 0) {
|
|
|
throw new MallException("店铺资质表添加失败,请重试");
|
|
|
}
|
|
|
|
|
|
- //插入store_bind_category表
|
|
|
- StoreBindCategory storeBindCategory = new StoreBindCategory();
|
|
|
- storeBindCategory.setStoreId(0L);
|
|
|
- storeBindCategory.setCreateVendorId(vendor.getVendorId());
|
|
|
- storeBindCategory.setCreateTime(new Date());
|
|
|
- storeBindCategory.setState(StoreConst.STORE_CATEGORY_STATE_SEND);
|
|
|
-
|
|
|
- String[] split = storeApplyDTO.getGoodsCategoryIds().split(",");
|
|
|
- for (String goodsCategoryId : split) {
|
|
|
- String[] split1 = goodsCategoryId.split("-");
|
|
|
- storeBindCategory.setGoodsCategoryId1(Integer.parseInt(split1[0]));
|
|
|
- storeBindCategory.setGoodsCategoryId2(Integer.parseInt(split1[1]));
|
|
|
- storeBindCategory.setGoodsCategoryId3(Integer.parseInt(split1[2]));
|
|
|
- //根据一级分类id查询一级分类名称
|
|
|
- GoodsCategory goodsCategory1 = goodsCategoryReadMapper.getByPrimaryKey(split1[0]);
|
|
|
- //根据二级分类id查询二级分类名称
|
|
|
- GoodsCategory goodsCategory2 = goodsCategoryReadMapper.getByPrimaryKey(split1[1]);
|
|
|
- //根据三级分类id查询三级分类名称
|
|
|
- GoodsCategory goodsCategory3 = goodsCategoryReadMapper.getByPrimaryKey(split1[2]);
|
|
|
- //拼接类目组合名称
|
|
|
- String goodsCateName = goodsCategory1.getCategoryName() + ">" + goodsCategory2.getCategoryName() + ">" + goodsCategory3.getCategoryName();
|
|
|
- storeBindCategory.setGoodsCateName(goodsCateName);
|
|
|
- storeBindCategory.setScaling(goodsCategory3.getScaling());
|
|
|
- count = storeBindCategoryWriteMapper.insert(storeBindCategory);
|
|
|
- if (count == 0) {
|
|
|
- throw new MallException("店铺可用商品分类表添加失败,请重试");
|
|
|
- }
|
|
|
+ for (StoreSiteCategoryInfoDTO siteCategoryInfoDTO : storeApplyDTO.getSiteInfoList()) {
|
|
|
+ //插入store_bind_category表
|
|
|
+ StoreBindCategory storeBindCategory = new StoreBindCategory();
|
|
|
+ storeBindCategory.setStoreId(0L);
|
|
|
+ storeBindCategory.setWebSite(siteCategoryInfoDTO.getWebSite());
|
|
|
+ storeBindCategory.setCreateVendorId(vendor.getVendorId());
|
|
|
+ storeBindCategory.setCreateTime(new Date());
|
|
|
+ storeBindCategory.setState(StoreConst.STORE_CATEGORY_STATE_SEND);
|
|
|
+
|
|
|
+ String[] split = siteCategoryInfoDTO.getGoodsCategoryIds().split(",");
|
|
|
+ for (String goodsCategoryId : split) {
|
|
|
+ String[] split1 = goodsCategoryId.split("-");
|
|
|
+ storeBindCategory.setGoodsCategoryId1(Integer.parseInt(split1[0]));
|
|
|
+ storeBindCategory.setGoodsCategoryId2(Integer.parseInt(split1[1]));
|
|
|
+ storeBindCategory.setGoodsCategoryId3(Integer.parseInt(split1[2]));
|
|
|
+ //根据一级分类id查询一级分类名称
|
|
|
+ GoodsCategory goodsCategory1 = goodsCategoryReadMapper.getByPrimaryKey(split1[0]);
|
|
|
+ //根据二级分类id查询二级分类名称
|
|
|
+ GoodsCategory goodsCategory2 = goodsCategoryReadMapper.getByPrimaryKey(split1[1]);
|
|
|
+ //根据三级分类id查询三级分类名称
|
|
|
+ GoodsCategory goodsCategory3 = goodsCategoryReadMapper.getByPrimaryKey(split1[2]);
|
|
|
+ //拼接类目组合名称
|
|
|
+ String goodsCateName = goodsCategory1.getCategoryName() + ">" + goodsCategory2.getCategoryName() + ">" + goodsCategory3.getCategoryName();
|
|
|
+ storeBindCategory.setGoodsCateName(goodsCateName);
|
|
|
+ storeBindCategory.setScaling(goodsCategory3.getScaling());
|
|
|
+ count = storeBindCategoryWriteMapper.insert(storeBindCategory);
|
|
|
+ if (count == 0) {
|
|
|
+ throw new MallException("店铺可用商品分类表添加失败,请重试");
|
|
|
+ }
|
|
|
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -220,36 +262,77 @@ public class StoreApplyModel {
|
|
|
AssertUtil.isTrue(count > 0, "公司名称已存在");
|
|
|
}
|
|
|
}
|
|
|
- //重复判断:店铺名称不能重复
|
|
|
- String storeName = storeApplyDTO.getStoreName().trim();
|
|
|
- if (!StringUtils.isEmpty(storeName)) {
|
|
|
- StoreApplyExample example = new StoreApplyExample();
|
|
|
- example.setStoreName(storeName);
|
|
|
- example.setVendorIdNotEquals(vendor.getVendorId());
|
|
|
- int count = storeApplyReadMapper.countByExample(example);
|
|
|
- AssertUtil.isTrue(count > 0, "店铺名称已存在");
|
|
|
- }
|
|
|
|
|
|
- StoreCertificate storeCertificate = storeCertificateReadMapper.getByPrimaryKey(storeApplyDTO.getCertificateId());
|
|
|
- PropertyUtils.copyProperties(storeCertificate, storeApplyDTO);
|
|
|
+ if (CollectionUtil.isEmpty(storeApplyDTO.getSiteInfoList())){
|
|
|
+ throw new MallException("请选择经营信息");
|
|
|
+ }
|
|
|
+
|
|
|
+ for (StoreSiteCategoryInfoDTO siteCategoryInfoDTO : storeApplyDTO.getSiteInfoList()) {
|
|
|
+ //重复判断:店铺名称不能重复
|
|
|
+ String storeName = siteCategoryInfoDTO.getStoreName().trim();
|
|
|
+ if (!StringUtils.isEmpty(storeName)) {
|
|
|
+ if (WebSiteConstant.MEMBER_OVERSEA.equals(siteCategoryInfoDTO.getWebSite())) {
|
|
|
+ StoreApplyExample example = new StoreApplyExample();
|
|
|
+ example.setStoreName(storeName);
|
|
|
+ example.setVendorIdNotEquals(vendor.getVendorId());
|
|
|
+ int count = storeApplyReadMapper.countByExample(example);
|
|
|
+ AssertUtil.isTrue(count > 0, "店铺名称已存在");
|
|
|
+ //更新store_apply表
|
|
|
+ StoreApply storeApply = storeApplyReadMapper.getByPrimaryKey(storeApplyDTO.getApplyId());
|
|
|
+ PropertyUtils.copyProperties(storeApply, storeApplyDTO);
|
|
|
+ storeApply.setStoreName(storeName);
|
|
|
+ storeApply.setState(StoreConst.STATE_1_SEND_APPLY);
|
|
|
+ storeApply.setSubmitTime(new Date());
|
|
|
+ count = storeApplyWriteMapper.updateByPrimaryKeySelective(storeApply);
|
|
|
+ if (count == 0) {
|
|
|
+ log.error("根据applyId:" + storeApply.getApplyId() + "更新商家申请表失败");
|
|
|
+ throw new MallException("更新商家申请表失败,请重试");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ int count;
|
|
|
+ if (siteCategoryInfoDTO.getId() != null) {
|
|
|
+ StoreNameExample example = new StoreNameExample();
|
|
|
+ example.setIdNotEquals(siteCategoryInfoDTO.getId());
|
|
|
+ example.setStoreName(storeName);
|
|
|
+ example.setWebSite(siteCategoryInfoDTO.getWebSite());
|
|
|
+ count = storeNameReadMapper.countByExample(example);
|
|
|
+ AssertUtil.isTrue(count > 0, "店铺名称已存在");
|
|
|
+ StoreName name = storeNameReadMapper.getByPrimaryKey(siteCategoryInfoDTO.getId());
|
|
|
+ PropertyUtils.copyProperties(name, siteCategoryInfoDTO);
|
|
|
+ name.setStoreName(storeName);
|
|
|
+ name.setUpdateId(vendor.getVendorId());
|
|
|
+ name.setUpdateTime(new Date());
|
|
|
+ count = storeNameWriteMapper.updateByPrimaryKeySelective(name);
|
|
|
+ if (count == 0) {
|
|
|
+ log.error("根据id:" + name.getId() + "更新店铺名称表失败");
|
|
|
+ throw new MallException("更新店铺名称表失败,请重试");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ StoreName name = new StoreName();
|
|
|
+ PropertyUtils.copyProperties(name, siteCategoryInfoDTO);
|
|
|
+ StoreApply storeApply = storeApplyReadMapper.getByPrimaryKey(storeApplyDTO.getApplyId());
|
|
|
+ name.setStoreId(storeApply.getStoreId());
|
|
|
+ name.setStoreName(storeName);
|
|
|
+ name.setCreateId(vendor.getVendorId());
|
|
|
+ name.setCreateTime(new Date());
|
|
|
+ count = storeNameWriteMapper.insert(name);
|
|
|
+ if (count == 0) {
|
|
|
+ log.error("添加店铺名称表失败");
|
|
|
+ throw new MallException("添加店铺名称表失败,请重试");
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- //更新store_apply表
|
|
|
- StoreApply storeApply = storeApplyReadMapper.getByPrimaryKey(storeApplyDTO.getApplyId());
|
|
|
- PropertyUtils.copyProperties(storeApply, storeApplyDTO);
|
|
|
- storeApply.setStoreName(storeName);
|
|
|
- storeApply.setState(StoreConst.STATE_1_SEND_APPLY);
|
|
|
- storeApply.setSubmitTime(new Date());
|
|
|
+ }
|
|
|
|
|
|
- int count;
|
|
|
- count = storeApplyWriteMapper.updateByPrimaryKeySelective(storeApply);
|
|
|
- if (count == 0) {
|
|
|
- log.error("根据applyId:" + storeApply.getApplyId() + "更新商家申请表失败");
|
|
|
- throw new MallException("更新商家申请表失败,请重试");
|
|
|
+ }
|
|
|
}
|
|
|
+ StoreCertificate storeCertificate = storeCertificateReadMapper.getByPrimaryKey(storeApplyDTO.getCertificateId());
|
|
|
+ PropertyUtils.copyProperties(storeCertificate, storeApplyDTO);
|
|
|
+
|
|
|
|
|
|
//更新store_certificate表
|
|
|
storeCertificate.setCompanyName(companyName);
|
|
|
- count = storeCertificateWriteMapper.updateByPrimaryKeySelective(storeCertificate);
|
|
|
+ int count = storeCertificateWriteMapper.updateByPrimaryKeySelective(storeCertificate);
|
|
|
if (count == 0) {
|
|
|
log.error("根据certificateId:" + storeCertificate.getCertificateId() + "更新商家资质表失败");
|
|
|
throw new MallException("更新商家资质表失败,请重试");
|
|
@@ -260,31 +343,34 @@ public class StoreApplyModel {
|
|
|
storeBindCategoryExample.setCreateVendorId(vendor.getVendorId());
|
|
|
storeBindCategoryWriteMapper.deleteByExample(storeBindCategoryExample);
|
|
|
|
|
|
- StoreBindCategory storeBindCategory = new StoreBindCategory();
|
|
|
- storeBindCategory.setStoreId(0L);
|
|
|
- storeBindCategory.setCreateVendorId(vendor.getVendorId());
|
|
|
- storeBindCategory.setCreateTime(new Date());
|
|
|
- storeBindCategory.setState(StoreConst.STORE_CATEGORY_STATE_SEND);
|
|
|
-
|
|
|
- String[] split = storeApplyDTO.getGoodsCategoryIds().split(",");
|
|
|
- for (String goodsCategoryId : split) {
|
|
|
- String[] split1 = goodsCategoryId.split("-");
|
|
|
- storeBindCategory.setGoodsCategoryId1(Integer.parseInt(split1[0]));
|
|
|
- storeBindCategory.setGoodsCategoryId2(Integer.parseInt(split1[1]));
|
|
|
- storeBindCategory.setGoodsCategoryId3(Integer.parseInt(split1[2]));
|
|
|
- //根据一级分类id查询一级分类名称
|
|
|
- GoodsCategory goodsCategory1 = goodsCategoryReadMapper.getByPrimaryKey(split1[0]);
|
|
|
- //根据二级分类id查询二级分类名称
|
|
|
- GoodsCategory goodsCategory2 = goodsCategoryReadMapper.getByPrimaryKey(split1[1]);
|
|
|
- //根据三级分类id查询三级分类名称
|
|
|
- GoodsCategory goodsCategory3 = goodsCategoryReadMapper.getByPrimaryKey(split1[2]);
|
|
|
- //拼接类目组合名称
|
|
|
- String goodsCateName = goodsCategory1.getCategoryName() + ">" + goodsCategory2.getCategoryName() + ">" + goodsCategory3.getCategoryName();
|
|
|
- storeBindCategory.setGoodsCateName(goodsCateName);
|
|
|
- storeBindCategory.setScaling(goodsCategory3.getScaling());
|
|
|
- count = storeBindCategoryWriteMapper.insert(storeBindCategory);
|
|
|
- if (count == 0) {
|
|
|
- throw new MallException("店铺可用商品分类表添加失败,请重试");
|
|
|
+ for (StoreSiteCategoryInfoDTO siteCategoryInfoDTO : storeApplyDTO.getSiteInfoList()) {
|
|
|
+ StoreBindCategory storeBindCategory = new StoreBindCategory();
|
|
|
+ storeBindCategory.setStoreId(0L);
|
|
|
+ storeBindCategory.setWebSite(siteCategoryInfoDTO.getWebSite());
|
|
|
+ storeBindCategory.setCreateVendorId(vendor.getVendorId());
|
|
|
+ storeBindCategory.setCreateTime(new Date());
|
|
|
+ storeBindCategory.setState(StoreConst.STORE_CATEGORY_STATE_SEND);
|
|
|
+
|
|
|
+ String[] split = siteCategoryInfoDTO.getGoodsCategoryIds().split(",");
|
|
|
+ for (String goodsCategoryId : split) {
|
|
|
+ String[] split1 = goodsCategoryId.split("-");
|
|
|
+ storeBindCategory.setGoodsCategoryId1(Integer.parseInt(split1[0]));
|
|
|
+ storeBindCategory.setGoodsCategoryId2(Integer.parseInt(split1[1]));
|
|
|
+ storeBindCategory.setGoodsCategoryId3(Integer.parseInt(split1[2]));
|
|
|
+ //根据一级分类id查询一级分类名称
|
|
|
+ GoodsCategory goodsCategory1 = goodsCategoryReadMapper.getByPrimaryKey(split1[0]);
|
|
|
+ //根据二级分类id查询二级分类名称
|
|
|
+ GoodsCategory goodsCategory2 = goodsCategoryReadMapper.getByPrimaryKey(split1[1]);
|
|
|
+ //根据三级分类id查询三级分类名称
|
|
|
+ GoodsCategory goodsCategory3 = goodsCategoryReadMapper.getByPrimaryKey(split1[2]);
|
|
|
+ //拼接类目组合名称
|
|
|
+ String goodsCateName = goodsCategory1.getCategoryName() + ">" + goodsCategory2.getCategoryName() + ">" + goodsCategory3.getCategoryName();
|
|
|
+ storeBindCategory.setGoodsCateName(goodsCateName);
|
|
|
+ storeBindCategory.setScaling(goodsCategory3.getScaling());
|
|
|
+ count = storeBindCategoryWriteMapper.insert(storeBindCategory);
|
|
|
+ if (count == 0) {
|
|
|
+ throw new MallException("店铺可用商品分类表添加失败,请重试");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|