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
c0a41b2f
Commit
c0a41b2f
authored
Jan 11, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
f966fb03
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
1 deletions
+33
-1
xggsve-order/app/base/db/impl/order/oorderprocessDao.js
+9
-0
xggsve-order/app/base/service/impl/order/oorderstatusSve.js
+24
-1
No files found.
xggsve-order/app/base/db/impl/order/oorderprocessDao.js
View file @
c0a41b2f
...
@@ -6,6 +6,15 @@ class OorderprocessDao extends Dao {
...
@@ -6,6 +6,15 @@ class OorderprocessDao extends Dao {
super
(
Dao
.
getModelName
(
OorderprocessDao
));
super
(
Dao
.
getModelName
(
OorderprocessDao
));
}
}
async
delByOrderId
(
order_id
)
{
if
(
!
order_id
)
{
return
;
}
let
sql
=
"DELETE FROM o_order_process WHERE order_id = :order_id"
;
await
this
.
customUpdate
(
sql
,
{
order_id
:
order_id
});
}
async
findByOrderIdAndStatus
(
orderId
,
status
)
{
async
findByOrderIdAndStatus
(
orderId
,
status
)
{
if
(
!
orderId
||
!
status
)
{
if
(
!
orderId
||
!
status
)
{
return
null
;
return
null
;
...
...
xggsve-order/app/base/service/impl/order/oorderstatusSve.js
View file @
c0a41b2f
...
@@ -8,6 +8,8 @@ class OorderstatusService extends ServiceBase {
...
@@ -8,6 +8,8 @@ class OorderstatusService extends ServiceBase {
constructor
()
{
constructor
()
{
super
(
"order"
,
ServiceBase
.
getDaoName
(
OorderstatusService
));
super
(
"order"
,
ServiceBase
.
getDaoName
(
OorderstatusService
));
this
.
oorderSve
=
system
.
getObject
(
"service.order.oorderSve"
);
this
.
oorderinforegDao
=
system
.
getObject
(
"db.order.oorderinforegDao"
);
this
.
oorderinforegDao
=
system
.
getObject
(
"db.order.oorderinforegDao"
);
this
.
oorderdeliverDao
=
system
.
getObject
(
"db.order.oorderdeliverDao"
);
this
.
oorderdeliverDao
=
system
.
getObject
(
"db.order.oorderdeliverDao"
);
this
.
oorderprocessDao
=
system
.
getObject
(
"db.order.oorderprocessDao"
);
this
.
oorderprocessDao
=
system
.
getObject
(
"db.order.oorderprocessDao"
);
...
@@ -40,6 +42,28 @@ class OorderstatusService extends ServiceBase {
...
@@ -40,6 +42,28 @@ class OorderstatusService extends ServiceBase {
if
(
!
_order
)
{
if
(
!
_order
)
{
return
system
.
getResult
(
null
,
`订单不存在`
);
return
system
.
getResult
(
null
,
`订单不存在`
);
}
}
// 完善订单特殊处理
if
(
_order
.
status
==
1010
)
{
let
chooseItems
=
[];
for
(
let
citem
of
this
.
trim
(
params
.
service_items
).
split
(
","
))
{
let
productId
=
Number
(
this
.
trim
(
citem
)
||
0
);
if
(
productId
)
{
chooseItems
.
push
(
productId
);
}
}
let
orderProcessList
=
await
this
.
oorderSve
.
buildOrderProcess
(
_order
.
product_id
,
chooseItems
);
if
(
!
orderProcessList
||
orderProcessList
.
length
==
0
)
{
return
system
.
getResult
(
null
,
"产品流程未配置"
);
}
for
(
let
process
of
orderProcessList
)
{
process
.
order_id
=
_order
.
id
;
}
await
this
.
oorderprocessDao
.
delByOrderId
(
_order
.
id
);
await
this
.
oorderprocessDao
.
bulkCreate
(
orderProcessList
);
}
let
_orderStatus
=
await
this
.
getOrderProcessStatus
(
_order
.
id
,
_order
.
status
);
let
_orderStatus
=
await
this
.
getOrderProcessStatus
(
_order
.
id
,
_order
.
status
);
let
nextList
=
JSON
.
parse
(
_orderStatus
.
next_status
);
let
nextList
=
JSON
.
parse
(
_orderStatus
.
next_status
);
_orderStatus
.
next_status
=
nextList
;
_orderStatus
.
next_status
=
nextList
;
...
@@ -154,7 +178,6 @@ class OorderstatusService extends ServiceBase {
...
@@ -154,7 +178,6 @@ class OorderstatusService extends ServiceBase {
params
.
_order
.
service_items
=
this
.
trim
(
params
.
service_items
);
params
.
_order
.
service_items
=
this
.
trim
(
params
.
service_items
);
params
.
_order
.
service_remark
=
this
.
trim
(
params
.
service_remark
);
params
.
_order
.
service_remark
=
this
.
trim
(
params
.
service_remark
);
params
.
_order
.
status
=
this
.
trim
(
params
.
status
);
params
.
_order
.
status
=
this
.
trim
(
params
.
status
);
try
{
try
{
//开启事务
//开启事务
await
this
.
db
.
transaction
(
async
t
=>
{
await
this
.
db
.
transaction
(
async
t
=>
{
...
...
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