1、大理片笼及中空大理片笼自动报工,增加过渡台限制(高度超过2500或者厚度超过12)
2、卧理报工
| | |
| | | Boolean submitReport(Damage damage); |
| | | |
| | | /** |
| | | * 按照玻璃id信息自动报工 |
| | | * @param glassId |
| | | * @param deviceId |
| | | * @param workingProcedure |
| | | * @param remark |
| | | */ |
| | | void autoSubmitReport(String glassId, int deviceId,String workingProcedure,String remark); |
| | | /** |
| | | * 单个破损 |
| | | * |
| | | * @param damage |
| | |
| | | import com.kangaroohy.milo.model.ReadWriteEntity; |
| | | import com.kangaroohy.milo.service.MiloService; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.damage.service.DamageService; |
| | | import com.mes.edgglasstask.entity.EdgGlassTaskInfo; |
| | | import com.mes.edgglasstask.service.EdgGlassTaskInfoService; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCage; |
| | |
| | | EdgStorageCageService edgStorageCageService; |
| | | @Resource |
| | | EdgStorageDeviceTaskHistoryService edgStorageDeviceTaskHistoryService; |
| | | @Resource |
| | | DamageService damageService; |
| | | |
| | | @Value("${mes.glassGap}") |
| | | private int glassGap; |
| | |
| | | private void startOneOpcTaskChild(String tableName, int device) { |
| | | EdgStorageDeviceTask task = edgStorageDeviceTaskService.queryTaskMessage(tableName); |
| | | // try { |
| | | if (task == null) { |
| | | log.info("任务表基础数据录入失败,请检查数据是否录入成功"); |
| | | return; |
| | | } |
| | | if (task.getTaskState() == 2) { |
| | | //防止出片任务且笼前有玻璃的情况,将进片id置空,即出片仅考虑笼内的玻璃 |
| | | task.setGlassIdIn(""); |
| | | } |
| | | if (task == null) { |
| | | log.info("任务表基础数据录入失败,请检查数据是否录入成功"); |
| | | return; |
| | | } |
| | | if (task.getTaskState() == 2) { |
| | | //防止出片任务且笼前有玻璃的情况,将进片id置空,即出片仅考虑笼内的玻璃 |
| | | task.setGlassIdIn(""); |
| | | } |
| | | int request = task.getTaskState(); |
| | | int taskRunning = task.getTaskRunning(); |
| | | log.info("开始执行任务,任务请信息为{}", task); |
| | | log.info("开始执行任务,任务请信息为{}", task); |
| | | if (request == 0) { |
| | | log.info("设备:{}状态:{}", device, request); |
| | | log.info("未收到任务请求,结束本次任务"); |
| | |
| | | .eq(EdgStorageDeviceTaskHistory::getTaskState, Const.RAW_GLASS_TASK_NEW) |
| | | .eq(EdgStorageDeviceTaskHistory::getDeviceId, device) |
| | | .orderByDesc(EdgStorageDeviceTaskHistory::getCreateTime).last("limit 1")); |
| | | //如果任务类型为1,3,将切割完成的玻璃自动报工 |
| | | if (Const.GLASS_CACHE_TYPE_IN_ALL.contains(taskHistory.getTaskType())) { |
| | | damageService.autoSubmitReport(taskHistory.getGlassIdIn(), taskHistory.getDeviceId(),"切割","进卧理"); |
| | | } |
| | | updateCellRemainWidth(cell, device, taskHistory); |
| | | edgStorageDeviceTaskHistoryService.update(new LambdaUpdateWrapper<EdgStorageDeviceTaskHistory>() |
| | | .eq(EdgStorageDeviceTaskHistory::getTaskState, Const.RAW_GLASS_TASK_NEW) |
| | |
| | | MPJLambdaWrapper<BigStorageCage> wrapper = new MPJLambdaWrapper<>(); |
| | | wrapper.selectAll(BigStorageCage.class).selectCollection(BigStorageCageDetails.class, BigStorageCage::getBigStorageCageDetails) |
| | | .leftJoin(BigStorageCageDetails.class, on -> on.eq(BigStorageCageDetails::getSlot, BigStorageCage::getSlot) |
| | | .eq(StringUtils.isNotBlank(query.getFilmsId()), BigStorageCageDetails::getFilmsId, query.getFilmsId()) |
| | | .eq(StringUtils.isNotBlank(query.getFlowCardId()), BigStorageCageDetails::getFlowCardId, query.getFlowCardId()) |
| | | .like(StringUtils.isNotBlank(query.getFilmsId()), BigStorageCageDetails::getFilmsId, query.getFilmsId()) |
| | | .like(StringUtils.isNotBlank(query.getFlowCardId()), BigStorageCageDetails::getFlowCardId, query.getFlowCardId()) |
| | | .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN, Const.GLASS_STATE_ARTIFICIAL, Const.GLASS_STATE_OUT_ING)) |
| | | .eq(BigStorageCage::getDeviceId, query.getDeviceId()) |
| | | .orderByAsc(BigStorageCage::getDeviceId) |
| | |
| | | private Integer artificialOutTargetPosition; |
| | | @Value("${mes.slotMaxHeight}") |
| | | private Integer slotMaxHeight; |
| | | @Value("${mes.slotMaxthickness}") |
| | | private Integer slotMaxthickness; |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void inBigStorageTask() throws Exception { |
| | |
| | | } |
| | | } |
| | | //todo:超大尺寸 |
| | | if (slotMaxHeight < Math.min(glassInfoList.get(0).getWidth(), glassInfoList.get(0).getHeight())) { |
| | | if (slotMaxHeight < Math.min(glassInfoList.get(0).getWidth(), glassInfoList.get(0).getHeight()) || glassInfoList.get(0).getThickness() > slotMaxthickness) { |
| | | int count = bigStorageCageDetailsService.count(new LambdaQueryWrapper<BigStorageCageDetails>() |
| | | .eq(BigStorageCageDetails::getSlot, THROUGH_SLOT) |
| | | .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL)); |
| | |
| | | //修改磨边对列表的玻璃状态 |
| | | edgGlassTaskInfoService.update(new LambdaUpdateWrapper<EdgGlassTaskInfo>() |
| | | .set(EdgGlassTaskInfo::getState, Const.EDG_GLASS_SUCCESS).in(EdgGlassTaskInfo::getGlassId, glassIdList)); |
| | | //报工 |
| | | for (String glass : glassIdList) { |
| | | damageService.autoSubmitReport(glass, inTaskList.get(0).getStartSlot(), "磨边", "进大理片笼"); |
| | | } |
| | | |
| | | Map<String, List<GlassInfo>> glassListMap = glassInfoList.stream().collect(Collectors.groupingBy(GlassInfo::getGlassId)); |
| | | //计算目标格子 |
| | | List<BigStorageCageHistoryTask> historyTasks = new ArrayList<>(); |
| | |
| | | glassGap: 250 #玻璃间距 |
| | | xMaxSize: 2800 |
| | | slotMaxHeight: 2500 |
| | | slotMaxthickness: 12 |
| | | temperingOutTargetPosition: 930 |
| | | artificialOutTargetPosition: 931 |
| | | |
| | |
| | | </where> |
| | | </update> |
| | | <update id="updateDeviceIdBySlot"> |
| | | update big_storage_cage_details t innser join big_storage_cage t1 on t.slot = t1.slot |
| | | update big_storage_cage_details t inner join big_storage_cage t1 on t.slot = t1.slot |
| | | set t.device_id = t1.device_id |
| | | where t.slot in ( |
| | | <foreach collection="list" item="item" separator=","> |
| | |
| | | .eq(HollowGlassRelationInfo::getFlowCardId, flowCardId) |
| | | .eq(HollowGlassRelationInfo::getWidth, width) |
| | | .eq(HollowGlassRelationInfo::getHeight, height) |
| | | .eq(HollowGlassRelationInfo::getTotalLayer, totalLayer) |
| | | .eq(HollowGlassRelationInfo::getLayer, layer) |
| | | .eq(HollowGlassRelationInfo::getState, Const.HOLLOW_RELATION_NEW) |
| | | .orderByAsc(HollowGlassRelationInfo::getHollowSequence) |
| | |
| | | .eq(HollowGlassRelationInfo::getFlowCardId, flowCardId) |
| | | .eq(HollowGlassRelationInfo::getWidth, width) |
| | | .eq(HollowGlassRelationInfo::getHeight, height) |
| | | .eq(HollowGlassRelationInfo::getTotalLayer, totalLayer) |
| | | .eq(HollowGlassRelationInfo::getLayer, layer) |
| | | .eq(HollowGlassRelationInfo::getState, Const.HOLLOW_RELATION_NEW) |
| | | .orderByAsc(HollowGlassRelationInfo::getHollowSequence) |
| | |
| | | } |
| | | HollowBigStorageCageDetails hollowDetails = hollowBigStorageCageDetailsService.getOne(new LambdaQueryWrapper<HollowBigStorageCageDetails>() |
| | | .eq(HollowBigStorageCageDetails::getFlowCardId, relationInfoOne.getFlowCardId()) |
| | | .eq(HollowBigStorageCageDetails::getTotalLayer, totalLayer) |
| | | .eq(HollowBigStorageCageDetails::getLayer, layer) |
| | | .eq(HollowBigStorageCageDetails::getVirtualSlot, relationInfoOne.getVirtualSlot()) |
| | | .in(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL_ZERO) |
| | |
| | | } |
| | | HollowGlassRelationInfo relationInfoBefore = hollowGlassRelationInfoService.getOne(new LambdaQueryWrapper<HollowGlassRelationInfo>() |
| | | .eq(HollowGlassRelationInfo::getFlowCardId, relationInfoOne.getFlowCardId()) |
| | | .eq(HollowGlassRelationInfo::getLayer, relationInfoOne.getTotalLayer()) |
| | | .eq(HollowGlassRelationInfo::getLayer, relationInfoOne.getLayer()) |
| | | .eq(HollowGlassRelationInfo::getVirtualSlot, relationInfoOne.getVirtualSlot()) |
| | | .eq(HollowGlassRelationInfo::getSlotSequence, relationInfoOne.getSlotSequence() - 1)); |
| | |
| | | |
| | | private static final String BIG_STORAGE_CAGE_IN_TWO_TASK = "big_storage_cage_in_two_task"; |
| | | private static final String BIG_STORAGE_CAGE_OUT_TWO_TASK = "big_storage_cage_out_two_task"; |
| | | /** |
| | | * 直通格子 |
| | | */ |
| | | private static final Integer THROUGH_SLOT = 920; |
| | | @Autowired(required = false) |
| | | MiloService miloService; |
| | | @Resource |
| | |
| | | |
| | | @Value("${mes.outCarMaxSize}") |
| | | private Integer outCarMaxSize; |
| | | |
| | | @Value("${mes.slotMaxHeight}") |
| | | private Integer slotMaxHeight; |
| | | @Value("${mes.slotMaxthickness}") |
| | | private Integer slotMaxthickness; |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void inBigStorageTask() throws Exception { |
| | |
| | | //todo:向plc发送报警 |
| | | return; |
| | | } |
| | | //按照玻璃厚度分组,判断剩余格子是否可以存放 |
| | | Map<Double, Long> thickCountMap = glassInfoList.stream().collect(Collectors.groupingBy(GlassInfo::getThickness, Collectors.counting())); |
| | | for (Map.Entry<Double, Long> entry : thickCountMap.entrySet()) { |
| | | int count = hollowBigStorageCageService.count(new LambdaQueryWrapper<HollowBigStorageCage>() |
| | | .eq(HollowBigStorageCage::getEnableState, Const.SLOT_ON).eq(HollowBigStorageCage::getRemainWidth, slotWidth) |
| | | .le(HollowBigStorageCage::getMinThickness, entry.getKey()) |
| | | .ge(HollowBigStorageCage::getMaxThickness, entry.getKey())); |
| | | if (count < entry.getValue()) { |
| | | log.info("笼内格子剩余数量不足,结束本次进片"); |
| | | //todo:向plc发送报警 |
| | | return; |
| | | } |
| | | } |
| | | //todo:超大尺寸 |
| | | if (slotMaxHeight < Math.min(glassInfoList.get(0).getWidth(), glassInfoList.get(0).getHeight()) || glassInfoList.get(0).getThickness() > slotMaxthickness) { |
| | | int count = hollowBigStorageCageDetailsService.count(new LambdaQueryWrapper<HollowBigStorageCageDetails>() |
| | | .eq(HollowBigStorageCageDetails::getSlot, THROUGH_SLOT) |
| | | .in(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL)); |
| | | if (count > 0) { |
| | | log.info("直通片台存在玻璃,结束本次进片"); |
| | | //todo:向plc发送报警 |
| | | return; |
| | | } |
| | | } |
| | | |
| | | log.info("将钢化小片表内的状态改为钢化结束,玻璃id有:{}", glassIdList); |
| | | //修改钢化任务表中的状态 |
| | | temperingGlassInfoService.update(new LambdaUpdateWrapper<TemperingGlassInfo>() |
| | | .set(TemperingGlassInfo::getState, Const.TEMPERING_END).in(TemperingGlassInfo::getGlassId, glassIdList)); |
| | | |
| | | //报工 |
| | | log.info("将接收到的玻璃进行钢化自动报工,玻璃id有:{}", glassIdList); |
| | | for (String glass : glassIdList) { |
| | | damageService.autoSubmitReport(glass, inTaskList.get(0).getStartSlot(), "钢化", "进中空理片笼"); |
| | | } |
| | | Map<String, List<GlassInfo>> glassListMap = glassInfoList.stream().collect(Collectors.groupingBy(GlassInfo::getGlassId)); |
| | | |
| | | //计算目标格子 |
| | |
| | | targetSlot = storageCage.getSlot(); |
| | | hollowBigStorageCageService.update(new LambdaUpdateWrapper<HollowBigStorageCage>() |
| | | .set(HollowBigStorageCage::getRemainWidth, 0).eq(HollowBigStorageCage::getSlot, targetSlot)); |
| | | }else{ |
| | | } else { |
| | | resultList = tempList; |
| | | } |
| | | totalLayer = 0; |
| | |
| | | xMaxSize: 2800 |
| | | temperingOutTargetPosition: 930 |
| | | artificialOutTargetPosition: 931 |
| | | slotMaxHeight: 2500 |
| | | slotMaxthickness: 12 |
| | | kangaroohy: |
| | | milo: |
| | | enabled: true |