| | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.ArrayList; |
| | |
| | | |
| | | public static String engineerId = ""; |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | // @Scheduled(fixedDelay = 1000) |
| | | public void plcHomeEdgTask() { |
| | | Date startDate = new Date(); |
| | | log.info("本次任务开始执行时间:{}", startDate); |
| | |
| | | String confirmationWrodAddress = plcParameterObject.getPlcParameter("MES_confirmation_word").getAddress(); |
| | | String currentSlot = plcParameterObject.getPlcParameter("Current_slot").getValue(); |
| | | |
| | | // taskRequestTypeValue = "3"; |
| | | // taskRequestTypeValue = "2"; |
| | | // out08Glassstate = "1"; |
| | | // out10Glassstate = "1"; |
| | | // currentSlot = "2"; |
| | | // currentSlot = "5"; |
| | | // confirmationWrodValue = "0"; |
| | | // glassIdeValue = "P24092706|15|5"; |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | // @Scheduled(fixedDelay = 1000) |
| | | public void dealDamageTask() { |
| | | Date startDate = new Date(); |
| | | log.info("卧式理片破损玻璃清除任务开始执行时间:{}", startDate); |
| | |
| | | details.setSlot(nearestEmpty.getSlot()); |
| | | details.setDeviceId(nearestEmpty.getDeviceId()); |
| | | edgStorageCageDetailsService.save(details); |
| | | damageService.deleteByGlassId(glassId); |
| | | log.info("5、玻璃信息已存入理片笼详情表,玻璃信息为{}", details); |
| | | //添加进片任务 |
| | | boolean taskCache = saveTaskCache(details.getGlassId(), 0, nearestEmpty.getSlot(), Const.GLASS_CACHE_TYPE_IN); |
| | |
| | | .eq(GlassInfo::getThickness, glassInfo.getThickness()) |
| | | .eq(GlassInfo::getFilmsid, glassInfo.getFilmsid()) |
| | | .eq(GlassInfo::getFlowCardId, glassInfo.getFlowCardId()) |
| | | .ne(GlassInfo::getGlassId, glassInfo.getGlassId()) |
| | | .eq(GlassInfo::getTotalLayer, glassInfo.getTotalLayer()) |
| | | .eq(GlassInfo::getLayer, glassInfo.getLayer()) |
| | | .eq(GlassInfo::getEngineerId, glassInfo.getEngineerId()) |
| | |
| | | // 玻璃小片表中玻璃已经替换,更新卧理笼内现有的准备出笼的玻璃信息, |
| | | if (null == swapGlassDetailInfo) { |
| | | GlassInfo glassInfoBase = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>() |
| | | .eq(GlassInfo::getGlassId, swapGlassId)); |
| | | .eq(GlassInfo::getGlassId, glassId)); |
| | | //需要替换的玻璃为存进卧理,仅需更新当前需要出笼的玻璃信息即可 |
| | | edgStorageCageDetailsService.update(new LambdaUpdateWrapper<EdgStorageCageDetails>() |
| | | .eq(EdgStorageCageDetails::getGlassId, glassId) |
| | |
| | | //定义出片玻璃信息 |
| | | int endcell = 0; |
| | | EdgStorageCageDetails glassInfo = null; |
| | | |
| | | |
| | | boolean flag = queryMaxMinDiff(threshold); |
| | | log.info("1、获取钢化版图是否超过阈值:{}", flag); |
| | |
| | | damage.setType(1); |
| | | damage.setRemark("过卧式理片"); |
| | | damageService.insertDamage(damage); |
| | | damageService.deleteByGlassId(glassId); |
| | | return Boolean.TRUE; |
| | | } |
| | | return Boolean.FALSE; |
| | |
| | | edgGlassTaskInfo.setHeight((int) (glassInfo.getHeight() * ratio)); |
| | | edgGlassTaskInfo.setWidth((int) (glassInfo.getWidth() * ratio)); |
| | | edgGlassTaskInfo.setThickness((int) (glassInfo.getThickness() * ratio)); |
| | | edgGlassTaskInfo.setStatus(Const.EDG_GLASS_BEFORE); |
| | | edgGlassTaskInfo.setState(Const.EDG_GLASS_BEFORE); |
| | | edgGlassTaskInfo.setLine(endcell); |
| | | edgGlassTaskInfo.setTime(new Date()); |
| | | edgGlassTaskInfo.setCreateTime(new Date()); |
| | | edgGlassTaskInfo.setUpdateTime(new Date()); |
| | | //先将历史对列表中本玻璃的数据删除,重新新增一份最新的数据 |
| | | edgGlassTaskInfoService.remove(new LambdaQueryWrapper<EdgGlassTaskInfo>().eq(EdgGlassTaskInfo::getGlassId, glassInfo.getGlassId())); |
| | | return edgGlassTaskInfoService.save(edgGlassTaskInfo); |
| | |
| | | } |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void CacheGlassTasks() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | List<Map<String, Object>> currentCutTerritorys = edgStorageCageDetailsService.selectCutTerritory(); |
| | | jsonObject.append("currentCutTerritory", currentCutTerritorys); |
| | | //log.info("本次识别版图{},++++{}",engineerId,currentCutTerritorys); |
| | | //卧室缓存笼内信息 |
| | | List<Map<String, Object>> EdgStorageCageinfos = edgStorageCageService.selectEdgStorageCages(); |
| | | jsonObject.append("EdgStorageCageinfos", EdgStorageCageinfos); |
| | | |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("cacheGlass"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | if (webserver != null) { |
| | | webserver.sendMessage(jsonObject.toString()); |
| | | List<String> messages = webserver.getMessages(); |
| | | if (!messages.isEmpty()) { |
| | | // // 将最后一个消息转换为整数类型的列表 |
| | | webserver.clearMessages(); |
| | | } |
| | | } else { |
| | | log.info("Home is closed"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void cacheGlassIsRun() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | //正在进行的任务 |
| | | List<EdgGlassTaskInfo> taskCaches = edgGlassTaskInfoService.selectTaskCacheIsRun(); |
| | | jsonObject.append("taskCaches", taskCaches); |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("cacheGlassIsRun"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | if (webserver != null) { |
| | | webserver.sendMessage(jsonObject.toString()); |
| | | } else { |
| | | log.info("Home is closed"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void CacheGlassTaskss() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | //log.info("本次识别版图{},++++{}",engineerId,currentCutTerritorys); |
| | | //磨边信息 |
| | | List<EdgGlassTaskInfo> edgTasks = edgGlassTaskInfoService.selectEdgInfo(); |
| | | jsonObject.append("edgTasks", edgTasks); |
| | | |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("edgTasks"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | if (webserver != null) { |
| | | webserver.sendMessage(jsonObject.toString()); |
| | | List<String> messages = webserver.getMessages(); |
| | | if (!messages.isEmpty()) { |
| | | // // 将最后一个消息转换为整数类型的列表 |
| | | webserver.clearMessages(); |
| | | } |
| | | } else { |
| | | log.info("edgTasks is closed"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |