UI-Project/src/lang/zh.js
@@ -209,6 +209,7 @@ tit:'条数据', temperingqueries:'钢化查询', specifytempering:'指定一炉', specifyout:'指定人工出片', specifyengineerid:'指定工程', projectnumber:'工程号', layoutnumber:'钢化版图号', UI-Project/src/views/Slicecage/slicecage.vue
@@ -362,7 +362,7 @@ } }; // 指定钢化 const brokee = async(row) => { const brokee = async(row,temperingFeedSequence) => { try { const confirmResult = await ElMessageBox.confirm( t('searchOrder.specifytemperinga'), @@ -377,6 +377,7 @@ const response = await request.post("/cacheVerticalGlass/bigStorageCageDetails/TemperingGlass",{ engineerId: row.engineer_id, temperingLayoutId: row.tempering_layout_id, temperingFeedSequence:temperingFeedSequence }); if (response.code === 200) { ElMessage.success(response.message); @@ -387,6 +388,7 @@ } catch (error) { console.error('发生错误:', error); } handleganghua(); }; // 指定工程 const brokek = async(row) => { @@ -1561,10 +1563,10 @@ <el-table-column prop="count4" align="center" :label="$t('破损/拿走数量')" min-width="150" /> <el-table-column fixed="right" :label="$t('searchOrder.operate')" align="center" width="250"> <template #default="scope"> <el-button size="mini" type="text" plain @click="brokee(scope.row)">{{ $t('searchOrder.specifytempering') }}</el-button> <el-button size="mini" type="text" plain @click="brokee(scope.row,1)">{{ $t('searchOrder.specifytempering') }}</el-button> <el-button size="mini" type="text" plain @click="brokee(scope.row,0)">{{ $t('searchOrder.specifyout') }}</el-button> <el-button size="mini" type="text" plain @click="brokek(scope.row)">{{ $t('searchOrder.specifyengineerid') }}</el-button> </template> </el-table-column> </el-table> </el-dialog> UI-Project/src/views/UnLoadGlass/PrintCustomLabelSemi1.vue
@@ -36,13 +36,14 @@ let props = defineProps({ printFlowCardId: null, printLayer: null, printGlassId: null, }) onMounted(async () => { console.log(props.printFlowCardId,props.printLayer) const response = await request.post('/unLoadGlass/downGlassInfo/downGlassLabelPrint',{ flowCardId:props.printFlowCardId, layer:props.printLayer layer:props.printLayer, glassId:props.printGlassId }); if (response.code == 200) { console.log("lastList.value",response.data) UI-Project/src/views/UnLoadGlass/loadmachinerack.vue
@@ -44,6 +44,7 @@ const dialogTableVisible1 = ref(false) const printFlowCardId = ref('') const printLayer = ref('') const printGlassId = ref('') const now = new Date(); const timeRange = ref([]) const browser = ref(false) @@ -234,6 +235,9 @@ scanGlass.value.width = height; scanGlass.value.height = width; } if(autoPrint.value == true && browser.value == true){ open1(scanGlass); } } //自动打印 @@ -338,6 +342,7 @@ printFlowCardId.value = row.flowCardId; printLayer.value = row.layer printGlassId.value = row.glassId dialogTableVisible1.value = true; setTimeout(() => { printFlowCard1(); @@ -536,6 +541,7 @@ </div> <div style="font-size: 50px; text-align: center;position: absolute;top:0px;left:170px;"> <div>人工下片当前玻璃信息</div> <div><el-button type="primary" @click="open1(takeGlass)" >打印标签</el-button></div> <div>{{ takeGlass.flowCardId }}</div> <div>{{ takeGlass.layer }}</div> <div>{{ takeGlass.glassId }}</div> @@ -551,6 +557,7 @@ </div> <div style="font-size: 50px; text-align: center;position: absolute;top:0px;left:200px;"> <div>扫码枪当前玻璃信息</div> <div><el-button type="primary" @click="open1(scanGlass)" >打印标签</el-button></div> <div>{{ scanGlass.flowCardId }}</div> <div>{{ scanGlass.layer }}</div> <div>{{ scanGlass.glassId }}</div> @@ -622,7 +629,7 @@ style="width: 100%;height: 100%" /> </el-dialog> <el-dialog id="sizePrintCalrd1" v-model="dialogTableVisible1" destroy-on-close> <print-label id="printFlowCard" :printFlowCardId="printFlowCardId" :printLayer="printLayer" style="" /> <print-label id="printFlowCard" :printFlowCardId="printFlowCardId" :printLayer="printLayer" :printGlassId="printGlassId" style="" /> </el-dialog> </template> hangzhoumesParent/common/servicebase/src/main/resources/mapper/FlowCardMapper.xml
@@ -27,7 +27,7 @@ on pd.prod_id = od.product_id and pd.glass_sort = ogd.technology_number where fc.process_id = #{processId} <if test="technologyNumber != 0"> and a.layer = #{technologyNumber} and fc.technology_number = #{technologyNumber} </if> <if test="technologyNumber != 0"> and position(fc.technology_number in #{technologyNumber}) hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/CacheGlassTask.java
@@ -80,6 +80,12 @@ @Value("${mes.max.secondLength}") private String secondLength; @Value("${mes.cache.cacheWidth}") private double cacheWidth; @Value("${mes.cache.cacheHeight}") private double cacheHeight; @Value("${mes.min.one.firstLength}") private String minOneFirstLength; @@ -164,9 +170,9 @@ Damage damage = new Damage(); damage.setGlassId(e.getGlassId()); damage.setLine(e.getEndCell()); damage.setWorkingProcedure("冷加工"); damage.setWorkingProcedure("磨边"); damage.setRemark("磨边前卧式理片"); damage.setStatus(0); damage.setStatus(1); damage.setType(e.getTaskStatus()); return damage; }).collect(Collectors.toList()); @@ -186,6 +192,16 @@ */ public void inTo(String glassId, String confirmationWrodAddress, String currentSlot) { log.info("1、按照玻璃id:{}获取玻璃小片信息,当前格子为:{}", glassId, currentSlot); GlassInfo feedGlassInfo = glassInfoService.getOne( new LambdaQueryWrapper<GlassInfo>() .eq(GlassInfo::getGlassId,glassId) ); if(Math.max(feedGlassInfo.getWidth(),feedGlassInfo.getHeight())>cacheWidth||Math.min(feedGlassInfo.getWidth(),feedGlassInfo.getHeight())>cacheHeight){ log.info("1.1、玻璃超过卧式理片最大尺寸:{}", feedGlassInfo); return; } //添加进片任务 查找空格 EdgStorageCage nearestEmpty = edgStorageCageService.selectNearestEmpty(Integer.parseInt(currentSlot), Boolean.FALSE); Assert.isTrue(null != nearestEmpty, "格子已满"); hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/application.yml
@@ -3,7 +3,7 @@ spring: profiles: active: dev active: cz application: name: cacheGlass liquibase: @@ -15,6 +15,9 @@ mes: threshold: 3 ratio: 10 cache: # 卧式理片最大尺寸 cacheWidth: 4000 cacheHeight:3000 max: # 第二条线的最大尺寸信息 firstLength: 3500 secondLength: 2500 hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/controller/BigStorageCageDetailsController.java
@@ -92,7 +92,8 @@ @ApiOperation("指定钢化") @PostMapping("/TemperingGlass") public Result temperingGlass(@RequestBody BigStorageCageDetails bigStorageCageDetails) { boolean result = bigStorageCageDetailsService.temperingGlass(bigStorageCageDetails.getTemperingLayoutId().toString(), bigStorageCageDetails.getEngineerId()); boolean result = bigStorageCageDetailsService .temperingGlass(bigStorageCageDetails.getTemperingLayoutId().toString(), bigStorageCageDetails.getEngineerId(),bigStorageCageDetails.getTemperingFeedSequence().toString()); if (result == true) { return Result.build(200, "指定钢化成功", 1); } else { hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/BigStorageCageDetailsService.java
@@ -69,7 +69,7 @@ */ List<SlotSequenceDTO> queryGlassMaxAndMin(String engineerId, Integer temperingLayoutId); boolean temperingGlass(String temperingLayoutId, String engineerId); boolean temperingGlass(String temperingLayoutId, String engineerId, String temperingFeedSequence); List<Map<String, Object>> selectTemperingGlass(); hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageCageDetailsServiceImpl.java
@@ -27,6 +27,7 @@ import com.mes.glassinfo.entity.GlassInfo; import com.mes.glassinfo.mapper.GlassInfoMapper; import com.mes.glassinfo.service.GlassInfoService; import com.mes.job.PlcStorageCageTask; import com.mes.temperingglass.entity.TemperingGlassInfo; import com.mes.temperingglass.mapper.TemperingGlassInfoMapper; import com.mes.temperingglass.service.TemperingGlassInfoService; @@ -36,10 +37,7 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.*; import java.util.stream.Collectors; /** @@ -70,6 +68,9 @@ @Resource private TemperingGlassInfoService temperingGlassInfoService; @Resource private PlcStorageCageTask plcStorageCageTask; @Resource private DamageService damageService; @@ -188,7 +189,7 @@ LambdaQueryWrapper<BigStorageCageDetails> bigStorageCageDetailsWrapper = new LambdaQueryWrapper<>(); bigStorageCageDetailsWrapper .eq(BigStorageCageDetails::getGlassId, glassId) .eq(BigStorageCageDetails::getState,Const.GLASS_STATE_IN); .eq(BigStorageCageDetails::getState, Const.GLASS_STATE_IN); BigStorageCageDetails bigStorageCageDetails = baseMapper.selectOne(bigStorageCageDetailsWrapper); if (temperingGlassInfo != null) { @@ -221,7 +222,7 @@ @Override public List<BigStorageCageDetails> selectBigStorageCageDetails(String glassId) { LambdaQueryWrapper<GlassInfo> glassInfoWrapper = new LambdaQueryWrapper<>(); List<BigStorageCageDetails> bigStorageCageDetailsList=new ArrayList<>(); List<BigStorageCageDetails> bigStorageCageDetailsList = new ArrayList<>(); glassInfoWrapper.eq(GlassInfo::getGlassId, glassId); GlassInfo glassInfo = glassInfoMapper.selectOne(glassInfoWrapper); BigStorageCageDetails bigStorageCageDetails = new BigStorageCageDetails(); @@ -276,8 +277,8 @@ .gt(BigStorageCage::getRemainWidth, Math.max(glassInfo.getWidth(), glassInfo.getHeight())) .last("limit 1"); if (glassInfo.getTemperingLayoutId() == 0) { wrapper.eq(BigStorageCageDetails::getFlowCardId,glassInfo.getFlowCardId()) .eq(BigStorageCageDetails::getLayer,glassInfo.getLayer()); wrapper.eq(BigStorageCageDetails::getFlowCardId, glassInfo.getFlowCardId()) .eq(BigStorageCageDetails::getLayer, glassInfo.getLayer()); // wrapper.eq(BigStorageCageDetails::getWidth, glassInfo.getWidth()).eq(BigStorageCageDetails::getHeight, glassInfo.getHeight()); } else { wrapper.eq(BigStorageCageDetails::getTemperingFeedSequence, glassInfo.getTemperingFeedSequence() + 1); @@ -363,7 +364,7 @@ } @Override public boolean temperingGlass(String temperingLayoutId, String engineerId) { public boolean temperingGlass(String temperingLayoutId, String engineerId, String temperingFeedSequence) { LambdaQueryWrapper<TemperingGlassInfo> temperingGlassInfoLambdaQueryWrapper = new LambdaQueryWrapper<>(); temperingGlassInfoLambdaQueryWrapper .eq(TemperingGlassInfo::getState, Const.TEMPERING_NEW); @@ -380,11 +381,17 @@ .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN) .orderBy(Boolean.TRUE, sequenceOrder, GlassInfo::getTemperingFeedSequence)); if (CollectionUtils.isNotEmpty(temperingGlassInfos)) { temperingGlassInfoService.saveBatch(temperingGlassInfos); if ("0".equals(temperingFeedSequence)){ if (CollectionUtils.isNotEmpty(temperingGlassInfos)) { plcStorageCageTask.computeOutMoreGlassInfo(temperingGlassInfos, Boolean.FALSE, ""); } }else{ temperingGlassInfoService.saveBatch(temperingGlassInfos); } return true; } } return false; return false; } @@ -406,7 +413,7 @@ } @Override public void appointEngineerId(String engineerId){ public void appointEngineerId(String engineerId) { redisUtil.setCacheObject("temperingengineerId", engineerId); } } hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/PlcStorageCageTask.java
@@ -437,13 +437,13 @@ List<BigStorageCageOutTask> outSuccessGlass = bigStorageCageOutTaskService.list(new LambdaQueryWrapper<BigStorageCageOutTask>() .in(BigStorageCageOutTask::getGlassId, glassIds).in(BigStorageCageOutTask::getTaskState, Const.BIG_STORAGE_OUT_ALL)); if (CollectionUtils.isNotEmpty(outSuccessGlass)) { for (BigStorageCageOutTask bigStorageCageOutTask:outSuccessGlass ) { if(bigStorageCageOutTask.getEndSlot().equals(Const.ARTIFICIAL_OUT_TARGET_POSITION)){ for (BigStorageCageOutTask bigStorageCageOutTask : outSuccessGlass ) { if (bigStorageCageOutTask.getEndSlot().equals(Const.ARTIFICIAL_OUT_TARGET_POSITION)) { temperingGlassInfoService.update( new LambdaUpdateWrapper<TemperingGlassInfo>() .set(TemperingGlassInfo::getState,Const.TEMPERING_END) .eq(TemperingGlassInfo::getGlassId,bigStorageCageOutTask.getGlassId()) .set(TemperingGlassInfo::getState, Const.TEMPERING_END) .eq(TemperingGlassInfo::getGlassId, bigStorageCageOutTask.getGlassId()) ); } } @@ -527,9 +527,9 @@ Damage damage = new Damage(); damage.setGlassId(bigStorageCageFeedTask.getGlassId()); damage.setLine(bigStorageCageFeedTask.getLine()); damage.setWorkingProcedure("冷加工"); damage.setWorkingProcedure("磨边"); damage.setRemark("进笼前卧转立"); damage.setStatus(0); damage.setStatus(1); damage.setType(bigStorageCageFeedTask.getTaskState()); damageService.insertDamage(damage); slotList.add(bigStorageCageFeedTask.getTargetSlot()); @@ -555,9 +555,9 @@ Damage damage = new Damage(); damage.setGlassId(bigStorageCageOutTask.getGlassId()); damage.setLine(bigStorageCageOutTask.getEndSlot()); damage.setWorkingProcedure("冷加工"); damage.setWorkingProcedure("钢化"); damage.setRemark("出片后卧转立"); damage.setStatus(0); damage.setStatus(1); damage.setType(bigStorageCageOutTask.getTaskState()); damageService.insertDamage(damage); slotList.add(bigStorageCageOutTask.getStartSlot()); @@ -572,6 +572,58 @@ } /** * 确认字清空 */ // @Scheduled(fixedDelay = 300) // public void confirmClear() { // PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; // String d01ToMES = plcParameterObject.getPlcParameter("D01ToMES").getValue(); // String d04ToMES = plcParameterObject.getPlcParameter("D04ToMES").getValue(); // String mesD01Address = plcParameterObject.getPlcParameter("MESToD01").getAddress(); // String mesD04Address = plcParameterObject.getPlcParameter("MESToD04").getAddress(); // String d03ToMES = plcParameterObject.getPlcParameter("D03ToMES").getValue(); // String d05ToMES = plcParameterObject.getPlcParameter("D05ToMES").getValue(); // String mesD03Address = plcParameterObject.getPlcParameter("MESToD03").getAddress(); // String mesD05Address = plcParameterObject.getPlcParameter("MESToD05").getAddress(); // if(!REQUEST_WORD.equals(d01ToMES)){ // S7object.getinstance().plccontrol.writeWord(mesD01Address, 0); // } // if(!REQUEST_WORD.equals(d04ToMES)){ // S7object.getinstance().plccontrol.writeWord(mesD04Address, 0); // } // if (!REQUEST_WORD.equals(d03ToMES)) { // S7object.getinstance().plccontrol.writeWord(mesD03Address, 0); // } // if (!REQUEST_WORD.equals(d05ToMES)) { // S7object.getinstance().plccontrol.writeWord(mesD05Address, 0); // } // } /** * 进片状态修改 */ // @Scheduled(fixedDelay = 300) // public void feedStatusUpdate() { // List<String> glassIds1=null; // List<String> glassIds2=null; // List<BigStorageCageFeedTask> bigStorageCageFeedTasks1=bigStorageCageFeedTaskService.list( // new LambdaQueryWrapper<BigStorageCageFeedTask>() // .eq(BigStorageCageFeedTask::getTaskState,1) // .eq(BigStorageCageFeedTask::getLine,Const.ARTIFICIAL_OUT_TARGET_POSITION) // ); // List<BigStorageCageFeedTask> bigStorageCageFeedTasks2=bigStorageCageFeedTaskService.list( // new LambdaQueryWrapper<BigStorageCageFeedTask>() // .eq(BigStorageCageFeedTask::getTaskState,1) // .eq(BigStorageCageFeedTask::getLine,Const.TEMPERING_OUT_TARGET_POSITION) // ); //// if(CollectionUtils.isNotEmpty(bigStorageCageFeedTasks1)){ //// //// } //// if(CollectionUtils.isNotEmpty(bigStorageCageFeedTasks1)){ //// //// } // } /** * 按照玻璃id判断玻璃状态及卧转立是否可直接启动 */ public Boolean judgeGlassTypeStatus(String glassId, Integer line, String mesAddress) { @@ -581,14 +633,24 @@ .eq(EdgGlassTaskInfo::getLine, line) .apply("time >= (select time from edg_glass_task_info where line='" + line + "' and glass_id = '" + glassId + "' and deleted = 0)") .orderByAsc(EdgGlassTaskInfo::getTime)); if (edgGlassTaskInfoList == null) { log.info("线路:{}识别玻璃信息未出现在尺寸表中,获取相邻两块玻璃失败", line); } else { if (edgGlassTaskInfoList.size() == 0) { edgGlassTaskInfoList = edgGlassTaskInfoService.list(new QueryWrapper<EdgGlassTaskInfo>() .select("Top 1 *") .eq("glass_id", glassId) ); log.info("在尺寸表中获取玻璃信息{}", edgGlassTaskInfoList); if (edgGlassTaskInfoList.size() == 0) { GlassInfo glassInfo = glassInfoService.getOne( new LambdaQueryWrapper<GlassInfo>() .eq(GlassInfo::getGlassId, glassId) ); EdgGlassTaskInfo edgGlassTaskInfo = new EdgGlassTaskInfo(); BeanUtils.copyProperties(glassInfo, edgGlassTaskInfo); edgGlassTaskInfo.setWidth((int)glassInfo.getWidth()); edgGlassTaskInfo.setHeight((int)glassInfo.getHeight()); edgGlassTaskInfoList.add(edgGlassTaskInfo); log.info("在玻璃信息表中获取玻璃信息{}", edgGlassTaskInfoList); } } Assert.isFalse(CollectionUtils.isEmpty(edgGlassTaskInfoList), "识别玻璃信息未出现在尺寸表中,获取相邻两块玻璃失败"); //2、获取卧转立剩余宽度 @@ -844,7 +906,7 @@ * @param <T> * @return */ private <T extends BigStorageCageBaseInfo> Boolean computeOutMoreGlassInfo(List<T> list, Boolean isTempering, String mesToPLCAddress) { public <T extends BigStorageCageBaseInfo> Boolean computeOutMoreGlassInfo(List<T> list, Boolean isTempering, String mesToPLCAddress) { //任务数据 获取车子存放玻璃最大数量 玻璃间隔 List<BigStorageCageOutTask> bigStorageCageOutTaskList = new ArrayList<>(); //打车剩余尺寸 hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/test/java/com/mes/CacheVerticalGlassModuleApplicationTest.java
@@ -173,7 +173,7 @@ Damage damage=new Damage(); damage.setGlassId("P24060403|3|6"); damage.setLine(2001); damage.setWorkingProcedure("冷加工"); damage.setWorkingProcedure("磨边"); damage.setRemark(""); damage.setStatus(2); damageService.insertDamage(damage); hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/job/TemperingTask.java
@@ -152,7 +152,7 @@ damage.setLine(Const.TEMPERING_OUT_TARGET_POSITION); damage.setWorkingProcedure("钢化"); damage.setRemark("钢化"); damage.setStatus(0); damage.setStatus(1); damage.setType(e.getState()); return damage; }).collect(Collectors.toList()); hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downglassinfo/service/impl/DownGlassInfoServiceImpl.java
@@ -19,6 +19,7 @@ import com.mes.downworkstation.entity.dto.DownGlassInfoDTO; import com.mes.downworkstation.service.DownWorkstationService; import com.mes.glassinfo.entity.GlassInfo; import com.mes.glassinfo.service.GlassInfoService; import com.mes.job.DownLoadCacheGlassTask; import com.mes.pp.service.FlowCardService; import lombok.extern.slf4j.Slf4j; @@ -52,6 +53,9 @@ @Autowired FlowCardService flowCardService; @Autowired GlassInfoService glassInfoService; /** * 根据流程卡号查询最大序号 @@ -224,8 +228,15 @@ @Override public List<Map<String, Object>> downGlassLabelPrint(DownGlassInfo downGlassInfo) { List<Map<String, Object>> resultList = baseMapper.downGlassLabelPrint(downGlassInfo.getFlowCardId(), downGlassInfo.getLayer()); List<Map<String, Object>> resultList = null; if (downGlassInfo.getGlassId() != null) { resultList = glassInfoService.listMaps( new LambdaQueryWrapper<GlassInfo>() .eq(GlassInfo::getGlassId,downGlassInfo.getGlassId()) ); }else{ resultList = baseMapper.downGlassLabelPrint(downGlassInfo.getFlowCardId(), downGlassInfo.getLayer()); } log.info("MES落架数据:{}", resultList); //获取ERP标签所需的信息 List<Map<String, Object>> labelInfo; hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/job/DownLoadCacheGlassTask.java
@@ -94,7 +94,6 @@ String confirmationWrodAddress = plcParameterObject.getPlcParameter("confirmationWord").getAddress(); String currentSlot = plcParameterObject.getPlcParameter("currentCell").getValue(); log.info("1、获取到的请求字为:{},获取到的扫描ID为:{},获取到的确认字为:{},获取到的出片状态分别为:g06:{}、g08:{}、g11:{}、g13:{},当前格子号为:{}", requestWord, glassIdeValue, confirmationWrodValue, out06Glassstate, out08Glassstate, out11Glassstate, out13Glassstate, currentSlot); if ("0".equals(requestWord)) { @@ -169,9 +168,9 @@ Damage damage = new Damage(); damage.setGlassId(e.getGlassId()); damage.setLine(Const.TEMPERING_OUT_TARGET_POSITION); damage.setWorkingProcedure("下片"); damage.setWorkingProcedure("钢化"); damage.setRemark("下片"); damage.setStatus(0); damage.setStatus(1); damage.setType(e.getTaskStatus()); return damage; }).collect(Collectors.toList());