Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
saturn
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alpha
saturn
Commits
00a87055
Commit
00a87055
authored
Jun 27, 2019
by
haowang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix code
parent
70fd4500
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
25 deletions
+37
-25
product.py
api/views/product.py
+37
-25
No files found.
api/views/product.py
View file @
00a87055
...
@@ -43,39 +43,51 @@ class ProductBatchCreate(BaseView):
...
@@ -43,39 +43,51 @@ class ProductBatchCreate(BaseView):
if
not
product_id
:
if
not
product_id
:
return
error
,
None
# 创建商品失败 未获取到商品ID
return
error
,
None
# 创建商品失败 未获取到商品ID
self
.
add_parallel_rpc_call_info
(
'create_brand'
,
'neptune/commodity/brand/create'
,
if
brand_info
:
cn_name
=
brand_info
.
get
(
'cnName'
),
icon
=
brand_info
.
get
(
'imgSrc'
)
,
self
.
add_parallel_rpc_call_info
(
'create_brand'
,
'neptune/commodity/brand/create'
,
description
=
brand_info
.
get
(
'description'
),
en_name
=
brand_info
.
get
(
'en_name
'
),
cn_name
=
brand_info
.
get
(
'cnName'
),
icon
=
brand_info
.
get
(
'imgSrc
'
),
origin_brand_id
=
brand_info
.
get
(
'id'
),
platform
=
PRODUCT_FLATFORM
.
BEVOL
,
product_id
=
product_id
)
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'
,
origin_brand_id
=
brand_info
.
get
(
'id'
),
platform
=
PRODUCT_FLATFORM
.
BEVOL
,
product_id
=
product_id
)
infos
=
composition_infos
,
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'
,
self
.
add_parallel_rpc_call_info
(
'create_category'
,
'neptune/commodity/category/create'
,
infos
=
composition_infos
,
platform
=
PRODUCT_FLATFORM
.
BEVOL
,
product_id
=
product_id
)
cn_name
=
category_info
.
get
(
'name'
),
platform
=
PRODUCT_FLATFORM
.
BEVOL
,
origin_category_id
=
category_info
.
get
(
'id'
),
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'
,
if
effect_info
:
cn_name
=
effect_info
.
get
(
'name'
),
origin_effect_id
=
effect_info
.
get
(
'id'
),
self
.
add_parallel_rpc_call_info
(
'create_effect'
,
'neptune/commodity/effect/create'
,
platform
=
PRODUCT_FLATFORM
.
BEVOL
,
product_id
=
product_id
)
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
()
self
.
shoot_rpc_calls_in_parallel
()
error
,
_
=
self
.
parallel_rpc_call_result
[
'create_brand'
]
if
brand_info
:
if
error
:
error
,
_
=
self
.
parallel_rpc_call_result
[
'create_brand'
]
return
error
,
None
if
error
:
print
(
'create_brand'
)
return
error
,
None
error
,
_
=
self
.
parallel_rpc_call_result
[
'batch_create_composition'
]
if
composition_infos
:
if
error
:
error
,
_
=
self
.
parallel_rpc_call_result
[
'batch_create_composition'
]
return
error
,
None
if
error
:
print
(
'batch_create_composition'
)
return
error
,
None
error
,
_
=
self
.
parallel_rpc_call_result
[
'create_category'
]
if
category_info
:
if
error
:
error
,
_
=
self
.
parallel_rpc_call_result
[
'create_category'
]
return
error
,
None
if
error
:
print
(
'create_category'
)
return
error
,
None
error
,
_
=
self
.
parallel_rpc_call_result
[
'create_effect'
]
if
effect_info
:
if
error
:
error
,
_
=
self
.
parallel_rpc_call_result
[
'create_effect'
]
return
error
,
None
if
error
:
print
(
'create_effect'
,
effect_info
)
return
error
,
None
return
None
,
result
return
None
,
result
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment