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
0abc4777
Commit
0abc4777
authored
Oct 27, 2020
by
宋毅
Browse files
Options
Browse Files
Download
Plain Diff
tj
parents
92242122
5bb39aef
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
837 additions
and
74 deletions
+837
-74
center-channel/app/base/api/impl/action/icpnotify.js
+247
-0
center-channel/app/base/api/impl/action/patentQuery.js
+1
-0
center-channel/app/base/api/impl/opreceive/need.js
+15
-0
center-channel/app/base/service/impl/common/centerorderSve.js
+95
-0
center-channel/app/base/service/impl/common/qcCenterOrderSve.js
+25
-12
center-channel/app/base/service/impl/utilsSve/utilsAuthSve.js
+33
-31
center-channel/app/base/service/impl/utilsSve/utilsNeedSve.js
+133
-2
center-channel/app/base/service/impl/utilsSve/utilsOrderSve.js
+101
-7
center-channel/app/base/utils/execClient.js
+14
-8
center-channel/app/base/utils/restClient.js
+6
-1
center-channel/app/config/routes/api.js
+77
-0
center-channel/app/config/settings.js
+15
-1
center-channel/app/front/entry/public/apidoc/patentDesc/patent.md
+49
-0
center-channel/package-lock.json
+26
-12
No files found.
center-channel/app/base/api/impl/action/icpnotify.js
0 → 100644
View file @
0abc4777
var
APIBase
=
require
(
"../../api.base"
);
var
system
=
require
(
"../../../system"
);
var
settings
=
require
(
"../../../../config/settings"
);
const
uuidv4
=
require
(
'uuid/v4'
);
/**
* icp通知接口(百度icp接入)
* 庄冰 2020.10.22
*/
class
IcpNotify
extends
APIBase
{
constructor
()
{
super
();
this
.
gatewaypushlogSve
=
system
.
getObject
(
"service.common.gatewaypushlogSve"
);
}
getUUID
()
{
var
uuid
=
uuidv4
();
var
u
=
uuid
.
replace
(
/
\-
/g
,
""
);
return
u
;
}
getResultSuccess
(
requestId
)
{
return
{
"requestId"
:
requestId
,
"success"
:
true
,
"errorMsg"
:
""
,
"errorCode"
:
"ok"
}
}
getResultFail
(
errmsg
)
{
var
self
=
this
;
return
{
"requestId"
:
self
.
getUUID
(),
"success"
:
false
,
"errorMsg"
:
errmsg
,
"errorCode"
:
"ok"
};
}
//icp需求提交
async
icpSubmitNeed
(
pobj
,
obj
,
req
)
{
var
self
=
this
;
if
(
!
pobj
.
appInfo
||
!
pobj
.
appInfo
.
uapp_key
||
!
pobj
.
appInfo
.
uapp_secret
){
return
self
.
getResultFail
(
"未知应用或应用未启用"
);
}
if
(
!
pobj
.
intentionBizId
)
{
return
self
.
getResultFail
(
"intentionBizId不能为空"
);
}
if
(
!
pobj
.
phone
)
{
return
self
.
getResultFail
(
"mobile不能为空"
);
}
if
(
!
pobj
.
consultType
)
{
return
self
.
getResultFail
(
"consultType不能为空"
);
}
pobj
.
type
=
pobj
.
consultType
;
pobj
.
mobile
=
pobj
.
phone
;
pobj
.
action_type
=
"submitIcpNeed"
;
if
(
pobj
.
area
)
{
switch
(
pobj
.
area
)
{
case
"1"
:
pobj
.
area
=
"北京"
;
break
;
case
"2"
:
pobj
.
area
=
"上海"
;
break
;
case
"3"
:
pobj
.
area
=
"福建"
;
break
;
case
"4"
:
pobj
.
area
=
"广西"
;
break
;
case
"5"
:
pobj
.
area
=
"广东"
;
break
;
case
"6"
:
pobj
.
area
=
"安徽"
;
break
;
case
"7"
:
pobj
.
area
=
"河南"
;
break
;
case
"8"
:
pobj
.
area
=
"湖北"
;
break
;
case
"9"
:
pobj
.
area
=
"浙江"
;
break
;
case
"10"
:
pobj
.
area
=
"江苏"
;
break
;
case
"11"
:
pobj
.
area
=
"山东"
;
break
;
case
"12"
:
pobj
.
area
=
"陕西"
;
break
;
case
"13"
:
pobj
.
area
=
"宁夏"
;
break
;
case
"14"
:
pobj
.
area
=
"甘肃"
;
break
;
case
"15"
:
pobj
.
area
=
"新疆"
;
break
;
case
"16"
:
pobj
.
area
=
"青海"
;
break
;
case
"17"
:
pobj
.
area
=
"天津"
;
break
;
case
"18"
:
pobj
.
area
=
"重庆"
;
break
;
case
"19"
:
pobj
.
area
=
"河北"
;
break
;
case
"20"
:
pobj
.
area
=
"山西"
;
break
;
case
"21"
:
pobj
.
area
=
"辽宁"
;
break
;
case
"22"
:
pobj
.
area
=
"吉林"
;
break
;
case
"23"
:
pobj
.
area
=
"黑龙江"
;
break
;
case
"24"
:
pobj
.
area
=
"江西"
;
break
;
case
"25"
:
pobj
.
area
=
"湖南"
;
break
;
case
"26"
:
pobj
.
area
=
"四川"
;
break
;
case
"27"
:
pobj
.
area
=
"贵州"
;
break
;
case
"28"
:
pobj
.
area
=
"云南"
;
break
;
case
"29"
:
pobj
.
area
=
"内蒙古"
;
break
;
case
"30"
:
pobj
.
area
=
"西藏"
;
break
;
case
"31"
:
pobj
.
area
=
"含外资"
;
break
;
case
"32"
:
pobj
.
area
=
"全外资"
;
break
;
case
"33"
:
pobj
.
area
=
"香港"
;
break
;
case
"34"
:
pobj
.
area
=
"海南"
;
break
;
default
:
pobj
.
area
=
""
;
break
;
}
}
if
(
!
pobj
.
area
)
{
return
self
.
getResultFail
(
"area参数错误"
);
}
var
param
=
{
requestId
:
req
.
requestId
||
self
.
getUUID
(),
requestUrl
:
"/icp/consultation/submit"
,
requestjson
:
JSON
.
stringify
(
pobj
),
//请求地址
pushUrl
:
"/action/intentionapi/springBoard"
,
//调用地址
pushActionType
:
"submitIcpNeed"
,
//调用参数
pushtimes
:
0
,
//推送次数
pushStatus
:
"wts"
,
//推送状态
}
await
self
.
gatewaypushlogSve
.
create
(
param
);
return
self
.
getResultSuccess
(
param
.
requestId
);
}
//icp需求反馈
async
icpFeedbackSubmit
(
pobj
,
obj
,
req
)
{
var
self
=
this
;
if
(
!
pobj
.
appInfo
||
!
pobj
.
appInfo
.
uapp_key
||
!
pobj
.
appInfo
.
uapp_secret
){
return
self
.
getResultFail
(
"未知应用或应用未启用"
);
}
if
(
!
pobj
.
intentionBizId
)
{
return
self
.
getResultFail
(
"intentionBizId不能为空"
);
}
if
(
!
pobj
.
description
)
{
return
self
.
getResultFail
(
"description不能为空"
);
}
if
(
!
pobj
.
intentionStatus
)
{
return
self
.
getResultFail
(
"intentionStatus不能为空"
);
}
var
param
=
{
requestId
:
req
.
requestId
||
self
.
getUUID
(),
requestUrl
:
"/icp/feedback/submit"
,
requestjson
:
JSON
.
stringify
(
pobj
),
//请求地址
pushUrl
:
"/action/intentionapi/springBoard"
,
//调用地址
pushActionType
:
"icpFeedbackSubmit"
,
//调用参数
pushtimes
:
0
,
//推送次数
pushStatus
:
"wts"
,
//推送状态
}
await
self
.
gatewaypushlogSve
.
create
(
param
);
return
self
.
getResultSuccess
(
param
.
requestId
);
}
//icp状态变更
async
icpNotify
(
pobj
,
obj
,
req
)
{
var
self
=
this
;
if
(
!
pobj
.
appInfo
||
!
pobj
.
appInfo
.
uapp_key
||
!
pobj
.
appInfo
.
uapp_secret
){
return
self
.
getResultFail
(
"未知应用或应用未启用"
);
}
if
(
!
pobj
.
orderNo
)
{
return
self
.
getResultFail
(
"orderNo不能为空"
);
}
if
(
!
pobj
.
isDirectBuy
||
pobj
.
isDirectBuy
==
"0"
){
pobj
.
isDirectBuy
=
0
;
}
pobj
.
status
=
1
;
if
(
pobj
.
isDirectBuy
==
0
&&
!
pobj
.
bizId
)
{
return
self
.
getResultFail
(
"非直接下单bizId不能为空"
);
}
if
(
pobj
.
isDirectBuy
==
1
&&
!
pobj
.
phone
)
{
return
self
.
getResultFail
(
"直接下单phone不能为空"
);
}
if
(
pobj
.
isDirectBuy
==
1
&&
!
pobj
.
consultType
)
{
return
self
.
getResultFail
(
"直接下单consultType不能为空"
);
}
pobj
.
action_type
=
"icpOrderStatus"
;
var
param
=
{
requestId
:
req
.
requestId
||
self
.
getUUID
(),
requestUrl
:
"/icp/order/notify"
,
requestjson
:
JSON
.
stringify
(
pobj
),
//请求地址
pushUrl
:
"/action/intentionapi/springBoard"
,
//调用地址
pushActionType
:
"icpNotifyNew"
,
//调用参数
pushtimes
:
0
,
//推送次数
pushStatus
:
"wts"
,
//推送状态
}
await
self
.
gatewaypushlogSve
.
create
(
param
);
return
self
.
getResultSuccess
(
param
.
requestId
);
}
}
module
.
exports
=
IcpNotify
;
\ No newline at end of file
center-channel/app/base/api/impl/action/patentQuery.js
View file @
0abc4777
...
...
@@ -47,6 +47,7 @@ class PatentQueryAPI extends WEBBase {
case
"CommomSearchbyFilingno"
:
//根据申请号查询聚合
case
"CommomSearchbyPubno"
:
//根据公开号查询聚合
case
"AffairsearchbyFilingno"
:
//根据申请号查询并根据法律状态日期排序
case
"paDataOrderByPubno"
:
//查询所有专利,按公开日倒序排列
opResult
=
await
this
.
patentSve
.
opReqResult
(
pobj
,
req
);
break
;
default
:
...
...
center-channel/app/base/api/impl/opreceive/need.js
View file @
0abc4777
...
...
@@ -91,6 +91,21 @@ class Need extends APIBase {
case
"testsymq"
:
opResult
=
await
this
.
utilsNeedSve
.
testsymq
(
pobj
);
break
;
//-----------接入百度ICP------start----zhuangbing--2020.10.22----------------------------
case
"submitIcpNeed"
:
//提交需求
opResult
=
await
this
.
utilsNeedSve
.
submitNeed2
(
pobj
,
pobj
.
actionBody
);
break
;
case
"icpFeedbackSubmitNew"
:
//icp接收方案反馈信息
pobj
.
actionType
=
"receiveIcpFeedback"
;
opResult
=
await
this
.
utilsNeedSve
.
reqCenterOrderQcApi
(
pobj
);
break
;
case
"icpNotifyNew"
:
//icp方案更新
opResult
=
await
this
.
utilsNeedSve
.
icpNotifyNew
(
pobj
,
pobj
.
actionBody
);
if
(
opResult
.
status
==
0
&&
pobj
.
actionBody
.
status
==
1
)
{
opResult
=
await
self
.
centerorderSve
.
icppaysuccessNew
(
pobj
,
pobj
.
actionBody
);
}
break
;
//-----------接入百度ICP------end----------------------------------
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
break
;
...
...
center-channel/app/base/service/impl/common/centerorderSve.js
View file @
0abc4777
...
...
@@ -538,6 +538,101 @@ class CenterorderService extends AppServiceBase {
return
system
.
getResult
(
null
,
"生成logo操作异常"
);
}
}
//-----------接入百度ICP------start-------zhuangbing--2020.10.22-------------------------
async
icppaysuccessNew
(
pobj
)
{
var
sobj
=
{
actionType
:
"getaliicpProduce"
,
// actionBody: { typeCode: itemResult.data.channelTypeCode, province: itemResult.data.province },
actionBody
:
{
typeCode
:
pobj
.
actionBody
.
channelTypeCode
,
province
:
pobj
.
actionBody
.
province
},
appInfo
:
pobj
.
appInfo
,
actionProcess
:
pobj
.
actionProcess
}
var
url
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
var
rtn
=
await
this
.
execClient
.
execPost
(
sobj
,
url
);
if
(
!
rtn
||
!
rtn
.
stdout
)
{
return
system
.
getResultFail
(
-
5010
,
"产品查询失败"
);
}
var
data
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
data
.
status
!=
0
)
{
return
system
.
getResultFail
(
-
5010
,
"产品查询失败"
);
}
// pobj.actionBody = data.data;
// pobj.actionBody.orderNo = pobj.actionBody.bizId;
pobj
.
actionBody
.
totalSum
=
data
.
data
.
price
;
pobj
.
actionBody
.
orderPrice
=
data
.
data
.
price
;
pobj
.
actionBody
.
payTotalSum
=
data
.
data
.
price
;
pobj
.
actionBody
.
payCode
=
data
.
data
.
payCode
;
pobj
.
actionBody
.
channelItemCode
=
data
.
data
.
channelItemCode
;
pobj
.
actionBody
.
channelNeedNo
=
data
.
data
.
channelNeedNo
;
pobj
.
actionBody
.
needNo
=
data
.
data
.
needNo
;
pobj
.
actionBody
.
quantity
=
1
;
pobj
.
actionBody
.
channelOrder
=
{
channelServiceNo
:
pobj
.
actionBody
.
orderNo
,
channelOrderNo
:
pobj
.
actionBody
.
orderNo
,
orderStatus
:
2
}
var
orderrtn
=
await
this
.
utilsOrderSve
.
addOrder
(
pobj
,
pobj
.
actionBody
);
if
(
orderrtn
.
status
!=
0
&&
orderrtn
.
status
!=
-
1
)
{
return
system
.
getResultFail
(
-
5012
,
"订单创建失败"
);
}
if
(
orderrtn
.
data
)
{
pobj
.
actionBody
.
orderNo
=
orderrtn
.
data
.
orderNo
;
}
pobj
.
actionBody
.
channelSolutionNo
=
pobj
.
actionBody
.
bizId
;
pobj
.
actionType
=
"receiveSolutionPayInfoNew"
;
var
url
=
settings
.
centerOrderUrl
()
+
"action/icapi/springBoard"
;
var
solutionrtn
=
await
this
.
execClient
.
execPost
(
pobj
,
url
);
if
(
!
solutionrtn
||
!
solutionrtn
.
stdout
)
{
return
system
.
getResultFail
(
-
5011
,
"方案查询失败"
);
}
var
solutiondata
=
JSON
.
parse
(
solutionrtn
.
stdout
);
if
(
solutiondata
.
status
!=
0
)
{
return
system
.
getResultFail
(
-
5011
,
"方案查询失败"
);
}
if
(
!
solutiondata
.
data
)
{
return
system
.
getResultFail
(
-
5012
,
"方案查询数据为空"
);
}
if
(
solutiondata
.
data
&&
solutiondata
.
data
.
channelNeedNo
)
{
pobj
.
actionBody
.
needId
=
solutiondata
.
data
.
channelNeedNo
;
}
if
(
pobj
.
actionBody
.
channelItemCode
==
'5'
)
{
pobj
.
actionBody
.
regType
=
"baidu.icp"
;
}
else
if
(
pobj
.
actionBody
.
channelItemCode
==
'7'
)
{
pobj
.
actionBody
.
regType
=
"baidu.edi"
;
}
var
fqobj
=
{
actionBody
:
{
area
:
pobj
.
actionBody
.
province
,
city
:
pobj
.
actionBody
.
province
,
regType
:
pobj
.
actionBody
.
regType
,
orderNo
:
pobj
.
actionBody
.
channelOrder
.
channelOrderNo
,
orderPrice
:
Number
(
pobj
.
actionBody
.
orderPrice
/
100
),
phone
:
pobj
.
actionBody
.
publishMobile
,
needId
:
solutiondata
.
data
.
channelNeedNo
,
companyName
:
solutiondata
.
data
.
solutionContent
.
solution
.
CompanyName
||
''
},
appInfo
:
pobj
.
appInfo
}
var
deliveryObj
=
{
actionBody
:
{
orderNo
:
orderrtn
.
data
.
orderNo
,
//pobj.actionBody.channelOrder.channelOrderNo,
needsolution
:
solutiondata
.
data
.
solutionContent
,
channelNeedNo
:
solutiondata
.
data
.
channelNeedNo
,
channelSolutionNo
:
solutiondata
.
data
.
channelSolutionNo
,
skuCode
:
data
.
data
.
payCode
,
servicer
:
{
code
:
'gsb'
,
name
:
'公司宝'
}
},
appInfo
:
pobj
.
appInfo
}
this
.
utilsPushSve
.
aliBusiness2Fq
(
fqobj
,
"pushOrderICPBusiness"
);
this
.
utilsPushSve
.
aliBusiness2Delivery
(
deliveryObj
,
"pushDeliveryOrder"
);
return
system
.
getResultSuccess
();
}
}
module
.
exports
=
CenterorderService
;
// var task = new CenterorderService();
...
...
center-channel/app/base/service/impl/common/qcCenterOrderSve.js
View file @
0abc4777
...
...
@@ -59,7 +59,9 @@ class QcCenterOrderService extends AppServiceBase {
var
pushObj
=
{
IntentionBizId
:
needinfo
.
channelNeedNo
,
CompanyName
:
solution
.
CompanyName
,
IcpType
:
solution
.
IcpType
,
CompanyAddress
:
solution
.
CompanyAddress
,
Area
:
solution
.
Area
,
Note
:
solution
.
Note
Area
:
solution
.
Area
,
Note
:
solution
.
Note
,
ActionType
:
solution
.
ActionType
,
Source
:
"官网"
};
if
(
needsolution
.
channelSolutionNo
)
{
pushObj
[
"BizId"
]
=
needsolution
.
channelSolutionNo
;
...
...
@@ -271,7 +273,7 @@ class QcCenterOrderService extends AppServiceBase {
var
reqParams
=
{
actionBody
:
{
intentionBizId
:
res
.
data
.
needinfo
.
channelNeedNo
,
status
:
"
beforeConfirma
tion"
status
:
"
createSolu
tion"
},
opType
:
"updateChanceStatus"
,
appInfo
:
pobj
.
appInfo
...
...
@@ -338,6 +340,7 @@ class QcCenterOrderService extends AppServiceBase {
pobj
.
actionType
=
"abolishIcpProgrammeByNeed"
var
reqUrl
=
this
.
centerOrderUrl
+
"action/qcapi/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
console
.
log
(
'www+++result'
,
result
)
if
(
result
.
status
==
0
)
{
if
(
result
.
data
)
{
pobj
.
actionBody
.
orderNo
=
result
.
data
;
...
...
@@ -351,7 +354,7 @@ class QcCenterOrderService extends AppServiceBase {
var
reqParams
=
{
actionBody
:
{
intentionBizId
:
pobj
.
actionBody
.
needNo
,
status
:
"
isClos
ed"
status
:
"
closeNe
ed"
},
opType
:
"updateChanceStatus"
,
appInfo
:
pobj
.
appInfo
...
...
@@ -362,15 +365,25 @@ class QcCenterOrderService extends AppServiceBase {
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
||
""
:
""
,
appkey
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_key
||
""
:
""
,
requestId
:
pobj
.
requestId
||
""
,
op
:
"service/impl/comm
e
n/qcCenterOrderSve.js/closeNeed"
,
op
:
"service/impl/comm
o
n/qcCenterOrderSve.js/closeNeed"
,
content
:
JSON
.
stringify
(
reqParams
),
resultInfo
:
""
,
optitle
:
"updateChanceStatus推送蜂擎获取的接口信息->aliBusiness2Delivery"
,
});
// 推送ali
var
a
=
await
self
.
aliclient
.
reqbyget
({
action
:
"CloseIntentionForPartner"
,
reqbody
:
{
BizId
:
pobj
.
actionBody
.
needNo
,
BizType
:
"esp.wangwen"
},
apiVersion
:
"2020-03-06"
});
var
a
=
await
self
.
aliclient
.
reqbyget
({
action
:
"CloseIntentionForPartner"
,
reqbody
:
{
IntentionBizId
:
pobj
.
actionBody
.
needNo
,
BizType
:
"esp.wangwen"
,
Note
:
pobj
.
actionBody
.
note
},
apiVersion
:
"2020-03-06"
});
console
.
log
(
'alalallala'
,
a
)
self
.
utilsPushSve
.
aliBusiness2Fq
(
pobj
,
"pushCloseICPNeed"
);
// 2020 1021 lin 新增查看日志
self
.
logCtl
.
info
({
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
||
""
:
""
,
appkey
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_key
||
""
:
""
,
requestId
:
pobj
.
requestId
||
""
,
op
:
"service/impl/common/qcCenterOrderSve.js/closeNeed"
,
content
:
JSON
.
stringify
(
a
),
resultInfo
:
""
,
optitle
:
"推送ali关闭需求->closeNeed"
,
});
self
.
utilsPushSve
.
aliBusiness2Fq
(
pobj
,
"pushCloseWangWenNeed"
);
return
system
.
getResultSuccess
();
}
else
{
return
system
.
getResult
(
null
,
"close fail 100389 "
);
...
...
@@ -477,7 +490,7 @@ async submitFoodSolution(pobj) {
var
reqParams
=
{
actionBody
:
{
intentionBizId
:
pobj
.
actionBody
.
needNo
,
status
:
"
beforeConfirma
tion"
status
:
"
createSolu
tion"
},
opType
:
"updateChanceStatus"
,
appInfo
:
pobj
.
appInfo
...
...
@@ -489,7 +502,7 @@ async submitFoodSolution(pobj) {
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
||
""
:
""
,
appkey
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_key
||
""
:
""
,
requestId
:
pobj
.
requestId
||
""
,
op
:
"service/impl/comm
e
n/qcCenterOrderSve.js/submitFoodSolution"
,
op
:
"service/impl/comm
o
n/qcCenterOrderSve.js/submitFoodSolution"
,
content
:
JSON
.
stringify
(
reqParams
),
resultInfo
:
""
,
optitle
:
"updateChanceStatus推送蜂擎获取的接口信息->aliBusiness2Delivery"
,
...
...
@@ -523,7 +536,7 @@ async foodCloseNeed(pobj) {
pobj
.
actionType
=
"abolishIcpProgrammeByNeed"
var
reqUrl
=
this
.
centerOrderUrl
+
"action/qcapi/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
console
.
log
(
'food+++result'
,
result
)
if
(
result
.
status
==
0
)
{
if
(
result
.
data
)
{
pobj
.
actionBody
.
orderNo
=
result
.
data
;
...
...
@@ -537,7 +550,7 @@ async foodCloseNeed(pobj) {
var
reqParams
=
{
actionBody
:
{
intentionBizId
:
pobj
.
actionBody
.
needNo
,
status
:
"
isClos
ed"
status
:
"
closeNe
ed"
},
opType
:
"updateChanceStatus"
,
appInfo
:
pobj
.
appInfo
...
...
@@ -555,8 +568,8 @@ async foodCloseNeed(pobj) {
optitle
:
"updateChanceStatus推送蜂擎获取的接口信息->aliBusiness2Delivery"
,
});
// 推送ali
var
a
=
await
self
.
aliclient
.
reqbyget
({
action
:
"CloseIntentionForPartner"
,
reqbody
:
{
BizId
:
pobj
.
actionBody
.
needNo
,
BizType
:
"esp.wangwen"
},
apiVersion
:
"2020-03-06"
});
self
.
utilsPushSve
.
aliBusiness2Fq
(
pobj
,
"pushClose
ICP
Need"
);
var
a
=
await
self
.
aliclient
.
reqbyget
({
action
:
"CloseIntentionForPartner"
,
reqbody
:
{
IntentionBizId
:
pobj
.
actionBody
.
needNo
,
BizType
:
"esp.wangwen"
,
Note
:
pobj
.
actionBody
.
note
},
apiVersion
:
"2020-03-06"
});
self
.
utilsPushSve
.
aliBusiness2Fq
(
pobj
,
"pushClose
Food
Need"
);
return
system
.
getResultSuccess
();
}
else
{
return
system
.
getResult
(
null
,
"close fail 100389 "
);
...
...
center-channel/app/base/service/impl/utilsSve/utilsAuthSve.js
View file @
0abc4777
...
...
@@ -60,7 +60,7 @@ class UtilsAuthService extends AppServiceBase {
}
/**
* 渠道通过账户进行登录,有则返回用户信息,没有则创建用户
* @param {*} pobj
* @param {*} pobj
* @param {*} actionBody {channelUserId:XX}
*/
async
getLoginByUserName
(
req
,
pobj
,
actionBody
)
{
//渠道通过账户进行登录,有则返回用户信息,没有则创建用户---actionBody.channelUserId
...
...
@@ -127,7 +127,7 @@ class UtilsAuthService extends AppServiceBase {
}
/**
* 通过短信登录或注册信息
* @param {*} pobj
* @param {*} pobj
* @param {*} actionBody {mobile:XXX,vcode:XXX,reqType:"reg",password:XXX-reqType为reg时有此值}
*/
async
getReqUserPinByLgoinVcode
(
pobj
,
actionBody
)
{
...
...
@@ -175,7 +175,7 @@ class UtilsAuthService extends AppServiceBase {
/**
* 通过手机验证码修改用户密码
* @param {*} pobj
* @param {*} pobj
* @param {*} actionBody {mobile:XX,vcode:XXX,newPwd:XXX,userpin:XXXXX}
*/
async
putUserPwdByMobile
(
pobj
,
actionBody
)
{
...
...
@@ -199,7 +199,7 @@ class UtilsAuthService extends AppServiceBase {
}
/**
* 通过userpin获取用户登录信息
* @param {*} pobj
* @param {*} pobj
* @param {*} actionBody {userpin:XXXXX}
*/
async
getLoginInfo
(
pobj
,
actionBody
)
{
...
...
@@ -214,7 +214,7 @@ class UtilsAuthService extends AppServiceBase {
}
/**
* 用户退出
* @param {*} pobj
* @param {*} pobj
* @param {*} actionBody {userpin:XXXX}
*/
async
userLogout
(
pobj
,
actionBody
)
{
...
...
@@ -233,36 +233,29 @@ class UtilsAuthService extends AppServiceBase {
* @param req
* @returns {Promise<void>}
*/
async
channelUserLogin
(
pobj
,
actionBody
,
req
)
{
//360登录地址
let
skipUrl
=
''
;
let
opResult
=
system
.
getResult
(
null
,
"req Failure"
);
//----通过Authorization 获取用户信息
let
Authorization
=
req
.
headers
[
"authorization"
]
||
""
;
if
(
!
Authorization
)
{
opResult
.
data
.
redirectUrl
=
skipUrl
;
opResult
=
system
.
getResultFail
(
-
99
,
'用户未登录'
,
{
redirectUrl
:
'skipUrl'
});
return
opResult
;
}
let
icCompanyUrl
=
''
;
let
subData
=
{
Authorization
:
Authorization
}
let
rtn
=
await
this
.
execClient
.
execFqGet
(
subData
,
icCompanyUrl
);
if
(
!
rtn
||
!
rtn
.
stdout
)
{
return
system
.
getResult
(
null
,
"execPost data is empty"
);
}
var
userInfo
=
JSON
.
parse
(
rtn
.
stdout
);
//----结束
async
channelUserLogin
(
pobj
,
actionBody
,
req
){
let
opResult
=
system
.
getResultSuccess
()
let
pin
=
actionBody
.
pin
;
let
result
=
await
this
.
get360Token
();
let
token
=
result
.
access_token
;
//360验证接口
// let subData = "pin=" + pin + "&token=" + token;
// let url = settings.requestUrl360() + 'api/v1/VerifyPin';
// let rtn = await this.restClient.execGet(subData,url);
// if (!rtn || !rtn.stdout) {
// return system.getResult(null, "restGet data is empty");
// }
// let checkRet = JSON.parse(rtn.stdout);
// if(checkRet.code != 200){
// return system.getResultFail(-1,checkRet.msg)
// }
//---渠道用户登录,有则返回userpin ,没有则注册用户并返回userpin
let
channelUserId
=
userInfo
.
mobile
;
actionBody
.
channelUserId
=
channelUserId
;
let
loginRt
=
await
this
.
getLoginByUserName
(
req
,
pobj
,
actionBody
);
actionBody
.
channelUserId
=
pin
;
let
loginRt
=
await
this
.
getLoginByUserName
(
pobj
,
actionBody
);
if
(
loginRt
.
status
!=
0
&&
loginRt
.
status
!=
2060
)
{
return
loginRt
;
}
opResult
.
data
=
{
userpin
:
pobj
.
actionBody
.
userpin
}
opResult
.
data
=
{
userpin
:
pobj
.
actionBody
.
userpin
}
if
(
loginRt
.
status
==
2060
)
{
opResult
.
msg
=
loginRt
.
msg
;
opResult
.
data
.
userpin
=
loginRt
.
data
.
userpin
;
...
...
@@ -270,5 +263,14 @@ class UtilsAuthService extends AppServiceBase {
return
opResult
;
}
async
get360Token
(){
let
rtn
=
await
this
.
execClient
.
exec360GetToken
(
settings
.
tokenUrl360
())
if
(
!
rtn
||
!
rtn
.
stdout
)
{
return
system
.
getResult
(
null
,
"restPost data is empty"
);
}
let
result
=
JSON
.
parse
(
rtn
.
stdout
);
return
result
;
}
}
module
.
exports
=
UtilsAuthService
;
center-channel/app/base/service/impl/utilsSve/utilsNeedSve.js
View file @
0abc4777
...
...
@@ -98,7 +98,6 @@ class UtilsNeedService extends AppServiceBase {
}
//调用center-order icp需求反馈
async
reqCenterOrderQcApi
(
pobj
,
reqUrl
)
{
var
url
=
this
.
centerOrderUrl
+
"action/qcapi/springBoard"
;
...
...
@@ -362,7 +361,7 @@ class UtilsNeedService extends AppServiceBase {
}
actionBody
.
newuserOtherList
=
newuserOtherList
;
}
if
(
actionBody
.
isDirectBuy
&&
(
actionBody
.
status
==
1
||
actionBody
.
status
==
0
))
{
//已支付直购不调用
if
(
actionBody
.
isDirectBuy
===
"true"
&&
(
actionBody
.
status
==
1
||
actionBody
.
status
==
0
))
{
//已支付直购不调用
return
system
.
getResultSuccess
();
}
pobj
.
actionType
=
"receiveIcpStatusNotify"
;
...
...
@@ -1315,6 +1314,138 @@ class UtilsNeedService extends AppServiceBase {
}
return
rtn
}
//-----------接入百度ICP------start--------zhuangbing----2020.10.22----------------------
/**
* 提交需求
* @param {*} pobj
* @param {*} actionBody
*/
async
submitNeed2
(
pobj
,
actionBody
)
{
if
(
actionBody
.
type
==
"esp.wangwen"
||
actionBody
.
type
==
"esp.food"
)
{
actionBody
.
area
=
this
.
wangwenAreaChange
(
actionBody
.
area
)
}
if
(
!
actionBody
.
intentionBizId
)
{
return
system
.
getResult
(
null
,
"actionBody.intentionBizId can not be empty,100380"
);
}
var
sobj
=
pobj
;
sobj
.
actionType
=
"getProductTypeInfo"
;
var
url
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
var
rtn
=
await
this
.
execClient
.
execPost
(
sobj
,
url
);
if
(
!
rtn
||
!
rtn
.
stdout
)
{
return
system
.
getResultFail
(
-
5015
,
"需求類型查询失败"
);
}
var
data
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
data
.
status
!=
0
)
{
return
system
.
getResultFail
(
-
5015
,
"需求類型查询失败"
);
}
pobj
.
actionBody
.
type_code
=
data
.
data
.
type_code
;
pobj
.
actionBody
.
type_name
=
data
.
data
.
type_name
;
pobj
.
actionBody
.
channel_type_code
=
data
.
data
.
channel_type_code
;
pobj
.
actionBody
.
channel_type_name
=
data
.
data
.
channel_type_name
;
pobj
.
actionBody
.
type
=
pobj
.
actionBody
.
channel_type_code
;
if
(
pobj
.
actionBody
.
channel_type_code
==
5
)
{
pobj
.
actionBody
.
type
=
"baidu.icp"
;
}
else
if
(
pobj
.
actionBody
.
channel_type_code
==
7
)
{
pobj
.
actionBody
.
type
=
"baidu.edi"
;
}
else
if
(
pobj
.
actionBody
.
channel_type_code
==
"tmjy"
)
{
pobj
.
actionBody
.
type
=
"baidu.tmd"
;
}
if
(
pobj
.
actionBody
.
description
&&
pobj
.
actionBody
.
description
.
indexOf
(
"备#"
)
<
0
)
{
pobj
.
actionBody
.
level
=
"A"
;
}
else
{
var
levelurl
=
"http://106.13.228.212:8000/recProbability"
;
var
levelresult
=
await
this
.
restPostUrl
({
intentionBizId
:
pobj
.
actionBody
.
intentionBizId
,
type
:
pobj
.
actionBody
.
type
,
note
:
pobj
.
actionBody
.
description
},
levelurl
);
if
(
levelresult
.
status
==
0
)
{
pobj
.
actionBody
.
level
=
levelresult
.
data
.
level
;
pobj
.
actionBody
.
probability
=
levelresult
.
data
.
per
;
}
else
{
pobj
.
actionBody
.
level
=
"C"
}
}
if
(
pobj
.
actionBody
.
phone
==
"17319425791"
)
{
pobj
.
actionBody
.
level
=
"F"
;
}
pobj
.
actionType
=
"submitNeed"
;
var
reqUrl
=
this
.
centerOrderUrl
+
"action/need/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
if
(
result
.
status
==
0
)
{
if
(
pobj
.
actionBody
.
channel_type_code
==
"esp.companyreg"
)
{
this
.
utilsPushSve
.
aliBusiness2Fq
(
pobj
,
"pushNeedBusiness"
);
}
else
{
var
reqParams
=
{
actionBody
:
pobj
.
actionBody
,
appInfo
:
pobj
.
appInfo
}
this
.
utilsPushSve
.
aliBusiness2Delivery
(
reqParams
,
"addChance"
);
pobj
.
actionBody
.
description
=
pobj
.
actionBody
.
description
+
" 成交概率:"
+
pobj
.
actionBody
.
level
if
(
pobj
.
actionBody
.
probability
)
{
pobj
.
actionBody
.
description
=
pobj
.
actionBody
.
description
+
"("
+
pobj
.
actionBody
.
probability
+
") "
}
this
.
utilsPushSve
.
aliBusiness2Fq
(
pobj
,
"pushNeedICPBusiness"
);
}
}
return
result
;
}
//状态更新
async
icpNotifyNew
(
pobj
)
{
var
actionBody
=
pobj
.
actionBody
;
var
self
=
this
;
if
(
actionBody
.
isDirectBuy
&&
actionBody
.
isDirectBuy
==
1
)
{
actionBody
.
bizId
=
actionBody
.
orderNo
}
if
(
!
actionBody
.
bizId
)
{
return
system
.
getResult
(
null
,
"actionBody.bizId can not be empty,100495"
);
}
actionBody
.
BizId
=
actionBody
.
bizId
;
if
(
!
actionBody
.
status
)
{
return
system
.
getResult
(
null
,
"actionBody.status can not be empty,100495"
);
}
pobj
.
actionType
=
"receiveOrderStatusNotify"
;
var
url
=
settings
.
centerOrderUrl
()
+
"action/qcapi/springBoard"
;
var
rtn
=
await
this
.
restPostUrl
(
pobj
,
url
);
if
(
actionBody
.
status
==
2
)
{
var
deliveryObj
=
{
actionBody
:
{
orderNo
:
rtn
.
data
.
orderNo
,
//pobj.actionBody.channelOrder.channelOrderNo,
needsolution
:
rtn
.
data
.
solutionContent
,
channelNeedNo
:
rtn
.
data
.
channelNeedNo
,
channelSolutionNo
:
rtn
.
data
.
channelSolutionNo
,
servicer
:
{
code
:
'gsb'
,
name
:
'公司宝'
}
},
appInfo
:
pobj
.
appInfo
}
this
.
utilsPushSve
.
aliBusiness2Delivery
(
deliveryObj
,
"pushDeliveryOrder"
);
}
if
(
rtn
.
status
==
0
&&
actionBody
.
status
!=
1
&&
actionBody
.
status
!=
2
&&
rtn
.
data
)
{
var
tmpObj
=
{
actionBody
:
{
orderNo
:
rtn
.
data
.
orderNo
,
channelNeedNo
:
rtn
.
data
.
channelNeedNo
,
needsolution
:
rtn
.
data
.
solutionContent
},
appInfo
:
pobj
.
appInfo
}
this
.
utilsPushSve
.
aliBusiness2Delivery
(
tmpObj
,
"pushDeliveryStatusNotify"
);
pobj
.
actionBody
.
orderNo
=
rtn
.
data
.
orderNo
;
if
(
actionBody
.
status
==
11
)
{
var
orderrtn
=
await
self
.
utilsOrderSve
.
delOrder
(
pobj
,
pobj
.
actionBody
);
if
(
orderrtn
.
status
<
0
)
{
return
system
.
getResultFail
(
-
5022
,
"订单关闭失败"
);
}
tmpObj
.
actionBody
.
orderNo
=
rtn
.
data
.
channelSolutionNo
;
self
.
utilsPushSve
.
aliBusiness2Fq
(
tmpObj
,
"pushOrderICPClose"
);
}
}
//通知更新状态
return
rtn
;
}
//-----------接入百度ICP------end----------------------------------
}
module
.
exports
=
UtilsNeedService
;
...
...
center-channel/app/base/service/impl/utilsSve/utilsOrderSve.js
View file @
0abc4777
...
...
@@ -49,9 +49,9 @@ class UtilsOrderService extends AppServiceBase {
}
console
.
log
(
"buyTotalSum"
,
buyTotalSum
)
console
.
log
(
"totalSum"
,
totalSum
)
if
(
buyTotalSum
<
totalSum
)
{
return
system
.
getResult
(
null
,
"订单金额有误,100060"
);
}
//
if (buyTotalSum < totalSum) {
//
return system.getResult(null, "订单金额有误,100060");
//
}
pobj
.
actionBody
.
product_info
.
price_item
=
price_list
[
productIndex
];
if
(
additionsIndex
>=
0
)
{
pobj
.
actionBody
.
product_info
.
price_additions_item
=
price_list
[
additionsIndex
];
...
...
@@ -933,7 +933,7 @@ class UtilsOrderService extends AppServiceBase {
};
opOrderResult
.
data
.
orderNo
=
params
.
orderNo
;
opOrderResult
.
data
.
order_info
.
pay_flow_no
=
params
.
trade_no
||
""
;
// 2020 0704 lin 新增 推送fq必填字段
opOrderResult
.
data
.
order_info
.
pay_channel
=
params
.
payType
==
'wx'
?
'微信'
:
'支付宝'
;
//付款方式
opOrderResult
.
data
.
order_info
.
pay_channel
=
params
.
payType
||
""
;
//付款方式
opOrderResult
.
data
.
order_info
.
pay_time
=
params
.
payTime
;
//付款时间
opOrderResult
.
data
.
order_info
.
pay_payer_bank_no
=
params
.
buyer_email
||
""
;
//付款账号
opOrderResult
.
data
.
order_contact
=
opOrderResult
.
data
.
delivery_content
.
orderContact
;
...
...
@@ -944,15 +944,109 @@ class UtilsOrderService extends AppServiceBase {
}
// 推送
this
.
utilsPushSve
.
pushBusInfo
(
pobj
,
"pushOrder"
,
0
);
if
([
'icpsq'
,
'edisq'
].
includes
(
opOrderResult
.
data
.
product_info
.
channel_item_code
)){
this
.
utilsPushSve
.
aliBusiness2Delivery
(
pobj
,
"pushDeliveryOrder"
);
}
opOrderResult
.
data
=
null
;
return
opOrderResult
;
}
catch
(
e
)
{
// await this.cacheManager["TlPayLocker"].release(params.orderNo);
this
.
logCtl
.
error
({
optitle
:
"回调处理订单---error异常"
,
op
:
"center-app/app/base/service/impl/utilsSve/utilsOrderSve.js/channelPayNotify"
,
content
:
"参数="
+
JSON
.
stringify
(
params
)
+
",error:"
+
e
.
stack
,
clientIp
:
client_ip
||
""
});
return
system
.
getResultFail
(
-
200
,
e
.
stack
);
}
}
async
channelPayNotify360
(
params
,
client_ip
)
{
//渠道订单支付通知
try
{
this
.
logCtl
.
info
({
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"渠道订单支付回调参数信息"
,
op
:
"service/impl/utilsSve/utilsOrderSve.js/channelPayNotify"
,
content
:
JSON
.
stringify
(
params
),
clientIp
:
client_ip
||
""
});
if
(
!
params
.
appkey
)
{
return
system
.
getResult
(
null
,
'appKey can be not null'
)
}
if
(
!
params
.
orderNo
)
{
return
system
.
getResult
(
null
,
'orderNo can be not null'
)
}
if
(
!
params
.
payTotalSum
)
{
return
system
.
getResult
(
null
,
'payTotalSum can be not null'
)
}
if
(
!
params
.
signature
)
{
return
system
.
getResult
(
null
,
'signature can be not null'
)
}
if
(
!
params
.
payType
)
{
return
system
.
getResult
(
null
,
'payType can be not null'
)
}
if
(
!
params
.
payOrderNo
)
{
return
system
.
getResult
(
null
,
'payOrderNo can be not null'
)
}
let
url
=
this
.
centerAppUrl
+
'payment/paymentApi/getAppInfoByAppKey'
;
let
appInfoRt
=
await
this
.
restPostUrl
({
appKey
:
params
.
appkey
},
url
);
if
(
appInfoRt
.
status
!=
0
)
{
appInfoRt
.
msg
=
appInfoRt
.
msg
+
",100270"
;
return
appInfoRt
;
}
let
singStr
=
params
.
appkey
+
params
.
orderNo
+
params
.
payTotalSum
+
appInfoRt
.
data
.
uapp_secret
let
sign
=
md5
(
singStr
).
toUpperCase
();
if
(
sign
!=
params
.
signature
)
{
return
system
.
getResultFail
(
-
1
,
'验证签名失败'
)
}
var
appInfo
=
appInfoRt
.
data
;
params
.
appInfo
=
{
uapp_id
:
appInfo
.
uapp_id
};
params
.
pay_type
=
params
.
payType
;
params
.
time_end
=
params
.
payTime
;
//修改并返回订单支付状态,创建收款单
// 这里修改了order_info的状态(status/paytime等)
var
orderUrl
=
this
.
centerOrderUrl
+
"opaction/opPayOrder/receivePayCallBackNotifyByChannel"
;
var
opOrderResult
=
await
this
.
restPostUrl
(
params
,
orderUrl
);
if
(
opOrderResult
.
status
!=
0
)
{
opOrderResult
.
data
=
null
;
return
opOrderResult
;
}
if
(
!
opOrderResult
.
data
){
return
opOrderResult
;
}
opOrderResult
.
data
.
appInfo
=
{
uapp_id
:
appInfo
.
uapp_id
,
uapp_key
:
appInfo
.
uapp_key
,
app_code
:
appInfo
.
app_code
,
app_name
:
appInfo
.
app_name
};
opOrderResult
.
data
.
userInfo
=
{
channel_userid
:
opOrderResult
.
data
.
order_info
.
channelUserId
,
channel_username
:
opOrderResult
.
data
.
order_info
.
channelUserId
,
channel_nickname
:
opOrderResult
.
data
.
order_info
.
channelUserId
};
opOrderResult
.
data
.
orderNo
=
params
.
orderNo
;
opOrderResult
.
data
.
order_info
.
pay_flow_no
=
params
.
trade_no
||
""
;
// 2020 0704 lin 新增 推送fq必填字段
opOrderResult
.
data
.
order_info
.
pay_channel
=
params
.
payType
||
""
;
//付款方式
opOrderResult
.
data
.
order_info
.
pay_time
=
params
.
payTime
;
//付款时间
opOrderResult
.
data
.
order_info
.
pay_payer_bank_no
=
params
.
buyer_email
||
""
;
//付款账号
opOrderResult
.
data
.
order_contact
=
opOrderResult
.
data
.
delivery_content
.
orderContact
;
var
pobj
=
{
appInfo
:
opOrderResult
.
data
.
appInfo
,
actionBody
:
opOrderResult
.
data
}
// 推送
this
.
utilsPushSve
.
pushBusInfo
(
pobj
,
"pushOrder"
,
0
);
if
([
'icpsq'
,
'edisq'
].
includes
(
opOrderResult
.
data
.
product_info
.
channel_item_code
)){
this
.
utilsPushSve
.
aliBusiness2Delivery
(
pobj
,
"pushDeliveryOrder"
);
}
else
{
this
.
utilsPushSve
.
pushBusInfo
(
pobj
,
"pushOrder"
,
0
);
}
opOrderResult
.
data
=
null
;
return
opOrderResult
;
}
catch
(
e
)
{
await
this
.
cacheManager
[
"TlPayLocker"
].
release
(
params
.
orderNo
);
//
await this.cacheManager["TlPayLocker"].release(params.orderNo);
this
.
logCtl
.
error
({
optitle
:
"回调处理订单---error异常"
,
op
:
"center-app/app/base/service/impl/utilsSve/utilsOrderSve.js/channelPayNotify"
,
...
...
center-channel/app/base/utils/execClient.js
View file @
0abc4777
...
...
@@ -2,6 +2,7 @@ var childproc = require('child_process');
const
util
=
require
(
'util'
);
const
exec
=
util
.
promisify
(
require
(
'child_process'
).
exec
);
const
uuidv4
=
require
(
'uuid/v4'
);
var
settings
=
require
(
"../../config/settings"
);
class
ExecClient
{
constructor
()
{
this
.
cmdPostPattern
=
"curl --user admines:adminGSBes. -k -H 'Content-type: application/json' -d '{data}' {url}"
;
...
...
@@ -9,7 +10,8 @@ class ExecClient {
this
.
cmdPushDataPostPattern
=
"curl -k -H 'Content-type: application/json' -H 'token:{tk}' -H 'request-id:{requestId}' -d '{data}' {url}"
;
this
.
cmdFeishuGetPattern
=
"curl -X GET -k -H 'Content-Type: application/json' -H 'Authorization: {Authorization}' -d '{data}' {url} "
;
this
.
cmdFeishuPostPattern
=
"curl -k -H 'Content-type: application/json' -H 'Authorization: {Authorization}' -d '{data}' {url}"
;
//360
this
.
cmd360PostPattern
=
"curl -u gongsibao:qPa4PsVsxbQ847i5pOKSmfPKrzRoNKqx -d '{data}' -X POST {url}"
}
getUUID
()
{
var
uuid
=
uuidv4
();
...
...
@@ -80,11 +82,6 @@ class ExecClient {
console
.
log
(
cmd
);
return
cmd
;
}
FetchFqGetCmd
(
subData
,
url
)
{
var
cmd
=
this
.
cmdFeishuGetPattern
.
replace
(
/
\{
url
\}
/g
,
url
).
replace
(
/
\{
Authorization
\}
/g
,
"Bearer "
+
subData
.
Authorization
);
console
.
log
(
cmd
);
return
cmd
;
}
//飞书小程序GET请求
FetchFeishuGetCmd
(
subData
,
url
)
{
...
...
@@ -106,8 +103,17 @@ class ExecClient {
return
result
;
}
async
execFqGet
(
subData
,
url
)
{
let
cmd
=
this
.
FetchFqGetCmd
(
subData
,
url
);
Fetch360PostCmd
(
subData
,
url
){
var
cmd
=
this
.
cmd360PostPattern
.
replace
(
/
\{
data
\}
/g
,
subData
).
replace
(
/
\{
url
\}
/g
,
url
);
console
.
log
(
cmd
);
return
cmd
;
}
async
exec360GetToken
(
url
){
const
qs
=
require
(
'qs'
)
let
obj
=
{
"scope"
:
"smart_business"
,
"grant_type"
:
"client_credentials"
}
let
cmd
=
this
.
Fetch360PostCmd
(
qs
.
stringify
(
obj
),
url
);
console
.
log
(
cmd
);
var
result
=
await
this
.
exec
(
cmd
);
return
result
;
...
...
center-channel/app/base/utils/restClient.js
View file @
0abc4777
...
...
@@ -19,7 +19,6 @@ class RestClient {
this
.
cmdPostPattern5
=
"curl -k --data '{data}' {url}"
;
// authorization=[token]
this
.
cmdPostpatternToken
=
"curl -k -H 'Content-type: application/json' -H 'authorization:{token}' -X POST {url}"
}
getUUID
()
{
var
uuid
=
uuidv4
();
...
...
@@ -172,6 +171,12 @@ class RestClient {
var
result
=
await
this
.
exec
(
cmd
);
return
result
;
}
async
execDeliveryPost
(
subdata
,
url
){
let
cmd
=
this
.
FetchPostCmd
(
subdata
,
url
)
cmd
+=
" -H 'XAPPKEY:647a68c9-da01-40d3-9763-1ffa0f64cf3f'"
var
result
=
await
this
.
exec
(
cmd
);
return
result
;
}
test
()
{
console
.
log
(
"hello"
);
}
...
...
center-channel/app/config/routes/api.js
View file @
0abc4777
...
...
@@ -545,4 +545,80 @@ module.exports = function (app) {
});
//-----------------------新的模式---------api---------结束
//-----------------------新的模式---------ICP---------开始
app
.
all
(
"/icp/*"
,
async
function
(
req
,
res
,
next
)
{
var
result
=
system
.
getResult
(
null
,
"req method must is post"
);
if
(
req
.
method
!=
"POST"
)
{
res
.
end
(
JSON
.
stringify
(
result
));
return
;
}
var
token
=
req
.
headers
[
"token"
]
||
""
;
if
(
!
token
)
{
var
resfail
=
{
"success"
:
false
,
"errorMsg"
:
"req headers token can not be empty"
,
"errorCode"
:
"ok"
};
res
.
end
(
JSON
.
stringify
(
resfail
));
return
;
}
var
cacheManager
=
system
.
getObject
(
"db.common.cacheManager"
);
var
result
=
await
cacheManager
[
"AppTokenByHostsCache"
].
getCache
(
token
,
system
.
exTime
);
if
(
result
.
status
!=
0
)
{
var
resfail
=
{
"success"
:
false
,
"errorMsg"
:
result
.
msg
||
"token error"
,
"errorCode"
:
"ok"
};
res
.
end
(
JSON
.
stringify
(
resfail
));
// res.end(JSON.stringify(result));
return
;
}
req
.
appInfo
=
result
.
data
;
req
.
body
.
appInfo
=
result
.
data
;
req
.
actionProcess
=
result
.
data
.
app_code
;
next
();
});
//icp需求推送
app
.
post
(
'/icp/consultation/submit'
,
function
(
req
,
res
)
{
var
p
=
null
;
var
params
=
[
"icpnotify"
,
"icpSubmitNeed"
,
req
.
body
,
req
.
query
,
req
];
// gname, methodname, pobj, query, req
var
invokeObj
=
system
.
getObject
(
"api.action.icpnotify"
);
if
(
invokeObj
[
"doexecMethod"
])
{
p
=
invokeObj
[
"doexecMethod"
].
apply
(
invokeObj
,
params
);
}
p
.
then
(
r
=>
{
res
.
end
(
JSON
.
stringify
(
r
));
});
});
//⽤户反馈需求通知服务商
app
.
post
(
'/icp/feedback/submit'
,
function
(
req
,
res
)
{
var
p
=
null
;
req
.
body
.
action_type
=
"icpFeedbackSubmit"
;
var
params
=
[
"icpnotify"
,
"icpFeedbackSubmit"
,
req
.
body
,
req
.
query
,
req
];
// gname, methodname, pobj, query, req
var
invokeObj
=
system
.
getObject
(
"api.action.icpnotify"
);
if
(
invokeObj
[
"doexecMethod"
])
{
p
=
invokeObj
[
"doexecMethod"
].
apply
(
invokeObj
,
params
);
}
p
.
then
(
r
=>
{
res
.
end
(
JSON
.
stringify
(
r
));
});
});
//推送订单信息
app
.
post
(
'/icp/order/notify'
,
function
(
req
,
res
)
{
var
p
=
null
;
req
.
body
.
action_type
=
"icpNotify"
;
var
params
=
[
"icpnotify"
,
"icpNotify"
,
req
.
body
,
req
.
query
,
req
];
// gname, methodname, pobj, query, req
var
invokeObj
=
system
.
getObject
(
"api.action.icpnotify"
);
if
(
invokeObj
[
"doexecMethod"
])
{
p
=
invokeObj
[
"doexecMethod"
].
apply
(
invokeObj
,
params
);
}
p
.
then
(
r
=>
{
res
.
end
(
JSON
.
stringify
(
r
));
});
});
//-----------------------新的模式---------ICP---------结束
};
\ No newline at end of file
center-channel/app/config/settings.js
View file @
0abc4777
...
...
@@ -158,7 +158,7 @@ var settings = {
},
gatewayUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://
192.168.0.106
:4005/"
;
return
"http://
localhost
:4005/"
;
}
else
{
return
"https://channelgateway-api.gongsibao.com/"
;
}
...
...
@@ -235,6 +235,20 @@ var settings = {
return
"https://m.ucommune.com/"
// 6.29lin修改为测试环境。原因优客 目前还没有正式环境
}
},
tokenUrl360
:
function
(){
if
(
this
.
env
==
"dev"
)
{
return
"https://oauth2.e.360.cn/site/token"
// 360测试环境
}
else
{
return
""
//
}
},
requestUrl360
:
function
(){
if
(
this
.
env
==
"dev"
)
{
return
"http://180.163.239.98:38085/"
// 360测试环境
}
else
{
return
""
//
}
},
aliUappId
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
18
// uapp_id
...
...
center-channel/app/front/entry/public/apidoc/patentDesc/patent.md
View file @
0abc4777
...
...
@@ -15,6 +15,7 @@
1.
[
根据公开号查询聚合
](
#CommomSearchbyPubno
)
1.
[
根据发明人查询聚合
](
#CommomSearchbyInventor
)
1.
[
根据申请号查询并根据法律状态日期排序
](
#AffairsearchbyFilingno
)
1.
[
查询所有专利,按公开日倒序排列
](
#paDataOrderByPubno
)
## **<a name="CommomSearchbyApplicant"> 根据申请人查询聚合接口</a>**
...
...
@@ -1143,4 +1144,51 @@
"bizmsg"
:
"empty"
}
```
## **<a name="paDataOrderByPubno"> 查询所有专利,按公开日倒序排列</a>**
[
返回到目录
](
#menu
)
##### URL
[
/action/patentQuery/paDataOrderByPubno
]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 渠道执行的类型 actionType:paDataOrderByPubno
```
javascript
{
"page_size"
:
10
//需要返回的最大条数,可不传,默认20
"current_page"
:
0
//需要返回的当前页。可不传,默认0
}
```
#### 返回结果
```
javascript
{
"status"
:
0
,
"msg"
:
"操作成功"
,
"data"
:
{
"total"
:
3
,
"data"
:
[
{
"abstr_text"
:
"本申请提供了一种任务调度管理方法、装置及电子设备,其中,该任务调度管理方法包括:使用目标监测组件对容器编排平台中的目标工作进行监控;当目标监测组件监控到目标工作的工作状态发生变化时,则通过目标监测组件将目标工作的当前工作状态发送给任务记录组件;通过任务记录组件,根据目标工作的当前工作状态对目标工作对应的目标任务的任务状态进行更新。"
,
"filing_name"
:
"任务调度管理方法、装置及电子设备"
,
"filing_no"
:
"202010458650"
,
"pub_no"
:
"CN111597032A"
},
{
"abstr_text"
:
"本发明的一种基于WB芯片的双面挖腔陶瓷封装工艺,在陶瓷基板两侧面的芯片贴装位置进行预先挖腔,封装时将WB芯片分别沉到相应的陶瓷腔里并与陶瓷基板连接,连接后进行底面封帽和顶面封帽,在陶瓷基板底面焊接引脚并弯曲成型,完成封装。通过在陶瓷基板两侧面分别设置上挖腔和下挖腔,使得陶瓷基板的空间得到增大,且上挖腔和下挖腔内均设有WB芯片,使得陶瓷基板的封装空间变大,提高了陶瓷封装的空间利用率且降低了陶瓷封装的外形尺寸。"
,
"filing_name"
:
"一种基于WB芯片的双面挖腔陶瓷封装工艺"
,
"filing_no"
:
"202010458856"
,
"pub_no"
:
"CN111599689A"
},
{
"abstr_text"
:
"本发明公开了一种乐器打孔用定位装置,包括底板,所述底板的上表面上通过螺钉固定安装有伺服电缸,所述伺服电缸的输出端端头上通过螺钉固定安装有支撑板,所述支撑板的上表面上开设有圆槽,所述圆槽中通过至少四个连接机构转动安装有工作台,所述伺服电机的输出轴贯穿底板后与工作台固定连接,所述工作台的上表面左右边缘处均固定焊接有第一固定板,所述第一固定板上通过螺纹套管螺纹连接有手柄螺栓,所述手柄螺栓的端头上通过转动机构设置有活动夹块,所述第二固定板上固定焊接有固定夹块。本发明的高度可进行调节,可适应不同的打孔设备,可快速变换工作台的打孔工位,可实现连续性地打孔作业,提高了乐器加工效率。"
,
"filing_name"
:
"一种乐器打孔用定位装置"
,
"filing_no"
:
"202010459355"
,
"pub_no"
:
"CN111589936A"
}
]
},
"bizmsg"
:
"empty"
}
```
\ No newline at end of file
center-channel/package-lock.json
View file @
0abc4777
...
...
@@ -417,6 +417,11 @@
"resolved"
:
"https://registry.npmjs.org/ast-types/-/ast-types-0.11.4.tgz"
,
"integrity"
:
"sha512-RbY3UMcOcGhc3pOfQ6sliVjt3lqGib9lRjfH1UXJ8YfBFWbcWSJ8jr/VB2W6ulCzTSO/DSnCASqsHYuqa8O7yw=="
},
"async"
:
{
"version"
:
"3.2.0"
,
"resolved"
:
"https://registry.npmjs.org/async/-/async-3.2.0.tgz"
,
"integrity"
:
"sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw=="
},
"async-foreach"
:
{
"version"
:
"0.1.3"
,
"resolved"
:
"https://registry.npmjs.org/async-foreach/-/async-foreach-0.1.3.tgz"
,
...
...
@@ -1176,6 +1181,16 @@
"emitter-listener"
:
"^1.1.1"
}
},
"convert-hex"
:
{
"version"
:
"0.1.0"
,
"resolved"
:
"https://registry.npmjs.org/convert-hex/-/convert-hex-0.1.0.tgz"
,
"integrity"
:
"sha1-CMBFaJIsJ3drii6BqV05M2LqC2U="
},
"convert-string"
:
{
"version"
:
"0.1.0"
,
"resolved"
:
"https://registry.npmjs.org/convert-string/-/convert-string-0.1.0.tgz"
,
"integrity"
:
"sha1-ec5BqbsNA7z3LNxqjzxW+7xkQQo="
},
"cookie"
:
{
"version"
:
"0.3.1"
,
"resolved"
:
"https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz"
,
...
...
@@ -3669,7 +3684,8 @@
"is-buffer"
:
{
"version"
:
"1.1.6"
,
"resolved"
:
"https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz"
,
"integrity"
:
"sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w=="
"integrity"
:
"sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w=="
,
"dev"
:
true
},
"is-builtin-module"
:
{
"version"
:
"1.0.0"
,
...
...
@@ -4480,16 +4496,6 @@
"resolved"
:
"https://registry.npmjs.org/marked/-/marked-0.7.0.tgz"
,
"integrity"
:
"sha512-c+yYdCZJQrsRjTPhUx7VKkApw9bwDkNbHUKo1ovgcfDjb2kc8rLuRbIFyXL5WOEUwzSSKo3IXpph2K6DqB/KZg=="
},
"md5"
:
{
"version"
:
"2.2.1"
,
"resolved"
:
"https://registry.npmjs.org/md5/-/md5-2.2.1.tgz"
,
"integrity"
:
"sha1-U6s41f48iJG6RlMp6iP6wFQBJvk="
,
"requires"
:
{
"charenc"
:
"~0.0.1"
,
"crypt"
:
"~0.0.1"
,
"is-buffer"
:
"~1.1.1"
}
},
"media-typer"
:
{
"version"
:
"0.3.0"
,
"resolved"
:
"https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz"
,
...
...
@@ -6681,6 +6687,15 @@
"crypt"
:
">= 0.0.1"
}
},
"sha256"
:
{
"version"
:
"0.2.0"
,
"resolved"
:
"https://registry.npmjs.org/sha256/-/sha256-0.2.0.tgz"
,
"integrity"
:
"sha1-c6C0GNqrcDW/+G6EkeNjQS/CqwU="
,
"requires"
:
{
"convert-hex"
:
"~0.1.0"
,
"convert-string"
:
"~0.1.0"
}
},
"shebang-command"
:
{
"version"
:
"1.2.0"
,
"resolved"
:
"https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz"
,
...
...
@@ -8107,7 +8122,6 @@
"resolved"
:
"https://registry.npmjs.org/wx-pay/-/wx-pay-1.0.2.tgz"
,
"integrity"
:
"sha1-rhQqFRQ0yjgKgDffgytl3f9JdQQ="
,
"requires"
:
{
"md5"
:
"^2.0.0"
,
"request"
:
"^2.54.0"
,
"xml2js"
:
"^0.4.6"
}
...
...
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