|
|
@@ -740,8 +740,10 @@ public class SysUserServiceImpl implements ISysUserService
|
|
|
}else if (i>2){
|
|
|
Map<Integer, String> map = maps.get(i);
|
|
|
UserClockDtails userClockDtails=new UserClockDtails();
|
|
|
+ List<LegalHolidays> legalHolidays = legalHolidaysMapper.selectAll();
|
|
|
//每一条是一个人的当月打卡
|
|
|
for (int j = 0; j < map.size(); j++) {
|
|
|
+ days=0;
|
|
|
String s = map.get(j);
|
|
|
if (j==0)userClockDtails.setName(s);
|
|
|
else if (j==1)userClockDtails.setGroupName(s.replace("\n","-").replace(" ",""));
|
|
|
@@ -760,9 +762,10 @@ public class SysUserServiceImpl implements ISysUserService
|
|
|
}else {
|
|
|
days++;
|
|
|
}
|
|
|
+ System.out.println("year="+year+",month="+month+",days="+days);
|
|
|
newUserlock.setClockTime(LocalDate.of(year,month,days));
|
|
|
//false不用上班 true需要上班
|
|
|
- boolean flag=pushLeaglHolidays(newUserlock.getClockTime());
|
|
|
+ boolean flag=pushLeaglHolidays(newUserlock.getClockTime(),legalHolidays);
|
|
|
if (flag || StringUtils.isNotEmpty(s)){
|
|
|
String[] split = s.split("\n");
|
|
|
if (split.length==1){
|
|
|
@@ -838,14 +841,13 @@ public class SysUserServiceImpl implements ISysUserService
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private boolean pushLeaglHolidays(LocalDate clockTime) {
|
|
|
+ private boolean pushLeaglHolidays(LocalDate clockTime ,List<LegalHolidays> legalHolidays) {
|
|
|
boolean flag = true;
|
|
|
String format = clockTime.format(DateTimeFormatter.ISO_DATE);
|
|
|
int weeks = DateUtils.getWeeks(format);
|
|
|
if (weeks==6||weeks==0) flag=false;
|
|
|
Instant instant = clockTime.atStartOfDay().toInstant(ZoneOffset.of("+8"));
|
|
|
long epochMilli = instant.toEpochMilli();
|
|
|
- List<LegalHolidays> legalHolidays = legalHolidaysMapper.selectAll();
|
|
|
for (LegalHolidays e : legalHolidays) {
|
|
|
if (e.getHolidays().getTime()==epochMilli){
|
|
|
if(e.getStatus()==1){
|