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
f6bbca5f
Commit
f6bbca5f
authored
Jun 22, 2020
by
sxy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 生成材料下载地址
parent
533da2e8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
273 additions
and
5 deletions
+273
-5
icp-deliver/app/base/controller/impl/delivery/materialCtl.js
+256
-0
icp-deliver/app/base/db/dao.base.js
+2
-2
icp-deliver/app/base/db/impl/delivery/materialDao.js
+2
-1
icp-deliver/app/base/db/models/delivery/meterials_info.js
+8
-0
icp-deliver/app/base/service/sve.base.js
+5
-2
No files found.
icp-deliver/app/base/controller/impl/delivery/materialCtl.js
0 → 100644
View file @
f6bbca5f
var
system
=
require
(
"../../../system"
);
const
http
=
require
(
"http"
);
const
querystring
=
require
(
'querystring'
);
var
settings
=
require
(
"../../../../config/settings"
);
const
CtlBase
=
require
(
"../../ctl.base"
);
const
moment
=
require
(
"moment"
);
class
MaterialCtl
extends
CtlBase
{
constructor
()
{
super
(
"delivery"
,
CtlBase
.
getServiceName
(
MaterialCtl
));
this
.
db
=
system
.
getObject
(
"db.common.connection"
).
getCon
();
}
// 获取 组装 excl 文件 数据
async
waitGenerate
(
pobj
,
qobj
,
req
)
{
const
rs
=
await
this
.
service
.
findAll
({
ifDownload
:
false
},
[
{
model
:
this
.
db
.
models
.
deliver
,
attributes
:
[
"product_code"
],
}
]);
// 组装数据
return
system
.
getResult
(
rs
.
map
(
item
=>
{
const
type
=
item
.
deliver
.
product_code
;
const
{
proposerInfo
,
otherMaterialsInfo
,
implementationPlanInfo
,
safetyInfo
,
shareholderData
}
=
item
;
const
{
businessLicense
,
businessInformation
,
principalInfo
,
contactInfo
}
=
proposerInfo
;
const
{
webApp
,
targetUser
,
profitableWay
,
specialApproval
,
serviceProjectEdi
,
serviceProjectIcp
}
=
implementationPlanInfo
;
// 1. id ,type
// 2.注册认证
let
registeredAddressData
=
{
authentication
:
{},
files
:
[]
};
let
legalRepresentative
=
principalInfo
.
filter
(
item
=>
{
return
item
.
title
===
"法定代表人"
});
legalRepresentative
=
legalRepresentative
.
length
>
0
?
legalRepresentative
[
0
]
:
{};
registeredAddressData
.
authentication
=
{
personType
:
"法人"
,
companyType
:
businessLicense
.
type
,
enterpriseCode
:
businessLicense
.
enterpriseCode
,
name
:
businessLicense
.
name
,
legalTypes
:
businessInformation
.
legalTypes
,
legalName
:
legalRepresentative
.
name
,
legalCertificateId
:
legalRepresentative
.
certificateId
,
legalCertificateType
:
legalRepresentative
.
certificateType
,
contactAddress
:
contactInfo
.
address
};
registeredAddressData
.
files
.
push
(
...(
Array
.
isArray
(
otherMaterialsInfo
)
?
otherMaterialsInfo
.
filter
(
item
=>
{
return
item
.
title
===
"营业执照"
;
})
:
[])
,
{
title
:
"法定代表人身份证件"
,
file
:
legalRepresentative
.
file
});
// 3. 发展和实施计划
let
implementationPlanData
=
{
// ICP
// EDI
webApp
:
webApp
,
files
:
[]
};
let
serviceProject
=
{};
if
(
type
===
"ICP"
)
{
serviceProject
=
{
releaseAndDelivery
:
""
,
community
:
""
,
protectiveProcessing
:
""
,
interactive
:
""
,
search
:
""
}
serviceProjectIcp
.
map
(
item
=>
{
switch
(
item
.
title
)
{
case
"信息发布平台和递送服务"
:
serviceProject
[
"releaseAndDelivery"
]
=
item
.
value
.
join
().
replace
(
/其他/
,
item
.
otherValue
);
break
case
"信息搜索查询服务"
:
serviceProject
[
"search"
]
=
item
.
value
.
join
().
replace
(
/其他/
,
item
.
otherValue
);
break
case
"信息社区服务"
:
serviceProject
[
"community"
]
=
item
.
value
.
join
().
replace
(
/其他/
,
item
.
otherValue
);
break
case
"信息保护加工处理服务"
:
serviceProject
[
"protectiveProcessing"
]
=
item
.
value
.
join
().
replace
(
/其他/
,
item
.
otherValue
);
break
case
"信息及时交互服务"
:
serviceProject
[
"interactive"
]
=
item
.
value
.
join
().
replace
(
/其他/
,
item
.
otherValue
);
break
}
})
}
else
if
(
type
===
'EDI'
)
{
serviceProject
=
{
electronicExchange
:
""
,
transactionProcessing
:
""
,
dataProcessing
:
""
}
serviceProjectEdi
.
map
(
item
=>
{
switch
(
item
.
title
)
{
case
"电子交换业务"
:
serviceProject
[
"electronicExchange"
]
=
item
.
value
.
join
();
break
case
"交易处理业务"
:
serviceProject
[
"transactionProcessing"
]
=
item
.
value
.
join
();
break
case
"网络/电子设备数据处理业务"
:
serviceProject
[
"dataProcessing"
]
=
item
.
value
.
join
();
break
}
})
}
implementationPlanData
[
type
]
=
{
...
serviceProject
,
targetUser
:
targetUser
.
join
(),
profitableWay
:
profitableWay
.
join
()
};
// 专项审批项目 ICP
if
(
type
===
"ICP"
)
{
implementationPlanData
.
files
.
push
(...
specialApproval
.
filter
(
item
=>
{
return
item
.
file
&&
item
.
file
.
url
?
true
:
false
}).
map
(
item
=>
{
return
{
file
:
item
.
file
,
title
:
`专项审批项-
${
item
.
title
}
`
}
}));
}
implementationPlanData
.
files
.
push
(...
otherMaterialsInfo
.
filter
(
item
=>
{
return
item
.
title
===
"域名证书"
}));
if
(
type
===
"EDI"
)
{
implementationPlanData
.
files
.
push
(...
serviceProjectEdi
.
filter
(
item
=>
{
return
item
.
file
&&
item
.
file
.
url
?
true
:
false
}).
map
(
item
=>
{
return
{
title
:
item
.
title
,
file
:
item
.
file
}
}));
}
// 4. 增值电信申请表
let
licenceData
=
{
licence
:
{
companyName
:
businessLicense
.
name
,
enterpriseCode
:
businessLicense
.
enterpriseCode
,
registeredCapital
:
businessLicense
.
registeredCapital
,
registerAddress
:
businessLicense
.
address
,
fixedTelephone
:
businessInformation
.
fixedTelephone
,
workAddress
:
businessInformation
.
address
,
zipCode
:
businessInformation
.
zipCode
,
comapnyNature
:
businessInformation
.
comapnyNature
,
ifListed
:
businessInformation
.
ifListed
?
"是"
:
"否"
},
files
:
[
...(
Array
.
isArray
(
otherMaterialsInfo
)
?
otherMaterialsInfo
.
filter
(
item
=>
{
return
item
.
title
===
"营业执照"
;
})
:
[])
]
}
// 5. 公司及人员情况
let
companyPersonnelData
=
{
personnelInfo
:
principalInfo
,
companyInfo
:
{
bussinessDirection
:
businessInformation
.
bussinessDirection
,
staffSize
:
businessInformation
.
staffSize
,
businessScale
:
businessInformation
.
businessScale
},
files
:
[]
}
companyPersonnelData
.
files
.
push
(...
principalInfo
.
filter
(
item
=>
{
return
item
.
file
&&
item
.
file
.
url
?
true
:
false
}).
map
(
item
=>
{
return
{
"title"
:
`
${
item
.
title
}
身份证`
,
file
:
item
.
file
}
}),
...(
Array
.
isArray
(
otherMaterialsInfo
)
?
otherMaterialsInfo
.
filter
(
item
=>
{
return
item
.
title
===
"社保证明文件"
;
})
:
[]))
// 6. 网络与信息安全
let
safetyData
=
{
safety
:
{
qualification
:
safetyInfo
.
qualification
,
responsibility
:
safetyInfo
.
responsibility
},
files
:
[]
}
// 7. 股东信息
let
shareholdersData
=
{
shareholdes
:
shareholderData
,
files
:
[]
}
shareholdersData
.
files
.
push
(...(
Array
.
isArray
(
otherMaterialsInfo
)
?
otherMaterialsInfo
.
filter
(
item
=>
{
return
[
"股东追溯承诺书"
,
"申请者国家企业信用信息公示系统截图"
].
includes
(
item
.
title
);
})
:
[]))
shareholdersData
.
files
.
push
(...
shareholderData
.
filter
(
item
=>
{
return
item
.
file
&&
item
.
file
.
url
?
true
:
false
}).
map
(
item
=>
{
return
{
file
:
item
.
file
,
title
:
`
${
item
.
name
}
身份证`
}
}));
// 8. 电信业务承诺书
let
telecommunicationServiceData
=
{
files
:
[...(
Array
.
isArray
(
otherMaterialsInfo
)
?
otherMaterialsInfo
.
filter
(
item
=>
{
return
[
"依法经营电信业务承诺书"
].
includes
(
item
.
title
);
})
:
[])]
}
// 9. 其他材料
let
otherMaterialsData
=
{
files
:
[...(
Array
.
isArray
(
otherMaterialsInfo
)
?
otherMaterialsInfo
.
filter
(
item
=>
{
return
[
"收费方案"
,
"服务器托管协议"
,
"服务器托管商IDC许可证"
].
includes
(
item
.
title
)
||
item
.
fixed
===
false
;
})
:
[])]
}
return
{
id
:
item
.
id
,
type
,
registeredAddressData
,
implementationPlanData
,
licenceData
,
companyPersonnelData
,
safetyData
,
shareholdersData
,
telecommunicationServiceData
,
otherMaterialsData
}
}));
}
// 更新 下载 url
async
updateUrl
(
pobj
)
{
if
(
!
pobj
.
id
)
{
return
system
.
getResult
(
null
,
"id can not be empty,100290"
);
}
if
(
!
pobj
.
url
)
{
return
system
.
getResult
(
null
,
"url can not be empty,100290"
);
}
await
this
.
service
.
updateByWhere
({
ifDownload
:
true
,
downloadUrl
:
pobj
.
url
},
{
id
:
pobj
.
id
,
});
return
system
.
getResultSuccess
();
}
}
module
.
exports
=
MaterialCtl
;
icp-deliver/app/base/db/dao.base.js
View file @
f6bbca5f
...
@@ -266,8 +266,8 @@ class Dao {
...
@@ -266,8 +266,8 @@ class Dao {
async
findById
(
oid
)
{
async
findById
(
oid
)
{
return
this
.
model
.
findById
(
oid
);
return
this
.
model
.
findById
(
oid
);
}
}
async
findAll
(
obj
)
{
async
findAll
(
obj
,
include
=
[]
)
{
return
this
.
model
.
findAll
({
"where"
:
obj
,
row
:
true
});
return
this
.
model
.
findAll
({
"where"
:
obj
,
include
,
row
:
true
});
}
}
}
}
module
.
exports
=
Dao
;
module
.
exports
=
Dao
;
icp-deliver/app/base/db/impl/delivery/materialDao.js
View file @
f6bbca5f
...
@@ -17,7 +17,8 @@ class MaterialDao extends Dao {
...
@@ -17,7 +17,8 @@ class MaterialDao extends Dao {
implementationPlanInfo
:
pobj
.
cache_info
.
implementationPlanInfo
,
implementationPlanInfo
:
pobj
.
cache_info
.
implementationPlanInfo
,
safetyInfo
:
pobj
.
cache_info
.
safetyInfo
,
safetyInfo
:
pobj
.
cache_info
.
safetyInfo
,
otherMaterialsInfo
:
pobj
.
cache_info
.
otherMaterialsInfo
,
otherMaterialsInfo
:
pobj
.
cache_info
.
otherMaterialsInfo
,
deliver_id
:
pobj
.
deliver_id
deliver_id
:
pobj
.
deliver_id
,
ifDownload
:
false
}
}
dataInfo
.
proposerInfo
.
businessInformation
.
ifListed
=
dataInfo
.
proposerInfo
.
businessInformation
.
ifListed
===
"true"
dataInfo
.
proposerInfo
.
businessInformation
.
ifListed
=
dataInfo
.
proposerInfo
.
businessInformation
.
ifListed
===
"true"
if
(
materialData
)
{
if
(
materialData
)
{
...
...
icp-deliver/app/base/db/models/delivery/meterials_info.js
View file @
f6bbca5f
...
@@ -25,6 +25,14 @@ module.exports = (db, DataTypes) => {
...
@@ -25,6 +25,14 @@ module.exports = (db, DataTypes) => {
otherMaterialsInfo
:
{
otherMaterialsInfo
:
{
allowNull
:
false
,
allowNull
:
false
,
type
:
DataTypes
.
JSON
type
:
DataTypes
.
JSON
},
ifDownload
:
{
//是否生成下载文件
type
:
DataTypes
.
BOOLEAN
,
defaultValue
:
false
},
downloadUrl
:
{
allowNull
:
true
,
type
:
DataTypes
.
STRING
}
}
},
{
},
{
paranoid
:
false
,
//假的删除
paranoid
:
false
,
//假的删除
...
...
icp-deliver/app/base/service/sve.base.js
View file @
f6bbca5f
...
@@ -75,11 +75,14 @@ class ServiceBase {
...
@@ -75,11 +75,14 @@ class ServiceBase {
async
findById
(
oid
)
{
async
findById
(
oid
)
{
return
this
.
dao
.
findById
(
oid
);
return
this
.
dao
.
findById
(
oid
);
}
}
async
findAll
(
obj
,
include
=
[])
{
return
this
.
dao
.
findAll
(
obj
,
include
);
}
/*
/*
返回20位业务订单号
返回20位业务订单号
prefix:业务前缀
prefix:业务前缀
*/
*/
async
getBusUid
(
prefix
)
{
async
getBusUid
(
prefix
)
{
prefix
=
(
prefix
||
""
);
prefix
=
(
prefix
||
""
);
if
(
prefix
)
{
if
(
prefix
)
{
prefix
=
prefix
.
toUpperCase
();
prefix
=
prefix
.
toUpperCase
();
...
@@ -97,7 +100,7 @@ class ServiceBase {
...
@@ -97,7 +100,7 @@ class ServiceBase {
len:返回长度
len:返回长度
radix:参与计算的长度,最大为62
radix:参与计算的长度,最大为62
*/
*/
async
getUidInfo
(
len
,
radix
)
{
async
getUidInfo
(
len
,
radix
)
{
var
chars
=
'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
.
split
(
''
);
//长度62,到yz长度为长36
var
chars
=
'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
.
split
(
''
);
//长度62,到yz长度为长36
var
uuid
=
[],
i
;
var
uuid
=
[],
i
;
radix
=
radix
||
chars
.
length
;
radix
=
radix
||
chars
.
length
;
...
...
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