|
|
@ -251,11 +251,10 @@ public class XmProjectPhaseService extends BaseService { |
|
|
for (XmProjectPhase node : noExistsList) { |
|
|
for (XmProjectPhase node : noExistsList) { |
|
|
if(hadCalcMap.containsKey(node.getParentPhaseId())){ |
|
|
if(hadCalcMap.containsKey(node.getParentPhaseId())){ |
|
|
String idPaths=hadCalcMap.get(node.getParentPhaseId()); |
|
|
String idPaths=hadCalcMap.get(node.getParentPhaseId()); |
|
|
node.setPidPaths(idPaths+node.getId()+","); |
|
|
|
|
|
|
|
|
node.setPidPaths(idPaths); |
|
|
}else{ |
|
|
}else{ |
|
|
this.parentIdPathsCalcBeforeSave(node); |
|
|
this.parentIdPathsCalcBeforeSave(node); |
|
|
String idPaths=node.getPidPaths(); |
|
|
String idPaths=node.getPidPaths(); |
|
|
idPaths=idPaths.substring(0,idPaths.length()-node.getId().length()-1); |
|
|
|
|
|
hadCalcMap.put(node.getParentPhaseId(),idPaths); |
|
|
hadCalcMap.put(node.getParentPhaseId(),idPaths); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@ -266,7 +265,7 @@ public class XmProjectPhaseService extends BaseService { |
|
|
} |
|
|
} |
|
|
if(hadCalcMap.containsKey(node.getParentPhaseId())){ |
|
|
if(hadCalcMap.containsKey(node.getParentPhaseId())){ |
|
|
String idPaths=hadCalcMap.get(node.getParentPhaseId()); |
|
|
String idPaths=hadCalcMap.get(node.getParentPhaseId()); |
|
|
node.setPidPaths(idPaths+node.getId()+","); |
|
|
|
|
|
|
|
|
node.setPidPaths(idPaths); |
|
|
}else{ |
|
|
}else{ |
|
|
List<XmProjectPhase> pnodeList=this.getParentList(node,nodes); |
|
|
List<XmProjectPhase> pnodeList=this.getParentList(node,nodes); |
|
|
XmProjectPhase topParent=pnodeList.get(pnodeList.size()-1); |
|
|
XmProjectPhase topParent=pnodeList.get(pnodeList.size()-1); |
|
|
@ -277,13 +276,13 @@ public class XmProjectPhaseService extends BaseService { |
|
|
for (int i = pnodeList.size() - 1; i >= 0; i--) { |
|
|
for (int i = pnodeList.size() - 1; i >= 0; i--) { |
|
|
idPath=idPath+pnodeList.get(i).getId()+","; |
|
|
idPath=idPath+pnodeList.get(i).getId()+","; |
|
|
} |
|
|
} |
|
|
node.setPidPaths(idPath+node.getId()+","); |
|
|
|
|
|
|
|
|
node.setPidPaths(idPath); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
for (XmProjectPhase node : nodes) { |
|
|
for (XmProjectPhase node : nodes) { |
|
|
String idPaths=node.getPidPaths(); |
|
|
String idPaths=node.getPidPaths(); |
|
|
String[] idpss=idPaths.split(","); |
|
|
String[] idpss=idPaths.split(","); |
|
|
node.setLvl(idpss.length-1); |
|
|
|
|
|
|
|
|
node.setLvl(idpss.length); |
|
|
} |
|
|
} |
|
|
return nodes; |
|
|
return nodes; |
|
|
} |
|
|
} |
|
|
@ -298,7 +297,7 @@ public class XmProjectPhaseService extends BaseService { |
|
|
public Tips parentIdPathsCalcBeforeSave(XmProjectPhase currNode) { |
|
|
public Tips parentIdPathsCalcBeforeSave(XmProjectPhase currNode) { |
|
|
Tips tips = new Tips("成功"); |
|
|
Tips tips = new Tips("成功"); |
|
|
if (!StringUtils.hasText(currNode.getParentPhaseId()) || "0".equals(currNode.getParentPhaseId())) { |
|
|
if (!StringUtils.hasText(currNode.getParentPhaseId()) || "0".equals(currNode.getParentPhaseId())) { |
|
|
currNode.setPidPaths("0," + currNode.getId() + ","); |
|
|
|
|
|
|
|
|
currNode.setPidPaths("0,"); |
|
|
return tips; |
|
|
return tips; |
|
|
} else { |
|
|
} else { |
|
|
List<XmProjectPhase> parentList=this.getParentList(currNode); |
|
|
List<XmProjectPhase> parentList=this.getParentList(currNode); |
|
|
@ -306,11 +305,11 @@ public class XmProjectPhaseService extends BaseService { |
|
|
for (int i = parentList.size() - 1; i >= 0; i--) { |
|
|
for (int i = parentList.size() - 1; i >= 0; i--) { |
|
|
idPath=idPath+parentList.get(i).getId()+","; |
|
|
idPath=idPath+parentList.get(i).getId()+","; |
|
|
} |
|
|
} |
|
|
currNode.setPidPaths(idPath+currNode.getId()+","); |
|
|
|
|
|
|
|
|
currNode.setPidPaths(idPath); |
|
|
|
|
|
|
|
|
String idPaths=currNode.getPidPaths(); |
|
|
String idPaths=currNode.getPidPaths(); |
|
|
String[] idpss=idPaths.split(","); |
|
|
String[] idpss=idPaths.split(","); |
|
|
currNode.setLvl(idpss.length-1); |
|
|
|
|
|
|
|
|
currNode.setLvl(idpss.length); |
|
|
} |
|
|
} |
|
|
return tips; |
|
|
return tips; |
|
|
} |
|
|
} |
|
|
|