Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
gsc
/
gsc-vcp-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit f3e00e7c
authored
Nov 17, 2025
by
张富康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
EvalNoGenerator工具类
1 parent
069cc8fe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
69 deletions
src/main/java/com/gsc4cloud/gsc/vpc/api/util/EvalNoGenerator.java
src/main/java/com/gsc4cloud/gsc/vpc/api/util/EvalNoGenerator.java
deleted
100644 → 0
View file @
069cc8f
package
com
.
gsc4cloud
.
gsc
.
vpc
.
api
.
util
;
import
com.gsc4cloud.gsc.common.snowflake.core.SnowflakeWorker
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.util.UUID
;
/**
* 评估单号生成工具类
* 生成规则:er + 雪花算法
*
* @author zhangfk
*/
@Component
public
class
EvalNoGenerator
{
/**
* 评估单号前缀
*/
private
static
final
String
EVAL_ORDER_PREFIX
=
"er"
;
private
static
final
String
EVAL_CONTRACT_NO_PREFIX
=
"ec"
;
/**
* 雪花算法实例
*/
private
final
SnowflakeWorker
snowflake
;
@Autowired
private
ShortLinkComponent
shortLinkComponent
;
public
EvalNoGenerator
()
{
// 使用 Hutool 的雪花算法,workerId 和 datacenterId 可以根据实际情况配置
this
.
snowflake
=
new
SnowflakeWorker
(
1
,
1
);
}
/**
* 生成评估单号
* 格式:er + 雪花算法生成的ID
*
* @return 评估单号
*/
public
String
generateEvalOrderNo
()
{
long
id
=
snowflake
.
nextId
();
return
EVAL_ORDER_PREFIX
+
id
;
}
/**
* 生成合同编号
*
* @return 合同编号
*/
public
String
generateContractNo
()
{
long
id
=
snowflake
.
nextId
();
return
EVAL_CONTRACT_NO_PREFIX
+
id
;
}
/**
* 生成车源号
* @return 车源号
*/
public
String
generateSourceNo
()
{
String
prefix
=
java
.
time
.
format
.
DateTimeFormatter
.
ofPattern
(
"yyMM"
).
format
(
java
.
time
.
LocalDate
.
now
());
String
code
=
shortLinkComponent
.
createShortLinkCode
(
UUID
.
randomUUID
().
toString
());
return
prefix
+
code
;
}
}
\ No newline at end of file
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment