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
44d82ccf
Commit
44d82ccf
authored
Nov 05, 2020
by
Sxy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 接入百度360
parent
a31625a1
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
406 additions
and
111 deletions
+406
-111
icp-deliver/app/base/controller/impl/delivery/newdeliverCtl.js
+4
-4
icp-deliver/app/base/db/impl/delivery/deliverDao.js
+1
-1
icp-deliver/app/base/service/impl/delivery/deliverSve.js
+28
-88
icp-deliver/app/base/service/impl/delivery/newdeliverSve.js
+22
-16
icp-deliver/app/base/system.js
+2
-1
icp-deliver/app/base/utils/logClient.js
+6
-1
icp-deliver/app/base/utils/toQft/baseClient.js
+97
-0
icp-deliver/app/base/utils/toQft/index.js
+27
-0
icp-deliver/app/base/utils/toQft/vatClient.js
+128
-0
icp-deliver/app/base/utils/toQft/wangwenClient.js
+91
-0
No files found.
icp-deliver/app/base/controller/impl/delivery/
wangwen
Ctl.js
→
icp-deliver/app/base/controller/impl/delivery/
newdeliver
Ctl.js
View file @
44d82ccf
...
...
@@ -4,9 +4,9 @@ const querystring = require('querystring');
var
settings
=
require
(
"../../../../config/settings"
);
const
CtlBase
=
require
(
"../../ctl.base"
);
const
moment
=
require
(
"moment"
);
class
Wangwen
Ctl
extends
CtlBase
{
class
Newdeliver
Ctl
extends
CtlBase
{
constructor
()
{
super
(
"delivery"
,
CtlBase
.
getServiceName
(
Wangwen
Ctl
));
super
(
"delivery"
,
CtlBase
.
getServiceName
(
Newdeliver
Ctl
));
}
// 查询 详情
...
...
@@ -39,7 +39,7 @@ class WangwenCtl extends CtlBase {
// 更改状态
async
changeDeliveryStatus
(
pobj
,
qobj
,
req
)
{
try
{
if
(
!
pobj
.
deliver_
id
)
{
if
(
!
pobj
.
id
)
{
throw
new
Error
(
"参数错误"
)
}
const
rs
=
await
this
.
service
.
changeDeliveryStatus
(
pobj
);
...
...
@@ -49,4 +49,4 @@ class WangwenCtl extends CtlBase {
}
}
}
module
.
exports
=
Wangwen
Ctl
;
module
.
exports
=
Newdeliver
Ctl
;
icp-deliver/app/base/db/impl/delivery/deliverDao.js
View file @
44d82ccf
...
...
@@ -212,7 +212,7 @@ class DeliverDao extends Dao {
return
result
;
}
async
findInfoByWangwen
(
pobj
)
{
async
newFindInfo
(
pobj
)
{
const
result
=
await
this
.
model
.
findOne
({
where
:
{
id
:
pobj
.
id
...
...
icp-deliver/app/base/service/impl/delivery/deliverSve.js
View file @
44d82ccf
...
...
@@ -49,9 +49,6 @@ class DeliverService extends ServiceBase {
throw
new
Error
(
"查不到此交付单"
);
}
// 推送到商城
// await pushTx.submitMaterials(deliverData, JSON.parse(JSON.stringify(pobj.cache_info)))
if
([
system
.
SERVERSESTATUS
.
COLLECTING
,
system
.
SERVERSESTATUS
.
USERCONFIRMATIONREJECT
].
includes
(
deliverData
.
delivery_status
))
{
await
pushQft
.
submitMaterials
(
deliverData
,
JSON
.
parse
(
JSON
.
stringify
(
pobj
.
cache_info
)))
}
...
...
@@ -59,24 +56,6 @@ class DeliverService extends ServiceBase {
return
this
.
db
.
transaction
(
async
(
t
)
=>
{
await
this
.
cacheinfoDao
.
createOrUpdate
(
pobj
,
t
);
await
this
.
materialDao
.
createOrUpdate
(
pobj
,
t
);
if
(
deliverData
.
source_number
===
"tencentCloud"
)
{
if
(
deliverData
.
delivery_status
===
system
.
SERVERSESTATUS
.
COLLECTING
)
{
await
this
.
dao
.
updateByWhere
({
delivery_status
:
system
.
SERVERSESTATUS
.
SUBMITING
},
{
id
:
pobj
.
deliver_id
},
t
);
this
.
statuslogDao
.
create
({
flow_type
:
system
.
FLOWCODE
.
DELIVERY
,
flow_id
:
pobj
.
deliver_id
,
status_code
:
system
.
SERVERSESTATUS
.
SUBMITING
,
salesman_id
:
pobj
.
userid
,
salesman_name
:
pobj
.
username
});
}
}
if
(
deliverData
.
source_number
===
"aliCloud"
)
{
if
([
system
.
SERVERSESTATUS
.
COLLECTING
,
system
.
SERVERSESTATUS
.
USERCONFIRMATIONREJECT
].
includes
(
deliverData
.
delivery_status
))
{
await
this
.
dao
.
updateByWhere
({
...
...
@@ -93,8 +72,6 @@ class DeliverService extends ServiceBase {
});
}
}
return
"SUCCESS"
});
}
...
...
@@ -177,6 +154,8 @@ class DeliverService extends ServiceBase {
status
=
system
.
SERVERSESTATUS
.
SUCCESS
;
// txstatus = pushTx.TXSTATUS.SUCCESS;
break
default
:
throw
new
Error
(
"此状态手动不能更改"
);
}
// await pushTx.pushChangeOrder(txstatus, deliverData.delivery_code);
...
...
@@ -196,7 +175,16 @@ class DeliverService extends ServiceBase {
return
"success"
}
// 点击详情 将 订单状态 从 已接单更新为收集材料中
/**
* 阿里渠道
* 1. 交付单起始状态 为 已接单
* 2. 点击详情 更新为 用户待上传材料
* 3. 当用户上传完材料 自动更新为 收集材料中
*
* 其他渠道
* 1. 交付单起始状态 为 已接单
* 2. 点击详情 更新为 收集材料中
*/
async
toCollecting
(
pobj
)
{
const
deliverData
=
await
this
.
dao
.
findOne
({
id
:
pobj
.
id
...
...
@@ -204,35 +192,36 @@ class DeliverService extends ServiceBase {
if
(
!
deliverData
)
{
throw
new
Error
(
"没有此交付单"
);
}
/**
*
* 1. 交付单起始状态 为 已接单
* 2. 点击详情 更新为 用户待上传材料
* 3. 当用户上传完材料 自动更新为 收集材料中
*/
if
(
system
.
SERVERSESTATUS
.
RECEIVED
===
deliverData
.
delivery_status
)
{
let
status
;
if
(
deliverData
.
source_number
===
"aliCloud"
)
{
status
=
system
.
SERVERSESTATUS
.
USERUPLOADWAIT
}
else
{
status
=
system
.
SERVERSESTATUS
.
COLLECTING
}
await
this
.
dao
.
updateByWhere
({
delivery_status
:
s
ystem
.
SERVERSESTATUS
.
USERUPLOADWAIT
delivery_status
:
s
tatus
},
{
id
:
pobj
.
id
});
this
.
statuslogDao
.
create
({
flow_type
:
system
.
FLOWCODE
.
DELIVERY
,
flow_id
:
pobj
.
id
,
status_code
:
s
ystem
.
SERVERSESTATUS
.
USERUPLOADWAIT
,
status_code
:
s
tatus
,
salesman_id
:
pobj
.
userid
,
salesman_name
:
pobj
.
username
});
}
return
"
success
"
return
"
SUCCESS
"
}
/**
* 1. 保存资质信息
*/
async
addQualification
(
pobj
)
{
/**
* 1. 保存资质信息
* 2. 判断是否有年报服务,有的话改变年报状态
*/
const
deliverData
=
await
this
.
dao
.
findOne
({
id
:
pobj
.
deliver_id
});
...
...
@@ -242,58 +231,9 @@ class DeliverService extends ServiceBase {
if
(
deliverData
.
delivery_status
!==
system
.
SERVERSESTATUS
.
DISPOSEING
)
{
throw
new
Error
(
"该交付单状态下不可提交"
);
}
let
annualReportData
;
let
annualReportArry
=
[];
// 年报逻辑
if
(
deliverData
.
master_source_number
)
{
annualReportData
=
await
this
.
dao
.
findOne
({
master_source_number
:
deliverData
.
master_source_number
,
id
:
{
$ne
:
deliverData
.
id
}
});
if
(
annualReportData
&&
annualReportData
.
delivery_status
===
System
.
ANNUALREPORT
.
RECEIVED
)
{
// TODO: let year = annualReportData.delivery_info && annualReportData.delivery_info.numYear || 5
let
year
=
5
;
for
(
let
i
=
new
Date
().
getFullYear
();
i
<
new
Date
().
getFullYear
()
+
year
;
i
++
)
{
annualReportArry
.
push
({
year
:
i
,
status
:
System
.
ANNUALREPORT
.
WAITDECLARE
,
deliver_id
:
annualReportData
.
id
});
}
// 推送年报信息
// await pushTx.pushChangeOrder(pushTx.TXSTATUS.WAITDECLARE, annualReportData.delivery_code, {
// annualReport: annualReportArry
// })
}
}
return
this
.
db
.
transaction
(
async
(
t
)
=>
{
await
this
.
qualificationDao
.
createOrUpdate
(
pobj
,
t
);
if
(
annualReportData
&&
annualReportData
.
delivery_status
===
System
.
ANNUALREPORT
.
RECEIVED
)
{
await
this
.
dao
.
updateByWhere
({
delivery_status
:
System
.
ANNUALREPORT
.
TAKEEFFECT
},
{
id
:
annualReportData
.
id
},
t
);
this
.
statuslogDao
.
create
({
flow_type
:
system
.
FLOWCODE
.
DELIVERY
,
flow_id
:
annualReportData
.
id
,
status_code
:
System
.
ANNUALREPORT
.
TAKEEFFECT
,
salesman_id
:
pobj
.
userid
,
salesman_name
:
pobj
.
username
});
await
this
.
annualreportDao
.
bulkCreate
(
annualReportArry
,
t
);
}
return
"success"
});
await
this
.
qualificationDao
.
createOrUpdate
(
pobj
);
return
"SUCCESS"
}
async
closeDeliver
(
pobj
)
{
...
...
icp-deliver/app/base/service/impl/delivery/
wangwen
Sve.js
→
icp-deliver/app/base/service/impl/delivery/
newdeliver
Sve.js
View file @
44d82ccf
...
...
@@ -4,11 +4,12 @@ const settings = require("../../../../config/settings");
const
moment
=
require
(
"moment"
);
const
System
=
require
(
"../../../system"
);
const
pushQft
=
require
(
"../../../utils/toqifutongClient"
)
const
TOQFT
=
require
(
"../../../utils/toQft"
);
class
Wangwen
Service
extends
ServiceBase
{
class
Newdeliver
Service
extends
ServiceBase
{
constructor
()
{
super
(
"delivery"
,
ServiceBase
.
getDaoName
(
Wangwen
Service
));
super
(
"delivery"
,
ServiceBase
.
getDaoName
(
Newdeliver
Service
));
this
.
cacheinfoDao
=
system
.
getObject
(
"db.delivery.cacheinfoDao"
);
this
.
deliveryDao
=
system
.
getObject
(
"db.delivery.deliverDao"
);
this
.
newmaterialDao
=
system
.
getObject
(
"db.delivery.newmaterialDao"
);
...
...
@@ -16,7 +17,7 @@ class WangwenService extends ServiceBase {
}
async
findInfo
(
pobj
,
qobj
,
req
)
{
let
result
=
await
this
.
deliveryDao
.
findInfoByWangwen
({
let
result
=
await
this
.
deliveryDao
.
newFindInfo
({
id
:
pobj
.
id
});
if
(
!
result
)
{
...
...
@@ -34,22 +35,28 @@ class WangwenService extends ServiceBase {
throw
new
Error
(
"查不到此交付单"
);
}
if
([
system
.
SERVERSESTATUS
.
COLLECTING
,
system
.
SERVERSESTATUS
.
USERCONFIRMATIONREJECT
].
includes
(
deliverData
.
delivery_status
))
{
await
pushQft
.
wangwenSubmitOption
(
deliverData
,
pobj
.
cache_info
);
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
:
s
ystem
.
SERVERSESTATUS
.
USERCONFIRMATIONWAIT
delivery_status
:
s
tatus
},
{
id
:
pobj
.
deliver_id
},
t
);
this
.
statuslogDao
.
create
({
flow_type
:
system
.
FLOWCODE
.
DELIVERY
,
flow_id
:
pobj
.
deliver_id
,
status_code
:
s
ystem
.
SERVERSESTATUS
.
USERCONFIRMATIONWAIT
,
status_code
:
s
tatus
,
salesman_id
:
pobj
.
userid
,
salesman_name
:
pobj
.
username
});
...
...
@@ -60,7 +67,7 @@ class WangwenService extends ServiceBase {
async
changeDeliveryStatus
(
pobj
,
qobj
,
req
)
{
const
deliverData
=
await
this
.
deliveryDao
.
findOne
({
id
:
pobj
.
deliver_
id
id
:
pobj
.
id
});
if
(
!
deliverData
)
{
throw
new
Error
(
"没有此交付单"
);
...
...
@@ -68,41 +75,40 @@ class WangwenService extends ServiceBase {
let
status
;
switch
(
deliverData
.
delivery_status
)
{
case
system
.
SERVERSESTATUS
.
USERCONFIRMATIONRESOLVE
:
case
system
.
SERVERSESTATUS
.
COLLECTSUCCESS
:
status
=
system
.
SERVERSESTATUS
.
ACCOUNTREGISTRATION
;
await
pushQft
.
wangwenSubmitOption
(
deliverData
);
break
case
system
.
SERVERSESTATUS
.
ACCOUNTREGISTRATION
:
status
=
system
.
SERVERSESTATUS
.
SUBMITING
;
await
pushQft
.
wangwenSubmitOption
(
deliverData
);
break
case
system
.
SERVERSESTATUS
.
SUBMITING
:
status
=
system
.
SERVERSESTATUS
.
DISPOSEING
;
await
pushQft
.
wangwenSubmitOption
(
deliverData
);
break
case
system
.
SERVERSESTATUS
.
DISPOSEING
:
status
=
system
.
SERVERSESTATUS
.
THROUGH
;
await
pushQft
.
wangwenSubmitOption
(
deliverData
);
break
case
system
.
SERVERSESTATUS
.
THROUGH
:
status
=
system
.
SERVERSESTATUS
.
SUCCESS
;
break
default
:
throw
new
Error
(
"此状态手动不能更改"
);
break
}
await
TOQFT
.
getClientByType
(
deliverData
.
product_code
).
changeStatus
(
pobj
.
username
,
deliverData
);
await
this
.
deliveryDao
.
updateByWhere
({
delivery_status
:
status
},
{
id
:
pobj
.
deliver_
id
id
:
pobj
.
id
})
this
.
statuslogDao
.
create
({
flow_type
:
system
.
FLOWCODE
.
DELIVERY
,
flow_id
:
pobj
.
deliver_
id
,
flow_id
:
pobj
.
id
,
status_code
:
status
,
salesman_id
:
pobj
.
userid
,
salesman_name
:
pobj
.
username
});
return
"
success
"
return
"
SUCCESS
"
}
}
module
.
exports
=
Wangwen
Service
;
module
.
exports
=
Newdeliver
Service
;
icp-deliver/app/base/system.js
View file @
44d82ccf
...
...
@@ -356,7 +356,8 @@ System.SCHEMESTATUS = {
System
.
SERVERSESTATUS
=
{
RECEIVED
:
"received"
,
//已接单
COLLECTING
:
"collecting"
,
//收集材料中
SUBMITING
:
"submiting"
,
//递交材料中
COLLECTSUCCESS
:
"collectsuccess"
,
//收集材料完成
SUBMITING
:
"submiting"
,
//递交材料中 || 向工信部递交材料
DISPOSEING
:
"disposeing"
,
//工信部处理中 || 工信部已受理
POSTING
:
"posting"
,
//证书已邮寄
SUCCESS
:
"success"
,
//服务已完成
...
...
icp-deliver/app/base/utils/logClient.js
View file @
44d82ccf
...
...
@@ -14,7 +14,12 @@ class LogClient {
rtninfo
.
requestId
=
this
.
getUUID
()
req
.
params
.
param
=
pobj
//第三个字段应该存公司id
system
.
execLogs
(
settings
.
appname
+
"_"
+
req
.
xctx
.
codetitle
,
req
.
params
,
"_"
+
"icp-deliver"
+
(
pobj
.
company_id
||
''
)
+
"_"
,
rtninfo
,
errinfo
).
then
(
res
=>
{
system
.
execLogs
(
settings
.
appname
+
"_"
+
req
.
xctx
.
codetitle
,
req
.
params
,
"_"
+
"icp-deliver"
+
(
pobj
.
company_id
||
''
)
+
"_"
,
rtninfo
,
errinfo
).
then
(
res
=>
{
if
(
res
&&
res
.
status
==
1
)
{
console
.
log
(
"log.....success"
)
}
else
{
...
...
icp-deliver/app/base/utils/toQft/baseClient.js
0 → 100644
View file @
44d82ccf
const
axios
=
require
(
"axios"
);
const
settings
=
require
(
"../../../config/settings"
);
const
system
=
require
(
"../../system"
);
const
centerChannelUrl
=
settings
.
centerChannelUrl
();
const
qifutongUrl
=
settings
.
qifutongUrl
();
/**
* 请求启服通的基类
* 封装 获取 userpin token
* 统一请求方法
* 统一日志记录
*/
class
BaseClient
{
constructor
(
appKey
,
secret
)
{
this
.
appKey
=
appKey
;
this
.
secret
=
secret
;
}
/**
* 推送到 启服通
* @param {*} user
* @param {*} data
*/
async
pushQiFuTong
(
user
,
data
)
{
const
header
=
await
this
.
getLoginByUserName
(
user
);
await
this
.
postRequest
(
`
${
qifutongUrl
}
/web/action/qcapi/springBoard`
,
data
,
header
);
}
async
getLoginByUserName
(
user
)
{
const
token
=
await
this
.
getAppTokenByAppKey
(
this
.
appKey
,
this
.
secret
);
const
data
=
await
this
.
postRequest
(
`
${
centerChannelUrl
}
/api/opreceive/accessAuth/springBoard`
,
{
"actionType"
:
"getLoginByUserName"
,
"actionBody"
:
{
"channelUserId"
:
user
,
" user"
:
user
,
"userName"
:
user
}
},
{
token
});
return
{
token
,
userpin
:
data
.
userpin
}
}
async
getAppTokenByAppKey
(
appKey
,
secret
)
{
const
data
=
await
this
.
postRequest
(
`
${
centerChannelUrl
}
/api/opreceive/accessAuth/getAppTokenByAppKey`
,
{
"actionType"
:
"getAppTokenByAppKey"
,
"actionBody"
:
{
"appkey"
:
appKey
,
"secret"
:
secret
}
});
return
data
.
token
}
async
postRequest
(
url
,
data
,
headers
=
{})
{
try
{
console
.
log
(
`
${
url
}
: 请求信息 ------- `
);
console
.
log
(
JSON
.
stringify
(
data
))
console
.
log
(
JSON
.
stringify
(
headers
))
let
result
=
await
axios
.
post
(
`
${
url
}
`
,
data
,
{
headers
:
{
'Content-Type'
:
'application/json'
,
...
headers
}
});
result
=
result
.
data
;
console
.
log
(
`
${
url
}
: 返回信息 ------- `
);
console
.
log
(
result
);
system
.
execLogs
(
`请求:
${
url
}
`
,
{
data
,
headers
},
'交付请求'
,
result
,
null
).
catch
(
err
=>
{
console
.
log
(
`日志写入错误
${
url
}
`
)
});
if
(
result
.
status
===
0
)
{
return
result
.
data
}
else
{
throw
new
Error
(
result
.
msg
)
}
}
catch
(
err
)
{
console
.
log
(
`
${
url
}
: 返回错误信息 ------- `
);
console
.
log
(
err
)
throw
(
err
)
}
}
}
module
.
exports
=
BaseClient
;
icp-deliver/app/base/utils/toQft/index.js
0 → 100644
View file @
44d82ccf
const
vatClient
=
require
(
"./vatClient"
)
const
wangwenClient
=
require
(
"./wangwenClient"
)
const
system
=
require
(
"../../system"
);
/**
* 根据产品类型选择不同的方法
* @param {*} type
*/
function
getClientByType
(
type
)
{
switch
(
type
)
{
case
system
.
SERVICECODE
.
ICP
:
case
system
.
SERVICECODE
.
EDI
:
return
new
vatClient
()
case
system
.
SERVICECODE
.
WANGWEN
:
return
new
wangwenClient
()
default
:
throw
new
Error
(
"此状态手动不能更改"
);
}
}
module
.
exports
=
{
vatClient
:
new
vatClient
(),
wangwenClient
:
new
wangwenClient
(),
getClientByType
}
\ No newline at end of file
icp-deliver/app/base/utils/toQft/vatClient.js
0 → 100644
View file @
44d82ccf
const
BaseClient
=
require
(
"./baseClient"
)
const
system
=
require
(
"../../system"
);
const
settings
=
require
(
"../../../config/settings"
);
const
{
appKey
,
secret
}
=
settings
;
const
qualificationDao
=
system
.
getObject
(
"db.delivery.qualificationDao"
);
/**
* 增值电信 产品
*/
class
VatClient
extends
BaseClient
{
constructor
()
{
super
(
appKey
,
secret
);
this
.
CIRCUITSTATUS
=
{
ACCOUNTREGISTRATION
:
507
,
// 完成账户注册
SUBMITING
:
508
,
// 提交材料到工信部
DISPOSEING
:
509
,
// 工信部已受理
DISPOSEINGFAIL
:
510
,
// 工信不予受理
THROUGH
:
511
,
// 工信部通过
THROUGHFAIL
:
512
// 工信部未通过
}
}
/**
* 递交材料
* @param {*} deliverData
* @param {*} materials
*/
async
submitMaterials
(
username
,
deliverData
,
materials
)
{
const
{
businessLicense
,
materialFile
,
otherInformation
}
=
materials
;
const
{
address
,
businessTerm
,
createdAt
,
enterpriseCode
,
legalRepresentative
,
name
,
registeredCapital
,
scopeBusiness
,
type
}
=
businessLicense
;
const
{
domain
,
corporateName
,
includeForeignInvestment
}
=
otherInformation
;
const
{
companyBasicForm
,
companyServiceQualityForm
,
icpCertificate
,
networkSecurityInformationForm
,
partnerBusinessLicense
,
partnerDomainCertificate
,
partnerForeignInvestment
,
partnerIdCardList
,
partnerLaw
,
partnerPlan
,
partnerPreviewOtherList
,
partnerSignAndStampOtherList
,
partnerSignOtherList
,
businessDevelopmentForm
,
partnerStampOtherList
}
=
materialFile
;
await
this
.
pushQiFuTong
(
username
,
{
actionType
:
"serviceProviderSubmitMaterial"
,
actionBody
:
{
orderNo
:
deliverData
.
delivery_code
,
material
:
{
BusinessLicense
:
{
Address
:
address
,
BusinessTerm
:
businessTerm
,
CreatedAt
:
createdAt
,
EnterpriseCode
:
enterpriseCode
,
LegalRepresentative
:
legalRepresentative
,
Name
:
name
,
RegisteredCapital
:
registeredCapital
,
ScopeBusiness
:
scopeBusiness
,
Type
:
type
},
Domain
:
domain
,
CorporateName
:
corporateName
,
IncludeForeignInvestment
:
includeForeignInvestment
===
"是"
,
PartnerBusinessLicense
:
partnerBusinessLicense
.
url
,
PartnerIdCardList
:
partnerIdCardList
.
map
(
item
=>
item
.
url
),
PartnerDomainCertificate
:
partnerDomainCertificate
.
url
,
PartnerPreviewOtherList
:
(
partnerPreviewOtherList
&&
partnerPreviewOtherList
.
length
>
0
)
?
partnerPreviewOtherList
.
map
(
item
=>
item
.
url
)
:
undefined
,
PartnerPlan
:
partnerPlan
.
url
,
PartnerForeignInvestment
:
partnerForeignInvestment
.
url
,
PartnerLaw
:
partnerLaw
.
url
,
IcpCertificate
:
icpCertificate
.
url
,
BusinessDevelopmentForm
:
businessDevelopmentForm
.
url
,
CompanyBasicForm
:
companyBasicForm
.
url
,
CompanyServiceQualityForm
:
companyServiceQualityForm
.
url
,
NetworkSecurityInformationForm
:
networkSecurityInformationForm
.
url
,
PartnerSignAndStampOtherList
:
partnerSignAndStampOtherList
.
url
&&
[
partnerSignAndStampOtherList
.
url
],
PartnerSignOtherList
:
partnerSignOtherList
.
url
&&
[
partnerSignOtherList
.
url
],
PartnerStampOtherList
:
partnerStampOtherList
.
url
&&
[
partnerStampOtherList
.
url
]
}
}
});
}
/**
* 改变 状态
* @param {*} status
* @param {*} sendMessage 办理的资质文件等
*/
async
changeStatus
(
username
,
deliverData
,
materials
=
{})
{
let
status
;
switch
(
deliverData
.
delivery_status
)
{
case
system
.
SERVERSESTATUS
.
USERCONFIRMATIONRESOLVE
:
case
system
.
SERVERSESTATUS
.
COLLECTSUCCESS
:
status
=
this
.
CIRCUITSTATUS
.
ACCOUNTREGISTRATION
break
case
system
.
SERVERSESTATUS
.
ACCOUNTREGISTRATION
:
status
=
this
.
CIRCUITSTATUS
.
SUBMITING
break
case
system
.
SERVERSESTATUS
.
SUBMITING
:
status
=
this
.
CIRCUITSTATUS
.
DISPOSEING
break
case
system
.
SERVERSESTATUS
.
DISPOSEING
:
const
qualificationData
=
await
qualificationDao
.
findOne
({
deliver_id
:
deliverData
.
id
});
if
(
qualificationData
)
{
materials
.
officialFileURL
=
qualificationData
.
file
&&
qualificationData
.
file
.
url
}
status
=
this
.
CIRCUITSTATUS
.
THROUGH
break
case
system
.
SERVERSESTATUS
.
THROUGH
:
return
"SUCCESS"
default
:
throw
new
Error
(
"此状态不能手动更改"
);
}
await
this
.
pushQiFuTong
(
username
,
{
actionType
:
"serviceProviderNotification"
,
actionBody
:
{
orderNo
:
deliverData
.
delivery_code
,
status
,
...
materials
}
});
}
}
module
.
exports
=
VatClient
\ No newline at end of file
icp-deliver/app/base/utils/toQft/wangwenClient.js
0 → 100644
View file @
44d82ccf
const
BaseClient
=
require
(
"./baseClient"
)
const
settings
=
require
(
"../../../config/settings"
);
const
system
=
require
(
"../../system"
);
const
{
appKey
,
secret
}
=
settings
;
/**
* 食品 网文 产品
*/
class
WangwenClient
extends
BaseClient
{
constructor
()
{
super
(
appKey
,
secret
);
}
/**
* 文网文 递交材料,状态变更
601: "完成账户注册",
602: "服务商提交资料",
603: "服务商完成提交资料到⼯信部",
604: "⼯商部已受理",
605: "⼯商部不予受理",
606: "⼯商部通过",
607: "⼯商部未通过"
*/
async
submitMaterials
(
username
,
deliverData
,
materials
)
{
const
channelType
=
{
"wangwen"
:
"esp.wangwen"
,
"food"
:
"esp.food"
};
let
req
=
{};
switch
(
deliverData
.
delivery_status
)
{
case
system
.
SERVERSESTATUS
.
COLLECTING
:
case
system
.
SERVERSESTATUS
.
USERCONFIRMATIONREJECT
:
let
{
basicInfo
,
materialList
}
=
materials
;
let
extInfo
=
{};
for
(
let
val
in
basicInfo
)
{
if
(
basicInfo
[
val
])
{
extInfo
[
val
]
=
basicInfo
[
val
];
}
}
for
(
let
val
of
materialList
)
{
if
(
val
.
files
||
val
.
files
.
length
>
0
)
{
let
urls
=
[];
for
(
let
file
of
val
.
files
)
{
if
(
file
&&
file
.
url
)
{
urls
.
push
(
file
.
url
);
}
}
if
(
urls
.
length
>
0
)
{
extInfo
[
val
.
key
]
=
urls
}
}
}
req
=
{
"ApplicationStatus"
:
601
,
"extInfo"
:
JSON
.
stringify
(
extInfo
)
}
break
case
system
.
SERVERSESTATUS
.
USERCONFIRMATIONRESOLVE
:
req
.
ApplicationStatus
=
602
;
break
case
system
.
SERVERSESTATUS
.
ACCOUNTREGISTRATION
:
req
.
ApplicationStatus
=
603
;
break
case
system
.
SERVERSESTATUS
.
SUBMITING
:
req
.
ApplicationStatus
=
604
;
break
case
system
.
SERVERSESTATUS
.
DISPOSEING
:
req
.
ApplicationStatus
=
606
;
break
default
:
throw
new
Error
(
"此状态手动不能更改"
);
}
await
this
.
pushQiFuTong
(
username
,
{
actionType
:
"serviceSubmitOption"
,
actionBody
:
{
"channelType"
:
channelType
[
deliverData
.
product_code
],
"orderNo"
:
deliverData
.
delivery_code
,
"extInfo"
:
"{}"
,
...
req
,
}
});
}
async
changeStatus
(
username
,
deliverData
,
materials
)
{
await
this
.
submitMaterials
(
username
,
deliverData
,
materials
);
}
}
module
.
exports
=
WangwenClient
\ 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