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
12090978
Commit
12090978
authored
Oct 22, 2020
by
庄冰
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'center-channel' of gitlab.gongsibao.com:jiangyong/zhichan into center-channel
parents
b5d893cb
356dd084
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
156 additions
and
77 deletions
+156
-77
center-channel/app/base/service/impl/common/qcCenterOrderSve.js
+65
-27
center-channel/app/base/service/impl/utilsSve/utilsAuthSve.js
+31
-30
center-channel/app/base/service/impl/utilsSve/utilsNeedSve.js
+25
-10
center-channel/app/base/service/impl/utilsSve/utilsOrderSve.js
+1
-1
center-channel/app/base/utils/execClient.js
+14
-8
center-channel/app/base/utils/restClient.js
+6
-1
center-channel/app/config/settings.js
+14
-0
No files found.
center-channel/app/base/service/impl/common/qcCenterOrderSve.js
View file @
12090978
...
...
@@ -59,7 +59,7 @@ 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
};
if
(
needsolution
.
channelSolutionNo
)
{
pushObj
[
"BizId"
]
=
needsolution
.
channelSolutionNo
;
...
...
@@ -266,6 +266,28 @@ class QcCenterOrderService extends AppServiceBase {
solution
=
JSON
.
parse
(
solution
);
solution
=
solution
.
solution
solution
=
JSON
.
stringify
(
solution
)
//推送交付系统
var
reqParams
=
{
actionBody
:
{
intentionBizId
:
res
.
data
.
needinfo
.
channelNeedNo
,
status
:
"createSolution"
},
opType
:
"updateChanceStatus"
,
appInfo
:
pobj
.
appInfo
}
var
self
=
this
;
self
.
utilsPushSve
.
aliBusiness2Delivery
(
reqParams
,
"updateChanceStatus"
);
//日志记录
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/submitWangwenSolution"
,
content
:
JSON
.
stringify
(
reqParams
),
resultInfo
:
""
,
optitle
:
"updateChanceStatus推送蜂擎获取的接口信息->aliBusiness2Delivery"
,
});
//推送数据至阿里
var
pushObj
=
{
intentionBizId
:
res
.
data
.
needinfo
.
channelNeedNo
,
...
...
@@ -274,7 +296,7 @@ class QcCenterOrderService extends AppServiceBase {
solution
:
solution
};
console
.
log
(
"wangwen"
,
pushObj
);
var
self
=
this
;
this
.
pushSubmitSolution
(
pushObj
,
needsolution
.
solutionNo
,
pobj
.
appInfo
,
self
);
return
system
.
getResultSuccess
();
}
...
...
@@ -316,15 +338,7 @@ class QcCenterOrderService extends AppServiceBase {
pobj
.
actionType
=
"abolishIcpProgrammeByNeed"
var
reqUrl
=
this
.
centerOrderUrl
+
"action/qcapi/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
this
.
logCtl
.
info
({
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
||
""
:
""
,
appkey
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_key
||
""
:
""
,
requestId
:
pobj
.
requestId
||
""
,
op
:
"service/impl/utilsSve/utilsNeedSve.js/closeNeed"
,
content
:
JSON
.
stringify
(
pobj
),
resultInfo
:
JSON
.
stringify
(
result
),
optitle
:
"abolishIcpProgrammeByNeed推送蜂擎获取的接口信息->aliBusiness2Delivery"
,
});
console
.
log
(
'www+++result'
,
result
)
if
(
result
.
status
==
0
)
{
if
(
result
.
data
)
{
pobj
.
actionBody
.
orderNo
=
result
.
data
;
...
...
@@ -349,15 +363,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/
utilsSve/utilsNeed
Sve.js/closeNeed"
,
op
:
"service/impl/
common/qcCenterOrder
Sve.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 "
);
...
...
@@ -459,6 +483,28 @@ async submitFoodSolution(pobj) {
solution
=
JSON
.
parse
(
solution
);
solution
=
solution
.
solution
solution
=
JSON
.
stringify
(
solution
)
//推送交付系统
var
reqParams
=
{
actionBody
:
{
intentionBizId
:
pobj
.
actionBody
.
needNo
,
status
:
"createSolution"
},
opType
:
"updateChanceStatus"
,
appInfo
:
pobj
.
appInfo
}
var
self
=
this
;
self
.
utilsPushSve
.
aliBusiness2Delivery
(
reqParams
,
"updateChanceStatus"
);
//日志记录
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/submitFoodSolution"
,
content
:
JSON
.
stringify
(
reqParams
),
resultInfo
:
""
,
optitle
:
"updateChanceStatus推送蜂擎获取的接口信息->aliBusiness2Delivery"
,
});
//推送数据至阿里
var
pushObj
=
{
intentionBizId
:
res
.
data
.
needinfo
.
channelNeedNo
,
...
...
@@ -467,7 +513,6 @@ async submitFoodSolution(pobj) {
solution
:
solution
};
console
.
log
(
"food"
,
pushObj
);
var
self
=
this
;
this
.
pushSubmitSolution
(
pushObj
,
needsolution
.
solutionNo
,
pobj
.
appInfo
,
self
);
return
system
.
getResultSuccess
();
}
...
...
@@ -489,15 +534,7 @@ async foodCloseNeed(pobj) {
pobj
.
actionType
=
"abolishIcpProgrammeByNeed"
var
reqUrl
=
this
.
centerOrderUrl
+
"action/qcapi/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
this
.
logCtl
.
info
({
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
||
""
:
""
,
appkey
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_key
||
""
:
""
,
requestId
:
pobj
.
requestId
||
""
,
op
:
"service/impl/utilsSve/utilsNeedSve.js/closeNeed"
,
content
:
JSON
.
stringify
(
pobj
),
resultInfo
:
JSON
.
stringify
(
result
),
optitle
:
"abolishIcpProgrammeByNeed推送蜂擎获取的接口信息->aliBusiness2Delivery"
,
});
console
.
log
(
'food+++result'
,
result
)
if
(
result
.
status
==
0
)
{
if
(
result
.
data
)
{
pobj
.
actionBody
.
orderNo
=
result
.
data
;
...
...
@@ -516,20 +553,21 @@ async foodCloseNeed(pobj) {
opType
:
"updateChanceStatus"
,
appInfo
:
pobj
.
appInfo
}
var
self
=
this
;
self
.
utilsPushSve
.
aliBusiness2Delivery
(
reqParams
,
"updateChanceStatus"
);
//日志记录
self
.
logCtl
.
info
({
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
||
""
:
""
,
appkey
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_key
||
""
:
""
,
requestId
:
pobj
.
requestId
||
""
,
op
:
"service/impl/
utilsSve/utilsNeedSve.js/c
loseNeed"
,
op
:
"service/impl/
common/qcCenterOrderSve.js/foodC
loseNeed"
,
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"
});
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 @
12090978
...
...
@@ -32,7 +32,7 @@ class UtilsAuthService extends AppServiceBase {
}
/**
* 渠道通过账户进行登录,有则返回用户信息,没有则创建用户
* @param {*} pobj
* @param {*} pobj
* @param {*} actionBody {channelUserId:XX}
*/
async
getLoginByUserName
(
pobj
,
actionBody
)
{
//渠道通过账户进行登录,有则返回用户信息,没有则创建用户---actionBody.channelUserId
...
...
@@ -50,7 +50,7 @@ class UtilsAuthService extends AppServiceBase {
/**
* 通过账户和密码登录
* @param {*} pobj
* @param {*} pobj
* @param {*} actionBody {userName:XX,password:XXX}
*/
async
getReqUserPinByLgoin
(
pobj
,
actionBody
)
{
...
...
@@ -70,7 +70,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
)
{
...
...
@@ -96,7 +96,7 @@ class UtilsAuthService extends AppServiceBase {
/**
* 获取默认模板的手机验证码
* @param {*} pobj
* @param {*} pobj
* @param {*} actionBody {mobile:XXX}
*/
async
getVerifyCodeByMoblie
(
pobj
,
actionBody
)
{
...
...
@@ -108,7 +108,7 @@ class UtilsAuthService extends AppServiceBase {
/**
* 通过手机验证码修改用户密码
* @param {*} pobj
* @param {*} pobj
* @param {*} actionBody {mobile:XX,vcode:XXX,newPwd:XXX,userpin:XXXXX}
*/
async
putUserPwdByMobile
(
pobj
,
actionBody
)
{
...
...
@@ -132,7 +132,7 @@ class UtilsAuthService extends AppServiceBase {
}
/**
* 通过userpin获取用户登录信息
* @param {*} pobj
* @param {*} pobj
* @param {*} actionBody {userpin:XXXXX}
*/
async
getLoginInfo
(
pobj
,
actionBody
)
{
...
...
@@ -147,7 +147,7 @@ class UtilsAuthService extends AppServiceBase {
}
/**
* 用户退出
* @param {*} pobj
* @param {*} pobj
* @param {*} actionBody {userpin:XXXX}
*/
async
userLogout
(
pobj
,
actionBody
)
{
...
...
@@ -167,35 +167,27 @@ class UtilsAuthService extends AppServiceBase {
* @returns {Promise<void>}
*/
async
channelUserLogin
(
pobj
,
actionBody
,
req
){
//360登录地址
let
skipUrl
=
''
;
let
opResult
=
system
.
getResult
(
null
,
"req Failure"
);
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);
// console.log(checkRet,'checkRet--------------');
//----通过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
);
//----结束
//---渠道用户登录,有则返回userpin ,没有则注册用户并返回userpin
let
channelUserId
=
userInfo
.
mobile
;
actionBody
.
channelUserId
=
channelUserId
;
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
;
...
...
@@ -203,5 +195,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 @
12090978
...
...
@@ -361,6 +361,9 @@ class UtilsNeedService extends AppServiceBase {
}
actionBody
.
newuserOtherList
=
newuserOtherList
;
}
if
(
actionBody
.
isDirectBuy
===
"true"
&&
(
actionBody
.
status
==
1
||
actionBody
.
status
==
0
))
{
//已支付直购不调用
return
system
.
getResultSuccess
();
}
pobj
.
actionType
=
"receiveIcpStatusNotify"
;
var
url
=
settings
.
centerOrderUrl
()
+
"action/qcapi/springBoard"
;
var
rtn
=
await
this
.
restPostUrl
(
pobj
,
url
);
...
...
@@ -369,7 +372,7 @@ class UtilsNeedService extends AppServiceBase {
actionBody
:
{
orderNo
:
rtn
.
data
.
orderNo
,
//pobj.actionBody.channelOrder.channelOrderNo,
needsolution
:
rtn
.
data
.
solutionContent
,
channelNeedNo
:
rtn
.
data
.
channelNeedNo
,
channelNeedNo
:
rtn
.
data
.
channelNeedNo
||
""
,
channelSolutionNo
:
rtn
.
data
.
channelSolutionNo
,
servicer
:
{
code
:
'gsb'
,
...
...
@@ -413,9 +416,9 @@ class UtilsNeedService extends AppServiceBase {
/*docUrl下载链接,全路径,如:https://XXXXXX.pdf?XXXXX */
try
{
var
tmpFileName
=
docUrl
.
substring
(
0
,
docUrl
.
lastIndexOf
(
"?"
));
var
fileName
=
tmpFileName
.
substr
(
tmpFileName
.
lastIndexOf
(
"/"
)
+
1
,
tmpFileName
.
leng
ht
);
var
fileName
=
tmpFileName
.
substr
(
tmpFileName
.
lastIndexOf
(
"/"
)
+
1
,
tmpFileName
.
leng
th
);
// 2020 0803 lin 修改;
var
urlJson
=
this
.
urlSplit
(
d
ocUrl
);
var
urlJson
=
this
.
urlSplit
(
d
ecodeURI
(
docUrl
)
);
if
(
urlJson
[
"Expires"
])
{
// url中过期时间与服务器时间对比结果为已过期
if
(
urlJson
[
"Expires"
]
<
new
Date
().
getTime
())
{
...
...
@@ -945,7 +948,7 @@ class UtilsNeedService extends AppServiceBase {
}
urlSplit
(
url
)
{
var
arr
=
url
.
split
(
"?"
)
[
1
]
;
//根据?跟个url
var
arr
=
url
.
split
(
"?"
);
//根据?跟个url
var
arr2
=
arr
[
1
].
split
(
"&"
);
//根据&重新分割参数
var
jsonarr
=
{};
//定义一个json对象放置url 参数
for
(
var
i
=
0
;
i
<
arr2
.
length
;
i
++
)
{
//循环将参数放到json里面
...
...
@@ -1222,19 +1225,23 @@ class UtilsNeedService extends AppServiceBase {
var
businessLicenseArr
=
[];
if
(
extJson
.
idCardList
)
{
// 抽出数组
var
idCardListA
=
JSON
.
parse
(
extJson
.
idCardList
)
;
var
idCardListA
=
extJson
.
idCardList
;
var
idCardListArr
=
[];
for
(
var
i
=
0
;
i
<
idCardListA
.
leng
ht
;
i
++
)
{
for
(
var
i
=
0
;
i
<
idCardListA
.
leng
th
;
i
++
)
{
idCardListArr
.
push
(
await
this
.
opDownFileInfo
(
idCardListA
[
i
]));
}
}
for
(
var
i
=
0
;
i
<
extJson
.
businessLicense
.
leng
ht
;
i
++
)
{
for
(
var
i
=
0
;
i
<
extJson
.
businessLicense
.
leng
th
;
i
++
)
{
businessLicenseArr
.
push
(
await
this
.
opDownFileInfo
(
extJson
.
businessLicense
[
i
]));
}
actionBody
.
extInfo
=
{
businessLicenseArr
,
idCardListArr
}
// 2020 1020 lin 新增 因为下面receiveEdiStatusNotify ,JSON.parse(ab.extInfo);
// rejectReason需要转换 否则驳回理由处可能有问题
actionBody
.
extInfo
=
JSON
.
stringify
(
actionBody
.
extInfo
)
console
.
log
(
actionBody
.
extInfo
)
}
}
var
self
=
this
;
...
...
@@ -1265,16 +1272,20 @@ class UtilsNeedService extends AppServiceBase {
this
.
utilsPushSve
.
aliBusiness2Delivery
(
deliveryObj
,
"pushDeliveryOrder"
);
}
if
(
rtn
.
status
==
0
&&
actionBody
.
operationType
!=
"USER_PAY_PRODUCE"
&&
actionBody
.
operationType
!=
"USER_UPLOAD_PRODUCE"
&&
rtn
.
data
)
{
console
.
log
(
"pushDeliveryStatusNotify start ------"
)
var
tmpObj
=
{
actionBody
:
{
orderNo
:
rtn
.
data
.
o
rderNo
,
orderNo
:
rtn
.
data
.
channelO
rderNo
,
channelNeedNo
:
rtn
.
data
.
channelNeedNo
,
needsolution
:
rtn
.
data
.
solutionContent
},
appInfo
:
pobj
.
appInfo
}
console
.
log
(
tmpObj
)
this
.
utilsPushSve
.
aliBusiness2Delivery
(
tmpObj
,
"pushDeliveryStatusNotify"
);
var
res
=
await
this
.
utilsPushSve
.
aliBusiness2Delivery
(
tmpObj
,
"pushDeliveryStatusNotify"
);
console
.
log
(
"res"
)
console
.
log
(
res
);
console
.
log
(
"pushDeliveryStatusNotify end ------"
)
pobj
.
actionBody
.
orderNo
=
rtn
.
data
.
orderNo
;
if
(
actionBody
.
operationType
==
"ABC_CLOSE_PRODUCE"
)
{
var
orderrtn
=
await
self
.
utilsOrderSve
.
delOrder
(
pobj
,
pobj
.
actionBody
);
...
...
@@ -1450,4 +1461,8 @@ module.exports = UtilsNeedService;
// var a = new UtilsNeedService();
// a.test();
// var a = new UtilsNeedService();
// a.ediNotify(null, {
// operationType:'USER_UPLOAD_PRODUCE',
// extInfo:"{\"businessLicense\":[\"https://companyreg-wangwen.oss-cn-shanghai.aliyuncs.com/business_license/1219541161213057/1603184928383/xk8suu62qo.jpg?Expires=1603193934&OSSAccessKeyId=hObpgEXoca42qH3V&Signature=BtHNsjWCN0Eqp2OQWwim8J62eWA%3D&response-content-disposition=fileName%3D%E8%90%A5%E4%B8%9A%E6%89%A7%E7%85%A7%3B\"],\"idCardList\":[\"https://companyreg-wangwen.oss-cn-shanghai.aliyuncs.com/card/1219541161213057/1603184933494/0m5epfgzhg79.jpg?Expires=1603193934&OSSAccessKeyId=hObpgEXoca42qH3V&Signature=5w%2FhkZuJ%2BxR5J9nC4QzkhqcrKy4%3D&response-content-disposition=fileName%3D%E7%9B%B8%E5%85%B3%E4%BA%BA%E5%91%98%E8%BA%AB%E4%BB%BD%E8%AF%81%3B\"]}"
// })
center-channel/app/base/service/impl/utilsSve/utilsOrderSve.js
View file @
12090978
...
...
@@ -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
;
...
...
center-channel/app/base/utils/execClient.js
View file @
12090978
...
...
@@ -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 @
12090978
...
...
@@ -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/settings.js
View file @
12090978
...
...
@@ -228,6 +228,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
...
...
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