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
ef1b611d
Commit
ef1b611d
authored
Sep 15, 2020
by
王勇飞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gyq
parent
6c6864e4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
42 deletions
+50
-42
tx-fi-tax/app/base/service/impl/bizchance/deliverybillSve.js
+50
-42
No files found.
tx-fi-tax/app/base/service/impl/bizchance/deliverybillSve.js
View file @
ef1b611d
...
...
@@ -14,51 +14,59 @@ class DeliverybillService extends ServiceBase {
}
async
updateOrderStatus
(
pobj
)
{
let
deliverData
=
await
this
.
dao
.
findOne
({
id
:
pobj
.
deliverId
});
if
(
!
deliverData
)
{
throw
new
Error
(
"查不到此交付单"
);
}
if
(
deliverData
.
delivery_status
!==
system
.
SERVERSESTATUS
.
RECEIVED
)
{
throw
new
Error
(
"该状态下不可处理"
);
}
if
(
!
deliverData
.
delivery_info
.
companyName
)
{
throw
new
Error
(
"查不到对应公司名称"
);
}
let
updateResult
=
{};
let
{
delivery_info
}
=
deliverData
;
if
(
pobj
.
orderStaus
===
true
)
{
updateResult
=
{
delivery_info
:
{
...
delivery_info
,
setupAt
:
pobj
.
setupAt
//建账时间
},
delivery_status
:
system
.
SERVERSESTATUS
.
WAITUSERCONFIRM
try
{
let
deliverData
=
await
this
.
dao
.
findOne
({
id
:
pobj
.
deliverId
});
if
(
!
deliverData
)
{
throw
new
Error
(
"查不到此交付单"
);
}
}
if
(
pobj
.
orderStaus
===
false
)
{
updateResult
=
{
delivery_status
:
system
.
SERVERSESTATUS
.
CLOSED
,
close_reason
:
pobj
.
note
if
(
deliverData
.
delivery_status
!==
system
.
SERVERSESTATUS
.
RECEIVED
)
{
throw
new
Error
(
"该状态下不可处理"
);
}
if
(
!
deliverData
.
delivery_info
.
companyName
)
{
throw
new
Error
(
"查不到对应公司名称"
);
}
let
updateResult
=
{};
let
{
delivery_info
}
=
deliverData
;
if
(
pobj
.
orderStaus
===
true
)
{
updateResult
=
{
delivery_info
:
{
...
delivery_info
,
setupAt
:
pobj
.
setupAt
//建账时间
},
delivery_status
:
system
.
SERVERSESTATUS
.
WAITUSERCONFIRM
}
}
if
(
pobj
.
orderStaus
===
false
)
{
updateResult
=
{
delivery_status
:
system
.
SERVERSESTATUS
.
CLOSED
,
close_reason
:
pobj
.
note
}
}
// 通过消息队列 发送 融易算
await
toFtClient
.
feedbackToRys
({
...
pobj
,
bizId
:
deliverData
.
delivery_info
.
bizId
});
await
this
.
dao
.
updateByWhere
(
updateResult
,
{
id
:
pobj
.
deliverId
});
this
.
logService
.
insertInfo
({
flowType
:
system
.
FLOWCODE
.
DELIVERY
,
flowId
:
pobj
.
deliverId
,
statusCode
:
updateResult
.
delivery_status
,
clerkName
:
pobj
.
userid
,
clerkId
:
pobj
.
username
});
console
.
log
(
"deliverySve:updateOrderStatus:success-----------------------------------------success"
);
return
"SUCCESS"
}
// 通过消息队列 发送 融易算
await
toFtClient
.
feedbackToRys
({
...
pobj
,
bizId
:
deliverData
.
delivery_info
.
bizId
});
await
this
.
dao
.
updateByWhere
(
updateResult
,
{
id
:
pobj
.
deliverId
});
this
.
logService
.
insertInfo
({
flowType
:
system
.
FLOWCODE
.
DELIVERY
,
flowId
:
pobj
.
deliverId
,
statusCode
:
updateResult
.
delivery_status
,
clerkName
:
pobj
.
userid
,
clerkId
:
pobj
.
username
});
return
"SUCCESS"
catch
(
error
){
console
.
log
(
"deliverySve:updateOrderStatus:error------------------------------------------"
+
error
);
return
error
;
}
}
async
setupBill
(
pobj
)
{
...
...
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