Commit cdbb41e4 authored by huyuchen's avatar huyuchen

huych-社保自动化相关提交

parent 84573e24
......@@ -20,10 +20,10 @@ public class TEmployeeContractDateVo implements Serializable {
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
private Date registDate;
@Schema(description = "月份后 1、2、3...")
@Schema(description = "月份后 0、1、2、3...")
private int monthAfter;
@Schema(description = "年份后 1、2、3...")
@Schema(description = "年份后 0、1、2、3...")
private int yearAfter;
}
......@@ -1509,14 +1509,21 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
.atZone(ZoneId.systemDefault())
.toLocalDate();
// 添加年数和月数
localDate = localDate
.plusYears(vo.getYearAfter())
.plusMonths(vo.getMonthAfter())
.minusDays(1);
// 转回Date类型
return Date.from(localDate.atStartOfDay()
.atZone(ZoneId.systemDefault())
.toInstant());
if (vo.getMonthAfter() ==0 && vo.getYearAfter() ==0) {
// 转回Date类型
return Date.from(localDate.atStartOfDay()
.atZone(ZoneId.systemDefault())
.toInstant());
} else {
localDate = localDate
.plusYears(vo.getYearAfter())
.plusMonths(vo.getMonthAfter())
.minusDays(1);
// 转回Date类型
return Date.from(localDate.atStartOfDay()
.atZone(ZoneId.systemDefault())
.toInstant());
}
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment