Commit 2318b792 authored by 王浩's avatar 王浩

Merge branch 'haow/dev' into 'test'

fix code

See merge request alpha/saturn!67
parents 70fd4500 00a87055
......@@ -43,39 +43,51 @@ class ProductBatchCreate(BaseView):
if not product_id:
return error, None # 创建商品失败 未获取到商品ID
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)
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'),
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)
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)
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)
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)
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()
error, _ = self.parallel_rpc_call_result['create_brand']
if error:
return error, None
if brand_info:
error, _ = self.parallel_rpc_call_result['create_brand']
if error:
print('create_brand')
return error, None
error, _ = self.parallel_rpc_call_result['batch_create_composition']
if error:
return error, None
if composition_infos:
error, _ = self.parallel_rpc_call_result['batch_create_composition']
if error:
print('batch_create_composition')
return error, None
error, _ = self.parallel_rpc_call_result['create_category']
if error:
return error, None
if category_info:
error, _ = self.parallel_rpc_call_result['create_category']
if error:
print('create_category')
return error, None
error, _ = self.parallel_rpc_call_result['create_effect']
if error:
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