Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gs1-office-web-sit
Overview
Overview
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
吴迪
gs1-office-web-sit
Commits
7ba6d932
Commit
7ba6d932
authored
Dec 22, 2021
by
吴迪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【新增】修改特殊符号返回
parent
10dfed49
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletions
+13
-1
BarcodeGenerationServiceImpl.java
...les/manage/service/impl/BarcodeGenerationServiceImpl.java
+13
-1
No files found.
src/main/java/io/office/modules/manage/service/impl/BarcodeGenerationServiceImpl.java
View file @
7ba6d932
...
...
@@ -36,7 +36,8 @@ public class BarcodeGenerationServiceImpl implements BarcodeGenerationService {
if
(
fixedLengthResult
.
getIsVariable
()==
1
){
if
(
split
[
1
].
trim
().
length
()<=
fixedLengthResult
.
getMaxLength
()
&&
split
[
1
].
trim
().
length
()>=
fixedLengthResult
.
getMinLength
()){
content
=
content
+
split
[
0
]+
split
[
1
]+
SEPERATOR
;
//content= content+split[0]+split[1]+SEPERATOR;前端拼接过了去掉特殊符号
content
=
content
+
split
[
0
]+
split
[
1
];
}
else
{
throw
new
RRException
(
"AI为"
+
aiCode
+
" 的信息需要填充"
+
fixedLengthResult
.
getMaxLength
()+
"位数字"
);
}
...
...
@@ -59,6 +60,8 @@ public class BarcodeGenerationServiceImpl implements BarcodeGenerationService {
}
else
if
(
content
.
length
()>
48
){
throw
new
RRException
(
"总长度不能超过48位"
);
}
String
url
=
""
;
if
(
content
.
length
()
>
50
)
{
throw
new
RRException
(
"最大50位!"
);
...
...
@@ -76,4 +79,13 @@ public class BarcodeGenerationServiceImpl implements BarcodeGenerationService {
public
GS1CodeListEntity
getGS1CodeListGRAI
()
{
return
this
.
qRcodeDao
.
getGS1ByMark
();
}
public
static
void
main
(
String
[]
args
)
{
String
content
=
"1122112ñ"
;
if
(
content
.
lastIndexOf
(
"ñ"
)==
content
.
length
()-
1
){
content
=
content
.
substring
(
0
,
content
.
length
()-
1
);
}
System
.
out
.
println
(
content
);
}
}
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