Merge branch 'master' of http://10.153.19.25:10105/r/YiWuProject
| | |
| | | log.info("二线卧理: {}", s7DataWLTwo); |
| | | Boolean oneInkageEntity = s7DataWLOne.getDeviceState(); |
| | | int cellFlag = 1; |
| | | if (!oneInkageEntity && !Const.OUT_DISABLE.equals(s7DataWLExtraTwo.getD06SlotState())) { |
| | | if (!oneInkageEntity && !Const.OUT_DISABLE.equals(s7DataWLExtraTwo.getD06SlotState())) { |
| | | cellFlag = 2; |
| | | } |
| | | startOneOpcTaskChild(s7DataWLTwo, 2, cellFlag); |
| | | |
| | | } |
| | | |
| | | private void startOneOpcTaskChild(S7DataWL task, int device, int cellFlag) throws Exception { |
| | |
| | | //状态有3中情况:0空闲 1忙碌 2禁用 |
| | | //两条线都为禁用则不出玻璃 |
| | | if (Const.OUT_DISABLE.equals(oneOutState) && Const.OUT_DISABLE.equals(twoOutState)) { |
| | | log.info("A09、A10为{},{}非自动状态,无法出片", oneOutState, oneOutState); |
| | | log.info("设备{}:A09、A10为{},{}非自动状态,无法出片", deviceId, oneOutState, oneOutState); |
| | | return Boolean.FALSE; |
| | | } |
| | | //获取d06片台状态 |
| | |
| | | cell = Const.TWO_OUT_TARGET_POSITION; |
| | | } |
| | | } |
| | | log.info("{}线路计算完成:{}", deviceId, cell); |
| | | if (cellFlag == 2) { |
| | | if (!outChildTask(task, deviceId, cell, startDate)) { |
| | | cell = cell == Const.ONE_OUT_TARGET_POSITION ? Const.TWO_OUT_TARGET_POSITION : Const.ONE_OUT_TARGET_POSITION; |
| | |
| | | |
| | | //笼内是版图相差是否超过阈值 |
| | | boolean flag = queryMaxMinDiffByDevice(threshold, deviceId); |
| | | log.info("{}阈值计算完成:{}", deviceId, flag); |
| | | if (flag) { |
| | | //先找最小版图版序的玻璃小片 |
| | | EdgStorageCageDetails minEdgDetails = edgStorageCageDetailsService.getOne(new LambdaQueryWrapper<EdgStorageCageDetails>() |
| | |
| | | ); |
| | | } |
| | | } |
| | | log.info("{}按照阈值查找结果:{}", deviceId, edgStorageCageDetails); |
| | | if (null == edgStorageCageDetails) { |
| | | // 获取历史表中上次任务最后一片尺寸 |
| | | EdgStorageDeviceTaskHistory edgeData = edgStorageDeviceTaskHistoryService.getOne(new LambdaQueryWrapper<EdgStorageDeviceTaskHistory>() |
| | | .eq(EdgStorageDeviceTaskHistory::getDeviceId, cell) |
| | | .in(EdgStorageDeviceTaskHistory::getTaskType, Const.GLASS_CACHE_TYPE_OUT, Const.GLASS_CACHE_TYPE_THROUGH) |
| | | .orderByDesc(EdgStorageDeviceTaskHistory::getId).last("limit 1")); |
| | | log.info("{}获取上次任务信息:{}", deviceId, edgeData); |
| | | if (null != edgeData) { |
| | | GlassInfo glassOutInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getGlassId, edgeData.getGlassIdOut())); |
| | | //笼内的玻璃的尺寸是否和上一次任务一致 |
| | | |
| | | edgStorageCageDetails = edgStorageCageDetailsService.queryEdgStorageDetailsBySize(deviceId, task.getCurrentCell(), glassOutInfo.getWidth(), glassOutInfo.getHeight(), cell, maxThickness); |
| | | if (null == edgStorageCageDetails && StringUtils.isNotBlank(task.getGlassIdIn())) { |
| | | GlassInfo glassInInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>() |
| | |
| | | } |
| | | } |
| | | } |
| | | log.info("{}获取历史表中上次任务最后一片尺寸:{}", deviceId, edgStorageCageDetails); |
| | | //前面已经尺寸问题处理完毕,开始计算无相同尺寸的新玻璃小片 |
| | | if (null == edgStorageCageDetails) { |
| | | edgStorageCageDetails = edgStorageCageDetailsService.queryEdgStorageDetailsByLimitSize(deviceId, Integer.parseInt(task.getCurrentCell().toString()), 0, 0, |
| | | cell, minOneFirstLength, minOneSecondLength, maxTwoFirstLength, maxTwoSecondLength, maxThickness); |
| | | } |
| | | log.info("{}开始计算无相同尺寸的新玻璃小片:{}", deviceId, edgStorageCageDetails); |
| | | if (edgStorageCageDetails == null && StringUtils.isNotBlank(task.getGlassIdIn())) { |
| | | //和上次任务不存在相同尺寸 |
| | | GlassInfo glassInInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getGlassId, task.getGlassIdIn())); |
| | |
| | | log.info("直通任务目标线路为{},进片玻璃尺寸为{}*{},不符合出片条件", cell, maxLength, minLength); |
| | | } |
| | | } |
| | | log.info("{}直通任务:{}", deviceId, edgStorageCageDetails); |
| | | if (edgStorageCageDetails == null) { |
| | | //和上次任务不存在相同尺寸 |
| | | log.info("笼内没有玻璃了"); |
| | |
| | | if (3 != task.getTaskState()) { |
| | | return Boolean.FALSE; |
| | | } |
| | | log.info("5、直通任务,将玻璃信息插入卧式理片笼,当前玻璃信息:{}", edgStorageCageDetails); |
| | | log.info("5、{}直通任务,将玻璃信息插入卧式理片笼,当前玻璃信息:{}", edgStorageCageDetails); |
| | | if (glassInIdOne.equals(task.getGlassIdIn()) || glassInIdTwo.equals(task.getGlassIdIn())) { |
| | | log.info("玻璃id与上次相同,禁止进片"); |
| | | return Boolean.FALSE; |
| | |
| | | GlassInfo one = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getGlassId, glassId)); |
| | | BeanUtils.copyProperties(one, edgStorageCageDetails); |
| | | } |
| | | EdgStorageCage storageCage = edgStorageCageService.getOne(new LambdaQueryWrapper<EdgStorageCage>() |
| | | .eq(EdgStorageCage::getDeviceId, deviceId) |
| | | .eq(EdgStorageCage::getEnableState, Const.SLOT_ON) |
| | | .ge(EdgStorageCage::getRemainWidth, cellLength) |
| | | .last("order by abs(slot - " + task.getCurrentCell() + ") limit 1")); |
| | | EdgStorageCage storageCage = edgStorageCageService.selectNearestEmpty(Integer.parseInt(task.getCurrentCell().toString()), deviceId, Boolean.TRUE); |
| | | Assert.isTrue(null != storageCage, "格子已满,无法执行直通任务"); |
| | | log.info("3、查询卧式理片笼里面的空格:{}", storageCage); |
| | | edgStorageCageDetails.setSlot(storageCage.getSlot()); |
| | |
| | | import org.mybatis.spring.annotation.MapperScan; |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.cache.annotation.EnableCaching; |
| | | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc; |
| | |
| | | @EnableDiscoveryClient |
| | | @MapperScan(basePackages = "com.mes.*.mapper") |
| | | @EnableScheduling |
| | | @EnableCaching |
| | | public class HollowGlassApplication { |
| | | |
| | | public static void main(String[] args) { |
| | |
| | | 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; |
| | | |
| | |
| | | OrderDTO queryOrderByFlowCardId(@Param("flowCardId") String flowCardId); |
| | | |
| | | List<PieChartVO> queryPieChart(); |
| | | |
| | | /** |
| | | * 按照流程卡获取产品名称 |
| | | * |
| | | * @param flowCardId |
| | | * @return |
| | | */ |
| | | OrderDetailsDTO queryProductNameByFlowCardId(String flowCardId); |
| | | } |
| | | |
| | |
| | | import com.mes.hollow.entity.dto.LackDetailsDTO; |
| | | import com.mes.hollow.entity.dto.OrderDetailsDTO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.cache.annotation.Cacheable; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | 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); |
| | | |
| | | } |
| | | |
| | |
| | | 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.hollow.entity.request.HollowHistoryTaskRequest; |
| | | import com.mes.hollow.entity.request.HollowTaskRequest; |
| | | import com.mes.hollowqueue.entity.HollowGlassQueueInfo; |
| | |
| | | |
| | | List<String> hollowTaskList(int cell); |
| | | |
| | | Map<String, List<HollowGlassQueueInfo>> appointHollowTaskDetails( int cell); |
| | | Map<String, List<HollowGlassQueueInfo>> appointHollowTaskDetails(int cell); |
| | | |
| | | Boolean startTask(int cell); |
| | | |
| | |
| | | Page<HollowGlassOutRelationInfo> queryHollowHistoryTask(HollowHistoryTaskRequest request); |
| | | |
| | | List<PieChartVO> queryPieChart(); |
| | | |
| | | OrderDetailsDTO queryProductNameByFlowCardId(String flowCardId); |
| | | } |
| | | |
| | |
| | | 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.hollow.entity.vo.HollowAllFlowCardVO; |
| | | import com.mes.hollow.entity.vo.HollowBigStorageDetailsQueryVO; |
| | | |
| | |
| | | Integer getGlassGapByThickness(Double thickness); |
| | | |
| | | Boolean hollowBigStorageGlassDamage(DamageRequest request); |
| | | |
| | | OrderDetailsDTO queryProductNameByFlowCardId(String flowCardId, String productName, String customerName); |
| | | } |
| | | |
| | |
| | | import freemarker.template.Version; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.cache.annotation.Cacheable; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | return this.page(page, wrapper); |
| | | } |
| | | |
| | | @Override |
| | | @Cacheable(value = "orderDetails", key = "#flowCardId") |
| | | public OrderDetailsDTO queryProductNameByFlowCardId(String flowCardId) { |
| | | log.info("查询数据库一次:{}", flowCardId); |
| | | return baseMapper.queryProductNameByFlowCardId(flowCardId); |
| | | } |
| | | |
| | | private HollowGlassOutRelationInfo childrenTask(HollowTaskRequest request, int isForce) { |
| | | GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getFlowCardId, request.getFlowCardId()).last("limit 1")); |
| | |
| | | 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; |
| | |
| | | .last("limit 1") |
| | | ); |
| | | } |
| | | Assert.isTrue(null != relationInfoOne, "相关流程卡未找到对应的组号信息,玻璃流程卡:{},序号:{},总层数:{},层数:{}", flowCardId, glassType, totalLayer, layer); |
| | | if (null == relationInfoOne) { |
| | | throw new RuntimeException("相关流程卡未找到对应的组号信息,玻璃流程卡:" + flowCardId + ",序号:" + glassType + ",总层数:" + totalLayer + ",层数:" + layer); |
| | | } |
| | | Integer slotWidth = sysConfigService.queryConfigValue(ConstSysConfig.HOLLOW_SLOT_WIDTH); |
| | | //详情表内获取本组是否已经有玻璃在笼子内(0表示提前占用) |
| | | int taskCount = hollowGlassOutRelationInfoService.count(new LambdaQueryWrapper<HollowGlassOutRelationInfo>() |
| | |
| | | HollowAllFlowCardVO hollowAllFlowCardVO = new HollowAllFlowCardVO(); |
| | | HollowBigStorageCageDetails cageDetails = v.get(0); |
| | | //按照流程卡获取对应的产品名称 |
| | | OrderDetailsDTO orderDetails = baseMapper.queryProductNameByFlowCardId(cageDetails.getFlowCardId(), query.getProductName(), query.getCustomerName()); |
| | | OrderDetailsDTO orderDetails = this.queryProductNameByFlowCardId(cageDetails.getFlowCardId(), query.getProductName(), query.getCustomerName()); |
| | | if (null != orderDetails) { |
| | | BeanUtils.copyProperties(orderDetails, hollowAllFlowCardVO); |
| | | hollowAllFlowCardVO.setFlowCardId(e); |
| | |
| | | return Boolean.TRUE; |
| | | } |
| | | |
| | | @Override |
| | | public OrderDetailsDTO queryProductNameByFlowCardId(String flowCardId, String productName, String customerName) { |
| | | OrderDetailsDTO dto = hollowGlassOutRelationInfoService.queryProductNameByFlowCardId(flowCardId); |
| | | if ((StringUtils.isBlank(productName) || dto.getProductName().contains(productName)) && (StringUtils.isBlank(customerName) || dto.getCustomerName().contains(customerName))) { |
| | | return dto; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | private void sortFlowCardIdList(List<HollowAllFlowCardVO> list) { |
| | | Pattern pattern = Pattern.compile("^NG(\\d+)([A-Za-z]+)(\\d+)$"); |
| | | |
| | |
| | | } |
| | | baseInfoList = resultList; |
| | | } else { |
| | | //大于总层数先取totalLyaer倍数数量的玻璃,保证大车上的玻璃成对传 |
| | | //大于总层数先取totalLayer倍数数量的玻璃,保证大车上的玻璃成对传 |
| | | int remainCount = templist.size() % totalLayer; |
| | | if (targetSlot == 930) { |
| | | baseInfoList = templist.subList(0, totalLayer); |
| | | int tempSequence = templist.get(0).getHollowSequence(); |
| | | List<T> resultList = new ArrayList<>(); |
| | | for (int i = 0; i < templist.size(); i++) { |
| | | if (tempSequence == list.get(i).getHollowSequence()) { |
| | | resultList.add(templist.get(i)); |
| | | } else { |
| | | break; |
| | | } |
| | | } |
| | | baseInfoList = resultList; |
| | | } else { |
| | | baseInfoList = templist.subList(0, templist.size() - remainCount); |
| | | } |
| | |
| | | </update> |
| | | |
| | | <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 |
| | | 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 ), |
| | | lack_flow_layer_count AS ( |
| | | WITH flow_layer_stats AS ( |
| | | SELECT |
| | | t.flow_card_id, |
| | | t.layer, |
| | | ifnull((sum_count - real_count - ifnull(damage_count,0)),0) AS lack_count |
| | | FROM |
| | | sum_flow_layer_count t |
| | | left JOIN real_flow_layer_count t1 ON t.flow_card_id = t1.flow_card_id |
| | | AND t.layer = t1.layer |
| | | left JOIN damage_flow_layer_count t2 ON t1.flow_card_id = t2.flow_card_id |
| | | AND t1.layer = t2.layer |
| | | h.flow_card_id, |
| | | h.layer, |
| | | MIN(r.films_id) AS films_id, |
| | | MIN(r.thickness) AS thickness, |
| | | COUNT(*) AS sum_count, |
| | | COUNT(DISTINCT h.slot) AS slot_count, |
| | | SUM(CASE WHEN h.state = 100 THEN 1 ELSE 0 END) AS real_count |
| | | FROM hollow_glass_relation_info r |
| | | LEFT JOIN hollow_big_storage_cage_details h |
| | | ON r.flow_card_id = h.flow_card_id AND r.layer = h.layer |
| | | WHERE r.flow_card_id = #{flowCardId} |
| | | GROUP BY h.flow_card_id, h.layer |
| | | ), |
| | | layer_one AS ( SELECT * FROM hollow_big_storage_cage_details WHERE layer = 1 AND state = 100 ), |
| | | layer_two AS ( SELECT * FROM hollow_big_storage_cage_details WHERE layer = 2 AND state = 100), |
| | | layer_three AS ( SELECT * FROM hollow_big_storage_cage_details WHERE layer = 3 AND state = 100 ) |
| | | , |
| | | pair_flow_layer_count AS ( |
| | | damage_stats AS ( |
| | | SELECT |
| | | t.flow_card_id, |
| | | count(*) AS pair_count |
| | | FROM |
| | | layer_one t |
| | | INNER JOIN layer_two t1 ON t.flow_card_id = t1.flow_card_id |
| | | AND t.virtual_slot = t1.virtual_slot |
| | | AND t.sequence = t1.sequence |
| | | process_id AS flow_card_id, |
| | | technology_number AS layer, |
| | | COUNT(*) AS damage_count |
| | | FROM damage |
| | | WHERE type IN (8,9) AND process_id = #{flowCardId} |
| | | GROUP BY process_id, technology_number |
| | | ), |
| | | pair_stats AS ( |
| | | SELECT |
| | | t1.flow_card_id, |
| | | COUNT(*) AS pair_count |
| | | FROM hollow_big_storage_cage_details t1 |
| | | INNER JOIN hollow_big_storage_cage_details 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 |
| | | AND t1.state = 100 AND t2.state = 100 |
| | | <if test="totalLayer == 3"> |
| | | inner join layer_three t2 |
| | | on t.flow_card_id = t2.flow_card_id and |
| | | t.virtual_slot = t2.virtual_slot and t.sequence = t2.sequence |
| | | INNER JOIN hollow_big_storage_cage_details t3 |
| | | ON t1.flow_card_id = t3.flow_card_id |
| | | AND t1.virtual_slot = t3.virtual_slot |
| | | AND t1.sequence = t3.sequence |
| | | AND t3.layer = 3 AND t3.state = 100 |
| | | </if> |
| | | GROUP BY |
| | | t.flow_card_id |
| | | ), |
| | | result_flow_layer_count AS ( |
| | | WHERE t1.flow_card_id = #{flowCardId} |
| | | GROUP BY t1.flow_card_id |
| | | ) |
| | | SELECT |
| | | t.flow_card_id, |
| | | t.layer, |
| | | t.films_id, |
| | | t.thickness, |
| | | sum_count, |
| | | IFNULL( t3.pair_count, 0 ) AS pair_count, |
| | | IFNULL( real_count, 0 ) AS real_count, |
| | | IFNULL( damage_count, 0 ) AS damage_count, |
| | | IFNULL( lack_count, 0 ) AS lack_count, |
| | | IFNULL(slot_count,0) AS slot_count |
| | | FROM |
| | | sum_flow_layer_count t |
| | | LEFT JOIN real_flow_layer_count t1 ON t.flow_card_id = t1.flow_card_id |
| | | AND t.layer = t1.layer |
| | | LEFT JOIN lack_flow_layer_count t2 ON t.flow_card_id = t2.flow_card_id |
| | | AND t.layer = t2.layer |
| | | LEFT JOIN pair_flow_layer_count t3 ON t.flow_card_id = t3.flow_card_id |
| | | LEFT JOIN damage_flow_layer_count t4 ON t.flow_card_id = t4.flow_card_id |
| | | AND t.layer = t4.layer |
| | | ) SELECT |
| | | * |
| | | FROM |
| | | result_flow_layer_count |
| | | WHERE |
| | | flow_card_id = #{flowCardId} |
| | | f.flow_card_id, |
| | | f.layer, |
| | | f.films_id, |
| | | f.thickness, |
| | | f.sum_count, |
| | | COALESCE(p.pair_count, 0) AS pair_count, |
| | | COALESCE(f.real_count, 0) AS real_count, |
| | | COALESCE(d.damage_count, 0) AS damage_count, |
| | | (f.sum_count - COALESCE(f.real_count, 0) - COALESCE(d.damage_count, 0)) AS lack_count, |
| | | f.slot_count |
| | | FROM flow_layer_stats f |
| | | LEFT JOIN damage_stats d |
| | | ON f.flow_card_id = d.flow_card_id AND f.layer = d.layer |
| | | LEFT JOIN pair_stats p |
| | | ON f.flow_card_id = p.flow_card_id |
| | | WHERE 1=1 |
| | | <if test="flag == true"> |
| | | and sum_count = pair_count |
| | | AND f.sum_count = COALESCE(p.pair_count, 0) |
| | | </if> |
| | | order by layer |
| | | ORDER BY f.layer; |
| | | </select> |
| | | |
| | | <select id="queryIsAllNeedDispatchVirtualSlot" resultMap="virtualSlotSequenceDTO"> |
| | |
| | | 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> |
| | |
| | | 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> |
| | | |
| | | <update id="clearDirtyFlowCardData"> |
| | | update hollow_glass_relation_info |
| | | set glass_id = null, |
| | | tempering_layout_id = null, |
| | | tempering_feed_sequence = null, |
| | | engineer_id = null, |
| | | state = 0 |
| | | update tempering_glass_relation_info |
| | | set shelf_order = 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 |
| | | and shelf_order not in ( |
| | | select shelf_order |
| | | from vertical_sheet_cage_details |
| | | where flow_card_id = #{flowCardId} |
| | | and layer = #{layer} |
| | | and state in (100, 102, 103, 104) |