zhoushihao
2024-08-03 bb3cfeae80cbc5a6c26292d0eb23f1754d039db9
1、大理片笼笼进片逻辑调整
2、钢化版图按照版序出
3个文件已修改
44 ■■■■■ 已修改文件
hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/application.yml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageCageDetailsServiceImpl.java 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/mapper/BigStorageCageDetailsMapper.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/application.yml
@@ -13,12 +13,16 @@
mes:
  threshold: 3
  ratio: 10
  max:
  max: # 第二条线的最大尺寸信息
    firstLength: 3500
    secondLength: 2500
  min:
    one: #第一条磨边线的最小尺寸信息
    firstLength: 600
    secondLength: 350
    two: #第二条磨边线的最小尺寸信息
      firstLength: 400
      secondLength: 300
  sequence:
    order: false
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageCageDetailsServiceImpl.java
@@ -27,7 +27,6 @@
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;
@@ -71,9 +70,6 @@
    @Resource
    private TemperingGlassInfoService temperingGlassInfoService;
    @Resource
    private PlcStorageCageTask plcStorageCageTask;
    @Resource
    private DamageService damageService;
@@ -272,6 +268,7 @@
                .selectAll(BigStorageCage.class)
                .leftJoin(BigStorageCageDetails.class, BigStorageCageDetails::getSlot, BigStorageCage::getSlot)
                .eq(BigStorageCage::getEnableState, Const.SLOT_ON)
                .in(BigStorageCageDetails::getState, Const.GLASS_STATE_NEW, Const.GLASS_STATE_IN_ALL)
                .eq(BigStorageCageDetails::getEngineerId,glassInfo.getEngineerId())
                .eq(BigStorageCageDetails::getTemperingLayoutId, glassInfo.getTemperingLayoutId())
                .gt(BigStorageCage::getRemainWidth, Math.max(glassInfo.getWidth(), glassInfo.getHeight()))
@@ -293,9 +290,9 @@
        bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>()
                .eq(BigStorageCage::getEnableState, Const.SLOT_ON)
                .eq(BigStorageCage::getRemainWidth, slotWidth)
                .notInSql(BigStorageCage::getSlot, "select distinct slot from big_storage_cage_details where state = 0")
//                .notInSql(BigStorageCage::getSlot, "select distinct slot from big_storage_cage_details where state = 0")
                .inSql(BigStorageCage::getDeviceId,
                        "select distinct device_id from big_storage_cage_details where engineer_id = "+glassInfo.getEngineerId()+" and tempering_layout_id = " + glassInfo.getTemperingLayoutId())
                        "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());
@@ -310,29 +307,33 @@
        bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>()
                .eq(BigStorageCage::getRemainWidth, slotWidth)
                .eq(BigStorageCage::getEnableState, Const.SLOT_ON)
                .notInSql(BigStorageCage::getSlot, "select distinct slot from big_storage_cage_details where state = 0")
                .notInSql(BigStorageCage::getDeviceId,
                        "select distinct device_id from big_storage_cage_details where state in (100,102,103)")
                .ge(BigStorageCage::getMaxThickness, glassInfo.getThickness())
                .orderByAsc(BigStorageCage::getDeviceId)
                .inSql(BigStorageCage::getDeviceId,
                        "select t.device_id from big_storage_cage t left join big_storage_cage_details t1 on t.slot = t1.slot " +
                                " where state in (0,100,102,103,104)  and t.max_thickness >= " + glassInfo.getThickness() + " and t.enable_state = 1 " +
                                " group by t.device_id " +
                                " order by count(DISTINCT t1.tempering_layout_id), count(distinct t1.slot)")
                .last("limit 1"));
        if (null != bigStorageCage) {
            log.info("版图id首次进笼且不是所有笼子都有版图id,版图版图id:{},格子:{},玻璃id:{}", glassInfo.getTemperingLayoutId() , bigStorageCage.getSlot(),  glassInfo.getGlassId());
            log.info("按照存笼玻璃格子数占用最少方式获取信息格子为:{},玻璃id:{}", bigStorageCage.getSlot(), glassInfo.getGlassId());
            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)
                .notInSql(BigStorageCage::getSlot, "select distinct slot from big_storage_cage_details where state = 0")
                .eq(BigStorageCage::getEnableState, Const.SLOT_ON)
                .ge(BigStorageCage::getMaxThickness, glassInfo.getThickness())
                .orderByAsc(BigStorageCage::getDeviceId)
                .inSql(BigStorageCage::getDeviceId,
                        "select t.device_id from big_storage_cage t left join big_storage_cage_details t1 on t.slot = t1.slot " +
                                " where state in (0,100,102,103,104)  and t.max_thickness >= " + glassInfo.getThickness() + " and t.enable_state = 1 " +
                                " group by t.device_id " +
                                " order by count(DISTINCT t1.tempering_layout_id), count(distinct t.slot) - count(distinct t1.slot) desc")
                .last("limit 1"));
        Assert.isTrue(null != bigStorageCage, "没有空余的笼子存放玻璃");
        log.info("版图id首次进笼且是所有笼子都有版图id,版图版图id:{},格子:{},玻璃id:{}", glassInfo.getTemperingLayoutId() , bigStorageCage.getSlot(),  glassInfo.getGlassId());
        log.info("按照存笼玻璃格子数剩余最多得方式获取信息版图id:{},格子:{},玻璃id:{}", glassInfo.getTemperingLayoutId(), bigStorageCage.getSlot(), glassInfo.getGlassId());
        bigStorageDTO = new BigStorageDTO();
        bigStorageDTO.setWidth(bigStorageCage.getRemainWidth());
        bigStorageDTO.setSlot(bigStorageCage.getSlot());
@@ -387,7 +388,9 @@
        QueryWrapper<BigStorageCageDetails> wrapper = new QueryWrapper<>();
        wrapper.select("engineer_id,tempering_layout_id,count(*) as count")
                .in("state", Const.GLASS_STATE_IN, Const.GLASS_STATE_ARTIFICIAL)
                .groupBy("engineer_id,tempering_layout_id");
                .groupBy("engineer_id,tempering_layout_id")
                .orderByAsc("engineer_id")
                .orderByAsc("tempering_layout_id");
        List<Map<String, Object>> TemperingGlass = baseMapper.selectMaps(wrapper);
        return TemperingGlass;
    }
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/mapper/BigStorageCageDetailsMapper.xml
@@ -41,6 +41,7 @@
                             GROUP BY ENGINEER_ID, TEMPERING_LAYOUT_ID) T3 ON T2.ENGINEER_ID = T3.ENGINEER_ID
            AND T2.TEMPERING_LAYOUT_ID = T3.TEMPERING_LAYOUT_ID
            AND T2.COUNT = T3.COUNT
        ORDER BY T2.ENGINEER_ID, T2.TEMPERING_LAYOUT_ID
    </select>
    <select id="queryTemperingOccupySlot" resultMap="temperingLayoutDTO">