|
|
|
|
@ -1,6 +1,8 @@
|
|
|
|
|
package com.ruoyi.quartz.task;
|
|
|
|
|
|
|
|
|
|
import com.ruoyi.kaohe.domain.KhPingce;
|
|
|
|
|
import com.ruoyi.kaohe.domain.KhVote;
|
|
|
|
|
import com.ruoyi.kaohe.service.IKhPingceService;
|
|
|
|
|
import com.ruoyi.kaohe.service.IKhVoteService;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
@ -19,11 +21,14 @@ public class RyTask
|
|
|
|
|
{
|
|
|
|
|
@Autowired
|
|
|
|
|
private IKhVoteService khVoteService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private IKhPingceService khPingceService;
|
|
|
|
|
|
|
|
|
|
public void performTask() {
|
|
|
|
|
System.out.println("进入定时任务-------------------------------------------------------------");
|
|
|
|
|
//获取所有未完成的评分任务
|
|
|
|
|
List<KhVote> list = khVoteService.selectUnfinishedVote();
|
|
|
|
|
//根据时间自动修改评分任务状态
|
|
|
|
|
for (KhVote vote : list) {
|
|
|
|
|
Date sTime = vote.getsTime();
|
|
|
|
|
Date eTime = vote.geteTime();
|
|
|
|
|
@ -42,6 +47,27 @@ public class RyTask
|
|
|
|
|
System.out.println("执行定时任务: " + System.currentTimeMillis() + " 修改评分任务: " + vote.getVoteTitle() + " 状态为已完成");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//修改考核任务状态,当考核任务下的所有评分任务状态为已完成时 考核任务状态进行中修改为已完成
|
|
|
|
|
KhPingce param = new KhPingce();
|
|
|
|
|
param.setState("1");
|
|
|
|
|
List<KhPingce> khPingces = khPingceService.selectKhPingceList(param);
|
|
|
|
|
for (KhPingce khPingce : khPingces) {
|
|
|
|
|
KhVote vote = new KhVote();
|
|
|
|
|
vote.setPingceId(khPingce.getId());
|
|
|
|
|
List<KhVote> khVotes = khVoteService.selectKhVoteList(vote);
|
|
|
|
|
boolean finished = true;
|
|
|
|
|
for (KhVote khVote : khVotes) {
|
|
|
|
|
if( khVote.getState().equals("0")|| khVote.getState().equals("1")){
|
|
|
|
|
finished=false;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(finished){
|
|
|
|
|
khPingce.setState("2");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i)
|
|
|
|
|
|