add new sub partner excepeion

master
wangning 7 years ago
parent 0b7f69d450
commit f26a747c05

@ -70,6 +70,7 @@ import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.Order;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.RandomStringUtils;
@ -413,7 +414,11 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if (clientMapper.findClientByMoniker(registery.getClientMoniker()) != null) {
throw new BadRequestException("error.partner.valid.dumplicate_client_moniker");
}
clientMapper.save(partner);
try {
clientMapper.save(partner);
} catch (Exception e) {
throw new BadRequestException("error.partner.valid.dumplicate_client_moniker");
}
if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) {
JSONObject client_bd = new JSONObject();
@ -2721,7 +2726,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
private TemplateMessage initSendToComplianceGreenChannelTemplate(String loginUrl, String wxopenid, String templateId2, String bd_user_name,
JSONObject client) {
JSONObject client) {
TemplateMessage msg = new TemplateMessage(wxopenid, templateId2, loginUrl);
msg.put("first", bd_user_name + " 提交了新商户绿色通道申请,请审核", "#ff0000");
msg.put("keyword1", client.getString("client_moniker") + "申请绿色通道", "#0000ff");
@ -2784,8 +2789,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
String wxopenid = compliance.getString("wx_openid");
try {
MpWechatApi paymentApi = mpWechatApiProvider.getNewPaymentApi();
TemplateMessage msg = initSendCommissionTemplate(wxopenid, paymentApi.getTemplateId("commission"), "BD申请制作合同" + client_moniker, bd_user_name, "制作合同申请",
"BD申请制作" + short_name + "的合同");
TemplateMessage msg = initSendCommissionTemplate(wxopenid, paymentApi.getTemplateId("commission"), "BD申请制作合同" + client_moniker,
bd_user_name, "制作合同申请", "BD申请制作" + short_name + "的合同");
paymentApi.sendTemplateMessage(msg);
} catch (WechatException e) {
logger.error("Wechat Message Error,open_status=1" + e.getMessage());
@ -2802,8 +2807,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if (wxopenid != null) {
try {
MpWechatApi paymentApi = mpWechatApiProvider.getNewPaymentApi();
TemplateMessage msg = initSendCommissionTemplate(wxopenid, paymentApi.getTemplateId("commission"), client_moniker + "合同制作完成", "Compliance", "合规材料",
"上传完整合规材料,商户:" + short_name);
TemplateMessage msg = initSendCommissionTemplate(wxopenid, paymentApi.getTemplateId("commission"), client_moniker + "合同制作完成",
"Compliance", "合规材料", "上传完整合规材料,商户:" + short_name);
paymentApi.sendTemplateMessage(msg);
} catch (WechatException e) {
logger.error("Wechat Message Error,open_status=3" + e.getMessage());
@ -2822,8 +2827,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
String wxopenid = compliance.getString("wx_openid");
try {
MpWechatApi paymentApi = mpWechatApiProvider.getNewPaymentApi();
TemplateMessage msg = initSendCommissionTemplate(wxopenid, paymentApi.getTemplateId("commission"), client_moniker + "合规材料已提交", bd_user_name, "审核材料",
"BD已提交合规材料等待审核");
TemplateMessage msg = initSendCommissionTemplate(wxopenid, paymentApi.getTemplateId("commission"), client_moniker + "合规材料已提交",
bd_user_name, "审核材料", "BD已提交合规材料等待审核");
paymentApi.sendTemplateMessage(msg);
} catch (WechatException e) {
logger.error("Wechat Message Error,open_status=1" + e.getMessage());
@ -2858,8 +2863,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
String wxopenid = compliance.getString("wx_openid");
try {
MpWechatApi paymentApi = mpWechatApiProvider.getNewPaymentApi();
TemplateMessage msg = initSendCommissionTemplate(wxopenid, paymentApi.getTemplateId("commission"), client_moniker + "申请绿色通道", bd_user_name, "绿色通道申请",
"BD已提交绿色通道申请,商户:" + short_name);
TemplateMessage msg = initSendCommissionTemplate(wxopenid, paymentApi.getTemplateId("commission"), client_moniker + "申请绿色通道",
bd_user_name, "绿色通道申请", "BD已提交绿色通道申请,商户:" + short_name);
paymentApi.sendTemplateMessage(msg);
} catch (WechatException e) {
logger.error("Wechat Message Error,open_status=10");

Loading…
Cancel
Save