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
4f338a1c
Commit
4f338a1c
authored
Dec 22, 2020
by
Sxy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 工商推送启服通
parent
93fd114c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
146 additions
and
45 deletions
+146
-45
icp-deliver/app/base/service/impl/delivery/companyCaseSve.js
+47
-38
icp-deliver/app/base/utils/toQft/gongshangClient.js
+90
-0
icp-deliver/app/base/utils/toQft/guangboClient.js
+4
-4
icp-deliver/app/base/utils/toQft/index.js
+5
-3
No files found.
icp-deliver/app/base/service/impl/delivery/companyCaseSve.js
View file @
4f338a1c
...
...
@@ -20,33 +20,28 @@ class CompanycaseService extends ServiceBase {
const
deliverData
=
await
this
.
deliveryDao
.
findOne
({
id
:
pobj
.
deliver_id
});
if
(
!
deliverData
)
{
throw
new
Error
(
"查不到此交付单"
);
}
// await TOQFT.getClientByType(deliverData.product_code).submitMaterials(pobj.username, deliverData, pobj.cache_info);
return
this
.
db
.
transaction
(
async
(
t
)
=>
{
await
this
.
cacheinfoDao
.
createOrUpdate
(
pobj
,
t
);
await
this
.
newmaterialDao
.
createOrUpdate
(
pobj
,
t
);
// if ([system.SERVERSESTATUS.COLLECTING, system.SERVERSESTATUS.USERCONFIRMATIONREJECT].includes(deliverData.delivery_status)) {
// let status;
// if (deliverData.source_number === "aliCloud") {
// status = system.SERVERSESTATUS.USERCONFIRMATIONWAIT
// } else {
// status = system.SERVERSESTATUS.COLLECTSUCCESS;
// }
// await this.deliveryDao.updateByWhere({
// delivery_status: status
// }, {
// id: pobj.deliver_id
// }, t);
// this.statuslogDao.create({
// flow_type: system.FLOWCODE.DELIVERY,
// flow_id: pobj.deliver_id,
// status_code: status,
// salesman_id: pobj.userid,
// salesman_name: pobj.username
// });
// }
if
([
system
.
SERVERSESTATUS
.
COLLECTING
].
includes
(
deliverData
.
delivery_status
))
{
let
status
=
System
.
SERVERSESTATUS
.
AUDITING
;
await
this
.
deliveryDao
.
updateByWhere
({
delivery_status
:
status
},
{
id
:
pobj
.
deliver_id
},
t
);
this
.
statuslogDao
.
create
({
flow_type
:
system
.
FLOWCODE
.
DELIVERY
,
flow_id
:
pobj
.
deliver_id
,
status_code
:
status
,
salesman_id
:
pobj
.
userid
,
salesman_name
:
pobj
.
username
});
}
return
"SUCCESS"
});
}
...
...
@@ -60,24 +55,38 @@ class CompanycaseService extends ServiceBase {
}
let
status
;
switch
(
deliverData
.
delivery_status
)
{
// case system.SERVERSESTATUS.THROUGH:
// status = system.SERVERSESTATUS.SUCCESS;
// break
// default:
// throw new Error("此状态手动不能更改");
case
system
.
SERVERSESTATUS
.
RECEIVED
:
if
(
deliverData
.
product_code
===
System
.
SERVICECODE
.
COMPANYCASE
)
{
status
=
system
.
SERVERSESTATUS
.
COLLECTING
;
}
else
{
status
=
system
.
SERVERSESTATUS
.
SERVICEING
;
}
break
case
system
.
SERVERSESTATUS
.
AUDITING
:
// 工商审核环节
status
=
system
.
SERVERSESTATUS
.
ENGRAVING
;
break
case
system
.
SERVERSESTATUS
.
ENGRAVING
:
// 刻章环节
status
=
system
.
SERVERSESTATUS
.
SUCCESS
;
break
case
system
.
SERVERSESTATUS
.
SERVICEING
:
// 服务中
status
=
system
.
SERVERSESTATUS
.
SUCCESS
;
break
default
:
throw
new
Error
(
"此状态手动不能更改"
);
}
// await this.deliveryDao.updateByWhere({
// delivery_status: status
// }, {
// id: pobj.id
// })
// this.statuslogDao.create({
// flow_type: system.FLOWCODE.DELIVERY,
// flow_id: pobj.id,
// status_code: status,
// salesman_id: pobj.userid,
// salesman_name: pobj.username
// });
// await TOQFT.getClientByType(deliverData.product_code).changeStatus(pobj.username, deliverData);
await
this
.
deliveryDao
.
updateByWhere
({
delivery_status
:
status
},
{
id
:
pobj
.
id
})
this
.
statuslogDao
.
create
({
flow_type
:
system
.
FLOWCODE
.
DELIVERY
,
flow_id
:
pobj
.
id
,
status_code
:
status
,
salesman_id
:
pobj
.
userid
,
salesman_name
:
pobj
.
username
});
return
"SUCCESS"
}
}
...
...
icp-deliver/app/base/utils/toQft/gongshangClient.js
0 → 100644
View file @
4f338a1c
const
BaseClient
=
require
(
"./baseClient"
)
const
settings
=
require
(
"../../../config/settings"
);
const
system
=
require
(
"../../system"
);
const
{
appKey
,
secret
}
=
settings
;
/**
* 工商 产品
*/
class
GongshangClient
extends
BaseClient
{
constructor
()
{
super
(
appKey
,
secret
,
"/web/action/regapi/springBoard"
);
this
.
instance
=
null
;
this
.
CIRCUITSTATUS
=
{
RECEIVED
:
701
,
//已接单
COLLECTING
:
702
,
//材料收集环节
AUDITING
:
703
,
//工商审核环节
ENGRAVING
:
704
,
//刻章环节
SUCCESS
:
705
,
//已完成
}
}
static
getInstance
()
{
if
(
!
this
.
instance
)
{
this
.
instance
=
new
GongshangClient
();
}
return
this
.
instance
;
}
async
submitMaterials
(
username
,
deliverData
,
materials
)
{
const
{
companyInfo
,
materialFile
,
}
=
materials
;
// TODO: 封装材料
let
status
;
switch
(
deliverData
.
delivery_status
)
{
case
system
.
SERVERSESTATUS
.
COLLECTING
:
// 工商审核环节
status
=
this
.
CIRCUITSTATUS
.
COLLECTING
;
break
case
system
.
SERVERSESTATUS
.
AUDITING
:
// 工商审核环节
status
=
this
.
CIRCUITSTATUS
.
AUDITING
;
break
case
system
.
SERVERSESTATUS
.
ENGRAVING
:
// 刻章环节
status
=
this
.
CIRCUITSTATUS
.
ENGRAVING
;
break
case
system
.
SERVERSESTATUS
.
SUCCESS
:
// 服务中
status
=
system
.
SERVERSESTATUS
.
SUCCESS
;
break
default
:
throw
new
Error
(
"此状态手动不能更改"
);
}
await
this
.
pushQiFuTong
(
username
,
{
actionType
:
"regUpdateOrderStatus"
,
actionBody
:
{
orderNo
:
deliverData
.
delivery_code
,
status
,
}
});
}
async
changeStatus
(
username
,
deliverData
,
materials
=
{})
{
let
status
;
switch
(
deliverData
.
delivery_status
)
{
case
system
.
SERVERSESTATUS
.
RECEIVED
:
if
(
deliverData
.
product_code
===
System
.
SERVICECODE
.
COMPANYCASE
)
{
status
=
this
.
CIRCUITSTATUS
.
COLLECTING
;
}
else
{
status
=
"TODO:"
;
}
break
case
system
.
SERVERSESTATUS
.
AUDITING
:
// 工商审核环节
status
=
this
.
CIRCUITSTATUS
.
ENGRAVING
;
break
case
system
.
SERVERSESTATUS
.
ENGRAVING
:
// 刻章环节
status
=
this
.
CIRCUITSTATUS
.
SUCCESS
;
break
case
system
.
SERVERSESTATUS
.
SERVICEING
:
// 服务中
status
=
system
.
SERVERSESTATUS
.
SUCCESS
;
break
default
:
throw
new
Error
(
"此状态手动不能更改"
);
}
await
this
.
pushQiFuTong
(
username
,
{
actionType
:
"regUpdateOrderStatus"
,
actionBody
:
{
orderNo
:
deliverData
.
delivery_code
,
status
,
}
});
}
}
module
.
exports
=
GongshangClient
\ No newline at end of file
icp-deliver/app/base/utils/toQft/guangboClient.js
View file @
4f338a1c
...
...
@@ -5,7 +5,7 @@ const { appKey, secret } = settings;
/**
* 广播电视 产品
*/
class
Wangwen
Client
extends
BaseClient
{
class
Guangbo
Client
extends
BaseClient
{
constructor
()
{
super
(
appKey
,
secret
,
"/web/action/qcapi/springBoard"
);
this
.
instance
=
null
;
...
...
@@ -21,7 +21,7 @@ class WangwenClient extends BaseClient {
static
getInstance
()
{
if
(
!
this
.
instance
)
{
this
.
instance
=
new
Wangwen
Client
();
this
.
instance
=
new
Guangbo
Client
();
}
return
this
.
instance
;
}
...
...
@@ -104,4 +104,4 @@ class WangwenClient extends BaseClient {
}
}
module
.
exports
=
WangwenClient
\ No newline at end of file
module
.
exports
=
GuangboClient
\ No newline at end of file
icp-deliver/app/base/utils/toQft/index.js
View file @
4f338a1c
...
...
@@ -2,6 +2,8 @@ const vatClient = require("./vatClient")
const
wangwenClient
=
require
(
"./wangwenClient"
)
const
pannongClient
=
require
(
"./pannongClient"
)
const
guangboClient
=
require
(
"./guangboClient"
)
const
gongshangClient
=
require
(
"./gongshangClient"
)
const
system
=
require
(
"../../system"
);
...
...
@@ -21,13 +23,14 @@ function getClientByType(type) {
return
pannongClient
.
getInstance
();
case
system
.
SERVICECODE
.
GUANGBO
:
return
guangboClient
.
getInstance
();
case
system
.
SERVICECODE
.
COMPANYCASE
:
case
system
.
SERVICECODE
.
SEALSEVCASE
:
return
gongshangClient
.
getInstance
();
default
:
throw
new
Error
(
"无此产品类型"
);
}
}
module
.
exports
=
{
vatClient
:
new
vatClient
(),
wangwenClient
:
new
wangwenClient
(),
getClientByType
}
\ No newline at end of file
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