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
b0daf055
Commit
b0daf055
authored
Jun 10, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
24e4f652
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
1 deletions
+33
-1
laowubao/app/base/api/impl/operator/laoActionApi.js
+24
-1
laowubao/app/base/db/impl/common/workloadDao.js
+5
-0
laowubao/app/base/service/impl/common/workloadSve.js
+4
-0
No files found.
laowubao/app/base/api/impl/operator/laoActionApi.js
View file @
b0daf055
...
@@ -89,7 +89,7 @@ class LaoActionApi extends APIBase {
...
@@ -89,7 +89,7 @@ class LaoActionApi extends APIBase {
}
}
async
testUrl
(
pobj
)
{
async
testUrl
(
pobj
)
{
let
j
=
{
userName
:
"1
111"
,
companyName
:
"123"
,
mchtId
:
"1250717023940415489
"
};
let
j
=
{
userName
:
"1
8817222007"
,
companyName
:
"测试商户1(待删除)"
,
mchtId
:
"1103667243432067073
"
};
let
str
=
JSON
.
stringify
(
j
);
let
str
=
JSON
.
stringify
(
j
);
console
.
log
(
"str: "
+
str
);
console
.
log
(
"str: "
+
str
);
console
.
log
(
"str object: "
+
JSON
.
parse
(
str
));
console
.
log
(
"str object: "
+
JSON
.
parse
(
str
));
...
@@ -1491,6 +1491,29 @@ class LaoActionApi extends APIBase {
...
@@ -1491,6 +1491,29 @@ class LaoActionApi extends APIBase {
}
}
}
}
async
workloadDel
(
obj
)
{
try
{
if
(
!
obj
.
userId
)
{
return
system
.
getResult
(
null
,
"用户未登录"
);
}
let
workload
=
await
this
.
workloadSve
.
findById
(
obj
.
id
);
if
(
!
workload
)
{
return
system
.
getResultSuccess
();
}
if
(
obj
.
userId
!=
workload
.
user_id
)
{
return
system
.
getResult
(
null
,
"删除失败"
);
}
if
(
workload
.
status
)
{
return
system
.
getResult
(
null
,
"工作量已确认,不允许删除"
);
}
let
rs
=
await
this
.
workloadSve
.
delById
(
obj
.
id
);
return
system
.
getResultSuccess
(
rs
);
}
catch
(
e
)
{
console
.
log
(
e
);
return
system
.
getErrResult2
(
"您的网络不稳, 请稍后重试"
)
}
}
async
workLoadPage2
(
obj
)
{
async
workLoadPage2
(
obj
)
{
// if (!obj.userId) {
// if (!obj.userId) {
// return system.getResult(null, "用户未登录");
// return system.getResult(null, "用户未登录");
...
...
laowubao/app/base/db/impl/common/workloadDao.js
View file @
b0daf055
...
@@ -6,6 +6,11 @@ class WorkloadDao extends Dao {
...
@@ -6,6 +6,11 @@ class WorkloadDao extends Dao {
super
(
Dao
.
getModelName
(
WorkloadDao
));
super
(
Dao
.
getModelName
(
WorkloadDao
));
}
}
async
delById
(
id
)
{
let
sql
=
`DELETE FROM workload_info WHERE id = :id AND status = 0`
;
return
await
this
.
customUpdate
(
sql
,
{
id
:
id
});
}
async
countHistory
(
params
)
{
async
countHistory
(
params
)
{
var
sql
=
[];
var
sql
=
[];
sql
.
push
(
"SELECT COUNT(DISTINCT(id_nu)) AS num FROM `workload_info` WHERE status = 1"
);
sql
.
push
(
"SELECT COUNT(DISTINCT(id_nu)) AS num FROM `workload_info` WHERE status = 1"
);
...
...
laowubao/app/base/service/impl/common/workloadSve.js
View file @
b0daf055
...
@@ -10,6 +10,10 @@ class WorkloadService extends ServiceBase {
...
@@ -10,6 +10,10 @@ class WorkloadService extends ServiceBase {
this
.
usersSve
=
system
.
getObject
(
"service.operator.usersSve"
);
this
.
usersSve
=
system
.
getObject
(
"service.operator.usersSve"
);
}
}
async
delById
(
id
)
{
return
await
this
.
dao
.
delById
(
id
);
}
async
pageByCondition
(
params
)
{
async
pageByCondition
(
params
)
{
var
currentPage
=
Number
(
params
.
currentPage
||
1
);
var
currentPage
=
Number
(
params
.
currentPage
||
1
);
var
pageSize
=
Number
(
params
.
pageSize
||
10
);
var
pageSize
=
Number
(
params
.
pageSize
||
10
);
...
...
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