| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.zy.asrs.wcs.core.entity.Loc; |
| | | import com.zy.asrs.wcs.core.entity.Task; |
| | | import com.zy.asrs.wcs.core.entity.TaskLog; |
| | | import com.zy.asrs.wcs.core.entity.*; |
| | | import com.zy.asrs.wcs.core.model.enums.LocStsType; |
| | | import com.zy.asrs.wcs.core.model.enums.TaskStsType; |
| | | import com.zy.asrs.wcs.core.service.LocService; |
| | | import com.zy.asrs.wcs.core.service.TaskLogService; |
| | | import com.zy.asrs.wcs.core.service.TaskService; |
| | | import com.zy.asrs.wcs.core.service.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | |
| | | private TaskService taskService; |
| | | @Autowired |
| | | private TaskLogService taskLogService; |
| | | @Autowired |
| | | private MotionService motionService; |
| | | @Autowired |
| | | private MotionLogService motionLogService; |
| | | @Autowired |
| | | private LocService locService; |
| | | |
| | |
| | | taskLog.setUpdateTime(date); |
| | | taskLogService.save(taskLog); |
| | | |
| | | List<Motion> motions = motionService.list(new LambdaQueryWrapper<Motion>().eq(Motion::getTaskNo, task.getTaskNo()).eq(Motion::getHostId, task.getHostId())); |
| | | for (Motion motion : motions) { |
| | | //创建动作历史档 |
| | | MotionLog motionLog = new MotionLog(); |
| | | motionLog.sync(motion); |
| | | motionLog.setUpdateTime(new Date()); |
| | | motionLogService.save(motionLog); |
| | | } |
| | | |
| | | //删除源任务 |
| | | taskService.removeById(task.getId()); |
| | | //删除动作 |
| | | motionService.remove(new LambdaQueryWrapper<Motion>().eq(Motion::getTaskNo, task.getTaskNo()).eq(Motion::getHostId, task.getHostId())); |
| | | } |
| | | |
| | | } |