...
|
...
|
@@ -55,21 +55,27 @@ const task = async(id) => { |
|
|
|
|
|
const productId = detail.productId;
|
|
|
const soldNum = detail.soldNum;
|
|
|
const sizes = sizeList.map(sizeItem => {
|
|
|
return {
|
|
|
size: sizeItem.size,
|
|
|
price: _.isEmpty(sizeItem.item) ? 0 : sizeItem.item.price,
|
|
|
soldNum: 0
|
|
|
};
|
|
|
});
|
|
|
|
|
|
const dest = await processBuys({
|
|
|
const articleNumber = detail.articleNumber;
|
|
|
|
|
|
// const sizes = sizeList.map(sizeItem => {
|
|
|
// return {
|
|
|
// size: sizeItem.size,
|
|
|
// price: _.isEmpty(sizeItem.item) ? 0 : sizeItem.item.price,
|
|
|
// soldNum: 0
|
|
|
// };
|
|
|
// });
|
|
|
|
|
|
// const dest = await processBuys({
|
|
|
// productId,
|
|
|
// soldNum,
|
|
|
// sizes
|
|
|
// });
|
|
|
|
|
|
return {
|
|
|
productId,
|
|
|
soldNum,
|
|
|
sizes
|
|
|
});
|
|
|
|
|
|
return dest;
|
|
|
articleNumber
|
|
|
};
|
|
|
}
|
|
|
};
|
|
|
|
...
|
...
|
@@ -87,7 +93,7 @@ module.exports = async() => { |
|
|
lockTask(id).then(async result => {
|
|
|
if (result) {
|
|
|
|
|
|
logger.info(`time:${now}; productId:${id}; soldNum:${result.soldNum}; sizeSoldNum:${_.sumBy(result.sizes, 'soldNum')}`);
|
|
|
logger.info(`time:${now}; productId:${id}; soldNum:${result.soldNum};`);
|
|
|
|
|
|
fw.write(`${JSON.stringify(result)}\n`);
|
|
|
}
|
...
|
...
|
|