zhoushihao
2025-10-10 95d5d11d932f6eefca6bc5c3c883269e93894441
1、中空领取任务界面查询慢解决
2、缺片详情界面调整
13个文件已修改
286 ■■■■ 已修改文件
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/controller/HollowGlassRelationInfoController.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/entity/dto/FlowCardGlassInfoDTO.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/entity/dto/LackDetailsDTO.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/mapper/HollowBigStorageCageDetailsMapper.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/mapper/HollowGlassRelationInfoMapper.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/HollowBigStorageCageDetailsService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/HollowGlassRelationInfoService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | 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/HollowGlassRelationInfoServiceImpl.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/job/PushMessageToIndex.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/application-dev.yml 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/mapper/HollowBigStorageCageDetailsMapper.xml 125 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/mapper/HollowGlassRelationInfoMapper.xml 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/controller/HollowGlassRelationInfoController.java
@@ -40,18 +40,18 @@
    }
    @ApiOperation("查询指定流程卡及层数的缺片详情")
    @PostMapping("/queryLackByFlowCard")
    public Result<List<LackDetailsDTO>> queryLackByFlowCard() {
        List<LackDetailsDTO> lackDetailsList = hollowGlassRelationInfoService.queryLackByFlowCard();
    @PostMapping("/queryAllLackByFlowCard")
    public Result<List<LackDetailsDTO>> queryAllLackByFlowCard() {
        List<LackDetailsDTO> lackDetailsList = hollowGlassRelationInfoService.queryAllLackByFlowCard();
        return Result.success(lackDetailsList);
    }
//    @ApiOperation("查询指定流程卡及层数的缺片详情")
//    @PostMapping("/queryLackByFlowCard")
//    public Result<List<LackDetailsDTO>> queryLackByFlowCard(String flowCardId) {
//        List<LackDetailsDTO> lackDetailsList = hollowGlassRelationInfoService.queryLackByFlowCard(flowCardId);
//        return Result.success(lackDetailsList);
//    }
    @ApiOperation("查询指定流程卡及层数的缺片详情")
    @PostMapping("/queryLackByFlowCard")
    public Result<Map<Integer,List<LackDetailsDTO>>> queryLackByFlowCard(String flowCardId) {
        Map<Integer,List<LackDetailsDTO>> lackDetailsMap = hollowGlassRelationInfoService.queryLackByFlowCard(flowCardId);
        return Result.success(lackDetailsMap);
    }
    @ApiOperation("中空缺片爆破笼报破损")
    @PostMapping("/hollowBigStorageGlassDamage")
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/entity/dto/FlowCardGlassInfoDTO.java
@@ -23,6 +23,10 @@
     */
    private String productName;
    /**
     * 中空片序 0 直通  1 笼内
     */
    private int hollowSequence;
    /**
     * 膜系
     */
    private String filmsId;
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/entity/dto/LackDetailsDTO.java
@@ -15,6 +15,10 @@
     */
    private String flowCardId;
    /**
     * 玻璃id
     */
    private String glassId;
    /**
     * 流程卡
     */
    private int layer;
@@ -53,5 +57,9 @@
     */
    private Integer damageCount;
    /**
     * 工序
     */
    private String workingProcedure;
}
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/mapper/HollowBigStorageCageDetailsMapper.java
@@ -7,6 +7,7 @@
import com.mes.hollow.entity.dto.FlowCardGlassInfoDTO;
import com.mes.hollow.entity.dto.FlowCardVirtualSlotDTO;
import com.mes.hollow.entity.dto.UpdateHollowBigStorageCageDTO;
import com.mes.hollow.entity.vo.HollowBigStorageDetailsQueryVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -35,8 +36,16 @@
    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<HollowBigStorageCageDetails> queryPairGlassList(@Param("flowCardId") String flowCardId, @Param("totalLayer") Integer totalLayer, @Param("totalPairQuantity") Integer totalPairQuantity, @Param("isOut") Integer isOut);
    List<FlowCardVirtualSlotDTO> queryFlowCardIdsAndLayer();
    /**
     * 查询笼内的缺片详情
     *
     * @param query
     * @return
     */
    List<FlowCardGlassInfoDTO> queryHollowAllFlowCard(HollowBigStorageDetailsQueryVO query);
}
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/mapper/HollowGlassRelationInfoMapper.java
@@ -24,12 +24,13 @@
    List<HollowGlassDetailsDTO> queryFlowCardIdLayerGlassInfo(@Param("flowCardId") String flowCardId, @Param("totalLayer") int totalLayer, @Param("layer") int layer);
    List<LackDetailsDTO> queryLackByFlowCard();
    List<LackDetailsDTO> queryAllLackByFlowCard();
    int queryLayerByFlowCardId(@Param("flowCardId") String flowCardId);
    void clearDirtyFlowCardData(@Param("flowCardId") String flowCardId, @Param("layer") int layer);
    List<LackDetailsDTO> queryLackByFlowCard(@Param("flowCardId")  String flowCardId);
}
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/HollowBigStorageCageDetailsService.java
@@ -4,6 +4,8 @@
import com.mes.base.entity.vo.BigStorageVO;
import com.mes.hollow.entity.HollowBigStorageCageDetails;
import com.mes.hollow.entity.dto.*;
import com.mes.hollow.entity.vo.HollowAllFlowCardVO;
import com.mes.hollow.entity.vo.HollowBigStorageDetailsQueryVO;
import java.util.List;
import java.util.Map;
@@ -66,5 +68,7 @@
    Boolean updateHollowStorageCageDisabled(int slot, int enableState);
    List<FlowCardVirtualSlotDTO> queryFlowCardIdsAndLayer();
    List<FlowCardGlassInfoDTO> queryHollowAllFlowCard(HollowBigStorageDetailsQueryVO query);
}
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/HollowGlassRelationInfoService.java
@@ -36,10 +36,11 @@
    List<FlowCardGlassInfoDTO> queryHollowAllFlowCardSummary(HollowBigStorageDetailsQueryVO query);
    List<LackDetailsDTO> queryLackByFlowCard();
    List<LackDetailsDTO> queryAllLackByFlowCard();
    int queryLayerByFlowCardId(String flowCardId);
//    List<LackDetailsDTO> queryLackByFlowCard(String flowCardId);
    Map<Integer,List<LackDetailsDTO>> queryLackByFlowCard(String flowCardId);
    /**
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowBigStorageCageDetailsServiceImpl.java
@@ -145,6 +145,11 @@
        return baseMapper.queryFlowCardIdsAndLayer();
    }
    @Override
    public List<FlowCardGlassInfoDTO> queryHollowAllFlowCard(HollowBigStorageDetailsQueryVO query) {
        return baseMapper.queryHollowAllFlowCard(query);
    }
    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/HollowGlassRelationInfoServiceImpl.java
@@ -26,7 +26,6 @@
import com.mes.sysconfig.service.SysConfigService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@@ -307,25 +306,20 @@
    public List<HollowAllFlowCardVO> queryHollowAllFlowCard(HollowBigStorageDetailsQueryVO query) {
        Date startDate = new Date();
        log.info("开始查询中空流程卡任务信息,开始时间{}", startDate);
        List<HollowBigStorageCageDetails> detailsList = hollowBigStorageCageDetailsService.list(new LambdaQueryWrapper<HollowBigStorageCageDetails>()
                .eq(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN)
                .like(StringUtils.isNotBlank(query.getFilmsId()), HollowBigStorageCageDetails::getFilmsId, query.getFilmsId())
                .like(StringUtils.isNotBlank(query.getFlowCardId()), HollowBigStorageCageDetails::getFlowCardId, query.getFlowCardId())
                .eq(query.getThickness() != 0, HollowBigStorageCageDetails::getThickness, query.getThickness())
                .orderByAsc(HollowBigStorageCageDetails::getFlowCardId)
        );
        List<FlowCardGlassInfoDTO> detailsList = hollowBigStorageCageDetailsService.queryHollowAllFlowCard(query);
        if (CollectionUtil.isEmpty(detailsList)) {
            log.info("笼内无玻璃");
            return new ArrayList<>();
        }
        Date middleDate = new Date();
        log.info("中空理片笼详情数据已查询完毕,耗时:{}ms", middleDate.getTime() - startDate.getTime());
        Map<String, List<HollowBigStorageCageDetails>> listMap = detailsList.stream().collect(Collectors.groupingBy(HollowBigStorageCageDetails::getFlowCardId));
        Map<String, List<FlowCardGlassInfoDTO>> listMap = detailsList.stream().collect(Collectors.groupingBy(FlowCardGlassInfoDTO::getFlowCardId));
        List<HollowAllFlowCardVO> resultList = new ArrayList<>();
        AtomicInteger pairTotalCount = new AtomicInteger();
        listMap.forEach((e, v) -> {
            HollowAllFlowCardVO hollowAllFlowCardVO = new HollowAllFlowCardVO();
            HollowBigStorageCageDetails cageDetails = v.get(0);
            FlowCardGlassInfoDTO cageDetails = v.get(0);
            //按照流程卡获取对应的产品名称
            OrderDetailsDTO orderDetails = this.queryProductNameByFlowCardId(cageDetails.getFlowCardId(), query.getProductName(), query.getCustomerName());
            if (null != orderDetails) {
@@ -336,12 +330,8 @@
                } else {
                    hollowAllFlowCardVO.setIsThroughSlot(Boolean.FALSE);
                }
                List<FlowCardGlassInfoDTO> flowCardInfoList = hollowBigStorageCageDetailsService.hollowIsAll(e, cageDetails.getTotalLayer(), Boolean.FALSE);
                log.info("获取到的流程卡信息为:{}", flowCardInfoList);
                if (CollectionUtil.isNotEmpty(flowCardInfoList)) {
                    hollowAllFlowCardVO.setFlowCardGlassInfoDTOList(flowCardInfoList);
                    pairTotalCount.addAndGet(flowCardInfoList.get(0).getPairCount());
                }
                hollowAllFlowCardVO.setFlowCardGlassInfoDTOList(v);
                pairTotalCount.addAndGet(cageDetails.getPairCount());
                resultList.add(hollowAllFlowCardVO);
            }
        });
@@ -403,8 +393,8 @@
    }
    @Override
    public List<LackDetailsDTO> queryLackByFlowCard() {
        List<LackDetailsDTO> lackDetailsList = this.baseMapper.queryLackByFlowCard();
    public List<LackDetailsDTO> queryAllLackByFlowCard() {
        List<LackDetailsDTO> lackDetailsList = this.baseMapper.queryAllLackByFlowCard();
        return lackDetailsList;
    }
@@ -414,6 +404,12 @@
    }
    @Override
    public Map<Integer,List<LackDetailsDTO>> queryLackByFlowCard(String flowCardId) {
        List<LackDetailsDTO> detailsDTOS = baseMapper.queryLackByFlowCard(flowCardId);
        return detailsDTOS.stream().collect(Collectors.groupingBy(item -> item.getLayer()));
    }
    @Override
    public Integer getGlassGapByThickness(Double thickness) {
        int sysKey = 0;
        if (thickness >= 12) {
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/job/PushMessageToIndex.java
@@ -336,7 +336,7 @@
        jsonObject.append("bigStorageCageUsageSummary", bigStorageCageUsageSummary);
        //缺片详情
        List<LackDetailsDTO> lackDetailsList = hollowGlassRelationInfoService.queryLackByFlowCard();
        List<LackDetailsDTO> lackDetailsList = hollowGlassRelationInfoService.queryAllLackByFlowCard();
        jsonObject.append("lackDetailsList", lackDetailsList);
        jsonObject.append("alarmInfo", productAlarmInfoService.list(new LambdaQueryWrapper<ProductAlarmInfo>()
hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/application-dev.yml
@@ -5,7 +5,7 @@
      strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源.
      datasource:
        northGlassMes:
          url: jdbc:mysql://127.0.0.1:3306/north_glass_mes?serverTimezone=GMT%2b8
          url: jdbc:mysql://127.0.0.1:3306/yw_mes?serverTimezone=GMT%2b8
          username: root
          password: beibo.123/
          driver-class-name: com.mysql.cj.jdbc.Driver
@@ -24,23 +24,19 @@
      discovery:
        server-addr: 127.0.0.1:8848
  redis:
    database: 0
    database: 1
    host: 127.0.0.1
    port: 6379
    password: 123456
    kangaroohy:
      milo:
        enabled: true
        primary: default
        config:
          default:
            endpoint: opc.tcp://10.153.19.150:49320
            security-policy: basic256sha256
            username: admin
            password: 1qaz2wsx3edc4rfv
  cache:
    type: redis  # 明确指定缓存类型
    redis:
      time-to-live: -1    # 缓存过期时间
      cache-null-values: true # 是否缓存空值
      use-key-prefix: true    # 使用key前缀
kangaroohy:
  milo:
    enabled: true
    enabled: false
    primary: default
    config:
      default:
hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/mapper/HollowBigStorageCageDetailsMapper.xml
@@ -252,4 +252,129 @@
        where state in (100, 102, 103, 104)
        group by flow_card_id, layer
    </select>
    <select id="queryHollowAllFlowCard" resultType="com.mes.hollow.entity.dto.FlowCardGlassInfoDTO">
        WITH hollow_flow_temp AS (
        SELECT DISTINCT flow_card_id
        FROM hollow_big_storage_cage_details
        WHERE state = 100
        <if test="flowCardId != null and flowCardId != ''">
            AND flow_card_id LIKE CONCAT('%', #{flowCardId}, '%')
        </if>
        <if test="filmsId != null and filmsId != ''">
            AND films_id LIKE CONCAT('%', #{filmsId}, '%')
        </if>
        <if test="thickness != 0">
            AND thickness = #{thickness}
        </if>
        ),
        hollow_details_temp AS (
        SELECT
        flow_card_id,
        glass_id,
        virtual_slot,
        sequence,
        layer,
        total_layer,
        hollow_sequence
        FROM hollow_big_storage_cage_details
        WHERE state = 100
        <if test="flowCardId != null and flowCardId != ''">
            AND flow_card_id LIKE CONCAT('%', #{flowCardId}, '%')
        </if>
        <if test="filmsId != null and filmsId != ''">
            AND films_id LIKE CONCAT('%', #{filmsId}, '%')
        </if>
        <if test="thickness != 0">
            AND thickness = #{thickness}
        </if>
        ),
        hollow_through_temp AS (
        SELECT
        flow_card_id,
        MIN(hollow_sequence) as hollow_sequence,
        MAX(total_layer) as total_layer
        FROM hollow_details_temp
        GROUP BY flow_card_id
        ),
        hollow_pair_temp AS (
        SELECT
        t1.flow_card_id,
        COUNT(*) AS pair_count
        FROM hollow_details_temp t1
        INNER JOIN hollow_details_temp t2
        ON t1.flow_card_id = t2.flow_card_id
        AND t1.virtual_slot = t2.virtual_slot
        AND t1.sequence = t2.sequence
        AND t1.layer = 1 AND t2.layer = 2
        WHERE NOT EXISTS (
        SELECT 1
        FROM hollow_through_temp ht
        WHERE ht.flow_card_id = t1.flow_card_id
        AND ht.total_layer = 3
        ) OR EXISTS (
        SELECT 1
        FROM hollow_details_temp t3
        WHERE t3.flow_card_id = t1.flow_card_id
        AND t3.virtual_slot = t1.virtual_slot
        AND t3.sequence = t1.sequence
        AND t3.layer = 3
        )
        GROUP BY t1.flow_card_id
        ),
        glass_info_temp AS (
        SELECT
        gi.id,
        gi.glass_id,
        gi.flow_card_id,
        gi.layer,
        gi.thickness,
        gi.filmsId
        FROM hollow_flow_temp hft
        INNER JOIN glass_info gi ON hft.flow_card_id = gi.flow_card_id
        ),
        damage_ranked AS (
        SELECT
        d.glass_id,
        d.type,
        d.status,
        ROW_NUMBER() OVER(PARTITION BY d.glass_id ORDER BY d.id DESC) as rn
        FROM hollow_flow_temp hft
        INNER JOIN damage d ON hft.flow_card_id = d.process_id
        ),
        damage_latest AS (
        SELECT
        glass_id,
        type,
        status
        FROM damage_ranked
        WHERE rn = 1
        ),
        result_temp AS (
        SELECT
        t.flow_card_id,
        t.layer,
        t.thickness,
        t.filmsId,
        COUNT(DISTINCT t.id) as sum_count,
        COUNT(DISTINCT t1.glass_id) as real_count,
        COUNT(DISTINCT t.id) - COUNT(DISTINCT t1.glass_id) as lack_count,
        COUNT(DISTINCT CASE WHEN t2.type IN (7,8) AND t2.status = 1 THEN t.glass_id END) as damage_count
        FROM glass_info_temp t
        LEFT JOIN hollow_details_temp t1 ON t.glass_id = t1.glass_id
        LEFT JOIN damage_latest t2 ON t.glass_id = t2.glass_id
        GROUP BY t.flow_card_id, t.layer, t.thickness, t.filmsId
        )
        SELECT
        t.*,
        COALESCE(t1.pair_count, 0) as pair_count,
        t2.hollow_sequence,
        t2.total_layer
        FROM result_temp t
        LEFT JOIN hollow_pair_temp t1 ON t.flow_card_id = t1.flow_card_id
        LEFT JOIN hollow_through_temp t2 ON t.flow_card_id = t2.flow_card_id
        ORDER BY t.flow_card_id
    </select>
</mapper>
hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/mapper/HollowGlassRelationInfoMapper.xml
@@ -105,7 +105,7 @@
        select *
        from result
    </select>
    <select id="queryLackByFlowCard" resultMap="lackBaseMap">
    <select id="queryAllLackByFlowCard" resultMap="lackBaseMap">
        with flow_card_id_info as (
            select distinct flow_card_id from hollow_big_storage_cage_details where state = 100
        ),
@@ -164,6 +164,51 @@
        from hollow_glass_relation_info
        where flow_card_id = #{flowCardId}
    </select>
    <select id="queryLackByFlowCard" resultType="com.mes.hollow.entity.dto.LackDetailsDTO">
        with hollow_flow_temp AS (
            SELECT DISTINCT flow_card_id
            FROM hollow_big_storage_cage_details
            WHERE state = 100
        <if test="flowCardId != null and flowCardId != ''">
            and flow_card_id = #{flowCardId}
        </if>
        )
           , glass_temp as (
            select t1.*
            from hollow_flow_temp t
                     INNER JOIN glass_info t1 on t.flow_card_id = t1.flow_card_id
        )
           , detail_temp as (
            select t.*
            from glass_temp t
                     left join hollow_big_storage_cage_details t1 on t.glass_id = t1.glass_id
            where t1.glass_id is null
        )
           , damage_ranked AS (
            SELECT t.flow_card_id,
                   t.layer,
                   t.glass_id,
                   t.glass_type,
                   t.width,
                   t.height,
                   t.filmsId,
                   t.thickness,
                   case
                       when type in (7, 8) and status = 1 then ''
                       else t1.working_procedure end                                as working_procedure,
                   ROW_NUMBER() OVER (PARTITION BY t1.glass_id ORDER BY t1.id DESC) as rn
            FROM detail_temp t
                     inner join damage t1 on t.glass_id = t1.glass_id
        )
           , damage_latest AS (
            SELECT *
            FROM damage_ranked
            WHERE rn = 1
        )
        select *
        from damage_latest
    </select>
    <update id="clearDirtyFlowCardData">
        update tempering_glass_relation_info