Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
H
hzsomms
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
ZTGK
hzsomms
Commits
e87bddc0
Commit
e87bddc0
authored
Jul 17, 2023
by
hkl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:1.单元编号划分
parent
961cb187
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
17 deletions
+13
-17
UnitCodeUtil.java
...m/src/main/java/org/jeecg/modules/utils/UnitCodeUtil.java
+13
-17
No files found.
jeecg-module-system/src/main/java/org/jeecg/modules/utils/UnitCodeUtil.java
View file @
e87bddc0
...
...
@@ -41,20 +41,20 @@ public class UnitCodeUtil {
/**
* 钢轨单元编码:线别码+GG+流水号(5位流水号)
* 实例:SXGG00001
*
SQX - 竖曲线
* 000
00
1-流水号
* 实例:SX
X
GG00001
*
GG - 钢轨编码
* 0001-流水号
*
* @param lineId 线别ID
*/
public
static
String
railUnitCodeUtil
(
String
lineId
)
{
// 获取线别拼音
LineAlias
lineAlias
=
lineAliasService
.
getById
(
lineId
);
String
lineAliasPinyin
=
PinyinUtil
.
getFirstLetter
(
lineAlias
.
getLineAliasName
(),
""
).
to
Low
erCase
();
String
lineAliasPinyin
=
PinyinUtil
.
getFirstLetter
(
lineAlias
.
getLineAliasName
(),
""
).
to
Upp
erCase
();
// 查询最大的编号
String
unitCode
=
lineAliasPinyin
+
"
SQX
"
;
String
unitCode
=
lineAliasPinyin
+
"
GG
"
;
RailManagement
record
=
railManagementService
.
lambdaQuery
()
.
likeRight
(
RailManagement:
:
getUnitCode
,
unitCode
)
.
orderByDesc
(
RailManagement:
:
getUnitCode
)
...
...
@@ -66,7 +66,7 @@ public class UnitCodeUtil {
Integer
serialNum
=
1
;
if
(
null
!=
record
&&
record
.
getUnitCode
()
!=
null
)
{
// 流水号+1
serialNum
=
Integer
.
parseInt
(
record
.
getUnitCode
().
substring
(
6
))
+
1
;
serialNum
=
Integer
.
parseInt
(
record
.
getUnitCode
().
substring
(
record
.
getUnitCode
().
length
()
-
4
))
+
1
;
}
String
serialNumStr
=
supplementZero
(
4
,
serialNum
);
...
...
@@ -74,17 +74,15 @@ public class UnitCodeUtil {
}
/**
* 曲线代码生成: 01SQX0001
* 01 - 上行;02-表示下行
* SQX - 竖曲线
* 000
00
1-流水号
* 0001-流水号
*
* @param lineId 线别ID
*/
public
static
String
verticalCurveUnitCodeUtil
(
String
lineId
)
{
// 获取线别拼音
LineAlias
lineAlias
=
lineAliasService
.
getById
(
lineId
);
String
lineAliasPinyin
=
PinyinUtil
.
getFirstLetter
(
lineAlias
.
getLineAliasName
(),
""
).
to
Low
erCase
();
String
lineAliasPinyin
=
PinyinUtil
.
getFirstLetter
(
lineAlias
.
getLineAliasName
(),
""
).
to
Upp
erCase
();
// 查询最大的编号
...
...
@@ -100,7 +98,7 @@ public class UnitCodeUtil {
Integer
serialNum
=
1
;
if
(
null
!=
record
&&
record
.
getUnitCode
()
!=
null
)
{
// 流水号+1
serialNum
=
Integer
.
parseInt
(
record
.
getUnitCode
().
substring
(
6
))
+
1
;
serialNum
=
Integer
.
parseInt
(
record
.
getUnitCode
().
substring
(
record
.
getUnitCode
().
length
()
-
4
))
+
1
;
}
String
serialNumStr
=
supplementZero
(
4
,
serialNum
);
...
...
@@ -109,7 +107,6 @@ public class UnitCodeUtil {
/**
* 曲线代码生成: L201QX0001
* 01 - 上行;02-表示下行
* QX - 曲线
* 000001-流水号
*
...
...
@@ -118,7 +115,7 @@ public class UnitCodeUtil {
public
static
String
curveUnitCodeUtil
(
String
lineId
)
{
// 获取线别拼音
LineAlias
lineAlias
=
lineAliasService
.
getById
(
lineId
);
String
lineAliasPinyin
=
PinyinUtil
.
getFirstLetter
(
lineAlias
.
getLineAliasName
(),
""
).
to
Low
erCase
();
String
lineAliasPinyin
=
PinyinUtil
.
getFirstLetter
(
lineAlias
.
getLineAliasName
(),
""
).
to
Upp
erCase
();
// 查询最大的编号
...
...
@@ -133,7 +130,7 @@ public class UnitCodeUtil {
Integer
serialNum
=
1
;
if
(
null
!=
record
&&
record
.
getUnitCode
()
!=
null
)
{
// 流水号+1
serialNum
=
Integer
.
parseInt
(
record
.
getUnitCode
().
substring
(
6
))
+
1
;
serialNum
=
Integer
.
parseInt
(
record
.
getUnitCode
().
substring
(
record
.
getUnitCode
().
length
()
-
4
))
+
1
;
}
String
serialNumStr
=
supplementZero
(
4
,
serialNum
);
...
...
@@ -151,7 +148,7 @@ public class UnitCodeUtil {
public
static
String
switchUnitCodeUtil
(
String
lineId
)
{
// 获取线别拼音
LineAlias
lineAlias
=
lineAliasService
.
getById
(
lineId
);
String
lineAliasPinyin
=
PinyinUtil
.
getFirstLetter
(
lineAlias
.
getLineAliasName
(),
""
).
to
Low
erCase
();
String
lineAliasPinyin
=
PinyinUtil
.
getFirstLetter
(
lineAlias
.
getLineAliasName
(),
""
).
to
Upp
erCase
();
// 查询最大的编号
...
...
@@ -166,7 +163,7 @@ public class UnitCodeUtil {
Integer
serialNum
=
1
;
if
(
null
!=
record
&&
record
.
getUnitCode
()
!=
null
)
{
// 流水号+1
serialNum
=
Integer
.
parseInt
(
record
.
getUnitCode
().
substring
(
6
))
+
1
;
serialNum
=
Integer
.
parseInt
(
record
.
getUnitCode
().
substring
(
record
.
getUnitCode
().
length
()
-
4
))
+
1
;
}
String
serialNumStr
=
supplementZero
(
4
,
serialNum
);
...
...
@@ -183,5 +180,4 @@ public class UnitCodeUtil {
public
static
String
supplementZero
(
int
numLength
,
int
num
)
{
return
String
.
format
(
"%0"
+
numLength
+
"d"
,
num
);
}
}
\ No newline at end of file
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