diff --git a/pom.xml b/pom.xml index 26d847ffd..bfb3b872f 100644 --- a/pom.xml +++ b/pom.xml @@ -5,11 +5,11 @@ au.com.royalpay.payment payment-parent - 2.1.44 + 2.1.45 4.0.0 manage - 2.3.1 + 2.3.2 UTF-8 2.2.0 diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientRateMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientRateMapper.java index a6972d809..7b606adc5 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientRateMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientRateMapper.java @@ -20,6 +20,9 @@ public interface ClientRateMapper { List listClientRates(@Param("client_id") int clientId, @Param("rate_name") String rateName); + @AutoSql(SqlType.SELECT) + JSONObject findRateByRateId(@Param("client_rate_id") String rateId); + @AutoSql(SqlType.INSERT) void saveRate(JSONObject rateConfig); @@ -39,23 +42,22 @@ public interface ClientRateMapper { @Param("clean_days") Integer cleanDays, @Param("rate_name") String rateName); - - List latestConfig(@Param("client_id")int client_id,@Param("rate_name") String rate_name); + List latestConfig(@Param("client_id") int client_id, @Param("rate_name") String rate_name); //Task - List maxChannelExpiryTime(@Param("client_id")int client_id,@Param("rate_name")String rate_name); + List maxChannelExpiryTime(@Param("client_id") int client_id, @Param("rate_name") String rate_name); - List getAllExpiry(@Param("expiry_date")Date expiry_date); + List getAllExpiry(@Param("expiry_date") Date expiry_date); List getAllClientRateExpiryMerchants(); void postponeMerchantRateByClientId(int clientId); - JSONObject latestChannelCleanDays(@Param("rate_name")String rate_name, @Param("client_id")int client_id); + JSONObject latestChannelCleanDays(@Param("rate_name") String rate_name, @Param("client_id") int client_id); - JSONObject latestCardChannelCleanDays(@Param("rate_name")String rate_name, @Param("client_id")int client_id); + JSONObject latestCardChannelCleanDays(@Param("rate_name") String rate_name, @Param("client_id") int client_id); - JSONObject latestExpiryConfig(@Param("client_id")int client_id,@Param("rate_name") String rate_name); + JSONObject latestExpiryConfig(@Param("client_id") int client_id, @Param("rate_name") String rate_name); } 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 0d21c9e23..b52df74a7 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 @@ -86,16 +86,11 @@ public interface ClientManager { void checkAndSendInitEmail(JSONObject manager, String clientMoniker); - void sendOpenEmail(final JSONObject client, String username, String pwd); - -// void sendInitEmail(JSONObject account,JSONObject client, String username, String pwd); void markApproveEmailSendStatus(String clientMoniker, JSONObject manager); void checkEmailStatus(); - void newCheckEmailStatus(); - @Transactional void switchPermission(JSONObject manager, String clientMoniker, String permissionKey, boolean allow); @@ -397,7 +392,7 @@ public interface ClientManager { void getAggregateCardAgreeFile(String clientMoniker, JSONObject manager, boolean renewal) throws Exception; - void getAggregateCardPromotionaAgreeFile(String clientMoniker, JSONObject manager, boolean renewal, String promotionalEffectiveDate, int promotionalPeriod) throws Exception; + void getAggregateCardPromotionaAgreeFile(String clientMoniker, JSONObject manager, boolean renewal,String rateid,HttpServletResponse httpResponse); void getNewAggregateAgreeFile(String clientMoniker, JSONObject manager, boolean renewal) throws Exception; 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 62f5b0e71..5645d1efe 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 @@ -33,14 +33,20 @@ import au.com.royalpay.payment.manage.gateway.core.GatewayMerchantApply; import au.com.royalpay.payment.manage.kyc.enums.FilesAuthEnum; 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.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.payment.CommonSubMerchantIdMapper; 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.risk.RiskAttentionMerchantsMapper; import au.com.royalpay.payment.manage.mappers.system.*; import au.com.royalpay.payment.manage.merchants.beans.*; -import au.com.royalpay.payment.manage.merchants.core.*; +import au.com.royalpay.payment.manage.merchants.core.ClientConfigService; +import au.com.royalpay.payment.manage.merchants.core.ClientInfoCacheSupport; +import au.com.royalpay.payment.manage.merchants.core.ClientManager; +import au.com.royalpay.payment.manage.merchants.core.ClientModifySupport; import au.com.royalpay.payment.manage.merchants.entity.impls.*; import au.com.royalpay.payment.manage.merchants.enums.UPayAuthFileEnum; import au.com.royalpay.payment.manage.notice.core.MailService; @@ -102,6 +108,9 @@ import org.apache.poi.hssf.util.HSSFColor; import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.Font; import org.dom4j.Element; +import org.joda.time.DateTime; +import org.joda.time.format.DateTimeFormat; +import org.joda.time.format.DateTimeFormatter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; @@ -109,13 +118,11 @@ import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.Cacheable; import org.springframework.context.ApplicationEventPublisher; import org.springframework.context.ApplicationEventPublisherAware; -import org.springframework.context.MessageSource; import org.springframework.data.mongodb.core.MongoTemplate; import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.ui.Model; -import org.springframework.util.Assert; import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.multipart.MultipartFile; @@ -138,7 +145,6 @@ import java.security.InvalidParameterException; import java.security.KeyPair; import java.security.interfaces.RSAPrivateKey; import java.security.interfaces.RSAPublicKey; -import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.List; import java.util.*; @@ -195,16 +201,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid @Resource private OrgMapper orgMapper; @Resource - private LogSettleMailMapper logSettleMailMapper; - @Resource - private CommoditiesMapper commoditiesMapper; - @Resource private ActClientInvitationCodeMapper actClientInvitationCodeMapper; @Resource private MailService mailService; - // todo 作用 - @Resource - private ClientComplyValidator[] validators; @Resource private ClientModifySupport clientModifySupport; @@ -260,8 +259,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid @Resource private ClientContractService clientContractService; @Resource - private MessageSource messageSource; - @Resource private ClientsOperationLogMapper clientsOperationLogMapper; @Resource private LogClientSubMerchantIdMapper logClientSubMerchantIdMapper; @@ -321,6 +318,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid private RPayMerchantMapper rPayMerchantMapper; @Resource private SysClientUpayProfileMapper sysClientUpayProfileMapper; + DateTimeFormatter formatter = DateTimeFormat.forPattern("dd MMM yyyy"); @Resource @@ -1310,73 +1308,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } } - - @Override - public void sendOpenEmail(final JSONObject client, String username, String pwd) { - JSONObject model = new JSONObject(); - model.put("username", username); - model.put("password", pwd); - model.put("client_moniker", client.getString("client_moniker")); - model.put("contact_person", client.getString("contact_person")); - model.put("credential_code", client.getString("credential_code")); - List bds = clientBDMapper.listClientBDInfoAvailable(client.getIntValue("client_id"), new Date()); - // todo Velocity - Context ctx = new Context(); - ctx.setVariable("bds", bds); - ctx.setVariable("short_name", client.getString("short_name")); - ctx.setVariable("password", pwd); - ctx.setVariable("username", username); - ctx.setVariable("client_moniker", client.getString("client_moniker")); - ctx.setVariable("contact_person", client.getString("contact_person")); - ctx.setVariable("credential_code", client.getString("credential_code")); - - final String content = thymeleaf.process("mail/new_client_notice", ctx); - // final String content = VelocityEngineUtils.mergeTemplateIntoString(null, "mail/new_client_notice.vm", - // "utf-8", model); - ctx.setVariable("password", "*****"); - final String contentBd = thymeleaf.process("mail/new_client_notice", ctx); - final List mailTos = new ArrayList<>(); - String mailTo = client.getString("contact_email"); - if (StringUtils.isEmpty(mailTo)) { - throw new EmailException("Client Contact Email is invalid"); - } - mailTos.add(mailTo); - JSONObject clientLegal = sysClientLegalPersonMapper.findRepresentativeInfo(client.getIntValue("client_id")); - if (clientLegal != null && StringUtils.isNotBlank(clientLegal.getString("email"))) { - mailTos.add(clientLegal.getString("email")); - } - - final List emails = new ArrayList<>(); - for (JSONObject bd : bds) { - String email = bd.getString("email"); - if (StringUtils.isNotEmpty(email)) { - emails.add(email); - } - } - new Thread() { - @Override - public void run() { - try { - String emailId = mailService.sendEmail("Your RoyalPay Cross-border Payment has been set up", StringUtils.join(mailTos, ","), "", content); - mailService.sendEmail("Your RoyalPay Cross-border Payment has been set up", emails.isEmpty() ? "" : StringUtils.join(emails, ","), - "", contentBd); - JSONObject clientUpdate = new JSONObject(); - clientUpdate.put("client_id", client.getIntValue("client_id")); - clientUpdate.put("approve_email_send", 3); - clientUpdate.put("approve_email_id", emailId); - clientMapper.update(clientUpdate); - } catch (Exception e) { - JSONObject clientUpdate = new JSONObject(); - clientUpdate.put("client_id", client.getIntValue("client_id")); - clientUpdate.put("approve_email_send", 0); - clientUpdate.put("approve_email_id", null); - clientMapper.update(clientUpdate); - throw new EmailException("Email Sending Failed", e); - } - } - }.start(); - } - public void sendInitEmail(final JSONObject client, String username, String pwd, boolean isUpayAuditPass) { logger.debug("sending email after comply"); JSONObject model = new JSONObject(); @@ -1386,7 +1317,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid model.put("contact_person", client.getString("contact_person")); model.put("credential_code", client.getString("credential_code")); List bds = clientBDMapper.listClientBDInfoAvailable(client.getIntValue("client_id"), new Date()); - // todo Velocity Context ctx = new Context(); ctx.setVariable("bds", bds); ctx.setVariable("short_name", client.getString("short_name")); @@ -1395,10 +1325,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid ctx.setVariable("client_moniker", client.getString("client_moniker")); ctx.setVariable("contact_person", client.getString("contact_person")); ctx.setVariable("credential_code", client.getString("credential_code")); + ctx.setVariable("card_approving", isUpayAuditPass); final String content = thymeleaf.process("mail/new_client_notice", ctx); - // final String content = VelocityEngineUtils.mergeTemplateIntoString(null, "mail/new_client_notice.vm", - // "utf-8", model); ctx.setVariable("password", "*****"); final String contentBd = thymeleaf.process("mail/new_client_notice", ctx); final List mailTos = new ArrayList<>(); @@ -1457,32 +1386,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid }.start(); } - /** - * public void sendInitEmail(JSONObject account, final JSONObject client, String username, String pwd) { - * logger.debug("sending email after comply"); JSONObject model = new JSONObject(); model.put("username", username); - * model.put("password", pwd); model.put("client_moniker", client.getString("client_moniker")); - * model.put("contact_person", client.getString("contact_person")); model.put("credential_code", - * client.getString("credential_code")); List bds = - * clientBDMapper.listClientBDInfoAvailable(client.getIntValue("client_id"), new Date()); // todo Velocity Context - * ctx = new Context(); ctx.setVariable("bds", bds); ctx.setVariable("password", pwd); ctx.setVariable("username", - * username); ctx.setVariable("client_moniker", client.getString("client_moniker")); - * ctx.setVariable("contact_person", client.getString("contact_person")); ctx.setVariable("credential_code", - * client.getString("credential_code")); ctx.setVariable("short_name", client.getString("short_name")); final String - * content = thymeleaf.process("mail/new_client_notice", ctx); // final String content = - * VelocityEngineUtils.mergeTemplateIntoString(null, "mail/new_client_notice.vm", // "utf-8", model); final String - * mailTo = client.getString("contact_email"); if (StringUtils.isEmpty(mailTo)) { throw new EmailException("Client - * Contact Email is invalid"); } final Set 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 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) { logger.debug("sending email after comply about a new partner opening by quick access"); @@ -1587,37 +1490,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } } - @Override - public void newCheckEmailStatus() { - List clients = clientMapper.listClientsWithEmailNotVerify(); - for (JSONObject client : clients) { - try { - String emailId = client.getString("approve_email_id"); - JSONObject status = mailSendMapper.find(emailId, client.getString("contact_email")); - if (status != null) { - int statusNo = status.getIntValue("status"); - logger.debug("get mail status:" + emailId + "--" + statusNo); - int mailStatus = 3; - switch (statusNo) { - case 1: - mailStatus = 1; - break; - case 2: - mailStatus = 2; - break; - } - updateClientApproveEmailStatus(mailStatus, null, client.getString("client_moniker")); - } else { - logger.debug("get mail status:" + emailId + "-- none"); - // updateClientApproveEmailStatus(client.getIntValue("client_id"), 0); - } - - } catch (Exception e) { - logger.error("check email status failed", e); - } - } - } - @Override public void switchPermission(JSONObject manager, String clientMoniker, String permissionKey, boolean allow) { JSONObject client = getClientInfoByMoniker(clientMoniker); @@ -1740,7 +1612,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid JSONObject account = clientAccountMapper.findById(accountId); if (clientMoniker != null) { JSONObject client = getClientInfoByMoniker(clientMoniker); - Assert.notNull(client); //父商户全局管理子商户时候,跳过 if (account.getIntValue("client_id") != client.getIntValue("client_id")) { //登录用户所属商户 @@ -1863,7 +1734,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid @Override public void togglePayNotice(JSONObject account, String clientMoniker, boolean enable) { JSONObject partner = getClientInfoByMoniker(clientMoniker); - Assert.notNull(partner); clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account, clientMoniker, "enable_pay_notice", enable)); clientInfoCacheSupport.clearClientCache(partner.getIntValue("client_id")); } @@ -2075,11 +1945,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid config.getDoubleValue("rate_value"), config.getInteger("clean_days"), channel).isEmpty()) { return; } - List existRate = clientRateMapper.listCurrentClientRates(clientId, config.getDate("active_time"), channel); - for (JSONObject rateLog : existRate) { - rateLog.put("expiry_time", DateUtils.addDays(config.getDate("active_time"), -1)); - clientRateMapper.updateConfig(rateLog); - } if (StringUtils.equalsIgnoreCase("rpaypmt_card", config.getString("type"))) { JSONObject extRateParams = new JSONObject() {{ put("domestic_rate_value", config.getBigDecimal("rate_value")); @@ -3112,12 +2977,12 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid @Override @Transactional - public void getAggregateCardPromotionaAgreeFile(String clientMoniker, JSONObject manager, boolean renewal, String promotionalEffectiveDate, int promotionalPeriod) throws ParseException { + public void getAggregateCardPromotionaAgreeFile(String clientMoniker, JSONObject manager, boolean renewal, String rateid, HttpServletResponse httpResponse) { JSONObject client = clientMapper.findClientByMoniker(clientMoniker); if (client == null) { throw new InvalidShortIdException(); } - exportPromotionalOfferPDF(clientMoniker, manager, promotionalEffectiveDate, promotionalPeriod); + exportPromotionalOfferPDF(clientMoniker, manager, rateid, httpResponse); } @Override @@ -7137,7 +7002,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid JSONObject legalInfo = sysClientLegalPersonMapper.findRepresentativeInfo(clientId); //装在数据 JSONObject info = new JSONObject(); - info.put("down_date", convertDateEnglish(new Date()));//下载文件日期 + info.put("down_date", formatter.print(new DateTime()));//下载文件日期 info.put("bussiness_name", (client.containsKey("business_name") ? client.getString("business_name") : legalInfo.getString("representative_person")) + " " + client.getString("abn"));//商圈类型 info.put("partner_address", client.getString("address"));//商家店铺地址 info.put("partner_country", client.getString("country"));//国家 @@ -7149,7 +7014,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid info.put("annual_rate", cardAnnualRate);//年费率 info.put("cost_per_transaction", clientRate.getString("transaction_fee"));//每次交易成本 info.put("domestic_fee", cardRate.getString("domestic_rate_value"));//国内服务费 - info.put("international_fee", upayProfileInfo.getBoolean("enable_international_card")?cardRate.getString("overseas_rate_value"):"-");//国际服务费 + info.put("international_fee", upayProfileInfo.getBoolean("enable_international_card") ? cardRate.getString("overseas_rate_value") : "-");//国际服务费 BigDecimal reserve = (upayProfileInfo.getBigDecimal("expected_card_revenue").multiply(new BigDecimal(0.005)).setScale(0, RoundingMode.HALF_UP)); info.put("account_reserve", reserve.compareTo(new BigDecimal(200)) <= 0 ? new BigDecimal(200).toPlainString() : reserve.toPlainString());//账户储备金 //银行账号信息 @@ -7160,15 +7025,25 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid return info; } - private void exportPromotionalOfferPDF(String clientMoniker, JSONObject manager, String promotionalEffectiveDate, int promotionalPeriod) throws ParseException { - Date date = DateUtils.parseDate(promotionalEffectiveDate, "yyyy-MM-dd"); - JSONObject info = convertPromotionalOfferInfo(clientMoniker, convertDateEnglish(date), promotionalPeriod); - String pdfPath = this.getClass().getClassLoader().getResource("").getPath() + "/templates/pdf/promotional_offer.pdf"; + private void exportPromotionalOfferPDF(String clientMoniker, JSONObject manager, String rateid, HttpServletResponse httpResponse) { + httpResponse.setContentType("application/pdf"); + httpResponse.setHeader("content-disposition", "attachment;filename=" + clientMoniker + "_PROMOTIONAL_OFFER_" + new Date() + ".pdf"); + JSONObject info = convertPromotionalOfferInfo(clientMoniker, rateid); + String pdfPath = Objects.requireNonNull(this.getClass().getClassLoader().getResource("")).getPath() + "templates/pdf/promotional_offer.pdf"; String fileName = clientMoniker + "_Promotional_Offer.pdf"; - publishExcelCardPDFFile(clientMoniker, manager, fileName, pdfPath, info, PROMOTIONAL_OFFER_FILE); + try (ServletOutputStream sos = httpResponse.getOutputStream()) { + File file = new File(fileName); + PdfUtils pdu = new PdfUtils(); + pdu.setTemplatePdfPath(pdfPath); + pdu.setPdfTemplate(info); + ByteArrayOutputStream bos = pdu.templetPdfBos(file); + sos.write(bos.toByteArray()); + } catch (Exception e) { + throw new ServerErrorException(); + } } - private JSONObject convertPromotionalOfferInfo(String clientMoniker, String promotionalEffectiveDate, int promotionalPeriod) { + private JSONObject convertPromotionalOfferInfo(String clientMoniker, String rateid) { JSONObject client = getClientInfoByMoniker(clientMoniker); if (client == null) { throw new InvalidShortIdException(); @@ -7178,16 +7053,15 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid throw new BadRequestException("The merchant failed the audit!"); } int clientId = client.getInteger("client_id"); - JSONObject clientRate = merchantInfoProvider.clientCurrentRate(clientId, new Date(), "rpaypmt_card"); - if (clientRate == null) { + JSONObject currentRate = clientRateMapper.findRateByRateId(rateid); + if (currentRate == null) { throw new BadRequestException("rpaypmt_card rate Not configured"); } - JSONObject cardRate = clientRate.getJSONObject("ext_rates"); + JSONObject cardRate = currentRate.getJSONObject("ext_rates"); JSONObject legalInfo = sysClientLegalPersonMapper.findRepresentativeInfo(clientId); JSONObject upayProfileInfo = sysClientUpayProfileMapper.findInfo(clientId); - JSONObject info = new JSONObject(); - info.put("down_date", convertDateEnglish(new Date()));//下载文件日期 + info.put("down_date", formatter.print(new DateTime()));//下载文件日期 info.put("bussiness_name", (client.containsKey("business_name") ? client.getString("business_name") : legalInfo.getString("representative_person")) + " " + client.getString("abn"));//商圈类型 info.put("partner_address", client.getString("address"));//商家店铺地址 info.put("partner_country", client.getString("country"));//国家 @@ -7195,9 +7069,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid info.put("partner_bussiness_name", client.getString("business_name"));//商户商用名称 info.put("legal_bussiness", legalInfo.getString("representative_person") + " AS " + (client.containsKey("business_name") ? client.getString("business_name") : legalInfo.getString("representative_person")) + " ABN " + client.getString("abn"));//拼接规则:法人名 AS 商用名称 ABD 编码 info.put("domestic_fee", cardRate.getString("domestic_rate_value"));//国内服务费 - info.put("international_fee", upayProfileInfo.getBoolean("enable_international_card")?cardRate.getString("overseas_rate_value"):"-");//国际服务费 - info.put("promotional_effective_date", promotionalEffectiveDate); - info.put("promotional_period", promotionalPeriod); + info.put("international_fee", upayProfileInfo.getBoolean("enable_international_card") ? cardRate.getString("overseas_rate_value") : "-");//国际服务费 + info.put("promotional_effective_date", formatter.print(currentRate.getDate("active_time").getTime())); + info.put("promotional_period", formatter.print(currentRate.getDate("expiry_time").getTime())); return info; } @@ -7236,16 +7110,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } } - private String convertDateEnglish(Date date) { - String[] months = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Spt", "Oct", "Nov", "Dec"}; - Calendar calendar = Calendar.getInstance(); - calendar.setTime(date); - int year = calendar.get(Calendar.YEAR); - int month = calendar.get(Calendar.MONTH); - int day = calendar.get(Calendar.DAY_OF_MONTH); - return day + " " + months[month] + " " + year; - } - private void importCardAgreeFile(String clientMoniker, JSONObject manager, String sourceFile, String fileLabel) { JSONObject client = getClientInfoByMoniker(clientMoniker); if (client == null) { diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java index 5ae92e4b2..516966b08 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java @@ -56,7 +56,7 @@ public class PartnerManageController { } - @RequestMapping(value = "/init/merchant_code", method = RequestMethod.GET,produces = "application/json") + @RequestMapping(value = "/init/merchant_code", method = RequestMethod.GET, produces = "application/json") public JSONObject initMerchantCode() { JSONObject result = new JSONObject(); result.put("partner_code", clientManager.initMerchantCode()); @@ -311,7 +311,7 @@ public class PartnerManageController { @ManagerMapping(value = "/{clientMoniker}/selectBillVersion", method = RequestMethod.POST, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) public void selectBillVersion(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.selectBillCodeVersion(manager, clientMoniker, pass.getString("version")); + clientManager.selectBillCodeVersion(manager, clientMoniker, pass.getString("version")); } /** @@ -527,10 +527,10 @@ public class PartnerManageController { } @ManagerMapping(value = "/{clientMoniker}/sub_clients/page", method = RequestMethod.GET) - public JSONObject listSubClientsByPage(@PathVariable String clientMoniker,@RequestParam(defaultValue = "1") int page, + public JSONObject listSubClientsByPage(@PathVariable String clientMoniker, @RequestParam(defaultValue = "1") int page, @RequestParam(required = false) String searchText, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return clientManager.listSubClientsByPage(manager, clientMoniker,searchText,page); + return clientManager.listSubClientsByPage(manager, clientMoniker, searchText, page); } //创建子商户 @@ -596,8 +596,8 @@ public class PartnerManageController { */ @ManagerMapping(value = "/{clientMoniker}/file/source_card_agree_file", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER, ManagerRole.SERVANT}) public JSONObject getSourceCardAgreeAuthFiles(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, - @RequestParam("fileName") String fileName){ - return clientManager.getSourceCardAgreeFiles(clientMoniker,manager,fileName); + @RequestParam("fileName") String fileName) { + return clientManager.getSourceCardAgreeFiles(clientMoniker, manager, fileName); } @ManagerMapping(value = "/auth_file/{fileId}/delete", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) @@ -618,13 +618,13 @@ public class PartnerManageController { @ManagerMapping(value = "/{clientMoniker}/mw_file", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER}) public void uploadMWAuthFiles(@PathVariable String clientMoniker, @RequestBody ClientMWAuthFilesInfo filesInfo, - @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { + @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { clientManager.uploadMWAuthFilesManager(manager, clientMoniker, filesInfo); } @ManagerMapping(value = "/{clientMoniker}/kycFile", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER}) public void uploadKycFiles(@PathVariable String clientMoniker, @RequestBody ClientKycFilesInfo filesInfo, - @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { + @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { clientManager.uploadKycFiles(manager, clientMoniker, filesInfo); } @@ -646,6 +646,7 @@ public class PartnerManageController { /** * 提交资料,BD提交卡支付最终审核 + * * @param clientMoniker * @param manager */ @@ -661,6 +662,7 @@ public class PartnerManageController { /** * 提交资料,申请卡支付 + * * @param clientMoniker * @param manager */ @@ -686,6 +688,7 @@ public class PartnerManageController { /** * 制作卡支付合同 + * * @param clientMoniker * @param manager * @throws Exception @@ -697,14 +700,18 @@ public class PartnerManageController { /** * 制作促销合同 + * * @param clientMoniker * @param manager * @throws Exception */ - @ManagerMapping(value = "/{clientMoniker}/export/aggregate/card_promotiona_agree_pdf", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.DIRECTOR, ManagerRole.OPERATOR}) - public void exportAggregateCardPromotionaAgreeFile(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, - @RequestParam("date") String promotionalEffectiveDate,@RequestParam("period") int promotionalPeriod) throws Exception { - clientManager.getAggregateCardPromotionaAgreeFile(clientMoniker, manager, false,promotionalEffectiveDate,promotionalPeriod); + @GetMapping(value = "/{clientMoniker}/export/aggregate/card_promotion_agree_pdf") + public void exportAggregateCardPromotionaAgreeFile(@PathVariable String clientMoniker, + @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, + @RequestParam("rateid") String rateid, + HttpServletResponse httpResponse + ) { + clientManager.getAggregateCardPromotionaAgreeFile(clientMoniker, manager, false, rateid, httpResponse); } @ManagerMapping(value = "/{clientMoniker}/temp/export/pdf", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.DIRECTOR, ManagerRole.OPERATOR}) @@ -724,6 +731,7 @@ public class PartnerManageController { /** * 信用卡合同生成完毕通知BD + * * @param clientMoniker * @param manager */ @@ -755,8 +763,8 @@ public class PartnerManageController { @GetMapping(value = "/{clientMoniker}/lists_settlements/excel") @ReadOnlyConnection - public void excelSettlements(@PathVariable String clientMoniker, TradeLogQuery query, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager,HttpServletResponse response){ - clientManager.excelSettlementLog(manager, clientMoniker, query,response); + public void excelSettlements(@PathVariable String clientMoniker, TradeLogQuery query, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, HttpServletResponse response) { + clientManager.excelSettlementLog(manager, clientMoniker, query, response); } @ManagerMapping(value = "/{clientMoniker}/requireCustinfo", method = RequestMethod.POST, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) @@ -805,6 +813,7 @@ public class PartnerManageController { public List listRpaySubMerchantIdApplys(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { return clientManager.listRpaySubMerchantIdApplys(manager, clientMoniker); } + @ManagerMapping(value = "/{clientMoniker}/sub_apply", method = RequestMethod.POST, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) public String subMerchantApplication(@PathVariable String clientMoniker, @RequestBody SubMerchantIdApply subMerchantIdApply, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { return clientManager.subMerchantApplication(clientMoniker, subMerchantIdApply, manager); @@ -932,51 +941,54 @@ public class PartnerManageController { /** * 获取商户所有增值服务 + * * @param clientMoniker * @return */ @ManagerMapping(value = "/{clientMoniker}/incremental_service", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) - public JSONObject getClientIncrementalService(@PathVariable String clientMoniker){ - return clientManager.partnerIncrementalService(clientMoniker); + public JSONObject getClientIncrementalService(@PathVariable String clientMoniker) { + return clientManager.partnerIncrementalService(clientMoniker); } /** * 保存/修改增值服务配置 + * * @param clientMoniker * @param incrementalService */ @ManagerMapping(value = "/{clientMoniker}/incremental_service", method = RequestMethod.POST, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) - public void updateClientIncrementalService(@PathVariable("clientMoniker") String clientMoniker,@RequestBody JSONObject incrementalService, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager){ - clientManager.changePartnerIncrementalService(clientMoniker,incrementalService,manager); + public void updateClientIncrementalService(@PathVariable("clientMoniker") String clientMoniker, @RequestBody JSONObject incrementalService, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { + clientManager.changePartnerIncrementalService(clientMoniker, incrementalService, manager); } /** * 禁用/启用增值服务 + * * @param clientMoniker * @param incrementalService */ @ManagerMapping(value = "/{clientMoniker}/incremental_service/status", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) - public void switchClientIncrementalService(@PathVariable("clientMoniker") String clientMoniker,@RequestBody JSONObject incrementalService, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager){ - clientManager.changeSwitchIncrementalService(clientMoniker,incrementalService,manager); + public void switchClientIncrementalService(@PathVariable("clientMoniker") String clientMoniker, @RequestBody JSONObject incrementalService, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { + clientManager.changeSwitchIncrementalService(clientMoniker, incrementalService, manager); } @ManagerMapping(value = "/{clientMoniker}/ext_config", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) - public void changeClientExtConfigs(@PathVariable("clientMoniker")String clientMoniker, + public void changeClientExtConfigs(@PathVariable("clientMoniker") String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, - @RequestBody JSONObject params){ - clientManager.changeExtParams(clientMoniker,manager,params); + @RequestBody JSONObject params) { + clientManager.changeExtParams(clientMoniker, manager, params); } - @ManagerMapping(value = "/{clientMoniker}/applyMWMerchantId",method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) - public RPayMerchantEntity applyMWMerchantId(@PathVariable("clientMoniker")String clientMoniker, - @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager){ - return clientManager.applyMWMerchantId(clientMoniker,manager); + @ManagerMapping(value = "/{clientMoniker}/applyMWMerchantId", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) + public RPayMerchantEntity applyMWMerchantId(@PathVariable("clientMoniker") String clientMoniker, + @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { + return clientManager.applyMWMerchantId(clientMoniker, manager); } - @ManagerMapping(value = "/{clientMoniker}/queryMWMerchantIdStatus",method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) - public RPayMerchantEntity queryMWMerchantIdStatus(@PathVariable("clientMoniker")String clientMoniker, - @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager){ - return clientManager.queryMWMerchantIdStatus(clientMoniker,manager); + @ManagerMapping(value = "/{clientMoniker}/queryMWMerchantIdStatus", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) + public RPayMerchantEntity queryMWMerchantIdStatus(@PathVariable("clientMoniker") String clientMoniker, + @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { + return clientManager.queryMWMerchantIdStatus(clientMoniker, manager); } @ManagerMapping(value = "/{clientMoniker}/query/mw_info", method = RequestMethod.GET, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) @@ -986,10 +998,11 @@ public class PartnerManageController { /** * 启用/禁用国际卡支付 + * * @param clientMoniker */ @ManagerMapping(value = "/{clientMoniker}/payment_card_permission", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) - public void switchInternationalCard(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager){ + public void switchInternationalCard(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { clientManager.modifyUPayProfile(manager, clientMoniker, "enable_international_card", pass.getBooleanValue("allow")); } diff --git a/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java index 6183230d5..6679d26c9 100644 --- a/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java @@ -12,7 +12,10 @@ import au.com.royalpay.payment.core.exceptions.ParamInvalidException; import au.com.royalpay.payment.manage.mappers.client.ClientCustomersMapper; 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.payment.*; +import au.com.royalpay.payment.manage.mappers.payment.AustracDataMapper; +import au.com.royalpay.payment.manage.mappers.payment.OrderMapper; +import au.com.royalpay.payment.manage.mappers.payment.RefundMapper; +import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper; import au.com.royalpay.payment.manage.mappers.system.*; import au.com.royalpay.payment.manage.merchants.core.ClientManager; import au.com.royalpay.payment.manage.organizations.core.OrgManager; @@ -56,7 +59,6 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; -import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.stereotype.Service; import org.springframework.ui.Model; @@ -88,8 +90,6 @@ public class TradeLogServiceImpl implements TradeLogService { @Resource private RefundMapper refundMapper; @Resource - private RefundAuditionMapper refundAuditionMapper; - @Resource private ClientAccountMapper clientAccountMapper; @Resource private ClientManager clientManager; @@ -116,8 +116,6 @@ public class TradeLogServiceImpl implements TradeLogService { @Resource private ClearingLogMapper clearingLogMapper; @Resource - private StringRedisTemplate stringRedisTemplate; - @Resource private OrgManager orgManager; @Resource private ClientMapper clientMapper; diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml index 38e1504a7..b7508e323 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml @@ -952,7 +952,7 @@ INNER JOIN sys_org so ON t.org_id = so.org_id AND so.is_valid = 1 AND so.type = 0 AND so.citypartner = 1 AND so.commission = 1 - AND year(t.transaction_time) = #{year} AND month(t.transaction_time) = #{month} + AND year(t.create_time) = #{year} AND month(t.create_time) = #{month} AND t.channel != 'Settlement' AND t.channel != 'System' AND t.system_generate = 0 ORDER BY t.client_id asc ]]> diff --git a/src/main/resources/jasper/austrac_report20171228.jasper b/src/main/resources/jasper/austrac_report20171228.jasper deleted file mode 100644 index bc48e6dab..000000000 Binary files a/src/main/resources/jasper/austrac_report20171228.jasper and /dev/null differ diff --git a/src/main/resources/jasper/partner_invoice_20171201.jasper b/src/main/resources/jasper/partner_invoice_20171201.jasper deleted file mode 100644 index 5e336bbee..000000000 Binary files a/src/main/resources/jasper/partner_invoice_20171201.jasper and /dev/null differ diff --git a/src/main/resources/jasper/partner_invoice_gst20180409.jasper b/src/main/resources/jasper/partner_invoice_gst20180409.jasper deleted file mode 100644 index 95cd7257e..000000000 Binary files a/src/main/resources/jasper/partner_invoice_gst20180409.jasper and /dev/null differ diff --git a/src/main/resources/jasper/partner_invoice_gst20180412.jasper b/src/main/resources/jasper/partner_invoice_gst20180412.jasper deleted file mode 100644 index 9c01d8c81..000000000 Binary files a/src/main/resources/jasper/partner_invoice_gst20180412.jasper and /dev/null differ diff --git a/src/main/resources/jasper/partner_invoice_gst20200410.jasper b/src/main/resources/jasper/partner_invoice_gst20200410.jasper deleted file mode 100644 index a5111a4fa..000000000 Binary files a/src/main/resources/jasper/partner_invoice_gst20200410.jasper and /dev/null differ diff --git a/src/main/resources/jasper/partner_invoice_gst_bak.jasper b/src/main/resources/jasper/partner_invoice_gst_bak.jasper deleted file mode 100644 index a5111a4fa..000000000 Binary files a/src/main/resources/jasper/partner_invoice_gst_bak.jasper and /dev/null differ diff --git a/src/main/resources/jasper/trans_excel20161008.jasper b/src/main/resources/jasper/trans_excel20161008.jasper deleted file mode 100644 index 4540bd758..000000000 Binary files a/src/main/resources/jasper/trans_excel20161008.jasper and /dev/null differ diff --git a/src/main/resources/jasper/trans_excel20161009.jasper b/src/main/resources/jasper/trans_excel20161009.jasper deleted file mode 100644 index 8f1c479c2..000000000 Binary files a/src/main/resources/jasper/trans_excel20161009.jasper and /dev/null differ diff --git a/src/main/resources/jasper/trans_excel20170516.jasper b/src/main/resources/jasper/trans_excel20170516.jasper deleted file mode 100644 index 92f6d53b8..000000000 Binary files a/src/main/resources/jasper/trans_excel20170516.jasper and /dev/null differ diff --git a/src/main/resources/jasper/trans_excel20170531.jasper b/src/main/resources/jasper/trans_excel20170531.jasper deleted file mode 100644 index 114f3e452..000000000 Binary files a/src/main/resources/jasper/trans_excel20170531.jasper and /dev/null differ diff --git a/src/main/resources/jasper/trans_excel20170704.jasper b/src/main/resources/jasper/trans_excel20170704.jasper deleted file mode 100644 index 6a3088df4..000000000 Binary files a/src/main/resources/jasper/trans_excel20170704.jasper and /dev/null differ diff --git a/src/main/resources/jasper/trans_excel20170822.jasper b/src/main/resources/jasper/trans_excel20170822.jasper deleted file mode 100644 index e15c25426..000000000 Binary files a/src/main/resources/jasper/trans_excel20170822.jasper and /dev/null differ diff --git a/src/main/resources/jasper/trans_excel20180412.jasper b/src/main/resources/jasper/trans_excel20180412.jasper deleted file mode 100644 index 70a836128..000000000 Binary files a/src/main/resources/jasper/trans_excel20180412.jasper and /dev/null differ diff --git a/src/main/resources/jasper/trans_flow20161008.jasper b/src/main/resources/jasper/trans_flow20161008.jasper deleted file mode 100644 index d9d27c387..000000000 Binary files a/src/main/resources/jasper/trans_flow20161008.jasper and /dev/null differ diff --git a/src/main/resources/jasper/trans_flow20161009.jasper b/src/main/resources/jasper/trans_flow20161009.jasper deleted file mode 100644 index 633fecc1f..000000000 Binary files a/src/main/resources/jasper/trans_flow20161009.jasper and /dev/null differ diff --git a/src/main/resources/jasper/trans_flow_new20161107.jasper b/src/main/resources/jasper/trans_flow_new20161107.jasper deleted file mode 100644 index 781826752..000000000 Binary files a/src/main/resources/jasper/trans_flow_new20161107.jasper and /dev/null differ diff --git a/src/main/resources/jasper/trans_flow_new20161202.jasper b/src/main/resources/jasper/trans_flow_new20161202.jasper deleted file mode 100644 index cbb4e4e8a..000000000 Binary files a/src/main/resources/jasper/trans_flow_new20161202.jasper and /dev/null differ diff --git a/src/main/resources/jasper/trans_flow_new20170302.jasper b/src/main/resources/jasper/trans_flow_new20170302.jasper deleted file mode 100644 index aeccc6c99..000000000 Binary files a/src/main/resources/jasper/trans_flow_new20170302.jasper and /dev/null differ diff --git a/src/main/resources/templates/mail/new_client_notice.html b/src/main/resources/templates/mail/new_client_notice.html index 750855542..f5003c77c 100644 --- a/src/main/resources/templates/mail/new_client_notice.html +++ b/src/main/resources/templates/mail/new_client_notice.html @@ -5,6 +5,14 @@

I'm happy to let you know that your RoyalPay Cross-border Payment account has been set up.
很高兴通知您,贵司RoyalPay跨境全支付已经开通

+

I'm + happy to let you know + Congratulations, you have passed the compliance review and be granted a RoyalPay account. + You can start to do IT integration. At the same time, please contact BD regarding the invoice of security + deposit. We will set up your account live in the production environment after receiving the security deposit + from your company. +
+ 恭喜您已通过 CardPayment 合规审核,您可开始做IT对接. 请联系BD沟通支付保证金事宜。我司会在收到贵司提交的保证金后,开启您的 CardPayment 权限。

Please kindly log on the website below to manage your accounts and transactions:
@@ -94,7 +102,7 @@ Store to download APP for IOS,which helps check your payment receiving records.

您可以在APP Store里搜索"RoyalPay"下载royalpay的app,来进行收款和接收到账提醒等。 + href="https://itunes.apple.com/app/royalpay/id1049566852?l=en&mt=8">RoyalPay"下载royalpay的app,来进行收款和接收到账提醒等。


@@ -154,7 +162,8 @@
- +
Tel:
1300 10 77 50
Level 14, 383 Kent Street, Sydney NSW 2000
Tunnel Show Pty Ltd trading as RoyalPay
@@ -173,10 +182,7 @@
- - -
- \ No newline at end of file + diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index 3c0d71eb3..21ca834d7 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -147,7 +147,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter controller: 'partnerDeviceCtrl' }).state('partners.detail.files', { url: '/files', - params:{commitType:"cross-border"}, + params: {commitType: "cross-border"}, templateUrl: '/static/payment/partner/templates/partner_auth_files.html', controller: 'partnerAuthFileCtrl' }).state('partners.detail.files.CP_files', { @@ -211,8 +211,447 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter url: '/incremental_service', templateUrl: 'static/payment/partner/templates/incremental_service.html', controller: 'incrementalServiceCtrl' + }).state('partners.edit', { + url: '/{clientMoniker}/edit', + params: {"commitCardPayment": false, "commitCrossBorderPayment": false}, + templateUrl: 'static/payment/partner/templates/partner_edit.html', + controller: 'partnerEditCtrl', + resolve: { + partner: ['$http', '$stateParams', function ($http, $stateParams) { + return $http.get('/sys/partners/' + $stateParams.clientMoniker); + }] + } }); }]); + app.controller('partnerEditCtrl', ['$scope', '$http', '$state', 'Upload', 'commonDialog', 'timezone', 'partner', 'upayIndustryMap', + function ($scope, $http, $state, Upload, commonDialog, timezone, partner, upayIndustryMap) { + $scope.upayIndustrys = upayIndustryMap.configs(); + $scope.timezones = timezone.configs(); + $scope.partner = partner.data; + if (!$scope.partner.client_type) { + $scope.partner.client_type = 'cross-border'; + } + if ($scope.partner.representativeInfo != null) { + $scope.partner.registered_address = $scope.partner.representativeInfo.address; + $scope.partner.registered_suburb = $scope.partner.representativeInfo.suburb; + $scope.partner.registered_postcode = $scope.partner.representativeInfo.postcode; + $scope.partner.registered_state = $scope.partner.representativeInfo.state; + $scope.partner.legal_representative_person = $scope.partner.representativeInfo.representative_person; + $scope.partner.legal_representative_phone = $scope.partner.representativeInfo.phone; + $scope.partner.legal_representative_email = $scope.partner.representativeInfo.email; + $scope.partner.legal_representative_job = $scope.partner.representativeInfo.job_title; + + $scope.partner.marketing_person = $scope.partner.representativeInfo.marketing_person; + $scope.partner.marketing_phone = $scope.partner.representativeInfo.marketing_phone; + $scope.partner.marketing_email = $scope.partner.representativeInfo.marketing_email; + $scope.partner.marketing_job = $scope.partner.representativeInfo.marketing_job_title; + + $scope.partner.legal_representative_wechatid = $scope.partner.representativeInfo.legal_representative_wechatid; + $scope.partner.marketing_wechatid = $scope.partner.representativeInfo.marketing_wechatid; + } + + $scope.enablePaymentType = function (type) { + $scope.partner[type] = !$scope.partner[type]; + }; + + if ($state.params.commitCardPayment) { + $scope.enablePaymentType('enable_card_payment'); + } + + if ($state.params.commitCrossBorderPayment) { + $scope.enablePaymentType('enable_cross_payment'); + } + + function hasRole() { + var rolenum; + switch (sessionStorage.getItem('role')) { + case "administrator": + rolenum = 1; + break; + case "bduser": + rolenum = 4; + break; + case "salesmanager": + rolenum = 8192; + break; + case "accountant": + rolenum = 8; + break; + case "sitemanager": + rolenum = 128; + break; + case "director": + rolenum = 64; + break; + case "developer": + rolenum = 256; + break; + case "compliance": + rolenum = 2; + break; + case "guest": + rolenum = 2048; + break; + case "orgmanager": + rolenum = 4096; + break; + case "riskmanager": + rolenum = 1024; + break; + default: + break; + } + if ((window.currentUser.role & rolenum) > 0) { + return true; + } else { + sessionStorage.removeItem('role'); + return false; + } + } + + if (hasRole()) { + $scope.role = sessionStorage.getItem('role'); + } + + var origin_referrer_id = angular.copy($scope.partner.referrer_id); + var resetClientPayDescByTpey = function (type) { + type = parseInt(type); + if (type == 1) { + removeClientPayDesc($scope.partner.client_pay_desc, '10'); + } + if (type == 2) { + removeClientPayDesc($scope.partner.client_pay_desc, '20'); + } + }; + var compare = function (x, y) { + x = parseInt(x); + y = parseInt(y); + if (x < y) { + return -1; + } else if (x > y) { + return 1; + } else { + return 0; + } + } + $scope.toggleClientPayType = function (type) { + if (!$scope.partner.client_pay_type) { + $scope.partner.client_pay_type = []; + } + var $idx = $scope.partner.client_pay_type.indexOf(type); + if ($idx >= 0) { + $scope.partner.client_pay_type.splice($idx, 1); + resetClientPayDescByTpey(type); + } else { + $scope.partner.client_pay_type.push(type); + $scope.partner.client_pay_type.sort(compare); + } + }; + $scope.toggleClientPayDesc = function (type) { + if (!$scope.partner.client_pay_desc) { + $scope.partner.client_pay_desc = []; + } + var $idx = $scope.partner.client_pay_desc.indexOf(type); + if ($idx >= 0) { + if (type == '203') { + removeClientPayDesc($scope.partner.client_pay_desc, '2030') + } + $scope.partner.client_pay_desc.splice($idx, 1); + } else { + $scope.partner.client_pay_desc.push(type); + $scope.partner.client_pay_desc.sort(compare); + } + }; + + $scope.partner.sameAsContactPerson = false; + $scope.checkboxOnclick = function () { + $scope.partner.sameAsContactPerson = !($scope.partner.sameAsContactPerson); + if ($scope.partner.sameAsContactPerson) { + $scope.partner.legal_representative_person = $scope.partner.contact_person; + $scope.partner.legal_representative_phone = $scope.partner.contact_phone; + $scope.partner.legal_representative_email = $scope.partner.contact_email; + $scope.partner.legal_representative_job = $scope.partner.contact_job; + $scope.partner.legal_representative_wechatid = $scope.partner.contact_wechatid; + } + } + + $scope.partner.marketingSameAsContact = false; + $scope.checkMarketingSameAsContact = function () { + $scope.partner.marketingSameAsContact = !($scope.partner.marketingSameAsContact); + if ($scope.partner.marketingSameAsContact) { + $scope.partner.marketing_person = $scope.partner.contact_person; + $scope.partner.marketing_phone = $scope.partner.contact_phone; + $scope.partner.marketing_email = $scope.partner.contact_email; + $scope.partner.marketing_job = $scope.partner.contact_job; + $scope.partner.marketing_wechatid = $scope.partner.contact_wechatid; + } + } + + $scope.partner.sameAsAddress = false; + $scope.sameAddress = function () { + $scope.partner.sameAsAddress = !($scope.partner.sameAsAddress); + if ($scope.partner.sameAsAddress) { + $scope.partner.registered_address = $scope.partner.address; + $scope.partner.registered_suburb = $scope.partner.suburb; + $scope.partner.registered_postcode = $scope.partner.postcode; + $scope.partner.registered_state = $scope.partner.state; + } + } + + $scope.listReferrers = function () { + $http.get('/sys/orgs/referrer').then(function (resp) { + $scope.referrers = resp.data; + }) + }; + $scope.listReferrers(); + + $scope.loadAlipayCategory = function () { + $http.get('/static/data/alipayMcc.json').then(function (resp) { + $scope.alipayMccCategory = resp.data; + }) + }; + $scope.loadAlipayCategory(); + $scope.loadJDindustry = function () { + $http.get('/static/data/jdindustry.json').then(function (resp) { + $scope.jdindustry = resp.data; + }) + }; + $scope.loadJDindustry(); + + $scope.loadLakalaPayindustry = function () { + $http.get('/static/data/lakalapayindustry.json').then(function (resp) { + $scope.lakalapayindustry = resp.data; + }) + }; + $scope.loadLakalaPayindustry(); + + $scope.loadLakalaPaySettle = function () { + $http.get('/static/data/lakalapaysettle.json').then(function (resp) { + $scope.lakalapaysettle = resp.data; + }) + }; + $scope.loadLakalaPaySettle(); + + $scope.loadLakalaPayGoods = function () { + $http.get('/static/data/lakalapaygoods.json').then(function (resp) { + $scope.lakalapaygoods = resp.data; + }) + }; + $scope.loadLakalaPayGoods(); + + $scope.loadRoyalpayindustry = function () { + $http.get('/static/data/royalpayindustry.json').then(function (resp) { + $scope.royalpayindustry = resp.data; + }) + }; + $scope.loadRoyalpayindustry(); + + $scope.loadHfindustry = function () { + $http.get('/static/data/hfindustry.json').then(function (resp) { + $scope.hfindustry = resp.data; + }) + }; + $scope.loadHfindustry(); + + $scope.onAlipayMccSelect = function (selectedItem) { + $scope.partner.alipay_category = selectedItem.label; + $scope.partner.alipayindustry = selectedItem.mccCode; + }; + $scope.onRoyalPayIndustrySelect = function (selectedItem) { + $scope.partner.royalpay_label = selectedItem.label; + $scope.partner.royalpayindustry = selectedItem.mccCode; + }; + $scope.onHfIndustrySelect = function (selectedItem) { + $scope.partner.hf_label = selectedItem.label; + $scope.partner.hfindustry = selectedItem.mccCode; + }; + + + $scope.updatePartner = function (form) { + if (form.$invalid) { + angular.forEach(form, function (item, key) { + if (key.indexOf('$') < 0) { + item.$dirty = true; + } + }); + return; + } + + if ($scope.partner.company_name.indexOf("Migration") != -1) { + alert("Company Name包含敏感词汇,请检查后重新提交!"); + return; + } + if ($scope.partner.company_phone.indexOf(' ') != -1) { + alert('Company Phone can not contain space character'); + return; + } + if ($scope.partner.contact_email.indexOf(' ') != -1) { + alert('Contact email Phone can not contain space character'); + return; + } + if ($scope.partner.suburb.indexOf(' ') != -1) { + alert('suburb can not contain two and more continuous space characters'); + return; + } + if ($scope.partner.client_pay_type.indexOf('2') >= 0) { + if (!$scope.partner.company_photo) { + alert('Shop Photo1 is necessary'); + return; + } + if (!$scope.partner.store_photo) { + alert('Shop Photo2 is necessary'); + return; + } + } + + if ($scope.partner.acn && $scope.partner.business_structure == 'Company') { + if ($scope.partner.acn.length != 9) { + alert('Acn is not valid'); + } + } + if ($scope.partner.referrer_id) { + $scope.referrers.forEach(function (e) { + if ($scope.partner.referrer_id == e.org_id) { + $scope.partner.referrer_name = e.name; + return; + } + }) + } + var content = ''; + if (!origin_referrer_id && $scope.partner.referrer_id) { + content = 'Update partner info successfully,But You Had add new Referrer,Please Change the BD Commission Proportion!'; + } + if ($scope.partner.client_pay_type.length == 0) { + alert('请选择商户支付场景') + return; + } + if ($scope.partner.client_pay_desc.length == 0) { + alert('请选择商户支付方式') + return; + } + if ($scope.partner.client_pay_type.indexOf('1') >= 0) { + if ($scope.partner.client_pay_desc.join(',').indexOf('10') < 0) { + alert("请检查线上支付场景是否已选择支付方式"); + return; + } + } + if ($scope.partner.client_pay_type.indexOf('2') >= 0) { + if ($scope.partner.client_pay_desc.join(',').indexOf('20') < 0) { + alert("请检查线下支付场景是否已选择支付方式"); + return; + } + } + if ($scope.partner.client_pay_desc.join(',').indexOf('203') >= 0) { + if ($scope.partner.client_pay_desc.join(',').indexOf('2030') < 0 && $scope.partner.client_pay_desc.join(',').indexOf('20399') < 0) { + alert("请检查线下支付是否已选择收银系统类型"); + return; + } + } + $scope.partner.client_pay_type = $scope.partner.client_pay_type.join(','); + $scope.partner.client_pay_desc = $scope.partner.client_pay_desc.join(','); + $http.put('/sys/partners/' + $scope.partner.client_moniker, $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' + }); + } + $scope.updateMerchantLocation(); + $scope.loadPartners(); + $state.go('^.detail', {clientMoniker: $scope.partner.client_moniker}, {reload: true}); + }, function (resp) { + commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}) + }); + }; + $scope.uploadLogo = function (file) { + if (file != null) { + if (file.size > 1 * 1024 * 1024) { + commonDialog.alert({title: 'Error', content: '文件大小不能超过1MB,请压缩后重试', type: 'error'}) + } else { + $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) { + if (file.size > 2 * 1024 * 1024) { + commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB,请压缩后重试', type: 'error'}) + } else { + $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) { + if (file.size > 2 * 1024 * 1024) { + commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB,请压缩后重试', type: 'error'}) + } else { + $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.getMerchantLocation = function () { + $http.get('/sys/partners/' + $scope.partner.client_moniker + '/location').then(function (resp) { + $scope.merchant_location = resp.data; + }); + }; + $scope.getMerchantLocation(); + + $scope.updateMerchantLocation = function () { + var params = window.frames['merchant_detail'].merchant_location; + if (params) { + $http.put('/sys/partners/modify/' + $scope.partner.client_moniker + '/location', params).then(function () { + }); + } + } + }]); app.controller('partnerListCtrl', ['$scope', '$sce', '$http', '$filter', '$uibModal', 'businessStructuresMap', 'industryMap', 'stateMap', 'sectorMap', 'countryMap', function ($scope, $sce, $http, $filter, $uibModal, businessStructuresMap, industryMap, stateMap, sectorMap, countryMap) { @@ -239,7 +678,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter var selectAll = { "label": "All", "mccCode": "0", - "children":{} + "children": {} }; $scope.royalpayindustry.unshift(selectAll); }) @@ -271,7 +710,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter } return key + '=' + encodeURIComponent(value) }).join('&'); - window.open('/sys/partners/exporting_excel?'+param_str) + window.open('/sys/partners/exporting_excel?' + param_str) }; /*$scope.loadLocations = function () { @@ -419,748 +858,701 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }; }]); - app.controller('partnerDetailCtrl', ['$scope', '$http', '$state', '$uibModal', '$rootScope', 'Upload', 'commonDialog', 'partner', '$sce', function ($scope, $http, $state, $uibModal, $rootScope, Upload, commonDialog, partner, $sce) { - $scope.init = {wechat_compliance: false, local_merchant: false}; - $scope.partner = partner.data; - $scope.isComplianceOfCompanyName = false; - $scope.isComplianceOfShortName = false; - $scope.isComplianceOfBusinessStructure = false; - $scope.cardPromotionaparams={} - var website = partner.data.company_website; - if (website != null) { - if (website.indexOf('http') != 0) { - $scope.partner.company_website = 'http://' + angular.copy(website); + app.controller('partnerDetailCtrl', ['$scope', '$http', '$state', '$uibModal', '$rootScope', 'Upload', 'commonDialog', 'partner', '$sce', + function ($scope, $http, $state, $uibModal, $rootScope, Upload, commonDialog, partner, $sce) { + $scope.init = {wechat_compliance: false, local_merchant: false}; + $scope.partner = partner.data; + $scope.isComplianceOfCompanyName = false; + $scope.isComplianceOfShortName = false; + $scope.isComplianceOfBusinessStructure = false; + $scope.cardPromotionaparams = {}; + var website = partner.data.company_website; + if (website != null) { + if (website.indexOf('http') !== 0) { + $scope.partner.company_website = 'http://' + angular.copy(website); + } } - } - $scope.decideCompliance = function (name) { - var keywords = ['education', 'financial', 'train', 'immigrant', 'invest', - '律师咨询', '会计事务所', '移民', '留学', '娱乐', '金融', '地产', '投资']; - for (var i = 0; i < keywords.length; i++) { - if (name.indexOf(keywords[i]) != -1) { - return true; + $scope.decideCompliance = function (name) { + var keywords = ['education', 'financial', 'train', 'immigrant', 'invest', + '律师咨询', '会计事务所', '移民', '留学', '娱乐', '金融', '地产', '投资']; + for (var i = 0; i < keywords.length; i++) { + if (name.indexOf(keywords[i]) !== -1) { + return true; + } } + return false; + }; + if (partner.data.company_name != null) { + $scope.isComplianceOfCompanyName = $scope.decideCompliance(partner.data.company_name); } - return false; - }; - if (partner.data.company_name != null) { - $scope.isComplianceOfCompanyName = $scope.decideCompliance(partner.data.company_name); - } - if (partner.data.short_name != null) { - $scope.isComplianceOfShortName = $scope.decideCompliance(partner.data.short_name); - } - if (partner.data.business_structure != null) { - $scope.isComplianceOfBusinessStructure = $scope.decideCompliance(partner.data.business_structure); - } - $scope.showDBUsers = function () { - $http.get('/sys/partners/' + $scope.partner.client_moniker + '/bd_user').then(function (resp) { - $scope.partner.client_bds = resp.data; - }) - }; - $scope.showDBUsers(); - $scope.showFile = function () { - $http.get('/sys/partners/' + $scope.partner.client_moniker + '/file/source_agree_file').then(function (resp) { - $scope.fileManager = resp.data; - }); - }; + if (partner.data.short_name != null) { + $scope.isComplianceOfShortName = $scope.decideCompliance(partner.data.short_name); + } + if (partner.data.business_structure != null) { + $scope.isComplianceOfBusinessStructure = $scope.decideCompliance(partner.data.business_structure); + } + $scope.showDBUsers = function () { + $http.get('/sys/partners/' + $scope.partner.client_moniker + '/bd_user').then(function (resp) { + $scope.partner.client_bds = resp.data; + }) + }; + $scope.showDBUsers(); + $scope.showFile = function () { + $http.get('/sys/partners/' + $scope.partner.client_moniker + '/file/source_agree_file').then(function (resp) { + $scope.fileManager = resp.data; + }); + }; - $scope.showCardFile = function () { - $http.get('/sys/partners/' + $scope.partner.client_moniker + '/file/source_card_agree_file?fileName=letter_of_offer_file').then(function (resp) { - $scope.letterOfOfferFileManager = resp.data; - }); - $http.get('/sys/partners/' + $scope.partner.client_moniker + '/file/source_card_agree_file?fileName=promotional_offer_file').then(function (resp) { - $scope.promotionalOfferFileManager = resp.data; - }); - $http.get('/sys/partners/' + $scope.partner.client_moniker + '/file/source_card_agree_file?fileName=terms_and_conditions_file').then(function (resp) { - $scope.termsAndConditionsFile = resp.data; - }); - }; + $scope.showCardFile = function () { + $http.get('/sys/partners/' + $scope.partner.client_moniker + '/file/source_card_agree_file?fileName=letter_of_offer_file').then(function (resp) { + $scope.letterOfOfferFileManager = resp.data; + }); + $http.get('/sys/partners/' + $scope.partner.client_moniker + '/file/source_card_agree_file?fileName=promotional_offer_file').then(function (resp) { + $scope.promotionalOfferFileManager = resp.data; + }); + $http.get('/sys/partners/' + $scope.partner.client_moniker + '/file/source_card_agree_file?fileName=terms_and_conditions_file').then(function (resp) { + $scope.termsAndConditionsFile = resp.data; + }); + }; - $scope.showFile(); - $scope.showCardFile(); - $scope.passClient = function () { - if ($scope.partner.enable_hf) { - if ($scope.partner.hfindustry == null) { - alert("已开启HF支付通道,HF行业不可为空!"); + $scope.showFile(); + $scope.showCardFile(); + $scope.passClient = function () { + if (!$rootScope.complianceCheck) { + alert("please check first"); return; } - } - if (!$rootScope.complianceCheck) { - alert("please check first"); - return; - } - if (!$rootScope.complianceCheck.authFile) { - alert("Compliance Files not checked"); - return; - } - if (!$rootScope.complianceCheck.clientInfo) { - alert("Partner Detail not checked"); - return; - } - if (!$rootScope.complianceCheck.bankAccount) { - alert("Bank Account not checked"); - return; - } - var title = 'Audit Partner'; - var content = 'Are you sure to mark partner ' + $scope.partner.company_name + ' audited?'; - var choises = ''; - var contentHtml = ''; - if ($scope.isComplianceOfCompanyName || $scope.isComplianceOfShortName - || $scope.isComplianceOfBusinessStructure) { - var info = []; - if ($scope.isComplianceOfCompanyName) { - info.push('Company Name'); + if (!$rootScope.complianceCheck.authFile) { + alert("Compliance Files not checked"); + return; } - if ($scope.isComplianceOfShortName) { - info.push('Short Name'); + if (!$rootScope.complianceCheck.clientInfo) { + alert("Partner Detail not checked"); + return; } - if ($scope.isComplianceOfBusinessStructure) { - info.push('Business Structure'); + if (!$rootScope.complianceCheck.bankAccount) { + alert("Bank Account not checked"); + return; } - title = 'Warning'; - contentHtml = $sce.trustAsHtml('本次提交的商户[' + $scope.partner.company_name + '],' + info.toString() + '存在微信渠道不合规信息'); - choises = [{label: '取消', className: 'btn-danger', key: '2', dismiss: true}, - {label: '确认提交', className: 'btn-success', key: '1'}]; - content = ''; - } - commonDialog.confirm({ - title: title, - content: content, - choises: choises, - contentHtml: contentHtml - }).then(function () { - $http.put('/sys/partners/' + $scope.partner.client_moniker + '/audit', {pass: 1}).then(function () { - if ($scope.partner.approve_result == 2 && ($scope.partner.source == 1 || $scope.partner.source == 2)) { - commonDialog.alert({ - title: 'Success', - content: 'Comply Passed!', - type: 'success' - }); - } else { - commonDialog.alert({ - title: 'Success', - content: 'Comply Passed! Email will send to contact email address soon.', - type: 'success' - }); + var title = 'Audit Partner'; + var content = 'Are you sure to mark partner ' + $scope.partner.company_name + ' audited?'; + var choises = ''; + var contentHtml = ''; + if ($scope.isComplianceOfCompanyName || $scope.isComplianceOfShortName + || $scope.isComplianceOfBusinessStructure) { + var info = []; + if ($scope.isComplianceOfCompanyName) { + info.push('Company Name'); } - delete $rootScope.complianceCheck; - $state.reload(); - }, function (resp) { - commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); - }) - }); - }; - $scope.passCardClient = function () { - if (!$rootScope.complianceCheck) { - alert("please check first"); - return; - } - if (!$rootScope.complianceCheck.authFile) { - alert("Compliance Files not checked"); - return; - } - if (!$rootScope.complianceCheck.clientInfo) { - alert("Partner Detail not checked"); - return; - } - if (!$rootScope.complianceCheck.bankAccount) { - alert("Bank Account not checked"); - return; - } - var title = 'Audit Partner Card'; - var content = 'Are you sure to mark partner ' + $scope.partner.company_name + ' audited?'; - var choises = ''; - var contentHtml = ''; - if ($scope.isComplianceOfCompanyName || $scope.isComplianceOfShortName - || $scope.isComplianceOfBusinessStructure) { - var info = []; - if ($scope.isComplianceOfCompanyName) { - info.push('Company Name'); + if ($scope.isComplianceOfShortName) { + info.push('Short Name'); + } + if ($scope.isComplianceOfBusinessStructure) { + info.push('Business Structure'); + } + title = 'Warning'; + contentHtml = $sce.trustAsHtml('本次提交的商户[' + $scope.partner.company_name + '],' + info.toString() + '存在微信渠道不合规信息'); + choises = [{label: '取消', className: 'btn-danger', key: '2', dismiss: true}, + {label: '确认提交', className: 'btn-success', key: '1'}]; + content = ''; } - if ($scope.isComplianceOfShortName) { - info.push('Short Name'); + commonDialog.confirm({ + title: title, + content: content, + choises: choises, + contentHtml: contentHtml + }).then(function () { + $http.put('/sys/partners/' + $scope.partner.client_moniker + '/audit', {pass: 1}).then(function () { + if ($scope.partner.approve_result == 2 && ($scope.partner.source == 1 || $scope.partner.source == 2)) { + commonDialog.alert({ + title: 'Success', + content: 'Comply Passed!', + type: 'success' + }); + } else { + commonDialog.alert({ + title: 'Success', + content: 'Comply Passed! Email will send to contact email address soon.', + type: 'success' + }); + } + delete $rootScope.complianceCheck; + $state.reload(); + }, function (resp) { + commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); + }) + }); + }; + $scope.passCardClient = function () { + if (!$rootScope.complianceCheck) { + alert("please check first"); + return; } - if ($scope.isComplianceOfBusinessStructure) { - info.push('Business Structure'); + if (!$rootScope.complianceCheck.authFile) { + alert("Compliance Files not checked"); + return; } - title = 'Warning'; - contentHtml = $sce.trustAsHtml('本次提交的商户[' + $scope.partner.company_name + '],' + info.toString() + '存在微信渠道不合规信息'); - choises = [{label: '取消', className: 'btn-danger', key: '2', dismiss: true}, - {label: '确认提交', className: 'btn-success', key: '1'}]; - content = ''; - } - commonDialog.confirm({ - title: title, - content: content, - choises: choises, - contentHtml: contentHtml - }).then(function () { - $http.put('/sys/partners/' + $scope.partner.client_moniker + '/card_audit', {pass: 1}).then(function () { - if ($scope.partner.approve_result == 2 && ($scope.partner.source == 1 || $scope.partner.source == 2)) { - commonDialog.alert({ - title: 'Success', - content: 'Comply Passed!', - type: 'success' - }); - } else { + if (!$rootScope.complianceCheck.clientInfo) { + alert("Partner Detail not checked"); + return; + } + if (!$rootScope.complianceCheck.bankAccount) { + alert("Bank Account not checked"); + return; + } + var title = 'Audit Partner Card'; + var content = 'Are you sure to mark partner ' + $scope.partner.company_name + ' audited?'; + var choises = ''; + var contentHtml = ''; + if ($scope.isComplianceOfCompanyName || $scope.isComplianceOfShortName + || $scope.isComplianceOfBusinessStructure) { + var info = []; + if ($scope.isComplianceOfCompanyName) { + info.push('Company Name'); + } + if ($scope.isComplianceOfShortName) { + info.push('Short Name'); + } + if ($scope.isComplianceOfBusinessStructure) { + info.push('Business Structure'); + } + title = 'Warning'; + contentHtml = $sce.trustAsHtml('本次提交的商户[' + $scope.partner.company_name + '],' + info.toString() + '存在微信渠道不合规信息'); + choises = [{label: '取消', className: 'btn-danger', key: '2', dismiss: true}, + {label: '确认提交', className: 'btn-success', key: '1'}]; + content = ''; + } + commonDialog.confirm({ + title: title, + content: content, + choises: choises, + contentHtml: contentHtml + }).then(function () { + $http.put('/sys/partners/' + $scope.partner.client_moniker + '/card_audit', {pass: 1}).then(function () { + if ($scope.partner.approve_result == 2 && ($scope.partner.source == 1 || $scope.partner.source == 2)) { + commonDialog.alert({ + title: 'Success', + content: 'Comply Passed!', + type: 'success' + }); + } else { + commonDialog.alert({ + title: 'Success', + content: 'Comply Passed! Email will send to contact email address soon.', + type: 'success' + }); + } + delete $rootScope.complianceCheck; + $state.reload(); + }, function (resp) { + commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); + }) + }); + }; + $scope.pass2GreenChannel = function () { + commonDialog.confirm({ + title: 'Green Channel Audit Partner', + content: 'Are you sure to mark partner ' + $scope.partner.company_name + ' green channel audited ?' + }).then(function () { + $http.put('/sys/partners/' + $scope.partner.client_moniker + '/aduit/green_channel').then(function () { commonDialog.alert({ title: 'Success', content: 'Comply Passed! Email will send to contact email address soon.', type: 'success' }); - } - delete $rootScope.complianceCheck; + $state.reload(); + }, function (resp) { + commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); + }) + }) + }; + $scope.showBg = false; + $scope.exportPDF = function () { + $scope.showBg = true; + $http.get('/sys/partners/' + $scope.partner.client_moniker + '/export/agreepdf').then(function () { + commonDialog.alert({ + title: 'Success', + content: 'Agreement File Generate Succeed! Please notify BD!', + type: 'success' + }); + $scope.showBg = false; $state.reload(); }, function (resp) { + $scope.showBg = false; + $state.reload(); commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); - }) - }); - }; - $scope.pass2GreenChannel = function () { - commonDialog.confirm({ - title: 'Green Channel Audit Partner', - content: 'Are you sure to mark partner ' + $scope.partner.company_name + ' green channel audited ?' - }).then(function () { - $http.put('/sys/partners/' + $scope.partner.client_moniker + '/aduit/green_channel').then(function () { + }); + + }; + $scope.exportAgreegatePDF = function () { + $scope.showBg = true; + $http.get('/sys/partners/' + $scope.partner.client_moniker + '/export/aggregate/agreepdf').then(function () { commonDialog.alert({ title: 'Success', - content: 'Comply Passed! Email will send to contact email address soon.', + content: 'Agreement File Generate Succeed! Please notify BD!', type: 'success' }); + $scope.showBg = false; $state.reload(); }, function (resp) { + $scope.showBg = false; + $state.reload(); commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); - }) - }) - }; - $scope.showBg = false; - $scope.exportPDF = function () { - $scope.showBg = true; - $http.get('/sys/partners/' + $scope.partner.client_moniker + '/export/agreepdf').then(function () { - commonDialog.alert({ - title: 'Success', - content: 'Agreement File Generate Succeed! Please notify BD!', - type: 'success' }); - $scope.showBg = false; - $state.reload(); - }, function (resp) { - $scope.showBg = false; - $state.reload(); - commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); - }); + }; - }; - $scope.exportAgreegatePDF = function () { - $scope.showBg = true; - $http.get('/sys/partners/' + $scope.partner.client_moniker + '/export/aggregate/agreepdf').then(function () { - commonDialog.alert({ - title: 'Success', - content: 'Agreement File Generate Succeed! Please notify BD!', - type: 'success' + //制作卡支付合同 + $scope.exportCardAgreegatePDF = function () { + $scope.showBg = true; + $http.get('/sys/partners/' + $scope.partner.client_moniker + '/export/aggregate/card_agree_pdf').then(function () { + commonDialog.alert({ + title: 'Success', + content: 'Agreement File Generate Succeed! Please notify BD!', + type: 'success' + }); + $scope.showBg = false; + $state.reload(); + }, function (resp) { + $scope.showBg = false; + $state.reload(); + commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); }); - $scope.showBg = false; - $state.reload(); - }, function (resp) { - $scope.showBg = false; - $state.reload(); - commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); - }); - }; + } + $scope.Export = function () { + var url = '/dev/' + $scope.partner.client_moniker + '/export/aggregate/agreepdf'; + return url; + } + $scope.uploadAgreeFile = function (file) { + if (file != null) { + if (file.size > 2 * 1024 * 1024) { + commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB,请压缩后重试', type: 'error'}) + } else { + Upload.upload({ + url: '/attachment/files', + data: {file: file} + }).then(function (resp) { + $scope.agree_file_import = resp.data.url; + $http.put('/sys/partners/' + $scope.partner.client_moniker + '/import/agreepdf', {source_agree_file: $scope.agree_file_import}).then(function () { + commonDialog.alert({ + title: 'Success', + content: 'Succeed Imported! Please notify BD', + type: 'success' + }); + $state.reload(); + }, function (resp) { + commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); + }) + }, function (resp) { + commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) + }) + } + } + }; - //制作卡支付合同 - $scope.exportCardAgreegatePDF = function(){ - $scope.showBg = true; - $http.get('/sys/partners/' + $scope.partner.client_moniker + '/export/aggregate/card_agree_pdf').then(function () { - commonDialog.alert({ - title: 'Success', - content: 'Agreement File Generate Succeed! Please notify BD!', - type: 'success' + $scope.uploadCardAgreeFile = function (file) { + if (file != null) { + if (file.size > 2 * 1024 * 1024) { + commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB,请压缩后重试', type: 'error'}) + } else { + Upload.upload({ + url: '/attachment/files', + data: {file: file} + }).then(function (resp) { + $scope.agree_file_import = resp.data.url; + $http.put('/sys/partners/' + $scope.partner.client_moniker + '/import/agreepdf', {source_agree_file: $scope.agree_file_import}).then(function () { + commonDialog.alert({ + title: 'Success', + content: 'Succeed Imported! Please notify BD', + type: 'success' + }); + $state.reload(); + }, function (resp) { + commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); + }) + }, function (resp) { + commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) + }) + } + } + }; + $scope.notifyBD = function () { + $http.get('/sys/partners/' + $scope.partner.client_moniker + '/notify/completeAgree').then(function () { + commonDialog.alert({ + title: 'Success', + content: 'Notify BD Successed!.', + type: 'success' + }); + $state.reload(); + }, function (resp) { + commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}); }); - $scope.showBg = false; - $state.reload(); - }, function (resp) { - $scope.showBg = false; - $state.reload(); - commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); - }); - } + }; + + $scope.cardNotifyBD = function () { + $http.get('/sys/partners/' + $scope.partner.client_moniker + '/notify/cardCompleteAgree').then(function () { + commonDialog.alert({ + title: 'Success', + content: 'Notify BD Successed!.', + type: 'success' + }); + $state.reload(); + }, function (resp) { + commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}); + }); + }; - //制作促销合同 - $scope.exportCardPromotionaAgreegatePDF = function(){ - var title = '确认生成Promotional Offer合同'; - var promotiona_date=''; - var promotiona_period =''; - var contentHtml = $sce.trustAsHtml( - '请输入优惠开始日期(eg:2020-02-01): '+ - '' + - '
' + - '请输入活动周数(unit:week): ' + - ''); - var choises = [{label: '取消', className: 'btn-danger', key: '2', dismiss: true}, - {label: '确认生成', className: 'btn-success', key: '1'}]; - var content = ''; + $scope.downTempPdf = function () { + return '/sys/partners/' + $scope.partner.client_moniker + '/temp/export/pdf'; + } - commonDialog.confirm({ - title: title, - content: content, - choises: choises, - contentHtml: contentHtml - }).then(function (res) { - $scope.showBg = true; - var date = document.getElementById("promotiona_date").value; - var period = document.getElementById("promotiona_period").value; - if(date=='' || period==''){ - commonDialog.alert({title: 'Error', content: '选项不得未空', type: 'error'}); - }else{ - $http.get('/sys/partners/' + $scope.partner.client_moniker + '/export/aggregate/card_promotiona_agree_pdf?date='+date+'&period='+period).then(function () { + $scope.refuse = function () { + commonDialog.inputText({title: 'refuse cause'}).then(function (text) { + $http.put('/sys/partners/' + $scope.partner.client_moniker + '/audit/refuse', {refuse_remark: text}).then(function () { commonDialog.alert({ title: 'Success', - content: 'Agreement File Generate Succeed! Please notify BD!', + content: 'Audit application has been refused.', type: 'success' }); - $scope.showBg = false; $state.reload(); }, function (resp) { - $scope.showBg = false; + commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); + }) + }) + }; + + $scope.cardRefuse = function () { + commonDialog.inputText({title: 'refuse cause'}).then(function (text) { + $http.put('/sys/partners/' + $scope.partner.client_moniker + '/card_audit/refuse', {refuse_remark: text}).then(function () { + commonDialog.alert({ + title: 'Success', + content: 'Card Audit application has been refused.', + type: 'success' + }); $state.reload(); + }, function (resp) { commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); - }); - } + }) + }) + } - }); - } + $scope.deleteClient = function () { + commonDialog.confirm({ + title: 'Delete Partner', + content: 'Are you sure to delete ' + $scope.partner.company_name + '?' + }).then(function () { + $http.delete('/sys/partners/' + $scope.partner.client_moniker).then(function () { + $state.go('^'); + commonDialog.alert({title: 'Delete', content: 'Partner Already Disabled', type: 'error'}); + }, function (resp) { + commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); + }) + }) + }; + $scope.revertClient = function () { + commonDialog.confirm({ + title: 'Revert Partner', + content: 'Are you sure to Revert ' + $scope.partner.company_name + '?' + }).then(function () { + $http.put('/sys/partners/' + $scope.partner.client_moniker + '/revert').then(function () { + $state.go('^'); + commonDialog.alert({title: 'Revert', content: 'Partner Already Revert', type: 'success'}); + }, function (resp) { + commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); + }) + }) + }; - $scope.Export = function () { - var url = '/dev/' + $scope.partner.client_moniker + '/export/aggregate/agreepdf'; - return url; - } - $scope.uploadAgreeFile = function (file) { - if (file != null) { - if (file.size > 2 * 1024 * 1024) { - commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB,请压缩后重试', type: 'error'}) - } else { - Upload.upload({ - url: '/attachment/files', - data: {file: file} - }).then(function (resp) { - $scope.agree_file_import = resp.data.url; - $http.put('/sys/partners/' + $scope.partner.client_moniker + '/import/agreepdf', {source_agree_file: $scope.agree_file_import}).then(function () { + $scope.commitToCompliance = function () { + commonDialog.confirm({ + title: 'Commit to Compliance', + content: 'Are you sure to commit ' + $scope.partner.company_name + ' to compliance?', + choises: [ + {label: 'Submit', className: 'btn-success', key: 1}, + {label: 'Cancel', className: 'btn-warning', key: 0, dismiss: true} + ] + }).then(function (choice) { + if (choice == 1) { + $http.put('/sys/partners/' + $scope.partner.client_moniker + '/to_compliance', {}).then(function () { commonDialog.alert({ title: 'Success', - content: 'Succeed Imported! Please notify BD', + content: 'Commit to Compliance successfully', type: 'success' }); $state.reload(); }, function (resp) { commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); }) - }, function (resp) { - commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) - }) - } - } - }; + } + }) + }; - $scope.uploadCardAgreeFile = function (file) { - if (file != null) { - if (file.size > 2 * 1024 * 1024) { - commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB,请压缩后重试', type: 'error'}) - } else { - Upload.upload({ - url: '/attachment/files', - data: {file: file} - }).then(function (resp) { - $scope.agree_file_import = resp.data.url; - $http.put('/sys/partners/' + $scope.partner.client_moniker + '/import/agreepdf', {source_agree_file: $scope.agree_file_import}).then(function () { + $scope.commitToCardCompliance = function () { + commonDialog.confirm({ + title: 'Commit to Compliance', + content: 'Are you sure to commit ' + $scope.partner.company_name + ' to compliance?', + choises: [ + {label: 'Submit', className: 'btn-success', key: 1}, + {label: 'Cancel', className: 'btn-warning', key: 0, dismiss: true} + ] + }).then(function (choice) { + if (choice == 1) { + $http.put('/sys/partners/' + $scope.partner.client_moniker + '/to_card_compliance', {}).then(function () { commonDialog.alert({ title: 'Success', - content: 'Succeed Imported! Please notify BD', + content: 'Commit to Compliance successfully', type: 'success' }); $state.reload(); }, function (resp) { commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); }) - }, function (resp) { - commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) - }) - } + } + }) } - }; - $scope.notifyBD = function () { - $http.get('/sys/partners/' + $scope.partner.client_moniker + '/notify/completeAgree').then(function () { - commonDialog.alert({ - title: 'Success', - content: 'Notify BD Successed!.', - type: 'success' - }); - $state.reload(); - }, function (resp) { - commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}); - }); - }; - - $scope.cardNotifyBD = function () { - $http.get('/sys/partners/' + $scope.partner.client_moniker + '/notify/cardCompleteAgree').then(function () { - commonDialog.alert({ - title: 'Success', - content: 'Notify BD Successed!.', - type: 'success' - }); - $state.reload(); - }, function (resp) { - commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}); - }); - }; - - $scope.downTempPdf = function () { - var url = '/sys/partners/' + $scope.partner.client_moniker + '/temp/export/pdf'; - return url; - } - - $scope.refuse = function () { - commonDialog.inputText({title: 'refuse cause'}).then(function (text) { - $http.put('/sys/partners/' + $scope.partner.client_moniker + '/audit/refuse', {refuse_remark: text}).then(function () { + $scope.apply2makeAgreeFile = function () { + if (!$scope.partner.enable_cross_payment) { commonDialog.alert({ - title: 'Success', - content: 'Audit application has been refused.', - type: 'success' + title: 'Error!', + content: '请完善商户跨境支付基本信息、签约费率、合规文件!', + type: 'error' }); - $state.reload(); - }, function (resp) { - commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); - }) - }) - }; + $state.go('partners.edit', { + clientMoniker: $scope.partner.client_moniker, + commitCardPayment: false, + commitCrossBorderPayment: true + }); + return; + } + $http.get('/sys/partners/' + $scope.partner.client_moniker + '/make_agree_file').then(function () { + commonDialog.alert({ + title: 'Success!', + content: '已提交制作合同!', + type: 'success' + }); + $state.reload(); + }, function (resp) { + commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); + } + ); + }; - $scope.cardRefuse = function(){ - commonDialog.inputText({title: 'refuse cause'}).then(function (text) { - $http.put('/sys/partners/' + $scope.partner.client_moniker + '/card_audit/refuse', {refuse_remark: text}).then(function () { + $scope.apply2makeCardAgreeFile = function () { + if (!$scope.partner.enable_card_payment) { commonDialog.alert({ - title: 'Success', - content: 'Card Audit application has been refused.', - type: 'success' + title: 'Error!', + content: '请完善商户卡支付基本信息、签约费率、合规文件!', + type: 'error' }); - $state.reload(); - }, function (resp) { - commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); - }) - }) - } - - $scope.deleteClient = function () { - commonDialog.confirm({ - title: 'Delete Partner', - content: 'Are you sure to delete ' + $scope.partner.company_name + '?' - }).then(function () { - $http.delete('/sys/partners/' + $scope.partner.client_moniker).then(function () { - $state.go('^'); - commonDialog.alert({title: 'Delete', content: 'Partner Already Disabled', type: 'error'}); - }, function (resp) { - commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); - }) - }) - }; - $scope.revertClient = function () { - commonDialog.confirm({ - title: 'Revert Partner', - content: 'Are you sure to Revert ' + $scope.partner.company_name + '?' - }).then(function () { - $http.put('/sys/partners/' + $scope.partner.client_moniker + '/revert').then(function () { - $state.go('^'); - commonDialog.alert({title: 'Revert', content: 'Partner Already Revert', type: 'success'}); - }, function (resp) { - commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); - }) - }) - }; + $state.go('partners.edit', { + clientMoniker: $scope.partner.client_moniker, + commitCardPayment: true, + commitCrossBorderPayment: false + }); + return; + } + $http.get('/sys/partners/' + $scope.partner.client_moniker + '/make_card_agree_file').then(function () { + commonDialog.alert({ + title: 'Success!', + content: '已提交制作合同!', + type: 'success' + }); + $state.reload(); + }, function (resp) { + if (String(resp.data.message).match("No Rate Config")) { + commonDialog.alert({ + title: 'Error!', + content: '商户卡支付签约费率未配置,请添加商户卡支付签约费率!', + type: 'error' + }); + $state.go('partners.detail.rates', { + clientMoniker: $scope.partner.client_moniker + }); + } else { + commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); + } + } + ); + }; - $scope.commitToCompliance = function () { - commonDialog.confirm({ - title: 'Commit to Compliance', - content: 'Are you sure to commit ' + $scope.partner.company_name + ' to compliance?', - choises: [ - {label: 'Submit', className: 'btn-success', key: 1}, - {label: 'Cancel', className: 'btn-warning', key: 0, dismiss: true} - ] - }).then(function (choice) { - if (choice == 1) { - $http.put('/sys/partners/' + $scope.partner.client_moniker + '/to_compliance', {}).then(function () { + $scope.commit2GreenChannel = function () { + commonDialog.confirm({ + title: 'Audit Partner', + content: 'Are you sure to mark partner ' + $scope.partner.company_name + ' Green Channel?' + }).then(function () { + $http.put('/sys/partners/' + $scope.partner.client_moniker + '/compliance/green_channel').then(function () { commonDialog.alert({ title: 'Success', - content: 'Commit to Compliance successfully', + content: 'Commit to Green Channel successfully', type: 'success' }); $state.reload(); }, function (resp) { commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); }) - } - }) - }; - $scope.commitToCardCompliance = function(){ - commonDialog.confirm({ - title: 'Commit to Compliance', - content: 'Are you sure to commit ' + $scope.partner.company_name + ' to compliance?', - choises: [ - {label: 'Submit', className: 'btn-success', key: 1}, - {label: 'Cancel', className: 'btn-warning', key: 0, dismiss: true} - ] - }).then(function (choice) { - if (choice == 1) { - $http.put('/sys/partners/' + $scope.partner.client_moniker + '/to_card_compliance', {}).then(function () { - commonDialog.alert({ - title: 'Success', - content: 'Commit to Compliance successfully', - type: 'success' - }); + }) + }; + + $scope.markAuditEmail = function () { + commonDialog.confirm({ + title: 'Warning', + content: 'Make sure you have send the email to client.' + }).then(function () { + $http.put('/sys/partners/' + $scope.partner.client_moniker + '/audit/email_sending_status').then(function () { $state.reload(); }, function (resp) { commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); }) - } - }) - } - $scope.apply2makeAgreeFile = function () { - if (!$scope.partner.enable_cross_payment) { - commonDialog.alert({ - title: 'Error!', - content: '请完善商户跨境支付基本信息、签约费率、合规文件!', - type: 'error' - }); - $state.go('partners.edit',{ - clientMoniker:$scope.partner.client_moniker, - commitCardPayment:false, - commitCrossBorderPayment:true}); - return; - } - $http.get('/sys/partners/' + $scope.partner.client_moniker + '/make_agree_file').then(function () { - commonDialog.alert({ - title: 'Success!', - content: '已提交制作合同!', - type: 'success' - }); + }) + }; + $scope.resendApproveEmail = function () { + commonDialog.confirm({ + title: 'Warning', + content: 'This operation will reset the password of admin user. Are you sure this email is correct ? Or you may update this information first.' + }).then(function () { + $http.put('/sys/partners/' + $scope.partner.client_moniker + '/audit/send_email').then(function () { + $state.reload(); + }, function (resp) { + commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); + }) + }) + }; + $scope.editBDUser = function () { + $uibModal.open({ + templateUrl: '/static/payment/partner/templates/bd_user_choose_dialog.html', + controller: 'partnerChooseBDUserDialogCtrl', + resolve: { + bdUsers: ['$http', function ($http) { + return $http.get('/sys/manager_accounts/roles/bd_user'); + }], + partner: function () { + return $scope.partner; + }, + type: function () { + return 'edit'; + } + } + }).result.then(function () { $state.reload(); - }, function (resp) { - commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); - } - ); - }; - - $scope.apply2makeCardAgreeFile = function () { - if (!$scope.partner.enable_card_payment) { - commonDialog.alert({ - title: 'Error!', - content: '请完善商户卡支付基本信息、签约费率、合规文件!', - type: 'error' - }); - $state.go('partners.edit',{ - clientMoniker:$scope.partner.client_moniker, - commitCardPayment:true, - commitCrossBorderPayment: false}); - return; - } - $http.get('/sys/partners/' + $scope.partner.client_moniker + '/make_card_agree_file').then(function () { - commonDialog.alert({ - title: 'Success!', - content: '已提交制作合同!', - type: 'success' - }); + }) + }; + $scope.bindBDUser = function () { + $uibModal.open({ + templateUrl: '/static/payment/partner/templates/bd_user_choose_dialog.html', + controller: 'partnerChooseBDUserDialogCtrl', + resolve: { + bdUsers: ['$http', function ($http) { + return $http.get('/sys/manager_accounts/roles/bd_user'); + }], + partner: function () { + return $scope.partner; + }, + type: function () { + return 'add'; + } + } + }).result.then(function () { $state.reload(); - }, function (resp) { - if (String(resp.data.message).match("No Rate Config")) { - commonDialog.alert({ - title: 'Error!', - content: '商户卡支付签约费率未配置,请添加商户卡支付签约费率!', - type: 'error' - }); - $state.go('partners.detail.rates', { - clientMoniker: $scope.partner.client_moniker - }); - }else { - commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); - } - } - ); - }; + }) + }; - $scope.commit2GreenChannel = function () { - commonDialog.confirm({ - title: 'Audit Partner', - content: 'Are you sure to mark partner ' + $scope.partner.company_name + ' Green Channel?' - }).then(function () { - $http.put('/sys/partners/' + $scope.partner.client_moniker + '/compliance/green_channel').then(function () { - commonDialog.alert({ - title: 'Success', - content: 'Commit to Green Channel successfully', - type: 'success' - }); - $state.reload(); - }, function (resp) { - commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); + $scope.configMasterMerchant = function () { + commonDialog.inputText({title: 'Input Master Merchant Code'}).then(function (text) { + $http.put('/sys/partners/' + $scope.partner.client_moniker + '/master_configuration', {master_merchant: text}).then(function () { + commonDialog.alert({ + title: 'Success', + content: "Master Merchant Code:" + text, + type: 'success' + }); + }, function (resp) { + commonDialog.alert({ + title: 'Config Master Merchant Failed', + content: resp.data.message, + type: 'error' + }); + }) }) + }; + $scope.getMerchantLocation = function () { + $http.get('/sys/partners/' + $scope.partner.client_moniker + '/location').then(function (resp) { + $scope.merchant_location = resp.data; + }); + }; + $scope.getMerchantLocation(); - }) - }; - $scope.markAuditEmail = function () { - commonDialog.confirm({ - title: 'Warning', - content: 'Make sure you have send the email to client.' - }).then(function () { - $http.put('/sys/partners/' + $scope.partner.client_moniker + '/audit/email_sending_status').then(function () { - $state.reload(); - }, function (resp) { - commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); - }) - }) - }; - $scope.resendApproveEmail = function () { - commonDialog.confirm({ - title: 'Warning', - content: 'This operation will reset the password of admin user. Are you sure this email is correct ? Or you may update this information first.' - }).then(function () { - $http.put('/sys/partners/' + $scope.partner.client_moniker + '/audit/send_email').then(function () { - $state.reload(); - }, function (resp) { - commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); - }) - }) - }; - $scope.editBDUser = function () { - $uibModal.open({ - templateUrl: '/static/payment/partner/templates/bd_user_choose_dialog.html', - controller: 'partnerChooseBDUserDialogCtrl', - resolve: { - bdUsers: ['$http', function ($http) { - return $http.get('/sys/manager_accounts/roles/bd_user'); - }], - partner: function () { - return $scope.partner; - }, - type: function () { - return 'edit'; - } + $scope.complianceCheck = function () { + if (!$rootScope.complianceCheck) { + $rootScope.complianceCheck = {}; } - }).result.then(function () { - $state.reload(); - }) - }; - $scope.bindBDUser = function () { - $uibModal.open({ - templateUrl: '/static/payment/partner/templates/bd_user_choose_dialog.html', - controller: 'partnerChooseBDUserDialogCtrl', - resolve: { - bdUsers: ['$http', function ($http) { - return $http.get('/sys/manager_accounts/roles/bd_user'); - }], - partner: function () { - return $scope.partner; - }, - type: function () { - return 'add'; + $rootScope.complianceCheck.client_id = $scope.partner.client_id; + $rootScope.complianceCheck.clientInfo = true; + }; + $scope.complianceChangeCheck = function () { + if ($rootScope.complianceCheck) { + if ($scope.partner.client_id != $rootScope.complianceCheck.client_id) { + delete $rootScope.complianceCheck; } } - }).result.then(function () { - $state.reload(); - }) - }; + }; + $scope.complianceChangeCheck(); + + $scope.changeWechatCompliance = function () { + if (!$scope.partner) { + return; + } + if (!$state.is('partners.detail')) { + $scope.init.wechat_compliance = false; + return; + } + if (!$scope.init.wechat_compliance) { + $scope.init.wechat_compliance = true; + return; + } + $http.put('/sys/partners/' + $scope.partner.client_moniker + '/wechat_compliance_permission', {allow: $scope.partner.wechat_compliance}).then(function () { - $scope.configMasterMerchant = function () { - commonDialog.inputText({title: 'Input Master Merchant Code'}).then(function (text) { - $http.put('/sys/partners/' + $scope.partner.client_moniker + '/master_configuration', {master_merchant: text}).then(function () { - commonDialog.alert({title: 'Success', content: "Master Merchant Code:" + text, type: 'success'}); }, function (resp) { commonDialog.alert({ - title: 'Config Master Merchant Failed', + title: 'failed to change wechat_compliance permission status', content: resp.data.message, type: 'error' - }); + }) }) - }) - }; - - $scope.getMerchantLocation = function () { - $http.get('/sys/partners/' + $scope.partner.client_moniker + '/location').then(function (resp) { - $scope.merchant_location = resp.data; - }); - }; - $scope.getMerchantLocation(); - - - $scope.complianceCheck = function () { - if (!$rootScope.complianceCheck) { - $rootScope.complianceCheck = {}; - } - $rootScope.complianceCheck.client_id = $scope.partner.client_id; - $rootScope.complianceCheck.clientInfo = true; - }; - $scope.complianceChangeCheck = function () { - if ($rootScope.complianceCheck) { - if ($scope.partner.client_id != $rootScope.complianceCheck.client_id) { - delete $rootScope.complianceCheck; + }; + $scope.changeLocalMerchant = function () { + if (!$scope.partner) { + return; } - } - }; - $scope.complianceChangeCheck(); - - $scope.changeWechatCompliance = function () { - if (!$scope.partner) { - return; - } - if (!$state.is('partners.detail')) { - $scope.init.wechat_compliance = false; - return; - } - if (!$scope.init.wechat_compliance) { - $scope.init.wechat_compliance = true; - return; - } - $http.put('/sys/partners/' + $scope.partner.client_moniker + '/wechat_compliance_permission', {allow: $scope.partner.wechat_compliance}).then(function () { - - }, function (resp) { - commonDialog.alert({ - title: 'failed to change wechat_compliance permission status', - content: resp.data.message, - type: 'error' - }) - }) - }; - $scope.changeLocalMerchant = function () { - if (!$scope.partner) { - return; - } - if (!$state.is('partners.detail')) { - $scope.init.local_merchant = false; - return; - } - if (!$scope.init.local_merchant) { - $scope.init.local_merchant = true; - return; - } - $http.put('/sys/partners/' + $scope.partner.client_moniker + '/local_merchant_permission', {allow: $scope.partner.local_merchant}).then(function () { + if (!$state.is('partners.detail')) { + $scope.init.local_merchant = false; + return; + } + if (!$scope.init.local_merchant) { + $scope.init.local_merchant = true; + return; + } + $http.put('/sys/partners/' + $scope.partner.client_moniker + '/local_merchant_permission', {allow: $scope.partner.local_merchant}).then(function () { - }, function (resp) { - commonDialog.alert({ - title: 'failed to change local_merchant permission status', - content: resp.data.message, - type: 'error' + }, function (resp) { + commonDialog.alert({ + title: 'failed to change local_merchant permission status', + content: resp.data.message, + type: 'error' + }) }) - }) - }; + }; - $scope.removeSub = function () { - $http.delete('/sys/partners/unsub/' + $scope.partner.client_moniker).then(function (resp) { - $state.reload(); - }); - }; - $scope.addSub = function () { - $http.put('/sys/partners/unsub/' + $scope.partner.client_moniker).then(function (resp) { - $state.reload(); - }); - }; - }]); + $scope.removeSub = function () { + $http.delete('/sys/partners/unsub/' + $scope.partner.client_moniker).then(function (resp) { + $state.reload(); + }); + }; + $scope.addSub = function () { + $http.put('/sys/partners/unsub/' + $scope.partner.client_moniker).then(function (resp) { + $state.reload(); + }); + }; + }]); app.controller('partnerPaymentInfoCtrl', ['$scope', '$http', '$state', 'commonDialog', '$uibModal', '$sce', function ($scope, $http, $state, commonDialog, $uibModal, $sce) { $scope.convertExtParams = []; $scope.copyHfLink = function () { @@ -1197,7 +1589,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $http.get('/sys/partners/' + $scope.partner.client_moniker).then(function (resp) { $scope.extParams = {}; $scope.paymentInfo = resp.data; - $scope.extParams = $scope.paymentInfo.ext_params?JSON.parse($scope.paymentInfo.ext_params):null; + $scope.extParams = $scope.paymentInfo.ext_params ? JSON.parse($scope.paymentInfo.ext_params) : null; $scope.convertExtParams = $scope.extParamsEditFlags() $scope.ctrl.editSubMerchant = false; $scope.ctrl.editAliSubMerchant = false; @@ -1207,17 +1599,17 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.ctrl.editRefundCreditLine = false; }) }; - $scope.extParamsEditFlags = function(){ + $scope.extParamsEditFlags = function () { var paramList = [] - if($scope.extParams != null){ - for(var key in $scope.extParams){ + if ($scope.extParams != null) { + for (var key in $scope.extParams) { var obj = {} - if(typeof $scope.extParams[key] != 'boolean'){ + if (typeof $scope.extParams[key] != 'boolean') { obj.name = key; obj.value = $scope.extParams[key]; obj.type = 'string'; - obj.flag =false; - }else{ + obj.flag = false; + } else { obj.name = key; obj.value = $scope.extParams[key]; obj.type = 'boolean' @@ -1934,7 +2326,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }) }; - $scope.changeBillCodeVersion = function() { + $scope.changeBillCodeVersion = function () { if (!$scope.paymentInfo) { return; } @@ -1949,15 +2341,18 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }) }; - $scope.extChangeParam = function(name,value){ + $scope.extChangeParam = function (name, value) { var flag = true; $scope.convertExtParams.forEach(function (params) { - if(params.name == name && value=='' && params.type == 'string'){ - flag = false; + if (params.name == name && value == '' && params.type == 'string') { + flag = false; } }) - if(flag){ - $http.put('/sys/partners/' + $scope.partner.client_moniker + '/ext_config',{key:name,value:value}).then(function () { + if (flag) { + $http.put('/sys/partners/' + $scope.partner.client_moniker + '/ext_config', { + key: name, + value: value + }).then(function () { $scope.loadPartnerPaymentInfo(); }) } @@ -1993,7 +2388,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.loadSubClients = function (page) { var params = {}; params.page = page || $scope.pagination.page || 1; - $http.get('/sys/partners/' + $scope.partner.client_moniker + '/sub_clients/page',{params : params}).then(function (resp) { + $http.get('/sys/partners/' + $scope.partner.client_moniker + '/sub_clients/page', {params: params}).then(function (resp) { $scope.subPartners = resp.data.data; $scope.pagination = resp.data.pagination; }); @@ -2053,7 +2448,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }]); - app.controller('partnerRatesCtrl', ['$scope', '$rootScope', '$http', '$uibModal', 'commonDialog', '$sce','$state', function ($scope, $rootScope, $http, $uibModal, commonDialog, $sce,$state) { + app.controller('partnerRatesCtrl', ['$scope', '$rootScope', '$http', '$uibModal', 'commonDialog', '$sce', '$state', function ($scope, $rootScope, $http, $uibModal, commonDialog, $sce, $state) { $scope.bankCtrl = {edit: true, rate_name: 'Wechat'}; $scope.init = { skip_clearing: false, @@ -2301,6 +2696,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.getRates(); }); }; + $scope.complianceCheck = function () { if (!$rootScope.complianceCheck) { $rootScope.complianceCheck = {}; @@ -2383,7 +2779,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter if ($scope.card_payment_normal) { $scope.cardRateConfig = $scope.card_payment[0]; $scope.card_payment_switch_title = "Direct Debit"; - }else { + } else { $scope.cardRateConfig = $scope.card_payment[1]; $scope.card_payment_switch_title = "Card Payment"; } @@ -2740,9 +3136,9 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter // $scope.t2city_map = angular.copy(t2city_map); $scope.partner.sameAsContactPerson = false; - $scope.checkboxOnclick = function (){ + $scope.checkboxOnclick = function () { $scope.partner.sameAsContactPerson = !($scope.partner.sameAsContactPerson); - if($scope.partner.sameAsContactPerson) { + if ($scope.partner.sameAsContactPerson) { $scope.partner.legal_representative_person = $scope.partner.contact_person; $scope.partner.legal_representative_phone_a = $scope.partner.contact_phone_a; $scope.partner.legal_representative_phone_c = $scope.partner.contact_phone_c; @@ -2755,9 +3151,9 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.partner.marketingSameAsContact = false; - $scope.checkMarketingSameAsContact = function (){ + $scope.checkMarketingSameAsContact = function () { $scope.partner.marketingSameAsContact = !($scope.partner.marketingSameAsContact); - if($scope.partner.marketingSameAsContact) { + if ($scope.partner.marketingSameAsContact) { $scope.partner.marketing_person = $scope.partner.contact_person; $scope.partner.marketing_phone_a = $scope.partner.contact_phone_a; $scope.partner.marketing_phone_c = $scope.partner.contact_phone_c; @@ -2768,10 +3164,10 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter } } - $scope.partner.sameAsAddress=false; - $scope.sameAddress = function (){ - $scope.partner.sameAsAddress=!($scope.partner.sameAsAddress); - if($scope.partner.sameAsAddress) { + $scope.partner.sameAsAddress = false; + $scope.sameAddress = function () { + $scope.partner.sameAsAddress = !($scope.partner.sameAsAddress); + if ($scope.partner.sameAsAddress) { $scope.partner.registered_address = $scope.partner.address; $scope.partner.registered_suburb = $scope.partner.suburb; $scope.partner.registered_postcode = $scope.partner.postcode; @@ -2822,8 +3218,8 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter } $scope.partner.company_phone = '+' + $scope.partner.company_phone_c + ($scope.partner.company_phone_a || '') + $scope.partner.company_phone_p; $scope.partner.contact_phone = '+' + $scope.partner.contact_phone_c + ($scope.partner.contact_phone_a || '') + $scope.partner.contact_phone_p; - $scope.partner.legal_representative_phone = '+' + $scope.partner.legal_representative_phone_c + ( $scope.partner.legal_representative_phone_a || '') + $scope.partner.legal_representative_phone_p; - $scope.partner.marketing_phone = '+' + $scope.partner.marketing_phone_c + ( $scope.partner.marketing_phone_a || '') + $scope.partner.marketing_phone_p; + $scope.partner.legal_representative_phone = '+' + $scope.partner.legal_representative_phone_c + ($scope.partner.legal_representative_phone_a || '') + $scope.partner.legal_representative_phone_p; + $scope.partner.marketing_phone = '+' + $scope.partner.marketing_phone_c + ($scope.partner.marketing_phone_a || '') + $scope.partner.marketing_phone_p; if ($scope.partner.company_phone.indexOf(' ') != -1) { alert('Company Phone can not contain space character'); @@ -3033,25 +3429,25 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter params.dateto = $filter('date')(params.dateto, 'yyyyMMdd'); } params.page = page || $scope.pagination.page || 1; - if(params.gateway){ - if((params.gateway.sort().toString()!=[0,1].toString()) && (params.gateway.sort().toString()!=[5,6].toString())){ + if (params.gateway) { + if ((params.gateway.sort().toString() != [0, 1].toString()) && (params.gateway.sort().toString() != [5, 6].toString())) { delete params.gatewayChilds; delete params.gatewayChild; } - if(params.gatewayChilds){ + if (params.gatewayChilds) { var exist = false params.gatewayChilds.forEach(function (child) { - if(child==params.gatewayChild){ + if (child == params.gatewayChild) { exist = true } }) - if(!exist){ + if (!exist) { params.gatewayChild = null } - }else{ + } else { delete params.gatewayChild; } - }else{ + } else { delete params.gatewayChilds; delete params.gatewayChild; } @@ -3065,9 +3461,9 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }); }; - $scope.initGatewayChild = function(){ + $scope.initGatewayChild = function () { $scope.params.gatewayChilds = $scope.params.gateway; - $scope.params.gatewayChild=null; + $scope.params.gatewayChild = null; $scope.loadTradeLogs(1); } $scope.gatewaySelected = function (arr) { @@ -3129,7 +3525,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter } $scope.loadTradeLogs(); }; - $scope.searchSubClients = function (subSearchText,page) { + $scope.searchSubClients = function (subSearchText, page) { $scope.subClientTable1 = [$scope.partner]; $scope.subClientTable2 = []; var params = {}; @@ -3138,13 +3534,13 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.subSearchText = subSearchText; params.searchText = subSearchText; } - $http.get('/sys/partners/' + $scope.partner.client_moniker + '/sub_clients/page',{params: params}).then(function (resp) { + $http.get('/sys/partners/' + $scope.partner.client_moniker + '/sub_clients/page', {params: params}).then(function (resp) { var clientList = resp.data.data; $scope.subClientPagination = resp.data.pagination; clientList.forEach(function (client) { if ($scope.subClientTable1.length < 11) { $scope.subClientTable1.push(client); - }else { + } else { $scope.subClientTable2.push(client); } $scope.clients.push(client); @@ -3153,7 +3549,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }; if ($scope.partner.has_children && !$scope.partner.hide_sub_mch) { - $scope.searchSubClients('',1); + $scope.searchSubClients('', 1); $scope.loadTradeLogs(1); } else { $scope.loadTradeLogs(1); @@ -3518,9 +3914,9 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.listRedpackLogs(1); }]); app.controller('partnerAuthFileCtrl', ['$scope', '$http', '$rootScope', 'commonDialog', '$state', function ($scope, $http, $rootScope, commonDialog, $state) { - if ($state.params.commitType=='card-payment'){ + if ($state.params.commitType == 'card-payment') { $state.go('partners.detail.files.MW_files'); - }else { + } else { $state.go('partners.detail.files.CP_files'); } }]); @@ -3731,7 +4127,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter commonDialog.alert({title: 'Error', content: '请选择ID Type', type: 'error'}); return; } - if ($scope.file.beneficiary_id_title!="Ultimate beneficiary owner") { + if ($scope.file.beneficiary_id_title != "Ultimate beneficiary owner") { if (!$scope.file.other_id_title_desc) { commonDialog.alert({title: 'Error', content: '请简要告知为何无法提供受益股东的资料', type: 'error'}); return; @@ -3752,7 +4148,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.cancelIdInfo = function () { $state.reload(); - $scope.id_info_form.edit=false + $scope.id_info_form.edit = false }; $scope.downloadAsZip = function () { @@ -4119,7 +4515,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.cancelIdInfo = function () { $state.reload(); - $scope.id_info_form.edit=false + $scope.id_info_form.edit = false }; $scope.downloadAsZip = function () { @@ -4134,8 +4530,10 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter content: 'Upload Successful', type: 'success' }); - $state.go('partners.detail.files',{clientMoniker:$scope.partner.client_moniker, - commitType: "card-payment"}, {reload: true}); + $state.go('partners.detail.files', { + clientMoniker: $scope.partner.client_moniker, + commitType: "card-payment" + }, {reload: true}); }, function (resp) { commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); }) @@ -4155,19 +4553,19 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $rootScope.complianceCheck.authFile = true; $rootScope.complianceCheck.client_id = $scope.partner.client_id; - if($scope.file.upay_application_form==null || $scope.file.upay_application_form ==''){ + if ($scope.file.upay_application_form == null || $scope.file.upay_application_form == '') { commonDialog.alert({type: 'error', title: 'Error', content: '请补充商户申请表合规文件'}) $rootScope.complianceCheck.authFile = false; - }else if($scope.file.client_bank_file==null || $scope.file.client_bank_file ==''){ + } else if ($scope.file.client_bank_file == null || $scope.file.client_bank_file == '') { commonDialog.alert({type: 'error', title: 'Error', content: '请补六个月银行对账单合规文件'}) $rootScope.complianceCheck.authFile = false; - }else if($scope.file.client_company_file==null || $scope.file.client_company_file ==''){ + } else if ($scope.file.client_company_file == null || $scope.file.client_company_file == '') { commonDialog.alert({type: 'error', title: 'Error', content: '请补充当前公司信息摘录合规文件'}) $rootScope.complianceCheck.authFile = false; - }else if($scope.file.upay_driver_license==null || $scope.file.upay_driver_license ==''){ + } else if ($scope.file.upay_driver_license == null || $scope.file.upay_driver_license == '') { commonDialog.alert({type: 'error', title: 'Error', content: '请补充法人身份证明合规文件'}) $rootScope.complianceCheck.authFile = false; - } else if($scope.file.kyc_utility_bill_file==null || $scope.file.kyc_utility_bill_file ==''){ + } else if ($scope.file.kyc_utility_bill_file == null || $scope.file.kyc_utility_bill_file == '') { commonDialog.alert({type: 'error', title: 'Error', content: '请补充家庭住址证明 (一个水电煤网账单)合规文件'}) $rootScope.complianceCheck.authFile = false; } @@ -4306,10 +4704,10 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter } }; -/* $scope.downloadAsZip = function () { - var url = '/sys/partners/' + $scope.partner.client_moniker + '/download/complianceAsZIP'; - return url; - };*/ + /* $scope.downloadAsZip = function () { + var url = '/sys/partners/' + $scope.partner.client_moniker + '/download/complianceAsZIP'; + return url; + };*/ $scope.deleteComplianceFiles = function (file_id) { commonDialog.confirm({ @@ -4377,7 +4775,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.isAll = true; $scope.more20ChoseSubClient = false; $scope.choseSubClientNow = 'More'; - $scope.searchSubClients = function (subSearchText,page) { + $scope.searchSubClients = function (subSearchText, page) { $scope.subClientTable1 = [$scope.partner]; $scope.subClientTable2 = []; @@ -4387,31 +4785,31 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.subSearchText = subSearchText; params.searchText = subSearchText; } - $http.get('/sys/partners/' + $scope.partner.client_moniker + '/sub_clients/page',{params: params}).then(function (resp) { + $http.get('/sys/partners/' + $scope.partner.client_moniker + '/sub_clients/page', {params: params}).then(function (resp) { var clientList = resp.data.data; $scope.subClientPagination = resp.data.pagination; clientList.forEach(function (client) { if ($scope.subClientTable1.length < 11) { $scope.subClientTable1.push(client); - }else { + } else { $scope.subClientTable2.push(client); } $scope.clients.push(client); }); }); }; - $scope.initClientInfo = function(){ - $http.get('/sys/partners/'+clientMoniker).then(function (resp) { + $scope.initClientInfo = function () { + $http.get('/sys/partners/' + clientMoniker).then(function (resp) { $scope.client = resp.data; $scope.clients = [$scope.client]; if ($scope.client.has_children && !$scope.client.hide_sub_mch) { - $scope.searchSubClients('',1); + $scope.searchSubClients('', 1); $scope.params.dateto = new Date(); var day = new Date(); day.setDate(day.getDate() - 7); $scope.params.datefrom = day; $scope.chooseClient('all'); - }else { + } else { $scope.params.dateto = new Date(); var day = new Date(); day.setDate(day.getDate() - 7); @@ -4422,9 +4820,9 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter } $scope.initClientInfo(); - $scope.exportSettlementLogs = function() { + $scope.exportSettlementLogs = function () { var params = angular.copy($scope.params); - var url = '/sys/partners/'+clientMoniker+'/lists_settlements/excel'; + var url = '/sys/partners/' + clientMoniker + '/lists_settlements/excel'; var connectSymbol = '?'; if (params.datefrom) { params.datefrom = $filter('date')(params.datefrom, 'yyyyMMdd'); @@ -4435,7 +4833,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter params.dateto = $filter('date')(params.dateto, 'yyyyMMdd'); url += connectSymbol + 'dateto=' + params.dateto; } - if (params.client_ids && !$scope.isAll){ + if (params.client_ids && !$scope.isAll) { params.client_ids.forEach(function (i) { url += connectSymbol + 'client_ids=' + i; connectSymbol = '&'; @@ -4652,7 +5050,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }; $scope.channelAndDayOfAnalysis(1); }]); - app.controller('managerSettlementDetailOfMergeSettleCtrl', ['$scope', 'detail','client_id','$http', function ($scope, detail,client_id,$http) { + app.controller('managerSettlementDetailOfMergeSettleCtrl', ['$scope', 'detail', 'client_id', '$http', function ($scope, detail, client_id, $http) { $scope.ctrl = {channel: null}; $scope.show = true; $scope.report = detail.data; @@ -4805,21 +5203,21 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.applyMWSubMerchantId = function () { $http.get('/sys/partners/' + $scope.partner.client_moniker + '/query/mw_info').then(function (resp) { commonDialog.confirm({ - title: 'Apply Merchant Warrior Sub Merchant Id', - contentHtml: $sce.trustAsHtml('Are you sure to apply merchant Warrior sub merchant id for [' + $scope.partner.company_name + ']?'), - json: resp.data - }).then(function () { - $http.put('/sys/partners/' + $scope.partner.client_moniker + '/applyMWMerchantId').then(function (res) { - commonDialog.alert({ - title: 'Success', - content: 'Apply Merchant Warrior Sub Merchant ID successfully', - type: 'success' - }); - $scope.partner.cardInfo = res.data; - }, function (resp) { - commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); + title: 'Apply Merchant Warrior Sub Merchant Id', + contentHtml: $sce.trustAsHtml('Are you sure to apply merchant Warrior sub merchant id for [' + $scope.partner.company_name + ']?'), + json: resp.data + }).then(function () { + $http.put('/sys/partners/' + $scope.partner.client_moniker + '/applyMWMerchantId').then(function (res) { + commonDialog.alert({ + title: 'Success', + content: 'Apply Merchant Warrior Sub Merchant ID successfully', + type: 'success' + }); + $scope.partner.cardInfo = res.data; + }, function (resp) { + commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); + }) }) - }) }); }; $scope.applyRpaySubMerchantId = function () { @@ -5680,48 +6078,45 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }; }]); - app.controller('incrementalServiceCtrl',['$scope', '$http', '$uibModal', '$state', '$filter', 'commonDialog',function($scope, $http, $uibModal, $state, $filter, commonDialog){ + app.controller('incrementalServiceCtrl', ['$scope', '$http', '$uibModal', '$state', '$filter', 'commonDialog', function ($scope, $http, $uibModal, $state, $filter, commonDialog) { $scope.serviceAll = {}; - $scope.channelOptions=[]; - $scope.initData = function(){ - $http.get('/sys/partners/' + $scope.partner.client_moniker+'/incremental_service').then(function(res){ + $scope.channelOptions = []; + $scope.initData = function () { + $http.get('/sys/partners/' + $scope.partner.client_moniker + '/incremental_service').then(function (res) { $scope.serviceAll = res.data.all_service; - $scope.serviceAll.forEach(function(service){ - service.logo_url = '/static/images/'+service.channel+'.jpg' - service.logo_url = $scope.CheckImgExists(service.logo_url)?service.logo_url:'/static/images/royalpay_sign.png' + $scope.serviceAll.forEach(function (service) { + service.logo_url = '/static/images/' + service.channel + '.jpg' + service.logo_url = $scope.CheckImgExists(service.logo_url) ? service.logo_url : '/static/images/royalpay_sign.png' }) - $scope.channelOptions=res.data.incremental_channel; + $scope.channelOptions = res.data.incremental_channel; }) } - $scope.CheckImgExists =function (url) { - var xmlHttp ; - if (window.ActiveXObject) - { - xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); - } - else if (window.XMLHttpRequest) - { - xmlHttp = new XMLHttpRequest(); - } - xmlHttp.open("Get",url,false); - xmlHttp.send(); - if(xmlHttp.status==404) - return false; - else - return true; + $scope.CheckImgExists = function (url) { + var xmlHttp; + if (window.ActiveXObject) { + xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); + } else if (window.XMLHttpRequest) { + xmlHttp = new XMLHttpRequest(); + } + xmlHttp.open("Get", url, false); + xmlHttp.send(); + if (xmlHttp.status == 404) + return false; + else + return true; } $scope.initData(); - $scope.newServiceChannelDialog = function (){ + $scope.newServiceChannelDialog = function () { $uibModal.open({ templateUrl: '/static/payment/partner/templates/incremental_service_dialog.html', controller: 'incrementalServiceDialogCtrl', resolve: { - params: function(){ + params: function () { return { - isCreate:true, - clientMoniker:$scope.partner.client_moniker, - channelOptions:$scope.channelOptions, - serviceChannel:null + isCreate: true, + clientMoniker: $scope.partner.client_moniker, + channelOptions: $scope.channelOptions, + serviceChannel: null } } } @@ -5729,17 +6124,17 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.initData(); }); } - $scope.editServiceChannelDialog = function (serviceChannel){ + $scope.editServiceChannelDialog = function (serviceChannel) { $uibModal.open({ templateUrl: '/static/payment/partner/templates/incremental_service_dialog.html', controller: 'incrementalServiceDialogCtrl', resolve: { - params: function(){ + params: function () { return { - isCreate:false, - clientMoniker:$scope.partner.client_moniker, - channelOptions:$scope.channelOptions, - serviceChannel:serviceChannel + isCreate: false, + clientMoniker: $scope.partner.client_moniker, + channelOptions: $scope.channelOptions, + serviceChannel: serviceChannel } } } @@ -5747,9 +6142,9 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.initData(); }); } - $scope.updateStatus = function(service){ + $scope.updateStatus = function (service) { commonDialog.confirm({ - title: 'Update '+service.channel+ ' Incremental Service Status', + title: 'Update ' + service.channel + ' Incremental Service Status', content: 'Are you sure update ' + service.channel + ' status?', choises: [ {label: 'Submit', className: 'btn-success', key: 1}, @@ -5758,14 +6153,14 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }).then(function (choice) { if (choice == 1) { service.is_valid = !service.is_valid; - $http.put('/sys/partners/'+$scope.partner.client_moniker+'/incremental_service/status',service).then(function(res){ + $http.put('/sys/partners/' + $scope.partner.client_moniker + '/incremental_service/status', service).then(function (res) { commonDialog.alert({ title: 'Success', content: 'Update Service Successful!', type: 'success' }); $scope.initData(); - },function (resp) { + }, function (resp) { commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); $scope.initData(); }) @@ -5774,21 +6169,21 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter } }]); - app.controller('incrementalServiceDialogCtrl',['$scope','$http','params','commonDialog',function($scope ,$http,params,commonDialog){ - $scope.model ={}; + app.controller('incrementalServiceDialogCtrl', ['$scope', '$http', 'params', 'commonDialog', function ($scope, $http, params, commonDialog) { + $scope.model = {}; $scope.ctrl = {sending: false}; - $scope.isCreate = true; - $scope.initData =function(){ + $scope.isCreate = true; + $scope.initData = function () { $scope.isCreate = angular.copy(params.isCreate); - if($scope.isCreate){ - $scope.model.channel= angular.copy(params.channelOptions[0]) - $scope.model.channelOptions= angular.copy(params.channelOptions) - }else{ + if ($scope.isCreate) { + $scope.model.channel = angular.copy(params.channelOptions[0]) + $scope.model.channelOptions = angular.copy(params.channelOptions) + } else { $scope.model = angular.copy(params.serviceChannel); } } $scope.initData(); - $scope.save = function(form){ + $scope.save = function (form) { if (form.$invalid) { angular.forEach(form, function (item, key) { if (key.indexOf('$') < 0) { @@ -5798,15 +6193,15 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter return; } $scope.ctrl.sending = true; - $http.post('/sys/partners/'+params.clientMoniker+'/incremental_service',$scope.model).then(function(res){ + $http.post('/sys/partners/' + params.clientMoniker + '/incremental_service', $scope.model).then(function (res) { commonDialog.alert({ title: 'Success', - content: $scope.isCreate?'Create Service Successful!':'Update Service Successful!', + content: $scope.isCreate ? 'Create Service Successful!' : 'Update Service Successful!', type: 'success' }); $scope.ctrl.sending = false; $scope.$close(); - },function (resp) { + }, function (resp) { $scope.ctrl.sending = false; commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); }) diff --git a/src/main/ui/static/payment/partner/templates/add_partner.html b/src/main/ui/static/payment/partner/templates/add_partner.html index 952266506..c51dcc45f 100644 --- a/src/main/ui/static/payment/partner/templates/add_partner.html +++ b/src/main/ui/static/payment/partner/templates/add_partner.html @@ -1317,13 +1317,13 @@ diff --git a/src/main/ui/static/payment/partner/templates/partner_bankaccounts.html b/src/main/ui/static/payment/partner/templates/partner_bankaccounts.html index 29eb38502..949c9ecad 100644 --- a/src/main/ui/static/payment/partner/templates/partner_bankaccounts.html +++ b/src/main/ui/static/payment/partner/templates/partner_bankaccounts.html @@ -1,5 +1,5 @@