From 9a5ab9f2f92f798fe15d7bad13428d9ddace83f9 Mon Sep 17 00:00:00 2001 From: cl <418351270@qq.com> Date: 星期五, 19 七月 2024 09:08:04 +0800 Subject: [PATCH] 修改报工工位,及上传参数itemType --- jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java | 34 ++++++++++++++++++++++------------ 1 files changed, 22 insertions(+), 12 deletions(-) diff --git a/jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java b/jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java index d25e886..ef55561 100644 --- a/jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java +++ b/jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java @@ -163,7 +163,9 @@ String productType = productTypeObjcet.toString();//浜у搧绫诲瀷 String materialCode = Constants.materialMap.get(productType); //璋冪敤宸ュ巶MES锛屼繚瀛樺埌鏁版嵁搴�,骞朵笖灏嗗伐鍗曚紶缁橮LC - receivingWorkOrders(thoroughfare, device,materialCode); + CompletableFuture<Void> cp1 = CompletableFuture.runAsync(() -> { + receivingWorkOrders(thoroughfare, device,materialCode); + }); miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".RecordDataDone").value(11).build()); log.info("鍐欏叆鍒板伐浣峽}鐨凴ecordDataDone鏁版嵁锛歿}",device,11); }else{ @@ -219,9 +221,17 @@ result = savePassingStation(thoroughfare, device,cellCodeList);//淇濆瓨杩囩珯 if(result == 21) { + if(Constants.OP030.contains(device)){ + daTestDeviceInterfaceTempService.deleteDaTestDeviceInterfaceTempByProductNum(cellCode1); + daTestDeviceInterfaceTempService.deleteDaTestDeviceInterfaceTempByProductNum(cellCode2); + daTestDeviceInterfaceTempService.deleteDaTestDeviceInterfaceTempByProductNum(cellCode3); + daTestDeviceInterfaceTempService.deleteDaTestDeviceInterfaceTempByProductNum(cellCode4); + } result = saveParamCollection(device,cellCodeList);//淇濆瓨鍙傛暟锛屽彂閫佸伐鍘侻ES } + } + miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".RecordDataDone").value(result).build()); log.info("鍐欏叆鍒板伐浣峽}鐨凴ecordDataDone鏁版嵁锛歿}",device,result); } else if (Constants.OP100_OP150.contains(device)){//浜哄伐宸ヤ綅 @@ -257,7 +267,7 @@ } } - public void receivingWorkOrders(String thoroughfare ,String device ,String materialCode) + public synchronized void receivingWorkOrders(String thoroughfare ,String device ,String materialCode) { String paramProductNum = ""; try { @@ -498,9 +508,9 @@ //鎻掑叆鍙傛暟閲囬泦琛� daParamCollectionService.insertBatch(collectionList); - //濡傛灉220宸ヤ綅锛岃繘琛屾姤宸� + //濡傛灉220宸ヤ綅锛岃繘琛屾姤宸�,鍥犱负涓婂眰绯荤粺鍙敮鎸�6浣嶏紝鎵�鏈夋姤宸ュ伐浣嶄慨鏀逛负M1P220 if("M1OP220".equals(device)) { - getWorkReportResultFeedback(moduleCode, "M1OP220", format.format(new Date())); + getWorkReportResultFeedback(moduleCode, "M1P220", format.format(new Date())); } //涓婁紶鍒板伐鍘俶es @@ -819,7 +829,7 @@ if (ObjectUtil.isNotNull(value1)){ String cellCode = value1.toString(); List<DaTestDeviceInterfaceTemp> list = daTestDeviceInterfaceTempService.list(new LambdaQueryWrapper<DaTestDeviceInterfaceTemp>() - .eq(DaTestDeviceInterfaceTemp::getStationCode, "M1OP020") + //.eq(DaTestDeviceInterfaceTemp::getStationCode, "M1OP020") .eq(DaTestDeviceInterfaceTemp::getProductNum,cellCode)); if (CollUtil.isNotEmpty(list)){ DaTestDeviceInterfaceTemp daTestDeviceInterfaceTemp = list.get(list.size()-1); @@ -829,7 +839,7 @@ flag = false; miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".CellStatus_1").value(2).build()); } - daTestDeviceInterfaceTempService.deleteDaTestDeviceInterfaceTempByProductNum(cellCode); + //daTestDeviceInterfaceTempService.deleteDaTestDeviceInterfaceTempByProductNum(cellCode); }else { flag = false; miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".CellStatus_1").value(5).build()); @@ -844,7 +854,7 @@ if (ObjectUtil.isNotNull(value2)){ String cellCode = value2.toString(); List<DaTestDeviceInterfaceTemp> list = daTestDeviceInterfaceTempService.list(new LambdaQueryWrapper<DaTestDeviceInterfaceTemp>() - .eq(DaTestDeviceInterfaceTemp::getStationCode, device) + //.eq(DaTestDeviceInterfaceTemp::getStationCode, "M1OP020") .eq(DaTestDeviceInterfaceTemp::getProductNum,cellCode)); if (CollUtil.isNotEmpty(list)){ DaTestDeviceInterfaceTemp daTestDeviceInterfaceTemp = list.get(list.size()-1); @@ -854,7 +864,7 @@ flag = false; miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".CellStatus_2").value(2).build()); } - daTestDeviceInterfaceTempService.deleteDaTestDeviceInterfaceTempByProductNum(cellCode); + //daTestDeviceInterfaceTempService.deleteDaTestDeviceInterfaceTempByProductNum(cellCode); }else { flag = false; miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".CellStatus_2").value(5).build()); @@ -870,7 +880,7 @@ if (ObjectUtil.isNotNull(value3)){ String cellCode = value3.toString(); List<DaTestDeviceInterfaceTemp> list = daTestDeviceInterfaceTempService.list(new LambdaQueryWrapper<DaTestDeviceInterfaceTemp>() - .eq(DaTestDeviceInterfaceTemp::getStationCode, device) + //.eq(DaTestDeviceInterfaceTemp::getStationCode, "M1OP020") .eq(DaTestDeviceInterfaceTemp::getProductNum,cellCode)); if (CollUtil.isNotEmpty(list)){ DaTestDeviceInterfaceTemp daTestDeviceInterfaceTemp = list.get(list.size()-1); @@ -880,7 +890,7 @@ flag = false; miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".CellStatus_3").value(2).build()); } - daTestDeviceInterfaceTempService.deleteDaTestDeviceInterfaceTempByProductNum(cellCode); + //daTestDeviceInterfaceTempService.deleteDaTestDeviceInterfaceTempByProductNum(cellCode); }else { flag = false; miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".CellStatus_3").value(5).build()); @@ -896,7 +906,7 @@ if (ObjectUtil.isNotNull(value4)){ String cellCode = value4.toString(); List<DaTestDeviceInterfaceTemp> list = daTestDeviceInterfaceTempService.list(new LambdaQueryWrapper<DaTestDeviceInterfaceTemp>() - .eq(DaTestDeviceInterfaceTemp::getStationCode, device) + //.eq(DaTestDeviceInterfaceTemp::getStationCode, "M1OP020") .eq(DaTestDeviceInterfaceTemp::getProductNum,cellCode)); if (CollUtil.isNotEmpty(list)){ DaTestDeviceInterfaceTemp daTestDeviceInterfaceTemp = list.get(list.size()-1); @@ -906,7 +916,7 @@ flag = false; miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".CellStatus_4").value(2).build()); } - daTestDeviceInterfaceTempService.deleteDaTestDeviceInterfaceTempByProductNum(cellCode); + //daTestDeviceInterfaceTempService.deleteDaTestDeviceInterfaceTempByProductNum(cellCode); }else { flag = false; miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".CellStatus_4").value(5).build()); -- Gitblit v1.9.3