#
lsh
2024-06-21 352b3946e1afb9a27c96f58bb138e2ba5a010ec0
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -109,6 +109,8 @@
    private WrkMastSplitTwinService wrkMastSplitTwinService;
    @Autowired
    private BasJarMastService basJarMastService;
    @Autowired
    private WrkMastExecuteService wrkMastExecuteService;
    @Value("${wms.url}")
    private String wmsUrl;
@@ -4411,18 +4413,42 @@
     */
    public synchronized void jarGenerateWrkMastSta() {
        for (JarSlave jarSlave : slaveProperties.getJar()) {
            try{
                Integer count = basJarMastService.getJarMastByJarIdCount(jarSlave.getId().longValue());
                if (count>=7){
            for(JarSlave.StaStn staStn : jarSlave.getJarInSta()){
                // 获取硫化罐入库站信息
                DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, staStn.getDevpPlcId());
                StaProtocol staProtocol = devpThread.getStation().get(staStn.getStaNo());
                if (staProtocol == null) {
                    continue;
                } else {
                    staProtocol = staProtocol.clone();
                }
                BasJarMast jarMastByJarIdMax = basJarMastService.getJarMastByJarIdMax(jarSlave.getId().longValue());
                if (!Cools.isEmpty(jarMastByJarIdMax) && jarMastByJarIdMax.getJarLocDigit()==7){
                    continue;
                if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.getWorkNo()!=0){
                    try{
                        if (basJarMastService.selectJarMastOperation(jarSlave.getId(),1)!=0){
                            break;
                        }
                        if (wrkMastExecuteService.getWrkMastByJarIdCount(jarSlave.getId())!=0){
                            break;
                        }
                        if (basJarMastService.getJarMastByJarIdCount(jarSlave.getId())>=7){
                            continue;
                        }
                        BasJarMast jarMastByJarIdMax = basJarMastService.getJarMastByJarIdMax(jarSlave.getId());
                        if (!Cools.isEmpty(jarMastByJarIdMax) && jarMastByJarIdMax.getJarLocDigit()==7){
                            continue;
                        }
                        WrkMast wrkMast = wrkMastMapper.selectById(staProtocol.getWorkNo());
                        if (Cools.isEmpty(wrkMast) || wrkMast.getWrkSts()!=2){
                            continue;
                        }
                        if (jarGenerateWrkMastStaExecute(jarSlave,wrkMast)){
                            return;
                        };
                    }catch (Exception e){
                        log.error(jarSlave.getId()+"号小车复位线程报错!"+e);
                    }
                    break;
                }
                jarGenerateWrkMastStaExecute(jarSlave);
            }catch (Exception e){
                log.error(jarSlave.getId()+"号小车复位线程报错!"+e);
            }
        }
    }
@@ -4430,7 +4456,7 @@
    /**
     *  Jar任务创建  执行
     */
    public synchronized boolean jarGenerateWrkMastStaExecute(JarSlave jarSlave) {
    public synchronized boolean jarGenerateWrkMastStaExecute(JarSlave jarSlave,WrkMast wrkMast) {
        try{
            // 获取堆垛机信息
            JarThread jarThread = (JarThread) SlaveConnection.get(SlaveType.Jar, jarSlave.getId());
@@ -4451,8 +4477,8 @@
                return false;
            }
            //自动、空闲、右门关闭、
            if (jarProtocol.isAutoing() && !jarProtocol.isRightDoor() && jarProtocol.jarErr==0 && !jarOtherProtocol.isLeftDoor() && jarOtherProtocol.jarErr==0){
            //自动、空闲、右门关闭、   Other左门关闭
            if (jarProtocol.isAutoing() && !jarProtocol.isRightDoor() && jarProtocol.jarErr==0 && !jarOtherProtocol.isLeftDoor()){
            }