| | |
| | | |
| | | //给opc发21 |
| | | miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("MOZU1."+daParamCollection.getLocationCode()+".RecordDataDone").value(21).build()); |
| | | if(daParamCollection.getLocationCode().equals("OP240")){ |
| | | if(daParamCollection.getLocationCode().equals("M1OP100-1") || daParamCollection.getLocationCode().equals("M1OP100-2") ){ |
| | | try{ |
| | | CompletableFuture<Void> cp1 = CompletableFuture.runAsync(() -> { |
| | | logger.info("OP230报工开始-工厂MES异步方法"); |
| | | String reportResult = RestfulService.getWorkReportResultFeedback(daParamCollection.getProductBarcode(), "OP230", format.format(new Date())); |
| | | logger.info("OP100报工开始-工厂MES异步方法"); |
| | | String reportResult = RestfulService.getWorkReportResultFeedback(daParamCollection.getProductBarcode(), daParamCollection.getLocationCode(), format.format(new Date())); |
| | | JSONObject jsonObject = new JSONObject(reportResult); |
| | | String code = jsonObject.getStr("code"); |
| | | if("success".equals(code)){ |
| | | //如果成功,执行报工成功方法,修改是否报工为1,添加报工时间 |
| | | omProductionOrdeInfoService.updateOrderByProductNum("1",daParamCollection.getProductBarcode(),"OP230"); |
| | | omProductionOrdeInfoService.updateOrderByProductNum("1",daParamCollection.getProductBarcode(),daParamCollection.getLocationCode()); |
| | | }else{ |
| | | //解析工厂mes返回结果,如果失败,执行报工失败方法,修改是否报工为2,添加报工时间 |
| | | omProductionOrdeInfoService.updateOrderByProductNum("2",daParamCollection.getProductBarcode(),"OP230"); |
| | | omProductionOrdeInfoService.updateOrderByProductNum("2",daParamCollection.getProductBarcode(),daParamCollection.getLocationCode()); |
| | | } |
| | | logger.info("OP230报工结束-工厂MES异步方法{}"+reportResult); |
| | | logger.info("OP100报工结束-工厂MES异步方法{}"+reportResult); |
| | | }); |
| | | }catch (Exception e){ |
| | | System.out.println(e.getMessage()); |