hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/CacheGlassTask.java
@@ -66,11 +66,17 @@
    @Value("${mes.sequence.order}")
    private boolean sequenceOrder;
    @Value("${mes.firstLength}")
    @Value("${mes.max.firstLength}")
    private String firstLength;
    @Value("${mes.secondLength}")
    @Value("${mes.max.secondLength}")
    private String secondLength;
    @Value("${mes.min.firstLength}")
    private String minFirstLength;
    @Value("${mes.min.secondLength}")
    private String minSecondLength;
    @Scheduled(fixedDelay = 1000)
    public void plcHomeEdgTask() {
@@ -272,6 +278,10 @@
                        wrapper.innerJoin("(select glass_id, case when height <= width then width else height end as first_length, " +
                                "case when width < height then width else height end as second_length from edg_storage_cage_details) t1 " +
                                "on t.glass_id = t1.glass_id and (t1.first_length <=" + firstLength + " and t1.second_length<=" + secondLength + ") ");
                    } else {
                        wrapper.innerJoin("(select glass_id, case when height <= width then width else height end as first_length, " +
                                "case when width < height then width else height end as second_length from edg_storage_cage_details) t1 " +
                                "on t.glass_id = t1.glass_id and (t1.first_length >=" + minFirstLength + " and t1.second_length>=" + minSecondLength + ") ");
                    }
                    wrapper.last("order by count(t.glass_id) desc  limit 2");
                    List<EdgStorageCageDetails> list = edgStorageCageDetailsService.list(wrapper);
@@ -280,9 +290,13 @@
                                .selectAll(GlassInfo.class).eq("t.glass_id", glassId);
//                                .inSql("t.engineer_id", "select engineer_id from engineering where state = 1");
                        if (endcell == Const.A10_OUT_TARGET_POSITION) {
                            queryWrapper.innerJoin("(select glass_id, case when height <= width then width else height end as first_length, " +
                                    "case when width < height then width else height end as second_length from glass_info) t1 " +
                            wrapper.innerJoin("(select glass_id, case when height <= width then width else height end as first_length, " +
                                    "case when width < height then width else height end as second_length from edg_storage_cage_details) t1 " +
                                    "on t.glass_id = t1.glass_id and (t1.first_length <=" + firstLength + " and t1.second_length<=" + secondLength + ") ");
                        } else {
                            wrapper.innerJoin("(select glass_id, case when height <= width then width else height end as first_length, " +
                                    "case when width < height then width else height end as second_length from edg_storage_cage_details) t1 " +
                                    "on t.glass_id = t1.glass_id and (t1.first_length >=" + minFirstLength + " and t1.second_length>=" + minSecondLength + ") ");
                        }
                        GlassInfo one = glassInfoService.getOne(queryWrapper);
                        if (one != null) {
@@ -494,10 +508,14 @@
        wrapper.select("count(t.glass_id) as count, t.width, t.height")
                .eq("t.state", Const.GLASS_STATE_IN)
                .groupBy("t.width, t.height");
        if (endcell == Const.A09_OUT_TARGET_POSITION) {
        if (endcell == Const.A10_OUT_TARGET_POSITION) {
            wrapper.innerJoin("(select glass_id, case when height <= width then width else height end as first_length, " +
                    "case when width < height then width else height end as second_length from edg_storage_cage_details) t1 " +
                    "on t.glass_id = t1.glass_id and (t1.first_length <=" + firstLength + " and t1.second_length<=" + secondLength + ") ");
        } else {
            wrapper.innerJoin("(select glass_id, case when height <= width then width else height end as first_length, " +
                    "case when width < height then width else height end as second_length from edg_storage_cage_details) t1 " +
                    "on t.glass_id = t1.glass_id and (t1.first_length >=" + minFirstLength + " and t1.second_length>=" + minSecondLength + ") ");
        }
        wrapper.last("order by count(t.glass_id) desc  limit 2");
        List<EdgStorageCageDetails> list = edgStorageCageDetailsService.list(wrapper);
@@ -587,7 +605,7 @@
                boolean taskCacheStatus = saveTaskCache(glassInfo.getGlassId(), glassInfo.getSlot(), endcell, Const.GLASS_CACHE_TYPE_OUT);
                log.info("6、添加出片任务是否完成:{}", taskCacheStatus);
            }
            boolean glassSizeStatus = saveGlassSize(glassInfo);
            boolean glassSizeStatus = saveGlassSize(glassInfo, endcell);
            log.info("7、添加出片玻璃尺寸信息到磨边前玻璃表是否完成:{}", glassSizeStatus);
            S7object.getinstance().plccontrol.writeWord(confirmationWrodAddress, 1);
            log.info("8、发送确认字已完成");
@@ -620,15 +638,18 @@
     * 添加理片笼任务
     *
     * @param glassInfo
     * @param endcell
     * @return
     */
    private boolean saveGlassSize(EdgStorageCageDetails glassInfo) {
    private boolean saveGlassSize(EdgStorageCageDetails glassInfo, int endcell) {
        EdgGlassTaskInfo edgGlassTaskInfo = new EdgGlassTaskInfo();
        BeanUtils.copyProperties(glassInfo, edgGlassTaskInfo);
        edgGlassTaskInfo.setHeight((int) (glassInfo.getHeight() * ratio));
        edgGlassTaskInfo.setWidth((int) (glassInfo.getWidth() * ratio));
        edgGlassTaskInfo.setThickness((int) (glassInfo.getThickness() * ratio));
        edgGlassTaskInfo.setStatus(Const.EDG_GLASS_BEFORE);
        edgGlassTaskInfo.setLine(endcell);
        edgGlassTaskInfo.setTime(new Date());
        return edgGlassTaskInfoService.save(edgGlassTaskInfo);
    }