fix bd String

master
eason.qian 7 years ago
parent f385c488a0
commit ef2e90efbe

@ -29,7 +29,7 @@ public interface BDPrizeService {
List<JSONObject> listBDLevels();
void updateBDLevel(int bdId, JSONObject info, JSONObject manager);
void updateBDLevel(String bdId, JSONObject info, JSONObject manager);
List<JSONObject> listBDLeaderAndManager(String month);

@ -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");
}

@ -70,7 +70,7 @@ public class BDPrizeController {
}
@ManagerMapping(value = "/config/bd_levels/{bdId}", method = RequestMethod.PUT, role = {ManagerRole.FINANCIAL_STAFF, ManagerRole.ADMIN})
public void updateBDLevel(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable int bdId, @RequestBody JSONObject info) {
public void updateBDLevel(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String bdId, @RequestBody JSONObject info) {
bdPrizeService.updateBDLevel(bdId, info,manager);
}

Loading…
Cancel
Save