历史推送简化修改
This commit is contained in:
parent
2c24ba58a8
commit
835d70b126
|
|
@ -20,8 +20,12 @@ import org.springframework.validation.annotation.Validated;
|
|||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 考勤数据拉取控制层
|
||||
|
|
@ -46,6 +50,7 @@ public class AttHisPullController extends BaseController {
|
|||
public AjaxResult getAttTempData(AttDataDetailsBean bean) {
|
||||
try{
|
||||
List<String> dateList = AttTimeUtil.getStrDateListBetween(bean.getStartDate(), bean.getEndDate());
|
||||
Collections.reverse(dateList);
|
||||
for (String date : dateList) {
|
||||
attTask.insertAttDateHistory(date);
|
||||
attTask.insertAttTempData(date, 2);
|
||||
|
|
@ -66,6 +71,7 @@ public class AttHisPullController extends BaseController {
|
|||
public AjaxResult getAttDataPull( AttDataDetailsBean bean) {
|
||||
try{
|
||||
List<String> dateList = AttTimeUtil.getStrDateListBetween(bean.getStartDate(), bean.getEndDate());
|
||||
Collections.reverse(dateList);
|
||||
for (String date : dateList) {
|
||||
attTask.getAttendanceData(date,2);
|
||||
attTask.updateAttData(date,2);
|
||||
|
|
@ -86,6 +92,7 @@ public class AttHisPullController extends BaseController {
|
|||
public AjaxResult getAbsenteeismData( AttDataDetailsBean bean) {
|
||||
try{
|
||||
List<String> dateList = AttTimeUtil.getStrDateListBetween(bean.getStartDate(), bean.getEndDate());
|
||||
Collections.reverse(dateList);
|
||||
for (String date : dateList) {
|
||||
attTask.updateAbsenteeismData(date,2);
|
||||
}
|
||||
|
|
@ -105,6 +112,7 @@ public class AttHisPullController extends BaseController {
|
|||
public AjaxResult getLegalHolidayData( AttDataDetailsBean bean) {
|
||||
try{
|
||||
List<String> dateList = AttTimeUtil.getStrDateListBetween(bean.getStartDate(), bean.getEndDate());
|
||||
Collections.reverse(dateList);
|
||||
for (String date : dateList) {
|
||||
attTask.updateLegalHolidayData(date);
|
||||
}
|
||||
|
|
@ -117,16 +125,15 @@ public class AttHisPullController extends BaseController {
|
|||
|
||||
/**
|
||||
* 请假数据应用--请假
|
||||
* 每天更新两次上午8点,下午18点(45天前数据)
|
||||
* 每天更新两次上午8点,下午18点(15天前数据)
|
||||
*/
|
||||
@GetMapping("/getLeaveData")
|
||||
@Log(title = "考勤数据拉取->请假数据应用--请假", businessType = BusinessType.QUERY)
|
||||
public AjaxResult getLeaveData( AttDataDetailsBean bean) {
|
||||
try{
|
||||
List<String> dateList = AttTimeUtil.getStrDateListBetween(bean.getStartDate(), bean.getEndDate());
|
||||
for (String date : dateList) {
|
||||
attTask.updateLeaveData(date);
|
||||
}
|
||||
String lastDate = dateList.get(dateList.size() - 1);
|
||||
attTask.updateLeaveData(lastDate);
|
||||
return toAjax(true);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
|
|
@ -143,6 +150,7 @@ public class AttHisPullController extends BaseController {
|
|||
public AjaxResult insertDayReportData( AttDataDetailsBean bean) {
|
||||
try{
|
||||
List<String> dateList = AttTimeUtil.getStrDateListBetween(bean.getStartDate(), bean.getEndDate());
|
||||
Collections.reverse(dateList);
|
||||
for (String date : dateList) {
|
||||
attTask.insertDayReportData(date);
|
||||
}
|
||||
|
|
@ -162,7 +170,12 @@ public class AttHisPullController extends BaseController {
|
|||
public AjaxResult insertMonthReportTempData( AttDataDetailsBean bean) {
|
||||
try{
|
||||
List<String> dateList = AttTimeUtil.getStrDateListBetween(bean.getStartDate(), bean.getEndDate());
|
||||
for (String date : dateList) {
|
||||
List<String> monthList = dateList.stream()
|
||||
.map(LocalDate::parse)
|
||||
.map(localDate -> localDate.format(DateTimeFormatter.ofPattern("yyyy-MM")))
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
for (String date : monthList) {
|
||||
attTask.insertMonthReportTempData(date);
|
||||
}
|
||||
return toAjax(true);
|
||||
|
|
@ -173,7 +186,7 @@ public class AttHisPullController extends BaseController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 报表数据生成--月报表
|
||||
* 报表数据更新--月报表
|
||||
* 每日数据变化修改之后修改
|
||||
*/
|
||||
@GetMapping("/updateMonthReportData")
|
||||
|
|
@ -181,7 +194,12 @@ public class AttHisPullController extends BaseController {
|
|||
public AjaxResult updateMonthReportData( AttDataDetailsBean bean) {
|
||||
try{
|
||||
List<String> dateList = AttTimeUtil.getStrDateListBetween(bean.getStartDate(), bean.getEndDate());
|
||||
for (String date : dateList) {
|
||||
List<String> monthList = dateList.stream()
|
||||
.map(LocalDate::parse)
|
||||
.map(localDate -> localDate.format(DateTimeFormatter.ofPattern("yyyy-MM")))
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
for (String date : monthList) {
|
||||
attTask.updateMonthReportData(date);
|
||||
}
|
||||
return toAjax(true);
|
||||
|
|
|
|||
Loading…
Reference in New Issue