Commit 7ba6d932 by 吴迪

【新增】修改特殊符号返回

parent 10dfed49
......@@ -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);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment