1
zhang
3 天以前 591735554fc359c5988e00732ef9067d79157007
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -6,7 +6,6 @@
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.core.common.Cools;
import com.core.common.DateUtils;
import com.core.common.R;
import com.core.exception.CoolException;
import com.zy.asrs.entity.*;
import com.zy.asrs.mapper.BasCrnErrorMapper;
@@ -749,7 +748,7 @@
//            }
            //堆垛机回原点任务中
            Object object = redisUtil.get(RedisConstantType.CRN_MOVE_LOCK);
            Object object = redisUtil.get(RedisConstantType.CRN_MOVE_LOCK + crn.getId());
            if (object != null) {
                continue;
            }
@@ -821,7 +820,7 @@
                    continue;
                }
                Object object = redisUtil.get(RedisConstantType.CRN_MOVE_LOCK);
                Object object = redisUtil.get(RedisConstantType.CRN_MOVE_LOCK + crn.getId());
                if (object != null) {
                    continue;
                }
@@ -893,7 +892,7 @@
                    continue;
                }
                Object object = redisUtil.get(RedisConstantType.CRN_MOVE_LOCK);
                Object object = redisUtil.get(RedisConstantType.CRN_MOVE_LOCK + crn.getId());
                if (object != null) {
                    continue;
                }
@@ -1251,7 +1250,7 @@
                            turnCrnExecuteCurrentChannel = turnCrnExecuteCurrentChannelConfig.getValue();
                        }
                        if(turnCrnExecuteCurrentChannel.equals("Y")) {
                        if (turnCrnExecuteCurrentChannel.equals("Y")) {
                            //判断堆垛机和当前任务是否处于一个巷道
                            if (Utils.getLaneByLocNo(wrkMast.getSourceLocNo()) != crnProtocol.getCrnLane()) {
                                //判断堆垛机所在巷道是否存在其他任务,如存在则优先执行
@@ -1650,6 +1649,7 @@
                if (crnProtocol.getTaskNo() == 9999) {
                    // 堆垛机复位
                    crnThread.setResetFlag(true);
                    redisUtil.set(RedisConstantType.CRN_MOVE_LOCK + crn.getId(), "lock", 8);//防止回原点后下发指令过快
                    continue;
                }
@@ -1661,7 +1661,7 @@
                }
                Date now = new Date();
                if(wrkMast.getIoType() < 100){
                if (wrkMast.getIoType() < 100) {
                    // 入库 + 库位转移  ==> 4.入库完成
                    if (wrkMast.getWrkSts() == 3 || (wrkMast.getWrkSts() == 12 && (wrkMast.getIoType() == 11 || wrkMast.getIoType() == 111))) {
                        wrkMast.setWrkSts(4L);
@@ -1677,7 +1677,7 @@
                        News.warnNoLog("" + mark + " - 2" + " - 修改成功后复位堆垛机 : 堆垛机号={}", crnThread.getCrnProtocol().getCrnNo());
                        crnThread.setResetFlag(true);
                    }
                }else {
                } else {
                    List<Long> list = new ArrayList<>();
                    list.add(14L);
                    list.add(15L);
@@ -2142,16 +2142,25 @@
                    if (!wrkDetls.isEmpty()) {
                        WrkDetl wrkDetl = wrkDetls.get(0);
                        double anfme = 0D;
                        double weight = 0D;
                        for (WrkDetl detl : wrkDetls) {
                            double anfme = wrkDetl.getAnfme() + detl.getAnfme();
                            double weight = wrkDetl.getWeight() + detl.getWeight();
                            double stockNum = wrkDetl.getStockNum() + detl.getStockNum();
                            double stockNum2 = wrkDetl.getStockNum2() + detl.getStockNum2();
                            anfme += detl.getAnfme();
                            weight += detl.getWeight();
                            wrkDetl.setAnfme(anfme);
                            wrkDetl.setWeight(weight);
                            wrkDetl.setStockNum(stockNum);
                            wrkDetl.setStockNum2(stockNum2);
                        }
                        List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>()
                                .eq("loc_no", wrkMast.getSourceLocNo()));
                        double totalAnfme = 0D;
                        double totalWeight = 0D;
                        for (LocDetl locDetl : locDetls) {
                            totalAnfme += locDetl.getAnfme();
                            totalWeight += locDetl.getWeight();
                        }
                        wrkDetl.setStockNum(totalAnfme);
                        wrkDetl.setStockNum2(totalWeight);
                        ledCommand.getMatDtos().add(new MatDto(
                                wrkDetl.getMatnr()
@@ -2418,6 +2427,15 @@
                return false;
//                throw new CoolException("双深库位 --- 浅库位阻塞异常! 待移转浅库位:" + shallowLoc.getLocNo());
            } else {
                String deepLoc2 = Utils.getDeepLoc2(slaveProperties, loc.getLocNo());
                if (deepLoc2 != null) {
                    LocMast locnew = locMastService.selectById(deepLoc2);
                    if (locnew != null && locnew.getLocSts().equals("O")) {
                        loc = locnew;
                    }
                }
                try {
                    // 获取工作号
                    int workNo = commonService.getWorkNo(0);