|
|
@@ -2547,7 +2547,14 @@ public class BjStarClassMpServ extends Serv {
|
|
|
Db db, YearMonth month) throws Exception {
|
|
|
SqlCmd sqlc = new SqlCmd(
|
|
|
"select BJID,"
|
|
|
- + "sum(case when JFLX=1 then JFZ else 0 end) BONUS,"
|
|
|
+ + "sum(case when JFLX=1 and LYLX in('"
|
|
|
+ + XjbJfServ.LYLX_TEAM_ROLE + "','"
|
|
|
+ + XjbJfServ.LYLX_TEAM_MEMBER
|
|
|
+ + "') then JFZ else 0 end) TEAM_BONUS,"
|
|
|
+ + "sum(case when JFLX=1 and nvl(LYLX,'#') not in('"
|
|
|
+ + XjbJfServ.LYLX_TEAM_ROLE + "','"
|
|
|
+ + XjbJfServ.LYLX_TEAM_MEMBER
|
|
|
+ + "') then JFZ else 0 end) OTHER_BONUS,"
|
|
|
+ "sum(case when JFLX=2 then JFZ else 0 end) DEDUCTION,"
|
|
|
+ "sum(case when JFLX=1 then 1 else 0 end) BONUS_CNT,"
|
|
|
+ "sum(case when JFLX=2 then 1 else 0 end) DEDUCTION_CNT"
|
|
|
@@ -2558,7 +2565,9 @@ public class BjStarClassMpServ extends Serv {
|
|
|
Map<Long, AdjustmentTotals> result = new HashMap<>();
|
|
|
for (Map<String, Object> row : db.doSelMapListByC(sqlc)) {
|
|
|
AdjustmentTotals total = new AdjustmentTotals();
|
|
|
- total.bonus = Math.min(8.0, rdDouble(row.get("bonus")));
|
|
|
+ total.bonus = XjbJfServ.capBonus(
|
|
|
+ rdDouble(row.get("other_bonus")),
|
|
|
+ rdDouble(row.get("team_bonus")));
|
|
|
total.deduction = rdDouble(row.get("deduction"));
|
|
|
total.bonusEvents = rdInt(row.get("bonus_cnt"));
|
|
|
total.deductionEvents = rdInt(row.get("deduction_cnt"));
|
|
|
@@ -2657,16 +2666,24 @@ public class BjStarClassMpServ extends Serv {
|
|
|
private static AdjustmentTotals adjustmentTotals(
|
|
|
List<Adjustment> adjustments) {
|
|
|
AdjustmentTotals total = new AdjustmentTotals();
|
|
|
+ double otherBonus = 0.0;
|
|
|
+ double teamBonus = 0.0;
|
|
|
for (Adjustment item : adjustments) {
|
|
|
if (item.score > 0) {
|
|
|
- total.bonus += item.score;
|
|
|
+ if (XjbJfServ.LYLX_TEAM_ROLE.equals(item.sourceType)
|
|
|
+ || XjbJfServ.LYLX_TEAM_MEMBER.equals(
|
|
|
+ item.sourceType)) {
|
|
|
+ teamBonus += item.score;
|
|
|
+ } else {
|
|
|
+ otherBonus += item.score;
|
|
|
+ }
|
|
|
total.bonusEvents++;
|
|
|
} else {
|
|
|
total.deduction += Math.abs(item.score);
|
|
|
total.deductionEvents++;
|
|
|
}
|
|
|
}
|
|
|
- total.bonus = round2(total.bonus);
|
|
|
+ total.bonus = round2(XjbJfServ.capBonus(otherBonus, teamBonus));
|
|
|
total.deduction = round2(total.deduction);
|
|
|
return total;
|
|
|
}
|