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
7e464919
Commit
7e464919
authored
May 19, 2021
by
Sxy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 百度工商套餐
parent
a1e28642
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
231 additions
and
50 deletions
+231
-50
icp-deliver/app/base/controller/impl/delivery/companycaseCtl.js
+25
-1
icp-deliver/app/base/db/impl/delivery/deliverDao.js
+10
-1
icp-deliver/app/base/db/models/delivery/delivery_bill.js
+4
-0
icp-deliver/app/base/db/models/delivery/qualification_info.js
+6
-6
icp-deliver/app/base/service/impl/delivery/companycaseSve.js
+81
-8
icp-deliver/app/base/system.js
+4
-0
icp-deliver/app/base/utils/toQft/gongshangClient.js
+97
-33
icp-deliver/app/base/utils/toQft/index.js
+4
-1
No files found.
icp-deliver/app/base/controller/impl/delivery/companycaseCtl.js
View file @
7e464919
...
...
@@ -17,6 +17,31 @@ class CompanycaseCtl extends CtlBase {
return
system
.
getResult
(
null
,
err
.
message
)
}
}
// 工商通用产品 提交材料
async
companyCaseDeliverCommonSubmitMaterials
(
pobj
,
qobj
,
req
)
{
try
{
if
(
!
pobj
.
deliver_id
)
{
throw
new
Error
(
"参数错误"
)
}
const
rs
=
await
this
.
service
.
companyCaseDeliverCommonSubmitMaterials
(
pobj
);
return
system
.
getResult
(
rs
);
}
catch
(
err
)
{
return
system
.
getResult
(
null
,
err
.
message
)
}
}
// 工商通用产品 提交交付物
async
companyCaseDeliverCommonSubmitQualification
(
pobj
,
qobj
,
req
)
{
try
{
if
(
!
pobj
.
deliver_id
)
{
throw
new
Error
(
"参数错误"
)
}
const
rs
=
await
this
.
service
.
companyCaseDeliverCommonSubmitQualification
(
pobj
);
return
system
.
getResult
(
rs
);
}
catch
(
err
)
{
return
system
.
getResult
(
null
,
err
.
message
)
}
}
// 更改状态
async
changeDeliveryStatus
(
pobj
,
qobj
,
req
)
{
...
...
@@ -24,7 +49,6 @@ class CompanycaseCtl extends CtlBase {
if
(
!
pobj
.
id
)
{
throw
new
Error
(
"参数错误"
)
}
console
.
log
(
"log-------"
);
const
rs
=
await
this
.
service
.
changeDeliveryStatus
(
pobj
);
return
system
.
getResult
(
rs
);
}
catch
(
err
)
{
...
...
icp-deliver/app/base/db/impl/delivery/deliverDao.js
View file @
7e464919
...
...
@@ -6,7 +6,7 @@ class DeliverDao extends Dao {
super
(
Dao
.
getModelName
(
DeliverDao
));
}
orderBy
()
{
return
[[
"
upd
ated_at"
,
"DESC"
]];
return
[[
"
cre
ated_at"
,
"DESC"
]];
}
extraWhere
(
qobj
,
qw
,
qc
)
{
...
...
@@ -204,6 +204,10 @@ class DeliverDao extends Dao {
product_code
:
{
$in
:
[
system
.
SERVICECODE
.
COMPANYCASE
,
system
.
SERVICECODE
.
OPENBANKACCOUNTCASE
,
system
.
SERVICECODE
.
TAXCASE
,
system
.
SERVICECODE
.
REGADDRCASE1
,
system
.
SERVICECODE
.
AGENTCASE1
// system.SERVICECODE.SEALSEVCASE,
// system.SERVICECODE.TAXCONTROLCASE,
// system.SERVICECODE.TAXCASE,
...
...
@@ -286,6 +290,11 @@ class DeliverDao extends Dao {
},
include
:
[
{
model
:
this
.
db
.
models
.
qualification
,
// attributes: ['id', 'certificateNumber', 'businessTypes', 'businessScope', 'serviceProject', 'startAt', 'endAt', 'file'],
raw
:
false
},
{
model
:
this
.
db
.
models
.
newmaterial
,
raw
:
false
}
...
...
icp-deliver/app/base/db/models/delivery/delivery_bill.js
View file @
7e464919
...
...
@@ -110,6 +110,10 @@ module.exports = (db, DataTypes) => {
allowNull
:
true
,
type
:
DataTypes
.
STRING
},
is_package
:
{
//是否是套餐
type
:
DataTypes
.
BOOLEAN
,
defaultValue
:
false
},
},
{
paranoid
:
false
,
//假的删除
underscored
:
true
,
...
...
icp-deliver/app/base/db/models/delivery/qualification_info.js
View file @
7e464919
...
...
@@ -7,27 +7,27 @@ const appconfig = system.getSysConfig();
module
.
exports
=
(
db
,
DataTypes
)
=>
{
return
db
.
define
(
"qualification"
,
{
certificateNumber
:
{
allowNull
:
fals
e
,
allowNull
:
tru
e
,
type
:
DataTypes
.
STRING
},
businessTypes
:
{
allowNull
:
fals
e
,
allowNull
:
tru
e
,
type
:
DataTypes
.
STRING
},
businessScope
:
{
allowNull
:
fals
e
,
allowNull
:
tru
e
,
type
:
DataTypes
.
TEXT
},
serviceProject
:
{
allowNull
:
fals
e
,
allowNull
:
tru
e
,
type
:
DataTypes
.
STRING
},
startAt
:
{
allowNull
:
fals
e
,
allowNull
:
tru
e
,
type
:
DataTypes
.
DATE
},
endAt
:
{
allowNull
:
fals
e
,
allowNull
:
tru
e
,
type
:
DataTypes
.
DATE
},
file
:
{
...
...
icp-deliver/app/base/service/impl/delivery/companycaseSve.js
View file @
7e464919
...
...
@@ -13,6 +13,7 @@ class CompanycaseService extends ServiceBase {
this
.
deliveryDao
=
system
.
getObject
(
"db.delivery.deliverDao"
);
this
.
newmaterialDao
=
system
.
getObject
(
"db.delivery.newmaterialDao"
);
this
.
statuslogDao
=
system
.
getObject
(
"db.bizchance.statuslogDao"
);
this
.
qualificationDao
=
system
.
getObject
(
"db.delivery.qualificationDao"
);
}
async
submitMaterials
(
pobj
,
qobj
,
req
)
{
...
...
@@ -45,6 +46,17 @@ class CompanycaseService extends ServiceBase {
});
}
async
companyCaseDeliverCommonSubmitMaterials
(
pobj
,
qobj
,
req
)
{
const
deliverData
=
await
this
.
deliveryDao
.
findOne
({
id
:
pobj
.
deliver_id
});
if
(
!
deliverData
)
{
throw
new
Error
(
"查不到此交付单"
);
}
await
this
.
newmaterialDao
.
createOrUpdate
(
pobj
);
return
"SUCCESS"
}
async
changeDeliveryStatus
(
pobj
,
qobj
,
req
)
{
const
deliverData
=
await
this
.
deliveryDao
.
findOne
({
id
:
pobj
.
id
...
...
@@ -52,14 +64,39 @@ class CompanycaseService extends ServiceBase {
if
(
!
deliverData
)
{
throw
new
Error
(
"没有此交付单"
);
}
let
updateData
=
{};
let
status
;
let
materials
=
{};
switch
(
deliverData
.
delivery_status
)
{
case
system
.
SERVERSESTATUS
.
RECEIVED
:
if
(
deliverData
.
product_code
===
system
.
SERVICECODE
.
COMPANYCASE
)
{
status
=
system
.
SERVERSESTATUS
.
COLLECTING
;
}
else
{
status
=
system
.
SERVERSESTATUS
.
SERVICEING
;
switch
(
deliverData
.
product_code
)
{
case
system
.
SERVICECODE
.
COMPANYCASE
:
case
system
.
SERVICECODE
.
REGADDRCASE1
:
status
=
system
.
SERVERSESTATUS
.
COLLECTING
;
break
case
system
.
SERVICECODE
.
TAXCASE
:
case
system
.
SERVICECODE
.
OPENBANKACCOUNTCASE
:
status
=
system
.
SERVERSESTATUS
.
SUCCESS
;
break
case
system
.
SERVICECODE
.
AGENTCASE1
:
status
=
system
.
SERVERSESTATUS
.
SERVICEING
;
break
default
:
throw
new
Error
(
"异常操作"
);
}
break
case
system
.
SERVERSESTATUS
.
COLLECTING
:
// 收集材料
const
materialData
=
await
this
.
newmaterialDao
.
findOne
({
deliver_id
:
deliverData
.
id
})
if
(
materialData
&&
materialData
.
materialInfo
&&
materialData
.
materialInfo
.
file
&&
materialData
.
materialInfo
.
file
.
url
)
{
materials
=
{
deliverContent
:
{
deliverMaterialUrl
:
materialData
.
materialInfo
.
file
.
url
}
}
}
status
=
system
.
SERVERSESTATUS
.
SERVICEING
;
break
case
system
.
SERVERSESTATUS
.
AUDITING
:
// 工商审核环节
status
=
system
.
SERVERSESTATUS
.
ENGRAVING
;
...
...
@@ -73,10 +110,34 @@ class CompanycaseService extends ServiceBase {
default
:
throw
new
Error
(
"此状态手动不能更改"
);
}
await
TOQFT
.
getClientByType
(
deliverData
.
product_code
).
changeStatus
(
pobj
.
username
,
deliverData
);
await
this
.
deliveryDao
.
updateByWhere
({
delivery_status
:
status
},
{
if
(
(
system
.
SERVICECODE
.
REGADDRCASE1
===
deliverData
.
product_code
&&
deliverData
.
delivery_status
===
system
.
SERVERSESTATUS
.
SERVICEING
)
||
(
system
.
SERVICECODE
.
AGENTCASE1
===
deliverData
.
product_code
&&
deliverData
.
delivery_status
===
system
.
SERVERSESTATUS
.
RECEIVED
)
)
{
if
(
!
pobj
.
startTime
||
!
pobj
.
endTime
)
{
throw
new
Error
(
"请传入 服务的起止时间"
)
}
else
{
const
delivery_info
=
{
...
deliverData
.
delivery_info
,
startTime
:
system
.
SERVICECODE
.
REGADDRCASE1
===
deliverData
.
product_code
?
moment
(
pobj
.
startTime
).
format
(
'YYYY-MM-DD'
)
:
moment
(
pobj
.
startTime
).
format
(
'YYYY-MM'
),
endTime
:
system
.
SERVICECODE
.
REGADDRCASE1
===
deliverData
.
product_code
?
moment
(
pobj
.
endTime
).
format
(
'YYYY-MM-DD'
)
:
moment
(
pobj
.
endTime
).
format
(
'YYYY-MM'
)
}
updateData
=
{
delivery_status
:
status
,
delivery_info
}
deliverData
.
delivery_info
=
delivery_info
;
}
}
else
{
updateData
=
{
delivery_status
:
status
}
}
await
TOQFT
.
getClientByType
(
deliverData
.
product_code
).
changeStatus
(
pobj
.
username
,
deliverData
,
materials
);
await
this
.
deliveryDao
.
updateByWhere
(
updateData
,
{
id
:
pobj
.
id
})
this
.
statuslogDao
.
create
({
...
...
@@ -88,5 +149,17 @@ class CompanycaseService extends ServiceBase {
});
return
"SUCCESS"
}
async
companyCaseDeliverCommonSubmitQualification
(
pobj
,
qobj
,
req
)
{
const
deliverData
=
await
this
.
deliveryDao
.
findOne
({
id
:
pobj
.
deliver_id
});
if
(
!
deliverData
)
{
throw
new
Error
(
"查不到此交付单"
);
}
await
this
.
qualificationDao
.
createOrUpdate
(
pobj
);
return
"SUCCESS"
}
}
module
.
exports
=
CompanycaseService
;
icp-deliver/app/base/system.js
View file @
7e464919
...
...
@@ -341,6 +341,10 @@ System.SERVICECODE = {
TAXCONTROLCASE
:
"taxControlCase"
,
// 税控申请
TAXCASE
:
"taxCase"
,
// 税务报道
ICCHANGECASE
:
"icChangeCase"
,
// 工商变更
OPENBANKACCOUNTCASE
:
"openBankAccountCase"
,
// 银行开户
REGADDRCASE1
:
"regAddrCase1"
,
// 注册地址服务(一年期)
AGENTCASE1
:
"agentCase1"
// 代理记账(一年期)
}
// 商机状态
System
.
BUSSTATUS
=
{
...
...
icp-deliver/app/base/utils/toQft/gongshangClient.js
View file @
7e464919
...
...
@@ -9,12 +9,31 @@ class GongshangClient extends BaseClient {
constructor
()
{
super
(
appKey
,
secret
,
"/web/action/regapi/springBoard"
);
this
.
instance
=
null
;
this
.
productType
=
[
{
zzbType
:
system
.
SERVICECODE
.
COMPANYCASE
,
qftType
:
"GSZZ"
},
{
zzbType
:
system
.
SERVICECODE
.
OPENBANKACCOUNTCASE
,
qftType
:
"YHKH"
},
{
zzbType
:
system
.
SERVICECODE
.
TAXCASE
,
qftType
:
"SWBD"
},
{
zzbType
:
system
.
SERVICECODE
.
REGADDRCASE1
,
qftType
:
"DZFW"
},
{
zzbType
:
system
.
SERVICECODE
.
AGENTCASE1
,
qftType
:
"DLJZ"
},
];
this
.
CIRCUITSTATUS
=
{
RECEIVED
:
701
,
//已接单
COLLECTING
:
702
,
//材料收集环节
AUDITING
:
703
,
//工商审核环节
ENGRAVING
:
704
,
//刻章环节
SUCCESS
:
705
,
//已完成
SERVICEING
:
706
//服务中
}
}
...
...
@@ -52,36 +71,40 @@ class GongshangClient extends BaseClient {
break
case
system
.
SERVERSESTATUS
.
SUCCESS
:
// 服务中
return
"SUCCESS"
break
default
:
throw
new
Error
(
"此状态手动不能更改"
);
}
let
pushData
=
{
orderNo
:
deliverData
.
delivery_code
,
status
,
deliverContent
:
{
applicationFormUrl
:
applicationFormUrl
.
url
,
registDocumentsUrl
:
registDocumentsUrl
.
url
,
baseInfo
:
{},
companyInfo
:
{
companyName
,
spareName
:
spareName
.
filter
(
item
=>
{
return
item
;
}),
companyProperties
,
addressType
,
fullAddress
,
taxpayerType
,
serviceArea
,
engagedIndustry
,
businessScope
,
operatingPeriod
}
},
}
if
(
deliverData
.
is_package
)
{
pushData
.
productType
=
this
.
productType
.
find
((
item
)
=>
{
return
item
.
zzbType
===
deliverData
.
product_code
}).
qftType
;
}
await
this
.
pushQiFuTong
(
username
,
{
actionType
:
"regUpdateOrderStatus"
,
actionBody
:
{
orderNo
:
deliverData
.
delivery_code
,
status
,
deliverContent
:
{
applicationFormUrl
:
applicationFormUrl
.
url
,
registDocumentsUrl
:
registDocumentsUrl
.
url
,
baseInfo
:
{},
companyInfo
:
{
companyName
,
spareName
:
spareName
.
filter
(
item
=>
{
return
item
;
}),
companyProperties
,
addressType
,
fullAddress
,
taxpayerType
,
serviceArea
,
engagedIndustry
,
businessScope
,
operatingPeriod
}
},
}
actionBody
:
pushData
});
}
...
...
@@ -89,12 +112,25 @@ class GongshangClient extends BaseClient {
let
status
;
switch
(
deliverData
.
delivery_status
)
{
case
system
.
SERVERSESTATUS
.
RECEIVED
:
if
(
deliverData
.
product_code
===
system
.
SERVICECODE
.
COMPANYCASE
)
{
status
=
this
.
CIRCUITSTATUS
.
COLLECTING
;
}
else
{
status
=
"TODO:"
;
switch
(
deliverData
.
product_code
)
{
case
system
.
SERVICECODE
.
COMPANYCASE
:
case
system
.
SERVICECODE
.
REGADDRCASE1
:
status
=
system
.
SERVERSESTATUS
.
COLLECTING
;
break
case
system
.
SERVICECODE
.
TAXCASE
:
case
system
.
SERVICECODE
.
OPENBANKACCOUNTCASE
:
status
=
system
.
SERVERSESTATUS
.
SUCCESS
;
break
case
system
.
SERVICECODE
.
AGENTCASE1
:
status
=
system
.
SERVERSESTATUS
.
SERVICEING
;
break
default
:
throw
new
Error
(
"异常操作"
);
}
break
case
system
.
SERVERSESTATUS
.
COLLECTING
:
// 收集材料
status
=
system
.
SERVERSESTATUS
.
SERVICEING
;
break
case
system
.
SERVERSESTATUS
.
AUDITING
:
// 工商审核环节
status
=
this
.
CIRCUITSTATUS
.
ENGRAVING
;
break
...
...
@@ -107,12 +143,40 @@ class GongshangClient extends BaseClient {
default
:
throw
new
Error
(
"此状态手动不能更改"
);
}
let
pushData
=
{
orderNo
:
deliverData
.
delivery_code
,
status
,
}
// 套餐 判断
if
(
deliverData
.
is_package
)
{
pushData
.
productType
=
this
.
productType
.
find
((
item
)
=>
{
return
item
.
zzbType
===
deliverData
.
product_code
}).
qftType
;
}
// 代理记账、地址服务 的截止时间
if
(
(
system
.
SERVICECODE
.
REGADDRCASE1
===
deliverData
.
product_code
&&
deliverData
.
delivery_status
===
system
.
SERVERSESTATUS
.
SERVICEING
)
||
(
system
.
SERVICECODE
.
AGENTCASE1
===
deliverData
.
product_code
&&
deliverData
.
delivery_status
===
system
.
SERVERSESTATUS
.
RECEIVED
)
)
{
pushData
.
startTime
=
new
Date
(
deliverData
.
delivery_info
.
startTime
).
getTime
()
/
1000
;
pushData
.
endTime
=
new
Date
(
deliverData
.
delivery_info
.
endTime
).
getTime
()
/
1000
;
}
// 材料信息
if
(
Object
.
keys
(
materials
).
length
)
{
pushData
=
{
...
pushData
,
...
materials
}
}
await
this
.
pushQiFuTong
(
username
,
{
actionType
:
"regUpdateOrderStatus"
,
actionBody
:
{
orderNo
:
deliverData
.
delivery_code
,
status
,
}
actionBody
:
pushData
});
}
}
...
...
icp-deliver/app/base/utils/toQft/index.js
View file @
7e464919
...
...
@@ -24,7 +24,10 @@ function getClientByType(type) {
case
system
.
SERVICECODE
.
GUANGBO
:
return
guangboClient
.
getInstance
();
case
system
.
SERVICECODE
.
COMPANYCASE
:
case
system
.
SERVICECODE
.
SEALSEVCASE
:
case
system
.
SERVICECODE
.
OPENBANKACCOUNTCASE
:
case
system
.
SERVICECODE
.
TAXCASE
:
case
system
.
SERVICECODE
.
REGADDRCASE1
:
case
system
.
SERVICECODE
.
AGENTCASE1
:
return
gongshangClient
.
getInstance
();
default
:
throw
new
Error
(
"无此产品类型"
);
...
...
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