zhoushihao
2025-03-12 bd6729390a98d33bb96993cbf7611031ecf3b433
1、中空理片笼新增重置笼子接口
8个文件已修改
77 ■■■■ 已修改文件
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/controller/HollowBigStorageCageController.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/mapper/HollowBigStorageCageDetailsMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/HollowBigStorageCageDetailsService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/HollowBigStorageCageService.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowBigStorageCageDetailsServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowBigStorageCageServiceImpl.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/mapper/HollowBigStorageCageDetailsMapper.xml 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/mapper/HollowGlassRelationInfoMapper.xml 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/controller/HollowBigStorageCageController.java
@@ -33,5 +33,11 @@
    public Result<List<HollowBigStorageAndDetailsDTO>> queryHollowBigStorageCageDetail(@RequestBody HollowBigStorageDetailsQueryVO query) {
        return Result.build(200, "查询成功", hollowBigStorageCageService.queryHollowBigStorageCageDetail(query));
    }
    @ApiOperation("复位:重置理片笼基础信息1、清除笼内状态为0的脏数据;2将空格子的尺寸置为初始尺寸 3、将不在笼内的流程卡的关系表重置")
    @PostMapping("/resetCage")
    public Result<Boolean> resetCage() {
        return Result.build(200, "重置成功", hollowBigStorageCageService.resetCage());
    }
}
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/mapper/HollowBigStorageCageDetailsMapper.java
@@ -36,5 +36,7 @@
    void updateDeviceIdBySlot(@Param("list") List<Integer> slotList);
    List<HollowBigStorageCageDetails> queryPairGlassList(@Param("flowCardId")String flowCardId, @Param("totalLayer")Integer totalLayer, @Param("totalPairQuantity")Integer totalPairQuantity,@Param("isOut") Integer isOut);
    List<FlowCardVirtualSlotDTO> queryFlowCardIdsAndLayer();
}
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/HollowBigStorageCageDetailsService.java
@@ -64,5 +64,7 @@
     * @return
     */
    Boolean updateHollowStorageCageDisabled(int slot, int enableState);
    List<FlowCardVirtualSlotDTO> queryFlowCardIdsAndLayer();
}
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/HollowBigStorageCageService.java
@@ -21,5 +21,11 @@
    Map<Integer, List<HollowBigStorageCage>> queryHollowbigStorageCageDetail();
    List<Map<String, Object>> selectBigStorageCageUsage();
    /**
     * 复位:重置理片笼基础信息1、清除笼内状态为0的脏数据;2将空格子的尺寸置为初始尺寸 3、将不在笼内的流程卡的关系表重置
     * @return
     */
    Boolean resetCage();
}
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowBigStorageCageDetailsServiceImpl.java
@@ -140,6 +140,11 @@
                .eq(HollowBigStorageCage::getSlot, slot));
    }
    @Override
    public List<FlowCardVirtualSlotDTO> queryFlowCardIdsAndLayer() {
        return baseMapper.queryFlowCardIdsAndLayer();
    }
    private List<HollowBigStorageAndDetailsDTO> hollowBigStorageCageDetailsChild(String glassId, Integer deviceId, Integer slot, int state) {
        //将对应格子号的玻璃id置为101
        this.update(new LambdaUpdateWrapper<HollowBigStorageCageDetails>()
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowBigStorageCageServiceImpl.java
@@ -1,19 +1,25 @@
package com.mes.hollow.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.mes.common.config.Const;
import com.mes.hollow.entity.HollowBigStorageCage;
import com.mes.hollow.entity.HollowBigStorageCageDetails;
import com.mes.hollow.entity.dto.FlowCardVirtualSlotDTO;
import com.mes.hollow.entity.dto.HollowBigStorageAndDetailsDTO;
import com.mes.hollow.entity.vo.HollowBigStorageDetailsQueryVO;
import com.mes.hollow.mapper.HollowBigStorageCageMapper;
import com.mes.hollow.mapper.HollowGlassRelationInfoMapper;
import com.mes.hollow.service.HollowBigStorageCageDetailsService;
import com.mes.hollow.service.HollowBigStorageCageService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@@ -29,6 +35,12 @@
    @Value("${mes.slotWidth}")
    private Integer slotWidth;
    @Resource
    private HollowBigStorageCageDetailsService hollowBigStorageCageDetailsService;
    @Resource
    private HollowGlassRelationInfoMapper hollowGlassRelationInfoMapper;
    @Override
    public List<HollowBigStorageAndDetailsDTO> queryHollowBigStorageCageDetail(HollowBigStorageDetailsQueryVO query) {
        MPJLambdaWrapper<HollowBigStorageCage> wrapper = new MPJLambdaWrapper<>();
@@ -61,5 +73,23 @@
                .groupBy("device_id");
        return baseMapper.selectMaps(wrapper);
    }
    @Override
    public Boolean resetCage() {
//        复位:重置理片笼基础信息1、清除笼内状态为0的脏数据;
        hollowBigStorageCageDetailsService.remove(new LambdaQueryWrapper<HollowBigStorageCageDetails>()
                .eq(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_NEW));
//        2将空格子的尺寸置为初始尺寸
        this.update(new LambdaUpdateWrapper<HollowBigStorageCage>()
                .set(HollowBigStorageCage::getRemainWidth, slotWidth)
                .notIn(HollowBigStorageCage::getSlot, "select distinct slot from hollow_big_storage_cage_details where state in( 100 , 102 , 103 ,104)"));
//        3、将不在笼内的流程卡的关系表重置
//        仅获取理片笼内的流程卡信息避免玻璃
        List<FlowCardVirtualSlotDTO> list = hollowBigStorageCageDetailsService.queryFlowCardIdsAndLayer();
        for (FlowCardVirtualSlotDTO item : list) {
            hollowGlassRelationInfoMapper.clearDirtyFlowCardData(item.getFlowCardId(), item.getLayer());
        }
        return Boolean.TRUE;
    }
}
hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/mapper/HollowBigStorageCageDetailsMapper.xml
@@ -52,7 +52,8 @@
    <select id="hollowIsAll" resultMap="baseMap">
        WITH sum_flow_layer_count AS ( SELECT flow_card_id, layer, min( films_id ) AS films_id, min(thickness) as
        thickness,count(*) AS sum_count FROM hollow_glass_relation_info GROUP BY flow_card_id, layer ),
        real_flow_layer_count AS ( SELECT flow_card_id, layer, count(*) AS real_count, count(distinct slot) as slot_count FROM
        real_flow_layer_count AS ( SELECT flow_card_id, layer, count(*) AS real_count, count(distinct slot) as
        slot_count FROM
        hollow_big_storage_cage_details t WHERE state = 100 GROUP BY flow_card_id, layer ),
        damage_flow_layer_count AS ( SELECT process_id AS flow_card_id, technology_number AS layer, count(*) as
        damage_count FROM damage where type in(8,9) GROUP BY process_id, technology_number ),
@@ -209,8 +210,9 @@
    </select>
    <select id="queryHollowbigStorageCageDetail" resultType="com.mes.base.entity.vo.BigStorageVO">
        select hbsc.device_id, hbsc.slot, count(hbscd.glass_id) as count
        from hollow_big_storage_cage hbsc left join hollow_big_storage_cage_details hbscd
        on hbsc.slot=hbscd.slot and hbscd.state in (100, 102, 103, 104)
        from hollow_big_storage_cage hbsc
                 left join hollow_big_storage_cage_details hbscd
                           on hbsc.slot = hbscd.slot and hbscd.state in (100, 102, 103, 104)
        group by hbsc.device_id, hbsc.slot
        order by hbsc.device_id, hbsc.slot
    </select>
@@ -248,4 +250,10 @@
        inner join hollow_sequence_temp t1 on t.hollow_sequence = t1.hollow_sequence
        ORDER BY t.hollow_sequence
    </select>
    <select id="queryFlowCardIdsAndLayer" resultType="com.mes.hollow.entity.dto.FlowCardVirtualSlotDTO">
        select flow_card_id, layer
        from hollow_big_storage_cage_details
        where state in (100, 102, 103, 104)
        group by flow_card_id, layer
    </select>
</mapper>
hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/mapper/HollowGlassRelationInfoMapper.xml
@@ -132,17 +132,19 @@
    <update id="clearDirtyFlowCardData">
        update hollow_glass_relation_info
        set glass_id = null,
            tempering_layout_id = null,
        set glass_id                = null,
            tempering_layout_id     = null,
            tempering_feed_sequence = null,
            engineer_id = null,
            state = 0
            engineer_id             = null,
            state                   = 0
        where flow_card_id = #{flowCardId}
          and layer = #{layer}
          and glass_id not in (
            select glass_id
            from hollow_big_storage_cage_details
            where flow_card_id = #{flowCardId} and layer = #{layer} and state = 100
            where flow_card_id = #{flowCardId}
              and layer = #{layer}
              and state in (100, 102, 103, 104)
        )
    </update>
</mapper>