Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
0f04e559
Commit
0f04e559
authored
Aug 05, 2025
by
tianbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ymt): 生成监码时支持自定义起始序列号
- 在 EquipmentCategoryServiceImpl 中添加 startCode 属性,用于配置起始序列号 - 修改生成监码逻辑,支持使用配置的起始序列号 - 在 GenerateCodeServiceImpl 中添加 SUPERVISOR_SEQUENCE_TYPE 常量,用于生成监码序列
parent
4df63d57
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
+10
-3
EquipmentCategoryServiceImpl.java
...le/ymt/biz/service/impl/EquipmentCategoryServiceImpl.java
+7
-2
GenerateCodeServiceImpl.java
.../module/ymt/biz/service/impl/GenerateCodeServiceImpl.java
+3
-1
No files found.
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-biz/src/main/java/com/yeejoin/amos/boot/module/ymt/biz/service/impl/EquipmentCategoryServiceImpl.java
View file @
0f04e559
...
...
@@ -273,6 +273,11 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
private
ESElavtorRepository
esElavtorRepository
;
@Value
(
"${regulator.unit.code}"
)
private
String
code
;
// 仅测试时使用该起始序列号,默认为空。正式环境不配置该属性时使用枚举里的值
@Value
(
"${ymt.createCode.96333.startCode:}"
)
private
String
startCode
;
@Autowired
private
RedisUtils
redisUtils
;
// 一码通checkCode中redis key过期时间
...
...
@@ -718,7 +723,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
}
log
.
info
(
"生成码成功"
);
SupervisoryCodeInfo
supervisoryCodeInfo
=
new
SupervisoryCodeInfo
();
SupervisoryCodeInfo
selectOne
=
supervisoryCodeInfoMapper
.
selectOne
(
new
QueryWrapper
<
SupervisoryCodeInfo
>().
eq
(
"supervisory_code"
,
supervis
ionCode
));
SupervisoryCodeInfo
selectOne
=
supervisoryCodeInfoMapper
.
selectOne
(
new
QueryWrapper
<
SupervisoryCodeInfo
>().
eq
(
"supervisory_code"
,
supervis
orCode
.
toString
()
));
// 将生成的码添加到码表中,码的使用状态为初始状态
String
equState
=
EquipmentCategoryEnum
.
CSZT
.
getCode
();
supervisoryCodeInfo
.
setCode96333
(
String
.
valueOf
(
elevatorCode
));
...
...
@@ -882,7 +887,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
if
(!
ObjectUtils
.
isEmpty
(
elevatorOtherInfo
)
&&
elevatorOtherInfo
.
getCode
()
!=
null
)
{
StopWatch
stopWatch
=
new
StopWatch
();
stopWatch
.
start
();
Integer
start
=
Integer
.
valueOf
(
prefix
+
EquipmentCategoryEnum
.
getCode
.
get
(
prefix
));
Integer
start
=
Integer
.
valueOf
(
prefix
+
(
ValidationUtil
.
isEmpty
(
startCode
)
?
EquipmentCategoryEnum
.
getCode
.
get
(
prefix
)
:
startCode
));
Integer
end
=
Integer
.
valueOf
(
elevatorOtherInfo
.
getCode
());
// List<Integer> allCodeList = IntStream.rangeClosed(start, end)
// .boxed()
...
...
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-biz/src/main/java/com/yeejoin/amos/boot/module/ymt/biz/service/impl/GenerateCodeServiceImpl.java
View file @
0f04e559
...
...
@@ -35,6 +35,8 @@ public class GenerateCodeServiceImpl implements IGenerateCodeService {
private
static
final
String
LOCK_KEY_SUPERVISORY
=
"sequence_lock_supervisory"
;
private
static
final
String
SEQUENCE_TYPE_UR
=
"%05d"
;
private
static
final
String
SEQUENCE_TYPE
=
"%08d"
;
private
static
final
String
SUPERVISOR_SEQUENCE_TYPE
=
"%07d"
;
private
final
RedisTemplate
<
String
,
String
>
redisTemplate
;
private
final
StringRedisTemplate
stringRedisTemplate
;
private
final
CategoryOtherInfoMapper
categoryOtherInfoMapper
;
...
...
@@ -128,7 +130,7 @@ public class GenerateCodeServiceImpl implements IGenerateCodeService {
log
.
info
(
"===================>获取《{}》当前顺序码:{}<==================="
,
sequenceKey
,
currentSequenceStr
);
currentSequence
++;
// 生成顺序码
String
formattedSequence
=
String
.
format
(
GenerateCodeServiceImpl
.
SEQUENCE_TYPE
,
currentSequence
);
String
formattedSequence
=
String
.
format
(
GenerateCodeServiceImpl
.
S
UPERVISOR_S
EQUENCE_TYPE
,
currentSequence
);
log
.
info
(
"===================>更新《{}》顺序码:{}<==================="
,
sequenceKey
,
formattedSequence
);
// 更新顺序码
valueOps
.
set
(
sequenceKey
,
formattedSequence
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment