国家库同步时报错

purchase
anthonyywj2 3 years ago
parent 66706d2019
commit 90a424dd12

@ -7,53 +7,55 @@ import java.util.Iterator;
*/
final class Gs1128Utils {
public static final String PREFIX = "]C1";
public static final char END_AI_VARIED = (char) 29;
private Gs1128Utils() {
super();
}
public static Iterator<Character> iterator(String value) {
return value.chars().mapToObj(c -> (char) c).iterator();
}
public static String value(AI ai, Iterator<Character> iterator) {
Format format = Format.valueOf(ai.getFormat());
if (format.isVaried()) {
return variedValue(iterator);
} else {
return fixedValue(format.getLength(), iterator);
public static final String PREFIX = "]C1";
public static final char END_AI_VARIED = (char) 29;
private Gs1128Utils() {
super();
}
public static Iterator<Character> iterator(String value) {
return value.chars().mapToObj(c -> (char) c).iterator();
}
}
public static String value(Session session, String value) {
Iterator<Character> iterator = iterator(value);
if (session.isVaried()) {
return variedValue(iterator);
} else {
return fixedValue(session.getLength(), iterator);
public static String value(AI ai, Iterator<Character> iterator) {
Format format = Format.valueOf(ai.getFormat());
if (format.isVaried()) {
return variedValue(iterator);
} else {
return fixedValue(format.getLength(), iterator);
}
}
}
private static String fixedValue(int size, Iterator<Character> iterator) {
StringBuilder builder = new StringBuilder();
for (int i = 0; i < size; i++) {
builder.append(iterator.next());
public static String value(Session session, String value) {
Iterator<Character> iterator = iterator(value);
if (session.isVaried()) {
return variedValue(iterator);
} else {
return fixedValue(session.getLength(), iterator);
}
}
return builder.toString();
}
private static String variedValue(Iterator<Character> iterator) {
StringBuilder builder = new StringBuilder();
while (iterator.hasNext()) {
char value = iterator.next();
if (value == END_AI_VARIED) {
break;
}
builder.append(value);
private static String fixedValue(int size, Iterator<Character> iterator) {
StringBuilder builder = new StringBuilder();
for (int i = 0; i < size; i++) {
if (iterator.hasNext()) {
builder.append(iterator.next());
}
}
return builder.toString();
}
private static String variedValue(Iterator<Character> iterator) {
StringBuilder builder = new StringBuilder();
while (iterator.hasNext()) {
char value = iterator.next();
if (value == END_AI_VARIED) {
break;
}
builder.append(value);
}
return builder.toString();
}
return builder.toString();
}
}

@ -3,10 +3,13 @@ spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.jdbc-url=jdbc:mysql://192.168.0.109:3306/udiwms?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
spring.datasource.username=root
spring.datasource.password=123456
spring.datasource.hikari.connection-timeout=60000
spring.datasource.hikari.maximum-pool-size=60
spring.datasource.hikari.minimum-idle=10
server.servlet.context-path=
logging.level.com.glxp.api.admin.dao=debug
file_path=D:/udi/udiwms/udiwmsfile/
#file_path=/home/glxp/udiwms
#file_path=/home/glxp/udiwms++
UDI_KEY=6b137c66-6286-46c6-8efa-c2f5dd9237df
UDI_SERVER_URL=https://www.udims.com/UDI_DL_Server_test
SPMS_KEY=lCOdWCBKS6Kw45wdnnqUTELXyuSKnXEs

@ -453,7 +453,6 @@
#{cpbsbmtxmc},
#{isNewest},
#{updateTime},
#{hchzsb},
#{cplx},
#{hchzsb},
#{sfwblztlcp},

Loading…
Cancel
Save