|
|
@ -17,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
|
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
|
|
|
|
|
|
|
|
|
|
import com.hw.common.core.utils.StringUtils;
|
|
|
|
import com.hw.common.core.utils.StringUtils;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
@ -89,10 +90,35 @@ public class DmsPlanMaintServiceImpl implements IDmsPlanMaintService {
|
|
|
|
@Transactional
|
|
|
|
@Transactional
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public int insertDmsPlanMaint(DmsPlanMaint dmsPlanMaint) {
|
|
|
|
public int insertDmsPlanMaint(DmsPlanMaint dmsPlanMaint) {
|
|
|
|
Long week = dmsPlanMaint.getWeek();
|
|
|
|
String day = "*";
|
|
|
|
week += 1;
|
|
|
|
String month = "*";
|
|
|
|
|
|
|
|
String week = "*";
|
|
|
|
|
|
|
|
String year = "*";
|
|
|
|
|
|
|
|
String cron = "";
|
|
|
|
|
|
|
|
if (dmsPlanMaint.getDay()!=null){
|
|
|
|
|
|
|
|
day = dmsPlanMaint.getDay().toString();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (dmsPlanMaint.getMonth()!=null){
|
|
|
|
|
|
|
|
month = dmsPlanMaint.getMonth().toString();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (dmsPlanMaint.getWeek()!=null){
|
|
|
|
|
|
|
|
Long weekDay = dmsPlanMaint.getWeek() + 1;
|
|
|
|
|
|
|
|
week = weekDay.toString();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (dmsPlanMaint.getYear()!=null){
|
|
|
|
|
|
|
|
year = dmsPlanMaint.getYear().toString();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (dmsPlanMaint.getMaintLevel().equals(1l)){
|
|
|
|
|
|
|
|
cron = "0 0 "+dmsPlanMaint.getHour()+" "+day+" "+month+" ?";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (dmsPlanMaint.getMaintLevel().equals(2l)){
|
|
|
|
|
|
|
|
cron = "0 0 "+dmsPlanMaint.getHour()+" ?"+" "+month+" "+week;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (dmsPlanMaint.getMaintLevel().equals(3l)){
|
|
|
|
|
|
|
|
cron = "0 0 "+dmsPlanMaint.getHour()+" "+day+" "+ month+" ? "+year;
|
|
|
|
|
|
|
|
}
|
|
|
|
String planMaintCode = Seq.getId(Seq.planMaintSeqType, Seq.planMaintCode);
|
|
|
|
String planMaintCode = Seq.getId(Seq.planMaintSeqType, Seq.planMaintCode);
|
|
|
|
String cron = "* * "+dmsPlanMaint.getHour()+" ? * "+week;
|
|
|
|
// String cron = "* * "+dmsPlanMaint.getHour()+" ? * "+week;
|
|
|
|
SysJob job = new SysJob();
|
|
|
|
SysJob job = new SysJob();
|
|
|
|
job.setJobName("保养计划编号" + planMaintCode + "工单任务");
|
|
|
|
job.setJobName("保养计划编号" + planMaintCode + "工单任务");
|
|
|
|
job.setJobGroup("DEFAULT");
|
|
|
|
job.setJobGroup("DEFAULT");
|
|
|
|