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