|
@@ -442,13 +442,8 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
|
|
|
for (int i = reNodes.size() - 1; i >= 0; i--) {
|
|
|
WbsTreeContractTreeAllVO node = reNodes.get(i);
|
|
|
if (node.getChildren() != null && !node.getChildren().isEmpty()) {
|
|
|
- long childSubmitCounts = 0L;
|
|
|
- int colorStatus = 1;
|
|
|
-
|
|
|
- boolean allChildStatusEquals3 = true;
|
|
|
- boolean allChildStatusEquals4 = true;
|
|
|
-
|
|
|
//计数
|
|
|
+ long childSubmitCounts = 0L;
|
|
|
for (WbsTreeContractTreeAllVO child : node.getChildren()) {
|
|
|
if (child.getSubmitCounts() == 1L) {
|
|
|
childSubmitCounts++;
|
|
@@ -456,50 +451,44 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
|
|
|
childSubmitCounts = child.getSubmitCounts();
|
|
|
}
|
|
|
}
|
|
|
+ node.setSubmitCounts(childSubmitCounts);
|
|
|
|
|
|
//颜色
|
|
|
+ boolean allThree = true; //是否所有子节点的getColorStatus都等于3
|
|
|
+ boolean allFour = true; //是否所有子节点的getColorStatus都等于4
|
|
|
+ boolean hasTwo = false; //是否存在子节点的getColorStatus等于2
|
|
|
+ boolean hasOne = false; //是否存在子节点的getColorStatus等于1
|
|
|
+ boolean hasThreeOrFour = false; //是否存在子节点的getColorStatus等于3或4
|
|
|
for (WbsTreeContractTreeAllVO child : node.getChildren()) {
|
|
|
- if (ObjectUtils.isNotEmpty(child.getColorStatus())) {
|
|
|
- //只要有一个子级是已填报-未上报,那么上级默认已填报-未上报(蓝色)
|
|
|
- if (child.getColorStatus().equals(2)) {
|
|
|
- colorStatus = 2;
|
|
|
- break;
|
|
|
- }
|
|
|
-
|
|
|
- if (child.getColorStatus().equals(3)) {
|
|
|
- allChildStatusEquals4 = false;
|
|
|
- colorStatus = 4;
|
|
|
-
|
|
|
- } else if (child.getColorStatus().equals(4)) {
|
|
|
- allChildStatusEquals3 = false;
|
|
|
- colorStatus = 3;
|
|
|
-
|
|
|
- } else {
|
|
|
- allChildStatusEquals3 = false;
|
|
|
- allChildStatusEquals4 = false;
|
|
|
- colorStatus = 1;
|
|
|
- break;
|
|
|
- }
|
|
|
+ if (child.getColorStatus() != 3) {
|
|
|
+ allThree = false;
|
|
|
+ }
|
|
|
+ if (child.getColorStatus() != 4) {
|
|
|
+ allFour = false;
|
|
|
+ }
|
|
|
+ if (child.getColorStatus() == 2) {
|
|
|
+ hasTwo = true;
|
|
|
+ }
|
|
|
+ if (child.getColorStatus() == 1) {
|
|
|
+ hasOne = true;
|
|
|
+ }
|
|
|
+ if (child.getColorStatus() == 3 || child.getColorStatus() == 4) {
|
|
|
+ hasThreeOrFour = true;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- //父节点计数
|
|
|
- node.setSubmitCounts(childSubmitCounts);
|
|
|
-
|
|
|
- //父节点颜色
|
|
|
- if (allChildStatusEquals3) {
|
|
|
+ if (allThree) {
|
|
|
node.setColorStatus(3);
|
|
|
- continue;
|
|
|
- }
|
|
|
- if (allChildStatusEquals4) {
|
|
|
+ } else if (allFour) {
|
|
|
node.setColorStatus(4);
|
|
|
- continue;
|
|
|
+ } else if (hasTwo || (hasOne && hasThreeOrFour)) {
|
|
|
+ node.setColorStatus(2);
|
|
|
+ } else {
|
|
|
+ node.setColorStatus(1);
|
|
|
}
|
|
|
- node.setColorStatus(colorStatus);
|
|
|
|
|
|
} else if (node.getSubmitCounts() == 1L) {
|
|
|
node.setSubmitCounts(1L);
|
|
|
- //最底层颜色
|
|
|
+ //最底层节点颜色
|
|
|
if (ObjectUtils.isNotEmpty(node.getColorStatus())) {
|
|
|
if (node.getColorStatus().equals(0)) { //任务状态=0,未上报
|
|
|
node.setColorStatus(2); //蓝色
|