|
|
@ -10,6 +10,8 @@ import com.google.common.collect.Maps;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import weaver.general.Util;
|
|
|
|
import weaver.general.Util;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.text.DateFormatter;
|
|
|
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
|
import java.util.Calendar;
|
|
|
|
import java.util.Calendar;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
@ -68,6 +70,8 @@ public class SinglePaymentInFullWay implements HolidayGenerationWay {
|
|
|
|
String schdedkzsxrq = Util.null2String(vocationList.get(0).get("schdedkzsxrq"));
|
|
|
|
String schdedkzsxrq = Util.null2String(vocationList.get(0).get("schdedkzsxrq"));
|
|
|
|
//间隔时长算法
|
|
|
|
//间隔时长算法
|
|
|
|
String jgscsf = Util.null2String(vocationList.get(0).get("jgsc"));
|
|
|
|
String jgscsf = Util.null2String(vocationList.get(0).get("jgsc"));
|
|
|
|
|
|
|
|
//累计时长单位:0:年;1:月
|
|
|
|
|
|
|
|
String ljgldw = Util.null2String(vocationList.get(0).get("lsgldw"));
|
|
|
|
|
|
|
|
|
|
|
|
if ("".equals(qsrq)){
|
|
|
|
if ("".equals(qsrq)){
|
|
|
|
return Maps.newHashMap();
|
|
|
|
return Maps.newHashMap();
|
|
|
@ -247,12 +251,31 @@ public class SinglePaymentInFullWay implements HolidayGenerationWay {
|
|
|
|
String wscl = Util.null2String(vocationList.get(0).get("wscl"));
|
|
|
|
String wscl = Util.null2String(vocationList.get(0).get("wscl"));
|
|
|
|
//间隔时长算法
|
|
|
|
//间隔时长算法
|
|
|
|
String jgscsf = Util.null2String(vocationList.get(0).get("jgsc"));
|
|
|
|
String jgscsf = Util.null2String(vocationList.get(0).get("jgsc"));
|
|
|
|
|
|
|
|
//累计工龄数或者直取工龄数
|
|
|
|
int seniority = "".equals(ljcrglyfslwz)?0:Double.valueOf(ljcrglyfslwz).intValue();
|
|
|
|
int seniority = 0;
|
|
|
|
|
|
|
|
//累计时长单位:0:年;1:月
|
|
|
|
|
|
|
|
String ljgldw = Util.null2String(vocationList.get(0).get("lsgldw"));
|
|
|
|
|
|
|
|
if(!"2".equals(jgscsf)) {
|
|
|
|
|
|
|
|
//间隔时长不为直取工龄时,进行取整处理 todo:实际上累计工龄为年时 基本上都是有小数的 ,都不应该取整 ,这里的逻辑有待优化
|
|
|
|
|
|
|
|
seniority = "".equals(ljcrglyfslwz) ? 0 : Double.valueOf(ljcrglyfslwz).intValue();
|
|
|
|
|
|
|
|
}
|
|
|
|
double restTime=0.0;
|
|
|
|
double restTime=0.0;
|
|
|
|
//折算
|
|
|
|
//折算
|
|
|
|
if (changeMethodEnum == QuotaChangeMethodEnum.CONVERT){
|
|
|
|
if (changeMethodEnum == QuotaChangeMethodEnum.CONVERT){
|
|
|
|
|
|
|
|
int beginYear = 0;
|
|
|
|
|
|
|
|
int endYear = 0;
|
|
|
|
|
|
|
|
String divideTime = "";
|
|
|
|
|
|
|
|
if("2".equals(jgscsf)) {
|
|
|
|
|
|
|
|
//直接取工龄字段
|
|
|
|
|
|
|
|
beginYear = Double.valueOf(ljcrglyfslwz).intValue();
|
|
|
|
|
|
|
|
endYear = beginYear+1;
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
//LocalDateTime localDateTime = DateUtil.getTime(sxrq);
|
|
|
|
|
|
|
|
//localDateTime = localDateTime.plusMonths((int)Math.ceil(divdemonths*12));
|
|
|
|
|
|
|
|
//divideTime = localDateTime.format(dateTimeFormatter);
|
|
|
|
|
|
|
|
}else {
|
|
|
|
int beginYearMonth = DateUtil.getBetWeenMonths(qsrq, sxrq);
|
|
|
|
int beginYearMonth = DateUtil.getBetWeenMonths(qsrq, sxrq);
|
|
|
|
if (beginYearMonth < 0) {
|
|
|
|
if (beginYearMonth < 0) {
|
|
|
|
beginYearMonth = 0;
|
|
|
|
beginYearMonth = 0;
|
|
|
@ -260,29 +283,12 @@ public class SinglePaymentInFullWay implements HolidayGenerationWay {
|
|
|
|
beginYearMonth = beginYearMonth + seniority;
|
|
|
|
beginYearMonth = beginYearMonth + seniority;
|
|
|
|
int endYearMonth = DateUtil.getBetWeenMonths(qsrq, nextSxrq);
|
|
|
|
int endYearMonth = DateUtil.getBetWeenMonths(qsrq, nextSxrq);
|
|
|
|
endYearMonth = endYearMonth + seniority;
|
|
|
|
endYearMonth = endYearMonth + seniority;
|
|
|
|
int beginYear = beginYearMonth/12;
|
|
|
|
beginYear = beginYearMonth / 12;
|
|
|
|
int endYear = endYearMonth/12;
|
|
|
|
endYear = endYearMonth / 12;
|
|
|
|
|
|
|
|
|
|
|
|
//残年分割日期
|
|
|
|
//残年分割日期
|
|
|
|
String divideTime = DateUtil.beforeMonth(qsrq,seniority);
|
|
|
|
divideTime = DateUtil.beforeMonth(qsrq,seniority);
|
|
|
|
divideTime = sxrq.split("-")[0]+"-"+divideTime.split("-")[1]+"-"+divideTime.split("-")[2];
|
|
|
|
divideTime = sxrq.split("-")[0]+"-"+divideTime.split("-")[1]+"-"+divideTime.split("-")[2];
|
|
|
|
if (jgscsf.equals("2")){
|
|
|
|
|
|
|
|
//直接取工龄字段
|
|
|
|
|
|
|
|
beginYear = seniority/12;
|
|
|
|
|
|
|
|
endYear = beginYear+1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//分割日期
|
|
|
|
|
|
|
|
int month = DateUtil.getBetWeenMonths(qsrq,sxrq);
|
|
|
|
|
|
|
|
if (month < 0){
|
|
|
|
|
|
|
|
month = 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
int historySeniority = seniority-month<0?0:seniority-month;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
divideTime = DateUtil.beforeMonth(qsrq,historySeniority);
|
|
|
|
|
|
|
|
divideTime = sxrq.split("-")[0]+"-"+divideTime.split("-")[1]+"-"+divideTime.split("-")[2];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String,Object> beginYearmap = VocationCommonUtil.getVocationMap(vocationList, beginYear, yjzd,userId);
|
|
|
|
Map<String,Object> beginYearmap = VocationCommonUtil.getVocationMap(vocationList, beginYear, yjzd,userId);
|
|
|
|
Map<String,Object> endYearmap = VocationCommonUtil.getVocationMap(vocationList, endYear, yjzd,userId);
|
|
|
|
Map<String,Object> endYearmap = VocationCommonUtil.getVocationMap(vocationList, endYear, yjzd,userId);
|
|
|
|
double beginEdktsc = Double.valueOf(beginYearmap.get("edktsc") == null? "0" :Util.null2String(beginYearmap.get("edktsc")));
|
|
|
|
double beginEdktsc = Double.valueOf(beginYearmap.get("edktsc") == null? "0" :Util.null2String(beginYearmap.get("edktsc")));
|
|
|
@ -322,13 +328,12 @@ public class SinglePaymentInFullWay implements HolidayGenerationWay {
|
|
|
|
restTime = VocationCommonUtil.handleRestDays(beforeRestTime+afterRestTime,wscl);
|
|
|
|
restTime = VocationCommonUtil.handleRestDays(beforeRestTime+afterRestTime,wscl);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
}else {
|
|
|
|
//不折算
|
|
|
|
//不折算
|
|
|
|
int beginYear = 0;
|
|
|
|
int beginYear = 0;
|
|
|
|
if (jgscsf.equals("2")){
|
|
|
|
if (jgscsf.equals("2")){
|
|
|
|
//直接取工龄字段
|
|
|
|
//直接取工龄字段
|
|
|
|
beginYear = seniority/12;
|
|
|
|
beginYear = Double.valueOf(ljcrglyfslwz).intValue();
|
|
|
|
}else {
|
|
|
|
}else {
|
|
|
|
//起算日期与当前日期间隔+工龄字段
|
|
|
|
//起算日期与当前日期间隔+工龄字段
|
|
|
|
int beginYearMonth = DateUtil.getBetWeenMonths(qsrq,sxrq);
|
|
|
|
int beginYearMonth = DateUtil.getBetWeenMonths(qsrq,sxrq);
|
|
|
|