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
01952f14
Commit
01952f14
authored
Dec 27, 2020
by
Sxy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: redis缓存
parent
69f1a82c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
22 deletions
+27
-22
center-manage/app/base/service/impl/common/channelhandlers/ali.js
+6
-5
center-manage/app/base/service/impl/common/channelhandlers/baidu.js
+12
-9
center-manage/app/base/service/impl/common/channelhandlers/pannong.js
+2
-2
center-manage/app/base/service/impl/common/channelhandlers/zc360.js
+5
-4
center-manage/app/config/routes/api.js
+2
-2
No files found.
center-manage/app/base/service/impl/common/channelhandlers/ali.js
View file @
01952f14
...
@@ -67,7 +67,7 @@ class AliHandler {
...
@@ -67,7 +67,7 @@ class AliHandler {
var
j
=
JSON
.
parse
(
rtn
.
stdout
);
var
j
=
JSON
.
parse
(
rtn
.
stdout
);
console
.
log
(
JSON
.
stringify
(
j
),
"RRRRRRRRRRRRRRR"
);
console
.
log
(
JSON
.
stringify
(
j
),
"RRRRRRRRRRRRRRR"
);
if
(
j
.
status
==
1
)
{
if
(
j
.
status
==
1
)
{
await
this
.
cacheManager
[
"AliCache"
].
cache
(
cachestr
,
JSON
.
stringify
({
cachestr
:
cachestr
}),
180
000
);
//插入redis缓存
await
this
.
cacheManager
[
"AliCache"
].
cache
(
cachestr
,
JSON
.
stringify
({
cachestr
:
cachestr
}),
180
);
//插入redis缓存
}
}
return
j
;
return
j
;
}
}
...
@@ -122,7 +122,7 @@ class AliHandler {
...
@@ -122,7 +122,7 @@ class AliHandler {
var
j
=
JSON
.
parse
(
rtn
.
stdout
);
var
j
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
j
.
status
==
0
)
{
if
(
j
.
status
==
0
)
{
j
.
status
=
1
;
j
.
status
=
1
;
await
this
.
cacheManager
[
"AliCache"
].
cache
(
cachestr
,
JSON
.
stringify
({
cachestr
:
cachestr
}),
180
000
);
//插入redis缓存
await
this
.
cacheManager
[
"AliCache"
].
cache
(
cachestr
,
JSON
.
stringify
({
cachestr
:
cachestr
}),
180
);
//插入redis缓存
}
}
return
j
return
j
}
}
...
@@ -193,7 +193,7 @@ class AliHandler {
...
@@ -193,7 +193,7 @@ class AliHandler {
var
rtn
=
await
rc
.
execPost3
(
params
,
requrl
);
var
rtn
=
await
rc
.
execPost3
(
params
,
requrl
);
var
j
=
JSON
.
parse
(
rtn
.
stdout
);
var
j
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
j
.
status
==
0
)
{
if
(
j
.
status
==
0
)
{
await
this
.
cacheManager
[
"AliCache"
].
cache
(
cachestr
,
JSON
.
stringify
({
cachestr
:
cachestr
}),
180
000
);
//插入缓存
await
this
.
cacheManager
[
"AliCache"
].
cache
(
cachestr
,
JSON
.
stringify
({
cachestr
:
cachestr
}),
180
);
//插入缓存
//给业务员发信息
//给业务员发信息
var
selUrl
=
this
.
icUrl
+
"/schemeCtl/findInfoByDemandCode"
;
var
selUrl
=
this
.
icUrl
+
"/schemeCtl/findInfoByDemandCode"
;
...
@@ -288,6 +288,7 @@ class AliHandler {
...
@@ -288,6 +288,7 @@ class AliHandler {
if
(
datajson
.
actionBody
.
needsolution
.
status
&&
(
datajson
.
actionBody
.
needsolution
.
status
==
"PAID"
||
datajson
.
actionBody
.
needsolution
.
status
==
"USER_PAY_PRODUCE"
))
{
if
(
datajson
.
actionBody
.
needsolution
.
status
&&
(
datajson
.
actionBody
.
needsolution
.
status
==
"PAID"
||
datajson
.
actionBody
.
needsolution
.
status
==
"USER_PAY_PRODUCE"
))
{
//查询业务员信息并填充到obj
//查询业务员信息并填充到obj
if
(
datajson
.
actionBody
.
needsolution
.
salesmanInfo
.
salesmanChannelId
)
{
if
(
datajson
.
actionBody
.
needsolution
.
salesmanInfo
.
salesmanChannelId
)
{
obj
.
salesmanOpcode
=
`root10/bizgroup01/g1members/
${
datajson
.
actionBody
.
needsolution
.
salesmanInfo
.
salesmanChannelId
}
`
;
//去数据库查询该业务员信息
//去数据库查询该业务员信息
try
{
try
{
let
resInfo
=
await
this
.
userService
.
getSalesmanInfo
(
datajson
.
actionBody
.
needsolution
.
salesmanInfo
.
salesmanChannelId
);
let
resInfo
=
await
this
.
userService
.
getSalesmanInfo
(
datajson
.
actionBody
.
needsolution
.
salesmanInfo
.
salesmanChannelId
);
...
@@ -358,7 +359,7 @@ class AliHandler {
...
@@ -358,7 +359,7 @@ class AliHandler {
console
.
log
(
"pushOrderDelivery插入数据成功---------------------------------"
+
rtn
.
stdout
);
console
.
log
(
"pushOrderDelivery插入数据成功---------------------------------"
+
rtn
.
stdout
);
var
j
=
JSON
.
parse
(
rtn
.
stdout
);
var
j
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
j
.
status
==
0
)
{
if
(
j
.
status
==
0
)
{
await
this
.
cacheManager
[
"AliCache"
].
cache
(
cachestr
,
JSON
.
stringify
({
cachestr
:
cachestr
}),
180
000
);
await
this
.
cacheManager
[
"AliCache"
].
cache
(
cachestr
,
JSON
.
stringify
({
cachestr
:
cachestr
}),
180
);
j
.
status
=
1
;
j
.
status
=
1
;
}
}
return
j
return
j
...
@@ -410,7 +411,7 @@ class AliHandler {
...
@@ -410,7 +411,7 @@ class AliHandler {
var
rtn
=
await
rc
.
execPost3
(
params
,
requrl
);
var
rtn
=
await
rc
.
execPost3
(
params
,
requrl
);
var
j
=
JSON
.
parse
(
rtn
.
stdout
);
var
j
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
j
.
status
==
0
)
{
if
(
j
.
status
==
0
)
{
await
this
.
cacheManager
[
"AliCache"
].
cache
(
cachestr
,
JSON
.
stringify
({
cachestr
:
cachestr
}),
180
000
);
//插入缓存
await
this
.
cacheManager
[
"AliCache"
].
cache
(
cachestr
,
JSON
.
stringify
({
cachestr
:
cachestr
}),
180
);
//插入缓存
return
{
return
{
"status"
:
1
,
//1代表成功,否则失败
"status"
:
1
,
//1代表成功,否则失败
"msg"
:
""
,
"msg"
:
""
,
...
...
center-manage/app/base/service/impl/common/channelhandlers/baidu.js
View file @
01952f14
...
@@ -70,7 +70,7 @@ class BaiduHandler {
...
@@ -70,7 +70,7 @@ class BaiduHandler {
var
j
=
JSON
.
parse
(
rtn
.
stdout
);
var
j
=
JSON
.
parse
(
rtn
.
stdout
);
console
.
log
(
JSON
.
stringify
(
j
),
"RRRRRRRRRRRRRRR"
);
console
.
log
(
JSON
.
stringify
(
j
),
"RRRRRRRRRRRRRRR"
);
if
(
j
.
status
==
1
)
{
if
(
j
.
status
==
1
)
{
await
this
.
cacheManager
[
"AliCache"
].
cache
(
cachestr
,
JSON
.
stringify
({
cachestr
:
cachestr
}),
180
000
);
//插入redis缓存
await
this
.
cacheManager
[
"AliCache"
].
cache
(
cachestr
,
JSON
.
stringify
({
cachestr
:
cachestr
}),
180
);
//插入redis缓存
}
}
return
j
;
return
j
;
}
}
...
@@ -124,7 +124,7 @@ class BaiduHandler {
...
@@ -124,7 +124,7 @@ class BaiduHandler {
var
j
=
JSON
.
parse
(
rtn
.
stdout
);
var
j
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
j
.
status
==
0
)
{
if
(
j
.
status
==
0
)
{
j
.
status
=
1
;
j
.
status
=
1
;
await
this
.
cacheManager
[
"AliCache"
].
cache
(
cachestr
,
JSON
.
stringify
({
cachestr
:
cachestr
}),
180
000
);
//插入redis缓存
await
this
.
cacheManager
[
"AliCache"
].
cache
(
cachestr
,
JSON
.
stringify
({
cachestr
:
cachestr
}),
180
);
//插入redis缓存
}
}
return
j
return
j
}
}
...
@@ -158,10 +158,11 @@ class BaiduHandler {
...
@@ -158,10 +158,11 @@ class BaiduHandler {
obj
.
channelNumber
=
channelobj
.
code
;
obj
.
channelNumber
=
channelobj
.
code
;
//如果订单状态为已支付
//如果订单状态为已支付
if
(
datajson
.
actionBody
.
needsolution
.
status
&&
(
datajson
.
actionBody
.
needsolution
.
status
==
"PAID"
||
datajson
.
actionBody
.
needsolution
.
status
==
"USER_PAY_PRODUCE"
)
)
{
if
(
datajson
.
actionBody
.
needsolution
.
status
==
"PAID"
)
{
//查询业务员信息并填充到obj
//查询业务员信息并填充到obj
if
(
datajson
.
actionBody
.
needsolution
.
salesmanInfo
.
salesmanChannelId
)
{
if
(
datajson
.
actionBody
.
needsolution
.
salesmanInfo
.
salesmanChannelId
)
{
//去数据库查询该业务员信息
//去数据库查询该业务员信息
obj
.
salesmanOpcode
=
`root10/bizgroup01/g1members/
${
datajson
.
actionBody
.
needsolution
.
salesmanInfo
.
salesmanChannelId
}
`
;
try
{
try
{
let
resInfo
=
await
this
.
userService
.
getSalesmanInfo
(
datajson
.
actionBody
.
needsolution
.
salesmanInfo
.
salesmanChannelId
);
let
resInfo
=
await
this
.
userService
.
getSalesmanInfo
(
datajson
.
actionBody
.
needsolution
.
salesmanInfo
.
salesmanChannelId
);
if
(
resInfo
)
{
if
(
resInfo
)
{
...
@@ -170,7 +171,6 @@ class BaiduHandler {
...
@@ -170,7 +171,6 @@ class BaiduHandler {
obj
.
servicerCode
=
resInfo
.
company_id
;
obj
.
servicerCode
=
resInfo
.
company_id
;
}
}
}
catch
(
error
)
{
}
catch
(
error
)
{
obj
.
salesmanOpcode
=
`root10/bizgroup01/g1members/
${
datajson
.
actionBody
.
needsolution
.
salesmanInfo
.
salesmanChannelId
}
`
;
console
.
log
(
"salesmanChannelId: "
+
datajson
.
actionBody
.
needsolution
.
salesmanInfo
.
salesmanChannelId
+
"获取业务员opcode失败:"
+
error
)
console
.
log
(
"salesmanChannelId: "
+
datajson
.
actionBody
.
needsolution
.
salesmanInfo
.
salesmanChannelId
+
"获取业务员opcode失败:"
+
error
)
}
}
}
}
...
@@ -204,7 +204,7 @@ class BaiduHandler {
...
@@ -204,7 +204,7 @@ class BaiduHandler {
console
.
log
(
"pushOrderDelivery插入数据成功---------------------------------"
+
rtn
.
stdout
);
console
.
log
(
"pushOrderDelivery插入数据成功---------------------------------"
+
rtn
.
stdout
);
var
j
=
JSON
.
parse
(
rtn
.
stdout
);
var
j
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
j
.
status
==
0
)
{
if
(
j
.
status
==
0
)
{
await
this
.
cacheManager
[
"AliCache"
].
cache
(
cachestr
,
JSON
.
stringify
({
cachestr
:
cachestr
}),
180
000
);
await
this
.
cacheManager
[
"AliCache"
].
cache
(
cachestr
,
JSON
.
stringify
({
cachestr
:
cachestr
}),
180
);
j
.
status
=
1
;
j
.
status
=
1
;
}
}
return
j
return
j
...
@@ -245,7 +245,7 @@ class BaiduHandler {
...
@@ -245,7 +245,7 @@ class BaiduHandler {
var
rtn
=
await
rc
.
execPost3
(
params
,
requrl
);
var
rtn
=
await
rc
.
execPost3
(
params
,
requrl
);
var
j
=
JSON
.
parse
(
rtn
.
stdout
);
var
j
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
j
.
status
==
0
)
{
if
(
j
.
status
==
0
)
{
await
this
.
cacheManager
[
"AliCache"
].
cache
(
cachestr
,
JSON
.
stringify
({
cachestr
:
cachestr
}),
180
000
);
//插入缓存
await
this
.
cacheManager
[
"AliCache"
].
cache
(
cachestr
,
JSON
.
stringify
({
cachestr
:
cachestr
}),
180
);
//插入缓存
j
.
status
=
1
;
j
.
status
=
1
;
}
}
...
@@ -322,6 +322,9 @@ class BaiduHandler {
...
@@ -322,6 +322,9 @@ class BaiduHandler {
if
(
data
.
needsolution
.
bizType
==
"food"
)
{
if
(
data
.
needsolution
.
bizType
==
"food"
)
{
obj
.
businessType
=
"food"
;
obj
.
businessType
=
"food"
;
}
}
if
(
data
.
needsolution
.
bizType
==
"GSREG"
)
{
obj
.
businessType
=
"companyCase"
;
}
}
}
if
(
data
.
needsolution
.
typeName
)
{
//产品名称
if
(
data
.
needsolution
.
typeName
)
{
//产品名称
if
(
data
.
needsolution
.
typeName
==
"icp申请"
)
{
if
(
data
.
needsolution
.
typeName
==
"icp申请"
)
{
...
@@ -382,9 +385,9 @@ class BaiduHandler {
...
@@ -382,9 +385,9 @@ class BaiduHandler {
if
(
data
.
needsolution
.
customerInfo
.
publishMobile
)
{
//联系电话
if
(
data
.
needsolution
.
customerInfo
.
publishMobile
)
{
//联系电话
obj
.
baseInfo
.
contactsPhone
=
data
.
needsolution
.
customerInfo
.
publishMobile
;
obj
.
baseInfo
.
contactsPhone
=
data
.
needsolution
.
customerInfo
.
publishMobile
;
}
}
if
(
data
.
needsolution
.
customerRemark
)
{
//备注信息
}
obj
.
baseInfo
.
memoInfo
=
data
.
needsolution
.
customerRemark
;
if
(
data
.
needsolution
.
customerRemark
)
{
//备注信息
}
obj
.
baseInfo
.
memoInfo
=
data
.
needsolution
.
customerRemark
;
}
}
if
(
data
.
needsolution
.
customerMaterial
)
{
//客户上传所有材料
if
(
data
.
needsolution
.
customerMaterial
)
{
//客户上传所有材料
obj
.
baseInfo
.
customerMaterial
=
data
.
needsolution
.
customerMaterial
;
obj
.
baseInfo
.
customerMaterial
=
data
.
needsolution
.
customerMaterial
;
...
...
center-manage/app/base/service/impl/common/channelhandlers/pannong.js
View file @
01952f14
...
@@ -26,7 +26,7 @@ class PannongHandler {
...
@@ -26,7 +26,7 @@ class PannongHandler {
let
j
=
JSON
.
parse
(
rtn
.
stdout
);
let
j
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
j
.
status
==
0
)
{
if
(
j
.
status
==
0
)
{
j
.
status
=
1
;
j
.
status
=
1
;
await
this
.
cacheManager
[
"AliCache"
].
cache
(
cachestr
,
JSON
.
stringify
({
cachestr
:
cachestr
}),
180
000
);
//插入redis缓存
await
this
.
cacheManager
[
"AliCache"
].
cache
(
cachestr
,
JSON
.
stringify
({
cachestr
:
cachestr
}),
180
);
//插入redis缓存
j
.
status
=
1
;
j
.
status
=
1
;
}
}
return
j
;
return
j
;
...
@@ -56,7 +56,7 @@ class PannongHandler {
...
@@ -56,7 +56,7 @@ class PannongHandler {
let
j
=
JSON
.
parse
(
rtn
.
stdout
);
let
j
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
j
.
status
==
0
)
{
if
(
j
.
status
==
0
)
{
j
.
status
=
1
;
j
.
status
=
1
;
await
this
.
cacheManager
[
"AliCache"
].
cache
(
cachestr
,
JSON
.
stringify
({
cachestr
:
cachestr
}),
180
000
);
//插入redis缓存
await
this
.
cacheManager
[
"AliCache"
].
cache
(
cachestr
,
JSON
.
stringify
({
cachestr
:
cachestr
}),
180
);
//插入redis缓存
}
}
return
j
;
return
j
;
}
}
...
...
center-manage/app/base/service/impl/common/channelhandlers/zc360.js
View file @
01952f14
...
@@ -36,18 +36,19 @@ class Zc360Handler {
...
@@ -36,18 +36,19 @@ class Zc360Handler {
//如果订单状态为已支付
//如果订单状态为已支付
//查询业务员信息并填充到obj
//查询业务员信息并填充到obj
if
(
datajson
.
actionBody
.
needsolution
.
salesmanInfo
.
salesmanId
)
{
if
(
datajson
.
actionBody
.
needsolution
.
salesmanInfo
.
salesmanId
||
datajson
.
actionBody
.
needsolution
.
salesmanInfo
.
salesmanChannelId
)
{
let
userId
=
datajson
.
actionBody
.
needsolution
.
salesmanInfo
.
salesmanId
||
datajson
.
actionBody
.
needsolution
.
salesmanInfo
.
salesmanChannelId
;
obj
.
salesmanOpcode
=
`root10/bizgroup01/g1members/
${
userId
}
`
;
//去数据库查询该业务员信息
//去数据库查询该业务员信息
try
{
try
{
let
resInfo
=
await
this
.
userService
.
getSalesmanInfo
(
datajson
.
actionBody
.
needsolution
.
salesmanInfo
.
salesman
Id
);
let
resInfo
=
await
this
.
userService
.
getSalesmanInfo
(
user
Id
);
if
(
resInfo
)
{
if
(
resInfo
)
{
obj
.
salesmanOpcode
=
resInfo
.
opath
;
obj
.
salesmanOpcode
=
resInfo
.
opath
;
obj
.
salesmanName
=
obj
.
salesmanName
||
resInfo
.
nickName
;
obj
.
salesmanName
=
obj
.
salesmanName
||
resInfo
.
nickName
;
obj
.
servicerCode
=
resInfo
.
company_id
;
obj
.
servicerCode
=
resInfo
.
company_id
;
}
}
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
log
(
"salesmanId: "
+
datajson
.
actionBody
.
needsolution
.
salesmanInfo
.
salesmanId
+
"获取业务员opcode失败:"
+
error
)
console
.
log
(
"salesmanId: "
+
userId
+
"获取业务员opcode失败:"
+
error
)
obj
.
salesmanOpcode
=
`root10/bizgroup01/g1members/
${
datajson
.
actionBody
.
needsolution
.
salesmanInfo
.
salesmanId
}
`
;
}
}
}
}
...
...
center-manage/app/config/routes/api.js
View file @
01952f14
...
@@ -87,10 +87,10 @@ module.exports = function (app) {
...
@@ -87,10 +87,10 @@ module.exports = function (app) {
isAllocated
:
true
,
isAllocated
:
true
,
skilltags
:
[...
skilltags
].
join
()
skilltags
:
[...
skilltags
].
join
()
}
}
uf
=
await
userS
.
registerByTantent
(
reguser
)
uf
=
await
userS
.
registerByTantent
(
reguser
)
;
}
}
let
rtnobj
=
await
userS
.
loginApp
(
appkey
,
userName
);
let
rtnobj
=
await
userS
.
loginApp
(
appkey
,
userName
);
res
.
json
(
System
.
getResult
({
openurl
:
rtnobj
.
homePage
+
"?code="
+
rtnobj
.
code
}))
res
.
json
(
System
.
getResult
({
openurl
:
rtnobj
.
homePage
+
"?code="
+
rtnobj
.
code
}))
;
}
catch
(
e
)
{
}
catch
(
e
)
{
res
.
json
(
System
.
getResult
(
null
,
e
.
message
));
res
.
json
(
System
.
getResult
(
null
,
e
.
message
));
}
}
...
...
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