文件阅览权限批量导入更新,部门名称转换为id
This commit is contained in:
parent
d0e3428cd5
commit
ccc1b62545
@ -0,0 +1,34 @@
|
||||
package com.actionsoft.apps.coe.pal.publisher.event;
|
||||
|
||||
import com.actionsoft.bpms.bo.engine.BO;
|
||||
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 java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class PermissionReadingDataWindowValidateEvent extends DataWindowValidateImport {
|
||||
@Override
|
||||
public BO excute(UserContext userContext, BO bo, String s, Map<String, String> map, String s1, Map<String, Object> map1) {
|
||||
String orgperm = bo.getString("ORGPERM");
|
||||
String[] split = orgperm.split("\\s+|\\.|\\,|\\,|@");
|
||||
String ids = "";
|
||||
for (String depname : split) {
|
||||
String sql = "SELECT ID,DEPARTMENTNAME FROM orgdepartment WHERE DEPARTMENTNAME = '" + depname + "' ";
|
||||
List<RowMap> maps = DBSql.getMaps(sql);
|
||||
if (maps != null && maps.size() == 1) {
|
||||
ids += maps.get(0).getString("ID") + ",";
|
||||
}else{
|
||||
map.put("ORGPERM","【"+depname+"】,名称错误,请检查后再导入");
|
||||
}
|
||||
}
|
||||
if (ids.length()>0){
|
||||
bo.set("ORGPERM",ids.substring(0,ids.length()-1));
|
||||
}
|
||||
|
||||
|
||||
return bo;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user