master
kira 6 years ago
parent 857c4517a8
commit fcb9a0ae6f

@ -15,10 +15,32 @@ import au.com.royalpay.payment.manage.application.core.SimpleClientApplyService;
import au.com.royalpay.payment.manage.device.core.DeviceManager; import au.com.royalpay.payment.manage.device.core.DeviceManager;
import au.com.royalpay.payment.manage.management.sysconfig.core.impls.PermissionPartnerManagerImpl; import au.com.royalpay.payment.manage.management.sysconfig.core.impls.PermissionPartnerManagerImpl;
import au.com.royalpay.payment.manage.mappers.financial.FinancialBDConfigMapper; import au.com.royalpay.payment.manage.mappers.financial.FinancialBDConfigMapper;
import au.com.royalpay.payment.manage.mappers.log.*; import au.com.royalpay.payment.manage.mappers.log.ClearingDetailMapper;
import au.com.royalpay.payment.manage.mappers.log.ClearingLogMapper;
import au.com.royalpay.payment.manage.mappers.log.ClientsOperationLogMapper;
import au.com.royalpay.payment.manage.mappers.log.LogClientSubMerchantIdMapper;
import au.com.royalpay.payment.manage.mappers.log.LogSettleMailMapper;
import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper; import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper;
import au.com.royalpay.payment.manage.mappers.redpack.ActClientInvitationCodeMapper; import au.com.royalpay.payment.manage.mappers.redpack.ActClientInvitationCodeMapper;
import au.com.royalpay.payment.manage.mappers.system.*; import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientApplyMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientAuditProcessMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientBDMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientBankAccountMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientConfigMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientDeviceMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientFilesMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientRateMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientsContractMapper;
import au.com.royalpay.payment.manage.mappers.system.CommoditiesMapper;
import au.com.royalpay.payment.manage.mappers.system.MailSendMapper;
import au.com.royalpay.payment.manage.mappers.system.MailUnsubMapper;
import au.com.royalpay.payment.manage.mappers.system.ManagerMapper;
import au.com.royalpay.payment.manage.mappers.system.OrgMapper;
import au.com.royalpay.payment.manage.mappers.system.PermissionClientModuleMapper;
import au.com.royalpay.payment.manage.mappers.system.PermissionPartnerModuleMapper;
import au.com.royalpay.payment.manage.mappers.system.SysWxMerchantApplyMapper;
import au.com.royalpay.payment.manage.merchants.beans.ActivityPosterBuilder; import au.com.royalpay.payment.manage.merchants.beans.ActivityPosterBuilder;
import au.com.royalpay.payment.manage.merchants.beans.BankAccountInfo; import au.com.royalpay.payment.manage.merchants.beans.BankAccountInfo;
import au.com.royalpay.payment.manage.merchants.beans.ClientAuthFilesInfo; import au.com.royalpay.payment.manage.merchants.beans.ClientAuthFilesInfo;
@ -273,8 +295,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Resource @Resource
private PermissionPartnerManagerImpl permissionPartnerManagerImpl; private PermissionPartnerManagerImpl permissionPartnerManagerImpl;
private static final String SOURCE_AGREE_FILE = "source_agree_file"; private static final String SOURCE_AGREE_FILE = "source_agree_file";
private static final String CLIENT_BANK_FILE = "client_bank_file"; private static final String CLIENT_BANK_FILE = "client_bank_file";
private static final String CLIENT_ID_FILE = "client_id_file"; private static final String CLIENT_ID_FILE = "client_id_file";
@ -336,7 +356,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
int role = manager != null ? manager.getIntValue("role") : 0; int role = manager != null ? manager.getIntValue("role") : 0;
if (manager != null) { if (manager != null) {
if (ManagerRole.OPERATOR.hasRole(role)) { if (ManagerRole.OPERATOR.hasRole(role)) {
List<JSONObject> log = logClientSubMerchantIdMapper.listLogsByClientId(client.getInteger("client_id"),new PageBounds(Order.formString("create_time.desc"))); List<JSONObject> log = logClientSubMerchantIdMapper.listLogsByClientId(client.getInteger("client_id"),
new PageBounds(Order.formString("create_time.desc")));
client.put("sub_merchant_id_log", log.size() > 0 ? true : false); client.put("sub_merchant_id_log", log.size() > 0 ? true : false);
} }
if (ManagerRole.BD_USER.hasRole(role)) { if (ManagerRole.BD_USER.hasRole(role)) {
@ -764,6 +785,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
clientMapper.update(update); clientMapper.update(update);
clientInfoCacheSupport.clearClientCache(clientId); clientInfoCacheSupport.clearClientCache(clientId);
} }
private String createWechatInstitutionMerchantId(String wechatInstitutionMerchantId) { private String createWechatInstitutionMerchantId(String wechatInstitutionMerchantId) {
JSONObject client = clientMapper.findByWechatInstitutionMerchantId(wechatInstitutionMerchantId); JSONObject client = clientMapper.findByWechatInstitutionMerchantId(wechatInstitutionMerchantId);
if (client == null) { if (client == null) {
@ -959,62 +981,33 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} }
}.start(); }.start();
} }
/** /**
* public void sendInitEmail(JSONObject account, final JSONObject client, String username, String pwd) { * public void sendInitEmail(JSONObject account, final JSONObject client, String username, String pwd) {
logger.debug("sending email after comply"); * logger.debug("sending email after comply"); JSONObject model = new JSONObject(); model.put("username", username);
JSONObject model = new JSONObject(); * model.put("password", pwd); model.put("client_moniker", client.getString("client_moniker"));
model.put("username", username); * model.put("contact_person", client.getString("contact_person")); model.put("credential_code",
model.put("password", pwd); * client.getString("credential_code")); List<JSONObject> bds =
model.put("client_moniker", client.getString("client_moniker")); * clientBDMapper.listClientBDInfoAvailable(client.getIntValue("client_id"), new Date()); // todo Velocity Context
model.put("contact_person", client.getString("contact_person")); * ctx = new Context(); ctx.setVariable("bds", bds); ctx.setVariable("password", pwd); ctx.setVariable("username",
model.put("credential_code", client.getString("credential_code")); * username); ctx.setVariable("client_moniker", client.getString("client_moniker"));
List<JSONObject> bds = clientBDMapper.listClientBDInfoAvailable(client.getIntValue("client_id"), new Date()); * ctx.setVariable("contact_person", client.getString("contact_person")); ctx.setVariable("credential_code",
// todo Velocity * client.getString("credential_code")); ctx.setVariable("short_name", client.getString("short_name")); final String
Context ctx = new Context(); * content = thymeleaf.process("mail/new_client_notice", ctx); // final String content =
ctx.setVariable("bds", bds); * VelocityEngineUtils.mergeTemplateIntoString(null, "mail/new_client_notice.vm", // "utf-8", model); final String
ctx.setVariable("password", pwd); * mailTo = client.getString("contact_email"); if (StringUtils.isEmpty(mailTo)) { throw new EmailException("Client
ctx.setVariable("username", username); * Contact Email is invalid"); } final Set<String> emails = new HashSet<>(); for (JSONObject bd : bds) { String
ctx.setVariable("client_moniker", client.getString("client_moniker")); * email = bd.getString("email"); if (StringUtils.isNotEmpty(email)) { emails.add(email); } } new Thread() {
ctx.setVariable("contact_person", client.getString("contact_person")); *
ctx.setVariable("credential_code", client.getString("credential_code")); * @Override public void run() { try { SendMail sendMail = new SendMail(); Set<String> to = new HashSet<>();
ctx.setVariable("short_name", client.getString("short_name")); * to.add(mailTo); sendMail.setFrom("info@mail.royalpay.com.au"); sendMail.setMailTos(to);
final String content = thymeleaf.process("mail/new_client_notice", ctx); * sendMail.setMailCcs(emails); sendMail.setTitle("Your RoyalPay Cross-border Payment has been set up");
// final String content = VelocityEngineUtils.mergeTemplateIntoString(null, "mail/new_client_notice.vm", * sendMail.setContent(content); sendMail.setTags(tags); JSONObject mailResult =
// "utf-8", model); * mailGunService.sendMail(sendMail); clientModifySupport.processClientModify(new EmailModify(account,
final String mailTo = client.getString("contact_email"); * client.getString("client_moniker"), 3, mailResult.getString("mail_id"))); } catch (Exception e) {
if (StringUtils.isEmpty(mailTo)) { * clientModifySupport.processClientModify(new EmailModify(account, client.getString("client_moniker"), 0,
throw new EmailException("Client Contact Email is invalid"); * null)); throw new EmailException("Email Sending Failed", e); } } }.start(); }
} *
final Set<String> emails = new HashSet<>();
for (JSONObject bd : bds) {
String email = bd.getString("email");
if (StringUtils.isNotEmpty(email)) {
emails.add(email);
}
}
new Thread() {
@Override
public void run() {
try {
SendMail sendMail = new SendMail();
Set<String> to = new HashSet<>();
to.add(mailTo);
sendMail.setFrom("info@mail.royalpay.com.au");
sendMail.setMailTos(to);
sendMail.setMailCcs(emails);
sendMail.setTitle("Your RoyalPay Cross-border Payment has been set up");
sendMail.setContent(content);
sendMail.setTags(tags);
JSONObject mailResult = mailGunService.sendMail(sendMail);
clientModifySupport.processClientModify(new EmailModify(account, client.getString("client_moniker"), 3, mailResult.getString("mail_id")));
} catch (Exception e) {
clientModifySupport.processClientModify(new EmailModify(account, client.getString("client_moniker"), 0, null));
throw new EmailException("Email Sending Failed", e);
}
}
}.start();
}
*/ */
public void sendAuthInitEmail(JSONObject account, final JSONObject client) { public void sendAuthInitEmail(JSONObject account, final JSONObject client) {
@ -3008,8 +3001,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if (client == null) { if (client == null) {
throw new InvalidShortIdException(); throw new InvalidShortIdException();
} }
clientModifySupport clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account, client.getString("client_moniker"), "require_remark", requireRemark));
.processClientConfigModify(new SwitchPermissionModify(account, client.getString("client_moniker"), "require_remark", requireRemark));
} }
@ -3058,12 +3050,21 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} }
saveClientAuditProcess(client.getIntValue("client_id"), open_status, client.getInteger("open_status"), "打回," + refuse_remark, manager); saveClientAuditProcess(client.getIntValue("client_id"), open_status, client.getInteger("open_status"), "打回," + refuse_remark, manager);
clientModifySupport.processClientModify(auditModify); clientModifySupport.processClientModify(auditModify);
if(client.getIntValue("source") == 4){
client.getString("contact_phone");
}
try { try {
sendMessageToBD(client, refuse_remark); sendMessageToBD(client, refuse_remark);
if (client.getIntValue("source") == 4) {
String contact_phone = client.getString("contact_phone");
if (contact_phone.startsWith("+61")) {
ArrayList<String> param = new ArrayList<>();
param.add(refuse_remark);
try {
SmsSender.getSender().sendWithParam("+61", contact_phone.replace("+61", ""), REFUSE_CLIENT_TEMPLID, param, "RoyalPay", "", "");
} catch (Exception ignore) {
throw new ServerErrorException("Phone number is wrong :" + contact_phone);
}
}
}
} catch (Exception e) { } catch (Exception e) {
logger.error("RefusePartnerError=======:" + clientMoniker + "," + e.getMessage()); logger.error("RefusePartnerError=======:" + clientMoniker + "," + e.getMessage());
} }
@ -3737,7 +3738,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} }
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(manager, clientMoniker, "enable_link", allow)); clientModifySupport.processClientConfigModify(new SwitchPermissionModify(manager, clientMoniker, "enable_link", allow));
} }
@Override @Override

Loading…
Cancel
Save