同步考勤数据不能超过当天
This commit is contained in:
parent
57539edda8
commit
a61a8a3715
|
|
@ -199,6 +199,10 @@ public class AttendanceDetailsServiceImpl implements AttendanceDetailsService {
|
||||||
public AjaxResult synchronous(AttDataDetailsBean bean) {
|
public AjaxResult synchronous(AttDataDetailsBean bean) {
|
||||||
try {
|
try {
|
||||||
List<String> dateList = attTasks.getStrDateListBetween(bean.getStartDate(), bean.getEndDate());
|
List<String> dateList = attTasks.getStrDateListBetween(bean.getStartDate(), bean.getEndDate());
|
||||||
|
//只执行今天之前的时间(包含今天)
|
||||||
|
dateList = dateList.stream()
|
||||||
|
.filter(date -> attTasks.isBeforeToday(date))
|
||||||
|
.collect(Collectors.toList());
|
||||||
attTasks.hisAttPush(dateList);
|
attTasks.hisAttPush(dateList);
|
||||||
return AjaxResult.success("数据同步成功");
|
return AjaxResult.success("数据同步成功");
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
|
|
|
||||||
|
|
@ -538,7 +538,7 @@ public class AttTasks {
|
||||||
* @param dateStr 传入的日期字符串,格式为 "yyyy-MM-dd"
|
* @param dateStr 传入的日期字符串,格式为 "yyyy-MM-dd"
|
||||||
* @return 如果传入的日期在今天的日期之前,返回 true;否则返回 false
|
* @return 如果传入的日期在今天的日期之前,返回 true;否则返回 false
|
||||||
*/
|
*/
|
||||||
private boolean isBeforeToday(String dateStr) {
|
public boolean isBeforeToday(String dateStr) {
|
||||||
if (dateStr == null || dateStr.isEmpty()) {
|
if (dateStr == null || dateStr.isEmpty()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue