|
|
@@ -76,6 +76,7 @@ public class ApplicationProcedureTemporaryController implements ApplicationProce
|
|
|
.ne("status", "0"));
|
|
|
String startDto=applicationProcedureDto.getStartTime();
|
|
|
String endDto=applicationProcedureDto.getEndTime();
|
|
|
+ //周日-周1为上周
|
|
|
int dtoCount=this.checkWeek(startDto,endDto);
|
|
|
if(dtoCount==-1||dtoCount>countConfig){
|
|
|
return CommonResult.fail("申请日期不能跨周,一周不能超过"+countConfig+"天,请重新申请");
|
|
|
@@ -83,7 +84,8 @@ public class ApplicationProcedureTemporaryController implements ApplicationProce
|
|
|
//筛选同一周数据
|
|
|
if (!list.isEmpty()){
|
|
|
String[] arr =TimeExchange.getCurrentWeekTimeFrame(startDto);
|
|
|
- list=list.stream().filter(a -> a.getStartTime().compareTo(arr[0])>=0&&a.getEndTime().compareTo(arr[1])<=0)
|
|
|
+ //开始时间为本周
|
|
|
+ list=list.stream().filter(a -> a.getStartTime().compareTo(arr[0])>=0&&a.getStartTime().compareTo(arr[1])<=0)
|
|
|
.collect(Collectors.toList());
|
|
|
}
|
|
|
if (!list.isEmpty()) {
|
|
|
@@ -94,8 +96,8 @@ public class ApplicationProcedureTemporaryController implements ApplicationProce
|
|
|
return CommonResult.fail("相同日期已有待审批申请,请勿重复申请");
|
|
|
}
|
|
|
aa=this.checkWeek(apt.getStartTime(),apt.getEndTime())+aa;
|
|
|
-
|
|
|
- if(countConfig-dtoCount<=aa){
|
|
|
+ //已申请+本次大于配置数量则不能申请
|
|
|
+ if(countConfig<aa+dtoCount){
|
|
|
return CommonResult.fail("总申请天数超过本周限额");
|
|
|
}
|
|
|
|
|
|
@@ -491,6 +493,8 @@ public class ApplicationProcedureTemporaryController implements ApplicationProce
|
|
|
}
|
|
|
if(year==year1&&week==week1){
|
|
|
return day1-day;
|
|
|
+ }else if (year==year1&&week+1==week1&&day1==1){
|
|
|
+ return day-day1;
|
|
|
}else{
|
|
|
return -1;
|
|
|
}
|