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
376523b0
Commit
376523b0
authored
Apr 08, 2021
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加日志
parent
230e90cf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
52 deletions
+61
-52
center-channel/app/base/db/models/common/gatewaypushlog.js
+1
-1
center-channel/app/base/service/impl/common/gatewaypushlogSve.js
+58
-49
center-channel/app/base/service/impl/common/signSve.js
+2
-2
No files found.
center-channel/app/base/db/models/common/gatewaypushlog.js
View file @
376523b0
...
@@ -10,7 +10,7 @@ module.exports = (db, DataTypes) => {
...
@@ -10,7 +10,7 @@ module.exports = (db, DataTypes) => {
pushActionType
:
DataTypes
.
STRING
,
//调用参数
pushActionType
:
DataTypes
.
STRING
,
//调用参数
pushtimes
:
DataTypes
.
INTEGER
,
//推送次数
pushtimes
:
DataTypes
.
INTEGER
,
//推送次数
pushStatus
:
DataTypes
.
STRING
,
//推送状态
pushStatus
:
DataTypes
.
STRING
,
//推送状态
error
:
DataTypes
.
STRING
,
//错误信息
error
:
DataTypes
.
STRING
(
5000
)
,
//错误信息
},
{
},
{
paranoid
:
false
,
//假的删除
paranoid
:
false
,
//假的删除
underscored
:
true
,
underscored
:
true
,
...
...
center-channel/app/base/service/impl/common/gatewaypushlogSve.js
View file @
376523b0
...
@@ -3,61 +3,70 @@ const ServiceBase = require("../../sve.base");
...
@@ -3,61 +3,70 @@ const ServiceBase = require("../../sve.base");
var
settings
=
require
(
"../../../../config/settings"
);
var
settings
=
require
(
"../../../../config/settings"
);
const
uuidv4
=
require
(
'uuid/v4'
);
const
uuidv4
=
require
(
'uuid/v4'
);
const
getRawBody
=
require
(
'raw-body'
);
const
getRawBody
=
require
(
'raw-body'
);
class
GatewaypushlogService
extends
ServiceBase
{
class
GatewaypushlogService
extends
ServiceBase
{
constructor
()
{
constructor
()
{
super
(
"common"
,
ServiceBase
.
getDaoName
(
GatewaypushlogService
));
super
(
"common"
,
ServiceBase
.
getDaoName
(
GatewaypushlogService
));
this
.
execClient
=
system
.
getObject
(
"util.execClient"
);
this
.
execClient
=
system
.
getObject
(
"util.execClient"
);
this
.
dingClient
=
system
.
getObject
(
"util.dingClient"
);
this
.
dingClient
=
system
.
getObject
(
"util.dingClient"
);
}
}
async
taskAliIcapi
()
{
async
taskAliIcapi
()
{
try
{
try
{
var
sql
=
"select * from gateway_pushlog where pushStatus='wts' and pushtimes<4"
var
sql
=
"select * from gateway_pushlog where pushStatus='wts' and pushtimes<4"
var
icloginfos
=
await
this
.
customQuery
(
sql
);
var
icloginfos
=
await
this
.
customQuery
(
sql
);
if
(
icloginfos
.
length
>
0
)
{
if
(
icloginfos
.
length
>
0
)
{
var
count
=
100
;
var
count
=
100
;
if
(
icloginfos
.
length
<
count
)
{
if
(
icloginfos
.
length
<
count
)
{
count
=
icloginfos
.
length
;
count
=
icloginfos
.
length
;
}
}
var
self
=
this
;
var
self
=
this
;
for
(
var
i
=
0
;
i
<
count
;
i
++
)
{
for
(
var
i
=
0
;
i
<
count
;
i
++
)
{
try
{
try
{
var
icloginfo
=
icloginfos
[
i
];
var
icloginfo
=
icloginfos
[
i
];
var
requestdata
=
null
;
var
requestdata
=
null
;
if
(
icloginfo
&&
icloginfo
.
requestjson
)
{
if
(
icloginfo
&&
icloginfo
.
requestjson
)
{
requestdata
=
JSON
.
parse
(
icloginfo
.
requestjson
);
requestdata
=
JSON
.
parse
(
icloginfo
.
requestjson
);
}
}
var
url
=
settings
.
gatewayUrl
()
+
"action/intentionapi/springBoard"
;
var
url
=
settings
.
gatewayUrl
()
+
"action/intentionapi/springBoard"
;
var
rtn
=
await
self
.
execClient
.
execPost
(
requestdata
,
url
);
var
rtn
=
await
self
.
execClient
.
execPost
(
requestdata
,
url
);
var
data
=
rtn
var
data
=
rtn
data
=
JSON
.
parse
(
rtn
.
stdout
);
data
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
data
.
success
)
{
if
(
data
.
success
)
{
icloginfo
.
pushStatus
=
"yts"
;
icloginfo
.
pushStatus
=
"yts"
;
}
else
{
}
else
{
if
(
data
.
errorMsg
!=
"状态错误"
)
{
//除1 2 4 11其它状态没处理、返回的状态错误
if
(
data
.
errorMsg
!=
"状态错误"
)
{
//除1 2 4 11其它状态没处理、返回的状态错误
data
.
push_url
=
url
data
.
push_url
=
url
;
data
.
api
=
"center-channel/taskAliIcapi"
data
.
api
=
"center-channel/taskAliIcapi-for"
;
this
.
dingClient
.
gatewayPushError
(
data
)
data
.
requestdata
=
requestdata
;
}
data
.
message
=
"error info"
;
icloginfo
.
pushtimes
+=
1
;
this
.
dingClient
.
gatewayPushError
(
data
);
}
icloginfo
.
error
=
JSON
.
stringify
(
data
);
icloginfo
.
pushtimes
+=
1
;
}
this
.
update
(
icloginfo
);
}
catch
(
e
)
{
const
stackStr
=
e
.
stack
?
e
.
stack
:
JSON
.
stringify
(
e
);
icloginfo
.
error
=
stackStr
;
this
.
update
(
icloginfo
);
this
.
dingClient
.
gatewayPushError
({
message
:
"Exception info"
,
api
:
"center-channel/taskAliIcapi-for"
,
e
})
}
}
}
}
this
.
update
(
icloginfo
);
return
system
.
getResultSuccess
();
}
catch
(
e
)
{
icloginfo
.
error
=
JSON
.
stringify
(
e
)
this
.
update
(
icloginfo
);
this
.
dingClient
.
gatewayPushError
({
message
:
"Exception"
,
api
:
"center-channel/taskAliIcapi"
,
e
})
}
}
}
return
system
.
getResultSuccess
();
}
catch
(
error
)
{
}
catch
(
error
)
{
this
.
dingClient
.
gatewayPushError
({
message
:
"Exception"
,
api
:
"center-channel/taskAliIcapi"
,
error
})
this
.
dingClient
.
gatewayPushError
({
message
:
"Exception"
,
api
:
"center-channel/taskAliIcapi"
,
error
})
return
system
.
getResultFail
(
-
1
,
error
);
return
system
.
getResultFail
(
-
1
,
error
);
}
}
}
}
}
}
module
.
exports
=
GatewaypushlogService
;
module
.
exports
=
GatewaypushlogService
;
center-channel/app/base/service/impl/common/signSve.js
View file @
376523b0
...
@@ -192,12 +192,12 @@ module.exports = SignService;
...
@@ -192,12 +192,12 @@ module.exports = SignService;
// };
// };
//需求
//需求
// var obj={
// var obj={
// "intentionBizId": "baidu_test_000
9
1",
// "intentionBizId": "baidu_test_000
10
1",
// "phone": "18506013355",
// "phone": "18506013355",
// "userName": "测试03",
// "userName": "测试03",
// "description": "测试03描述",
// "description": "测试03描述",
// "area": "上海",
// "area": "上海",
// "consultType": "
7
"
// "consultType": "
GSREG
"
// };
// };
// task.createSign(obj,"7cbb892450174167b5c7e01we4716t51").then(sign=>{
// task.createSign(obj,"7cbb892450174167b5c7e01we4716t51").then(sign=>{
// console.log(sign,"..............Sign");
// console.log(sign,"..............Sign");
...
...
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