From e0fac38b26845f25de479783e0c76cf12a5311e0 Mon Sep 17 00:00:00 2001 From: cl <418351270@qq.com> Date: 星期五, 19 一月 2024 10:31:28 +0800 Subject: [PATCH] 修改数据采集 --- guns-vip-main/src/main/java/cn/stylefeng/guns/plcserver/server/OP050/impl/OP050ServerInterfaceImpl.java | 38 ++++++++++++-------------------------- 1 files changed, 12 insertions(+), 26 deletions(-) diff --git a/guns-vip-main/src/main/java/cn/stylefeng/guns/plcserver/server/OP050/impl/OP050ServerInterfaceImpl.java b/guns-vip-main/src/main/java/cn/stylefeng/guns/plcserver/server/OP050/impl/OP050ServerInterfaceImpl.java index ec7996e..9c6aeee 100644 --- a/guns-vip-main/src/main/java/cn/stylefeng/guns/plcserver/server/OP050/impl/OP050ServerInterfaceImpl.java +++ b/guns-vip-main/src/main/java/cn/stylefeng/guns/plcserver/server/OP050/impl/OP050ServerInterfaceImpl.java @@ -85,8 +85,8 @@ String ecpStr = "";//寮傚父璁板綍鏍囪 try{ - String isHeartBeat = OPCUnit.read(opc.getOP050_F_HEART_BEAT()); - setHeartbeat(isHeartBeat); + /* String isHeartBeat = OPCUnit.read(opc.getOP050_F_HEART_BEAT()); + setHeartbeat(isHeartBeat);*/ if(GlobalVariable.OP050_F_HEART_BEAT) { //PC璇诲伐鍗� @@ -104,9 +104,15 @@ if(isPLCFinish.equals("true")){ String isFinish = OPCUnit.read(opc.getOP050_J_PC_FINISH());//PC鎿嶄綔瀹屾垚 if(isFinish.equals("false")){ - handleMaterial(); - handleInfo(); + logger.info("handleFinsh寮�濮嬫椂闂�:"+new Date()); handleFinsh(); + logger.info("handleFinsh瀹屾垚鏃堕棿:"+new Date()); + logger.info("handleInfo寮�濮嬫椂闂�:"+new Date()); + handleInfo(); + logger.info("handleInfo瀹屾垚鏃堕棿:"+new Date()); + logger.info("handleMaterial寮�濮嬫椂闂�:"+new Date()); + handleMaterial(); + logger.info("handleMaterial瀹屾垚鏃堕棿:"+new Date()); } } @@ -165,13 +171,7 @@ } public void handleMaterial() { - if("".equals(S_ORDER_CODE)){ - IN_TIME = DateTool.getLocalTimeForDate(); - S_ORDER_CODE = OPCUnit.read(opc.getOP050_S_ORDER_CODE());//宸ュ崟缂栧彿 - S_PRODUCT_TYPE = OPCUnit.read(opc.getOP050_S_PRODUCT_CODE());//浜у搧缂栧彿 - S_PRODUCT_CODE = GlobalVariable.PRODUCT_CODE_MAP.get(S_PRODUCT_TYPE); - S_SFC_CODE = OPCUnit.read(opc.getOP050_S_SFC_CODE());//鎬绘垚缂栫爜 - } + //鏌ヨ鎵规涓婃枡淇℃伅 ProductionOrderBatchInfoParam productionOrderBatchInfoParam = new ProductionOrderBatchInfoParam(); productionOrderBatchInfoParam.setWorkOrderNo(S_ORDER_CODE); @@ -181,22 +181,8 @@ for(int i=0;i<list1.size();i++){ ProductionOrderBatchInfoResult productionOrderBatchInfoResult = list1.get(i); - //鍒ゆ柇鏄惁鏈夎宸ヤ綅 - String[] locationCodes = productionOrderBatchInfoResult.getLocationCode().split("/"); - logger.info("褰撳墠宸ヤ綅锛�"+locationCodes.toString()); - boolean isLocationCode = false; - if(locationCodes.length>0) - { - for (int j=0;j<locationCodes.length;j++){ - String location = locationCodes[j]; - if(location.equals(LOCATION_CODE)){ - isLocationCode = true; - } - } - } - int remainingQuantity = productionOrderBatchInfoResult.getResidueQuantity();//鍓╀綑鏁伴噺 - if(remainingQuantity>0 && isLocationCode){ + if(remainingQuantity>0){ //鏂板鐗╂枡杩芥函 MaterialTraceabilityParam materialTraceabilityParam = new MaterialTraceabilityParam(); materialTraceabilityParam.setWorkOrderNo(S_ORDER_CODE); -- Gitblit v1.9.3