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
90560737
Commit
90560737
authored
Apr 03, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
7029e472
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
183 additions
and
0 deletions
+183
-0
xgg-saas-platform/app/base/controller/impl/trade/tradeCtl.js
+71
-0
xgg-saas-platform/app/base/service/impl/saas/merchantSve.js
+5
-0
xgg-saas-platform/app/base/service/impl/trade/tradeSve.js
+107
-0
xgg-saas-platform/app/base/system.js
+0
-0
xgg-saas-platform/app/front/entry/public/apidoc/saas/trade.md
+0
-0
No files found.
xgg-saas-platform/app/base/controller/impl/trade/tradeCtl.js
0 → 100644
View file @
90560737
var
system
=
require
(
"../../../system"
)
const
CtlBase
=
require
(
"../../ctlms.base"
);
class
TradeCtl
extends
CtlBase
{
constructor
()
{
super
();
this
.
tradeSve
=
system
.
getObject
(
"service.trade.tradeSve"
);
this
.
redisClient
=
system
.
getObject
(
"util.redisClient"
);
}
async
orderPage
(
params
,
pobj2
,
req
)
{
try
{
this
.
doTimeCondition
(
params
,
[
"createBegin"
,
"createEnd"
]);
return
await
this
.
tradeSve
.
orderPage
(
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
async
orderInfo
(
params
,
pobj2
,
req
)
{
try
{
return
await
this
.
tradeSve
.
orderInfo
(
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
async
itemPage
(
params
,
pobj2
,
req
)
{
try
{
this
.
doTimeCondition
(
params
,
[
"createBegin"
,
"createEnd"
]);
return
await
this
.
tradeSve
.
itemPage
(
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
async
audit1
(
params
,
pobj2
,
req
)
{
try
{
return
await
this
.
tradeSve
.
audit1
(
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
async
audit2
(
params
,
pobj2
,
req
)
{
try
{
return
await
this
.
tradeSve
.
audit2
(
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
async
trade
(
params
,
pobj2
,
req
)
{
try
{
return
await
this
.
tradeSve
.
trade
(
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
async
tradeFeedBack
(
params
,
pobj2
,
req
)
{
try
{
return
await
this
.
tradeSve
.
tradeFeedBack
(
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
}
module
.
exports
=
TradeCtl
;
\ No newline at end of file
xgg-saas-platform/app/base/service/impl/saas/merchantSve.js
View file @
90560737
...
...
@@ -8,6 +8,11 @@ class MerchantService extends ServiceBase {
this
.
mainSve
=
system
.
getObject
(
"service.saas.mainSve"
);
}
async
idsLikeName
(
params
)
{
var
rs
=
await
this
.
callms
(
"merchant"
,
"mchtIdsLikeName"
,
params
||
{});
return
rs
;
}
async
mapByIds
(
params
)
{
var
rs
=
await
this
.
callms
(
"merchant"
,
"mchtMapByIds"
,
params
||
{});
return
rs
;
...
...
xgg-saas-platform/app/base/service/impl/trade/tradeSve.js
0 → 100644
View file @
90560737
const
system
=
require
(
"../../../system"
);
const
ServiceBase
=
require
(
"../../svems.base"
);
const
settings
=
require
(
"../../../../config/settings"
);
class
TradeService
extends
ServiceBase
{
constructor
()
{
super
();
this
.
businessmenSve
=
system
.
getObject
(
"service.business.businessmenSve"
);
this
.
merchantSve
=
system
.
getObject
(
"service.saas.merchantSve"
);
this
.
redisClient
=
system
.
getObject
(
"util.redisClient"
);
}
async
orderPage
(
params
)
{
params
.
currentPage
=
Number
(
params
.
currentPage
||
1
);
params
.
pageSize
=
Number
(
params
.
pageSize
||
10
);
let
res
=
await
this
.
setMerchantIdsByName
(
params
);
if
(
res
.
status
!==
0
)
{
return
system
.
getResultSuccess
({
count
:
0
,
rows
:
[]});
}
let
rs
=
await
this
.
callms
(
"trade"
,
"orderPage"
,
params
)
||
{};
if
(
rs
.
data
&&
rs
.
data
.
rows
)
{
this
.
transFields
(
rs
.
data
.
rows
);
}
return
rs
;
}
async
orderInfo
(
params
)
{
let
rs
=
await
this
.
callms
(
"trade"
,
"orderInfo"
,
params
)
||
{};
let
order
=
rs
.
data
;
if
(
order
)
{
this
.
transFields
([
order
]);
let
merchant
=
await
this
.
merchantSve
.
info
({
id
:
order
.
saas_merchant_id
})
||
{};
merchant
=
merchant
.
data
||
{};
order
.
merchant_name
=
merchant
.
name
;
}
return
rs
;
}
async
setMerchantIdsByName
(
params
)
{
let
merchantName
=
this
.
trim
(
params
.
merchant_name
);
if
(
merchantName
)
{
let
merchantIds
=
await
this
.
merchantSve
.
idsLikeName
({
name
:
merchantName
,
saas_id
:
this
.
trim
(
params
.
saas_id
),
saas_merchant_id
:
this
.
trim
(
params
.
saas_merchant_id
),
})
||
{};
if
(
!
merchantIds
||
!
merchantIds
.
data
||
merchantIds
.
data
.
length
==
0
)
{
return
system
.
getResult
(
null
);
}
params
.
saas_merchant_ids
=
merchantIds
.
data
;
}
return
system
.
getResultSuccess
();
}
async
itemPage
(
params
)
{
params
=
params
||
{};
params
.
currentPage
=
Number
(
params
.
currentPage
||
1
);
params
.
pageSize
=
Number
(
params
.
pageSize
||
10
);
let
res
=
await
this
.
setMerchantIdsByName
(
params
);
if
(
res
.
status
!==
0
)
{
return
system
.
getResultSuccess
({
count
:
0
,
rows
:
[]});
}
let
rs
=
await
this
.
callms
(
"trade"
,
"itemPage"
,
params
)
||
{};
if
(
rs
.
data
&&
rs
.
data
.
rows
)
{
this
.
transFields
(
rs
.
data
.
rows
);
}
return
rs
;
}
async
audit1
(
params
)
{
let
rs
=
await
this
.
callms
(
"trade"
,
"orderAudit1"
,
params
)
||
{};
return
rs
;
}
async
audit2
(
params
)
{
let
rs
=
await
this
.
callms
(
"trade"
,
"orderAudit2"
,
params
)
||
{};
return
rs
;
}
async
trade
(
params
)
{
let
rs
=
await
this
.
callms
(
"trade"
,
"orderTrade"
,
params
)
||
{};
return
rs
;
}
async
tradeFeedBack
(
params
)
{
let
rs
=
await
this
.
callms
(
"trade"
,
"itemTradeOfflineCB"
,
params
)
||
{};
return
rs
;
}
transFields
(
rows
)
{
if
(
!
rows
||
rows
.
length
==
0
)
{
return
;
}
for
(
let
row
of
rows
)
{
row
.
amt
=
system
.
f2y
(
row
.
amt
);
row
.
actual_amt
=
system
.
f2y
(
row
.
actual_amt
);
row
.
deduct_amt
=
system
.
f2y
(
row
.
deduct_amt
);
row
.
service_tax
=
system
.
f2y
(
row
.
service_tax
);
row
.
service_rate
=
system
.
f2y
(
row
.
service_rate
);
}
}
}
module
.
exports
=
TradeService
;
\ No newline at end of file
xgg-saas-platform/app/base/system.js
View file @
90560737
This diff is collapsed.
Click to expand it.
xgg-saas-platform/app/front/entry/public/apidoc/saas/trade.md
0 → 100644
View file @
90560737
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