|
@@ -15,6 +15,7 @@ import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
import java.util.stream.Collectors;
|
|
@@ -424,15 +425,15 @@ public class KYNTServiceImpl implements KYNTService {
|
|
|
getLeaveNum("8a10b574-4274-47bc-9bad-1df1c4308f60",userId,0,50,leaveQuotasList);
|
|
|
|
|
|
//查询员工调休假余额
|
|
|
- int compensatoryLeaveNum = 0;
|
|
|
+ BigDecimal compensatoryLeaveNum = new BigDecimal(0.00);
|
|
|
if (Objects.nonNull(leaveQuotasList)){
|
|
|
for (Map leaveQuotas : leaveQuotasList) {
|
|
|
if ((long) leaveQuotas.get("start_time") <= currentTime && currentTime <= (long) leaveQuotas.get("end_time")){
|
|
|
if (Objects.isNull(leaveQuotas.get("quota_num_per_day")) && Objects.nonNull(leaveQuotas.get("quota_num_per_hour"))){
|
|
|
- compensatoryLeaveNum += ((int) leaveQuotas.get("quota_num_per_hour")) / 100;
|
|
|
+ compensatoryLeaveNum = compensatoryLeaveNum.add(new BigDecimal(String.valueOf(leaveQuotas.get("quota_num_per_hour"))).divide(new BigDecimal(100)));
|
|
|
}
|
|
|
if (Objects.nonNull(leaveQuotas.get("used_num_per_hour"))){
|
|
|
- compensatoryLeaveNum -= ((int) leaveQuotas.get("used_num_per_hour")) / 100;
|
|
|
+ compensatoryLeaveNum = compensatoryLeaveNum.subtract(new BigDecimal(String.valueOf(leaveQuotas.get("used_num_per_hour"))).divide(new BigDecimal(100)));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -456,14 +457,14 @@ public class KYNTServiceImpl implements KYNTService {
|
|
|
}
|
|
|
|
|
|
}*/
|
|
|
- if (compensatoryLeaveNum >= 80){
|
|
|
+ if (compensatoryLeaveNum.compareTo(new BigDecimal(80)) >= 0){
|
|
|
leaveMap.put("可预支调休",80);
|
|
|
- leaveMap.put("实际加班小时数",compensatoryLeaveNum-80);
|
|
|
+ leaveMap.put("实际加班小时数",compensatoryLeaveNum.subtract(new BigDecimal(80)));
|
|
|
leaveMap.put("已预支调休",0);
|
|
|
}else {
|
|
|
leaveMap.put("可预支调休",compensatoryLeaveNum);
|
|
|
leaveMap.put("实际加班小时数",0);
|
|
|
- leaveMap.put("已预支调休",80-compensatoryLeaveNum);
|
|
|
+ leaveMap.put("已预支调休",new BigDecimal(80).subtract(compensatoryLeaveNum));
|
|
|
}
|
|
|
/*leaveMap.put("可预支调休",leaveNum);
|
|
|
leaveMap.put("实际加班小时数",Math.max(0,leaveNum-80));
|