部门视图提交

This commit is contained in:
zhal 2024-07-15 15:39:15 +08:00
parent c1f26781be
commit b4aceb39c3

View File

@ -69,7 +69,7 @@ public class DataViewService extends ActionWeb {
// 当前登录信息 // 当前登录信息
ArrayList<Map> currentLoginMaps = new ArrayList<>(); ArrayList<Map> currentLoginMaps = new ArrayList<>();
LinkedHashMap<String, Object> currentLoginMap = new LinkedHashMap<>(); LinkedHashMap<String, Object> currentLoginMap = new LinkedHashMap<>();
currentLoginMap = new LinkedHashMap<>(); /*currentLoginMap = new LinkedHashMap<>();
currentLoginMap.put("title", "账号"); currentLoginMap.put("title", "账号");
currentLoginMap.put("text", uc.getUserModel().getUID()); currentLoginMap.put("text", uc.getUserModel().getUID());
currentLoginMaps.add(currentLoginMap); currentLoginMaps.add(currentLoginMap);
@ -80,9 +80,9 @@ public class DataViewService extends ActionWeb {
currentLoginMap = new LinkedHashMap<>(); currentLoginMap = new LinkedHashMap<>();
currentLoginMap.put("title", "部门"); currentLoginMap.put("title", "部门");
currentLoginMap.put("text", uc.getDepartmentModel().getName()); currentLoginMap.put("text", uc.getDepartmentModel().getName());
currentLoginMaps.add(currentLoginMap); currentLoginMaps.add(currentLoginMap);*/
currentLoginMap = new LinkedHashMap<>(); currentLoginMap = new LinkedHashMap<>();
currentLoginMap.put("title", "岗位"); currentLoginMap.put("title", "我的岗位");
currentLoginMap.put("text", uc.getUserModel().getPositionName()); currentLoginMap.put("text", uc.getUserModel().getPositionName());
currentLoginMaps.add(currentLoginMap); currentLoginMaps.add(currentLoginMap);
ro.put("personInfos", currentLoginMaps); ro.put("personInfos", currentLoginMaps);
@ -1196,8 +1196,6 @@ public class DataViewService extends ActionWeb {
new_DepartnodeRowMaps) { new_DepartnodeRowMaps) {
DepartnodeRowMaps.add(rowMap); DepartnodeRowMaps.add(rowMap);
} }
System.out.println("=========nodeRowMaps========>" + nodeRowMaps);
System.out.println("=========DepartnodeRowMaps========>" + DepartnodeRowMaps);
for (RowMap nodeRowMap : nodeRowMaps) { for (RowMap nodeRowMap : nodeRowMaps) {
String plId = nodeRowMap.getString("PLID"); String plId = nodeRowMap.getString("PLID");
RowMap fileRowMap = DBSql.getMap( RowMap fileRowMap = DBSql.getMap(
@ -1678,6 +1676,10 @@ public class DataViewService extends ActionWeb {
fileType.put("termsKey", "formFile"); fileType.put("termsKey", "formFile");
fileType.put("termsVal", "表单/模板"); fileType.put("termsVal", "表单/模板");
fileTypes.add(fileType); fileTypes.add(fileType);
fileType = new HashMap<String, Object>();
fileType.put("termsKey", "engineeringtandardFile");
fileType.put("termsVal", "工程技术标准");
fileTypes.add(fileType);
ro.put("fileTypes", fileTypes); ro.put("fileTypes", fileTypes);
return ro.toString(); return ro.toString();
@ -1705,7 +1707,7 @@ public class DataViewService extends ActionWeb {
String fileType = params.get("fileType"); String fileType = params.get("fileType");
ArrayList<String> deptIDList = new ArrayList<>(); ArrayList<String> deptIDList = new ArrayList<>();
ArrayList<String> deptIDList2 = new ArrayList<>(); ArrayList<String> deptIDList2 = new ArrayList<>();
String sql = "SELECT ID AS FILEID,PLNAME,PLPARENTID,PLMETHODID,PLLEVEL,PLVERSIONID,PLORDERINDEX,EXT3 as POLICYTYPE FROM APP_ACT_COE_PAL_REPOSITORY WHERE ISPUBLISH = 1 AND EXT5 = '1' AND PLMETHODID in ('process.epc','control.policy','process.flowchart')"; String sql = "SELECT ID AS FILEID,PLNAME,PLPARENTID,PLMETHODID,PLLEVEL,PLVERSIONID,PLORDERINDEX,EXT3 as POLICYTYPE FROM APP_ACT_COE_PAL_REPOSITORY WHERE ISPUBLISH = 1 AND EXT5 = '1' AND PLMETHODID in ('process.epc','control.policy','process.flowchart','engineering.standard')";
ArrayList<RowMap> fileHandleRowMaps = new ArrayList<>(); ArrayList<RowMap> fileHandleRowMaps = new ArrayList<>();
Map<String, Object> reFileMap = new HashMap<>(); Map<String, Object> reFileMap = new HashMap<>();
RowMap reFileRowMap = new RowMap(reFileMap); RowMap reFileRowMap = new RowMap(reFileMap);
@ -1782,10 +1784,9 @@ public class DataViewService extends ActionWeb {
} }
try { try {
String sqltt = "SELECT ID AS FILEID,PLNAME,PLPARENTID,PLMETHODID,PLLEVEL,PLVERSIONID,PLORDERINDEX,EXT3 as POLICYTYPE,EXT6 FROM APP_ACT_COE_PAL_REPOSITORY WHERE ISPUBLISH = 1 AND ISSTOP =0 AND EXT5 = '1' AND EXT6 IS NOT NULL AND PLMETHODID in ('process.epc','control.policy','process.flowchart')"; String sqltt = "SELECT ID AS FILEID,PLNAME,PLPARENTID,PLMETHODID,PLLEVEL,PLVERSIONID,PLORDERINDEX,EXT3 as POLICYTYPE,EXT6 FROM APP_ACT_COE_PAL_REPOSITORY WHERE ISPUBLISH = 1 AND ISSTOP =0 AND EXT5 = '1' AND EXT6 IS NOT NULL AND PLMETHODID in ('process.epc','control.policy','process.flowchart','engineering.standard')";
SDK.getLogAPI().consoleInfo("sql>>>>>>>>>>>>>>" + sqltt); SDK.getLogAPI().consoleInfo("sql>>>>>>>>>>>>>>" + sqltt);
List<RowMap> maps = DBSql.getMaps(sqltt); List<RowMap> maps = DBSql.getMaps(sqltt);
SDK.getLogAPI().consoleInfo("maps是多少个>>>>>>>>>>>>" + maps.size());
List<RowMap> last_maps = new LinkedList<>(); List<RowMap> last_maps = new LinkedList<>();
for (RowMap map : for (RowMap map :
maps) { maps) {
@ -1821,7 +1822,7 @@ public class DataViewService extends ActionWeb {
getArrt("support_files", model, dempId, PLLEVEL, reFileRowMap, fileHandleRowMaps); getArrt("support_files", model, dempId, PLLEVEL, reFileRowMap, fileHandleRowMaps);
// 相关文件 // 相关文件
getArrt("R_relevant_flies", model, dempId, PLLEVEL, reFileRowMap, fileHandleRowMaps); getArrt("R_relevant_flies", model, dempId, PLLEVEL, reFileRowMap, fileHandleRowMaps);
} else if ("control.policy".equals(methodId)) { } else if ("control.policy".equals(methodId) || "engineering.standard".equals(methodId) ) {
// 支持文件 // 支持文件
getArrt("support_files", model, dempId, PLLEVEL, reFileRowMap, fileHandleRowMaps); getArrt("support_files", model, dempId, PLLEVEL, reFileRowMap, fileHandleRowMaps);
// 相关文件 // 相关文件
@ -1891,6 +1892,13 @@ public class DataViewService extends ActionWeb {
} }
} }
if (fileType.equals("engineeringtandardFile")) {
if (fileRowMap.getString("PLMETHODID").equals("engineering.standard")) {
fileHandleRowMaps.add(fileRowMap);
}
}
if (fileType.equals("totalFile")) { if (fileType.equals("totalFile")) {
fileHandleRowMaps.add(fileRowMap); fileHandleRowMaps.add(fileRowMap);
} }
@ -1903,7 +1911,6 @@ public class DataViewService extends ActionWeb {
// reFileRowMap); // reFileRowMap);
} }
fileRowMaps = fileHandleRowMaps; fileRowMaps = fileHandleRowMaps;
System.err.println("=======fileRowMaps=========" + fileRowMaps);
// 遍历选择的结果 // 遍历选择的结果
List<Map> fileMaps = new ArrayList<>(); List<Map> fileMaps = new ArrayList<>();
List<RowMap> frameRowMaps = new ArrayList<>(); List<RowMap> frameRowMaps = new ArrayList<>();
@ -1915,6 +1922,8 @@ public class DataViewService extends ActionWeb {
Integer policyFileNum = 0; Integer policyFileNum = 0;
Integer guideFileNum = 0; Integer guideFileNum = 0;
Integer formFileNum = 0; Integer formFileNum = 0;
Integer engineeringtandardFileNum=0;
String path = ""; String path = "";
PALRepositoryModel model = null; PALRepositoryModel model = null;
String taskId = ""; String taskId = "";
@ -1954,7 +1963,6 @@ public class DataViewService extends ActionWeb {
frameMap.put("nodeType", nodeType); frameMap.put("nodeType", nodeType);
fileMaps.add(frameMap); fileMaps.add(frameMap);
} }
// System.err.println("=====fileRowMaps1=====>" + fileRowMaps);
for (RowMap fileRowMap : fileRowMaps) { for (RowMap fileRowMap : fileRowMaps) {
fileMap = new HashMap<String, Object>(); fileMap = new HashMap<String, Object>();
@ -1976,7 +1984,11 @@ public class DataViewService extends ActionWeb {
} else if (fileRowMap.getString("PLMETHODID").equals("data.form")) { } else if (fileRowMap.getString("PLMETHODID").equals("data.form")) {
fileMap.put("fileType", "formFile"); fileMap.put("fileType", "formFile");
formFileNum += 1; formFileNum += 1;
} else if(fileRowMap.getString("PLMETHODID").equals("engineering.standard")){
fileMap.put("fileType", "engineeringtandardFile");
engineeringtandardFileNum += 1;
} }
model = PALRepositoryCache.getCache().get(fileRowMap.getString("FILEID")); model = PALRepositoryCache.getCache().get(fileRowMap.getString("FILEID"));
if (null != model) { if (null != model) {
taskId = getLastPublishTaskIdByModelId(model.getId()); taskId = getLastPublishTaskIdByModelId(model.getId());
@ -2009,11 +2021,12 @@ public class DataViewService extends ActionWeb {
Integer policyFile = 0; Integer policyFile = 0;
Integer guideFile = 0; Integer guideFile = 0;
Integer formFile = 0; Integer formFile = 0;
Integer engineeringtandardFile = 0;
HashMap<String, Object> fileSortMap = new HashMap<>(); HashMap<String, Object> fileSortMap = new HashMap<>();
// List<RowMap> fileRowMaps = DBSql.getMaps( "SELECT // List<RowMap> fileRowMaps = DBSql.getMaps( "SELECT
// FILEID,PLMETHODID,POLICYTYPE FROM BO_EU_PAL_FILE1 WHERE FILESTATE='1'"); // FILEID,PLMETHODID,POLICYTYPE FROM BO_EU_PAL_FILE1 WHERE FILESTATE='1'");
List<RowMap> fileRowMapss = DBSql.getMaps( List<RowMap> fileRowMapss = DBSql.getMaps(
"SELECT ID AS FILEID,EXT6 AS PUBDEPT,PLMETHODID,EXT5 AS FILESTATE,EXT3 AS POLICYTYPE FROM APP_ACT_COE_PAL_REPOSITORY WHERE ISPUBLISH = '1' AND EXT5 = '1' AND PLMETHODID in ('process.epc','process.flowchart','control.policy','data.form')"); "SELECT ID AS FILEID,EXT6 AS PUBDEPT,PLMETHODID,EXT5 AS FILESTATE,EXT3 AS POLICYTYPE FROM APP_ACT_COE_PAL_REPOSITORY WHERE ISPUBLISH = '1' AND EXT5 = '1' AND PLMETHODID in ('process.epc','process.flowchart','control.policy','data.form','engineering.standard')");
// List<RowMap> fileRowMaps = DBSql.getMaps( "SELECT // List<RowMap> fileRowMaps = DBSql.getMaps( "SELECT
// FILEID,PLMETHODID,POLICYTYPE FROM BO_EU_PAL_FILE1 WHERE FILESTATE='1'"); // FILEID,PLMETHODID,POLICYTYPE FROM BO_EU_PAL_FILE1 WHERE FILESTATE='1'");
if (null != fileRowMapss && !fileRowMapss.isEmpty()) { if (null != fileRowMapss && !fileRowMapss.isEmpty()) {
@ -2033,6 +2046,9 @@ public class DataViewService extends ActionWeb {
} else if (fileRowMap.getString("PLMETHODID").equals("data.form")) { } else if (fileRowMap.getString("PLMETHODID").equals("data.form")) {
fileTotal += 1; fileTotal += 1;
formFile += 1; formFile += 1;
} else if(fileRowMap.getString("PLMETHODID").equals("engineering.standard")){
fileTotal += 1;
engineeringtandardFile += 1;
} }
} }
} }
@ -2042,6 +2058,8 @@ public class DataViewService extends ActionWeb {
filesCount.put("policyFileNum", policyFile); filesCount.put("policyFileNum", policyFile);
filesCount.put("guideFileNum", guideFile); filesCount.put("guideFileNum", guideFile);
filesCount.put("formFileNum", formFile); filesCount.put("formFileNum", formFile);
filesCount.put("engineeringtandardFileNum", engineeringtandardFile);
ro.put("filesCount", filesCount); ro.put("filesCount", filesCount);
} else { } else {
@ -2051,11 +2069,13 @@ public class DataViewService extends ActionWeb {
filesCount.put("policyFileNum", policyFileNum); filesCount.put("policyFileNum", policyFileNum);
filesCount.put("guideFileNum", guideFileNum); filesCount.put("guideFileNum", guideFileNum);
filesCount.put("formFileNum", formFileNum); filesCount.put("formFileNum", formFileNum);
filesCount.put("engineeringtandardFileNum", engineeringtandardFileNum);
ro.put("filesCount", filesCount); ro.put("filesCount", filesCount);
} }
List<Map> fileTreeNodes = TreeUtil.buildTree("0", fileMaps, "process", "frame", null, null); List<Map> fileTreeNodes = TreeUtil.buildTree("0", fileMaps, "process", "frame", null, null);
ro.put("fileMaps", fileTreeNodes); ro.put("fileMaps", fileMaps);
return ro.toString(); return ro.toString();
} else { } else {
filesCount = new LinkedHashMap<>(); filesCount = new LinkedHashMap<>();
@ -2063,6 +2083,7 @@ public class DataViewService extends ActionWeb {
filesCount.put("policyFileNum", policyFileNum); filesCount.put("policyFileNum", policyFileNum);
filesCount.put("guideFileNum", guideFileNum); filesCount.put("guideFileNum", guideFileNum);
filesCount.put("formFileNum", formFileNum); filesCount.put("formFileNum", formFileNum);
filesCount.put("engineeringtandardFileNum", engineeringtandardFileNum);
ro.ok("暂无文件"); ro.ok("暂无文件");
ro.put("fileMaps", fileMaps); ro.put("fileMaps", fileMaps);
ro.put("filesCount", filesCount); ro.put("filesCount", filesCount);
@ -2075,7 +2096,6 @@ public class DataViewService extends ActionWeb {
} finally { } finally {
// System.err.println("====执行完毕====>"); // System.err.println("====执行完毕====>");
} }
System.out.println("ro=================" + ro.toString());
return ro.toString(); return ro.toString();
} }
@ -2165,6 +2185,33 @@ public class DataViewService extends ActionWeb {
} }
} }
} }
if (fileType.equals("engineeringtandardFile")) {
if (fileRowMap.getString("PLMETHODID").equals("engineering.standard")) {
try {
BaseModel defineModel = CoeDesignerAPIManager.getInstance()
.getDefinition(fileRowMap.getString("FILEID"), 0);
if (defineModel != null) {
String define = defineModel.getDefinition();
JSONObject definition = JSONObject.parseObject(define);
JSONObject elements = definition.getJSONObject("elements");
for (String key : elements.keySet()) {
JSONObject shape1 = elements.getJSONObject(key);
if ("I/O_L4".equals(shape1.getString("name"))) {
fileRowMap.put("POLICYTYPE", "I/O_L4");
fileHandleRowMaps.add(fileRowMap);
}
}
}
} catch (Exception e) {
// TODO: handle exception
}
}
}
/* /*
* if (fileType.equals("totalFile")) { fileHandleRowMaps.add(fileRowMap); } * if (fileType.equals("totalFile")) { fileHandleRowMaps.add(fileRowMap); }
*/ */