|
@@ -13,6 +13,7 @@ import com.management.platform.service.*;
|
|
import com.management.platform.util.ExcelUtil;
|
|
import com.management.platform.util.ExcelUtil;
|
|
import com.management.platform.util.HttpRespMsg;
|
|
import com.management.platform.util.HttpRespMsg;
|
|
import com.management.platform.util.ListUtil;
|
|
import com.management.platform.util.ListUtil;
|
|
|
|
+import com.management.platform.util.WorkDayCalculateUtils;
|
|
import org.apache.poi.EncryptedDocumentException;
|
|
import org.apache.poi.EncryptedDocumentException;
|
|
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
|
|
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
|
|
import org.apache.poi.ss.usermodel.CellType;
|
|
import org.apache.poi.ss.usermodel.CellType;
|
|
@@ -34,7 +35,10 @@ import javax.servlet.http.HttpServletResponse;
|
|
import java.io.*;
|
|
import java.io.*;
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
import java.sql.Timestamp;
|
|
import java.sql.Timestamp;
|
|
-import java.text.*;
|
|
|
|
|
|
+import java.text.DateFormat;
|
|
|
|
+import java.text.DecimalFormat;
|
|
|
|
+import java.text.NumberFormat;
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
import java.time.Duration;
|
|
import java.time.Duration;
|
|
import java.time.LocalDate;
|
|
import java.time.LocalDate;
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
@@ -3090,8 +3094,16 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
DecimalFormat dft = new DecimalFormat("0%");
|
|
DecimalFormat dft = new DecimalFormat("0%");
|
|
LocalDateTime sDate = LocalDate.parse(startDate).atTime(LocalTime.now());
|
|
LocalDateTime sDate = LocalDate.parse(startDate).atTime(LocalTime.now());
|
|
LocalDateTime eDate = LocalDate.parse(endDate).atTime(LocalTime.now());
|
|
LocalDateTime eDate = LocalDate.parse(endDate).atTime(LocalTime.now());
|
|
|
|
+ List<LocalDateTime> dateTimeList = getDays(sDate, eDate);
|
|
Duration duration=Duration.between(sDate,eDate);
|
|
Duration duration=Duration.between(sDate,eDate);
|
|
|
|
+ //去掉非工作日
|
|
long days = duration.toDays();
|
|
long days = duration.toDays();
|
|
|
|
+ for (LocalDateTime localDateTime : dateTimeList) {
|
|
|
|
+ if(WorkDayCalculateUtils.isWorkDay(localDateTime.toLocalDate())){
|
|
|
|
+ days-=1;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ System.out.println(days);
|
|
Integer companyId= userMapper.selectById(request.getHeader("token")).getCompanyId();
|
|
Integer companyId= userMapper.selectById(request.getHeader("token")).getCompanyId();
|
|
TimeType timeType = timeTypeMapper.selectById(companyId);
|
|
TimeType timeType = timeTypeMapper.selectById(companyId);
|
|
String alertTime = timeType.getAlertTime();
|
|
String alertTime = timeType.getAlertTime();
|
|
@@ -3265,5 +3277,13 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
}
|
|
}
|
|
return allList;
|
|
return allList;
|
|
}
|
|
}
|
|
|
|
+ private List<LocalDateTime> getDays(LocalDateTime start, LocalDateTime end) {
|
|
|
|
+ List<LocalDateTime> result = new ArrayList<LocalDateTime>();
|
|
|
|
+ while (start.isBefore(end)) {
|
|
|
|
+ result.add(start.plusDays(1));
|
|
|
|
+ start=start.plusDays(1);
|
|
|
|
+ }
|
|
|
|
+ return result;
|
|
|
|
+ }
|
|
|
|
|
|
}
|
|
}
|