From f6789ac9f44a6b1f9d95421329bb1f0a7cd52d6d Mon Sep 17 00:00:00 2001 From: admin <15939171744@163.com> Date: 星期五, 07 三月 2025 18:37:11 +0800 Subject: [PATCH] -换型增加物料配置 --- jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java | 44 +++++++++++++++++++++++++------------------- 1 files changed, 25 insertions(+), 19 deletions(-) diff --git a/jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java b/jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java index 9da4f4a..799e25e 100644 --- a/jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java +++ b/jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java @@ -302,28 +302,37 @@ boolean save = daPassingStationCollectionService.save(daPassingStationCollection); //娣诲姞鍩虹鍙傛暟 - this.manualWorkstationsAddBasicParameters(daParamCollection); +// this.manualWorkstationsAddBasicParameters(daParamCollection); //鍗婅嚜鍔ㄥ伐浣嶏紝鍏堝皢鑷姩鏁版嵁淇濆瓨鍒版暟鎹簱 this.saveParameters(daParamCollection); //缁檕pc鍙�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{ + //鏇存柊宸ュ崟鐘舵�佷负宸叉墽琛� + LambdaUpdateWrapper<OmProductionOrdeInfo> updateWrapper = new LambdaUpdateWrapper<>(); + updateWrapper.set(OmProductionOrdeInfo::getOrderStatus,"3"); + updateWrapper.eq(OmProductionOrdeInfo::getProductNum,daParamCollection.getProductBarcode()); + omProductionOrdeInfoService.update(new OmProductionOrdeInfo(),updateWrapper); + + //涓婁紶宸ュ巶MES鎶ュ伐 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 stationCode = "M1P100";//鍥犱负涓婂眰绯荤粺鍙敮鎸�6浣嶏紝鎵�鏈夋姤宸ュ伐浣嶄负M1P100 + //String reportResult = RestfulService.getWorkReportResultFeedback(daParamCollection.getProductBarcode(), stationCode, format.format(new Date())); + String reportResult = OPCUaSubscription.getWorkReportResultFeedback(daParamCollection.getProductBarcode(), stationCode, 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{ //瑙f瀽宸ュ巶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()); @@ -341,11 +350,13 @@ //鍗婅嚜鍔ㄥ伐浣嶏紝鍏堝皢鑷姩鏁版嵁淇濆瓨鍒版暟鎹簱 public void saveParameters(DaParamCollection daParamCollection) { + OmProductionOrdeInfo omProductionOrdeInfo = omProductionOrdeInfoService.selectOrderByProductNum(daParamCollection.getProductBarcode()); //娣诲姞鑷姩宸ヤ綅鍙傛暟鏁版嵁 //鏌ヨ鍙傛暟閰嶇疆琛� List<DaCollectionParamConf> list = daCollectionParamConfService.list(new LambdaQueryWrapper<DaCollectionParamConf>() .eq(DaCollectionParamConf::getProcessesCode, daParamCollection.getLocationCode())//宸ヤ綅 .eq(DaCollectionParamConf::getWhetherToCollect, Constants.ONE)//鏄惁閲囬泦 + .eq(DaCollectionParamConf::getProductModel,omProductionOrdeInfo.getProductModel()) );//绫诲瀷 List<String> collectAddressList = list.stream() @@ -536,8 +547,6 @@ public void pushGeelycvMesFeedback(String packID, String stationCode) { logger.info("杩涘叆浜哄伐宸ヤ綅鎺ㄩ�佸伐鍘侻ES鏁版嵁鏂规硶-pushGeelycvMesFeedback-宸ヤ綅{}-pack鐮亄}",stationCode,packID); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String url = "https://imes-uat-group.geelycv-test.com/api/mom-open/restful/aMesSysIntegration/deviceResultFeedback"; -// String url = "https://imes-group.geelycv.com/api/mom-open/restful/aMesSysIntegration/deviceResultFeedback"; String totalResult = "0"; List<DaParamCollectionTemp> paramList = daParamCollectionTempService.list(new LambdaQueryWrapper<DaParamCollectionTemp>().eq(DaParamCollectionTemp::getSfcCode, packID).eq(DaParamCollectionTemp::getLocationCode, stationCode)); if(paramList.size() > 0){ @@ -567,7 +576,7 @@ // childVO.setItemType("3"); // } if(paramConfOne!=null){ - childVO.setItemType(paramConfOne.getSpareField1()); + childVO.setItemType(paramConfOne.getItemType()); childVO.setItemText(paramConfOne.getCollectParameterName()); }else { childVO.setItemType("3"); @@ -591,10 +600,9 @@ parentVO.setCheckList(listChildVo); try{ CompletableFuture<Void> cp1 = CompletableFuture.runAsync(() -> { - logger.info("寮�濮嬫墽琛屽紓姝ユ柟娉�"); - HttpResponse execute = HttpRequest.post(url).body(JSONUtil.toJsonStr(parentVO)).execute(); - logger.info("寮傛鏂规硶鎵ц缁撴潫"); - logger.info("鎵嬪姩宸ヤ綅浼犲伐鍘侻ES寮傛鏂规硶{}"+execute.body()); + logger.info("鎵嬪姩宸ヤ綅浼犲伐鍘侻ES寮傛鏂规硶start,宸ヤ綅鍙穥}锛屽叆鍙倇}",stationCode,parentVO.toString()); + HttpResponse execute = HttpRequest.post(Constants.FACTORY_EMS_UAT_GET_RUL+"deviceResultFeedback").body(JSONUtil.toJsonStr(parentVO)).execute(); + logger.info("鎵嬪姩宸ヤ綅浼犲伐鍘侻ES寮傛鏂规硶end宸ヤ綅鍙穥}锛屽嚭鍙倇}",stationCode,execute.body()); DaParamCollectionTemp daParamCollectionTemp = new DaParamCollectionTemp(); daParamCollectionTemp.setSfcCode(packID); @@ -622,14 +630,12 @@ public void automaticWorkstationPushGeelycvMesFeedback(String packID, String stationCode,List<DaParamCollection> paramList) { logger.info("杩涘叆宸ヤ綅{}-宸ュ巶MES鎺ㄩ�佹暟鎹柟娉昦utomaticWorkstationPushGeelycvMesFeedback",stationCode); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); -// String url = "https://imes-uat-group.geelycv-test.com/api/mom-open/restful/aMesSysIntegration/deviceResultFeedback"; - String url = "https://imes-group.geelycv.com/api/mom-open/restful/aMesSysIntegration/deviceResultFeedback"; String totalResult = "0"; - if(paramList.size() > 0){ + if(!paramList.isEmpty()){ logger.info("杩涘叆宸ヤ綅{}-鎷兼暟鎹�",stationCode); ParentVO parentVO = new ParentVO(); parentVO.setSiteCode("3983"); - parentVO.setRecordId(String.valueOf(Instant.now().toEpochMilli())); + parentVO.setRecordId(UUID.randomUUID().toString()); parentVO.setStationCode(stationCode); parentVO.setProductNum(packID); parentVO.setTotalResult("1"); @@ -679,7 +685,7 @@ try{ CompletableFuture<Void> cp1 = CompletableFuture.runAsync(() -> { logger.info("寮�濮嬫墽琛屽紓姝ユ柟娉�"); - HttpResponse execute = HttpRequest.post(url).body(JSONUtil.toJsonStr(parentVO)).execute(); + HttpResponse execute = HttpRequest.post(Constants.FACTORY_EMS_UAT_GET_RUL+"deviceResultFeedback").body(JSONUtil.toJsonStr(parentVO)).execute(); System.out.println(execute.body()); logger.info("寮傛鏂规硶鎵ц缁撴潫"); logger.info("鑷姩宸ヤ綅浼犲伐鍘侻ES寮傛鏂规硶{}"+execute.body()); -- Gitblit v1.9.3