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
bfbe91ad
Commit
bfbe91ad
authored
May 23, 2022
by
陈思聪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 新资质产品接入
parent
df8fcb55
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
353 additions
and
5 deletions
+353
-5
icp-deliver/app/base/controller/impl/delivery/newdeliverCtl.js
+26
-0
icp-deliver/app/base/db/impl/delivery/deliverDao.js
+9
-2
icp-deliver/app/base/db/impl/delivery/qualificationDao.js
+1
-0
icp-deliver/app/base/db/models/delivery/qualification_info.js
+4
-0
icp-deliver/app/base/service/impl/delivery/newdeliverSve.js
+44
-2
icp-deliver/app/base/utils/toQft/commonVatClient.js
+203
-0
icp-deliver/app/base/utils/toQft/index.js
+66
-1
No files found.
icp-deliver/app/base/controller/impl/delivery/newdeliverCtl.js
View file @
bfbe91ad
...
...
@@ -22,6 +22,19 @@ class NewdeliverCtl extends CtlBase {
}
}
// 查询新材料详情
async
findNewMaterial
(
pobj
,
qobj
,
req
)
{
try
{
if
(
!
pobj
.
id
)
{
throw
new
Error
(
"参数错误"
)
}
const
rs
=
await
this
.
service
.
findNewMaterial
(
pobj
);
return
system
.
getResult
(
rs
);
}
catch
(
err
)
{
return
system
.
getResult
(
null
,
err
.
message
)
}
}
// 提交材料
async
submitMaterials
(
pobj
,
qobj
,
req
)
{
...
...
@@ -49,6 +62,19 @@ class NewdeliverCtl extends CtlBase {
}
}
// 编辑收件人信息
async
updateRecipient
(
pobj
,
qobj
,
req
)
{
try
{
if
(
!
pobj
.
id
)
{
throw
new
Error
(
"参数错误"
)
}
const
rs
=
await
this
.
service
.
updateRecipient
(
pobj
);
return
system
.
getResult
(
rs
);
}
catch
(
err
)
{
return
system
.
getResult
(
null
,
err
.
message
)
}
}
async
addQualification
(
pobj
,
qobj
,
req
)
{
if
(
!
pobj
.
id
)
{
return
system
.
getResult
(
null
,
"deliver_id can not be empty,100290"
);
...
...
icp-deliver/app/base/db/impl/delivery/deliverDao.js
View file @
bfbe91ad
...
...
@@ -29,8 +29,15 @@ class DeliverDao extends Dao {
let
type
=
qobj
.
bizpath
.
split
(
'/'
)[
1
];
if
(
type
===
'deliveryManagement'
)
{
qc
.
where
.
product_code
=
qc
.
where
.
product_code
&&
[
system
.
SERVICECODE
.
EDI
,
system
.
SERVICECODE
.
ICP
].
includes
(
qc
.
where
.
product_code
)
?
qc
.
where
.
product_code
:
{
$in
:
[
system
.
SERVICECODE
.
EDI
,
system
.
SERVICECODE
.
ICP
]
const
serviceCodes
=
[
system
.
SERVICECODE
.
EDI
,
system
.
SERVICECODE
.
ICP
,
system
.
SERVICECODE
.
IDC
,
system
.
SERVICECODE
.
ISP
,
system
.
SERVICECODE
.
SP
,
system
.
SERVICECODE
.
CCL
,
system
.
SERVICECODE
.
CDN
,
system
.
SERVICECODE
.
NCBI_AM
,
system
.
SERVICECODE
.
NCBI_lB
,
system
.
SERVICECODE
.
BC
,
system
.
SERVICECODE
.
IEP
,
system
.
SERVICECODE
.
HRSL
,
system
.
SERVICECODE
.
LDP
,
system
.
SERVICECODE
.
RTPPOL
,
system
.
SERVICECODE
.
PBL_R
,
system
.
SERVICECODE
.
PBL_W
,
system
.
SERVICECODE
.
CPL
,
system
.
SERVICECODE
.
ISO9001
,
system
.
SERVICECODE
.
ISO14001
,
system
.
SERVICECODE
.
ISO27001
,
system
.
SERVICECODE
.
ISO20000
,
system
.
SERVICECODE
.
ISO45001
,
system
.
SERVICECODE
.
IONHTE
,
system
.
SERVICECODE
.
SISSM
,
system
.
SERVICECODE
.
SSGEI
,
system
.
SERVICECODE
.
DSCC
,
system
.
SERVICECODE
.
HTACS
,
system
.
SERVICECODE
.
BL_TMD
,
system
.
SERVICECODE
.
BF_TMD
,
system
.
SERVICECODE
.
IDISL_B
,
system
.
SERVICECODE
.
IDISL_NB
,
system
.
SERVICECODE
.
LPE_2
,
system
.
SERVICECODE
.
LPE_3
,
]
qc
.
where
.
product_code
=
qc
.
where
.
product_code
&&
serviceCodes
.
includes
(
qc
.
where
.
product_code
)
?
qc
.
where
.
product_code
:
{
$in
:
serviceCodes
}
switch
(
qobj
.
bizpath
)
{
...
...
icp-deliver/app/base/db/impl/delivery/qualificationDao.js
View file @
bfbe91ad
...
...
@@ -16,6 +16,7 @@ class QualificationDao extends Dao {
certificateNumber
:
pobj
.
certificateNumber
,
endAt
:
pobj
.
endAt
,
file
:
pobj
.
file
,
acceptNotifyFile
:
pobj
.
acceptNotifyFile
,
serviceProject
:
pobj
.
serviceProject
,
startAt
:
pobj
.
startAt
,
deliver_id
:
pobj
.
deliver_id
...
...
icp-deliver/app/base/db/models/delivery/qualification_info.js
View file @
bfbe91ad
...
...
@@ -33,6 +33,10 @@ module.exports = (db, DataTypes) => {
file
:
{
allowNull
:
false
,
type
:
DataTypes
.
JSON
},
acceptNotifyFile
:
{
allowNull
:
true
,
type
:
DataTypes
.
JSON
}
},
{
paranoid
:
false
,
//假的删除
...
...
icp-deliver/app/base/service/impl/delivery/newdeliverSve.js
View file @
bfbe91ad
...
...
@@ -25,6 +25,48 @@ class NewdeliverService extends ServiceBase {
return
result
;
}
async
findNewMaterial
(
pobj
,
qobj
,
req
)
{
const
result
=
await
this
.
newmaterialDao
.
findOne
({
deliver_id
:
pobj
.
id
});
return
result
;
}
// 编辑收件人信息
async
updateRecipient
(
pobj
){
const
materialInfo
=
await
this
.
newmaterialDao
.
findOne
({
deliver_id
:
pobj
.
id
});
let
cacheInfo
=
{};
if
(
!
materialInfo
){
// 如果缓存信息为空
cacheInfo
=
{
recipientInfo
:{
addr
:
pobj
.
recipientInfo
.
addr
,
name
:
pobj
.
recipientInfo
.
name
,
phone
:
pobj
.
recipientInfo
.
phone
,
expressNum
:
pobj
.
recipientInfo
.
expressNum
}
}
}
else
{
cacheInfo
=
materialInfo
.
materialInfo
;
cacheInfo
.
recipientInfo
=
{
addr
:
pobj
.
recipientInfo
.
addr
,
name
:
pobj
.
recipientInfo
.
name
,
phone
:
pobj
.
recipientInfo
.
phone
,
expressNum
:
pobj
.
recipientInfo
.
expressNum
}
}
const
params
=
{
deliver_id
:
pobj
.
id
,
cache_info
:
cacheInfo
}
return
await
this
.
submitMaterials
(
params
);
}
async
submitMaterials
(
pobj
,
qobj
,
req
)
{
const
deliverData
=
await
this
.
deliveryDao
.
findOne
({
id
:
pobj
.
deliver_id
...
...
@@ -34,7 +76,7 @@ class NewdeliverService extends ServiceBase {
throw
new
Error
(
"查不到此交付单"
);
}
if
([
system
.
SERVERSESTATUS
.
COLLECTING
,
system
.
SERVERSESTATUS
.
USERCONFIRMATIONREJECT
,
system
.
SERVERSESTATUS
.
FILLING
].
includes
(
deliverData
.
delivery_status
))
{
await
TOQFT
.
getClientByType
(
deliverData
.
product_code
).
submitMaterials
(
pobj
.
username
,
deliverData
,
pobj
.
cache_info
);
await
TOQFT
.
getClientByType
AndChannel
(
deliverData
.
product_code
,
deliverData
.
source_number
).
submitMaterials
(
pobj
.
username
,
deliverData
,
pobj
.
cache_info
);
}
return
this
.
db
.
transaction
(
async
(
t
)
=>
{
...
...
@@ -107,7 +149,7 @@ class NewdeliverService extends ServiceBase {
throw
new
Error
(
"此状态手动不能更改"
);
}
await
TOQFT
.
getClientByType
(
deliverData
.
product_code
).
changeStatus
(
pobj
.
username
,
deliverData
);
await
TOQFT
.
getClientByType
AndChannel
(
deliverData
.
product_code
,
deliverData
.
source_number
).
changeStatus
(
pobj
.
username
,
deliverData
);
await
this
.
deliveryDao
.
updateByWhere
({
delivery_status
:
status
...
...
icp-deliver/app/base/utils/toQft/commonVatClient.js
0 → 100644
View file @
bfbe91ad
const
BaseClient
=
require
(
"./baseClient"
)
const
settings
=
require
(
"../../../config/settings"
);
const
system
=
require
(
"../../system"
);
const
moment
=
require
(
"moment"
);
const
qualificationDao
=
system
.
getObject
(
"db.delivery.qualificationDao"
);
const
{
appKey
,
secret
}
=
settings
;
/**
* 通用资质类 产品
*/
class
CommonVatClient
extends
BaseClient
{
constructor
()
{
super
(
appKey
,
secret
,
"/web/action/qcapi/springBoard"
);
this
.
instance
=
null
;
this
.
CIRCUITSTATUS
=
{
ACCOUNTREGISTRATION
:
507
,
// 完成账户注册
SUBMITING
:
508
,
// 提交材料到工信部
DISPOSEING
:
509
,
// 工信部已受理
DISPOSEINGFAIL
:
510
,
// 工信不予受理
THROUGH
:
511
,
// 工信部通过
THROUGHFAIL
:
512
// 工信部未通过
}
this
.
newmaterialDao
=
system
.
getObject
(
"db.delivery.newmaterialDao"
);
this
.
qualificationDao
=
system
.
getObject
(
"db.delivery.qualificationDao"
);
}
static
getInstance
()
{
if
(
!
this
.
instance
)
{
this
.
instance
=
new
CommonVatClient
();
}
return
this
.
instance
;
}
/**
* 递交材料
* @param {*} deliverData
* @param {*} materials
*/
async
submitMaterials
(
username
,
deliverData
,
materials
)
{
const
params
=
{
username
,
deliverData
,
materials
,
}
console
.
log
(
`【commonVatClient-submitMaterials】递交材料 方法入参,(deliveryId=
${
deliverData
.
id
}
),请求参数:`
+
JSON
.
stringify
(
params
))
// 如果办理材料为空,则查询数据库
let
businessLicense
=
{};
let
recipientInfo
=
{};
let
applyMaterial
=
{};
//办理材料
let
acceptNotifyFileUrl
=
''
;
// 受理通知书url
let
certificateFileUrl
=
''
;
// 证书文件url
if
(
!
materials
||
Object
.
keys
(
materials
).
length
==
0
){
const
materialData
=
await
this
.
newmaterialDao
.
findOne
({
deliver_id
:
deliverData
.
id
,
});
if
(
materialData
&&
materialData
.
materialInfo
&&
materialData
.
materialInfo
.
businessLicense
){
businessLicense
=
materialData
.
materialInfo
.
businessLicense
;
}
if
(
materialData
&&
materialData
.
materialInfo
&&
materialData
.
materialInfo
.
recipientInfo
){
recipientInfo
=
materialData
.
materialInfo
.
recipientInfo
;
}
if
(
materialData
&&
materialData
.
materialInfo
&&
materialData
.
materialInfo
.
materialFile
&&
materialData
.
materialInfo
.
materialFile
.
applyMaterial
){
applyMaterial
=
materialData
.
materialInfo
.
materialFile
.
applyMaterial
;
}
}
const
qualificationData
=
await
this
.
qualificationDao
.
findOne
({
deliver_id
:
deliverData
.
id
});
if
(
qualificationData
){
acceptNotifyFileUrl
=
qualificationData
.
acceptNotifyFile
;
certificateFileUrl
=
qualificationData
.
file
}
const
pushParams
=
{
orderNo
:
deliverData
.
delivery_code
,
companyName
:
businessLicense
.
name
!=
undefined
?
businessLicense
.
name
:
null
,
applyMaterial
:
applyMaterial
.
url
!=
undefined
?
applyMaterial
.
url
:
null
,
user
:
{
name
:
recipientInfo
.
name
!=
undefined
?
recipientInfo
.
name
:
null
,
phone
:
recipientInfo
.
phone
!=
undefined
?
recipientInfo
.
phone
:
null
,
addr
:
recipientInfo
.
addr
!=
undefined
?
recipientInfo
.
addr
:
null
,
},
acceptNotifyFile
:
acceptNotifyFileUrl
!=
undefined
?
acceptNotifyFileUrl
:
null
,
// 受理通知书
certificateFile
:
certificateFileUrl
!=
undefined
?
certificateFileUrl
:
null
,
// 证书文件
expressNum
:
recipientInfo
.
expressNum
!=
undefined
?
recipientInfo
.
expressNum
:
null
,
status
:
null
,
};
console
.
log
(
`【commonVatClient-submitMaterials】开始调用启服通 递交材料 接口(deliveryId=
${
deliverData
.
id
}
),请求参数:`
+
JSON
.
stringify
(
pushParams
))
const
res
=
await
this
.
pushQiFuTong
(
username
,
{
actionType
:
"serviceProviderNotification"
,
actionBody
:
pushParams
});
console
.
log
(
`【commonVatClient-submitMaterials】结束调用启服通 递交材料 接口(deliveryId=
${
deliverData
.
id
}
),请求参数:
${
JSON
.
stringify
(
pushParams
)}
`
)
// system.execLogs(`请求启服通`, {url, data, headers }, '交付请求', result, null)
}
/**
* 改变 状态
* @param {*} status
* @param {*} sendMessage 办理的资质文件等
*/
async
changeStatus
(
username
,
deliverData
,
materials
=
{})
{
const
params
=
{
username
,
deliverData
,
materials
}
console
.
log
(
`【commonVatClient-changeStatus】改变状态 方法入参,(deliveryId=
${
deliverData
.
id
}
),请求参数:`
+
JSON
.
stringify
(
params
))
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
:
status
=
this
.
CIRCUITSTATUS
.
THROUGH
break
case
system
.
SERVERSESTATUS
.
THROUGH
:
return
"SUCCESS"
default
:
throw
new
Error
(
"此状态不能手动更改"
);
}
// 如果办理材料为空,则查询数据库
let
businessLicense
=
{};
let
recipientInfo
=
{};
let
applyMaterial
=
{};
//办理材料
let
acceptNotifyFileUrl
=
''
;
// 受理通知书url
let
certificateFileUrl
=
''
;
// 证书文件url
if
(
!
materials
||
Object
.
keys
(
materials
).
length
==
0
){
const
materialData
=
await
this
.
newmaterialDao
.
findOne
({
deliver_id
:
deliverData
.
id
,
});
if
(
materialData
&&
materialData
.
materialInfo
&&
materialData
.
materialInfo
.
businessLicense
){
businessLicense
=
materialData
.
materialInfo
.
businessLicense
;
}
if
(
materialData
&&
materialData
.
materialInfo
&&
materialData
.
materialInfo
.
recipientInfo
){
recipientInfo
=
materialData
.
materialInfo
.
recipientInfo
;
}
if
(
materialData
&&
materialData
.
materialInfo
&&
materialData
.
materialInfo
.
materialFile
&&
materialData
.
materialInfo
.
materialFile
.
applyMaterial
){
applyMaterial
=
materialData
.
materialInfo
.
materialFile
.
applyMaterial
;
}
}
const
qualificationData
=
await
this
.
qualificationDao
.
findOne
({
deliver_id
:
deliverData
.
id
});
if
(
qualificationData
){
acceptNotifyFileUrl
=
qualificationData
.
acceptNotifyFile
;
certificateFileUrl
=
qualificationData
.
file
}
const
pushParams
=
{
orderNo
:
deliverData
.
delivery_code
,
companyName
:
businessLicense
.
name
!=
undefined
?
businessLicense
.
name
:
null
,
applyMaterial
:
applyMaterial
.
url
!=
undefined
?
applyMaterial
.
url
:
null
,
user
:
{
name
:
recipientInfo
.
name
!=
undefined
?
recipientInfo
.
name
:
null
,
phone
:
recipientInfo
.
phone
!=
undefined
?
recipientInfo
.
phone
:
null
,
addr
:
recipientInfo
.
addr
!=
undefined
?
recipientInfo
.
addr
:
null
,
},
acceptNotifyFile
:
acceptNotifyFileUrl
!=
undefined
?
acceptNotifyFileUrl
:
null
,
// 受理通知书
certificateFile
:
certificateFileUrl
!=
undefined
?
certificateFileUrl
:
null
,
// 证书文件
expressNum
:
recipientInfo
.
expressNum
!=
undefined
?
recipientInfo
.
expressNum
:
null
,
status
:
status
};
console
.
log
(
`【commonVatClient-changeStatus】开始调用启服通提交材料接口 ,(deliveryId=
${
deliverData
.
id
}
),请求参数:`
+
JSON
.
stringify
(
pushParams
))
await
this
.
pushQiFuTong
(
username
,
{
actionType
:
"serviceProviderNotification"
,
actionBody
:
pushParams
});
console
.
log
(
`【commonVatClient-changeStatus】结束调用启服通提交材料接口 ,(deliveryId=
${
deliverData
.
id
}
),请求参数:
${
JSON
.
stringify
(
pushParams
)}
`
)
}
}
module
.
exports
=
CommonVatClient
\ No newline at end of file
icp-deliver/app/base/utils/toQft/index.js
View file @
bfbe91ad
...
...
@@ -3,6 +3,7 @@ const wangwenClient = require("./wangwenClient")
const
pannongClient
=
require
(
"./pannongClient"
)
const
guangboClient
=
require
(
"./guangboClient"
)
const
gongshangClient
=
require
(
"./gongshangClient"
)
const
commonVatClient
=
require
(
"./commonVatClient"
)
const
system
=
require
(
"../../system"
);
...
...
@@ -34,6 +35,69 @@ function getClientByType(type) {
}
}
/**
* 根据产品类型、渠道选择不同的方法
* @param {*} type
* @param {*} channel
*/
function
getClientByTypeAndChannel
(
type
,
channel
)
{
switch
(
type
)
{
case
system
.
SERVICECODE
.
ICP
:
case
system
.
SERVICECODE
.
EDI
:
case
system
.
SERVICECODE
.
IDC
:
case
system
.
SERVICECODE
.
ISP
:
case
system
.
SERVICECODE
.
SP
:
case
system
.
SERVICECODE
.
CCL
:
case
system
.
SERVICECODE
.
CDN
:
case
system
.
SERVICECODE
.
NCBI_AM
:
case
system
.
SERVICECODE
.
NCBI_lB
:
case
system
.
SERVICECODE
.
BC
:
case
system
.
SERVICECODE
.
IEP
:
case
system
.
SERVICECODE
.
HRSL
:
case
system
.
SERVICECODE
.
LDP
:
case
system
.
SERVICECODE
.
RTPPOL
:
case
system
.
SERVICECODE
.
PBL_R
:
case
system
.
SERVICECODE
.
PBL_W
:
case
system
.
SERVICECODE
.
CPL
:
case
system
.
SERVICECODE
.
ISO9001
:
case
system
.
SERVICECODE
.
ISO14001
:
case
system
.
SERVICECODE
.
ISO27001
:
case
system
.
SERVICECODE
.
ISO20000
:
case
system
.
SERVICECODE
.
ISO45001
:
case
system
.
SERVICECODE
.
IONHTE
:
case
system
.
SERVICECODE
.
SISSM
:
case
system
.
SERVICECODE
.
SSGEI
:
case
system
.
SERVICECODE
.
DSCC
:
case
system
.
SERVICECODE
.
HTACS
:
case
system
.
SERVICECODE
.
BL_TMD
:
case
system
.
SERVICECODE
.
BF_TMD
:
case
system
.
SERVICECODE
.
IDISL_B
:
case
system
.
SERVICECODE
.
IDISL_NB
:
case
system
.
SERVICECODE
.
LPE_2
:
case
system
.
SERVICECODE
.
LPE_3
:
//, system.SERVICECODE.EDI
if
([
system
.
SERVICECODE
.
ICP
,
system
.
SERVICECODE
.
EDI
].
includes
(
type
)
&&
[
'aliCloud'
,
'zc360'
,
'baidu'
,
'ename'
].
includes
(
channel
)){
// 这4个渠道的icp、edi走老接口
return
vatClient
.
getInstance
();
}
else
{
return
commonVatClient
.
getInstance
();
}
case
system
.
SERVICECODE
.
WANGWEN
:
return
wangwenClient
.
getInstance
();
case
system
.
SERVICECODE
.
PANNONG
:
return
pannongClient
.
getInstance
();
case
system
.
SERVICECODE
.
GUANGBO
:
return
guangboClient
.
getInstance
();
case
system
.
SERVICECODE
.
COMPANYCASE
:
case
system
.
SERVICECODE
.
OPENBANKACCOUNTCASE
:
case
system
.
SERVICECODE
.
TAXCASE
:
case
system
.
SERVICECODE
.
REGADDRCASE1
:
case
system
.
SERVICECODE
.
AGENTCASE1
:
return
gongshangClient
.
getInstance
();
default
:
throw
new
Error
(
"无此产品类型"
);
}
}
module
.
exports
=
{
getClientByType
getClientByType
,
getClientByTypeAndChannel
}
\ 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