1、中空部分直接查询ERP数据库修改为使用OrderServices
| File was renamed from hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/entity/dto/HollowGlassDetailsDTO.java |
| | |
| | | package com.mes.hollow.entity.dto; |
| | | package com.mes.order.entity; |
| | | |
| | | import lombok.Data; |
| | | |
| File was renamed from hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/entity/dto/OrderDTO.java |
| | |
| | | package com.mes.hollow.entity.dto; |
| | | package com.mes.order.entity; |
| | | |
| | | import lombok.Data; |
| | | |
| | |
| | | * @Description: |
| | | */ |
| | | @Data |
| | | public class OrderDTO { |
| | | public class HollowOrderDTO { |
| | | |
| | | /** |
| | | * <订单表> |
| File was renamed from hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/entity/dto/OrderDetailsDTO.java |
| | |
| | | package com.mes.hollow.entity.dto; |
| | | package com.mes.order.entity; |
| | | |
| | | import lombok.Data; |
| | | |
| | |
| | | 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> |
| | |
| | | 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; |
| | | |
| | |
| | | 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); |
| | | } |
| | |
| | | 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; |
| | |
| | | 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); |
| | | } |
| | |
| | | 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; |
| | |
| | | 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); |
| | | } |
| | | } |
| | |
| | | <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, |
| | |
| | | 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> |
| | |
| | | |
| | | 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; |
| | | |
| | |
| | | */ |
| | | public interface HollowGlassOutRelationInfoMapper extends BaseMapper<HollowGlassOutRelationInfo> { |
| | | |
| | | OrderDTO queryOrderByFlowCardId(@Param("flowCardId") String flowCardId); |
| | | |
| | | List<PieChartVO> queryPieChart(); |
| | | |
| | | /** |
| | | * 按照流程卡获取产品名称 |
| | | * |
| | | * @param flowCardId |
| | | * @return |
| | | */ |
| | | OrderDetailsDTO queryProductNameByFlowCardId(String flowCardId); |
| | | } |
| | | |
| | |
| | | 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; |
| | |
| | | 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); |
| | | } |
| | |
| | | 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; |
| | |
| | | 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)表服务接口 |
| | |
| | | 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; |
| | |
| | | HollowGlassRelationInfoService hollowGlassRelationInfoService; |
| | | @Resource |
| | | SysConfigService sysConfigService; |
| | | @Resource |
| | | OrdersService ordersService; |
| | | |
| | | @Resource |
| | | RedisUtil redisUtil; |
| | |
| | | return "任务总层数小于2,不生成李赛克文件"; |
| | | } |
| | | //获取订单相关信息 |
| | | OrderDTO order = baseMapper.queryOrderByFlowCardId(flowCardId); |
| | | HollowOrderDTO order = ordersService.queryOrderByFlowCardId(flowCardId); |
| | | if (null == order) { |
| | | return "生成失败,相关订单信息不存在"; |
| | | } |
| | |
| | | @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) { |
| | |
| | | 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; |
| | |
| | | SysConfigService sysConfigService; |
| | | @Resource |
| | | DamageService damageService; |
| | | @Resource |
| | | OrdersService ordersService; |
| | | // @Value("${mes.slotWidth}") |
| | | // private Integer slotWidth; |
| | | // @Value("${mes.glassGap}") |
| | |
| | | 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); |
| | |
| | | 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, |
| | |
| | | FROM |
| | | hollow_big_storage_cage_history_task |
| | | WHERE |
| | | Date ( create_time ) = '2025-06-23' |
| | | Date ( create_time ) = '${days} |
| | | GROUP BY |
| | | date ( create_time ) |
| | | ), |
| | |
| | | <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, |
| | |
| | | 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> |
| | |
| | | <!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"/> |
| | |
| | | <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 |
| | |
| | | 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 ( |