Toggle navigation
Toggle navigation
This project
Loading...
Sign in
yoho-search
/
yoho-search-consumer
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
wangnan
8 years ago
Commit
839e9c833bda5541b6d26ca8488bd2e932f6ee59
1 parent
7be5bfbc
添加增量逻辑
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
2 deletions
consumer/src/main/java/com/yoho/search/mq/ProductPoolDetailMqListener.java
consumer/src/main/java/com/yoho/search/mq/ProductPoolDetailMqListener.java
View file @
839e9c8
package
com
.
yoho
.
search
.
mq
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.rabbitmq.client.Channel
;
import
com.yoho.error.event.SearchEvent
;
...
...
@@ -137,7 +136,30 @@ public class ProductPoolDetailMqListener extends AbstractMqListener implements C
//更新productPool
Map
<
String
,
Object
>
indexData
=
new
HashMap
<>();
ProductPool
productPool
=
productPoolService
.
getById
(
productPoolDetail
.
getId
());
this
.
updateProductPoolIndexWithDataMap
(
JSON
.
toJSONString
(
productPool
),
productPool
.
getId
(),
key
,
System
.
currentTimeMillis
());
indexData
.
put
(
"poolId"
,
productPool
.
getPoolId
());
indexData
.
put
(
"productSkn"
,
productPool
.
getProductSkn
());
indexData
.
put
(
"productId"
,
productPool
.
getProductId
());
indexData
.
put
(
"sales"
,
productPool
.
getSales
());
indexData
.
put
(
"brandId"
,
productPool
.
getBrandId
());
indexData
.
put
(
"status"
,
productPool
.
getStatus
());
indexData
.
put
(
"attribute"
,
productPool
.
getAttribute
());
indexData
.
put
(
"smallSortId"
,
productPool
.
getSmallSortId
());
indexData
.
put
(
"middleSortId"
,
productPool
.
getMiddleSortId
());
indexData
.
put
(
"maxSortId"
,
productPool
.
getMaxSortId
());
indexData
.
put
(
"gender"
,
productPool
.
getGender
());
indexData
.
put
(
"storageNum"
,
productPool
.
getStorageNum
());
indexData
.
put
(
"salesNum"
,
productPool
.
getSalesNum
());
indexData
.
put
(
"marketPrice"
,
productPool
.
getMarketPrice
());
indexData
.
put
(
"vipDiscountType"
,
productPool
.
getVipDiscountType
());
indexData
.
put
(
"isDiscount"
,
productPool
.
getIsDiscount
());
indexData
.
put
(
"isOutlets"
,
productPool
.
getIsOutlets
());
indexData
.
put
(
"sizeIds"
,
productPool
.
getSizeIds
());
try
{
indexService
.
updateIndexData
(
ISearchConstans
.
INDEX_NAME_PRODUCT_POOL
,
productPool
.
getId
().
toString
(),
indexData
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"[func=updateIndex][step=error][indexName={}][id={}][cost={}ms][error={}]"
,
ISearchConstans
.
INDEX_NAME_PRODUCT_POOL
,
productPool
.
getId
().
toString
(),
(
System
.
currentTimeMillis
()
-
begin
),
e
.
getMessage
());
}
}
}
}
...
...
Please
register
or
login
to post a comment