1:大理片 新增计算最大宽度:避免高度大于宽度  计算出错
2、磨边前卧式理片新增最小尺寸校验
3、下片修复下片逻辑异常,新增配置 人工下片的最大尺寸 最小尺寸 直通任务的最大尺寸
11个文件已修改
134 ■■■■■ 已修改文件
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgglasstask/entity/EdgGlassTaskInfo.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/CacheGlassTask.java 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/application.yml 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageCageDetailsServiceImpl.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/mapper/BigStorageCageFeedTaskMapper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/service/impl/BigStorageCageFeedTaskServiceImpl.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/PlcStorageCageTask.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/mapper/BigStorageCageFeedTaskMapper.xml 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/job/DownLoadCacheGlassTask.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/resources/application.yml 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgglasstask/entity/EdgGlassTaskInfo.java
@@ -4,6 +4,7 @@
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
/**
 * <p>
@@ -31,7 +32,8 @@
    private Integer status;
    private Integer line;
    private Date time;
}
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);
    }
hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/application.yml
@@ -13,8 +13,12 @@
mes:
  threshold: 3
  ratio: 10
  firstLength: 3500
  secondLength: 2500
  max:
    firstLength: 3500
    secondLength: 2500
  min:
    firstLength: 600
    secondLength: 350
  sequence:
    order: false
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageCageDetailsServiceImpl.java
@@ -13,7 +13,6 @@
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;
@@ -59,8 +58,8 @@
    @Value("${mes.slotWidth}")
    private Integer slotWidth;
    @Value("${mes.galssGap}")
    private Integer galssGap;
    @Value("${mes.glassGap}")
    private Integer glassGap;
    /**
     * 查询进/出片任务
@@ -131,7 +130,7 @@
        for (BigStorageCageDetails bigStorageCageDetails : bigStorageCageDetailsList
        ) {
            if (bigStorageCageDetails.getBigStorageCageFeedTask().getTaskState() == 0) {
                carWidth = carWidth - bigStorageCageDetails.getWidth() - galssGap;
                carWidth = carWidth - bigStorageCageDetails.getWidth() - glassGap;
            }
        }
        return carWidth;
@@ -187,7 +186,7 @@
        if (glassInfo != null) {
            BeanUtils.copyProperties(glassInfo, bigStorageCageDetails);
            bigStorageCageDetails.setState(1);
            bigStorageCageDetails.setGap(galssGap);
            bigStorageCageDetails.setGap(glassGap);
        }
        List<BigStorageCageDetails> bigStorageCageDetailsList = new ArrayList<>();
        bigStorageCageDetailsList.add(bigStorageCageDetails);
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/mapper/BigStorageCageFeedTaskMapper.java
@@ -10,7 +10,7 @@
/**
 * <p>
 *  Mapper 接口
 * Mapper 接口
 * </p>
 *
 * @author zhoush
@@ -21,5 +21,5 @@
    List<Integer> querySitToUpGlass();
    BigStorageDTO querySitToUpRemainWidth(@Param(value = "line") Integer line);
    BigStorageDTO querySitToUpRemainWidth(@Param(value = "line") Integer line, @Param(value = "glassGap") Integer glassGap);
}
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/service/impl/BigStorageCageFeedTaskServiceImpl.java
@@ -7,13 +7,14 @@
import com.mes.bigstoragetask.entity.BigStorageCageFeedTask;
import com.mes.bigstoragetask.mapper.BigStorageCageFeedTaskMapper;
import com.mes.bigstoragetask.service.BigStorageCageFeedTaskService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.List;
/**
 * <p>
 *  服务实现类
 * 服务实现类
 * </p>
 *
 * @author zhoush
@@ -22,9 +23,12 @@
@Service
public class BigStorageCageFeedTaskServiceImpl extends ServiceImpl<BigStorageCageFeedTaskMapper, BigStorageCageFeedTask> implements BigStorageCageFeedTaskService {
    @Value("${mes.glassGap}")
    private Integer glassGap;
    @Override
    public void addFeedTask(BigStorageCageDetails slotInfo, Integer plcFeedReqLine, int taskType){
        BigStorageCageFeedTask bigStorageCageFeedTask=new BigStorageCageFeedTask();
    public void addFeedTask(BigStorageCageDetails slotInfo, Integer plcFeedReqLine, int taskType) {
        BigStorageCageFeedTask bigStorageCageFeedTask = new BigStorageCageFeedTask();
        bigStorageCageFeedTask.setId(slotInfo.getId());
        bigStorageCageFeedTask.setTaskState(0);
        bigStorageCageFeedTask.setLine(plcFeedReqLine);
@@ -41,7 +45,7 @@
    @Override
    public BigStorageDTO querySitToUpRemainWidth(Integer line) {
        return baseMapper.querySitToUpRemainWidth(line);
        return baseMapper.querySitToUpRemainWidth(line, glassGap);
    }
    @Override
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/PlcStorageCageTask.java
@@ -78,8 +78,8 @@
    @Value("${mes.outCarMaxSize}")
    private Integer outCarMaxSize;
    @Value("${mes.galssGap}")
    private Integer galssGap;
    @Value("${mes.glassGap}")
    private Integer glassGap;
    @Scheduled(fixedDelay = 300)
    public void plcToHomeEdgScan() {
@@ -235,7 +235,7 @@
        List<BigStorageCageDetails> artificialList = bigStorageCageDetailsService.list(new LambdaQueryWrapper<BigStorageCageDetails>()
                .eq(BigStorageCageDetails::getState, Const.GLASS_STATE_ARTIFICIAL).orderByDesc(BigStorageCageDetails::getWidth));
        if (CollectionUtils.isNotEmpty(artificialList)) {
            computeOutGlassInfo(temperingGlassInfoList, Boolean.FALSE, mesToPLCAddress);
            computeOutGlassInfo(artificialList, Boolean.FALSE, mesToPLCAddress);
            return;
        }
        //钢化优先:获取理片笼  玻璃小片  破损表 数量   判断笼内版图是否到齐
@@ -262,7 +262,7 @@
            for (int i = 0; i < slotSequenceList.size() - 1; i++) {
                SlotSequenceDTO first = slotSequenceList.get(i);
                SlotSequenceDTO second = slotSequenceList.get(i + 1);
                int slotWidth = carWidth - first.getRemainWidth() - galssGap;
                int slotWidth = carWidth - first.getRemainWidth() - glassGap;
                if (first.getMinSequence() == second.getMaxSequence() + 1
                        && second.getRemainWidth() > slotWidth) {
                    List<BigStorageCageDetails> list = bigStorageCageDetailsService.list(new LambdaQueryWrapper<BigStorageCageDetails>()
@@ -303,7 +303,7 @@
        Boolean flag = Boolean.TRUE;
        //2、获取卧转立
        Integer widthFirst = edgGlassTaskInfoList.get(0).getWidth();
        Integer widthFirst = Math.max(edgGlassTaskInfoList.get(0).getWidth(), edgGlassTaskInfoList.get(0).getHeight());
        if (edgGlassTaskInfoList.size() == 1) {
            if (remainWidth >= widthFirst) {
                if (glassCount < inCarMaxSize) {
@@ -315,9 +315,9 @@
                flag = Boolean.FALSE;
            }
        } else {
            Integer widthSecond = edgGlassTaskInfoList.get(1).getWidth();
            Integer widthSecond = Math.max(edgGlassTaskInfoList.get(1).getWidth(), edgGlassTaskInfoList.get(1).getHeight());
            if (remainWidth >= widthFirst) {
                if (remainWidth - widthFirst - galssGap >= widthSecond) {
                if (remainWidth - widthFirst - glassGap >= widthSecond) {
                    if (glassCount < inCarMaxSize) {
                        addFeedTask(glassId, line, Const.BIG_STORAGE_IN_WAIT, widthFirst);
                    } else {
@@ -446,7 +446,7 @@
            if (bigStorageCageOutTaskList.size() > outCarMaxSize || e.getWidth() > remainWidth) {
                break;
            }
            remainWidth = remainWidth - (int) e.getWidth() - galssGap;
            remainWidth = remainWidth - (int) e.getWidth() - glassGap;
            if (isTempering) {
                bigStorageCageOutTaskList.add(new BigStorageCageOutTask(e.getGlassId(), e.getSlot(), Const.TEMPERING_OUT_TARGET_POSITION,
                        (int) e.getWidth() * 10, 0, 0, 1));
@@ -483,7 +483,7 @@
        List<Integer> slotList = list.stream().map(T::getSlot).distinct().collect(Collectors.toList());
        //获取待出去的玻璃信息(等下车出去的玻璃)
        Map<Integer, Double> slotRemainMap = list.stream().filter(e -> !taskGlassIds.contains(e.getGlassId()))
                .collect(Collectors.groupingBy(T::getSlot, Collectors.summingDouble(item -> item.getWidth() + galssGap)));
                .collect(Collectors.groupingBy(T::getSlot, Collectors.summingDouble(item -> item.getWidth() + glassGap)));
        if (CollectionUtils.isNotEmpty(slotRemainMap)) {
            //按照格子号更新剩余尺寸
            slotRemainMap.forEach((e, v) -> {
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application.yml
@@ -18,4 +18,4 @@
  slotWidth: 5000   #大车宽度
  inCarMaxSize: 6     #进片大车最大存放玻璃数量
  outCarMaxSize: 1     #出片大车最大存放玻璃数量
  galssGap: 300      #玻璃间距
  glassGap: 300      #玻璃间距
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/mapper/BigStorageCageFeedTaskMapper.xml
@@ -21,11 +21,21 @@
        where t.total_count = t.real_count
    </select>
    <select id="querySitToUpRemainWidth" resultMap="bigStorageDTO">
        SELECT cast(5000 - sum(width + 20) as INT) as REMAIN_WIDTH,
               count(glass_id)                     as GLASS_COUNT
        FROM big_storage_cage_feed_task
        WHERE line = #{line}
          AND task_state in (1, 2)
        SELECT CAST
                   (5000 - SUM(MAX_LENGTH + #{glassGap}) AS INT) AS REMAIN_WIDTH,
               COUNT(GLASS_ID)                                   AS GLASS_COUNT
        FROM (
                 SELECT GLASS_ID,
                        CASE
                            WHEN WIDTH >= HEIGHT THEN
                                WIDTH
                            ELSE HEIGHT
                            END MAX_LENGTH
                 FROM BIG_STORAGE_CAGE_FEED_TASK
                 WHERE LINE = 2002
                   AND TASK_STATE IN (1, 2)
             ) T
    </select>
</mapper>
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/job/DownLoadCacheGlassTask.java
@@ -236,8 +236,8 @@
            return Boolean.FALSE;
        }
        Boolean flag08 = "1".equals(out08Glassstate) ? Boolean.TRUE : Boolean.FALSE;
        if (!generateTaskByShelf(glassStatus11, flag08, glassStatus13, tempList, cageDetails)) {
            return generateTaskByShelf(glassStatus11, !flag08, glassStatus13, tempList, cageDetails);
        if (!generateTaskByShelf(glassStatus06, glassStatus11, flag08, glassStatus13, tempList, cageDetails)) {
            return generateTaskByShelf(glassStatus06, glassStatus11, !flag08, glassStatus13, tempList, cageDetails);
        }
        return Boolean.TRUE;
    }
@@ -279,16 +279,16 @@
        }
    }
    private Boolean generateTaskByShelf(String glassStatus, 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) {
        //获取2个机械臂范围内的架子绑定的流程卡信息
        List<Integer> workList = new ArrayList();
        if (flag08) {
            if (!"2".equals(glassStatus)) {
            if (!"2".equals(glassStatus11)) {
                workList.addAll(Const.G11_WORK_STATION);
            }
        } else {
            if (!"2".equals(glassStatus)) {
            if (!"2".equals(glassStatus06)) {
                workList.addAll(Const.G06_WORK_STATION);
            }
        }
@@ -297,7 +297,7 @@
        //对笼内玻璃进行过滤,仅出符合逻辑的玻璃
        if (CollectionUtils.isNotEmpty(workList)) {
            List<DownWorkstation> downWorkstationList = downWorkstationService.list(new LambdaQueryWrapper<DownWorkstation>()
                    .eq(DownWorkstation::getEnableState, 0).in(DownWorkstation::getWorkstationId, workList));
                    .eq(DownWorkstation::getEnableState, Const.SLOT_ON).in(DownWorkstation::getWorkstationId, workList));
            log.info("架子被禁用,无法出片落架");
            if (CollectionUtils.isEmpty(downWorkstationList)) {
                log.info("笼子被禁用,无法走机械臂下片");
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/resources/application.yml
@@ -3,7 +3,7 @@
spring:
  profiles:
    active: dev
    active: cz
  application:
    name: unLoadGlass
@@ -14,8 +14,10 @@
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
mes:
  maxWidth: 1000    #下片的最大宽度
  maxHeight: 1000   #下片的最大高度
  maxWidth: 2500    #下片的最大宽度
  maxHeight: 2000   #下片的最大高度
  minWidth: 400    #下片的最大宽度
  minHeight: 400   #下片的最大高度
  throughWidth: 3000
  throughHeight: 3000
  throughHeight: 2500
  threshold: 5      #下片的最大阈值