|
|
|
@ -282,15 +282,16 @@ public class BDPrizeServiceImpl implements BDPrizeService {
|
|
|
|
|
JSONObject totalDetail = financialBDPrizeLogMapper.findByReportAndBDTotal(report.getString("record_id"), managerId);
|
|
|
|
|
log.putAll(totalDetail);
|
|
|
|
|
JSONObject bdInfo = managerMapper.findById(managerId);
|
|
|
|
|
|
|
|
|
|
if (ManagerRole.BD_LEADER.hasRole(bdInfo.getIntValue("role"))) {
|
|
|
|
|
JSONObject groupPrizeLog = financialBDPrizeLogMapper.findByReportAndGroup(report.getString("record_id"), managerId);
|
|
|
|
|
log.put("group_prize", groupPrizeLog);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (bdInfo == null) {
|
|
|
|
|
log.put("leftCompany", true);
|
|
|
|
|
}else {
|
|
|
|
|
if (ManagerRole.BD_LEADER.hasRole(bdInfo.getIntValue("role"))) {
|
|
|
|
|
JSONObject groupPrizeLog = financialBDPrizeLogMapper.findByReportAndGroup(report.getString("record_id"), managerId);
|
|
|
|
|
log.put("group_prize", groupPrizeLog);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return log;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -323,11 +324,10 @@ public class BDPrizeServiceImpl implements BDPrizeService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void updateBDLevel(int bdId, JSONObject info, JSONObject manager) {
|
|
|
|
|
String bdIdStr = String.valueOf(bdId);
|
|
|
|
|
JSONObject config = financialBDConfigMapper.getBdConfig(bdIdStr);
|
|
|
|
|
public void updateBDLevel(String bdId, JSONObject info, JSONObject manager) {
|
|
|
|
|
JSONObject config = financialBDConfigMapper.getBdConfig(bdId);
|
|
|
|
|
if (config == null) {
|
|
|
|
|
JSONObject bdUser = managerMapper.findById(bdIdStr);
|
|
|
|
|
JSONObject bdUser = managerMapper.findById(bdId);
|
|
|
|
|
if (bdUser == null || !ManagerRole.BD_USER.hasRole(bdUser.getIntValue("role"))) {
|
|
|
|
|
throw new BadRequestException("BD User Not exists");
|
|
|
|
|
}
|
|
|
|
|