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
c26b0e56
Commit
c26b0e56
authored
Nov 10, 2020
by
Sxy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 流程优化
parent
c2842f9c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
39 deletions
+41
-39
icp-deliver/app/base/service/impl/delivery/deliverSve.js
+41
-39
No files found.
icp-deliver/app/base/service/impl/delivery/deliverSve.js
View file @
c26b0e56
...
@@ -114,7 +114,7 @@ class DeliverService extends ServiceBase {
...
@@ -114,7 +114,7 @@ class DeliverService extends ServiceBase {
if
(
!
deliverData
)
{
if
(
!
deliverData
)
{
throw
new
Error
(
'没有此交付单'
);
throw
new
Error
(
'没有此交付单'
);
}
}
if
(
!
[
system
.
SERVERSESTATUS
.
SUBMITING
,
system
.
SERVERSESTATUS
.
POSTING
].
includes
(
deliverData
.
delivery_status
))
{
if
(
!
[
system
.
SERVERSESTATUS
.
SUBMITING
,
system
.
SERVERSESTATUS
.
DISPOSEING
,
system
.
SERVERSESTATUS
.
POSTING
].
includes
(
deliverData
.
delivery_status
))
{
throw
new
Error
(
'此状态下不可手动更新办理状态'
);
throw
new
Error
(
'此状态下不可手动更新办理状态'
);
}
}
let
status
;
let
status
;
...
@@ -124,6 +124,10 @@ class DeliverService extends ServiceBase {
...
@@ -124,6 +124,10 @@ class DeliverService extends ServiceBase {
status
=
system
.
SERVERSESTATUS
.
DISPOSEING
;
status
=
system
.
SERVERSESTATUS
.
DISPOSEING
;
txstatus
=
pushTx
.
TXSTATUS
.
DISPOSEING
;
txstatus
=
pushTx
.
TXSTATUS
.
DISPOSEING
;
break
;
break
;
case
system
.
SERVERSESTATUS
.
DISPOSEING
:
status
=
system
.
SERVERSESTATUS
.
POSTING
;
txstatus
=
pushTx
.
TXSTATUS
.
POSTING
;
break
;
case
system
.
SERVERSESTATUS
.
POSTING
:
case
system
.
SERVERSESTATUS
.
POSTING
:
status
=
system
.
SERVERSESTATUS
.
SUCCESS
;
status
=
system
.
SERVERSESTATUS
.
SUCCESS
;
txstatus
=
pushTx
.
TXSTATUS
.
SUCCESS
;
txstatus
=
pushTx
.
TXSTATUS
.
SUCCESS
;
...
@@ -188,16 +192,17 @@ class DeliverService extends ServiceBase {
...
@@ -188,16 +192,17 @@ class DeliverService extends ServiceBase {
}
}
if
(
if
(
!
[
system
.
SERVERSESTATUS
.
DISPOSEING
,
!
[
system
.
SERVERSESTATUS
.
DISPOSEING
,
system
.
SERVERSESTATUS
.
SUCCESS
,
system
.
SERVERSESTATUS
.
SUCCESS
,
system
.
SERVERSESTATUS
.
POSTING
].
includes
(
deliverData
.
delivery_status
)
system
.
SERVERSESTATUS
.
POSTING
].
includes
(
deliverData
.
delivery_status
)
)
{
)
{
throw
new
Error
(
'该交付单状态下不可提交'
);
throw
new
Error
(
'该交付单状态下不可提交'
);
}
}
if
([
system
.
SERVERSESTATUS
.
SUCCESS
,
system
.
SERVERSESTATUS
.
POSTING
].
includes
(
deliverData
.
delivery_status
))
{
if
([
system
.
SERVERSESTATUS
.
SUCCESS
,
system
.
SERVERSESTATUS
.
POSTING
,
system
.
SERVERSESTATUS
.
DISPOSEING
].
includes
(
deliverData
.
delivery_status
))
{
// 给腾讯 发消息
// 给腾讯 发消息
const
STATUS
=
{
const
STATUS
=
{
success
:
pushTx
.
TXSTATUS
.
SUCCESS
,
success
:
pushTx
.
TXSTATUS
.
SUCCESS
,
posting
:
pushTx
.
TXSTATUS
.
POSTING
,
posting
:
pushTx
.
TXSTATUS
.
POSTING
,
disposeing
:
pushTx
.
TXSTATUS
.
DISPOSEING
};
};
await
pushTx
.
pushChangeOrder
(
STATUS
[
deliverData
.
delivery_status
],
deliverData
.
delivery_code
,
{
await
pushTx
.
pushChangeOrder
(
STATUS
[
deliverData
.
delivery_status
],
deliverData
.
delivery_code
,
{
...
@@ -338,22 +343,14 @@ class DeliverService extends ServiceBase {
...
@@ -338,22 +343,14 @@ class DeliverService extends ServiceBase {
}
}
async
addMail
(
pobj
)
{
async
addMail
(
pobj
)
{
/**
* 判断状态
* 保存 邮寄信息
* 更改流转状态
*/
const
result
=
await
this
.
dao
.
findInfo
(
pobj
);
const
result
=
await
this
.
dao
.
findInfo
(
pobj
);
if
(
!
result
)
{
if
(
!
result
)
{
throw
new
Error
(
'交付单不可查看'
);
throw
new
Error
(
'交付单不可查看'
);
}
}
if
(
!
result
.
qualification
)
{
throw
new
Error
(
'请先上传资质信息'
);
}
if
(
if
(
!
[
system
.
SERVERSESTATUS
.
DISPOSEING
,
!
[
system
.
SERVERSESTATUS
.
DISPOSEING
,
system
.
SERVERSESTATUS
.
SUCCESS
,
system
.
SERVERSESTATUS
.
SUCCESS
,
system
.
SERVERSESTATUS
.
POSTING
].
includes
(
result
.
delivery_status
)
system
.
SERVERSESTATUS
.
POSTING
].
includes
(
result
.
delivery_status
)
)
{
)
{
throw
new
Error
(
'该状态下不可填写邮寄信息'
);
throw
new
Error
(
'该状态下不可填写邮寄信息'
);
}
}
...
@@ -367,38 +364,43 @@ class DeliverService extends ServiceBase {
...
@@ -367,38 +364,43 @@ class DeliverService extends ServiceBase {
};
};
await
pushTx
.
pushChangeOrder
(
STATUS
[
result
.
delivery_status
],
result
.
delivery_code
,
{
await
pushTx
.
pushChangeOrder
(
STATUS
[
result
.
delivery_status
],
result
.
delivery_code
,
{
qualification
:
result
.
qualification
,
recipientInfo
:
{
recipientInfo
:
{
...
pobj
.
recipientInfo
,
...
pobj
.
recipientInfo
,
phone
:
encryptStr
(
pobj
.
recipientInfo
.
phone
),
phone
:
encryptStr
(
pobj
.
recipientInfo
.
phone
),
},
},
});
});
await
this
.
materialDao
.
updateByWhere
({
return
this
.
db
.
transaction
(
async
(
t
)
=>
{
proposerInfo
,
await
this
.
materialDao
.
updateByWhere
({
},
{
proposerInfo
,
id
:
material
.
id
,
},
{
id
:
material
.
id
,
},
t
);
if
(
system
.
SERVERSESTATUS
.
DISPOSEING
===
result
.
delivery_status
)
{
await
this
.
dao
.
updateByWhere
({
delivery_status
:
system
.
SERVERSESTATUS
.
POSTING
,
},
{
id
:
pobj
.
id
,
},
t
);
this
.
statuslogDao
.
create
({
flow_type
:
system
.
FLOWCODE
.
DELIVERY
,
flow_id
:
pobj
.
id
,
status_code
:
system
.
SERVERSESTATUS
.
POSTING
,
salesman_id
:
pobj
.
userid
,
salesman_name
:
pobj
.
username
,
});
}
return
'success'
;
});
});
return
"SUCCESS"
// return this.db.transaction(async (t) => {
// await this.materialDao.updateByWhere({
// proposerInfo,
// }, {
// id: material.id,
// }, t);
// if (system.SERVERSESTATUS.DISPOSEING === result.delivery_status) {
// await this.dao.updateByWhere({
// delivery_status: system.SERVERSESTATUS.POSTING,
// }, {
// id: pobj.id,
// }, t);
// this.statuslogDao.create({
// flow_type: system.FLOWCODE.DELIVERY,
// flow_id: pobj.id,
// status_code: system.SERVERSESTATUS.POSTING,
// salesman_id: pobj.userid,
// salesman_name: pobj.username,
// });
// }
// return 'success';
// });
}
}
async
findAnnualReportInfo
(
pobj
)
{
async
findAnnualReportInfo
(
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