From cb6a246ca81339abff8cec8c1cbead516ee85df6 Mon Sep 17 00:00:00 2001 From: seaon Date: Tue, 21 Jan 2025 11:25:51 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=9B=B4=E5=8F=96=E5=B7=A5?= =?UTF-8?q?=E9=BE=84=E6=97=B6=EF=BC=8C=E5=88=86=E6=AE=B5=E6=B4=BE=E5=8F=91?= =?UTF-8?q?=E9=A2=9D=E5=BA=A6=E7=9A=84=E9=80=BB=E8=BE=91=EF=BC=8C=E7=9B=B4?= =?UTF-8?q?=E6=8E=A5=E6=A0=B9=E6=8D=AE=E7=9B=B4=E5=8F=96=E5=B7=A5=E9=BE=84?= =?UTF-8?q?=E5=80=BC=E8=AE=A1=E7=AE=97=E5=88=86=E9=9A=94=E6=9C=88=E4=BB=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tactics/BySchedulePaymentWay.java | 49 +++++++++---------- 1 file changed, 23 insertions(+), 26 deletions(-) diff --git a/src/com/engine/jucailinkq/attendance/vacation/job/holidaygeneration/tactics/BySchedulePaymentWay.java b/src/com/engine/jucailinkq/attendance/vacation/job/holidaygeneration/tactics/BySchedulePaymentWay.java index ddaf946..113e4f1 100644 --- a/src/com/engine/jucailinkq/attendance/vacation/job/holidaygeneration/tactics/BySchedulePaymentWay.java +++ b/src/com/engine/jucailinkq/attendance/vacation/job/holidaygeneration/tactics/BySchedulePaymentWay.java @@ -10,6 +10,7 @@ import com.google.common.collect.Maps; import lombok.extern.slf4j.Slf4j; import weaver.general.Util; +import java.time.format.DateTimeFormatter; import java.util.List; import java.util.Map; @@ -232,34 +233,30 @@ public class BySchedulePaymentWay implements HolidayGenerationWay{ double restTime=0.0; //折算 if (changeMethodEnum == QuotaChangeMethodEnum.CONVERT){ - int beginYearMonth = DateUtil.getBetWeenMonths(qsrq,sxrq); - if (beginYearMonth < 0){ - beginYearMonth = 0; - } - beginYearMonth = beginYearMonth+seniority; - int endYearMonth = DateUtil.getBetWeenMonths(qsrq,nextSxrq); - endYearMonth = endYearMonth+seniority; - int beginYear = beginYearMonth/12; - int endYear = endYearMonth/12; - - //残年分割日期 - String divideTime = DateUtil.beforeMonth(qsrq,seniority); - divideTime = sxrq.split("-")[0]+"-"+divideTime.split("-")[1]+"-"+divideTime.split("-")[2]; - divideTime = DateUtil.nextMonth(divideTime,1,DateUtil.yyyyMM)+"-01"; + int beginYear=0;//生效日期对应的年度 + int endYear=0;//失效日期对应的年度 + String divideTime = "";//工龄变更日期 if (jgscsf.equals("2")){ - //直接取工龄字段 - beginYear = seniority/12; + beginYear = Double.valueOf(ljcrglyfslwz).intValue(); endYear = beginYear+1; - - //分割日期 -// int month = DateUtil.getBetWeenMonths(qsrq,sxrq); -// if (month < 0){ -// month = 0; -// } -// int historySeniority = seniority-month; -// divideTime = DateUtil.beforeMonth(qsrq,historySeniority); - divideTime = sxrq.split("-")[0]+"-"+qsrq.split("-")[1]+"-"+qsrq.split("-")[2]; - divideTime = DateUtil.nextMonth(divideTime,1,DateUtil.yyyyMM)+"-01"; + DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + double divdemonths = Double.valueOf(ljcrglyfslwz) - Double.valueOf(ljcrglyfslwz).intValue(); + divideTime = DateUtil.nextMonth(sxrq,(int)Math.ceil(divdemonths*12),dateTimeFormatter); + }else { + int beginYearMonth = DateUtil.getBetWeenMonths(qsrq, sxrq); + if (beginYearMonth < 0) { + beginYearMonth = 0; + } + beginYearMonth = beginYearMonth + seniority; + int endYearMonth = DateUtil.getBetWeenMonths(qsrq, nextSxrq); + endYearMonth = endYearMonth + seniority; + beginYear = beginYearMonth / 12; + endYear = endYearMonth / 12; + + //残年分割日期 + divideTime = DateUtil.beforeMonth(qsrq, seniority); + divideTime = sxrq.split("-")[0] + "-" + divideTime.split("-")[1] + "-" + divideTime.split("-")[2]; + divideTime = DateUtil.nextMonth(divideTime, 1, DateUtil.yyyyMM) + "-01"; } Map beginYearmap = VocationCommonUtil.getVocationMap(vocationList, beginYear, yjzd,userId);