master:迁移内里材质属性调整;
parent
ad3e6512e9
commit
b5c0abc129
|
|
@ -145,18 +145,13 @@ public class FhbOtherBizAfterController extends BaseController {
|
||||||
|
|
||||||
Map<String, FhbProdVO.SMIVO> fhbProdMap = fhbProdList.stream().collect(Collectors.toMap(FhbProdVO.SMIVO::getArtNo, x -> x, (v1, v2) -> v2));
|
Map<String, FhbProdVO.SMIVO> fhbProdMap = fhbProdList.stream().collect(Collectors.toMap(FhbProdVO.SMIVO::getArtNo, x -> x, (v1, v2) -> v2));
|
||||||
// 找到枚举的 鞋面材质 和 鞋面内里材质
|
// 找到枚举的 鞋面材质 和 鞋面内里材质
|
||||||
List<SysDictData> attrList = Optional.ofNullable(this.dictDataMapper.selectList(new LambdaQueryWrapper<SysDictData>()
|
List<SysDictData> shaftMaterialList = Optional.ofNullable(this.dictDataMapper.selectList(new LambdaQueryWrapper<SysDictData>()
|
||||||
.in(SysDictData::getDictType, Arrays.asList(DICT_TYPE_SHAFT_MATERIAL, DICT_TYPE_SHOE_UPPER_LINING_MATERIAL))
|
.eq(SysDictData::getDictType, DICT_TYPE_SHAFT_MATERIAL).eq(SysDictData::getDelFlag, Constants.UNDELETED)))
|
||||||
.eq(SysDictData::getDelFlag, Constants.UNDELETED)))
|
.orElseThrow(() -> new ServiceException("系统枚举 鞋面材质 不存在!", HttpStatus.ERROR));
|
||||||
.orElseThrow(() -> new ServiceException("系统枚举 鞋面材质及鞋面内里材质 不存在!", HttpStatus.ERROR));
|
Map<String, String> shaftMaterialMap = shaftMaterialList.stream().collect(Collectors.toMap(SysDictData::getDictLabel, SysDictData::getDictValue));
|
||||||
Map<String, String> shaftMaterialMap = attrList.stream().filter(x -> Objects.equals(x.getDictType(), DICT_TYPE_SHAFT_MATERIAL))
|
|
||||||
.collect(Collectors.toMap(SysDictData::getDictLabel, SysDictData::getDictValue));
|
|
||||||
Map<String, String> shoeUpperLiningMaterialMap = attrList.stream().filter(x -> Objects.equals(x.getDictType(), DICT_TYPE_SHOE_UPPER_LINING_MATERIAL))
|
|
||||||
.collect(Collectors.toMap(SysDictData::getDictLabel, SysDictData::getDictValue));
|
|
||||||
List<StoreProductCategoryAttribute> prodCateAttrList = new ArrayList<>();
|
List<StoreProductCategoryAttribute> prodCateAttrList = new ArrayList<>();
|
||||||
List<StoreProductService> prodSvcList = new ArrayList<>();
|
List<StoreProductService> prodSvcList = new ArrayList<>();
|
||||||
Map<String, String> newShaftMaterialMap = new HashMap<>();
|
Map<String, String> newShaftMaterialMap = new HashMap<>();
|
||||||
Map<String, String> newShoeUpperLiningMaterialMap = new HashMap<>();
|
|
||||||
storeProdList.forEach(storeProd -> {
|
storeProdList.forEach(storeProd -> {
|
||||||
FhbProdVO.SMIVO fhbProdVO = Optional.ofNullable(fhbProdMap.get(storeProd.getProdArtNum()))
|
FhbProdVO.SMIVO fhbProdVO = Optional.ofNullable(fhbProdMap.get(storeProd.getProdArtNum()))
|
||||||
.orElseThrow(() -> new ServiceException("FHB独有商品,未找到FHB对应的商品!", HttpStatus.ERROR));
|
.orElseThrow(() -> new ServiceException("FHB独有商品,未找到FHB对应的商品!", HttpStatus.ERROR));
|
||||||
|
|
@ -164,31 +159,9 @@ public class FhbOtherBizAfterController extends BaseController {
|
||||||
if (StringUtils.isNotBlank(fhbProdVO.getOutStuff()) && !shaftMaterialMap.containsKey(fhbProdVO.getOutStuff())) {
|
if (StringUtils.isNotBlank(fhbProdVO.getOutStuff()) && !shaftMaterialMap.containsKey(fhbProdVO.getOutStuff())) {
|
||||||
newShaftMaterialMap.put(fhbProdVO.getOutStuff(), fhbProdVO.getOutStuff());
|
newShaftMaterialMap.put(fhbProdVO.getOutStuff(), fhbProdVO.getOutStuff());
|
||||||
}
|
}
|
||||||
if (StringUtils.isNotBlank(fhbProdVO.getInnerStuff()) && !shoeUpperLiningMaterialMap.containsKey(fhbProdVO.getInnerStuff())) {
|
// 只设置鞋面材质
|
||||||
newShoeUpperLiningMaterialMap.put(fhbProdVO.getInnerStuff(), fhbProdVO.getInnerStuff());
|
prodCateAttrList.add(new StoreProductCategoryAttribute().setStoreId(storeProd.getStoreId())
|
||||||
}
|
.setStoreProdId(storeProd.getId()).setShaftMaterial(fhbProdVO.getOutStuff()));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
|
|
||||||
// 只设置鞋面材质 和 鞋面内里材质
|
|
||||||
prodCateAttrList.add(new StoreProductCategoryAttribute().setStoreId(storeProd.getStoreId()).setStoreProdId(storeProd.getId())
|
|
||||||
.setShaftMaterial(fhbProdVO.getOutStuff()).setShoeUpperLiningMaterial(fhbProdVO.getInnerStuff()));
|
|
||||||
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 初始化商品服务承诺
|
// 初始化商品服务承诺
|
||||||
prodSvcList.add(new StoreProductService().setStoreProdId(storeProd.getId()).setCustomRefund("0")
|
prodSvcList.add(new StoreProductService().setStoreProdId(storeProd.getId()).setCustomRefund("0")
|
||||||
.setThirtyDayRefund("0").setOneBatchSale("1").setRefundWithinThreeDay("0"));
|
.setThirtyDayRefund("0").setOneBatchSale("1").setRefundWithinThreeDay("0"));
|
||||||
|
|
@ -197,10 +170,6 @@ public class FhbOtherBizAfterController extends BaseController {
|
||||||
if (MapUtils.isNotEmpty(newShaftMaterialMap)) {
|
if (MapUtils.isNotEmpty(newShaftMaterialMap)) {
|
||||||
newShaftMaterialMap.forEach((k, v) -> newDictDataList.add(new SysDictData().setDictLabel(k).setDictValue(k).setDictType(DICT_TYPE_SHAFT_MATERIAL).setStatus("0").setDictSort(100L)));
|
newShaftMaterialMap.forEach((k, v) -> newDictDataList.add(new SysDictData().setDictLabel(k).setDictValue(k).setDictType(DICT_TYPE_SHAFT_MATERIAL).setStatus("0").setDictSort(100L)));
|
||||||
}
|
}
|
||||||
if (MapUtils.isNotEmpty(newShoeUpperLiningMaterialMap)) {
|
|
||||||
newShoeUpperLiningMaterialMap.forEach((k, v) -> newDictDataList.add(new SysDictData().setDictLabel(k).setDictValue(k)
|
|
||||||
.setDictType(DICT_TYPE_SHOE_UPPER_LINING_MATERIAL).setStatus("0").setDictSort(100L)));
|
|
||||||
}
|
|
||||||
if (CollectionUtils.isNotEmpty(newDictDataList)) {
|
if (CollectionUtils.isNotEmpty(newDictDataList)) {
|
||||||
this.dictDataMapper.insert(newDictDataList);
|
this.dictDataMapper.insert(newDictDataList);
|
||||||
}
|
}
|
||||||
|
|
@ -252,9 +221,18 @@ public class FhbOtherBizAfterController extends BaseController {
|
||||||
throw new ServiceException("FHB cache 数据为空!", HttpStatus.ERROR);
|
throw new ServiceException("FHB cache 数据为空!", HttpStatus.ERROR);
|
||||||
}
|
}
|
||||||
Map<String, List<FhbProdVO.SMIVO>> fhbProdSkuMap = fhbProdList.stream().collect(Collectors.groupingBy(FhbProdVO.SMIVO::getArtNo));
|
Map<String, List<FhbProdVO.SMIVO>> fhbProdSkuMap = fhbProdList.stream().collect(Collectors.groupingBy(FhbProdVO.SMIVO::getArtNo));
|
||||||
|
|
||||||
|
// 找到枚举的 鞋面内里材质
|
||||||
|
List<SysDictData> shoeUpperLiningMaterialList = Optional.ofNullable(this.dictDataMapper.selectList(new LambdaQueryWrapper<SysDictData>()
|
||||||
|
.eq(SysDictData::getDictType, DICT_TYPE_SHOE_UPPER_LINING_MATERIAL).eq(SysDictData::getDelFlag, Constants.UNDELETED)))
|
||||||
|
.orElseThrow(() -> new ServiceException("系统枚举 鞋面内里材质 不存在!", HttpStatus.ERROR));
|
||||||
|
Map<String, String> shoeUpperLiningMaterialMap = shoeUpperLiningMaterialList.stream().collect(Collectors.toMap(SysDictData::getDictLabel, SysDictData::getDictValue));
|
||||||
|
|
||||||
// 商品所有颜色 尺码 颜色库存初始化
|
// 商品所有颜色 尺码 颜色库存初始化
|
||||||
List<StoreProductColor> prodColorList = new ArrayList<>();
|
List<StoreProductColor> prodColorList = new ArrayList<>();
|
||||||
List<StoreProductColorSize> prodColorSizeList = new ArrayList<>();
|
List<StoreProductColorSize> prodColorSizeList = new ArrayList<>();
|
||||||
|
List<SysDictData> newDictDataList = new ArrayList<>();
|
||||||
|
Map<String, String> newShoeUpperLiningMaterialMap = new HashMap<>();
|
||||||
storeProdList.forEach(storeProd -> {
|
storeProdList.forEach(storeProd -> {
|
||||||
Optional.ofNullable(fhbAfterArtNumGroupMap.get(storeProd.getProdArtNum()))
|
Optional.ofNullable(fhbAfterArtNumGroupMap.get(storeProd.getProdArtNum()))
|
||||||
.orElseThrow(() -> new ServiceException("没有FHB[独有]商品货号!" + storeProd.getProdArtNum(), HttpStatus.ERROR));
|
.orElseThrow(() -> new ServiceException("没有FHB[独有]商品货号!" + storeProd.getProdArtNum(), HttpStatus.ERROR));
|
||||||
|
|
@ -263,11 +241,15 @@ public class FhbOtherBizAfterController extends BaseController {
|
||||||
.map(fhbProdSkuMap::get).filter(Objects::nonNull).flatMap(List::stream).collect(Collectors.toList());
|
.map(fhbProdSkuMap::get).filter(Objects::nonNull).flatMap(List::stream).collect(Collectors.toList());
|
||||||
AtomicInteger orderNum = new AtomicInteger();
|
AtomicInteger orderNum = new AtomicInteger();
|
||||||
fhbMatchColorList.forEach(fhbProdColor -> {
|
fhbMatchColorList.forEach(fhbProdColor -> {
|
||||||
|
// 处理内里材质,若步橘没有的,则需要新增
|
||||||
|
if (StringUtils.isNotBlank(fhbProdColor.getInnerStuff()) && !shoeUpperLiningMaterialMap.containsKey(fhbProdColor.getInnerStuff())) {
|
||||||
|
newShoeUpperLiningMaterialMap.put(fhbProdColor.getInnerStuff(), fhbProdColor.getInnerStuff());
|
||||||
|
}
|
||||||
StoreColor storeColor = Optional.ofNullable(storeColorMap.get(fhbProdColor.getColor()))
|
StoreColor storeColor = Optional.ofNullable(storeColorMap.get(fhbProdColor.getColor()))
|
||||||
.orElseThrow(() -> new ServiceException("没有FHB[独有]商品颜色!" + storeProd.getProdArtNum(), HttpStatus.ERROR));
|
.orElseThrow(() -> new ServiceException("没有FHB[独有]商品颜色!" + storeProd.getProdArtNum(), HttpStatus.ERROR));
|
||||||
// 该商品的颜色
|
// 该商品的颜色
|
||||||
prodColorList.add(new StoreProductColor().setStoreId(storeProd.getStoreId()).setStoreProdId(storeProd.getId()).setOrderNum(orderNum.addAndGet(1))
|
prodColorList.add(new StoreProductColor().setStoreId(storeProd.getStoreId()).setStoreProdId(storeProd.getId()).setOrderNum(orderNum.addAndGet(1))
|
||||||
.setColorName(storeColor.getColorName()).setStoreColorId(storeColor.getId()).setProdStatus(EProductStatus.ON_SALE.getValue()));
|
.setColorName(storeColor.getColorName()).setShoeUpperLiningMaterial(fhbProdColor.getInnerStuff()).setStoreColorId(storeColor.getId()).setProdStatus(EProductStatus.ON_SALE.getValue()));
|
||||||
// 该颜色最低价格
|
// 该颜色最低价格
|
||||||
BigDecimal minPrice = ObjectUtils.defaultIfNull(fhbProdColor.getSalePrice(), BigDecimal.ZERO);
|
BigDecimal minPrice = ObjectUtils.defaultIfNull(fhbProdColor.getSalePrice(), BigDecimal.ZERO);
|
||||||
List<Integer> standardSizeList = StrUtil.split(fhbProdColor.getSize(), ",").stream().map(Integer::parseInt).collect(Collectors.toList());
|
List<Integer> standardSizeList = StrUtil.split(fhbProdColor.getSize(), ",").stream().map(Integer::parseInt).collect(Collectors.toList());
|
||||||
|
|
@ -285,6 +267,14 @@ public class FhbOtherBizAfterController extends BaseController {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 处理新增的 内里材质 枚举
|
||||||
|
if (MapUtils.isNotEmpty(newShoeUpperLiningMaterialMap)) {
|
||||||
|
newShoeUpperLiningMaterialMap.forEach((k, v) -> newDictDataList.add(new SysDictData().setDictLabel(k).setDictValue(k)
|
||||||
|
.setDictType(DICT_TYPE_SHOE_UPPER_LINING_MATERIAL).setStatus("0").setDictSort(100L)));
|
||||||
|
this.dictDataMapper.insert(newDictDataList);
|
||||||
|
}
|
||||||
|
|
||||||
// 插入商品颜色及颜色对应的尺码,档口服务承诺
|
// 插入商品颜色及颜色对应的尺码,档口服务承诺
|
||||||
this.prodColorMapper.insert(prodColorList);
|
this.prodColorMapper.insert(prodColorList);
|
||||||
// 按照货号颜色尺码升序排列
|
// 按照货号颜色尺码升序排列
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import com.ruoyi.common.constant.Constants;
|
||||||
import com.ruoyi.common.constant.HttpStatus;
|
import com.ruoyi.common.constant.HttpStatus;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.common.core.domain.R;
|
||||||
|
import com.ruoyi.common.core.domain.entity.SysDictData;
|
||||||
import com.ruoyi.common.core.redis.RedisCache;
|
import com.ruoyi.common.core.redis.RedisCache;
|
||||||
import com.ruoyi.common.exception.ServiceException;
|
import com.ruoyi.common.exception.ServiceException;
|
||||||
import com.ruoyi.common.utils.DateUtils;
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
|
|
@ -16,14 +17,15 @@ import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
import com.ruoyi.framework.es.EsClientWrapper;
|
import com.ruoyi.framework.es.EsClientWrapper;
|
||||||
import com.ruoyi.framework.notice.fs.FsNotice;
|
import com.ruoyi.framework.notice.fs.FsNotice;
|
||||||
import com.ruoyi.web.controller.xkt.migartion.vo.gtAndFhb.GtAndFHBCompareDownloadVO;
|
import com.ruoyi.system.mapper.SysDictDataMapper;
|
||||||
import com.ruoyi.web.controller.xkt.migartion.vo.gtAndFhb.GtAndFHBInitVO;
|
|
||||||
import com.ruoyi.web.controller.xkt.migartion.vo.fhb.FhbCusDiscountVO;
|
import com.ruoyi.web.controller.xkt.migartion.vo.fhb.FhbCusDiscountVO;
|
||||||
import com.ruoyi.web.controller.xkt.migartion.vo.fhb.FhbCusVO;
|
import com.ruoyi.web.controller.xkt.migartion.vo.fhb.FhbCusVO;
|
||||||
import com.ruoyi.web.controller.xkt.migartion.vo.fhb.FhbProdStockVO;
|
import com.ruoyi.web.controller.xkt.migartion.vo.fhb.FhbProdStockVO;
|
||||||
import com.ruoyi.web.controller.xkt.migartion.vo.fhb.FhbProdVO;
|
import com.ruoyi.web.controller.xkt.migartion.vo.fhb.FhbProdVO;
|
||||||
import com.ruoyi.web.controller.xkt.migartion.vo.gt.GtCateVO;
|
import com.ruoyi.web.controller.xkt.migartion.vo.gt.GtCateVO;
|
||||||
import com.ruoyi.web.controller.xkt.migartion.vo.gt.GtProdSkuVO;
|
import com.ruoyi.web.controller.xkt.migartion.vo.gt.GtProdSkuVO;
|
||||||
|
import com.ruoyi.web.controller.xkt.migartion.vo.gtAndFhb.GtAndFHBCompareDownloadVO;
|
||||||
|
import com.ruoyi.web.controller.xkt.migartion.vo.gtAndFhb.GtAndFHBInitVO;
|
||||||
import com.ruoyi.xkt.domain.*;
|
import com.ruoyi.xkt.domain.*;
|
||||||
import com.ruoyi.xkt.dto.es.ESProductDTO;
|
import com.ruoyi.xkt.dto.es.ESProductDTO;
|
||||||
import com.ruoyi.xkt.dto.storeProdColorPrice.StoreProdMinPriceDTO;
|
import com.ruoyi.xkt.dto.storeProdColorPrice.StoreProdMinPriceDTO;
|
||||||
|
|
@ -81,6 +83,10 @@ public class GtAndFhbBizController extends BaseController {
|
||||||
final EsClientWrapper esClientWrapper;
|
final EsClientWrapper esClientWrapper;
|
||||||
final IPictureService pictureService;
|
final IPictureService pictureService;
|
||||||
final FsNotice fsNotice;
|
final FsNotice fsNotice;
|
||||||
|
final SysDictDataMapper dictDataMapper;
|
||||||
|
|
||||||
|
// 系统枚举 鞋面内里材质
|
||||||
|
private static final String DICT_TYPE_SHOE_UPPER_LINING_MATERIAL = "shoe_upper_lining_material";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* step1
|
* step1
|
||||||
|
|
@ -384,9 +390,17 @@ public class GtAndFhbBizController extends BaseController {
|
||||||
// gt按照货号分组
|
// gt按照货号分组
|
||||||
Map<String, List<GtProdSkuVO>> gtSaleGroupMap = gtSaleBasicList.stream().collect(Collectors.groupingBy(GtProdSkuVO::getArticle_number));
|
Map<String, List<GtProdSkuVO>> gtSaleGroupMap = gtSaleBasicList.stream().collect(Collectors.groupingBy(GtProdSkuVO::getArticle_number));
|
||||||
|
|
||||||
|
// 找到枚举的 鞋面内里材质
|
||||||
|
List<SysDictData> shoeUpperLiningMaterialList = Optional.ofNullable(this.dictDataMapper.selectList(new LambdaQueryWrapper<SysDictData>()
|
||||||
|
.eq(SysDictData::getDictType, DICT_TYPE_SHOE_UPPER_LINING_MATERIAL).eq(SysDictData::getDelFlag, Constants.UNDELETED)))
|
||||||
|
.orElseThrow(() -> new ServiceException("系统枚举 鞋面内里材质 不存在!", HttpStatus.ERROR));
|
||||||
|
Map<String, String> shoeUpperLiningMaterialMap = shoeUpperLiningMaterialList.stream().collect(Collectors.toMap(SysDictData::getDictLabel, SysDictData::getDictValue));
|
||||||
|
|
||||||
// 商品所有颜色 尺码 颜色库存初始化
|
// 商品所有颜色 尺码 颜色库存初始化
|
||||||
List<StoreProductColor> prodColorList = new ArrayList<>();
|
List<StoreProductColor> prodColorList = new ArrayList<>();
|
||||||
List<StoreProductColorSize> prodColorSizeList = new ArrayList<>();
|
List<StoreProductColorSize> prodColorSizeList = new ArrayList<>();
|
||||||
|
List<SysDictData> newDictDataList = new ArrayList<>();
|
||||||
|
Map<String, String> newShoeUpperLiningMaterialMap = new HashMap<>();
|
||||||
storeProdList.forEach(storeProd -> {
|
storeProdList.forEach(storeProd -> {
|
||||||
// 获取clearArtNo
|
// 获取clearArtNo
|
||||||
String clearArtNo = this.extractCoreArticleNumber(storeProd.getProdArtNum());
|
String clearArtNo = this.extractCoreArticleNumber(storeProd.getProdArtNum());
|
||||||
|
|
@ -402,9 +416,14 @@ public class GtAndFhbBizController extends BaseController {
|
||||||
for (FhbProdVO.SMIVO smivo : fhbMatchSkuList) {
|
for (FhbProdVO.SMIVO smivo : fhbMatchSkuList) {
|
||||||
StoreColor storeColor = Optional.ofNullable(storeColorMap.get(smivo.getColor()))
|
StoreColor storeColor = Optional.ofNullable(storeColorMap.get(smivo.getColor()))
|
||||||
.orElseThrow(() -> new ServiceException("没有FHB商品颜色!" + fhbArtNo, HttpStatus.ERROR));
|
.orElseThrow(() -> new ServiceException("没有FHB商品颜色!" + fhbArtNo, HttpStatus.ERROR));
|
||||||
|
// 处理内里材质,若步橘没有的,则需要新增
|
||||||
|
if (org.apache.commons.lang3.StringUtils.isNotBlank(smivo.getInnerStuff()) && !shoeUpperLiningMaterialMap.containsKey(smivo.getInnerStuff())) {
|
||||||
|
newShoeUpperLiningMaterialMap.put(smivo.getInnerStuff(), smivo.getInnerStuff());
|
||||||
|
}
|
||||||
// 该商品的颜色
|
// 该商品的颜色
|
||||||
prodColorList.add(new StoreProductColor().setStoreId(storeProd.getStoreId()).setStoreProdId(storeProd.getId()).setOrderNum(orderNum.addAndGet(1))
|
prodColorList.add(new StoreProductColor().setStoreId(storeProd.getStoreId()).setStoreProdId(storeProd.getId())
|
||||||
.setColorName(storeColor.getColorName()).setStoreColorId(storeColor.getId()).setProdStatus(EProductStatus.ON_SALE.getValue()));
|
.setOrderNum(orderNum.addAndGet(1)).setColorName(storeColor.getColorName()).setShoeUpperLiningMaterial(smivo.getInnerStuff())
|
||||||
|
.setStoreColorId(storeColor.getId()).setProdStatus(EProductStatus.ON_SALE.getValue()));
|
||||||
// 该颜色所有的尺码
|
// 该颜色所有的尺码
|
||||||
for (int j = 0; j < Constants.SIZE_LIST.size(); j++) {
|
for (int j = 0; j < Constants.SIZE_LIST.size(); j++) {
|
||||||
// FHB系统条码前缀
|
// FHB系统条码前缀
|
||||||
|
|
@ -420,6 +439,14 @@ public class GtAndFhbBizController extends BaseController {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 处理新增的 内里材质 枚举
|
||||||
|
if (MapUtils.isNotEmpty(newShoeUpperLiningMaterialMap)) {
|
||||||
|
newShoeUpperLiningMaterialMap.forEach((k, v) -> newDictDataList.add(new SysDictData().setDictLabel(k).setDictValue(k)
|
||||||
|
.setDictType(DICT_TYPE_SHOE_UPPER_LINING_MATERIAL).setStatus("0").setDictSort(100L)));
|
||||||
|
this.dictDataMapper.insert(newDictDataList);
|
||||||
|
}
|
||||||
|
|
||||||
// 插入商品颜色及颜色对应的尺码,档口服务承诺
|
// 插入商品颜色及颜色对应的尺码,档口服务承诺
|
||||||
this.prodColorMapper.insert(prodColorList);
|
this.prodColorMapper.insert(prodColorList);
|
||||||
prodColorSizeList.sort(Comparator.comparing(StoreProductColorSize::getStoreProdId).thenComparing(StoreProductColorSize::getSize));
|
prodColorSizeList.sort(Comparator.comparing(StoreProductColorSize::getStoreProdId).thenComparing(StoreProductColorSize::getSize));
|
||||||
|
|
@ -736,51 +763,6 @@ public class GtAndFhbBizController extends BaseController {
|
||||||
String shaftMaterialAttr = attrMap.get(Constants.SHAFT_MATERIAL_NAME);
|
String shaftMaterialAttr = attrMap.get(Constants.SHAFT_MATERIAL_NAME);
|
||||||
prodAttr.setShaftMaterial(org.apache.commons.lang3.StringUtils.isEmpty(shaftMaterialAttr) ? attrMap.get(Constants.UPPER_MATERIAL_NAME) : shaftMaterialAttr);
|
prodAttr.setShaftMaterial(org.apache.commons.lang3.StringUtils.isEmpty(shaftMaterialAttr) ? attrMap.get(Constants.UPPER_MATERIAL_NAME) : shaftMaterialAttr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
// 4. 鞋面内里材质
|
|
||||||
if (attrMap.containsKey(Constants.SHOE_UPPER_LINING_MATERIAL_NAME)) {
|
|
||||||
// 先找鞋面内里材质,为空 则 再找 内里材质,为空则再找 里料材质
|
|
||||||
String shoeUpperLiningMaterialAttr = attrMap.get(Constants.SHOE_UPPER_LINING_MATERIAL_NAME);
|
|
||||||
if (org.apache.commons.lang3.StringUtils.isEmpty(shoeUpperLiningMaterialAttr)) {
|
|
||||||
shoeUpperLiningMaterialAttr = attrMap.get(Constants.INNER_MATERIAL);
|
|
||||||
if (org.apache.commons.lang3.StringUtils.isEmpty(shoeUpperLiningMaterialAttr)) {
|
|
||||||
shoeUpperLiningMaterialAttr = attrMap.get(Constants.OUTER_MATERIAL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
prodAttr.setShoeUpperLiningMaterial(shoeUpperLiningMaterialAttr);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 5. 靴款品名
|
// 5. 靴款品名
|
||||||
if (attrMap.containsKey(Constants.SHOE_STYLE_NAME_NAME)) {
|
if (attrMap.containsKey(Constants.SHOE_STYLE_NAME_NAME)) {
|
||||||
prodAttr.setShoeStyleName(attrMap.get(Constants.SHOE_STYLE_NAME_NAME));
|
prodAttr.setShoeStyleName(attrMap.get(Constants.SHOE_STYLE_NAME_NAME));
|
||||||
|
|
|
||||||
|
|
@ -9,12 +9,14 @@ import com.ruoyi.common.constant.Constants;
|
||||||
import com.ruoyi.common.constant.HttpStatus;
|
import com.ruoyi.common.constant.HttpStatus;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.common.core.domain.R;
|
||||||
|
import com.ruoyi.common.core.domain.entity.SysDictData;
|
||||||
import com.ruoyi.common.core.redis.RedisCache;
|
import com.ruoyi.common.core.redis.RedisCache;
|
||||||
import com.ruoyi.common.exception.ServiceException;
|
import com.ruoyi.common.exception.ServiceException;
|
||||||
import com.ruoyi.common.utils.DateUtils;
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
import com.ruoyi.framework.es.EsClientWrapper;
|
import com.ruoyi.framework.es.EsClientWrapper;
|
||||||
import com.ruoyi.framework.notice.fs.FsNotice;
|
import com.ruoyi.framework.notice.fs.FsNotice;
|
||||||
|
import com.ruoyi.system.mapper.SysDictDataMapper;
|
||||||
import com.ruoyi.web.controller.xkt.migartion.vo.gt.GtCateVO;
|
import com.ruoyi.web.controller.xkt.migartion.vo.gt.GtCateVO;
|
||||||
import com.ruoyi.web.controller.xkt.migartion.vo.gt.GtProdSkuVO;
|
import com.ruoyi.web.controller.xkt.migartion.vo.gt.GtProdSkuVO;
|
||||||
import com.ruoyi.web.controller.xkt.migartion.vo.gtAndTy.GtAndTYCompareDownloadVO;
|
import com.ruoyi.web.controller.xkt.migartion.vo.gtAndTy.GtAndTYCompareDownloadVO;
|
||||||
|
|
@ -76,6 +78,10 @@ public class GtAndTyBiz2Controller extends BaseController {
|
||||||
final SysProductCategoryMapper prodCateMapper;
|
final SysProductCategoryMapper prodCateMapper;
|
||||||
final EsClientWrapper esClientWrapper;
|
final EsClientWrapper esClientWrapper;
|
||||||
final FsNotice fsNotice;
|
final FsNotice fsNotice;
|
||||||
|
final SysDictDataMapper dictDataMapper;
|
||||||
|
|
||||||
|
// 系统枚举 鞋面内里材质
|
||||||
|
private static final String DICT_TYPE_SHOE_UPPER_LINING_MATERIAL = "shoe_upper_lining_material";
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -302,9 +308,17 @@ public class GtAndTyBiz2Controller extends BaseController {
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
// 找到枚举的 鞋面内里材质
|
||||||
|
List<SysDictData> shoeUpperLiningMaterialList = Optional.ofNullable(this.dictDataMapper.selectList(new LambdaQueryWrapper<SysDictData>()
|
||||||
|
.eq(SysDictData::getDictType, DICT_TYPE_SHOE_UPPER_LINING_MATERIAL).eq(SysDictData::getDelFlag, Constants.UNDELETED)))
|
||||||
|
.orElseThrow(() -> new ServiceException("系统枚举 鞋面内里材质 不存在!", HttpStatus.ERROR));
|
||||||
|
Map<String, String> shoeUpperLiningMaterialMap = shoeUpperLiningMaterialList.stream().collect(Collectors.toMap(SysDictData::getDictLabel, SysDictData::getDictValue));
|
||||||
|
|
||||||
// 商品所有颜色 尺码 颜色库存初始化
|
// 商品所有颜色 尺码 颜色库存初始化
|
||||||
List<StoreProductColor> prodColorList = new ArrayList<>();
|
List<StoreProductColor> prodColorList = new ArrayList<>();
|
||||||
List<StoreProductColorSize> prodColorSizeList = new ArrayList<>();
|
List<StoreProductColorSize> prodColorSizeList = new ArrayList<>();
|
||||||
|
List<SysDictData> newDictDataList = new ArrayList<>();
|
||||||
|
Map<String, String> newShoeUpperLiningMaterialMap = new HashMap<>();
|
||||||
storeProdList.forEach(storeProd -> {
|
storeProdList.forEach(storeProd -> {
|
||||||
// TY匹配的货号
|
// TY匹配的货号
|
||||||
List<String> tyMatchArtNoList = gtMatchTyArtNoMap.get(storeProd.getProdArtNum());
|
List<String> tyMatchArtNoList = gtMatchTyArtNoMap.get(storeProd.getProdArtNum());
|
||||||
|
|
@ -318,9 +332,14 @@ public class GtAndTyBiz2Controller extends BaseController {
|
||||||
for (TyProdImportVO tyProdImportVO : tyMatchSkuList) {
|
for (TyProdImportVO tyProdImportVO : tyMatchSkuList) {
|
||||||
StoreColor storeColor = Optional.ofNullable(storeColorMap.get(tyProdImportVO.getColorName()))
|
StoreColor storeColor = Optional.ofNullable(storeColorMap.get(tyProdImportVO.getColorName()))
|
||||||
.orElseThrow(() -> new ServiceException("没有TY商品颜色!" + tyArtNo, HttpStatus.ERROR));
|
.orElseThrow(() -> new ServiceException("没有TY商品颜色!" + tyArtNo, HttpStatus.ERROR));
|
||||||
|
// 处理内里材质,若步橘没有的,则需要新增
|
||||||
|
if (StringUtils.isNotBlank(tyProdImportVO.getShoeUpperLiningMaterial()) && !shoeUpperLiningMaterialMap.containsKey(tyProdImportVO.getShoeUpperLiningMaterial())) {
|
||||||
|
newShoeUpperLiningMaterialMap.put(tyProdImportVO.getShoeUpperLiningMaterial(), tyProdImportVO.getShoeUpperLiningMaterial());
|
||||||
|
}
|
||||||
// 该商品的颜色
|
// 该商品的颜色
|
||||||
prodColorList.add(new StoreProductColor().setStoreId(storeProd.getStoreId()).setStoreProdId(storeProd.getId()).setOrderNum(orderNum.addAndGet(1))
|
prodColorList.add(new StoreProductColor().setStoreId(storeProd.getStoreId()).setStoreProdId(storeProd.getId()).setOrderNum(orderNum.addAndGet(1))
|
||||||
.setColorName(storeColor.getColorName()).setStoreColorId(storeColor.getId()).setProdStatus(EProductStatus.ON_SALE.getValue()));
|
.setShoeUpperLiningMaterial(tyProdImportVO.getShoeUpperLiningMaterial()).setColorName(storeColor.getColorName())
|
||||||
|
.setStoreColorId(storeColor.getId()).setProdStatus(EProductStatus.ON_SALE.getValue()));
|
||||||
// 该颜色所有的尺码
|
// 该颜色所有的尺码
|
||||||
for (int j = 0; j < Constants.SIZE_LIST.size(); j++) {
|
for (int j = 0; j < Constants.SIZE_LIST.size(); j++) {
|
||||||
// TY系统条码前缀
|
// TY系统条码前缀
|
||||||
|
|
@ -334,6 +353,14 @@ public class GtAndTyBiz2Controller extends BaseController {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 处理新增的 内里材质 枚举
|
||||||
|
if (MapUtils.isNotEmpty(newShoeUpperLiningMaterialMap)) {
|
||||||
|
newShoeUpperLiningMaterialMap.forEach((k, v) -> newDictDataList.add(new SysDictData().setDictLabel(k).setDictValue(k)
|
||||||
|
.setDictType(DICT_TYPE_SHOE_UPPER_LINING_MATERIAL).setStatus("0").setDictSort(100L)));
|
||||||
|
this.dictDataMapper.insert(newDictDataList);
|
||||||
|
}
|
||||||
|
|
||||||
// 插入商品颜色及颜色对应的尺码,档口服务承诺
|
// 插入商品颜色及颜色对应的尺码,档口服务承诺
|
||||||
this.prodColorMapper.insert(prodColorList);
|
this.prodColorMapper.insert(prodColorList);
|
||||||
prodColorSizeList.sort(Comparator.comparing(StoreProductColorSize::getStoreProdId).thenComparing(StoreProductColorSize::getSize));
|
prodColorSizeList.sort(Comparator.comparing(StoreProductColorSize::getStoreProdId).thenComparing(StoreProductColorSize::getSize));
|
||||||
|
|
@ -656,43 +683,6 @@ public class GtAndTyBiz2Controller extends BaseController {
|
||||||
String shaftMaterialAttr = attrMap.get(Constants.SHAFT_MATERIAL_NAME);
|
String shaftMaterialAttr = attrMap.get(Constants.SHAFT_MATERIAL_NAME);
|
||||||
prodAttr.setShaftMaterial(StringUtils.isEmpty(shaftMaterialAttr) ? attrMap.get(Constants.UPPER_MATERIAL_NAME) : shaftMaterialAttr);
|
prodAttr.setShaftMaterial(StringUtils.isEmpty(shaftMaterialAttr) ? attrMap.get(Constants.UPPER_MATERIAL_NAME) : shaftMaterialAttr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
// 4. 鞋面内里材质
|
|
||||||
if (attrMap.containsKey(Constants.SHOE_UPPER_LINING_MATERIAL_NAME)) {
|
|
||||||
// 先找鞋面内里材质,为空 则 再找 内里材质,为空则再找 里料材质
|
|
||||||
String shoeUpperLiningMaterialAttr = attrMap.get(Constants.SHOE_UPPER_LINING_MATERIAL_NAME);
|
|
||||||
if (StringUtils.isEmpty(shoeUpperLiningMaterialAttr)) {
|
|
||||||
shoeUpperLiningMaterialAttr = attrMap.get(Constants.INNER_MATERIAL);
|
|
||||||
if (StringUtils.isEmpty(shoeUpperLiningMaterialAttr)) {
|
|
||||||
shoeUpperLiningMaterialAttr = attrMap.get(Constants.OUTER_MATERIAL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
prodAttr.setShoeUpperLiningMaterial(shoeUpperLiningMaterialAttr);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 5. 靴款品名
|
// 5. 靴款品名
|
||||||
if (attrMap.containsKey(Constants.SHOE_STYLE_NAME_NAME)) {
|
if (attrMap.containsKey(Constants.SHOE_STYLE_NAME_NAME)) {
|
||||||
prodAttr.setShoeStyleName(attrMap.get(Constants.SHOE_STYLE_NAME_NAME));
|
prodAttr.setShoeStyleName(attrMap.get(Constants.SHOE_STYLE_NAME_NAME));
|
||||||
|
|
|
||||||
|
|
@ -9,17 +9,18 @@ import com.ruoyi.common.constant.Constants;
|
||||||
import com.ruoyi.common.constant.HttpStatus;
|
import com.ruoyi.common.constant.HttpStatus;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.common.core.domain.R;
|
||||||
|
import com.ruoyi.common.core.domain.entity.SysDictData;
|
||||||
import com.ruoyi.common.core.redis.RedisCache;
|
import com.ruoyi.common.core.redis.RedisCache;
|
||||||
import com.ruoyi.common.exception.ServiceException;
|
import com.ruoyi.common.exception.ServiceException;
|
||||||
import com.ruoyi.common.utils.DateUtils;
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
import com.ruoyi.framework.es.EsClientWrapper;
|
import com.ruoyi.framework.es.EsClientWrapper;
|
||||||
import com.ruoyi.framework.notice.fs.FsNotice;
|
import com.ruoyi.framework.notice.fs.FsNotice;
|
||||||
import com.ruoyi.web.controller.xkt.migartion.vo.gtAndTy.GtAndTYCompareDownloadVO;
|
import com.ruoyi.system.mapper.SysDictDataMapper;
|
||||||
import com.ruoyi.web.controller.xkt.migartion.vo.gtAndTy.GtAndTYInitVO;
|
|
||||||
import com.ruoyi.web.controller.xkt.migartion.vo.gt.GtCateVO;
|
import com.ruoyi.web.controller.xkt.migartion.vo.gt.GtCateVO;
|
||||||
import com.ruoyi.web.controller.xkt.migartion.vo.gt.GtProdSkuVO;
|
import com.ruoyi.web.controller.xkt.migartion.vo.gt.GtProdSkuVO;
|
||||||
|
import com.ruoyi.web.controller.xkt.migartion.vo.gtAndTy.GtAndTYCompareDownloadVO;
|
||||||
|
import com.ruoyi.web.controller.xkt.migartion.vo.gtAndTy.GtAndTYInitVO;
|
||||||
import com.ruoyi.web.controller.xkt.migartion.vo.ty.TyCusDiscImportVO;
|
import com.ruoyi.web.controller.xkt.migartion.vo.ty.TyCusDiscImportVO;
|
||||||
import com.ruoyi.web.controller.xkt.migartion.vo.ty.TyCusImportVO;
|
import com.ruoyi.web.controller.xkt.migartion.vo.ty.TyCusImportVO;
|
||||||
import com.ruoyi.web.controller.xkt.migartion.vo.ty.TyProdImportVO;
|
import com.ruoyi.web.controller.xkt.migartion.vo.ty.TyProdImportVO;
|
||||||
|
|
@ -35,6 +36,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.collections4.MapUtils;
|
import org.apache.commons.collections4.MapUtils;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
@ -76,6 +78,10 @@ public class GtAndTyBizController extends BaseController {
|
||||||
final SysProductCategoryMapper prodCateMapper;
|
final SysProductCategoryMapper prodCateMapper;
|
||||||
final EsClientWrapper esClientWrapper;
|
final EsClientWrapper esClientWrapper;
|
||||||
final FsNotice fsNotice;
|
final FsNotice fsNotice;
|
||||||
|
final SysDictDataMapper dictDataMapper;
|
||||||
|
|
||||||
|
// 系统枚举 鞋面内里材质
|
||||||
|
private static final String DICT_TYPE_SHOE_UPPER_LINING_MATERIAL = "shoe_upper_lining_material";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* step1
|
* step1
|
||||||
|
|
@ -348,9 +354,17 @@ public class GtAndTyBizController extends BaseController {
|
||||||
// gt按照货号分组
|
// gt按照货号分组
|
||||||
Map<String, List<GtProdSkuVO>> gtSaleGroupMap = gtSaleBasicList.stream().collect(Collectors.groupingBy(GtProdSkuVO::getArticle_number));
|
Map<String, List<GtProdSkuVO>> gtSaleGroupMap = gtSaleBasicList.stream().collect(Collectors.groupingBy(GtProdSkuVO::getArticle_number));
|
||||||
|
|
||||||
|
// 找到枚举的 鞋面内里材质
|
||||||
|
List<SysDictData> shoeUpperLiningMaterialList = Optional.ofNullable(this.dictDataMapper.selectList(new LambdaQueryWrapper<SysDictData>()
|
||||||
|
.eq(SysDictData::getDictType, DICT_TYPE_SHOE_UPPER_LINING_MATERIAL).eq(SysDictData::getDelFlag, Constants.UNDELETED)))
|
||||||
|
.orElseThrow(() -> new ServiceException("系统枚举 鞋面内里材质 不存在!", HttpStatus.ERROR));
|
||||||
|
Map<String, String> shoeUpperLiningMaterialMap = shoeUpperLiningMaterialList.stream().collect(Collectors.toMap(SysDictData::getDictLabel, SysDictData::getDictValue));
|
||||||
|
|
||||||
// 商品所有颜色 尺码 颜色库存初始化
|
// 商品所有颜色 尺码 颜色库存初始化
|
||||||
List<StoreProductColor> prodColorList = new ArrayList<>();
|
List<StoreProductColor> prodColorList = new ArrayList<>();
|
||||||
List<StoreProductColorSize> prodColorSizeList = new ArrayList<>();
|
List<StoreProductColorSize> prodColorSizeList = new ArrayList<>();
|
||||||
|
List<SysDictData> newDictDataList = new ArrayList<>();
|
||||||
|
Map<String, String> newShoeUpperLiningMaterialMap = new HashMap<>();
|
||||||
storeProdList.forEach(storeProd -> {
|
storeProdList.forEach(storeProd -> {
|
||||||
// 取clearArtNo
|
// 取clearArtNo
|
||||||
String clearArtNo = this.extractCoreArticleNumber(storeProd.getProdArtNum());
|
String clearArtNo = this.extractCoreArticleNumber(storeProd.getProdArtNum());
|
||||||
|
|
@ -366,9 +380,14 @@ public class GtAndTyBizController extends BaseController {
|
||||||
for (TyProdImportVO tyProdImportVO : tyMatchSkuList) {
|
for (TyProdImportVO tyProdImportVO : tyMatchSkuList) {
|
||||||
StoreColor storeColor = Optional.ofNullable(storeColorMap.get(tyProdImportVO.getColorName()))
|
StoreColor storeColor = Optional.ofNullable(storeColorMap.get(tyProdImportVO.getColorName()))
|
||||||
.orElseThrow(() -> new ServiceException("没有TY商品颜色!" + tyArtNo, HttpStatus.ERROR));
|
.orElseThrow(() -> new ServiceException("没有TY商品颜色!" + tyArtNo, HttpStatus.ERROR));
|
||||||
|
// 处理内里材质,若步橘没有的,则需要新增
|
||||||
|
if (StringUtils.isNotBlank(tyProdImportVO.getShoeUpperLiningMaterial()) && !shoeUpperLiningMaterialMap.containsKey(tyProdImportVO.getShoeUpperLiningMaterial())) {
|
||||||
|
newShoeUpperLiningMaterialMap.put(tyProdImportVO.getShoeUpperLiningMaterial(), tyProdImportVO.getShoeUpperLiningMaterial());
|
||||||
|
}
|
||||||
// 该商品的颜色
|
// 该商品的颜色
|
||||||
prodColorList.add(new StoreProductColor().setStoreId(storeProd.getStoreId()).setStoreProdId(storeProd.getId()).setOrderNum(orderNum.addAndGet(1))
|
prodColorList.add(new StoreProductColor().setStoreId(storeProd.getStoreId()).setStoreProdId(storeProd.getId()).setOrderNum(orderNum.addAndGet(1))
|
||||||
.setColorName(storeColor.getColorName()).setStoreColorId(storeColor.getId()).setProdStatus(EProductStatus.ON_SALE.getValue()));
|
.setShoeUpperLiningMaterial(tyProdImportVO.getShoeUpperLiningMaterial()).setColorName(storeColor.getColorName())
|
||||||
|
.setStoreColorId(storeColor.getId()).setProdStatus(EProductStatus.ON_SALE.getValue()));
|
||||||
// 该颜色所有的尺码
|
// 该颜色所有的尺码
|
||||||
for (int j = 0; j < Constants.SIZE_LIST.size(); j++) {
|
for (int j = 0; j < Constants.SIZE_LIST.size(); j++) {
|
||||||
// TY系统条码前缀
|
// TY系统条码前缀
|
||||||
|
|
@ -382,6 +401,14 @@ public class GtAndTyBizController extends BaseController {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 处理新增的 内里材质 枚举
|
||||||
|
if (MapUtils.isNotEmpty(newShoeUpperLiningMaterialMap)) {
|
||||||
|
newShoeUpperLiningMaterialMap.forEach((k, v) -> newDictDataList.add(new SysDictData().setDictLabel(k).setDictValue(k)
|
||||||
|
.setDictType(DICT_TYPE_SHOE_UPPER_LINING_MATERIAL).setStatus("0").setDictSort(100L)));
|
||||||
|
this.dictDataMapper.insert(newDictDataList);
|
||||||
|
}
|
||||||
|
|
||||||
// 插入商品颜色及颜色对应的尺码,档口服务承诺
|
// 插入商品颜色及颜色对应的尺码,档口服务承诺
|
||||||
this.prodColorMapper.insert(prodColorList);
|
this.prodColorMapper.insert(prodColorList);
|
||||||
prodColorSizeList.sort(Comparator.comparing(StoreProductColorSize::getStoreProdId).thenComparing(StoreProductColorSize::getSize));
|
prodColorSizeList.sort(Comparator.comparing(StoreProductColorSize::getStoreProdId).thenComparing(StoreProductColorSize::getSize));
|
||||||
|
|
@ -699,33 +726,8 @@ public class GtAndTyBizController extends BaseController {
|
||||||
if (attrMap.containsKey(Constants.SHAFT_MATERIAL_NAME)) {
|
if (attrMap.containsKey(Constants.SHAFT_MATERIAL_NAME)) {
|
||||||
// 先看靴筒面材质,为空则找帮面材质
|
// 先看靴筒面材质,为空则找帮面材质
|
||||||
String shaftMaterialAttr = attrMap.get(Constants.SHAFT_MATERIAL_NAME);
|
String shaftMaterialAttr = attrMap.get(Constants.SHAFT_MATERIAL_NAME);
|
||||||
prodAttr.setShaftMaterial(org.apache.commons.lang3.StringUtils.isEmpty(shaftMaterialAttr) ? attrMap.get(Constants.UPPER_MATERIAL_NAME) : shaftMaterialAttr);
|
prodAttr.setShaftMaterial(StringUtils.isEmpty(shaftMaterialAttr) ? attrMap.get(Constants.UPPER_MATERIAL_NAME) : shaftMaterialAttr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
// 4. 鞋面内里材质
|
|
||||||
if (attrMap.containsKey(Constants.SHOE_UPPER_LINING_MATERIAL_NAME)) {
|
|
||||||
// 先找鞋面内里材质,为空 则 再找 内里材质,为空则再找 里料材质
|
|
||||||
String shoeUpperLiningMaterialAttr = attrMap.get(Constants.SHOE_UPPER_LINING_MATERIAL_NAME);
|
|
||||||
if (org.apache.commons.lang3.StringUtils.isEmpty(shoeUpperLiningMaterialAttr)) {
|
|
||||||
shoeUpperLiningMaterialAttr = attrMap.get(Constants.INNER_MATERIAL);
|
|
||||||
if (org.apache.commons.lang3.StringUtils.isEmpty(shoeUpperLiningMaterialAttr)) {
|
|
||||||
shoeUpperLiningMaterialAttr = attrMap.get(Constants.OUTER_MATERIAL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
prodAttr.setShoeUpperLiningMaterial(shoeUpperLiningMaterialAttr);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 5. 靴款品名
|
// 5. 靴款品名
|
||||||
if (attrMap.containsKey(Constants.SHOE_STYLE_NAME_NAME)) {
|
if (attrMap.containsKey(Constants.SHOE_STYLE_NAME_NAME)) {
|
||||||
prodAttr.setShoeStyleName(attrMap.get(Constants.SHOE_STYLE_NAME_NAME));
|
prodAttr.setShoeStyleName(attrMap.get(Constants.SHOE_STYLE_NAME_NAME));
|
||||||
|
|
|
||||||
|
|
@ -157,6 +157,7 @@ public class GtOnlyBizController extends BaseController {
|
||||||
// 获取GT所有的货品
|
// 获取GT所有的货品
|
||||||
List<GtProdSkuVO> gtOnSaleCacheList = ObjectUtils.defaultIfNull(redisCache
|
List<GtProdSkuVO> gtOnSaleCacheList = ObjectUtils.defaultIfNull(redisCache
|
||||||
.getCacheObject(CacheConstants.MIGRATION_GT_SALE_BASIC_KEY + initVO.getUserId()), new ArrayList<>());
|
.getCacheObject(CacheConstants.MIGRATION_GT_SALE_BASIC_KEY + initVO.getUserId()), new ArrayList<>());
|
||||||
|
Map<String, GtProdSkuVO> gtProdMap = gtOnSaleCacheList.stream().collect(Collectors.toMap(GtProdSkuVO::getArticle_number, x -> x, (s1, s2) -> s2));
|
||||||
Map<String, List<GtProdSkuVO>> gtProdSkuMap = gtOnSaleCacheList.stream().collect(Collectors.groupingBy(GtProdSkuVO::getArticle_number));
|
Map<String, List<GtProdSkuVO>> gtProdSkuMap = gtOnSaleCacheList.stream().collect(Collectors.groupingBy(GtProdSkuVO::getArticle_number));
|
||||||
// 商品所有颜色 尺码 颜色库存初始化
|
// 商品所有颜色 尺码 颜色库存初始化
|
||||||
List<StoreProductColor> prodColorList = new ArrayList<>();
|
List<StoreProductColor> prodColorList = new ArrayList<>();
|
||||||
|
|
@ -174,9 +175,11 @@ public class GtOnlyBizController extends BaseController {
|
||||||
prodColorMap.forEach((color, gtColor) -> {
|
prodColorMap.forEach((color, gtColor) -> {
|
||||||
StoreColor storeColor = Optional.ofNullable(storeColorMap.get(gtColor))
|
StoreColor storeColor = Optional.ofNullable(storeColorMap.get(gtColor))
|
||||||
.orElseThrow(() -> new ServiceException("没有GT商品颜色!" + storeProd.getProdArtNum(), HttpStatus.ERROR));
|
.orElseThrow(() -> new ServiceException("没有GT商品颜色!" + storeProd.getProdArtNum(), HttpStatus.ERROR));
|
||||||
|
// 获取GT的内里材质
|
||||||
|
final String shoeUpperLiningMaterial = this.getShoeUpperLiningMaterial(initVO.getUserId(), gtProdMap.get(storeProd.getProdArtNum()));
|
||||||
// 该商品的颜色
|
// 该商品的颜色
|
||||||
prodColorList.add(new StoreProductColor().setStoreId(storeProd.getStoreId()).setStoreProdId(storeProd.getId()).setOrderNum(orderNum.addAndGet(1))
|
prodColorList.add(new StoreProductColor().setStoreId(storeProd.getStoreId()).setStoreProdId(storeProd.getId()).setOrderNum(orderNum.addAndGet(1))
|
||||||
.setColorName(storeColor.getColorName()).setStoreColorId(storeColor.getId()).setProdStatus(EProductStatus.ON_SALE.getValue()));
|
.setColorName(storeColor.getColorName()).setShoeUpperLiningMaterial(shoeUpperLiningMaterial).setStoreColorId(storeColor.getId()).setProdStatus(EProductStatus.ON_SALE.getValue()));
|
||||||
Map<Integer, BigDecimal> sizePriceMap = Optional.ofNullable(colorSizePriceMap.get(gtColor))
|
Map<Integer, BigDecimal> sizePriceMap = Optional.ofNullable(colorSizePriceMap.get(gtColor))
|
||||||
.orElseThrow(() -> new ServiceException("没有GT商品颜色尺码价格!" + storeProd.getProdArtNum(), HttpStatus.ERROR));
|
.orElseThrow(() -> new ServiceException("没有GT商品颜色尺码价格!" + storeProd.getProdArtNum(), HttpStatus.ERROR));
|
||||||
// 该颜色最低价格
|
// 该颜色最低价格
|
||||||
|
|
@ -201,6 +204,7 @@ public class GtOnlyBizController extends BaseController {
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* step3
|
* step3
|
||||||
*/
|
*/
|
||||||
|
|
@ -469,5 +473,32 @@ public class GtOnlyBizController extends BaseController {
|
||||||
prodAttrMap.put(product_id, prodAttr);
|
prodAttrMap.put(product_id, prodAttr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取GT商品的内里属性
|
||||||
|
* @param userId
|
||||||
|
* @param gtProdSkuVO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private String getShoeUpperLiningMaterial(Integer userId, GtProdSkuVO gtProdSkuVO) {
|
||||||
|
String shoeUpperLiningMaterialAttr = "";
|
||||||
|
// 类目属性
|
||||||
|
Map<String, String> attrMap = redisCache.getCacheMap(CacheConstants.MIGRATION_GT_SALE_ATTR_KEY + userId + "_" + gtProdSkuVO.getProduct_id());
|
||||||
|
if (MapUtils.isEmpty(attrMap)) {
|
||||||
|
return shoeUpperLiningMaterialAttr;
|
||||||
|
}
|
||||||
|
// 4. 鞋面内里材质
|
||||||
|
if (attrMap.containsKey(Constants.SHOE_UPPER_LINING_MATERIAL_NAME)) {
|
||||||
|
// 先找鞋面内里材质,为空 则 再找 内里材质,为空则再找 里料材质
|
||||||
|
shoeUpperLiningMaterialAttr = attrMap.get(Constants.SHOE_UPPER_LINING_MATERIAL_NAME);
|
||||||
|
if (org.apache.commons.lang3.StringUtils.isEmpty(shoeUpperLiningMaterialAttr)) {
|
||||||
|
shoeUpperLiningMaterialAttr = attrMap.get(Constants.INNER_MATERIAL);
|
||||||
|
if (org.apache.commons.lang3.StringUtils.isEmpty(shoeUpperLiningMaterialAttr)) {
|
||||||
|
shoeUpperLiningMaterialAttr = attrMap.get(Constants.OUTER_MATERIAL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return shoeUpperLiningMaterialAttr;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -181,6 +181,7 @@ public class GtOtherBizAfterController extends BaseController {
|
||||||
// 获取GT所有的货品
|
// 获取GT所有的货品
|
||||||
List<GtProdSkuVO> gtOnSaleCacheList = ObjectUtils.defaultIfNull(redisCache
|
List<GtProdSkuVO> gtOnSaleCacheList = ObjectUtils.defaultIfNull(redisCache
|
||||||
.getCacheObject(CacheConstants.MIGRATION_GT_SALE_BASIC_KEY + userId), new ArrayList<>());
|
.getCacheObject(CacheConstants.MIGRATION_GT_SALE_BASIC_KEY + userId), new ArrayList<>());
|
||||||
|
Map<String, GtProdSkuVO> gtProdMap = gtOnSaleCacheList.stream().collect(Collectors.toMap(GtProdSkuVO::getArticle_number, x -> x, (s1, s2) -> s2));
|
||||||
Map<String, List<GtProdSkuVO>> gtProdSkuMap = gtOnSaleCacheList.stream().collect(Collectors.groupingBy(GtProdSkuVO::getArticle_number));
|
Map<String, List<GtProdSkuVO>> gtProdSkuMap = gtOnSaleCacheList.stream().collect(Collectors.groupingBy(GtProdSkuVO::getArticle_number));
|
||||||
// 商品所有颜色 尺码 颜色库存初始化
|
// 商品所有颜色 尺码 颜色库存初始化
|
||||||
List<StoreProductColor> prodColorList = new ArrayList<>();
|
List<StoreProductColor> prodColorList = new ArrayList<>();
|
||||||
|
|
@ -198,9 +199,11 @@ public class GtOtherBizAfterController extends BaseController {
|
||||||
prodColorMap.forEach((color, gtColor) -> {
|
prodColorMap.forEach((color, gtColor) -> {
|
||||||
StoreColor storeColor = Optional.ofNullable(storeColorMap.get(gtColor))
|
StoreColor storeColor = Optional.ofNullable(storeColorMap.get(gtColor))
|
||||||
.orElseThrow(() -> new ServiceException("没有GT商品颜色!" + storeProd.getProdArtNum(), HttpStatus.ERROR));
|
.orElseThrow(() -> new ServiceException("没有GT商品颜色!" + storeProd.getProdArtNum(), HttpStatus.ERROR));
|
||||||
|
// 获取GT的内里材质
|
||||||
|
final String shoeUpperLiningMaterial = this.getShoeUpperLiningMaterial(userId, gtProdMap.get(storeProd.getProdArtNum()));
|
||||||
// 该商品的颜色
|
// 该商品的颜色
|
||||||
prodColorList.add(new StoreProductColor().setStoreId(storeProd.getStoreId()).setStoreProdId(storeProd.getId()).setOrderNum(orderNum.addAndGet(1))
|
prodColorList.add(new StoreProductColor().setStoreId(storeProd.getStoreId()).setStoreProdId(storeProd.getId()).setOrderNum(orderNum.addAndGet(1))
|
||||||
.setColorName(storeColor.getColorName()).setStoreColorId(storeColor.getId()).setProdStatus(EProductStatus.ON_SALE.getValue()));
|
.setColorName(storeColor.getColorName()).setShoeUpperLiningMaterial(shoeUpperLiningMaterial).setStoreColorId(storeColor.getId()).setProdStatus(EProductStatus.ON_SALE.getValue()));
|
||||||
Map<Integer, BigDecimal> sizePriceMap = Optional.ofNullable(colorSizePriceMap.get(gtColor))
|
Map<Integer, BigDecimal> sizePriceMap = Optional.ofNullable(colorSizePriceMap.get(gtColor))
|
||||||
.orElseThrow(() -> new ServiceException("没有GT商品颜色尺码价格!" + storeProd.getProdArtNum(), HttpStatus.ERROR));
|
.orElseThrow(() -> new ServiceException("没有GT商品颜色尺码价格!" + storeProd.getProdArtNum(), HttpStatus.ERROR));
|
||||||
// 该颜色最低价格
|
// 该颜色最低价格
|
||||||
|
|
@ -398,38 +401,6 @@ public class GtOtherBizAfterController extends BaseController {
|
||||||
String shaftMaterialAttr = attrMap.get(Constants.SHAFT_MATERIAL_NAME);
|
String shaftMaterialAttr = attrMap.get(Constants.SHAFT_MATERIAL_NAME);
|
||||||
prodAttr.setShaftMaterial(org.apache.commons.lang3.StringUtils.isEmpty(shaftMaterialAttr) ? attrMap.get(Constants.UPPER_MATERIAL_NAME) : shaftMaterialAttr);
|
prodAttr.setShaftMaterial(org.apache.commons.lang3.StringUtils.isEmpty(shaftMaterialAttr) ? attrMap.get(Constants.UPPER_MATERIAL_NAME) : shaftMaterialAttr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
// 4. 鞋面内里材质
|
|
||||||
if (attrMap.containsKey(Constants.SHOE_UPPER_LINING_MATERIAL_NAME)) {
|
|
||||||
// 先找鞋面内里材质,为空 则 再找 内里材质,为空则再找 里料材质
|
|
||||||
String shoeUpperLiningMaterialAttr = attrMap.get(Constants.SHOE_UPPER_LINING_MATERIAL_NAME);
|
|
||||||
if (org.apache.commons.lang3.StringUtils.isEmpty(shoeUpperLiningMaterialAttr)) {
|
|
||||||
shoeUpperLiningMaterialAttr = attrMap.get(Constants.INNER_MATERIAL);
|
|
||||||
if (org.apache.commons.lang3.StringUtils.isEmpty(shoeUpperLiningMaterialAttr)) {
|
|
||||||
shoeUpperLiningMaterialAttr = attrMap.get(Constants.OUTER_MATERIAL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
prodAttr.setShoeUpperLiningMaterial(shoeUpperLiningMaterialAttr);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 5. 靴款品名
|
// 5. 靴款品名
|
||||||
if (attrMap.containsKey(Constants.SHOE_STYLE_NAME_NAME)) {
|
if (attrMap.containsKey(Constants.SHOE_STYLE_NAME_NAME)) {
|
||||||
prodAttr.setShoeStyleName(attrMap.get(Constants.SHOE_STYLE_NAME_NAME));
|
prodAttr.setShoeStyleName(attrMap.get(Constants.SHOE_STYLE_NAME_NAME));
|
||||||
|
|
@ -514,4 +485,32 @@ public class GtOtherBizAfterController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取GT商品的内里属性
|
||||||
|
*
|
||||||
|
* @param userId
|
||||||
|
* @param gtProdSkuVO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private String getShoeUpperLiningMaterial(Integer userId, GtProdSkuVO gtProdSkuVO) {
|
||||||
|
String shoeUpperLiningMaterialAttr = "";
|
||||||
|
// 类目属性
|
||||||
|
Map<String, String> attrMap = redisCache.getCacheMap(CacheConstants.MIGRATION_GT_SALE_ATTR_KEY + userId + "_" + gtProdSkuVO.getProduct_id());
|
||||||
|
if (MapUtils.isEmpty(attrMap)) {
|
||||||
|
return shoeUpperLiningMaterialAttr;
|
||||||
|
}
|
||||||
|
// 4. 鞋面内里材质
|
||||||
|
if (attrMap.containsKey(Constants.SHOE_UPPER_LINING_MATERIAL_NAME)) {
|
||||||
|
// 先找鞋面内里材质,为空 则 再找 内里材质,为空则再找 里料材质
|
||||||
|
shoeUpperLiningMaterialAttr = attrMap.get(Constants.SHOE_UPPER_LINING_MATERIAL_NAME);
|
||||||
|
if (org.apache.commons.lang3.StringUtils.isEmpty(shoeUpperLiningMaterialAttr)) {
|
||||||
|
shoeUpperLiningMaterialAttr = attrMap.get(Constants.INNER_MATERIAL);
|
||||||
|
if (org.apache.commons.lang3.StringUtils.isEmpty(shoeUpperLiningMaterialAttr)) {
|
||||||
|
shoeUpperLiningMaterialAttr = attrMap.get(Constants.OUTER_MATERIAL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return shoeUpperLiningMaterialAttr;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -130,83 +130,34 @@ public class TYOtherBizAfterController extends BaseController {
|
||||||
Map<String, TyProdImportVO> tyProdMap = tyProdList.stream().collect(Collectors.toMap(TyProdImportVO::getProdArtNum, x -> x, (v1, v2) -> v2));
|
Map<String, TyProdImportVO> tyProdMap = tyProdList.stream().collect(Collectors.toMap(TyProdImportVO::getProdArtNum, x -> x, (v1, v2) -> v2));
|
||||||
// 找到枚举的 鞋面材质 和 鞋面内里材质
|
// 找到枚举的 鞋面材质 和 鞋面内里材质
|
||||||
List<SysDictData> attrList = Optional.ofNullable(this.dictDataMapper.selectList(new LambdaQueryWrapper<SysDictData>()
|
List<SysDictData> attrList = Optional.ofNullable(this.dictDataMapper.selectList(new LambdaQueryWrapper<SysDictData>()
|
||||||
.in(SysDictData::getDictType, Arrays.asList(DICT_TYPE_SHAFT_MATERIAL, DICT_TYPE_SHOE_UPPER_LINING_MATERIAL))
|
.eq(SysDictData::getDictType, DICT_TYPE_SHAFT_MATERIAL).eq(SysDictData::getDelFlag, Constants.UNDELETED)))
|
||||||
.eq(SysDictData::getDelFlag, Constants.UNDELETED)))
|
|
||||||
.orElseThrow(() -> new ServiceException("系统枚举 鞋面材质及鞋面内里材质 不存在!", HttpStatus.ERROR));
|
.orElseThrow(() -> new ServiceException("系统枚举 鞋面材质及鞋面内里材质 不存在!", HttpStatus.ERROR));
|
||||||
Map<String, String> shaftMaterialMap = attrList.stream().filter(x -> Objects.equals(x.getDictType(), DICT_TYPE_SHAFT_MATERIAL))
|
Map<String, String> shaftMaterialMap = attrList.stream().filter(x -> Objects.equals(x.getDictType(), DICT_TYPE_SHAFT_MATERIAL))
|
||||||
.collect(Collectors.toMap(SysDictData::getDictLabel, SysDictData::getDictValue));
|
.collect(Collectors.toMap(SysDictData::getDictLabel, SysDictData::getDictValue));
|
||||||
Map<String, String> shoeUpperLiningMaterialMap = attrList.stream().filter(x -> Objects.equals(x.getDictType(), DICT_TYPE_SHOE_UPPER_LINING_MATERIAL))
|
|
||||||
.collect(Collectors.toMap(SysDictData::getDictLabel, SysDictData::getDictValue));
|
|
||||||
List<StoreProductCategoryAttribute> prodCateAttrList = new ArrayList<>();
|
List<StoreProductCategoryAttribute> prodCateAttrList = new ArrayList<>();
|
||||||
List<StoreProductService> prodSvcList = new ArrayList<>();
|
List<StoreProductService> prodSvcList = new ArrayList<>();
|
||||||
Map<String, String> newShaftMaterialMap = new HashMap<>();
|
Map<String, String> newShaftMaterialMap = new HashMap<>();
|
||||||
Map<String, String> newShoeUpperLiningMaterialMap = new HashMap<>();
|
|
||||||
storeProdList.forEach(storeProd -> {
|
storeProdList.forEach(storeProd -> {
|
||||||
TyProdImportVO tyProdVO = Optional.ofNullable(tyProdMap.get(storeProd.getProdArtNum()))
|
TyProdImportVO tyProdVO = Optional.ofNullable(tyProdMap.get(storeProd.getProdArtNum()))
|
||||||
.orElseThrow(() -> new ServiceException("TY独有商品,未找到TY对应的商品!", HttpStatus.ERROR));
|
.orElseThrow(() -> new ServiceException("TY独有商品,未找到TY对应的商品!", HttpStatus.ERROR));
|
||||||
// 鞋面材质 为数据库不存在的属性,则新增
|
// 鞋面材质 为数据库不存在的属性,则新增
|
||||||
if (StringUtils.isNotBlank(tyProdVO.getShaftMaterial()) && !shaftMaterialMap.containsKey(tyProdVO.getShaftMaterial())) {
|
if (StringUtils.isNotBlank(tyProdVO.getShaftMaterial()) && !shaftMaterialMap.containsKey(tyProdVO.getShaftMaterial())) {
|
||||||
newShaftMaterialMap.put(tyProdVO.getShaftMaterial(), tyProdVO.getShaftMaterial());
|
newShaftMaterialMap.put(tyProdVO.getShaftMaterial(), tyProdVO.getShaftMaterial());
|
||||||
|
|
||||||
}
|
}
|
||||||
if (StringUtils.isNotBlank(tyProdVO.getShoeUpperLiningMaterial()) && !shoeUpperLiningMaterialMap.containsKey(tyProdVO.getShoeUpperLiningMaterial())) {
|
// 只设置鞋面材质
|
||||||
newShoeUpperLiningMaterialMap.put(tyProdVO.getShoeUpperLiningMaterial(), tyProdVO.getShoeUpperLiningMaterial());
|
prodCateAttrList.add(new StoreProductCategoryAttribute().setStoreId(storeProd.getStoreId())
|
||||||
|
.setStoreProdId(storeProd.getId()).setShaftMaterial(tyProdVO.getShaftMaterial()));
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 只设置鞋面材质 和 鞋面内里材质
|
|
||||||
prodCateAttrList.add(new StoreProductCategoryAttribute().setStoreId(storeProd.getStoreId()).setStoreProdId(storeProd.getId())
|
|
||||||
.setShaftMaterial(tyProdVO.getShaftMaterial()).setShoeUpperLiningMaterial(tyProdVO.getShoeUpperLiningMaterial()));
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 初始化商品服务承诺
|
// 初始化商品服务承诺
|
||||||
prodSvcList.add(new StoreProductService().setStoreProdId(storeProd.getId()).setCustomRefund("0")
|
prodSvcList.add(new StoreProductService().setStoreProdId(storeProd.getId()).setCustomRefund("0")
|
||||||
.setThirtyDayRefund("0").setOneBatchSale("1").setRefundWithinThreeDay("0"));
|
.setThirtyDayRefund("0").setOneBatchSale("1").setRefundWithinThreeDay("0"));
|
||||||
});
|
});
|
||||||
|
|
||||||
List<SysDictData> newDictDataList = new ArrayList<>();
|
|
||||||
if (MapUtils.isNotEmpty(newShaftMaterialMap)) {
|
if (MapUtils.isNotEmpty(newShaftMaterialMap)) {
|
||||||
|
List<SysDictData> newDictDataList = new ArrayList<>();
|
||||||
newShaftMaterialMap.forEach((k, v) -> newDictDataList.add(new SysDictData().setDictLabel(k).setDictValue(k).setDictType(DICT_TYPE_SHAFT_MATERIAL).setStatus("0").setDictSort(100L)));
|
newShaftMaterialMap.forEach((k, v) -> newDictDataList.add(new SysDictData().setDictLabel(k).setDictValue(k).setDictType(DICT_TYPE_SHAFT_MATERIAL).setStatus("0").setDictSort(100L)));
|
||||||
}
|
|
||||||
if (MapUtils.isNotEmpty(newShoeUpperLiningMaterialMap)) {
|
|
||||||
newShoeUpperLiningMaterialMap.forEach((k, v) -> newDictDataList.add(new SysDictData().setDictLabel(k).setDictValue(k)
|
|
||||||
.setDictType(DICT_TYPE_SHOE_UPPER_LINING_MATERIAL).setStatus("0").setDictSort(100L)));
|
|
||||||
}
|
|
||||||
if (CollectionUtils.isNotEmpty(newDictDataList)) {
|
|
||||||
this.dictDataMapper.insert(newDictDataList);
|
this.dictDataMapper.insert(newDictDataList);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.prodCateAttrMapper.insert(prodCateAttrList);
|
this.prodCateAttrMapper.insert(prodCateAttrList);
|
||||||
this.prodSvcMapper.insert(prodSvcList);
|
this.prodSvcMapper.insert(prodSvcList);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
|
|
@ -244,7 +195,7 @@ public class TYOtherBizAfterController extends BaseController {
|
||||||
// 从数据库查询最新数据
|
// 从数据库查询最新数据
|
||||||
List<StoreProduct> storeProdList = this.storeProdMapper.selectList(new LambdaQueryWrapper<StoreProduct>()
|
List<StoreProduct> storeProdList = this.storeProdMapper.selectList(new LambdaQueryWrapper<StoreProduct>()
|
||||||
.eq(StoreProduct::getStoreId, storeId).eq(StoreProduct::getDelFlag, Constants.UNDELETED)
|
.eq(StoreProduct::getStoreId, storeId).eq(StoreProduct::getDelFlag, Constants.UNDELETED)
|
||||||
// TODO 特殊处理,只保留GT单独处理的部分 important important important
|
// TODO 特殊处理,只保留TY单独处理的部分 important important important
|
||||||
.in(StoreProduct::getProdArtNum, tyAfterArtNumGroupMap.keySet()));
|
.in(StoreProduct::getProdArtNum, tyAfterArtNumGroupMap.keySet()));
|
||||||
List<StoreColor> storeColorList = this.storeColorMapper.selectList(new LambdaQueryWrapper<StoreColor>()
|
List<StoreColor> storeColorList = this.storeColorMapper.selectList(new LambdaQueryWrapper<StoreColor>()
|
||||||
.eq(StoreColor::getStoreId, storeId).eq(StoreColor::getDelFlag, Constants.UNDELETED));
|
.eq(StoreColor::getStoreId, storeId).eq(StoreColor::getDelFlag, Constants.UNDELETED));
|
||||||
|
|
@ -254,9 +205,18 @@ public class TYOtherBizAfterController extends BaseController {
|
||||||
List<TyProdImportVO> tyProdList = ObjectUtils.defaultIfNull(redisCache
|
List<TyProdImportVO> tyProdList = ObjectUtils.defaultIfNull(redisCache
|
||||||
.getCacheObject(CacheConstants.MIGRATION_TY_PROD_KEY + userId), new ArrayList<>());
|
.getCacheObject(CacheConstants.MIGRATION_TY_PROD_KEY + userId), new ArrayList<>());
|
||||||
Map<String, List<TyProdImportVO>> tyProdSkuMap = tyProdList.stream().collect(Collectors.groupingBy(TyProdImportVO::getProdArtNum));
|
Map<String, List<TyProdImportVO>> tyProdSkuMap = tyProdList.stream().collect(Collectors.groupingBy(TyProdImportVO::getProdArtNum));
|
||||||
|
|
||||||
|
// 找到枚举的 鞋面内里材质
|
||||||
|
List<SysDictData> shoeUpperLiningMaterialList = Optional.ofNullable(this.dictDataMapper.selectList(new LambdaQueryWrapper<SysDictData>()
|
||||||
|
.eq(SysDictData::getDictType, DICT_TYPE_SHOE_UPPER_LINING_MATERIAL).eq(SysDictData::getDelFlag, Constants.UNDELETED)))
|
||||||
|
.orElseThrow(() -> new ServiceException("系统枚举 鞋面内里材质 不存在!", HttpStatus.ERROR));
|
||||||
|
Map<String, String> shoeUpperLiningMaterialMap = shoeUpperLiningMaterialList.stream().collect(Collectors.toMap(SysDictData::getDictLabel, SysDictData::getDictValue));
|
||||||
|
|
||||||
// 商品所有颜色 尺码 颜色库存初始化
|
// 商品所有颜色 尺码 颜色库存初始化
|
||||||
List<StoreProductColor> prodColorList = new ArrayList<>();
|
List<StoreProductColor> prodColorList = new ArrayList<>();
|
||||||
List<StoreProductColorSize> prodColorSizeList = new ArrayList<>();
|
List<StoreProductColorSize> prodColorSizeList = new ArrayList<>();
|
||||||
|
List<SysDictData> newDictDataList = new ArrayList<>();
|
||||||
|
Map<String, String> newShoeUpperLiningMaterialMap = new HashMap<>();
|
||||||
storeProdList.forEach(storeProd -> {
|
storeProdList.forEach(storeProd -> {
|
||||||
Optional.ofNullable(tyAfterArtNumGroupMap.get(storeProd.getProdArtNum()))
|
Optional.ofNullable(tyAfterArtNumGroupMap.get(storeProd.getProdArtNum()))
|
||||||
.orElseThrow(() -> new ServiceException("没有TY[独有]商品货号!" + storeProd.getProdArtNum(), HttpStatus.ERROR));
|
.orElseThrow(() -> new ServiceException("没有TY[独有]商品货号!" + storeProd.getProdArtNum(), HttpStatus.ERROR));
|
||||||
|
|
@ -267,6 +227,10 @@ public class TYOtherBizAfterController extends BaseController {
|
||||||
tyMatchColorList.forEach(tyProdColor -> {
|
tyMatchColorList.forEach(tyProdColor -> {
|
||||||
StoreColor storeColor = Optional.ofNullable(storeColorMap.get(tyProdColor.getColorName()))
|
StoreColor storeColor = Optional.ofNullable(storeColorMap.get(tyProdColor.getColorName()))
|
||||||
.orElseThrow(() -> new ServiceException("没有TY[独有]商品颜色!" + storeProd.getProdArtNum(), HttpStatus.ERROR));
|
.orElseThrow(() -> new ServiceException("没有TY[独有]商品颜色!" + storeProd.getProdArtNum(), HttpStatus.ERROR));
|
||||||
|
// 处理内里材质,若步橘没有的,则需要新增
|
||||||
|
if (StringUtils.isNotBlank(tyProdColor.getShoeUpperLiningMaterial()) && !shoeUpperLiningMaterialMap.containsKey(tyProdColor.getShoeUpperLiningMaterial())) {
|
||||||
|
newShoeUpperLiningMaterialMap.put(tyProdColor.getShoeUpperLiningMaterial(), tyProdColor.getShoeUpperLiningMaterial());
|
||||||
|
}
|
||||||
// 该商品的颜色
|
// 该商品的颜色
|
||||||
prodColorList.add(new StoreProductColor().setStoreId(storeProd.getStoreId()).setStoreProdId(storeProd.getId()).setOrderNum(orderNum.addAndGet(1))
|
prodColorList.add(new StoreProductColor().setStoreId(storeProd.getStoreId()).setStoreProdId(storeProd.getId()).setOrderNum(orderNum.addAndGet(1))
|
||||||
.setColorName(storeColor.getColorName()).setStoreColorId(storeColor.getId()).setProdStatus(EProductStatus.ON_SALE.getValue()));
|
.setColorName(storeColor.getColorName()).setStoreColorId(storeColor.getId()).setProdStatus(EProductStatus.ON_SALE.getValue()));
|
||||||
|
|
@ -285,6 +249,14 @@ public class TYOtherBizAfterController extends BaseController {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 处理新增的 内里材质 枚举
|
||||||
|
if (MapUtils.isNotEmpty(newShoeUpperLiningMaterialMap)) {
|
||||||
|
newShoeUpperLiningMaterialMap.forEach((k, v) -> newDictDataList.add(new SysDictData().setDictLabel(k).setDictValue(k)
|
||||||
|
.setDictType(DICT_TYPE_SHOE_UPPER_LINING_MATERIAL).setStatus("0").setDictSort(100L)));
|
||||||
|
this.dictDataMapper.insert(newDictDataList);
|
||||||
|
}
|
||||||
|
|
||||||
// 插入商品颜色及颜色对应的尺码,档口服务承诺
|
// 插入商品颜色及颜色对应的尺码,档口服务承诺
|
||||||
this.prodColorMapper.insert(prodColorList);
|
this.prodColorMapper.insert(prodColorList);
|
||||||
// 按照货号颜色尺码升序排列
|
// 按照货号颜色尺码升序排列
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -73,6 +74,8 @@ public class StoreProdResVO {
|
||||||
private Long storeColorId;
|
private Long storeColorId;
|
||||||
@ApiModelProperty(value = "颜色名称")
|
@ApiModelProperty(value = "颜色名称")
|
||||||
private String colorName;
|
private String colorName;
|
||||||
|
@ApiModelProperty(value = "内里材质")
|
||||||
|
private String shoeUpperLiningMaterial;
|
||||||
@ApiModelProperty(value = "商品尺码")
|
@ApiModelProperty(value = "商品尺码")
|
||||||
private Integer size;
|
private Integer size;
|
||||||
@ApiModelProperty(value = "是否是标准尺码")
|
@ApiModelProperty(value = "是否是标准尺码")
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,8 @@ public class StoreProdColorDTO {
|
||||||
private Long storeColorId;
|
private Long storeColorId;
|
||||||
@ApiModelProperty(value = "颜色名称")
|
@ApiModelProperty(value = "颜色名称")
|
||||||
private String colorName;
|
private String colorName;
|
||||||
|
@ApiModelProperty(value = "内里材质")
|
||||||
|
private String shoeUpperLiningMaterial;
|
||||||
@ApiModelProperty(value = "排序")
|
@ApiModelProperty(value = "排序")
|
||||||
private Integer orderNum;
|
private Integer orderNum;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,8 @@ public class StoreProdSizeDTO {
|
||||||
private Long storeColorId;
|
private Long storeColorId;
|
||||||
@ApiModelProperty(value = "颜色名称")
|
@ApiModelProperty(value = "颜色名称")
|
||||||
private String colorName;
|
private String colorName;
|
||||||
|
@ApiModelProperty(value = "内里材质")
|
||||||
|
private String shoeUpperLiningMaterial;
|
||||||
@ApiModelProperty(value = "商品尺码")
|
@ApiModelProperty(value = "商品尺码")
|
||||||
private Integer size;
|
private Integer size;
|
||||||
@ApiModelProperty(value = "是否是标准尺码")
|
@ApiModelProperty(value = "是否是标准尺码")
|
||||||
|
|
|
||||||
|
|
@ -132,8 +132,12 @@ public class StoreProductServiceImpl implements IStoreProductService {
|
||||||
List<StoreColorDTO> allColorList = this.storeColorMapper.selectListByStoreProdId(storeProd.getStoreId());
|
List<StoreColorDTO> allColorList = this.storeColorMapper.selectListByStoreProdId(storeProd.getStoreId());
|
||||||
// 档口当前商品颜色列表
|
// 档口当前商品颜色列表
|
||||||
List<StoreProdColorDTO> colorList = this.storeProdColorMapper.selectListByStoreProdId(storeProdId);
|
List<StoreProdColorDTO> colorList = this.storeProdColorMapper.selectListByStoreProdId(storeProdId);
|
||||||
|
// 颜色与内里材质映射
|
||||||
|
Map<String, String> colorLiningMaterialMap = colorList.stream().collect(Collectors
|
||||||
|
.toMap(StoreProdColorDTO::getColorName, StoreProdColorDTO::getShoeUpperLiningMaterial, (v1, v2) -> v2));
|
||||||
// 档口商品颜色尺码价格列表
|
// 档口商品颜色尺码价格列表
|
||||||
List<StoreProdSizeDTO> sizeList = this.storeProdColorSizeMapper.selectListByStoreProdId(storeProdId);
|
List<StoreProdSizeDTO> sizeList = this.storeProdColorSizeMapper.selectListByStoreProdId(storeProdId);
|
||||||
|
sizeList.forEach(size -> size.setShoeUpperLiningMaterial(colorLiningMaterialMap.get(size.getColorName())));
|
||||||
// 档口商品详情
|
// 档口商品详情
|
||||||
StoreProductDetail prodDetail = this.storeProdDetailMapper.selectByStoreProdId(storeProdId);
|
StoreProductDetail prodDetail = this.storeProdDetailMapper.selectByStoreProdId(storeProdId);
|
||||||
// 档口服务承诺
|
// 档口服务承诺
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
sp.produce_price AS producePrice,
|
sp.produce_price AS producePrice,
|
||||||
spc.order_num AS orderNum,
|
spc.order_num AS orderNum,
|
||||||
spca.shaft_material,
|
spca.shaft_material,
|
||||||
spca.shoe_upper_lining_material
|
spc.shoe_upper_lining_material
|
||||||
FROM
|
FROM
|
||||||
store_product_color spc
|
store_product_color spc
|
||||||
JOIN store_product sp ON spc.store_prod_id = sp.id
|
JOIN store_product sp ON spc.store_prod_id = sp.id
|
||||||
|
|
@ -88,6 +88,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
spc.store_color_id,
|
spc.store_color_id,
|
||||||
sp.prod_art_num,
|
sp.prod_art_num,
|
||||||
spc.color_name,
|
spc.color_name,
|
||||||
|
spc.shoe_upper_lining_material,
|
||||||
(SELECT MIN(spcs.price) FROM store_product_color_size spcs
|
(SELECT MIN(spcs.price) FROM store_product_color_size spcs
|
||||||
WHERE spcs.store_prod_id = spc.store_prod_id AND spcs.store_color_id = spc.store_color_id AND spcs.del_flag = 0) AS price,
|
WHERE spcs.store_prod_id = spc.store_prod_id AND spcs.store_color_id = spc.store_color_id AND spcs.del_flag = 0) AS price,
|
||||||
spc.order_num
|
spc.order_num
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue