double leadership = 0D;
double cellGrade = dist.getCellAchieve(); /**小组业绩*/
if(rank == ConstantUtil._lev_5 && cellGrade> 600D){/**五星,小组业绩大于600,领取1%的奖金*/
double gap_bonus_1 = bonusCfgMap.get(ConstantUtil._lev_5).getW1()/100; /**一代领导奖*/
for(TDistributor lch : dirchildList){/**遍历支臂*/
TDistributor find = getChildGradeCellHighest(lch,rank); /**find中有可能会返回lch*/
if(find!=null){
int floors = find.getFloors();/**定点的层级*/
Long id = find.getId();
/**获取第一代*/
List<String> child_Lv1_List=findChildListByFloors (floors+1,id);/**第一代层级*/
for(String code:child_Lv1_List){
leadership+=tgMap.get(code).getCellAchieve().doubleValue()*gap_bonus_1;
code = null;
}
child_Lv1_List = null;
}
find = null;
lch = null;
}
}else if(rank == ConstantUtil._lev_6 && cellGrade> 1000D){/**六星*/
double gap_bonus_1 = bonusCfgMap.get(ConstantUtil._lev_6).getW1()/100; /**一代领导奖*/
double gap_bonus_2 = bonusCfgMap.get(ConstantUtil._lev_6).getW2()/100; /**二代领导奖*/
double gap_bonus_3 = bonusCfgMap.get(ConstantUtil._lev_6).getW3()/100; /**三代领导奖*/
for(TDistributor lch : dirchildList){/**遍历支臂*/
TDistributor find = getChildGradeCellHighest(lch,rank);
if(find!=null){
int floors = find.getFloors();/**定点的层级*/
Long id = find.getId();
/**获取第一代*/
List<String> child_Lv1_List=findChildListByFloors (floors+1,id);/**第一代层级*/
for(String code:child_Lv1_List){
leadership+=tgMap.get(code).getCellAchieve().doubleValue()*gap_bonus_1;
code = null;
}
child_Lv1_List = null;
/**获取第二代*/
List<String> child_Lv2_List=findChildListByFloors (floors+2,id);/**第一代层级*/
for(String code:child_Lv2_List){
leadership+=tgMap.get(code).getCellAchieve().doubleValue()*gap_bonus_2;
code = null;
}
child_Lv2_List = null;
/**获取第三代*/
List<String> child_Lv3_List=findChildListByFloors (floors+3,id);/**第一代层级*/
for(String code:child_Lv3_List){
leadership+=tgMap.get(code).getCellAchieve().doubleValue()*gap_bonus_3;
code = null;
}
child_Lv3_List = null;
}
find = null;
lch = null;
}
}else if(rank == ConstantUtil._lev_7 && cellGrade> 2000D){/**七星*/
double gap_bonus_1 = bonusCfgMap.get(ConstantUtil._lev_7).getW1()/100; /**一代领导奖*/
double gap_bonus_2 = bonusCfgMap.get(ConstantUtil._lev_7).getW2()/100; /**二代领导奖*/
double gap_bonus_3 = bonusCfgMap.get(ConstantUtil._lev_7).getW3()/100; /**三代领导奖*/
double gap_bonus_4 = bonusCfgMap.get(ConstantUtil._lev_7).getW4()/100; /**一代领导奖*/
double gap_bonus_5 = bonusCfgMap.get(ConstantUtil._lev_7).getW5()/100; /**二代领导奖*/
for(TDistributor lch : dirchildList){/**遍历支臂*/
TDistributor find = getChildGradeCellHighest(lch,rank);
if(find!=null){
int floors = find.getFloors();/**定点的层级*/
Long id = find.getId();
/**获取第一代*/
List<String> child_Lv1_List=findChildListByFloors (floors+1,id);/**第一代层级*/
for(String code:child_Lv1_List){
leadership+=tgMap.get(code).getCellAchieve().doubleValue()*gap_bonus_1;
code = null;
}
child_Lv1_List = null;
/**获取第二代*/
List<String> child_Lv2_List=findChildListByFloors (floors+2,id);/**第一代层级*/
for(String code:child_Lv2_List){
leadership+=tgMap.get(code).getCellAchieve().doubleValue()*gap_bonus_2;
code = null;
}
child_Lv2_List = null;
/**获取第三代*/
List<String> child_Lv3_List=findChildListByFloors (floors+3,id);/**第一代层级*/
for(String code:child_Lv3_List){
leadership+=tgMap.get(code).getCellAchieve().doubleValue()*gap_bonus_3;
code = null;
}
child_Lv3_List = null;
/**获取第四代*/
List<String> child_Lv4_List=findChildListByFloors (floors+4,id);/**第一代层级*/
for(String code:child_Lv4_List){
leadership+=tgMap.get(code).getCellAchieve().doubleValue()*gap_bonus_4;
code = null;
}
child_Lv4_List = null;
/**获取第五代*/
List<String> child_Lv5_List=findChildListByFloors (floors+5,id);/**第一代层级*/
for(String code:child_Lv5_List){
leadership+=tgMap.get(code).getCellAchieve().doubleValue()*gap_bonus_5;
code = null;
}
child_Lv5_List = null;
}
find = null;
lch = null;
}
}else if(rank >ConstantUtil._lev_7 && cellGrade> 3000D){/**八星/金狮/银狮/铜师*/
double gap_bonus_1 = bonusCfgMap.get(ConstantUtil._lev_8).getW1()/100; /**一代领导奖*/
double gap_bonus_2 = bonusCfgMap.get(ConstantUtil._lev_8).getW2()/100; /**二代领导奖*/
double gap_bonus_3 = bonusCfgMap.get(ConstantUtil._lev_8).getW3()/100; /**三代领导奖*/
double gap_bonus_4 = bonusCfgMap.get(ConstantUtil._lev_8).getW4()/100; /**四代领导奖*/
double gap_bonus_5 = bonusCfgMap.get(ConstantUtil._lev_8).getW5()/100; /**五代领导奖*/
double gap_bonus_6 = bonusCfgMap.get(ConstantUtil._lev_8).getW6()/100; /**六代领导奖*/
double gap_bonus_7 = bonusCfgMap.get(ConstantUtil._lev_8).getW7()/100; /**七代领导奖*/
double gap_bonus_8 = bonusCfgMap.get(ConstantUtil._lev_8).getW8()/100; /**八代领导奖*/
for(TDistributor lch : dirchildList){/**遍历支臂*/
TDistributor find = getChildGradeCellHighest(lch,rank);
if(find!=null){
int floors = find.getFloors();/**定点的层级*/
Long id = find.getId();
/**获取第一代*/
List<String> child_Lv1_List=findChildListByFloors (floors+1,id);/**第一代层级*/
for(String code:child_Lv1_List){
leadership+=tgMap.get(code).getCellAchieve().doubleValue()*gap_bonus_1;
code = null;