未进行判空处理,增加了判断为空不进行校验
This commit is contained in:
parent
67dcd110ba
commit
bbffddcf6e
@ -5,6 +5,7 @@ import com.actionsoft.bpms.commons.database.RowMap;
|
||||
import com.actionsoft.bpms.dw.exec.event.ideimport.DataWindowValidateImport;
|
||||
import com.actionsoft.bpms.server.UserContext;
|
||||
import com.actionsoft.bpms.util.DBSql;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -33,22 +34,24 @@ public class PermissionReadingDataWindowValidateEvent extends DataWindowValidate
|
||||
* @author wangpf
|
||||
*/
|
||||
private void mapNameSToIds(BO bo, Map<String, String> map, String permTypeName, int type) {
|
||||
String[] names = permTypeName.split("\\s+|\\.|\\,|\\,|@");
|
||||
String ids = "";
|
||||
for (String name : names) {
|
||||
String sql = generateSqlByType(type, name);
|
||||
List<RowMap> maps = DBSql.getMaps(sql);
|
||||
if (maps != null && maps.size() == 1) {
|
||||
ids += maps.get(0).getString("ID") + ",";
|
||||
} else {
|
||||
if (type == 0) {
|
||||
map.put("ORGPERM", "【" + name + "】,名称错误,请检查后再导入");
|
||||
}
|
||||
if (type == 1) {
|
||||
map.put("POSTPERM", "【" + name + "】,名称错误,请检查后再导入");
|
||||
}
|
||||
if (type == 2) {
|
||||
map.put("LEVELPERM", "【" + name + "】,名称错误,请检查后再导入");
|
||||
if (StringUtils.isNotEmpty(permTypeName)) {
|
||||
String[] names = permTypeName.split("\\s+|\\.|\\,|\\,|@");
|
||||
String ids = "";
|
||||
for (String name : names) {
|
||||
String sql = generateSqlByType(type, name);
|
||||
List<RowMap> maps = DBSql.getMaps(sql);
|
||||
if (maps != null && maps.size() == 1) {
|
||||
ids += maps.get(0).getString("ID") + ",";
|
||||
} else {
|
||||
if (type == 0) {
|
||||
map.put("ORGPERM", "【" + name + "】,名称错误,请检查后再导入");
|
||||
}
|
||||
if (type == 1) {
|
||||
map.put("POSTPERM", "【" + name + "】,名称错误,请检查后再导入");
|
||||
}
|
||||
if (type == 2) {
|
||||
map.put("LEVELPERM", "【" + name + "】,名称错误,请检查后再导入");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user