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
dcce5378
Commit
dcce5378
authored
Jul 19, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改考勤汇总
parent
39dda050
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
78 additions
and
5 deletions
+78
-5
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/MockDataController.java
...c/main/java/com/mortals/xhx/busiz/MockDataController.java
+78
-5
No files found.
attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/MockDataController.java
View file @
dcce5378
...
...
@@ -17,6 +17,7 @@ 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.DeptPerformStatService
;
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
;
...
...
@@ -26,10 +27,8 @@ import com.mortals.xhx.module.perform.model.PerformPerposeStaffStatEntity;
import
com.mortals.xhx.module.perform.service.PerformPerposeDeptStatService
;
import
com.mortals.xhx.module.perform.service.PerformPerposeStaffService
;
import
com.mortals.xhx.module.perform.service.PerformPerposeStaffStatService
;
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.*
;
import
com.mortals.xhx.module.staff.service.StaffPerformStatService
;
import
com.mortals.xhx.module.staff.service.StaffPerformSummaryService
;
import
com.mortals.xhx.module.staff.service.StaffService
;
import
com.mortals.xhx.module.workman.model.WorkmanEntity
;
...
...
@@ -80,7 +79,10 @@ public class MockDataController {
private
PerformPerposeDeptStatService
perposeDeptStatService
;
@Autowired
private
StaffPerformSummaryService
summaryService
;
@Autowired
private
StaffPerformStatService
staffPerformStatService
;
private
DeptPerformStatService
deptPerformStatService
;
/**
* 生成模拟数据
...
...
@@ -204,7 +206,7 @@ public class MockDataController {
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
);
BigDecimal
totalScore
=
attendScore
.
add
(
reviewScore
).
add
(
complainScore
).
add
(
goworkScore
).
add
(
effectScore
).
add
(
otherScore
).
add
(
errorScore
);
statEntity
.
setAttendScore
(
attendScore
);
statEntity
.
setReviewScore
(
reviewScore
);
...
...
@@ -228,6 +230,77 @@ public class MockDataController {
}
/**
* 生成模拟数据
* mortals_xhx_staff_perform_stat
*
* @return
*/
@GetMapping
(
"randomStaffPerformStatData"
)
@UnAuth
public
Rest
<
Void
>
randomStaffPerformStatData
()
{
List
<
StaffEntity
>
cacheList
=
staffService
.
getCacheList
();
//最近两月模拟数据
DateTime
beforeStartDate
=
DateUtil
.
offsetDay
(
new
Date
(),
-
60
);
for
(
int
i
=
1
;
i
<=
60
;
i
++)
{
DateTime
curDate
=
DateUtil
.
offsetDay
(
beforeStartDate
,
i
);
List
<
StaffPerformStatEntity
>
collect
=
cacheList
.
stream
().
map
(
item
->
{
StaffPerformStatEntity
statEntity
=
new
StaffPerformStatEntity
();
statEntity
.
initAttrValue
();
statEntity
.
setStaffId
(
item
.
getId
());
statEntity
.
setStaffName
(
item
.
getName
());
BigDecimal
attendScoreAdd
=
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
);
BigDecimal
reviewScoreAdd
=
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
);
BigDecimal
complainScoreAdd
=
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
);
BigDecimal
goworkScoreAdd
=
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
);
BigDecimal
effectScoreAdd
=
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
);
BigDecimal
otherScoreAdd
=
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
);
BigDecimal
attendScoreSub
=
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
);
BigDecimal
reviewScoreSub
=
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
);
BigDecimal
complainScoreSub
=
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
);
BigDecimal
goworkScoreSub
=
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
);
BigDecimal
effectScoreSub
=
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
);
BigDecimal
otherScoreSub
=
RandomUtil
.
randomBigDecimal
(
BigDecimal
.
ZERO
,
new
BigDecimal
(
"1"
)).
setScale
(
2
,
BigDecimal
.
ROUND_CEILING
);
statEntity
.
setAttendScoreAdd
(
attendScoreAdd
);
statEntity
.
setAttendScoreSub
(
attendScoreSub
);
statEntity
.
setReviewScoreAdd
(
reviewScoreAdd
);
statEntity
.
setReviewScoreSub
(
reviewScoreSub
);
statEntity
.
setComplainScoreAdd
(
complainScoreAdd
);
statEntity
.
setComplainScoreSub
(
complainScoreSub
);
statEntity
.
setGoworkScoreAdd
(
goworkScoreAdd
);
statEntity
.
setGoworkScoreSub
(
goworkScoreSub
);
statEntity
.
setEffectScoreAdd
(
effectScoreAdd
);
statEntity
.
setEffectScoreSub
(
effectScoreSub
);
statEntity
.
setOtherScoreAdd
(
otherScoreAdd
);
statEntity
.
setOtherScoreSub
(
otherScoreSub
);
BigDecimal
totalScoreAdd
=
attendScoreAdd
.
add
(
reviewScoreAdd
).
add
(
complainScoreAdd
)
.
add
(
goworkScoreAdd
).
add
(
effectScoreAdd
).
add
(
otherScoreAdd
);
BigDecimal
totalScoreSub
=
attendScoreSub
.
add
(
reviewScoreSub
).
add
(
complainScoreSub
)
.
add
(
goworkScoreSub
).
add
(
effectScoreSub
).
add
(
otherScoreSub
);
statEntity
.
setTotalAddScore
(
totalScoreAdd
);
statEntity
.
setTotalSubScore
(
totalScoreSub
);
BigDecimal
subtract
=
statEntity
.
getTotalAddScore
().
subtract
(
statEntity
.
getTotalSubScore
());
statEntity
.
setTotalScore
(
subtract
.
compareTo
(
BigDecimal
.
ZERO
)>
0
?
subtract:
BigDecimal
.
ZERO
);
statEntity
.
setYear
(
DateUtil
.
year
(
curDate
));
statEntity
.
setMonth
(
DateUtil
.
month
(
curDate
)
+
1
);
statEntity
.
setDay
(
DateUtil
.
dayOfMonth
(
curDate
));
return
statEntity
;
}).
collect
(
Collectors
.
toList
());
staffPerformStatService
.
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
));
}
...
...
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