wangfei
2025-04-21 09402133807b1e774e658a13ad365b2e6efca25b
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/tools/service/impl/BigStorageBaseServiceImpl.java
@@ -13,13 +13,14 @@
import com.mes.bigstoragetask.entity.BigStorageCageFeedTask;
import com.mes.common.S7object;
import com.mes.common.config.Const;
import com.mes.common.config.ConstSysConfig;
import com.mes.device.PlcParameterObject;
import com.mes.glassinfo.entity.GlassInfo;
import com.mes.glassinfo.service.GlassInfoService;
import com.mes.sysconfig.service.SysConfigService;
import com.mes.tools.S7control;
import com.mes.tools.service.BigStorageBaseService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@@ -47,22 +48,27 @@
    @Resource
    GlassInfoService glassInfoService;
    @Value("${mes.slotWidth}")
    private Integer slotWidth;
    @Resource
    SysConfigService sysConfigService;
    @Value("${mes.carWidth}")
    private Integer carWidth;
    @Value("${mes.outCarMaxSize}")
    private Integer outCarMaxSize;
    @Value("${mes.glassGap}")
    private Integer glassGap;
//    @Value("${mes.slotWidth}")
//    private Integer slotWidth;
//
//    @Value("${mes.carWidth}")
//    private Integer carWidth;
//
//    @Value("${mes.outCarMaxSize}")
//    private Integer outCarMaxSize;
//
//    @Value("${mes.glassGap}")
//    private Integer glassGap;
    @Override
    public void updateSlotRemainBySlots(List<Integer> slotList) {
        //获取格子内所有的玻璃信息
        Integer slotWidth = sysConfigService.queryConfigValue(ConstSysConfig.VERTICAL_SLOT_WIDTH);
        int glassGap = sysConfigService.queryConfigValue(ConstSysConfig.VERTICAL_GLASS_GAP);
        List<BigStorageCageDetails> inSlotGlassList = bigStorageCageDetailsService.list(new LambdaQueryWrapper<BigStorageCageDetails>()
                .in(BigStorageCageDetails::getSlot, slotList).in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL));
        Map<Integer, Double> slotRemainMap = new HashMap<>();
@@ -574,13 +580,16 @@
            List<GlassInfo> infoList = glassInfoService.list(new LambdaQueryWrapper<GlassInfo>()
                    .notInSql(GlassInfo::getGlassId, "select glass_id from damage where tempering_layout_id = " + temperingLayoutId + " and engineer_id = '" + engineerId + "'")
                    .eq(GlassInfo::getTemperingLayoutId, temperingLayoutId).eq(GlassInfo::getEngineerId, engineerId).orderByAsc(GlassInfo::getTemperingFeedSequence));
            int remainWidth = carWidth;
            int remainWidth = sysConfigService.queryConfigValue(ConstSysConfig.VERTICAL_CAR_WIDTH);
            int trainNumber = 1;
            int serialNumber = 0;
            int min = 0;
            int temp = infoList.get(0).getTemperingFeedSequence();
            int slot = 0;
            int resultTrainNumber = 0;
            int outCarMaxSize = sysConfigService.queryConfigValue(ConstSysConfig.VERTICAL_OUT_CAR_SIZE);
            int carWidth = sysConfigService.queryConfigValue(ConstSysConfig.VERTICAL_CAR_WIDTH);
            int glassGap = sysConfigService.queryConfigValue(ConstSysConfig.VERTICAL_GLASS_GAP);
            for (GlassInfo e : infoList) {
                int maxLength = Math.max((int) e.getWidth(), (int) e.getHeight());
                if (serialNumber >= outCarMaxSize || maxLength > remainWidth || e.getTemperingFeedSequence() >= minLength) {
@@ -620,7 +629,7 @@
            bigStorageDTO.setDeviceId(bigStorageCage.getDeviceId());
            return bigStorageDTO;
        }
        int slotWidth = sysConfigService.queryConfigValue(ConstSysConfig.VERTICAL_SLOT_WIDTH);
        bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>()
                .eq(BigStorageCage::getEnableState, Const.SLOT_ON)
                .eq(BigStorageCage::getRemainWidth, slotWidth).orderByAsc(BigStorageCage::getSlot)