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
60ffc93a
Commit
60ffc93a
authored
Apr 10, 2020
by
庄冰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
icp
parent
afc7df87
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
442 additions
and
0 deletions
+442
-0
center-order/app/base/api/impl/action/icpapi.js
+60
-0
center-order/app/base/service/impl/dbneed/needsolutionSve.js
+382
-0
No files found.
center-order/app/base/api/impl/action/icpapi.js
0 → 100644
View file @
60ffc93a
var
APIBase
=
require
(
"../../api.base"
);
var
system
=
require
(
"../../../system"
);
var
settings
=
require
(
"../../../../config/settings"
);
class
IcpAPI
extends
APIBase
{
constructor
()
{
super
();
// this.utilsProductSve = system.getObject("service.utilsSve.utilsProductSve");
this
.
needsolutionSve
=
system
.
getObject
(
"service.dbneed.needsolutionSve"
);
this
.
needinfoSve
=
system
.
getObject
(
"service.dbneed.needinfoSve"
);
this
.
orderinfoSve
=
system
.
getObject
(
"service.dbcorder.orderinfoSve"
);
}
/**
* 接口跳转-POST请求
* action_process 执行的流程
* action_type 执行的类型
* action_body 执行的参数
*/
async
springBoard
(
pobj
,
qobj
,
req
)
{
if
(
!
pobj
.
actionType
)
{
return
system
.
getResult
(
null
,
"actionType参数不能为空"
);
}
if
(
pobj
.
actionType
==
'getPolicyNeedList'
||
pobj
.
actionType
==
'submitPolicyNeedNotes'
)
{
if
(
!
pobj
.
userInfo
)
{
return
system
.
getResult
(
system
.
noLogin
,
"user no login!"
);
}
if
(
!
pobj
.
appInfo
)
{
return
system
.
getResult
(
system
.
noLogin
,
"app is null!"
);
}
}
var
result
=
await
this
.
opActionProcess
(
pobj
,
pobj
.
actionType
,
req
);
return
result
;
}
async
opActionProcess
(
pobj
,
action_type
,
req
)
{
var
opResult
=
null
;
switch
(
action_type
)
{
case
"submitIcpProgramme"
:
//icp方案提交
opResult
=
await
this
.
needsolutionSve
.
submitIcpProgramme
(
pobj
);
break
;
case
"submitIcpMaterial"
:
//icp材料提交
opResult
=
await
this
.
needsolutionSve
.
submitIcpMaterial
(
pobj
);
break
;
case
"acceptIcpPartnerNotification"
:
//icp通知状态变更
opResult
=
await
this
.
needsolutionSve
.
updateStausByRefundOrder
(
pobj
);
break
;
case
"abolishIcpProgramme"
:
//服务商icp方案关闭
opResult
=
await
this
.
needsolutionSve
.
abolishIcpProgramme
(
pobj
);
break
;
// case "updateStausByRefundOrder"://修改退款方案状态
// opResult = await this.needsolutionSve.updateStausByRefundOrder(pobj);
// break;
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
break
;
}
return
opResult
;
}
}
module
.
exports
=
IcpAPI
;
\ No newline at end of file
center-order/app/base/service/impl/dbneed/needsolutionSve.js
View file @
60ffc93a
...
@@ -10,6 +10,7 @@ class NeedsolutionService extends ServiceBase {
...
@@ -10,6 +10,7 @@ class NeedsolutionService extends ServiceBase {
// this.push2aliSve = system.getObject("service.common.push2aliSve");
// this.push2aliSve = system.getObject("service.common.push2aliSve");
this
.
orderinfoDao
=
system
.
getObject
(
"db.dbcorder.orderinfoDao"
);
this
.
orderinfoDao
=
system
.
getObject
(
"db.dbcorder.orderinfoDao"
);
}
}
//---------------------公司注册-start-----------------------------------------------------------------
//提交方案
//提交方案
async
submitProgramme
(
pobj
){
async
submitProgramme
(
pobj
){
var
ab
=
pobj
.
actionBody
;
var
ab
=
pobj
.
actionBody
;
...
@@ -523,6 +524,387 @@ class NeedsolutionService extends ServiceBase {
...
@@ -523,6 +524,387 @@ class NeedsolutionService extends ServiceBase {
await
this
.
dao
.
model
.
update
(
reqObj
,
{
where
:
{
id
:
ns
.
id
}});
//修改方案信息
await
this
.
dao
.
model
.
update
(
reqObj
,
{
where
:
{
id
:
ns
.
id
}});
//修改方案信息
return
system
.
getResultSuccess
();
return
system
.
getResultSuccess
();
}
}
//---------------------公司注册-end-----------------------------------------------------------------
//---------------------icp注册-start-----------------------------------------------------------------
//提交方案
async
submitIcpProgramme
(
pobj
){
var
ab
=
pobj
.
actionBody
;
var
user
=
pobj
.
userInfo
;
if
(
!
user
||
!
user
.
id
){
return
system
.
getResultFail
(
-
100
,
"未知用户"
);
}
ab
[
"createUserId"
]
=
user
.
id
;
if
(
!
ab
.
needNo
){
return
system
.
getResultFail
(
-
101
,
"渠道需求号不能为空"
);
}
if
(
!
ab
.
solutionContent
){
return
system
.
getResultFail
(
-
102
,
"方案信息有误"
);
}
//获取需求信息
var
needinfo
=
await
this
.
needinfoDao
.
model
.
findOne
({
where
:{
channelNeedNo
:
ab
.
needNo
},
raw
:
true
});
if
(
!
needinfo
||
!
needinfo
.
id
){
return
system
.
getResultFail
(
-
201
,
"未知需求信息"
);
}
if
(
needinfo
.
status
==
"ycd"
||
needinfo
.
status
==
"ygb"
){
return
system
.
getResultFail
(
-
202
,
"该方案需求状态为"
+
needinfo
.
statusName
+
",不能创建方案"
);
}
var
bizType
=
ab
.
solutionContent
.
bizType
;
//icp业务类型
if
(
!
bizType
||
!
needinfo
.
typeCode
||
bizType
!=
needinfo
.
typeCode
){
return
system
.
getResultFail
(
-
205
,
"方案类型错误"
);
}
if
(
!
needinfo
.
channelTypeCode
){
return
system
.
getResultFail
(
-
206
,
"渠道方案类型错误"
);
}
ab
.
solutionContent
.
bizType
=
needinfo
.
channelTypeCode
;
bizType
=
needinfo
.
channelTypeCode
;
if
(
!
ab
.
solutionContent
.
solution
){
return
system
.
getResultFail
(
-
104
,
"业务方案信息不能为空"
);
}
var
solution
=
ab
.
solutionContent
.
solution
;
if
(
!
solution
){
return
system
.
getResultFail
(
-
103
,
"方案交付信息有误"
);
}
ab
.
solutionContent
.
solution
.
IcpType
=
needinfo
.
channelTypeCode
;
ab
.
solutionContent
.
applicationStatusList
=
[{
"OfficialFileURL"
:
""
,
"ApplicationStatus"
:
"submitIcpProgramme"
,
"ApplicationStatusName"
:
"提交方案"
,
"created_at"
:
new
Date
();
}];
if
(
!
solution
.
CompanyName
){
return
system
.
getResultFail
(
-
105
,
"公司名不能为空"
);
}
if
(
!
solution
.
CompanyAddress
){
return
system
.
getResultFail
(
-
106
,
"公司地址不能为空"
);
}
if
(
!
solution
.
Area
){
return
system
.
getResultFail
(
-
107
,
"区域不能为空"
);
}
ab
[
"channelNeedNo"
]
=
needinfo
.
channelNeedNo
;
var
solutionNo
=
await
this
.
getBusUid
(
"ns"
);
ab
[
"solutionNo"
]
=
solutionNo
;
ab
[
"status"
]
=
"dqr"
;
ab
.
solutionContent
[
"notes"
]
=
""
;
ab
.
solutionContent
[
"totalSum"
]
=
""
;
ab
.
solutionContent
=
JSON
.
stringify
(
ab
.
solutionContent
);
var
self
=
this
;
return
await
this
.
db
.
transaction
(
async
function
(
t
)
{
ab
[
"needNo"
]
=
needinfo
.
needNo
;
var
od
=
await
self
.
dao
.
create
(
ab
,
t
);
if
(
od
&&
od
.
id
){
var
pushflag
=
0
;
//推送标志 值为1推送小记
var
needObj
=
{
id
:
needinfo
.
id
};
if
(
!
needinfo
.
followManUserId
){
needObj
=
{
id
:
needinfo
.
id
,
followManUserId
:
user
.
id
,
//跟进人id
followManName
:
user
.
channel_username
,
//跟进人姓名
followManMobile
:
user
.
mobile
,
//跟进人手机号(合伙人)
followManOnlyCode
:
user
.
channel_userid
};
}
if
(
!
needinfo
.
followContent
){
var
followContent
=
{
followDate
:
new
Date
(),
content
:
"icp提交到方案"
};
followContent
=
JSON
.
stringify
(
followContent
);
needObj
[
"followContent"
]
=
followContent
;
pushflag
=
1
;
}
await
self
.
needinfoDao
.
update
(
needObj
,
t
);
needinfo
=
await
self
.
needinfoDao
.
model
.
findOne
({
where
:{
id
:
needinfo
.
id
},
raw
:
true
});
needinfo
[
"pushflag"
]
=
pushflag
;
return
system
.
getResultSuccess
({
needinfo
:
needinfo
,
needsolution
:
od
});
}
else
{
return
system
.
getResultFail
(
-
202
,
"提交方案失败"
);
}
})
}
//修改icp方案-- 无效
async
updateIcpProgramme
(
pobj
){
var
ab
=
pobj
.
actionBody
;
var
user
=
pobj
.
userInfo
;
if
(
!
user
||
!
user
.
id
){
return
system
.
getResultFail
(
-
100
,
"未知用户"
);
}
ab
[
"createUserId"
]
=
user
.
id
;
if
(
!
ab
.
needNo
){
return
system
.
getResultFail
(
-
101
,
"渠道需求号不能为空"
);
}
if
(
!
ab
.
solutionContent
){
return
system
.
getResultFail
(
-
102
,
"方案信息有误"
);
}
//获取需求信息
var
needinfo
=
await
this
.
needinfoDao
.
model
.
findOne
({
where
:{
channelNeedNo
:
ab
.
needNo
},
raw
:
true
});
if
(
!
needinfo
||
!
needinfo
.
id
){
return
system
.
getResultFail
(
-
201
,
"未知需求信息"
);
}
if
(
needinfo
.
status
==
"ycd"
||
needinfo
.
status
==
"ygb"
){
return
system
.
getResultFail
(
-
202
,
"该方案需求状态为"
+
needinfo
.
statusName
+
",不能创建方案"
);
}
var
bizType
=
ab
.
solutionContent
.
bizType
;
//icp业务类型
if
(
!
bizType
||
!
needinfo
.
typeCode
||
bizType
!=
needinfo
.
typeCode
){
return
system
.
getResultFail
(
-
205
,
"方案类型错误"
);
}
if
(
!
needinfo
.
channelTypeCode
){
return
system
.
getResultFail
(
-
206
,
"渠道方案类型错误"
);
}
ab
.
solutionContent
.
bizType
=
needinfo
.
channelTypeCode
;
bizType
=
needinfo
.
channelTypeCode
;
if
(
!
ab
.
solutionContent
.
solution
){
return
system
.
getResultFail
(
-
104
,
"业务方案信息不能为空"
);
}
var
solution
=
ab
.
solutionContent
.
solution
;
if
(
!
solution
){
return
system
.
getResultFail
(
-
103
,
"方案交付信息有误"
);
}
ab
.
solutionContent
.
solution
.
IcpType
=
needinfo
.
channelTypeCode
;
if
(
!
solution
.
CompanyName
){
return
system
.
getResultFail
(
-
105
,
"公司名不能为空"
);
}
if
(
!
solution
.
CompanyAddress
){
return
system
.
getResultFail
(
-
106
,
"公司地址不能为空"
);
}
if
(
!
solution
.
Area
){
return
system
.
getResultFail
(
-
107
,
"区域不能为空"
);
}
ab
[
"channelNeedNo"
]
=
needinfo
.
channelNeedNo
;
var
solutionNo
=
await
this
.
getBusUid
(
"ns"
);
ab
[
"solutionNo"
]
=
solutionNo
;
ab
[
"status"
]
=
"dqr"
;
ab
.
solutionContent
[
"notes"
]
=
""
;
ab
.
solutionContent
[
"totalSum"
]
=
""
;
ab
.
solutionContent
=
JSON
.
stringify
(
ab
.
solutionContent
);
var
self
=
this
;
return
await
this
.
db
.
transaction
(
async
function
(
t
)
{
ab
[
"needNo"
]
=
needinfo
.
needNo
;
var
od
=
await
self
.
dao
.
create
(
ab
,
t
);
if
(
od
&&
od
.
id
){
var
pushflag
=
0
;
//推送标志 值为1推送小记
var
needObj
=
{
id
:
needinfo
.
id
};
if
(
!
needinfo
.
followManUserId
){
needObj
=
{
id
:
needinfo
.
id
,
followManUserId
:
user
.
id
,
//跟进人id
followManName
:
user
.
channel_username
,
//跟进人姓名
followManMobile
:
user
.
mobile
,
//跟进人手机号(合伙人)
followManOnlyCode
:
user
.
channel_userid
};
}
if
(
!
needinfo
.
followContent
){
var
followContent
=
{
followDate
:
new
Date
(),
content
:
"icp提交到方案"
};
followContent
=
JSON
.
stringify
(
followContent
);
needObj
[
"followContent"
]
=
followContent
;
pushflag
=
1
;
}
await
self
.
needinfoDao
.
update
(
needObj
,
t
);
needinfo
=
await
self
.
needinfoDao
.
model
.
findOne
({
where
:{
id
:
needinfo
.
id
},
raw
:
true
});
needinfo
[
"pushflag"
]
=
pushflag
;
return
system
.
getResultSuccess
({
needinfo
:
needinfo
,
needsolution
:
od
});
}
else
{
return
system
.
getResultFail
(
-
202
,
"提交方案失败"
);
}
})
}
//提交icp材料信息
async
submitIcpMaterial
(
pobj
){
var
ab
=
pobj
.
actionBody
;
var
user
=
pobj
.
userInfo
;
if
(
!
user
||
!
user
.
id
){
return
system
.
getResultFail
(
-
100
,
"未知用户"
);
}
ab
[
"createUserId"
]
=
user
.
id
;
if
(
!
ab
.
BizId
){
return
system
.
getResultFail
(
-
101
,
"方案编号不能为空"
);
}
if
(
!
ab
.
material
){
return
system
.
getResultFail
(
-
102
,
"材料信息有误"
);
}
//获取方案信息
var
needsolutioninfo
=
await
this
.
dao
.
model
.
findOne
({
where
:{
channelSolutionNo
:
ab
.
BizId
},
raw
:
true
});
if
(
!
needsolutioninfo
||
!
needsolutioninfo
.
id
){
return
system
.
getResultFail
(
-
400
,
"未知方案"
);
}
if
(
!
needsolutioninfo
.
needNo
){
return
system
.
getResultFail
(
-
401
,
"方案需求信息有误"
);
}
var
solutionContent
=
needsolutioninfo
.
solutionContent
;
if
(
!
solutionContent
){
return
system
.
getResultFail
(
-
402
,
"方案交付信息有误"
);
}
//获取需求信息
var
needinfo
=
await
this
.
needinfoDao
.
model
.
findOne
({
where
:{
needNo
:
needsolutioninfo
.
needNo
},
raw
:
true
});
if
(
!
needinfo
||
!
needinfo
.
id
){
return
system
.
getResultFail
(
-
201
,
"未知需求信息"
);
}
if
(
needinfo
.
status
==
"ycd"
||
needinfo
.
status
==
"ygb"
){
return
system
.
getResultFail
(
-
202
,
"该方案需求状态为"
+
needinfo
.
statusName
+
",不能执行此操作"
);
}
var
material
=
ab
.
material
;
if
(
!
material
.
Domain
){
return
system
.
getResultFail
(
-
101
,
"备案域名不能为空"
);
}
if
(
!
material
.
hasOwnProperty
(
"IncludeForeignInvestment"
)){
return
system
.
getResultFail
(
-
102
,
"包含外贸参数不能为空"
);
}
if
(
!
material
.
PartnerBusinessLicense
){
return
system
.
getResultFail
(
-
103
,
"营业执照不能为空"
);
}
if
(
!
material
.
PartnerIdCardList
||
material
.
PartnerIdCardList
.
length
<
1
){
return
system
.
getResultFail
(
-
105
,
"相关人员身份证不能为空"
);
}
if
(
!
material
.
PartnerDomainCertificate
){
return
system
.
getResultFail
(
-
106
,
"域名证书不能为空"
);
}
if
(
!
material
.
PartnerPreviewOtherList
||
material
.
PartnerPreviewOtherList
.
length
<
1
){
return
system
.
getResultFail
(
-
107
,
"合作方递交其他供预览文件不能为空"
);
}
solutionContent
.
material
=
ab
.
material
;
needsolutioninfo
.
solutionContent
=
JSON
.
stringify
(
solutionContent
);
var
self
=
this
;
return
await
this
.
db
.
transaction
(
async
function
(
t
)
{
await
self
.
dao
.
update
(
needsolutioninfo
,
t
);
needsolutioninfo
=
await
this
.
dao
.
model
.
findOne
({
where
:{
channelSolutionNo
:
ab
.
BizId
},
raw
:
true
});
return
system
.
getResultSuccess
(
needsolutioninfo
);
})
}
//通知状态变更
async
acceptIcpPartnerNotification
(
pobj
){
var
ab
=
pobj
.
actionBody
;
var
user
=
pobj
.
userInfo
;
if
(
!
user
||
!
user
.
id
){
return
system
.
getResultFail
(
-
100
,
"未知用户"
);
}
ab
[
"createUserId"
]
=
user
.
id
;
if
(
!
ab
.
BizId
){
return
system
.
getResultFail
(
-
101
,
"方案编号不能为空"
);
}
if
(
!
ab
.
ApplicationStatus
){
return
system
.
getResultFail
(
-
102
,
"通知状态不能为空"
);
}
//获取方案信息
var
needsolutioninfo
=
await
this
.
dao
.
model
.
findOne
({
where
:{
channelSolutionNo
:
ab
.
BizId
},
raw
:
true
});
if
(
!
needsolutioninfo
||
!
needsolutioninfo
.
id
){
return
system
.
getResultFail
(
-
400
,
"未知方案"
);
}
if
(
!
needsolutioninfo
.
needNo
){
return
system
.
getResultFail
(
-
401
,
"方案需求信息有误"
);
}
var
solutionContent
=
needsolutioninfo
.
solutionContent
;
if
(
!
solutionContent
){
return
system
.
getResultFail
(
-
402
,
"方案交付信息有误"
);
}
//获取需求信息
var
needinfo
=
await
this
.
needinfoDao
.
model
.
findOne
({
where
:{
needNo
:
needsolutioninfo
.
needNo
},
raw
:
true
});
if
(
!
needinfo
||
!
needinfo
.
id
){
return
system
.
getResultFail
(
-
201
,
"未知需求信息"
);
}
if
(
needinfo
.
status
==
"ycd"
||
needinfo
.
status
==
"ygb"
){
return
system
.
getResultFail
(
-
202
,
"该方案需求状态为"
+
needinfo
.
statusName
+
",不能执行此操作"
);
}
var
applicationStatusList
=
solutionContent
.
applicationStatusList
||
[];
var
statusObj
=
{
"OfficialFileURL"
:
ab
.
OfficialFileURL
||
""
,
"ApplicationStatus"
:
ab
.
ApplicationStatus
,
"created_at"
:
new
Date
();
};
applicationStatusList
.
push
(
statusObj
);
solutionContent
.
applicationStatusList
=
applicationStatusList
;
solutionContent
.
status
=
ab
.
ApplicationStatus
;
needsolutioninfo
.
solutionContent
=
JSON
.
stringify
(
solutionContent
);
var
self
=
this
;
return
await
this
.
db
.
transaction
(
async
function
(
t
)
{
await
self
.
dao
.
update
(
needsolutioninfo
,
t
);
needsolutioninfo
=
await
this
.
dao
.
model
.
findOne
({
where
:{
channelSolutionNo
:
ab
.
BizId
},
raw
:
true
});
statusObj
[
"BizId"
]
=
ab
.
BizId
;
return
system
.
getResultSuccess
(
statusObj
);
})
}
//服务商方案作废 -- abolishIcpProgramme
async
abolishIcpProgramme
(
pobj
){
var
ab
=
pobj
.
actionBody
;
var
user
=
pobj
.
userInfo
;
if
(
!
user
||
!
user
.
id
){
return
system
.
getResultFail
(
-
100
,
"未知用户"
);
}
if
(
!
ab
.
BizId
){
return
system
.
getResultFail
(
-
101
,
"渠道方案号不能为空"
);
}
if
(
!
ab
.
Note
){
return
system
.
getResultFail
(
-
105
,
"关闭理由不能为空"
);
}
//获取方案信息
var
ns
=
await
this
.
dao
.
model
.
findOne
({
where
:{
channelSolutionNo
:
ab
.
BizId
,
createUserId
:
user
.
id
},
raw
:
true
});
if
(
!
ns
||
!
ns
.
id
){
return
system
.
getResultFail
(
-
102
,
"未知方案"
);
}
var
needinfo
=
await
this
.
needinfoDao
.
model
.
findOne
({
where
:{
needNo
:
ns
.
needNo
},
raw
:
true
});
if
(
!
needinfo
){
return
system
.
getResultFail
(
-
104
,
"未知方案需求"
);
}
if
(
needinfo
.
status
==
"ycd"
||
needinfo
.
status
==
"ygb"
){
return
system
.
getResultFail
(
-
105
,
"该方案需求状态为"
+
needinfo
.
statusName
+
",不能执行此操作"
);
}
if
(
ns
.
status
!=
"dqr"
){
return
system
.
getResultFail
(
-
103
,
"方案状态错误,只能废弃待确认方案"
);
}
var
solutionContent
=
ns
.
solutionContent
;
solutionContent
.
solution
.
Note
=
ab
.
Note
;
solutionContent
=
JSON
.
stringify
(
solutionContent
);
await
this
.
dao
.
update
({
id
:
ns
.
id
,
status
:
"yzf"
,
solutionContent
:
solutionContent
});
//方案废弃
//获取方案信息
ns
=
await
this
.
dao
.
model
.
findOne
({
where
:{
channelSolutionNo
:
ab
.
BizId
,
createUserId
:
user
.
id
},
raw
:
true
});
return
system
.
getResultSuccess
(
ns
);
}
//确认方案
async
confirmIcpIntention
(
pobj
){
return
system
.
getResultFail
();
}
//---------------------icp注册-end-----------------------------------------------------------------
}
}
module
.
exports
=
NeedsolutionService
;
module
.
exports
=
NeedsolutionService
;
// var task = new NeedsolutionService();
// var task = new NeedsolutionService();
...
...
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