opts: code opts.

feihu wang
This commit is contained in:
feihu.wang
2021-03-25 14:33:00 +08:00
parent b025a765c5
commit 6da4d700d0
2 changed files with 7 additions and 9 deletions

View File

@@ -33,7 +33,7 @@
<mysql.version>8.0.16</mysql.version>
<springboot.version>2.2.5.RELEASE</springboot.version>
<tensorflow.version>1.12.0</tensorflow.version>
<es.version>7.6.1</es.version>
<es.version>7.11.2</es.version>
<mapstruct.version>1.4.1.Final</mapstruct.version>
</properties>

View File

@@ -29,18 +29,16 @@ public class ALLINONE implements PluginServiceV2 {
@Override
public Object handle(PreItemVO item, Map<String, Object> jsonInfo,
String[] sourceField) {
List<Object> fields = new ArrayList<>();
for (String field : sourceField) {
fields.add(jsonInfo.get(field));
if (sourceField == null || sourceField.length == 0) {
return "";
}
StringBuilder builder = new StringBuilder();
for (int i = 0; i < fields.size(); i++) {
Object f = fields.get(i);
for (String field : sourceField) {
Object f = jsonInfo.get(field);
builder.append(f == null ? "" : f.toString());
if (i < fields.size() - 1) {
builder.append("_");
}
builder.append("_");
}
builder.deleteCharAt(builder.length() - 1);
return builder.toString();
}
}