流程发布变更时文件选择过滤调整
This commit is contained in:
parent
70dd07546a
commit
aa5fc98a1f
@ -2395,7 +2395,7 @@ public class ProcessPublishWeb extends ActionWeb {
|
||||
* @return
|
||||
*/
|
||||
private JSONArray getPublishedRepositoryTreeData2(String wsId, String teamId) {
|
||||
PALRepository dao = new PALRepository();
|
||||
PALRepository dao = new PALRepository();
|
||||
if (UtilString.isNotEmpty(teamId)) {
|
||||
// 小组Id不为空,则需要查询小组授权后的流程库
|
||||
CoeCooperationTeamModel team = CoeCooperationAPIManager.getInstance().queryCooperationTeamById(teamId, true);
|
||||
@ -2404,40 +2404,58 @@ public class ProcessPublishWeb extends ActionWeb {
|
||||
}
|
||||
List<PALRepositoryModel> orglist = dao.getPublishedRepositoryList(wsId);
|
||||
|
||||
List<PALRepositoryModel> list1 = new ArrayList<PALRepositoryModel>();
|
||||
for (PALRepositoryModel palRepositoryModel : orglist) {
|
||||
String versionId = palRepositoryModel.getVersionId();
|
||||
List<PALRepositoryModel> temp = PALRepositoryCache.getByVersionId(wsId,versionId);
|
||||
for (PALRepositoryModel repositoryModel : temp) {
|
||||
if(!repositoryModel.isPublish()&&!repositoryModel.isStop()) {
|
||||
|
||||
//根据名称去重
|
||||
List<PALRepositoryModel> list = orglist.stream().collect(Collectors.collectingAndThen(
|
||||
Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(PALRepositoryModel::getName))), ArrayList::new));
|
||||
list1.add(palRepositoryModel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// List<String> versionIds = CoeCooperationAPIManager.getInstance().queryCooperationRoleDataPermByTeamUser(teamId, _uc.getUID());
|
||||
Set<String> versionIds = CooperationCache.getUserDataVisitablePermission(teamId, _uc.getUID(), false);
|
||||
if (UtilString.isNotEmpty(teamId))
|
||||
if (list != null) {
|
||||
List<PALRepositoryModel> removeList = new ArrayList<PALRepositoryModel>();
|
||||
for (PALRepositoryModel model : list)
|
||||
if (!versionIds.contains(model.getVersionId()))
|
||||
removeList.add(model);
|
||||
list.removeAll(removeList);
|
||||
}
|
||||
|
||||
// 只获取有未发布版本的已发布流程文件
|
||||
List<PALRepositoryModel> list2 = new ArrayList<>();
|
||||
for (PALRepositoryModel model : list) {
|
||||
List<PALRepositoryModel> temp = PALRepositoryCache.getByVersionId(model.getWsId(), model.getVersionId());
|
||||
if (temp != null && temp.size() > 1) {
|
||||
//判断历史版本是否存在未发布,如果有则添加
|
||||
if(temp.stream()
|
||||
.filter(item->item.isPublish()
|
||||
==false)
|
||||
.findAny()
|
||||
.isPresent()) {
|
||||
list2.add(model);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* //根据名称去重 List<PALRepositoryModel> list =
|
||||
* orglist.stream().collect(Collectors.collectingAndThen(
|
||||
* Collectors.toCollection(() -> new
|
||||
* TreeSet<>(Comparator.comparing(PALRepositoryModel::getName))),
|
||||
* ArrayList::new));
|
||||
*
|
||||
*
|
||||
* // List<String> versionIds =
|
||||
* CoeCooperationAPIManager.getInstance().queryCooperationRoleDataPermByTeamUser
|
||||
* (teamId, _uc.getUID()); Set<String> versionIds =
|
||||
* CooperationCache.getUserDataVisitablePermission(teamId, _uc.getUID(), false);
|
||||
* if (UtilString.isNotEmpty(teamId)) if (list != null) {
|
||||
* List<PALRepositoryModel> removeList = new ArrayList<PALRepositoryModel>();
|
||||
* for (PALRepositoryModel model : list) if
|
||||
* (!versionIds.contains(model.getVersionId())) removeList.add(model);
|
||||
* list.removeAll(removeList); }
|
||||
*
|
||||
* // 只获取有未发布版本的已发布流程文件 List<PALRepositoryModel> list2 = new ArrayList<>(); for
|
||||
* (PALRepositoryModel model : list) { List<PALRepositoryModel> temp =
|
||||
* PALRepositoryCache.getByVersionId(model.getWsId(), model.getVersionId()); if
|
||||
* (temp != null && temp.size() > 1) { //判断历史版本是否存在未发布,如果有则添加 if(temp.stream()
|
||||
* .filter(item->item.isPublish() ==false) .findAny() .isPresent()) {
|
||||
* list2.add(model); } } }
|
||||
*/
|
||||
JSONArray treeData = getRepositoryTree(list1, wsId, false, true, "-", false);
|
||||
JSONArray treeData2 = new JSONArray();
|
||||
for (Object object : treeData) {
|
||||
JSONObject parseObject = JSONObject.parseObject(object.toString());
|
||||
String name = parseObject.getString("name");
|
||||
if(!"流程制度".equals(name)) {
|
||||
String versionId = parseObject.getString("versionId");
|
||||
String sql = "SELECT PLNAME FROM APP_ACT_COE_PAL_REPOSITORY WHERE PLVERSIONID = '"+versionId+"' and ISPUBLISH = '0' and ISSTOP = '0' ";
|
||||
String newName = DBSql.getString(sql);
|
||||
parseObject.remove("name");
|
||||
parseObject.put("name", newName);
|
||||
}
|
||||
treeData2.add(parseObject);
|
||||
}
|
||||
JSONArray treeData = getRepositoryTree(list2, wsId, false, true, "-", false);
|
||||
return treeData;
|
||||
return treeData2;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user