提交 b1ee38af authored 作者: 梁业锦's avatar 梁业锦 💬

修复PullAndBear和Zara的爬虫导致的尺码混乱的问题

上级 a81d48e5
......@@ -121,12 +121,12 @@ public class PullandbearSpider implements IItemSpider {
JSONObject sizesObj = sizesArr.getJSONObject(j);
///////////////////////// 获取商品尺码属性 ////////////////////
String sizeNo = sizesObj.getString("sku");
// String sizeNo = sizesObj.getString("sku");
String size = sizesObj.getString("name");
ProductProp productPropSize = new ProductProp();
productPropSize.setPropName(size);
productPropSize.setPropId(sizeNo);
productPropSize.setPropId(size);
sizePropSetSize.add(productPropSize);
if (productPropSet.get("尺码") == null) {
productPropSet.put("尺码", sizePropSetSize);
......@@ -138,7 +138,7 @@ public class PullandbearSpider implements IItemSpider {
///////////////////////// 获取商品尺码属性 END////////////////////
// 商品的库存id
String skuStr = ";" + colorNo + ";" + sizeNo + ";";
String skuStr = ";" + colorNo + ";" + size + ";";
//////////////////////////////////// 获取库存 ////////////////////////////////////////////
......
......@@ -121,14 +121,12 @@ public class ZaraSpider implements IItemSpider {
for (int j = 0; j < sizesArr.size(); j++) {
JSONObject sizesObj = sizesArr.getJSONObject(j);
///////////////////////// 获取商品尺码属性 ////////////////////
String sizeNo = sizesObj.getString("sku");
// String sizeNo = sizesObj.getString("sku");
String size = sizesObj.getString("name");
ProductProp productPropSize = new ProductProp();
productPropSize.setPropId(sizeNo);
productPropSize.setPropId(size);
productPropSize.setPropName(size);
sizePropSet.add(productPropSize);
if (productPropSet.get("尺码") == null) {
......@@ -141,7 +139,7 @@ public class ZaraSpider implements IItemSpider {
///////////////////////// 获取商品尺码属性 END////////////////////
// 库存对应的id(Zara 中以颜色id + 尺码id)
String skuStr = ";" + colorNo + ";" + sizeNo + ";";
String skuStr = ";" + colorNo + ";" + size + ";";
//////////////////////////////////// 获取库存 ////////////////////////////////////////////
if (productSkuStockList == null) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论