|
@@ -760,7 +760,7 @@ public class WeixinUserImpl implements IWeixinUserService{
|
|
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public Map<String, Object> U8Vacation(String id) throws ParseException {
|
|
|
|
|
|
+ public Map<String, Object> U8Vacation(String id,String year) throws ParseException {
|
|
Map<String,Object> map=new HashMap<>();
|
|
Map<String,Object> map=new HashMap<>();
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");//日期格式化
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");//日期格式化
|
|
SimpleDateFormat sdt = new SimpleDateFormat("yyyy");
|
|
SimpleDateFormat sdt = new SimpleDateFormat("yyyy");
|
|
@@ -770,28 +770,54 @@ public class WeixinUserImpl implements IWeixinUserService{
|
|
int yearCount=0;
|
|
int yearCount=0;
|
|
int yearCounts=0;
|
|
int yearCounts=0;
|
|
int lyearCount=0;
|
|
int lyearCount=0;
|
|
- List<BdAnnualLeave> years = bdAnnualLeaveMapper.getYear(simpleDateFormat.format(newDate));
|
|
|
|
|
|
+ int lyearCounts=0;
|
|
|
|
+ List<BdAnnualLeave> years = bdAnnualLeaveMapper.getYear(year);
|
|
if (years!=null&&years.size()>0&&userByid.getEntryDate()!=null){
|
|
if (years!=null&&years.size()>0&&userByid.getEntryDate()!=null){
|
|
for (BdAnnualLeave ls:years){
|
|
for (BdAnnualLeave ls:years){
|
|
- if (userByid.getWorkMoth().equals("0")&&DateUtils.getDate().getTime()>userByid.getTrialEndDate().getTime()){
|
|
|
|
- yearCount=5;
|
|
|
|
- }else {
|
|
|
|
- if(oConvertUtils.isNotEmpty(userByid.getEntryDate())&&Integer.parseInt(sdt.format(userByid.getEntryDate()))<Integer.parseInt(ls.getYearName())) {
|
|
|
|
|
|
+ if (Integer.parseInt(year)==Integer.parseInt(ls.getYearName())){
|
|
|
|
+ if (oConvertUtils.isNotEmpty(userByid.getEntryDate())&&Integer.parseInt(sdt.format(userByid.getEntryDate()))==Integer.parseInt(year)){
|
|
|
|
+ int i = daysBetween(userByid.getEntryDate(), DateUtils.parseDate(ls.getYearName() + "-12-31", "yyyy-MM-dd"));
|
|
|
|
+ int yearToWorkMoth = getYearToWorkMoth(userByid.getWorkMoth());
|
|
|
|
+ BigDecimal multiply = new BigDecimal(yearToWorkMoth).multiply(new BigDecimal(i));
|
|
|
|
+ BigDecimal bigDecimal = multiply.divide(new BigDecimal("365"),0, BigDecimal.ROUND_DOWN);
|
|
|
|
+ yearCounts+=Integer.parseInt(bigDecimal.toString());
|
|
|
|
+ yearCount+=Integer.parseInt(bigDecimal.toString());
|
|
|
|
+ }else {
|
|
|
|
+ yearCount += getYear(userByid.getEntryDate(), ls.getBeginDate(), userByid);
|
|
|
|
+ yearCounts += getYear(userByid.getEntryDate(), ls.getBeginDate(), userByid);
|
|
|
|
+ }
|
|
|
|
+ }else if (Integer.parseInt(ls.getYearName())<Integer.parseInt(year)&&Integer.parseInt(year)-1!=Integer.parseInt(ls.getYearName())&&oConvertUtils.isNotEmpty(userByid.getEntryDate())&&Integer.parseInt(sdt.format(userByid.getEntryDate()))<=Integer.parseInt(ls.getYearName())){
|
|
|
|
+ if (Integer.parseInt(sdt.format(userByid.getEntryDate()))<Integer.parseInt(ls.getYearName())) {
|
|
yearCount += getYear(userByid.getEntryDate(), ls.getBeginDate(), userByid);
|
|
yearCount += getYear(userByid.getEntryDate(), ls.getBeginDate(), userByid);
|
|
- } if(oConvertUtils.isNotEmpty(userByid.getEntryDate())&&Integer.parseInt(sdt.format(userByid.getEntryDate()))==Integer.parseInt(ls.getYearName())) {
|
|
|
|
|
|
+ lyearCounts += getYear(userByid.getEntryDate(), ls.getBeginDate(), userByid);
|
|
|
|
+ }else {
|
|
|
|
+ int i = daysBetween(userByid.getEntryDate(), DateUtils.parseDate(ls.getYearName() + "-12-31", "yyyy-MM-dd"));
|
|
|
|
+ int yearToWorkMoth = getYearToWorkMoth(userByid.getWorkMoth());
|
|
|
|
+ BigDecimal multiply = new BigDecimal(yearToWorkMoth).multiply(new BigDecimal(i));
|
|
|
|
+ BigDecimal bigDecimal = multiply.divide(new BigDecimal("365"),0, BigDecimal.ROUND_DOWN);
|
|
|
|
+ yearCount+=Integer.parseInt(bigDecimal.toString());
|
|
|
|
+ lyearCounts+=Integer.parseInt(bigDecimal.toString());
|
|
|
|
+ }
|
|
|
|
+ }else if (Integer.parseInt(ls.getYearName())<Integer.parseInt(year)&&Integer.parseInt(year)-1==Integer.parseInt(ls.getYearName())){
|
|
|
|
+ if (oConvertUtils.isNotEmpty(userByid.getEntryDate())&&Integer.parseInt(sdt.format(userByid.getEntryDate()))==Integer.parseInt(ls.getYearName())){
|
|
int i = daysBetween(userByid.getEntryDate(), DateUtils.parseDate(ls.getYearName() + "-12-31", "yyyy-MM-dd"));
|
|
int i = daysBetween(userByid.getEntryDate(), DateUtils.parseDate(ls.getYearName() + "-12-31", "yyyy-MM-dd"));
|
|
int yearToWorkMoth = getYearToWorkMoth(userByid.getWorkMoth());
|
|
int yearToWorkMoth = getYearToWorkMoth(userByid.getWorkMoth());
|
|
BigDecimal multiply = new BigDecimal(yearToWorkMoth).multiply(new BigDecimal(i));
|
|
BigDecimal multiply = new BigDecimal(yearToWorkMoth).multiply(new BigDecimal(i));
|
|
BigDecimal bigDecimal = multiply.divide(new BigDecimal("365"),0, BigDecimal.ROUND_DOWN);
|
|
BigDecimal bigDecimal = multiply.divide(new BigDecimal("365"),0, BigDecimal.ROUND_DOWN);
|
|
|
|
+ lyearCount+=Integer.parseInt(bigDecimal.toString());
|
|
yearCount+=Integer.parseInt(bigDecimal.toString());
|
|
yearCount+=Integer.parseInt(bigDecimal.toString());
|
|
- yearCounts+=yearToWorkMoth;
|
|
|
|
- } if(oConvertUtils.isNotEmpty(userByid.getEntryDate())&&Integer.parseInt(sdt.format(newDate))-1==Integer.parseInt(ls.getYearName())) {
|
|
|
|
- lyearCount+=yearCount;
|
|
|
|
|
|
+ lyearCounts+=Integer.parseInt(bigDecimal.toString());
|
|
|
|
+ }else if (oConvertUtils.isNotEmpty(userByid.getEntryDate())&&Integer.parseInt(sdt.format(userByid.getEntryDate()))<Integer.parseInt(ls.getYearName())){
|
|
|
|
+ lyearCount += getYear(userByid.getEntryDate(), ls.getBeginDate(), userByid);
|
|
|
|
+ yearCount += getYear(userByid.getEntryDate(), ls.getBeginDate(), userByid);
|
|
|
|
+ lyearCounts += getYear(userByid.getEntryDate(), ls.getBeginDate(), userByid);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
for (int is=years.size()-1;is>=0;is--){
|
|
for (int is=years.size()-1;is>=0;is--){
|
|
- vacationsBody.addAll(vacationMapper.queryListBody(id,years.get(is).getYearName()));
|
|
|
|
|
|
+ if (Integer.parseInt(years.get(is).getYearName())<=Integer.parseInt(year)) {
|
|
|
|
+ vacationsBody.addAll(vacationMapper.queryListBody(id, years.get(is).getYearName()));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
@@ -801,24 +827,29 @@ public class WeixinUserImpl implements IWeixinUserService{
|
|
String txCount="0";
|
|
String txCount="0";
|
|
if (vacationsBody!=null&&vacationsBody.size()>0) {
|
|
if (vacationsBody!=null&&vacationsBody.size()>0) {
|
|
for (int i = vacationsBody.size() - 1; i >= 0; i--) {
|
|
for (int i = vacationsBody.size() - 1; i >= 0; i--) {
|
|
- if (Integer.parseInt(sdt.format(vacationsBody.get(i).getYear())) < Integer.parseInt(sdt.format(newDate))) {
|
|
|
|
|
|
+ if (Integer.parseInt(sdt.format(vacationsBody.get(i).getYear())) < Integer.parseInt(year)) {
|
|
lsyYearCount = new BigDecimal(lsyYearCount).add(new BigDecimal(vacationsBody.get(i).getHolidayCount())).toString();
|
|
lsyYearCount = new BigDecimal(lsyYearCount).add(new BigDecimal(vacationsBody.get(i).getHolidayCount())).toString();
|
|
|
|
+ syYearCount = new BigDecimal(syYearCount).add(new BigDecimal(vacationsBody.get(i).getHolidayCount())).toString();
|
|
|
|
+
|
|
|
|
+ }else if (Integer.parseInt(sdt.format(vacationsBody.get(i).getYear()))==Integer.parseInt(year)){
|
|
|
|
+ syYearCount = new BigDecimal(syYearCount).add(new BigDecimal(vacationsBody.get(i).getHolidayCount())).toString();
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- for (int it = vacationsBody.size() - 1; it >= 0; it--) {
|
|
|
|
|
|
+ /* for (int it = vacationsBody.size() - 1; it >= 0; it--) {
|
|
syYearCount = new BigDecimal(syYearCount).add(new BigDecimal(vacationsBody.get(it).getHolidayCount())).toString();
|
|
syYearCount = new BigDecimal(syYearCount).add(new BigDecimal(vacationsBody.get(it).getHolidayCount())).toString();
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
|
|
|
|
- vacationsBody=vacationMapper.queryListBody(id,sdt.format(newDate));
|
|
|
|
|
|
+ vacationsBody=vacationMapper.queryListBody(id,year);
|
|
|
|
|
|
syYearCount=new BigDecimal(syYearCount).divide(new BigDecimal("24"),1,BigDecimal.ROUND_DOWN).toString();
|
|
syYearCount=new BigDecimal(syYearCount).divide(new BigDecimal("24"),1,BigDecimal.ROUND_DOWN).toString();
|
|
syYearCount=new BigDecimal(yearCount).subtract(new BigDecimal(syYearCount)).toString();
|
|
syYearCount=new BigDecimal(yearCount).subtract(new BigDecimal(syYearCount)).toString();
|
|
if (!lsyYearCount.equals("0")) {
|
|
if (!lsyYearCount.equals("0")) {
|
|
lsyYearCount = new BigDecimal(lsyYearCount).divide(new BigDecimal("24"), 1, BigDecimal.ROUND_DOWN).toString();
|
|
lsyYearCount = new BigDecimal(lsyYearCount).divide(new BigDecimal("24"), 1, BigDecimal.ROUND_DOWN).toString();
|
|
- lsyYearCount = new BigDecimal(lyearCount).subtract(new BigDecimal(lsyYearCount)).toString();
|
|
|
|
|
|
+ lsyYearCount = new BigDecimal(lyearCounts).subtract(new BigDecimal(lsyYearCount)).toString();
|
|
}else {
|
|
}else {
|
|
- lsyYearCount=String.valueOf(lyearCount);
|
|
|
|
|
|
+ lsyYearCount=String.valueOf(lyearCounts);
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
syYearCount=String.valueOf(yearCount);
|
|
syYearCount=String.valueOf(yearCount);
|
|
@@ -844,6 +875,7 @@ public class WeixinUserImpl implements IWeixinUserService{
|
|
map.put("syYearCount",syYearCount);
|
|
map.put("syYearCount",syYearCount);
|
|
map.put("txCount",txCount);
|
|
map.put("txCount",txCount);
|
|
map.put("vacationsBody",vacationsBody);
|
|
map.put("vacationsBody",vacationsBody);
|
|
|
|
+ map.put("entry",userByid.getEntryDate());
|
|
return map;
|
|
return map;
|
|
}
|
|
}
|
|
|
|
|