|
|
|
@ -420,15 +420,13 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
client.put("temp_sub_merchant", checkSubMerchantIdInCommonPool(subMerchantId));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (client.getIntValue("approve_result") == 1
|
|
|
|
|
|| (client.getIntValue("approve_result") == 2 && (client.getIntValue("source") == 1 || client.getIntValue("source") == 2))) {
|
|
|
|
|
try {
|
|
|
|
|
JSONObject activeRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Wechat");
|
|
|
|
|
if (activeRate != null) {
|
|
|
|
|
client.put("rate_value", activeRate.getDouble("rate_value"));
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception ignore) {
|
|
|
|
|
try {
|
|
|
|
|
JSONObject activeRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Wechat");
|
|
|
|
|
if (activeRate != null) {
|
|
|
|
|
client.put("rate_value", activeRate.getDouble("rate_value"));
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception ignore) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
client.put("max_customer_surcharge_rate", PlatformEnvironment.getEnv().getMaxCustomerSurchargeRate());
|
|
|
|
|
if (client.getBigDecimal("rate_value") != null) {
|
|
|
|
@ -522,6 +520,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
@Override
|
|
|
|
|
public void exportClients(JSONObject manager, PartnerQuery query, HttpServletResponse resp) {
|
|
|
|
|
JSONObject params = prepareListClientsParameter(manager, query);
|
|
|
|
|
logger.info("exporting_clients:--->{}", params);
|
|
|
|
|
JSONObject retResp = serverlessFunctionTrigger.triggerFunction("export_merchants", params);
|
|
|
|
|
String contentB64 = retResp.getString("content");
|
|
|
|
|
resp.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
|
|
|
@ -1556,7 +1555,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
|
}
|
|
|
|
|
checkOrgPermission(manager, client);
|
|
|
|
|
checkPhoneAndWechatExist(account);
|
|
|
|
|
if (StringUtils.isNotBlank(account.getContactPhone())) {
|
|
|
|
|
checkPhoneAndWechatExist(account);
|
|
|
|
|
}
|
|
|
|
|
JSONObject accountJson = account.toJson();
|
|
|
|
|
JSONObject accountCheck = clientAccountMapper.findByUsernameForDuplicate(accountJson.getString("username"));
|
|
|
|
|
if (accountCheck != null) {
|
|
|
|
@ -1578,10 +1579,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void checkPhoneAndWechatExist(NewAccountBean account) {
|
|
|
|
|
if (clientAccountMapper.findByPhone(account.getContactPhone(), "+" + account.getNation_code()) != null) {
|
|
|
|
|
if (clientAccountMapper.findByPhone(account.getContactPhone(), account.getNation_code().startsWith("+")?account.getNation_code():"+"+account.getNation_code()) != null) {
|
|
|
|
|
throw new BadRequestException("Mobile phone number has been bound to other accounts");
|
|
|
|
|
}
|
|
|
|
|
;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -3615,7 +3615,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
Date endDate = TimeZoneUtils.nextYearByCurrDay();
|
|
|
|
|
String end_date = DateFormatUtils.format(endDate, "dd/MM/yyyy");
|
|
|
|
|
client.put("end_date", end_date);
|
|
|
|
|
client.put("full_name", URLDecoder.decode(file.getOriginalFilename(),"UTF-8"));
|
|
|
|
|
client.put("full_name", URLDecoder.decode(file.getOriginalFilename(), "UTF-8"));
|
|
|
|
|
BufferedImage img = ImageIO.read(file.getInputStream());
|
|
|
|
|
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
|
|
|
|
ImageIO.write(img, "png", out);
|
|
|
|
@ -4976,11 +4976,11 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
String[] payType = clientConfig.getString("client_pay_type").split(",");
|
|
|
|
|
if (Arrays.asList(payType).contains("1")) {
|
|
|
|
|
registerAlipayOnlineGms(clientMoniker, null);
|
|
|
|
|
switchChannelPermission(account, clientMoniker, "Alipay", true);
|
|
|
|
|
enableGatewayAlipayOnline(account, clientMoniker, true);
|
|
|
|
|
}
|
|
|
|
|
if (Arrays.asList(payType).contains("2")) {
|
|
|
|
|
registerAlipayGms(clientMoniker, null);
|
|
|
|
|
enableGatewayAlipayOnline(account, clientMoniker, true);
|
|
|
|
|
switchChannelPermission(account, clientMoniker, "Alipay", true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -5293,12 +5293,12 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
throw new BadRequestException("The Partner's Bank Account is not config!");
|
|
|
|
|
}
|
|
|
|
|
JSONObject representativeInfo = sysClientLegalPersonMapper.findRepresentativeInfo(client.getIntValue("client_id"));
|
|
|
|
|
for(String str:representativeInfo.keySet()){
|
|
|
|
|
if(representativeInfo.getString(str) == null || !(representativeInfo.getString(str).length()>0)|| !(client.getString("contact_job")!=null && client.getString("contact_job").length()>0)) {
|
|
|
|
|
for (String str : representativeInfo.keySet()) {
|
|
|
|
|
if (representativeInfo.getString(str) == null || !(representativeInfo.getString(str).length() > 0) || !(client.getString("contact_job") != null && client.getString("contact_job").length() > 0)) {
|
|
|
|
|
throw new BadRequestException("The LegalPersonInfo is not config!Please upgrade the RoyalPay App version");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if ( !(StringUtils.isNotBlank(client.getString("client_pay_type"))) || !(StringUtils.isNotBlank(client.getString("client_pay_desc"))) ) {
|
|
|
|
|
if (!(StringUtils.isNotBlank(client.getString("client_pay_type"))) || !(StringUtils.isNotBlank(client.getString("client_pay_desc")))) {
|
|
|
|
|
throw new BadRequestException("Merchant Payment Scenario is not config!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|