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
b342d76e
Commit
b342d76e
authored
Mar 16, 2020
by
庄冰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ic
parent
d305fac5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
114 additions
and
0 deletions
+114
-0
center-channel/app/base/api/impl/action/icapi.js
+55
-0
center-channel/app/base/service/impl/common/centerorderSve.js
+59
-0
No files found.
center-channel/app/base/api/impl/action/icapi.js
0 → 100644
View file @
b342d76e
var
APIBase
=
require
(
"../../api.base"
);
var
system
=
require
(
"../../../system"
);
var
settings
=
require
(
"../../../../config/settings"
);
class
IcAPI
extends
APIBase
{
constructor
()
{
super
();
// this.utilsProductSve = system.getObject("service.utilsSve.utilsProductSve");
this
.
centerorderSve
=
system
.
getObject
(
"service.common.centerorderSve"
);
}
/**
* 接口跳转-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
"submitProgramme"
:
//提交公司注册方案
opResult
=
await
this
.
centerorderSve
.
submitProgramme
(
pobj
);
break
;
case
"getProgrammeInfoByNeedNo"
:
//根据需求查看方案列表
opResult
=
await
this
.
centerorderSve
.
reqCenterOrderApi
(
pobj
);
break
;
case
"receiveFeedback"
:
//接收方案反馈信息(即方案作废)
opResult
=
await
this
.
centerorderSve
.
reqCenterOrderApi
(
pobj
);
break
;
case
"abolishProgramme"
:
//服务商方案作废
opResult
=
await
this
.
centerorderSve
.
abolishProgramme
(
pobj
);
break
;
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
break
;
}
return
opResult
;
}
}
module
.
exports
=
IcAPI
;
\ No newline at end of file
center-channel/app/base/service/impl/common/centerorderSve.js
0 → 100644
View file @
b342d76e
const
system
=
require
(
"../../../system"
);
const
crypto
=
require
(
'crypto'
);
var
settings
=
require
(
"../../../../config/settings"
);
class
CenterorderService
{
constructor
()
{
this
.
centerOrderUrl
=
settings
.
centerOrderUrl
();
this
.
execClient
=
system
.
getObject
(
"util.execClient"
);
this
.
aliclient
=
system
.
getObject
(
"util.aliyunClient"
);
this
.
cacheManager
=
system
.
getObject
(
"db.common.cacheManager"
);
};
//调用center-order
async
reqCenterOrderApi
(
pobj
,
reqUrl
){
var
url
=
this
.
centerOrderUrl
+
"action/icapi/springBoard"
;
if
(
reqUrl
){
var
url
=
this
.
centerOrderUrl
+
reqUrl
;
}
var
rtn
=
await
this
.
execClient
.
execPost
(
pobj
,
url
);
var
data
=
JSON
.
parse
(
rtn
.
stdout
);
return
data
;
}
//提交公司注册方案
async
submitProgramme
(
pobj
){
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
);
if
(
res
&&
res
.
status
==
0
&&
res
.
data
&&
res
.
data
.
needinfo
&&
res
.
data
.
needsolution
){
var
needinfo
=
res
.
data
.
needinfo
;
//需求信息
var
needsolution
=
res
.
data
.
needsolution
;
//方案信息
//推送数据至阿
var
bizType
=
pobj
.
actionBody
.
solutionContent
.
bizType
||
""
;
//业务类型里
var
pushObj
=
{
intentionBizId
:
needinfo
.
channelNeedNo
,
bizType
:
bizType
,
solution
:
ab
.
solutionContent
.
solution
};
// var pushRes = await this.aliclient.reqbyget({action:"",reqbody:pushObj});
// if(pushRes && pushRes.SolutionBizId){
// var reqObj2 = {
// actionType:"receiveProgrammeNo",
// actionBody:{
// solutionNo:needsolution.needsolution,
// solutionBizId:pushRes.SolutionBizId
// }
// };
// await this.reqCenterOrderApi(reqObj2);//保存渠道方案id
// }
}
return
system
.
getResultSuccess
();
}
//服务商方案作废
async
abolishProgramme
(
pobj
){
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
);
if
(
res
&&
res
.
status
==
0
&&
res
.
data
&&
res
.
data
.
channelNeedNo
){
//推送数据至阿
var
pushObj
=
{
solutionBizId
:
res
.
data
.
channelNeedNo
,
note
:
pobj
.
actionBody
.
note
||
""
};
// var pushRes = await this.aliclient.reqbyget({action:"",reqbody:pushObj});
}
return
res
;
}
}
module
.
exports
=
CenterorderService
;
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