diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/EstimateAnalysisServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/EstimateAnalysisServiceImpl.java index 5e2120145..1fedfab93 100644 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/EstimateAnalysisServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/EstimateAnalysisServiceImpl.java @@ -12,16 +12,23 @@ import au.com.royalpay.payment.manage.mappers.log.PlatformSettlementMapper; import au.com.royalpay.payment.manage.mappers.system.ClientMapper; import au.com.royalpay.payment.tools.exceptions.NotFoundException; import au.com.royalpay.payment.tools.utils.TimeZoneUtils; + import com.alibaba.fastjson.JSONObject; + import org.apache.commons.lang3.time.DateFormatUtils; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; -import javax.annotation.Resource; import java.math.BigDecimal; import java.text.DateFormat; import java.text.SimpleDateFormat; -import java.util.*; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.TimeZone; + +import javax.annotation.Resource; /** * Created by Tayl0r on 2017/7/3. @@ -163,6 +170,12 @@ public class EstimateAnalysisServiceImpl implements EstimateAnalysisService { dayInfo.put("aliSettleFee_" + logs.getString("merchants"), logs.getBigDecimal("settlement_fee")); dayInfo.put("platformGetSettleFee",dayInfo.getBigDecimal("aliSettleFee_" + logs.getString("merchants"))); } + + List alipayOnlineSettleLogs = platformSettlementMapper.findBySettleDate(new Date(estimateAnalysisMapper.findLastCleanDays(end_date, 1).getDate("date_str").getTime()), "AlipayOnline"); + for (JSONObject logs : alipayOnlineSettleLogs) { + dayInfo.put("aliOnlineSettleFee_" + logs.getString("merchants"), logs.getBigDecimal("settlement_fee")); + dayInfo.put("platformGetSettleFee",dayInfo.getBigDecimal("platformGetSettleFee").add(dayInfo.getBigDecimal("aliOnlineSettleFee_" + logs.getString("merchants")))); + } cleanDays.clear(); //T2 diff --git a/src/main/java/au/com/royalpay/payment/manage/application/beans/ClientPreApplyBean.java b/src/main/java/au/com/royalpay/payment/manage/application/beans/ClientPreApplyBean.java index d00e8e90a..8f2f4c2be 100644 --- a/src/main/java/au/com/royalpay/payment/manage/application/beans/ClientPreApplyBean.java +++ b/src/main/java/au/com/royalpay/payment/manage/application/beans/ClientPreApplyBean.java @@ -52,6 +52,7 @@ public class ClientPreApplyBean { @NotEmpty(message = "codeKey can't be null") private String codeKey; private boolean agree; + private String nation_code; public JSONObject insertObject() { JSONObject res = (JSONObject) JSON.toJSON(this); @@ -225,4 +226,12 @@ public class ClientPreApplyBean { public void setCodeKey(String codeKey) { this.codeKey = codeKey; } + + public String getNation_code() { + return nation_code; + } + + public void setNation_code(String nation_code) { + this.nation_code = nation_code; + } } diff --git a/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java index fc4b29bfb..22b1bb925 100644 --- a/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java @@ -1,5 +1,7 @@ package au.com.royalpay.payment.manage.application.core.impls; +import au.com.royalpay.payment.channels.wechat.config.WeChatPayConfig; +import au.com.royalpay.payment.channels.wechat.runtime.MpPaymentApi; import au.com.royalpay.payment.core.mappers.PmtSubMerchantIdMapper; import au.com.royalpay.payment.manage.application.core.SimpleClientApplyService; import au.com.royalpay.payment.manage.mappers.preapply.SysClientPreMapperMapper; @@ -44,6 +46,7 @@ import java.util.ArrayList; import java.util.Date; import java.util.HashSet; import java.util.List; +import java.util.Random; import java.util.Set; import java.util.concurrent.TimeUnit; @@ -63,6 +66,8 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { @Value("${royalpay.sms.appkey:43390d81e20c5191c278fbf4cd275be2}") private String appKey; @Resource + private MpPaymentApi mpPaymentApi; + @Resource private SysConfigManager sysConfigManager; @Resource private MailGunService mailGunService; @@ -140,7 +145,7 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { String registerClientCode = RandomStringUtils.random(6, false, true); param.add("RoyalPay"); param.add(registerClientCode); - String expireMin = (String) sysConfig.getOrDefault("sms.verification.code.expire", 3); + String expireMin = String.valueOf(sysConfig.getOrDefault("sms.verification.code.expire", 3)); param.add(expireMin); try { sender.sendWithParam(nationCode.trim(), phoneNumber, REGISTER_CLIENT_TEMPLID, param, "RoyalPay", "", ""); @@ -158,6 +163,9 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { if (client == null) { throw new BadRequestException("Merchant not found"); } + if(client.getBooleanValue("mail_confirm")){ + throw new BadRequestException("mail address has been verified"); + } String key = checkOrGenerateVerifyMailKey(address, null); Context ctx = new Context(); ctx.setVariable("url", PlatformEnvironment.getEnv().concatUrl("/register/account/mail/" + address + "/verify/" + key + "/jump?username="+username)); @@ -257,7 +265,11 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { } JSONObject apply = sysClientPreMapperMapper.findByUserName(username); - JSONObject subMerchantId = pmtSubMerchantIdMapper.randomOne(); + JSONObject sysConfig = sysConfigManager.getSysConfig(); + + String arr [] = sysConfig.getString("temp_sub_mch_id").split(","); + String tempSubMerchantId = arr[new Random().nextInt(arr.length) + 1]; + WeChatPayConfig.Merchant availableMerchant = mpPaymentApi.determineMerchant(tempSubMerchantId); String clientMoniker = generateClientMoniker(); JSONObject sysClient = new JSONObject(); sysClient.put("company_name",apply.getString("company_name")); @@ -276,11 +288,14 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { sysClient.put("create_time",new Date()); sysClient.put("source",4); sysClient.put("approve_result",2); + sysClient.put("approve_time",new Date()); sysClient.put("creator",0); + sysClient.put("business_name",apply.getString("short_name")); sysClient.put("industry",331); - sysClient.put("merchant_id",subMerchantId.getString("merchant_id")); - sysClient.put("sub_merchant_id",subMerchantId.getString("sub_merchant_id")); + sysClient.put("merchant_id", availableMerchant.getMerchantId()); + sysClient.put("sub_merchant_id",tempSubMerchantId); sysClient.put("common_sub_merchant_id",1); + sysClient.put("credential_code", RandomStringUtils.random(32, true, true)); clientMapper.save(sysClient); int clientId = sysClient.getIntValue("client_id"); @@ -290,11 +305,11 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { sysAccount.put("display_name",apply.getString("username")); String salt = PasswordUtils.newSalt(); sysAccount.put("salt", salt); + sysAccount.put("role", 1); sysAccount.put("password_hash", PasswordUtils.hashPwd(apply.getString("password"), salt)); sysAccount.put("password_aes", PasswordUtils.encryptAESPwd(apply.getString("password"))); sysAccount.put("creator",0); sysAccount.put("contact_phone",apply.getString("contact_phone")); - sysAccount.put("password_hash",apply.getString("password")); sysAccount.put("client_id",clientId); sysAccount.put("create_time",new Date()); sysAccount.put("is_password_expired",0); @@ -316,12 +331,12 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { sysBank.put("branch",bankInfo.getString("branch")); clientBankAccountMapper.save(sysBank); - JSONObject sysConfig = new JSONObject(); - sysConfig.put("client_id",clientId); - sysConfig.put("client_moniker",clientMoniker); - sysConfig.put("clean_days",apply.getIntValue("clean_days")); - sysConfig.put("common_sub_merchant_id",1); - clientConfigMapper.save(sysConfig); + JSONObject clientConfig = new JSONObject(); + clientConfig.put("client_id",clientId); + clientConfig.put("client_moniker",clientMoniker); + clientConfig.put("clean_days",apply.getIntValue("clean_days")); + clientConfig.put("common_sub_merchant_id",1); + clientConfigMapper.save(clientConfig); JSONObject sysRate = new JSONObject(); sysRate.put("client_id",clientId); @@ -350,6 +365,11 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { configNewClientRate(sysRate, clientId, "AlipayOnline", "AlipayOnline"); configNewClientRate(sysRate, clientId, "Bestpay", "Bestpay"); configNewClientRate(sysRate, clientId, "jd", "JDpay"); + try { + clientManager.getNewAggregateAgreeFile(clientMoniker,null,false); + } catch (Exception ignore) { + } + } private String generateClientMoniker(){ @@ -400,7 +420,7 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { LoginInfo loginInfo = new LoginInfo(); loginInfo.setLoginId(loginAccount.getString("userName")); loginInfo.setPassword(loginAccount.getString("password")); - JSONObject account = signInAccountService.accountCheck(loginInfo); + JSONObject account = signInAccountService.clientLoginCheck(loginInfo); JSONObject client = clientManager.getClientInfo(account.getIntValue("client_id")); if (!address.equals(client.getString("contact_email"))) { throw new BadRequestException(LocaleSupport.localeMessage("error.login.password")); diff --git a/src/main/java/au/com/royalpay/payment/manage/application/web/SimpleClientApplyController.java b/src/main/java/au/com/royalpay/payment/manage/application/web/SimpleClientApplyController.java index c409e3288..4b96f8fb3 100644 --- a/src/main/java/au/com/royalpay/payment/manage/application/web/SimpleClientApplyController.java +++ b/src/main/java/au/com/royalpay/payment/manage/application/web/SimpleClientApplyController.java @@ -76,10 +76,8 @@ public class SimpleClientApplyController { @RequestMapping(value = "/info/phone/{phone_number}/verify", method = RequestMethod.POST) @ResponseBody - public JSONObject getAndSendSmsCode(@PathVariable String phone_number, @RequestParam String nation_code) { - JSONObject result = new JSONObject(); - result.put("phoneCodeKey", simpleClientApplyService.getAndSendSmsCode(phone_number, nation_code)); - return result; + public void getAndSendSmsCode(@PathVariable String phone_number, @RequestParam String nation_code) { + simpleClientApplyService.getAndSendSmsCode(phone_number, nation_code); } @RequestMapping(value = "/info/update/{username}", method = RequestMethod.POST) diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/ClientRegisterInfo.java b/src/main/java/au/com/royalpay/payment/manage/merchants/beans/ClientRegisterInfo.java index eb65168f7..8c0f45cd5 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/ClientRegisterInfo.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/beans/ClientRegisterInfo.java @@ -31,7 +31,7 @@ public class ClientRegisterInfo { // @NotEmpty(message = "error.payment.valid.param_missing") private String industry; @JSONField(name = "alipayindustry") - @NotEmpty(message = "error.payment.valid.param_missing") + /* @NotEmpty(message = "error.payment.valid.param_missing")*/ private String alipayIndustry; @JSONField(name = "company_photo") private String companyPhoto; diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java index 6ab259398..febcab7e8 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java @@ -292,4 +292,6 @@ public interface ClientManager { List getClientSubMerchantIdLogs(String clientMoniker,JSONObject manager); void applyToCompliance(String client_moniker, JSONObject account); + + void sendVerifyEmail(JSONObject client,String accountId); } diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java index 631b59bc6..a6f3411eb 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java @@ -11,6 +11,7 @@ import au.com.royalpay.payment.core.exceptions.InvalidShortIdException; import au.com.royalpay.payment.core.utils.OrderExpiryRuleResolver; import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper; import au.com.royalpay.payment.manage.appclient.beans.AppClientBean; +import au.com.royalpay.payment.manage.application.core.SimpleClientApplyService; import au.com.royalpay.payment.manage.device.core.DeviceManager; import au.com.royalpay.payment.manage.mappers.financial.FinancialBDConfigMapper; import au.com.royalpay.payment.manage.mappers.log.ClientsOperationLogMapper; @@ -264,6 +265,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid @Resource private ClientInfoCacheSupport clientInfoCacheSupport; + + @Resource + private SimpleClientApplyService simpleClientApplyService; @Resource private MongoTemplate mongoTemplate; @Resource @@ -3439,4 +3443,11 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid sendCommissionWechatMessage(client); } } + + @Override + public void sendVerifyEmail(JSONObject client,String accountId) { + JSONObject clientAccount = clientAccountMapper.findById(accountId); + Assert.notNull(clientAccount); + simpleClientApplyService.sendVerifyEmail(client.getString("contact_email"),client.getIntValue("client_id"),clientAccount.getString("username")); + } } diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerViewController.java b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerViewController.java index 3ecfa512b..e1eb68b66 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerViewController.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerViewController.java @@ -1,6 +1,9 @@ package au.com.royalpay.payment.manage.merchants.web; import au.com.royalpay.payment.core.exceptions.ParamInvalidException; +import au.com.royalpay.payment.manage.application.core.SimpleClientApplyService; +import au.com.royalpay.payment.manage.merchants.beans.ClientAuthFilesInfo; +import au.com.royalpay.payment.manage.merchants.beans.ClientRegisterInfo; import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean; import au.com.royalpay.payment.manage.merchants.core.ClientManager; import au.com.royalpay.payment.manage.merchants.core.ClientSignEventSupport; @@ -57,6 +60,9 @@ public class PartnerViewController { @Resource private ClientContractService clientContractService; + @Resource + private SimpleClientApplyService simpleClientApplyService; + @RequestMapping(method = RequestMethod.GET) @RequirePartner @ResponseBody @@ -385,4 +391,41 @@ public class PartnerViewController { public void commitAudit(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { clientManager.applyToCompliance(account.getString("client_moniker"),account); } + + @PartnerMapping(value = "/compliance/files", method = RequestMethod.GET) + @ResponseBody + public JSONObject complianceFile(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { + return clientManager.getAuthFiles(null,account.getString("client_moniker")); + } + + @PartnerMapping(value = "/verify/email", method = RequestMethod.PUT) + @ResponseBody + public void sendVerifyEmail(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { + clientManager.sendVerifyEmail(account.getJSONObject("client"),account.getString("account_id")); + } + + @PartnerMapping(value = "/update/partnerInfo", method = RequestMethod.PUT) + @ResponseBody + public void updatePartnerInfo(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account,@RequestBody ClientRegisterInfo info) { + JSONObject client = account.getJSONObject("client"); + if (client.getIntValue("approve_result") != 1 && client.getIntValue("source") == 4){ + clientManager.updateClientRegisterInfo(null,account.getString("client_moniker"),info); + }else { + throw new BadRequestException("已通过审核,暂不能提交和修改"); + } + + } + + @PartnerMapping(value = "/update/file", method = RequestMethod.PUT) + @ResponseBody + public void updateFile(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody ClientAuthFilesInfo filesInfo) { + JSONObject client = account.getJSONObject("client"); + if (client.getIntValue("approve_result") != 1 && client.getIntValue("source") == 4){ + JSONObject manager = new JSONObject(); + manager.put("display_name","client"); + clientManager.uploadAuthFiles(manager, account.getString("client_moniker"), filesInfo); + }else { + throw new BadRequestException("已通过审核,暂不能提交和修改"); + } + } } diff --git a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/TransactionAnalysisMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/TransactionAnalysisMapper.xml index 013fb8311..faf20b1d1 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/TransactionAnalysisMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/TransactionAnalysisMapper.xml @@ -196,6 +196,10 @@ THEN 'APP' WHEN 11 THEN 'Share Code' + WHEN 12 + THEN 'MICROAPP' + WHEN 13 + THEN 'Native QR Code' END AS gateway_label, ifnull(sum(if(l.transaction_type='Credit',l.clearing_amount,0)), 0) aud_fee FROM pmt_transactions l @@ -455,6 +459,10 @@ THEN 'APP' WHEN 11 THEN 'Share Code' + WHEN 12 + THEN 'MICROAPP' + WHEN 13 + THEN 'Native QR Code' END AS gateway_label, ifnull(COUNT(DISTINCT l.client_id), 0) partner_count FROM pmt_transactions l @@ -512,6 +520,12 @@ and o.gateway=11 + + and o.gateway=12 + + + and o.gateway=13 + and l.org_id=#{org_id} and l.org_id in #{org_id} @@ -595,6 +609,12 @@ and o.gateway=11 + + and o.gateway=12 + + + and o.gateway=13 + and ptran.org_id=#{org_id} and ptran.org_id in #{org_id} diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.xml index 027f4ac1b..d4d2c9011 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.xml @@ -87,6 +87,8 @@ THEN 'APP' WHEN 12 THEN 'MICROAPP' + WHEN 13 + THEN 'Native QR Code' END AS gateway, p.client_moniker partner_code, p.short_name partner_name, diff --git a/src/main/resources/templates/mail/verify_mail.html b/src/main/resources/templates/mail/verify_mail.html index e68034a6d..5fa6b2a3b 100644 --- a/src/main/resources/templates/mail/verify_mail.html +++ b/src/main/resources/templates/mail/verify_mail.html @@ -52,7 +52,7 @@
- +
@@ -114,7 +114,7 @@ $("#bg").hide(); $("#show").hide(); alert("Succes"); - location.href = 'index.html' + location.href = '/login.html'; }, error: function (jqXHR) { $("#bg").hide(); diff --git a/src/main/ui/merchant_application.html b/src/main/ui/merchant_application.html index 23e6a03d8..40171ea05 100644 --- a/src/main/ui/merchant_application.html +++ b/src/main/ui/merchant_application.html @@ -1,5 +1,6 @@ - + @@ -272,7 +273,7 @@
+ required maxlength="50" name="contact_email" ng-mouseleave="checkParams()" ng-mousedown="trueEmail =false">

The mailbox is incorrect

@@ -283,14 +284,16 @@ ng-class="{'has-error':accountForm.contact_phone.$invalid && accountForm.contact_phone.$dirty || name_exist}">
+61 - + placeholder="Your Phone" maxlength="15" ng-mouseleave="checkParams()" ng-mousedown="name_exist =false">
+
+ The phone number has already existed +
phone number is also your login id
@@ -299,8 +302,8 @@
- +
+ placeholder="Company Name" required maxlength="80">
@@ -345,17 +348,17 @@
+ placeholder="Merchant Name" required maxlength="50">
+ placeholder="Company phone" required maxlength="20">
+ name="address" required maxlength="200">
+ maxlength="10" name="postcode">
@@ -420,14 +423,15 @@
-
@@ -494,27 +498,27 @@
-

  WeChat Rate Value: {{rate.wechat_rate_value}}%

+

  WeChat Rate Value:  {{rate.wechat_rate_value}}%

-

  Alipay Rate Value(Retail): {{rate.alipay_rate_value}}%

+

  Alipay Rate Value(Retail):  {{rate.alipay_rate_value}}%

-

  Alipay Rate Value(Online): {{rate.alipayonline_rate_value}}%

+

  Alipay Rate Value(Online):  {{rate.alipayonline_rate_value}}%

-

  Bestpay Rate Value: {{rate.bestpay_rate_value}}%

+

  Bestpay Rate Value:  {{rate.bestpay_rate_value}}%

-

  JD Rate Value: {{rate.jd_rate_value}}%

+

  JD Rate Value:  {{rate.jd_rate_value}}%

- +
diff --git a/src/main/ui/static/analysis/templates/settle_estimate_analysis.html b/src/main/ui/static/analysis/templates/settle_estimate_analysis.html index e2eb2bed8..2de2c0e78 100644 --- a/src/main/ui/static/analysis/templates/settle_estimate_analysis.html +++ b/src/main/ui/static/analysis/templates/settle_estimate_analysis.html @@ -51,6 +51,7 @@

(1431999902)到账金额:

(1487387142)到账金额:

Alipay 到账金额:

+

AliPayOnline 到账金额(AlipayOnline):

RoyalPay 总到账金额:

diff --git a/src/main/ui/static/boot/indexMainApp.js b/src/main/ui/static/boot/indexMainApp.js index fb359860b..7f6454032 100644 --- a/src/main/ui/static/boot/indexMainApp.js +++ b/src/main/ui/static/boot/indexMainApp.js @@ -21,7 +21,7 @@ define(['angular', 'angularSanitize', 'angularAnimate', 'angularMessages', 'uiRo $scope.loadCurrentUser = function () { $http.get('/global/userstatus/current_partner').then(function (resp) { $rootScope.currentUser = resp.data; - if ((resp.data.client.approve_result == 2 || resp.data.client.approve_result == 3) && resp.data.client.source == 4) { + /* if ((resp.data.client.approve_result == 2 || resp.data.client.approve_result == 3) && resp.data.client.source == 4) { if (resp.data.wechat_openid == null) { $scope.newPartnerGuide(resp.data); } else { @@ -32,7 +32,7 @@ define(['angular', 'angularSanitize', 'angularAnimate', 'angularMessages', 'uiRo }); } - } + }*/ if ($rootScope.currentUser.is_password_expired) { commonDialog.confirm({ title: 'Change Password!', @@ -542,7 +542,9 @@ define(['angular', 'angularSanitize', 'angularAnimate', 'angularMessages', 'uiRo case '11': return 'Share Code'; case '12': - return 'MICROAPP' + return 'MICROAPP'; + case '13': + return 'Native QR Code' } } }); diff --git a/src/main/ui/static/boot/managerMainApp.js b/src/main/ui/static/boot/managerMainApp.js index f0850e4e8..b7cf22c8a 100644 --- a/src/main/ui/static/boot/managerMainApp.js +++ b/src/main/ui/static/boot/managerMainApp.js @@ -327,7 +327,9 @@ define(['angular', 'angularSanitize', 'angularAnimate', 'angularMessages', 'uiRo case '11': return '账单码'; case '12': - return '小程序' + return '小程序'; + case '13': + return '原生二维码' } } }); diff --git a/src/main/ui/static/css/merchant_application.css b/src/main/ui/static/css/merchant_application.css index 218f8cb27..c99261d17 100644 --- a/src/main/ui/static/css/merchant_application.css +++ b/src/main/ui/static/css/merchant_application.css @@ -95,7 +95,7 @@ body .progress_inner__step:before { height: 30px; color: #70afd0; background: white; - line-height: 30px; + line-height: 26px; border: 3px solid #a6cde2; font-size: 12px; top: 3px; diff --git a/src/main/ui/static/dashboard/partner-dashboard.js b/src/main/ui/static/dashboard/partner-dashboard.js index c2a26c267..115835087 100644 --- a/src/main/ui/static/dashboard/partner-dashboard.js +++ b/src/main/ui/static/dashboard/partner-dashboard.js @@ -568,7 +568,8 @@ define(['angular','decimal', 'uiRouter', 'uiBootstrap', 'angularEcharts'], funct } }]);*/ - app.controller('partnerDashboardCtrl', ['$scope', '$http', '$filter', '$uibModal','$timeout', 'chartParser','clearingDetailService', function ($scope, $http, $filter, $uibModal,$timeout, chartParser,clearingDetailService) { + app.controller('partnerDashboardCtrl', ['$scope', '$http', '$filter', '$uibModal','$timeout', 'chartParser','clearingDetailService','commonDialog', function ($scope, $http, $filter, $uibModal,$timeout, chartParser,clearingDetailService,commonDialog) { + $scope.sendMailCount = 0; $scope.scales = [ { key: 'today', @@ -901,6 +902,7 @@ define(['angular','decimal', 'uiRouter', 'uiBootstrap', 'angularEcharts'], funct $scope.getCurrentPartner = function () { $http.get('/client/partner_info').then(function (resp) { $scope.manual_settle = resp.data.manual_settle; + $scope.mail_confirm = resp.data.mail_confirm; }) }; $scope.getCurrentPartner(); @@ -910,190 +912,62 @@ define(['angular','decimal', 'uiRouter', 'uiBootstrap', 'angularEcharts'], funct controller: 'unSettledAmountHistoryDialogCtrl' }) }; - + $scope.contactCustomerService = function () { + $uibModal.open({ + templateUrl: 'static/dashboard/templates/dashboard_service_support.html', + controller: 'contactCustomerServiceDialogCtrl', + size: 'sm' + }) + }; $scope.getClearingTransactions = function (client_id, detailId) { clearingDetailService.clientClearingDetail(client_id, detailId, true) }; - }]); - - app.controller('exchangeRateHistoryDialogCtrl', ['$scope', '$http', '$filter', 'chartParser', function ($scope, $http, $filter, chartParser) { - $scope.loadExchangeRateHistory = function (days) { - var endDate = new Date(); - var startDate = new Date(); - startDate.setDate(startDate.getDate() - days); - $http.get('/dashboard/system/exchange_rates', { - params: { - begin: $filter('date')(startDate, 'yyyyMMdd'), - end: $filter('date')(endDate, 'yyyyMMdd') - } - }).then(function (resp) { - handleRateHistoryChart(resp.data); - }) - }; - $scope.loadExchangeRateHistory(7); - var rateHistoryConfig = { - chart: { - tooltip: { - trigger: 'axis', - }, - toolbox: { - show: true, - feature: { - mySeven: { - title: 'Last 7 Days', - show: true, - icon: 'path://M3.59-4.07L32.38-4.07L32.38 0.04Q22.25 25.11 17.19 46.34L10.65 46.34Q16.14 26.94 26.19 1.41L3.59 1.41L3.59-4.07Z', - onclick: function () { - $scope.loadExchangeRateHistory(7) - } - }, - myThirty: { - title: 'Last 30 Days', - show: true, - icon: 'path://M12.52 17.02L16.10 17.02Q20.71 17.02 22.43 15.72Q25.66 13.23 25.66 8.23Q25.66-0.63 17.61-0.63Q10.93-0.63 9.42 6.93L3.73 6.93Q4.50 2.19 7.03-0.91Q10.90-5.51 17.61-5.51Q23.24-5.51 26.89-2.28Q31.22 1.52 31.22 8.02Q31.22 16.78 23.38 19.48Q32.84 23.14 32.84 32.81Q32.84 39.00 29.32 42.97Q25.10 47.79 17.72 47.79Q10.79 47.79 6.68 43.04Q3.66 39.56 3.02 33.44L8.93 33.44Q9.67 42.83 17.72 42.83Q21.45 42.83 23.98 40.72Q27.14 38.01 27.14 32.81Q27.14 21.63 16.10 21.63L12.52 21.63L12.52 17.02ZM54-5.51Q67.99-5.51 67.99 21.14Q67.99 47.79 54 47.79Q40.04 47.79 40.04 21.14Q40.04-5.51 54-5.51M46.97 33.65L59.84 4.30Q57.80-0.55 53.93-0.55Q45.95-0.55 45.95 21.14Q45.95 28.52 46.97 33.65M48.16 37.91Q50.13 42.83 54 42.83Q62.09 42.83 62.09 21.07Q62.09 13.86 61.07 8.66L48.16 37.91Z', - onclick: function () { - $scope.loadExchangeRateHistory(30) - } - } + $scope.checkStartGuidance = function () { + $http.get('/client/partner_info/compliance/files').then(function (resp) { + $scope.complianceFiles = resp.data; + if($scope.complianceFiles.client_id_file != null){ + if($scope.complianceFiles.client_bank_file != null && $scope.complianceFiles.client_company_file != null){ + $scope.toCommitFiles = true; } - }, - legend: { - data: ['Wechat', 'Alipay'], - bottom: 0, - height: '15%', - width: '80%', - left: '10%' - }, - yAxis: { - type: 'value', - name: 'Exchange Rate', - min: 'auto' } - }, - xAxis: { - basic: { - type: 'category', - boundaryGap: false - }, - key: 'date' - }, - series: [ - { - basic: { - name: 'Wechat', - type: 'line', - label: {normal: {show: true}}, - showAllSymbols: true, - showSymbol: true, - yAxisIndex: 0, - itemStyle : { - normal : { - color:'#09bb07', - lineStyle:{ - color:'#09bb07' - } - } - } - - }, - column: {key: 'Wechat.exchange_rate'} - }, - { - basic: { - name: 'Alipay', - type: 'line', - label: {normal: {show: true}}, - showAllSymbols: true, - showSymbol: true, - yAxisIndex: 0, - itemStyle : { - normal : { - color:'#00c0ef', - lineStyle:{ - color:'#00c0ef' - } + }); + $http.get('/client/partner_info').then(function (resp) { + $scope.applyClient = resp.data; + if($scope.applyClient.logo_url != null && $scope.applyClient.description != null && $scope.applyClient.business_structure != null){ + if(($scope.applyClient.store_photo != null && $scope.applyClient.company_photo != null) || $scope.applyClient.company_website != null){ + if (($scope.applyClient.business_structure == "Company" && $scope.applyClient.acn != null) || $scope.applyClient.business_structure != 'Company' && $scope.applyClient.abn != null){ + $scope.commitPartnerInfo = true; } } - - }, - column: {key: 'Alipay.exchange_rate'} - } - ] - }; - - function handleRateHistoryChart(exchangeRates) { - $scope.rateHistory = chartParser.parse(rateHistoryConfig, exchangeRates); - } - }]); - - app.controller('unSettledAmountHistoryDialogCtrl', ['$scope', '$http', '$filter','commonDialog', function ($scope, $http, $filter,commonDialog) { - $scope.params = {isAll:true}; - $scope.settleParams = {}; - $scope.unSettledAmountHistory = function () { - $http.get('/client/manual_settle/today').then(function (resp) { - $scope.currentSettle = resp.data; - $scope.settleParams = angular.copy($scope.currentSettle); - if($scope.currentSettle.settle_to){ - $scope.params.isAll = false; - $scope.params.to_date = new Date($scope.currentSettle.settle_to); } - $scope.params.maxData = $scope.currentSettle.unsettle[0].date_str; + $scope.source = resp.data.source; + $scope.approve_result = resp.data.approve_result; }) }; - $scope.unSettledAmountHistory(); - $scope.changeIsAll = function () { - if($scope.params.isAll){ - $scope.params.to_date = ''; - $scope.settleParams = angular.copy($scope.currentSettle); - }else { - if($scope.currentSettle.settle_to){ - $scope.params.to_date = new Date($scope.currentSettle.settle_to); - }else{ - $scope.params.to_date = $scope.params.maxData; - } - } - }; - $scope.$watch('params.to_date', function() { - $scope.settleParams = angular.copy($scope.currentSettle); - if($scope.params.to_date){ - $scope.params.isAll=false; - $scope.to_date = $filter('date')($scope.params.to_date, 'yyyy-MM-dd'); - var cashbackChoose = {}; - var count = 0; - var total_settle_amount = 0.00; - angular.forEach($scope.currentSettle.unsettle, function (unsettle) { - if (new Date(unsettle.date_str).getTime() <= new Date($scope.to_date).getTime()) { - cashbackChoose[count] = unsettle; - if(unsettle.settle_amount != null){ - total_settle_amount = decimal.add(unsettle.settle_amount,total_settle_amount).toFixed(2); - } - count++; - } - }); - $scope.settleParams.unsettle = cashbackChoose; - $scope.settleParams.total_settle_amount = total_settle_amount; - }else { - $scope.params.isAll = true; + if($scope.currentUser.client.source == 4 && $scope.currentUser.client.approve_result != 1){ + $scope.checkStartGuidance(); + } + + $scope.checkEmail = function () { + if($scope.mail_confirm){ + commonDialog.alert({title: 'Message', content: '邮件已验证,请勿重复发送', type: 'info'}); + return; } - try { - $scope.$digest(); - }catch (err){} - }); - $scope.manualSettle = function () { - if($scope.currentSettle.locked){ - alert("系统正好在执行清算任务,暂不能提现,请稍后再试!"); + if($scope.sendMailCount >=1){ + commonDialog.alert({title: 'Message', content: '邮件已发送,请勿重复点击', type: 'info'}); return; } - $scope.settle_to = $scope.params.to_date || $scope.params.maxData; - $scope.settle_to = $filter('date')($scope.settle_to, 'yyyy-MM-dd'); - $http.put('/client/manual_settle/today', {settle_to: $scope.settle_to}).then(function () { - commonDialog.alert({title: 'Success', content: 'Withdraw application has been submitted', type: 'success'}); - $scope.$close(); - }, function (resp) { - commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); + $http.put('/client/partner_info/verify/email').then(function (resp) { + $scope.sendMailCount = $scope.sendMailCount +1; + commonDialog.alert({title: 'Message', content: 'Verify that the message has been sent to your mailbox. Please complete the validation as soon as possible', type: 'info'}); }) } }]); + + app.controller('contactCustomerServiceDialogCtrl', ['$scope', '$http', function ($scope, $http) { + + }]); + app.filter('abs', function () { return function (value) { return Math.abs(value); diff --git a/src/main/ui/static/dashboard/templates/dashboard_service_support.html b/src/main/ui/static/dashboard/templates/dashboard_service_support.html new file mode 100644 index 000000000..2fa133ffc --- /dev/null +++ b/src/main/ui/static/dashboard/templates/dashboard_service_support.html @@ -0,0 +1,8 @@ +
+ +
+ 1300-10-77-50
+ support@royalpay.com.au
+ Mon-Fri (9:00am-5:30pm) +
+
\ No newline at end of file diff --git a/src/main/ui/static/dashboard/templates/partner_dashboard.html b/src/main/ui/static/dashboard/templates/partner_dashboard.html index 999479e12..ab68d1b24 100644 --- a/src/main/ui/static/dashboard/templates/partner_dashboard.html +++ b/src/main/ui/static/dashboard/templates/partner_dashboard.html @@ -180,8 +180,26 @@ .mini-stat-info span{ font-size: 18px; } - + .start_item{ + line-height: 50px; + } + .start_ico{ + display: inline-block; + line-height: 50px; + font-size: 30px; + vertical-align: middle; + color: #6fd088; + } + .start_text{ + line-height: 50px; + display: inline-block; + vertical-align: baseline; + } + .text-gray{ + color: grey !important; + } +

Dashboard @@ -201,6 +219,84 @@

+
+
+
+
+

Tips: Started with RoyalPay

+
+
+ + + + + +
+ As soon as you create a RoyalPay account, you can use all of RoyalPay's features, including accepting payments from customers. + But before you activate your account, RoyalPay will not execute settlement.Therefore, it is recommended that you submit your compliance materials as soon as possible, and our compliance department will notify you when the audit is completed. If you have any questions, you can contact our customer service!. +
+
+
+
+
diff --git a/src/main/ui/static/images/customer_service2.jpg b/src/main/ui/static/images/customer_service2.jpg new file mode 100644 index 000000000..980b4c7e1 Binary files /dev/null and b/src/main/ui/static/images/customer_service2.jpg differ diff --git a/src/main/ui/static/images/step/send_code.png b/src/main/ui/static/images/step/send_code.png deleted file mode 100644 index 2c2f5546d..000000000 Binary files a/src/main/ui/static/images/step/send_code.png and /dev/null differ diff --git a/src/main/ui/static/merchantapplication/merchant_application.js b/src/main/ui/static/merchantapplication/merchant_application.js index 40aa14f0e..6bf1abc62 100644 --- a/src/main/ui/static/merchantapplication/merchant_application.js +++ b/src/main/ui/static/merchantapplication/merchant_application.js @@ -58,7 +58,7 @@ angular.module('applyPartnerApp', ['ngMessages']).controller('applyPartnerCtrl', $scope.seconds = 6; $scope.canClick=false; $scope.description = "Send Code"; - $scope.partner = {nation_code:"+61"}; + $scope.partner = {nation_code:"+86"}; $scope.bankaccount = {}; $scope.rate = {}; $scope.phone_code_timer=$interval(function () {}, 1000); @@ -71,6 +71,25 @@ angular.module('applyPartnerApp', ['ngMessages']).controller('applyPartnerCtrl', $scope.loadRoyalpayindustry(); + $scope.checkParams = function () { + if($scope.partner.contact_phone && $scope.partner.nation_code){ + $http.get('/register/account/check?phone='+$scope.partner.contact_phone+'&nation_code='+$scope.partner.nation_code).then(function (resp) { + $scope.name_exist = false; + }, function (resp) { + if (resp.data.status == 403){ + $scope.name_exist = true; + } + }) + }; + if($scope.partner.contact_email){ + var reg = new RegExp("^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$"); + if(!reg.test($scope.partner.contact_email)){ + $scope.trueEmail = true; + }else { + $scope.trueEmail = false; + } + } + }; $scope.checkUserName = function (phone,nation_code) { if(phone && nation_code){ $http.get('/register/account/check?phone='+phone+'&nation_code='+nation_code).then(function (resp) { @@ -137,7 +156,6 @@ angular.module('applyPartnerApp', ['ngMessages']).controller('applyPartnerCtrl', }; $scope.sendVerificationCode = function () { $scope.initErrorMsg(); - $scope.checkUserName($scope.partner.contact_phone,$scope.partner.nation_code) $scope.sendPhoneCodeTime(); $http.post('/register/info/phone/'+ $scope.partner.contact_phone +'/verify?nation_code='+$scope.partner.nation_code).then(function (resp) { }, function (resp) { @@ -156,7 +174,7 @@ angular.module('applyPartnerApp', ['ngMessages']).controller('applyPartnerCtrl', $scope.initErrorMsg(); if (bsb_no != null && bsb_no != "") { $scope.showBankInfo = false; - $http.get('/register/info/bank/' + bsb_no).then(function (resp) { + $http.get('/register/info/bank/' + bsb_no+"?username="+$scope.partner.username+'&'+'codeKey='+$scope.partner.codeKey).then(function (resp) { $scope.bankInfo = resp.data; $scope.bankaccount.bank = $scope.bankInfo.bank; $scope.bankaccount.city = $scope.bankInfo.city; diff --git a/src/main/ui/static/payment/partner/partner.js b/src/main/ui/static/payment/partner/partner.js index c60e038ad..fab009d85 100644 --- a/src/main/ui/static/payment/partner/partner.js +++ b/src/main/ui/static/payment/partner/partner.js @@ -15,10 +15,23 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload'], funct return $http.get('/client/partner_info'); }] } + }).state('basic.payment_info_edit', { + url: '/payment/edit', + templateUrl: '/static/payment/partner/templates/client_partner_edit.html', + controller: 'clientPaymentInfoEditCtrl' }).state('basic.payment_info', { url: '/payment', templateUrl: '/static/payment/partner/templates/client_payment_info.html', controller: 'clientPaymentInfoCtrl' + }).state('basic.compliance_files', { + url: '/{client_moniker}/compliance_files', + templateUrl: '/static/payment/partner/templates/client_compliance_files.html', + controller: 'clientComplianceFilesCtrl', + resolve: { + file: ['$http', function ($http) { + return $http.get('/client/partner_info/compliance/files'); + }] + } }).state('payment_materials', { url: '/payment_materials', templateUrl: '/static/payment/partner/templates/client_payment_materials.html', @@ -46,15 +59,354 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload'], funct controller: 'clientDeviceCtrl' }) }]); - app.controller('clientPartnerDetailCtrl', ['$scope', '$http', 'partner','industryMap', function ($scope, $http, partner,industryMap) { + app.controller('clientPartnerDetailCtrl', ['$scope', '$http', 'partner','industryMap','businessStructuresMap', function ($scope, $http, partner,industryMap,businessStructuresMap) { + $scope.business_structures = businessStructuresMap.configs(); $scope.industries = industryMap.configs(); $scope.partner = partner.data; //修改邮箱 $scope.updateEmail = function () { - $http.put('/client/partner_info', $scope.partner).then( + $http.put('/client/partner_info/compliance_audit').then( ); + }; + + $scope.commitToCompliance = function () { + $http.get('/client/partner_info/compliance/files').then(function (resp) { + $scope.complianceFiles = resp.data; + if($scope.complianceFiles.client_id_file == null||$scope.complianceFiles.client_bank_file == null || $scope.complianceFiles.client_company_file == null){ + alert("请前去完善合规资料,再进行提交"); + return; + } + if($scope.partner.business_structure == null ||$scope.partner.logo_url == null || $scope.partner.description == null || (($scope.partner.store_photo == null || $scope.partner.company_photo == null) && $scope.currentUser.client.company_website == null)){ + alert("请前去完善商户资料,再进行提交"); + return; + } + if(($scope.partner.business_structure == "Company" && $scope.partner.acn == null) || ($scope.partner.business_structure != "Company" && $scope.partner.abn == null)){ + alert("请前去完善商户资料,再进行提交"); + return; + } + if(!$scope.partner.mail_confirm){ + alert("请验证邮箱后,再进行提交"); + return; + } + $http.post('/client/partner_info/compliance_audit').then( + ); + }); + } + }]); + app.controller('clientPaymentInfoEditCtrl', ['$scope', '$http','industryMap', 'commonDialog','$state','Upload',function ($scope, $http,industryMap,commonDialog,$state,Upload) { + /* $scope.loadClient = function () { + $http.get('/client/partner_info').then(function (resp) { + $scope.partner = resp.data; + }) + };*/ + + $scope.uploadLogo = function (file) { + if (file != null) { + $scope.logoProgress = {value: 0}; + Upload.upload({ + url: '/attachment/files', + data: {file: file} + }).then(function (resp) { + delete $scope.logoProgress; + $scope.partner.logo_id = resp.data.fileid; + $scope.partner.logo_url = resp.data.url; + }, function (resp) { + delete $scope.logoProgress; + commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) + }, function (evt) { + $scope.logoProgress.value = parseInt(100 * evt.loaded / evt.total); + }) + } + }; + + $scope.uploadShopPhoto = function (file) { + if (file != null) { + $scope.shopPhotoProgress = {value: 0}; + Upload.upload({ + url: '/attachment/files', + data: {file: file} + }).then(function (resp) { + delete $scope.shopPhotoProgress; + $scope.partner.company_photo = resp.data.url; + }, function (resp) { + delete $scope.shopPhotoProgress; + commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) + }, function (evt) { + $scope.shopPhotoProgress.value = parseInt(100 * evt.loaded / evt.total); + }) + } + }; + + $scope.uploadStorePhoto = function (file) { + if (file != null) { + $scope.storePhotoProgress = {value: 0}; + Upload.upload({ + url: '/attachment/files', + data: {file: file} + }).then(function (resp) { + delete $scope.storePhotoProgress; + $scope.partner.store_photo = resp.data.url; + }, function (resp) { + delete $scope.storePhotoProgress; + commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) + }, function (evt) { + $scope.storePhotoProgress.value = parseInt(100 * evt.loaded / evt.total); + }) + } + }; + + $scope.updatePartner = function (form) { + if (form.$invalid) { + angular.forEach(form, function (item, key) { + if (key.indexOf('$') < 0) { + item.$dirty = true; + } + }); + return; + } + if (!$scope.partner.logo_url) { + alert("Logo is necessary!"); + return; + } + if($scope.partner.partner_type == 'photo'){ + if (!$scope.partner.company_photo) { + alert('Shop Photo1 is necessary'); + return; + } + if (!$scope.partner.store_photo) { + alert('Shop Photo2 is necessary'); + return; + } + } + + var content = ''; + $http.put('/client/partner_info/update/partnerInfo', $scope.partner).then(function () { + if (content != '') { + commonDialog.alert({ + title: 'Warning', + content: content, + type: 'error' + }); + } else { + commonDialog.alert({ + title: 'Success', + content: 'Update partner information successfully', + type: 'success' + }); + } + $state.go('basic', {clientMoniker: $scope.partner.client_moniker}, {reload: true}); + }, function (resp) { + commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}) + }); + }; + }]); + app.controller('clientComplianceFilesCtrl', ['$scope', '$http', '$rootScope', 'commonDialog', '$state', 'Upload', 'file', function ($scope, $http, $rootScope, commonDialog, $state, Upload, file) { + + $scope.file = file.data || {}; + //audit files + $scope.uploadBankFile = function (file) { + if (file != null) { + if (file.size > 3 * 1024 * 1024) { + commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB,请压缩后重试', type: 'error'}) + } else { + $scope.bankFileProgress = {value: 0}; + Upload.upload({ + url: '/attachment/files', + data: {file: file} + }).then(function (resp) { + delete $scope.bankFileProgress; + $scope.file.file_bank_info = resp.data.url; + $scope.updateFile(); + if ($scope.file.file_bank_info.endsWith('pdf')) { + $scope.bankIsImage = false; + } else { + $scope.bankIsImage = true; + } + }, function (resp) { + delete $scope.bankFileProgress; + commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) + }, function (evt) { + $scope.bankFileProgress.value = parseInt(100 * evt.loaded / evt.total); + }) + } + } + }; + $scope.agreeIsImage = true; + if ($scope.file.file_agreement_info && $scope.file.file_agreement_info.endsWith('pdf')) { + $scope.agreeIsImage = false; + } + $scope.bankIsImage = true; + if ($scope.file.file_bank_info && $scope.file.file_bank_info.endsWith('pdf')) { + $scope.bankIsImage = false; } + $scope.companyIsImage = true; + if ($scope.file.file_company_info && $scope.file.file_company_info.endsWith('pdf')) { + $scope.companyIsImage = false; + } + $scope.applyIsImage = true; + if ($scope.file.file_apply_info && $scope.file.file_apply_info.endsWith('pdf')) { + $scope.applyIsImage = false; + } + $scope.idIsImage = true; + if ($scope.file.file_id_info && $scope.file.file_id_info.endsWith('pdf')) { + $scope.idIsImage = false; + } + + $scope.uploadCompanyFile = function (file) { + if (file != null) { + if (file.size > 3 * 1024 * 1024) { + commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB,请压缩后重试', type: 'error'}) + } else { + $scope.companyFileProgress = {value: 0}; + Upload.upload({ + url: '/attachment/files', + data: {file: file} + }).then(function (resp) { + delete $scope.companyFileProgress; + $scope.file.file_company_info = resp.data.url; + $scope.updateFile(); + if ($scope.file.file_company_info.endsWith('pdf')) { + $scope.companyIsImage = false; + } else { + $scope.companyIsImage = true; + } + }, function (resp) { + delete $scope.companyFileProgress; + commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) + }, function (evt) { + $scope.companyFileProgress.value = parseInt(100 * evt.loaded / evt.total); + }) + } + } + }; + //上传ID信息 + $scope.uploadIDFile = function (file) { + if (file != null) { + if (file.size > 3 * 1024 * 1024) { + commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB,请压缩后重试', type: 'error'}) + } else { + $scope.idFileProgress = {value: 0}; + Upload.upload({ + url: '/attachment/files', + data: {file: file} + }).then(function (resp) { + delete $scope.idFileProgress; + $scope.file.file_id_info = resp.data.url; + $scope.updateFile(); + if ($scope.file.file_id_info.endsWith('pdf')) { + $scope.idIsImage = false; + } else { + $scope.idIsImage = true; + } + }, function (resp) { + delete $scope.idFileProgress; + commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) + }, function (evt) { + $scope.idFileProgress.value = parseInt(100 * evt.loaded / evt.total); + }) + } + } + }; + + //上传协议文件 + $scope.uploadAgreementFile = function (file) { + if (file != null) { + if (file.size > 10 * 1024 * 1024) { + commonDialog.alert({title: 'Error', content: '文件大小不能超过5MB,请压缩后重试', type: 'error'}) + } else { + $scope.agreementFileProgress = {value: 0}; + Upload.upload({ + url: '/attachment/files', + data: {file: file} + }).then(function (resp) { + delete $scope.agreementFileProgress; + $scope.file.file_agreement_info = resp.data.url; + $scope.updateFile(); + if ($scope.file.file_agreement_info.endsWith('pdf')) { + $scope.agreeIsImage = false; + } else { + $scope.agreeIsImage = true; + } + }, function (resp) { + delete $scope.agreementFileProgress; + commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) + }, function (evt) { + $scope.agreementFileProgress.value = parseInt(100 * evt.loaded / evt.total); + }) + } + } + }; + + //上传申请表 + $scope.uploadApplyFile = function (file) { + if (file != null) { + if (file.size > 3 * 1024 * 1024) { + commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB,请压缩后重试', type: 'error'}) + } else { + $scope.applyFileProgress = {value: 0}; + Upload.upload({ + url: '/attachment/files', + data: {file: file} + }).then(function (resp) { + delete $scope.applyFileProgress; + $scope.file.file_apply_info = resp.data.url; + $scope.updateFile(); + if ($scope.file.file_apply_info.endsWith('pdf')) { + $scope.applyIsImage = false; + } else { + $scope.applyIsImage = true; + } + }, function (resp) { + delete $scope.applyFileProgress; + commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) + }, function (evt) { + $scope.applyFileProgress.value = parseInt(100 * evt.loaded / evt.total); + }) + + } + } + }; + + /* $scope.downloadAsZip = function () { + var url = '/sys/partners/' + $scope.partner.client_moniker + '/download/complianceAsZIP'; + return url; + }; +*/ + $scope.updateFile = function () { + $http.put('/client/partner_info/update/file', $scope.file).then(function () { + commonDialog.alert({ + title: 'Success', + content: 'Upload Successful', + type: 'success' + }); + $state.reload(); + }, function (resp) { + commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); + }) + }; + + function commitError() { + commonDialog.alert({ + title: 'Error', + content: 'Missing file', + type: 'error' + }); + }; + $scope.commitPartner = function () { + if ($scope.file) { + if ($scope.file.file_bank_info != null && $scope.file.file_company_info != null && $scope.file.file_id_info != null && $scope.file_apply_info != null) { + $http.put('/client/partner_info/compliance_audit').then(function (resp) { + + }); + } else { + commitError(); + } + } else { + commitError(); + } + }; }]); + app.controller('clientPaymentInfoCtrl', ['$scope', '$http', 'commonDialog', function ($scope, $http, commonDialog) { $scope.paymentInfo = $scope.partner; $scope.old_customer_surcharge_rate = angular.copy($scope.partner.customer_surcharge_rate); diff --git a/src/main/ui/static/payment/partner/templates/client_compliance_files.html b/src/main/ui/static/payment/partner/templates/client_compliance_files.html new file mode 100644 index 000000000..a90c24d45 --- /dev/null +++ b/src/main/ui/static/payment/partner/templates/client_compliance_files.html @@ -0,0 +1,154 @@ + +
+
+
+
+ +
+
+ + + +
+ + + +
+
+
+

Example:请保证图片信息清晰可见,如下图

+ +
+
+
+ +
+ +
+
+ + + +
+ + + +
+
+
+
+

Example:公司请提供以下文件图片

+ + +
+
+

sole trade(个体户),partnership(合伙),trust(信托)请在http://abr.business.gov.au,将查询结果截图上传

+ +
+
+
+
+ +
+ +
+
+ + + +
+ + + +
+
+
+
+

Example:请保证图片(护照或驾照)信息清晰可见,如下图

+ +
+
+
+
+ +
+
+
+
+ + +
+
+
+ + + + \ No newline at end of file diff --git a/src/main/ui/static/payment/partner/templates/client_partner_detail.html b/src/main/ui/static/payment/partner/templates/client_partner_detail.html index cd34f8e31..0dfd9e30d 100644 --- a/src/main/ui/static/payment/partner/templates/client_partner_detail.html +++ b/src/main/ui/static/payment/partner/templates/client_partner_detail.html @@ -9,6 +9,26 @@
+
+
+

Compliance (Refused + :{{partner.refuse_remark}}) + 【目前状态】- + + (自助申请)资料完善中 + (自助申请)已开通 + (自助申请)快速开通等待提交合规材料 + (自助申请)待审核(材料已提交) + +

+
+ +
+
+