Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
16492eba
Commit
16492eba
authored
Jul 03, 2020
by
孙亚楠
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
md
parent
a2290504
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
5 deletions
+14
-5
esign-sve-order/app/base/db/models/eorder/eorderproduct.js
+1
-0
esign-sve-order/app/base/service/impl/eorder/eorderSve.js
+13
-5
No files found.
esign-sve-order/app/base/db/models/eorder/eorderproduct.js
View file @
16492eba
...
@@ -8,6 +8,7 @@ module.exports = function (db, DataTypes) {
...
@@ -8,6 +8,7 @@ module.exports = function (db, DataTypes) {
product_id
:
{
type
:
DataTypes
.
STRING
,
field
:
'product_id'
,
allowNull
:
true
,
defaultValue
:
''
,
comment
:
'产品id'
},
product_id
:
{
type
:
DataTypes
.
STRING
,
field
:
'product_id'
,
allowNull
:
true
,
defaultValue
:
''
,
comment
:
'产品id'
},
price
:
{
type
:
DataTypes
.
BIGINT
,
field
:
'price'
,
allowNull
:
true
,
defaultValue
:
0
,
comment
:
'订单价格'
},
price
:
{
type
:
DataTypes
.
BIGINT
,
field
:
'price'
,
allowNull
:
true
,
defaultValue
:
0
,
comment
:
'订单价格'
},
product_name
:
{
type
:
DataTypes
.
STRING
,
field
:
'product_name'
,
allowNull
:
true
,
defaultValue
:
''
,
comment
:
'产品名称'
},
product_name
:
{
type
:
DataTypes
.
STRING
,
field
:
'product_name'
,
allowNull
:
true
,
defaultValue
:
''
,
comment
:
'产品名称'
},
product_property
:
{
type
:
DataTypes
.
INTEGER
,
field
:
'product_property'
,
allowNull
:
true
,
defaultValue
:
0
,
comment
:
'产品属性 1认证 2签约'
},
created_at
:
{
type
:
DataTypes
.
DATE
,
field
:
'created_at'
,
allowNull
:
false
},
created_at
:
{
type
:
DataTypes
.
DATE
,
field
:
'created_at'
,
allowNull
:
false
},
updated_at
:
{
type
:
DataTypes
.
DATE
,
field
:
'updated_at'
,
allowNull
:
false
},
updated_at
:
{
type
:
DataTypes
.
DATE
,
field
:
'updated_at'
,
allowNull
:
false
},
deleted_at
:
{
type
:
DataTypes
.
DATE
,
field
:
'deleted_at'
,
allowNull
:
true
},
deleted_at
:
{
type
:
DataTypes
.
DATE
,
field
:
'deleted_at'
,
allowNull
:
true
},
...
...
esign-sve-order/app/base/service/impl/eorder/eorderSve.js
View file @
16492eba
...
@@ -67,6 +67,9 @@ class EorderService extends ServiceBase {
...
@@ -67,6 +67,9 @@ class EorderService extends ServiceBase {
if
(
!
_orderBean
){
if
(
!
_orderBean
){
return
system
.
getResult
(
null
,
`订单【
${
params
.
id
}
】不存在`
);
return
system
.
getResult
(
null
,
`订单【
${
params
.
id
}
】不存在`
);
}
}
if
(
_orderBean
.
audit_status
!=
'10'
){
return
system
.
getResult
(
null
,
`订单【
${
_orderBean
.
id
}
】不能编辑`
);
}
let
_orderBeanProperties
=
{
id
:
_orderBean
.
id
};
let
_orderBeanProperties
=
{
id
:
_orderBean
.
id
};
_orderBeanProperties
.
merchant_id
=
params
.
merchant_id
?
params
.
merchant_id
:
_orderBean
.
merchant_id
;
_orderBeanProperties
.
merchant_id
=
params
.
merchant_id
?
params
.
merchant_id
:
_orderBean
.
merchant_id
;
_orderBeanProperties
.
merchant_name
=
params
.
merchant_name
?
params
.
merchant_name
:
_orderBean
.
merchant_name
;
_orderBeanProperties
.
merchant_name
=
params
.
merchant_name
?
params
.
merchant_name
:
_orderBean
.
merchant_name
;
...
@@ -117,7 +120,8 @@ class EorderService extends ServiceBase {
...
@@ -117,7 +120,8 @@ class EorderService extends ServiceBase {
order_id
:
_orderBean
.
id
,
order_id
:
_orderBean
.
id
,
product_id
:
productItemMap
[
key
].
id
,
product_id
:
productItemMap
[
key
].
id
,
product_name
:
productItemMap
[
key
].
product_name
,
product_name
:
productItemMap
[
key
].
product_name
,
price
:
productItemMap
[
key
].
price
price
:
productItemMap
[
key
].
price
,
product_property
:
productItemMap
[
key
].
product_property
});
});
}
}
_orderBeanProperties
.
eorderProducts
=
eorderProductProperties
;
_orderBeanProperties
.
eorderProducts
=
eorderProductProperties
;
...
@@ -144,7 +148,8 @@ class EorderService extends ServiceBase {
...
@@ -144,7 +148,8 @@ class EorderService extends ServiceBase {
order_id
:
orderBean
.
id
,
order_id
:
orderBean
.
id
,
product_id
:
productItemMap
[
key
].
id
,
product_id
:
productItemMap
[
key
].
id
,
product_name
:
productItemMap
[
key
].
product_name
,
product_name
:
productItemMap
[
key
].
product_name
,
price
:
productItemMap
[
key
].
price
price
:
productItemMap
[
key
].
price
,
product_property
:
productItemMap
[
key
].
product_property
});
});
}
}
await
this
.
eorderproductDao
.
bulkCreate
(
eorderProductProperties
,
t
);
await
this
.
eorderproductDao
.
bulkCreate
(
eorderProductProperties
,
t
);
...
@@ -264,7 +269,7 @@ class EorderService extends ServiceBase {
...
@@ -264,7 +269,7 @@ class EorderService extends ServiceBase {
},
},
attributes
:[
'product_id'
,
'product_name'
,
'price'
,
'order_id'
]
attributes
:[
'product_id'
,
'product_name'
,
'price'
,
'order_id'
]
});
});
orderBean
.
product
Children
=
productChildren
;
orderBean
.
product
_arr
=
productChildren
;
this
.
handleDate
(
orderBean
,
[
'created_at'
,
'pay_date'
,
'audit_date'
,
'live_start'
,
'live_end'
],
null
,
null
);
this
.
handleDate
(
orderBean
,
[
'created_at'
,
'pay_date'
,
'audit_date'
,
'live_start'
,
'live_end'
],
null
,
null
);
orderBean
.
product_type_name
=
orderBean
.
product_type
==
'1'
?
'单产品'
:
'组合产品'
;
orderBean
.
product_type_name
=
orderBean
.
product_type
==
'1'
?
'单产品'
:
'组合产品'
;
...
@@ -335,10 +340,10 @@ class EorderService extends ServiceBase {
...
@@ -335,10 +340,10 @@ class EorderService extends ServiceBase {
if
(
!
orderProductMap
[
childPro
.
order_id
]){
if
(
!
orderProductMap
[
childPro
.
order_id
]){
orderProductMap
[
childPro
.
order_id
]
=
[];
orderProductMap
[
childPro
.
order_id
]
=
[];
}
}
orderProductMap
[
childPro
.
order_id
].
push
(
childPro
.
product_id
);
orderProductMap
[
childPro
.
order_id
].
push
(
childPro
);
}
}
for
(
let
element
of
list
){
for
(
let
element
of
list
){
element
.
eorderproduct
=
orderProductMap
[
element
.
id
]
||
[]
;
element
.
eorderproduct
=
orderProductMap
[
element
.
id
]
||
{}
;
}
}
return
system
.
getResult
({
count
:
countRes
.
eorderCount
,
rows
:
list
});
return
system
.
getResult
({
count
:
countRes
.
eorderCount
,
rows
:
list
});
}
catch
(
e
)
{
}
catch
(
e
)
{
...
@@ -412,6 +417,9 @@ class EorderService extends ServiceBase {
...
@@ -412,6 +417,9 @@ class EorderService extends ServiceBase {
if
(
params
.
trade_id
){
if
(
params
.
trade_id
){
orderBean
.
trade_id
=
this
.
trim
(
params
.
trade_id
);
orderBean
.
trade_id
=
this
.
trim
(
params
.
trade_id
);
}
}
if
(
params
.
engine_account_id
){
orderBean
.
engine_account_id
=
this
.
trim
(
params
.
engine_account_id
);
}
try
{
try
{
await
orderBean
.
save
();
await
orderBean
.
save
();
return
system
.
getResultSuccess
();
return
system
.
getResultSuccess
();
...
...
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