| | |
| | | package com.zy.asrs.wcs.core.model.enums; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.zy.asrs.framework.common.SpringUtils; |
| | | import com.zy.asrs.framework.exception.CoolException; |
| | | import com.zy.asrs.wcs.core.entity.TaskSts; |
| | | import com.zy.asrs.wcs.core.service.TaskStsService; |
| | | |
| | | public enum TaskStsType { |
| | | |
| | |
| | | throw new CoolException("TaskStsType Error!!!"); |
| | | } |
| | | |
| | | public static TaskStsType queryById(Long id) { |
| | | TaskStsService taskStsService = SpringUtils.getBean(TaskStsService.class); |
| | | TaskSts taskSts = taskStsService.getById(id); |
| | | if (taskSts == null) { |
| | | throw new CoolException("TaskStsType Error!!!"); |
| | | } |
| | | return query(Long.valueOf(taskSts.getUuid())); |
| | | } |
| | | |
| | | public Long getId() { |
| | | TaskStsService taskStsService = SpringUtils.getBean(TaskStsService.class); |
| | | TaskSts taskSts = taskStsService.getOne(new LambdaQueryWrapper<TaskSts>() |
| | | .eq(TaskSts::getUuid, sts) |
| | | .eq(TaskSts::getStatus, 1)); |
| | | if (taskSts == null) { |
| | | throw new CoolException("TaskStsType Error!!!"); |
| | | } |
| | | return taskSts.getId(); |
| | | } |
| | | |
| | | } |