Merge remote-tracking branch 'origin/develop' into develop

master
yixian 5 years ago
commit a48446e302

@ -5,12 +5,12 @@
<parent>
<groupId>au.com.royalpay.payment</groupId>
<artifactId>payment-parent</artifactId>
<version>1.0.11</version>
<version>1.0.13</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId>
<version>1.1.30</version>
<version>1.1.31</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

@ -10,7 +10,9 @@ import au.com.royalpay.payment.tools.merchants.beans.QRCodeConfig;
import au.com.royalpay.payment.tools.merchants.beans.UpdateSurchargeDTO;
import com.alibaba.fastjson.JSONObject;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
@ -194,5 +196,17 @@ public interface RetailAppService {
JSONObject toggleCBBankCustomerSurcharge(JSONObject device, boolean customerSurcharge);
JSONObject getClientAuthFileStatus(JSONObject device);
void getCBBankAggregateFile(JSONObject device, HttpServletResponse httpResponse);
JSONObject getSourceAggregateFile(JSONObject device);
JSONObject getClientAggregateFile(JSONObject device, MultipartFile file) throws IOException;
List<JSONObject> uploadGreenChannelAuthFiles(JSONObject device, ClientAuthFilesInfo filesInfo);
void deleteGreenChannelAuthFiles(JSONObject device, String filesInfo);
void commitAuthFilesToCompliance(JSONObject device);
}

@ -42,6 +42,7 @@ import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery;
import au.com.royalpay.payment.manage.tradelog.core.TradeLogService;
import au.com.royalpay.payment.manage.tradelog.refund.RefundService;
import au.com.royalpay.payment.tools.cms.RoyalPayCMSSupport;
import au.com.royalpay.payment.tools.connections.attachment.core.AttachmentClient;
import au.com.royalpay.payment.tools.device.DeviceSupport;
import au.com.royalpay.payment.tools.device.message.AppMessage;
import au.com.royalpay.payment.tools.device.message.AppMsgSender;
@ -67,6 +68,7 @@ import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import com.github.qcloudsms.httpclient.HTTPException;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.RandomUtils;
@ -82,12 +84,12 @@ import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
import org.springframework.web.multipart.MultipartFile;
import org.thymeleaf.context.Context;
import org.thymeleaf.spring4.SpringTemplateEngine;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.awt.image.BufferedImage;
import java.io.*;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DateFormat;
@ -201,8 +203,13 @@ public class RetailAppServiceImp implements RetailAppService {
@Resource
private SpringTemplateEngine thymeleaf;
@Resource
private AttachmentClient attachmentClient;
@Resource
private ClientBankAccountMapper clientBankAccountMapper;
@Resource
private StringRedisTemplate stringRedisTemplate;
private final String CBBANK_AGGREGATE_FILE = "https://file.royalpay.com.au/open/2019/08/05/1564972204689_uwZvpTBjtLUMcN8c540xcZvux1Rd3O.pdf";
private final String IMG_AGGREGATE_FILE = "https://file.royalpay.com.au/open/2019/08/22/1566440384256_R7Jc3cl5JPZsmVznKffzStwVMELwsl.pdf";
@Resource
private SmsSender smsSender;
@ -2219,10 +2226,136 @@ public class RetailAppServiceImp implements RetailAppService {
client.put("bank_account_number", bankAccount.getString("account_no"));
client.put("bank_account_name", bankAccount.getString("account_name"));
}
exportAggregateFile(client, httpResponse);
exportCBBankAggregateFile(client, httpResponse);
}
@Override
public JSONObject getClientAuthFileStatus(JSONObject device) {
String clientType = device.getString("client_type");
deviceSupport.findRegister(clientType);
JSONObject client = clientMapper.findClient(device.getIntValue("client_id"));
JSONObject account = clientAccountMapper.findById(device.getString("account_id"));
if (PartnerRole.getRole(account.getIntValue("role")) == PartnerRole.CASHIER) {
JSONObject cashierResult = new JSONObject();
cashierResult.put("client_less_file", false);
return cashierResult;
}
return signInAccountService.checkAuthFileStatus(client);
}
private void exportAggregateFile(JSONObject client, HttpServletResponse httpResponse) {
@Override
public JSONObject getSourceAggregateFile(JSONObject device) {
String clientType = device.getString("client_type");
deviceSupport.findRegister(clientType);
JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id"));
String address = client.getString("address").trim();
if (address.contains(",")) {
client.put("address", address.substring(0, address.lastIndexOf(",")).trim());
client.put("address_sub", address.substring(address.lastIndexOf(",") + 1).trim());
}
if (client.getString("acn") != null && !client.getString("acn").equals("")) {
client.put("acn_type", "ACN: (" + client.getString("acn") + ")");
client.put("company_name_acn", client.getString("company_name") + " (ACN " + client.getString("acn") + ")");
} else {
client.put("acn_type", "ABN: (" + client.getString("abn") + ")");
client.put("company_name_acn", client.getString("company_name") + " (ABN " + client.getString("abn") + ")");
}
JSONObject weChatRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Wechat");
if (weChatRate == null) {
throw new BadRequestException("The Partner's Rate is not config!");
}
client.put("wechat_rate", weChatRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN));
client.put("clean", "T+" + weChatRate.getString("clean_days"));
client.put("clean_days", weChatRate.getString("clean_days"));
try {
JSONObject alipayRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Alipay");
if (alipayRate != null) {
client.put("alipay_rate", alipayRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN));
}
JSONObject bestPayRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Bestpay");
if (bestPayRate != null) {
client.put("bestpay_rate", bestPayRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN));
}
JSONObject jdRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "jd");
if (jdRate != null) {
client.put("jd_rate", jdRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN));
}
JSONObject alipayOnlineRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "AlipayOnline");
if (alipayOnlineRate != null) {
client.put("alipay_online_rate", alipayOnlineRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN));
}
JSONObject cbBankPayRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "CB_BankPay");
if (cbBankPayRate != null) {
client.put("cbbank_rate", cbBankPayRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN));
}
} catch (Exception ignored) {
throw new BadRequestException("Merchant Rate Not Configure");
}
JSONObject bankAccount = getBankAccountByClientId(client.getIntValue("client_id"));
if (bankAccount == null || bankAccount.size() <= 0) {
throw new BadRequestException("The Partner's Account is not config!");
}
client.put("bank", bankAccount.getString("bank"));
client.put("bsb_no", bankAccount.getString("bsb_no"));
client.put("account_no", bankAccount.getString("account_no"));
client.put("account_name", bankAccount.getString("account_name"));
String start_date = DateFormatUtils.format(new Date(), "dd/MM/yyyy");
client.put("start_date", start_date);
Date endDate = TimeZoneUtils.nextYearByCurrDay();
String end_date = DateFormatUtils.format(endDate, "dd/MM/yyyy");
client.put("end_date", end_date);
return exportClientAggregateFile(client);
}
@Override
public JSONObject getClientAggregateFile(JSONObject device,MultipartFile file) throws IOException{
String clientType = device.getString("client_type");
deviceSupport.findRegister(clientType);
if (StringUtils.isBlank(file.getOriginalFilename())) {
throw new BadRequestException("Please Enter Full Name");
}
JSONObject account = clientAccountMapper.findById(device.getString("account_id"));
return clientManager.getClientAggregateFile(account, file);
}
@Override
public List<JSONObject> uploadGreenChannelAuthFiles(JSONObject device, ClientAuthFilesInfo clientAuthFilesInfo) {
String clientType = device.getString("client_type");
deviceSupport.findRegister(clientType);
JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id"));
JSONObject account = clientAccountMapper.findById(device.getString("account_id"));
clientAuthFilesInfo.setAuthStatus(0);
clientAuthFilesInfo.setFile_agreement_info(null);
clientAuthFilesInfo.setFile_apply_info(null);
return clientManager.uploadAuthFilesForWaitCompliance(account, client.getString("client_moniker"), clientAuthFilesInfo);
}
@Override
public void deleteGreenChannelAuthFiles(JSONObject device, String fileId) {
String clientType = device.getString("client_type");
deviceSupport.findRegister(clientType);
clientManager.deleteAuthFiles(fileId);
}
@Override
public void commitAuthFilesToCompliance(JSONObject device) {
String clientType = device.getString("client_type");
deviceSupport.findRegister(clientType);
JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id"));
JSONObject account = clientAccountMapper.findById(device.getString("account_id"));
clientManager.commitAuthFilesToCompliance(client.getString("client_moniker"), account,"App");
}
private void exportCBBankAggregateFile(JSONObject client, HttpServletResponse httpResponse) {
httpResponse.setContentType("application/pdf");
httpResponse.setHeader("content-disposition", "attachment;filename=" + client.getString("client_moniker") + "_AGREEMENT_" + new Date() + ".pdf");
ServletOutputStream sos = null;
@ -2240,6 +2373,24 @@ public class RetailAppServiceImp implements RetailAppService {
}
}
private JSONObject exportClientAggregateFile(JSONObject client) {
InputStream stream = null;
JSONObject result = new JSONObject();
try {
PdfUtils pdu = new PdfUtils();
pdu.setTemplatePdfPath(IMG_AGGREGATE_FILE);
pdu.setPdfTemplate(client);
File file = new File(client.getString("client_moniker") + "_agreement.pdf");
ByteArrayOutputStream bos = pdu.templetPdfBos(file);
stream = new ByteArrayInputStream(bos.toByteArray());
JSONObject fileInfo = attachmentClient.uploadFile(stream, client.getString("client_moniker") + "_" + System.currentTimeMillis() + "_agreement_source.pdf", false);
result.put("file_value", fileInfo.getString("url"));
} catch (Exception e) {
throw new BadRequestException("获取合同文件失败");
}
return result;
}
private void deleteAccountEmailKey(String codeKey) {
stringRedisTemplate.delete(getUpdateAccountEmailKey(codeKey));
}
@ -2256,4 +2407,8 @@ public class RetailAppServiceImp implements RetailAppService {
return BIND_ACCOUNT_PHONE_PREFIX + codeKey;
}
private JSONObject getBankAccountByClientId(int client_id) {
List<JSONObject> list = clientBankAccountMapper.clientBankAccounts(client_id);
return list.isEmpty() ? new JSONObject() : list.get(0);
}
}

@ -42,6 +42,7 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;
import java.io.IOException;
import java.math.BigDecimal;
import java.text.ParseException;
import java.util.Arrays;
@ -725,8 +726,62 @@ public class RetailAppController {
}
@RequestMapping(value = "/cbbank_pay/aggregate_file", method = RequestMethod.GET)
public void getCBBankAggragateFile(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device,HttpServletResponse httpResponse) {
public void getCBBankAggregateFile(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device,HttpServletResponse httpResponse) {
retailAppService.getCBBankAggregateFile(device, httpResponse);
}
@RequestMapping(value = "/client/auth_file/status", method = RequestMethod.GET)
public JSONObject getClientAuthFileStatus(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
return retailAppService.getClientAuthFileStatus(device);
}
/**
*
* @param device
*/
@RequestMapping(value = "/client/aggregate_file", method = RequestMethod.GET)
public JSONObject getSourceAggregateFile(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
return retailAppService.getSourceAggregateFile(device);
}
/**
*
* @param device
* @param file url
*/
@RequestMapping(value = "/client/aggregate_file", method = RequestMethod.POST)
public JSONObject getClientAggregateFile(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device,@RequestParam MultipartFile file) throws IOException {
return retailAppService.getClientAggregateFile(device, file);
}
/**
*
* @param device
* @param filesInfo url
*/
@RequestMapping(value = "/client/auth_file", method = RequestMethod.PUT)
public List<JSONObject> uploadGreenChannelAuthFiles(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device,@RequestBody ClientAuthFilesInfo filesInfo){
return retailAppService.uploadGreenChannelAuthFiles(device, filesInfo);
}
/**
*
* @param device
* @param fileId Id
*/
@RequestMapping(value = "/client/auth_file/{fileId}/delete", method = RequestMethod.PUT)
public void deleteGreenChannelAuthFiles(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device,@PathVariable String fileId){
retailAppService.deleteGreenChannelAuthFiles(device, fileId);
}
/**
*
* @param device
*/
@RequestMapping(value = "/client/auth_file/commit_to_compliance", method = RequestMethod.POST)
public void commitToComplianceAuthFiles(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device){
retailAppService.commitAuthFilesToCompliance(device);
}
}

@ -0,0 +1,59 @@
package au.com.royalpay.payment.manage.complianceAudit.bean;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;
/**
* Created by yixian on 2016-07-01.
*/
public class ClientComplianceQuery {
private int limit = 10;
private int page = 1;
private String status;
private String client_moniker;
public JSONObject toJson(){
JSONObject jason = new JSONObject();
if(StringUtils.isNotEmpty(status)){
jason.put("status",status);
}
if(StringUtils.isNotEmpty(client_moniker)){
jason.put("client_moniker",client_moniker);
}
return jason;
}
public int getLimit() {
return limit;
}
public void setLimit(int limit) {
this.limit = limit;
}
public int getPage() {
return page;
}
public void setPage(int page) {
this.page = page;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getClient_moniker() {
return client_moniker;
}
public void setClient_moniker(String client_moniker) {
this.client_moniker = client_moniker;
}
}

@ -0,0 +1,21 @@
package au.com.royalpay.payment.manage.complianceAudit.core;
import au.com.royalpay.payment.manage.complianceAudit.bean.ClientComplianceQuery;
import com.alibaba.fastjson.JSONObject;
/**
* Created by yishuqian on 18/10/2016.
*/
public interface ClientComplianceApply {
JSONObject listClientComplianceApply(JSONObject manager, ClientComplianceQuery apply);
JSONObject complianceAuthFile(JSONObject client);
void passComplianceFile(JSONObject manager,int clientId,JSONObject passInfo);
void refuseComplianceFile(JSONObject manager,int clientId,JSONObject refuseInfo);
}

@ -0,0 +1,109 @@
package au.com.royalpay.payment.manage.complianceAudit.core.impl;
import au.com.royalpay.payment.core.exceptions.InvalidShortIdException;
import au.com.royalpay.payment.manage.complianceAudit.bean.ClientComplianceQuery;
import au.com.royalpay.payment.manage.complianceAudit.core.ClientComplianceApply;
import au.com.royalpay.payment.manage.mappers.system.ClientComplianceCompanyMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientFilesMapper;
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.tools.utils.PageListUtils;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.Order;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.omg.CORBA.SystemException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
import java.util.stream.Collectors;
/**
* Created by yishuqian on 18/10/2016.
*/
@Service
public class ClientComplianceApplyImpl implements ClientComplianceApply
{
@Resource
private ClientComplianceCompanyMapper clientComplianceCompanyMapper;
@Resource
private ClientFilesMapper clientFilesMapper;
@Override
public JSONObject listClientComplianceApply(JSONObject manager, ClientComplianceQuery applyQuery) {
JSONObject params = applyQuery.toJson();
if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) {
params.put("bd_user", manager.getString("manager_id"));
}
PageList<JSONObject> partners = clientComplianceCompanyMapper.listClientCompliances(params, new PageBounds(applyQuery.getPage(), applyQuery.getLimit(), Order.formString("submit_time.desc")));
return PageListUtils.buildPageListResult(partners);
}
@Override
public JSONObject complianceAuthFile(JSONObject client)
{
String[] fileKeys = {"client_bank_file", "client_company_file", "client_id_file", "client_agree_file", "client_apply_file"};
if (client == null) {
throw new InvalidShortIdException();
}
List<JSONObject> clientFiles = clientFilesMapper.findAllClientFile(client.getIntValue("client_id"));
JSONObject fileJson = new JSONObject();
if (clientFiles != null && clientFiles.size() > 0) {
for (String fileKey : fileKeys) {
List<JSONObject> clientFileUrl = clientFiles.stream()
.filter(json -> (fileKey.equals(json.getString("file_name"))))
.sorted((log1, log2) -> log2.getDate("last_update_date").compareTo(log1.getDate("last_update_date")))
.map(json -> {
JSONObject params = new JSONObject();
params.put("file_id", json.getString("file_id"));
params.put("status", json.getString("status"));
params.put("file_value", json.getString("file_value"));
return params;
})
.collect(Collectors.toList());
if (clientFileUrl != null && clientFileUrl.size() > 0) {
fileJson.put(fileKey, clientFileUrl);
}
}
}
return fileJson;
};
@Override
public void passComplianceFile(JSONObject manager, int clientId, JSONObject passInfo) {
JSONObject complianceDetail = clientComplianceCompanyMapper.findFileByClientId(clientId);
if (complianceDetail == null) {
throw new BadRequestException("无此记录");
}
if (complianceDetail.getIntValue("status") == 1) {
throw new BadRequestException("审核已通过,请避免重复操作");
}
complianceDetail.put("operator_id", manager.getString("manager_id"));
complianceDetail.put("status",1);
complianceDetail.put("description",' ');
clientComplianceCompanyMapper.update(complianceDetail);
clientFilesMapper.passCompliance(clientId);
}
@Override
public void refuseComplianceFile(JSONObject manager, int clientId, JSONObject refuseInfo) {
JSONObject complianceDetail = clientComplianceCompanyMapper.findFileByClientId(clientId);
if (complianceDetail == null) {
throw new BadRequestException("无此记录");
}
if (complianceDetail.getIntValue("status") == 2) {
throw new BadRequestException("已打回,请避免重复操作");
}
complianceDetail.put("description",refuseInfo.getString("description"));
complianceDetail.put("operator_id", manager.getString("manager_id"));
complianceDetail.put("status",2);
clientComplianceCompanyMapper.update(complianceDetail);
clientFilesMapper.refuseCompliance(clientId);
}
}

@ -0,0 +1,53 @@
package au.com.royalpay.payment.manage.complianceAudit.web;
import au.com.royalpay.payment.manage.complianceAudit.bean.ClientComplianceQuery;
import au.com.royalpay.payment.manage.complianceAudit.core.ClientComplianceApply;
import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.manage.permission.manager.RequireManager;
import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
/**
* Created by yishuqian on 18/10/2016.
*/
@RestController
@RequestMapping("/compliance/audit")
public class ComplianceAuditController
{
@Resource
private ClientComplianceApply clientComplianceApply;
@Resource
private ClientManager clientManager;
@Resource
private ClientMapper clientMapper;
@RequestMapping(value = "/listClientCompliances",method = RequestMethod.GET)
@RequireManager(role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR, ManagerRole.SERVANT})
public JSONObject clientComplianceList(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, ClientComplianceQuery apply) {
return clientComplianceApply.listClientComplianceApply(manager,apply);
}
@ManagerMapping(value = "/{clientId}/pass/complianceFile", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER})
public void passComplianceAudit(@PathVariable int clientId, @RequestBody JSONObject passInfo, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
clientComplianceApply.passComplianceFile(manager,clientId,passInfo);
}
@ManagerMapping(value = "/{clientId}/refuse/complianceFile", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER})
public void refuseComplianceAudit(@PathVariable int clientId, @RequestBody JSONObject refuseInfo, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
clientComplianceApply.refuseComplianceFile(manager,clientId,refuseInfo);
}
@RequestMapping(value = "/compliance/clientViewFiles/{clientMoniker}",method = RequestMethod.GET)
@RequireManager(role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR, ManagerRole.SERVANT})
public JSONObject searchCompliances(@PathVariable String clientMoniker) {
JSONObject client = clientMapper.findClientByMoniker(clientMoniker);
return clientManager.getComplianceFilesForBD(client);
}
}

@ -0,0 +1,30 @@
package au.com.royalpay.payment.manage.mappers.system;
import cn.yixblog.support.mybatis.autosql.annotations.AdvanceSelect;
import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper;
import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Created by yishuqian on 06/03/2017.
*/
@AutoMapper(tablename = "client_authfile_compliance", pkName = "compliance_id")
public interface ClientComplianceCompanyMapper {
@AutoSql(type = SqlType.INSERT)
void save(JSONObject partner);
@AutoSql(type = SqlType.UPDATE)
void update(JSONObject partner);
@AutoSql(type = SqlType.SELECT)
JSONObject findFileByClientId(@Param("client_id") int client_id);
PageList<JSONObject> listClientCompliances(JSONObject params, PageBounds pageBounds);
}

@ -1,5 +1,6 @@
package au.com.royalpay.payment.manage.mappers.system;
import cn.yixblog.support.mybatis.autosql.annotations.AdvanceSelect;
import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper;
import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
@ -20,13 +21,35 @@ public interface ClientFilesMapper {
void update(JSONObject partner);
@AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "is_valid = 1 and status = 1")
List<JSONObject> findClientFile(@Param("client_id") int clientId);
@AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "is_valid = 1 and (status = 1 or status = 2) and file_name='client_agree_file'")
List<JSONObject> findClientPassAggreeFile(@Param("client_id") int clientId);
@AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "is_valid = 1 and (status = 0 or status = 3) and file_name='client_agree_file'")
List<JSONObject> findClientAggreeFileCommit(@Param("client_id") int clientId);
@AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "is_valid = 1")
List<JSONObject> findAllClientFile(@Param("client_id") int clientId);
@AutoSql(type = SqlType.SELECT)
JSONObject findFileById(@Param("file_id") String file_id);
List<JSONObject> findFileByClientAndType(@Param("client_id") int client_id, @Param("file_name") String file_name);
void deleteByClientAndFileId(@Param("file_id") String file_id);
void deleteAggreeByClientId(@Param("client_id") int file_id);
void confirmAgreeFile(@Param("client_id") int client_id);
void updateBeforeCompliance(@Param("client_id") int client_id);
void refuseCompliance(@Param("client_id") int client_id);
void passCompliance(@Param("client_id") int client_id);
}

@ -12,6 +12,7 @@ import com.alibaba.fastjson.JSONObject;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@ -235,8 +236,22 @@ public interface ClientManager {
JSONObject getAuthFiles(JSONObject manager, String clientMoniker);
JSONObject getClientViewAuthFiles(JSONObject manager, String clientMoniker);
JSONObject getAllAuthFiles(JSONObject manager, String clientMoniker);
void deleteAuthFiles(String fileId);
void deleteAuthFilesByAdmin(String fileId);
void uploadAuthFiles(JSONObject manager, String clientMoniker, ClientAuthFilesInfo filesInfo);
List<JSONObject> uploadAuthFilesForWaitCompliance(JSONObject manager, String clientMoniker, ClientAuthFilesInfo filesInfo);
void commitAuthFilesToCompliance(String clientMoniker, JSONObject account, String source);
JSONObject getClientAggregateFile(JSONObject account, MultipartFile file) throws IOException;
JSONObject getClientsAnalysis(JSONObject manager);
List<JSONObject> getUnRegister(JSONObject manager);
@ -450,4 +465,10 @@ public interface ClientManager {
List<Integer> listLevel3Client(int client_id);
void updateRefundCreditLine(JSONObject manager, String clientMoniker, JSONObject refundLineInfo);
JSONObject getComplianceFiles(JSONObject account);
JSONObject getClientInfoByAggree(JSONObject account);
JSONObject getComplianceFilesForBD(JSONObject account);
}

@ -22,6 +22,7 @@ import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper
import au.com.royalpay.payment.manage.appclient.beans.AppClientBean;
import au.com.royalpay.payment.manage.appclient.beans.AppMerchantBean;
import au.com.royalpay.payment.manage.application.core.SimpleClientApplyService;
import au.com.royalpay.payment.manage.complianceAudit.core.ClientComplianceApply;
import au.com.royalpay.payment.manage.dev.bean.TestMerchantAccountInfo;
import au.com.royalpay.payment.manage.device.core.DeviceManager;
import au.com.royalpay.payment.manage.management.sysconfig.core.impls.PermissionPartnerManagerImpl;
@ -104,13 +105,12 @@ 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;
import org.thymeleaf.context.Context;
import org.thymeleaf.spring4.SpringTemplateEngine;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import javax.crypto.*;
import javax.crypto.spec.SecretKeySpec;
import javax.imageio.ImageIO;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
@ -121,7 +121,6 @@ import java.math.BigDecimal;
import java.math.RoundingMode;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.security.*;
import java.security.interfaces.RSAPrivateKey;
import java.security.interfaces.RSAPublicKey;
@ -158,6 +157,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
private AttachmentClient attachmentClient;
@Resource
private StringRedisTemplate stringRedisTemplate;
@Resource
private ClientComplianceApply clientComplianceApply;
@Value("${app.redis.prefix}")
private String redisPrefix;
private ApplicationEventPublisher publisher;
@ -287,6 +289,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
private Locker locker;
@Resource
private MongoTemplate mongoTemplate;
@Resource
private ClientComplianceCompanyMapper clientComplianceCompanyMapper;
@Resource
@ -303,6 +307,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
private String agreetemplatePdfPath;
@Value("${app.agreetemplate.aggregate.path}")
private String aggregateAgreetemplatePdfPath;
private final String IMG_AGGREGATE_FILE = "https://file.royalpay.com.au/open/2019/08/22/1566440384256_R7Jc3cl5JPZsmVznKffzStwVMELwsl.pdf";
@Resource
private MpWechatApiProvider mpWechatApiProvider;
@ -1985,6 +1991,102 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
clientInfoCacheSupport.clearClientCache(clientId);
}
@Override
public JSONObject getComplianceFiles(JSONObject account) {
JSONObject client = getClientInfo(account.getIntValue("client_id"));
if (client == null) {
throw new InvalidShortIdException();
}
JSONObject file = signInAccountService.checkAuthFileStatus(client);
file.put("file_company", clientComplianceCompanyMapper.findFileByClientId(account.getIntValue("client_id")));
return file;
}
@Override
public JSONObject getClientInfoByAggree(JSONObject account) {
JSONObject client = getClientInfo(account.getIntValue("client_id"));
if (client == null) {
throw new InvalidShortIdException();
}
String address = client.getString("address").trim();
if (address.contains(",")) {
client.put("address", address.substring(0, address.lastIndexOf(",")).trim());
client.put("address_sub", address.substring(address.lastIndexOf(",") + 1).trim());
}
if (client.getString("acn") != null && !client.getString("acn").equals("")) {
client.put("acn_type", "ACN: (" + client.getString("acn") + ")");
client.put("company_name_acn", client.getString("company_name") + " (ACN " + client.getString("acn") + ")");
} else {
client.put("acn_type", "ABN: (" + client.getString("abn") + ")");
client.put("company_name_acn", client.getString("company_name") + " (ABN " + client.getString("abn") + ")");
}
JSONObject weChatRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Wechat");
if (weChatRate == null) {
throw new BadRequestException("The Partner's Rate is not config!");
}
client.put("wechat_rate", weChatRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN));
client.put("clean", "T+" + weChatRate.getString("clean_days"));
client.put("clean_days", weChatRate.getString("clean_days"));
try {
JSONObject alipayRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Alipay");
if (alipayRate != null) {
client.put("alipay_rate", alipayRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN));
}
JSONObject bestPayRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Bestpay");
if (bestPayRate != null) {
client.put("bestpay_rate", bestPayRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN));
}
JSONObject jdRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "jd");
if (jdRate != null) {
client.put("jd_rate", jdRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN));
}
JSONObject alipayOnlineRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "AlipayOnline");
if (alipayOnlineRate != null) {
client.put("alipay_online_rate", alipayOnlineRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN));
}
JSONObject cbBankPayRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "CB_BankPay");
if (cbBankPayRate != null) {
client.put("cbbank_rate", cbBankPayRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN));
}
} catch (Exception ignored) {
throw new BadRequestException("Merchant Rate Not Configure");
}
JSONObject bankAccount = getBankAccountByClientId(client.getIntValue("client_id"));
if (bankAccount == null || bankAccount.size() <= 0) {
throw new BadRequestException("The Partner's Account is not config!");
}
client.put("bank", bankAccount.getString("bank"));
client.put("bsb_no", bankAccount.getString("bsb_no"));
client.put("account_no", bankAccount.getString("account_no"));
client.put("account_name", bankAccount.getString("account_name"));
String start_date = DateFormatUtils.format(new Date(), "dd/MM/yyyy");
client.put("start_date", start_date);
Date endDate = TimeZoneUtils.nextYearByCurrDay();
String end_date = DateFormatUtils.format(endDate, "dd/MM/yyyy");
client.put("end_date", end_date);
return client;
}
@Override
public JSONObject getComplianceFilesForBD(JSONObject account) {
JSONObject client = getClientInfo(account.getIntValue("client_id"));
if (client == null) {
throw new InvalidShortIdException();
}
JSONObject file = clientComplianceApply.complianceAuthFile(client);
file.put("file_company", clientComplianceCompanyMapper.findFileByClientId(account.getIntValue("client_id")));
file.put("client", client);
return file;
}
@Override
@Transactional
public void updateClientBDUsers(JSONObject manager, String clientMoniker, JSONObject data) throws Exception {
@ -3052,6 +3154,88 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
@Override
public JSONObject getAllAuthFiles(JSONObject manager, String clientMoniker) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
String[] fileKeys = {"client_bank_file", "client_company_file", "client_id_file", "client_agree_file", "client_apply_file"};
if (client == null) {
throw new InvalidShortIdException();
}
List<JSONObject> clientFiles = clientFilesMapper.findClientFile(client.getIntValue("client_id"));
JSONObject fileJson = new JSONObject();
if (clientFiles != null && clientFiles.size() > 0) {
for (String fileKey : fileKeys) {
List<JSONObject> clientFileUrl = clientFiles.stream()
.filter(json -> (fileKey.equals(json.getString("file_name"))))
.sorted((log1, log2) -> log2.getDate("last_update_date").compareTo(log1.getDate("last_update_date")))
.map(json -> {
JSONObject params = new JSONObject();
params.put("file_id", json.getString("file_id"));
params.put("file_value", json.getString("file_value"));
return params;
})
.collect(Collectors.toList());
if (clientFileUrl != null && clientFileUrl.size() > 0) {
fileJson.put(fileKey, clientFileUrl);
}
}
}
return fileJson;
}
@Override
public JSONObject getClientViewAuthFiles(JSONObject manager, String clientMoniker) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
String[] fileKeys = {"client_bank_file", "client_company_file", "client_id_file", "client_agree_file", "client_apply_file"};
if (client == null) {
throw new InvalidShortIdException();
}
List<JSONObject> clientFiles = clientFilesMapper.findAllClientFile(client.getIntValue("client_id"));
JSONObject fileJson = new JSONObject();
if (clientFiles != null && clientFiles.size() > 0) {
for (String fileKey : fileKeys) {
List<JSONObject> clientFileUrl = clientFiles.stream()
.filter(json -> (fileKey.equals(json.getString("file_name"))))
.sorted((log1, log2) -> log2.getDate("last_update_date").compareTo(log1.getDate("last_update_date")))
.map(json -> {
JSONObject params = new JSONObject();
params.put("file_id", json.getString("file_id"));
params.put("file_value", json.getString("file_value"));
params.put("status", json.getIntValue("status"));
return params;
})
.collect(Collectors.toList());
if (clientFileUrl != null && clientFileUrl.size() > 0) {
fileJson.put(fileKey, clientFileUrl);
}
}
}
return fileJson;
}
;
@Override
public void deleteAuthFiles(String fileId) {
JSONObject file = clientFilesMapper.findFileById(fileId);
if (file.getIntValue("status") == 1 || file.getIntValue("status") == 2) {
throw new BadRequestException("The file has passed and cannot be deleted");
}
clientFilesMapper.deleteByClientAndFileId(fileId);
}
@Override
public void deleteAuthFilesByAdmin(String fileId) {
JSONObject file = clientFilesMapper.findFileById(fileId);
if (file == null) {
throw new BadRequestException("The file has deleted");
}
clientFilesMapper.deleteByClientAndFileId(fileId);
}
@Override
@Transactional
public void uploadAuthFiles(JSONObject manager, String clientMoniker, ClientAuthFilesInfo filesInfo) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) {
@ -3074,6 +3258,162 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
// }
}
@Override
@Transactional
public List<JSONObject> uploadAuthFilesForWaitCompliance(JSONObject manager, String clientMoniker, ClientAuthFilesInfo filesInfo) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
List<JSONObject> fileResult = new ArrayList<>();
if (client == null) {
throw new InvalidShortIdException();
}
int clientId = client.getIntValue("client_id");
try {
updateAggregateFilesForWaitCompliance(manager, clientId, CLIENT_AGREE_FILE, filesInfo.getFile_agreement_info(), fileResult);
updateSysClientFilesForWaitCompliance(manager, clientId, CLIENT_APPLY_FILE, filesInfo.getFile_apply_info(), fileResult);
updateSysClientFilesForWaitCompliance(manager, clientId, CLIENT_BANK_FILE, filesInfo.getFile_bank_info(), fileResult);
updateSysClientFilesForWaitCompliance(manager, clientId, CLIENT_COMPANY_FILE, filesInfo.getFile_company_info(), fileResult);
updateSysClientFilesForWaitCompliance(manager, clientId, CLIENT_ID_FILE, filesInfo.getFile_id_info(), fileResult);
} catch (Exception e) {
logger.error("上传合规文件失败", e);
throw new BadRequestException("合同制作出现问题:" + e.getMessage());
}
// boolean clientSource = client.getIntValue("source") == 4 ? true : false;
// if (filesInfo.getAuthStatus() == 1 && clientSource) {
// client.put("approve_result", 3);
// clientMapper.update(client);
// }
return fileResult;
}
@Override
@Transactional
public void commitAuthFilesToCompliance(String clientMoniker, JSONObject account, String source) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
int sourceEnum = 2;
if (client == null) {
throw new InvalidShortIdException();
}
List<JSONObject> clientAllAuthFiles = clientFilesMapper.findAllClientFile(client.getIntValue("client_id"));
if (clientAllAuthFiles == null || clientAllAuthFiles.size() == 0) {
throw new BadRequestException("Please check the information is uploaded completely");
}
String[] fileKeys = {"client_bank_file", "client_company_file", "client_id_file", "client_agree_file"};
String[] fileNames = {"bank statement", "Certificate of Registration", "ID", "Agreement"};
for (int i = 0; i < fileKeys.length; i++) {
String fileKey = fileKeys[i];
if (clientAllAuthFiles.stream().noneMatch(fileJson -> fileKey.equals(fileJson.getString("file_name")))) {
if ("client_agree_file".equals(fileKey)) {
throw new BadRequestException("Please check that the agreement has been signed");
}else {
throw new BadRequestException("Please check the " + fileNames[i] + " is uploaded completely");
}
}
}
if ("app".equals(source.toLowerCase())) {
sourceEnum = 1;
}
JSONObject fileComp = clientComplianceCompanyMapper.findFileByClientId(client.getIntValue("client_id"));
if (fileComp == null) {
fileComp = new JSONObject();
fileComp.put("client_id", client.getIntValue("client_id"));
fileComp.put("submit_time", new Date());
fileComp.put("status", 0);
fileComp.put("source", sourceEnum);
fileComp.put("commit_by_id", account.getString("account_id"));
clientComplianceCompanyMapper.save(fileComp);
clientFilesMapper.updateBeforeCompliance(client.getIntValue("client_id"));
} else if (fileComp.getIntValue("status") == 2) {
fileComp.put("status", 0);
fileComp.put("submit_time", new Date());
fileComp.put("source", sourceEnum);
fileComp.put("commit_by_id", account.getString("account_id"));
clientComplianceCompanyMapper.update(fileComp);
clientFilesMapper.updateBeforeCompliance(client.getIntValue("client_id"));
} else {
throw new BadRequestException("please do not repeat submission");
}
signInAccountService.clearAccountCache(account.getString("account_id"));
}
@Override
public JSONObject getClientAggregateFile(JSONObject account, MultipartFile file) throws IOException{
if (StringUtils.isBlank(file.getOriginalFilename())) {
throw new BadRequestException("Please Enter Full Name");
}
JSONObject client = getClientInfo(account.getIntValue("client_id"));
String address = client.getString("address").trim();
if (address.contains(",")) {
client.put("address", address.substring(0, address.lastIndexOf(",")).trim());
client.put("address_sub", address.substring(address.lastIndexOf(",") + 1).trim());
}
if (client.getString("acn") != null && !client.getString("acn").equals("")) {
client.put("acn_type", "ACN: (" + client.getString("acn") + ")");
client.put("company_name_acn", client.getString("company_name") + " (ACN " + client.getString("acn") + ")");
} else {
client.put("acn_type", "ABN: (" + client.getString("abn") + ")");
client.put("company_name_acn", client.getString("company_name") + " (ABN " + client.getString("abn") + ")");
}
JSONObject weChatRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Wechat");
if (weChatRate == null) {
throw new BadRequestException("The Partner's Rate is not config!");
}
client.put("wechat_rate", weChatRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN));
client.put("clean", "T+" + weChatRate.getString("clean_days"));
client.put("clean_days", weChatRate.getString("clean_days"));
try {
JSONObject alipayRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Alipay");
if (alipayRate != null) {
client.put("alipay_rate", alipayRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN));
}
JSONObject bestPayRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Bestpay");
if (bestPayRate != null) {
client.put("bestpay_rate", bestPayRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN));
}
JSONObject jdRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "jd");
if (jdRate != null) {
client.put("jd_rate", jdRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN));
}
JSONObject alipayOnlineRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "AlipayOnline");
if (alipayOnlineRate != null) {
client.put("alipay_online_rate", alipayOnlineRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN));
}
JSONObject cbBankPayRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "CB_BankPay");
if (cbBankPayRate != null) {
client.put("cbbank_rate", cbBankPayRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN));
}
} catch (Exception ignored) {
throw new BadRequestException("Merchant Rate Not Configure");
}
JSONObject bankAccount = getBankAccountByClientId(client.getIntValue("client_id"));
if (bankAccount == null || bankAccount.size() <= 0) {
throw new BadRequestException("The Partner's Account is not config!");
}
client.put("bank", bankAccount.getString("bank"));
client.put("bsb_no", bankAccount.getString("bsb_no"));
client.put("account_no", bankAccount.getString("account_no"));
client.put("account_name", bankAccount.getString("account_name"));
String start_date = DateFormatUtils.format(new Date(), "dd/MM/yyyy");
client.put("start_date", start_date);
Date endDate = TimeZoneUtils.nextYearByCurrDay();
String end_date = DateFormatUtils.format(endDate, "dd/MM/yyyy");
client.put("end_date", end_date);
client.put("full_name", file.getOriginalFilename());
BufferedImage img = ImageIO.read(file.getInputStream());
ByteArrayOutputStream out = new ByteArrayOutputStream();
ImageIO.write(img, "png", out);
client.put("img","data:image/png;base64," + Base64.encodeBase64String(out.toByteArray()));
return exportImgAggregateFile(account, client);
}
@Override
public JSONObject getSettlementLog(JSONObject manager, String clientMoniker, TradeLogQuery query) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
@ -3113,31 +3453,70 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
public void updateSysClientFiles(JSONObject manager, int clientId, String fileType, String fileValue) {
if (fileValue != null) {
List<JSONObject> existFiles = clientFilesMapper.findFileByClientAndType(clientId, fileType);
JSONObject existFile = null;
if (!CollectionUtils.isEmpty(existFiles)) {
existFile = existFiles.get(0);
}
JSONObject fileJson = new JSONObject();
fileJson.put("client_id", clientId);
fileJson.put("last_update_date", new Date());
fileJson.put("last_update_by", manager.getString("display_name"));
if (existFile != null) {
fileJson.put("file_id", existFile.getString("file_id"));
fileJson.put("file_name", fileType);
fileJson.put("file_value", fileValue);
clientFilesMapper.update(fileJson);
logger.info(clientId + "的fileType文件更新成功");
} else {
fileJson.put("file_name", fileType);
fileJson.put("file_value", fileValue);
fileJson.put("status", 1);
fileJson.put("is_valid", 1);
clientFilesMapper.save(fileJson);
logger.info(clientId + "的fileType文件上传成功");
}
}
public void updateSysClientFilesForWaitCompliance(JSONObject manager, int clientId, String fileType, String fileValue, List<JSONObject> fileResult) {
if (fileValue != null) {
String[] values = fileValue.split(",");
for (String value : values) {
JSONObject fileJson = new JSONObject();
fileJson.put("client_id", clientId);
fileJson.put("last_update_date", new Date());
fileJson.put("last_update_by", manager.getString("display_name"));
fileJson.put("file_name", fileType);
fileJson.put("file_value", fileValue);
fileJson.put("file_value", value);
fileJson.put("status", 0);
fileJson.put("is_valid", 1);
clientFilesMapper.save(fileJson);
logger.info(clientId + "的fileType文件上传成功");
logger.info(clientId + "的fileType文件上传成功" + fileJson.getString("file_id"));
JSONObject file = new JSONObject();
file.put("file_id", fileJson.getString("file_id"));
file.put("file_value", fileJson.getString("file_value"));
fileResult.add(file);
}
}
}
public void updateAggregateFilesForWaitCompliance(JSONObject manager, int clientId, String fileType, String fileValue, List<JSONObject> fileResult) {
if (fileValue != null) {
List<JSONObject> passAggregateFiles = clientFilesMapper.findClientPassAggreeFile(clientId);
if (passAggregateFiles != null && passAggregateFiles.size() > 0) {
throw new BadRequestException("合同已提交或审核通过,请勿重复签订合同");
}
List<JSONObject> aggregateFiles = clientFilesMapper.findClientAggreeFileCommit(clientId);
if (aggregateFiles != null && aggregateFiles.size() > 0) {
clientFilesMapper.deleteAggreeByClientId(clientId);
}
JSONObject fileJson = new JSONObject();
fileJson.put("client_id", clientId);
fileJson.put("last_update_date", new Date());
fileJson.put("last_update_by", manager.getString("display_name"));
fileJson.put("file_name", fileType);
fileJson.put("file_value", fileValue);
fileJson.put("status", 0);
fileJson.put("is_valid", 1);
clientFilesMapper.save(fileJson);
logger.info(clientId + "的合同文件上传成功" + fileJson.getString("file_id"));
JSONObject file = new JSONObject();
file.put("file_id", fileJson.getString("file_id"));
file.put("file_value", fileJson.getString("file_value"));
fileResult.add(file);
}
}
@Override
public JSONObject getClientsAnalysis(JSONObject manager) {
JSONObject params = new JSONObject();
@ -5156,6 +5535,34 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
clientMapper.update(updateClient);
}
private JSONObject exportImgAggregateFile(JSONObject account, JSONObject client) throws IOException{
JSONObject result = new JSONObject();
InputStream stream = null;
try {
PdfUtils pdu = new PdfUtils();
pdu.setTemplatePdfPath(IMG_AGGREGATE_FILE);
pdu.setPdfTemplate(client);
File file = new File(client.getString("client_moniker") + "_agreement.pdf");
ByteArrayOutputStream bos = pdu.templetPdfBos(file,"STSong-Light","UniGB-UCS2-H");
stream = new ByteArrayInputStream(bos.toByteArray());
JSONObject fileInfo = attachmentClient.uploadFile(stream, client.getString("client_moniker") + "_" + System.currentTimeMillis() + "_agreement.pdf", false);
ClientAuthFilesInfo clientAuthFilesInfo = new ClientAuthFilesInfo();
clientAuthFilesInfo.setFile_agreement_info(fileInfo.getString("url"));
clientAuthFilesInfo.setFile_apply_info(null);
clientAuthFilesInfo.setFile_bank_info(null);
clientAuthFilesInfo.setFile_company_info(null);
clientAuthFilesInfo.setFile_id_info(null);
clientAuthFilesInfo.setAuthStatus(0);
result = uploadAuthFilesForWaitCompliance(account, client.getString("client_moniker"), clientAuthFilesInfo).get(0);
} catch (Exception e) {
logger.error("合同制作出现问题:", e);
throw new BadRequestException("合同制作出现问题:" + e.getMessage());
} finally {
stream.close();
}
return result;
}
private TemplateMessage initClientMessage(JSONObject client, String newExpiryDate, String wechatOpenid, String templateId) {
TemplateMessage notice = new TemplateMessage(wechatOpenid, templateId, null);
notice.put("first", "您好您的合同费率已到期根据合同协议系统已自动为您延期1年。", "#ff0000");

@ -1,5 +1,6 @@
package au.com.royalpay.payment.manage.merchants.web;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import com.google.code.kaptcha.Producer;
import au.com.royalpay.payment.manage.merchants.beans.ClientApplyInfo;
@ -40,6 +41,9 @@ public class PartnerApplyController {
private ClientApply clientApply;
@Resource
private Producer captchaProducer;
@Resource
private ClientManager clientManager;
@RequestMapping(method = RequestMethod.POST)
public void applyPartner(@CookieValue(CommonConsts.CODE_KEY) String codeKey, @RequestBody @Valid ClientApplyInfo apply,
@ -67,6 +71,12 @@ public class PartnerApplyController {
return clientApply.listPartnerApply(manager,apply);
}
@RequestMapping(value = "/{client_id}",method = RequestMethod.GET)
@RequireManager(role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR, ManagerRole.SERVANT})
public JSONObject getComplianceCompanyDetail(@PathVariable String client_apply_id) {
return clientApply.getPartnerApplicationDetail(client_apply_id);
}
@RequestMapping(value = "/{client_apply_id}",method = RequestMethod.GET)
@RequireManager(role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR, ManagerRole.SERVANT})
public JSONObject getApplicationDetail(@PathVariable String client_apply_id) {

@ -531,7 +531,12 @@ public class PartnerManageController {
@ManagerMapping(value = "/{clientMoniker}/file", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER, ManagerRole.SERVANT})
public JSONObject getAuthFiles(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return clientManager.getAuthFiles(manager, clientMoniker);
return clientManager.getAllAuthFiles(manager, clientMoniker);
}
@ManagerMapping(value = "/auth_file/{fileId}/delete", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER})
public void deleteAuthFiles(@PathVariable String fileId, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
clientManager.deleteAuthFilesByAdmin(fileId);
}
@ManagerMapping(value = "/{clientMoniker}/file", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER})

@ -2,14 +2,17 @@ package au.com.royalpay.payment.manage.merchants.web;
import au.com.royalpay.payment.core.exceptions.ParamInvalidException;
import au.com.royalpay.payment.manage.application.core.SimpleClientApplyService;
import au.com.royalpay.payment.manage.mappers.system.ClientComplianceCompanyMapper;
import au.com.royalpay.payment.manage.merchants.beans.ClientAuthFilesInfo;
import au.com.royalpay.payment.manage.merchants.beans.ClientRegisterInfo;
import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.merchants.core.ClientSignEventSupport;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.manage.permission.manager.PartnerMapping;
import au.com.royalpay.payment.manage.permission.manager.RequirePartner;
import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection;
import au.com.royalpay.payment.manage.signin.core.SignInAccountService;
import au.com.royalpay.payment.manage.support.wechatclients.KangaLandWechatApiImpl;
import au.com.royalpay.payment.manage.support.wechatclients.RedpackWechatApiImpl;
import au.com.royalpay.payment.manage.system.core.ClientContractService;
@ -21,20 +24,25 @@ import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.exceptions.ForbiddenException;
import au.com.royalpay.payment.tools.http.HttpUtils;
import au.com.royalpay.payment.tools.merchants.beans.QRCodeConfig;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.tools.permission.enums.PartnerRole;
import au.com.royalpay.payment.tools.permission.wechat.WechatMapping;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.Model;
import org.springframework.validation.Errors;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Date;
import java.util.List;
/**
@ -52,6 +60,10 @@ public class PartnerViewController {
private ClientSignEventSupport clientSignEventSupport;
@Resource
private ClientContractService clientContractService;
@Resource
private ClientComplianceCompanyMapper clientComplianceCompanyMapper;
@Resource
private SignInAccountService signInAccountService;
@Resource
private SimpleClientApplyService simpleClientApplyService;
@ -496,6 +508,30 @@ public class PartnerViewController {
return clientManager.getAuthFiles(null,account.getString("client_moniker"));
}
@PartnerMapping(value = "/compliance/complianceInfo", method = RequestMethod.GET)
@ResponseBody
public JSONObject complianceInfo(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) {
return null;
}
@PartnerMapping(value = "/compliance/clientViewFiles", method = RequestMethod.GET)
@ResponseBody
public JSONObject complianceFiles(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) {
return clientManager.getComplianceFiles(account);
}
@PartnerMapping(value = "/aggregateFile/client_info", method = RequestMethod.GET)
@ResponseBody
public JSONObject getClientInfoByAggree(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) {
return clientManager.getClientInfoByAggree(account);
}
/* @PartnerMapping(value = "/{clientMoniker}/clientViewFiles", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER, ManagerRole.SERVANT})
public JSONObject getAuthFiles(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return clientManager.getAllAuthFiles(manager, clientMoniker);
}*/
@PartnerMapping(value = "/verify/email", method = RequestMethod.PUT)
@ResponseBody
public void sendVerifyEmail(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) {
@ -527,4 +563,37 @@ public class PartnerViewController {
throw new BadRequestException("已通过审核,暂不能提交和修改");
}
}
@PartnerMapping(value = "/update/wait_compliance_file", method = RequestMethod.PUT)
@ResponseBody
public void updateWaitComplianceFile(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody ClientAuthFilesInfo filesInfo) {
JSONObject client = clientManager.getClientInfo(account.getIntValue("client_id"));
JSONObject authFileStatus = signInAccountService.checkAuthFileStatus(client);
if (authFileStatus.getBooleanValue("client_less_file")) {
JSONObject manager = new JSONObject();
manager.put("display_name","client");
clientManager.uploadAuthFilesForWaitCompliance(manager, account.getString("client_moniker"), filesInfo);
}else {
throw new BadRequestException("已通过审核,暂不能提交和修改");
}
}
@PartnerMapping(value = "/clientCompliance/{clientMoniker}/viewCommit", method = RequestMethod.POST)
@ResponseBody
public void clientComplianceViewCommit(@PathVariable String clientMoniker ,@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) {
clientManager.commitAuthFilesToCompliance(clientMoniker, account, "Web");
}
@PartnerMapping(value = "/clientCompliance/{clientMoniker}/commit_aggregate_file", method = RequestMethod.POST)
@ResponseBody
public JSONObject getClientArregateFile(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestParam MultipartFile file) throws IOException {
return clientManager.getClientAggregateFile(account, file);
}
@PartnerMapping(value = "/auth_file/{fileId}/delete", method = RequestMethod.PUT, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER})
@ResponseBody
public void deleteAuthFiles(@PathVariable String fileId, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) {
clientManager.deleteAuthFiles(fileId);
}
}

@ -57,4 +57,6 @@ public interface SignInAccountService {
void deleteClientCodeKey(String codekey);
void deleteManagerCodeKey(String codekey);
JSONObject checkAuthFileStatus(JSONObject client);
}

@ -42,10 +42,7 @@ import org.thymeleaf.spring4.SpringTemplateEngine;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
@ -87,18 +84,24 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati
@Resource
private ClientFilesMapper clientFilesMapper;
@Resource
private ClientComplianceCompanyMapper clientComplianceCompanyMapper;
@Resource
private SmsSender smsSender;
private final String RESET_CLIENT_ACCOUNT_PREFIX = "RESET_CLIENT_ACCOUNT";
private final String RESET_MANAGER_ACCOUNT_PREFIX = "RESET_MANAGER_ACCOUNT";
private final String[] FILE_KEYS = {"client_bank_file", "client_company_file", "client_id_file", "client_agree_file"};
private final String[] PUT_KEYS = {"file_bank_info", "file_company_info", "file_id_info", "file_agreement_info"};
private final String[] FILE_NAMES = {"* bank statement", "* Certificate of Registration", "* ID", "* Agreement"};
private final int RESET_PASSWORD_TEMPLID = 126978;
private ApplicationEventPublisher publisher;
private static final List<String> tags = new ArrayList<>();
@PostConstruct
public void init(){
public void init() {
tags.add("account");
}
@Override
@Cacheable(value = ":login:managers:", key = "''+#accountId")
public JSONObject getManager(String accountId) {
@ -130,7 +133,7 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati
manager.put("available_func_names", funcNames);
manager.put("modules", modules.values());
manager.put("module_names", modules.keySet());
if((manager.getIntValue("role")& ManagerRole.SERVANT.getMask())>0){
if ((manager.getIntValue("role") & ManagerRole.SERVANT.getMask()) > 0) {
JSONObject cs = sysCustomerServiceMapper.findByManagerId(accountId);
if (cs != null) {
manager.put("onoff", cs.getBoolean("onoff"));
@ -162,30 +165,19 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati
}
client.putAll(clientConfigService.find(client_id));
client = clientInfoWithNoSecretInfo(client);
if (client.getIntValue("approve_result") == 2 || client.getIntValue("open_status") == 10) {
List<JSONObject> resultFiles = new ArrayList<>();
List<JSONObject> clientFiles = clientFilesMapper.findClientFile(client.getIntValue("client_id"));
String[] fileKeys = {"client_bank_file", "client_company_file", "client_id_file", "client_agree_file", "client_apply_file"};
String[] putKeys = {"file_bank_info", "file_company_info", "file_id_info", "file_agreement_info", "file_apply_info"};
String[] fileNames = {"* bank statement", "* Certificate of Registration", "* ID", "* Agreement" ,"Application Form(optional)"};
boolean clientFilesIsLess = false;
for (int i = 0; i < fileKeys.length; i++) {
String fileKey = fileKeys[i];
if (clientFiles.stream().noneMatch(fileJson -> fileKey.equals(fileJson.getString("file_name")))) {
JSONObject fileJson = new JSONObject();
fileJson.put("key", putKeys[i]);
fileJson.put("name", fileNames[i]);
fileJson.put("file_value", "not Configure");
resultFiles.add(fileJson);
if (!"client_apply_file".equals(fileKey)) {
clientFilesIsLess = true;
client.put("client_less_file", false);
if (client.getIntValue("client_id") == 9 &&(client.getIntValue("approve_result") == 2 || client.getIntValue("open_status") == 10 || client.getIntValue("approve_result") ==1 || client.getIntValue("open_status") == 5) && client.getIntValue("source")!=4) {
List<JSONObject> clientFiles = clientFilesMapper.findAllClientFile(client.getIntValue("client_id"));
if (clientFiles != null && clientFiles.size() > 0) {
clientFiles = clientFiles.stream().filter(fileJson -> ((fileJson.getIntValue("status") == 1 || fileJson.getIntValue("status") == 2))).collect(Collectors.toList());
String[] fileKeys = {"client_bank_file", "client_company_file", "client_id_file", "client_agree_file"};
for (String fileKey : fileKeys) {
if (clientFiles.stream().noneMatch(fileJson -> fileKey.equals(fileJson.getString("file_name")))) {
client.put("client_less_file", true);
}
}
}
client.put("greenChannel", 1);
client.put("client_less_file", clientFilesIsLess);
if (clientFilesIsLess) {
client.put("client_files", resultFiles);
}else {
client.put("client_less_file", true);
}
}
if (client.getInteger("parent_client_id") != null) {
@ -402,7 +394,7 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati
ctx.setVariable("url", url);
ctx.setVariable("accounts", accounts);
ctx.setVariable("client_moniker", client_moniker);
final String content = thymeleaf.process( "mail/reset_password", ctx);
final String content = thymeleaf.process("mail/reset_password", ctx);
//final String content = VelocityEngineUtils.mergeTemplateIntoString(null, "mail/reset_password.vm", "utf-8", map);
new Thread(() -> {
@ -468,11 +460,11 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati
public static JSONObject clientInfoWithNoSecretInfo(JSONObject client) {
JSONObject simpleClient = new JSONObject();
String[] columns = { "client_id", "client_moniker", "parent_client_id", "company_name", "address", "business_name", "business_structure", "abn", "acn",
String[] columns = {"client_id", "client_moniker", "parent_client_id", "company_name", "address", "business_name", "business_structure", "abn", "acn",
"company_phone", "suburb", "postcode", "state", "contact_person", "contact_phone", "contact_email", "short_name", "logo_url", "enable_refund",
"enable_refund_auth", "retail_surcharge", "require_custinfo", "require_remark", "logo_thumbnail", "creator", "create_time", "approver",
"approve_result", "approve_time", "open_status", "timezone", "has_children", "source", "customer_surcharge_rate", "enable_alipay", "enable_wechat",
"enable_bestpay", "manual_settle", "skip_clearing" ,"mail_confirm","surcharge_mode"};
"enable_bestpay", "manual_settle", "skip_clearing", "mail_confirm", "surcharge_mode"};
for (String col : columns) {
simpleClient.put(col, client.get(col));
}
@ -508,24 +500,24 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati
}
@Override
public void getClientResetPwdCode(JSONObject account,String type) {
if(StringUtils.equals(type,"email") && !account.containsKey("contact_email")){
public void getClientResetPwdCode(JSONObject account, String type) {
if (StringUtils.equals(type, "email") && !account.containsKey("contact_email")) {
throw new BadRequestException("Your account is not bound to your mailbox!");
}
if(StringUtils.equals(type,"phone") && !account.containsKey("contact_phone") && !account.containsKey("nation_code")){
if (StringUtils.equals(type, "phone") && !account.containsKey("contact_phone") && !account.containsKey("nation_code")) {
throw new BadRequestException("Your account is not bound to your phone!");
}
String accountId = account.getString("account_id");
String codeKeyValueRedis = stringRedisTemplate.boundValueOps(getResetClientAccountKey(accountId)).get();
if(StringUtils.isNotEmpty(codeKeyValueRedis)){
throw new BadRequestException("Captcha has been sent.Please check your "+type+" or try again in 5 minutes.");
if (StringUtils.isNotEmpty(codeKeyValueRedis)) {
throw new BadRequestException("Captcha has been sent.Please check your " + type + " or try again in 5 minutes.");
}
String codeKeyValue = RandomStringUtils.random(6, false, true);
switch(type){
switch (type) {
case "email":
Context ctx = new Context();
ctx.setVariable("account",account);
ctx.setVariable("captcha",codeKeyValue);
ctx.setVariable("account", account);
ctx.setVariable("captcha", codeKeyValue);
final String content = thymeleaf.process("mail/account_reset_email.html", ctx);
royalThreadPoolExecutor.execute(() -> {
try {
@ -550,28 +542,28 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati
}
break;
}
stringRedisTemplate.boundValueOps(getResetClientAccountKey(accountId)).set(codeKeyValue,5, TimeUnit.MINUTES);
stringRedisTemplate.boundValueOps(getResetClientAccountKey(accountId)).set(codeKeyValue, 5, TimeUnit.MINUTES);
}
@Override
public void getManagerResetPwdCode(JSONObject account, String type) {
if(StringUtils.equals(type,"email") && !account.containsKey("email")){
if (StringUtils.equals(type, "email") && !account.containsKey("email")) {
throw new BadRequestException("Your account is not bound to your mailbox!");
}
if(StringUtils.equals(type,"phone") && !account.containsKey("phone") && !account.containsKey("nation_code")){
if (StringUtils.equals(type, "phone") && !account.containsKey("phone") && !account.containsKey("nation_code")) {
throw new BadRequestException("Your account is not bound to your phone!");
}
String managerId = account.getString("manager_id");
String codeKeyValueRedis = stringRedisTemplate.boundValueOps(getResetManagerAccountKey(managerId)).get();
if(StringUtils.isNotEmpty(codeKeyValueRedis)){
throw new BadRequestException("Captcha has been sent.Please check your "+type+" or try again in 5 minutes.");
if (StringUtils.isNotEmpty(codeKeyValueRedis)) {
throw new BadRequestException("Captcha has been sent.Please check your " + type + " or try again in 5 minutes.");
}
String codeKeyValue = RandomStringUtils.random(6, false, true);
switch(type){
switch (type) {
case "email":
Context ctx = new Context();
ctx.setVariable("account",account);
ctx.setVariable("captcha",codeKeyValue);
ctx.setVariable("account", account);
ctx.setVariable("captcha", codeKeyValue);
final String content = thymeleaf.process("mail/account_reset_email.html", ctx);
royalThreadPoolExecutor.execute(() -> {
try {
@ -596,16 +588,16 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati
}
break;
}
stringRedisTemplate.boundValueOps(getResetManagerAccountKey(managerId)).set(codeKeyValue,5, TimeUnit.MINUTES);
stringRedisTemplate.boundValueOps(getResetManagerAccountKey(managerId)).set(codeKeyValue, 5, TimeUnit.MINUTES);
}
@Override
public void verifyClientCaptcha(JSONObject account, String captcha) {
String captchaRedis = stringRedisTemplate.boundValueOps(getResetClientAccountKey(account.getString("account_id"))).get();
if(StringUtils.isBlank(captchaRedis)){
if (StringUtils.isBlank(captchaRedis)) {
throw new BadRequestException("Captcha has expired");
}
if(StringUtils.equals(captcha,captchaRedis)){
if (StringUtils.equals(captcha, captchaRedis)) {
throw new BadRequestException("Captcha is wrong");
}
}
@ -613,10 +605,10 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati
@Override
public void verifyManagerCaptcha(JSONObject account, String captcha) {
String captchaRedis = stringRedisTemplate.boundValueOps(getResetManagerAccountKey(account.getString("manager_id"))).get();
if(StringUtils.isBlank(captchaRedis)){
if (StringUtils.isBlank(captchaRedis)) {
throw new BadRequestException("Captcha has expired");
}
if(StringUtils.equals(captcha,captchaRedis)){
if (StringUtils.equals(captcha, captchaRedis)) {
throw new BadRequestException("Captcha is wrong");
}
}
@ -631,20 +623,97 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati
deleteManagerAccountKey(codekey);
}
private void deleteClientAccountKey(String codeKey){
private void deleteClientAccountKey(String codeKey) {
stringRedisTemplate.delete(getResetClientAccountKey(codeKey));
}
private void deleteManagerAccountKey(String codeKey){
private void deleteManagerAccountKey(String codeKey) {
stringRedisTemplate.delete(getResetManagerAccountKey(codeKey));
}
private String getResetClientAccountKey(String codeKey){
private String getResetClientAccountKey(String codeKey) {
return RESET_CLIENT_ACCOUNT_PREFIX + codeKey;
}
private String getResetManagerAccountKey(String codeKey){
private String getResetManagerAccountKey(String codeKey) {
return RESET_MANAGER_ACCOUNT_PREFIX + codeKey;
}
@Override
public JSONObject checkAuthFileStatus(JSONObject client) {
JSONObject result = new JSONObject();
result.put("client_less_file", false);
result.put("put_fail_pdf", "https://file.royalpay.com.au/open/2019/08/28/1566959635986_P1GuvCkuWINPhUJUqUQnz8E0u6Lgpx.pdf");
if (client.getIntValue("client_id") == 9 &&(client.getIntValue("approve_result") == 2 || client.getIntValue("open_status") == 10 || client.getIntValue("approve_result") == 1 || client.getIntValue("open_status") == 5) && client.getIntValue("source")!=4) {
List<JSONObject> clientFiles = clientFilesMapper.findAllClientFile(client.getIntValue("client_id"));
boolean clientFilesIsLess = false;
for (int i = 0; i < FILE_KEYS.length; i++) {
String fileKey = FILE_KEYS[i];
if (clientFiles != null && clientFiles.size() > 0) {
List<JSONObject> clientFileUrl = clientFiles.stream()
.filter(fileJson -> (fileKey.equals(fileJson.getString("file_name")) && (fileJson.getIntValue("status") == 1 || fileJson.getIntValue("status") == 2)))
.sorted((log1, log2) -> log2.getDate("last_update_date").compareTo(log1.getDate("last_update_date")))
.map(json -> {
JSONObject params = new JSONObject();
params.put("file_id", json.getString("file_id"));
params.put("file_value", json.getString("file_value"));
return params;
})
.collect(Collectors.toList());
if (clientFileUrl != null && clientFileUrl.size() > 0) {
JSONObject fileJson = new JSONObject();
fileJson.put("key", PUT_KEYS[i]);
fileJson.put("name", FILE_NAMES[i]);
fileJson.put("file_value", clientFileUrl);
fileJson.put("file_write", false);
result.put(fileKey,fileJson);
} else {
List<JSONObject> clientBackToFileUrl = clientFiles.stream()
.filter(fileJson -> (fileKey.equals(fileJson.getString("file_name")) && (fileJson.getIntValue("status") == 0 || fileJson.getIntValue("status") == 3)))
.sorted((log1, log2) -> log2.getDate("last_update_date").compareTo(log1.getDate("last_update_date")))
.map(json -> {
JSONObject params = new JSONObject();
params.put("file_id", json.getString("file_id"));
params.put("file_value", json.getString("file_value"));
return params;
})
.collect(Collectors.toList());
JSONObject fileJson = new JSONObject();
fileJson.put("key", PUT_KEYS[i]);
fileJson.put("name", FILE_NAMES[i]);
if (clientBackToFileUrl != null && clientBackToFileUrl.size() > 0) {
if ("client_agree_file".equals(fileKey)) {
List<JSONObject> agreeFile = new ArrayList<>();
agreeFile.add(clientBackToFileUrl.get(0));
fileJson.put("file_value", agreeFile);
}else {
fileJson.put("file_value", clientBackToFileUrl);
}
}
fileJson.put("file_write", true);
result.put(fileKey,fileJson);
clientFilesIsLess = true;
}
}else {
clientFilesIsLess = true;
for (int c = 0; c < FILE_KEYS.length; c++) {
String key = FILE_KEYS[c];
JSONObject fileJson = new JSONObject();
fileJson.put("key", PUT_KEYS[c]);
fileJson.put("name", FILE_NAMES[c]);
fileJson.put("file_write", true);
result.put(key,fileJson);
}
}
result.put("client_less_file", clientFilesIsLess);
if (clientFilesIsLess) {
JSONObject authFileCompliance = clientComplianceCompanyMapper.findFileByClientId(client.getIntValue("client_id"));
if (authFileCompliance != null && StringUtils.isNotBlank(authFileCompliance.getString("description"))) {
result.put("client_refuse_reason", "Refuse reason/打回原因:" + authFileCompliance.getString("description"));
}
}
}
}
return result;
}
}

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="au.com.royalpay.payment.manage.mappers.system.ClientComplianceCompanyMapper">
<select id="listClientCompliances" resultType="com.alibaba.fastjson.JSONObject">
SELECT c.client_moniker,c.short_name,c.create_time,c.bd_user_name,c.approve_result,c.approve_time,c.open_status,
c.source as client_source,a.* FROM client_authfile_compliance a INNER JOIN sys_clients c on c.client_id = a.client_id
<where>
<if test="client_moniker!=null">
and c.client_moniker = #{client_moniker}
</if>
<if test="status!=null">
and a.status = #{status}
</if>
</where>
</select>
</mapper>

@ -5,17 +5,41 @@
select * from sys_files
where client_id = #{client_id}
and file_name = #{file_name}
and status = 1
and is_valid = 1
order by last_update_date desc
</select>
<select id="deleteByClientAndFileId" resultType="com.alibaba.fastjson.JSONObject">
update sys_files set is_valid = 0
where file_id = #{file_id}
</select>
<select id="deleteAggreeByClientId" resultType="com.alibaba.fastjson.JSONObject">
update sys_files set is_valid = 0
where client_id = #{client_id}
and file_name='client_agree_file'
and status != 1
</select>
<update id="confirmAgreeFile">
update sys_files
set state = 2
where file_name = 'source_agree_file'
and client_id = #{client_id}
</update>
<select id="findClientFile" resultType="com.alibaba.fastjson.JSONObject">
select * from sys_files
<update id="updateBeforeCompliance">
update sys_files
set status = 2
where client_id = #{client_id}
order by last_update_date
</select>
and is_valid = 1
and (status = 0 or status = 3)
</update>
<update id="refuseCompliance">
update sys_files set `status` = 3 where client_id = #{client_id} and is_valid = 1 and status = 2
</update>
<update id="passCompliance">
update sys_files set `status` = 1 where client_id = #{client_id} and is_valid = 1 and status = 2
</update>
</mapper>

@ -472,6 +472,11 @@ margin-bottom: 10%;"/>
<i class="fa fa fa-eye"></i> <span>商户合规</span>
</a>
</li>
<li ui-sref-active="active">
<a ui-sref="partner_compliance_auth" ui-sref-opts="{reload:true}">
<i class="fa fa-balance-scale"></i> <span>合规文件审核</span>
</a>
</li>
<li ui-sref-active="active">
<a ui-sref="contract">
<i class="fa fa-money"></i> <span>合同签约情况</span>

@ -19,6 +19,7 @@ define(['angular', 'angularSanitize', 'angularAnimate', 'angularMessages', 'uiRo
var stompClient = null;
var newPartnerGuide_counts = 0;
var pwdcount = 0;
var complianceNoticeCount = 0;
$scope.loadCurrentUser = function () {
$http.get('/global/userstatus/current_partner').then(function (resp) {
$rootScope.currentUser = resp.data;
@ -35,7 +36,6 @@ define(['angular', 'angularSanitize', 'angularAnimate', 'angularMessages', 'uiRo
}*/
if ($rootScope.currentUser.is_password_expired && pwdcount == 0) {
commonDialog.confirm({
title: 'Change Password!',
content: 'Your password has been expired,click OK to set a new password'
@ -44,6 +44,25 @@ define(['angular', 'angularSanitize', 'angularAnimate', 'angularMessages', 'uiRo
})
pwdcount++;
}
$scope.ComplianceToperfect = function () {
$uibModal.open({
templateUrl: '/static/payment/partner/templates/compliance_files_advice.html',
size: 'lg',
controller: 'partnerFilesCtrl',
resolve: {
file: ['$http', function ($http) {
return $http.get('/client/partner_info/compliance/clientViewFiles');
}]
}
})
};
if($scope.currentUser.client.client_less_file && complianceNoticeCount==0 && $scope.currentUser.role!=3)
{
$scope.ComplianceToperfect();
complianceNoticeCount++;
}
connectWebSocket();
if ($scope.currentUser.role == 1 || $scope.currentUser.role == 2) {
$scope.getAgStatus();
@ -458,6 +477,9 @@ define(['angular', 'angularSanitize', 'angularAnimate', 'angularMessages', 'uiRo
})
}
}]);
app.controller('partnerFilesCtrl', ['$scope', '$http', '$sce', 'file', function ($scope, $http, $sce, file) {
$scope.file = angular.copy(file);
}]);
app.factory('myLoginLogView', ['$uibModal', function ($uibModal) {
return {
show: function () {

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

@ -9,7 +9,12 @@ define(['angular','decimal', 'uiRouter', 'uiBootstrap', 'angularEcharts'], funct
$stateProvider.state('partner_dashboard', {
url: '/partner_dashboard',
templateUrl: '/static/dashboard/templates/partner_dashboard.html',
controller: 'partnerDashboardCtrl'
controller: 'partnerDashboardCtrl',
resolve: {
company_info: ['$http', function ($http) {
return $http.get('/client/partner_info/compliance/complianceInfo');
}]
}
})
}]);
/*app.controller('partnerDashboardCtrl', ['$scope', '$http', '$filter', '$uibModal','$timeout', 'chartParser', function ($scope, $http, $filter, $uibModal,$timeout, chartParser) {
@ -568,7 +573,8 @@ define(['angular','decimal', 'uiRouter', 'uiBootstrap', 'angularEcharts'], funct
}
}]);*/
app.controller('partnerDashboardCtrl', ['$scope', '$http', '$filter', '$uibModal','$timeout', 'chartParser','clearingDetailService','commonDialog', function ($scope, $http, $filter, $uibModal,$timeout, chartParser,clearingDetailService,commonDialog) {
app.controller('partnerDashboardCtrl', ['$scope', '$http', '$filter', '$uibModal','$timeout', 'chartParser','clearingDetailService','commonDialog','company_info', function ($scope, $http, $filter, $uibModal,$timeout, chartParser,clearingDetailService,commonDialog,company_info) {
$scope.company_info = company_info.data || {};
$scope.sendMailCount = 0;
$scope.scales = [
{
@ -967,6 +973,7 @@ define(['angular','decimal', 'uiRouter', 'uiBootstrap', 'angularEcharts'], funct
commonDialog.alert({title: 'Message', content: 'Verify that the message has been sent to your mailbox. Please complete the validation as soon as possible', type: 'info'});
})
}
}]);
app.controller('contactCustomerServiceDialogCtrl', ['$scope', '$http', function ($scope, $http) {

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

@ -0,0 +1,4 @@
/* Modernizr 2.5.2 (Custom Build) | MIT & BSD
* Build: http://www.modernizr.com/download/#-borderradius-csscolumns-canvas-touch-mq-cssclasses-addtest-teststyles-testprop-testallprops-prefixes-domprefixes-fullscreen_api
*/
;window.Modernizr=function(a,b,c){function A(a){j.cssText=a}function B(a,b){return A(m.join(a+";")+(b||""))}function C(a,b){return typeof a===b}function D(a,b){return!!~(""+a).indexOf(b)}function E(a,b){for(var d in a)if(j[a[d]]!==c)return b=="pfx"?a[d]:!0;return!1}function F(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:C(f,"function")?f.bind(d||b):f}return!1}function G(a,b,c){var d=a.charAt(0).toUpperCase()+a.substr(1),e=(a+" "+o.join(d+" ")+d).split(" ");return C(b,"string")||C(b,"undefined")?E(e,b):(e=(a+" "+p.join(d+" ")+d).split(" "),F(e,b,c))}var d="2.5.2",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m=" -webkit- -moz- -o- -ms- ".split(" "),n="Webkit Moz O ms",o=n.split(" "),p=n.toLowerCase().split(" "),q={},r={},s={},t=[],u=t.slice,v,w=function(a,c,d,e){var f,i,j,k=b.createElement("div"),l=b.body,m=l?l:b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),k.appendChild(j);return f=["&#173;","<style>",a,"</style>"].join(""),k.id=h,m.innerHTML+=f,m.appendChild(k),l||g.appendChild(m),i=c(k,a),l?k.parentNode.removeChild(k):m.parentNode.removeChild(m),!!i},x=function(b){var c=a.matchMedia||a.msMatchMedia;if(c)return c(b).matches;var d;return w("@media "+b+" { #"+h+" { position: absolute; } }",function(b){d=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle)["position"]=="absolute"}),d},y={}.hasOwnProperty,z;!C(y,"undefined")&&!C(y.call,"undefined")?z=function(a,b){return y.call(a,b)}:z=function(a,b){return b in a&&C(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=u.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(u.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(u.call(arguments)))};return e});var H=function(c,d){var f=c.join(""),g=d.length;w(f,function(c,d){var f=b.styleSheets[b.styleSheets.length-1],h=f?f.cssRules&&f.cssRules[0]?f.cssRules[0].cssText:f.cssText||"":"",i=c.childNodes,j={};while(g--)j[i[g].id]=i[g];e.touch="ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch||(j.touch&&j.touch.offsetTop)===9},g,d)}([,["@media (",m.join("touch-enabled),("),h,")","{#touch{top:9px;position:absolute}}"].join("")],[,"touch"]);q.canvas=function(){var a=b.createElement("canvas");return!!a.getContext&&!!a.getContext("2d")},q.touch=function(){return e.touch},q.borderradius=function(){return G("borderRadius")},q.csscolumns=function(){return G("columnCount")};for(var I in q)z(q,I)&&(v=I.toLowerCase(),e[v]=q[I](),t.push((e[v]?"":"no-")+v));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)z(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,g.className+=" "+(b?"":"no-")+a,e[a]=b}return e},A(""),i=k=null,e._version=d,e._prefixes=m,e._domPrefixes=p,e._cssomPrefixes=o,e.mq=x,e.testProp=function(a){return E([a])},e.testAllProps=G,e.testStyles=w,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+t.join(" "):""),e}(this,this.document),Modernizr.addTest("fullscreen",function(){for(var a=0;a<Modernizr._domPrefixes.length;a++)if(document[Modernizr._domPrefixes[a].toLowerCase()+"CancelFullScreen"])return!0;return!!document.cancelFullScreen||!1});

@ -336,7 +336,7 @@
<div class="col-sm-2 col-xs-6">
<div class="description-block">
<a ui-sref="contract" ui-sref-opts="{reload:true}">
<img src="/static/images/main_menu/compliance_contract.png"/>
<img src="static/images/main_menu/compliance_contract.png"/>
<div class="description-text">
<span class="description-text">合同签约情况</span>
</div>
@ -405,6 +405,17 @@
</div>
</a>
</div>
<div class="col-sm-2 col-xs-6">
<a ui-sref="partner_compliance_auth" ui-sref-opts="{reload:true}">
<div class="description-block">
<img src="/static/images/main_menu/compliance_merchant.png"/>
<div class="description-text">
<span class="description-text">合规文件审核</span>
</div>
</div>
</a>
</div>
</div>
</div>
<div class="list-group" ng-if="(role=='salesmanager') || (role=='director')">

@ -93,7 +93,6 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
}
}]);
app.controller('partnerApplicationDetailCtrl', ['$rootScope', '$scope', '$http', '$state', '$uibModal', 'commonDialog', 'partner', function ($rootScope, $scope, $http, $state, $uibModal, commonDialog, partner) {
$scope.partner = partner.data;

@ -104,6 +104,10 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
url: '/partners/compliance',
templateUrl: '/static/payment/partner/templates/partner_compliance.html',
controller: 'compliancePartnerCtrl'
}).state('complianceDocumentAudit', {
url: '/partners/compliance',
templateUrl: '/static/payment/partner/templates/partner_compliance.html',
controller: 'compliancePartnerCtrl'
}).state('partners.detail', {
url: '/{clientMoniker}/detail',
templateUrl: '/static/payment/partner/templates/partner_detail.html',
@ -3811,6 +3815,25 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
return url;
};
$scope.deleteComplianceFiles = function (file_id) {
commonDialog.confirm({
title: 'Warning',
content: 'This operation will delete the file, Are you sure?'
}).then(function () {
$http.put('/sys/partners/auth_file/' + file_id + '/delete').then(function (resp) {
commonDialog.alert({
title: 'Success',
content: 'Delete Successful',
type: 'success'
});
$state.reload();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
})
})
};
$scope.updateFile = function () {
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/file', $scope.file).then(function () {
commonDialog.alert({

@ -2,9 +2,9 @@
* partner info in partner client
* Created by yixian on 2016-07-03.
*/
define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBootstrap'], function (angular, Decimal) {
define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiBootstrap'], function (angular, Decimal) {
'use strict';
var app = angular.module('partnerInfoApp', ['ui.router', 'frapontillo.bootstrap-switch', 'ngFileUpload','ui.bootstrap']);
var app = angular.module('partnerInfoApp', ['ui.router', 'frapontillo.bootstrap-switch', 'ngFileUpload', 'ui.bootstrap']);
app.config(['$stateProvider', function ($stateProvider) {
$stateProvider.state('basic', {
url: '/basic',
@ -37,6 +37,22 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
return $http.get('/client/partner_info/compliance/files');
}]
}
}).state('compliance_to_perfect', {
url: '/compliance_to_perfect',
templateUrl: '/static/payment/partner/templates/client_compliance_to_perfect.html',
controller: 'clientCommitToComplianceFilesCtrl',
resolve: {
file: ['$http', function ($http) {
return $http.get('/client/partner_info/compliance/clientViewFiles');
}],
partner: ['$http', function ($http) {
return $http.get('/client/partner_info');
}]
}
}).state('compliance_contract', {
url: '/compliance/contract',
templateUrl: '/static/payment/partner/templates/contract_for_compliance.html',
controller: 'aggregateFileCtrl'
}).state('basic.clearing_config', {
url: '/clearing_config',
templateUrl: '/static/payment/partner/templates/client_bankaccounts.html',
@ -60,7 +76,7 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
controller: 'clientDeviceCtrl'
})
}]);
app.controller('clientPartnerDetailCtrl', ['$scope', '$http', 'partner','industryMap','businessStructuresMap','commonDialog','Upload','$state', function ($scope, $http, partner,industryMap,businessStructuresMap,commonDialog,Upload,$state) {
app.controller('clientPartnerDetailCtrl', ['$scope', '$http', 'partner', 'industryMap', 'businessStructuresMap', 'commonDialog', 'Upload', '$state', function ($scope, $http, partner, industryMap, businessStructuresMap, commonDialog, Upload, $state) {
$scope.business_structures = businessStructuresMap.configs();
$scope.industries = industryMap.configs();
$scope.partner = partner.data;
@ -143,7 +159,7 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
var removeClientPayDesc = function (items, key) {
for (var i = 0; i < items.length; i++) {
var item = items[i];
if (item.indexOf(key)>=0) {
if (item.indexOf(key) >= 0) {
items.splice(items.indexOf(item), 1);
i = i - 1;
}
@ -157,7 +173,7 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
var $idx = $scope.partner.client_pay_desc.indexOf(type);
if ($idx >= 0) {
if (type == '203') {
removeClientPayDesc($scope.partner.client_pay_desc,'2030')
removeClientPayDesc($scope.partner.client_pay_desc, '2030')
}
$scope.partner.client_pay_desc.splice($idx, 1);
} else {
@ -201,7 +217,7 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
alert("Logo is necessary!");
return;
}
if($scope.partner.partner_type == 'photo'){
if ($scope.partner.partner_type == 'photo') {
if (!$scope.partner.company_photo) {
alert('Shop Photo1 is necessary');
return;
@ -213,11 +229,11 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
}
var content = '';
if ($scope.partner.client_pay_type.length==0) {
if ($scope.partner.client_pay_type.length == 0) {
alert('请选择商户支付场景')
return;
}
if ($scope.partner.client_pay_desc.length==0) {
if ($scope.partner.client_pay_desc.length == 0) {
alert('请选择商户支付方式')
return;
}
@ -227,7 +243,7 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
return;
}
}
if ( $scope.partner.client_pay_type.indexOf('2') >= 0) {
if ($scope.partner.client_pay_type.indexOf('2') >= 0) {
if ($scope.partner.client_pay_desc.join(',').indexOf('20') < 0) {
alert("请检查线下支付场景是否已选择支付方式");
return;
@ -262,27 +278,27 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
};
//修改邮箱
$scope.updateEmail = function () {
$http.put('/client/partner_info/compliance_audit').then(
$http.put('/client/partner_info/complianceAudit').then(
);
};
$scope.commitToCompliance = function () {
$http.get('/client/partner_info/compliance/files').then(function (resp) {
$scope.complianceFiles = resp.data;
if($scope.complianceFiles.client_id_file == null||$scope.complianceFiles.client_bank_file == null || $scope.complianceFiles.client_company_file == null){
if ($scope.complianceFiles.client_id_file == null || $scope.complianceFiles.client_bank_file == null || $scope.complianceFiles.client_company_file == null) {
commonDialog.alert({title: 'Message', content: '请前去完善合规资料,再进行提交!', type: 'info'});
return;
}
if($scope.partner.business_structure == null ||$scope.partner.logo_url == null || $scope.partner.description == null ||($scope.partner.partner_type == 'website' && $scope.partner.company_website == null) || ($scope.partner.partner_type == 'photo'&&($scope.partner.store_photo == null || $scope.partner.company_photo == null))){
if ($scope.partner.business_structure == null || $scope.partner.logo_url == null || $scope.partner.description == null || ($scope.partner.partner_type == 'website' && $scope.partner.company_website == null) || ($scope.partner.partner_type == 'photo' && ($scope.partner.store_photo == null || $scope.partner.company_photo == null))) {
commonDialog.alert({title: 'Message', content: '请前去完善商户资料,再进行提交!', type: 'info'});
return;
}
if(($scope.partner.business_structure == "Company" && $scope.partner.acn == null) || ($scope.partner.business_structure != "Company" && $scope.partner.abn == null)){
if (($scope.partner.business_structure == "Company" && $scope.partner.acn == null) || ($scope.partner.business_structure != "Company" && $scope.partner.abn == null)) {
commonDialog.alert({title: 'Message', content: '请前去完善商户资料,再进行提交!', type: 'info'});
return;
}
if(!$scope.partner.mail_confirm){
if (!$scope.partner.mail_confirm) {
commonDialog.alert({title: 'Message', content: '请验证邮箱后,再进行提交!', type: 'info'});
return;
}
@ -296,7 +312,7 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
}).then(function (choice) {
$scope.submitted = true;
if (choice == 1) {
$http.post('/client/partner_info/compliance_audit').then(function (){
$http.post('/client/partner_info/complianceAudit').then(function () {
commonDialog.alert({title: 'Success', content: '已提交至合规,请耐心等待审核!', type: 'info'});
$state.reload();
}, function () {
@ -307,7 +323,7 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
});
}
}]);
app.controller('clientPartnerEditCtrl', ['$scope', '$http', 'commonDialog','stateMap','countryMap','partner','$state','Upload',function ($scope, $http, commonDialog,stateMap,countryMap,partner,$state,Upload) {
app.controller('clientPartnerEditCtrl', ['$scope', '$http', 'commonDialog', 'stateMap', 'countryMap', 'partner', '$state', 'Upload', function ($scope, $http, commonDialog, stateMap, countryMap, partner, $state, Upload) {
$scope.partner = partner.data;
$scope.states = stateMap.configs();
$scope.countries = countryMap.configs();
@ -405,7 +421,7 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
var removeClientPayDesc = function (items, key) {
for (var i = 0; i < items.length; i++) {
var item = items[i];
if (item.indexOf(key)>=0) {
if (item.indexOf(key) >= 0) {
items.splice(items.indexOf(item), 1);
i = i - 1;
}
@ -419,7 +435,7 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
var $idx = $scope.partner.client_pay_desc.indexOf(type);
if ($idx >= 0) {
if (type == '203') {
removeClientPayDesc($scope.partner.client_pay_desc,'2030')
removeClientPayDesc($scope.partner.client_pay_desc, '2030')
}
$scope.partner.client_pay_desc.splice($idx, 1);
} else {
@ -441,7 +457,7 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
alert("Logo is necessary!");
return;
}
if($scope.partner.partner_type == 'photo'){
if ($scope.partner.partner_type == 'photo') {
if (!$scope.partner.company_photo) {
alert('Shop Photo1 is necessary');
return;
@ -453,11 +469,11 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
}
var content = '';
if ($scope.partner.client_pay_type.length==0) {
if ($scope.partner.client_pay_type.length == 0) {
alert('请选择商户支付场景')
return;
}
if ($scope.partner.client_pay_desc.length==0) {
if ($scope.partner.client_pay_desc.length == 0) {
alert('请选择商户支付方式')
return;
}
@ -467,7 +483,7 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
return;
}
}
if ( $scope.partner.client_pay_type.indexOf('2') >= 0) {
if ($scope.partner.client_pay_type.indexOf('2') >= 0) {
if ($scope.partner.client_pay_desc.join(',').indexOf('20') < 0) {
alert("请检查线下支付场景是否已选择支付方式");
return;
@ -502,26 +518,26 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
};
}]);
app.controller('clientResetPartnerPublicKeyDialogCtrl', ['$scope', '$http', 'gateway_sign', function ($scope, $http,gateway_sign) {
app.controller('clientResetPartnerPublicKeyDialogCtrl', ['$scope', '$http', 'gateway_sign', function ($scope, $http, gateway_sign) {
$scope.gateway_sign = angular.copy(gateway_sign);
$scope.uploadPublicKey = function (mch_public_key) {
$scope.errmsg = null;
$http.put('/client/partner_info/partner_public_key', {partner_public_key:mch_public_key}).then(function () {
$http.put('/client/partner_info/partner_public_key', {partner_public_key: mch_public_key}).then(function () {
$scope.$close();
}, function (resp) {
$scope.errmsg = resp.data.message;
})
}
}]);
app.controller('clientRefreshPlatformPublicKeyDialogCtrl', ['$scope', '$http', 'gateway_sign','commonDialog', function ($scope, $http,gateway_sign,commonDialog) {
app.controller('clientRefreshPlatformPublicKeyDialogCtrl', ['$scope', '$http', 'gateway_sign', 'commonDialog', function ($scope, $http, gateway_sign, commonDialog) {
$scope.gateway_sign = angular.copy(gateway_sign);
$scope.copyPublicKey = function() {
var e=document.getElementById("c-cpKey");
$scope.copyPublicKey = function () {
var e = document.getElementById("c-cpKey");
e.select();
var successful = document.execCommand("Copy");
if (successful) {
commonDialog.alert({title: 'Success', content: '已复制到剪切板!', type: 'success'});
}else {
} else {
commonDialog.alert({title: 'Error', content: '您的浏览器不支持!请手动复制', type: 'error'});
}
};
@ -711,11 +727,11 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
}
};
/* $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.updateFile = function () {
$http.put('/client/partner_info/update/file', $scope.file).then(function () {
commonDialog.alert({
@ -739,7 +755,268 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
$scope.commitPartner = function () {
if ($scope.file) {
if ($scope.file.file_bank_info != null && $scope.file.file_company_info != null && $scope.file.file_id_info != null && $scope.file_apply_info != null) {
$http.put('/client/partner_info/compliance_audit').then(function (resp) {
$http.put('/client/partner_info/complianceAudit').then(function (resp) {
});
} else {
commitError();
}
} else {
commitError();
}
};
}]);
app.controller('clientCommitToComplianceFilesCtrl', ['$scope', '$http', '$rootScope', 'commonDialog', '$state', 'Upload', 'file','partner', function ($scope, $http, $rootScope, commonDialog, $state, Upload, file, partner) {
$scope.file = file.data || {};
$scope.partner = partner.data || {};
//audit files
$scope.uploadBankFile = function (file) {
if (file != null) {
if (file.size > 3 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'})
} else {
$scope.bankFileProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.bankFileProgress;
$scope.file.file_bank_info = resp.data.url;
$scope.updateFile();
if ($scope.file.file_bank_info.endsWith('pdf')) {
$scope.bankIsImage = false;
} else {
$scope.bankIsImage = true;
}
}, function (resp) {
delete $scope.bankFileProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.bankFileProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
$scope.agreeIsImage = true;
if ($scope.file.file_agreement_info && $scope.file.file_agreement_info.endsWith('pdf')) {
$scope.agreeIsImage = false;
}
$scope.bankIsImage = true;
if ($scope.file.file_bank_info && $scope.file.file_bank_info.endsWith('pdf')) {
$scope.bankIsImage = false;
}
$scope.companyIsImage = true;
if ($scope.file.file_company_info && $scope.file.file_company_info.endsWith('pdf')) {
$scope.companyIsImage = false;
}
$scope.applyIsImage = true;
if ($scope.file.file_apply_info && $scope.file.file_apply_info.endsWith('pdf')) {
$scope.applyIsImage = false;
}
$scope.idIsImage = true;
if ($scope.file.file_id_info && $scope.file.file_id_info.endsWith('pdf')) {
$scope.idIsImage = false;
}
$scope.uploadCompanyFile = function (file) {
if (file != null) {
if (file.size > 3 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'})
} else {
$scope.companyFileProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.companyFileProgress;
$scope.file.file_company_info = resp.data.url;
$scope.updateFile();
if ($scope.file.file_company_info.endsWith('pdf')) {
$scope.companyIsImage = false;
} else {
$scope.companyIsImage = true;
}
}, function (resp) {
delete $scope.companyFileProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.companyFileProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
//上传ID信息
$scope.uploadIDFile = function (file) {
if (file != null) {
if (file.size > 3 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'})
} else {
$scope.idFileProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.idFileProgress;
$scope.file.file_id_info = resp.data.url;
$scope.updateFile();
if ($scope.file.file_id_info.endsWith('pdf')) {
$scope.idIsImage = false;
} else {
$scope.idIsImage = true;
}
}, function (resp) {
delete $scope.idFileProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.idFileProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
//上传协议文件
$scope.uploadAgreementFile = function (file) {
if (file != null) {
if (file.size > 10 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过5MB请压缩后重试', type: 'error'})
} else {
$scope.agreementFileProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.agreementFileProgress;
$scope.file.file_agreement_info = resp.data.url;
$scope.updateFile();
if ($scope.file.file_agreement_info.endsWith('pdf')) {
$scope.agreeIsImage = false;
} else {
$scope.agreeIsImage = true;
}
}, function (resp) {
delete $scope.agreementFileProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.agreementFileProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
//上传申请表
$scope.uploadApplyFile = function (file) {
if (file != null) {
if (file.size > 3 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'})
} else {
$scope.applyFileProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.applyFileProgress;
$scope.file.file_apply_info = resp.data.url;
$scope.updateFile();
if ($scope.file.file_apply_info.endsWith('pdf')) {
$scope.applyIsImage = false;
} else {
$scope.applyIsImage = true;
}
}, function (resp) {
delete $scope.applyFileProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.applyFileProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
/* $scope.downloadAsZip = function () {
var url = '/sys/partners/' + $scope.partner.client_moniker + '/download/complianceAsZIP';
return url;
};
*/
$scope.updateFile = function () {
$http.put('/client/partner_info/update/wait_compliance_file', $scope.file).then(function () {
commonDialog.alert({
title: 'Success',
content: 'Upload Successful',
type: 'success'
});
$state.reload();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
})
};
function commitError() {
commonDialog.alert({
title: 'Error',
content: 'Missing file',
type: 'error'
});
};
$scope.clientComplianceViewCommit = function () {
if (!$scope.file.client_agree_file) {
commonDialog.alert({title: 'Error', content: '请提交* Agreement', type: 'error'});
return;
} else if (!$scope.file.client_id_file) {
commonDialog.alert({title: 'Error', content: '请提交* ID', type: 'error'});
return;
} else if (!$scope.file.client_bank_file) {
commonDialog.alert({title: 'Error', content: '请提交* bank statement', type: 'error'});
return;
} else if (!$scope.file.client_company_file) {
commonDialog.alert({title: 'Error', content: '请提交* Certificate of Registration', type: 'error'});
return;
}
;
commonDialog.confirm({
title: 'Warning',
content: 'Are you sure commit for compliance audit?'
}).then(function () {
$http.post('/client/partner_info/clientCompliance/' + $scope.partner.client_moniker + '/viewCommit', $scope.file).then(function () {
commonDialog.alert({
title: 'Success',
content: 'Commit Successful',
type: 'success'
});
$state.reload();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
})
})
};
$scope.deleteComplianceFiles = function (file_id) {
$scope.file_id = file_id;
commonDialog.confirm({
title: 'Warning',
content: 'This operation will delete the file, Are you sure?'
}).then(function () {
$http.put('/client/partner_info/auth_file/' + $scope.file_id + '/delete').then(function (resp) {
commonDialog.alert({
title: 'Success',
content: 'Delete Successful',
type: 'success'
});
$state.reload();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
})
})
};
$scope.commitPartner = function () {
if ($scope.file) {
if ($scope.file.file_bank_info != null && $scope.file.file_company_info != null && $scope.file.file_id_info != null && $scope.file_apply_info != null) {
$http.put('/client/partner_info/complianceAudit').then(function (resp) {
});
} else {
@ -749,9 +1026,114 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
commitError();
}
};
}]);
app.controller('clientPaymentInfoCtrl', ['$scope', '$http', '$state', 'commonDialog','$uibModal', function ($scope, $http, $state, commonDialog, $uibModal) {
app.controller('aggregateFileCtrl', ['$scope', '$http', '$rootScope', 'commonDialog', '$state', '$uibModal', 'Upload', function ($scope, $http, $rootScope, commonDialog, $state, $uibModal, Upload) {
$scope.signInfo = {};
$scope.confirmBtn = false;
$scope.signItBtn = true;
$scope.aggregateFile = function () {
$http.get('/client/partner_info/aggregateFile/client_info').then(function (resp) {
$scope.aggregateFileInfo = resp.data;
}, function (resp) {
commonDialog.alert({
title: '生成合同失败',
content: "错误原因:" + resp.data.message + ",请联系BD或客服",
type: 'error'
});
var url = $state.href('compliance_to_perfect');
window.open(url);
})
};
$scope.aggregateFile();
$scope.goBottom = function () {
window.scrollTo(0, document.documentElement.scrollHeight - document.documentElement.clientHeight);
$uibModal.open({
backdrop: false,
templateUrl: '/static/payment/partner/templates/agreement_signature_dialog.html',
controller: 'agreementSignDialogCtrl',
size: 'md'
}).result.then(function (result) {
$scope.confirmBtn = true;
$scope.signItBtn = false;
$scope.signInfo.fullName = result.fullName;
$scope.signInfo.src = result.src;
})
};
$scope.submitContract = function () {
$uibModal.open({
backdrop: false,
templateUrl: '/static/payment/partner/templates/confirmForSubmit.html',
controller: 'submitContractCtrl',
size: 'md'
}).result.then(function (result) {
$scope.uploadSign();
})
};
$scope.uploadSign = function () {
if ($scope.signInfo.fullName == null || $scope.signInfo.fullName == "") {
commonDialog.alert({title: 'Submit Fail', content: 'Please confirm full name entered', type: 'error'});
return;
}
if ($scope.signInfo.src == null || $scope.signInfo.src == "") {
commonDialog.alert({title: 'Submit Fail', content: 'Please confirm signature', type: 'error'});
return;
}
document.getElementById("loading_logo").style ="";
$scope.white();
var signFile = dataURLtoFile($scope.signInfo.src, $scope.signInfo.fullName);
$scope.logoProgress = {value: 0};
Upload.upload({
url: '/client/partner_info/clientCompliance/' + $scope.aggregateFileInfo.client_moniker + '/commit_aggregate_file',
data: {file: signFile}
}).then(function (resp) {
document.getElementById('loading').style.display = "none";
document.getElementById('loading_logo').style.display = "none";
delete $scope.logoProgress;
$state.go('compliance_to_perfect', {reload: true});
window.open(resp.data.file_value, '_blank');
}, function (resp) {
delete $scope.logoProgress;
document.getElementById('loading').style.display = "none";
document.getElementById('loading_logo').style.display = "none";
commonDialog.alert({title: 'Commit Aggregate File Fail', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.logoProgress.value = parseInt(100 * evt.loaded / evt.total);
});
};
$scope.white=function(){
$("#loading").css({
"position":"absolute",    //绝对位置
"display":"block",    //让对象成为块级元素
"background-color":"white",  //背景白色
"z-index":"9999",  //最上层显示
"opacity":"0.7"  //背景透明度
});
}
function dataURLtoFile(dataurl, filename) {//将base64转换为文件
var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1],
bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
while (n--) {
u8arr[n] = bstr.charCodeAt(n);
}
return new File([u8arr], filename, {type: mime});
}
}]);
app.controller('clientPaymentInfoCtrl', ['$scope', '$http', '$state', 'commonDialog', '$uibModal', function ($scope, $http, $state, commonDialog, $uibModal) {
$scope.paymentInfo = $scope.partner;
$scope.old_customer_surcharge_rate = angular.copy($scope.partner.customer_surcharge_rate);
$scope.qrConfig = {currency: 'AUD'};
@ -760,13 +1142,13 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
switch_verify_ip: false
};
$scope.clientCopyHfLink = function() {
var e=document.getElementById("c-cpbt");
$scope.clientCopyHfLink = function () {
var e = document.getElementById("c-cpbt");
e.select();
var successful = document.execCommand("Copy");
if (successful) {
commonDialog.alert({title: 'Success', content: '已复制到剪切板!', type: 'success'});
}else {
} else {
commonDialog.alert({title: 'Error', content: '您的浏览器不支持!', type: 'error'});
}
};
@ -787,7 +1169,7 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
}
$http.put('/client/partner_info/switch_gateway_v2', {enable_gateway_version2: $scope.paymentInfo.enable_gateway_version2}).then(function () {
$scope.loadPartnerPaymentInfo();
}, function (resp) {
}, function (resp) {
commonDialog.alert({
title: 'failed to change Gateway Version',
content: resp.data.message,
@ -834,7 +1216,11 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
}
}
}).result.then(function () {
commonDialog.alert({title: 'Success!', content: 'Partner Public Key Upload Successfully', type: 'success'})
commonDialog.alert({
title: 'Success!',
content: 'Partner Public Key Upload Successfully',
type: 'success'
})
$scope.loadPartnerPaymentInfo();
})
};
@ -851,7 +1237,11 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
}
}
}).result.then(function () {
commonDialog.alert({title: 'Success!', content: 'RoyalPay Public Key Refresh Successfully', type: 'success'})
commonDialog.alert({
title: 'Success!',
content: 'RoyalPay Public Key Refresh Successfully',
type: 'success'
})
$scope.loadPartnerPaymentInfo();
})
};
@ -868,17 +1258,21 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
}
}
}).result.then(function () {
commonDialog.alert({title: 'Success!', content: 'Refund Password Changed Successfully', type: 'success'})
commonDialog.alert({
title: 'Success!',
content: 'Refund Password Changed Successfully',
type: 'success'
})
})
};
$scope.clientCopyCBBannkPayLink = function() {
var e=document.getElementById("c-cpcbbankpay");
$scope.clientCopyCBBannkPayLink = function () {
var e = document.getElementById("c-cpcbbankpay");
e.select();
var successful = document.execCommand("Copy");
if (successful) {
commonDialog.alert({title: 'Success', content: '已复制到剪切板!', type: 'success'});
}else {
} else {
commonDialog.alert({title: 'Error', content: '您的浏览器不支持!', type: 'error'});
}
};
@ -1065,61 +1459,61 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
slidesPc.push({
image: '/static/images/hfpaylink_intro/pc_hf_pay_step1.png',
text: '第一次打开支付链接进行下单,第一步用微信扫码页面弹出的二维码,确认您的身份',
id:0
id: 0
});
slidesPc.push({
image: '/static/images/hfpaylink_intro/pc_hf_pay_step2.png',
text: '下一步填写订单信息。注意订单金额货币单位是澳元AUD。请认真填写商品名称否则可能导致交易不成功。填写完成最后提交订单。',
id:1
id: 1
});
slidesPc.push({
image: '/static/images/hfpaylink_intro/pc_hf_pay_step3.png',
text: '页面显示支付二维码使用相应的支付app进行扫码支付。如订单有误请点击"返回上一步"修改订单。',
id:2
id: 2
});
slidesPc.push({
image: '/static/images/hfpaylink_intro/hf_pay_end.png',
text: '完成支付,跳转到支付成功页面。',
id:3
id: 3
});
};
var addSlidePcBank = function () {
slidesPcBank.push({
image: '/static/images/hfpaylink_intro/pc_bank_hf_pay_step1.png',
text: '第一次打开支付链接进行下单,第一步用微信扫码页面弹出的二维码,确认您的身份',
id:0
id: 0
});
slidesPcBank.push({
image: '/static/images/hfpaylink_intro/pc_bank_hf_pay_step2.png',
text: '下一步填写订单信息。注意订单金额货币单位是澳元AUD。请认真填写商品名称否则可能导致交易不成功。填写完成最后提交订单。',
id:1
id: 1
});
slidesPcBank.push({
image: '/static/images/hfpaylink_intro/pc_bank_hf_pay_step3.png',
text: '提交订单后,页面跳转到对应银行,请填写相关信息完成支付。',
id:2
id: 2
});
slidesPcBank.push({
image: '/static/images/hfpaylink_intro/hf_pay_end.png',
text: '完成支付,跳转到支付成功页面。',
id:3
id: 3
});
};
var addSlideApp = function () {
slidesApp.push({
image: '/static/images/hfpaylink_intro/app_bank_hf_pay_step1.png',
text: '使用微信客户端填写订单信息。注意订单金额货币单位是澳元AUD。请认真填写商品名称否则可能导致交易不成功。填写完成最后提交订单。',
id:0
id: 0
});
slidesApp.push({
image: '/static/images/hfpaylink_intro/app_bank_hf_pay_step2.png',
text: '提交订单后,页面跳转到汇付天下支付页面,请填写相关信息完成支付。',
id:1
id: 1
});
};
$scope.toPcFirst = function () {
$scope.reset();
if(!$scope.pcfirst) {
if (!$scope.pcfirst) {
return;
}
addSlidePc();
@ -1127,7 +1521,7 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
};
$scope.toBankFirst = function () {
$scope.reset();
if(!$scope.bankfirst) {
if (!$scope.bankfirst) {
return;
}
addSlidePcBank();
@ -1135,7 +1529,7 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
};
$scope.toAppFirst = function () {
$scope.reset();
if(!$scope.appfirst) {
if (!$scope.appfirst) {
return;
}
addSlideApp();
@ -1177,8 +1571,8 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
commonDialog.confirm({
title: 'Warning',
content: 'Refresh Credential will expire the current one, ' +
'which will cause the current payment service disabled. ' +
'Are you sure going on?'
'which will cause the current payment service disabled. ' +
'Are you sure going on?'
}).then(function () {
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/credential_code').then(function () {
$state.reload();
@ -1232,9 +1626,9 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
})
}
}]);
app.controller('clientClearingConfigCtrl', ['$scope', '$http','$state','commonDialog', function ($scope, $http,$state,commonDialog) {
$scope.bankCtrl = {rate_name:'Wechat'};
$scope.init = {manual:false};
app.controller('clientClearingConfigCtrl', ['$scope', '$http', '$state', 'commonDialog', function ($scope, $http, $state, commonDialog) {
$scope.bankCtrl = {rate_name: 'Wechat'};
$scope.init = {manual: false};
$scope.getBankAccount = function () {
$http.get('/client/partner_info/bank_account').then(function (resp) {
$scope.bankaccount = resp.data;
@ -1251,32 +1645,32 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
});
};
$scope.manualSettle = function (manualSettle) {
if(!$scope.init.manual){
if (!$scope.init.manual) {
$scope.init.manual = true;
return;
}
var waring_messsage;
if(manualSettle){
if (manualSettle) {
waring_messsage = "Open"
}else {
} else {
waring_messsage = "Close"
}
commonDialog.confirm({
title: 'Confirmation',
content: 'Are you sure to '+waring_messsage+'?',
}).then(function(){
$http.put('/client/partner_info/manual_settle?'+'manual_settle='+manualSettle).then(function (resp) {
},function (resp) {
content: 'Are you sure to ' + waring_messsage + '?',
}).then(function () {
$http.put('/client/partner_info/manual_settle?' + 'manual_settle=' + manualSettle).then(function (resp) {
}, function (resp) {
commonDialog.alert({title: 'Error!', content: resp.data.message, type: 'error'})
})
},function () {
}, function () {
$state.reload();
});
};
$scope.getRates();
}]);
app.controller('clientSubPartnersCtrl', ['$scope', '$http','partner', function ($scope, $http,partner) {
app.controller('clientSubPartnersCtrl', ['$scope', '$http', 'partner', function ($scope, $http, partner) {
$scope.partner = partner.data;
$scope.loadSubPartners = function () {
$http.get('/client/partner_info/sub_partners').then(function (resp) {
@ -1292,7 +1686,7 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
};
$scope.loadSubPartners();
}]);
app.controller('clientDeviceCtrl','newDive','newDeviceDialogCtrl', ['$scope', '$http', 'orderService', 'commonDialog', 'refunder','$filter', '$uibModal', function ($scope, $http, orderService, commonDialog, refunder,$filter,$uibModal) {
app.controller('clientDeviceCtrl', 'newDive', 'newDeviceDialogCtrl', ['$scope', '$http', 'orderService', 'commonDialog', 'refunder', '$filter', '$uibModal', function ($scope, $http, orderService, commonDialog, refunder, $filter, $uibModal) {
$scope.pagination = {};
$scope.params = {};
/**
@ -1398,8 +1792,26 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
};
}]);
app.controller('submitContractCtrl', ['$scope', '$http', function ($scope, $http) {
$scope.choice = false;
$scope.chooseYes = function () {
$scope.choice = true;
$scope.$close($scope.choice);
};
}]);
app.controller('agreementSignDialogCtrl', ['$scope', '$http', 'commonDialog', function ($scope, $http, commonDialog) {
$scope.submitSign = function (fullName) {
var sign = $("#signature").jSignature('getData', 'image');
var signInfo = {};
signInfo.src = 'data:' + sign[0] + ',' + sign[1];
signInfo.fullName = fullName;
$scope.$close(signInfo);
};
}]);
return app;
});

@ -0,0 +1,112 @@
define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiSelect'], function (angular) {
'use strict';
var app = angular.module('complianceAuthFile', ['ui.bootstrap', 'ui.router', 'frapontillo.bootstrap-switch', 'ngFileUpload', 'ui.select']);
app.config(['$stateProvider', function ($stateProvider) {
$stateProvider.state('partner_compliance_auth', {
url: '/partners/complianceForClient',
templateUrl: 'static/sys/templates/partner_compliance_for_client.html',
controller: 'compliancePartnerForClientCtrl'
}).state('compliance_detail', {
url: '/{client_moniker}/compliance_detail',
templateUrl: '/static/payment/partner/templates/client_compliance_to_auth.html',
controller: 'partnerComplianceCompanyDetail',
resolve: {
file: ['$http','$stateParams',function ($http, $stateParams) {
return $http.get('/compliance/audit/compliance/clientViewFiles/'+ $stateParams.client_moniker);
}]
}
}).state('partner_detail', {
url: '/{client_moniker}/partner_detail',
templateUrl: '/static/payment/partner/templates/partner_detail_for_compliance.html',
controller: 'partnerComplianceCompanyDetail',
resolve: {
file: ['$http','$stateParams',function ($http, $stateParams) {
return $http.get('/compliance/audit/compliance/clientViewFiles/'+ $stateParams.client_moniker);
}]
}
}).state('compliance_for_audit_detail', {
url: '/partner/complianceForAudit',
templateUrl: '/static/payment/partner/templates/compliance_auth.html',
controller: 'partnerComplianceAuditCtrl',
})
}]);
app.controller('compliancePartnerForClientCtrl', ['$scope', '$sce', '$http', '$filter', '$uibModal', 'businessStructuresMap', 'industryMap', 'stateMap', 'sectorMap', 'countryMap',
function ($scope, $sce, $http, $filter, $uibModal, businessStructuresMap, industryMap, stateMap, sectorMap, countryMap) {
$scope.pagination = {};
$scope.industries = industryMap.configs();
$scope.states = stateMap.configs();
$scope.countries = countryMap.configs();
$scope.params = {};
$scope.loadClientCompliance = function (page) {
var params = angular.copy($scope.params);
params.page = page || $scope.pagination.page || 1;
$http.get('/compliance/audit/listClientCompliances', {params: params}).then(function (resp) {
$scope.compliances = resp.data.data;
$scope.pagination = resp.data.pagination;
});
};
$scope.loadClientCompliance(1);
$scope.statusSelected = function (arr) {
return $scope.params.status != null && $scope.params.status.filter(function (status) {
return arr.indexOf(status) >= 0
}).length > 0
};
}]);
app.controller('partnerComplianceCompanyDetail', ['$rootScope', '$scope', '$http', '$state', '$uibModal', 'commonDialog', 'file', function ($rootScope, $scope, $http, $state, $uibModal, commonDialog, file) {
$scope.file = file.data || {};
$scope.partner = $scope.file.client;
$scope.passPartnerComplianceFiles = function () {
commonDialog.confirm({
title: 'Confirm!',
content: '确认是否通过商户合规文件?'
}).then(function () {
$http.put('/compliance/audit/'+$scope.file.client.client_id+'/pass/complianceFile',{}).then(function (resp) {
$state.reload();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
})
})
}
$scope.refusePartnerComplianceFiles = function (obj) {
var partner = angular.copy(obj);
$uibModal.open({
templateUrl: '/static/payment/partner/templates/refuse_reason.html',
controller: 'refusePartnerComplianceFilesCtrl',
resolve: {
partner: partner
}
})
};
}]);
app.controller('refusePartnerComplianceFilesCtrl', ['$scope', '$http', '$state', 'partner', function ($scope, $http, $state, partner) {
$scope.partner = angular.copy(partner);
$scope.partner.description = "";
$scope.refusePartnerComplianceFiles = function () {
var a = $scope.partner.description;
$http.put('/compliance/audit/'+$scope.partner.client_id+'/refuse/complianceFile',{description:$scope.partner.description}).then(function (resp) {
$state.reload();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
})
}
}]);
app.controller('partnerComplianceAuditCtrl', ['$rootScope','$state','$stateParams', function ($rootScope,$state,$stateParams) {
if ($state.is('compliance_for_audit_detail')){
$state.go('partner_detail');
}
}]);
return app;
});

@ -0,0 +1,46 @@
<script src="static/lib/jSignature/jquery.js"></script>
<script src="static/lib/jSignature/jSignature.js"></script>
<style>
.dialog{
font-size: 17px;
}
</style>
<!--<div class="modal-header bg-green">-->
<!-- <h4 style="text-align: center">Sign</h4>-->
<!--</div>-->
<div class="modal-body">
<div class="row dialog">
<div class="container-fluid">
<div class="" style="overflow-x: auto;">
<span style="color:#f39c12">* Please sign here</span>
<div id="signatureparent" class="sign">
<div id="signature" style="border:1px solid black;background-color: white; lineWidth:5; color: black "></div>
<div style="float:right">
</div>
</div>
<div style="margin-top: 20px;">
<span>* Print Full Name:</span>
<input id="full_name" ng-model="fullName" style="height: 40px;width: 60%;font-size: 100%;margin-left: 20px" required />
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-success" ng-click="submitSign(fullName);$dismiss()" type="button">Submit</button>
<button class="btn btn-warning" onclick="reset()" >Clear</button>
<button class="btn btn-danger" ng-click="$dismiss()" type="button">Cancel</button>
</div>
<script>
$(function() {
$("#signature").jSignature();
})
function reset() {
$("#signature").jSignature('reset');
}
</script>

@ -0,0 +1,168 @@
<style type="text/css">
img {
width: 100%;
}
</style>
<div class="content">
<div class="row">
<div class="col-sm-12">
<div class="nav-tabs-custom">
<ul class="nav nav-tabs">
<li ui-sref-active-eq="active">
<a ui-sref="partner_detail({client_moniker:partner.client_moniker})">Partner Detail</a>
</li>
<li ui-sref-active="active">
<a ui-sref="compliance_detail({client_moniker:partner.client_moniker})">Compliance Audit</a>
</li>
</ul>
<div class="tab-content" ui-view>
<div class="panel panel-default">
<div class="panel-body">
<div class="form-group">
<label class="control-label col-sm-2">商户合规文件审核详情:</label>
<div class="col-sm-10">
<p class="form-control-static">
<span ng-if="file.file_company.status==0">待审核</span>
<span ng-if="file.file_company.status==1">通过</span>
<span ng-if="file.file_company.status==2">打回<p class="small text-danger" ng-if="file.file_company.description && file.file_company.description!=' '"> 打回原因:({{file.file_company.description}}</p></span>
</p>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">Partner Code</label>
<div class="col-sm-10">
<p class="form-control-static">
<span id="parent_code">{{partner.client_moniker}}</span>
</p>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">Company Name</label>
<div class="col-sm-10">
<p class="form-control-static">
<span ng-bind="partner.company_name"></span>
<span
ng-if="isComplianceOfCompanyName && partner.open_status"
style="margin-left: 10px;font-weight: 700;color: red;">
注意:(微信渠道可能不合规)
</span>
<span class="description-text text-red" ng-bind="partner.same_company_name"></span>
</p>
</div>
</div>
</div>
<div class="panel-heading" ng-if="'10'|withRole">Audit Files &nbsp;&nbsp;&nbsp;
<button class="btn-group btn btn-warning" type="button"
ng-click="passPartnerComplianceFiles()" ng-if="file.file_company.status !=1 && file.file_company.status !=2" >PASS
</button>
<button class="btn btn-danger" type="button"
ng-click="refusePartnerComplianceFiles(file.client)" ng-if="file.file_company.status !=1 && file.file_company.status !=2">REFUSE
</button>
<button class="btn-group btn btn-warning" type="button" ng-if="file.file_company.status == 1" >Already Passed
</button>
<button class="btn btn-danger" type="button" ng-if=" file.file_company.status == 2">Already Refused
</button>
</div>
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group">
<label class="control-label col-sm-4" style="text-align: center;">* bank statement
<span ng-if="file.client_bank_file[0].status == 0" class="small text-dark">(未提交)</span>
<span ng-if="file.client_bank_file[0].status == 1" class="small text-success">(已通过)</span>
<span ng-if="file.client_bank_file[0].status == 2" class="small text-danger">(待审核)</span>
<span ng-if="file.client_bank_file[0].status == 3" class="small text-danger">(已驳回)</span>
</label>
<div class="col-sm-6">
<table>
<tbody>
<tr ng-repeat="file_src in file.client_bank_file track by $index">
<td ng-bind="$index+1+'.'" ALIGN="left" VALIGN="top" class="btn">1</td>
<td><a target="_blank" ng-href="{{file_src.file_value}}">
<img class="col-sm-6" style="border: 1px solid #ddd" ng-src="{{file_src.file_value}}" class="col-sm-8" onerror="this.src='https://static.easyicon.net/preview/118/1184255.gif'">
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4" style="text-align: center;">* Certificate of Registration
<span ng-if="file.client_company_file[0].status == 0" class="small text-dark">(未提交)</span>
<span ng-if="file.client_company_file[0].status == 1" class="small text-success">(已通过)</span>
<span ng-if="file.client_company_file[0].status == 2" class="small text-danger">(待审核)</span>
<span ng-if="file.client_company_file[0].status == 3" class="small text-danger">(已驳回)</span>
</label>
<div class="col-sm-6">
<table>
<tbody>
<tr ng-repeat="file_src in file.client_company_file track by $index">
<td ng-bind="$index+1+'.'" class="btn">1</td>
<td><a target="_blank" ng-href="{{file_src.file_value}}">
<img class="col-sm-6" style="border: 1px solid #ddd" ng-src="{{file_src.file_value}}" class="col-sm-8" onerror="this.src='https://static.easyicon.net/preview/118/1184255.gif'">
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4" style="text-align: center;">* ID
<span ng-if="file.client_id_file[0].status == 0" class="small text-dark">(未提交)</span>
<span ng-if="file.client_id_file[0].status == 1" class="small text-success">(已通过)</span>
<span ng-if="file.client_id_file[0].status == 2" class="small text-danger">(待审核)</span>
<span ng-if="file.client_id_file[0].status == 3" class="small text-danger">(已驳回)</span>
</label>
<div class="col-sm-6">
<table>
<tbody>
<tr ng-repeat="file_src in file.client_id_file track by $index">
<td ng-bind="$index+1+'.'" class="btn">1</td>
<td><a target="_blank" ng-href="{{file_src.file_value}}">
<img class="col-sm-6" style="border: 1px solid #ddd" ng-src="{{file_src.file_value}}" class="col-sm-8" onerror="this.src='https://static.easyicon.net/preview/118/1184255.gif'">
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4" style="text-align: center;">* Agreement
<span ng-if="file.client_agree_file[0].status == 0" class="small text-dark">(未提交)</span>
<span ng-if="file.client_agree_file[0].status == 1" class="small text-success">(已通过)</span>
<span ng-if="file.client_agree_file[0].status == 2" class="small text-danger">(待审核)</span>
<span ng-if="file.client_agree_file[0].status == 3" class="small text-danger">(已驳回)</span>
</label>
<div class="col-sm-6">
<table>
<tbody>
<tr ng-repeat="file_src in file.client_agree_file track by $index">
<td ng-bind="$index+1+'.'" class="btn">1</td>
<td><a target="_blank" ng-href="{{file_src.file_value}}">
<img class="col-sm-6" style="border: 1px solid #ddd" ng-src="{{file_src.file_value}}" class="col-sm-8" onerror="this.src='https://static.easyicon.net/preview/118/1184255.gif'">
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

@ -0,0 +1,201 @@
<style type="text/css">
img {
width: 100%;
}
</style>
<section class="content-header">
<h1>商户合规文件补充
<span class="small text-danger" style="margin: 20px 20px;font-size: 20px;" ng-if="file.client_refuse_reason">
({{file.client_refuse_reason}})</span>
</h1>
</section>
<div class="panel-body box box-warning ng-scope" style="margin-top: 20px;">
<div class="form-horizontal">
<div class="form-group">
<label class="control-label col-sm-3">* bank statement</label>
<div class="col-sm-3">
<div class="form-control-static">
<button class="btn btn-primary" type="button"
ngf-select="uploadBankFile($file)"
ng-if="file.client_bank_file.file_write && file.file_company.status != 0 && file.file_company.status!=1">
<i class="fa fa-upload"></i> Upload
</button>
</div>
<uib-progressbar value="bankFileProgress.value" ng-if="bankFileProgress"></uib-progressbar>
<!-- <a ng-if="bankIsImage" target="_blank" ng-repeat="src in file.client_bank_file" ng-href="{{src}}">
<img ng-src="{{src}}" class="col-sm-8">
</a>-->
<table>
<tbody>
<tr ng-repeat="file_src in file.client_bank_file.file_value track by $index">
<td ng-bind="$index+1+'.'" ALIGN="left" VALIGN="top" class="btn">1</td>
<td><a ng-if="bankIsImage" target="_blank" ng-href="{{file_src.file_value}}">
<img class="col-sm-6" style="border: 1px solid #ddd" ng-src="{{file_src.file_value}}"
class="col-sm-8"
onerror="this.src='https://static.easyicon.net/preview/118/1184255.gif'">
</a>
<button class="btn btn-danger" type="button"
ng-click="deleteComplianceFiles(file_src.file_id)"
ng-if="file.client_bank_file.file_write && file_src.status !=1 && file.file_company.status != 0 && file.file_company.status!=1">
X
</button>
</td>
</tr>
</tbody>
</table>
</div>
<div class="col-sm-3">
<div class="form-control-static">
<p>Example请保证图片信息清晰可见,如示例
<img class="col-sm-6" style="border: 1px solid #ddd"
src="https://file.royalpay.com.au/open/2017/03/07/1488859920633_5ruVtDa30yY2ytBSDAAqxg0Ob2nreh.jpeg">
</p>
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">* Certificate of Registration</label>
<div class="col-sm-3">
<div class="form-control-static">
<button class="btn btn-primary" type="button"
ngf-select="uploadCompanyFile($file)"
ng-if="file.client_company_file.file_write && file.file_company.status != 0 && file.file_company.status!=1">
<i class="fa fa-upload"></i> Upload
</button>
</div>
<uib-progressbar value="companyFileProgress.value" ng-if="companyFileProgress"></uib-progressbar>
<!-- <a ng-if="companyIsImage" ng-repeat="src in file.client_company_file" ng-href="{{src}}" target="_blank">
<img ng-src="{{src}}" class="col-sm-8"></a>-->
<table>
<tbody>
<tr ng-repeat="file_src in file.client_company_file.file_value track by $index">
<td ng-bind="$index+1+'.'" class="btn">1</td>
<td><a ng-if="companyIsImage" target="_blank" ng-href="{{file_src.file_value}}">
<img ng-src="{{file_src.file_value}}" class="col-sm-8"
onerror="this.src='https://static.easyicon.net/preview/118/1184255.gif'">
</a>
<button class="btn btn-danger" type="button"
ng-click="deleteComplianceFiles(file_src.file_id)"
ng-if="file.client_company_file.file_write && file_src.status !=1 && file.file_company.status != 0 && file.file_company.status!=1">
X
</button>
</td>
</tr>
</tbody>
</table>
</div>
<div class="col-sm-5">
<div class="form-control-static">
<div class="col-sm-12">
<p class="col-sm-6">Example公司请提供以下文件图片,如示例
<img class="col-xs-12" style="border: 1px solid #ddd"
src="https://file.royalpay.com.au/open/2017/03/07/1488865011738_mW91ylSb5V1NJYu8jxvBPGNN49Zyel.jpeg">
</p>
<!--<img class="col-sm-12" src="https://file.royalpay.com.au/open/2017/03/07/1488864017622_BppIfz1yhMeoF0Z49rHt2gZIfVOihA.jpeg">-->
<p class="col-sm-6">sole trade个体户),partnership合伙,trust信托请在http://abr.business.gov.au将查询结果截图上传
<img class="col-sm-12" style="border: 1px solid #ddd"
src="https://file.royalpay.com.au/open/2017/03/07/1488860564017_37spL6phUySM27oRtO4cQ7FOJblYJ6.jpeg">
</p>
</div>
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">* ID </label>
<div class="col-sm-3">
<div class="form-control-static">
<button class="btn btn-primary" type="button"
ngf-select="uploadIDFile($file)"
ng-if="file.client_id_file.file_write && file.file_company.status != 0 && file.file_company.status!=1">
<i class="fa fa-upload"></i> Upload
</button>
</div>
<uib-progressbar value="idFileProgress.value" ng-if="idFileProgress"></uib-progressbar>
<!--<a ng-if="idIsImage" ng-repeat="src in file.client_id_file" ng-href="{{src}}" target="_blank">
<img ng-src="{{src}}" class="col-sm-8"></a>-->
<table>
<tbody>
<tr ng-repeat="file_src in file.client_id_file.file_value track by $index">
<td ng-bind="$index+1+'.'" class="btn">1</td>
<td><a ng-if="idIsImage" target="_blank" ng-href="{{file_src.file_value}}">
<img ng-src="{{file_src.file_value}}" class="col-sm-8"
onerror="this.src='https://static.easyicon.net/preview/118/1184255.gif'">
</a>
<button class="btn btn-danger" type="button"
ng-click="deleteComplianceFiles(file_src.file_id)"
ng-if="file.client_id_file.file_write && file_src.status !=1 && file.file_company.status != 0 && file.file_company.status!=1 ">
X
</button>
</td>
</tr>
</tbody>
</table>
</div>
<div class="col-sm-3">
<div class="form-control-static">
<div class="col-sm-12">
<p>Example请保证图片(护照或驾照)信息清晰可见,如示例
<img class="col-xs-6" style="border: 1px solid #ddd"
src="https://file.royalpay.com.au/open/2017/06/29/1498725651779_OPiqOP1dGnTpaxPsCR3P9lVrp4384b.jpg">
<img class="col-sm-6" style="border: 1px solid #ddd"
src="https://file.royalpay.com.au/open/2017/06/29/1498725678615_Bv2tzUtihY5U6YK9ScveXzKkVWOnrF.jpg">
</p>
</div>
</div>
</div>
</div>
<div class="form-horizontal">
<div class="form-group">
<label class="control-label col-sm-3">* Agreement</label>
<div class="col-sm-3">
<div class="form-control-static">
<a role="button" class="btn btn-primary"
ng-if="file.client_agree_file.file_value && file.file_company.status != 0 && file.file_company.status!=1 && file.client_less_file"
ui-sref="compliance_contract">Resign The Contract
</a>
<a role="button" class="btn btn-primary"
ng-if="!file.client_agree_file.file_value && file.file_company.status != 0 && file.file_company.status!=1 && file.client_less_file"
ui-sref="compliance_contract">Sign The Contract</a>
<a ng-if="file.client_agree_file.file_value" role="button" class="btn-group btn btn-warning"
type="button" ng-href="{{file.client_agree_file.file_value[0].file_value}}"
target="_blank"><i class="fa fa-download"></i></a>
<table>
<tbody>
<tr ng-repeat="file_src in file.client_agree_file.file_value track by $index">
<td ng-bind="$index+1+'.'" class="btn">1</td>
<td><a ng-if="agreeIsImage" target="_blank" ng-href="{{file_src.file_value}}">
<img ng-src="{{file_src.file_value}}" class="col-sm-8"
onerror="this.src='https://static.easyicon.net/preview/118/1184255.gif'">
</a>
<button class="btn btn-danger" type="button"
ng-click="deleteComplianceFiles(file_src.file_id)"
ng-if="file.client_id_file.file_write && file_src.status !=1 && file.file_company.status != 0 && file.file_company.status!=1 ">
X
</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="row" style="text-align: center">
<button style="width: 35%;height: 50px;font-size: 20px;margin-top: 40px;margin-bottom: 20px;" class="btn-group btn btn-success" type="button"
ng-click="clientComplianceViewCommit()"
ng-if="file.file_company.status != 0 && file.file_company.status!=1">Submit Files
</button>
</div>
</div>
</div>
</div>
<!--<div class="margin-bottom margin-top">-->
<!--<button class="btn-group btn btn-success" type="button" ng-click="updateFile()">Save-->
<!--</button>-->
<!--</div>-->

@ -52,6 +52,7 @@
<li ui-sref-active="active" ng-show="partner.source==4">
<a ui-sref=".compliance_files">Compliance files</a>
</li>
</ul>
<div class="tab-content" ui-view>
<div ng-show="(partner.source == 4 && (partner.approve_result ==3 || partner.approve_result == 1) ) || partner.source != 4">

@ -0,0 +1,65 @@
<div class="modal-header bg-green">
<h4 style="text-align: center">合规文件补充通知<span ng-if="file.data.client_refuse_reason" style="color:#b55252">({{file.data.client_refuse_reason}})</span></h4>
</div>
<div class="modal-body" style="padding: 30px">
<div class="row">
<div class="col-xs-12">
<div class="form-horizontal">
<!--<div class="form-group">-->
<!--&lt;!&ndash;<label class="control-label col-xs-3">Title</label>&ndash;&gt;-->
<!--<div class="col-xs-12">-->
<!--<p class="form-control-static">-->
<!--{{notice.title}}-->
<!--</p>-->
<!--</div>-->
<!--</div>-->
<div class="form-group">
<!--<label class="control-label col-xs-3">Content</label>-->
<div class="col-xs-12">
<p style="text-align: center;"><span
style="text-align: center; font-family: DengXian; font-size: 14px;">RoyalPay</span>Merchant Supplement
Compliance File Notification<span style="text-align: center; font-family: DengXian; font-size: 14px;"></span>
</p>
<p><span style="font-family: DengXian; font-size: 14px;">Dear RoyalPay Merchants:</span></p>
<p class="p1">RoyalPay is committed to providing a secure and safe platform for Chinese payments. As a part of this
we regularly participate in communication with Austrac and China&#39;s Foreign Exchange Regulator. To ensure
your business is fully compliant, we require certain documents from you by the 30st of September. If you believe
you may not be able to submit these documents on time please get in touch with us as soon as possible.</p>
<p><br/><span style="font-family: DengXian; font-size: 14px;"></span></p>
<p><span
style="font-family: DengXian; font-size: 14px;">If you have any questions or issues related to this&nbsp;</span><span
style="font-family: DengXian; font-size: 14px;">adjustment,</span><span
style="font-family: DengXian; font-size: 14px;">&nbsp;please don</span><span
style="font-family: DengXian; font-size: 14px;"></span><span
style="font-family: DengXian; font-size: 14px;">t hesitate to call 1300 107 750 or&nbsp;</span><span
style="font-family: DengXian; font-size: 14px;">email</span><span
style="font-family: DengXian; font-size: 14px;">&nbsp;</span><a href="mailto:info@royalpay.com.au"><span
style="font-family: DengXian; color: rgb(0, 0, 255);">info@royalpay.com.au</span></a><span
style="font-family: DengXian; font-size: 14px;">.</span></p>
<p><span style="font-family: DengXian; font-size: 14px;">Best Regards,</span></p>
<p><span style="font-family: DengXian; font-size: 14px;">RoyalPay Customer Service Team</span></p>
<hr/>
<p style="text-align: center;"><span style="font-family: DengXian; font-size: 14px;">RoyalPay皇家支付商户合规文件补充通知</span>
</p>
<p><span style="font-family: DengXian; font-size: 14px;">尊敬的RoyalPay商户</span></p>
<p class="p1">应澳洲政府反洗钱监管机构Austrac和中国外汇监管相关要求需要您配合补充完善基本资料以完成合规流程截止时间2019年9月30日前超期未提交将可能会影响您的正常交易谢谢您的配合。</p>
<p class="p1"><br/><span style="font-family: DengXian; font-size: 14px;"></span></p>
<p><span style="font-family: DengXian; font-size: 14px;">RoyalPay客服与技术支持在此期间将竭诚为您服务如有疑问或需帮助请拨打我们的客服电话1300 107 750或添加RoyalPay官方客服号royalpay_</span><span
style="font-family: DengXian; font-size: 14px;">1</span><span
style="font-family: DengXian; font-size: 14px;">详询。</span></p>
<p><span style="font-family: DengXian; font-size: 14px;">顺颂商祺</span></p>
<p><span style="font-family: DengXian; font-size: 14px;">RoyalPay Customer Service Team</span></p>
</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-success" ui-sref="compliance_to_perfect" ng-click="$dismiss()" type="button">Submit Documents
</button>
<button class="btn btn-danger" ng-click="$dismiss()" type="button">Cancel</button>
</div>

@ -0,0 +1,29 @@
<style>
.dialog{
font-size: 17px;
}
</style>
<div class="modal-header bg-green">
<h4>Confirm</h4>
</div>
<div class="modal-body">
<div class="row dialog">
<div class="col-xs-12">
<div class="form-horizontal">
<div class="form-group">
<div class="col-xs-12">
<p class="form-control-static">
Do you confirm the submission of the agreement?
</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-success" ng-click="chooseYes();$dismiss()" type="button">Submit</button>
<button class="btn btn-danger" ng-click="$dismiss()" type="button">Cancel</button>
</div>

@ -26,8 +26,25 @@
<i class="fa fa-check-square-o check-i" aria-hidden="true" style="float: none" ng-if="$root.complianceCheck.authFile"></i>
</div>
<uib-progressbar value="bankFileProgress.value" ng-if="bankFileProgress"></uib-progressbar>
<a ng-if="bankIsImage" target="_blank" ng-href="{{file.client_bank_file}}">
<img ng-src="{{file.client_bank_file}}" class="col-sm-8"></a>
<!-- <a ng-if="bankIsImage" target="_blank" ng-repeat="src in file.client_bank_file" ng-href="{{src}}">
<img ng-src="{{src}}" class="col-sm-8">
</a>-->
<table>
<tbody>
<tr ng-repeat="file_src in file.client_bank_file track by $index">
<td ng-bind="$index+1+'.'" ALIGN="left" VALIGN="top" class="btn">1</td>
<td><a ng-if="bankIsImage" target="_blank" ng-href="{{file_src.file_value}}">
<img ng-src="{{file_src.file_value}}"class="col-sm-6" style="border: 1px solid #ddd" onerror="this.src='https://static.easyicon.net/preview/118/1184255.gif'">
</a>
<button class="btn btn-danger" type="button" ng-click="deleteComplianceFiles(file_src.file_id)">X</button>
</td>
</tr>
</tbody>
</table>
</div>
<div class="col-sm-6">
<div class="form-control-static">
@ -50,8 +67,18 @@
<i class="fa fa-check-square-o check-i" aria-hidden="true" style="float: none" ng-if="$root.complianceCheck.authFile"></i>
</div>
<uib-progressbar value="companyFileProgress.value" ng-if="companyFileProgress"></uib-progressbar>
<a ng-if="companyIsImage" ng-href="{{file.client_company_file}}" target="_blank">
<img ng-src="{{file.client_company_file}}" class="col-sm-8"></a>
<!-- <a ng-if="companyIsImage" ng-repeat="src in file.client_company_file" ng-href="{{src}}" target="_blank">
<img ng-src="{{src}}" class="col-sm-8"></a>-->
<table><tbody>
<tr ng-repeat="file_src in file.client_company_file track by $index">
<td ng-bind="$index+1+'.'" class="btn">1</td>
<td><a ng-if="companyIsImage" target="_blank" ng-href="{{file_src.file_value}}">
<img ng-src="{{file_src.file_value}}" class="col-sm-6" style="border: 1px solid #ddd" onerror="this.src='https://static.easyicon.net/preview/118/1184255.gif'">
</a>
<button class="btn btn-danger" type="button" ng-click="deleteComplianceFiles(file_src.file_id)">X</button>
</td>
</tr>
</tbody></table>
</div>
<div class="col-sm-6">
<div class="form-control-static">
@ -82,8 +109,19 @@
<i class="fa fa-check-square-o check-i" aria-hidden="true" style="float: none" ng-if="$root.complianceCheck.authFile"></i>
</div>
<uib-progressbar value="idFileProgress.value" ng-if="idFileProgress"></uib-progressbar>
<a ng-if="idIsImage" ng-href="{{file.client_id_file}}" target="_blank">
<img ng-src="{{file.client_id_file}}" class="col-sm-8"></a>
<!--<a ng-if="idIsImage" ng-repeat="src in file.client_id_file" ng-href="{{src}}" target="_blank">
<img ng-src="{{src}}" class="col-sm-8"></a>-->
<table>
<tbody>
<tr ng-repeat="file_src in file.client_id_file track by $index">
<td ng-bind="$index+1+'.'" class="btn">1</td>
<td><a ng-if="bankIsImage" target="_blank" ng-href="{{file_src.file_value}}">
<img ng-src="{{file_src.file_value}}" class="col-sm-6" style="border: 1px solid #ddd" onerror="this.src='https://static.easyicon.net/preview/118/1184255.gif'">
</a>
<button class="btn btn-danger" type="button" ng-click="deleteComplianceFiles(file_src.file_id)">X</button>
</td>
</tr>
</tbody></table>
</div>
<div class="col-sm-6">
<div class="form-control-static">
@ -115,8 +153,19 @@
<i class="fa fa-check-square-o check-i" aria-hidden="true" style="float: none" ng-if="$root.complianceCheck.authFile"></i>
</div>
<uib-progressbar value="agreementFileProgress.value" ng-if="agreementFileProgress"></uib-progressbar>
<a ng-if="agreeIsImage" target="_blank" ng-href="{{file.client_agree_file}}">
<img ng-src="{{file.client_agree_file}}" class="col-sm-8"></a>
<!-- <a ng-if="agreeIsImage" target="_blank" ng-repeat="src in file.client_agree_file" ng-href="{{src}}">
<img ng-src="{{src}}" class="col-sm-8"></a>-->
<table>
<tbody>
<tr ng-repeat="file_src in file.client_agree_file track by $index">
<td ng-bind="$index+1+'.'" class="btn">1</td>
<td><a ng-if="bankIsImage" target="_blank" ng-href="{{file_src.file_value}}">
<img ng-src="{{file_src.file_value}}" class="col-sm-6" style="border: 1px solid #ddd" onerror="this.src='https://static.easyicon.net/preview/118/1184255.gif'">
</a>
<button class="btn btn-danger" type="button" ng-click="deleteComplianceFiles(file_src.file_id)">X</button>
</td>
</tr>
</tbody></table>
</div>
<div class="col-sm-6">
<div class="form-control-static">
@ -141,8 +190,19 @@
<i class="fa fa-check-square-o check-i" style="float: none" aria-hidden="true"ng-if="$root.complianceCheck.authFile"></i>
</div>
<uib-progressbar value="bankFileProgress.value" ng-if="applyFileProgress"></uib-progressbar>
<a ng-if="applyIsImage" target="_blank" ng-href="{{file.client_apply_file}}">
<img ng-src="{{file.client_apply_file}}" class="col-sm-8"></a>
<!-- <a ng-if="applyIsImage" target="_blank" ng-repeat="src in file.client_apply_file" ng-href="{{src}}">
<img ng-src="{{src}}" class="col-sm-8"></a>-->
<table>
<tbody>
<tr ng-repeat="file_src in file.client_apply_file track by $index">
<td ng-bind="$index+1+'.'" class="btn">1</td>
<td><a ng-if="bankIsImage" target="_blank" ng-href="{{file_src.file_value}}">
<img ng-src="{{file_src.file_value}}"class="col-sm-6" style="border: 1px solid #ddd" onerror="this.src='https://static.easyicon.net/preview/118/1184255.gif'">
</a>
<button class="btn btn-danger" type="button" ng-click="deleteComplianceFiles(file_src.file_id)">X</button>
</td>
</tr>
</tbody></table>
</div>
<div class="col-sm-6">
<div class="form-control-static">

@ -0,0 +1,256 @@
<section class="content-header">
<h1>
<span ng-bind="partner.company_name"></span>
</h1>
</section>
<div class="content">
<div class="row">
<div class="col-sm-12">
<div class="nav-tabs-custom">
<div class="tab-content" ui-view>
<div class="panel panel-default">
<div class="panel-heading">
Partner Basic Information
<span ng-if="partner.apply_approve_result==3||partner.apply_approve_result==4"
style="color: red">(Refused)</span>
<span ng-if="partner.apply_approve_result==2 && partner.client_id" style="color: green">(Pass)</span>
<span class="form-inline" ng-if="('10'|withRole) && partner.apply_approve_result==1" style="color: blue">
({{partner.bd_user_name}} is following)
<div class="form-group"
style="padding-left: 10px">
<div class="form-group">
<ui-select ng-model="choosed.selected" theme="bootstrap" reset-search-input="false" title="Choose a BD"
append-to-body="true" style="min-width: 150px;max-width: 300px">
<ui-select-match placeholder="Select a BD To Follow Up">{{$select.selected.display_name}}</ui-select-match>
<ui-select-choices group-by="'org_name'"
repeat="bd in bds | filter:$select.search">
<div ng-bind-html="bd.display_name | highlight: $select.search"></div>
</ui-select-choices>
</ui-select>
</div>
<button type="button" class="btn btn-success" ng-class="{'disabled':!choosed.selected}"
ng-click="chooseBD(choosed.selected)">Change BD</button>
</div>
</span>
<span style="float: right;margin-top: -7px" class="form-inline"
ng-if="(partner.apply_approve_result==0 && ('10'|withRole))||(partner.apply_approve_result==1 && ('100'|withRole))">
<!--<div uib-dropdown ng-if="partner.apply_approve_result==0 && ('10'|withRole)" class="btn-group pull-right">-->
<!--<button id="single-button" type="button" class="btn btn-success" uib-dropdown-toggle ng-disabled="disabled">-->
<!--Choose BD To Follow Up <span class="caret"></span>-->
<!--</button>-->
<!--<ul class="dropdown-menu" uib-dropdown-menu aria-labelledby="single-button">-->
<!--<li ng-repeat="bd in bds"><a ng-click="chooseBD(bd)">{{bd.display_name}}</a></li>-->
<!--</ul>-->
<!--</div>-->
<div class="form-group">
<a role="button" class="btn btn-danger" ng-click="refuse()">
Refuse
</a>
</div>
<div class="form-group" ng-if="partner.apply_approve_result==0 && ('10'|withRole)"
style="padding-left: 10px">
<div class="form-group">
<ui-select ng-model="choosed.selected" theme="bootstrap" reset-search-input="false" title="Choose a BD"
append-to-body="true" style="min-width: 150px;max-width: 300px">
<ui-select-match placeholder="Select a BD To Follow Up">{{$select.selected.display_name}}</ui-select-match>
<ui-select-choices group-by="'org_name'"
repeat="bd in bds | filter:$select.search">
<div ng-bind-html="bd.display_name | highlight: $select.search"></div>
</ui-select-choices>
</ui-select>
</div>
<button type="button" class="btn btn-success" ng-class="{'disabled':!choosed.selected}"
ng-click="chooseBD(choosed.selected)">Next</button>
</div>
<div class="form-group">
<a ng-click="pass(partner)" ng-if="partner.apply_approve_result==1 && ('100'|withRole)"
role="button" class="btn btn-success">
PASS
</a>
</div>
</span>
</div>
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group">
<label class="control-label col-sm-2">Full Name</label>
<div class="col-sm-10">
<p class="form-control-static" ng-bind="partner.company_name"></p>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">Short Name</label>
<div class="col-sm-10">
<p class="form-control-static" ng-bind="partner.short_name"></p>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">Business License No. (ABN/ACN)</label>
<div class="col-sm-10">
<p class="form-control-static" ng-bind="partner.abn"></p>
</div>
</div>
<!--<div class="form-group">-->
<!--<label class="control-label col-sm-2">Industry</label>-->
<!--<div class="col-sm-10">-->
<!--<p class="form-control-static" ng-bind="partner.industry|partner_industry"></p>-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group" ng-if="partner.company_email">-->
<!--<label class="control-label col-sm-2">Email Address</label>-->
<!--<div class="col-sm-10">-->
<!--<p class="form-control-static" target="_blank" ng-bind="partner.company_email"></p>-->
<!--</div>-->
<!--</div>-->
<div class="form-group" ng-if="partner.company_website">
<label class="control-label col-sm-2">Website</label>
<div class="col-sm-10">
<a class="form-control-static" target="_blank" ng-bind="partner.company_website"
ng-href="http://{{partner.company_website}}"></a>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">Office Telephone Number</label>
<div class="col-sm-10">
<p class="form-control-static" ng-bind="partner.company_phone||'-'"></p>
</div>
</div>
<!--<div class="form-group col-sm-6">-->
<!--<label class="control-label col-sm-4">Mobile Number (China)</label>-->
<!--<div class="col-sm-8">-->
<!--<p class="form-control-static" ng-bind="partner.mobile_chn||'-'"></p>-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group col-sm-6">-->
<!--<label class="control-label col-sm-4">Mobile Number (Aus)</label>-->
<!--<div class="col-sm-8">-->
<!--<p class="form-control-static" ng-bind="partner.mobile_aus||'-'"></p>-->
<!--</div>-->
<!--</div>-->
<div class="form-group col-sm-12">
<label class="control-label col-sm-2">Address</label>
<div class="col-sm-10">
<p class="form-control-static" ng-bind="partner.address"></p>
</div>
</div>
<div class="form-group col-sm-6">
<label class="control-label col-sm-4">City</label>
<div class="col-sm-8">
<p class="form-control-static" ng-bind="partner.suburb"></p>
</div>
</div>
<div class="form-group col-sm-6">
<label class="control-label col-sm-4">Post Code</label>
<div class="col-sm-8">
<p class="form-control-static" ng-bind="partner.postcode"></p>
</div>
</div>
<div class="form-group col-sm-6">
<label class="control-label col-sm-4">State</label>
<div class="col-sm-8">
<p class="form-control-static" ng-bind="partner.state||partner_state"></p>
</div>
</div>
<div class="form-group col-sm-6">
<label class="control-label col-sm-4">Country</label>
<div class="col-sm-8">
<p class="form-control-static" ng-bind="partner.country"></p>
</div>
</div>
<div class="form-group col-sm-6">
<label class="control-label col-sm-4">Business category</label>
<div class="col-sm-8">
<p class="form-control-static" ng-bind="(partner.aus_mch_category |aus_mch_category).categoryLabel"></p>
</div>
</div>
<div class="form-group col-sm-6">
<label class="control-label col-sm-4">Business industry</label>
<div class="col-sm-8">
<p class="form-control-static" ng-bind="(partner.aus_mch_category |aus_mch_category).industryLabel"></p>
</div>
</div>
</div>
</div>
</div>
<!--end 商户基本资料-->
<div class="panel panel-default">
<div class="panel-heading">Contact Information</div>
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group col-sm-12">
<label class="control-label col-sm-2">Contact Person</label>
<div class="col-sm-10">
<p class="form-control-static" ng-bind="partner.contact_person"></p>
</div>
</div>
<!--<div class="form-group col-sm-6">-->
<!--<label class="control-label col-sm-4">Job Title</label>-->
<!--<div class="col-sm-8">-->
<!--<p class="form-control-static" ng-bind="partner.contact_person_job"></p>-->
<!--</div>-->
<!--</div>-->
<div class="form-group col-sm-6">
<label class="control-label col-sm-4">Telephone No.</label>
<div class="col-sm-8">
<p class="form-control-static" ng-bind="partner.contact_phone"></p>
</div>
</div>
<div class="form-group col-sm-6">
<label class="control-label col-sm-4">E-mail</label>
<div class="col-sm-8">
<p class="form-control-static" ng-bind="partner.contact_email"></p>
</div>
</div>
</div>
</div>
</div>
<!--end 商户联系资料-->
<div class="panel panel-default" ng-if="partner.apply_approve_result>0">
<div class="panel-heading">Approaching Progress </div>
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group col-sm-12">
<div class="col-sm-12" ng-if="('100'|withRole)">
<textarea class="form-control" ng-model="partner.remark" name="remark"
id="remark-input" maxlength="500"></textarea>
<a ng-if="('100'|withRole)" class="btn btn-success" role="button" ng-click="updateRemark()">Save</a>
</div>
<div class="col-sm-12" ng-if="partner.apply_approve_result>0 && ('10'|withRole)">
<p class="form-control-static" ng-bind="partner.remark"></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

@ -0,0 +1,301 @@
<style type="text/css">
#bg {
display: block;
position: absolute;
top: 0%;
left: 0%;
width: 100%;
height: 100%;
background-color: black;
z-index: 1001;
-moz-opacity: 0.7;
opacity: .70;
filter: alpha(opacity=70);
}
#show {
display: block;
position: absolute;
top: 20%;
left: 50%;
width: 50%;
padding: 50px;
z-index: 2004;
overflow: auto;
}
.industry-p {
width: 95%;
float: left;
}
.img-size {
height: 100px;
margin-left: 20px;
}
.btn-default:active,
.btn-default.active,
.open > .dropdown-toggle.btn-default {
color: #333;
background-color: #f7bf90;
border-color: #adadad;
}
</style>
<div class="content">
<div class="row">
<div class="col-sm-12">
<div class="nav-tabs-custom">
<ul class="nav nav-tabs">
<li ui-sref-active-eq="active">
<a ui-sref="partner_detail({client_moniker:partner.client_moniker})">Partner Detail</a>
</li>
<li ui-sref-active="active">
<a ui-sref="compliance_detail({client_moniker:partner.client_moniker})">Compliance Audit</a>
</li>
</ul>
<div class="tab-content" ui-view>
<div class="panel panel-default">
<div class="panel-heading">
Partner Basic Information
<a role="button" class="" ng-click="configMasterMerchant()"
ng-if="partner.show_all_permission && ('10'|withRole)||(partner.show_all_permission && ('1'|withRole))">
(<i class="fa fa-arrows" aria-hidden="true"></i> Config master merchant)
</a>
<a role="button" class="pull-right"
ng-if="partner.show_all_permission && ('110'|withRole)||(partner.show_all_permission && ('1'|withRole))"
ui-sref="partners.edit({clientMoniker:partner.client_moniker})">
<i class="fa fa-edit"></i> Edit
</a>
</div>
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group">
<label class="control-label col-sm-2">Partner Code</label>
<div class="col-sm-10">
<p class="form-control-static">
<span id="parent_code">{{partner.client_moniker}}</span>
<span ng-if="partner.parent_client_id!=null">(Sub Partner of
<a ui-sref="partners.detail({clientMoniker:partner.parent_client.client_moniker})"
ng-bind="partner.parent_client.client_moniker"></a>)
</span>
<span ng-if="partner.is_valid==0"
ng-class="{pass_timeout:partner.is_valid==0}">(已禁用)</span>
</p>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">Company Name</label>
<div class="col-sm-10">
<p class="form-control-static">
<span ng-bind="partner.company_name"></span>
<span
ng-if="isComplianceOfCompanyName && partner.open_status"
style="margin-left: 10px;font-weight: 700;color: red;">
注意:(微信渠道可能不合规)
</span>
<span class="description-text text-red" ng-bind="partner.same_company_name"></span>
</p>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">Short Name</label>
<div class="col-sm-10">
<p class="form-control-static pull-left" ng-bind="partner.short_name"></p>
<p class="form-control-static pull-left"
ng-if="isComplianceOfShortName && partner.open_status"
style="margin-left: 10px;font-weight: 700;color: red;">
注意:(微信渠道可能不合规)
</p>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">Business Name</label>
<div class="col-sm-10">
<p class="form-control-static" ng-bind="partner.business_name"></p>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">Store Name</label>
<div class="col-sm-10">
<p class="form-control-static pull-left" ng-bind="partner.store_name"></p>
<p class="form-control-static pull-left"
ng-if="isComplianceOfShortName && partner.open_status"
style="margin-left: 10px;font-weight: 700;color: red;">
注意:(微信渠道可能不合规)
</p>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">Business Structure</label>
<div class="col-sm-10">
<p class="form-control-static pull-left"
ng-bind="partner.business_structure|business_structure"></p>
<p class="form-control-static pull-left"
ng-if="isComplianceOfBusinessStructure && partner.open_status"
style="margin-left: 10px;font-weight: 700;color: red;">
注意:(微信渠道可能不合规)
</p>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">Logo</label>
<div class="col-sm-10">
<img ng-src="{{partner.logo_url}}" style="max-height: 100px;">
</div>
</div>
<div class="form-group" ng-if="partner.abn">
<label class="control-label col-sm-2">ABN</label>
<div class="col-sm-10">
<p class="form-control-static" ng-bind="partner.abn"></p>
</div>
</div>
<div class="form-group" ng-if="partner.acn">
<label class="control-label col-sm-2">ACN</label>
<div class="col-sm-10">
<p class="form-control-static" ng-bind="partner.acn"></p>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">Industry</label>
<div class="col-sm-10">
<p class="form-control-static" ng-bind="partner.industry|partner_industry"></p>
</div>
</div>
<div hidden class="form-group">
<label class="control-label col-sm-2">Sector</label>
<div class="col-sm-10">
<p class="form-control-static" ng-bind="partner.sector"></p>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">Service Phone</label>
<div class="col-sm-10">
<p class="form-control-static" ng-bind="partner.company_phone||'-'"></p>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">Major Products/Service</label>
<div class="col-sm-10">
<p class="form-control-static" ng-bind="partner.description"></p>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">Remark</label>
<div class="col-sm-10">
<p class="form-control-static" ng-bind="partner.remark"></p>
</div>
</div>
<div class="form-group" ng-if="partner.referrer_id">
<label class="control-label col-sm-2">Referrer</label>
<div class="col-sm-10">
<p class="form-control-static" ng-bind="partner.referrer_name"></p>
</div>
</div>
</div>
</div>
</div>
<!--end 商户基本资料-->
<div class="panel panel-default">
<div class="panel-heading">Partner Contact Information</div>
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group">
<label class="control-label col-sm-2">Contact Person Name</label>
<div class="col-sm-10">
<p class="form-control-static" ng-bind="partner.contact_person"></p>
</div>
</div>
<div class="form-group col-sm-6">
<label class="control-label col-sm-4">Phone</label>
<div class="col-sm-8">
<p class="form-control-static" ng-bind="partner.contact_phone"></p>
<p class="description-text text-red" ng-bind="partner.same_phone"></p>
</div>
</div>
<div class="form-group col-sm-6">
<label class="control-label col-sm-4">E-mail</label>
<div class="col-sm-8">
<p class="form-control-static">
<span ng-bind="partner.contact_email"></span>
</span>
</p>
<p class="description-text text-red" ng-bind="partner.same_email"></p>
</div>
</div>
</div>
</div>
</div>
<!--end 商户联系资料-->
<div class="panel panel-default">
<div class="panel-heading">Address Information</div>
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group col-sm-6">
<label class="control-label col-sm-4">Address</label>
<div class="col-sm-8">
<p class="form-control-static" ng-bind="partner.address"></p>
<p class="description-text text-red" ng-bind="partner.same_address"></p>
</div>
</div>
<div class="form-group col-sm-6">
<label class="control-label col-sm-4">Suburb</label>
<div class="col-sm-8">
<p class="form-control-static" ng-bind="partner.suburb"></p>
</div>
</div>
<div class="form-group col-sm-6">
<label class="control-label col-sm-4">PostCode</label>
<div class="col-sm-8">
<p class="form-control-static" ng-bind="partner.postcode"></p>
</div>
</div>
<div class="form-group col-sm-6">
<label class="control-label col-sm-4">State</label>
<div class="col-sm-8">
<p class="form-control-static" ng-bind="partner.state"></p>
</div>
</div>
<div class="form-group col-sm-6">
<label class="control-label col-sm-4">Country</label>
<div class="col-sm-8">
<p class="form-control-static" ng-bind="partner.country"></p>
</div>
</div>
<div class="form-group ">
<label class="control-label col-sm-2">Timezone</label>
<div class="col-sm-10">
<p class="form-control-static" ng-bind="partner.timezone|timezoneLabel"></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

@ -0,0 +1,25 @@
<div class="modal-header">
<h4>Pass Application({{partner.company_name}})</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-sm-12">
<form name="partnerForm" novalidate>
<div class="form-group"
ng-class="{'has-error':partnerForm.client_moniker.$invalid && partnerForm.client_moniker.$dirty}">
<label class="control-label col-sm-3" for="short-id-input">Refuse Reason:</label>
<div class="col-sm-8">
<textarea class="form-control text-uppercase" ng-model="partner.description"
type="text"
name="description"
id="short-id-input"></textarea>
</div>
</div>
</form>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success" ng-click="refusePartnerComplianceFiles();$dismiss();">Refuse</button>
<button type="button" class="btn btn-danger" ng-click="$dismiss()">Cancel</button>
</div>

@ -0,0 +1,128 @@
<section class="content-header">
<h1>商户合规文件审核</h1>
<ol class="breadcrumb">
<li>
<i class="fa fa-sitemap"></i> Compliance Management
</li>
<li class="active">商户合规文件审核</li>
</ol>
</section>
<div class="box box-warning" style="margin-top: 30px;">
<div class="box-header">
<div class="row">
<div class="col-sm-12">
<div class="form-horizontal">
<div class="form-group col-xs-12">
<label class="col-xs-4 col-sm-2 control-label">Partner Code</label>
<div class="col-sm-5 col-xs-8">
<input class="form-control" placeholder="" ng-click="loadClientCompliance(1)"
ng-model="params.client_moniker">
</div>
</div>
<div class="form-group col-xs-12">
<label class="control-label col-xs-4 col-sm-2">审核状态:</label>
<div class="col-sm-10 col-xs-8">
<p class="form-control-static">
<a role="button" ng-class="{'bg-primary':params.status==null}"
ng-click="params.status=null;loadClientCompliance(1)">All</a> |
<a role="button" ng-class="{'bg-primary':statusSelected([0])}"
ng-click="params.status=[0];loadClientCompliance(1)">待审核</a>|
<a role="button" ng-class="{'bg-primary':statusSelected([1])}"
ng-click="params.status=[1];loadClientCompliance(1)">通过</a>|
<a role="button" ng-class="{'bg-primary':statusSelected([2])}"
ng-click="params.status=[2];loadClientCompliance(1)">打回</a>
</p>
</div>
</div>
<button class="btn btn-success" type="button" ng-click="loadTradeLogs()">
<i class="fa fa-search"></i> Search
</button>
</div>
</div>
</div>
</div>
</div>
<div class="box box-danger">
<div class="modal-body">
<div class="box-body table-responsive">
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th>Client Moniker</th>
<th>Short Name</th>
<th>Compliance Status</th>
<th>Register Time</th>
<th>BD</th>
<th>AuthFile Status</th>
<th>Submit Time</th>
<th>Source</th>
<th>Operation</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="compliance_company in compliances">
<td ng-bind="compliance_company.client_moniker"></td>
<td ng-bind="compliance_company.short_name"></td>
<td ng-class="{'bg-green':(compliance_company.approve_result==2 && (compliance_company.client_source==1 || compliance_company.client_source==2)),'bg-red':((compliance_company.open_status==1||compliance_company.open_status==2||compliance_company.open_status==4) && compliance_company.approve_result!=3)||(compliance_company.approve_result==3 && (!compliance_company.open_status || compliance_company.open_status==1 || compliance_company.open_status == 4))||(compliance_company.approve_result==4 && !compliance_company.open_status)||(compliance_company.open_status==10)}">
<span ng-if="compliance_company.approve_result==1 && compliance_company.approve_time">通过({{compliance_company.approve_time}})</span>
<span ng-if="!compliance_company.open_status && !compliance_company.approve_result && compliance_company.approve_result!=5 && compliance_company.client_source!=4">资料完善中</span>
<span ng-if="!compliance_company.open_status && !compliance_company.approve_result && compliance_company.approve_result!=5 && compliance_company.client_source==4">(自助开通)资料完善中</span>
<span ng-if="!compliance_company.open_status && compliance_company.approve_result==2 && compliance_company.approve_time">自助开通试用中({{compliance_company.approve_time}}~{{compliance_company.expiry_time}})</span>
<span ng-if="compliance_company.approve_result==0 && compliance_company.approve_time">不通过({{compliance_company.approve_time}})</span>
<span ng-if="compliance_company.approve_result==5 && compliance_company.approve_time && compliance_company.refuse_remark">申请打回({{compliance_company.refuse_remark|limitTo:15}})</span>
<span ng-if="(compliance_company.open_status==1||compliance_company.open_status==4) && compliance_company.approve_result!=3"><i
ng-if="compliance_company.refuse_remark.length>0" class="fa fa-reply" aria-hidden="true"
title="被打回重新提交"></i>等待合规</span>
<span ng-if="compliance_company.approve_result==3 && (!compliance_company.open_status || compliance_company.open_status==4)">自助开通(等待合规)</span>
<span ng-if="compliance_company.open_status==2">合同制作完成</span>
<span ng-if="compliance_company.open_status==3 && compliance_company.approve_result!=5">等待BD上传材料审核</span>
<span ng-if="compliance_company.open_status==10">绿色通道申请中</span>
<span ng-if="compliance_company.approve_result==4 && !compliance_company.open_status"><i
ng-if="compliance_company.refuse_remark.length>0" class="fa fa-reply" aria-hidden="true"
title="被打回重新提交"></i>等待合规</span>
</td>
<td ng-bind="compliance_company.create_time|date:'dd/MMM/yyyy'"></td>
<td ng-bind="compliance_company.bd_user_name"></td>
<td>
<span ng-if="compliance_company.status==0">待审核</span>
<span ng-if="compliance_company.status==1">通过</span>
<span ng-if="compliance_company.status==2">打回</span>
</td>
<td ng-bind="compliance_company.submit_time|date:'dd/MMM/yyyy'"></td>
<td>
<span ng-if="compliance_company.source==1">App</span>
<span ng-if="compliance_company.source==2">Web</span>
</td>
<td><a class="text-primary" role="button" title="Detail"
ui-sref="compliance_detail({client_moniker:compliance_company.client_moniker})">
<i class="fa fa-search"></i> Detail
</a>
</td>
<!--({client_id:compliance_company.client_id})-->
</tr>
</tbody>
</table>
</div>
<div class="modal-footer">
<uib-pagination ng-if="compliances.length"
class="pagination"
total-items="pagination.totalCount"
boundary-links="true"
ng-model="pagination.page"
items-per-page="pagination.limit"
max-size="10"
ng-change="getContractAnalysis()"
previous-text="&lsaquo;"
next-text="&rsaquo;"
first-text="&laquo;"
last-text="&raquo;"></uib-pagination>
<div class="col-xs-12">Total Records:{{pagination.totalCount}};Total Pages:{{pagination.totalPages}}</div>
</div>
</div>
</div>
Loading…
Cancel
Save