master:迁移内里材质属性调整;

pull/1121/head
liujiang 2025-11-12 10:19:14 +08:00
parent ad3e6512e9
commit b5c0abc129
12 changed files with 225 additions and 247 deletions

View File

@ -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));
// 找到枚举的 鞋面材质 和 鞋面内里材质
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::getDelFlag, Constants.UNDELETED)))
.orElseThrow(() -> new ServiceException("系统枚举 鞋面材质及鞋面内里材质 不存在!", HttpStatus.ERROR));
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<SysDictData> shaftMaterialList = Optional.ofNullable(this.dictDataMapper.selectList(new LambdaQueryWrapper<SysDictData>()
.eq(SysDictData::getDictType, DICT_TYPE_SHAFT_MATERIAL).eq(SysDictData::getDelFlag, Constants.UNDELETED)))
.orElseThrow(() -> new ServiceException("系统枚举 鞋面材质 不存在!", HttpStatus.ERROR));
Map<String, String> shaftMaterialMap = shaftMaterialList.stream().collect(Collectors.toMap(SysDictData::getDictLabel, SysDictData::getDictValue));
List<StoreProductCategoryAttribute> prodCateAttrList = new ArrayList<>();
List<StoreProductService> prodSvcList = new ArrayList<>();
Map<String, String> newShaftMaterialMap = new HashMap<>();
Map<String, String> newShoeUpperLiningMaterialMap = new HashMap<>();
storeProdList.forEach(storeProd -> {
FhbProdVO.SMIVO fhbProdVO = Optional.ofNullable(fhbProdMap.get(storeProd.getProdArtNum()))
.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())) {
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()).setShoeUpperLiningMaterial(fhbProdVO.getInnerStuff()));
*/
// 只设置鞋面材质
prodCateAttrList.add(new StoreProductCategoryAttribute().setStoreId(storeProd.getStoreId())
.setStoreProdId(storeProd.getId()).setShaftMaterial(fhbProdVO.getOutStuff()));
// 初始化商品服务承诺
prodSvcList.add(new StoreProductService().setStoreProdId(storeProd.getId()).setCustomRefund("0")
.setThirtyDayRefund("0").setOneBatchSale("1").setRefundWithinThreeDay("0"));
@ -197,10 +170,6 @@ public class FhbOtherBizAfterController extends BaseController {
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)));
}
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);
}
@ -252,9 +221,18 @@ public class FhbOtherBizAfterController extends BaseController {
throw new ServiceException("FHB cache 数据为空!", HttpStatus.ERROR);
}
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<StoreProductColorSize> prodColorSizeList = new ArrayList<>();
List<SysDictData> newDictDataList = new ArrayList<>();
Map<String, String> newShoeUpperLiningMaterialMap = new HashMap<>();
storeProdList.forEach(storeProd -> {
Optional.ofNullable(fhbAfterArtNumGroupMap.get(storeProd.getProdArtNum()))
.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());
AtomicInteger orderNum = new AtomicInteger();
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()))
.orElseThrow(() -> new ServiceException("没有FHB[独有]商品颜色!" + storeProd.getProdArtNum(), HttpStatus.ERROR));
// 该商品的颜色
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);
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);
// 按照货号颜色尺码升序排列

View File

@ -9,6 +9,7 @@ import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.core.controller.BaseController;
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.exception.ServiceException;
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.framework.es.EsClientWrapper;
import com.ruoyi.framework.notice.fs.FsNotice;
import com.ruoyi.web.controller.xkt.migartion.vo.gtAndFhb.GtAndFHBCompareDownloadVO;
import com.ruoyi.web.controller.xkt.migartion.vo.gtAndFhb.GtAndFHBInitVO;
import com.ruoyi.system.mapper.SysDictDataMapper;
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.FhbProdStockVO;
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.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.dto.es.ESProductDTO;
import com.ruoyi.xkt.dto.storeProdColorPrice.StoreProdMinPriceDTO;
@ -81,6 +83,10 @@ public class GtAndFhbBizController extends BaseController {
final EsClientWrapper esClientWrapper;
final IPictureService pictureService;
final FsNotice fsNotice;
final SysDictDataMapper dictDataMapper;
// 系统枚举 鞋面内里材质
private static final String DICT_TYPE_SHOE_UPPER_LINING_MATERIAL = "shoe_upper_lining_material";
/**
* step1
@ -384,9 +390,17 @@ public class GtAndFhbBizController extends BaseController {
// gt按照货号分组
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<StoreProductColorSize> prodColorSizeList = new ArrayList<>();
List<SysDictData> newDictDataList = new ArrayList<>();
Map<String, String> newShoeUpperLiningMaterialMap = new HashMap<>();
storeProdList.forEach(storeProd -> {
// 获取clearArtNo
String clearArtNo = this.extractCoreArticleNumber(storeProd.getProdArtNum());
@ -402,9 +416,14 @@ public class GtAndFhbBizController extends BaseController {
for (FhbProdVO.SMIVO smivo : fhbMatchSkuList) {
StoreColor storeColor = Optional.ofNullable(storeColorMap.get(smivo.getColor()))
.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))
.setColorName(storeColor.getColorName()).setStoreColorId(storeColor.getId()).setProdStatus(EProductStatus.ON_SALE.getValue()));
prodColorList.add(new StoreProductColor().setStoreId(storeProd.getStoreId()).setStoreProdId(storeProd.getId())
.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++) {
// 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);
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);
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. 靴款品名
if (attrMap.containsKey(Constants.SHOE_STYLE_NAME_NAME)) {
prodAttr.setShoeStyleName(attrMap.get(Constants.SHOE_STYLE_NAME_NAME));

View File

@ -9,12 +9,14 @@ import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.core.controller.BaseController;
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.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.es.EsClientWrapper;
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.GtProdSkuVO;
import com.ruoyi.web.controller.xkt.migartion.vo.gtAndTy.GtAndTYCompareDownloadVO;
@ -76,6 +78,10 @@ public class GtAndTyBiz2Controller extends BaseController {
final SysProductCategoryMapper prodCateMapper;
final EsClientWrapper esClientWrapper;
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<StoreProductColorSize> prodColorSizeList = new ArrayList<>();
List<SysDictData> newDictDataList = new ArrayList<>();
Map<String, String> newShoeUpperLiningMaterialMap = new HashMap<>();
storeProdList.forEach(storeProd -> {
// TY匹配的货号
List<String> tyMatchArtNoList = gtMatchTyArtNoMap.get(storeProd.getProdArtNum());
@ -318,9 +332,14 @@ public class GtAndTyBiz2Controller extends BaseController {
for (TyProdImportVO tyProdImportVO : tyMatchSkuList) {
StoreColor storeColor = Optional.ofNullable(storeColorMap.get(tyProdImportVO.getColorName()))
.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))
.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++) {
// 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);
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);
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. 靴款品名
if (attrMap.containsKey(Constants.SHOE_STYLE_NAME_NAME)) {
prodAttr.setShoeStyleName(attrMap.get(Constants.SHOE_STYLE_NAME_NAME));

View File

@ -9,17 +9,18 @@ import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.core.controller.BaseController;
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.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.es.EsClientWrapper;
import com.ruoyi.framework.notice.fs.FsNotice;
import com.ruoyi.web.controller.xkt.migartion.vo.gtAndTy.GtAndTYCompareDownloadVO;
import com.ruoyi.web.controller.xkt.migartion.vo.gtAndTy.GtAndTYInitVO;
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.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.TyCusImportVO;
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.MapUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
@ -76,6 +78,10 @@ public class GtAndTyBizController extends BaseController {
final SysProductCategoryMapper prodCateMapper;
final EsClientWrapper esClientWrapper;
final FsNotice fsNotice;
final SysDictDataMapper dictDataMapper;
// 系统枚举 鞋面内里材质
private static final String DICT_TYPE_SHOE_UPPER_LINING_MATERIAL = "shoe_upper_lining_material";
/**
* step1
@ -348,9 +354,17 @@ public class GtAndTyBizController extends BaseController {
// gt按照货号分组
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<StoreProductColorSize> prodColorSizeList = new ArrayList<>();
List<SysDictData> newDictDataList = new ArrayList<>();
Map<String, String> newShoeUpperLiningMaterialMap = new HashMap<>();
storeProdList.forEach(storeProd -> {
// 取clearArtNo
String clearArtNo = this.extractCoreArticleNumber(storeProd.getProdArtNum());
@ -366,9 +380,14 @@ public class GtAndTyBizController extends BaseController {
for (TyProdImportVO tyProdImportVO : tyMatchSkuList) {
StoreColor storeColor = Optional.ofNullable(storeColorMap.get(tyProdImportVO.getColorName()))
.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))
.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++) {
// 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);
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)) {
// 先看靴筒面材质,为空则找帮面材质
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. 靴款品名
if (attrMap.containsKey(Constants.SHOE_STYLE_NAME_NAME)) {
prodAttr.setShoeStyleName(attrMap.get(Constants.SHOE_STYLE_NAME_NAME));

View File

@ -157,6 +157,7 @@ public class GtOnlyBizController extends BaseController {
// 获取GT所有的货品
List<GtProdSkuVO> gtOnSaleCacheList = ObjectUtils.defaultIfNull(redisCache
.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));
// 商品所有颜色 尺码 颜色库存初始化
List<StoreProductColor> prodColorList = new ArrayList<>();
@ -174,9 +175,11 @@ public class GtOnlyBizController extends BaseController {
prodColorMap.forEach((color, gtColor) -> {
StoreColor storeColor = Optional.ofNullable(storeColorMap.get(gtColor))
.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))
.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))
.orElseThrow(() -> new ServiceException("没有GT商品颜色尺码价格!" + storeProd.getProdArtNum(), HttpStatus.ERROR));
// 该颜色最低价格
@ -201,6 +204,7 @@ public class GtOnlyBizController extends BaseController {
return R.ok();
}
/**
* step3
*/
@ -469,5 +473,32 @@ public class GtOnlyBizController extends BaseController {
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;
}
}

View File

@ -181,6 +181,7 @@ public class GtOtherBizAfterController extends BaseController {
// 获取GT所有的货品
List<GtProdSkuVO> gtOnSaleCacheList = ObjectUtils.defaultIfNull(redisCache
.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));
// 商品所有颜色 尺码 颜色库存初始化
List<StoreProductColor> prodColorList = new ArrayList<>();
@ -198,9 +199,11 @@ public class GtOtherBizAfterController extends BaseController {
prodColorMap.forEach((color, gtColor) -> {
StoreColor storeColor = Optional.ofNullable(storeColorMap.get(gtColor))
.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))
.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))
.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);
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. 靴款品名
if (attrMap.containsKey(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;
}
}

View File

@ -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));
// 找到枚举的 鞋面材质 和 鞋面内里材质
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::getDelFlag, Constants.UNDELETED)))
.eq(SysDictData::getDictType, DICT_TYPE_SHAFT_MATERIAL).eq(SysDictData::getDelFlag, Constants.UNDELETED)))
.orElseThrow(() -> new ServiceException("系统枚举 鞋面材质及鞋面内里材质 不存在!", HttpStatus.ERROR));
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<StoreProductService> prodSvcList = new ArrayList<>();
Map<String, String> newShaftMaterialMap = new HashMap<>();
Map<String, String> newShoeUpperLiningMaterialMap = new HashMap<>();
storeProdList.forEach(storeProd -> {
TyProdImportVO tyProdVO = Optional.ofNullable(tyProdMap.get(storeProd.getProdArtNum()))
.orElseThrow(() -> new ServiceException("TY独有商品未找到TY对应的商品!", HttpStatus.ERROR));
// 鞋面材质 为数据库不存在的属性,则新增
if (StringUtils.isNotBlank(tyProdVO.getShaftMaterial()) && !shaftMaterialMap.containsKey(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()).setShoeUpperLiningMaterial(tyProdVO.getShoeUpperLiningMaterial()));
*/
// 只设置鞋面材质
prodCateAttrList.add(new StoreProductCategoryAttribute().setStoreId(storeProd.getStoreId())
.setStoreProdId(storeProd.getId()).setShaftMaterial(tyProdVO.getShaftMaterial()));
// 初始化商品服务承诺
prodSvcList.add(new StoreProductService().setStoreProdId(storeProd.getId()).setCustomRefund("0")
.setThirtyDayRefund("0").setOneBatchSale("1").setRefundWithinThreeDay("0"));
});
List<SysDictData> newDictDataList = new ArrayList<>();
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)));
}
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.prodCateAttrMapper.insert(prodCateAttrList);
this.prodSvcMapper.insert(prodSvcList);
return R.ok();
@ -244,7 +195,7 @@ public class TYOtherBizAfterController extends BaseController {
// 从数据库查询最新数据
List<StoreProduct> storeProdList = this.storeProdMapper.selectList(new LambdaQueryWrapper<StoreProduct>()
.eq(StoreProduct::getStoreId, storeId).eq(StoreProduct::getDelFlag, Constants.UNDELETED)
// TODO 特殊处理,只保留GT单独处理的部分 important important important
// TODO 特殊处理,只保留TY单独处理的部分 important important important
.in(StoreProduct::getProdArtNum, tyAfterArtNumGroupMap.keySet()));
List<StoreColor> storeColorList = this.storeColorMapper.selectList(new LambdaQueryWrapper<StoreColor>()
.eq(StoreColor::getStoreId, storeId).eq(StoreColor::getDelFlag, Constants.UNDELETED));
@ -254,9 +205,18 @@ public class TYOtherBizAfterController extends BaseController {
List<TyProdImportVO> tyProdList = ObjectUtils.defaultIfNull(redisCache
.getCacheObject(CacheConstants.MIGRATION_TY_PROD_KEY + userId), new ArrayList<>());
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<StoreProductColorSize> prodColorSizeList = new ArrayList<>();
List<SysDictData> newDictDataList = new ArrayList<>();
Map<String, String> newShoeUpperLiningMaterialMap = new HashMap<>();
storeProdList.forEach(storeProd -> {
Optional.ofNullable(tyAfterArtNumGroupMap.get(storeProd.getProdArtNum()))
.orElseThrow(() -> new ServiceException("没有TY[独有]商品货号!" + storeProd.getProdArtNum(), HttpStatus.ERROR));
@ -267,6 +227,10 @@ public class TYOtherBizAfterController extends BaseController {
tyMatchColorList.forEach(tyProdColor -> {
StoreColor storeColor = Optional.ofNullable(storeColorMap.get(tyProdColor.getColorName()))
.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))
.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);
// 按照货号颜色尺码升序排列

View File

@ -9,6 +9,7 @@ import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
@ -73,6 +74,8 @@ public class StoreProdResVO {
private Long storeColorId;
@ApiModelProperty(value = "颜色名称")
private String colorName;
@ApiModelProperty(value = "内里材质")
private String shoeUpperLiningMaterial;
@ApiModelProperty(value = "商品尺码")
private Integer size;
@ApiModelProperty(value = "是否是标准尺码")

View File

@ -19,6 +19,8 @@ public class StoreProdColorDTO {
private Long storeColorId;
@ApiModelProperty(value = "颜色名称")
private String colorName;
@ApiModelProperty(value = "内里材质")
private String shoeUpperLiningMaterial;
@ApiModelProperty(value = "排序")
private Integer orderNum;

View File

@ -17,6 +17,8 @@ public class StoreProdSizeDTO {
private Long storeColorId;
@ApiModelProperty(value = "颜色名称")
private String colorName;
@ApiModelProperty(value = "内里材质")
private String shoeUpperLiningMaterial;
@ApiModelProperty(value = "商品尺码")
private Integer size;
@ApiModelProperty(value = "是否是标准尺码")

View File

@ -132,8 +132,12 @@ public class StoreProductServiceImpl implements IStoreProductService {
List<StoreColorDTO> allColorList = this.storeColorMapper.selectListByStoreProdId(storeProd.getStoreId());
// 档口当前商品颜色列表
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);
sizeList.forEach(size -> size.setShoeUpperLiningMaterial(colorLiningMaterialMap.get(size.getColorName())));
// 档口商品详情
StoreProductDetail prodDetail = this.storeProdDetailMapper.selectByStoreProdId(storeProdId);
// 档口服务承诺

View File

@ -69,7 +69,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sp.produce_price AS producePrice,
spc.order_num AS orderNum,
spca.shaft_material,
spca.shoe_upper_lining_material
spc.shoe_upper_lining_material
FROM
store_product_color spc
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,
sp.prod_art_num,
spc.color_name,
spc.shoe_upper_lining_material,
(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,
spc.order_num