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
64ece70b
Commit
64ece70b
authored
Jul 18, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改考勤汇总
parent
b686ac46
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
14 deletions
+61
-14
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/MockDataController.java
...c/main/java/com/mortals/xhx/busiz/MockDataController.java
+61
-14
No files found.
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/MockDataController.java
View file @
64ece70b
...
...
@@ -15,8 +15,12 @@ import com.mortals.xhx.base.system.upload.service.UploadService;
import
com.mortals.xhx.base.system.user.model.UserEntity
;
import
com.mortals.xhx.base.system.user.model.UserQuery
;
import
com.mortals.xhx.base.system.user.service.UserService
;
import
com.mortals.xhx.module.dept.model.DeptEntity
;
import
com.mortals.xhx.module.dept.model.DeptQuery
;
import
com.mortals.xhx.module.dept.service.DeptService
;
import
com.mortals.xhx.module.hik.face.model.req.img.ImgReq
;
import
com.mortals.xhx.module.hik.face.service.IHikFaceService
;
import
com.mortals.xhx.module.perform.model.PerformPerposeDeptStatEntity
;
import
com.mortals.xhx.module.perform.model.PerformPerposeStaffEntity
;
import
com.mortals.xhx.module.perform.model.PerformPerposeStaffStatEntity
;
import
com.mortals.xhx.module.perform.service.PerformPerposeDeptStatService
;
...
...
@@ -64,10 +68,12 @@ public class MockDataController {
private
IHikFaceService
faceService
;
@Autowired
private
UploadService
uploadService
;
@Autowired
private
DeptService
deptService
;
@Autowired
private
PerformPerposeStaffStatService
perposeStaffStatService
;
@Autowired
private
PerformPerposeDeptStatService
perposeDeptStatService
;
...
...
@@ -93,18 +99,18 @@ public class MockDataController {
statEntity
.
setStaffName
(
item
.
getName
());
statEntity
.
setNumber
(
item
.
getWorkNum
());
statEntity
.
setAbsentRate
(
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
));
statEntity
.
setAbsenceRate
(
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
));
statEntity
.
setLateRate
(
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
));
statEntity
.
setEarlyRate
(
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
));
statEntity
.
setLeaveRate
(
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
));
statEntity
.
setTurnoverRate
(
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
));
statEntity
.
setSleepRate
(
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
));
statEntity
.
setPlayPhoneRate
(
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
));
statEntity
.
setExpireWorkRate
(
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
));
statEntity
.
setNegaReviewRate
(
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
));
statEntity
.
setAbsentRate
(
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
));
statEntity
.
setAbsenceRate
(
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
));
statEntity
.
setLateRate
(
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
));
statEntity
.
setEarlyRate
(
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
));
statEntity
.
setLeaveRate
(
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
));
statEntity
.
setTurnoverRate
(
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
));
statEntity
.
setSleepRate
(
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
));
statEntity
.
setPlayPhoneRate
(
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
));
statEntity
.
setExpireWorkRate
(
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
));
statEntity
.
setNegaReviewRate
(
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
));
statEntity
.
setYear
(
DateUtil
.
year
(
curDate
));
statEntity
.
setMonth
(
DateUtil
.
month
(
curDate
)
+
1
);
statEntity
.
setMonth
(
DateUtil
.
month
(
curDate
)
+
1
);
statEntity
.
setDay
(
DateUtil
.
dayOfMonth
(
curDate
));
...
...
@@ -112,16 +118,57 @@ public class MockDataController {
}).
collect
(
Collectors
.
toList
());
perposeStaffStatService
.
save
(
collect
);
}
return
Rest
.
ok
();
}
/**
* 生成模拟数据
* mortals_xhx_perform_perpose_staff_stat
*
* @return
*/
@GetMapping
(
"randomStatPerposeDeptData"
)
@UnAuth
public
Rest
<
Void
>
randomStatPerposeDeptData
()
{
List
<
DeptEntity
>
deptEntityList
=
deptService
.
find
(
new
DeptQuery
());
//最近两月模拟数据
DateTime
beforeStartDate
=
DateUtil
.
offsetDay
(
new
Date
(),
60
);
for
(
int
i
=
1
;
i
<=
60
;
i
++)
{
DateTime
curDate
=
DateUtil
.
offsetDay
(
beforeStartDate
,
i
);
List
<
PerformPerposeDeptStatEntity
>
collect
=
deptEntityList
.
stream
().
map
(
item
->
{
PerformPerposeDeptStatEntity
statEntity
=
new
PerformPerposeDeptStatEntity
();
statEntity
.
initAttrValue
();
statEntity
.
setDeptId
(
item
.
getId
());
statEntity
.
setDeptName
(
item
.
getDeptName
());
statEntity
.
setAbsentRate
(
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
));
statEntity
.
setAbsenceRate
(
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
));
statEntity
.
setLateRate
(
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
));
statEntity
.
setEarlyRate
(
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
));
statEntity
.
setLeaveRate
(
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
));
statEntity
.
setTurnoverRate
(
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
));
statEntity
.
setSleepRate
(
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
));
statEntity
.
setPlayPhoneRate
(
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
));
statEntity
.
setExpireWorkRate
(
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
));
statEntity
.
setNegaReviewRate
(
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
));
statEntity
.
setYear
(
DateUtil
.
year
(
curDate
));
statEntity
.
setMonth
(
DateUtil
.
month
(
curDate
)
+
1
);
statEntity
.
setDay
(
DateUtil
.
dayOfMonth
(
curDate
));
return
statEntity
;
}).
collect
(
Collectors
.
toList
());
perposeDeptStatService
.
save
(
collect
);
}
return
Rest
.
ok
();
}
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