|
@@ -81,6 +81,9 @@ public class ApplicationProcedureTemporaryController implements ApplicationProce
|
|
|
String endDto=applicationProcedureDto.getEndTime();
|
|
String endDto=applicationProcedureDto.getEndTime();
|
|
|
//周日-周1为上周
|
|
//周日-周1为上周
|
|
|
int dtoCount=this.checkWeek(startDto,endDto);
|
|
int dtoCount=this.checkWeek(startDto,endDto);
|
|
|
|
|
+ if(startDto.compareTo(endDto)>=0){
|
|
|
|
|
+ return CommonResult.fail("开始时间不能大于结束时间");
|
|
|
|
|
+ }
|
|
|
if(dtoCount==-1||dtoCount>countConfig){
|
|
if(dtoCount==-1||dtoCount>countConfig){
|
|
|
return CommonResult.fail("申请日期不能跨周,一周不能超过"+countConfig+"天,请重新申请");
|
|
return CommonResult.fail("申请日期不能跨周,一周不能超过"+countConfig+"天,请重新申请");
|
|
|
}
|
|
}
|
|
@@ -480,7 +483,6 @@ public class ApplicationProcedureTemporaryController implements ApplicationProce
|
|
|
public static int checkWeek(String strDate1,String strDate2) {
|
|
public static int checkWeek(String strDate1,String strDate2) {
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
calendar.setTime(TimeExchange.StringToDate(strDate1,"yyyy-MM-dd"));
|
|
calendar.setTime(TimeExchange.StringToDate(strDate1,"yyyy-MM-dd"));
|
|
|
- int year = calendar.get(Calendar.YEAR);
|
|
|
|
|
int week = calendar.get(Calendar.WEEK_OF_YEAR);
|
|
int week = calendar.get(Calendar.WEEK_OF_YEAR);
|
|
|
week=week==1?53:week;
|
|
week=week==1?53:week;
|
|
|
int day = calendar.get(Calendar.DAY_OF_WEEK)-1;
|
|
int day = calendar.get(Calendar.DAY_OF_WEEK)-1;
|
|
@@ -490,7 +492,6 @@ public class ApplicationProcedureTemporaryController implements ApplicationProce
|
|
|
}
|
|
}
|
|
|
Calendar calendar1 = Calendar.getInstance();
|
|
Calendar calendar1 = Calendar.getInstance();
|
|
|
calendar1.setTime(TimeExchange.StringToDate(strDate2,"yyyy-MM-dd"));
|
|
calendar1.setTime(TimeExchange.StringToDate(strDate2,"yyyy-MM-dd"));
|
|
|
- int year1 = calendar1.get(Calendar.YEAR);
|
|
|
|
|
int week1 = calendar1.get(Calendar.WEEK_OF_YEAR);
|
|
int week1 = calendar1.get(Calendar.WEEK_OF_YEAR);
|
|
|
week1=week1==1?53:week1;
|
|
week1=week1==1?53:week1;
|
|
|
int day1 = calendar1.get(Calendar.DAY_OF_WEEK)-1;
|
|
int day1 = calendar1.get(Calendar.DAY_OF_WEEK)-1;
|
|
@@ -498,10 +499,10 @@ public class ApplicationProcedureTemporaryController implements ApplicationProce
|
|
|
day1=7;
|
|
day1=7;
|
|
|
week1=week1-1;
|
|
week1=week1-1;
|
|
|
}
|
|
}
|
|
|
- if(year==year1&&week==week1){
|
|
|
|
|
|
|
+ if(week==week1){
|
|
|
return day1-day;
|
|
return day1-day;
|
|
|
- }else if (year==year1&&week+1==week1&&day1==1){
|
|
|
|
|
- return 1;
|
|
|
|
|
|
|
+ }else if (week+1==week1&&day1==1){
|
|
|
|
|
+ return day1+7-day;
|
|
|
}else{
|
|
}else{
|
|
|
return -1;
|
|
return -1;
|
|
|
}
|
|
}
|