package com.zy.asrs.task.handler;
|
|
import com.alibaba.fastjson.JSON;
|
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
import com.zy.asrs.entity.WrkMastExecute;
|
import com.zy.asrs.service.WrkMastExecuteService;
|
import com.zy.asrs.task.AbstractHandler;
|
import com.zy.asrs.task.core.ReturnT;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Service;
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
/**
|
* Created by Monkey D. Luffy on 2024.06.27
|
* 亳州煜星..............以下.............亳州煜星.............硫化罐区域执行任务
|
*/
|
@Slf4j
|
@Service
|
@Transactional
|
public class WrkMastExecuteHandler extends AbstractHandler<String> {
|
@Autowired
|
private WrkMastExecuteService wrkMastExecuteService;
|
|
public ReturnT<String> start(int[] excute) {
|
try {
|
//保存历史档案
|
if (!wrkMastExecuteService.save(excute)){
|
log.error("保存硫化罐区域执行任务历史档[workNo={"+ JSON.toJSONString(excute) +"}]失败");
|
}
|
//删除工作档案
|
if (!wrkMastExecuteService.delete(new EntityWrapper<WrkMastExecute>().eq("io_type",excute[0]).eq("wrk_sts",excute[1]).eq("wrk_type",2))){
|
log.error("删除硫化罐区域执行任务[workNo={"+JSON.toJSONString(excute)+"}]失败");
|
}
|
}catch (Exception e){
|
log.error("异常!!!"+e);
|
return FAIL;
|
}
|
return SUCCESS;
|
}
|
}
|