Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
attendance-performance-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
attendance-performance-platform
Commits
7dd5af8b
Commit
7dd5af8b
authored
Jul 18, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改考勤汇总
parent
64ece70b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
3 deletions
+64
-3
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/MockDataController.java
...c/main/java/com/mortals/xhx/busiz/MockDataController.java
+64
-3
No files found.
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/MockDataController.java
View file @
7dd5af8b
...
@@ -27,7 +27,10 @@ import com.mortals.xhx.module.perform.service.PerformPerposeDeptStatService;
...
@@ -27,7 +27,10 @@ import com.mortals.xhx.module.perform.service.PerformPerposeDeptStatService;
import
com.mortals.xhx.module.perform.service.PerformPerposeStaffService
;
import
com.mortals.xhx.module.perform.service.PerformPerposeStaffService
;
import
com.mortals.xhx.module.perform.service.PerformPerposeStaffStatService
;
import
com.mortals.xhx.module.perform.service.PerformPerposeStaffStatService
;
import
com.mortals.xhx.module.staff.model.StaffEntity
;
import
com.mortals.xhx.module.staff.model.StaffEntity
;
import
com.mortals.xhx.module.staff.model.StaffPerformSummaryEntity
;
import
com.mortals.xhx.module.staff.model.StaffPerformSummaryQuery
;
import
com.mortals.xhx.module.staff.model.StaffQuery
;
import
com.mortals.xhx.module.staff.model.StaffQuery
;
import
com.mortals.xhx.module.staff.service.StaffPerformSummaryService
;
import
com.mortals.xhx.module.staff.service.StaffService
;
import
com.mortals.xhx.module.staff.service.StaffService
;
import
com.mortals.xhx.module.workman.model.WorkmanEntity
;
import
com.mortals.xhx.module.workman.model.WorkmanEntity
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -75,6 +78,8 @@ public class MockDataController {
...
@@ -75,6 +78,8 @@ public class MockDataController {
private
PerformPerposeStaffStatService
perposeStaffStatService
;
private
PerformPerposeStaffStatService
perposeStaffStatService
;
@Autowired
@Autowired
private
PerformPerposeDeptStatService
perposeDeptStatService
;
private
PerformPerposeDeptStatService
perposeDeptStatService
;
@Autowired
private
StaffPerformSummaryService
summaryService
;
/**
/**
...
@@ -88,7 +93,7 @@ public class MockDataController {
...
@@ -88,7 +93,7 @@ public class MockDataController {
public
Rest
<
Void
>
randomStatPerposeStaffData
()
{
public
Rest
<
Void
>
randomStatPerposeStaffData
()
{
List
<
StaffEntity
>
cacheList
=
staffService
.
getCacheList
();
List
<
StaffEntity
>
cacheList
=
staffService
.
getCacheList
();
//最近两月模拟数据
//最近两月模拟数据
DateTime
beforeStartDate
=
DateUtil
.
offsetDay
(
new
Date
(),
60
);
DateTime
beforeStartDate
=
DateUtil
.
offsetDay
(
new
Date
(),
-
60
);
for
(
int
i
=
1
;
i
<=
60
;
i
++)
{
for
(
int
i
=
1
;
i
<=
60
;
i
++)
{
DateTime
curDate
=
DateUtil
.
offsetDay
(
beforeStartDate
,
i
);
DateTime
curDate
=
DateUtil
.
offsetDay
(
beforeStartDate
,
i
);
...
@@ -125,7 +130,7 @@ public class MockDataController {
...
@@ -125,7 +130,7 @@ public class MockDataController {
/**
/**
* 生成模拟数据
* 生成模拟数据
* mortals_xhx_perform_perpose_
staff
_stat
* mortals_xhx_perform_perpose_
dept
_stat
*
*
* @return
* @return
*/
*/
...
@@ -136,7 +141,7 @@ public class MockDataController {
...
@@ -136,7 +141,7 @@ public class MockDataController {
List
<
DeptEntity
>
deptEntityList
=
deptService
.
find
(
new
DeptQuery
());
List
<
DeptEntity
>
deptEntityList
=
deptService
.
find
(
new
DeptQuery
());
//最近两月模拟数据
//最近两月模拟数据
DateTime
beforeStartDate
=
DateUtil
.
offsetDay
(
new
Date
(),
60
);
DateTime
beforeStartDate
=
DateUtil
.
offsetDay
(
new
Date
(),
-
60
);
for
(
int
i
=
1
;
i
<=
60
;
i
++)
{
for
(
int
i
=
1
;
i
<=
60
;
i
++)
{
DateTime
curDate
=
DateUtil
.
offsetDay
(
beforeStartDate
,
i
);
DateTime
curDate
=
DateUtil
.
offsetDay
(
beforeStartDate
,
i
);
...
@@ -167,6 +172,62 @@ public class MockDataController {
...
@@ -167,6 +172,62 @@ public class MockDataController {
}
}
/**
* 生成模拟数据
* mortals_xhx_staff_perform_summary
*
* @return
*/
@GetMapping
(
"randomStatStaffSummaryData"
)
@UnAuth
public
Rest
<
Void
>
randomStatStaffSummaryData
()
{
List
<
StaffEntity
>
cacheList
=
staffService
.
getCacheList
();
//最近两月模拟数据
DateTime
beforeStartDate
=
DateUtil
.
offsetMonth
(
new
Date
(),
-
3
);
for
(
int
i
=
1
;
i
<=
3
;
i
++)
{
DateTime
curDate
=
DateUtil
.
offsetMonth
(
beforeStartDate
,
i
);
List
<
StaffPerformSummaryEntity
>
collect
=
cacheList
.
stream
().
map
(
item
->
{
StaffPerformSummaryEntity
statEntity
=
new
StaffPerformSummaryEntity
();
statEntity
.
initAttrValue
();
statEntity
.
setStaffId
(
item
.
getId
());
statEntity
.
setStaffName
(
item
.
getName
());
statEntity
.
setWorkNum
(
item
.
getWorkNum
());
statEntity
.
setDeptId
(
item
.
getDeptId
());
statEntity
.
setDeptName
(
item
.
getDeptName
());
BigDecimal
attendScore
=
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
);
BigDecimal
reviewScore
=
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
);
BigDecimal
complainScore
=
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
);
BigDecimal
goworkScore
=
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
);
BigDecimal
effectScore
=
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
);
BigDecimal
otherScore
=
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
);
BigDecimal
errorScore
=
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
);
BigDecimal
totalScore
=
attendScore
.
add
(
reviewScore
).
add
(
complainScore
).
add
(
goworkScore
).
add
(
effectScore
).
add
(
otherScore
).
add
(
errorScore
);
statEntity
.
setAttendScore
(
attendScore
);
statEntity
.
setReviewScore
(
reviewScore
);
statEntity
.
setComplainScore
(
complainScore
);
statEntity
.
setGoworkScore
(
goworkScore
);
statEntity
.
setEffectScore
(
effectScore
);
statEntity
.
setOtherScore
(
otherScore
);
statEntity
.
setErrorScore
(
errorScore
);
statEntity
.
setTotalScore
(
totalScore
);
statEntity
.
setYear
(
DateUtil
.
year
(
curDate
));
statEntity
.
setMonth
(
DateUtil
.
month
(
curDate
)
+
1
);
return
statEntity
;
}).
collect
(
Collectors
.
toList
());
summaryService
.
save
(
collect
);
}
return
Rest
.
ok
();
}
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
));
System
.
out
.
println
(
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
));
}
}
...
...
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