From b42c5d59290b005f8cb386d76988515be8acb002 Mon Sep 17 00:00:00 2001 From: cl <418351270@qq.com> Date: 星期五, 16 八月 2024 10:46:59 +0800 Subject: [PATCH] 修改1P1S --- jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java | 9 +++++++-- 1 files changed, 7 insertions(+), 2 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 3852bd2..fa3ab56 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 @@ -1127,12 +1127,17 @@ String batteryTypeCode = list.get(0).getBatteryTypeCode();//鐢垫睜绫诲瀷浠g爜 String specificationsCode = list.get(0).getSpecificationsCode();//瑙勬牸浠g爜 String traceInfoCode = list.get(0).getTraceInfoCode();//杩芥函淇℃伅浠g爜 - + String oldDateCode = list.get(0).getProDateCode(); String proDateCode = Constants.YEARSMAP.get(now.getYear()) + Constants.MONTHSMAP.get(now.getMonthValue()) + Constants.DAYMAP.get(now.getDayOfMonth());//鐢熶骇鏃ユ湡 - String code = list.get(0).getSfcCode();//搴忓垪鍙� + String code = ""; + if(oldDateCode.equals(proDateCode)){ + code = list.get(0).getSfcCode();//搴忓垪鍙� + }else { + code = "0"; + } code = StringUtils.leftPad(String.valueOf(Integer.valueOf(code)+1),7, "0");;//搴忓垪鍙� result = mfCode+proTypeCode+batteryTypeCode+specificationsCode+traceInfoCode+proDateCode+code; -- Gitblit v1.9.3