From b4aceb39c30b4e106a14e0868eeb9c34922c3e6d Mon Sep 17 00:00:00 2001 From: zhal <15900249928@163.com> Date: Mon, 15 Jul 2024 15:39:15 +0800 Subject: [PATCH] =?UTF-8?q?=E9=83=A8=E9=97=A8=E8=A7=86=E5=9B=BE=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../reportform/service/DataViewService.java | 75 +++++++++++++++---- 1 file changed, 61 insertions(+), 14 deletions(-) diff --git a/com.awspaas.user.apps.yili.reportform/src/com/awspaas/user/apps/yili/reportform/service/DataViewService.java b/com.awspaas.user.apps.yili.reportform/src/com/awspaas/user/apps/yili/reportform/service/DataViewService.java index f85fd70f..c2d91bce 100644 --- a/com.awspaas.user.apps.yili.reportform/src/com/awspaas/user/apps/yili/reportform/service/DataViewService.java +++ b/com.awspaas.user.apps.yili.reportform/src/com/awspaas/user/apps/yili/reportform/service/DataViewService.java @@ -69,7 +69,7 @@ public class DataViewService extends ActionWeb { // 当前登录信息 ArrayList currentLoginMaps = new ArrayList<>(); LinkedHashMap currentLoginMap = new LinkedHashMap<>(); - currentLoginMap = new LinkedHashMap<>(); + /*currentLoginMap = new LinkedHashMap<>(); currentLoginMap.put("title", "账号"); currentLoginMap.put("text", uc.getUserModel().getUID()); currentLoginMaps.add(currentLoginMap); @@ -80,9 +80,9 @@ public class DataViewService extends ActionWeb { currentLoginMap = new LinkedHashMap<>(); currentLoginMap.put("title", "部门"); currentLoginMap.put("text", uc.getDepartmentModel().getName()); - currentLoginMaps.add(currentLoginMap); + currentLoginMaps.add(currentLoginMap);*/ currentLoginMap = new LinkedHashMap<>(); - currentLoginMap.put("title", "岗位"); + currentLoginMap.put("title", "我的岗位"); currentLoginMap.put("text", uc.getUserModel().getPositionName()); currentLoginMaps.add(currentLoginMap); ro.put("personInfos", currentLoginMaps); @@ -1196,8 +1196,6 @@ public class DataViewService extends ActionWeb { new_DepartnodeRowMaps) { DepartnodeRowMaps.add(rowMap); } - System.out.println("=========nodeRowMaps========>" + nodeRowMaps); - System.out.println("=========DepartnodeRowMaps========>" + DepartnodeRowMaps); for (RowMap nodeRowMap : nodeRowMaps) { String plId = nodeRowMap.getString("PLID"); RowMap fileRowMap = DBSql.getMap( @@ -1678,6 +1676,10 @@ public class DataViewService extends ActionWeb { fileType.put("termsKey", "formFile"); fileType.put("termsVal", "表单/模板"); fileTypes.add(fileType); + fileType = new HashMap(); + fileType.put("termsKey", "engineeringtandardFile"); + fileType.put("termsVal", "工程技术标准"); + fileTypes.add(fileType); ro.put("fileTypes", fileTypes); return ro.toString(); @@ -1705,7 +1707,7 @@ public class DataViewService extends ActionWeb { String fileType = params.get("fileType"); ArrayList deptIDList = new ArrayList<>(); ArrayList 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 fileHandleRowMaps = new ArrayList<>(); Map reFileMap = new HashMap<>(); RowMap reFileRowMap = new RowMap(reFileMap); @@ -1782,10 +1784,9 @@ public class DataViewService extends ActionWeb { } 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); List maps = DBSql.getMaps(sqltt); - SDK.getLogAPI().consoleInfo("maps是多少个>>>>>>>>>>>>" + maps.size()); List last_maps = new LinkedList<>(); for (RowMap map : maps) { @@ -1821,7 +1822,7 @@ public class DataViewService extends ActionWeb { getArrt("support_files", 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); // 相关文件 @@ -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")) { fileHandleRowMaps.add(fileRowMap); } @@ -1903,7 +1911,6 @@ public class DataViewService extends ActionWeb { // reFileRowMap); } fileRowMaps = fileHandleRowMaps; - System.err.println("=======fileRowMaps=========" + fileRowMaps); // 遍历选择的结果 List fileMaps = new ArrayList<>(); List frameRowMaps = new ArrayList<>(); @@ -1915,6 +1922,8 @@ public class DataViewService extends ActionWeb { Integer policyFileNum = 0; Integer guideFileNum = 0; Integer formFileNum = 0; + Integer engineeringtandardFileNum=0; + String path = ""; PALRepositoryModel model = null; String taskId = ""; @@ -1954,7 +1963,6 @@ public class DataViewService extends ActionWeb { frameMap.put("nodeType", nodeType); fileMaps.add(frameMap); } - // System.err.println("=====fileRowMaps1=====>" + fileRowMaps); for (RowMap fileRowMap : fileRowMaps) { fileMap = new HashMap(); @@ -1976,7 +1984,11 @@ public class DataViewService extends ActionWeb { } else if (fileRowMap.getString("PLMETHODID").equals("data.form")) { fileMap.put("fileType", "formFile"); formFileNum += 1; + } else if(fileRowMap.getString("PLMETHODID").equals("engineering.standard")){ + fileMap.put("fileType", "engineeringtandardFile"); + engineeringtandardFileNum += 1; } + model = PALRepositoryCache.getCache().get(fileRowMap.getString("FILEID")); if (null != model) { taskId = getLastPublishTaskIdByModelId(model.getId()); @@ -2009,11 +2021,12 @@ public class DataViewService extends ActionWeb { Integer policyFile = 0; Integer guideFile = 0; Integer formFile = 0; + Integer engineeringtandardFile = 0; HashMap fileSortMap = new HashMap<>(); // List fileRowMaps = DBSql.getMaps( "SELECT // FILEID,PLMETHODID,POLICYTYPE FROM BO_EU_PAL_FILE1 WHERE FILESTATE='1'"); List 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 fileRowMaps = DBSql.getMaps( "SELECT // FILEID,PLMETHODID,POLICYTYPE FROM BO_EU_PAL_FILE1 WHERE FILESTATE='1'"); if (null != fileRowMapss && !fileRowMapss.isEmpty()) { @@ -2033,6 +2046,9 @@ public class DataViewService extends ActionWeb { } else if (fileRowMap.getString("PLMETHODID").equals("data.form")) { fileTotal += 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("guideFileNum", guideFile); filesCount.put("formFileNum", formFile); + filesCount.put("engineeringtandardFileNum", engineeringtandardFile); + ro.put("filesCount", filesCount); } else { @@ -2051,11 +2069,13 @@ public class DataViewService extends ActionWeb { filesCount.put("policyFileNum", policyFileNum); filesCount.put("guideFileNum", guideFileNum); filesCount.put("formFileNum", formFileNum); + filesCount.put("engineeringtandardFileNum", engineeringtandardFileNum); ro.put("filesCount", filesCount); } List fileTreeNodes = TreeUtil.buildTree("0", fileMaps, "process", "frame", null, null); - ro.put("fileMaps", fileTreeNodes); + ro.put("fileMaps", fileMaps); + return ro.toString(); } else { filesCount = new LinkedHashMap<>(); @@ -2063,6 +2083,7 @@ public class DataViewService extends ActionWeb { filesCount.put("policyFileNum", policyFileNum); filesCount.put("guideFileNum", guideFileNum); filesCount.put("formFileNum", formFileNum); + filesCount.put("engineeringtandardFileNum", engineeringtandardFileNum); ro.ok("暂无文件"); ro.put("fileMaps", fileMaps); ro.put("filesCount", filesCount); @@ -2075,7 +2096,6 @@ public class DataViewService extends ActionWeb { } finally { // System.err.println("====执行完毕====>"); } - System.out.println("ro=================" + 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); } */