| | |
| | | import com.jcdm.main.da.passingStationCollection.domain.DaPassingStationCollection; |
| | | import com.jcdm.main.da.passingStationCollection.mapper.DaPassingStationCollectionMapper; |
| | | import com.jcdm.main.da.passingStationCollection.service.IDaPassingStationCollectionService; |
| | | import com.jcdm.main.om.productionOrde.service.IOmProductionOrdeInfoService; |
| | | import com.jcdm.main.plcserver.sub.OPCUaSubscription; |
| | | import com.jcdm.main.restful.factoryMes.service.RestfulService; |
| | | import com.jcdm.main.restful.qingYan.doman.ChildVO; |
| | |
| | | |
| | | @Autowired |
| | | private IDaParamCollectionTempService daParamCollectionTempService; |
| | | |
| | | @Autowired |
| | | private IOmProductionOrdeInfoService omProductionOrdeInfoService; |
| | | |
| | | public SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | |
| | |
| | | //给opc发21 |
| | | miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("PACK."+daParamCollection.getLocationCode()+".RecordDataDone").value(21).build()); |
| | | if(daParamCollection.getLocationCode().equals("OP240")){ |
| | | RestfulService.getWorkReportResultFeedback(daParamCollection.getProductBarcode(),"OP230",format.format(new Date())); |
| | | try{ |
| | | CompletableFuture<Void> cp1 = CompletableFuture.runAsync(() -> { |
| | | logger.info("OP230报工开始-工厂MES异步方法"); |
| | | String reportResult = RestfulService.getWorkReportResultFeedback(daParamCollection.getProductBarcode(), "OP230", format.format(new Date())); |
| | | if("".equals(reportResult)){ |
| | | //执行报工失败方法 |
| | | }else{ |
| | | //解析工厂mes返回结果,如果失败,执行报工失败方法,修改是否报工为2,添加报工时间 |
| | | |
| | | //如果成功,执行报工成功方法,修改是否报工为1,添加报工时间 |
| | | } |
| | | logger.info("OP230报工结束-工厂MES异步方法{}"+reportResult); |
| | | }); |
| | | }catch (Exception e){ |
| | | System.out.println(e.getMessage()); |
| | | } |
| | | // RestfulService.getWorkReportResultFeedback(daParamCollection.getProductBarcode(),"OP230",format.format(new Date())); |
| | | } |
| | | |
| | | |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | |
| | | HttpResponse execute = HttpRequest.post(url).body(JSONUtil.toJsonStr(parentVO)).execute(); |
| | | logger.info("异步方法执行结束"); |
| | | logger.info("手动工位传工厂MES异步方法{}"+execute.body()); |
| | | List<Long> idsList = paramList.stream().map(DaParamCollectionTemp::getId).collect(Collectors.toList()); |
| | | Long[] array = idsList.toArray(new Long[0]); |
| | | int i = daParamCollectionTempService.deleteDaParamCollectionTempByIds(array); |
| | | |
| | | DaParamCollectionTemp daParamCollectionTemp = new DaParamCollectionTemp(); |
| | | daParamCollectionTemp.setSfcCode(packID); |
| | | daParamCollectionTemp.setLocationCode(stationCode); |
| | | int i = daParamCollectionTempService.deleteDaParamCollectionTempBySfcCodeAndLocationCode(daParamCollectionTemp); |
| | | logger.info("删除临时表数据条数{}-工位{}-pack码{}",i,stationCode,packID); |
| | | // List<Long> idsList = paramList.stream().map(DaParamCollectionTemp::getId).collect(Collectors.toList()); |
| | | // Long[] array = idsList.toArray(new Long[0]); |
| | | // int i = daParamCollectionTempService.deleteDaParamCollectionTempByIds(array); |
| | | // logger.info("删除临时表数据条数{}-工位{}-pack码{}",i,stationCode,packID); |
| | | }); |
| | | }catch (Exception e){ |
| | | System.out.println(e.getMessage()); |