diff --git a/com.actionsoft.apps.coe.pal.processlist/src/com/actionsoft/apps/coe/pal/processlist/web/PALRepositoryListWeb.java b/com.actionsoft.apps.coe.pal.processlist/src/com/actionsoft/apps/coe/pal/processlist/web/PALRepositoryListWeb.java index 3b390123..2c21d89d 100644 --- a/com.actionsoft.apps.coe.pal.processlist/src/com/actionsoft/apps/coe/pal/processlist/web/PALRepositoryListWeb.java +++ b/com.actionsoft.apps.coe.pal.processlist/src/com/actionsoft/apps/coe/pal/processlist/web/PALRepositoryListWeb.java @@ -3,6 +3,7 @@ package com.actionsoft.apps.coe.pal.processlist.web; import java.io.File; import java.io.FileOutputStream; import java.sql.Timestamp; +import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; @@ -117,6 +118,35 @@ public class PALRepositoryListWeb extends ActionWeb { macroLibraries.put("defaultSelectVal", defaultSelectVal); macroLibraries.put("teamId", teamId); macroLibraries.put("settingParam", JSON.toJSON(macroLibraries)); + JSONArray processStatusFilters = getProcessStatusFilters(); + for(int i=0;i palMethodCategoryList = PALMethodCache.getPALMethodList(true); + JSONArray categorySelect = new JSONArray(); + for (int i=0;i list = PALMethodCache.getPALMethodModelListByMethod(s); + for (PALMethodModel model : list) { + JSONObject category = new JSONObject(); + category.put("value", model.getId()); + category.put("label", I18nRes.findValue(CoEConstant.APP_ID, model.getId())); + categorySelect.add(category); + } + } + macroLibraries.put("categorySelect", categorySelect); // 操作行为日志记录 if (SDK.getAppAPI().getPropertyBooleanValue(CoEConstant.APP_ID, "IS_RECORD_OP_LOG", false)) { CoEOpLogAPI.auditOkOp(_uc, CoEOpLogConst.MODULE_CATEGORY_APPCENTER, CoEOpLogConst.OP_ACCESS, CoEOpLogConst.INFO_APPCENTER_ACCESS_PREFIX + SDK.getAppAPI().getAppContext(ProcessListConstant.PROCESSLIST).getName() + CoEOpLogConst.INFO_APPCENTER_ACCESS_SUFFIX); @@ -664,10 +694,98 @@ public class PALRepositoryListWeb extends ActionWeb { permVerIds = CoeProcessLevelUtil.getPermRepositoryVersionIds(wsId, teamId, _uc.getUID(), null, null); } + //文件状态 + JSONArray statusFilter = customFilterObj.getJSONArray("statusFilter");//流程架构L1 + Set statusSet = new HashSet<>(); + for (int i = 0; i < statusFilter.size(); i++) { + statusSet.add(statusFilter.getString(i)); + } + //使用状态 + JSONArray useFilter = customFilterObj.getJSONArray("useStatusFilter"); + Set useSet = new HashSet<>(); + for (int i = 0; i < useFilter.size(); i++) { + useSet.add(useFilter.getString(i)); + } + //生效日期 + JSONArray effectiveDate = customFilterObj.getJSONArray("effectiveDate"); + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); + long startTime = 0; + if (effectiveDate.size() > 0){ + String startTimeString = effectiveDate.getString(0); + try { + Date date = formatter.parse(startTimeString); + startTime = date.getTime(); + } catch (ParseException e) { + System.out.println("流程清单数据过滤时,生效日期的开始时间转化失败"); + e.printStackTrace(); + } + } + long endTime = 0; + if (effectiveDate.size() > 1){ + String endTimeString = effectiveDate.getString(1); + try { + Date date = formatter.parse(endTimeString); + endTime = date.getTime(); + } catch (ParseException e) { + System.out.println("流程清单数据过滤时,生效日期的结束时间转化失败"); + e.printStackTrace(); + } + } + //流程分类 + JSONArray categoryFilter = customFilterObj.getJSONArray("categoryFilter"); + Set categorySet = new HashSet<>(); + for (int i = 0; i < categoryFilter.size(); i++) { + categorySet.add(categoryFilter.getString(i)); + } for (PALRepositoryModel model: palList) { // if (!model.isUse()) {// 非设计中状态,过滤 // continue; // } + //文件状态 + if (statusSet.size()>0){ + String type = model.isPublish()?"publish":model.isStop()?"stop":"designer"; + if (!statusSet.contains( type)){ + continue; + } + } + //使用状态 + if (useSet.size()>0){ + String isUse= model.isUse()?"1":"2"; + if (!useSet.contains(isUse)){ + continue; + } + } + //流程分类 + if (categorySet.size()>0){ + if (!categorySet.contains(model.getMethodId())){ + continue; + } + } + + //生效日期 + if (startTime > 0 || endTime > 0) { + try { + PALRepositoryPropertyModel propModel = PALRepositoryPropertyCache.getPropertyByPropertyId(model.getId(), "fileExpiryDate"); + if (propModel == null) { + continue; + } + String expiryDate = propModel.getPropertyValue(); + if (UtilString.isEmpty(expiryDate)) { + continue; + } + Date date = formatter.parse(expiryDate); + if (startTime > 0 && date.getTime() <= startTime) { + continue; + } + if (endTime > 0 && date.getTime() >= endTime) { + continue; + } + } catch (Exception e) { + System.out.println("流程清单数据过滤时,文件有效期转化失败"); + e.printStackTrace(); + } + } + if (!UtilString.isEmpty(searchInput)) {// 流程名称条件不为空时,过滤名称 if (!model.getName().toUpperCase().contains(searchInput.toUpperCase())) { continue;