ZengTao
2024-10-19 06cb470194e34475a5506a4e89c2a563b6282f83
磨边方法还原
3个文件已修改
67 ■■■■ 已修改文件
UI-Project/src/views/Slicecage/slicecage.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/CacheGlassTask.java 62 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/job/DownLoadCacheGlassTask.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/views/Slicecage/slicecage.vue
@@ -960,7 +960,7 @@
    <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="info" @click="dialogFormVisibles=true;fetchFlows()">{{ $t('searchOrder.searchlayout') }}</el-button>
    <el-switch style="margin-top: 5px;margin-left: 10px;" v-model="ganghua" class="mb-2" :inactive-text="$t('searchOrder.temperedswitch')" @change="handleChange" />
    <el-button style="margin-top: 10px;margin-left: 10px;margin-bottom: 10px;" id="searchButton" type="primary"
      @click="dialogFormVisibleaDownGlasss = true">人工下片
      @click="dialogFormVisibleaDownGlasss = true">标签打印
    </el-button>
    <el-card style="flex: 1;margin-left: 10px;margin-top: 5px;" v-loading="loading">
      <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;max-height: 100px;">
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/CacheGlassTask.java
@@ -80,6 +80,12 @@
    @Value("${mes.max.secondLength}")
    private String secondLength;
    @Value("${mes.cache.cacheWidth}")
    private double cacheWidth;
    @Value("${mes.cache.cacheHeight}")
    private double cacheHeight;
    @Value("${mes.min.one.firstLength}")
    private String minOneFirstLength;
@@ -94,7 +100,7 @@
    public static String engineerId = "";
    //@Scheduled(fixedDelay = 1000)
    @Scheduled(fixedDelay = 1000)
    public void plcHomeEdgTask() {
        Date startDate = new Date();
        log.info("本次任务开始执行时间:{}", startDate);
@@ -107,6 +113,13 @@
        String out10Glassstate = plcParameterObject.getPlcParameter("A10_glass_status").getValue();
        String confirmationWrodAddress = plcParameterObject.getPlcParameter("MES_confirmation_word").getAddress();
        String currentSlot = plcParameterObject.getPlcParameter("Current_slot").getValue();
//        taskRequestTypeValue = "3";
//        out08Glassstate = "1";
//        out10Glassstate = "1";
//        currentSlot = "2";
//        confirmationWrodValue = "0";
//        glassIdeValue = "P24092706|15|5";
        log.info("1、获取到的请求字为:{},获取到的扫描ID为:{},获取到的确认字为:{},获取到的出片状态分别为:A09:{}、A10:{},当前格子号为:{}",
                taskRequestTypeValue, glassIdeValue, confirmationWrodValue, out08Glassstate, out10Glassstate, currentSlot);
@@ -132,7 +145,7 @@
            //09空闲 :1      10空闲 :2        都空闲:3    其他0
            log.info("2、出片请求,且确认字为0,执行出片任务");
            outTo(Integer.parseInt(out08Glassstate),
                    Integer.parseInt(out10Glassstate), confirmationWrodAddress, "", 0);
                    Integer.parseInt(out10Glassstate), confirmationWrodAddress, "", Integer.parseInt(currentSlot));
        } else if ("3".equals(taskRequestTypeValue)) {
            log.info("2、进片和出片都空闲,执行出片任务");
            //加笼子里面是否有玻璃,有先出,无玻璃先进
@@ -165,9 +178,9 @@
                Damage damage = new Damage();
                damage.setGlassId(e.getGlassId());
                damage.setLine(e.getEndCell());
                damage.setWorkingProcedure("冷加工");
                damage.setWorkingProcedure("磨边");
                damage.setRemark("磨边前卧式理片");
                damage.setStatus(0);
                damage.setStatus(1);
                damage.setType(e.getTaskStatus());
                return damage;
            }).collect(Collectors.toList());
@@ -187,6 +200,16 @@
     */
    public void inTo(String glassId, String confirmationWrodAddress, String currentSlot) {
        log.info("1、按照玻璃id:{}获取玻璃小片信息,当前格子为:{}", glassId, currentSlot);
        GlassInfo feedGlassInfo = glassInfoService.getOne(
                new LambdaQueryWrapper<GlassInfo>()
                        .eq(GlassInfo::getGlassId, glassId)
        );
        if (Math.max(feedGlassInfo.getWidth(), feedGlassInfo.getHeight()) > cacheWidth || Math.min(feedGlassInfo.getWidth(), feedGlassInfo.getHeight()) > cacheHeight) {
            log.info("1.1、玻璃超过卧式理片最大尺寸:{}", feedGlassInfo);
            return;
        }
        //添加进片任务  查找空格
        EdgStorageCage nearestEmpty = edgStorageCageService.selectNearestEmpty(Integer.parseInt(currentSlot), Boolean.FALSE);
        Assert.isTrue(null != nearestEmpty, "格子已满");
@@ -233,11 +256,14 @@
                .eq(GlassInfo::getHeight, glassInfo.getHeight())
                .eq(GlassInfo::getThickness, glassInfo.getThickness())
                .eq(GlassInfo::getFilmsid, glassInfo.getFilmsid())
                .eq(GlassInfo::getFlowCardId, glassInfo.getFlowCardId())
                .ne(GlassInfo::getGlassId, glassInfo.getGlassId())
                .eq(GlassInfo::getTotalLayer, glassInfo.getTotalLayer())
                .eq(GlassInfo::getLayer, glassInfo.getLayer())
                .eq(GlassInfo::getEngineerId, glassInfo.getEngineerId())
                .notInSql(GlassInfo::getGlassId, "select distinct glass_id from edg_storage_cage_details " +
                        "where engineer_id = '" + glassInfo.getEngineerId() + "' and width = " + glassInfo.getWidth() + " and height = " + glassInfo.getHeight())
                        "where engineer_id = '" + glassInfo.getEngineerId() + "' and width = " + glassInfo.getWidth() + " and height = " + glassInfo.getHeight()
                        + " and state != 100")
                .orderByAsc(GlassInfo::getTemperingLayoutId)
                .orderBy(Boolean.TRUE, sequenceOrder, GlassInfo::getTemperingFeedSequence)
                .last("Limit 1");
@@ -272,17 +298,28 @@
//        获取待出笼的玻璃需要替换的玻璃信息
        EdgStorageCageDetails swapGlassDetailInfo = edgStorageCageDetailsService.getOne(new LambdaQueryWrapper<EdgStorageCageDetails>()
                .eq(EdgStorageCageDetails::getGlassId, swapGlassId).eq(EdgStorageCageDetails::getState, Const.GLASS_STATE_IN));
//      玻璃小片表中玻璃已经替换,更新卧理笼内现有的准备出笼的玻璃信息,
        if (null == swapGlassDetailInfo) {
            GlassInfo glassInfoBase = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>()
                    .eq(GlassInfo::getGlassId, swapGlassId));
            //需要替换的玻璃为存进卧理,仅需更新当前需要出笼的玻璃信息即可
            edgStorageCageDetailsService.update(new LambdaUpdateWrapper<EdgStorageCageDetails>()
                    .eq(EdgStorageCageDetails::getGlassId, glassId).set(EdgStorageCageDetails::getGlassId, swapGlassId));
                    .eq(EdgStorageCageDetails::getGlassId, glassId)
                    .set(EdgStorageCageDetails::getTemperingLayoutId, glassInfoBase.getTemperingLayoutId())
                    .set(EdgStorageCageDetails::getTemperingFeedSequence, glassInfoBase.getTemperingFeedSequence()));
        } else {
            //需要替换的玻璃都在卧理内,按照玻璃id对调玻璃信息:对调玻璃id即可
            edgStorageCageDetailsService.update(new LambdaUpdateWrapper<EdgStorageCageDetails>()
                    .eq(EdgStorageCageDetails::getId, glassInfo.getId()).set(EdgStorageCageDetails::getGlassId, swapGlassId));
                    .eq(EdgStorageCageDetails::getId, glassInfo.getId())
                    .set(EdgStorageCageDetails::getTemperingLayoutId, swapGlassDetailInfo.getTemperingLayoutId())
                    .set(EdgStorageCageDetails::getTemperingFeedSequence, swapGlassDetailInfo.getTemperingFeedSequence())
            );
            edgStorageCageDetailsService.update(new LambdaUpdateWrapper<EdgStorageCageDetails>()
                    .eq(EdgStorageCageDetails::getId, swapGlassDetailInfo.getId()).set(EdgStorageCageDetails::getGlassId, glassId));
                    .eq(EdgStorageCageDetails::getId, swapGlassDetailInfo.getId())
                    .set(EdgStorageCageDetails::getTemperingLayoutId, glassInfo.getTemperingLayoutId())
                    .set(EdgStorageCageDetails::getTemperingFeedSequence, glassInfo.getTemperingFeedSequence())
            );
        }
    }
@@ -317,6 +354,7 @@
        //定义出片玻璃信息
        int endcell = 0;
        EdgStorageCageDetails glassInfo = null;
        boolean flag = queryMaxMinDiff(threshold);
        log.info("1、获取钢化版图是否超过阈值:{}", flag);
        if (flag) {
@@ -417,7 +455,7 @@
                }
            }
        }
        return saveOutGlassMessage(glassInfo, endcell, confirmationWrodAddress, glassId, currentSlot);
        return saveOutGlassMessageBySlot(glassInfo, endcell, confirmationWrodAddress, glassId, currentSlot);
    }
    /**
@@ -659,6 +697,7 @@
            log.info("4、添加出片任务,玻璃id:{},任务类型:{},起始位置:{},结束位置:{}", glassInfo.getGlassId(),
                    2, glassInfo.getSlot(), endcell);
            if (glassInfo.getGlassId().equals(glassId)) {
                log.info("5、直通任务,将玻璃信息插入卧式理片笼,当前玻璃信息:{}", glassInfo);
                EdgStorageCageDetails details = new EdgStorageCageDetails();
                BeanUtils.copyProperties(glassInfo, details);
@@ -718,7 +757,7 @@
                    BeanUtils.copyProperties(glassInfo, details);
                } else {
                    GlassInfo one = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getGlassId, glassId));
                    BeanUtils.copyProperties(glassInfo, details);
                    BeanUtils.copyProperties(one, details);
                }
                EdgStorageCage nearestEmpty = edgStorageCageService.selectNearestEmpty(currentSlot, Boolean.TRUE);
                Assert.isTrue(null != nearestEmpty, "格子已满,无法执行直通任务");
@@ -730,7 +769,7 @@
                log.info("6、添加出片任务是否完成:{}", taskCacheStatus);
            } else {
                log.info("5、非直通任务,将玻璃信息插入卧式理片笼,当前玻璃信息:{}", glassInfo);
                if (endcell != currentSlot) {
                if (!glassInfo.getSlot().equals(currentSlot)) {
                    EdgStorageCageDetails currentGlass = edgStorageCageDetailsService.getOne(new LambdaQueryWrapper<EdgStorageCageDetails>()
                            .eq(EdgStorageCageDetails::getState, Const.GLASS_STATE_IN)
                            .eq(EdgStorageCageDetails::getSlot, currentSlot).eq(EdgStorageCageDetails::getWidth, glassInfo.getWidth())
@@ -738,7 +777,6 @@
                    );
                    if (null != currentGlass) {
                        glassInfo = currentGlass;
                        endcell = currentSlot;
                    }
                }
                //玻璃信息替换
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/job/DownLoadCacheGlassTask.java
@@ -156,7 +156,7 @@
            //下片数量-1
            for (DownGlassTask downGlassTask : downGlassTaskList
            ) {
                if (Const.GLASS_CACHE_TYPE_OUT_ALL.equals(downGlassTask.getTaskType())) {
                if (Const.GLASS_CACHE_TYPE_OUT_ALL.contains(downGlassTask.getTaskType())) {
                    downWorkstationService.update(
                            new LambdaUpdateWrapper<DownWorkstation>()
                                    .setSql("racks_number = racks_number-1")
@@ -689,7 +689,6 @@
        downGlassInfoService.save(downGlassInfo);
        //生成任务信息
        GlassInfo glassInfo = new GlassInfo();
        downStorageCageDetails.setLayer(0);
        BeanUtils.copyProperties(downStorageCageDetails, glassInfo);
        //删除理片笼表拿走/破损数据数据
        damageService.deleteByGlassId(glassInfo.getGlassId());