#
lty
3 天以前 a454c4e3e56ed63a7676348f260a240fa18be481
src/main/java/com/zy/asrs/controller/CrnController.java
@@ -35,6 +35,7 @@
import com.zy.core.model.protocol.CrnProtocol;
import com.zy.core.properties.SlaveProperties;
import com.zy.core.properties.SystemProperties;
import com.zy.core.thread.RgvThread;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@@ -126,6 +127,9 @@
            vo.setForkOffset(crnProtocol.getForkPosType().desc);    // 货叉位置
            vo.setLiftPos(crnProtocol.getLiftPosType().desc);
            vo.setWalkPos(crnProtocol.getWalkPos()==1?"不在定位":"在定位");
            if(crnProtocol.getAlarm() == 10){
                crnProtocol.setAlarm((short) 0);
            }
            vo.setWarnCode(String.valueOf(crnProtocol.getAlarm()));
            if (crnProtocol.getAlarm() > 0) {
                BasCrnError crnError = basCrnErrorMapper.selectById(crnProtocol.getAlarm());
@@ -248,6 +252,8 @@
        command.setDestinationPosX(param.getRow());     // 目标库位排
        command.setDestinationPosY(param.getBay());     // 目标库位列
        command.setDestinationPosZ(param.getLev());     // 目标库位层
        boolean locSts = isLocSts(param.getRow().toString(), param.getBay().toString(), param.getLev().toString());
        command.setTraySize(locSts);
        return crnControl(command)?R.ok():R.error();
    }
@@ -265,6 +271,8 @@
        command.setDestinationPosX(param.getRow());     // 目标库位排
        command.setDestinationPosY(param.getBay());     // 目标库位列
        command.setDestinationPosZ(param.getLev());     // 目标库位层
        boolean locSts = isLocSts(param.getSourceRow().toString(), param.getSourceBay().toString(), param.getSourceLev().toString());
        command.setTraySize(locSts);
        return crnControl(command)?R.ok():R.error();
    }
@@ -286,7 +294,11 @@
                .eq("bay1", command.getSourcePosY()).eq("lev1", command.getSourcePosZ()));
        LocMast loc = locMastService.selectOne(new EntityWrapper<LocMast>().eq("row1", command.getDestinationPosX())
                .eq("bay1", command.getDestinationPosY()).eq("lev1", command.getDestinationPosZ()));
        VersionUtils.locMoveCheckLocType(sourceLoc, loc);
        if (sourceLoc.getLocType1() != loc.getLocType1()){
            return R.error("库位类型不一致");
        }
        command.setTraySize(loc.getLocType1() == 2);
//        VersionUtils.locMoveCheckLocType(sourceLoc, loc);
        return crnControl(command)?R.ok():R.error();
    }
@@ -375,6 +387,8 @@
        command.setDestinationPosZ((short) 0);     // 目标库位层
        return crnControl(command)?R.ok():R.error();
    }
//    @ManagerAuth(memo = "暂停")
//    @PostMapping("/operator/pause")
@@ -501,5 +515,20 @@
        }
    }
    private boolean isLocSts(String row,String bay,String lev){
        int rowInt = Integer.parseInt(row);
        int bayInt = Integer.parseInt(bay);
        int levInt = Integer.parseInt(lev);
        String loc = String.format("%2d",rowInt)+String.format("%3d",bayInt)+String.format("%2d",levInt);
        LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", loc));
        if (Cools.isEmpty(locMast)){
            return false;
        }
        if (locMast.getLocType1() == 2){
            return true;
        }
        return false;
    }
}