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
1b8c58bd
Commit
1b8c58bd
authored
May 21, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
7343bdf7
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
159 additions
and
9 deletions
+159
-9
xggsve-merchant/app/base/api/impl/op/action.js
+9
-8
xggsve-merchant/app/base/db/dao.base.js
+1
-1
xggsve-merchant/app/base/db/impl/merchant/saasmerchantconsumeDao.js
+76
-0
xggsve-merchant/app/base/db/models/merchant/saasmerchantconsume.js
+52
-0
xggsve-merchant/app/base/service/impl/merchant/saasmerchantconsumeSve.js
+21
-0
No files found.
xggsve-merchant/app/base/api/impl/op/action.js
View file @
1b8c58bd
...
...
@@ -11,13 +11,14 @@ class ActionAPI extends APIBase {
this
.
saasmerchantSve
=
system
.
getObject
(
"service.merchant.saasmerchantSve"
);
this
.
saasmerchanttitleSve
=
system
.
getObject
(
"service.merchant.saasmerchanttitleSve"
);
this
.
saasmerchantaddrSve
=
system
.
getObject
(
"service.merchant.saasmerchantaddrSve"
);
this
.
saasmerchantconsumeSve
=
system
.
getObject
(
"service.merchant.saasmerchantconsumeSve"
);
// -------------------------------将要弃用------------------------------------------
this
.
merchantSve
=
system
.
getObject
(
"service.merchant.merchantSve"
);
this
.
merchantsignedSve
=
system
.
getObject
(
"service.merchant.merchantsignedSve"
);
this
.
merchantaccountSve
=
system
.
getObject
(
"service.merchant.merchantaccountSve"
);
this
.
merchantrechargeSve
=
system
.
getObject
(
"service.merchant.merchantrechargeSve"
);
this
.
merchanttitleSve
=
system
.
getObject
(
"service.merchant.merchanttitleSve"
);
this
.
merchantaddressSve
=
system
.
getObject
(
"service.merchant.merchantaddressSve"
);
//
this.merchantSve = system.getObject("service.merchant.merchantSve");
//
this.merchantsignedSve = system.getObject("service.merchant.merchantsignedSve");
//
this.merchantaccountSve = system.getObject("service.merchant.merchantaccountSve");
//
this.merchantrechargeSve = system.getObject("service.merchant.merchantrechargeSve");
//
this.merchanttitleSve = system.getObject("service.merchant.merchanttitleSve");
//
this.merchantaddressSve = system.getObject("service.merchant.merchantaddressSve");
}
/**
* 接口跳转
...
...
@@ -126,8 +127,8 @@ class ActionAPI extends APIBase {
case
"mchtAddrs"
:
opResult
=
await
this
.
saasmerchantaddrSve
.
byMerchantId
(
action_body
);
break
;
case
"
mchtAddrSave
"
:
opResult
=
await
this
.
saasmerchant
addrSve
.
saveByMerchantId
(
action_body
);
case
"
addConsumeLog
"
:
opResult
=
await
this
.
saasmerchant
consumeSve
.
addLog
(
action_body
);
break
;
// ------------------------------以下api为历史将要弃用的---------------------------------------
// 商户api
...
...
xggsve-merchant/app/base/db/dao.base.js
View file @
1b8c58bd
...
...
@@ -10,7 +10,7 @@ class Dao {
}
async
preCreate
(
u
)
{
if
(
!
u
.
id
)
{
if
(
!
u
.
id
&&
!
u
.
autoIncrement
)
{
u
.
id
=
await
this
.
redisClient
.
genrateId
(
this
.
modelName
);
}
return
u
;
...
...
xggsve-merchant/app/base/db/impl/merchant/saasmerchantconsumeDao.js
0 → 100644
View file @
1b8c58bd
const
system
=
require
(
"../../../system"
);
const
Dao
=
require
(
"../../dao.base"
);
class
SaasmerchantConsumeDao
extends
Dao
{
constructor
()
{
super
(
Dao
.
getModelName
(
SaasmerchantConsumeDao
));
}
async
listByIds
(
ids
,
attrs
)
{
if
(
!
ids
||
ids
.
length
==
0
)
{
return
[];
}
attrs
=
attrs
||
"*"
;
let
sql
=
`SELECT
${
attrs
}
FROM
${
this
.
model
.
tableName
}
WHERE id IN (:ids) `
;
return
await
this
.
customQuery
(
sql
,
{
ids
:
ids
});
}
async
mapByIds
(
ids
,
attrs
)
{
let
result
=
{};
let
list
=
await
this
.
listByIds
(
ids
,
attrs
);
if
(
!
list
||
list
.
length
==
0
)
{
return
result
;
}
for
(
var
item
of
list
)
{
result
[
item
.
id
]
=
item
;
}
return
result
;
}
async
bySaasId
(
saasId
,
attrs
)
{
attrs
=
attrs
||
"*"
;
let
sql
=
`SELECT
${
attrs
}
FROM
${
this
.
model
.
tableName
}
WHERE saas_id = :saasId `
;
return
await
this
.
customQuery
(
sql
,
{
saasId
:
saasId
});
}
async
byChannelId
(
channelId
,
attrs
)
{
attrs
=
attrs
||
"*"
;
let
sql
=
`SELECT
${
attrs
}
FROM
${
this
.
model
.
tableName
}
WHERE channel_id = :channelId `
;
return
await
this
.
customQuery
(
sql
,
{
channelId
:
channelId
});
}
async
countByCondition
(
params
)
{
this
.
setCondition
();
return
0
;
}
async
listByCondition
(
params
)
{
params
.
startRow
=
Number
(
params
.
startRow
||
0
);
params
.
pageSize
=
Number
(
params
.
pageSize
||
10
);
this
.
setCondition
();
return
[];
}
setCondition
(
sql
,
params
)
{
if
(
!
params
||
!
sql
)
{
return
;
}
if
(
params
.
saas_id
)
{
sql
.
push
(
"AND saas_id = :saas_id"
);
}
if
(
params
.
saas_merchant_id
)
{
sql
.
push
(
"AND saas_merchant_id = :saas_merchant_id"
);
}
if
(
params
.
createBegin
)
{
sql
.
push
(
"AND created_at >= :createBegin"
);
}
if
(
params
.
createEnd
)
{
sql
.
push
(
"AND created_at <= :createEnd"
);
}
}
}
module
.
exports
=
SaasmerchantConsumeDao
;
xggsve-merchant/app/base/db/models/merchant/saasmerchantconsume.js
0 → 100644
View file @
1b8c58bd
const
system
=
require
(
"../../../system"
);
const
settings
=
require
(
"../../../../config/settings"
);
const
uiconfig
=
system
.
getUiConfig2
(
settings
.
appKey
);
module
.
exports
=
(
db
,
DataTypes
)
=>
{
return
db
.
define
(
"saasmerchantconsume"
,
{
saas_id
:
DataTypes
.
STRING
,
saas_merchant_id
:
DataTypes
.
STRING
,
consume_type
:
DataTypes
.
STRING
,
consume_id
:
DataTypes
.
STRING
,
result
:
DataTypes
.
STRING
,
},
{
paranoid
:
true
,
//假的删除
underscored
:
true
,
version
:
true
,
freezeTableName
:
true
,
//freezeTableName: true,
// define the table's name
tableName
:
'saas_merchant_consume'
,
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}]
// }
]
});
}
xggsve-merchant/app/base/service/impl/merchant/saasmerchantconsumeSve.js
0 → 100644
View file @
1b8c58bd
const
system
=
require
(
"../../../system"
);
const
ServiceBase
=
require
(
"../../sve.base"
)
const
settings
=
require
(
"../../../../config/settings"
)
class
SaasmerchantConsumeService
extends
ServiceBase
{
constructor
()
{
super
(
"merchant"
,
ServiceBase
.
getDaoName
(
SaasmerchantConsumeService
));
}
async
addLog
(
params
)
{
let
log
=
params
.
log
;
if
(
!
log
)
{
console
.
log
(
`商户日志插入错误,[
${
JSON
.
stringify
(
params
.
log
)}
]`
);
return
system
.
getResult
(
null
,
"log为空"
);
}
log
.
autoIncrement
=
true
;
let
rs
=
await
this
.
dao
.
create
(
log
);
return
system
.
getResultSuccess
(
rs
);
}
}
module
.
exports
=
SaasmerchantConsumeService
;
\ No newline at end of file
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