|
@@ -872,16 +872,8 @@ public class ReportController {
|
|
|
for (Report report : reportList) {
|
|
|
if(WorkDayCalculateUtils.isWorkDay(report.getCreateDate())){
|
|
|
HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
|
- List<Report> list = reportList.stream().filter(rl -> rl.getCreateDate().equals(report.getCreateDate()) && rl.getCreatorId().equals(report.getCreatorId())).collect(Collectors.toList());
|
|
|
- BigDecimal bigDecimal;
|
|
|
- if(list.size()>0){
|
|
|
- bigDecimal=new BigDecimal(0);
|
|
|
- for (Report r : list) {
|
|
|
- bigDecimal=bigDecimal.add(new BigDecimal(r.getWorkingTime()));
|
|
|
- }
|
|
|
- }else {
|
|
|
- bigDecimal=new BigDecimal(report.getWorkingTime());
|
|
|
- }
|
|
|
+ double sum = reportList.stream().filter(rl -> rl.getCreateDate().equals(report.getCreateDate()) && rl.getCreatorId().equals(report.getCreatorId())).mapToDouble(Report::getWorkingTime).sum();
|
|
|
+ BigDecimal bigDecimal=new BigDecimal(sum);
|
|
|
bigDecimal=bigDecimal.subtract(new BigDecimal(comTimeType.getAllday()));
|
|
|
if(report.getOvertimeHours()>bigDecimal.doubleValue()){
|
|
|
httpRespMsg.setError("加班时长不得超过总工作时长-正常工作时长");
|