|
@@ -229,117 +229,73 @@ public class UserWithBeisenController {
|
|
List<JSONObject> overTimeList = overTimeStream.filter(a -> a.getString("StaffId").equals(beisen.get().getUserId())
|
|
List<JSONObject> overTimeList = overTimeStream.filter(a -> a.getString("StaffId").equals(beisen.get().getUserId())
|
|
&& (a.getIntValue("ApproveStatus") == 2||a.getIntValue("ApproveStatus") == 1)).collect(Collectors.toList());
|
|
&& (a.getIntValue("ApproveStatus") == 2||a.getIntValue("ApproveStatus") == 1)).collect(Collectors.toList());
|
|
//加班数据可能存在结束日期是当前日期的情况的情况
|
|
//加班数据可能存在结束日期是当前日期的情况的情况
|
|
- BigDecimal overTimeBigDecimal;
|
|
|
|
- if(workDay){
|
|
|
|
- overTimeBigDecimal = new BigDecimal(0);
|
|
|
|
- }else {
|
|
|
|
- overTimeBigDecimal = new BigDecimal(8);
|
|
|
|
- }
|
|
|
|
|
|
+ BigDecimal overTimeBigDecimal= new BigDecimal(0);;
|
|
for (JSONObject o : overTimeList) {
|
|
for (JSONObject o : overTimeList) {
|
|
//存在开始日期为当前日期的数据以及结束日期为当天日期的数据 分开计算
|
|
//存在开始日期为当前日期的数据以及结束日期为当天日期的数据 分开计算
|
|
if(LocalDateTime.parse(o.getString("StartDate"),df1).toLocalDate().isEqual(localDate)){
|
|
if(LocalDateTime.parse(o.getString("StartDate"),df1).toLocalDate().isEqual(localDate)){
|
|
//存在开始日期为当天的数据
|
|
//存在开始日期为当天的数据
|
|
if(LocalDateTime.parse(o.getString("StartDate"),df1).toLocalDate().isEqual(LocalDateTime.parse(o.getString("StopDate"),df1).toLocalDate())){
|
|
if(LocalDateTime.parse(o.getString("StartDate"),df1).toLocalDate().isEqual(LocalDateTime.parse(o.getString("StopDate"),df1).toLocalDate())){
|
|
//开始日期和结束日期是相同的情况 说明是加班区间只存在于当天的情况
|
|
//开始日期和结束日期是相同的情况 说明是加班区间只存在于当天的情况
|
|
- if(max.get().isAfter(LocalTime.parse("19:00:00",df4))){
|
|
|
|
- //判断打卡时间是不是大于19:00 大于才算加班 通过打卡计算加班时长 与加班单作比较 取小
|
|
|
|
- Duration timeDurantion = Duration.between(LocalTime.parse("18:00:00", df4), max.get());
|
|
|
|
-// //如果结束时间大于13:00
|
|
|
|
-// if(max.get().isAfter(LocalTime.parse("13:00:00",df4))){
|
|
|
|
-// timeDurantion=timeDurantion.minusHours(1);
|
|
|
|
-// }
|
|
|
|
-// //如果结束时间大于18:00
|
|
|
|
-// if(max.get().isAfter(LocalTime.parse("18:00:00",df4))){
|
|
|
|
-// timeDurantion=timeDurantion.minusMinutes(30);
|
|
|
|
-// }
|
|
|
|
- BigDecimal decimal = new BigDecimal(timeDurantion.toMinutes());
|
|
|
|
- decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
|
|
|
|
- double l = decimal.doubleValue();
|
|
|
|
- if(l<o.getDouble("OverTimeDuration")){
|
|
|
|
- overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(l));
|
|
|
|
- }else {
|
|
|
|
- overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(o.getDouble("OverTimeDuration")));
|
|
|
|
- }
|
|
|
|
|
|
+ //判断打卡时间是不是大于19:00 大于才算加班 通过打卡计算加班时长 与加班单作比较 取小
|
|
|
|
+ Duration timeDurantion = Duration.between(LocalTime.parse("18:00:00", df4), max.get());
|
|
|
|
+ BigDecimal decimal = new BigDecimal(timeDurantion.toMinutes());
|
|
|
|
+ decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
|
|
|
|
+ double l = decimal.doubleValue();
|
|
|
|
+ if(l<o.getDouble("OverTimeDuration")){
|
|
|
|
+ overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(l<0?0:l));
|
|
|
|
+ }else {
|
|
|
|
+ overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(o.getDouble("OverTimeDuration")));
|
|
}
|
|
}
|
|
}else {
|
|
}else {
|
|
//开始日期和结束日期是不相同的情况 说明是加班区间存在加班到第二天的情况
|
|
//开始日期和结束日期是不相同的情况 说明是加班区间存在加班到第二天的情况
|
|
LocalDateTime start = LocalDateTime.parse(o.getString("StartDate"), df1);
|
|
LocalDateTime start = LocalDateTime.parse(o.getString("StartDate"), df1);
|
|
LocalDateTime stop = start.toLocalDate().atTime(LocalTime.MAX);
|
|
LocalDateTime stop = start.toLocalDate().atTime(LocalTime.MAX);
|
|
Duration duration = Duration.between(start, stop);
|
|
Duration duration = Duration.between(start, stop);
|
|
-// if(stop.toLocalTime().isAfter(LocalTime.parse("13:00:00",df4))){
|
|
|
|
-// duration=duration.minusHours(1);
|
|
|
|
-// }
|
|
|
|
-// //如果结束时间大于18:00
|
|
|
|
-// if(stop.toLocalTime().isAfter(LocalTime.parse("18:00:00",df4))){
|
|
|
|
-// duration=duration.minusMinutes(30);
|
|
|
|
-// }
|
|
|
|
BigDecimal decimal = new BigDecimal(duration.toMinutes());
|
|
BigDecimal decimal = new BigDecimal(duration.toMinutes());
|
|
decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
|
|
decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
|
|
double l = decimal.doubleValue();
|
|
double l = decimal.doubleValue();
|
|
- if(max.get().isAfter(LocalTime.parse("19:00:00",df4))){
|
|
|
|
- //判断打卡时间是不是大于19:00 通过打卡计算加班时长 与加班单作比较 取小
|
|
|
|
- Duration timeDurantion = Duration.between(LocalTime.parse("18:00:00", df4), max.get());
|
|
|
|
- BigDecimal decimal1 = new BigDecimal(timeDurantion.toMinutes());
|
|
|
|
- decimal1=decimal1.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
|
|
|
|
- double l1 = decimal1.doubleValue();
|
|
|
|
- if(l1<l){
|
|
|
|
- overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(l1));
|
|
|
|
- }else {
|
|
|
|
- overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(l));
|
|
|
|
- }
|
|
|
|
|
|
+ //判断打卡时间是不是大于19:00 通过打卡计算加班时长 与加班单作比较 取小
|
|
|
|
+ Duration timeDurantion = Duration.between(LocalTime.parse("18:00:00", df4), max.get());
|
|
|
|
+ BigDecimal decimal1 = new BigDecimal(timeDurantion.toMinutes());
|
|
|
|
+ decimal1=decimal1.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
|
|
|
|
+ double l1 = decimal1.doubleValue();
|
|
|
|
+ if(l1<l){
|
|
|
|
+ overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(l1<0?0:l1));
|
|
|
|
+ }else {
|
|
|
|
+ overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(l));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}else if(LocalDateTime.parse(o.getString("StopDate"),df1).toLocalDate().isEqual(localDate)){
|
|
}else if(LocalDateTime.parse(o.getString("StopDate"),df1).toLocalDate().isEqual(localDate)){
|
|
//存在结束日期为当天的数据
|
|
//存在结束日期为当天的数据
|
|
if(LocalDateTime.parse(o.getString("StartDate"),df1).toLocalDate().isEqual(LocalDateTime.parse(o.getString("StopDate"),df1).toLocalDate())){
|
|
if(LocalDateTime.parse(o.getString("StartDate"),df1).toLocalDate().isEqual(LocalDateTime.parse(o.getString("StopDate"),df1).toLocalDate())){
|
|
//开始日期和结束日期是相同的情况 说明是加班区间只存在于当天的情况
|
|
//开始日期和结束日期是相同的情况 说明是加班区间只存在于当天的情况
|
|
- if(max.get().isAfter(LocalTime.parse("19:00:00",df4))){
|
|
|
|
- //判断打卡时间是不是大于19:00 通过打卡计算加班时长 与加班单作比较 取小
|
|
|
|
- Duration timeDurantion = Duration.between(LocalTime.parse("18:00:00", df4), max.get());
|
|
|
|
-// //如果结束时间大于13:00
|
|
|
|
-// if(max.get().isAfter(LocalTime.parse("13:00:00",df4))){
|
|
|
|
-// timeDurantion=timeDurantion.minusHours(1);
|
|
|
|
-// }
|
|
|
|
-// //如果结束时间大于18:00
|
|
|
|
-// if(max.get().isAfter(LocalTime.parse("18:00:00",df4))){
|
|
|
|
-// timeDurantion=timeDurantion.minusMinutes(30);
|
|
|
|
-// }
|
|
|
|
- BigDecimal decimal = new BigDecimal(timeDurantion.toMinutes());
|
|
|
|
- decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
|
|
|
|
- double l = decimal.doubleValue();
|
|
|
|
- if(l<o.getDouble("OverTimeDuration")){
|
|
|
|
- overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(l));
|
|
|
|
- }else {
|
|
|
|
- overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(o.getDouble("OverTimeDuration")));
|
|
|
|
- }
|
|
|
|
|
|
+ //判断打卡时间是不是大于19:00 通过打卡计算加班时长 与加班单作比较 取小
|
|
|
|
+ Duration timeDurantion = Duration.between(LocalTime.parse("18:00:00", df4), max.get());
|
|
|
|
+ BigDecimal decimal = new BigDecimal(timeDurantion.toMinutes());
|
|
|
|
+ decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
|
|
|
|
+ double l = decimal.doubleValue();
|
|
|
|
+ if(l<o.getDouble("OverTimeDuration")){
|
|
|
|
+ overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(l<0?0:l));
|
|
|
|
+ }else {
|
|
|
|
+ overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(o.getDouble("OverTimeDuration")));
|
|
}
|
|
}
|
|
}else {
|
|
}else {
|
|
//开始日期和结束日期是不相同的情况 说明是加班区间存在加班到第二天的情况
|
|
//开始日期和结束日期是不相同的情况 说明是加班区间存在加班到第二天的情况
|
|
LocalDateTime stop = LocalDateTime.parse(o.getString("StopDate"), df1);
|
|
LocalDateTime stop = LocalDateTime.parse(o.getString("StopDate"), df1);
|
|
LocalDateTime start = stop.toLocalDate().atTime(LocalTime.MIN);
|
|
LocalDateTime start = stop.toLocalDate().atTime(LocalTime.MIN);
|
|
Duration duration = Duration.between(start, stop);
|
|
Duration duration = Duration.between(start, stop);
|
|
-// //如果结束时间大于13:00
|
|
|
|
-// if(stop.toLocalTime().isAfter(LocalTime.parse("13:00:00",df4))){
|
|
|
|
-// duration=duration.minusHours(1);
|
|
|
|
-// }
|
|
|
|
-// //如果结束时间大于18:00
|
|
|
|
-// if(stop.toLocalTime().isAfter(LocalTime.parse("18:00:00",df4))){
|
|
|
|
-// duration=duration.minusMinutes(30);
|
|
|
|
-// }
|
|
|
|
BigDecimal decimal = new BigDecimal(duration.toMinutes());
|
|
BigDecimal decimal = new BigDecimal(duration.toMinutes());
|
|
decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
|
|
decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
|
|
double l = decimal.doubleValue();
|
|
double l = decimal.doubleValue();
|
|
- if(max.get().isAfter(LocalTime.parse("19:00:00",df4))){
|
|
|
|
- //判断打卡时间是不是大于19:00 通过打卡计算加班时长 与加班单作比较 取小
|
|
|
|
- Duration timeDurantion = Duration.between(LocalTime.parse("18:00:00", df4), max.get());
|
|
|
|
- BigDecimal decimal1 = new BigDecimal(timeDurantion.toMinutes());
|
|
|
|
- decimal1=decimal1.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
|
|
|
|
- double l1 = decimal1.doubleValue();
|
|
|
|
- if(l1<l){
|
|
|
|
- overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(l1));
|
|
|
|
- }else {
|
|
|
|
- overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(l));
|
|
|
|
- }
|
|
|
|
|
|
+ //判断打卡时间是不是大于19:00 通过打卡计算加班时长 与加班单作比较 取小
|
|
|
|
+ Duration timeDurantion = Duration.between(LocalTime.parse("18:00:00", df4), max.get());
|
|
|
|
+ BigDecimal decimal1 = new BigDecimal(timeDurantion.toMinutes());
|
|
|
|
+ decimal1=decimal1.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
|
|
|
|
+ double l1 = decimal1.doubleValue();
|
|
|
|
+ if(l1<l){
|
|
|
|
+ overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(l1<0?0:l1));
|
|
|
|
+ }else {
|
|
|
|
+ overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(l));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -528,120 +484,75 @@ public class UserWithBeisenController {
|
|
// &&LocalDateTime.parse(a.getString("StartDate"),df1).toLocalDate().isEqual(localDate)).collect(Collectors.toList());
|
|
// &&LocalDateTime.parse(a.getString("StartDate"),df1).toLocalDate().isEqual(localDate)).collect(Collectors.toList());
|
|
List<JSONObject> overTimeList = overTimeStream.filter(a -> a.getString("StaffId").equals(beisen.get().getUserId())
|
|
List<JSONObject> overTimeList = overTimeStream.filter(a -> a.getString("StaffId").equals(beisen.get().getUserId())
|
|
&& (a.getIntValue("ApproveStatus") == 2||a.getIntValue("ApproveStatus") == 1)).collect(Collectors.toList());
|
|
&& (a.getIntValue("ApproveStatus") == 2||a.getIntValue("ApproveStatus") == 1)).collect(Collectors.toList());
|
|
- //加班数据可能存在结束日期是当前日期的情况的情况
|
|
|
|
- BigDecimal overTimeBigDecimal;
|
|
|
|
- if(workDay){
|
|
|
|
- overTimeBigDecimal = new BigDecimal(0);
|
|
|
|
- }else {
|
|
|
|
- overTimeBigDecimal = new BigDecimal(8);
|
|
|
|
- }
|
|
|
|
LocalDate localDate = LocalDate.parse(createDate, df);
|
|
LocalDate localDate = LocalDate.parse(createDate, df);
|
|
|
|
+ //加班数据可能存在结束日期是当前日期的情况的情况
|
|
|
|
+ BigDecimal overTimeBigDecimal= new BigDecimal(0);
|
|
for (JSONObject o : overTimeList) {
|
|
for (JSONObject o : overTimeList) {
|
|
//存在开始日期为当前日期的数据以及结束日期为当天日期的数据 分开计算
|
|
//存在开始日期为当前日期的数据以及结束日期为当天日期的数据 分开计算
|
|
if(LocalDateTime.parse(o.getString("StartDate"),df1).toLocalDate().isEqual(localDate)){
|
|
if(LocalDateTime.parse(o.getString("StartDate"),df1).toLocalDate().isEqual(localDate)){
|
|
//存在开始日期为当天的数据
|
|
//存在开始日期为当天的数据
|
|
if(LocalDateTime.parse(o.getString("StartDate"),df1).toLocalDate().isEqual(LocalDateTime.parse(o.getString("StopDate"),df1).toLocalDate())){
|
|
if(LocalDateTime.parse(o.getString("StartDate"),df1).toLocalDate().isEqual(LocalDateTime.parse(o.getString("StopDate"),df1).toLocalDate())){
|
|
//开始日期和结束日期是相同的情况 说明是加班区间只存在于当天的情况
|
|
//开始日期和结束日期是相同的情况 说明是加班区间只存在于当天的情况
|
|
- if(max.isAfter(LocalTime.parse("19:00:00",df4))){
|
|
|
|
- //判断打卡时间是不是大于19:00 大于才算加班 通过打卡计算加班时长 与加班单作比较 取小
|
|
|
|
- Duration timeDurantion = Duration.between(LocalTime.parse("18:00:00", df4), max);
|
|
|
|
-// //如果结束时间大于13:00
|
|
|
|
-// if(max.isAfter(LocalTime.parse("13:00:00",df4))){
|
|
|
|
-// timeDurantion=timeDurantion.minusHours(1);
|
|
|
|
-// }
|
|
|
|
-// //如果结束时间大于18:00
|
|
|
|
-// if(max.isAfter(LocalTime.parse("18:00:00",df4))){
|
|
|
|
-// timeDurantion=timeDurantion.minusMinutes(30);
|
|
|
|
-// }
|
|
|
|
- System.out.println(timeDurantion.toMinutes());
|
|
|
|
- BigDecimal decimal = new BigDecimal(timeDurantion.toMinutes());
|
|
|
|
- decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
|
|
|
|
- double l = decimal.doubleValue();
|
|
|
|
- if(l<o.getDouble("OverTimeDuration")){
|
|
|
|
- overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(l));
|
|
|
|
- }else {
|
|
|
|
- overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(o.getDouble("OverTimeDuration")));
|
|
|
|
- }
|
|
|
|
|
|
+ //判断打卡时间是不是大于19:00 大于才算加班 通过打卡计算加班时长 与加班单作比较 取小
|
|
|
|
+ Duration timeDurantion = Duration.between(LocalTime.parse(workDay?"18:00:00":"08:30:00", df4), max);
|
|
|
|
+ BigDecimal decimal = new BigDecimal(timeDurantion.toMinutes());
|
|
|
|
+ decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
|
|
|
|
+ double l = decimal.doubleValue();
|
|
|
|
+ if(l<o.getDouble("OverTimeDuration")){
|
|
|
|
+ overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(l<0?0:l));
|
|
|
|
+ }else {
|
|
|
|
+ overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(o.getDouble("OverTimeDuration")));
|
|
}
|
|
}
|
|
}else {
|
|
}else {
|
|
//开始日期和结束日期是不相同的情况 说明是加班区间存在加班到第二天的情况
|
|
//开始日期和结束日期是不相同的情况 说明是加班区间存在加班到第二天的情况
|
|
LocalDateTime start = LocalDateTime.parse(o.getString("StartDate"), df1);
|
|
LocalDateTime start = LocalDateTime.parse(o.getString("StartDate"), df1);
|
|
LocalDateTime stop = start.toLocalDate().atTime(LocalTime.MAX);
|
|
LocalDateTime stop = start.toLocalDate().atTime(LocalTime.MAX);
|
|
Duration duration = Duration.between(start, stop);
|
|
Duration duration = Duration.between(start, stop);
|
|
-// if(stop.toLocalTime().isAfter(LocalTime.parse("13:00:00",df4))){
|
|
|
|
-// duration=duration.minusHours(1);
|
|
|
|
-// }
|
|
|
|
-// //如果结束时间大于18:00
|
|
|
|
-// if(stop.toLocalTime().isAfter(LocalTime.parse("18:00:00",df4))){
|
|
|
|
-// duration=duration.minusMinutes(30);
|
|
|
|
-// }
|
|
|
|
BigDecimal decimal = new BigDecimal(duration.toMinutes());
|
|
BigDecimal decimal = new BigDecimal(duration.toMinutes());
|
|
decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
|
|
decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
|
|
double l = decimal.doubleValue();
|
|
double l = decimal.doubleValue();
|
|
- if(max.isAfter(LocalTime.parse("19:00:00",df4))){
|
|
|
|
- //判断打卡时间是不是大于19:00 通过打卡计算加班时长 与加班单作比较 取小
|
|
|
|
- Duration timeDurantion = Duration.between(LocalTime.parse("18:00:00", df4), max);
|
|
|
|
- BigDecimal decimal1 = new BigDecimal(timeDurantion.toMinutes());
|
|
|
|
- decimal1=decimal1.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
|
|
|
|
- double l1 = decimal1.doubleValue();
|
|
|
|
- if(l1<l){
|
|
|
|
- overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(l1));
|
|
|
|
- }else {
|
|
|
|
- overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(l));
|
|
|
|
- }
|
|
|
|
|
|
+ //判断打卡时间是不是大于19:00 通过打卡计算加班时长 与加班单作比较 取小
|
|
|
|
+ Duration timeDurantion = Duration.between(LocalTime.parse(workDay?"18:00:00":"08:30:00", df4), max);
|
|
|
|
+ BigDecimal decimal1 = new BigDecimal(timeDurantion.toMinutes());
|
|
|
|
+ decimal1=decimal1.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
|
|
|
|
+ double l1 = decimal1.doubleValue();
|
|
|
|
+ if(l1<l){
|
|
|
|
+ overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(l1<0?0:l1));
|
|
|
|
+ }else {
|
|
|
|
+ overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(l));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}else if(LocalDateTime.parse(o.getString("StopDate"),df1).toLocalDate().isEqual(localDate)){
|
|
}else if(LocalDateTime.parse(o.getString("StopDate"),df1).toLocalDate().isEqual(localDate)){
|
|
//存在结束日期为当天的数据
|
|
//存在结束日期为当天的数据
|
|
if(LocalDateTime.parse(o.getString("StartDate"),df1).toLocalDate().isEqual(LocalDateTime.parse(o.getString("StopDate"),df1).toLocalDate())){
|
|
if(LocalDateTime.parse(o.getString("StartDate"),df1).toLocalDate().isEqual(LocalDateTime.parse(o.getString("StopDate"),df1).toLocalDate())){
|
|
//开始日期和结束日期是相同的情况 说明是加班区间只存在于当天的情况
|
|
//开始日期和结束日期是相同的情况 说明是加班区间只存在于当天的情况
|
|
- if(max.isAfter(LocalTime.parse("19:00:00",df4))){
|
|
|
|
- //判断打卡时间是不是大于19:00 通过打卡计算加班时长 与加班单作比较 取小
|
|
|
|
- Duration timeDurantion = Duration.between(LocalTime.parse("18:00:00", df4), max);
|
|
|
|
-// //如果结束时间大于13:00
|
|
|
|
-// if(max.isAfter(LocalTime.parse("13:00:00",df4))){
|
|
|
|
-// timeDurantion=timeDurantion.minusHours(1);
|
|
|
|
-// }
|
|
|
|
-// //如果结束时间大于18:00
|
|
|
|
-// if(max.isAfter(LocalTime.parse("18:00:00",df4))){
|
|
|
|
-// timeDurantion=timeDurantion.minusMinutes(30);
|
|
|
|
-// }
|
|
|
|
- BigDecimal decimal = new BigDecimal(timeDurantion.toMinutes());
|
|
|
|
- decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
|
|
|
|
- double l = decimal.doubleValue();
|
|
|
|
- if(l<o.getDouble("OverTimeDuration")){
|
|
|
|
- overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(l));
|
|
|
|
- }else {
|
|
|
|
- overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(o.getDouble("OverTimeDuration")));
|
|
|
|
- }
|
|
|
|
|
|
+ //判断打卡时间是不是大于19:00 通过打卡计算加班时长 与加班单作比较 取小
|
|
|
|
+ Duration timeDurantion = Duration.between(LocalTime.parse(workDay?"18:00:00":"08:30:00", df4), max);
|
|
|
|
+ BigDecimal decimal = new BigDecimal(timeDurantion.toMinutes());
|
|
|
|
+ decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
|
|
|
|
+ double l = decimal.doubleValue();
|
|
|
|
+ if(l<o.getDouble("OverTimeDuration")){
|
|
|
|
+ overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(l<0?0:l));
|
|
|
|
+ }else {
|
|
|
|
+ overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(o.getDouble("OverTimeDuration")));
|
|
}
|
|
}
|
|
}else {
|
|
}else {
|
|
//开始日期和结束日期是不相同的情况 说明是加班区间存在加班到第二天的情况
|
|
//开始日期和结束日期是不相同的情况 说明是加班区间存在加班到第二天的情况
|
|
LocalDateTime stop = LocalDateTime.parse(o.getString("StopDate"), df1);
|
|
LocalDateTime stop = LocalDateTime.parse(o.getString("StopDate"), df1);
|
|
LocalDateTime start = stop.toLocalDate().atTime(LocalTime.MIN);
|
|
LocalDateTime start = stop.toLocalDate().atTime(LocalTime.MIN);
|
|
Duration duration = Duration.between(start, stop);
|
|
Duration duration = Duration.between(start, stop);
|
|
-// //如果结束时间大于13:00
|
|
|
|
-// if(stop.toLocalTime().isAfter(LocalTime.parse("13:00:00",df4))){
|
|
|
|
-// duration=duration.minusHours(1);
|
|
|
|
-// }
|
|
|
|
-// //如果结束时间大于18:00
|
|
|
|
-// if(stop.toLocalTime().isAfter(LocalTime.parse("18:00:00",df4))){
|
|
|
|
-// duration=duration.minusMinutes(30);
|
|
|
|
-// }
|
|
|
|
BigDecimal decimal = new BigDecimal(duration.toMinutes());
|
|
BigDecimal decimal = new BigDecimal(duration.toMinutes());
|
|
decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
|
|
decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
|
|
double l = decimal.doubleValue();
|
|
double l = decimal.doubleValue();
|
|
- if(max.isAfter(LocalTime.parse("19:00:00",df4))){
|
|
|
|
- //判断打卡时间是不是大于19:00 通过打卡计算加班时长 与加班单作比较 取小
|
|
|
|
- Duration timeDurantion = Duration.between(LocalTime.parse("18:00:00", df4), max);
|
|
|
|
- BigDecimal decimal1 = new BigDecimal(timeDurantion.toMinutes());
|
|
|
|
- decimal1=decimal1.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
|
|
|
|
- double l1 = decimal1.doubleValue();
|
|
|
|
- if(l1<l){
|
|
|
|
- overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(l1));
|
|
|
|
- }else {
|
|
|
|
- overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(l));
|
|
|
|
- }
|
|
|
|
|
|
+ //判断打卡时间是不是大于19:00 通过打卡计算加班时长 与加班单作比较 取小
|
|
|
|
+ Duration timeDurantion = Duration.between(LocalTime.parse(workDay?"18:00:00":"08:30:00", df4), max);
|
|
|
|
+ BigDecimal decimal1 = new BigDecimal(timeDurantion.toMinutes());
|
|
|
|
+ decimal1=decimal1.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
|
|
|
|
+ double l1 = decimal1.doubleValue();
|
|
|
|
+ if(l1<l){
|
|
|
|
+ overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(l1<0?0:l1));
|
|
|
|
+ }else {
|
|
|
|
+ overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(l));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|