zhoushihao
2025-12-01 3defdfb435a1a9b3822f5c1b7f9b9995ed986c1f
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageNewTask.java
@@ -6,6 +6,7 @@
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.github.xingshuangs.iot.protocol.s7.serializer.S7Serializer;
import com.github.xingshuangs.iot.protocol.s7.service.S7PLC;
import com.github.yulichang.toolkit.JoinWrappers;
import com.kangaroohy.milo.model.ReadWriteEntity;
import com.kangaroohy.milo.service.MiloService;
@@ -87,6 +88,9 @@
    @Autowired
    @Qualifier("s7SerializerDLPTwo")
    private S7Serializer s7SerializerDLPTwo;
    @Autowired
    @Qualifier("s7plcWZL")
    private S7PLC s7plcWZL;
    @Resource
    SysConfigService sysConfigService;
@@ -256,13 +260,13 @@
                    .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL));
            if (count > 0) {
                log.info("直通片台存在玻璃,结束本次进片");
                ProductAlarmInfo alarmInfo = new ProductAlarmInfo();
                alarmInfo.setState(Const.LOAD_RAW_GLASS_NEW);
                alarmInfo.setAlarmModule(ALARM_MODULE);
                alarmInfo.setAlarmType(ALARM_TYPE);
                alarmInfo.setAlarmCode(ALARM_CODE_OVER);
                alarmInfo.setAlarmMessage("");
                productAlarmInfoService.save(alarmInfo);
//                ProductAlarmInfo alarmInfo = new ProductAlarmInfo();
//                alarmInfo.setState(Const.LOAD_RAW_GLASS_NEW);
//                alarmInfo.setAlarmModule(ALARM_MODULE);
//                alarmInfo.setAlarmType(ALARM_TYPE);
//                alarmInfo.setAlarmCode(ALARM_CODE_OVER);
//                alarmInfo.setAlarmMessage("");
//                productAlarmInfoService.save(alarmInfo);
                //向plc发送报警:直通片台存在玻璃,无法继续直通
//                miloService.writeToOpcWord(generateReadWriteEntity("DLP1A.DLP1A.alarmSignal", 64));
                s7DataDLPOne = new S7DataDLPOne();
@@ -389,6 +393,17 @@
            log.info("当前未收到出片请求,结束出片任务");
            return;
        }
        try {
            int outRequest = s7plcWZL.readUInt16("DB51.8");
            if (outRequest == 0){
                log.info("当前未收到卧转立允许出片请求,结束出片任务");
                return;
            }
        } catch (Exception e) {
            log.error("读取卧转立信号异常", e);
            return;
        }
        //获取出片任务表
        List<BigStorageCageTask> outTaskList = getOutTaskList(s7DataWLTwo);
        if (CollectionUtil.isNotEmpty(outTaskList)) {
@@ -414,6 +429,8 @@
                LambdaQueryWrapper<BigStorageCage> queryWrapper = new LambdaQueryWrapper<BigStorageCage>()
                        .eq(BigStorageCage::getRemainWidth, slotWidth)
                        .eq(BigStorageCage::getEnableState, Const.SLOT_ON)
                        .le(BigStorageCage::getMinThickness, info.getThickness())
                        .ge(BigStorageCage::getMaxThickness, info.getThickness())
                        .orderByAsc(BigStorageCage::getDeviceId).orderByAsc(BigStorageCage::getSlot)
                        .last("limit 1");
@@ -1009,7 +1026,7 @@
//        if (!THROUGH_SLOT.equals(list.get(0).getSlot())) {
//            临时解决方案:出片时考虑玻璃碰撞,改为一片一出
        // 界面关闭调度开关 !Const.BIG_STORAGE_BEFORE_DISPATCH.equals(taskType)
        if (list.get(0).getSlot() >= 500 && list.get(0).getThickness() > 8) {
        if (list.get(0).getSlot() >= 500 && list.get(0).getThickness() > 7) {
            outGlassList = list.subList(0, 1);
        } else {
            List<String> glassIdList = bigStorageGlassRelationInfoService.queryNeedOutGlassId(