UI-Project/src/views/Slicecage/slicecage.vue
@@ -1616,7 +1616,7 @@ ></iframe> </el-dialog> <!-- 钢化查询 --> <el-dialog v-model="dialogFormVisiblec" top="5vh" width="85%" :title="$t('searchOrder.temperingqueries')"> <el-dialog v-model="dialogFormVisiblec" top="5vh" width="90%" :title="$t('searchOrder.temperingqueries')"> <div style="margin-bottom: 20px"> <el-form> <el-row style="margin-top: -15px;margin-bottom: -2px;"> @@ -1656,17 +1656,17 @@ </el-row> </el-form> </div> <el-table ref="table" style="margin-top: 20px;height: 500px;" <el-table ref="table" style="margin-top: 20px;height: 600px;" :data="tableDatagh" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> <el-table-column prop="engineerId" fixed align="center" :label="$t('searchOrder.projectnumber')" min-width="150"/> <el-table-column prop="engineerName" fixed align="center" :label="$t('large.productname')" min-width="150"/> <el-table-column prop="thickness" align="center" :label="$t('basicData.thickness')" min-width="150" /> <el-table-column prop="filmsId" align="center" :label="$t('basicData.coatingtypes')" min-width="150" /> <el-table-column prop="temperingLayoutId" align="center" :label="$t('searchOrder.layoutnumber')" min-width="120" /> <el-table-column prop="totalCount" align="center" :label="$t('searchOrder.allnumber')" min-width="150" /> <el-table-column prop="realCount" align="center" :label="$t('searchOrder.numbercages')" min-width="150" /> <el-table-column prop="lackCount" align="center" :label="$t('searchOrder.missingquantity')" min-width="150" /> <el-table-column prop="damageCount" align="center" :label="$t('searchOrder.breakquantity')" min-width="150" /> <el-table-column prop="engineerId" fixed align="center" :label="$t('searchOrder.projectnumber')" min-width="100"/> <el-table-column prop="engineerName" fixed align="center" :label="$t('large.productname')" min-width="120"/> <el-table-column prop="thickness" align="center" :label="$t('basicData.thickness')" min-width="100" /> <el-table-column prop="filmsId" align="center" :label="$t('basicData.coatingtypes')" min-width="100" /> <el-table-column prop="temperingLayoutId" align="center" :label="$t('searchOrder.layoutnumber')" min-width="100" /> <el-table-column prop="totalCount" align="center" :label="$t('searchOrder.allnumber')" min-width="100" /> <el-table-column prop="realCount" align="center" :label="$t('searchOrder.numbercages')" min-width="100" /> <el-table-column prop="lackCount" align="center" :label="$t('searchOrder.missingquantity')" min-width="100" /> <el-table-column prop="damageCount" align="center" :label="$t('searchOrder.breakquantity')" min-width="120" /> <el-table-column fixed="right" :label="$t('searchOrder.operate')" align="center" width="500"> <template #default="scope"> <el-button type="text" plain @click="brokee(scope.row,1)">{{ $t('searchOrder.specifytempering') }}</el-button> hangzhoumesParent/common/servicebase/src/main/java/com/mes/order/entity/dto/InterlayerDTO.java
New file @@ -0,0 +1,24 @@ package com.mes.order.entity.dto; import lombok.Data; /** * @Author : zhoush * @Date: 2025/11/25 8:35 * @Description: */ @Data public class InterlayerDTO { /** * 夹层第一层 */ private Integer prevSort; /** * 夹层第二层 */ private Integer nextSort; } hangzhoumesParent/common/servicebase/src/main/java/com/mes/order/mapper/OrdersMapper.java
@@ -1,6 +1,7 @@ package com.mes.order.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.mes.order.entity.*; import com.mes.order.entity.dto.InterlayerDTO; import com.mes.order.entity.dto.OrderDTO; import java.util.List; @@ -26,4 +27,11 @@ OrderDetailsDTO queryProductNameByFlowCardId(String flowCardId); List<ProcessCardReport> queryLackByERP(String flowCardId); /** * 按照流程卡查询是否夹层及层号 * @param flowCardId * @return */ List<InterlayerDTO> queryInterlayerByERP(String flowCardId); } hangzhoumesParent/common/servicebase/src/main/java/com/mes/order/service/OrdersService.java
@@ -2,6 +2,7 @@ import com.baomidou.mybatisplus.extension.service.IService; import com.mes.order.entity.*; import com.mes.order.entity.dto.InterlayerDTO; import com.mes.order.entity.dto.OrderDTO; import java.util.List; @@ -31,4 +32,6 @@ OrderDetailsDTO queryProductNameByFlowCardId(String flowCardId); List<ProcessCardReport> queryLackByERP(String flowCardId); List<InterlayerDTO> queryInterlayerByERP(String flowCardId); } hangzhoumesParent/common/servicebase/src/main/java/com/mes/order/service/impl/OrdersServiceImpl.java
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.mes.order.entity.*; import com.mes.order.entity.dto.InterlayerDTO; import com.mes.order.entity.dto.OrderDTO; import com.mes.order.mapper.OrderdetailMapper; import com.mes.order.mapper.OrdersMapper; @@ -78,4 +79,8 @@ public List<ProcessCardReport> queryLackByERP(String flowCardId) { return baseMapper.queryLackByERP(flowCardId); } @Override public List<InterlayerDTO> queryInterlayerByERP(String flowCardId) { return baseMapper.queryInterlayerByERP(flowCardId); } } hangzhoumesParent/common/servicebase/src/main/resources/mapper/OrderMapper.xml
@@ -152,4 +152,34 @@ and a.process = "中空" and (b.quantity - b.termination_quantity) > reporting_work_num </select> <select id="queryInterlayerByERP" resultType="com.mes.order.entity.dto.InterlayerDTO"> WITH flow_order AS ( SELECT ORDER_ID, ORDER_NUMBER FROM pp.flow_card WHERE process_id = #{flowCardId} ORDER BY ORDER_NUMBER /* 添加适当的排序字段,确保结果确定性 */ LIMIT 1 ), product_ids AS ( SELECT od.PRODUCT_ID FROM sd.order_detail od inner JOIN flow_order fo ON od.ORDER_id = fo.ORDER_ID AND od.ORDER_NUMBER = fo.ORDER_NUMBER ), ranked AS ( SELECT detail_type, LAG(glass_sort) OVER (PARTITION BY prod_id ORDER BY sort_num) AS prev_sort, LEAD(glass_sort) OVER (PARTITION BY prod_id ORDER BY sort_num) AS next_sort FROM sd.product_detail WHERE prod_id IN (SELECT PRODUCT_ID FROM product_ids) ) SELECT prev_sort, next_sort FROM ranked where detail_type = 'Interlayer' </select> </mapper> hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/config/S7Config.java
@@ -27,4 +27,9 @@ return S7Serializer.newInstance(s7PLC); } @Bean(name = "s7plcWZL") public S7PLC s7plcWZL() { return new S7PLC(EPlcType.S1200, "192.168.20.160"); } } hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageNewTask.java
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.github.xingshuangs.iot.protocol.s7.serializer.S7Serializer; import com.github.xingshuangs.iot.protocol.s7.service.S7PLC; import com.github.yulichang.toolkit.JoinWrappers; import com.kangaroohy.milo.model.ReadWriteEntity; import com.kangaroohy.milo.service.MiloService; @@ -87,6 +88,9 @@ @Autowired @Qualifier("s7SerializerDLPTwo") private S7Serializer s7SerializerDLPTwo; @Autowired @Qualifier("s7plcWZL") private S7PLC s7plcWZL; @Resource SysConfigService sysConfigService; @@ -389,6 +393,11 @@ log.info("当前未收到出片请求,结束出片任务"); return; } int outRequest = s7plcWZL.readUInt16("DB51.8"); if (outRequest == 0){ log.info("当前未收到卧转立允许出片请求,结束出片任务"); return; } //获取出片任务表 List<BigStorageCageTask> outTaskList = getOutTaskList(s7DataWLTwo); if (CollectionUtil.isNotEmpty(outTaskList)) { hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/mapper/HollowBigStorageCageDetailsMapper.java
@@ -30,7 +30,7 @@ List<BigStorageSequenceDTO> queryNeedDispatchSlot(FlowCardVirtualSlotDTO flowCardVirtualSlotDTO); List<HollowBigStorageCageDetails> queryOutGlassList(@Param("flowCardId") String flowCardId, @Param("cell") int cell); List<HollowBigStorageCageDetails> queryOutGlassList(@Param("flowCardId") String flowCardId, @Param("cell") int cell, @Param("list") List<Integer> layerList); List<BigStorageVO> queryHollowbigStorageCageDetail(); hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/HollowBigStorageCageDetailsService.java
@@ -5,7 +5,6 @@ import com.mes.hollow.entity.HollowBigStorageCageDetails; import com.mes.hollow.entity.dto.*; import com.mes.hollow.entity.request.HollowBigCageDetailsRequest; import com.mes.hollow.entity.vo.HollowAllFlowCardVO; import com.mes.hollow.entity.vo.HollowBigCageDetailsVO; import com.mes.hollow.entity.vo.HollowBigStorageDetailsQueryVO; @@ -29,7 +28,7 @@ List<BigStorageSequenceDTO> queryNeedDispatchSlot(FlowCardVirtualSlotDTO flowCardVirtualSlotDTO); List<HollowBigStorageCageDetails> queryOutGlassList(String flowCardId, int cell); List<HollowBigStorageCageDetails> queryOutGlassList(String flowCardId, int cell, List<Integer> layerList); Map<Integer, List<BigStorageVO>> queryHollowbigStorageCageDetail(); hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowBigStorageCageDetailsServiceImpl.java
@@ -70,8 +70,8 @@ } @Override public List<HollowBigStorageCageDetails> queryOutGlassList(String flowCardId, int cell) { return baseMapper.queryOutGlassList(flowCardId, cell); public List<HollowBigStorageCageDetails> queryOutGlassList(String flowCardId, int cell, List<Integer> layerList) { return baseMapper.queryOutGlassList(flowCardId, cell, layerList); } @Override hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassOutRelationInfoServiceImpl.java
@@ -30,6 +30,7 @@ import com.mes.largenscreen.entity.PieChartVO; import com.mes.order.entity.HollowOrderDTO; import com.mes.order.entity.OrderDetailsDTO; import com.mes.order.entity.dto.InterlayerDTO; import com.mes.order.service.OrdersService; import com.mes.sysconfig.service.SysConfigService; import com.mes.tools.DateUtil; @@ -43,7 +44,6 @@ import org.springframework.beans.BeanUtils; import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.io.*; @@ -366,9 +366,7 @@ } private HollowGlassOutRelationInfo childrenTask(HollowTaskRequest request, int isForce) { try { GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getFlowCardId, request.getFlowCardId()).last("limit 1")); HollowGlassOutRelationInfo info = new HollowGlassOutRelationInfo(); if (null == glassInfo) { @@ -393,9 +391,26 @@ info.setFormulaId(request.getFormulaId()); this.save(info); // 查询出需要出玻璃的队列 List<Integer> layerList = new ArrayList<>(); int isPairCount = 0; if (932 == request.getCell()) { List<InterlayerDTO> interlayerList = ordersService.queryInterlayerByERP(request.getFlowCardId()); if (CollectionUtil.isNotEmpty(interlayerList)) { List<Integer> tempList = new ArrayList<>(); for (InterlayerDTO dto : interlayerList) { tempList.add(dto.getPrevSort()); tempList.add(dto.getNextSort()); } layerList = tempList.stream().distinct().collect(Collectors.toList()); isPairCount = layerList.size() * request.getTotalPairQuantity(); }else{ isPairCount = glassInfo.getTotalLayer() * request.getTotalPairQuantity(); } } else { isPairCount = glassInfo.getTotalLayer() * request.getTotalPairQuantity(); } List<HollowBigStorageCageDetails> hollowBigStorageCageDetailsList = hollowBigStorageCageDetailsService .queryOutGlassList(request.getFlowCardId(), request.getCell()); int isPairCount = glassInfo.getTotalLayer() * request.getTotalPairQuantity(); .queryOutGlassList(request.getFlowCardId(), request.getCell(), layerList); List<HollowGlassQueueInfo> hollowQueues = new ArrayList<>(); Integer carWidth = sysConfigService.queryConfigValue(ConstSysConfig.HOLLOW_CAR_WIDTH); Integer glassGap = hollowGlassRelationInfoService.getGlassGapByThickness(hollowBigStorageCageDetailsList.get(0).getThickness()); hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/mapper/HollowBigStorageCageDetailsMapper.xml
@@ -196,6 +196,13 @@ on t.flow_card_id = t1.flow_card_id and t.hollow_sequence = t1.hollow_sequence where t.state = 100 and t.flow_card_id = #{flowCardId} <if test="list != null and list.size() > 0"> and t.layer in ( <foreach collection="list" item="item" separator=","> #{item} </foreach> ) </if> ) select * from result_detail @@ -207,8 +214,8 @@ <select id="queryHollowbigStorageCageDetail" resultType="com.mes.base.entity.vo.BigStorageVO"> select hbsc.device_id, hbsc.slot, count(hbscd.glass_id) as count from hollow_big_storage_cage hbsc left join hollow_big_storage_cage_details hbscd on hbsc.slot = hbscd.slot and hbscd.state in (100, 102, 103, 104) left join hollow_big_storage_cage_details hbscd on hbsc.slot = hbscd.slot and hbscd.state in (100, 102, 103, 104) group by hbsc.device_id, hbsc.slot order by hbsc.device_id, hbsc.slot </select>