Commit 59e50232 by youling Committed by chenzg

定时器

parent 38dca035
......@@ -10,6 +10,7 @@ import java.util.Date;
import java.util.List;
import java.util.Locale;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
......@@ -61,6 +62,7 @@ import cn.timer.api.utils.DateUtil;
*/
@Configuration //1.主要用于标记配置类,兼备Component的效果。
@EnableScheduling // 2.开启定时任务
@Slf4j
public class AttendanceTaskTiming{
@Autowired
......@@ -89,8 +91,8 @@ public class AttendanceTaskTiming{
// @Scheduled(cron = "0 23 15 * * ?")
@Scheduled(cron = "0 0 8,12,16,20 * * ?")//每天上午8、12点,下午16点,20点 执行
@Scheduled(cron = "0 */2 * * * ?")
// @Scheduled(cron = "0 0 8,12,16,20 * * ?")//每天上午8、12点,下午16点,20点 执行
// @Scheduled(cron = "0 0 6,20 * * ?")
public void AttendanceTask() throws ParseException {
......@@ -231,6 +233,7 @@ public class AttendanceTaskTiming{
if(attgro.getPbfs() == 1){ //固定排班
List<KqglAssoTeshu> bxdklist = kqglassoteshumapper.ShouldSpecialDatessetByKqzid(attgro.getId(), ttstr,1);//当前月 必须打卡日期
int bxdk = bxdklist.size();
log.error("bxdk数据为:" + bxdk);
String[] bxdkss = new String[bxdk];////特殊-必须打卡天数(工作日)
int b = 0;
for(KqglAssoTeshu bxd : bxdklist) {
......@@ -269,9 +272,11 @@ public class AttendanceTaskTiming{
int y = 0,q = 0,jj = 0,xx = 0;//jj:节假日
String[] zdxx = new String[31];//法定休息的具体天数(yyyy-MM-dd)
for(int i = 1; i <= ClockInTool.getDaysByYearMonth(year,month); i++){
log.error("ClockInTool:" + i);
boolean xixi = true;
Date date1 = sdf1.parse(yemo + "-" + i);
for(int u=0;u<week.length;u++){
log.error("week:" + u);
if(sdf2.format(date1).equals(week[u])){
q++;
y++;
......@@ -308,6 +313,7 @@ public class AttendanceTaskTiming{
daysOff = xiuxi;
daysOnDuty = y+bxdk;
log.error("bxdk数据为:" + bxdk);
int w = 0,x=0;
int zj = 6;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment