|
|
@@ -403,45 +403,45 @@ public class DkRecordServiceImpl implements DkRecordService { |
|
|
|
|
|
|
|
|
|
|
|
// 判断是否为休假日加班 |
|
|
|
// if(Constans.EXPORT_ZHOULIU==week || Constans.EXPORT_ZHOURI== week){ |
|
|
|
// if(dk.getClockIn() != null && dk.getClockOut() != null){ |
|
|
|
// dayRecord.setXiuxiri("*"); |
|
|
|
// dayRecord.setRemark("加班1次"); |
|
|
|
// // 计算时间差 |
|
|
|
// Duration duration = Duration.between(dk.getClockIn(), dk.getClockOut()); |
|
|
|
// // 获取小时差(注意:此方法会舍去分钟和秒部分) |
|
|
|
// long hours1 = duration.toMinutes(); // 结果:6 小时(15:45 - 09:30 = 6小时15分钟) |
|
|
|
// |
|
|
|
// if(hours1 >= 30){ |
|
|
|
// BigDecimal a = new BigDecimal(hours1); |
|
|
|
// BigDecimal b = new BigDecimal("60"); |
|
|
|
// // 执行除法,指定精度和舍入模式 |
|
|
|
// BigDecimal result = a.divide(b, 1, BigDecimal.ROUND_HALF_UP); |
|
|
|
// restOverTime = restOverTime.add(result); |
|
|
|
// } |
|
|
|
// } |
|
|
|
// }else { |
|
|
|
// // 判断是否为工作日加班 |
|
|
|
// if(dk.getClockOut() != null){ |
|
|
|
// if(dk.getClockOut().isAfter(workEndTime1)){ |
|
|
|
// // 计算时间差 |
|
|
|
// Duration duration = Duration.between(workEndTime1, dk.getClockOut()); |
|
|
|
// // 获取小时差(注意:此方法会舍去分钟和秒部分) |
|
|
|
// long hours1 = duration.toMinutes(); // 结果:6 小时(15:45 - 09:30 = 6小时15分钟) |
|
|
|
// |
|
|
|
// if(hours1 >= 30){ |
|
|
|
// BigDecimal a = new BigDecimal(hours1); |
|
|
|
// BigDecimal b = new BigDecimal("60"); |
|
|
|
// // 执行除法,指定精度和舍入模式 |
|
|
|
// BigDecimal result = a.divide(b, 1, BigDecimal.ROUND_HALF_UP); |
|
|
|
// dayRecord.setGongzuori("*"); |
|
|
|
// dayRecord.setRemark("加班1次:" + result + "小时"); |
|
|
|
// |
|
|
|
// workOverTime = workOverTime.add(result); |
|
|
|
// } |
|
|
|
// } |
|
|
|
// } |
|
|
|
// } |
|
|
|
if(Constans.EXPORT_ZHOULIU==week || Constans.EXPORT_ZHOURI== week){ |
|
|
|
if(dk.getClockIn() != null && dk.getClockOut() != null){ |
|
|
|
dayRecord.setXiuxiri("●"); |
|
|
|
dayRecord.setRemark("加班1次"); |
|
|
|
// 计算时间差 |
|
|
|
Duration duration = Duration.between(dk.getClockIn(), dk.getClockOut()); |
|
|
|
// 获取小时差(注意:此方法会舍去分钟和秒部分) |
|
|
|
long hours1 = duration.toMinutes(); // 结果:6 小时(15:45 - 09:30 = 6小时15分钟) |
|
|
|
|
|
|
|
if(hours1 >= 30){ |
|
|
|
BigDecimal a = new BigDecimal(hours1); |
|
|
|
BigDecimal b = new BigDecimal("60"); |
|
|
|
// 执行除法,指定精度和舍入模式 |
|
|
|
BigDecimal result = a.divide(b, 1, BigDecimal.ROUND_HALF_UP); |
|
|
|
restOverTime = restOverTime.add(result); |
|
|
|
} |
|
|
|
} |
|
|
|
}else { |
|
|
|
// 判断是否为工作日加班 |
|
|
|
if(dk.getClockOut() != null){ |
|
|
|
if(dk.getClockOut().isAfter(workEndTime1)){ |
|
|
|
// 计算时间差 |
|
|
|
Duration duration = Duration.between(workEndTime1, dk.getClockOut()); |
|
|
|
// 获取小时差(注意:此方法会舍去分钟和秒部分) |
|
|
|
long hours1 = duration.toMinutes(); // 结果:6 小时(15:45 - 09:30 = 6小时15分钟) |
|
|
|
|
|
|
|
if(hours1 >= 30){ |
|
|
|
BigDecimal a = new BigDecimal(hours1); |
|
|
|
BigDecimal b = new BigDecimal("60"); |
|
|
|
// 执行除法,指定精度和舍入模式 |
|
|
|
BigDecimal result = a.divide(b, 1, BigDecimal.ROUND_HALF_UP); |
|
|
|
dayRecord.setGongzuori("●"); |
|
|
|
dayRecord.setRemark("加班1次:" + result + "小时"); |
|
|
|
|
|
|
|
workOverTime = workOverTime.add(result); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// 判断是否为法定节假日加班 |
|
|
|
// // 获取法定节假日时间 |
|
|
|
// List<LocalDate> holidays = getHolidays(LocalDate.now().getYear()); |