master:处理app返回的html格式;
parent
881307a4ea
commit
9db6130d6d
|
|
@ -167,9 +167,28 @@ public class FhbOtherBizAfterController extends BaseController {
|
|||
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()));
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 初始化商品服务承诺
|
||||
prodSvcList.add(new StoreProductService().setStoreProdId(storeProd.getId()).setCustomRefund("0")
|
||||
.setThirtyDayRefund("0").setOneBatchSale("1").setRefundWithinThreeDay("0"));
|
||||
|
|
|
|||
|
|
@ -736,6 +736,24 @@ 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)) {
|
||||
// 先找鞋面内里材质,为空 则 再找 内里材质,为空则再找 里料材质
|
||||
|
|
@ -748,6 +766,21 @@ public class GtAndFhbBizController extends BaseController {
|
|||
}
|
||||
prodAttr.setShoeUpperLiningMaterial(shoeUpperLiningMaterialAttr);
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 5. 靴款品名
|
||||
if (attrMap.containsKey(Constants.SHOE_STYLE_NAME_NAME)) {
|
||||
prodAttr.setShoeStyleName(attrMap.get(Constants.SHOE_STYLE_NAME_NAME));
|
||||
|
|
|
|||
|
|
@ -656,6 +656,19 @@ 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)) {
|
||||
// 先找鞋面内里材质,为空 则 再找 内里材质,为空则再找 里料材质
|
||||
|
|
@ -667,7 +680,19 @@ public class GtAndTyBiz2Controller extends BaseController {
|
|||
}
|
||||
}
|
||||
prodAttr.setShoeUpperLiningMaterial(shoeUpperLiningMaterialAttr);
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 5. 靴款品名
|
||||
if (attrMap.containsKey(Constants.SHOE_STYLE_NAME_NAME)) {
|
||||
prodAttr.setShoeStyleName(attrMap.get(Constants.SHOE_STYLE_NAME_NAME));
|
||||
|
|
|
|||
|
|
@ -701,6 +701,10 @@ public class GtAndTyBizController 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)) {
|
||||
// 先找鞋面内里材质,为空 则 再找 内里材质,为空则再找 里料材质
|
||||
|
|
@ -712,7 +716,16 @@ public class GtAndTyBizController extends BaseController {
|
|||
}
|
||||
}
|
||||
prodAttr.setShoeUpperLiningMaterial(shoeUpperLiningMaterialAttr);
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 5. 靴款品名
|
||||
if (attrMap.containsKey(Constants.SHOE_STYLE_NAME_NAME)) {
|
||||
prodAttr.setShoeStyleName(attrMap.get(Constants.SHOE_STYLE_NAME_NAME));
|
||||
|
|
|
|||
|
|
@ -352,6 +352,16 @@ public class GtOnlyBizController 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)) {
|
||||
// 先找鞋面内里材质,为空 则 再找 内里材质,为空则再找 里料材质
|
||||
|
|
@ -364,6 +374,18 @@ public class GtOnlyBizController extends BaseController {
|
|||
}
|
||||
prodAttr.setShoeUpperLiningMaterial(shoeUpperLiningMaterialAttr);
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 5. 靴款品名
|
||||
if (attrMap.containsKey(Constants.SHOE_STYLE_NAME_NAME)) {
|
||||
prodAttr.setShoeStyleName(attrMap.get(Constants.SHOE_STYLE_NAME_NAME));
|
||||
|
|
|
|||
|
|
@ -398,6 +398,14 @@ 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)) {
|
||||
// 先找鞋面内里材质,为空 则 再找 内里材质,为空则再找 里料材质
|
||||
|
|
@ -410,6 +418,18 @@ public class GtOtherBizAfterController extends BaseController {
|
|||
}
|
||||
prodAttr.setShoeUpperLiningMaterial(shoeUpperLiningMaterialAttr);
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 5. 靴款品名
|
||||
if (attrMap.containsKey(Constants.SHOE_STYLE_NAME_NAME)) {
|
||||
prodAttr.setShoeStyleName(attrMap.get(Constants.SHOE_STYLE_NAME_NAME));
|
||||
|
|
|
|||
|
|
@ -153,9 +153,44 @@ public class TYOtherBizAfterController extends BaseController {
|
|||
newShoeUpperLiningMaterialMap.put(tyProdVO.getShoeUpperLiningMaterial(), tyProdVO.getShoeUpperLiningMaterial());
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
|
||||
|
||||
// 只设置鞋面材质 和 鞋面内里材质
|
||||
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")
|
||||
.setThirtyDayRefund("0").setOneBatchSale("1").setRefundWithinThreeDay("0"));
|
||||
|
|
|
|||
|
|
@ -143,8 +143,6 @@ public class StoreProdCreateVO {
|
|||
private String shaftLiningMaterial;
|
||||
@ApiModelProperty(value = "靴筒面材质")
|
||||
private String shaftMaterial;
|
||||
@ApiModelProperty(value = "鞋面内里材质")
|
||||
private String shoeUpperLiningMaterial;
|
||||
@ApiModelProperty(value = "靴款品名")
|
||||
private String shoeStyleName;
|
||||
@ApiModelProperty(value = "筒高")
|
||||
|
|
@ -197,6 +195,9 @@ public class StoreProdCreateVO {
|
|||
@NotBlank(message = "颜色名称不能为空!")
|
||||
@ApiModelProperty(value = "颜色名称", required = true)
|
||||
private String colorName;
|
||||
@NotBlank(message = "内里材质不可为空!")
|
||||
@ApiModelProperty(value = "内里材质" , required = true)
|
||||
private String shoeUpperLiningMaterial;
|
||||
@ApiModelProperty(value = "商品尺码", required = true)
|
||||
@NotNull(message = "档口商品定价不能为空!")
|
||||
private Integer size;
|
||||
|
|
|
|||
|
|
@ -44,10 +44,6 @@ public class StoreProductCategoryAttribute extends XktBaseEntity {
|
|||
* 鞋面材质(靴筒面材质)
|
||||
*/
|
||||
private String shaftMaterial;
|
||||
/**
|
||||
* 鞋面内里材质
|
||||
*/
|
||||
private String shoeUpperLiningMaterial;
|
||||
/**
|
||||
* 靴款品名
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -23,32 +23,30 @@ public class StoreProductColor extends XktBaseEntity {
|
|||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 档口颜色ID
|
||||
*/
|
||||
private Long storeColorId;
|
||||
|
||||
/**
|
||||
* 档口商品ID
|
||||
*/
|
||||
private Long storeProdId;
|
||||
|
||||
/**
|
||||
* 档口ID
|
||||
*/
|
||||
private Long storeId;
|
||||
|
||||
/**
|
||||
* 颜色名称
|
||||
*/
|
||||
private String colorName;
|
||||
|
||||
/**
|
||||
* 内里材质
|
||||
*/
|
||||
private String shoeUpperLiningMaterial;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer orderNum;
|
||||
|
||||
/**
|
||||
* 商品状态 2:在售 3:尾货 4:已下架
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -23,8 +23,6 @@ public class StoreProdCateAttrDTO {
|
|||
private String shaftLiningMaterial;
|
||||
@ApiModelProperty(value = "靴筒面材质")
|
||||
private String shaftMaterial;
|
||||
@ApiModelProperty(value = "鞋面内里材质")
|
||||
private String shoeUpperLiningMaterial;
|
||||
@ApiModelProperty(value = "靴款品名")
|
||||
private String shoeStyleName;
|
||||
@ApiModelProperty(value = "筒高")
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import lombok.NoArgsConstructor;
|
|||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
|
@ -77,6 +78,8 @@ public class StoreProdDTO {
|
|||
private Long storeColorId;
|
||||
@ApiModelProperty(value = "颜色名称")
|
||||
private String colorName;
|
||||
@ApiModelProperty(value = "内里材质")
|
||||
private String shoeUpperLiningMaterial;
|
||||
@ApiModelProperty(value = "商品尺码")
|
||||
private Integer size;
|
||||
@ApiModelProperty(value = "档口商品定价")
|
||||
|
|
|
|||
|
|
@ -358,10 +358,13 @@ public class StoreProductServiceImpl implements IStoreProductService {
|
|||
// 所有颜色列表
|
||||
List<StoreProductColor> dbProdColorList = this.storeProdColorMapper.selectList(new LambdaQueryWrapper<StoreProductColor>()
|
||||
.eq(StoreProductColor::getStoreProdId, storeProdId).eq(StoreProductColor::getDelFlag, Constants.UNDELETED));
|
||||
Map<String, StoreProductColor> existColorMap = dbProdColorList.stream().collect(Collectors.toMap(StoreProductColor::getColorName, x -> x));
|
||||
// 当前商品已存在的storeColorId列表
|
||||
List<Long> exitProdColorIdList = dbProdColorList.stream().map(StoreProductColor::getStoreColorId).collect(Collectors.toList());
|
||||
// 当前商品待更新的storeColorId列表
|
||||
List<Long> updateProdColorIdList = updateDTO.getSizeList().stream().map(StoreProdDTO.SPCSizeDTO::getColorName).map(storeColorMap::get).collect(Collectors.toList());
|
||||
// 待更新的商品颜色内里map
|
||||
Map<String, String> updateColorLineMaterialMap = updateDTO.getSizeList().stream().collect(Collectors.toMap(StoreProdDTO.SPCSizeDTO::getColorName, StoreProdDTO.SPCSizeDTO::getShoeUpperLiningMaterial, (v1, v2) -> v2));
|
||||
dbProdColorList.stream()
|
||||
// 判断有哪些是删除的颜色
|
||||
.filter(color -> !updateProdColorIdList.contains(color.getStoreColorId()))
|
||||
|
|
@ -372,6 +375,12 @@ public class StoreProductServiceImpl implements IStoreProductService {
|
|||
final Long updateProdColorId = storeColorMap.get(updateProdColorNameList.get(i));
|
||||
// 已存在的颜色则不新增
|
||||
if (exitProdColorIdList.contains(updateProdColorId)) {
|
||||
StoreProductColor existColor = existColorMap.get(updateProdColorNameList.get(i));
|
||||
if (ObjectUtils.isNotEmpty(existColor)) {
|
||||
String shoeUpperLiningMaterial = updateColorLineMaterialMap.get(updateProdColorNameList.get(i));
|
||||
// 修改颜色的内里属性
|
||||
existColor.setShoeUpperLiningMaterial(shoeUpperLiningMaterial);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
// 新增的商品颜色
|
||||
|
|
@ -494,9 +503,13 @@ public class StoreProductServiceImpl implements IStoreProductService {
|
|||
// 新增档口颜色尺码与价格
|
||||
List<StoreProductColor> prodColorList = new ArrayList<>();
|
||||
final List<String> prodColorNameList = createDTO.getSizeList().stream().map(StoreProdDTO.SPCSizeDTO::getColorName).distinct().collect(Collectors.toList());
|
||||
// 颜色与内里的关系
|
||||
final Map<String, String> colorLiningMaterialMap = createDTO.getSizeList().stream().collect(Collectors
|
||||
.toMap(StoreProdDTO.SPCSizeDTO::getColorName, StoreProdDTO.SPCSizeDTO::getShoeUpperLiningMaterial, (v1, v2) -> v2));
|
||||
for (int i = 0; i < prodColorNameList.size(); i++) {
|
||||
prodColorList.add(new StoreProductColor().setStoreColorId(storeColorMap.get(prodColorNameList.get(i))).setStoreProdId(storeProdId)
|
||||
.setStoreId(storeId).setColorName(prodColorNameList.get(i)).setOrderNum(i + 1).setProdStatus(EProductStatus.ON_SALE.getValue()));
|
||||
.setShoeUpperLiningMaterial(colorLiningMaterialMap.get(prodColorNameList.get(i))).setColorName(prodColorNameList.get(i))
|
||||
.setStoreId(storeId).setOrderNum(i + 1).setProdStatus(EProductStatus.ON_SALE.getValue()));
|
||||
}
|
||||
this.storeProdColorMapper.insert(prodColorList);
|
||||
// 新增档口颜色尺码对应价格
|
||||
|
|
@ -1442,10 +1455,6 @@ public class StoreProductServiceImpl implements IStoreProductService {
|
|||
if (ObjectUtils.isNotEmpty(cateAttr.getShaftMaterial())) {
|
||||
cateAttrMap.put(Constants.CATE_RELATE_MAP.get(SHAFT_MATERIAL), cateAttr.getShaftMaterial());
|
||||
}
|
||||
// 鞋面内里材质
|
||||
if (ObjectUtils.isNotEmpty(cateAttr.getShoeUpperLiningMaterial())) {
|
||||
cateAttrMap.put(Constants.CATE_RELATE_MAP.get(SHOE_UPPER_LINING_MATERIAL), cateAttr.getShoeUpperLiningMaterial());
|
||||
}
|
||||
// 靴款品名
|
||||
if (ObjectUtils.isNotEmpty(cateAttr.getShoeStyleName())) {
|
||||
cateAttrMap.put(Constants.CATE_RELATE_MAP.get(SHOE_STYLE_NAME), cateAttr.getShoeStyleName());
|
||||
|
|
|
|||
Loading…
Reference in New Issue