|
|
|
@ -2051,16 +2051,18 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
}
|
|
|
|
|
checkOrgPermission(manager, client);
|
|
|
|
|
if (!StringUtils.isNotBlank(master_merchant)) {
|
|
|
|
|
throw new NotFoundException("Invalid Input");
|
|
|
|
|
}
|
|
|
|
|
JSONObject master_client = getClientInfoByMoniker(master_merchant);
|
|
|
|
|
if (master_client == null) {
|
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(master_client.getString("parent_client_id"))) {
|
|
|
|
|
throw new BadRequestException("Master Merchant is not valid");
|
|
|
|
|
//throw new NotFoundException("Invalid Input");
|
|
|
|
|
JSONObject master_client = getClientInfoByMoniker(master_merchant);
|
|
|
|
|
if (master_client == null) {
|
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(master_client.getString("parent_client_id"))) {
|
|
|
|
|
throw new BadRequestException("Master Merchant is not valid");
|
|
|
|
|
}
|
|
|
|
|
client.put("parent_client_id", master_client.getIntValue("client_id"));
|
|
|
|
|
}else {
|
|
|
|
|
client.put("parent_client_id", null);
|
|
|
|
|
}
|
|
|
|
|
client.put("parent_client_id", master_client.getIntValue("client_id"));
|
|
|
|
|
clientMapper.update(client);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|