#
zjj
2025-07-02 d3f3d4b309cfb285fcbbc48b91c4046111c7e9cd
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,6 +95,8 @@
        taskWrk.setIoPri(param.getTaskPriority());//优先级
        taskWrk.setBarcode(param.getBarcode());//条码
        taskWrk.setCrnNo(param.getCrn());
        String stats = "";
        String wcsLocNo = "";
        if(param.getIoType() == 1){
            taskWrk.setWrkSts(1);
            if (!Cools.isEmpty(param.getTargetPoint())) {
@@ -105,14 +108,18 @@
            taskWrk.setWrkSts(11);
            if (!Cools.isEmpty(param.getStartPoint())) {
                taskWrk.setStartPoint(Utils.getWcsLocNo(param.getStartPoint()));//起点
                wcsLocNo = taskWrk.getStartPoint();
                taskWrk.setOriginStartPoint(param.getStartPoint());
                stats = "R";
            }
            taskWrk.setTargetPoint(param.getTargetPoint());
        }else if (param.getIoType() == 3){
            taskWrk.setWrkSts(11);
            if (!Cools.isEmpty(param.getStartPoint())) {
                taskWrk.setStartPoint(Utils.getWcsLocNo(param.getStartPoint()));//起点
                wcsLocNo = taskWrk.getStartPoint();
                taskWrk.setOriginStartPoint(param.getStartPoint());
                stats = "R";
            }
        }
@@ -121,6 +128,18 @@
        if (!Cools.isEmpty(param.getMemo())) {
            taskWrk.setMemo(param.getMemo());//备注
        }
        // 更新库位状态,入库还没分配库位,扫码之后才分配
//        if (param.getIoType() == 2 || param.getIoType() == 3) {
//            try {
//            LocMast locMast = locMastService.selectByLocNo(wcsLocNo);
//            locMast.setLocSts(stats);
//            log.info("-----入库更新库位状态为:R成功----------"+ locMast.getLocNo());
//            locMastService.updateById(locMast);
//            } catch (Exception e){
//                log.error("-----出库更新库位状态为:R异常----------"+ e);
//            }
//        }
        if (!taskWrkService.insert(taskWrk)) {
            return R.error("创建任务失败");
@@ -140,6 +159,11 @@
            list = getInEnableRoadway2();
        }
        if (Cools.isEmpty(list)){
            log.warn("无可入巷道,请稍后再试");
            return R.error("无可入巷道");
        }
        //TaskWrk taskWrk = taskWrkService.selectByTaskNo(param.getTaskNo());
        toWmsDTO.setWarehouseId("1688469798893297665");