|
@@ -14,9 +14,8 @@ import org.springblade.core.tool.utils.Func;
|
|
|
import org.springblade.manager.dto.ArchiveTreeContractAutoRuleMapDTO;
|
|
|
import org.springblade.manager.dto.ArchiveTreeDTO;
|
|
|
import org.springblade.manager.dto.ArchiveTreeSortDTO;
|
|
|
-import org.springblade.manager.entity.ArchiveTree;
|
|
|
-import org.springblade.manager.entity.ArchiveTreeContract;
|
|
|
-import org.springblade.manager.entity.ProjectInfo;
|
|
|
+import org.springblade.manager.entity.*;
|
|
|
+import org.springblade.manager.mapper.ArchiveAutoRuleWbsMapper;
|
|
|
import org.springblade.manager.service.IProjectInfoService;
|
|
|
import org.springblade.manager.service.IWbsTreePrivateService;
|
|
|
import org.springblade.manager.service.IWbsTreeService;
|
|
@@ -41,6 +40,8 @@ public class ArchiveTreeServiceImpl extends BaseServiceImpl<ArchiveTreeMapper, A
|
|
|
private final IWbsTreePrivateService wbsTreePrivateService;
|
|
|
private final IProjectInfoService projectInfoService;
|
|
|
|
|
|
+ private final ArchiveAutoRuleWbsMapper archiveAutoRuleWbsMapper;
|
|
|
+
|
|
|
@Override
|
|
|
public boolean initArchiveTree() {
|
|
|
QueryWrapper<ArchiveTree> queryWrapper = new QueryWrapper<>();
|
|
@@ -431,20 +432,33 @@ public class ArchiveTreeServiceImpl extends BaseServiceImpl<ArchiveTreeMapper, A
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public boolean saveArchiveAutoRule(Integer archiveAutoType, String nodeIds) {
|
|
|
- //项目级不需要考虑是否为wbs节点,已经同步出来了都属于归档树节点,直接按归档树节点处理
|
|
|
+ public boolean saveArchiveAutoRule(Integer archiveAutoType, String nodeIds,boolean iswbsNode) {
|
|
|
+ if(iswbsNode){
|
|
|
+ return saveArchiveAutoRule_WbsTreeNode(archiveAutoType, nodeIds);
|
|
|
+ }else{
|
|
|
+ return saveArchiveAutoRule_ArchiveTreeNode(archiveAutoType, nodeIds);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 归档树节点规则设置保存(系统级)
|
|
|
+ * @param archiveAutoType
|
|
|
+ * @param nodeIds
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private Boolean saveArchiveAutoRule_ArchiveTreeNode(Integer archiveAutoType, String nodeIds){
|
|
|
try{
|
|
|
- //步骤1保存选择节点的立卷规则。
|
|
|
String[] ids = nodeIds.split(",");
|
|
|
-
|
|
|
Long archiveAutoGroupId=null;
|
|
|
-
|
|
|
//分类并卷规则的需要生成个随机数,作为同一个分类赋值archiveAutoNodeId
|
|
|
if(archiveAutoType==2){
|
|
|
- double ran=(Math.random()*100000000) + 1;
|
|
|
+ double v = Math.random() * 10000;
|
|
|
+ int ran = (int)v;
|
|
|
archiveAutoGroupId=Long.parseLong(System.currentTimeMillis()+""+ran);
|
|
|
}
|
|
|
+
|
|
|
for(String nodeId:ids){
|
|
|
+ //步骤1:保存选择节点的立卷规则。
|
|
|
long nodeIdLong = Long.parseLong(nodeId);
|
|
|
ArchiveTree archiveTree = baseMapper.selectById(nodeIdLong);
|
|
|
archiveTree.setArchiveAutoType(archiveAutoType);
|
|
@@ -459,157 +473,306 @@ public class ArchiveTreeServiceImpl extends BaseServiceImpl<ArchiveTreeMapper, A
|
|
|
}
|
|
|
baseMapper.updateById(archiveTree);
|
|
|
|
|
|
- //步骤2保存选择节点下所有子节点的立卷规则。注意立卷规则优先级覆盖原则。(单独组卷>分类并卷>最高并卷)
|
|
|
- baseMapper.updateAllSonNodeIdsForArchiveAutoRule(archiveTree);
|
|
|
+ //步骤2保存选择节点下所有子节点的立卷规则。注意立卷规则优先级覆盖原则。(单独组卷,分类并卷>最高并卷)
|
|
|
+ baseMapper.updateAllSonNodeIdsForArchiveAutoRule(
|
|
|
+ archiveTree.getArchiveAutoType(),
|
|
|
+ archiveTree.getArchiveAutoNodeId(),
|
|
|
+ archiveTree.getArchiveAutoGroupId(),
|
|
|
+ archiveTree.getAncestors()
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
return true;
|
|
|
-
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
- * 获取节点规则查看
|
|
|
- * @param id
|
|
|
+ * 归档树wbs节点规则设置保存(系统级)
|
|
|
+ * @param archiveAutoType
|
|
|
+ * @param nodeIds
|
|
|
* @return
|
|
|
*/
|
|
|
- @Override
|
|
|
- public Map<String,Object> getArchiveAutoRule(Long id) {
|
|
|
-
|
|
|
- Map<String,Object> map= new HashMap<>();
|
|
|
-
|
|
|
- ArchiveTree archiveTree = baseMapper.selectById(id);
|
|
|
- Integer archiveAutoType = archiveTree.getArchiveAutoType();
|
|
|
- if(archiveAutoType!=null){
|
|
|
- if(archiveAutoType==1){
|
|
|
- //最高并卷层级 默认规则的节点 显示最高并卷层级节点
|
|
|
- Long archiveAutoNodeId = archiveTree.getArchiveAutoNodeId();
|
|
|
- ArchiveTree archiveAutoNode = baseMapper.selectById(archiveAutoNodeId);
|
|
|
- StringBuffer allName= new StringBuffer();
|
|
|
- String ancestors = archiveAutoNode.getAncestors();
|
|
|
- String[] ancestorssplit = ancestors.split(",");//全路径ID
|
|
|
- for(String pId:ancestorssplit){
|
|
|
- long pIdLong = Long.parseLong(pId);
|
|
|
- ArchiveTree pIdNode = baseMapper.selectById(pIdLong);
|
|
|
- allName.append(pIdNode.getNodeName()+"/");
|
|
|
- }
|
|
|
- allName.append(archiveAutoNode.getNodeName());
|
|
|
- ArchiveTreeAutoRuleVO vo= new ArchiveTreeAutoRuleVO();
|
|
|
- vo.setAllName(allName.toString());
|
|
|
- vo.setNodeId(archiveAutoNode.getId());
|
|
|
- vo.setArchiveAutoType(archiveAutoType);
|
|
|
- map.put("type",archiveAutoType);
|
|
|
- map.put("data",vo);
|
|
|
- return map;
|
|
|
- }
|
|
|
+ private Boolean saveArchiveAutoRule_WbsTreeNode(Integer archiveAutoType, String nodeIds){
|
|
|
+ try{
|
|
|
+ String[] ids = nodeIds.split(",");
|
|
|
+ Long archiveAutoGroupId=null;
|
|
|
+ //分类并卷规则的需要生成个随机数,作为同一个分类赋值archiveAutoNodeId
|
|
|
if(archiveAutoType==2){
|
|
|
- //分类并卷显示所在大类下树结构,过滤单独规则,其他分类并卷规则组节点 本节点分类组显示打钩
|
|
|
- //找出当前节点大类
|
|
|
- String ancestors = archiveTree.getAncestors();
|
|
|
- String[] ancestorssplit = ancestors.split(",");//全路径ID
|
|
|
- String nodeAncestors = ancestorssplit[0]+","+ancestorssplit[1]; //大类的ancestors
|
|
|
- //获取大类下所有节点,过滤单独规则,其他分类并卷规则组节点
|
|
|
- List<ArchiveTreeAutoRuleVO> nodetree = ForestNodeMerger.merge(baseMapper.getAllSonNodeforGroupView(nodeAncestors, archiveTree.getArchiveAutoNodeId()));
|
|
|
- //获取与当前节点同一分类的节点
|
|
|
- List<ArchiveTree> listGroup= baseMapper.selectList(Wrappers.<ArchiveTree>lambdaQuery()
|
|
|
- .eq(ArchiveTree::getArchiveAutoGroupId, archiveTree.getArchiveAutoGroupId())
|
|
|
- .orderByAsc(ArchiveTree::getSort));
|
|
|
- StringBuffer nodeSelect = new StringBuffer();
|
|
|
-
|
|
|
- for(ArchiveTree node:listGroup){
|
|
|
- nodeSelect.append(node.getId()+",");
|
|
|
- }
|
|
|
- map.put("type",archiveAutoType);
|
|
|
- map.put("tree",nodetree);
|
|
|
- map.put("data",nodeSelect.toString());
|
|
|
- return map;
|
|
|
+ double ran=(Math.random()*100000000) + 1;
|
|
|
+ archiveAutoGroupId=Long.parseLong(System.currentTimeMillis()+""+ran);
|
|
|
}
|
|
|
- if(archiveAutoType==3){
|
|
|
- //单独组卷规则 显示当前节点
|
|
|
- StringBuffer allName= new StringBuffer();
|
|
|
- String ancestors = archiveTree.getAncestors();
|
|
|
- String[] ancestorssplit = ancestors.split(",");//全路径ID
|
|
|
- for(String pId:ancestorssplit){
|
|
|
- long pIdLong = Long.parseLong(pId);
|
|
|
- ArchiveTree pIdNode = baseMapper.selectById(pIdLong);
|
|
|
- allName.append(pIdNode.getNodeName()+"/");
|
|
|
+
|
|
|
+ for(String nodeId:ids){
|
|
|
+ //步骤1:保存选择节点的立卷规则。
|
|
|
+ long nodeIdLong = Long.parseLong(nodeId);
|
|
|
+ //1.1最高规则和单独规则 将选择的wbs节点ID(wbsId),规则类型(archive_auto_type), 保存表m_archive_auto_rule_wbs
|
|
|
+ WbsTree wbsTree = wbsTreeService.getById(nodeIdLong);
|
|
|
+ ArchiveAutoRuleWbs autoRuleWbs = new ArchiveAutoRuleWbs();
|
|
|
+ autoRuleWbs.setWbsId(nodeIdLong);
|
|
|
+ autoRuleWbs.setArchiveAutoType(archiveAutoType);
|
|
|
+ if(archiveAutoType==2){
|
|
|
+ autoRuleWbs.setArchiveAutoGroupId(archiveAutoGroupId);
|
|
|
}
|
|
|
- allName.append(archiveTree.getNodeName());
|
|
|
- ArchiveTreeAutoRuleVO vo= new ArchiveTreeAutoRuleVO();
|
|
|
- vo.setAllName(allName.toString());
|
|
|
- vo.setNodeId(archiveTree.getId());
|
|
|
- vo.setArchiveAutoType(archiveAutoType);
|
|
|
- map.put("type",archiveAutoType);
|
|
|
- map.put("data",vo);
|
|
|
- return map;
|
|
|
+ autoRuleWbs.setProjectId(0L);//TODO
|
|
|
+ autoRuleWbs.setWbsRootId(null);//TODO
|
|
|
+ archiveAutoRuleWbsMapper.insert(autoRuleWbs);
|
|
|
}
|
|
|
+ return true;
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ return false;
|
|
|
}
|
|
|
- return map;
|
|
|
}
|
|
|
|
|
|
|
|
|
- public void removeArchiveAutoRule(Long nodeId){
|
|
|
- ArchiveTree node = baseMapper.selectById(nodeId);
|
|
|
- Integer archiveAutoType = node.getArchiveAutoType();
|
|
|
- if(archiveAutoType!=null){
|
|
|
- //删除默认规则
|
|
|
- if(archiveAutoType==1){
|
|
|
- baseMapper.removeAllSonNodeIdsForArchiveAutoRule_1(node);
|
|
|
- }
|
|
|
- //删除节点及所有子节点 分类并卷规则
|
|
|
- if(archiveAutoType==2){
|
|
|
- //删除规则
|
|
|
- baseMapper.removeAllSonNodeIdsForArchiveAutoRule_2(node);
|
|
|
- //TODO 验证节点的父节点是否为分类并卷规则,如是则取消。若无其他兄弟节点,继续往上验证。
|
|
|
- }
|
|
|
- //删除节点及所有子节点 单独并卷规则
|
|
|
- if(archiveAutoType==3){
|
|
|
- baseMapper.removeAllSonNodeIdsForArchiveAutoRule_3(node);
|
|
|
- }
|
|
|
+ @Override
|
|
|
+ public boolean updateArchiveAutoRule(ArchiveTreeContractAutoRuleMapDTO dto,boolean iswbsNode) {
|
|
|
+ if(iswbsNode){
|
|
|
+ return updateArchiveAutoRule_WbsTreeNode(dto);
|
|
|
+ }else{
|
|
|
+ return updateArchiveAutoRule_ArchiveTreeNode(dto);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 归档树节点规则更新
|
|
|
+ * @param dto
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private boolean updateArchiveAutoRule_ArchiveTreeNode(ArchiveTreeContractAutoRuleMapDTO dto) {
|
|
|
+ try{
|
|
|
+ Integer archiveAutoType = dto.getArchiveAutoType();
|
|
|
+ if(archiveAutoType!=null){
|
|
|
+ if(archiveAutoType==2){
|
|
|
+ Long groupId = dto.getArchiveAutoGroupId();
|
|
|
+ String selectNodeIds = dto.getSelectNodeIds();
|
|
|
+ List<String> selectNodeIdlist = Arrays.asList(selectNodeIds);
|
|
|
+ //先将同一分组的节点删除配置,。
|
|
|
+ baseMapper.removeNodeForArchiveAutoRule_Group(groupId);
|
|
|
+ //然后再按照选择节点保存新的设置
|
|
|
+ for(String nodeId:selectNodeIdlist){
|
|
|
+ long nodeIdLong = Long.parseLong(nodeId);
|
|
|
+ ArchiveTree archiveTree = baseMapper.selectById(nodeIdLong);
|
|
|
+ archiveTree.setArchiveAutoType(archiveAutoType);
|
|
|
+ //分类并卷规则 提交都是一个分类类型
|
|
|
+ archiveTree.setArchiveAutoGroupId(groupId);
|
|
|
+ archiveTree.setArchiveAutoGroupSelect(1);
|
|
|
+ baseMapper.updateById(archiveTree);
|
|
|
+ //保存选择节点下所有子节点的立卷规则。注意立卷规则优先级覆盖原则。(单独组卷>分类并卷>最高并卷)
|
|
|
+ baseMapper.updateAllSonNodeIdsForArchiveAutoRule(
|
|
|
+ archiveTree.getArchiveAutoType(),
|
|
|
+ archiveTree.getArchiveAutoNodeId(),
|
|
|
+ archiveTree.getArchiveAutoGroupId(),
|
|
|
+ archiveTree.getAncestors()
|
|
|
+ );
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ return false;
|
|
|
+ }
|
|
|
|
|
|
- @Override
|
|
|
- public boolean updateArchiveAutoRule(ArchiveTreeContractAutoRuleMapDTO dto) {
|
|
|
- //项目级不需要考虑是否为wbs节点,已经同步出来了都属于归档树节点,直接按归档树节点处理
|
|
|
+ return true;
|
|
|
+ }
|
|
|
|
|
|
- Integer archiveAutoType = dto.getArchiveAutoType();
|
|
|
- if(archiveAutoType!=null){
|
|
|
- if(archiveAutoType==2){
|
|
|
- Long groupId = dto.getArchiveAutoGroupId();
|
|
|
- String selectNodeIds = dto.getSelectNodeIds();
|
|
|
- List<String> selectNodeIdlist = Arrays.asList(selectNodeIds);
|
|
|
- //先将同一分类的节点删除配置,。
|
|
|
- baseMapper.removeNodeForArchiveAutoRule_Group(groupId);
|
|
|
- //然后再按照选择节点保存新的设置
|
|
|
- for(String nodeId:selectNodeIdlist){
|
|
|
- long nodeIdLong = Long.parseLong(nodeId);
|
|
|
- ArchiveTree archiveTree = baseMapper.selectById(nodeIdLong);
|
|
|
- archiveTree.setArchiveAutoType(archiveAutoType);
|
|
|
- //分类并卷规则 提交都是一个分类类型
|
|
|
- archiveTree.setArchiveAutoGroupId(groupId);
|
|
|
- archiveTree.setArchiveAutoGroupSelect(1);
|
|
|
- baseMapper.updateById(archiveTree);
|
|
|
- //保存选择节点下所有子节点的立卷规则。注意立卷规则优先级覆盖原则。(单独组卷>分类并卷>最高并卷)
|
|
|
- baseMapper.updateAllSonNodeIdsForArchiveAutoRule(archiveTree);
|
|
|
+ /**
|
|
|
+ * 归档树wbs节点更新
|
|
|
+ * @param dto
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private boolean updateArchiveAutoRule_WbsTreeNode(ArchiveTreeContractAutoRuleMapDTO dto) {
|
|
|
+ try{
|
|
|
+ Integer archiveAutoType = dto.getArchiveAutoType();
|
|
|
+ if(archiveAutoType!=null){
|
|
|
+ if(archiveAutoType==2){
|
|
|
+ Long groupId = dto.getArchiveAutoGroupId();
|
|
|
+ String selectNodeIds = dto.getSelectNodeIds();
|
|
|
+ List<String> selectNodeIdlist = Arrays.asList(selectNodeIds);
|
|
|
+ //先将同一分组的节点删除配置,。
|
|
|
+ archiveAutoRuleWbsMapper.removeNodeForArchiveAutoRule_Group(groupId,0L);
|
|
|
+ //然后再按照选择节点保存新的设置
|
|
|
+ for(String nodeId:selectNodeIdlist){
|
|
|
+ long nodeIdLong = Long.parseLong(nodeId);
|
|
|
+ ArchiveAutoRuleWbs autoRuleWbs = new ArchiveAutoRuleWbs();
|
|
|
+ autoRuleWbs.setWbsId(nodeIdLong);
|
|
|
+ autoRuleWbs.setArchiveAutoType(archiveAutoType);
|
|
|
+ if(archiveAutoType==2){
|
|
|
+ autoRuleWbs.setArchiveAutoGroupId(groupId);
|
|
|
+ }
|
|
|
+ autoRuleWbs.setProjectId(0L);//TODO
|
|
|
+ autoRuleWbs.setWbsRootId(null);//TODO
|
|
|
+ archiveAutoRuleWbsMapper.insert(autoRuleWbs);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- if(archiveAutoType==1){
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
|
|
|
+ /**
|
|
|
+ * 移除节点规则
|
|
|
+ * @param nodeId
|
|
|
+ */
|
|
|
+ public Map<String,String> removeArchiveAutoRule(Long nodeId,boolean iswbsNode){
|
|
|
+ Map<String,String> returnMap= new HashMap<>();
|
|
|
+ returnMap.put("code","1");
|
|
|
+ try{
|
|
|
+ if(iswbsNode){
|
|
|
+ ArchiveAutoRuleWbs archiveAutoRuleWbs = archiveAutoRuleWbsMapper.selectById(nodeId);
|
|
|
+ archiveAutoRuleWbs.setDelete(1);
|
|
|
+ archiveAutoRuleWbs.setUpdateTime(new Date());
|
|
|
+ archiveAutoRuleWbsMapper.updateById(archiveAutoRuleWbs);
|
|
|
+ }else{
|
|
|
+ ArchiveTree node = baseMapper.selectById(nodeId);
|
|
|
+ Integer archiveAutoType = node.getArchiveAutoType();
|
|
|
+ if(archiveAutoType!=null){
|
|
|
+ //删除默认规则
|
|
|
+ if(archiveAutoType==1){
|
|
|
+ baseMapper.removeAllSonNodeIdsForArchiveAutoRule_1(node.getArchiveAutoType(),node.getAncestors());
|
|
|
+ }
|
|
|
+ //删除节点及所有子节点 分类并卷规则
|
|
|
+ if(archiveAutoType==2){
|
|
|
+ if(node.getArchiveAutoGroupSelect()==1){
|
|
|
+ //删除规则 只能修改archive_auto_group_select=1的节点,
|
|
|
+ // 因为分类并卷规则影响范围包括下面所有子节点,如果给archive_auto_group_select=0的节点也就是范围内的子节点单独取消规则,会造成案卷归属节点错乱。
|
|
|
+ // (不理那么多,就这样限制先 。如业务非要发神经就要 TODO 验证节点的父节点是否为分类并卷规则,如是则取消。若无其他兄弟节点,继续往上验证。)
|
|
|
+ baseMapper.removeAllSonNodeIdsForArchiveAutoRule_2(node.getArchiveAutoType(),node.getAncestors());
|
|
|
+ }
|
|
|
+ returnMap.put("code","0");
|
|
|
+ returnMap.put("msg","只能取消设置的节点,不能取消设置节点范围下节点");
|
|
|
+ }
|
|
|
+ //删除节点及所有子节点 单独并卷规则
|
|
|
+ if(archiveAutoType==3){
|
|
|
+ baseMapper.removeAllSonNodeIdsForArchiveAutoRule_3(node.getArchiveAutoType(),node.getAncestors());
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- if(archiveAutoType==3){
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ returnMap.put("code","0");
|
|
|
+ returnMap.put("msg",e.getMessage());
|
|
|
+ }
|
|
|
+ return returnMap;
|
|
|
+ }
|
|
|
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * 获取节点规则查看
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public Map<String,Object> getArchiveAutoRule(Long id,boolean iswbsNode) {
|
|
|
|
|
|
+ if(iswbsNode){
|
|
|
+ return getArchiveAutoRule_ArchiveTreeNode(id);
|
|
|
+ }else{
|
|
|
+ return getArchiveAutoRule_WbsTreeNode(id);
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- return false;
|
|
|
+ /**
|
|
|
+ * 查看归档树节点立卷规则
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private Map<String,Object> getArchiveAutoRule_ArchiveTreeNode(Long id) {
|
|
|
+ Map<String,Object> map= new HashMap<>();
|
|
|
+ try{
|
|
|
+ ArchiveTree archiveTree = baseMapper.selectById(id);
|
|
|
+ Integer archiveAutoType = archiveTree.getArchiveAutoType();
|
|
|
+ if(archiveAutoType!=null){
|
|
|
+ if(archiveAutoType==1){
|
|
|
+ //最高并卷层级 默认规则的节点 显示最高并卷层级节点
|
|
|
+ Long archiveAutoNodeId = archiveTree.getArchiveAutoNodeId();
|
|
|
+ ArchiveTree archiveAutoNode = baseMapper.selectById(archiveAutoNodeId);
|
|
|
+ StringBuffer allName= new StringBuffer();
|
|
|
+ String ancestors = archiveAutoNode.getAncestors();
|
|
|
+ String[] ancestorssplit = ancestors.split(",");//全路径ID
|
|
|
+ for(String pId:ancestorssplit){
|
|
|
+ long pIdLong = Long.parseLong(pId);
|
|
|
+ ArchiveTree pIdNode = baseMapper.selectById(pIdLong);
|
|
|
+ allName.append(pIdNode.getNodeName()+"/");
|
|
|
+ }
|
|
|
+ allName.append(archiveAutoNode.getNodeName());
|
|
|
+ ArchiveTreeAutoRuleVO vo= new ArchiveTreeAutoRuleVO();
|
|
|
+ vo.setAllName(allName.toString());
|
|
|
+ vo.setNodeId(archiveAutoNode.getId());
|
|
|
+ vo.setArchiveAutoType(archiveAutoType);
|
|
|
+ map.put("type",archiveAutoType);
|
|
|
+ map.put("data",vo);
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+ if(archiveAutoType==2){
|
|
|
+ //分类并卷显示所在大类下树结构,过滤单独规则,其他分类并卷规则组节点 本节点分类组显示打钩
|
|
|
+ //找出当前节点大类
|
|
|
+ String ancestors = archiveTree.getAncestors();
|
|
|
+ String[] ancestorssplit = ancestors.split(",");//全路径ID
|
|
|
+ String nodeAncestors = ancestorssplit[0]+","+ancestorssplit[1]; //大类的ancestors
|
|
|
+ //获取大类下所有节点,过滤单独规则,其他分类并卷规则组节点
|
|
|
+ List<ArchiveTreeAutoRuleVO> nodetree = ForestNodeMerger.merge(baseMapper.getAllSonNodeforGroupView(nodeAncestors, archiveTree.getArchiveAutoNodeId()));
|
|
|
+ //获取与当前节点设置同一分类分组的节点
|
|
|
+ List<ArchiveTree> listGroup= baseMapper.selectList(Wrappers.<ArchiveTree>lambdaQuery()
|
|
|
+ .eq(ArchiveTree::getArchiveAutoGroupId, archiveTree.getArchiveAutoGroupId())
|
|
|
+ .eq(ArchiveTree::getArchiveAutoGroupSelect,1)
|
|
|
+ .orderByAsc(ArchiveTree::getSort));
|
|
|
+ StringBuffer nodeSelect = new StringBuffer();
|
|
|
+
|
|
|
+ for(ArchiveTree node:listGroup){
|
|
|
+ nodeSelect.append(node.getId()+",");
|
|
|
+ }
|
|
|
+ map.put("type",archiveAutoType);
|
|
|
+ map.put("tree",nodetree);
|
|
|
+ map.put("data",nodeSelect.toString());
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+ if(archiveAutoType==3){
|
|
|
+ //单独组卷规则 显示当前节点
|
|
|
+ StringBuffer allName= new StringBuffer();
|
|
|
+ String ancestors = archiveTree.getAncestors();
|
|
|
+ String[] ancestorssplit = ancestors.split(",");//全路径ID
|
|
|
+ for(String pId:ancestorssplit){
|
|
|
+ long pIdLong = Long.parseLong(pId);
|
|
|
+ ArchiveTree pIdNode = baseMapper.selectById(pIdLong);
|
|
|
+ allName.append(pIdNode.getNodeName()+"/");
|
|
|
+ }
|
|
|
+ allName.append(archiveTree.getNodeName());
|
|
|
+ ArchiveTreeAutoRuleVO vo= new ArchiveTreeAutoRuleVO();
|
|
|
+ vo.setAllName(allName.toString());
|
|
|
+ vo.setNodeId(archiveTree.getId());
|
|
|
+ vo.setArchiveAutoType(archiveAutoType);
|
|
|
+ map.put("type",archiveAutoType);
|
|
|
+ map.put("data",vo);
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+ return map;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 归档树wbs节点规则查看
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private Map<String,Object> getArchiveAutoRule_WbsTreeNode(Long id) {
|
|
|
+ Map<String,Object> map= new HashMap<>();
|
|
|
+ try{
|
|
|
+ //TODO 需要了解关联的wbs节点
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+ return map;
|
|
|
+ }
|
|
|
}
|