Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
Z
zion
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
1
合并请求
1
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
zhengfg
zion
Commits
3be02d75
提交
3be02d75
authored
12月 10, 2019
作者:
luojie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复zara
上级
d84f0ccf
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
13 行增加
和
12 行删除
+13
-12
HmSpider.java
...n/java/com/diaoyun/zion/chinafrica/bis/impl/HmSpider.java
+1
-1
ZaraSpider.java
...java/com/diaoyun/zion/chinafrica/bis/impl/ZaraSpider.java
+12
-11
没有找到文件。
src/main/java/com/diaoyun/zion/chinafrica/bis/impl/HmSpider.java
浏览文件 @
3be02d75
...
...
@@ -77,7 +77,7 @@ public class HmSpider implements IItemSpider {
Map
<
String
,
Set
<
ProductProp
>>
productPropSet
=
new
HashMap
<>(
16
);
Set
<
ProductProp
>
propSet
=
new
HashSet
<>(
16
);
Set
<
ProductProp
>
sizePropSet
=
new
HashSet
<>(
16
);
productResponse
.
setStockFlag
(
tru
e
);
productResponse
.
setStockFlag
(
fals
e
);
// 商品的基本属性
ItemInfo
itemInfo
=
new
ItemInfo
();
...
...
src/main/java/com/diaoyun/zion/chinafrica/bis/impl/ZaraSpider.java
浏览文件 @
3be02d75
...
...
@@ -52,7 +52,7 @@ public class ZaraSpider implements IItemSpider {
* @param dataMap 主要的 json 数据
* @return 格式化后的数据
*/
private
ProductResponse
formatZaraProductResponse
(
JSONObject
dataMap
)
{
private
ProductResponse
formatZaraProductResponse
(
JSONObject
dataMap
)
throws
InterruptedException
,
ExecutionException
,
TimeoutException
{
// 声明封装类
ProductResponse
productResponse
=
new
ProductResponse
();
// 含有商品的属性,设置为true
...
...
@@ -68,7 +68,7 @@ public class ZaraSpider implements IItemSpider {
Map
<
String
,
Set
<
ProductProp
>>
productPropSet
=
new
HashMap
<>(
16
);
Set
<
ProductProp
>
propSet
=
new
HashSet
<>(
16
);
Set
<
ProductProp
>
sizePropSet
=
new
HashSet
<>(
16
);
productResponse
.
setStockFlag
(
tru
e
);
productResponse
.
setStockFlag
(
fals
e
);
// 商品的基本属性
ItemInfo
itemInfo
=
new
ItemInfo
();
...
...
@@ -81,6 +81,7 @@ public class ZaraSpider implements IItemSpider {
//////////////////////////////////// 获取商品基本信息End(图片下取) ////////////////////////////////////////////
// 取 colors 节点数组
TranslateHelper
.
translateProductResponse
(
productObj
);
JSONArray
colorsArr
=
productObj
.
getJSONObject
(
"detail"
).
getJSONArray
(
"colors"
);
for
(
int
i
=
0
;
i
<
colorsArr
.
size
();
i
++)
{
JSONObject
colorsObj
=
colorsArr
.
getJSONObject
(
i
);
...
...
@@ -106,12 +107,12 @@ public class ZaraSpider implements IItemSpider {
productPropColor
.
setPropName
(
color
);
productPropColor
.
setImage
(
imageUrl
);
propSet
.
add
(
productPropColor
);
if
(
productPropSet
.
get
(
"
颜色
"
)
==
null
)
{
productPropSet
.
put
(
"
颜色
"
,
propSet
);
if
(
productPropSet
.
get
(
"
Color
"
)
==
null
)
{
productPropSet
.
put
(
"
Color
"
,
propSet
);
}
else
{
Set
<
ProductProp
>
oldPropSet
=
productPropSet
.
get
(
"
颜色
"
);
Set
<
ProductProp
>
oldPropSet
=
productPropSet
.
get
(
"
Color
"
);
propSet
.
addAll
(
oldPropSet
);
productPropSet
.
put
(
"
颜色
"
,
propSet
);
productPropSet
.
put
(
"
Color
"
,
propSet
);
}
//////////////////////////////////// 获取商品颜色属性 END ////////////////////////////////////////////
...
...
@@ -130,17 +131,17 @@ public class ZaraSpider implements IItemSpider {
productPropSize
.
setPropId
(
size
);
productPropSize
.
setPropName
(
size
);
sizePropSet
.
add
(
productPropSize
);
if
(
productPropSet
.
get
(
"
尺码
"
)
==
null
)
{
productPropSet
.
put
(
"
尺码
"
,
sizePropSet
);
if
(
productPropSet
.
get
(
"
Size
"
)
==
null
)
{
productPropSet
.
put
(
"
Size
"
,
sizePropSet
);
}
else
{
Set
<
ProductProp
>
oldPropSet
=
productPropSet
.
get
(
"
尺码
"
);
Set
<
ProductProp
>
oldPropSet
=
productPropSet
.
get
(
"
Size
"
);
sizePropSet
.
addAll
(
oldPropSet
);
productPropSet
.
put
(
"
尺码
"
,
sizePropSet
);
productPropSet
.
put
(
"
Size
"
,
sizePropSet
);
}
///////////////////////// 获取商品尺码属性 END////////////////////
// 库存对应的id(Zara 中以颜色id + 尺码id)
String
skuStr
=
";"
+
size
+
";"
+
color
+
";"
;
String
skuStr
=
";"
+
color
+
";"
+
size
+
";"
;
//////////////////////////////////// 获取库存 ////////////////////////////////////////////
if
(
productSkuStockList
==
null
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论