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
c79fc3a3
Commit
c79fc3a3
authored
Mar 19, 2020
by
宋毅
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'center-channel' of gitlab.gongsibao.com:jiangyong/zhichan into center-channel
parents
6fd0109a
cdd4fabc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
74 additions
and
32 deletions
+74
-32
center-channel/app/base/service/impl/common/centerorderSve.js
+42
-24
center-channel/app/base/utils/aliyunClient.js
+31
-8
center-channel/app/front/entry/public/apidoc/platform/icbcOrder.md
+1
-0
No files found.
center-channel/app/base/service/impl/common/centerorderSve.js
View file @
c79fc3a3
...
...
@@ -22,23 +22,34 @@ class CenterorderService{
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
// }
// var needinfo = res.data.needinfo;//需求信息
// var needsolution = res.data.needsolution;//方案信息
// var ab = pobj.actionBody;
// //推送数据至阿里
// var bizType = ab.solutionContent.bizType || "";//业务类型里
// var pushObj = {
// intentionBizId:needinfo.channelNeedNo,bizType:bizType,solution:ab.solutionContent.solution
// };
// //推送方案
// this.aliclient.reqbyget({action:"SubmitSolution",reqbody:pushObj}).then(pushRes=>{
// if(pushRes && pushRes.status==0 && pushRes.data){
// var resData = pushRes.data;
// var reqObj2 = {
// actionType:"receiveProgrammeNo",
// actionBody:{
// solutionNo:needsolution.solutionNo,
// solutionBizId:resData.SolutionBizId
// }
// };
// await this.reqCenterOrderApi(reqObj2);//保存渠道方案id
// }
// });
// //推送需求小记
// if(needinfo.pushflag && needinfo.pushflag==1){//推送标志 值为1推送需求小记
// var pushObj2={
// intentionBizId:needinfo.channelNeedNo,note:"创建方案"
// };
//
await this.reqCenterOrderApi(reqObj2);//保存渠道方案id
//
this.aliclient.reqbyget({action:"SubmitIntentionNote",reqbody:pushObj2});
// }
}
return
system
.
getResultSuccess
();
...
...
@@ -46,16 +57,22 @@ class CenterorderService{
//服务商方案作废
async
abolishProgramme
(
pobj
){
var
res
=
await
this
.
reqCenterOrderApi
(
pobj
);
if
(
res
&&
res
.
status
==
0
&&
res
.
data
&&
res
.
data
.
channel
Need
No
){
//推送数据至阿
var
pushObj
=
{
solutionBizId
:
res
.
data
.
channelNeed
No
,
note
:
pobj
.
actionBody
.
note
||
""
};
//
var pushRes = await this.aliclient.reqbyget({action:"",reqbody:pushObj});
if
(
res
&&
res
.
status
==
0
&&
res
.
data
&&
res
.
data
.
channel
Solution
No
){
//推送数据至阿
里
//
var pushObj = {
// solutionBizId:res.data.channelSolution
No,note:pobj.actionBody.note || ""
//
};
//
this.aliclient.reqbyget({action:"RejectSolution",reqbody:pushObj})
}
return
res
;
}
}
module
.
exports
=
CenterorderService
;
// var task = new CenterorderService();
// task.aliclient.reqbyget({action:"SubmitSolution",reqbody:{}}).then(d=>{
// console.log(d,"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
// })
// 提方案-SubmitSolution
// 作废方案-RejectSolution
// 提需求小记-SubmitIntentionNote
// 查需求小记-ListIntentionNote
\ No newline at end of file
center-channel/app/base/utils/aliyunClient.js
View file @
c79fc3a3
const
Client
=
require
(
'aliyun-api-gateway'
).
Client
;
var
RPCClient
=
require
(
'@alicloud/pop-core'
).
RPCClient
;
const
system
=
require
(
"../system"
);
class
aliyunClient
{
constructor
()
{
this
.
aliclient
=
new
RPCClient
({
...
...
@@ -9,6 +9,7 @@ class aliyunClient {
endpoint
:
"https://companyreg.aliyuncs.com"
,
apiVersion
:
"2020-03-06"
});
this
.
pushlogSve
=
system
.
getObject
(
"service.common.pushlogSve"
);
}
async
post
(
aliReqUrl
,
key
,
secret
,
actionBody
)
{
const
client
=
new
Client
(
key
,
secret
);
...
...
@@ -28,13 +29,35 @@ class aliyunClient {
async
reqbyget
(
obj
,
cbk
)
{
var
action
=
obj
.
action
;
var
reqbody
=
obj
.
reqbody
;
return
this
.
aliclient
.
request
(
action
,
reqbody
,
{
timeout
:
3000
,
// default 3000 ms
formatAction
:
true
,
// default true, format the action to Action
formatParams
:
true
,
// default true, format the parameter name to first letter upper case
method
:
'GET'
,
// set the http method, default is GET
headers
:
{},
// set the http request headers
});
try
{
var
res
=
await
this
.
aliclient
.
request
(
action
,
reqbody
,
{
timeout
:
3000
,
// default 3000 ms
formatAction
:
true
,
// default true, format the action to Action
formatParams
:
true
,
// default true, format the parameter name to first letter upper case
method
:
'GET'
,
// set the http method, default is GET
headers
:
{},
// set the http request headers
});
this
.
pushlogSve
.
createDb
({
op
:
"推送阿里信息返回:"
+
action
,
content
:
JSON
.
stringify
(
obj
),
resultInfo
:
JSON
.
stringify
(
res
),
returnType
:
'1'
,
logLevel
:
'1'
,
opTitle
:
"推送阿里信息返回成功"
});
return
system
.
getResultSuccess
(
res
);
}
catch
(
e
)
{
this
.
pushlogSve
.
createDb
({
op
:
"推送阿里信息返回:"
+
action
,
content
:
JSON
.
stringify
(
obj
),
resultInfo
:
JSON
.
stringify
(
e
.
stack
),
returnType
:
'0'
,
logLevel
:
'3'
,
opTitle
:
"推送阿里信息返回异常"
});
return
system
.
getResultFail
(
-
200
,
"出现异常,error:"
+
e
.
stack
);
}
}
}
...
...
center-channel/app/front/entry/public/apidoc/platform/icbcOrder.md
View file @
c79fc3a3
...
...
@@ -134,6 +134,7 @@
"orderNo"
:
null
,
"solutionContent"
:{
"bizType"
:
"esp.companyreg"
,
"notes"
:
"用户反馈"
,
"solution"
:{
}
...
...
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