ZengTao
2024-08-03 3c6f62168f51a655d3f88d6994122f21432ed352
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageCageDetailsServiceImpl.java
@@ -27,9 +27,11 @@
import com.mes.glassinfo.entity.GlassInfo;
import com.mes.glassinfo.mapper.GlassInfoMapper;
import com.mes.glassinfo.service.GlassInfoService;
import com.mes.job.PlcStorageCageTask;
import com.mes.temperingglass.entity.TemperingGlassInfo;
import com.mes.temperingglass.mapper.TemperingGlassInfoMapper;
import com.mes.temperingglass.service.TemperingGlassInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
@@ -49,6 +51,7 @@
 * @author zhoush
 * @since 2024-03-27
 */
@Slf4j
@Service
public class BigStorageCageDetailsServiceImpl extends MPJBaseServiceImpl<BigStorageCageDetailsMapper, BigStorageCageDetails> implements BigStorageCageDetailsService {
@@ -68,6 +71,9 @@
    @Resource
    private TemperingGlassInfoService temperingGlassInfoService;
    @Resource
    private PlcStorageCageTask plcStorageCageTask;
    @Resource
    private DamageService damageService;
@@ -277,6 +283,7 @@
        }
        BigStorageCage bigStorageCage = bigStorageCageService.selectJoinOne(BigStorageCage.class, wrapper);
        if (null != bigStorageCage) {
            log.info("无钢化版图id或根据当前玻璃片序+1找到目标格子:{},玻璃id:{}", bigStorageCage.getSlot(),  glassInfo.getGlassId());
            bigStorageDTO = new BigStorageDTO();
            bigStorageDTO.setWidth(bigStorageCage.getRemainWidth());
            bigStorageDTO.setSlot(bigStorageCage.getSlot());
@@ -291,6 +298,7 @@
                        "select distinct device_id from big_storage_cage_details where engineer_id = "+glassInfo.getEngineerId()+" and tempering_layout_id = " + glassInfo.getTemperingLayoutId())
                .last("limit 1"));
        if (null != bigStorageCage) {
            log.info("根据版图id找到笼子内的目标格子:{},玻璃id:{}", bigStorageCage.getSlot(),  glassInfo.getGlassId());
            bigStorageDTO = new BigStorageDTO();
            bigStorageDTO.setWidth(bigStorageCage.getRemainWidth());
            bigStorageDTO.setSlot(bigStorageCage.getSlot());
@@ -309,6 +317,7 @@
                .orderByAsc(BigStorageCage::getDeviceId)
                .last("limit 1"));
        if (null != bigStorageCage) {
            log.info("版图id首次进笼且不是所有笼子都有版图id,版图版图id:{},格子:{},玻璃id:{}", glassInfo.getTemperingLayoutId() , bigStorageCage.getSlot(),  glassInfo.getGlassId());
            bigStorageDTO = new BigStorageDTO();
            bigStorageDTO.setWidth(bigStorageCage.getRemainWidth());
            bigStorageDTO.setSlot(bigStorageCage.getSlot());
@@ -323,6 +332,7 @@
                .orderByAsc(BigStorageCage::getDeviceId)
                .last("limit 1"));
        Assert.isTrue(null != bigStorageCage, "没有空余的笼子存放玻璃");
        log.info("版图id首次进笼且是所有笼子都有版图id,版图版图id:{},格子:{},玻璃id:{}", glassInfo.getTemperingLayoutId() , bigStorageCage.getSlot(),  glassInfo.getGlassId());
        bigStorageDTO = new BigStorageDTO();
        bigStorageDTO.setWidth(bigStorageCage.getRemainWidth());
        bigStorageDTO.setSlot(bigStorageCage.getSlot());