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
c35cc259
Commit
c35cc259
authored
Oct 29, 2020
by
兰国旗
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
laolan
parent
5bb39aef
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
165 additions
and
0 deletions
+165
-0
center-channel/app/base/api/impl/action/qcapi2.js
+103
-0
center-channel/app/base/service/impl/common/baseCenterOrderSve.js
+0
-0
center-channel/app/base/service/impl/utilsSve/utilsNeedSve2.js
+0
-0
center-channel/app/base/utils/baiduClient.js
+62
-0
No files found.
center-channel/app/base/api/impl/action/qcapi2.js
0 → 100644
View file @
c35cc259
var
APIBase
=
require
(
"../../api.base"
);
var
system
=
require
(
"../../../system"
);
var
settings
=
require
(
"../../../../config/settings"
);
class
QcAPI2
extends
APIBase
{
constructor
()
{
super
();
this
.
centerorderSve
=
system
.
getObject
(
"service.common.qcCenterOrderSve"
);
this
.
baseOrderSve
=
system
.
getObject
(
"service.common.baseCenterOrderSve"
);
}
/**
* 接口跳转-POST请求
* action_process 执行的流程
* action_type 执行的类型
* action_body 执行的参数
*/
async
springBoard
(
pobj
,
qobj
,
req
)
{
if
(
!
pobj
.
actionType
)
{
return
system
.
getResult
(
null
,
"actionType参数不能为空"
);
}
var
result
=
await
this
.
opActionProcess
(
pobj
,
pobj
.
actionType
,
req
);
return
result
;
}
async
opActionProcess
(
pobj
,
action_type
,
req
)
{
var
opResult
=
null
;
switch
(
action_type
)
{
case
"getNeedSolutionDetailByUser"
:
//获取方案详情
opResult
=
await
this
.
baseOrderSve
.
reqCenterOrderApi
(
pobj
,
"action/baseapi/springBoard"
);
break
;
case
"submitIcpProgramme"
:
//icp方案提交
opResult
=
await
this
.
baseOrderSve
.
submitIcpProgramme
(
pobj
);
break
;
case
"receiveProgrammeNo"
:
//接收渠道方案号(测试)
opResult
=
await
this
.
baseOrderSve
.
reqCenterOrderApi
(
pobj
);
break
;
// case "submitIcpMaterial"://icp材料提交
// opResult = await this.baseOrderSve.submitIcpMaterial(pobj);
// break;
// case "acceptIcpPartnerNotification"://icp通知状态变更
// opResult = await this.baseOrderSve.acceptIcpPartnerNotification(pobj);
// break;
case
"abolishIcpProgramme"
:
//服务商icp方案关闭
opResult
=
await
this
.
baseOrderSve
.
abolishIcpProgramme
(
pobj
);
break
;
case
"getProgrammeInfoByChannelNeedNo"
:
//获取需求方案列表
opResult
=
await
this
.
baseOrderSve
.
reqCenterOrderApi
(
pobj
,
"action/baseapi/springBoard"
);
break
;
case
"serviceProviderSubmitMaterial"
:
//交付商提交材料信息
opResult
=
await
this
.
baseOrderSve
.
serviceProviderSubmitMaterial
(
pobj
);
break
;
case
"serviceProviderNotification"
:
//交付商通知状态变更
opResult
=
await
this
.
baseOrderSve
.
serviceProviderNotification
(
pobj
);
break
;
case
"closeOrderDelivery"
:
//交付商关闭交付单
opResult
=
await
this
.
baseOrderSve
.
closeOrderDelivery
(
pobj
);
break
;
// --------- 文网文 ---------
case
"serviceSubmitOption"
:
//服务商提交服务操作(文网文)2020-9-26
opResult
=
await
this
.
baseOrderSve
.
serviceSubmitOption
(
pobj
);
break
;
case
"submitWangwenSolution"
:
//提交方案(文网文)2020-9-26
opResult
=
await
this
.
baseOrderSve
.
submitWangwenSolution
(
pobj
);
break
;
case
"closeNeed"
:
//关闭需求(文网文)2020-9-28
opResult
=
await
this
.
baseOrderSve
.
closeNeed
(
pobj
);
break
;
case
"recordLog"
:
//提交沟通记录(文网文)2020-9-28
opResult
=
await
this
.
baseOrderSve
.
recordLog
(
pobj
);
break
;
case
"recordLogList"
:
//查询沟通记录(文网文)2020-9-29
opResult
=
await
this
.
baseOrderSve
.
recordLogList
(
pobj
);
break
;
// --------- 食品 ---------
case
"foodServiceSubmitOption"
:
//服务商提交服务操作(文网文)2020-9-26
opResult
=
await
this
.
baseOrderSve
.
foodServiceSubmitOption
(
pobj
);
break
;
case
"submitFoodSolution"
:
//提交方案(文网文)2020-9-26
opResult
=
await
this
.
baseOrderSve
.
submitFoodSolution
(
pobj
);
break
;
case
"foodCloseNeed"
:
//关闭需求(文网文)2020-9-28
opResult
=
await
this
.
baseOrderSve
.
foodCloseNeed
(
pobj
);
break
;
case
"foodRecordLog"
:
//提交沟通记录(文网文)2020-9-28
opResult
=
await
this
.
baseOrderSve
.
foodRecordLog
(
pobj
);
break
;
case
"foodRecordLogList"
:
//查询沟通记录(文网文)2020-9-29
opResult
=
await
this
.
baseOrderSve
.
foodRecordLogList
(
pobj
);
break
;
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
break
;
}
return
opResult
;
}
}
module
.
exports
=
QcAPI2
;
\ No newline at end of file
center-channel/app/base/service/impl/common/baseCenterOrderSve.js
0 → 100644
View file @
c35cc259
This diff is collapsed.
Click to expand it.
center-channel/app/base/service/impl/utilsSve/utilsNeedSve2.js
0 → 100644
View file @
c35cc259
This diff is collapsed.
Click to expand it.
center-channel/app/base/utils/baiduClient.js
0 → 100644
View file @
c35cc259
const
system
=
require
(
"../system"
);
class
baiduClient
{
constructor
()
{
this
.
pushlogSve
=
system
.
getObject
(
"service.common.pushlogSve"
);
}
//2020 1027 laolan 调用百度网关
async
baiduPost
(
baidRreqUrl
,
accessKeyId
,
accessKeySecret
,
endpoint
,
actionBody
)
{
accessKeyId
=
"ff2571490b4c4fb5add57385dc5e8f66"
;
accessKeySecret
=
"9d86f04a85db4cdfa95ba8ad28009188"
;
endpoint
=
"https://iam.bj.baidubce.com"
;
var
param
=
{
data
:
actionBody
,
timeout
:
20000
,
headers
:
{
accept
:
'application/json'
}
};
console
.
log
(
JSON
.
stringify
(
param
),
"______________峰擎---百度云参数_______"
);
var
result
=
await
this
.
baiduPost
(
baidRreqUrl
,
param
);
console
.
log
(
JSON
.
stringify
(
result
),
"______________峰擎---百度云返回结果_______"
);
return
result
;
}
//百度接口 2020-10-27 laolan
async
baiduReqbyget
(
obj
,
cbk
)
{
var
action
=
obj
.
action
;
var
reqbody
=
obj
.
reqbody
;
try
{
var
reqBaiduClient
=
null
;
// { ... this.baiduClient };
var
res
=
await
reqBaiduClient
.
request
(
action
,
reqbody
,
{
timeout
:
10000
,
// default 3000 ms 修改3000为10000,原因ConfirmIcpIntention BizIds 超过5条会超时
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
:
"new-baiduReqbyget"
,
content
:
JSON
.
stringify
(
obj
),
//推送的参数信息
resultInfo
:
JSON
.
stringify
(
res
),
returnType
:
'1'
,
logLevel
:
'1'
,
opTitle
:
"new-baiduReqbyget推送百度信息返回成功"
});
return
system
.
getResultSuccess
(
res
);
}
catch
(
e
)
{
this
.
pushlogSve
.
createFailLogDb
({
appid
:
obj
.
appInfo
?
obj
.
appInfo
.
uapp_id
||
""
:
""
,
appkey
:
obj
.
appInfo
?
obj
.
appInfo
.
uapp_key
||
""
:
""
,
requestId
:
obj
.
requestId
||
""
,
content
:
JSON
.
stringify
(
obj
),
//推送的参数信息
resultInfo
:
"error:"
+
JSON
.
stringify
(
e
),
clientIp
:
obj
.
clientIp
||
""
,
failType
:
1
,
opTitle
:
"new-baiduReqbyget推送百度信息返回异常"
,
pushNumber
:
obj
.
pushNumber
||
1
});
return
system
.
getResultFail
(
-
200
,
"出现异常,error:"
+
e
.
stack
);
}
}
}
module
.
exports
=
baiduClient
;
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