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
63a48587
Commit
63a48587
authored
Mar 20, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
d4e976a6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
201 additions
and
0 deletions
+201
-0
xgg-saas-platform/app/base/controller/impl/saas/merchantCtl.js
+73
-0
xgg-saas-platform/app/base/service/impl/saas/channelSve.js
+6
-0
xgg-saas-platform/app/base/service/impl/saas/mainSve.js
+6
-0
xgg-saas-platform/app/base/service/impl/saas/merchantSve.js
+116
-0
xgg-saas-platform/app/front/entry/public/apidoc/saas/merchant.md
+0
-0
No files found.
xgg-saas-platform/app/base/controller/impl/saas/merchantCtl.js
0 → 100644
View file @
63a48587
var
system
=
require
(
"../../../system"
)
const
CtlBase
=
require
(
"../../ctlms.base"
);
class
MerchantCtl
extends
CtlBase
{
constructor
()
{
super
();
this
.
merchantSve
=
system
.
getObject
(
"service.saas.merchantSve"
);
}
async
dics
(
params
,
pobj2
,
req
)
{
try
{
return
await
this
.
merchantSve
.
dics
(
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
async
info
(
params
,
pobj2
,
req
)
{
try
{
return
await
this
.
merchantSve
.
info
(
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
async
page
(
params
,
pobj2
,
req
)
{
try
{
this
.
doTimeCondition
(
params
,
[
"createBegin"
,
"createEnd"
]);
return
await
this
.
merchantSve
.
page
(
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
async
signPage
(
params
,
pobj2
,
req
)
{
try
{
params
.
is_sign
=
1
;
this
.
doTimeCondition
(
params
,
[
"createBegin"
,
"createEnd"
]);
return
await
this
.
merchantSve
.
page
(
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
async
save
(
params
,
pobj2
,
req
)
{
try
{
return
await
this
.
merchantSve
.
save
(
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
async
sign
(
params
,
pobj2
,
req
)
{
try
{
params
.
bm_reg_price
=
system
.
y2f
(
params
.
bm_reg_price
||
0
);
params
.
invoice_service_rate
=
system
.
y2f
(
params
.
invoice_service_rate
||
0
);
params
.
trans_service_rate
=
system
.
y2f
(
params
.
trans_service_rate
||
0
);
return
await
this
.
merchantSve
.
sign
(
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
async
signInfo
(
params
,
pobj2
,
req
)
{
try
{
return
await
this
.
merchantSve
.
signInfo
(
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
}
module
.
exports
=
MerchantCtl
;
\ No newline at end of file
xgg-saas-platform/app/base/service/impl/saas/channelSve.js
View file @
63a48587
...
@@ -25,5 +25,10 @@ class ChannelService extends ServiceBase {
...
@@ -25,5 +25,10 @@ class ChannelService extends ServiceBase {
var
rs
=
await
this
.
callms
(
"merchant"
,
"channelInfo"
,
params
);
var
rs
=
await
this
.
callms
(
"merchant"
,
"channelInfo"
,
params
);
return
rs
;
return
rs
;
}
}
async
mapByIds
(
params
)
{
var
rs
=
await
this
.
callms
(
"merchant"
,
"channelMapByIds"
,
params
);
return
rs
;
}
}
}
module
.
exports
=
ChannelService
;
module
.
exports
=
ChannelService
;
\ No newline at end of file
xgg-saas-platform/app/base/service/impl/saas/mainSve.js
View file @
63a48587
...
@@ -25,5 +25,10 @@ class MainService extends ServiceBase {
...
@@ -25,5 +25,10 @@ class MainService extends ServiceBase {
var
rs
=
await
this
.
callms
(
"merchant"
,
"mainInfo"
,
params
);
var
rs
=
await
this
.
callms
(
"merchant"
,
"mainInfo"
,
params
);
return
rs
;
return
rs
;
}
}
async
mapByIds
(
params
)
{
var
rs
=
await
this
.
callms
(
"merchant"
,
"mainMapByIds"
,
params
);
return
rs
;
}
}
}
module
.
exports
=
MainService
;
module
.
exports
=
MainService
;
\ No newline at end of file
xgg-saas-platform/app/base/service/impl/saas/merchantSve.js
0 → 100644
View file @
63a48587
const
system
=
require
(
"../../../system"
);
const
ServiceBase
=
require
(
"../../svems.base"
)
const
settings
=
require
(
"../../../../config/settings"
)
class
MerchantService
extends
ServiceBase
{
constructor
()
{
super
();
this
.
channelSve
=
system
.
getObject
(
"service.saas.channelSve"
);
this
.
mainSve
=
system
.
getObject
(
"service.saas.mainSve"
);
}
async
mapByIds
(
params
)
{
var
rs
=
await
this
.
callms
(
"merchant"
,
"mchtMapByIds"
,
params
||
{});
return
rs
;
}
async
dics
(
params
)
{
var
rs
=
await
this
.
callms
(
"merchant"
,
"mchtDics"
,
params
);
return
rs
;
}
async
info
(
params
)
{
var
rs
=
await
this
.
callms
(
"merchant"
,
"mchtInfo"
,
params
);
if
(
rs
.
data
&&
rs
.
data
.
sign
)
{
this
.
transSignFields
([
rs
.
data
.
sign
]);
await
this
.
setChannel
([
rs
.
data
]);
}
return
rs
;
}
async
save
(
params
)
{
var
rs
=
await
this
.
callms
(
"merchant"
,
"mchtSave"
,
params
);
return
rs
;
}
async
page
(
params
)
{
var
rs
=
await
this
.
callms
(
"merchant"
,
"mchtPage"
,
params
);
if
(
rs
.
data
&&
rs
.
data
.
rows
)
{
this
.
transSignFields
(
rs
.
data
.
rows
);
await
this
.
setChannel
(
rs
.
data
.
rows
);
await
this
.
setMain
(
rs
.
data
.
rows
);
}
return
rs
;
}
async
sign
(
params
)
{
var
rs
=
await
this
.
callms
(
"merchant"
,
"mchtSign"
,
params
);
return
rs
;
}
async
signInfo
(
params
)
{
var
rs
=
await
this
.
callms
(
"merchant"
,
"mchtSignInfo"
,
params
);
if
(
rs
.
data
)
{
this
.
transSignFields
([
rs
.
data
]);
}
return
rs
;
}
async
setChannel
(
rows
)
{
if
(
!
rows
)
{
return
;
}
let
channelIds
=
[];
for
(
let
row
of
rows
)
{
if
(
row
.
channel_id
)
{
channelIds
.
push
(
row
.
channel_id
);
}
}
if
(
channelIds
.
length
==
0
)
{
return
;
}
let
map
=
await
this
.
channelSve
.
mapByIds
({
ids
:
channelIds
})
||
{};
map
=
map
.
data
||
{};
for
(
let
row
of
rows
)
{
row
.
channel
=
map
[
row
.
channel_id
]
||
{};
}
}
async
setMain
(
rows
)
{
if
(
!
rows
)
{
return
;
}
let
mainIds
=
[];
for
(
let
row
of
rows
)
{
if
(
row
.
main_id
)
{
mainIds
.
push
(
row
.
main_id
);
}
}
if
(
mainIds
.
length
==
0
)
{
return
;
}
let
map
=
await
this
.
mainSve
.
mapByIds
({
ids
:
mainIds
})
||
{};
map
=
map
.
data
||
{};
for
(
let
row
of
rows
)
{
row
.
main
=
map
[
row
.
main_id
]
||
{};
}
}
transSignFields
(
rows
)
{
if
(
!
rows
)
{
return
;
}
for
(
var
item
of
rows
)
{
if
(
!
item
)
{
continue
;
}
item
.
bm_reg_price
=
system
.
f2y
(
item
.
bm_reg_price
);
item
.
invoice_service_rate
=
system
.
f2y
(
item
.
invoice_service_rate
);
item
.
trans_service_rate
=
system
.
f2y
(
item
.
trans_service_rate
);
}
}
}
module
.
exports
=
MerchantService
;
\ No newline at end of file
xgg-saas-platform/app/front/entry/public/apidoc/saas/merchant.md
0 → 100644
View file @
63a48587
This diff is collapsed.
Click to expand it.
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