|
|
|
@ -265,18 +265,33 @@ public class DeviceTaskServiceImpl implements IDeviceTaskService {
|
|
|
|
|
EquPlan equPlan = new EquPlan();
|
|
|
|
|
equPlan.setPlanType("spotInspection");
|
|
|
|
|
List<EquPlan> plans = deviceTaskMapper.getPlans(equPlan);
|
|
|
|
|
List<EquPlan> producePlans = this.confirmPlanProduceLine(plans,poolName);
|
|
|
|
|
|
|
|
|
|
for (EquPlan plan : producePlans) {
|
|
|
|
|
EquOrder hasTask = deviceTaskMapper.getNewTaskOrder(plan);
|
|
|
|
|
if (hasTask == null || Integer.parseInt(plan.getPlanLoop()) <= hasTask.getDays() || checkHourTask(hasTask, plan)) {
|
|
|
|
|
//生成点检计划
|
|
|
|
|
int m = this.createOrderPlan(plan);
|
|
|
|
|
if (m == 0) {
|
|
|
|
|
error("equ_order相关添加失败");
|
|
|
|
|
logger.info("++++++++++++" + poolName + "++++需要点检的++++++++++"+plans);
|
|
|
|
|
if(poolName.equals("ds_1000")){
|
|
|
|
|
List<EquPlan> producePlans = this.confirmPlanProduceLine(plans,poolName);//日点检 无产线计划 不生成点检工单
|
|
|
|
|
logger.info("++++++++++++" + poolName + "++++需要点检的++++++++++"+producePlans);
|
|
|
|
|
for (EquPlan plan : producePlans) {
|
|
|
|
|
EquOrder hasTask = deviceTaskMapper.getNewTaskOrder(plan);
|
|
|
|
|
if (hasTask == null || Integer.parseInt(plan.getPlanLoop()) <= hasTask.getDays() || checkHourTask(hasTask, plan)) {
|
|
|
|
|
//生成点检计划
|
|
|
|
|
int m = this.createOrderPlan(plan);
|
|
|
|
|
if (m == 0) {
|
|
|
|
|
error("equ_order相关添加失败");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
for (EquPlan plan : plans) {
|
|
|
|
|
EquOrder hasTask = deviceTaskMapper.getNewTaskOrder(plan);
|
|
|
|
|
if (hasTask == null || Integer.parseInt(plan.getPlanLoop()) <= hasTask.getDays() || checkHourTask(hasTask, plan)) {
|
|
|
|
|
//生成点检计划
|
|
|
|
|
int m = this.createOrderPlan(plan);
|
|
|
|
|
if (m == 0) {
|
|
|
|
|
error("equ_order相关添加失败");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
logger.info("++++++++++++" + poolName + "++++点检结束++++++++++");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|