生成合同
This commit is contained in:
parent
a24d186920
commit
b5653508ee
@ -9,6 +9,7 @@ import java.text.ParseException;
|
|||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.time.*;
|
import java.time.*;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.time.temporal.ChronoUnit;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -197,4 +198,15 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
|
|||||||
public static String toString(LocalDate date){
|
public static String toString(LocalDate date){
|
||||||
return toString(date,"yyyy-MM-dd");
|
return toString(date,"yyyy-MM-dd");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static long differentMonth(Date date,Date date2){
|
||||||
|
LocalDate startDate = date.toInstant()
|
||||||
|
.atZone(ZoneId.systemDefault())
|
||||||
|
.toLocalDate();
|
||||||
|
LocalDate endDate = date2.toInstant()
|
||||||
|
.atZone(ZoneId.systemDefault())
|
||||||
|
.toLocalDate();
|
||||||
|
return ChronoUnit.MONTHS.between(startDate.withDayOfMonth(1), endDate.withDayOfMonth(1));
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -616,10 +616,18 @@ public class PsContractInfoServiceImpl implements IPsContractInfoService {
|
|||||||
if(vo.getFirstApplyDate() != null){
|
if(vo.getFirstApplyDate() != null){
|
||||||
Date date = new Date();
|
Date date = new Date();
|
||||||
Date startDate = vo.getFirstApplyDate();
|
Date startDate = vo.getFirstApplyDate();
|
||||||
int year = (date.getYear() - startDate.getYear());
|
long num = DateUtils.differentMonth(startDate,date);
|
||||||
int month = (date.getMonth() - startDate.getMonth());
|
if(num<=0){
|
||||||
int day = (date.getDate() - startDate.getDate());
|
vo.setConTime("0");
|
||||||
vo.setConTime((year>0?year+"年":"")+(month>0?month+"月":"")+(day>0?day+"天":"") );
|
}else if(num<12){
|
||||||
|
vo.setConTime(num+"个月");
|
||||||
|
}else {
|
||||||
|
vo.setConTime(((int)(num/12))+"年"+num%12+"个月");
|
||||||
|
}
|
||||||
|
// int year = (date.getYear() - startDate.getYear());
|
||||||
|
// int month = (date.getMonth() - startDate.getMonth());
|
||||||
|
//// int day = (date.getDate() - startDate.getDate());
|
||||||
|
// vo.setConTime((year>0?year+"年":"")+(month>0?month+"月":"")/*+(day>0?day+"天":"") */);
|
||||||
}
|
}
|
||||||
//电子签章审批
|
//电子签章审批
|
||||||
if(StringUtils.equals(CommonStatusEnum.FAIL.getCode(),vo.getSignStatus())){
|
if(StringUtils.equals(CommonStatusEnum.FAIL.getCode(),vo.getSignStatus())){
|
||||||
|
Loading…
Reference in New Issue
Block a user