修改架构视图增加部门过滤
This commit is contained in:
parent
f54e31b0b5
commit
bb3445f5a9
@ -156,28 +156,45 @@ public class ToPageService extends ActionWeb {
|
|||||||
String fileType = params.get("fileType");
|
String fileType = params.get("fileType");
|
||||||
String departId =params.get("departId");
|
String departId =params.get("departId");
|
||||||
List<String> list = new ArrayList<>();
|
List<String> list = new ArrayList<>();
|
||||||
if (departId.contains(",")){
|
if (departId.contains(uc.getCompanyModel().getId())){
|
||||||
String[] split = departId.split(",");
|
List<RowMap> maps = DBSql.getMaps("select ID from orgdepartment where 1=1 AND closed = '0'");
|
||||||
for (String departID:
|
for (RowMap rowMap:
|
||||||
split) {
|
maps) {
|
||||||
ArrayList<String> childDept = getChildDept(departID, new ArrayList<>());
|
String id = rowMap.getString("ID");
|
||||||
if (childDept.size()>0){
|
list.add(id);
|
||||||
for (String departid:
|
}
|
||||||
childDept) {
|
}else {
|
||||||
list.add(departid);
|
|
||||||
|
if (UtilString.isNotEmpty(departId)){
|
||||||
|
if (departId.contains(",")){
|
||||||
|
String[] split = departId.split(",");
|
||||||
|
for (String departID:
|
||||||
|
split) {
|
||||||
|
ArrayList<String> childDept = getChildDept(departID, new ArrayList<>());
|
||||||
|
if (childDept.size()>0){
|
||||||
|
for (String departid:
|
||||||
|
childDept) {
|
||||||
|
list.add(departid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
ArrayList<String> childDept = getChildDept(departId, new ArrayList<>());
|
||||||
|
if (childDept.size()>0){
|
||||||
|
for (String departid:
|
||||||
|
childDept) {
|
||||||
|
list.add(departid);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
System.out.println("list>>>>>>>>>>"+list);
|
System.out.println("list>>>>>>>>>>"+list);
|
||||||
String sb ="(";
|
ro.put("departId",list.toString());
|
||||||
for (String departids:
|
|
||||||
list) {
|
String sb = getAppendOrAndInString(list);
|
||||||
sb+="'"+departids+"'"+",";
|
ro.put("sb",sb);
|
||||||
}
|
ro.put("frameIDtoFrameView",frameIDtoFrameView);
|
||||||
sb = sb.substring(0,sb.length()-1);
|
|
||||||
sb+=")";
|
|
||||||
System.out.println("sb>>>>>>>"+sb);
|
|
||||||
System.out.println("======frameIDtoFrameView======" + frameIDtoFrameView);
|
System.out.println("======frameIDtoFrameView======" + frameIDtoFrameView);
|
||||||
if (null != frameIDtoFrameView && !frameIDtoFrameView.equals("")) {
|
if (null != frameIDtoFrameView && !frameIDtoFrameView.equals("")) {
|
||||||
//SDK.getLogAPI().consoleInfo("当前架构ID1"+frameID);
|
//SDK.getLogAPI().consoleInfo("当前架构ID1"+frameID);
|
||||||
@ -208,9 +225,8 @@ public class ToPageService extends ActionWeb {
|
|||||||
List<RowMap> fileRowMaps =null;
|
List<RowMap> fileRowMaps =null;
|
||||||
//List<RowMap> fileRowMaps = DBSql.getMaps("SELECT FILEID,PLPARENTID,PLNAME,PLMETHODID,SUPPORTFILE,PUBDEPT,PUBDATETIME,PLORDERINDEX,PLLEVEL,POLICYTYPE FROM BO_EU_PAL_FILE1 WHERE PLPARENTID=? AND FILESTATE='1' AND (PLMETHODID='process.epc' OR PLMETHODID='process.flowchart' OR PLMETHODID='control.policy') ORDER BY TO_NUMBER(PLLEVEL) ASC, TO_NUMBER(PLORDERINDEX) ASC", sqlParams);
|
//List<RowMap> fileRowMaps = DBSql.getMaps("SELECT FILEID,PLPARENTID,PLNAME,PLMETHODID,SUPPORTFILE,PUBDEPT,PUBDATETIME,PLORDERINDEX,PLLEVEL,POLICYTYPE FROM BO_EU_PAL_FILE1 WHERE PLPARENTID=? AND FILESTATE='1' AND (PLMETHODID='process.epc' OR PLMETHODID='process.flowchart' OR PLMETHODID='control.policy') ORDER BY TO_NUMBER(PLLEVEL) ASC, TO_NUMBER(PLORDERINDEX) ASC", sqlParams);
|
||||||
if (sb.contains("'")){
|
if (sb.contains("'")){
|
||||||
fileRowMaps = DBSql.getMaps("SELECT ID AS FILEID,PLPARENTID,PLNAME,PLMETHODID,PLLEVEL,PLVERSIONID,PLORDERINDEX,EXT3 as POLICYTYPE FROM APP_ACT_COE_PAL_REPOSITORY WHERE PLPARENTID=? AND ISPUBLISH = 1 AND EXT6 IN"+sb+" AND ISSTOP =0 AND EXT5 = '1' AND (PLMETHODID='process.epc' OR PLMETHODID='control.policy' OR PLMETHODID='process.flowchart') ORDER BY TO_NUMBER(PLLEVEL) ASC, TO_NUMBER(PLORDERINDEX) ASC", sqlParams);
|
fileRowMaps = DBSql.getMaps("SELECT ID AS FILEID,PLPARENTID,PLNAME,PLMETHODID,PLLEVEL,PLVERSIONID,PLORDERINDEX,EXT3 as POLICYTYPE FROM APP_ACT_COE_PAL_REPOSITORY WHERE PLPARENTID=? AND ISPUBLISH = 1 AND "+sb+" AND ISSTOP =0 AND EXT5 = '1' AND (PLMETHODID='process.epc' OR PLMETHODID='control.policy' OR PLMETHODID='process.flowchart') ORDER BY TO_NUMBER(PLLEVEL) ASC, TO_NUMBER(PLORDERINDEX) ASC", sqlParams);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
fileRowMaps = DBSql.getMaps("SELECT ID AS FILEID,PLPARENTID,PLNAME,PLMETHODID,PLLEVEL,PLVERSIONID,PLORDERINDEX,EXT3 as POLICYTYPE FROM APP_ACT_COE_PAL_REPOSITORY WHERE PLPARENTID=? AND ISPUBLISH = 1 AND ISSTOP =0 AND EXT5 = '1' AND (PLMETHODID='process.epc' OR PLMETHODID='control.policy' OR PLMETHODID='process.flowchart') ORDER BY TO_NUMBER(PLLEVEL) ASC, TO_NUMBER(PLORDERINDEX) ASC", sqlParams);
|
fileRowMaps = DBSql.getMaps("SELECT ID AS FILEID,PLPARENTID,PLNAME,PLMETHODID,PLLEVEL,PLVERSIONID,PLORDERINDEX,EXT3 as POLICYTYPE FROM APP_ACT_COE_PAL_REPOSITORY WHERE PLPARENTID=? AND ISPUBLISH = 1 AND ISSTOP =0 AND EXT5 = '1' AND (PLMETHODID='process.epc' OR PLMETHODID='control.policy' OR PLMETHODID='process.flowchart') ORDER BY TO_NUMBER(PLLEVEL) ASC, TO_NUMBER(PLORDERINDEX) ASC", sqlParams);
|
||||||
}
|
}
|
||||||
System.out.println("fileRowMaps>>>>>>>>>>"+fileRowMaps);
|
System.out.println("fileRowMaps>>>>>>>>>>"+fileRowMaps);
|
||||||
@ -260,120 +276,154 @@ public class ToPageService extends ActionWeb {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
fileRowMaps.addAll(fileHandleRowMaps);
|
|
||||||
}
|
}
|
||||||
System.out.println("========fileRowMaps2========>" + fileRowMaps.size());
|
fileRowMaps.addAll(fileHandleRowMaps);
|
||||||
if (null != fileType && !fileType.equals("")) {
|
}
|
||||||
fileHandleRowMaps = new ArrayList<>();
|
System.out.println("========fileRowMaps2========>" + fileRowMaps.size());
|
||||||
if (null != fileRowMaps && !fileRowMaps.isEmpty()) {
|
if (null != fileType && !fileType.equals("")) {
|
||||||
for (RowMap fileRowMap : fileRowMaps) {
|
fileHandleRowMaps = new ArrayList<>();
|
||||||
if (fileType.equals("processFile")) {
|
if (null != fileRowMaps && !fileRowMaps.isEmpty()) {
|
||||||
if (fileRowMap.getString("PLMETHODID").equals("process.epc") || fileRowMap.getString("PLMETHODID").equals("process.flowchart")) {
|
for (RowMap fileRowMap : fileRowMaps) {
|
||||||
fileHandleRowMaps.add(fileRowMap);
|
if (fileType.equals("processFile")) {
|
||||||
}
|
if (fileRowMap.getString("PLMETHODID").equals("process.epc") || fileRowMap.getString("PLMETHODID").equals("process.flowchart")) {
|
||||||
}
|
|
||||||
System.out.println("========fileHandleRowMaps3========>" + fileHandleRowMaps.size());
|
|
||||||
if (fileType.equals("policyFile")) {
|
|
||||||
if (fileRowMap.getString("PLMETHODID").equals("control.policy") && (fileRowMap.getString("POLICYTYPE").equals("regulation") || null == fileRowMap.getString("POLICYTYPE") || fileRowMap.getString("POLICYTYPE").equals(""))) {
|
|
||||||
fileHandleRowMaps.add(fileRowMap);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// && fileRowMap.getString("POLICYTYPE").equals("regulation")
|
|
||||||
if (fileType.equals("guideFile")) {
|
|
||||||
if (fileRowMap.getString("PLMETHODID").equals("control.policy") && fileRowMap.getString("POLICYTYPE").equals("I/O_L4")) {
|
|
||||||
fileHandleRowMaps.add(fileRowMap);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (fileType.equals("formFile")) {
|
|
||||||
if (fileRowMap.getString("PLMETHODID").equals("data.form")) {
|
|
||||||
fileHandleRowMaps.add(fileRowMap);
|
|
||||||
String PLPARENTID = fileRowMap.getString("PLPARENTID");
|
|
||||||
PALRepositoryModel reFileModel = PALRepositoryCache.getCache().get(PLPARENTID);
|
|
||||||
String PLMETHODID = reFileModel.getMethodId();
|
|
||||||
String PUBDEPT = fileRowMap.getString("PUBDEPT");
|
|
||||||
Integer PLLEVEL = fileRowMap.getInt("PLLEVEL");
|
|
||||||
if (!PLMETHODID.equals("process.framework")) {
|
|
||||||
reFileMap = new HashMap<>();
|
|
||||||
reFileMap.put("FILEID", reFileModel.getId());
|
|
||||||
reFileMap.put("PLNAME", reFileModel.getName());
|
|
||||||
reFileMap.put("PLPARENTID", reFileModel.getParentId());
|
|
||||||
reFileMap.put("PLMETHODID", PLMETHODID);
|
|
||||||
reFileMap.put("PUBDEPT", PUBDEPT);
|
|
||||||
reFileMap.put("PLLEVEL", (PLLEVEL - 1));
|
|
||||||
reFileMap.put("PLORDERINDEX", reFileModel.getOrderIndex());
|
|
||||||
reFileRowMap = new RowMap(reFileMap);
|
|
||||||
fileHandleRowMaps.add(reFileRowMap);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (fileType.equals("totalFile")) {
|
|
||||||
fileHandleRowMaps.add(fileRowMap);
|
fileHandleRowMaps.add(fileRowMap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
System.out.println("========fileHandleRowMaps3========>" + fileHandleRowMaps.size());
|
||||||
fileHandleRowMaps = fileHandleRowMaps.stream().collect(collectingAndThen(toCollection(() -> new TreeSet<>(Comparator.comparing(o -> o.getString("FILEID")))),
|
if (fileType.equals("policyFile")) {
|
||||||
ArrayList::new));
|
if (fileRowMap.getString("PLMETHODID").equals("control.policy") && (fileRowMap.getString("POLICYTYPE").equals("regulation") || null == fileRowMap.getString("POLICYTYPE") || fileRowMap.getString("POLICYTYPE").equals(""))) {
|
||||||
fileRowMaps = fileHandleRowMaps;
|
fileHandleRowMaps.add(fileRowMap);
|
||||||
}
|
|
||||||
if (null != fileRowMaps && !fileRowMaps.isEmpty()) {
|
|
||||||
for (RowMap fileRowMap : fileRowMaps) {
|
|
||||||
fileMap = new HashMap<String, Object>();
|
|
||||||
model = PALRepositoryCache.getCache().get(fileRowMap.getString("FILEID"));
|
|
||||||
if (model != null) {
|
|
||||||
if (model.isPublish() || model.isStop()) {// 停用或已发布状态查询最新流程手册
|
|
||||||
taskId = getLastPublishTaskIdByModelId(model.getId());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
path = "./w" + "?" + "cmd=com.actionsoft.apps.coe.pal.publisher_publish_file_open" + "&" + "uuid=" + fileRowMap.getString("FILEID") + "&" + "sid=" + sid + "&" + "taskId=" + taskId;
|
// && fileRowMap.getString("POLICYTYPE").equals("regulation")
|
||||||
nodeType = "file";
|
if (fileType.equals("guideFile")) {
|
||||||
fileMap.put("ID", fileRowMap.getString("FILEID"));
|
if (fileRowMap.getString("PLMETHODID").equals("control.policy") && fileRowMap.getString("POLICYTYPE").equals("I/O_L4")) {
|
||||||
fileMap.put("PARENTID", fileRowMap.getString("PLPARENTID"));
|
fileHandleRowMaps.add(fileRowMap);
|
||||||
fileMap.put("name", fileRowMap.getString("PLNAME"));
|
}
|
||||||
fileMap.put("PLMETHODID", fileRowMap.getString("PLMETHODID"));
|
}
|
||||||
fileMap.put("PUBDATETIME", fileRowMap.getString("PUBDATETIME"));
|
if (fileType.equals("formFile")) {
|
||||||
fileMap.put("path", path);
|
if (fileRowMap.getString("PLMETHODID").equals("data.form")) {
|
||||||
fileMap.put("ORDERINDEX", fileRowMap.getString("PLORDERINDEX"));
|
fileHandleRowMaps.add(fileRowMap);
|
||||||
fileMap.put("TLEVEL", fileRowMap.getString("PLLEVEL"));
|
String PLPARENTID = fileRowMap.getString("PLPARENTID");
|
||||||
fileMap.put("nodeType", nodeType);
|
PALRepositoryModel reFileModel = PALRepositoryCache.getCache().get(PLPARENTID);
|
||||||
if (fileRowMap.getString("PLMETHODID").equals("process.epc") || fileRowMap.getString("PLMETHODID").equals("process.flowchart")) {
|
String PLMETHODID = reFileModel.getMethodId();
|
||||||
fileMap.put("fileType", "processFile");
|
String PUBDEPT = fileRowMap.getString("PUBDEPT");
|
||||||
} else if (fileRowMap.getString("PLMETHODID").equals("control.policy") && (fileRowMap.getString("POLICYTYPE").equals("regulation") || null == fileRowMap.getString("POLICYTYPE") || fileRowMap.getString("POLICYTYPE").equals(""))) {
|
Integer PLLEVEL = fileRowMap.getInt("PLLEVEL");
|
||||||
// && fileRowMap.getString("POLICYTYPE").equals("regulation")
|
if (!PLMETHODID.equals("process.framework")) {
|
||||||
fileMap.put("fileType", "policyFile");
|
reFileMap = new HashMap<>();
|
||||||
} else if (fileRowMap.getString("PLMETHODID").equals("control.policy") && fileRowMap.getString("POLICYTYPE").equals("I/O_L4")) {
|
reFileMap.put("FILEID", reFileModel.getId());
|
||||||
fileMap.put("fileType", "guideFile");
|
reFileMap.put("PLNAME", reFileModel.getName());
|
||||||
} else if (fileRowMap.getString("PLMETHODID").equals("data.form")) {
|
reFileMap.put("PLPARENTID", reFileModel.getParentId());
|
||||||
fileMap.put("fileType", "formFile");
|
reFileMap.put("PLMETHODID", PLMETHODID);
|
||||||
|
reFileMap.put("PUBDEPT", PUBDEPT);
|
||||||
|
reFileMap.put("PLLEVEL", (PLLEVEL - 1));
|
||||||
|
reFileMap.put("PLORDERINDEX", reFileModel.getOrderIndex());
|
||||||
|
reFileRowMap = new RowMap(reFileMap);
|
||||||
|
fileHandleRowMaps.add(reFileRowMap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (fileType.equals("totalFile")) {
|
||||||
|
fileHandleRowMaps.add(fileRowMap);
|
||||||
}
|
}
|
||||||
fileMaps.add(fileMap);
|
|
||||||
}
|
}
|
||||||
System.out.println("fileMaps============"+fileMaps);
|
|
||||||
|
|
||||||
|
|
||||||
List<Map> fileTreeNodes = TreeUtil.buildTree("1", fileMaps, null, "frame", null, null);
|
|
||||||
ro.put("fileMaps", fileTreeNodes);
|
|
||||||
System.err.println("============fileMaps============" + fileMaps);
|
|
||||||
System.err.println("============fileTreeNodes==========" + fileTreeNodes);
|
|
||||||
return ro.toString();
|
|
||||||
} else {
|
|
||||||
ro.ok("暂无文件");
|
|
||||||
fileMaps = new ArrayList<>();
|
|
||||||
ro.put("fileMaps", fileMaps);
|
|
||||||
return ro.toString();
|
|
||||||
}
|
}
|
||||||
|
fileHandleRowMaps = fileHandleRowMaps.stream().collect(collectingAndThen(toCollection(() -> new TreeSet<>(Comparator.comparing(o -> o.getString("FILEID")))),
|
||||||
|
ArrayList::new));
|
||||||
|
fileRowMaps = fileHandleRowMaps;
|
||||||
|
}
|
||||||
|
if (null != fileRowMaps && !fileRowMaps.isEmpty()) {
|
||||||
|
for (RowMap fileRowMap : fileRowMaps) {
|
||||||
|
fileMap = new HashMap<String, Object>();
|
||||||
|
model = PALRepositoryCache.getCache().get(fileRowMap.getString("FILEID"));
|
||||||
|
if (model != null) {
|
||||||
|
if (model.isPublish() || model.isStop()) {// 停用或已发布状态查询最新流程手册
|
||||||
|
taskId = getLastPublishTaskIdByModelId(model.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
path = "./w" + "?" + "cmd=com.actionsoft.apps.coe.pal.publisher_publish_file_open" + "&" + "uuid=" + fileRowMap.getString("FILEID") + "&" + "sid=" + sid + "&" + "taskId=" + taskId;
|
||||||
|
nodeType = "file";
|
||||||
|
fileMap.put("ID", fileRowMap.getString("FILEID"));
|
||||||
|
fileMap.put("PARENTID", fileRowMap.getString("PLPARENTID"));
|
||||||
|
fileMap.put("name", fileRowMap.getString("PLNAME"));
|
||||||
|
fileMap.put("PLMETHODID", fileRowMap.getString("PLMETHODID"));
|
||||||
|
fileMap.put("PUBDATETIME", fileRowMap.getString("PUBDATETIME"));
|
||||||
|
fileMap.put("path", path);
|
||||||
|
fileMap.put("ORDERINDEX", fileRowMap.getString("PLORDERINDEX"));
|
||||||
|
fileMap.put("TLEVEL", fileRowMap.getString("PLLEVEL"));
|
||||||
|
fileMap.put("nodeType", nodeType);
|
||||||
|
if (fileRowMap.getString("PLMETHODID").equals("process.epc") || fileRowMap.getString("PLMETHODID").equals("process.flowchart")) {
|
||||||
|
fileMap.put("fileType", "processFile");
|
||||||
|
} else if (fileRowMap.getString("PLMETHODID").equals("control.policy") && (fileRowMap.getString("POLICYTYPE").equals("regulation") || null == fileRowMap.getString("POLICYTYPE") || fileRowMap.getString("POLICYTYPE").equals(""))) {
|
||||||
|
// && fileRowMap.getString("POLICYTYPE").equals("regulation")
|
||||||
|
fileMap.put("fileType", "policyFile");
|
||||||
|
} else if (fileRowMap.getString("PLMETHODID").equals("control.policy") && fileRowMap.getString("POLICYTYPE").equals("I/O_L4")) {
|
||||||
|
fileMap.put("fileType", "guideFile");
|
||||||
|
} else if (fileRowMap.getString("PLMETHODID").equals("data.form")) {
|
||||||
|
fileMap.put("fileType", "formFile");
|
||||||
|
}
|
||||||
|
fileMaps.add(fileMap);
|
||||||
|
}
|
||||||
|
System.out.println("fileMaps============"+fileMaps);
|
||||||
|
|
||||||
|
|
||||||
|
List<Map> fileTreeNodes = TreeUtil.buildTree("1", fileMaps, null, "frame", null, null);
|
||||||
|
ro.put("fileMaps", fileTreeNodes);
|
||||||
|
System.err.println("============fileMaps============" + fileMaps);
|
||||||
|
System.err.println("============fileTreeNodes==========" + fileTreeNodes);
|
||||||
|
return ro.toString();
|
||||||
} else {
|
} else {
|
||||||
ro.ok("无效架构");
|
ro.ok("暂无文件");
|
||||||
fileMaps = new ArrayList<>();
|
fileMaps = new ArrayList<>();
|
||||||
ro.put("fileMaps", fileMaps);
|
ro.put("fileMaps", fileMaps);
|
||||||
return ro.toString();
|
return ro.toString();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ro.ok("未传入有效架构ID");
|
ro.ok("无效架构");
|
||||||
|
fileMaps = new ArrayList<>();
|
||||||
|
ro.put("fileMaps", fileMaps);
|
||||||
|
return ro.toString();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
return ro.toString();
|
ro.ok("未传入有效架构ID");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return ro.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static String getAppendOrAndInString(List<String> list){
|
||||||
|
StringBuffer sb=new StringBuffer();
|
||||||
|
String returnString="";
|
||||||
|
sb.append("(");
|
||||||
|
for(int i=0;i<list.size();i++){
|
||||||
|
if(i==0){
|
||||||
|
sb.append("EXT6 ");
|
||||||
|
sb.append(" in (");
|
||||||
|
}
|
||||||
|
sb.append("'").append(list.get(i).toString()).append("'");
|
||||||
|
if(i>=900&&i<list.size()-1){
|
||||||
|
if(i%900==0){
|
||||||
|
sb.append(") or ");
|
||||||
|
sb.append("EXT6");
|
||||||
|
sb.append(" in (");
|
||||||
|
}else{
|
||||||
|
sb.append(",");
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if(i<list.size()-1){
|
||||||
|
sb.append(",");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(i==list.size()-1){
|
||||||
|
sb.substring(0,sb.length()-1);
|
||||||
|
sb.append(")");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sb.append(")");
|
||||||
|
returnString=sb.toString();
|
||||||
|
return returnString;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user