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
a685f56f
Commit
a685f56f
authored
Aug 28, 2020
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
6aadfce9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
135 additions
and
81 deletions
+135
-81
center-channel/app/base/service/impl/trademark/icbcSve.js
+28
-8
center-channel/app/base/utils/redisClient.js
+42
-8
center-channel/app/config/localsettings.js
+1
-1
center-channel/app/config/routes/api.js
+64
-64
No files found.
center-channel/app/base/service/impl/trademark/icbcSve.js
View file @
a685f56f
...
@@ -7,6 +7,11 @@ class IcbcService extends AppServiceBase {
...
@@ -7,6 +7,11 @@ class IcbcService extends AppServiceBase {
super
();
super
();
this
.
zcApiUrl
=
settings
.
reqZcApi
();
this
.
zcApiUrl
=
settings
.
reqZcApi
();
this
.
certificationUrl
=
settings
.
certificationUrl
();
this
.
certificationUrl
=
settings
.
certificationUrl
();
this
.
restClient
=
system
.
getObject
(
"util.redisClient"
);
//处理企业资质证书数据
this
.
disposeCertificationData
=
"disposeCertificationData"
;
//企业资质证书查询
this
.
searchCertificationData
=
"searchCertificationData"
;
}
}
//企业模糊查询
//企业模糊查询
async
getCompanyListByVague
(
obj
,
req
)
{
async
getCompanyListByVague
(
obj
,
req
)
{
...
@@ -31,20 +36,35 @@ class IcbcService extends AppServiceBase {
...
@@ -31,20 +36,35 @@ class IcbcService extends AppServiceBase {
//企业证书查询
//企业证书查询
async
searchCertification
(
queryobj
,
req
)
{
async
searchCertification
(
queryobj
,
req
)
{
if
(
!
queryobj
.
companyName
){
if
(
!
queryobj
.
companyName
)
{
return
system
.
getResultFail
(
-
1
,
'companyName can not be empty'
);
return
system
.
getResultFail
(
-
1
,
'companyName can not be empty'
);
}
var
hashValue
=
await
this
.
restClient
.
hget
(
this
.
searchCertificationData
,
queryobj
.
companyName
);
if
(
hashValue
)
{
return
system
.
getResultSuccess
(
JSON
.
parse
(
hashValue
));
}
}
let
url
=
this
.
certificationUrl
+
"gsb/SearchCertification"
;
let
url
=
this
.
certificationUrl
+
"gsb/SearchCertification"
;
let
data
=
{
let
data
=
{
"company_name"
:
queryobj
.
companyName
,
"company_name"
:
queryobj
.
companyName
,
"pageSize"
:
20
,
"pageSize"
:
20
,
"pageIndex"
:
1
,
"pageIndex"
:
1
,
"isExactlySame"
:
"True"
"isExactlySame"
:
"True"
}
}
let
result
=
await
this
.
opReqResult
(
url
,
data
,
req
);
let
result
=
await
this
.
opReqResult
(
url
,
data
,
req
);
if
(
result
.
Status
!=
200
){
if
(
!
result
)
{
return
system
.
getResultFail
(
-
1
,
'查询失败'
);
return
system
.
getResultFail
(
-
1
,
'查询失败!!!'
);
}
if
(
result
.
Status
!=
200
)
{
return
system
.
getResultFail
(
-
1
,
'查询失败'
);
}
//对结果处理
// "Tag": 1为qichacha,0为gsb
var
setValue
=
{};
setValue
[
queryobj
.
companyName
]
=
JSON
.
stringify
(
result
.
Result
);
if
(
result
.
Tag
==
1
)
{
this
.
restClient
.
hmset
(
this
.
disposeCertificationData
,
setValue
);
}
}
this
.
restClient
.
hmset
(
this
.
searchCertificationData
,
setValue
);
return
system
.
getResult
(
result
.
Result
);
return
system
.
getResult
(
result
.
Result
);
}
}
...
...
center-channel/app/base/utils/redisClient.js
View file @
a685f56f
...
@@ -206,6 +206,7 @@ class RedisClient {
...
@@ -206,6 +206,7 @@ class RedisClient {
async
delete
(
key
)
{
async
delete
(
key
)
{
return
this
.
client
.
delAsync
(
key
);
return
this
.
client
.
delAsync
(
key
);
}
}
//设置hash表数据,jsonObj格式:{key:value}
async
hmset
(
key
,
jsonObj
)
{
async
hmset
(
key
,
jsonObj
)
{
return
this
.
client
.
hmsetAsync
(
key
,
jsonObj
);
return
this
.
client
.
hmsetAsync
(
key
,
jsonObj
);
}
}
...
@@ -217,6 +218,18 @@ class RedisClient {
...
@@ -217,6 +218,18 @@ class RedisClient {
async
hgetall
(
key
)
{
async
hgetall
(
key
)
{
return
this
.
client
.
hgetallAsync
(
key
);
return
this
.
client
.
hgetallAsync
(
key
);
}
}
//获取指定hash表的所有key
async
hkeys
(
key
)
{
return
this
.
client
.
hkeysAsync
(
key
);
}
//获取指定hash表的field对应的值
async
hget
(
key
,
field
)
{
return
this
.
client
.
hgetAsync
(
key
,
field
);
}
//删除指定hash表的字段
async
hdel
(
key
,
fields
)
{
return
this
.
client
.
hdelAsync
(
key
,
...
fields
);
}
async
hincrby
(
key
,
f
,
n
)
{
async
hincrby
(
key
,
f
,
n
)
{
return
this
.
client
.
hincrbyAsync
(
key
,
f
,
n
);
return
this
.
client
.
hincrbyAsync
(
key
,
f
,
n
);
}
}
...
@@ -245,13 +258,13 @@ class RedisClient {
...
@@ -245,13 +258,13 @@ class RedisClient {
}
}
}
}
module
.
exports
=
RedisClient
;
module
.
exports
=
RedisClient
;
// var client=
new RedisClient();
var
client
=
new
RedisClient
();
// (async ()
=>
{
// (async ()
=>
{
// await client.rpush("tasklist","xxx");
// await client.rpush("tasklist",
"xxx");
// await client.rpush("tasklist","xxx");
// await client.rpush("tasklist",
"xxx");
// var len
=
await client.llen("tasklist");
// var len
=
await client.llen("tasklist");
// //await client.clearlist("tasklist");
// //await client.clearlist("tasklist");
// len
=
await client.llen("tasklist");
// len
=
await client.llen("tasklist");
// console.log(len);
// console.log(len);
// })()
// })()
...
@@ -277,10 +290,31 @@ module.exports = RedisClient;
...
@@ -277,10 +290,31 @@ module.exports = RedisClient;
// r.get("hello").then(function(result){
// r.get("hello").then(function(result){
// console.log(result);
// console.log(result);
// });
// });
// client.hmset("user_1",{name:"jy",age:13}).then(function(r){
// client.hmset("user_1", { "北京汉唐科技": "hantang-sy", age: 1314 }).then(function (r) {
// console.log(r);
// });
// client.hmset("user_1", { "北京汉唐科技-test01": "hantang-sy-test01" }).then(function (r) {
// console.log(r);
// console.log(r);
//
// });
// client.hgetall("user_1").then(function (r) {
// console.log(r, "hgetall.................");
// });
// client.hkeys("user_19").then(function (r) {
// console.log(r, "hkeys.................");//没有值则为[]
// });
// client.hget("user_19", "北京汉唐科技").then(function (r) {
// console.log(r, "hget.................");//没有值则为null
// });
// client.hdel("user_1", ["age"]).then(function (r) {
// console.log(r, "hdel.................");//删除成功为1,否则删除失败
// });
// });
// client.hincrby("user_1","age",2).then(function(r){
// client.hincrby("user_1","age",2).then(function(r){
// console.log(r);
// console.log(r);
// setTimeout(function(){
// setTimeout(function(){
...
...
center-channel/app/config/localsettings.js
View file @
a685f56f
...
@@ -3,7 +3,7 @@ var settings = {
...
@@ -3,7 +3,7 @@ var settings = {
host
:
"43.247.184.32"
,
host
:
"43.247.184.32"
,
port
:
8967
,
port
:
8967
,
password
:
"Gongsibao2018"
,
password
:
"Gongsibao2018"
,
db
:
8
,
db
:
5
,
},
},
database
:
{
database
:
{
dbname
:
"igirl_api"
,
dbname
:
"igirl_api"
,
...
...
center-channel/app/config/routes/api.js
View file @
a685f56f
...
@@ -139,67 +139,67 @@ module.exports = function (app) {
...
@@ -139,67 +139,67 @@ module.exports = function (app) {
}
}
});
});
//----------------------飞书小程序---------------------------------------------结束
//----------------------飞书小程序---------------------------------------------结束
// app-ali支付回调通知
// app-ali支付回调通知
app
.
use
(
'/orderNotify/aliPayNotify'
,
async
function
(
req
,
res
)
{
app
.
use
(
'/orderNotify/aliPayNotify'
,
async
function
(
req
,
res
)
{
try
{
try
{
var
client_ip
=
system
.
get_client_ip
(
req
);
var
client_ip
=
system
.
get_client_ip
(
req
);
var
result
=
await
utilsOrderSve
.
aliPayNotify
(
req
.
body
,
client_ip
);
var
result
=
await
utilsOrderSve
.
aliPayNotify
(
req
.
body
,
client_ip
);
logCtl
.
info
({
logCtl
.
info
({
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"记录支付宝回调处理结果 api层"
,
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"记录支付宝回调处理结果 api层"
,
op
:
"center-channel/orderNotify/aliPayNotify"
,
op
:
"center-channel/orderNotify/aliPayNotify"
,
content
:
"支付回调处理结果:"
+
JSON
.
stringify
(
result
),
content
:
"支付回调处理结果:"
+
JSON
.
stringify
(
result
),
clientIp
:
client_ip
||
""
clientIp
:
client_ip
||
""
});
});
if
(
result
.
status
!=
0
)
{
if
(
result
.
status
!=
0
)
{
return
res
.
end
(
"FAIL"
);
return
res
.
end
(
"FAIL"
);
}
}
return
res
.
end
(
"success"
);
return
res
.
end
(
"success"
);
}
catch
(
e
)
{
}
catch
(
e
)
{
logCtl
.
error
({
logCtl
.
error
({
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"支付宝回调处理异常 api层"
,
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"支付宝回调处理异常 api层"
,
op
:
"center-channel/orderNotify/aliPayNotify"
,
op
:
"center-channel/orderNotify/aliPayNotify"
,
content
:
"回调参数:req="
+
JSON
.
stringify
(
req
)
+
"error:"
+
e
.
stack
,
content
:
"回调参数:req="
+
JSON
.
stringify
(
req
)
+
"error:"
+
e
.
stack
,
clientIp
:
client_ip
||
""
clientIp
:
client_ip
||
""
});
});
}
}
});
});
// app-wx支付回调
// app-wx支付回调
app
.
use
(
'/orderNotify/wxPayNotify'
,
async
function
(
req
,
res
)
{
app
.
use
(
'/orderNotify/wxPayNotify'
,
async
function
(
req
,
res
)
{
try
{
try
{
var
body
=
""
;
var
body
=
""
;
req
.
on
(
'data'
,
function
(
data
)
{
req
.
on
(
'data'
,
function
(
data
)
{
body
+=
data
;
body
+=
data
;
});
});
req
.
on
(
'end'
,
async
function
()
{
req
.
on
(
'end'
,
async
function
()
{
xml2js
.
parseString
(
body
,
{
trim
:
true
,
explicitArray
:
false
,
explicitRoot
:
false
},
async
function
(
err
,
json
)
{
xml2js
.
parseString
(
body
,
{
trim
:
true
,
explicitArray
:
false
,
explicitRoot
:
false
},
async
function
(
err
,
json
)
{
var
client_ip
=
system
.
get_client_ip
(
req
);
var
client_ip
=
system
.
get_client_ip
(
req
);
var
result
=
await
utilsOrderSve
.
wxPayNotify
(
json
);
var
result
=
await
utilsOrderSve
.
wxPayNotify
(
json
);
logCtl
.
info
({
logCtl
.
info
({
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"记录微信支付回调处理结果"
,
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"记录微信支付回调处理结果"
,
op
:
"center-channel/orderNotify/wxPayNotify"
,
op
:
"center-channel/orderNotify/wxPayNotify"
,
content
:
"支付回调处理结果:"
+
JSON
.
stringify
(
result
),
content
:
"支付回调处理结果:"
+
JSON
.
stringify
(
result
),
clientIp
:
client_ip
||
""
clientIp
:
client_ip
||
""
});
});
if
(
result
.
status
!=
0
)
{
if
(
result
.
status
!=
0
)
{
return
res
.
end
(
"FAIL"
);
return
res
.
end
(
"FAIL"
);
}
}
return
res
.
end
(
"success"
);
return
res
.
end
(
"success"
);
})
})
})
})
}
catch
(
e
)
{
}
catch
(
e
)
{
logCtl
.
error
({
logCtl
.
error
({
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"微信回调处理异常"
,
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"微信回调处理异常"
,
op
:
"center-channel/orderNotify/wxPayNotify"
,
op
:
"center-channel/orderNotify/wxPayNotify"
,
content
:
"回调参数:req="
+
JSON
.
stringify
(
req
)
+
"error:"
+
e
.
stack
,
content
:
"回调参数:req="
+
JSON
.
stringify
(
req
)
+
"error:"
+
e
.
stack
,
clientIp
:
client_ip
||
""
clientIp
:
client_ip
||
""
});
});
}
}
});
});
app
.
all
(
"/web/*"
,
async
function
(
req
,
res
,
next
)
{
app
.
all
(
"/web/*"
,
async
function
(
req
,
res
,
next
)
{
var
result
=
system
.
getResult
(
null
,
"req method must is post"
);
var
result
=
system
.
getResult
(
null
,
"req method must is post"
);
if
(
req
.
method
!=
"POST"
)
{
if
(
req
.
method
!=
"POST"
)
{
...
@@ -210,9 +210,9 @@ module.exports = function (app) {
...
@@ -210,9 +210,9 @@ module.exports = function (app) {
result
.
msg
=
"actionType can not be empty"
;
result
.
msg
=
"actionType can not be empty"
;
res
.
end
(
JSON
.
stringify
(
result
));
res
.
end
(
JSON
.
stringify
(
result
));
return
;
return
;
}
}
// 2020 0812 lin 只去掉了check,因为要记录智能诊断的返回值,其他接口暂时未去掉
// 2020 0812 lin 只去掉了check,因为要记录智能诊断的返回值,其他接口暂时未去掉
if
([
"getAppTokenByHosts"
,
"getAppTokenByAppKey"
,
"test"
,
"getIndustries"
,
"getSecondIndustries"
,
"getQualificationByIndustry"
,
"counselling"
].
indexOf
(
req
.
body
.
actionType
)
>=
0
)
{
if
([
"getAppTokenByHosts"
,
"getAppTokenByAppKey"
,
"test"
,
"getIndustries"
,
"getSecondIndustries"
,
"getQualificationByIndustry"
,
"counselling"
].
indexOf
(
req
.
body
.
actionType
)
>=
0
)
{
req
.
body
.
actionBody
.
appHosts
=
req
.
host
;
req
.
body
.
actionBody
.
appHosts
=
req
.
host
;
next
();
next
();
return
;
return
;
...
@@ -229,26 +229,26 @@ module.exports = function (app) {
...
@@ -229,26 +229,26 @@ module.exports = function (app) {
res
.
end
(
JSON
.
stringify
(
result
));
res
.
end
(
JSON
.
stringify
(
result
));
return
;
return
;
}
}
var
cacheManager
=
system
.
getObject
(
"db.common.cacheManager"
);
var
cacheManager
=
system
.
getObject
(
"db.common.cacheManager"
);
var
result
=
await
cacheManager
[
"AppTokenByHostsCache"
].
getCache
(
token
,
system
.
exTime
);
var
result
=
await
cacheManager
[
"AppTokenByHostsCache"
].
getCache
(
token
,
system
.
exTime
);
if
(
result
.
status
!=
0
)
{
if
(
result
.
status
!=
0
)
{
res
.
end
(
JSON
.
stringify
(
result
));
res
.
end
(
JSON
.
stringify
(
result
));
return
;
return
;
}
}
req
.
body
.
appInfo
=
result
.
data
;
req
.
body
.
appInfo
=
result
.
data
;
req
.
body
.
actionProcess
=
result
.
data
.
app_code
;
req
.
body
.
actionProcess
=
result
.
data
.
app_code
;
var
lst
=
[
"serviceProviderSubmitMaterial"
,
"closeOrderDelivery"
,
"serviceProviderNotification"
,
var
lst
=
[
"serviceProviderSubmitMaterial"
,
"closeOrderDelivery"
,
"serviceProviderNotification"
,
"tmConfirm"
,
"getNeedSolutionDetailByUser"
,
"getProgrammeInfoByChannelNeedNo"
,
"tmConfirm"
,
"getNeedSolutionDetailByUser"
,
"getProgrammeInfoByChannelNeedNo"
,
"submitIcpProgramme"
,
"submitIcpMaterial"
,
"acceptIcpPartnerNotification"
,
"abolishIcpProgramme"
,
"submitIcpProgramme"
,
"submitIcpMaterial"
,
"acceptIcpPartnerNotification"
,
"abolishIcpProgramme"
,
"addOrder"
,
"getH5PayUrl"
,
"getOrderQrCode"
,
"queryOrderStatus"
,
"getOrderInfo"
,
"getOrderDeliveryInfo"
,
"getOrderDetails"
,
"addOrder"
,
"getH5PayUrl"
,
"getOrderQrCode"
,
"queryOrderStatus"
,
"getOrderInfo"
,
"getOrderDeliveryInfo"
,
"getOrderDetails"
,
"getOrderDeliveryFlowInfo"
,
"getOrderDeliveryFlowList"
,
"getOrderLogInfo"
,
"updateContacts"
,
"updateTmOrder"
,
"delOrder"
,
"getOrderDeliveryFlowInfo"
,
"getOrderDeliveryFlowList"
,
"getOrderLogInfo"
,
"updateContacts"
,
"updateTmOrder"
,
"delOrder"
,
"submitProgramme"
,
"getProgrammeListByUser"
,
"getProgrammeInfoByNeedNo"
,
"abolishProgramme"
,
"getAliPayInfo"
,
"submitProgramme"
,
"getProgrammeListByUser"
,
"getProgrammeInfoByNeedNo"
,
"abolishProgramme"
,
"getAliPayInfo"
,
"getPaidLogoListByUser"
,
"getCollectibleLogoListByUser"
,
"collectLogo"
,
"getLogoMaterial"
,
"cancelCollectLogo"
,
"icpNotify"
,
"createName"
,
"getNameDetail"
,
"orderConfirm"
,
"getPaidLogoListByUser"
,
"getCollectibleLogoListByUser"
,
"collectLogo"
,
"getLogoMaterial"
,
"cancelCollectLogo"
,
"icpNotify"
,
"createName"
,
"getNameDetail"
,
"orderConfirm"
,
"orderTotalSum"
,
"collect"
,
"reg"
,
"orderCheck"
,
"getReOrderList"
,
"getOfficalList"
,
"addReviewList"
,
"opSubmitNeed"
,
"opNeedClose"
,
"opNeedList"
,
"getItemByNeedNo"
,
"opNeedDetailByChannelNo"
,
"orderTotalSum"
,
"collect"
,
"reg"
,
"orderCheck"
,
"getReOrderList"
,
"getOfficalList"
,
"addReviewList"
,
"opSubmitNeed"
,
"opNeedClose"
,
"opNeedList"
,
"getItemByNeedNo"
,
"opNeedDetailByChannelNo"
,
"getNeedListUser"
,
"getNeedListUser"
,
"manualEvaluation"
,
"diagnosisInfo"
,
"check"
,
"enterpriseInfo"
,
"diagnosisDetail"
,
"manualEvaluation"
,
"diagnosisInfo"
,
"check"
,
"enterpriseInfo"
,
"diagnosisDetail"
,
"submitIcpIntention"
,
"queryIntentionList"
,
"confirmIcpIntention"
,
"submitIcpIntention"
,
"queryIntentionList"
,
"confirmIcpIntention"
,
"tmAccept"
,
"tmRefuse"
,
"tmStatus"
"tmAccept"
,
"tmRefuse"
,
"tmStatus"
];
];
if
(
lst
.
indexOf
(
req
.
body
.
actionType
)
>=
0
)
{
if
(
lst
.
indexOf
(
req
.
body
.
actionType
)
>=
0
)
{
var
userpin
=
req
.
headers
[
"userpin"
]
||
""
;
var
userpin
=
req
.
headers
[
"userpin"
]
||
""
;
...
@@ -372,7 +372,7 @@ module.exports = function (app) {
...
@@ -372,7 +372,7 @@ module.exports = function (app) {
req
.
body
.
appInfo
=
result
.
data
;
req
.
body
.
appInfo
=
result
.
data
;
req
.
body
.
actionProcess
=
result
.
data
.
app_code
;
req
.
body
.
actionProcess
=
result
.
data
.
app_code
;
var
lst
=
[
var
lst
=
[
"submitNeed"
,
"paySuccess"
,
"icpNotify"
"submitNeed"
,
"paySuccess"
,
"icpNotify"
];
];
if
(
lst
.
indexOf
(
req
.
body
.
actionType
)
>=
0
)
{
if
(
lst
.
indexOf
(
req
.
body
.
actionType
)
>=
0
)
{
var
userpin
=
req
.
headers
[
"userpin"
]
||
""
;
var
userpin
=
req
.
headers
[
"userpin"
]
||
""
;
...
...
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