| | |
| | | |
| | | String thoroughfare = Constants.thoroughfareMap.get(bsFormulaChildInfo.getProcessesCode());//获取通道 |
| | | String str = thoroughfare+"."+bsFormulaChildInfo.getProcessesCode()+".MESScrew"; |
| | | miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(str).value(stepNumber).build());//拧紧步骤 |
| | | if(bsFormulaChildInfo.getProcessesCode().equals("OP230")){ |
| | | //所有进站将进站时间写给PLC |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | |
| | | }else if(bsFormulaChildInfo.getProcessesCode().equals("OP220")){ |
| | | miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + bsFormulaChildInfo.getProcessesCode() + ".RecordDataDone").value(11).build()); |
| | | } |
| | | miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(str).value(stepNumber).build()); |
| | | |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | |
| | | Constants.materialMap.put("1","9900200461");//微卡电驱动系统总成(9999276636)//9900200461 |
| | | Constants.materialMap.put("2","9900207783");//微面电驱动系统总成(9999276639)//9900207783 |
| | | |
| | | Constants.materialMap.put("9900200461","9999276636");//生产物料转工厂物料请求工单 |
| | | Constants.materialMap.put("9900207783","9999276639");//生产物料转工厂物料请求工单 |
| | | Constants.facMaterialMap.put("9900200461","9999276636");//生产物料转工厂物料请求工单 |
| | | Constants.facMaterialMap.put("9900207783","9999276639");//生产物料转工厂物料请求工单 |
| | | |
| | | //通道 |
| | | Constants.thoroughfareMap.put(Constants.OP010,"JCDM035-1"); |
| | |
| | | if(Constants.OP230.equals(device)){ |
| | | CompletableFuture<Void> cp1 = CompletableFuture.runAsync(() -> { |
| | | updateOrderStatus(snCode, "5","");//OP230工位更新工单状态为已完成 |
| | | reportFactoryMes(snCode, device, format.format(new Date()));//工厂MES报工 |
| | | reportFactoryMes(snCode, "OP240", format.format(new Date()));//工厂MES报工 //暂时 OP240工位还没有好,在230报240的工 |
| | | }); |
| | | } |
| | | if(result == 21){ |
| | |
| | | // 查询最新的工单信息 |
| | | OmProductionOrdeInfo lastOrder = omProductionOrdeInfoService.getLastOrder(); |
| | | String facMaterialCode = Constants.facMaterialMap.get(materialCode); |
| | | log.info("请求工厂MES工单:入参device{},请求工厂物料编码facMaterialCode:{},产品物料编码{}MaterialCode", device, facMaterialCode,materialCode); |
| | | String orderJsonString = RestfulService.getProductionWorkOrderRequest(lastOrder.getProductNum(), "OP010",facMaterialCode); |
| | | log.info("请求工厂MES工单:入参device{},请求工厂物料编码facMaterialCode:{},产品物料编码MaterialCode{}", device, facMaterialCode,materialCode); |
| | | String orderJsonString = RestfulService.getProductionWorkOrderRequest(lastOrder.getProductNum(), device,facMaterialCode); |
| | | log.info("请求工厂MES工单:出参pack:{}", orderJsonString); |
| | | |
| | | JSONObject jsonObject = new JSONObject(orderJsonString); |