【fix sonar】ForeseeConvert文件
This commit is contained in:
+11
-10
@@ -1,17 +1,19 @@
|
|||||||
package com.jero.generater.modules.online.cgform.converter.convert;
|
package com.jero.generater.modules.online.cgform.converter.convert;
|
||||||
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import com.jero.common.system.vo.DictModel;
|
import com.jero.common.system.vo.DictModel;
|
||||||
import com.jero.common.util.oConvertUtils;
|
import com.jero.common.util.oConvertUtils;
|
||||||
import com.jero.generater.modules.online.cgform.converter.FieldCommentConverter;
|
import com.jero.generater.modules.online.cgform.converter.FieldCommentConverter;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
public class ForeseeConvert implements FieldCommentConverter {
|
public class ForeseeConvert implements FieldCommentConverter {
|
||||||
protected String a;
|
protected String a;
|
||||||
protected List<DictModel> b;
|
protected List<DictModel> b;
|
||||||
|
|
||||||
public ForeseeConvert() {
|
public ForeseeConvert() {
|
||||||
|
// do other
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getFiled() {
|
public String getFiled() {
|
||||||
@@ -30,12 +32,11 @@ public class ForeseeConvert implements FieldCommentConverter {
|
|||||||
this.b = dictList;
|
this.b = dictList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String converterToVal(String txt) {
|
public String converterToVal(String txt) {
|
||||||
if (oConvertUtils.isNotEmpty(txt)) {
|
if (oConvertUtils.isNotEmpty(txt)) {
|
||||||
Iterator var2 = this.b.iterator();
|
|
||||||
|
|
||||||
while(var2.hasNext()) {
|
for (DictModel var3 : this.b) {
|
||||||
DictModel var3 = (DictModel)var2.next();
|
|
||||||
if (var3.getText().equals(txt)) {
|
if (var3.getText().equals(txt)) {
|
||||||
return var3.getValue();
|
return var3.getValue();
|
||||||
}
|
}
|
||||||
@@ -45,12 +46,11 @@ public class ForeseeConvert implements FieldCommentConverter {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String converterToTxt(String val) {
|
public String converterToTxt(String val) {
|
||||||
if (oConvertUtils.isNotEmpty(val)) {
|
if (oConvertUtils.isNotEmpty(val)) {
|
||||||
Iterator var2 = this.b.iterator();
|
|
||||||
|
|
||||||
while(var2.hasNext()) {
|
for (DictModel var3 : this.b) {
|
||||||
DictModel var3 = (DictModel)var2.next();
|
|
||||||
if (var3.getValue().equals(val)) {
|
if (var3.getValue().equals(val)) {
|
||||||
return var3.getText();
|
return var3.getText();
|
||||||
}
|
}
|
||||||
@@ -60,7 +60,8 @@ public class ForeseeConvert implements FieldCommentConverter {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Map<String, String> getConfig() {
|
public Map<String, String> getConfig() {
|
||||||
return null;
|
return Collections.emptyMap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user