From 2d12367dbb1c4781fbbc1e009c2f3eb0552837cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=95=B8=E9=9D=9E?= <8153694@qq.com> Date: Wed, 19 Jul 2023 17:44:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=80=83=E5=8B=A4=E6=B1=87?= =?UTF-8?q?=E6=80=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mortals/xhx/busiz/MockDataController.java | 53 ++++++++++--------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/MockDataController.java b/attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/MockDataController.java index 27f1cd55..dcb85cb0 100644 --- a/attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/MockDataController.java +++ b/attendance-performance-manager/src/main/java/com/mortals/xhx/busiz/MockDataController.java @@ -252,19 +252,19 @@ public class MockDataController { 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); + BigDecimal attendScoreAdd = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).setScale(2, BigDecimal.ROUND_CEILING); + BigDecimal reviewScoreAdd = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).setScale(2, BigDecimal.ROUND_CEILING); + BigDecimal complainScoreAdd = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).setScale(2, BigDecimal.ROUND_CEILING); + BigDecimal goworkScoreAdd = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).setScale(2, BigDecimal.ROUND_CEILING); + BigDecimal effectScoreAdd = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).setScale(2, BigDecimal.ROUND_CEILING); + BigDecimal otherScoreAdd = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).setScale(2, BigDecimal.ROUND_CEILING); + + BigDecimal attendScoreSub = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).setScale(2, BigDecimal.ROUND_CEILING); + BigDecimal reviewScoreSub = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).setScale(2, BigDecimal.ROUND_CEILING); + BigDecimal complainScoreSub = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).setScale(2, BigDecimal.ROUND_CEILING); + BigDecimal goworkScoreSub = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).setScale(2, BigDecimal.ROUND_CEILING); + BigDecimal effectScoreSub = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).setScale(2, BigDecimal.ROUND_CEILING); + BigDecimal otherScoreSub = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).setScale(2, BigDecimal.ROUND_CEILING); statEntity.setAttendScoreAdd(attendScoreAdd); statEntity.setAttendScoreSub(attendScoreSub); @@ -324,20 +324,21 @@ public class MockDataController { statEntity.initAttrValue(); statEntity.setDeptId(item.getId()); statEntity.setDeptName(item.getDeptName()); + int personNum = staffService.count(new StaffQuery().deptId(item.getId()), null); - 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 attendScoreAdd = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).multiply(new BigDecimal(personNum)).setScale(2, BigDecimal.ROUND_CEILING); + BigDecimal reviewScoreAdd = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).multiply(new BigDecimal(personNum)).setScale(2, BigDecimal.ROUND_CEILING); + BigDecimal complainScoreAdd = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).multiply(new BigDecimal(personNum)).setScale(2, BigDecimal.ROUND_CEILING); + BigDecimal goworkScoreAdd = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).multiply(new BigDecimal(personNum)).setScale(2, BigDecimal.ROUND_CEILING); + BigDecimal effectScoreAdd = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).multiply(new BigDecimal(personNum)).setScale(2, BigDecimal.ROUND_CEILING); + BigDecimal otherScoreAdd = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).multiply(new BigDecimal(personNum)).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); + BigDecimal attendScoreSub = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).multiply(new BigDecimal(personNum)).setScale(2, BigDecimal.ROUND_CEILING); + BigDecimal reviewScoreSub = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).multiply(new BigDecimal(personNum)).setScale(2, BigDecimal.ROUND_CEILING); + BigDecimal complainScoreSub = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).multiply(new BigDecimal(personNum)).setScale(2, BigDecimal.ROUND_CEILING); + BigDecimal goworkScoreSub = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).multiply(new BigDecimal(personNum)).setScale(2, BigDecimal.ROUND_CEILING); + BigDecimal effectScoreSub = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).multiply(new BigDecimal(personNum)).setScale(2, BigDecimal.ROUND_CEILING); + BigDecimal otherScoreSub = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).multiply(new BigDecimal(personNum)).setScale(2, BigDecimal.ROUND_CEILING); statEntity.setAttendScoreAdd(attendScoreAdd); statEntity.setAttendScoreSub(attendScoreSub); @@ -363,7 +364,7 @@ public class MockDataController { BigDecimal subtract = statEntity.getTotalAddScore().subtract(statEntity.getTotalSubScore()); statEntity.setTotalScore(subtract.compareTo(BigDecimal.ZERO) > 0 ? subtract : BigDecimal.ZERO); - int personNum = staffService.count(new StaffQuery().deptId(item.getId()), null); + if (personNum > 0) { BigDecimal aver = statEntity.getTotalScore().divide(new BigDecimal(personNum), 2, BigDecimal.ROUND_CEILING); -- 2.24.3