wangfei
2025-04-21 09402133807b1e774e658a13ad365b2e6efca25b
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/opctask/service/impl/EdgStorageDeviceTaskServiceImpl.java
@@ -4,6 +4,7 @@
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.mes.common.config.Const;
import com.mes.common.config.ConstSysConfig;
import com.mes.edgstoragecage.entity.EdgStorageCage;
import com.mes.edgstoragecage.entity.EdgStorageCageDetails;
import com.mes.edgstoragecage.entity.vo.EdgSlotRemainVO;
@@ -14,7 +15,7 @@
import com.mes.opctask.mapper.EdgStorageDeviceTaskMapper;
import com.mes.opctask.service.EdgStorageDeviceTaskHistoryService;
import com.mes.opctask.service.EdgStorageDeviceTaskService;
import org.springframework.beans.factory.annotation.Value;
import com.mes.sysconfig.service.SysConfigService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@@ -41,11 +42,13 @@
    private EdgStorageCageService edgStorageCageService;
    @Resource
    EdgStorageDeviceTaskMapper edgStorageDeviceTaskMapper;
    @Resource
    SysConfigService sysConfigService;
    @Value("${mes.glassGap}")
    private int glassGap;
    @Value("${mes.cellLength}")
    private int cellLength;
//    @Value("${mes.glassGap}")
//    private int glassGap;
//    @Value("${mes.cellLength}")
//    private int cellLength;
    @Override
    public EdgStorageDeviceTask queryTaskMessage(String tableName) {
@@ -96,6 +99,7 @@
        task.setTaskRunning(Const.GLASS_CACHE_TYPE_EMPTY);
        task.setGlassIdOut("");
        task.setStartCell(0);
        task.setEndCell(0);
        this.updateTaskMessage(tableName, task);
        return Boolean.TRUE;
    }
@@ -114,17 +118,20 @@
        task.setTaskRunning(Const.GLASS_CACHE_TYPE_EMPTY);
        task.setGlassIdOut("");
        task.setStartCell(0);
        task.setEndCell(0);
        this.updateTaskMessage(tableName, task);
        return Boolean.TRUE;
    }
    private boolean resetSlotRemainWidth() {
        int cellLength = sysConfigService.queryConfigValue(ConstSysConfig.CACHE_CELL_LENGTH);
        int glassGap = sysConfigService.queryConfigValue(ConstSysConfig.CACHE_GLASS_GAP);
        //将尺寸重置为原始尺寸
        edgStorageCageService.update(new LambdaUpdateWrapper<EdgStorageCage>().set(EdgStorageCage::getRemainWidth, cellLength));
        //获取笼内的详情数据
        List<EdgSlotRemainVO> edgSlotRemainVOS = edgStorageCageDetailsService.querySlotRemainWidth(cellLength, glassGap);
        //按照查询结果对笼内现有玻璃的格子尺寸进行更新
        if(CollectionUtils.isNotEmpty(edgSlotRemainVOS)){
        if (CollectionUtils.isNotEmpty(edgSlotRemainVOS)) {
            edgStorageCageService.resetSlotRemainWidth(edgSlotRemainVOS);
        }
        return Boolean.TRUE;