Commit 00a87055 authored by haowang's avatar haowang

fix code

parent 70fd4500
......@@ -43,38 +43,50 @@ class ProductBatchCreate(BaseView):
if not product_id:
return error, None # 创建商品失败 未获取到商品ID
if brand_info:
self.add_parallel_rpc_call_info('create_brand', 'neptune/commodity/brand/create',
cn_name=brand_info.get('cnName'), icon=brand_info.get('imgSrc'),
description=brand_info.get('description'), en_name=brand_info.get('en_name'),
origin_brand_id=brand_info.get('id'), platform=PRODUCT_FLATFORM.BEVOL, product_id=product_id)
origin_brand_id=brand_info.get('id'), platform=PRODUCT_FLATFORM.BEVOL, product_id=product_id)
if composition_infos:
self.add_parallel_rpc_call_info('batch_create_composition', 'neptune/commodity/composition/batch_create',
infos=composition_infos, platform=PRODUCT_FLATFORM.BEVOL, product_id=product_id)
if category_info:
self.add_parallel_rpc_call_info('create_category', 'neptune/commodity/category/create',
cn_name=category_info.get('name'), platform=PRODUCT_FLATFORM.BEVOL,
origin_category_id=category_info.get('id'), product_id=product_id)
if effect_info:
self.add_parallel_rpc_call_info('create_effect', 'neptune/commodity/effect/create',
cn_name=effect_info.get('name'), origin_effect_id=effect_info.get('id'),
platform=PRODUCT_FLATFORM.BEVOL, product_id=product_id)
self.shoot_rpc_calls_in_parallel()
if brand_info:
error, _ = self.parallel_rpc_call_result['create_brand']
if error:
print('create_brand')
return error, None
if composition_infos:
error, _ = self.parallel_rpc_call_result['batch_create_composition']
if error:
print('batch_create_composition')
return error, None
if category_info:
error, _ = self.parallel_rpc_call_result['create_category']
if error:
print('create_category')
return error, None
if effect_info:
error, _ = self.parallel_rpc_call_result['create_effect']
if error:
print('create_effect', effect_info)
return error, None
return None, result
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment