hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageCageDetailsServiceImpl.java
@@ -17,6 +17,8 @@
import com.mes.bigstoragetask.mapper.BigStorageCageFeedTaskMapper;
import com.mes.bigstoragetask.mapper.BigStorageCageOutTaskMapper;
import com.mes.common.config.Const;
import com.mes.damage.entity.Damage;
import com.mes.damage.service.DamageService;
import com.mes.glassinfo.entity.GlassInfo;
import com.mes.glassinfo.mapper.GlassInfoMapper;
import com.mes.temperingglass.entity.TemperingGlassInfo;
@@ -53,6 +55,9 @@
    private BigStorageCageService bigStorageCageService;
    @Resource
    private GlassInfoMapper glassInfoMapper;
    @Resource
    private DamageService damageService;
    @Value("${mes.minCount}")
    private int minCount;
@@ -103,6 +108,7 @@
                glassInfoWrapper.eq(GlassInfo::getGlassId, bigStorageCageFeedTask.getGlassId());
                GlassInfo glassInfo = glassInfoMapper.selectOne(glassInfoWrapper);
                BeanUtils.copyProperties(glassInfo, bigStorageCageDetails);
                bigStorageCageDetails.setBigStorageCageFeedTask(bigStorageCageFeedTask);
                bigStorageCageDetailsList.add(bigStorageCageDetails);
            }
            return bigStorageCageDetailsList;
@@ -203,7 +209,12 @@
        baseMapper.updateById(bigStorageCageDetails);
        bigStorageCageService.updateRemainWidth(bigStorageCageDetails.getSlot());
        //todo:插入破损数据
        Damage damage = new Damage();
        damage.setGlassId(bigStorageCageDetails.getGlassId());
        damage.setWorkingProcedure("冷加工");
        damage.setRemark("大理片笼破损");
        damage.setStatus(2);
        damageService.insertDamage(damage);
    }
    //查询玻璃信息
@@ -259,7 +270,7 @@
                .leftJoin(BigStorageCageDetails.class, BigStorageCageDetails::getSlot, BigStorageCage::getSlot)
                .eq(BigStorageCage::getEnableState, Const.SLOT_ON)
                .eq(BigStorageCageDetails::getTemperingLayoutId, glassInfo.getTemperingLayoutId())
                .gt(BigStorageCage::getRemainWidth, glassInfo.getWidth())
                .gt(BigStorageCage::getRemainWidth, Math.max(glassInfo.getWidth(), glassInfo.getHeight()))
                .last("limit 1");
        if (glassInfo.getTemperingLayoutId() == 0) {
            wrapper.eq(BigStorageCageDetails::getWidth, glassInfo.getWidth()).eq(BigStorageCageDetails::getHeight, glassInfo.getHeight());
@@ -271,6 +282,7 @@
            bigStorageDTO = new BigStorageDTO();
            bigStorageDTO.setWidth(bigStorageCage.getRemainWidth());
            bigStorageDTO.setSlot(bigStorageCage.getSlot());
            bigStorageDTO.setDeviceId(bigStorageCage.getDeviceId());
            return bigStorageDTO;
        }
        bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>()
@@ -283,9 +295,26 @@
            bigStorageDTO = new BigStorageDTO();
            bigStorageDTO.setWidth(bigStorageCage.getRemainWidth());
            bigStorageDTO.setSlot(bigStorageCage.getSlot());
            bigStorageDTO.setDeviceId(bigStorageCage.getDeviceId());
            return bigStorageDTO;
        }
        //todo:获取玻璃的厚度:重新选笼子需要按照笼子可放玻璃厚度进行选择
        //获取玻璃的厚度:重新选笼子需要按照笼子可放玻璃厚度进行选择
        bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>()
                .eq(BigStorageCage::getRemainWidth, slotWidth)
                .eq(BigStorageCage::getEnableState, Const.SLOT_ON)
                .notInSql(BigStorageCage::getDeviceId,
                        "select distinct device_id from big_storage_cage_details where tempering_layout_id = " + glassInfo.getTemperingLayoutId())
                .gt(BigStorageCage::getMaxThickness, glassInfo.getThickness())
                .orderByAsc(BigStorageCage::getDeviceId)
                .last("limit 1"));
        if (null != bigStorageCage) {
            bigStorageDTO = new BigStorageDTO();
            bigStorageDTO.setWidth(bigStorageCage.getRemainWidth());
            bigStorageDTO.setSlot(bigStorageCage.getSlot());
            bigStorageDTO.setDeviceId(bigStorageCage.getDeviceId());
            return bigStorageDTO;
        }
        bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>()
                .eq(BigStorageCage::getRemainWidth, slotWidth)
                .eq(BigStorageCage::getEnableState, Const.SLOT_ON)
@@ -296,11 +325,12 @@
        bigStorageDTO = new BigStorageDTO();
        bigStorageDTO.setWidth(bigStorageCage.getRemainWidth());
        bigStorageDTO.setSlot(bigStorageCage.getSlot());
        bigStorageDTO.setDeviceId(bigStorageCage.getDeviceId());
        return bigStorageDTO;
    }
    @Override
    public TemperingLayoutDTO temperingIsAll() {
    public List<TemperingLayoutDTO> temperingIsAll() {
        return baseMapper.temperingIsAll();
    }