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
6206c124
Commit
6206c124
authored
May 18, 2020
by
zhaoxiqing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
dd8a7d55
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
78 additions
and
2 deletions
+78
-2
laowubao/app/base/api/impl/operator/laoActionApi.js
+15
-0
laowubao/app/base/db/impl/common/workloadDao.js
+27
-0
laowubao/app/base/service/impl/common/workloadSve.js
+36
-2
laowubao/package-lock.json
+0
-0
No files found.
laowubao/app/base/api/impl/operator/laoActionApi.js
View file @
6206c124
...
...
@@ -1489,6 +1489,21 @@ class LaoActionApi extends APIBase {
}
}
async
workLoadPage2
(
obj
)
{
// if (!obj.userId) {
// return system.getResult(null, "用户未登录");
// }
try
{
obj
.
status
=
1
;
var
rs
=
await
this
.
workloadSve
.
pageByCondition2
(
obj
);
return
system
.
getResultSuccess
(
rs
);
}
catch
(
e
)
{
console
.
log
(
e
);
return
system
.
getErrResult2
(
"您的网络不稳, 请稍后重试"
)
}
}
async
workLoadHistoryInfo
(
obj
)
{
if
(
!
obj
.
userId
)
{
return
system
.
getResult
(
null
,
"用户未登录"
);
...
...
laowubao/app/base/db/impl/common/workloadDao.js
View file @
6206c124
...
...
@@ -19,6 +19,27 @@ class WorkloadDao extends Dao {
return
rs
[
0
].
num
||
0
;
}
async
pagecount
(
params
){
var
sql
=
[];
sql
.
push
(
"SELECT COUNT(*) AS num FROM workload_info wi LEFT JOIN user_info ui ON wi.user_id = ui.id WHERE `status`=1"
);
this
.
setpage
(
sql
,
params
);
let
rs
=
await
this
.
customQuery
(
sql
.
join
(
" "
),
params
);
if
(
!
rs
||
rs
.
length
==
0
)
{
return
0
;
}
return
rs
[
0
].
num
||
0
;
}
async
pageList
(
params
){
var
sql
=
[];
sql
.
push
(
"SELECT wi.*,ui.com_name,ui.mtchId FROM workload_info wi LEFT JOIN user_info ui ON wi.user_id = ui.id WHERE `status`=1"
);
this
.
setpage
(
sql
,
params
);
sql
.
push
(
"ORDER BY wi.id DESC"
);
sql
.
push
(
"LIMIT :startRow, :pageSize"
);
return
await
this
.
customQuery
(
sql
.
join
(
" "
),
params
);
}
async
pageHistory
(
params
)
{
var
sql
=
[];
sql
.
push
(
"SELECT"
);
...
...
@@ -61,6 +82,12 @@ class WorkloadDao extends Dao {
sql
.
push
(
"AND id_nu = :id_nu"
);
}
}
setpage
(
sql
,
params
)
{
if
(
params
.
mtchId
)
{
sql
.
push
(
"AND ui.mtchId = :mtchId"
);
}
}
}
module
.
exports
=
WorkloadDao
;
laowubao/app/base/service/impl/common/workloadSve.js
View file @
6206c124
...
...
@@ -7,6 +7,7 @@ class WorkloadService extends ServiceBase {
constructor
()
{
super
(
"common"
,
ServiceBase
.
getDaoName
(
WorkloadService
));
this
.
restClient
=
system
.
getObject
(
"util.restClient"
);
this
.
usersSve
=
system
.
getObject
(
"service.operator.usersSve"
);
}
async
pageByCondition
(
params
)
{
...
...
@@ -47,6 +48,28 @@ class WorkloadService extends ServiceBase {
return
page
;
}
async
pageByCondition2
(
params
)
{
params
.
currentPage
=
Number
(
params
.
currentPage
||
1
);
params
.
pageSize
=
Number
(
params
.
pageSize
||
10
);
params
.
mtchId
=
this
.
trim
(
params
.
ecompanyId
);
let
total
=
await
this
.
dao
.
pagecount
(
params
);
if
(
total
==
0
)
{
return
{
count
:
0
,
rows
:
[]};
}
params
.
startRow
=
(
params
.
currentPage
-
1
)
*
params
.
pageSize
;
let
list
=
await
this
.
dao
.
pageList
(
params
);
if
(
list
)
{
for
(
var
item
of
list
)
{
this
.
handleDate
(
item
,
[
'created_time'
,
'updated_time'
],
'YYYY-MM-DD'
);
this
.
handleDate
(
item
,
[
'updated_at'
,
'created_at'
],
'YYYY-MM-DD HH:mm:ss'
);
}
}
return
{
count
:
total
,
rows
:
list
};
}
async
workloadConfirm
(
params
)
{
var
sql
=
[];
sql
.
push
(
"UPDATE"
);
...
...
@@ -155,6 +178,18 @@ class WorkloadService extends ServiceBase {
return
result
;
}
}
async
getcompany
(
works
){
var
user
=
await
this
.
usersSve
.
findById
(
works
.
user_id
)
if
(
user
){
works
.
userOne
=
{
tenant
:
user
.
com_name
,
id
:
user
.
id
,
};
}
}
}
module
.
exports
=
WorkloadService
;
\ No newline at end of file
module
.
exports
=
WorkloadService
;
laowubao/package-lock.json
View file @
6206c124
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