pang.jiabao
2024-07-08 493bf8ea2cc50fc437057ba68159a5a6618e5c9b
src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java
@@ -22,14 +22,15 @@
import com.zy.core.model.Task;
import com.zy.core.model.protocol.StaProtocol;
import com.zy.core.properties.SlaveProperties;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.*;
@Slf4j
@Service
public class OpenServiceImpl implements OpenService {
@@ -94,11 +95,13 @@
        taskWrk.setIoPri(param.getTaskPriority());//优先级
        taskWrk.setBarcode(param.getBarcode());//条码
        taskWrk.setCrnNo(param.getCrn());
        String stats = "";
        if(param.getIoType() == 1){
            taskWrk.setWrkSts(1);
            if (!Cools.isEmpty(param.getTargetPoint())) {
                taskWrk.setTargetPoint(Utils.getWcsLocNo(param.getTargetPoint()));//终点
                taskWrk.setOriginTargetPoint(param.getTargetPoint());
                stats = "S";
            }
        } else if (param.getIoType() == 2) {
@@ -106,6 +109,7 @@
            if (!Cools.isEmpty(param.getStartPoint())) {
                taskWrk.setStartPoint(Utils.getWcsLocNo(param.getStartPoint()));//起点
                taskWrk.setOriginStartPoint(param.getStartPoint());
                stats = "R";
            }
            taskWrk.setTargetPoint(param.getTargetPoint());
        }else if (param.getIoType() == 3){
@@ -113,6 +117,7 @@
            if (!Cools.isEmpty(param.getStartPoint())) {
                taskWrk.setStartPoint(Utils.getWcsLocNo(param.getStartPoint()));//起点
                taskWrk.setOriginStartPoint(param.getStartPoint());
                stats = "R";
            }
        }
@@ -121,6 +126,12 @@
        if (!Cools.isEmpty(param.getMemo())) {
            taskWrk.setMemo(param.getMemo());//备注
        }
        // 更新库位状态
        String wcsLocNo = Utils.getWcsLocNo(param.getStartPoint());
        LocMast locMast = locMastService.selectByLocNo(wcsLocNo);
        locMast.setLocSts(stats);
        locMastService.updateById(locMast);
        if (!taskWrkService.insert(taskWrk)) {
            return R.error("创建任务失败");
@@ -140,6 +151,11 @@
            list = getInEnableRoadway2();
        }
        if (Cools.isEmpty(list)){
            log.warn("无可入巷道,请稍后再试");
            return R.error("无可入巷道");
        }
        //TaskWrk taskWrk = taskWrkService.selectByTaskNo(param.getTaskNo());
        toWmsDTO.setWarehouseId("1688469798893297665");