|
@@ -7383,8 +7383,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
//需要填报的最后一天
|
|
|
LocalDate lastDayOfWeek = sunday;
|
|
|
int days = sunday.lengthOfMonth() - sunday.getDayOfMonth();
|
|
|
- if (days <= 2) {
|
|
|
- //周日距离月底相差天数在2天以内,比如周日是10.29,则10.30和10.31也算在本周内
|
|
|
+ if (days <= 3) {
|
|
|
+ //周日距离月底相差天数在3天以内,比如周日是10.28,则10.29,10.30和10.31也算在本周内
|
|
|
lastDayOfWeek = sunday.plusDays(days);
|
|
|
}
|
|
|
//如果上周只有2天以内工作日,需要并到这周来
|
|
@@ -7392,7 +7392,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
LocalDate lastSaturday = lastSunday.with(DayOfWeek.SATURDAY);
|
|
|
|
|
|
if (WorkDayCalculateUtils.isWorkDay(lastSunday) && WorkDayCalculateUtils.isWorkDay(lastSaturday)) {
|
|
|
- //上周周末两天是工作日,并且只有2天以内工作日,需要并到这周来
|
|
|
+ //合并上周的工作日的情况:上周周末两天是工作日,并且只有2天以内工作日,需要并到这周来
|
|
|
LocalDate lastMonday = lastSunday.with(DayOfWeek.MONDAY);
|
|
|
boolean hasMoreWorkDays = false;
|
|
|
while (lastMonday.isBefore(lastSaturday)) {
|
|
@@ -7405,15 +7405,33 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
if (!hasMoreWorkDays) {
|
|
|
firstDayOfWeek = lastSaturday;
|
|
|
}
|
|
|
- }
|
|
|
- //如果本周一周二中有工作日,但是是上个月的月末,会被合并到上周去,本周要去掉
|
|
|
- if (WorkDayCalculateUtils.isWorkDay(firstDayOfWeek) && firstDayOfWeek.getDayOfMonth() >= 30) {
|
|
|
- firstDayOfWeek = firstDayOfWeek.plusDays(1);
|
|
|
- if (WorkDayCalculateUtils.isWorkDay(firstDayOfWeek) && firstDayOfWeek.getDayOfMonth() >= 30) {
|
|
|
- firstDayOfWeek = firstDayOfWeek.plusDays(1);
|
|
|
+ } else {
|
|
|
+ //剔除被合并到上周的情况,如果本周一周二周三中有工作日,但是是上个月的月末,会被合并到上周去,本周要去掉
|
|
|
+ boolean hasFirstDayOfMonth = false;
|
|
|
+ LocalDate checkDate = firstDayOfWeek;
|
|
|
+ int beforeDays = 0;
|
|
|
+ while (!checkDate.isAfter(lastDayOfWeek)) {
|
|
|
+ if (checkDate.getDayOfMonth() == 1) {
|
|
|
+ hasFirstDayOfMonth = true;
|
|
|
+ break;
|
|
|
+ } else {
|
|
|
+ beforeDays++;
|
|
|
+ }
|
|
|
+ checkDate = checkDate.plusDays(1);
|
|
|
+ }
|
|
|
+ if (hasFirstDayOfMonth && beforeDays <= 3) {
|
|
|
+ firstDayOfWeek = checkDate;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+// if (WorkDayCalculateUtils.isWorkDay(firstDayOfWeek) && firstDayOfWeek.getDayOfMonth() >= 30) {
|
|
|
+// firstDayOfWeek = firstDayOfWeek.plusDays(1);
|
|
|
+// if (WorkDayCalculateUtils.isWorkDay(firstDayOfWeek) && firstDayOfWeek.getDayOfMonth() >= 30) {
|
|
|
+// firstDayOfWeek = firstDayOfWeek.plusDays(1);
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+
|
|
|
//再按照当前用户的入职离职日期进行过滤
|
|
|
LocalDate entryDate = user.getInductionDate();
|
|
|
LocalDate leaveDate = user.getInactiveDate();
|