zhoushihao
2025-04-21 c11313e87c3bbbdb3910ebf1e5ee7b153e527f40
1、卧式理片笼漏提代码
1个文件已修改
32 ■■■■ 已修改文件
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/opccallback/CacheGlassStartCallback.java 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/opccallback/CacheGlassStartCallback.java
@@ -7,7 +7,6 @@
import com.kangaroohy.milo.runner.subscription.SubscriptionCallback;
import com.mes.common.config.Const;
import com.mes.edgglasstask.service.EdgGlassTaskInfoService;
import com.mes.edgstoragecage.entity.EdgStorageCage;
import com.mes.edgstoragecage.entity.EdgStorageCageDetails;
import com.mes.edgstoragecage.service.EdgStorageCageDetailsService;
import com.mes.edgstoragecage.service.EdgStorageCageService;
@@ -20,7 +19,6 @@
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@@ -54,12 +52,12 @@
    @Resource
    EdgGlassTaskInfoService edgGlassTaskInfoService;
    @Value("${mes.glassGap}")
    private int glassGap;
    @Value("${mes.threshold}")
    private int threshold;
    @Value("${mes.cellLength}")
    private int cellLength;
//    @Value("${mes.glassGap}")
//    private int glassGap;
//    @Value("${mes.threshold}")
//    private int threshold;
//    @Value("${mes.cellLength}")
//    private int cellLength;
    private Date startDate;
@@ -439,15 +437,15 @@
    }
    private boolean updateCellRemainWidth(int slot, int device) {
        List<EdgStorageCageDetails> list = edgStorageCageDetailsService.list(new LambdaQueryWrapper<EdgStorageCageDetails>().eq(EdgStorageCageDetails::getSlot, slot)
                .eq(EdgStorageCageDetails::getState, Const.GLASS_STATE_IN));
        int remainWidth = cellLength;
        if (CollectionUtil.isNotEmpty(list)) {
            int widthTotal = (int) list.stream().map(e -> Math.max(e.getWidth(), e.getHeight()) + glassGap).mapToDouble(Double::intValue).sum();
            remainWidth = cellLength - widthTotal >= 0 ? cellLength - widthTotal : 0;
        }
        edgStorageCageService.update(new LambdaUpdateWrapper<EdgStorageCage>().
                set(EdgStorageCage::getRemainWidth, remainWidth).eq(EdgStorageCage::getSlot, slot).eq(EdgStorageCage::getDeviceId, device));
//        List<EdgStorageCageDetails> list = edgStorageCageDetailsService.list(new LambdaQueryWrapper<EdgStorageCageDetails>().eq(EdgStorageCageDetails::getSlot, slot)
//                .eq(EdgStorageCageDetails::getState, Const.GLASS_STATE_IN));
//        int remainWidth = cellLength;
//        if (CollectionUtil.isNotEmpty(list)) {
//            int widthTotal = (int) list.stream().map(e -> Math.max(e.getWidth(), e.getHeight()) + glassGap).mapToDouble(Double::intValue).sum();
//            remainWidth = cellLength - widthTotal >= 0 ? cellLength - widthTotal : 0;
//        }
//        edgStorageCageService.update(new LambdaUpdateWrapper<EdgStorageCage>().
//                set(EdgStorageCage::getRemainWidth, remainWidth).eq(EdgStorageCage::getSlot, slot).eq(EdgStorageCage::getDeviceId, device));
        return Boolean.TRUE;
    }
}