zhoushihao
2024-07-08 7a5dbd93b904d47e0237cbd36594cbe1792f8aeb
大理片笼:进片任务联调 bug修复
下片:任务联调 bug修复
7个文件已修改
65 ■■■■■ 已修改文件
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageCageDetailsServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/PlcStorageCageTask.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/common/S7object.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/service/DownStorageCageDetailsService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/service/impl/DownStorageCageDetailsServiceImpl.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/job/DownLoadCacheGlassTask.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/resources/JsonFile/PlcdownGlass.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageCageDetailsServiceImpl.java
@@ -13,6 +13,7 @@
import com.mes.bigstorage.service.BigStorageCageDetailsService;
import com.mes.bigstorage.service.BigStorageCageService;
import com.mes.bigstoragetask.entity.BigStorageCageFeedTask;
import com.mes.bigstoragetask.entity.BigStorageCageOutTask;
import com.mes.bigstoragetask.mapper.BigStorageCageFeedTaskMapper;
import com.mes.bigstoragetask.mapper.BigStorageCageOutTaskMapper;
import com.mes.common.config.Const;
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/PlcStorageCageTask.java
@@ -93,13 +93,10 @@
        String mesD01Address = plcParameterObject.getPlcParameter("MESToD01").getAddress();
        String mesD04Address = plcParameterObject.getPlcParameter("MESToD04").getAddress();
        String d01ToMES = plcParameterObject.getPlcParameter("D01ToMES").getValue();
        if (!REQUEST_WORD.equals(d01ToMES)) {
            log.info("请求字为{},结束本次扫描进卧转立任务", d01ToMES);
            return;
        }
        String d04ToMES = plcParameterObject.getPlcParameter("D04ToMES").getValue();
        log.info("1、获取d01Id扫描ID为:{};获取d04Id扫描ID为:{};", d01Id, d04Id);
        if (StringUtils.isBlank(d01Id) && StringUtils.isBlank(d04Id)) {
        log.info("1、获取d01Id扫描ID为:{},请求字为{};获取d04Id扫描ID为:{},请求字为{};", d01Id, d01ToMES, d04Id, d04ToMES);
        if (StringUtils.isBlank(d01ToMES) && StringUtils.isBlank(d04ToMES)) {
            log.info("两条线未收到进片任务,结束本次扫描进卧转立任务");
            return;
        }
@@ -107,13 +104,11 @@
            log.info("两条线卧转立均在执行任务,结束本次扫描进卧转立任务");
            return;
        }
//        Boolean flag01 = Boolean.FALSE;
//        Boolean flag04 = Boolean.FALSE;
        //按照线路及玻璃id获取相邻两块玻璃 卧转立上的玻璃
        if (StringUtils.isNotBlank(d01Id) && (StringUtils.isBlank(d02State) || !REQUEST_WORD.equals(d03State))) {
        if (REQUEST_WORD.equals(d01ToMES) && (StringUtils.isBlank(d02State) || !REQUEST_WORD.equals(d03State))) {
            judgeGlassTypeStatus(d01Id, Const.A09_OUT_TARGET_POSITION, mesD01Address);
        }
        if (StringUtils.isNotBlank(d04Id) && !REQUEST_WORD.equals(d05State)) {
        if (REQUEST_WORD.equals(d04ToMES) && !REQUEST_WORD.equals(d05State)) {
            judgeGlassTypeStatus(d04Id, Const.A10_OUT_TARGET_POSITION, mesD04Address);
        }
        log.info("结束扫码任务");
@@ -303,7 +298,7 @@
        Boolean flag = Boolean.TRUE;
        //2、获取卧转立
        Integer widthFirst = Math.max(edgGlassTaskInfoList.get(0).getWidth(), edgGlassTaskInfoList.get(0).getHeight());
        Integer widthFirst = Math.max(edgGlassTaskInfoList.get(0).getWidth() / 10, edgGlassTaskInfoList.get(0).getHeight() / 10);
        if (edgGlassTaskInfoList.size() == 1) {
            if (remainWidth >= widthFirst) {
                if (glassCount < inCarMaxSize) {
@@ -315,7 +310,7 @@
                flag = Boolean.FALSE;
            }
        } else {
            Integer widthSecond = Math.max(edgGlassTaskInfoList.get(1).getWidth(), edgGlassTaskInfoList.get(1).getHeight());
            Integer widthSecond = Math.max(edgGlassTaskInfoList.get(1).getWidth() / 10, edgGlassTaskInfoList.get(1).getHeight() / 10);
            if (remainWidth >= widthFirst) {
                if (remainWidth - widthFirst - glassGap >= widthSecond) {
                    if (glassCount < inCarMaxSize) {
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/common/S7object.java
@@ -52,7 +52,9 @@
            }
            byte[] getplcvlues = plccontrol.readByte(PlcMesObject.getPlcAddressBegin(), PlcMesObject.getPlcAddressLength());
            if (getplcvlues != null) {
            PlcMesObject.setPlcParameterList(getplcvlues);
            }
        }
    }
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/service/DownStorageCageDetailsService.java
@@ -71,7 +71,7 @@
     */
    boolean DirectConnection(GlassInfo glassInfo);
    DownStorageCageDetails getGlassInfoMaxCount();
    String getGlassInfoMaxCount(String glassId);
    /**
     * @param glassId
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/service/impl/DownStorageCageDetailsServiceImpl.java
@@ -3,19 +3,14 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.yulichang.query.MPJLambdaQueryWrapper;
import com.github.yulichang.query.MPJQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.yulichang.query.MPJLambdaQueryWrapper;
import com.github.yulichang.toolkit.JoinWrappers;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.mes.common.config.Const;
import com.mes.downstorage.entity.DownStorageCage;
import com.mes.downstorage.entity.DownStorageCageDetails;
import com.mes.downstorage.mapper.DownStorageCageDetailsMapper;
import com.mes.downstorage.mapper.DownStorageCageMapper;
import com.mes.downstorage.service.DownStorageCageDetailsService;
import com.mes.downworkstation.entity.DownWorkstation;
@@ -198,8 +193,9 @@
    }
    @Override
    public DownStorageCageDetails getGlassInfoMaxCount() {
        return baseMapper.getGlassInfoMaxCount();
    public String getGlassInfoMaxCount(String glassId) {
        DownStorageCageDetails glassInfoMaxCount = baseMapper.getGlassInfoMaxCount();
        return null == glassInfoMaxCount ? glassId : glassInfoMaxCount.getGlassId();
    }
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/job/DownLoadCacheGlassTask.java
@@ -4,6 +4,7 @@
import cn.smallbun.screw.core.util.CollectionUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.mes.common.S7object;
import com.mes.common.config.Const;
import com.mes.device.PlcParameterObject;
@@ -94,7 +95,6 @@
        String currentSlot = plcParameterObject.getPlcParameter("currentCell").getValue();
        log.info("1、获取到的请求字为:{},获取到的扫描ID为:{},获取到的确认字为:{},获取到的出片状态分别为:g06:{}、g08:{}、g11:{}、g13:{},当前格子号为:{}",
                requestWord, glassIdeValue, confirmationWrodValue, out06Glassstate, out08Glassstate, out11Glassstate, out13Glassstate, currentSlot);
@@ -145,8 +145,7 @@
        //玻璃尺寸是否走人工下片
        if (glassInfo.getWidth() > maxWidth || glassInfo.getHeight() > maxHeight || glassInfo.getWidth() < minWidth || glassInfo.getHeight() < minHeight) {
            log.info("该玻璃尺寸不符合要求,需要走人工下片直接进片");
        }
        else {
        } else {
            log.info("该玻璃尺寸非人工下片");
            //获取该玻璃的流程卡是否已绑定架子
            DownWorkstation one = downWorkstationService.getOne(new LambdaQueryWrapper<DownWorkstation>()
@@ -161,7 +160,7 @@
            if (!checkFlag && !isBind) {
                log.info("该玻璃的流程卡未绑定架子,获取是否有空架子");
                List<DownWorkstation> list = downWorkstationService.list(new LambdaQueryWrapper<DownWorkstation>()
                        .isNull(DownWorkstation::getFlowCardId));
                        .isNull(DownWorkstation::getFlowCardId).orderByDesc(DownWorkstation::getWorkstationId));
                if (CollectionUtils.isNotEmpty(list)) {
                    log.info("有空架子,将流程卡与架子好绑定,执行进片任务 结束");
                    //绑定流程卡
@@ -245,8 +244,8 @@
            return Boolean.FALSE;
        }
        Boolean flag08 = "1".equals(out08Glassstate) ? Boolean.TRUE : Boolean.FALSE;
        if (!generateTaskByShelf(glassStatus06, glassStatus11, flag08, glassStatus13, tempList, cageDetails)) {
            return generateTaskByShelf(glassStatus06, glassStatus11, !flag08, glassStatus13, tempList, cageDetails);
        if (!generateTaskByShelf(glassStatus06, glassStatus11, flag08, glassStatus13, tempList, cageDetails, glassId)) {
            return generateTaskByShelf(glassStatus06, glassStatus11, !flag08, glassStatus13, tempList, cageDetails, glassId);
        }
        return Boolean.TRUE;
    }
@@ -288,7 +287,7 @@
        }
    }
    private Boolean generateTaskByShelf(String glassStatus06, String glassStatus11, Boolean flag08, String glassStatus13, List<DownStorageCageDetails> tempList, DownStorageCageDetails cageDetails) {
    private Boolean generateTaskByShelf(String glassStatus06, String glassStatus11, Boolean flag08, String glassStatus13, List<DownStorageCageDetails> tempList, DownStorageCageDetails cageDetails, String glassId) {
        //获取2个机械臂范围内的架子绑定的流程卡信息
        List<Integer> workList = new ArrayList();
@@ -357,10 +356,8 @@
            List<DownGlassInfoDTO> downGlassInfoDTOList = downGlassInfoService.queryWorkStationIsIn(Boolean.TRUE);
            List<String> downGlassFlowList = downGlassInfoDTOList.stream().map(item -> item.getFlowCardId() + ":" + item.getLayer()).collect(Collectors.toList());
            if (CollectionUtils.isEmpty(downGlassFlowList)) {
                //架子都未绑定流程卡,出笼内子数量最多尺寸最大的玻璃
                DownStorageCageDetails downStorageCageDetails = downStorageCageDetailsService.getGlassInfoMaxCount();
                //绑定流程卡,更新玻璃状态,生成出片任务,
                tempGlassId = downStorageCageDetails.getGlassId();
                //架子都未绑定流程卡,出笼内子数量最多尺寸最大的玻璃id,无  则返回扫描扫到的玻璃id进行出片
                tempGlassId = downStorageCageDetailsService.getGlassInfoMaxCount(glassId);
                isBind = Boolean.TRUE;
                break loop;
            }
@@ -371,9 +368,8 @@
//                List<DownWorkstation> emptyShelfList = downWorkstationService.list(new LambdaQueryWrapper<DownWorkstation>()
//                        .isNull(DownWorkstation::getFlowCardId));
                if (isEmptyShelf) {
                    DownStorageCageDetails downStorageCageDetails = downStorageCageDetailsService.getGlassInfoMaxCount();
                    //绑定流程卡,更新玻璃状态,生成出片任务
                    tempGlassId = downStorageCageDetails.getGlassId();
                    //架子都未绑定流程卡,出笼内子数量最多尺寸最大的玻璃id,无  则返回扫描扫到的玻璃id进行出片
                    tempGlassId = downStorageCageDetailsService.getGlassInfoMaxCount(glassId);
                    isBind = Boolean.TRUE;
                    break loop;
                }
@@ -484,7 +480,8 @@
            return Boolean.FALSE;
        }
        //更新落架玻璃数量
        downWorkstationService.update(new UpdateWrapper<DownWorkstation>().eq("flow_card_id", downStorageCageDetails.getFlowCardId())
                .eq("layer", downStorageCageDetails.getLayer()).setSql("racks_number = racks_number +1"));
        //生成任务信息
        DownGlassInfo downGlassInfo = new DownGlassInfo();
        BeanUtils.copyProperties(downStorageCageDetails, downGlassInfo);
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/resources/JsonFile/PlcdownGlass.json
@@ -12,7 +12,7 @@
        {
            "codeId": "requestID",
            "addressIndex": "2",
            "addressLenght": "30"
            "addressLenght": "20"
        },
        {
            "codeId": "currentCell",