From 16b1617ba569b2f9e572e15890d060cea2836410 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Mon, 7 Nov 2022 16:51:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=BA=E5=91=98=E6=A0=87=E8=AF=86-fixBug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/EmployeeIdentifiedServiceImpl.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/com/engine/bjcj220907/service/impl/EmployeeIdentifiedServiceImpl.java b/src/com/engine/bjcj220907/service/impl/EmployeeIdentifiedServiceImpl.java index 2cc7682..355bc63 100644 --- a/src/com/engine/bjcj220907/service/impl/EmployeeIdentifiedServiceImpl.java +++ b/src/com/engine/bjcj220907/service/impl/EmployeeIdentifiedServiceImpl.java @@ -72,7 +72,7 @@ public class EmployeeIdentifiedServiceImpl extends Service implements EmployeeId baseBean.writeLog(info.getXm() + "的入职日期获取失败"); return false; } - // 判断cal的月份是否和nextNextMonthCal在同一个月 + // 判断cal是否和nextNextMonthCal在同一个月或者之后 if (checkMonth(cal, nextNextMonthCal)) { info.setRz(1); flag = true; @@ -86,7 +86,7 @@ public class EmployeeIdentifiedServiceImpl extends Service implements EmployeeId baseBean.writeLog(info.getXm() + "的转正日期获取失败"); return false; } - // 判断cal的月份是否和nextNextMonthCal在同一个月 + // 判断cal是否和nextNextMonthCal在同一个月或者之后 if (checkMonth(cal, nextNextMonthCal)) { info.setZz(1); flag = true; @@ -100,7 +100,7 @@ public class EmployeeIdentifiedServiceImpl extends Service implements EmployeeId baseBean.writeLog(info.getXm() + "的调动日期获取失败"); return false; } - // 判断cal的月份是否和nextNextMonthCal在同一个月 + // 判断cal是否和nextNextMonthCal在同一个月或者之后 if (checkMonth(cal, nextNextMonthCal)) { info.setDd(1); flag = true; @@ -181,13 +181,19 @@ public class EmployeeIdentifiedServiceImpl extends Service implements EmployeeId } /** - * @description 判断cal的月份是否和nextNextMonthCal在同一个月 + * @description 判断cal是否和nextNextMonthCal在同一个月或者之后 * @return null * @author Harryxzy * @date 2022/11/1 15:10 */ private boolean checkMonth(Calendar cal,Calendar nextNextMonthCal){ - return cal.get(Calendar.MONTH) == nextNextMonthCal.get(Calendar.MONTH); + Calendar countCal = Calendar.getInstance(); + countCal.setTime(nextNextMonthCal.getTime()); + countCal.set(Calendar.DATE,1); + if(cal.getTime().after(countCal.getTime()) || (cal.getTime().compareTo(countCal.getTime())==0) ){ + return true; + } + return false; } /**