skyouc
2025-06-22 ebe2da6e4eefd59b366ebab3a651b32763b580ed
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/timer/TaskTimer.java
@@ -10,6 +10,8 @@
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;
@@ -22,6 +24,7 @@
@Slf4j
@Component
public class TaskTimer {
    public static Logger logger = LoggerFactory.getLogger(TaskTimer.class);
    @Autowired
    private TaskService taskService;
@@ -87,6 +90,7 @@
                        executeTask11(task);
                        break;
                    case 53://拣料再入库
                    case 57:
                        executeTask53(task);
                        break;
                    default:
@@ -147,6 +151,7 @@
                        executeTask101(task);
                        break;
                    case 103://拣料
                    case 107:
                        executeTask103(task);
                        break;
                    default:
@@ -323,7 +328,8 @@
     * @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) {
@@ -381,6 +387,11 @@
        }
    }
    /**
     * 更新任务明细,更新库存明细
     * @param task
     */
    //出库
    private void executeTask101(Task task) {
        Long hostId = task.getHostId();
@@ -390,6 +401,7 @@
            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());
@@ -415,6 +427,11 @@
                }
            }
        }
    }
    /**
@@ -431,7 +448,7 @@
        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());