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
dac8fa8f
Commit
dac8fa8f
authored
Nov 12, 2020
by
Sxy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 广播 网文
parent
9b35fe57
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
254 additions
and
64 deletions
+254
-64
icp-deliver/app/base/controller/impl/delivery/newdeliverCtl.js
+15
-0
icp-deliver/app/base/db/impl/delivery/deliverDao.js
+32
-2
icp-deliver/app/base/service/impl/delivery/newdeliverSve.js
+23
-0
icp-deliver/app/base/system.js
+2
-1
icp-deliver/app/base/utils/toQft/guangboClient.js
+108
-0
icp-deliver/app/base/utils/toQft/index.js
+4
-0
icp-deliver/app/base/utils/toQft/vatClient.js
+1
-1
icp-deliver/app/base/utils/toQft/wangwenClient.js
+69
-60
No files found.
icp-deliver/app/base/controller/impl/delivery/newdeliverCtl.js
View file @
dac8fa8f
...
...
@@ -48,5 +48,20 @@ class NewdeliverCtl extends CtlBase {
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"
);
}
if
(
!
pobj
.
file
||
!
pobj
.
file
.
url
)
{
return
system
.
getResult
(
null
,
"file can not be empty,100290"
);
}
try
{
let
rs
=
await
this
.
service
.
addQualification
(
pobj
);
return
system
.
getResult
(
rs
);
}
catch
(
err
)
{
return
system
.
getResult
(
null
,
err
.
message
)
}
}
}
module
.
exports
=
NewdeliverCtl
;
icp-deliver/app/base/db/impl/delivery/deliverDao.js
View file @
dac8fa8f
...
...
@@ -170,8 +170,38 @@ class DeliverDao extends Dao {
break
}
qc
.
where
[
"$and"
]
=
filters
;
}
else
{
}
else
if
(
type
===
"guangboManagement"
)
{
let
filters
=
[];
filters
.
push
({
product_code
:
"guangbo"
})
switch
(
qobj
.
bizpath
)
{
case
"/guangboManagement/wait"
:
filters
.
push
({
delivery_status
:
{
$notIn
:
[
system
.
SERVERSESTATUS
.
SUCCESS
,
system
.
SERVERSESTATUS
.
CLOSED
]
}
});
break
case
"/guangboManagement/deliveryAllocated"
:
filters
.
push
({
delivery_man_opcode
:
{
$ne
:
null
}
});
break
case
"/guangboManagement/deliveryNoAllocate"
:
filters
.
push
({
delivery_man_opcode
:
{
$eq
:
null
}
});
break
case
"/guangboManagement/all"
:
break
}
qc
.
where
[
"$and"
]
=
filters
;
}
else
{
throw
new
Error
(
"页面路径错误"
)
}
return
qw
;
...
...
icp-deliver/app/base/service/impl/delivery/newdeliverSve.js
View file @
dac8fa8f
...
...
@@ -110,5 +110,28 @@ class NewdeliverService extends ServiceBase {
});
return
"SUCCESS"
}
async
addQualification
(
pobj
)
{
const
deliverData
=
await
this
.
deliveryDao
.
findOne
({
id
:
pobj
.
id
});
if
(
!
deliverData
)
{
throw
new
Error
(
"查不到此交付单"
);
}
await
this
.
deliveryDao
.
updateByWhere
({
delivery_info
:
{
...
deliverData
.
delivery_info
,
qualification
:
pobj
.
file
}
},
{
id
:
pobj
.
id
});
return
"SUCCESS"
}
}
module
.
exports
=
NewdeliverService
;
icp-deliver/app/base/system.js
View file @
dac8fa8f
...
...
@@ -335,7 +335,8 @@ System.SERVICECODE = {
ICPANNUALREPORT
:
"ICPANNUALREPORT"
,
EDIANNUALREPORT
:
"EDIANNUALREPORT"
,
WANGWEN
:
"wangwen"
,
PANNONG
:
"pannong"
PANNONG
:
"pannong"
,
GUANGBO
:
"guangbo"
}
// 商机状态
System
.
BUSSTATUS
=
{
...
...
icp-deliver/app/base/utils/toQft/guangboClient.js
0 → 100644
View file @
dac8fa8f
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
,
"/web/action/qcapi/springBoard"
);
this
.
instance
=
null
;
this
.
CIRCUITSTATUS
=
{
ACCOUNTREGISTRATION
:
507
,
// 完成账户注册
SUBMITING
:
508
,
// 提交材料到工信部
DISPOSEING
:
509
,
// 工信部已受理
DISPOSEINGFAIL
:
510
,
// 工信不予受理
THROUGH
:
511
,
// 工信部通过
THROUGHFAIL
:
512
// 工信部未通过
}
}
static
getInstance
()
{
if
(
!
this
.
instance
)
{
this
.
instance
=
new
WangwenClient
();
}
return
this
.
instance
;
}
async
submitMaterials
(
username
,
deliverData
,
materials
)
{
const
{
businessLicense
,
materialFile
,
}
=
materials
;
const
{
address
,
businessTerm
,
createdAt
,
enterpriseCode
,
legalRepresentative
,
name
,
registeredCapital
,
scopeBusiness
,
type
}
=
businessLicense
;
const
{
partnerBusinessLicense
,
legalPersonIdentityCard
,
administrativeLicenseAuthorization
,
companyPolicy
,
mainManagement
,
radioAndTelevisionQualifications
,
registeredAddressCertificateDocument
,
partnerOtherList
,
}
=
materialFile
;
await
this
.
pushQiFuTong
(
username
,
{
actionType
:
"rtSubmitMaterial"
,
actionBody
:
{
orderNo
:
deliverData
.
delivery_code
,
material
:
{
businessLicense
:
{
address
,
businessTerm
,
createdAt
:
createdAt
?
createdAt
:
undefined
,
enterpriseCode
,
legalRepresentative
,
name
,
registeredCapital
,
scopeBusiness
,
type
},
partnerBusinessLicense
:
partnerBusinessLicense
.
url
,
legalPersonIdentityCard
:
legalPersonIdentityCard
.
url
,
administrativeLicenseAuthorization
:
administrativeLicenseAuthorization
.
url
,
companyPolicy
:
companyPolicy
.
url
,
mainManagement
:
mainManagement
.
url
,
radioAndTelevisionQualifications
:
radioAndTelevisionQualifications
.
url
,
registeredAddressCertificateDocument
:
registeredAddressCertificateDocument
.
url
,
partnerOtherList
:
partnerOtherList
.
url
,
}
}
});
}
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
:
status
=
this
.
CIRCUITSTATUS
.
THROUGH
if
(
deliverData
.
delivery_info
&&
deliverData
.
delivery_info
.
qualification
&&
deliverData
.
delivery_info
.
qualification
.
url
)
{
materials
=
{
officialFileURL
:
deliverData
.
delivery_info
.
qualification
.
url
}
}
break
case
system
.
SERVERSESTATUS
.
THROUGH
:
return
"SUCCESS"
default
:
throw
new
Error
(
"此状态不能手动更改"
);
}
await
this
.
pushQiFuTong
(
username
,
{
actionType
:
"rtNotification"
,
actionBody
:
{
orderNo
:
deliverData
.
delivery_code
,
status
,
...
materials
}
});
}
}
module
.
exports
=
WangwenClient
\ No newline at end of file
icp-deliver/app/base/utils/toQft/index.js
View file @
dac8fa8f
const
vatClient
=
require
(
"./vatClient"
)
const
wangwenClient
=
require
(
"./wangwenClient"
)
const
pannongClient
=
require
(
"./pannongClient"
)
const
guangboClient
=
require
(
"./guangboClient"
)
const
system
=
require
(
"../../system"
);
...
...
@@ -17,6 +19,8 @@ function getClientByType(type) {
return
wangwenClient
.
getInstance
();
case
system
.
SERVICECODE
.
PANNONG
:
return
pannongClient
.
getInstance
();
case
system
.
SERVICECODE
.
GUANGBO
:
return
guangboClient
.
getInstance
();
default
:
throw
new
Error
(
"无此产品类型"
);
}
...
...
icp-deliver/app/base/utils/toQft/vatClient.js
View file @
dac8fa8f
...
...
@@ -57,7 +57,7 @@ class VatClient extends BaseClient {
BusinessLicense
:
{
Address
:
address
,
BusinessTerm
:
businessTerm
,
CreatedAt
:
createdAt
,
CreatedAt
:
createdAt
?
createdAt
:
undefined
,
EnterpriseCode
:
enterpriseCode
,
LegalRepresentative
:
legalRepresentative
,
Name
:
name
,
...
...
icp-deliver/app/base/utils/toQft/wangwenClient.js
View file @
dac8fa8f
...
...
@@ -3,12 +3,20 @@ const settings = require("../../../config/settings");
const
system
=
require
(
"../../system"
);
const
{
appKey
,
secret
}
=
settings
;
/**
*
食品
网文 产品
* 网文 产品
*/
class
WangwenClient
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
// 工信部未通过
}
}
static
getInstance
()
{
...
...
@@ -17,81 +25,83 @@ class WangwenClient extends BaseClient {
}
return
this
.
instance
;
}
/**
* 文网文 递交材料,状态变更
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
)
async
submitMaterials
(
username
,
deliverData
,
materials
)
{
const
{
businessLicense
,
materialFile
,
}
=
materials
;
const
{
address
,
businessTerm
,
createdAt
,
enterpriseCode
,
legalRepresentative
,
name
,
registeredCapital
,
scopeBusiness
,
type
}
=
businessLicense
;
const
{
partnerBusinessLicense
,
legalPersonIdentityCard
,
businessDevelopmentDescription
,
companyPolicy
,
mainManagement
,
creditCertificateDocument
,
registeredAddressCertificateDocument
,
partnerOtherList
,
}
=
materialFile
;
await
this
.
pushQiFuTong
(
username
,
{
actionType
:
"ncSubmitMaterial"
,
actionBody
:
{
orderNo
:
deliverData
.
delivery_code
,
material
:
{
businessLicense
:
{
address
,
businessTerm
,
createdAt
:
createdAt
?
createdAt
:
undefined
,
enterpriseCode
,
legalRepresentative
,
name
,
registeredCapital
,
scopeBusiness
,
type
},
partnerBusinessLicense
:
partnerBusinessLicense
.
url
,
legalPersonIdentityCard
:
legalPersonIdentityCard
.
url
,
businessDevelopmentDescription
:
businessDevelopmentDescription
.
url
,
companyPolicy
:
companyPolicy
.
url
,
mainManagement
:
mainManagement
.
url
,
creditCertificateDocument
:
creditCertificateDocument
.
url
,
registeredAddressCertificateDocument
:
registeredAddressCertificateDocument
.
url
,
partnerOtherList
:
partnerOtherList
.
url
,
}
break
}
});
}
async
changeStatus
(
username
,
deliverData
,
materials
=
{})
{
let
status
;
switch
(
deliverData
.
delivery_status
)
{
case
system
.
SERVERSESTATUS
.
USERCONFIRMATIONRESOLVE
:
req
.
ApplicationStatus
=
602
;
case
system
.
SERVERSESTATUS
.
COLLECTSUCCESS
:
status
=
this
.
CIRCUITSTATUS
.
ACCOUNTREGISTRATION
break
case
system
.
SERVERSESTATUS
.
ACCOUNTREGISTRATION
:
req
.
ApplicationStatus
=
603
;
status
=
this
.
CIRCUITSTATUS
.
SUBMITING
break
case
system
.
SERVERSESTATUS
.
SUBMITING
:
req
.
ApplicationStatus
=
604
;
status
=
this
.
CIRCUITSTATUS
.
DISPOSEING
break
case
system
.
SERVERSESTATUS
.
DISPOSEING
:
req
.
ApplicationStatus
=
606
;
status
=
this
.
CIRCUITSTATUS
.
THROUGH
if
(
deliverData
.
delivery_info
&&
deliverData
.
delivery_info
.
qualification
&&
deliverData
.
delivery_info
.
qualification
.
url
)
{
materials
=
{
officialFileURL
:
deliverData
.
delivery_info
.
qualification
.
url
}
}
break
case
system
.
SERVERSESTATUS
.
THROUGH
:
return
"SUCCESS"
default
:
throw
new
Error
(
"此状态
手动不能
更改"
);
throw
new
Error
(
"此状态
不能手动
更改"
);
}
await
this
.
pushQiFuTong
(
username
,
{
actionType
:
"
serviceSubmitOp
tion"
,
actionType
:
"
ncNotifica
tion"
,
actionBody
:
{
"channelType"
:
channelType
[
deliverData
.
product_code
],
"orderNo"
:
deliverData
.
delivery_code
,
"extInfo"
:
"{}"
,
...
req
,
orderNo
:
deliverData
.
delivery_code
,
status
,
...
materials
}
});
}
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