|
|
@ -218,8 +218,36 @@ public class ClientApplyImpl implements ClientApply, ApplicationEventPublisherAw
|
|
|
|
|
|
|
|
|
|
|
|
partner.put("bd_user", manager.getString("manager_id"));
|
|
|
|
partner.put("bd_user", manager.getString("manager_id"));
|
|
|
|
partner.put("bd_user_name", manager.getString("display_name"));
|
|
|
|
partner.put("bd_user_name", manager.getString("display_name"));
|
|
|
|
if (clientMapper.findClientByMoniker(info.getClientMoniker()) != null) {
|
|
|
|
JSONObject client;
|
|
|
|
throw new BadRequestException("error.partner.valid.dumplicate_client_moniker");
|
|
|
|
|
|
|
|
|
|
|
|
if ((client = clientMapper.findClientByMoniker(info.getClientMoniker())) != null) {
|
|
|
|
|
|
|
|
if( manager.getString("manager_id").equals(client.getString("creator")) )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if(clientApplyMapper.findClientApplicationByClientMoniker(info.getClientMoniker()) != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
throw new BadRequestException("无效,已关联商户");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
JSONObject client_bd = new JSONObject();
|
|
|
|
|
|
|
|
client_bd.put("client_id", partner.getIntValue("client_id"));
|
|
|
|
|
|
|
|
client_bd.put("bd_id", manager.getString("manager_id"));
|
|
|
|
|
|
|
|
client_bd.put("bd_name", manager.getString("display_name"));
|
|
|
|
|
|
|
|
client_bd.put("create_time", new Date());
|
|
|
|
|
|
|
|
client_bd.put("create_id", manager.getString("manager_id"));
|
|
|
|
|
|
|
|
client_bd.put("start_date", new Date());
|
|
|
|
|
|
|
|
client_bd.put("proportion", 1);
|
|
|
|
|
|
|
|
clientBDMapper.saveBD(client_bd);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
apply.put("client_apply_id", client_apply_id);
|
|
|
|
|
|
|
|
apply.put("client_id", partner.getIntValue("client_id"));
|
|
|
|
|
|
|
|
apply.put("client_moniker", info.getClientMoniker());
|
|
|
|
|
|
|
|
apply.put("apply_approve_result", 2);
|
|
|
|
|
|
|
|
apply.put("apply_approve_time", new Date());
|
|
|
|
|
|
|
|
clientApplyMapper.updatePartnerApplication(apply);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return partner;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
throw new BadRequestException("您只能关联自己创建的商户");
|
|
|
|
|
|
|
|
//throw new BadRequestException("error.partner.valid.dumplicate_client_moniker");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
partner.put("source", 2);//自主申请
|
|
|
|
partner.put("source", 2);//自主申请
|
|
|
|
partner.put("country", "AUS");//自主申请
|
|
|
|
partner.put("country", "AUS");//自主申请
|
|
|
|