From 51ec98113c6d49d0f7eec4e3c030e55e337e97db Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期一, 26 五月 2025 15:47:16 +0800
Subject: [PATCH] 芯导软件(江苏)有限公司  delete

---
 framework/src/main/java/com/yuanchu/mom/utils/GiveCode.java |   22 +++++++++++++++++-----
 1 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/framework/src/main/java/com/yuanchu/mom/utils/GiveCode.java b/framework/src/main/java/com/yuanchu/mom/utils/GiveCode.java
index 4f60117..d539429 100644
--- a/framework/src/main/java/com/yuanchu/mom/utils/GiveCode.java
+++ b/framework/src/main/java/com/yuanchu/mom/utils/GiveCode.java
@@ -13,14 +13,26 @@
     @Resource
     private SystemLogMapper systemLogMapper;
 
-    public String giveCode(String code, String tableName, String symbol, String patten){
+    public String giveCode(String code, String tableName, String symbol, String patten) {
         String date = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd"));
         String date2 = LocalDate.now().format(DateTimeFormatter.ofPattern(patten));
-        int num = systemLogMapper.countRowsByNow(tableName, LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))) + 1;
+        int num;
+        num = systemLogMapper.countRowsByNow(tableName, LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))) + 1;
         String nums = num + "";
-        if(nums.length() == 1) nums = "00" + num;
-        else if(nums.length() == 2) nums = "0" + num;
-        return code + (date2==null?date:date2) + symbol + nums;
+        if (nums.length() == 1) nums = "00" + num;
+        else if (nums.length() == 2) nums = "0" + num;
+        return code + (date2 == null ? date : date2) + symbol + nums;
     }
 
+    //妫�楠屽崟濮旀墭鍗曞彿鐨勭敓鎴愯鍒�
+    public String giveCode2(String code, String tableName, String symbol, String patten) {
+        String date = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd"));
+        String date2 = LocalDate.now().format(DateTimeFormatter.ofPattern(patten));
+        int num;
+        num = systemLogMapper.countRowsByNow2(tableName, LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))) + 1;
+        String nums = num + "";
+        if (nums.length() == 1) nums = "00" + num;
+        else if (nums.length() == 2) nums = "0" + num;
+        return code + (date2 == null ? date : date2) + symbol + nums;
+    }
 }

--
Gitblit v1.9.3