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
f3237448
Commit
f3237448
authored
Jan 09, 2020
by
孙亚楠
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'xggsve-order-dev' of gitlab.gongsibao.com:jiangyong/zhichan into xggsve-order-dev
parents
486fd5df
3f5cbd63
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
11 deletions
+45
-11
xggsve-order/app/base/db/impl/order/oorderprocessDao.js
+27
-3
xggsve-order/app/base/service/impl/order/oorderSve.js
+2
-2
xggsve-order/app/base/service/impl/order/oorderstatusSve.js
+16
-6
No files found.
xggsve-order/app/base/db/impl/order/oorderprocessDao.js
View file @
f3237448
const
system
=
require
(
"../../../system"
);
const
Dao
=
require
(
"../../dao.base"
);
class
OorderprocessDao
extends
Dao
{
constructor
()
{
super
(
Dao
.
getModelName
(
OorderprocessDao
));
}
async
mapByOrderIdsAndStatus
(
orderIds
,
statuses
)
{
async
findByOrderIdAndStatus
(
orderId
,
status
)
{
if
(
!
orderId
||
!
status
)
{
return
null
;
}
let
sql
=
[];
sql
.
push
(
"SELECT"
);
sql
.
push
(
"*"
);
sql
.
push
(
"FROM `o_order_process`"
);
sql
.
push
(
"WHERE order_id = :orderId"
);
sql
.
push
(
"AND `status` = :status"
);
let
list
=
await
this
.
customQuery
(
sql
.
join
(
" "
),
{
orderId
:
orderId
,
status
:
status
});
if
(
!
list
||
list
.
length
==
0
)
{
return
null
;
}
return
list
[
0
];
}
async
listByOrderIdsAndStatus
(
orderIds
,
statuses
)
{
var
result
=
{};
if
(
!
orderIds
||
orderIds
.
length
==
0
||
!
statuses
||
statuses
.
length
==
0
)
{
if
(
!
orderIds
||
orderIds
.
length
==
0
||
!
statuses
||
statuses
.
length
==
0
)
{
return
result
;
}
let
sql
=
[];
...
...
@@ -17,8 +36,12 @@ class OorderprocessDao extends Dao {
sql
.
push
(
"WHERE order_id IN (:orderIds)"
);
sql
.
push
(
"AND `status` IN (:statuses)"
);
let
list
=
await
this
.
customQuery
(
sql
.
join
(
" "
),
{
orderIds
:
orderIds
,
statuses
:
statuses
});
return
await
this
.
customQuery
(
sql
.
join
(
" "
),
{
orderIds
:
orderIds
,
statuses
:
statuses
});
}
async
mapByOrderIdsAndStatus
(
orderIds
,
statuses
)
{
var
result
=
{};
let
list
=
await
this
.
listByOrderIdsAndStatus
(
orderIds
,
statuses
);
if
(
!
list
||
list
.
length
==
0
)
{
return
result
;
}
...
...
@@ -29,4 +52,5 @@ class OorderprocessDao extends Dao {
return
result
;
}
}
module
.
exports
=
OorderprocessDao
;
xggsve-order/app/base/service/impl/order/oorderSve.js
View file @
f3237448
...
...
@@ -369,7 +369,7 @@ class OorderService extends ServiceBase {
* @deliver_id String 交付商ID
* @deliver_name String 交付商名称
* @deliver_deliver String 交付商分成
* @status String 下一个状态码
* @status String 下一个状态码
*/
async
assignDeliver
(
params
)
{
//参数验证
...
...
@@ -409,7 +409,7 @@ class OorderService extends ServiceBase {
}
}
}
...
...
xggsve-order/app/base/service/impl/order/oorderstatusSve.js
View file @
f3237448
...
...
@@ -36,17 +36,27 @@ class OorderstatusService extends ServiceBase {
return
system
.
getResult
(
null
,
`订单不存在`
);
}
let
_orderStatus
=
await
this
.
getOrderProcessStatus
(
_order
.
id
,
_order
.
status
);
let
nextStatus
=
JSON
.
parse
(
_orderStatus
.
next_status
);
var
statuses
=
[];
for
(
var
ns
of
nextStatus
)
{
statuses
.
push
(
ns
.
next_status
);
let
nextList
=
JSON
.
parse
(
_orderStatus
.
next_status
);
let
flag
=
false
;
let
nextNames
=
[];
for
(
var
nextItem
of
nextList
)
{
nextNames
.
push
(
nextItem
.
next_name
);
if
(
nextItem
.
next_status
==
params
.
status
)
{
flag
=
true
;
break
;
}
}
if
(
statuses
.
indexOf
(
params
.
status
)
==
-
1
)
{
return
system
.
getResult
(
null
,
`订单状态错误,下一订单状态应该是
${
nextStatus
.
next_name
}
`
);
if
(
!
flag
)
{
nextNames
=
nextNames
.
join
(
"或"
);
return
system
.
getResult
(
null
,
`订单状态错误,下一订单状态应该是
${
nextNames
}
`
);
}
let
nextStatus
=
await
this
.
oorderprocessDao
.
findByOrderIdAndStatus
(
_order
.
id
,
params
.
status
);
params
.
_order
=
_order
;
//调用对应的方法 TODO SOMETHING .....
// 调用func
// await this[nextStatus.func](params);
}
catch
(
error
)
{
...
...
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