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
48fccf23
Commit
48fccf23
authored
Apr 03, 2020
by
王栋源
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wdy
parent
6c9c0c42
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
161 additions
and
1 deletions
+161
-1
center-channel/app/base/api/impl/auth/taskapi.js
+17
-0
center-channel/app/base/api/impl/opreceive/ic.js
+4
-0
center-channel/app/base/db/impl/common/gatewaypushlogDao.js
+8
-0
center-channel/app/base/db/models/common/gatewaypushlog.js
+58
-0
center-channel/app/base/service/impl/common/gatewaypushlogSve.js
+49
-0
center-channel/app/base/service/impl/utilsSve/utilsOrderSve.js
+17
-0
center-channel/app/config/routes/api.js
+1
-1
center-channel/app/config/settings.js
+7
-0
No files found.
center-channel/app/base/api/impl/auth/taskapi.js
0 → 100644
View file @
48fccf23
var
WEBBase
=
require
(
"../../web.base"
);
var
system
=
require
(
"../../../system"
);
class
AccessAuthAPI
extends
WEBBase
{
constructor
()
{
super
();
this
.
utilsAuthSve
=
system
.
getObject
(
"service.utilsSve.utilsAuthSve"
);
this
.
gatewaypushlogSve
=
system
.
getObject
(
"service.common.gatewaypushlogSve"
);
}
async
taskAliIcapi
(){
var
rtn
=
await
this
.
gatewaypushlogSve
.
taskAliIcapi
();
return
rtn
;
}
}
module
.
exports
=
AccessAuthAPI
;
\ No newline at end of file
center-channel/app/base/api/impl/opreceive/ic.js
View file @
48fccf23
...
...
@@ -5,6 +5,7 @@ class Ic extends APIBase {
constructor
()
{
super
();
this
.
centerorderSve
=
system
.
getObject
(
"service.common.centerorderSve"
);
this
.
utilsOrderSve
=
system
.
getObject
(
"service.utilsSve.utilsOrderSve"
);
}
/**
...
...
@@ -35,6 +36,9 @@ class Ic extends APIBase {
case
"paySuccess"
:
//支付回调
opResult
=
await
this
.
centerorderSve
.
paySuccess
(
pobj
);
break
;
case
"orderClose"
:
//阿里退款
opResult
=
await
this
.
utilsOrderSve
.
orderClose
(
pobj
);
break
;
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
break
;
...
...
center-channel/app/base/db/impl/common/gatewaypushlogDao.js
0 → 100644
View file @
48fccf23
const
system
=
require
(
"../../../system"
);
const
Dao
=
require
(
"../../dao.base"
);
class
GatewaypushlogDao
extends
Dao
{
constructor
(){
super
(
Dao
.
getModelName
(
GatewaypushlogDao
));
}
}
module
.
exports
=
GatewaypushlogDao
;
center-channel/app/base/db/models/common/gatewaypushlog.js
0 → 100644
View file @
48fccf23
const
system
=
require
(
"../../../system"
);
const
settings
=
require
(
"../../../../config/settings"
);
const
uiconfig
=
system
.
getUiConfig2
(
settings
.
appKey
);
module
.
exports
=
(
db
,
DataTypes
)
=>
{
return
db
.
define
(
"gatewaypushlog"
,
{
requestId
:
DataTypes
.
STRING
,
requestUrl
:
DataTypes
.
STRING
,
//请求地址
requestjson
:
DataTypes
.
STRING
,
//请求地址
pushUrl
:
DataTypes
.
STRING
,
//调用地址
pushActionType
:
DataTypes
.
STRING
,
//调用参数
pushtimes
:
DataTypes
.
INTEGER
,
//推送次数
pushStatus
:
DataTypes
.
STRING
,
//推送状态
},
{
paranoid
:
false
,
//假的删除
underscored
:
true
,
version
:
true
,
freezeTableName
:
true
,
timestamps
:
true
,
updatedAt
:
false
,
//freezeTableName: true,
// define the table's name
tableName
:
'gateway_pushlog'
,
validate
:
{
},
indexes
:
[
// Create a unique index on email
// {
// unique: true,
// fields: ['email']
// },
//
// // Creates a gin index on data with the jsonb_path_ops operator
// {
// fields: ['data'],
// using: 'gin',
// operator: 'jsonb_path_ops'
// },
//
// // By default index name will be [table]_[fields]
// // Creates a multi column partial index
// {
// name: 'public_by_author',
// fields: ['author', 'status'],
// where: {
// status: 'public'
// }
// },
//
// // A BTREE index with a ordered field
// {
// name: 'title_index',
// method: 'BTREE',
// fields: ['author', {attribute: 'title', collate: 'en_US', order: 'DESC', length: 5}]
// }
]
});
}
center-channel/app/base/service/impl/common/gatewaypushlogSve.js
0 → 100644
View file @
48fccf23
const
system
=
require
(
"../../../system"
);
const
ServiceBase
=
require
(
"../../sve.base"
);
var
settings
=
require
(
"../../../../config/settings"
);
const
uuidv4
=
require
(
'uuid/v4'
);
const
getRawBody
=
require
(
'raw-body'
);
class
GatewaypushlogService
extends
ServiceBase
{
constructor
()
{
super
(
"common"
,
ServiceBase
.
getDaoName
(
GatewaypushlogService
));
this
.
execClient
=
system
.
getObject
(
"util.execClient"
);
}
async
taskAliIcapi
()
{
try
{
var
sql
=
"select * from gateway_pushlog where pushStatus='wts' and pushtimes<4"
var
icloginfos
=
await
this
.
customQuery
(
sql
);
if
(
icloginfos
.
length
>
0
)
{
var
count
=
10
;
if
(
icloginfos
.
length
<
count
)
{
count
=
icloginfos
.
length
;
}
var
self
=
this
;
for
(
var
i
=
0
;
i
<
count
;
i
++
)
{
var
icloginfo
=
icloginfos
[
i
];
var
requestdata
=
null
;
if
(
icloginfo
&&
icloginfo
.
requestjson
)
{
requestdata
=
JSON
.
parse
(
icloginfo
.
requestjson
);
}
var
url
=
settings
.
gatewayUrl
()
+
"action/intentionapi/springBoard"
;
var
rtn
=
await
self
.
execClient
.
execPost
(
requestdata
,
url
);
var
data
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
data
.
success
)
{
icloginfo
.
pushStatus
=
"yts"
;
}
else
{
icloginfo
.
pushtimes
+=
1
;
}
await
this
.
update
(
icloginfo
);
}
}
return
system
.
getResultSuccess
();
}
catch
(
error
)
{
return
system
.
getResultFail
(
-
1
,
error
);
}
}
}
module
.
exports
=
GatewaypushlogService
;
center-channel/app/base/service/impl/utilsSve/utilsOrderSve.js
View file @
48fccf23
...
...
@@ -462,5 +462,22 @@ class UtilsOrderService extends AppServiceBase {
return
system
.
getResultFail
(
-
200
,
e
.
stack
);
}
}
async
orderClose
(
pobj
)
{
//阿里退款
if
(
!
pobj
.
actionBody
.
orderNo
)
{
return
system
.
getResult
(
null
,
"actionBody.prderNo can not be empty"
);
}
try
{
pobj
.
actionType
=
"channeldelOrder"
;
await
this
.
delOrder
(
pobj
,
pobj
.
actionBody
);
pobj
.
actionType
=
"updateStausByRefundOrder"
;
var
url
=
settings
.
centerOrderUrl
()
+
"action/icapi/springBoard"
;
await
this
.
execClient
.
execPost
(
pobj
,
url
);
return
system
.
getResultSuccess
();
}
catch
(
e
)
{
return
system
.
getResultFail
(
-
200
,
e
.
stack
);
}
}
}
module
.
exports
=
UtilsOrderService
;
center-channel/app/config/routes/api.js
View file @
48fccf23
...
...
@@ -211,7 +211,7 @@ module.exports = function (app) {
next
();
return
;
}
if
(
req
.
path
.
indexOf
(
"/taskapi/"
)
.
indexOf
>=
0
)
{
if
(
req
.
path
.
indexOf
(
"/taskapi/"
)
>=
0
)
{
next
();
return
;
}
...
...
center-channel/app/config/settings.js
View file @
48fccf23
...
...
@@ -55,6 +55,13 @@ var settings = {
return
"http://center-app-service/"
;
}
},
gatewayUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://192.168.0.106:4005"
;
}
else
{
return
"http://center-app-service"
;
}
},
centerOrderUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://centerapp.apps.com:4011/"
;
...
...
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