Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
peizhen-java
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
PeiZhen-Java
peizhen-java
Commits
e5fad2cb
Commit
e5fad2cb
authored
Nov 13, 2023
by
sdif
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加用户陪诊员假数据
parent
ebffa3af
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
9 deletions
+55
-9
pz-admin/src/main/java/com/pz/web/task/InsertTestOrderTask.java
+38
-0
pz-system/src/main/java/com/pz/merchant/service/impl/EmployeesServiceImpl.java
+15
-9
pz-system/src/main/java/com/pz/system/domain/FalseData.java
+2
-0
No files found.
pz-admin/src/main/java/com/pz/web/task/InsertTestOrderTask.java
View file @
e5fad2cb
package
com
.
pz
.
web
.
task
;
package
com
.
pz
.
web
.
task
;
import
cn.hutool.core.util.RandomUtil
;
import
cn.hutool.core.util.RandomUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.CollectionUtils
;
import
com.baomidou.mybatisplus.core.toolkit.CollectionUtils
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.pz.common.utils.DateUtils
;
import
com.pz.common.utils.DateUtils
;
...
@@ -69,6 +70,8 @@ public class InsertTestOrderTask {
...
@@ -69,6 +70,8 @@ public class InsertTestOrderTask {
private
final
EmployeesDivideMapper
employeesDivideMapper
;
private
final
EmployeesDivideMapper
employeesDivideMapper
;
private
final
FalseDataMapper
falseDataMapper
;
public
static
List
<
Integer
>
businessIds
=
Arrays
.
asList
(
1
,
2
,
3
,
4
,
5
,
6
);
public
static
List
<
Integer
>
businessIds
=
Arrays
.
asList
(
1
,
2
,
3
,
4
,
5
,
6
);
public
static
Map
<
Integer
,
Integer
>
orderNumMap
=
new
HashMap
<>();
public
static
Map
<
Integer
,
Integer
>
orderNumMap
=
new
HashMap
<>();
...
@@ -90,6 +93,41 @@ public class InsertTestOrderTask {
...
@@ -90,6 +93,41 @@ public class InsertTestOrderTask {
orderNumMap
.
put
(
16
,
27
);
orderNumMap
.
put
(
16
,
27
);
}
}
@Scheduled
(
cron
=
"0 0 1 * * ?"
)
// 凌晨12点执行
@Transactional
public
void
insertUser
()
{
Random
random
=
new
Random
();
int
randomNumber1
=
random
.
nextInt
(
5
-
1
+
1
)
+
1
;
int
randomNumber
=
random
.
nextInt
(
50
-
30
+
1
)
+
30
;
List
<
FalseData
>
falseData1
=
falseDataMapper
.
selectList
();
FalseData
falseData
=
new
FalseData
();
falseData
.
setId
(
1L
);
falseData
.
setAdminToday
((
long
)
randomNumber
);
falseData
.
setAdminSeven
(
falseData1
.
get
(
0
).
getCompanySeven
()
+
randomNumber
);
falseData
.
setAdminThirty
(
falseData1
.
get
(
0
).
getAdminThirty
()
+
randomNumber
);
falseData
.
setAdminSum
(
falseData1
.
get
(
0
).
getAdminSum
()
+
randomNumber
);
falseData
.
setCompanyToday
((
long
)
randomNumber
);
falseData
.
setCompanySeven
(
falseData1
.
get
(
0
).
getCompanySeven
()
+
randomNumber
);
falseData
.
setCompanyThirty
(
falseData1
.
get
(
0
).
getCompanyThirty
()
+
randomNumber
);
falseData
.
setCompanySum
(
falseData1
.
get
(
0
).
getCompanySum
()
+
randomNumber
);
falseDataMapper
.
updateById
(
falseData
);
List
<
Company
>
companies
=
companyMapper
.
selectList
();
for
(
Company
company
:
companies
)
{
FalseData
falseData2
=
falseDataMapper
.
selectOne
(
new
LambdaQueryWrapper
<
FalseData
>().
eq
(
FalseData:
:
getCompanyId
,
company
.
getId
()));
if
(
null
==
falseData2
){
continue
;
}
falseData2
.
setId
(
1L
);
falseData2
.
setAdminToday
((
long
)
randomNumber
);
falseData2
.
setAdminSeven
(
falseData2
.
getCompanySeven
()
+
randomNumber1
);
falseData2
.
setAdminThirty
(
falseData2
.
getAdminThirty
()
+
randomNumber1
);
falseData2
.
setAdminSum
(
falseData2
.
getAdminSum
()
+
randomNumber1
);
falseDataMapper
.
updateById
(
falseData2
);
}
}
@Scheduled
(
cron
=
"0 0 0 * * ?"
)
// 凌晨12点执行
@Scheduled
(
cron
=
"0 0 0 * * ?"
)
// 凌晨12点执行
@Transactional
@Transactional
...
...
pz-system/src/main/java/com/pz/merchant/service/impl/EmployeesServiceImpl.java
View file @
e5fad2cb
...
@@ -510,27 +510,33 @@ public class EmployeesServiceImpl implements IEmployeesService {
...
@@ -510,27 +510,33 @@ public class EmployeesServiceImpl implements IEmployeesService {
@Override
@Override
public
DataViewVo
dataEmployees
(
DataViewBo
dataViewBo
)
{
public
DataViewVo
dataEmployees
(
DataViewBo
dataViewBo
)
{
List
<
FalseData
>
falseData
=
falseDataMapper
.
selectList
();
Company
company
=
companyMapper
.
selectOne
(
new
LambdaQueryWrapper
<
Company
>().
eq
(
Company:
:
getUid
,
dataViewBo
.
getUserId
()));
if
(
null
==
company
){
DataViewVo
dataViewVo
=
new
DataViewVo
();
dataViewVo
.
setDataSum
(
0
);
return
dataViewVo
;
}
FalseData
falseData
=
falseDataMapper
.
selectOne
(
new
LambdaQueryWrapper
<
FalseData
>().
eq
(
FalseData:
:
getCompanyId
,
company
.
getId
()));
DataViewVo
dataViewVo
=
new
DataViewVo
();
DataViewVo
dataViewVo
=
new
DataViewVo
();
if
(
null
!=
dataViewBo
.
getUserId
()){
if
(
null
!=
dataViewBo
.
getUserId
()){
if
(
dataViewBo
.
getCondition
()
==
2
){
if
(
dataViewBo
.
getCondition
()
==
2
){
dataViewVo
.
setDataSum
(
falseData
.
get
(
1
).
get
CompanySeven
().
intValue
());
dataViewVo
.
setDataSum
(
falseData
.
getCompanySeven
().
intValue
());
}
else
if
(
dataViewBo
.
getCondition
()
==
3
){
}
else
if
(
dataViewBo
.
getCondition
()
==
3
){
dataViewVo
.
setDataSum
(
falseData
.
get
(
1
).
get
CompanyThirty
().
intValue
());
dataViewVo
.
setDataSum
(
falseData
.
getCompanyThirty
().
intValue
());
}
else
if
(
dataViewBo
.
getCondition
()
==
1
){
}
else
if
(
dataViewBo
.
getCondition
()
==
1
){
dataViewVo
.
setDataSum
(
falseData
.
get
(
1
).
get
CompanyToday
().
intValue
());
dataViewVo
.
setDataSum
(
falseData
.
getCompanyToday
().
intValue
());
}
else
{
}
else
{
dataViewVo
.
setDataSum
(
falseData
.
get
(
1
).
get
CompanySum
().
intValue
());
dataViewVo
.
setDataSum
(
falseData
.
getCompanySum
().
intValue
());
}
}
}
else
{
}
else
{
if
(
dataViewBo
.
getCondition
()
==
2
){
if
(
dataViewBo
.
getCondition
()
==
2
){
dataViewVo
.
setDataSum
(
falseData
.
get
(
0
).
get
CompanySeven
().
intValue
());
dataViewVo
.
setDataSum
(
falseData
.
getCompanySeven
().
intValue
());
}
else
if
(
dataViewBo
.
getCondition
()
==
3
){
}
else
if
(
dataViewBo
.
getCondition
()
==
3
){
dataViewVo
.
setDataSum
(
falseData
.
get
(
0
).
get
CompanyThirty
().
intValue
());
dataViewVo
.
setDataSum
(
falseData
.
getCompanyThirty
().
intValue
());
}
else
if
(
dataViewBo
.
getCondition
()
==
1
){
}
else
if
(
dataViewBo
.
getCondition
()
==
1
){
dataViewVo
.
setDataSum
(
falseData
.
get
(
0
).
get
CompanyToday
().
intValue
());
dataViewVo
.
setDataSum
(
falseData
.
getCompanyToday
().
intValue
());
}
else
{
}
else
{
dataViewVo
.
setDataSum
(
falseData
.
get
(
0
).
get
CompanySum
().
intValue
());
dataViewVo
.
setDataSum
(
falseData
.
getCompanySum
().
intValue
());
}
}
}
}
...
...
pz-system/src/main/java/com/pz/system/domain/FalseData.java
View file @
e5fad2cb
...
@@ -57,4 +57,6 @@ public class FalseData extends BaseEntity {
...
@@ -57,4 +57,6 @@ public class FalseData extends BaseEntity {
*/
*/
private
Long
companySum
;
private
Long
companySum
;
private
Long
companyId
;
}
}
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