From 7d5eb314b9cd5b5e19aa851b63b66aad5bf59d04 Mon Sep 17 00:00:00 2001 From: liyj <1003249715@qq.com> Date: Thu, 05 Sep 2024 20:01:25 +0800 Subject: [PATCH] 1、utils服务优化 --- dyh-service/dyh-utils/src/main/java/cn/huge/module/disp/utils/DispIdUtils.java | 20 +++++----- dyh-service/dyh-utils/src/main/java/cn/huge/module/mediate/utils/JudicIdUtils.java | 18 ++++---- dyh-service/dyh-utils/src/main/java/cn/huge/module/mediate/utils/CaseIdUtils.java | 18 ++++---- dyh-service/dyh-utils/src/main/java/cn/huge/module/sys/utils/SysIdUtils.java | 18 ++++---- dyh-service/dyh-utils/src/main/java/cn/huge/module/mediate/utils/MediateIdUtils.java | 18 ++++---- dyh-service/dyh-utils/src/main/java/cn/huge/module/cust/utils/CustIdUtils.java | 18 ++++---- dyh-service/dyh-utils/src/main/java/cn/huge/module/mediate/utils/CaseRefUtils.java | 2 dyh-service/dyh-utils/src/main/java/cn/huge/module/disp/controller/client/DispUtilsController.java | 4 +- 8 files changed, 58 insertions(+), 58 deletions(-) diff --git a/dyh-service/dyh-utils/src/main/java/cn/huge/module/cust/utils/CustIdUtils.java b/dyh-service/dyh-utils/src/main/java/cn/huge/module/cust/utils/CustIdUtils.java index afbb2f2..0a52fd2 100644 --- a/dyh-service/dyh-utils/src/main/java/cn/huge/module/cust/utils/CustIdUtils.java +++ b/dyh-service/dyh-utils/src/main/java/cn/huge/module/cust/utils/CustIdUtils.java @@ -16,17 +16,17 @@ /** * 时间Id统计常量 */ - private static int COUNT_NUM = 10000; + private static int COUNT_NUM = 1000; /** * 时间Id统计常量,常量前缀 */ - private static int SIGN_COUNT_NUM = 10000; + private static int SIGN_COUNT_NUM = 1000; /** * 时间Id统计常量,常量后缀 */ - private static int COUNT_NUM_SIGN = 10000; + private static int COUNT_NUM_SIGN = 1000; /** * 获取时间Id,后四位常量 @@ -34,8 +34,8 @@ */ public synchronized static String getNewTimeId(){ String timeId = getNowTime() + (COUNT_NUM++); - if(COUNT_NUM > 99999){ - COUNT_NUM = 10000; + if(COUNT_NUM > 9999){ + COUNT_NUM = 1000; } timeId=timeId.substring(2, timeId.length()); return timeId; @@ -48,8 +48,8 @@ */ public synchronized static String getSignNewTimeId(String sign){ String timeId = getNowTime() + sign + (SIGN_COUNT_NUM++); - if(SIGN_COUNT_NUM > 99999){ - SIGN_COUNT_NUM = 10000; + if(SIGN_COUNT_NUM > 9999){ + SIGN_COUNT_NUM = 1000; } timeId=timeId.substring(2, timeId.length()); return timeId; @@ -62,8 +62,8 @@ */ public synchronized static String getNewTimeIdSign(String sign){ String timeId = getNowTime() + (COUNT_NUM_SIGN++) + sign; - if(COUNT_NUM_SIGN > 99999){ - COUNT_NUM_SIGN = 10000; + if(COUNT_NUM_SIGN > 9999){ + COUNT_NUM_SIGN = 1000; } timeId=timeId.substring(2, timeId.length()); return timeId; diff --git a/dyh-service/dyh-utils/src/main/java/cn/huge/module/casedisp/controller/client/DispUtilsController.java b/dyh-service/dyh-utils/src/main/java/cn/huge/module/disp/controller/client/DispUtilsController.java similarity index 92% rename from dyh-service/dyh-utils/src/main/java/cn/huge/module/casedisp/controller/client/DispUtilsController.java rename to dyh-service/dyh-utils/src/main/java/cn/huge/module/disp/controller/client/DispUtilsController.java index 3d58024..3f421c0 100644 --- a/dyh-service/dyh-utils/src/main/java/cn/huge/module/casedisp/controller/client/DispUtilsController.java +++ b/dyh-service/dyh-utils/src/main/java/cn/huge/module/disp/controller/client/DispUtilsController.java @@ -1,8 +1,8 @@ -package cn.huge.module.casedisp.controller.client; +package cn.huge.module.disp.controller.client; import cn.huge.base.common.utils.ReturnFailUtils; import cn.huge.base.common.utils.ReturnSucUtils; -import cn.huge.module.casedisp.utils.DispIdUtils; +import cn.huge.module.disp.utils.DispIdUtils; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; diff --git a/dyh-service/dyh-utils/src/main/java/cn/huge/module/casedisp/utils/DispIdUtils.java b/dyh-service/dyh-utils/src/main/java/cn/huge/module/disp/utils/DispIdUtils.java similarity index 87% rename from dyh-service/dyh-utils/src/main/java/cn/huge/module/casedisp/utils/DispIdUtils.java rename to dyh-service/dyh-utils/src/main/java/cn/huge/module/disp/utils/DispIdUtils.java index ea7e97d..aa7b99b 100644 --- a/dyh-service/dyh-utils/src/main/java/cn/huge/module/casedisp/utils/DispIdUtils.java +++ b/dyh-service/dyh-utils/src/main/java/cn/huge/module/disp/utils/DispIdUtils.java @@ -1,4 +1,4 @@ -package cn.huge.module.casedisp.utils; +package cn.huge.module.disp.utils; import java.text.SimpleDateFormat; import java.util.Date; @@ -16,17 +16,17 @@ /** * 时间Id统计常量 */ - private static int COUNT_NUM = 10000; + private static int COUNT_NUM = 1000; /** * 时间Id统计常量,常量前缀 */ - private static int SIGN_COUNT_NUM = 10000; + private static int SIGN_COUNT_NUM = 1000; /** * 时间Id统计常量,常量后缀 */ - private static int COUNT_NUM_SIGN = 10000; + private static int COUNT_NUM_SIGN = 1000; /** * 获取时间Id,后四位常量 @@ -34,8 +34,8 @@ */ public synchronized static String getNewTimeId(){ String timeId = getNowTime() + (COUNT_NUM++); - if(COUNT_NUM > 99999){ - COUNT_NUM = 10000; + if(COUNT_NUM > 9999){ + COUNT_NUM = 1000; } timeId=timeId.substring(2, timeId.length()); return timeId; @@ -48,8 +48,8 @@ */ public synchronized static String getSignNewTimeId(String sign){ String timeId = getNowTime() + sign + (SIGN_COUNT_NUM++); - if(SIGN_COUNT_NUM > 99999){ - SIGN_COUNT_NUM = 10000; + if(SIGN_COUNT_NUM > 9999){ + SIGN_COUNT_NUM = 1000; } timeId=timeId.substring(2, timeId.length()); return timeId; @@ -62,8 +62,8 @@ */ public synchronized static String getNewTimeIdSign(String sign){ String timeId = getNowTime() + (COUNT_NUM_SIGN++) + sign; - if(COUNT_NUM_SIGN > 99999){ - COUNT_NUM_SIGN = 10000; + if(COUNT_NUM_SIGN > 9999){ + COUNT_NUM_SIGN = 1000; } timeId=timeId.substring(2, timeId.length()); return timeId; diff --git a/dyh-service/dyh-utils/src/main/java/cn/huge/module/mediate/utils/CaseIdUtils.java b/dyh-service/dyh-utils/src/main/java/cn/huge/module/mediate/utils/CaseIdUtils.java index 8fa2ab7..35be9c8 100644 --- a/dyh-service/dyh-utils/src/main/java/cn/huge/module/mediate/utils/CaseIdUtils.java +++ b/dyh-service/dyh-utils/src/main/java/cn/huge/module/mediate/utils/CaseIdUtils.java @@ -21,17 +21,17 @@ /** * 时间Id统计常量 */ - private static int COUNT_NUM = 10000; + private static int COUNT_NUM = 1000; /** * 时间Id统计常量,常量前缀 */ - private static int SIGN_COUNT_NUM = 10000; + private static int SIGN_COUNT_NUM = 1000; /** * 时间Id统计常量,常量后缀 */ - private static int COUNT_NUM_SIGN = 10000; + private static int COUNT_NUM_SIGN = 1000; /** * 获取时间Id,后四位常量 @@ -39,8 +39,8 @@ */ public synchronized static String getNewTimeId(){ String timeId = getNowTime() + (COUNT_NUM++); - if(COUNT_NUM > 99999){ - COUNT_NUM = 10000; + if(COUNT_NUM > 9999){ + COUNT_NUM = 1000; } timeId=timeId.substring(2, timeId.length()); return timeId; @@ -53,8 +53,8 @@ */ public synchronized static String getSignNewTimeId(String sign){ String timeId = getNowTime() + sign + (SIGN_COUNT_NUM++); - if(SIGN_COUNT_NUM > 99999){ - SIGN_COUNT_NUM = 10000; + if(SIGN_COUNT_NUM > 9999){ + SIGN_COUNT_NUM = 1000; } timeId=timeId.substring(2, timeId.length()); return timeId; @@ -67,8 +67,8 @@ */ public synchronized static String getNewTimeIdSign(String sign){ String timeId = getNowTime() + (COUNT_NUM_SIGN++) + sign; - if(COUNT_NUM_SIGN > 99999){ - COUNT_NUM_SIGN = 10000; + if(COUNT_NUM_SIGN > 9999){ + COUNT_NUM_SIGN = 1000; } timeId=timeId.substring(2, timeId.length()); return timeId; diff --git a/dyh-service/dyh-utils/src/main/java/cn/huge/module/mediate/utils/CaseRefUtils.java b/dyh-service/dyh-utils/src/main/java/cn/huge/module/mediate/utils/CaseRefUtils.java index 26c3f93..1920325 100644 --- a/dyh-service/dyh-utils/src/main/java/cn/huge/module/mediate/utils/CaseRefUtils.java +++ b/dyh-service/dyh-utils/src/main/java/cn/huge/module/mediate/utils/CaseRefUtils.java @@ -50,7 +50,7 @@ * @return String */ public synchronized static String getNowTime(){ - SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss"); + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); String nowTime = sdf.format(new Date()); return nowTime; } diff --git a/dyh-service/dyh-utils/src/main/java/cn/huge/module/mediate/utils/JudicIdUtils.java b/dyh-service/dyh-utils/src/main/java/cn/huge/module/mediate/utils/JudicIdUtils.java index 5fa163d..d01ee30 100644 --- a/dyh-service/dyh-utils/src/main/java/cn/huge/module/mediate/utils/JudicIdUtils.java +++ b/dyh-service/dyh-utils/src/main/java/cn/huge/module/mediate/utils/JudicIdUtils.java @@ -16,17 +16,17 @@ /** * 时间Id统计常量 */ - private static int COUNT_NUM = 10000; + private static int COUNT_NUM = 1000; /** * 时间Id统计常量,常量前缀 */ - private static int SIGN_COUNT_NUM = 10000; + private static int SIGN_COUNT_NUM = 1000; /** * 时间Id统计常量,常量后缀 */ - private static int COUNT_NUM_SIGN = 10000; + private static int COUNT_NUM_SIGN = 1000; /** * 获取时间Id,后四位常量 @@ -34,8 +34,8 @@ */ public synchronized static String getNewTimeId(){ String timeId = getNowTime() + (COUNT_NUM++); - if(COUNT_NUM > 99999){ - COUNT_NUM = 10000; + if(COUNT_NUM > 9999){ + COUNT_NUM = 1000; } timeId=timeId.substring(2, timeId.length()); return timeId; @@ -48,8 +48,8 @@ */ public synchronized static String getSignNewTimeId(String sign){ String timeId = getNowTime() + sign + (SIGN_COUNT_NUM++); - if(SIGN_COUNT_NUM > 99999){ - SIGN_COUNT_NUM = 10000; + if(SIGN_COUNT_NUM > 9999){ + SIGN_COUNT_NUM = 1000; } timeId=timeId.substring(2, timeId.length()); return timeId; @@ -62,8 +62,8 @@ */ public synchronized static String getNewTimeIdSign(String sign){ String timeId = getNowTime() + (COUNT_NUM_SIGN++) + sign; - if(COUNT_NUM_SIGN > 99999){ - COUNT_NUM_SIGN = 10000; + if(COUNT_NUM_SIGN > 9999){ + COUNT_NUM_SIGN = 1000; } timeId=timeId.substring(2, timeId.length()); return timeId; diff --git a/dyh-service/dyh-utils/src/main/java/cn/huge/module/mediate/utils/MediateIdUtils.java b/dyh-service/dyh-utils/src/main/java/cn/huge/module/mediate/utils/MediateIdUtils.java index 8860317..ecbf603 100644 --- a/dyh-service/dyh-utils/src/main/java/cn/huge/module/mediate/utils/MediateIdUtils.java +++ b/dyh-service/dyh-utils/src/main/java/cn/huge/module/mediate/utils/MediateIdUtils.java @@ -16,17 +16,17 @@ /** * 时间Id统计常量 */ - private static int COUNT_NUM = 10000; + private static int COUNT_NUM = 1000; /** * 时间Id统计常量,常量前缀 */ - private static int SIGN_COUNT_NUM = 10000; + private static int SIGN_COUNT_NUM = 1000; /** * 时间Id统计常量,常量后缀 */ - private static int COUNT_NUM_SIGN = 10000; + private static int COUNT_NUM_SIGN = 1000; /** * 获取时间Id,后四位常量 @@ -34,8 +34,8 @@ */ public synchronized static String getNewTimeId(){ String timeId = getNowTime() + (COUNT_NUM++); - if(COUNT_NUM > 99999){ - COUNT_NUM = 10000; + if(COUNT_NUM > 9999){ + COUNT_NUM = 1000; } timeId=timeId.substring(2, timeId.length()); return timeId; @@ -48,8 +48,8 @@ */ public synchronized static String getSignNewTimeId(String sign){ String timeId = getNowTime() + sign + (SIGN_COUNT_NUM++); - if(SIGN_COUNT_NUM > 99999){ - SIGN_COUNT_NUM = 10000; + if(SIGN_COUNT_NUM > 9999){ + SIGN_COUNT_NUM = 1000; } timeId=timeId.substring(2, timeId.length()); return timeId; @@ -62,8 +62,8 @@ */ public synchronized static String getNewTimeIdSign(String sign){ String timeId = getNowTime() + (COUNT_NUM_SIGN++) + sign; - if(COUNT_NUM_SIGN > 99999){ - COUNT_NUM_SIGN = 10000; + if(COUNT_NUM_SIGN > 9999){ + COUNT_NUM_SIGN = 1000; } timeId=timeId.substring(2, timeId.length()); return timeId; diff --git a/dyh-service/dyh-utils/src/main/java/cn/huge/module/sys/utils/SysIdUtils.java b/dyh-service/dyh-utils/src/main/java/cn/huge/module/sys/utils/SysIdUtils.java index 0ca28cc..aa9f260 100644 --- a/dyh-service/dyh-utils/src/main/java/cn/huge/module/sys/utils/SysIdUtils.java +++ b/dyh-service/dyh-utils/src/main/java/cn/huge/module/sys/utils/SysIdUtils.java @@ -16,17 +16,17 @@ /** * 时间Id统计常量 */ - private static int COUNT_NUM = 10000; + private static int COUNT_NUM = 1000; /** * 时间Id统计常量,常量前缀 */ - private static int SIGN_COUNT_NUM = 10000; + private static int SIGN_COUNT_NUM = 1000; /** * 时间Id统计常量,常量后缀 */ - private static int COUNT_NUM_SIGN = 10000; + private static int COUNT_NUM_SIGN = 1000; /** * 获取时间Id,后四位常量 @@ -34,8 +34,8 @@ */ public synchronized static String getNewTimeId(){ String timeId = getNowTime() + (COUNT_NUM++); - if(COUNT_NUM > 99999){ - COUNT_NUM = 10000; + if(COUNT_NUM > 9999){ + COUNT_NUM = 1000; } timeId=timeId.substring(2, timeId.length()); return timeId; @@ -48,8 +48,8 @@ */ public synchronized static String getSignNewTimeId(String sign){ String timeId = getNowTime() + sign + (SIGN_COUNT_NUM++); - if(SIGN_COUNT_NUM > 99999){ - SIGN_COUNT_NUM = 10000; + if(SIGN_COUNT_NUM > 9999){ + SIGN_COUNT_NUM = 1000; } timeId=timeId.substring(2, timeId.length()); return timeId; @@ -62,8 +62,8 @@ */ public synchronized static String getNewTimeIdSign(String sign){ String timeId = getNowTime() + (COUNT_NUM_SIGN++) + sign; - if(COUNT_NUM_SIGN > 99999){ - COUNT_NUM_SIGN = 10000; + if(COUNT_NUM_SIGN > 9999){ + COUNT_NUM_SIGN = 1000; } timeId=timeId.substring(2, timeId.length()); return timeId; -- Gitblit v1.8.0