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
3aabdf86
Commit
3aabdf86
authored
Dec 08, 2019
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
5634da84
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
12 deletions
+55
-12
xggsve-order/app/base/service/impl/order/iborderSve.js
+55
-12
No files found.
xggsve-order/app/base/service/impl/order/iborderSve.js
View file @
3aabdf86
...
...
@@ -11,6 +11,9 @@ class IborderService extends ServiceBase {
this
.
microsveClient
=
system
.
getObject
(
"util.microsve.microsveClient"
);
this
.
businessmenDao
=
system
.
getObject
(
"db.business.businessmenDao"
);
this
.
iborderbaseDao
=
system
.
getObject
(
"db.order.iborderbaseDao"
);
this
.
paymentDao
=
system
.
getObject
(
"db.order.paymentDao"
);
}
async
api
(
params
)
{
...
...
@@ -167,7 +170,6 @@ class IborderService extends ServiceBase {
}
}
// -----------------------以此间隔,上面为API下面为service---------------------------------
async
createOrder
(
params
,
t
)
{
...
...
@@ -199,6 +201,8 @@ class IborderService extends ServiceBase {
}
async
completedOrder
(
params
,
t
)
{
let
order
=
this
.
findById
(
params
.
id
);
if
(
!
order
.
legalName
)
{
return
system
.
getResult
(
null
,
'法人姓名'
);
}
...
...
@@ -229,7 +233,7 @@ class IborderService extends ServiceBase {
if
(
!
order
.
businessType
)
{
return
system
.
getResult
(
null
,
'经营范围'
);
}
if
(
!
order
.
businessScop
)
{
if
(
!
order
.
businessScop
e
)
{
return
system
.
getResult
(
null
,
'经营范围详情'
);
}
if
(
!
order
.
mailAddr
)
{
...
...
@@ -242,6 +246,14 @@ class IborderService extends ServiceBase {
return
system
.
getResult
(
null
,
'收件人电话'
);
}
order
.
isInfoComplete
=
true
;
let
orderBase
=
await
this
.
iborderbaseDao
.
findById
(
params
.
id
);
orderBase
.
isInfoComplete
=
true
;
await
order
.
save
();
await
orderBase
.
save
();
return
system
.
getResultSuccess
();
}
async
statTransData
(
params
)
{
...
...
@@ -394,34 +406,38 @@ class IborderService extends ServiceBase {
}
async
add
(
params
)
{
var
order
=
{};
let
order
=
{};
order
.
price
=
Number
(
params
.
price
||
300000
);
order
.
status
=
"1000"
;
var
merchantId
=
params
.
merchantId
||
params
.
merchant_id
;
let
payStatus
=
10
;
let
payType
=
1
;
let
merchantId
=
params
.
merchantId
||
params
.
merchant_id
;
if
(
merchantId
)
{
var
exists
=
await
this
.
dao
.
findOne
({
let
exists
=
await
this
.
dao
.
findOne
({
merchant_id
:
this
.
trim
(
merchantId
),
channelOrderNo
:
this
.
trim
(
params
.
channelOrderNo
),
});
if
(
exists
)
{
return
system
.
getResult
(
null
,
"订单号【"
+
params
.
channelOrderNo
+
"】重复"
);
}
var
merchantData
=
await
this
.
microsveClient
.
call
(
"merchant"
,
"getById"
,
{
let
merchantData
=
await
this
.
microsveClient
.
call
(
"merchant"
,
"getById"
,
{
"id"
:
merchantId
});
if
(
merchantData
.
status
!=
0
)
{
return
merchantData
;
}
var
merchant
=
merchantData
.
data
;
let
merchant
=
merchantData
.
data
;
if
(
!
merchant
.
mustPay
)
{
order
.
price
=
0
;
order
.
status
=
"1020"
;
payStatus
=
20
;
// 设置已支付
payType
=
2
;
// 设置为按年支付
}
}
var
busiStatus
=
await
this
.
orderBusinessStatus
.
findOrderBusinessStatus
(
order
.
status
);
let
busiStatus
=
await
this
.
orderBusinessStatus
.
findOrderBusinessStatus
(
order
.
status
);
if
(
busiStatus
)
{
order
.
ostatus
=
busiStatus
.
ostatus
;
}
...
...
@@ -462,11 +478,38 @@ class IborderService extends ServiceBase {
order
.
userId
=
this
.
trim
(
params
.
userId
);
// var baseOrder = {};
// baseOrder = await this.baseorderDao.create(baseOrder);
// order.id = baseOrder.id;
let
baseOrder
=
{
merchant_id
:
merchantId
,
businessmen_id
:
""
,
channelNo
:
"qiye"
,
thirdNo
:
order
.
channelOrderNo
,
productType
:
1000
,
bdId
:
order
.
bdId
,
bdPath
:
order
.
bdPath
,
price
:
order
.
price
,
payStatus
:
payStatus
,
status
:
1000
,
isInfoComplete
:
true
,
};
order
=
await
this
.
db
.
transaction
(
async
t
=>
{
baseOrder
=
await
this
.
iborderbaseDao
.
create
(
baseOrder
,
t
);
order
.
id
=
baseOrder
.
id
;
let
payment
=
{
order_id
:
baseOrder
.
id
,
price
:
baseOrder
.
price
,
channelName
:
""
,
companyName
:
merchant
.
name
,
payType
:
payType
,
payStatus
:
"10"
,
};
payment
=
await
this
.
paymentDao
.
create
(
payment
,
t
);
params
.
orderpay_id
=
payment
.
id
;
order
=
await
this
.
dao
.
create
(
order
);
order
=
await
this
.
dao
.
create
(
order
,
t
);
return
order
;
});
return
system
.
getResultSuccess
({
orderNo
:
order
.
id
});
...
...
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