|
@@ -133,10 +133,15 @@ public class WmUserSignServiceImpl extends ServiceImpl<WmUserSignMapper, WmUserS
|
|
String timeUnit = (String) f.get("timeUnit");
|
|
String timeUnit = (String) f.get("timeUnit");
|
|
|
|
|
|
// 同一个单位只记录最小的
|
|
// 同一个单位只记录最小的
|
|
- Integer l1 = eachLimitMap.get(timeUnit);
|
|
|
|
- if (l1 != null && l1 > limit) {
|
|
|
|
|
|
+ if (eachLimitMap.containsKey(timeUnit)){
|
|
|
|
+ Integer l1 = eachLimitMap.get(timeUnit);
|
|
|
|
+ if (l1 != null && l1 > limit) {
|
|
|
|
+ eachLimitMap.put(timeUnit, limit);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
eachLimitMap.put(timeUnit, limit);
|
|
eachLimitMap.put(timeUnit, limit);
|
|
}
|
|
}
|
|
|
|
+
|
|
});
|
|
});
|
|
|
|
|
|
}
|
|
}
|
|
@@ -162,10 +167,15 @@ public class WmUserSignServiceImpl extends ServiceImpl<WmUserSignMapper, WmUserS
|
|
|
|
|
|
// 月度限制
|
|
// 月度限制
|
|
if (isMonth) {
|
|
if (isMonth) {
|
|
- int monthLimit = eachLimitMap.get("MONTH");
|
|
|
|
- if (monthLimit < signs.size()) {
|
|
|
|
- log.warn("超过打卡每月限制:{} {}", wmUserSign.getSignUserid(), wmUserSign.getSignEntName());
|
|
|
|
- return R.failed("超过打卡每月限制");
|
|
|
|
|
|
+
|
|
|
|
+ Map<String, List<WmUserSign>> collect = signs.stream().collect(Collectors.groupingBy(WmUserSign::getSignEntId));
|
|
|
|
+ List<WmUserSign> wmUserSigns = collect.get(wmUserSign.getSignEntId());
|
|
|
|
+ if (CollUtil.isNotEmpty(wmUserSigns)) {
|
|
|
|
+ int monthLimit = eachLimitMap.get("MONTH");
|
|
|
|
+ if (monthLimit <= wmUserSigns.size()) {
|
|
|
|
+ log.warn("超过打卡每月限制:{} {}", wmUserSign.getSignUserid(), wmUserSign.getSignEntName());
|
|
|
|
+ return R.failed("超过打卡每月限制");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -201,14 +211,14 @@ public class WmUserSignServiceImpl extends ServiceImpl<WmUserSignMapper, WmUserS
|
|
|
|
|
|
|
|
|
|
} else {
|
|
} else {
|
|
- log.warn("超过每个地点打卡限制:{} {}", wmUserSign.getSignUserid(), wmUserSign.getSignEntName());
|
|
|
|
- return R.failed("超过每个地点打卡限制");
|
|
|
|
|
|
+ log.warn("超过每个地点打卡每日限制:{} {}", wmUserSign.getSignUserid(), wmUserSign.getSignEntName());
|
|
|
|
+ return R.failed("超过每个地点打卡每日限制");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
} else {
|
|
} else {
|
|
- log.warn("超过打卡每日限制:{} {}", wmUserSign.getSignUserid(), wmUserSign.getSignEntName());
|
|
|
|
- return R.failed("超过打卡每日限制");
|
|
|
|
|
|
+ log.warn("超过打卡每日总限制:{} {}", wmUserSign.getSignUserid(), wmUserSign.getSignEntName());
|
|
|
|
+ return R.failed("超过打卡每日总限制");
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|