From 7f291910791bdb9a545dc12ef36c3c359cfa4e59 Mon Sep 17 00:00:00 2001 From: admin <418351270@qq.com> Date: 星期三, 10 一月 2024 15:03:23 +0800 Subject: [PATCH] 添加查询 --- guns-vip-main/src/main/java/cn/stylefeng/guns/plcserver/opc/unit/SFCCodeTool.java | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/guns-vip-main/src/main/java/cn/stylefeng/guns/plcserver/opc/unit/SFCCodeTool.java b/guns-vip-main/src/main/java/cn/stylefeng/guns/plcserver/opc/unit/SFCCodeTool.java index c97a27f..f60f5c9 100644 --- a/guns-vip-main/src/main/java/cn/stylefeng/guns/plcserver/opc/unit/SFCCodeTool.java +++ b/guns-vip-main/src/main/java/cn/stylefeng/guns/plcserver/opc/unit/SFCCodeTool.java @@ -11,10 +11,9 @@ public static String productCompanyCode = ""; //浜у搧鍏徃缂栫爜 public static String RunningWaterNumber = "0000"; //娴佹按鍙� public static String SerialNumbers = "0000"; //搴忓垪鍙� - public static Calendar calendar = Calendar.getInstance(); - public static String Years = String.valueOf(calendar.get(Calendar.YEAR)); //骞翠唤 + /* public static String Years = String.valueOf(calendar.get(Calendar.YEAR)); //骞翠唤 public static String Months = StringUtils.leftPad(String.valueOf(calendar.get(Calendar.MONTH) + 1),2, "0"); //鏈堜唤 - public static String Dates = StringUtils.leftPad(String.valueOf(calendar.get(Calendar.DATE)),2, "0"); //鏃ユ湡 + public static String Dates = StringUtils.leftPad(String.valueOf(calendar.get(Calendar.DATE)),2, "0"); //鏃ユ湡*/ //澶撮儴鎷兼帴 @@ -27,7 +26,9 @@ public static String TAIL_STRING = "";//灏鹃儴鎷兼帴 - + public static void main(String[] args){ + createCodingRulesSFC("1","1","1"); + } /** * 鍗曚綋缂栧彿杩芥函 * @param softwareVersionCode 杞欢鐗堟湰缂栫爜(鍨嬪彿+鎵煩+宸紓娆�+鍥藉鍦板尯+杞欢鐗堟湰) @@ -37,7 +38,10 @@ */ public static String createCodingRulesSFC(String softwareVersionCode,String productCompanyCode,String serialNumbers){ - + Calendar calendar = Calendar.getInstance(); + String Years = String.valueOf(calendar.get(Calendar.YEAR)); //骞翠唤 + String Months = StringUtils.leftPad(String.valueOf(calendar.get(Calendar.MONTH) + 1),2, "0"); //鏈堜唤 + String Dates = StringUtils.leftPad(String.valueOf(calendar.get(Calendar.DATE)),2, "0"); //鏃ユ湡 StringBuffer result = new StringBuffer(); String headString = ""; -- Gitblit v1.9.3