ZengTao
2025-10-11 b03389088870daf55208b44f627a538df077e91b
1、中空部分直接查询ERP数据库修改为使用OrderServices
3 文件已重命名
14个文件已修改
349 ■■■■ 已修改文件
hangzhoumesParent/common/servicebase/src/main/java/com/mes/order/entity/HollowGlassDetailsDTO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/common/servicebase/src/main/java/com/mes/order/entity/HollowOrderDTO.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/common/servicebase/src/main/java/com/mes/order/entity/OrderDetailsDTO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/common/servicebase/src/main/java/com/mes/order/entity/dto/OrderDTO.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/common/servicebase/src/main/java/com/mes/order/mapper/OrdersMapper.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/common/servicebase/src/main/java/com/mes/order/service/OrdersService.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/common/servicebase/src/main/java/com/mes/order/service/impl/OrdersServiceImpl.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/common/servicebase/src/main/resources/mapper/OrderMapper.xml 108 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/mapper/HollowGlassOutRelationInfoMapper.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/mapper/HollowGlassRelationInfoMapper.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/HollowGlassOutRelationInfoService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/HollowGlassRelationInfoService.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassOutRelationInfoServiceImpl.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassRelationInfoServiceImpl.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/mapper/HollowBigStorageCageHistoryTaskMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/mapper/HollowGlassOutRelationInfoMapper.xml 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/mapper/HollowGlassRelationInfoMapper.xml 108 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/common/servicebase/src/main/java/com/mes/order/entity/HollowGlassDetailsDTO.java
File was renamed from hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/entity/dto/HollowGlassDetailsDTO.java
@@ -1,4 +1,4 @@
package com.mes.hollow.entity.dto;
package com.mes.order.entity;
import lombok.Data;
hangzhoumesParent/common/servicebase/src/main/java/com/mes/order/entity/HollowOrderDTO.java
File was renamed from hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/entity/dto/OrderDTO.java
@@ -1,4 +1,4 @@
package com.mes.hollow.entity.dto;
package com.mes.order.entity;
import lombok.Data;
@@ -10,7 +10,7 @@
 * @Description:
 */
@Data
public class OrderDTO {
public class HollowOrderDTO {
    /**
     * <订单表>
hangzhoumesParent/common/servicebase/src/main/java/com/mes/order/entity/OrderDetailsDTO.java
File was renamed from hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/entity/dto/OrderDetailsDTO.java
@@ -1,4 +1,4 @@
package com.mes.hollow.entity.dto;
package com.mes.order.entity;
import lombok.Data;
hangzhoumesParent/common/servicebase/src/main/java/com/mes/order/entity/dto/OrderDTO.java
@@ -1,14 +1,9 @@
package com.mes.order.entity.dto;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.models.auth.In;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
 * <p>
hangzhoumesParent/common/servicebase/src/main/java/com/mes/order/mapper/OrdersMapper.java
@@ -1,5 +1,8 @@
package com.mes.order.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mes.order.entity.HollowGlassDetailsDTO;
import com.mes.order.entity.HollowOrderDTO;
import com.mes.order.entity.OrderDetailsDTO;
import com.mes.order.entity.Orders;
import com.mes.order.entity.dto.OrderDTO;
@@ -16,4 +19,12 @@
public interface OrdersMapper extends BaseMapper<Orders> {
    List<OrderDTO> selectOrderPercent();
    HollowOrderDTO queryOrderByFlowCardId(String flowCardId);
    List<HollowGlassDetailsDTO> queryFlowCardIdMaxLayerGlassInfo(String flowCardId, int totalLayer);
    List<HollowGlassDetailsDTO> queryFlowCardIdLayerGlassInfo(String flowCardId, int totalLayer, int layer);
    OrderDetailsDTO queryProductNameByFlowCardId(String flowCardId);
}
hangzhoumesParent/common/servicebase/src/main/java/com/mes/order/service/OrdersService.java
@@ -1,9 +1,7 @@
package com.mes.order.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mes.order.entity.Order;
import com.mes.order.entity.Orderdetail;
import com.mes.order.entity.Orders;
import com.mes.order.entity.*;
import com.mes.order.entity.dto.OrderDTO;
import java.util.List;
@@ -23,4 +21,12 @@
    List<Orderdetail> selectOrderdetail(Orders orders);
    List<OrderDTO> selectOrderPercent();
    HollowOrderDTO queryOrderByFlowCardId(String flowCardId);
    List<HollowGlassDetailsDTO> queryFlowCardIdMaxLayerGlassInfo(String flowCardId, int totalLayer);
    List<HollowGlassDetailsDTO> queryFlowCardIdLayerGlassInfo(String flowCardId, int totalLayer, int layer);
    OrderDetailsDTO queryProductNameByFlowCardId(String flowCardId);
}
hangzhoumesParent/common/servicebase/src/main/java/com/mes/order/service/impl/OrdersServiceImpl.java
@@ -3,8 +3,7 @@
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mes.order.entity.Orderdetail;
import com.mes.order.entity.Orders;
import com.mes.order.entity.*;
import com.mes.order.entity.dto.OrderDTO;
import com.mes.order.mapper.OrderdetailMapper;
import com.mes.order.mapper.OrdersMapper;
@@ -47,4 +46,24 @@
    public List<OrderDTO> selectOrderPercent(){
        return baseMapper.selectOrderPercent();
    }
    @Override
    public HollowOrderDTO queryOrderByFlowCardId(String flowCardId){
        return baseMapper.queryOrderByFlowCardId(flowCardId);
    }
    @Override
    public List<HollowGlassDetailsDTO> queryFlowCardIdMaxLayerGlassInfo(String flowCardId, int totalLayer){
        return baseMapper.queryFlowCardIdMaxLayerGlassInfo(flowCardId, totalLayer);
    }
    @Override
    public List<HollowGlassDetailsDTO> queryFlowCardIdLayerGlassInfo(String flowCardId, int totalLayer, int layer){
        return baseMapper.queryFlowCardIdLayerGlassInfo(flowCardId, totalLayer, layer);
    }
    @Override
    public OrderDetailsDTO queryProductNameByFlowCardId(String flowCardId){
        return baseMapper.queryProductNameByFlowCardId(flowCardId);
    }
}
hangzhoumesParent/common/servicebase/src/main/resources/mapper/OrderMapper.xml
@@ -10,6 +10,14 @@
        <result column="create_time" property="createTime"/>
        <result column="percent" property="percent"/>
    </resultMap>
    <resultMap id="baseMapHollowDetail" type="com.mes.order.entity.HollowGlassDetailsDTO">
        <result column="process_id" property="flowCardId"/>
        <result column="child_width" property="width"/>
        <result column="child_height" property="height"/>
        <result column="order_number" property="orderSort"/>
        <result column="technology_number" property="layer"/>
        <result column="quantity" property="quantity"/>
    </resultMap>
    <select id="selectOrderPercent" resultMap="baseMap">
        SELECT a.order_id,
               a.customer_name,
@@ -32,4 +40,104 @@
        where a.warehousing != 2 and a.warehousing >= 0
        ORDER BY  a.order_id desc
    </select>
    <select id="queryOrderByFlowCardId" resultType="com.mes.order.entity.HollowOrderDTO">
        select t1.*
        from pp.flow_card t
                 inner join sd.order t1 on t.order_id = t1.order_id
        where t.process_id = #{flowCardId}
            limit 1
    </select>
    <select id="queryFlowCardIdMaxLayerGlassInfo" resultType="com.mes.order.entity.HollowGlassDetailsDTO">
        with temp_flow as (SELECT t.process_id,
                                  t.order_id,
                                  t.order_number,
                                  t.technology_number,
                                  t.quantity,
                                  t1.child_width,
                                  t1.child_height
                           from pp.flow_card t
                                    LEFT JOIN sd.order_glass_detail t1
                                              on t.order_id = t1.order_id
                                                  and t.order_number = t1.order_number
                                                  and t.technology_number = t1.technology_number
                           where t.process_id = #{flowCardId}),
             glass_info_temp as (
                 select process_id,
                        order_id,
                        GREATEST(child_width, child_height) as first_length,
                        least(child_width, child_height)    as second_length,
                        child_width,
                        child_height,
                        order_number,
                        technology_number,
                        quantity
                 from temp_flow
                 where technology_number = #{totalLayer}
             )
        select row_number() over (order by second_length desc,first_length desc) as rn, t.*
        from glass_info_temp t
    </select>
    <select id="queryFlowCardIdLayerGlassInfo" resultMap="baseMapHollowDetail">
        with temp_flow as (SELECT t.process_id,
                                  t.order_id,
                                  t.order_number,
                                  t.technology_number,
                                  t.quantity,
                                  t1.child_width,
                                  t1.child_height
                           from pp.flow_card t
                                    LEFT JOIN sd.order_glass_detail t1
                                              on t.order_id = t1.order_id
                                                  and t.order_number = t1.order_number
                                                  and t.technology_number = t1.technology_number
                           where t.process_id = #{flowCardId}),
             glass_info_max_layer_temp as (
                 select process_id,
                        order_id,
                        GREATEST(child_width, child_height) as first_length,
                        least(child_width, child_height)    as second_length,
                        child_width,
                        child_height,
                        order_number,
                        technology_number,
                        quantity
                 from temp_flow
                 where technology_number = #{totalLayer}
             ),
             glass_info_layer_temp as (
                 select process_id,
                        order_id,
                        GREATEST(child_width, child_height) as first_length,
                        least(child_width, child_height)    as second_length,
                        child_width,
                        child_height,
                        order_number,
                        technology_number,
                        quantity
                 from temp_flow
                 where technology_number = #{layer}
             ),
             max_layer_sequence as (
                 select row_number() over (order by second_length desc,first_length desc) as rn, t.order_number
                 from glass_info_max_layer_temp t
             ),
             result as (select t.*
                        from glass_info_layer_temp t
                                 INNER join max_layer_sequence t1 on t.order_number = t1.order_number
                        order by t1.rn)
        select *
        from result
    </select>
    <select id="queryProductNameByFlowCardId" resultType="com.mes.order.entity.OrderDetailsDTO">
        select t.product_name, t1.customer_name
        from sd.order_detail t
                 inner join sd.order t1 on t.order_id = t1.order_id
        where (t.order_id, t.order_number) = (
            select min(order_id) as order_id, min(order_number) as order_number
            from pp.flow_card
            where process_id = #{flowCardId}
        )
            limit 1
    </select>
</mapper>
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/mapper/HollowGlassOutRelationInfoMapper.java
@@ -2,10 +2,7 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mes.hollow.entity.HollowGlassOutRelationInfo;
import com.mes.hollow.entity.dto.OrderDTO;
import com.mes.hollow.entity.dto.OrderDetailsDTO;
import com.mes.largenscreen.entity.PieChartVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -17,16 +14,7 @@
 */
public interface HollowGlassOutRelationInfoMapper extends BaseMapper<HollowGlassOutRelationInfo> {
    OrderDTO queryOrderByFlowCardId(@Param("flowCardId") String flowCardId);
    List<PieChartVO> queryPieChart();
    /**
     * 按照流程卡获取产品名称
     *
     * @param flowCardId
     * @return
     */
    OrderDetailsDTO queryProductNameByFlowCardId(String flowCardId);
}
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/mapper/HollowGlassRelationInfoMapper.java
@@ -3,9 +3,8 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mes.glassinfo.entity.GlassInfo;
import com.mes.hollow.entity.HollowGlassRelationInfo;
import com.mes.hollow.entity.dto.HollowGlassDetailsDTO;
import com.mes.hollow.entity.dto.LackDetailsDTO;
import com.mes.hollow.entity.dto.OrderDetailsDTO;
import com.mes.order.entity.OrderDetailsDTO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -19,24 +18,11 @@
public interface HollowGlassRelationInfoMapper extends BaseMapper<HollowGlassRelationInfo> {
    List<HollowGlassDetailsDTO> queryFlowCardIdMaxLayerGlassInfo(@Param("flowCardId") String flowCardId, @Param("totalLayer") int totalLayer);
    List<HollowGlassDetailsDTO> queryFlowCardIdLayerGlassInfo(@Param("flowCardId") String flowCardId, @Param("totalLayer") int totalLayer, @Param("layer") int layer);
    List<LackDetailsDTO> queryLackByFlowCard();
    int queryLayerByFlowCardId(@Param("flowCardId") String flowCardId);
    void clearDirtyFlowCardData(@Param("flowCardId") String flowCardId, @Param("layer") int layer);
    /**
     * 按照流程卡获取产品名称
     *
     * @param flowCardId
     * @return
     */
    OrderDetailsDTO queryProductNameByFlowCardId(@Param("flowCardId") String flowCardId, @Param("productName") String productName, @Param("customerName") String customerName);
    List<GlassInfo> queryLackGlassByFlowCard(@Param("flowCardId") String flowCardId, @Param("orderSort") Integer orderSort, @Param("layer") Integer layer);
}
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/HollowGlassOutRelationInfoService.java
@@ -3,7 +3,7 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mes.hollow.entity.HollowGlassOutRelationInfo;
import com.mes.hollow.entity.dto.OrderDetailsDTO;
import com.mes.order.entity.OrderDetailsDTO;
import com.mes.hollow.entity.request.HollowHistoryTaskRequest;
import com.mes.hollow.entity.request.HollowTaskRequest;
import com.mes.hollowqueue.entity.HollowGlassQueueInfo;
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/HollowGlassRelationInfoService.java
@@ -7,12 +7,11 @@
import com.mes.hollow.entity.dto.FlowCardGlassInfoDTO;
import com.mes.hollow.entity.dto.HollowBigStorageDTO;
import com.mes.hollow.entity.dto.LackDetailsDTO;
import com.mes.hollow.entity.dto.OrderDetailsDTO;
import com.mes.order.entity.OrderDetailsDTO;
import com.mes.hollow.entity.vo.HollowAllFlowCardVO;
import com.mes.hollow.entity.vo.HollowBigStorageDetailsQueryVO;
import java.util.List;
import java.util.Map;
/**
 * (HollowGlassRelationInfo)表服务接口
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassOutRelationInfoServiceImpl.java
@@ -25,6 +25,9 @@
import com.mes.hollowqueue.entity.HollowGlassQueueInfo;
import com.mes.hollowqueue.service.HollowGlassQueueInfoService;
import com.mes.largenscreen.entity.PieChartVO;
import com.mes.order.entity.HollowOrderDTO;
import com.mes.order.entity.OrderDetailsDTO;
import com.mes.order.service.OrdersService;
import com.mes.sysconfig.service.SysConfigService;
import com.mes.tools.DateUtil;
import com.mes.utils.Blank;
@@ -67,6 +70,8 @@
    HollowGlassRelationInfoService hollowGlassRelationInfoService;
    @Resource
    SysConfigService sysConfigService;
    @Resource
    OrdersService ordersService;
    @Resource
    RedisUtil redisUtil;
@@ -200,7 +205,7 @@
            return "任务总层数小于2,不生成李赛克文件";
        }
        //获取订单相关信息
        OrderDTO order = baseMapper.queryOrderByFlowCardId(flowCardId);
        HollowOrderDTO order = ordersService.queryOrderByFlowCardId(flowCardId);
        if (null == order) {
            return "生成失败,相关订单信息不存在";
        }
@@ -347,7 +352,7 @@
    @Cacheable(value = "orderDetails", key = "#flowCardId")
    public OrderDetailsDTO queryProductNameByFlowCardId(String flowCardId) {
        log.info("查询数据库一次:{}", flowCardId);
        return baseMapper.queryProductNameByFlowCardId(flowCardId);
        return ordersService.queryProductNameByFlowCardId(flowCardId);
    }
    private HollowGlassOutRelationInfo childrenTask(HollowTaskRequest request, int isForce) {
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassRelationInfoServiceImpl.java
@@ -23,10 +23,12 @@
import com.mes.hollow.service.HollowBigStorageCageService;
import com.mes.hollow.service.HollowGlassOutRelationInfoService;
import com.mes.hollow.service.HollowGlassRelationInfoService;
import com.mes.order.entity.HollowGlassDetailsDTO;
import com.mes.order.entity.OrderDetailsDTO;
import com.mes.order.service.OrdersService;
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;
@@ -61,6 +63,8 @@
    SysConfigService sysConfigService;
    @Resource
    DamageService damageService;
    @Resource
    OrdersService ordersService;
//    @Value("${mes.slotWidth}")
//    private Integer slotWidth;
//    @Value("${mes.glassGap}")
@@ -208,13 +212,13 @@
            return;
        }
        //按照流程卡获取本流程卡最后一层或第一次的玻璃数据
        List<HollowGlassDetailsDTO> glassDetailsDTOS = this.baseMapper.queryFlowCardIdMaxLayerGlassInfo(flowCardId, totalLayer);
        List<HollowGlassDetailsDTO> glassDetailsDTOS = ordersService.queryFlowCardIdMaxLayerGlassInfo(flowCardId, totalLayer);
        if (CollectionUtil.isEmpty(glassDetailsDTOS)) {
            log.info("当前流程卡最外层数据未找到,请在erp确认数据无误,流程卡:{},总层数{}", flowCardId, totalLayer);
            return;
        }
        if (totalLayer != layer) {
            glassDetailsDTOS = this.baseMapper.queryFlowCardIdLayerGlassInfo(flowCardId, totalLayer, layer);
            glassDetailsDTOS = ordersService.queryFlowCardIdLayerGlassInfo(flowCardId, totalLayer, layer);
        }
        if (CollectionUtil.isEmpty(glassDetailsDTOS)) {
            log.info("当前流程卡最外层数据未找到,请在erp确认数据无误,流程卡:{},总层数{},层数{}", flowCardId, totalLayer, layer);
hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/mapper/HollowBigStorageCageHistoryTaskMapper.xml
@@ -51,7 +51,7 @@
        WITH big_storage_cage_history_task_temp AS
                 (SELECT DISTINCT create_time
                  FROM hollow_big_storage_cage_history_task
                  WHERE task_type = 5 AND DATE ( create_time ) = '2025-06-23' ),
                  WHERE task_type = 5 AND DATE ( create_time ) = '${days} ),
            time_temp AS (
        SELECT
            date (create_time) AS day_time,
@@ -60,7 +60,7 @@
        FROM
            hollow_big_storage_cage_history_task
        WHERE
            Date ( create_time ) = '2025-06-23'
            Date ( create_time ) = '${days}
        GROUP BY
            date ( create_time )
            ),
hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/mapper/HollowGlassOutRelationInfoMapper.xml
@@ -3,13 +3,6 @@
<mapper namespace="com.mes.hollow.mapper.HollowGlassOutRelationInfoMapper">
    <select id="queryOrderByFlowCardId" resultType="com.mes.hollow.entity.dto.OrderDTO">
        select t1.*
        from pp.flow_card t
                 inner join sd.order t1 on t.order_id = t1.order_id
        where t.process_id = #{flowCardId}
        limit 1
    </select>
    <select id="queryPieChart" resultType="com.mes.largenscreen.entity.PieChartVO">
        SELECT
            round( sum( CASE WHEN hgori.cell = 930 AND hgqi.state = 0 THEN 1 ELSE 0 END ), 2 ) AS oneCompletedQuantity,
@@ -38,16 +31,5 @@
        WHERE
            date( hgori.create_time ) = date(
            now())
    </select>
    <select id="queryProductNameByFlowCardId" resultType="com.mes.hollow.entity.dto.OrderDetailsDTO">
        select t.product_name, t1.customer_name
        from sd.order_detail t
                 inner join sd.order t1 on t.order_id = t1.order_id
        where (t.order_id, t.order_number) = (
            select min(order_id) as order_id, min(order_number) as order_number
            from pp.flow_card
            where process_id = #{flowCardId}
        )
        limit 1
    </select>
</mapper>
hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/mapper/HollowGlassRelationInfoMapper.xml
@@ -2,14 +2,6 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.mes.hollow.mapper.HollowGlassRelationInfoMapper">
    <resultMap id="baseMap" type="com.mes.hollow.entity.dto.HollowGlassDetailsDTO">
        <result column="process_id" property="flowCardId"/>
        <result column="child_width" property="width"/>
        <result column="child_height" property="height"/>
        <result column="order_number" property="orderSort"/>
        <result column="technology_number" property="layer"/>
        <result column="quantity" property="quantity"/>
    </resultMap>
    <resultMap id="lackBaseMap" type="com.mes.hollow.entity.dto.LackDetailsDTO">
        <result column="flow_card_id" property="flowCardId"/>
        <result column="layer" property="layer"/>
@@ -22,89 +14,6 @@
        <result column="damage_count" property="damageCount"/>
    </resultMap>
    <select id="queryFlowCardIdMaxLayerGlassInfo" resultMap="baseMap">
        with temp_flow as (SELECT t.process_id,
                                  t.order_id,
                                  t.order_number,
                                  t.technology_number,
                                  t.quantity,
                                  t1.child_width,
                                  t1.child_height
                           from pp.flow_card t
                                    LEFT JOIN sd.order_glass_detail t1
                                              on t.order_id = t1.order_id
                                                  and t.order_number = t1.order_number
                                                  and t.technology_number = t1.technology_number
                           where t.process_id = #{flowCardId}),
             glass_info_temp as (
                 select process_id,
                        order_id,
                        GREATEST(child_width, child_height) as first_length,
                        least(child_width, child_height)    as second_length,
                        child_width,
                        child_height,
                        order_number,
                        technology_number,
                        quantity
                 from temp_flow
                 where technology_number = #{totalLayer}
             )
        select row_number() over (order by second_length desc,first_length desc) as rn, t.*
        from glass_info_temp t
    </select>
    <select id="queryFlowCardIdLayerGlassInfo" resultMap="baseMap">
        with temp_flow as (SELECT t.process_id,
                                  t.order_id,
                                  t.order_number,
                                  t.technology_number,
                                  t.quantity,
                                  t1.child_width,
                                  t1.child_height
                           from pp.flow_card t
                                    LEFT JOIN sd.order_glass_detail t1
                                              on t.order_id = t1.order_id
                                                  and t.order_number = t1.order_number
                                                  and t.technology_number = t1.technology_number
                           where t.process_id = #{flowCardId}),
             glass_info_max_layer_temp as (
                 select process_id,
                        order_id,
                        GREATEST(child_width, child_height) as first_length,
                        least(child_width, child_height)    as second_length,
                        child_width,
                        child_height,
                        order_number,
                        technology_number,
                        quantity
                 from temp_flow
                 where technology_number = #{totalLayer}
             ),
             glass_info_layer_temp as (
                 select process_id,
                        order_id,
                        GREATEST(child_width, child_height) as first_length,
                        least(child_width, child_height)    as second_length,
                        child_width,
                        child_height,
                        order_number,
                        technology_number,
                        quantity
                 from temp_flow
                 where technology_number = #{layer}
             ),
             max_layer_sequence as (
                 select row_number() over (order by second_length desc,first_length desc) as rn, t.order_number
                 from glass_info_max_layer_temp t
             ),
             result as (select t.*
                        from glass_info_layer_temp t
                                 INNER join max_layer_sequence t1 on t.order_number = t1.order_number
                        order by t1.rn)
        select *
        from result
    </select>
    <select id="queryLackByFlowCard" resultMap="lackBaseMap">
        with flow_card_id_info as (
            select distinct flow_card_id from hollow_big_storage_cage_details where state = 100
@@ -163,23 +72,6 @@
        select count(distinct layer)
        from hollow_glass_relation_info
        where flow_card_id = #{flowCardId}
    </select>
    <select id="queryProductNameByFlowCardId" resultType="com.mes.hollow.entity.dto.OrderDetailsDTO">
        select t.product_name, t1.customer_name
        from sd.order_detail t
        inner join sd.order t1 on t.order_id = t1.order_id
        where (t.order_id, t.order_number) = (
        select min(order_id) as order_id, min(order_number) as order_number
        from pp.flow_card
        where process_id = #{flowCardId}
        <if test="productName != null and productName != ''">
            and t.product_name like concat('%', #{productName}, '%')
        </if>
        <if test="customerName != null and customerName != ''">
            and t1.customer_name like concat('%', #{customerName}, '%')
        </if>
        )
        limit 1
    </select>
    <select id="queryLackGlassByFlowCard" resultType="com.mes.glassinfo.entity.GlassInfo">
        with glass_id_info as (