| | |
| | | import com.zy.asrs.wms.asrs.entity.enums.TaskStsType;
|
| | | import com.zy.asrs.wms.asrs.service.*;
|
| | | import lombok.extern.slf4j.Slf4j;
|
| | | import org.slf4j.Logger;
|
| | | import org.slf4j.LoggerFactory;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.scheduling.annotation.Scheduled;
|
| | | import org.springframework.stereotype.Component;
|
| | |
| | | @Slf4j
|
| | | @Component
|
| | | public class TaskTimer {
|
| | | public static Logger logger = LoggerFactory.getLogger(TaskTimer.class);
|
| | |
|
| | | @Autowired
|
| | | private TaskService taskService;
|
| | |
| | | executeTask11(task);
|
| | | break;
|
| | | case 53://拣料再入库
|
| | | case 57:
|
| | | executeTask53(task);
|
| | | break;
|
| | | default:
|
| | |
| | | executeTask101(task);
|
| | | break;
|
| | | case 103://拣料
|
| | | case 107:
|
| | | executeTask103(task);
|
| | | break;
|
| | | default:
|
| | |
| | | * @param task
|
| | | */
|
| | | //拣料再入库
|
| | | private void executeTask53(Task task) {
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public void executeTask53(Task task) {
|
| | | Long hostId = task.getHostId();
|
| | | Loc loc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getLocNo, task.getTargetLoc()).eq(Loc::getHostId, hostId));
|
| | | if (loc == null) {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * 更新任务明细,更新库存明细
|
| | | * @param task
|
| | | */
|
| | | //出库
|
| | | private void executeTask101(Task task) {
|
| | | Long hostId = task.getHostId();
|
| | |
| | | throw new CoolException("库位不存在");
|
| | | }
|
| | | if (loc.getLocStsId() != LocStsType.R.val()) {
|
| | | logger.error("库位:" + loc.getLocNo() + ",状态不处于R.出库预约");
|
| | | throw new CoolException("库位状态不处于R.出库预约");
|
| | | }
|
| | | List<TaskDetl> taskDetls = taskDetlService.getTaskDetlByTaskId(task.getId());
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | if (loc == null) {
|
| | | throw new CoolException("库位不存在");
|
| | | }
|
| | | if (loc.getLocStsId() != LocStsType.S.val()) {
|
| | | if (loc.getLocStsId() != LocStsType.R.val()) {
|
| | | throw new CoolException("库位状态不处于R.出库预约");
|
| | | }
|
| | | List<TaskDetl> taskDetls = taskDetlService.getTaskDetlByTaskId(task.getId());
|