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
cc207ab9
Commit
cc207ab9
authored
Apr 01, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
dc324400
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
55 additions
and
12 deletions
+55
-12
xggsve-trade/app/base/api/impl/op/action.js
+3
-0
xggsve-trade/app/base/db/dao.base.js
+18
-1
xggsve-trade/app/base/service/impl/trade/storderSve.js
+32
-9
xggsve-trade/app/config/localsettings.js
+1
-1
xggsve-trade/app/config/settings.js
+1
-1
No files found.
xggsve-trade/app/base/api/impl/op/action.js
View file @
cc207ab9
...
...
@@ -37,6 +37,9 @@ class ActionAPI extends APIBase {
case
"test"
:
opResult
=
await
this
.
storderSve
.
test
(
action_body
);
break
;
case
"saveOrder"
:
opResult
=
await
this
.
storderSve
.
saveOrder
(
action_body
);
break
;
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
...
...
xggsve-trade/app/base/db/dao.base.js
View file @
cc207ab9
...
...
@@ -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
;
...
...
@@ -31,6 +31,23 @@ class Dao {
});
}
}
async
bulkCreate
(
objs
,
t
)
{
if
(
!
objs
||
objs
.
length
==
0
)
{
return
;
}
for
(
var
obj
of
objs
)
{
if
(
!
obj
.
id
&&
!
obj
.
autoIncrement
)
{
obj
.
id
=
await
this
.
redisClient
.
genrateId
(
this
.
modelName
);
}
}
if
(
t
)
{
return
await
this
.
model
.
bulkCreate
(
objs
,
{
transaction
:
t
});
}
else
{
return
await
this
.
model
.
bulkCreate
(
objs
);
}
}
static
getModelName
(
ClassObj
)
{
return
ClassObj
[
"name"
].
substring
(
0
,
ClassObj
[
"name"
].
lastIndexOf
(
"Dao"
)).
toLowerCase
()
}
...
...
xggsve-trade/app/base/service/impl/trade/storderSve.js
View file @
cc207ab9
...
...
@@ -3,9 +3,8 @@ const ServiceBase = require("../../sve.base")
class
StOrderService
extends
ServiceBase
{
constructor
()
{
super
(
"deliver"
,
ServiceBase
.
getDaoName
(
StOrderService
));
this
.
deliveruserDao
=
system
.
getObject
(
"db.deliver.deliveruserDao"
);
this
.
deliverorgDao
=
system
.
getObject
(
"db.deliver.deliverorgDao"
);
super
(
"trade"
,
ServiceBase
.
getDaoName
(
StOrderService
));
this
.
storderitemDao
=
system
.
getObject
(
"db.trade.storderitemDao"
);
}
async
test
(
params
)
{
...
...
@@ -39,10 +38,35 @@ class StOrderService extends ServiceBase {
return
system
.
getResultSuccess
(
page
);
}
// 保存打款信息
async
saveOrder
(
order
)
{
if
(
!
order
)
{
return
system
.
getResult
(
null
,
"订单不存在"
);
}
let
itemList
=
order
.
itemList
||
[];
if
(
itemList
.
length
==
0
)
{
return
system
.
getResult
(
null
,
"订单明细不存在"
);
}
let
self
=
this
;
order
=
await
this
.
db
.
transaction
(
async
t
=>
{
order
=
await
self
.
dao
.
create
(
order
,
t
);
for
(
let
item
of
itemList
)
{
item
.
order_id
=
order
.
id
;
item
.
saas_merchant_id
=
order
.
saas_merchant_id
;
item
.
out_trade_no
=
order
.
out_trade_no
;
item
.
saas_id
=
order
.
saas_id
;
item
.
trade_status
=
"01"
;
}
await
self
.
storderitemDao
.
bulkCreate
(
itemList
,
t
);
return
order
;
});
return
system
.
getResultSuccess
(
order
);
}
// 解析打款详情 excel
// 详情
...
...
@@ -61,17 +85,16 @@ class StOrderService extends ServiceBase {
// 交易列表页
async
page
(
params
)
{
let
currentPage
=
Number
(
params
.
currentPage
||
1
);
let
pageSize
=
Number
(
params
.
pageSize
||
10
);
let
where
=
{};
if
(
params
.
id
)
{
where
.
id
=
this
.
trim
(
params
.
id
);
if
(
params
.
id
)
{
where
.
id
=
this
.
trim
(
params
.
id
);
}
if
(
params
.
name
)
{
where
.
name
=
this
.
trim
(
params
.
name
);
if
(
params
.
name
)
{
where
.
name
=
this
.
trim
(
params
.
name
);
}
let
orderby
=
[
[
"id"
,
'desc'
]
...
...
xggsve-trade/app/config/localsettings.js
View file @
cc207ab9
...
...
@@ -6,7 +6,7 @@ var settings={
db
:
10
,
},
database
:{
dbname
:
"xgg-
common
"
,
dbname
:
"xgg-
trade
"
,
user
:
"write"
,
password
:
"write"
,
config
:
{
...
...
xggsve-trade/app/config/settings.js
View file @
cc207ab9
...
...
@@ -21,7 +21,7 @@ var settings = {
cacheprefix
:
"sjb"
,
usertimeout
:
3600
,
//单位秒
basepath
:
path
.
normalize
(
path
.
join
(
__dirname
,
'../..'
)),
port
:
process
.
env
.
NODE_PORT
||
310
2
,
port
:
process
.
env
.
NODE_PORT
||
310
7
,
defaultPassWord
:
"987456"
,
paasUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
...
...
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