【fix sonar】CategoryCodeRule文件
This commit is contained in:
+18
-9
@@ -26,15 +26,7 @@ public class CategoryCodeRule implements IFillRuleHandler {
|
|||||||
String categoryPid = ROOT_PID_VALUE;
|
String categoryPid = ROOT_PID_VALUE;
|
||||||
String categoryCode = null;
|
String categoryCode = null;
|
||||||
|
|
||||||
if (formData != null && formData.size() > 0) {
|
categoryPid = getCateGoryPid(params, formData, categoryPid);
|
||||||
Object obj = formData.get("pid");
|
|
||||||
if (oConvertUtils.isNotEmpty(obj)) categoryPid = obj.toString();
|
|
||||||
} else {
|
|
||||||
if (params != null) {
|
|
||||||
Object obj = params.get("pid");
|
|
||||||
if (oConvertUtils.isNotEmpty(obj)) categoryPid = obj.toString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 分成三种情况
|
* 分成三种情况
|
||||||
@@ -61,4 +53,21 @@ public class CategoryCodeRule implements IFillRuleHandler {
|
|||||||
}
|
}
|
||||||
return categoryCode;
|
return categoryCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String getCateGoryPid(JSONObject params, JSONObject formData, String categoryPid) {
|
||||||
|
if (formData != null && formData.size() > 0) {
|
||||||
|
Object obj = formData.get("pid");
|
||||||
|
if (oConvertUtils.isNotEmpty(obj)) {
|
||||||
|
categoryPid = obj.toString();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (params != null) {
|
||||||
|
Object obj = params.get("pid");
|
||||||
|
if (oConvertUtils.isNotEmpty(obj)) {
|
||||||
|
categoryPid = obj.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return categoryPid;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user