From e379948bb83ebcc9ce0c467a7b970f74bc00e9a1 Mon Sep 17 00:00:00 2001
From: long <418351270@qq.com>
Date: 星期六, 02 九月 2023 07:59:11 +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