Merge remote-tracking branch 'origin/develop'

master
james.zhao 6 years ago
commit d62ff090aa

@ -24,9 +24,12 @@ import au.com.royalpay.payment.manage.mappers.system.ClientBankAccountMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientMapper; import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
import au.com.royalpay.payment.manage.merchants.core.ClientManager; 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.ManagerMapping;
import au.com.royalpay.payment.manage.system.core.TradeSecureService;
import au.com.royalpay.payment.manage.system.core.beans.TradeSecureFile;
import au.com.royalpay.payment.manage.tradelog.core.TradeLogService; import au.com.royalpay.payment.manage.tradelog.core.TradeLogService;
import au.com.royalpay.payment.tools.CommonConsts; import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.defines.TradeType; import au.com.royalpay.payment.tools.defines.TradeType;
import au.com.royalpay.payment.tools.env.SysConfigManager;
import au.com.royalpay.payment.tools.exceptions.BadRequestException; import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.http.HttpUtils; import au.com.royalpay.payment.tools.http.HttpUtils;
import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider; import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider;
@ -40,6 +43,7 @@ import com.alibaba.fastjson.serializer.SerializerFeature;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils; import org.apache.commons.lang3.time.DateFormatUtils;
import org.dom4j.Element; import org.dom4j.Element;
import org.joda.time.DateTime;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
@ -121,6 +125,10 @@ public class TestController implements ApplicationEventPublisherAware {
private HfUpdateService hfUpdateService; private HfUpdateService hfUpdateService;
@Resource @Resource
private ClientManager clientManager; private ClientManager clientManager;
@Resource
private SysConfigManager sysConfigManager;
@Resource
private TradeSecureService tradeSecureService;
private final static String EMAIL = "lily.tao@royalpay.com.au,bella.sun@royalpay.com.au,astro.dai@royalpay.com.au,taylor.dang@royalpay.com.au"; private final static String EMAIL = "lily.tao@royalpay.com.au,bella.sun@royalpay.com.au,astro.dai@royalpay.com.au,taylor.dang@royalpay.com.au";
@ManagerMapping(value = "/{clientMoniker}/export/agreepdf", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.DIRECTOR, ManagerRole.OPERATOR}) @ManagerMapping(value = "/{clientMoniker}/export/agreepdf", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.DIRECTOR, ManagerRole.OPERATOR})
@ -434,13 +442,25 @@ public class TestController implements ApplicationEventPublisherAware {
@ManagerMapping(value = "/partner/reset_password", method = RequestMethod.GET, role = ManagerRole.DEVELOPER) @ManagerMapping(value = "/partner/reset_password", method = RequestMethod.GET, role = ManagerRole.DEVELOPER)
public void resetPartnerPassword() { public void resetPartnerPassword() {
final List<String> emails = new ArrayList<>(); //抄送人邮箱
List<String> emailList = Arrays.asList(EMAIL.split(",")); JSONObject sysConfig = sysConfigManager.getSysConfig();
emailList.stream().forEach(email -> { String ccMail = sysConfig.getString("reset_password.cc_list");
if (!emails.contains(email)) { //账号白名单
emails.add(email); String accountWhiteList = sysConfig.getString("reset_password.account_white_list");
} if (StringUtils.isEmpty(ccMail)) {
}); throw new BadRequestException("抄送人不能为空");
clientManager.updateAllPartnerPassword("PINE", emails); }
if (accountWhiteList == null) {
accountWhiteList = "";
}
List<String> emailList = Arrays.asList(ccMail.split(","));
clientManager.updateAllPartnerPassword("PINE", emailList, accountWhiteList);
}
@ManagerMapping(value = "/secure/hanyin_reports/{date}", role = ManagerRole.DEVELOPER, method = RequestMethod.GET)
public void downloadHanyinSecureReports(@PathVariable String date, HttpServletResponse response) {
TradeSecureFile file = tradeSecureService.getSecureReportFile(DateTime.parse(date).toDate());
file.writeToHttp(response);
} }
} }

@ -8,8 +8,6 @@ import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds; import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList; import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.joda.time.DateTime;
import org.springframework.beans.factory.annotation.Autowired;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
@ -102,6 +100,7 @@ public interface TransactionMapper {
BigDecimal TotalAmountForBDPrize(@Param("year") int year, @Param("month") int month, @Param("bd_id") String bd_id); BigDecimal TotalAmountForBDPrize(@Param("year") int year, @Param("month") int month, @Param("bd_id") String bd_id);
BigDecimal TotalAmountForBDLeaderPrize(@Param("year") int year, @Param("month") int month, @Param("bd_group") String bd_group); BigDecimal TotalAmountForBDLeaderPrize(@Param("year") int year, @Param("month") int month, @Param("bd_group") String bd_group);
BigDecimal TotalAmountForSydneyGMPrize(@Param("year") int year, @Param("month") int month); BigDecimal TotalAmountForSydneyGMPrize(@Param("year") int year, @Param("month") int month);
List<JSONObject> listTransactionForCityPartnerCommissionByDate(@Param("year") int year, @Param("month") int month); List<JSONObject> listTransactionForCityPartnerCommissionByDate(@Param("year") int year, @Param("month") int month);
@ -120,9 +119,9 @@ public interface TransactionMapper {
@AdvanceSelect(addonWhereClause = "transaction_type='Credit'") @AdvanceSelect(addonWhereClause = "transaction_type='Credit'")
int countOrders(@Param("client_id") int client_id); int countOrders(@Param("client_id") int client_id);
List<JSONObject> listDailyTransactions(@Param("from") Date from, @Param("to") Date to, @Param("dev_id") String devId, @Param("client_id") int clientId,@Param("client_ids")String [] client_ids); List<JSONObject> listDailyTransactions(@Param("from") Date from, @Param("to") Date to, @Param("dev_id") String devId, @Param("client_id") int clientId, @Param("client_ids") String[] client_ids);
JSONObject analysisRetailDailyReport(@Param("from") Date from, @Param("to") Date to, @Param("dev_id") String devId, @Param("client_id") int clientId,@Param("client_ids")String [] client_ids); JSONObject analysisRetailDailyReport(@Param("from") Date from, @Param("to") Date to, @Param("dev_id") String devId, @Param("client_id") int clientId, @Param("client_ids") String[] client_ids);
@AutoSql(type = SqlType.SELECT) @AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "system_generate=1") @AdvanceSelect(addonWhereClause = "system_generate=1")
@ -156,6 +155,7 @@ public interface TransactionMapper {
/** /**
* 退退 * 退退
*
* @param clientId * @param clientId
* @param systemTransactionId * @param systemTransactionId
* @return * @return
@ -164,4 +164,14 @@ public interface TransactionMapper {
PageList<JSONObject> findByClientIdAndSystemTransactionId(@Param("client_id") int clientId, PageList<JSONObject> findByClientIdAndSystemTransactionId(@Param("client_id") int clientId,
@Param("system_transaction_id") String systemTransactionId, @Param("system_transaction_id") String systemTransactionId,
PageBounds pageBounds); PageBounds pageBounds);
List<JSONObject> listCreditTransactionsForSecure(Date from, Date to);
List<JSONObject> listDebitTransactionsForSecure(Date from, Date to);
JSONObject getClearDetailTotal(JSONObject params);
List<JSONObject> getSettlementLogDetailList(@Param("clientOrders") List<Integer> clientOrders, @Param("client_id") int clientId);
List<JSONObject> getClientOrderByTransactionTime(JSONObject params);
} }

@ -355,7 +355,9 @@ public interface ClientManager {
void subYeepayMerchantApplication(String clientMoniker,JSONObject merchantInfo, JSONObject manager); void subYeepayMerchantApplication(String clientMoniker,JSONObject merchantInfo, JSONObject manager);
void updateAllPartnerPassword(String clientMoniker, List<String> emails); void reSubYeepayMerchantApplication(String clientMoniker,JSONObject merchantInfo, JSONObject manager);
void updateAllPartnerPassword(String clientMoniker, List<String> emails, String accountWhiteList);
void postponeClientRate(Date now, Date yearTomorrow, String expireDate, JSONObject client); void postponeClientRate(Date now, Date yearTomorrow, String expireDate, JSONObject client);

@ -3720,9 +3720,20 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
merchantInfo.put("create_time",new Date()); merchantInfo.put("create_time",new Date());
merchantInfo.put("operator",manager.getString("display_name")); merchantInfo.put("operator",manager.getString("display_name"));
merchantInfo.put("client_id",client.getIntValue("client_id")); merchantInfo.put("client_id",client.getIntValue("client_id"));
merchantInfo.put("vouchers",merchantInfo.getJSONObject("vouchers").toJSONString()); merchantInfo.put("client_id",merchantInfo.getString("client_id"));
// merchantInfo.put("vouchers",merchantInfo.getJSONObject("vouchers").toJSONString());
List<JSONObject> directorsAll = new ArrayList<>();
List<JSONObject> executivesAll = new ArrayList<>();
directorsAll.add(merchantInfo.getJSONObject("directors"));
executivesAll.add(merchantInfo.getJSONObject("executives"));
JSONObject extInfo = new JSONObject();
extInfo.put("directors",directorsAll);
extInfo.put("executives",executivesAll);
merchantInfo.put("extinfo",extInfo.toJSONString());
yeePayClientConfigMapper.saveMerchantConfig(merchantInfo); yeePayClientConfigMapper.saveMerchantConfig(merchantInfo);
JSONObject yeepayConfig = yeePayClientConfigMapper.findMerchantConfig(client.getIntValue("client_id")); JSONObject yeepayConfig = yeePayClientConfigMapper.findMerchantConfig(client.getIntValue("client_id"));
yeepayConfig.put("company_website",merchantInfo.getString("company_website"));
yeepayConfig.put("abn",merchantInfo.getString("abn"));
SubmerchantRegisterResult result = yeePayClient.registerMerchant(client,yeepayConfig); SubmerchantRegisterResult result = yeePayClient.registerMerchant(client,yeepayConfig);
if(result.getStatus().equals("FAILED")){ if(result.getStatus().equals("FAILED")){
throw new BadRequestException(result.getErrorMsg()); throw new BadRequestException(result.getErrorMsg());
@ -3733,6 +3744,35 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
clientMapper.update(client); clientMapper.update(client);
} }
@Override
public void reSubYeepayMerchantApplication(String clientMoniker, JSONObject merchantInfo, JSONObject manager) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
}
checkOrgPermission(manager, client);
JSONObject yeepayConfig = yeePayClientConfigMapper.findMerchantConfigBySub(merchantInfo.getString("subMerchantId"));
List<JSONObject> directorsAll = new ArrayList<>();
List<JSONObject> executivesAll = new ArrayList<>();
directorsAll.add(merchantInfo.getJSONObject("directors"));
executivesAll.add(merchantInfo.getJSONObject("executives"));
JSONObject extInfo = new JSONObject();
extInfo.put("directors",directorsAll);
extInfo.put("executives",executivesAll);
yeepayConfig.put("extinfo",extInfo.toJSONString());
yeepayConfig.put("industry",merchantInfo.getString("industry"));
yeepayConfig.put("business_content",merchantInfo.getString("business_content"));
yeepayConfig.put("business_licence",merchantInfo.getString("business_licence"));
yeePayClientConfigMapper.update(yeepayConfig);
yeepayConfig.put("company_website",merchantInfo.getString("company_website"));
yeepayConfig.put("abn",merchantInfo.getString("abn"));
yeepayConfig.put("mode","UPDATE");
SubmerchantRegisterResult result = yeePayClient.registerMerchant(client,yeepayConfig);
if(result.getStatus().equals("FAILED")){
throw new BadRequestException(result.getErrorMsg());
}
}
@Override @Override
public List<JSONObject> listMerchantIds(String clientMoniker, JSONObject manager) { public List<JSONObject> listMerchantIds(String clientMoniker, JSONObject manager) {
JSONObject client = getClientInfoByMoniker(clientMoniker); JSONObject client = getClientInfoByMoniker(clientMoniker);
@ -4089,24 +4129,28 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
return ""; return "";
} }
@Override @Override
public void updateAllPartnerPassword(String clientMoniker, List<String> emails) { @Transactional
public void updateAllPartnerPassword(String clientMoniker, List<String> emails, String accountWhiteList) {
JSONObject client = getClientInfoByMoniker(clientMoniker); JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) { if (client == null) {
throw new InvalidShortIdException(); throw new InvalidShortIdException();
} }
List<JSONObject> partners = clientAccountMapper.partnerAndSubPartnerAccounts(client.getIntValue("client_id")); List<JSONObject> partners = clientAccountMapper.partnerAndSubPartnerAccounts(client.getIntValue("client_id"));
partners.stream().forEach(partner -> { partners = partners.stream().filter(partner -> !Arrays.asList(accountWhiteList.split(",")).contains(partner.getString("username"))).collect(Collectors.toList());
String pwd = RandomStringUtils.random(8, true, true); partners.forEach(
String salt = PasswordUtils.newSalt(); partner -> {
String pwdHash = PasswordUtils.hashPwd(pwd, salt); String pwd = RandomStringUtils.random(8, true, true);
partner.put("salt", salt); String salt = PasswordUtils.newSalt();
partner.put("password_hash", pwdHash); String pwdHash = PasswordUtils.hashPwd(pwd, salt);
partner.put("password_aes", PasswordUtils.encryptAESPwd(pwd)); partner.put("salt", salt);
deviceManager.deviceOffline(partner.getString("account_id")); partner.put("password_hash", pwdHash);
clientAccountMapper.update(partner); partner.put("password_aes", PasswordUtils.encryptAESPwd(pwd));
signInAccountService.clearAccountCache(partner.getString("account_id")); deviceManager.deviceOffline(partner.getString("account_id"));
partner.put("password", pwd); clientAccountMapper.update(partner);
}); signInAccountService.clearAccountCache(partner.getString("account_id"));
partner.put("password", pwd);
}
);
sendTestMerchantPassword(partners, emails); sendTestMerchantPassword(partners, emails);
} }
@ -4339,6 +4383,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
mailService.sendEmail("测试商户账户已更新", emails.isEmpty() ? "" : StringUtils.join(emails, ","), "", content); mailService.sendEmail("测试商户账户已更新", emails.isEmpty() ? "" : StringUtils.join(emails, ","), "", content);
} catch (Exception ignored) { } catch (Exception ignored) {
logger.error("邮件发送失败", ignored); logger.error("邮件发送失败", ignored);
throw new BadRequestException("邮件发送失败");
} }
}).start(); }).start();
} }

@ -615,6 +615,11 @@ public class PartnerManageController {
clientManager.subYeepayMerchantApplication(clientMoniker, merchantInfo,manager); clientManager.subYeepayMerchantApplication(clientMoniker, merchantInfo,manager);
} }
@ManagerMapping(value = "/{clientMoniker}/updateYeepaySubMerchantId", method = RequestMethod.POST, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN})
public void reSubYeepayMerchantApplication(@PathVariable String clientMoniker,@RequestBody JSONObject merchantInfo,@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
clientManager.reSubYeepayMerchantApplication(clientMoniker, merchantInfo,manager);
}
@RequestMapping(value = "/compliance", method = RequestMethod.GET) @RequestMapping(value = "/compliance", method = RequestMethod.GET)
@RequireManager(role = { ManagerRole.OPERATOR}) @RequireManager(role = { ManagerRole.OPERATOR})
public JSONObject lisPartnersByCompliance(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, PartnerQuery query) { public JSONObject lisPartnersByCompliance(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, PartnerQuery query) {

@ -0,0 +1,17 @@
package au.com.royalpay.payment.manage.system.core;
import au.com.royalpay.payment.manage.system.core.beans.TradeSecureFile;
import java.util.Date;
/**
* Create by yixian at 2019-01-08 3:17
*/
public interface TradeSecureService {
void uploadSecureReportYesterday();
void uploadSecureReport(Date date);
TradeSecureFile getSecureReportFile(Date date);
}

@ -0,0 +1,149 @@
package au.com.royalpay.payment.manage.system.core.beans;
import au.com.royalpay.payment.tools.defines.TradeType;
import au.com.royalpay.payment.tools.env.PlatformEnvironment;
import au.com.royalpay.payment.tools.exceptions.ServerErrorException;
import au.com.royalpay.payment.tools.utils.CurrencyAmountUtils;
import com.alibaba.fastjson.JSONObject;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.math.BigDecimal;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.TimeZone;
import java.util.stream.Collectors;
/**
* Create by yixian at 2019-01-08 3:27
*/
public class TradeSecureFile {
private static final DateTimeZone zone = DateTimeZone.forTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
private final String pid;
private final DateTime transDate;
private final DateTime createTime;
private List<TradeItem> tradeItems;
private byte[] content;
public TradeSecureFile(String pid, Date transDate) {
this.pid = pid;
this.transDate = new DateTime(transDate).withZoneRetainFields(zone).withMillisOfDay(0);
this.tradeItems = new ArrayList<>();
this.createTime = DateTime.now(zone);
}
public DateTime getTransDate() {
return transDate;
}
public Date getFromTime() {
return transDate.withZone(DateTimeZone.forTimeZone(TimeZone.getDefault())).toDate();
}
public Date getToTime() {
return transDate.plusDays(1).withZone(DateTimeZone.forTimeZone(TimeZone.getDefault())).toDate();
}
public TradeSecureFile addTransactions(List<JSONObject> transactions) {
tradeItems.addAll(transactions.stream().map(TradeItem::new).collect(Collectors.toList()));
return this;
}
public void writeToHttp(HttpServletResponse response) {
response.setContentType("application/octet-stream");
response.setHeader("Content-Disposition", "attachment; filename=" + filename());
try (OutputStream ous = response.getOutputStream()) {
ous.write(content());
ous.flush();
} catch (IOException e) {
throw new ServerErrorException(e);
}
}
public String filename() {
return String.join("_", transDate.toString("yyMMdd"), pid, createTime.toString("yyMMddHHmmss")) + ".txt";
}
public byte[] content() {
return content == null ? build() : content;
}
private byte[] build() {
try (ByteArrayOutputStream bos = new ByteArrayOutputStream();
PrintWriter writer = new PrintWriter(new OutputStreamWriter(bos, StandardCharsets.UTF_8))) {
writer.println(headerLine());
for (TradeItem item : tradeItems) {
writer.println(item.line());
}
content = bos.toByteArray();
return content;
} catch (IOException e) {
throw new ServerErrorException(e);
}
}
private String headerLine() {
int totalCount = tradeItems.size();
BigDecimal totalCredit = tradeItems.stream().filter(TradeItem::isCredit).map(TradeItem::getClearingAmount)
.reduce(BigDecimal::add).orElse(BigDecimal.ZERO);
BigDecimal totalDebit = tradeItems.stream().filter(TradeItem::isDebit).map(TradeItem::getClearingAmount)
.reduce(BigDecimal::add).orElse(BigDecimal.ZERO);
String date = transDate.toString("yyyy-MM-dd");
String[] columns = {String.valueOf(totalCount), totalCredit.toPlainString(), totalDebit.toPlainString(), date, pid};
return String.join("|", columns);
}
class TradeItem {
private String clientMoniker;
private String orderId;
private String channel;
private TradeType gateway;
private BigDecimal price;
private BigDecimal clearingAmount;
private String currency;
private BigDecimal exchangeRate;
private String transactionType;
private Date transactionTime;
public TradeItem(JSONObject item) {
clientMoniker = item.getString("client_moniker");
transactionType = item.getString("transaction_type");
orderId = isCredit() ? item.getString("order_id") : item.getString("out_refund_id");
channel = item.getString("order_channel");
gateway = TradeType.fromGatewayNumber(item.getIntValue("gateway"));
currency = item.getString("transaction_currency");
price = CurrencyAmountUtils.scale(item.getBigDecimal("transaction_amount"), currency);
clearingAmount = CurrencyAmountUtils.scale(item.getBigDecimal("clearing_amount"), PlatformEnvironment.getEnv().getForeignCurrency());
exchangeRate = item.getBigDecimal("exchange_rate");
transactionTime = item.getDate("transaction_time");
}
public String line() {
String[] columns = {clientMoniker, orderId, channel, gateway.toString(), price.toPlainString(), clearingAmount.toPlainString(), currency,
exchangeRate.toPlainString(), filterStatus(), new DateTime(transactionTime).withZone(zone).toString()};
return String.join("|", columns);
}
private String filterStatus() {
return isCredit() ? "SUCCESS" : "REFUND";
}
public boolean isCredit() {
return "Credit".equals(transactionType);
}
public boolean isDebit() {
return "Debit".equals(transactionType);
}
public BigDecimal getClearingAmount() {
return clearingAmount;
}
}
}

@ -0,0 +1,107 @@
package au.com.royalpay.payment.manage.system.core.impl;
import au.com.royalpay.payment.core.exceptions.ChannelNetworkException;
import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper;
import au.com.royalpay.payment.manage.system.core.TradeSecureService;
import au.com.royalpay.payment.manage.system.core.beans.TradeSecureFile;
import au.com.royalpay.payment.tools.env.SysConfigManager;
import com.alibaba.fastjson.JSONObject;
import com.jcraft.jsch.*;
import org.apache.commons.vfs2.FileSystemOptions;
import org.apache.commons.vfs2.provider.sftp.SftpClientFactory;
import org.apache.commons.vfs2.provider.sftp.SftpFileSystemConfigBuilder;
import org.joda.time.DateTime;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.util.Date;
import java.util.List;
/**
* Create by yixian at 2019-01-08 3:26
*/
@Service
public class TradeSecureServiceHanyinImpl implements TradeSecureService {
private Logger logger = LoggerFactory.getLogger(getClass());
@Value("${app.hanyin-secure.pid:ROYALPAY}")
private String pid;
@Value("${app.hanyin-secure.sftp-host}")
private String sftpHost;
@Value("${app.hanyin-secure.sftp-port}")
private int sftpPort;
@Value("${app.hanyin-secure.sftp-username}")
private String sftpUsername;
@Value("${app.hanyin-secure.sftp-pwd}")
private String sftpPwd;
@Resource
private TransactionMapper transactionMapper;
@Resource
private SysConfigManager sysConfigManager;
@Override
public void uploadSecureReportYesterday() {
if (!sysConfigManager.getSysConfig().getBooleanValue("enable_hanyin_uploading")) {
return;
}
logger.debug("start uploading secure report");
uploadSecureReport(DateTime.now().plusDays(-1).withMillisOfDay(0).toDate());
}
@Override
public void uploadSecureReport(Date date) {
TradeSecureFile file = getSecureReportFile(date);
sftpUpload(file);
}
private void sftpUpload(TradeSecureFile file) {
Session session = null;
ChannelSftp command = null;
try {
session = initSFTPConnection();
Channel channel = session.openChannel("sftp");
channel.connect();
command = (ChannelSftp) channel;
command.ls("/royalpay");
String dir = "/royalpay/" + file.getTransDate().toString("yyyyMMdd");
logger.debug("removing dir:{}", dir);
command.rmdir(dir);
logger.debug("rmdir success");
logger.debug("mk dir:{}", dir);
command.mkdir(dir);
String dest = dir + file.filename();
logger.debug("rmdir success, start uploading file:{}", dest);
command.put(new ByteArrayInputStream(file.content()), dest);
} catch (IOException | JSchException | SftpException e) {
throw new ChannelNetworkException("Upload Secure file failed", e);
} finally {
if (command != null && command.isConnected()) {
command.exit();
session.disconnect();
}
}
}
private Session initSFTPConnection() throws IOException {
FileSystemOptions fso = new FileSystemOptions();
SftpFileSystemConfigBuilder.getInstance().setStrictHostKeyChecking(fso, "no");
return SftpClientFactory.createConnection(sftpHost, sftpPort,
sftpUsername.toCharArray(), sftpPwd.toCharArray(), fso);
}
@Override
public TradeSecureFile getSecureReportFile(Date date) {
TradeSecureFile file = new TradeSecureFile(pid, date);
Date from = file.getFromTime();
Date to = file.getToTime();
List<JSONObject> credits = transactionMapper.listCreditTransactionsForSecure(from, to);
file.addTransactions(credits);
List<JSONObject> debits = transactionMapper.listDebitTransactionsForSecure(from, to);
file.addTransactions(debits);
return file;
}
}

@ -0,0 +1,26 @@
package au.com.royalpay.payment.manage.task;
import au.com.royalpay.payment.manage.system.core.TradeSecureService;
import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
/**
* Create by yixian at 2019-01-08 3:13
*/
@Component
@ConditionalOnProperty(value = "app.run-tasks", havingValue = "true")
public class SecureTask {
@Resource
private SynchronizedScheduler synchronizedScheduler;
@Resource
private TradeSecureService tradeSecureService;
@Scheduled(cron = "0 0 3 * * *")
public void pushSecureFile(){
synchronizedScheduler.executeProcess("task:secure_file_uploading",600_000,()->tradeSecureService.uploadSecureReportYesterday());
}
}

@ -2,7 +2,12 @@ package au.com.royalpay.payment.manage.task;
import au.com.royalpay.payment.manage.mappers.system.ManagerMapper; import au.com.royalpay.payment.manage.mappers.system.ManagerMapper;
import au.com.royalpay.payment.manage.merchants.core.ClientManager; import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.tools.env.SysConfigManager;
import au.com.royalpay.payment.tools.env.mappers.SysConfigMapper;
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler; import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
@ -23,21 +28,26 @@ public class UpdatePartnerPasswordTask {
@Resource @Resource
private SynchronizedScheduler synchronizedScheduler; private SynchronizedScheduler synchronizedScheduler;
@Resource @Resource
private ManagerMapper managerMapper; private SysConfigManager sysConfigManager;
private final static String EMAIL = "lily.tao@royalpay.com.au,bella.sun@royalpay.com.au,astro.dai@royalpay.com.au,taylor.dang@royalpay.com.au"; // private final static String EMAIL = "lily.tao@royalpay.com.au,bella.sun@royalpay.com.au,astro.dai@royalpay.com.au,taylor.dang@royalpay.com.au";
@Scheduled(cron = "0 0 9 28 * ?") @Scheduled(cron = "0 0 9 28 * ?")
public void resetPartnerPassword() { public void resetPartnerPassword() {
synchronizedScheduler.executeProcess("manage_task:resetPartnerPassword", 300_000, () -> { synchronizedScheduler.executeProcess("manage_task:resetPartnerPassword", 300_000, () -> {
final List<String> emails = new ArrayList<>(); //抄送人邮箱
List<String> emailList = Arrays.asList(EMAIL.split(",")); JSONObject sysConfig = sysConfigManager.getSysConfig();
emailList.stream().forEach(email -> { String ccMail = sysConfig.getString("reset_password.cc_list");
if (!emails.contains(email)) { //账号白名单
emails.add(email); String accountWhiteList = sysConfig.getString("reset_password.account_white_list");
} if (StringUtils.isEmpty(ccMail)) {
}); throw new BadRequestException("抄送人不能为空");
clientManager.updateAllPartnerPassword("PINE", emails); }
if (accountWhiteList == null) {
accountWhiteList = "";
}
List<String> emailList = Arrays.asList(ccMail.split(","));
clientManager.updateAllPartnerPassword("PINE", emailList, accountWhiteList);
}); });
} }
} }

@ -50,4 +50,6 @@ public interface TradeLogService {
void fullReleasePreAuthorization(JSONObject account, TradeLogQuery query)throws Exception; void fullReleasePreAuthorization(JSONObject account, TradeLogQuery query)throws Exception;
PageList<JSONObject> listPreRefundClients(PreRefundQueryBean params); PageList<JSONObject> listPreRefundClients(PreRefundQueryBean params);
void exportSettlementLog(TradeLogQuery query, JSONObject partner, HttpServletResponse response);
} }

@ -28,6 +28,7 @@ import au.com.royalpay.payment.manage.organizations.core.OrgManager;
import au.com.royalpay.payment.manage.tradelog.beans.PreRefundQueryBean; import au.com.royalpay.payment.manage.tradelog.beans.PreRefundQueryBean;
import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery; 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.core.TradeLogService;
import au.com.royalpay.payment.tools.defines.TradeType;
import au.com.royalpay.payment.tools.env.PlatformEnvironment; import au.com.royalpay.payment.tools.env.PlatformEnvironment;
import au.com.royalpay.payment.tools.exceptions.BadRequestException; import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole; import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
@ -68,6 +69,8 @@ import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.hssf.util.HSSFColor; import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
@ -1177,4 +1180,97 @@ public class TradeLogServiceImpl implements TradeLogService {
return transactionMapper.listPreRefundClients(new PageBounds(params.getPage(), params.getLimit())); return transactionMapper.listPreRefundClients(new PageBounds(params.getPage(), params.getLimit()));
} }
@Override
public void exportSettlementLog(TradeLogQuery query, JSONObject partner, HttpServletResponse resp) {
int client_id = partner.getIntValue("client_id");
String begin = query.getDatefrom() == null ?"":query.getDatefrom();
String end = query.getDateto() == null ?"":query.getDateto();
String timezone = partner.getJSONObject("client").getString("timezone");
JSONObject params = query.toParams(timezone);
params.put("client_id", client_id);
List<JSONObject> clientOrderList = transactionMapper.getClientOrderByTransactionTime(params);
List<Integer> clientOrders = new ArrayList<>(clientOrderList.size());
clientOrderList.parallelStream().forEach(p->{
clientOrders.add(p.getInteger("clearing_order"));
});
List<JSONObject> settlementLogDetailList = transactionMapper.getSettlementLogDetailList(clientOrders, client_id);
OutputStream ous = null;
try {
JSONObject clearDetailTotal = transactionMapper.getClearDetailTotal(params);
resp.setContentType("application/octet-stream;");
resp.addHeader("Content-Disposition",
"attachment; filename=" + "Merchant_Settlement_Info_" + begin + "_" + end + ".xlsx");
ous = resp.getOutputStream();
Workbook wb = new XSSFWorkbook();
Cell cell = null;
Font font = wb.createFont();
font.setBoldweight(Font.BOLDWEIGHT_BOLD);
font.setFontHeightInPoints((short) 10);
CellStyle analysisStyle = wb.createCellStyle();
analysisStyle.setFont(font);
Sheet sheet = wb.createSheet("Merchant_Settlement_Info_" + begin + "_" + end);
int rowNum = 0;
Row row = sheet.createRow(rowNum);
String[] title = {"order Id", "Client Order Id", "Transaction Time", "Channel", "Gateway", "Exchange Rate", "Transaction Type", "Currency",
"Input Amount", "Total Amount", "Clearing Amount", "Sruchange Rate", "Settle Amount", "Remark", "Dev No"};
String[] analysis = {"Total Credit", "Total Debit", "Gross Amount", "Total Charge", "Net Amount"};
for (int i = 0; i < title.length; i++) {
row.createCell(i, Cell.CELL_TYPE_STRING).setCellValue(title[i]);
}
JSONObject device;
String clientDevId = "";
for (JSONObject settle : settlementLogDetailList) {
if (settle.getBigDecimal("clearing_amount").compareTo(BigDecimal.ZERO) == 0) {
continue;
}
row = sheet.createRow(++rowNum);
row.createCell(0, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("order_id"));
row.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("client_order_id"));
row.createCell(2, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("transaction_time"));
row.createCell(3, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("channel"));
if (settle.getInteger("gateway") != null) {
row.createCell(4, Cell.CELL_TYPE_STRING).setCellValue(TradeType.fromGatewayNumber(settle.getIntValue("gateway")).getTradeType());
} else {
row.createCell(4, Cell.CELL_TYPE_STRING).setCellValue("-");
}
row.createCell(5, Cell.CELL_TYPE_STRING).setCellValue(settle.getBigDecimal("exchange_rate").setScale(5, BigDecimal.ROUND_DOWN).toPlainString());
row.createCell(6, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("transaction_type"));
row.createCell(7, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("transaction_currency"));
row.createCell(8, Cell.CELL_TYPE_STRING).setCellValue(settle.getBigDecimal("display_amount") == null ? ""
: settle.getBigDecimal("display_amount").setScale(2, BigDecimal.ROUND_DOWN).toPlainString());
row.createCell(9, Cell.CELL_TYPE_STRING).setCellValue(settle.getBigDecimal("transaction_amount") == null ? ""
: settle.getBigDecimal("transaction_amount").setScale(2, BigDecimal.ROUND_DOWN).toPlainString());
row.createCell(10, Cell.CELL_TYPE_STRING).setCellValue(settle.getBigDecimal("clearing_amount") == null ? ""
: settle.getBigDecimal("clearing_amount").setScale(2, BigDecimal.ROUND_DOWN).toPlainString());
row.createCell(11, Cell.CELL_TYPE_STRING).setCellValue(settle.getBigDecimal("rate") == null? "": settle.getBigDecimal("rate").toPlainString() + "%");
row.createCell(12, Cell.CELL_TYPE_STRING).setCellValue(settle.getBigDecimal("settle_amount") == null ? ""
: settle.getBigDecimal("settle_amount").setScale(2, BigDecimal.ROUND_DOWN).toPlainString());
row.createCell(13, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("order_detail"));
device = clientDeviceMapper.find(settle.getString("dev_id"));
if (device != null)
clientDevId = device.getString("client_dev_id");
row.createCell(14, Cell.CELL_TYPE_STRING).setCellValue(clientDevId);
}
row = sheet.createRow(++rowNum);
for (int i = 0; i < analysis.length; i++) {
cell = row.createCell(i, Cell.CELL_TYPE_STRING);
cell.setCellStyle(analysisStyle);
cell.setCellValue(analysis[i]);
}
row = sheet.createRow(++rowNum);
row.createCell(0, Cell.CELL_TYPE_STRING).setCellValue(clearDetailTotal.getString("total_payment"));
row.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(clearDetailTotal.getString("total_refund"));
row.createCell(2, Cell.CELL_TYPE_STRING).setCellValue(clearDetailTotal.getString("gross_amount"));
row.createCell(3, Cell.CELL_TYPE_STRING).setCellValue(clearDetailTotal.getString("total_charge"));
row.createCell(4, Cell.CELL_TYPE_STRING).setCellValue(clearDetailTotal.getString("clearing_amount"));
wb.write(ous);
ous.flush();
} catch (IOException e) {
e.printStackTrace();
} finally {
IOUtils.closeQuietly(ous);
}
}
} }

@ -59,5 +59,10 @@ public class TradeFlowController {
return tradeLogService.getClientUnClearedAmount(partner).toString(); return tradeLogService.getClientUnClearedAmount(partner).toString();
} }
@PartnerMapping(value = "/settlement/log/excel",method = RequestMethod.GET)
@ResponseBody
public void exportSettlementLog(TradeLogQuery query, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, HttpServletResponse response) {
tradeLogService.exportSettlementLog(query, partner, response);
}
} }

@ -133,3 +133,11 @@ settle.abafile.bank.ANZ.apca=514624
settle.abafile.bank.ANZ.bsb=013006 settle.abafile.bank.ANZ.bsb=013006
settle.abafile.bank.ANZ.account-no=837022519 settle.abafile.bank.ANZ.account-no=837022519
settle.abafile.bank.ANZ.account-name=Tunnel Show Pty Ltd settle.abafile.bank.ANZ.account-name=Tunnel Show Pty Ltd
# 瀚银Secure
app.hanyin-secure.pid=ROYALPAY
app.hanyin-secure.sftp-host=180.168.61.86
app.hanyin-secure.sftp-port=28480
app.hanyin-secure.sftp-username=royalpay
app.hanyin-secure.sftp-pwd=royalpay

@ -10,10 +10,11 @@
c.city, c.city,
c.get_prize, c.get_prize,
c.bd_group, c.bd_group,
c.kpi_amount c.kpi_amount,
m.is_valid
FROM sys_managers m FROM sys_managers m
LEFT JOIN financial_bd_config c ON c.manager_id = m.manager_id LEFT JOIN financial_bd_config c ON c.manager_id = m.manager_id
WHERE m.role & 4 > 0 AND m.is_valid = 1 AND (m.org_id = 1 OR m.org_id IS NULL) WHERE m.role & 4 > 0 AND (m.org_id = 1 OR m.org_id IS NULL)
]]> ]]>
</select> </select>

@ -4,13 +4,19 @@
<update id="removeSettleRemark"> <update id="removeSettleRemark">
UPDATE pmt_transactions AS t UPDATE pmt_transactions AS t
INNER JOIN log_clearing_detail d ON d.clear_detail_id = t.clearing_order INNER JOIN log_clearing_detail d ON d.clear_detail_id = t.clearing_order
SET clearing_status = 0, clearing_order = NULL, clearing_time = NULL SET clearing_status = 0,
clearing_order = NULL,
clearing_time = NULL
WHERE d.clearing_id = #{clearing_id} WHERE d.clearing_id = #{clearing_id}
</update> </update>
<delete id="deleteSettlementTransaction"> <delete id="deleteSettlementTransaction">
DELETE t FROM pmt_transactions t DELETE t
INNER JOIN log_clearing_detail d ON d.clear_detail_id = t.clearing_order FROM pmt_transactions t
WHERE d.clearing_id = #{clearing_id} AND t.transaction_type = 'Debit' AND t.refund_id IS NULL and t.channel='Settlement' INNER JOIN log_clearing_detail d ON d.clear_detail_id = t.clearing_order
WHERE d.clearing_id = #{clearing_id}
AND t.transaction_type = 'Debit'
AND t.refund_id IS NULL
and t.channel = 'Settlement'
</delete> </delete>
<select id="listTransFlowPage" resultType="com.alibaba.fastjson.JSONObject"> <select id="listTransFlowPage" resultType="com.alibaba.fastjson.JSONObject">
SELECT t.*,if(t.refund_id is not null,'refund',if(t.transaction_type='Debit' AND SELECT t.*,if(t.refund_id is not null,'refund',if(t.transaction_type='Debit' AND
@ -95,7 +101,7 @@
THEN 'Native QR Code' THEN 'Native QR Code'
WHEN 14 WHEN 14
THEN 'Share Link' THEN 'Share Link'
END AS gateway, END AS gateway,
CASE o.channel CASE o.channel
WHEN 'Alipay' THEN ra.login_id WHEN 'Alipay' THEN ra.login_id
WHEN 'AlipayOnline' THEN ra.login_email WHEN 'AlipayOnline' THEN ra.login_email
@ -217,14 +223,16 @@
<select id="findLastIncome" resultType="com.alibaba.fastjson.JSONObject"> <select id="findLastIncome" resultType="com.alibaba.fastjson.JSONObject">
SELECT * SELECT *
FROM pmt_transactions FROM pmt_transactions
WHERE channel = 'Wechat' AND transaction_type = 'Credit' WHERE channel = 'Wechat'
AND transaction_type = 'Credit'
ORDER BY transaction_time DESC ORDER BY transaction_time DESC
LIMIT 1 LIMIT 1
</select> </select>
<select id="getClientUnClearedAmount" resultType="java.lang.Double"> <select id="getClientUnClearedAmount" resultType="java.lang.Double">
SELECT ifnull(sum(if(transaction_type = 'Credit', clearing_amount, -clearing_amount)), 0) SELECT ifnull(sum(if(transaction_type = 'Credit', clearing_amount, -clearing_amount)), 0)
FROM pmt_transactions FROM pmt_transactions
WHERE clearing_status = 0 AND client_id = #{client_id} WHERE clearing_status = 0
AND client_id = #{client_id}
</select> </select>
<select id="getClientsUnClearedAmount" resultType="com.alibaba.fastjson.JSONObject"> <select id="getClientsUnClearedAmount" resultType="com.alibaba.fastjson.JSONObject">
@ -252,14 +260,13 @@
</select> </select>
<select id="listPreRefundClients" resultType="com.alibaba.fastjson.JSONObject"> <select id="listPreRefundClients" resultType="com.alibaba.fastjson.JSONObject">
SELECT * SELECT *
FROM (SELECT FROM (SELECT ifnull(sum(if(transaction_type = 'Credit', clearing_amount, -clearing_amount)), 0) amount,
ifnull(sum(if(transaction_type = 'Credit', clearing_amount, -clearing_amount)), 0) amount, c.client_id client_id,
c.client_id client_id, max(t.transaction_time) transation_time,
max(t.transaction_time) transation_time, c.client_moniker client_moniker
c.client_moniker client_moniker
FROM pmt_transactions t FROM pmt_transactions t
INNER JOIN sys_clients c ON t.client_id = c.client_id INNER JOIN sys_clients c ON t.client_id = c.client_id
INNER JOIN sys_client_config cc on cc.client_id = c.client_id AND cc.enable_refund_auth = 1 INNER JOIN sys_client_config cc on cc.client_id = c.client_id AND cc.enable_refund_auth = 1
GROUP BY c.client_id) a GROUP BY c.client_id) a
WHERE a.amount &lt; 0 WHERE a.amount &lt; 0
</select> </select>
@ -281,41 +288,38 @@
</select> </select>
<select id="listUnclearedTransactionsOfClient" resultType="com.alibaba.fastjson.JSONObject"> <select id="listUnclearedTransactionsOfClient" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[ <![CDATA[
SELECT c.client_id,
c.client_moniker,
SELECT c.parent_client_id,
c.client_id, c.org_id,
c.client_moniker, cc.clean_days,
c.parent_client_id, t.transaction_id,
c.org_id, t.transaction_type,
cc.clean_days, t.transaction_time,
t.transaction_id, t.clearing_amount,
t.transaction_type, t.channel,
t.transaction_time, t.system_generate,
t.clearing_amount, t.order_id,
t.channel, t.refund_id,
t.system_generate, t.cny_amount,
t.order_id, t.exchange_rate,
t.refund_id, o.display_amount,
t.cny_amount, o.total_amount
t.exchange_rate,
o.display_amount,
o.total_amount
FROM pmt_transactions t FROM pmt_transactions t
INNER JOIN sys_clients c ON c.client_id = t.client_id INNER JOIN sys_clients c ON c.client_id = t.client_id
inner join sys_client_config cc on cc.client_id = c.client_id inner join sys_client_config cc on cc.client_id = c.client_id
LEFT JOIN pmt_orders o ON o.order_id = t.order_id LEFT JOIN pmt_orders o ON o.order_id = t.order_id
WHERE t.clearing_order IS NULL AND t.clearing_status = 0 AND t.channel != 'Settlement' AND WHERE t.clearing_order IS NULL
t.client_id = #{client_id} AND AND t.clearing_status = 0
((t.transaction_type = 'Credit' AND t.transaction_time < #{end} AND t.channel != 'System') AND t.channel != 'Settlement'
OR (t.transaction_type = 'Credit' AND date(t.transaction_time) < date(#{settleDate}) AND AND t.client_id = #{client_id}
t.channel = 'System') AND ((t.transaction_type = 'Credit' AND t.transaction_time < #{end} AND t.channel != 'System')
OR (t.transaction_type = 'Debit' AND t.transaction_time < now()) OR (t.transaction_type = 'Credit' AND date(t.transaction_time) < date(#{settleDate}) AND
) t.channel = 'System')
OR (t.transaction_type = 'Debit' AND t.transaction_time < now())
)
GROUP BY t.transaction_id GROUP BY t.transaction_id
ORDER BY t.transaction_type, t.transaction_time ORDER BY t.transaction_type, t.transaction_time
]]> ]]>
</select> </select>
@ -461,77 +465,66 @@
<select id="getMerchantAmount" resultType="com.alibaba.fastjson.JSONObject"> <select id="getMerchantAmount" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[ <![CDATA[
SELECT temp.* SELECT temp.*
FROM ( FROM (
SELECT SELECT #{clearing_date} AS order_time,
#{clearing_date} AS order_time, #{clearing_date} AS clearing_time,
#{clearing_date} AS clearing_time, t.client_id,
t.client_id, round(sum(if(t.transaction_type = 'Credit', t.clearing_amount, -t.clearing_amount)) *
round(sum(if(t.transaction_type = 'Credit', t.clearing_amount, -t.clearing_amount)) * (100 - ifnull(min(r.rate_value), 1.4))) / 100 clearing_amount,
(100 - ifnull(min(r.rate_value), 1.4))) / 100 clearing_amount, t.transaction_currency currency,
t.transaction_currency currency, t.order_id
t.order_id
FROM pmt_transactions t FROM pmt_transactions t
INNER JOIN sys_client_config c ON t.client_id = c.client_id AND c.skip_clearing = 0 INNER JOIN sys_client_config c ON t.client_id = c.client_id AND c.skip_clearing = 0
LEFT JOIN sys_client_rates r ON r.client_id = t.client_id LEFT JOIN sys_client_rates r ON r.client_id = t.client_id
AND date(r.expiry_time) >= DATE(t.transaction_time) AND date(r.expiry_time) >= DATE(t.transaction_time)
AND date(r.active_time) <= DATE(t.transaction_time) AND date(r.active_time) <= DATE(t.transaction_time)
INNER JOIN sys_bank_accounts a ON a.client_id = t.client_id INNER JOIN sys_bank_accounts a ON a.client_id = t.client_id
WHERE WHERE t.transaction_time >= #{from}
t.transaction_time >= #{from} AND t.transaction_time < #{to} AND t.channel != 'Settlement' AND t.transaction_time < #{to}
AND t.channel != 'Settlement'
GROUP BY t.client_id) temp GROUP BY t.client_id) temp
WHERE clearing_amount != 0 WHERE clearing_amount != 0
]]> ]]>
</select> </select>
<select id="getSumMerchantAmount" resultType="com.alibaba.fastjson.JSONObject"> <select id="getSumMerchantAmount" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[ <![CDATA[
SELECT SUM(temp.clearing_amount) clearing_amount SELECT SUM(temp.clearing_amount) clearing_amount
FROM FROM (SELECT round(sum(if(t.transaction_type = 'Credit', t.clearing_amount, -t.clearing_amount)) *
(SELECT round(sum(if(t.transaction_type = 'Credit', t.clearing_amount, -t.clearing_amount)) * (100 - ifnull(min(r.rate_value), 1.6))) / 100 clearing_amount
(100 - ifnull(min(r.rate_value), 1.6))) / 100 clearing_amount FROM pmt_transactions t
FROM pmt_transactions t INNER JOIN sys_client_config c ON t.client_id = c.client_id AND c.skip_clearing = 0
INNER JOIN sys_client_config c ON t.client_id = c.client_id AND c.skip_clearing = 0 LEFT JOIN sys_client_rates r ON r.client_id = t.client_id
LEFT JOIN sys_client_rates r ON r.client_id = t.client_id AND date(r.expiry_time) >= DATE(t.transaction_time)
AND date(r.expiry_time) >= DATE(t.transaction_time) AND date(r.active_time) <= DATE(t.transaction_time)
AND date(r.active_time) <= DATE(t.transaction_time) INNER JOIN sys_bank_accounts a ON a.client_id = t.client_id
INNER JOIN sys_bank_accounts a ON a.client_id = t.client_id WHERE t.transaction_time >= #{from}
WHERE AND t.transaction_time < #{to}
t.transaction_time >= #{from} AND t.transaction_time < #{to} AND t.channel != 'Settlement' AND t.channel != 'Settlement'
GROUP BY t.client_id) temp GROUP BY t.client_id) temp
WHERE temp.clearing_amount != 0 WHERE temp.clearing_amount != 0
]]> ]]>
</select> </select>
<select id="analysisTotalTransactions" resultType="java.lang.Double"> <select id="analysisTotalTransactions" resultType="java.lang.Double">
<![CDATA[ <![CDATA[
SELECT ifnull(sum(clearing_amount), 0) total SELECT ifnull(sum(clearing_amount), 0) total
FROM pmt_transactions FROM pmt_transactions
WHERE client_id = #{client_id} AND date(transaction_time) >= date(#{begin}) AND WHERE client_id = #{client_id}
date(transaction_time) <= date(#{end}) AND date(transaction_time) >= date(#{begin})
AND date(transaction_time) <= date(#{end})
]]> ]]>
</select> </select>
<select id="listTransactionsOfClearingTask" resultType="com.alibaba.fastjson.JSONObject"> <select id="listTransactionsOfClearingTask" resultType="com.alibaba.fastjson.JSONObject">
SELECT SELECT t.*,
t.*, cl.client_moniker
cl.client_moniker
FROM pmt_transactions t FROM pmt_transactions t
INNER JOIN log_clearing_detail d ON d.clear_detail_id = t.clearing_order INNER JOIN log_clearing_detail d ON d.clear_detail_id = t.clearing_order
INNER JOIN log_clearing c ON c.clearing_id = d.clearing_id AND c.clearing_id = #{clear_id} INNER JOIN log_clearing c ON c.clearing_id = d.clearing_id AND c.clearing_id = #{clear_id}
INNER JOIN sys_clients cl ON cl.client_id = t.client_id INNER JOIN sys_clients cl ON cl.client_id = t.client_id
inner join sys_client_config cc on cc.clear_id = cl.client_id and cc.is_valid = 1 inner join sys_client_config cc on cc.clear_id = cl.client_id and cc.is_valid = 1
WHERE t.transaction_type = 'Credit' OR t.refund_id IS NOT NULL WHERE t.transaction_type = 'Credit'
OR t.refund_id IS NOT NULL
ORDER BY t.order_id ASC ORDER BY t.order_id ASC
</select> </select>
@ -560,259 +553,267 @@
<select id="TotalAmountForBDPrize" resultType="java.math.BigDecimal"> <select id="TotalAmountForBDPrize" resultType="java.math.BigDecimal">
<![CDATA[ <![CDATA[
select sum(if(temp.transaction_type = 'Credit', temp.clearing_amount * d.proportion,
-temp.clearing_amount * d.proportion))
select sum(if(temp.transaction_type='Credit',temp.clearing_amount*d.proportion,-temp.clearing_amount*d.proportion)) total
total FROM FROM (SELECT l.client_id,l.clearing_amount,l.refund_id,l.transaction_type,o.create_time
(SELECT l.client_id,l.clearing_amount,l.refund_id,l.transaction_type,o.create_time FROM pmt_transactions l FROM pmt_transactions l
INNER JOIN pmt_orders o INNER JOIN pmt_orders o
ON o.order_id = l.order_id ON o.order_id = l.order_id
and year(o.create_time) = #{year} AND month(o.create_time) = #{month} and year(o.create_time) = #{year} AND month(o.create_time) = #{month}
where (l.transaction_type='Credit' or l.refund_id is not null) where (l.transaction_type = 'Credit' or l.refund_id is not null)
) temp ) temp
INNER JOIN sys_client_bd d ON temp.client_id = d.client_id AND d.start_date <= temp.create_time and INNER JOIN sys_client_bd d ON temp.client_id = d.client_id AND d.start_date <= temp.create_time and
d.is_valid = '1' d.is_valid = '1'
AND (d.end_date is null or d.end_date > temp.create_time) AND (d.end_date is null or d.end_date > temp.create_time)
and d.bd_id=#{bd_id} and d.bd_id = #{bd_id}
]]> ]]>
</select> </select>
<select id="TotalAmountForBDLeaderPrize" resultType="java.math.BigDecimal"> <select id="TotalAmountForBDLeaderPrize" resultType="java.math.BigDecimal">
SELECT SELECT ifnull(sum(t.total), 0)
ifnull(sum(t.total),0) total
total
FROM statistics_customer_order t FROM statistics_customer_order t
INNER JOIN sys_clients c ON c.client_id = t.client_id AND c.org_id = 1 INNER JOIN sys_clients c ON c.client_id = t.client_id AND c.org_id = 1
WHERE year(t.date) = #{year} AND month(t.date) = #{month} WHERE year(t.date) = #{year}
and t.client_id!=0 AND month(t.date) = #{month}
and t.client_id in and t.client_id != 0
(SELECT b.client_id FROM sys_client_bd b and t.client_id in
INNER JOIN financial_bd_config c ON c.manager_id=b.bd_id (SELECT b.client_id
where b.is_valid=1 and b.start_date&lt;=now() and (b.end_date is null or b.end_date &gt;= now()) FROM sys_client_bd b
AND c.bd_group=#{bd_group} or c.manager_id=#{bd_group}) INNER JOIN financial_bd_config c ON c.manager_id = b.bd_id
where b.is_valid = 1 and b.start_date &lt;= now() and (b.end_date is null or b.end_date &gt;= now())
AND c.bd_group = #{bd_group}
or c.manager_id = #{bd_group})
</select> </select>
<select id="TotalAmountForSydneyGMPrize" resultType="java.math.BigDecimal"> <select id="TotalAmountForSydneyGMPrize" resultType="java.math.BigDecimal">
SELECT SELECT ifnull(sum(t.total), 0)
ifnull(sum(t.total),0) total
total
FROM statistics_customer_order t FROM statistics_customer_order t
INNER JOIN sys_clients c ON c.client_id = t.client_id AND c.org_id = 1 INNER JOIN sys_clients c ON c.client_id = t.client_id AND c.org_id = 1
WHERE year(t.date) = #{year} AND month(t.date) = #{month} WHERE year(t.date) = #{year}
and t.client_id!=0 AND month(t.date) = #{month}
and t.client_id in and t.client_id != 0
(SELECT b.client_id FROM sys_client_bd b and t.client_id in
INNER JOIN financial_bd_config c ON c.manager_id=b.bd_id (SELECT b.client_id
where b.is_valid=1 and b.start_date&lt;=now() and (b.end_date is null or b.end_date &gt;= now()) FROM sys_client_bd b
AND c.city='Sydney') INNER JOIN financial_bd_config c ON c.manager_id = b.bd_id
where b.is_valid = 1
and b.start_date &lt;= now()
and (b.end_date is null or b.end_date &gt;= now())
AND c.city = 'Sydney')
</select> </select>
<select id="listTransactionsForCityPartnerCommission" resultType="com.alibaba.fastjson.JSONObject"> <select id="listTransactionsForCityPartnerCommission" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[ <![CDATA[
SELECT sum(if(t.transaction_type = 'Credit', t.clearing_amount, -t.clearing_amount)) * b.proportion
total,
SELECT t.client_id,
sum(if(t.transaction_type = 'Credit', t.clearing_amount, -t.clearing_amount)) * b.proportion m.org_id,
total, c.approve_time client_create_time,
t.client_id, c.source client_source,
m.org_id, date(t.transaction_time) trade_date,
c.approve_time client_create_time, t.channel channel,
c.source client_source, ifnull((SELECT min(r.rate_value)
date(t.transaction_time) trade_date, FROM sys_client_rates r
t.channel channel, WHERE r.client_id = t.client_id
ifnull((SELECT min(r.rate_value) AND r.active_time <= t.transaction_time
FROM sys_client_rates r AND r.expiry_time >= t.transaction_time
WHERE r.client_id = t.client_id AND r.active_time <= t.transaction_time AND AND r.rate_name = 'Wechat'), 1) wechat_rate_value,
r.expiry_time >= t.transaction_time AND ifnull((SELECT min(r.rate_value)
r.rate_name = 'Wechat'), 1) wechat_rate_value, FROM sys_client_rates r
ifnull((SELECT min(r.rate_value) WHERE r.client_id = t.client_id
FROM sys_client_rates r AND r.active_time <= t.transaction_time
WHERE r.client_id = t.client_id AND r.active_time <= t.transaction_time AND AND r.expiry_time >= t.transaction_time
r.expiry_time >= t.transaction_time AND AND r.rate_name = 'Alipay'), 1) alipay_rate_value,
r.rate_name = 'Alipay'), 1) alipay_rate_value, ifnull((SELECT min(r.rate_value)
ifnull((SELECT min(r.rate_value) FROM sys_client_rates r
FROM sys_client_rates r WHERE r.client_id = t.client_id
WHERE r.client_id = t.client_id AND r.active_time <= t.transaction_time AND AND r.active_time <= t.transaction_time
r.expiry_time >= t.transaction_time AND AND r.expiry_time >= t.transaction_time
r.rate_name = 'Bestpay'), 1) bestpay_rate_value, AND r.rate_name = 'Bestpay'), 1) bestpay_rate_value,
ifnull((SELECT min(r.rate_value) ifnull((SELECT min(r.rate_value)
FROM sys_client_rates r FROM sys_client_rates r
WHERE r.client_id = t.client_id AND r.active_time <= t.transaction_time AND WHERE r.client_id = t.client_id
r.expiry_time >= t.transaction_time AND AND r.active_time <= t.transaction_time
r.rate_name = 'jd'), 1) jd_rate_value, AND r.expiry_time >= t.transaction_time
ifnull((SELECT min(r.rate_value) AND r.rate_name = 'jd'), 1) jd_rate_value,
FROM sys_client_rates r ifnull((SELECT min(r.rate_value)
WHERE r.client_id = t.client_id AND r.active_time <= t.transaction_time AND FROM sys_client_rates r
r.expiry_time >= t.transaction_time AND WHERE r.client_id = t.client_id
r.rate_name = 'AlipayOnline'), 2.0) AlipayOnline_rate_value AND r.active_time <= t.transaction_time
AND r.expiry_time >= t.transaction_time
AND r.rate_name = 'AlipayOnline'), 2.0) AlipayOnline_rate_value
FROM pmt_transactions t FROM pmt_transactions t
INNER JOIN sys_clients c ON c.client_id = t.client_id INNER JOIN sys_clients c ON c.client_id = t.client_id
INNER JOIN sys_client_bd b ON b.client_id = c.client_id AND b.start_date <= t.transaction_time INNER JOIN sys_client_bd b ON b.client_id = c.client_id AND b.start_date <= t.transaction_time
AND (b.end_date IS NULL OR b.end_date >= t.transaction_time) AND AND (b.end_date IS NULL OR b.end_date >= t.transaction_time) AND
b.is_valid = 1 b.is_valid = 1
INNER JOIN sys_managers m ON m.manager_id = b.bd_id INNER JOIN sys_managers m ON m.manager_id = b.bd_id
INNER JOIN sys_org so INNER JOIN sys_org so
ON m.org_id = so.org_id AND so.is_valid = 1 AND so.type = 0 AND so.citypartner = 1 AND so.commission = 1 ON m.org_id = so.org_id AND so.is_valid = 1 AND so.type = 0 AND so.citypartner = 1 AND
WHERE year(t.transaction_time) = #{year} AND month(t.transaction_time) = #{month} AND t.channel != 'Settlement' so.commission = 1
WHERE year(t.transaction_time) = #{year}
AND month(t.transaction_time) = #{month}
AND t.channel != 'Settlement'
GROUP BY t.client_id, trade_date, channel GROUP BY t.client_id, trade_date, channel
ORDER BY c.org_id ASC, t.client_id ASC, trade_date ASC ORDER BY c.org_id ASC, t.client_id ASC, trade_date ASC
]]> ]]>
</select> </select>
<select id="listTransactionForCityPartnerCommissionByDate" resultType="com.alibaba.fastjson.JSONObject"> <select id="listTransactionForCityPartnerCommissionByDate" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[ <![CDATA[
select t.org_id,t.clearing_currency,t.client_id,t.channel,t.surcharge_rate,t.transaction_time,if(t.transaction_type = 'Credit', t.clearing_amount, -t.clearing_amount) clearing_amount, select t.org_id,
if(t.transaction_type = 'Credit', t.total_surcharge, -t.total_surcharge) total_surcharge, t.clearing_currency,
if(t.transaction_type = 'Credit', t.channel_surcharge, -t.channel_surcharge) channel_surcharge, t.client_id,
t.order_id t.channel,
from pmt_transactions t INNER JOIN sys_org so ON t.org_id = so.org_id AND so.is_valid = 1 t.surcharge_rate,
AND so.type=0 t.transaction_time,
AND so.citypartner = 1 AND so.commission = 1 if(t.transaction_type = 'Credit', t.clearing_amount, -t.clearing_amount) clearing_amount,
AND year(t.transaction_time) = #{year} AND month(t.transaction_time) = #{month} if(t.transaction_type = 'Credit', t.total_surcharge, -t.total_surcharge) total_surcharge,
AND t.channel != 'Settlement' AND t.channel!='System' if(t.transaction_type = 'Credit', t.channel_surcharge, -t.channel_surcharge) channel_surcharge,
t.order_id
from pmt_transactions t
INNER JOIN sys_org so ON t.org_id = so.org_id AND so.is_valid = 1
AND so.type = 0
AND so.citypartner = 1 AND so.commission = 1
AND year(t.transaction_time) = #{year} AND month(t.transaction_time) = #{month}
AND t.channel != 'Settlement' AND t.channel != 'System'
ORDER BY t.client_id asc ORDER BY t.client_id asc
]]> ]]>
</select> </select>
<select id="listTransactionForCityPartnerAgentCommissionByDate" resultType="com.alibaba.fastjson.JSONObject"> <select id="listTransactionForCityPartnerAgentCommissionByDate" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[ <![CDATA[
select t.org_id,t.client_id,t.channel,t.surcharge_rate,t.transaction_time,if(t.transaction_type = 'Credit', t.clearing_amount, -t.clearing_amount) clearing_amount, select t.org_id,
if(t.transaction_type = 'Credit', t.total_surcharge, -t.total_surcharge) total_surcharge, t.client_id,
if(t.transaction_type = 'Credit', t.channel_surcharge, -t.channel_surcharge) channel_surcharge, t.channel,
t.order_id t.surcharge_rate,
from pmt_transactions t INNER JOIN sys_org so ON t.org_id = so.org_id AND so.is_valid = 1 t.transaction_time,
AND so.type=0 if(t.transaction_type = 'Credit', t.clearing_amount, -t.clearing_amount) clearing_amount,
AND so.parent_org_id !='' if(t.transaction_type = 'Credit', t.total_surcharge, -t.total_surcharge) total_surcharge,
AND so.citypartner = 1 AND so.commission = 1 if(t.transaction_type = 'Credit', t.channel_surcharge, -t.channel_surcharge) channel_surcharge,
AND year(t.transaction_time) = #{year} AND month(t.transaction_time) = #{month} t.order_id
AND t.channel != 'Settlement' AND t.channel!='System' from pmt_transactions t
INNER JOIN sys_org so ON t.org_id = so.org_id AND so.is_valid = 1
AND so.type = 0
AND so.parent_org_id != ''
AND so.citypartner = 1 AND so.commission = 1
AND year(t.transaction_time) = #{year} AND month(t.transaction_time) = #{month}
AND t.channel != 'Settlement' AND t.channel != 'System'
ORDER BY t.client_id asc ORDER BY t.client_id asc
]]> ]]>
</select> </select>
<select id="listTransactionsForReferrerCommission" resultType="com.alibaba.fastjson.JSONObject"> <select id="listTransactionsForReferrerCommission" resultType="com.alibaba.fastjson.JSONObject">
SELECT SELECT sum(if(t.transaction_type = 'Credit', t.clearing_amount, -t.clearing_amount))
sum(if(t.transaction_type = 'Credit', t.clearing_amount, -t.clearing_amount)) total,
total, t.client_id client_id,
t.client_id client_id, so.org_id org_id,
so.org_id org_id, c.source client_source,
c.source client_source, date(t.transaction_time) trade_date,
date(t.transaction_time) trade_date, ifnull(so.rate_value, 1) rate_value
ifnull(so.rate_value, 1) rate_value
FROM pmt_transactions t FROM pmt_transactions t
INNER JOIN sys_clients c ON c.client_id = t.client_id INNER JOIN sys_clients c ON c.client_id = t.client_id
inner join sys_client_config cc on cc.client_id = c.client_id inner join sys_client_config cc on cc.client_id = c.client_id
INNER JOIN sys_org so INNER JOIN sys_org so
ON c.referrer_id = so.org_id AND so.is_valid = 1 AND so.type = 1 AND so.commission = 1 ON c.referrer_id = so.org_id AND so.is_valid = 1 AND so.type = 1 AND so.commission = 1
WHERE year(t.transaction_time) = #{year} AND month(t.transaction_time) = #{month} AND t.channel != 'Settlement' WHERE year(t.transaction_time) = #{year}
AND month(t.transaction_time) = #{month}
AND t.channel != 'Settlement'
GROUP BY so.org_id, trade_date, t.client_id GROUP BY so.org_id, trade_date, t.client_id
ORDER BY c.org_id ASC, t.client_id ASC, trade_date ASC ORDER BY c.org_id ASC, t.client_id ASC, trade_date ASC
</select> </select>
<select id="listTransactionsForAgentCommission" resultType="com.alibaba.fastjson.JSONObject"> <select id="listTransactionsForAgentCommission" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[ <![CDATA[
SELECT sum(if(t.transaction_type = 'Credit', t.clearing_amount, -t.clearing_amount))
total,
SELECT t.client_id client_id,
sum(if(t.transaction_type = 'Credit', t.clearing_amount, -t.clearing_amount)) c.approve_time client_create_time,
total, c.source client_source,
t.client_id client_id, date(t.transaction_time) trade_date,
c.approve_time client_create_time, t.channel channel,
c.source client_source, ifnull(so.rate_value, 1) rate_value,
date(t.transaction_time) trade_date, ifnull((SELECT min(r.rate_value)
t.channel channel, FROM sys_client_rates r
ifnull(so.rate_value, 1) rate_value, WHERE r.client_id = t.client_id
ifnull((SELECT min(r.rate_value) AND r.active_time <= t.transaction_time
FROM sys_client_rates r AND r.expiry_time >= t.transaction_time
WHERE r.client_id = t.client_id AND r.active_time <= t.transaction_time AND AND r.rate_name = 'Wechat'), 1) wechat_rate_value,
r.expiry_time >= t.transaction_time AND ifnull((SELECT min(r.rate_value)
r.rate_name = 'Wechat'), 1) wechat_rate_value, FROM sys_client_rates r
ifnull((SELECT min(r.rate_value) WHERE r.client_id = t.client_id
FROM sys_client_rates r AND r.active_time <= t.transaction_time
WHERE r.client_id = t.client_id AND r.active_time <= t.transaction_time AND AND r.expiry_time >= t.transaction_time
r.expiry_time >= t.transaction_time AND AND r.rate_name = 'Alipay'), 1) alipay_rate_value,
r.rate_name = 'Alipay'), 1) alipay_rate_value, ifnull((SELECT min(r.rate_value)
ifnull((SELECT min(r.rate_value) FROM sys_client_rates r
FROM sys_client_rates r WHERE r.client_id = t.client_id
WHERE r.client_id = t.client_id AND r.active_time <= t.transaction_time AND AND r.active_time <= t.transaction_time
r.expiry_time >= t.transaction_time AND AND r.expiry_time >= t.transaction_time
r.rate_name = 'Bestpay'), 1) bestpay_rate_value, AND r.rate_name = 'Bestpay'), 1) bestpay_rate_value,
ifnull((SELECT min(r.rate_value) ifnull((SELECT min(r.rate_value)
FROM sys_client_rates r FROM sys_client_rates r
WHERE r.client_id = t.client_id AND r.active_time <= t.transaction_time AND WHERE r.client_id = t.client_id
r.expiry_time >= t.transaction_time AND AND r.active_time <= t.transaction_time
r.rate_name = 'jd'), 1) jd_rate_value, AND r.expiry_time >= t.transaction_time
ifnull((SELECT min(r.rate_value) AND r.rate_name = 'jd'), 1) jd_rate_value,
FROM sys_client_rates r ifnull((SELECT min(r.rate_value)
WHERE r.client_id = t.client_id AND r.active_time <= t.transaction_time AND FROM sys_client_rates r
r.expiry_time >= t.transaction_time AND WHERE r.client_id = t.client_id
r.rate_name = 'AlipayOnline'), 2.0) AlipayOnline_rate_value AND r.active_time <= t.transaction_time
AND r.expiry_time >= t.transaction_time
AND r.rate_name = 'AlipayOnline'), 2.0) AlipayOnline_rate_value
FROM pmt_transactions t FROM pmt_transactions t
INNER JOIN sys_clients c ON c.client_id = t.client_id INNER JOIN sys_clients c ON c.client_id = t.client_id
INNER JOIN sys_org so INNER JOIN sys_org so
ON c.org_id = so.org_id AND so.is_valid = 1 AND so.type = 0 AND so.parent_org_id = #{parent_org_id} ON c.org_id = so.org_id AND so.is_valid = 1 AND so.type = 0 AND so.parent_org_id = #{parent_org_id}
WHERE year(t.transaction_time) = #{year} AND month(t.transaction_time) = #{month} AND t.channel != 'Settlement' WHERE year(t.transaction_time) = #{year}
AND month(t.transaction_time) = #{month}
AND t.channel != 'Settlement'
GROUP BY t.client_id, trade_date, channel GROUP BY t.client_id, trade_date, channel
ORDER BY c.org_id ASC, t.client_id ASC, trade_date ASC ORDER BY c.org_id ASC, t.client_id ASC, trade_date ASC
]]> ]]>
</select> </select>
<select id="checkBalance" resultType="java.math.BigDecimal"> <select id="checkBalance" resultType="java.math.BigDecimal">
<![CDATA[ <![CDATA[
SELECT sum(subval) SELECT sum(subval)
FROM (SELECT FROM (SELECT c.client_moniker,
c.client_moniker, a.client_id,
a.client_id, a.total_credit,
a.total_credit, a.total_debit,
a.total_debit, a.total_debit - a.total_credit subval
a.total_debit - a.total_credit subval FROM (
FROM SELECT sum(
( IF(
SELECT t.transaction_type = 'Credit',
sum( t.clearing_amount,
0
IF( )
t.transaction_type = 'Credit', ) total_credit,
t.clearing_amount, sum(
0 IF(
) t.transaction_type = 'Debit',
) total_credit, t.clearing_amount,
sum( 0
)
IF( ) total_debit,
t.transaction_type = 'Debit', t.client_id
t.clearing_amount, FROM pmt_transactions t
0 WHERE t.clearing_status = 1
) AND (date(t.clearing_time) <= date(#{end}) OR t.clearing_time IS NULL)
) total_debit, GROUP BY t.client_id
t.client_id ) a
FROM INNER JOIN sys_clients c ON c.client_id = a.client_id
pmt_transactions t AND c.client_id != 9
WHERE AND (
t.clearing_status = 1 c.parent_client_id != 9
AND (date(t.clearing_time) <= date(#{end}) OR t.clearing_time IS NULL) OR c.parent_client_id IS NULL
GROUP BY )
t.client_id WHERE abs(total_credit - total_debit) > 1
) a ORDER BY subval DESC) t
INNER JOIN sys_clients c ON c.client_id = a.client_id
AND c.client_id != 9
AND (
c.parent_client_id != 9
OR c.parent_client_id IS NULL
)
WHERE
abs(total_credit - total_debit) > 1
ORDER BY
subval DESC) t
]]> ]]>
</select> </select>
<select id="listDailyTransactions" resultType="com.alibaba.fastjson.JSONObject"> <select id="listDailyTransactions" resultType="com.alibaba.fastjson.JSONObject">
@ -866,37 +867,35 @@ select sum(if(temp.transaction_type='Credit',temp.clearing_amount*d.proportion,
</select> </select>
<select id="listTransactionsOfClearingOrder" resultType="com.alibaba.fastjson.JSONObject"> <select id="listTransactionsOfClearingOrder" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[ <![CDATA[
SELECT t.*,
o.display_amount,
SELECT o.client_order_id,
t.*, o.gateway,
o.display_amount, r.out_refund_id,
o.client_order_id, r.client_refund_id,
o.gateway, o.order_detail,
r.out_refund_id, o.dev_id
r.client_refund_id,
o.order_detail,
o.dev_id
FROM pmt_transactions t FROM pmt_transactions t
LEFT JOIN pmt_orders o ON o.order_id = t.order_id LEFT JOIN pmt_orders o ON o.order_id = t.order_id
LEFT JOIN pmt_refunds r ON r.refund_id = t.refund_id LEFT JOIN pmt_refunds r ON r.refund_id = t.refund_id
WHERE t.channel != 'Settlement' AND t.clearing_order = #{clearing_order} WHERE t.channel != 'Settlement'
AND t.clearing_order = #{clearing_order}
]]> ]]>
</select> </select>
<select id="listSettlementTransactions" resultType="com.alibaba.fastjson.JSONObject"> <select id="listSettlementTransactions" resultType="com.alibaba.fastjson.JSONObject">
SELECT t.* SELECT t.*
FROM pmt_transactions t FROM pmt_transactions t
WHERE t.channel = 'Settlement' AND t.clearing_order = #{clearing_order} WHERE t.channel = 'Settlement'
AND t.clearing_order = #{clearing_order}
</select> </select>
<select id="analysisCustomerPaid" resultType="java.math.BigDecimal"> <select id="analysisCustomerPaid" resultType="java.math.BigDecimal">
SELECT ifnull(sum(t.clearing_amount), 0) SELECT ifnull(sum(t.clearing_amount), 0)
FROM pmt_transactions t FROM pmt_transactions t
INNER JOIN pmt_orders o INNER JOIN pmt_orders o
ON o.order_id = t.order_id AND o.transaction_date BETWEEN #{startDate} AND #{endDate} AND ON o.order_id = t.order_id AND o.transaction_date BETWEEN #{startDate} AND #{endDate} AND
o.customer_id = #{customer_id} o.customer_id = #{customer_id}
WHERE t.system_generate = 0 AND t.transaction_type = 'Credit' WHERE t.system_generate = 0
AND t.transaction_type = 'Credit'
</select> </select>
<select id="getSettleDelayAnalysis" resultType="com.alibaba.fastjson.JSONObject"> <select id="getSettleDelayAnalysis" resultType="com.alibaba.fastjson.JSONObject">
@ -951,41 +950,152 @@ select sum(if(temp.transaction_type='Credit',temp.clearing_amount*d.proportion,
group by client_id group by client_id
</select> </select>
<select id="listClientUnsettleDataByDate" resultType="com.alibaba.fastjson.JSONObject"> <select id="listClientUnsettleDataByDate" resultType="com.alibaba.fastjson.JSONObject">
SELECT SELECT date(transaction_time) trans_date,
date(transaction_time) trans_date, sum(if(transaction_type = 'Credit', clearing_amount, -clearing_amount)) clearing_amount,
sum(if(transaction_type = 'Credit', clearing_amount, -clearing_amount)) clearing_amount, sum(if(transaction_type = 'Credit', settle_amount, -settle_amount)) settle_amount
sum(if(transaction_type = 'Credit', settle_amount, -settle_amount)) settle_amount
FROM pmt_transactions t FROM pmt_transactions t
WHERE t.client_id = #{client_id} AND t.clearing_status = 0 AND date(t.transaction_time)&lt;=date(#{max_settle_to}) WHERE t.client_id = #{client_id}
AND t.clearing_status = 0
AND date(t.transaction_time) &lt;= date(#{max_settle_to})
GROUP BY trans_date GROUP BY trans_date
ORDER BY trans_date DESC ORDER BY trans_date DESC
</select> </select>
<select id="getHfClearAmount" resultType="com.alibaba.fastjson.JSONObject"> <select id="getHfClearAmount" resultType="com.alibaba.fastjson.JSONObject">
SELECT sum(clearing_amount) clear_amount, SELECT sum(clearing_amount) clear_amount,
sum(channel_surcharge) charge_amount , sum(channel_surcharge) charge_amount,
transaction_type transaction_type
FROM pmt_transactions where channel='hf' FROM pmt_transactions
AND transaction_time >= #{datefrom} where channel = 'hf'
AND transaction_time &lt;= #{dateto} AND transaction_time >= #{datefrom}
GROUP BY transaction_type AND transaction_time &lt;= #{dateto}
GROUP BY transaction_type
</select> </select>
<select id="analysisForATOReport" resultType="com.alibaba.fastjson.JSONObject"> <select id="analysisForATOReport" resultType="com.alibaba.fastjson.JSONObject">
select sum(if(transaction_type='Credit',t.clearing_amount,0)) gross_payment, select sum(if(transaction_type = 'Credit', t.clearing_amount, 0)) gross_payment,
sum(if(transaction_type='Credit',1,0)) pay_count, sum(if(transaction_type = 'Credit', 1, 0)) pay_count,
sum(if(transaction_type='Debit',t.clearing_amount,0)) total_refund, sum(if(transaction_type = 'Debit', t.clearing_amount, 0)) total_refund,
sum(if(transaction_type='Debit',1,0)) refund_count, sum(if(transaction_type = 'Debit', 1, 0)) refund_count,
min(t.transaction_time) period_start, min(t.transaction_time) period_start,
max(t.transaction_time) period_end, max(t.transaction_time) period_end,
cd.bsb_no, cd.bsb_no,
cd.account_no, cd.account_no,
cd.account_name cd.account_name
from pmt_transactions t from pmt_transactions t
inner join log_clearing_detail cd on cd.clear_detail_id=t.clearing_order inner join log_clearing_detail cd on cd.clear_detail_id = t.clearing_order
where t.client_id=#{clientId} and t.system_generate=0 and t.clearing_status=1 and t.transaction_time between #{from} and #{to} where t.client_id = #{clientId}
and t.channel!='Settlement' and t.system_generate = 0
and t.clearing_status = 1
and t.transaction_time between #{from} and #{to}
and t.channel != 'Settlement'
group by cd.bsb_no,cd.account_no group by cd.bsb_no,cd.account_no
order by period_start order by period_start
</select> </select>
<select id="listCreditTransactionsForSecure" resultType="com.alibaba.fastjson.JSONObject">
select c.client_moniker,
o.order_id,
o.gateway,
t.transaction_amount,
t.transaction_currency,
t.order_channel,
t.clearing_amount,
t.exchange_rate,
t.transaction_time,
t.transaction_type
from pmt_transactions t
inner join pmt_orders o on o.order_id = t.order_id
inner join sys_clients c on c.client_id = t.client_id
where t.transaction_time between #{from} and #{to}
and t.channel not in ('Settlement', 'System')
and t.system_generate = 0
and t.transaction_type = 'Credit'
</select>
<select id="listDebitTransactionsForSecure" resultType="com.alibaba.fastjson.JSONObject">
select c.client_moniker,
o.order_id,
o.gateway,
r.out_refund_id,
t.transaction_amount,
t.transaction_currency,
t.order_channel,
t.clearing_amount,
t.exchange_rate,
t.transaction_time,
t.transaction_type
from pmt_transactions t
inner join pmt_orders o on o.order_id = t.order_id
inner join sys_clients c on c.client_id = t.client_id
inner join pmt_refunds r on r.refund_id = t.refund_id
where t.transaction_time between #{from} and #{to}
and t.channel not in ('Settlement', 'System')
and t.system_generate = 0
and t.transaction_type = 'Debit'
</select>
<select id="getClearDetailTotal" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
SELECT
client_id,
sum(total_payment) total_payment,
sum(total_refund) total_refund,
sum(gross_amount) gross_amount,
SUM(clearing_amount) clearing_amount,
sum(total_charge) total_charge
from (
SELECT
t.client_id,
total_payment,
total_refund,
gross_amount,
cd.clearing_amount,
total_charge
FROM
pmt_transactions t
LEFT JOIN log_clearing_detail cd ON cd.clear_detail_id = t.clearing_order
WHERE
t.channel = 'Settlement' and t.client_id=#{client_id}
]]>
<if test="from!=null">and t.transaction_time &gt;= #{from}</if>
<if test="to!=null">and t.transaction_time &lt; #{to}</if>
GROUP BY
t.order_id) temp
</select>
<select id="getSettlementLogDetailList" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
SELECT
t.*, o.display_amount,
o.client_order_id,
o.gateway,
r.out_refund_id,
r.client_refund_id,
o.order_detail,
o.dev_id,
a.rate
FROM
pmt_transactions t
LEFT JOIN pmt_orders o ON o.order_id = t.order_id
LEFT JOIN pmt_refunds r ON r.refund_id = t.refund_id
LEFT JOIN log_clearing_detail_analysis a ON a.clearing_detail_id = t.clearing_order
AND t.channel = a.channel
WHERE t.channel != 'Settlement' AND t.client_id = #{client_id}
]]>
<if test="clientOrders!=null">
AND t.clearing_order IN
<foreach collection="clientOrders" open="(" close=")" separator="," item="clearing_order">
#{clearing_order}
</foreach>
</if>
ORDER BY transaction_time DESC
</select>
<select id="getClientOrderByTransactionTime" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
SELECT t.clearing_order
FROM pmt_transactions t
WHERE t.channel='Settlement' AND client_id = #{client_id}
]]>
<if test="from!=null">and t.transaction_time &gt;= #{from}</if>
<if test="to!=null">and t.transaction_time &lt; #{to}</if>
</select>
</mapper> </mapper>

@ -241,7 +241,7 @@
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach> <foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach>
</if> </if>
<if test="referrer_id!=null">and c.referrer_id=#{referrer_id}</if> <if test="referrer_id!=null">and c.referrer_id=#{referrer_id}</if>
<if test="is_valid">and c.is_valid=1</if> <if test="is_valid">and c.is_valid=0</if>
</where> </where>
</select> </select>

@ -9,7 +9,8 @@
</span> </span>
请于 请于
<span th:text="${reply_date}" style="background: #FCE824;"></span> <span th:text="${reply_date}" style="background: #FCE824;"></span>
<span style="background: #FCE824;">下午5:00悉尼时间</span>提供腾讯被查商户 <span style="background: #FCE824;">下午5:00悉尼时间</span>
提供<span th:if="${order_type != 2}">腾讯</span><span th:if="${order_type == 2}">支付宝</span>被查商户
<span th:text="${client.short_name}"></span> (<span th:text="${client.client_moniker}"></span>)的以下材料: <span th:text="${client.short_name}"></span> (<span th:text="${client.client_moniker}"></span>)的以下材料:
</p> </p>

@ -349,7 +349,7 @@
<div class="form-group has-feedback" <div class="form-group has-feedback"
ng-class="{'has-error':companyForm.short_name.$invalid && companyForm.short_name.$dirty}"> ng-class="{'has-error':companyForm.short_name.$invalid && companyForm.short_name.$dirty}">
<input type="text" class="form-control" ng-model="partner.short_name" name="short_name" <input type="text" class="form-control" ng-model="partner.short_name" name="short_name"
placeholder="Merchant Name" required maxlength="50"> placeholder="Merchant Name" required maxlength="15">
</div> </div>
<div class="form-group has-feedback" <div class="form-group has-feedback"
ng-class="{'has-error':companyForm.company_phone.$invalid && companyForm.company_phone.$dirty}"> ng-class="{'has-error':companyForm.company_phone.$invalid && companyForm.company_phone.$dirty}">

@ -332,7 +332,7 @@
<div class="form-group has-feedback" <div class="form-group has-feedback"
ng-class="{'has-error':partnerForm.short_name.$invalid && partnerForm.short_name.$dirty}"> ng-class="{'has-error':partnerForm.short_name.$invalid && partnerForm.short_name.$dirty}">
<input type="text" class="form-control" ng-model="partner.short_name" name="short_name" <input type="text" class="form-control" ng-model="partner.short_name" name="short_name"
placeholder="Store Name /Company Name" required maxlength="80"> placeholder="Store Name /Company Name" required maxlength="15">
<span ng-messages="partnerForm.short_name.$error" ng-if="partnerForm.short_name.$dirty" ng-message="required"> <span ng-messages="partnerForm.short_name.$error" ng-if="partnerForm.short_name.$dirty" ng-message="required">
</span> </span>
</div> </div>

@ -572,6 +572,7 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
data: {file: file} data: {file: file}
}).then(function (resp) { }).then(function (resp) {
urls.push(resp.data.url); urls.push(resp.data.url);
delete $scope.riskMaterial.material[index].fileProgressValue;
}, function (resp) { }, function (resp) {
delete $scope.riskMaterial.material[index].fileProgressValue; delete $scope.riskMaterial.material[index].fileProgressValue;
alert('Upload Failed'); alert('Upload Failed');

@ -46,13 +46,13 @@
<label class="control-label col-sm-2" for="short-name-input">* Short Name</label> <label class="control-label col-sm-2" for="short-name-input">* Short Name</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input class="form-control" ng-model="partner.short_name" type="text" <input class="form-control" ng-model="partner.short_name" type="text"
name="short_name" id="short-name-input" required maxlength="50"> name="short_name" id="short-name-input" required maxlength="15">
<p class="small text-info">short name for WeChat payment display and partner <p class="small text-info">short name for WeChat payment display and partner
name</p> name</p>
<div ng-messages="partnerForm.short_name.$error" <div ng-messages="partnerForm.short_name.$error"
ng-if="partnerForm.company_name.$dirty"> ng-if="partnerForm.company_name.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p> <p class="small text-danger" ng-message="required">Required Field</p>
<p class="small text-danger" ng-message="maxlength">Less Than 50 <p class="small text-danger" ng-message="maxlength">Less Than 15
Characters(including symbols and spaces)</p> Characters(including symbols and spaces)</p>
</div> </div>
</div> </div>

@ -3,7 +3,7 @@
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div class="callout callout-info" ng-repeat="order in try_alerts"> <div class="callout callout-info" ng-repeat="order in try_alerts">
<h4><span style="font-size: 22px">{{order.customer_payment_amount|currency:order.currency+' '}}</span> Paid <h4><span style="font-size: 22px">{{order.display_amount|currency:order.currency+' '}}</span> Paid
Success!</h4> Success!</h4>
<p>Pay Time:{{order.pay_time_local}}</p> <p>Pay Time:{{order.pay_time_local}}</p>
</div> </div>

@ -124,7 +124,8 @@
</thead> </thead>
<tbody> <tbody>
<tr ng-repeat="bd in bds|filter:{get_prize:true}"> <tr ng-repeat="bd in bds|filter:{get_prize:true}">
<td ng-bind="bd.display_name"></td> <td ng-if="bd.is_valid==1">{{bd.display_name}}</td>
<td ng-if="bd.is_valid==0"><s>{{bd.display_name}}</s><span style="color: red"> (Left Company)</span></td>
<td> <td>
<input type="number" ng-model="bd.kpi_amount" min="0"> <input type="number" ng-model="bd.kpi_amount" min="0">
</td> </td>

@ -647,7 +647,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.showFile(); $scope.showFile();
$scope.passClient = function () { $scope.passClient = function () {
if(!$scope.partner.wechat_institution_merchant_id){ if(!$scope.partner.wechat_institution_merchant_id){
commonDialog.alert({title: 'info', content: 'Wechat Institution Merchant Id not Refresh', type: 'info'}); commonDialog.alert({title: 'info', content: 'HF Institution Merchant Id not Refresh', type: 'info'});
return; return;
} }
if ($scope.partner.enable_hf) { if ($scope.partner.enable_hf) {
@ -1297,7 +1297,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
} }
}]); }]);
app.controller('partnerPaymentInfoCtrl', ['$scope', '$http', '$state', 'commonDialog','$uibModal', '$sce', function ($scope, $http, $state, commonDialog,$uibModal, $sce) { app.controller('partnerPaymentInfoCtrl', ['$scope', '$http', '$state', 'commonDialog','$uibModal', '$sce', function ($scope, $http, $state, commonDialog,$uibModal, $sce) {
$scope.refresh = false;
$scope.copyHfLink = function() { $scope.copyHfLink = function() {
var e=document.getElementById("cpbt"); var e=document.getElementById("cpbt");
e.select(); e.select();
@ -1452,23 +1451,26 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}; };
$scope.ctrl = {}; $scope.ctrl = {};
$scope.saveSubMerchantId = function () { $scope.saveSubMerchantId = function () {
if(!$scope.refresh){
commonDialog.alert({title: 'info', content: 'Wechat Institution Merchant Id not Refresh', type: 'info'});
return;
}
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/payment_config', {sub_merchant_id: $scope.paymentInfo.sub_merchant_id}).then(function (resp) { $http.put('/sys/partners/' + $scope.partner.client_moniker + '/payment_config', {sub_merchant_id: $scope.paymentInfo.sub_merchant_id}).then(function (resp) {
$scope.refreshInstitutionAfterSaveMerchantId();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
});
};
$scope.refreshInstitutionAfterSaveMerchantId = function () {
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/wechat_institution_merchant_id', {wechat_institution_merchant_id: $scope.paymentInfo.wechat_institution_merchant_id}).then(function (resp) {
commonDialog.alert({ commonDialog.alert({
title: 'Success', title: 'Success',
content: 'Modify Wechat Sub Merchant ID successfully', content: 'Modify Wechat Sub Merchant ID And Refresh Wechat Institution Merchant Id successfully',
type: 'success' type: 'success'
}); });
$scope.refresh = false;
$scope.loadPartnerPaymentInfo(); $scope.loadPartnerPaymentInfo();
}, function (resp) { }, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}) commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
}); });
}; };
$scope.refreshWechatInstitutionMerchantId = function () { $scope.refreshWechatInstitutionMerchantId = function () {
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/wechat_institution_merchant_id', {wechat_institution_merchant_id: $scope.paymentInfo.wechat_institution_merchant_id}).then(function (resp) { $http.put('/sys/partners/' + $scope.partner.client_moniker + '/wechat_institution_merchant_id', {wechat_institution_merchant_id: $scope.paymentInfo.wechat_institution_merchant_id}).then(function (resp) {
commonDialog.alert({ commonDialog.alert({
@ -1476,7 +1478,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
content: 'Refresh Wechat Institution Merchant Id successfully', content: 'Refresh Wechat Institution Merchant Id successfully',
type: 'success' type: 'success'
}); });
$scope.refresh = true;
$scope.loadPartnerPaymentInfo(); $scope.loadPartnerPaymentInfo();
}, function (resp) { }, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}) commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
@ -3401,6 +3402,22 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.loadSubMerchantInfos(); $scope.loadSubMerchantInfos();
}) })
}; };
$scope.updateYeepaySubMerchantId = function (sub_merchant_id) {
$uibModal.open({
templateUrl: '/static/payment/partner/templates/update_yeepay_sub_merchant_id.html',
controller: 'updateYeepaySubMerchantIdCtrl',
resolve: {
subMerchantInfo: function () {
return $scope.partner;
},
subMerchantId: function () {
return sub_merchant_id;
}
}
}).result.then(function () {
$scope.loadSubMerchantInfos();
})
};
$scope.loadSubMerchantInfos(); $scope.loadSubMerchantInfos();
}]); }]);
app.controller('applyWxSubMerchantIdCtrl', ['$scope', '$http', '$uibModal', '$state', 'subMerchantInfo', '$filter', 'merchantIds', 'commonDialog', function ($scope, $http, $uibModal, $state, subMerchantInfo, $filter, merchantIds, commonDialog) { app.controller('applyWxSubMerchantIdCtrl', ['$scope', '$http', '$uibModal', '$state', 'subMerchantInfo', '$filter', 'merchantIds', 'commonDialog', function ($scope, $http, $uibModal, $state, subMerchantInfo, $filter, merchantIds, commonDialog) {
@ -3504,58 +3521,64 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.subMerchantInfo = angular.copy(subMerchantInfo); $scope.subMerchantInfo = angular.copy(subMerchantInfo);
var vouchers={}; var vouchers={};
var merchantId = ''; $scope.directors={};
$scope.executives={};
$scope.industry = '';
$scope.business_content = '';
var merchantInfo = {};
var merchantId = '';
$scope.uploadLegalIDcardFront = function (file) {
if (file != null) {
if (file.size > 3 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'})
} else {
$scope.legalIDcardFrontProgress = {value: 0};
Upload.upload({
url: '/attachment/yeepayFiles',
data: {file: file}
}).then(function (resp) {
delete $scope.legalIDcardFrontProgress;
$scope.legalIDcardFront = resp.data.path;
vouchers['legalIDcardFront'] = resp.data.path;
merchantId = resp.data.merchantId;
commonDialog.alert({title: 'Upload Success', content: 'Upload Success', type: 'success'})
}, function (resp) {
delete $scope.legalIDcardFrontProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.legalIDcardFrontProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
$scope.uploadLegalIDcardBack = function (file) { // $scope.uploadLegalIDcardFront = function (file) {
if (file != null) { // if (file != null) {
if (file.size > 3 * 1024 * 1024) { // if (file.size > 3 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'}) // commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'})
} else { // } else {
$scope.legalIDcardBackProgress = {value: 0}; // $scope.legalIDcardFrontProgress = {value: 0};
Upload.upload({ // Upload.upload({
url: '/attachment/yeepayFiles', // url: '/attachment/yeepayFiles',
data: {file: file} // data: {file: file}
}).then(function (resp) { // }).then(function (resp) {
delete $scope.legalIDcardBackProgress; // delete $scope.legalIDcardFrontProgress;
$scope.legalIDcardBack = resp.data.path; // $scope.legalIDcardFront = resp.data.path;
vouchers['legalIDcardBack'] = resp.data.path; // vouchers['legalIDcardFront'] = resp.data.path;
merchantId = resp.data.merchantId; // merchantId = resp.data.merchantId;
commonDialog.alert({title: 'Upload Success', content: 'Upload Success', type: 'success'}) // commonDialog.alert({title: 'Upload Success', content: 'Upload Success', type: 'success'})
}, function (resp) { // }, function (resp) {
delete $scope.legalIDcardBackProgress; // delete $scope.legalIDcardFrontProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) // commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) { // }, function (evt) {
$scope.legalIDcardBackProgress.value = parseInt(100 * evt.loaded / evt.total); // $scope.legalIDcardFrontProgress.value = parseInt(100 * evt.loaded / evt.total);
}) // })
} // }
} // }
}; // };
//
// $scope.uploadLegalIDcardBack = function (file) {
// if (file != null) {
// if (file.size > 3 * 1024 * 1024) {
// commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'})
// } else {
// $scope.legalIDcardBackProgress = {value: 0};
// Upload.upload({
// url: '/attachment/yeepayFiles',
// data: {file: file}
// }).then(function (resp) {
// delete $scope.legalIDcardBackProgress;
// $scope.legalIDcardBack = resp.data.path;
// vouchers['legalIDcardBack'] = resp.data.path;
// merchantId = resp.data.merchantId;
// commonDialog.alert({title: 'Upload Success', content: 'Upload Success', type: 'success'})
// }, function (resp) {
// delete $scope.legalIDcardBackProgress;
// commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
// }, function (evt) {
// $scope.legalIDcardBackProgress.value = parseInt(100 * evt.loaded / evt.total);
// })
// }
// }
// };
$scope.uploadBusinessLicence = function (file) { $scope.uploadBusinessLicence = function (file) {
if (file != null) { if (file != null) {
@ -3569,7 +3592,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}).then(function (resp) { }).then(function (resp) {
delete $scope.businessLicenceProgress; delete $scope.businessLicenceProgress;
$scope.businessLicence = resp.data.path; $scope.businessLicence = resp.data.path;
vouchers['businessLicence'] = resp.data.path; merchantInfo['business_licence'] = resp.data.path;
merchantId = resp.data.merchantId; merchantId = resp.data.merchantId;
commonDialog.alert({title: 'Upload Success', content: 'Upload Success', type: 'success'}) commonDialog.alert({title: 'Upload Success', content: 'Upload Success', type: 'success'})
}, function (resp) { }, function (resp) {
@ -3582,133 +3605,492 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
} }
}; };
$scope.uploadTaxLevel = function (file) { // $scope.uploadTaxLevel = function (file) {
// if (file != null) {
// if (file.size > 3 * 1024 * 1024) {
// commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'})
// } else {
// $scope.taxLevelProgress = {value: 0};
// Upload.upload({
// url: '/attachment/yeepayFiles',
// data: {file: file}
// }).then(function (resp) {
// delete $scope.taxLevelProgress;
// $scope.taxLevel = resp.data.path;
// vouchers['taxLevel'] = resp.data.path;
// merchantId = resp.data.merchantId;
// commonDialog.alert({title: 'Upload Success', content: 'Upload Success', type: 'success'})
// }, function (resp) {
// delete $scope.taxLevelProgress;
// commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
// }, function (evt) {
// $scope.taxLevelProgress.value = parseInt(100 * evt.loaded / evt.total);
// })
// }
// }
// };
// $scope.uploadBankAccountOpen = function (file) {
// if (file != null) {
// if (file.size > 3 * 1024 * 1024) {
// commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'})
// } else {
// $scope.bankAccountOpenProgress = {value: 0};
// Upload.upload({
// url: '/attachment/yeepayFiles',
// data: {file: file}
// }).then(function (resp) {
// delete $scope.bankAccountOpenProgress;
// $scope.bankAccountOpen = resp.data.path;
// vouchers['bankAccountOpen'] = resp.data.path;
// merchantId = resp.data.merchantId;
// commonDialog.alert({title: 'Upload Success', content: 'Upload Success', type: 'success'})
// }, function (resp) {
// delete $scope.bankAccountOpenProgress;
// commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
// }, function (evt) {
// $scope.bankAccountOpenProgress.value = parseInt(100 * evt.loaded / evt.total);
// })
// }
// }
// };
// $scope.uploadOrgCode = function (file) {
// if (file != null) {
// if (file.size > 3 * 1024 * 1024) {
// commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'})
// } else {
// $scope.orgCodeProgress = {value: 0};
// Upload.upload({
// url: '/attachment/yeepayFiles',
// data: {file: file}
// }).then(function (resp) {
// delete $scope.orgCodeProgress;
// $scope.orgCode = resp.data.path;
// vouchers['orgCode'] = resp.data.path;
// merchantId = resp.data.merchantId;
// commonDialog.alert({title: 'Upload Success', content: 'Upload Success', type: 'success'})
// }, function (resp) {
// delete $scope.orgCodeProgress;
// commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
// }, function (evt) {
// $scope.orgCodeProgress.value = parseInt(100 * evt.loaded / evt.total);
// })
// }
// }
// };
//
// $scope.uploadNonStanProtocol = function (file) {
// if (file != null) {
// if (file.size > 3 * 1024 * 1024) {
// commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'})
// } else {
// $scope.nonStanProtocolProgress = {value: 0};
// Upload.upload({
// url: '/attachment/yeepayFiles',
// data: {file: file}
// }).then(function (resp) {
// delete $scope.nonStanProtocolProgress;
// $scope.nonStanProtocol = resp.data.path;
// vouchers['nonStanProtocol'] = resp.data.path;
// merchantId = resp.data.merchantId;
// commonDialog.alert({title: 'Upload Success', content: 'Upload Success', type: 'success'})
// }, function (resp) {
// delete $scope.nonStanProtocolProgress;
// commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
// }, function (evt) {
// $scope.nonStanProtocolProgress.value = parseInt(100 * evt.loaded / evt.total);
// })
// }
// }
// };
//
// $scope.uploadZipPath = function (file) {
// if (file != null) {
// if (file.size > 3 * 1024 * 1024) {
// commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'})
// } else {
// $scope.zipPathProgress = {value: 0};
// Upload.upload({
// url: '/attachment/yeepayFiles',
// data: {file: file}
// }).then(function (resp) {
// delete $scope.zipPathProgress;
// $scope.zipPath = resp.data.path;
// vouchers['zipPath'] = resp.data.path;
// merchantId = resp.data.merchantId;
// commonDialog.alert({title: 'Upload Success', content: 'Upload Success', type: 'success'})
// }, function (resp) {
// delete $scope.zipPathProgress;
// commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
// }, function (evt) {
// $scope.zipPathProgress.value = parseInt(100 * evt.loaded / evt.total);
// })
// }
// }
// };
$scope.uploadDirectorPassport = function (file) {
if (file != null) { if (file != null) {
if (file.size > 3 * 1024 * 1024) { if (file.size > 3 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'}) commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'})
} else { } else {
$scope.taxLevelProgress = {value: 0}; $scope.directorPassportProgress = {value: 0};
Upload.upload({ Upload.upload({
url: '/attachment/yeepayFiles', url: '/attachment/yeepayFiles',
data: {file: file} data: {file: file}
}).then(function (resp) { }).then(function (resp) {
delete $scope.taxLevelProgress; delete $scope.directorPassportProgress;
$scope.taxLevel = resp.data.path; $scope.directorPassport = resp.data.path;
vouchers['taxLevel'] = resp.data.path; $scope.directors.filePath = resp.data.path;
merchantId = resp.data.merchantId; merchantId = resp.data.merchantId;
commonDialog.alert({title: 'Upload Success', content: 'Upload Success', type: 'success'}) commonDialog.alert({title: 'Upload Success', content: 'Upload Success', type: 'success'})
}, function (resp) { }, function (resp) {
delete $scope.taxLevelProgress; delete $scope.directorPassportProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) { }, function (evt) {
$scope.taxLevelProgress.value = parseInt(100 * evt.loaded / evt.total); $scope.directorPassportProgress.value = parseInt(100 * evt.loaded / evt.total);
}) })
} }
} }
}; };
$scope.uploadBankAccountOpen = function (file) { $scope.uploadExecutivePassport = function (file) {
if (file != null) { if (file != null) {
if (file.size > 3 * 1024 * 1024) { if (file.size > 3 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'}) commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'})
} else { } else {
$scope.bankAccountOpenProgress = {value: 0}; $scope.executivePassportProgress = {value: 0};
Upload.upload({ Upload.upload({
url: '/attachment/yeepayFiles', url: '/attachment/yeepayFiles',
data: {file: file} data: {file: file}
}).then(function (resp) { }).then(function (resp) {
delete $scope.bankAccountOpenProgress; delete $scope.executivePassportProgress;
$scope.bankAccountOpen = resp.data.path; $scope.executivePassport = resp.data.path;
vouchers['bankAccountOpen'] = resp.data.path; $scope.executives.filePath = resp.data.path;
merchantId = resp.data.merchantId; merchantId = resp.data.merchantId;
commonDialog.alert({title: 'Upload Success', content: 'Upload Success', type: 'success'}) commonDialog.alert({title: 'Upload Success', content: 'Upload Success', type: 'success'})
}, function (resp) { }, function (resp) {
delete $scope.bankAccountOpenProgress; delete $scope.executivePassportProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) { }, function (evt) {
$scope.bankAccountOpenProgress.value = parseInt(100 * evt.loaded / evt.total); $scope.executivePassportProgress.value = parseInt(100 * evt.loaded / evt.total);
}) })
} }
} }
}; };
$scope.uploadOrgCode = function (file) { $scope.saveYeepayApply = function (form) {
$scope.errmsg = null;
if (form.$invalid) {
angular.forEach(form, function (item, key) {
if (key.indexOf('$') < 0) {
item.$dirty = true;
}
});
return;
}
// angular.forEach(form, function (item, key) {
// if(item !=null) {
// if(item.$name !=null) {
// merchantInfo[key] = item.$modelValue;
// }
// }
// });
merchantInfo['company_website'] = $scope.subMerchantInfo.company_website;
merchantInfo['abn'] = $scope.subMerchantInfo.abn;
merchantInfo['executives'] = $scope.executives;
merchantInfo['directors'] = $scope.directors;
merchantInfo['business_content'] = $scope.business_content;
merchantInfo['industry'] = $scope.industry;
merchantInfo['merchantId'] = merchantId;
$http.post('/sys/partners/' + $scope.subMerchantInfo.client_moniker + '/registYeepaySubMerchantId', merchantInfo).then(function (resp) {
$scope.apply_sub_merchant_id = resp.data;
$scope.$close();
if (subMerchantInfo.yeepay_sub_merchant_id != null) {
commonDialog.alert({
title: 'Success',
content: 'Modify Yeepay Sub Merchant ID successfully',
type: 'success'
});
$state.reload();
}
}, function (resp) {
commonDialog.alert({
title: 'Error',
content: resp.data.message,
type: 'error'
});
})
}
}]);
app.controller('updateYeepaySubMerchantIdCtrl', ['$scope', '$http', '$uibModal', '$state','subMerchantInfo','yeepayIndustryMap','yeepayBusinessContentMap','$filter', 'commonDialog','Upload','subMerchantId', function ($scope, $http, $uibModal, $state,subMerchantInfo,yeepayIndustryMap,yeepayBusinessContentMap,$filter, commonDialog,Upload,subMerchantId) {
$scope.yeepay_industries = yeepayIndustryMap.configs();
$scope.yeepay_business_contents = yeepayBusinessContentMap.configs();
$scope.subMerchantInfo = angular.copy(subMerchantInfo);
var vouchers={};
$scope.directors={};
$scope.executives={};
$scope.industry = '';
$scope.business_content = '';
var merchantInfo = {};
var merchantId = '';
// $scope.uploadLegalIDcardFront = function (file) {
// if (file != null) {
// if (file.size > 3 * 1024 * 1024) {
// commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'})
// } else {
// $scope.legalIDcardFrontProgress = {value: 0};
// Upload.upload({
// url: '/attachment/yeepayFiles',
// data: {file: file}
// }).then(function (resp) {
// delete $scope.legalIDcardFrontProgress;
// $scope.legalIDcardFront = resp.data.path;
// vouchers['legalIDcardFront'] = resp.data.path;
// merchantId = resp.data.merchantId;
// commonDialog.alert({title: 'Upload Success', content: 'Upload Success', type: 'success'})
// }, function (resp) {
// delete $scope.legalIDcardFrontProgress;
// commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
// }, function (evt) {
// $scope.legalIDcardFrontProgress.value = parseInt(100 * evt.loaded / evt.total);
// })
// }
// }
// };
//
// $scope.uploadLegalIDcardBack = function (file) {
// if (file != null) {
// if (file.size > 3 * 1024 * 1024) {
// commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'})
// } else {
// $scope.legalIDcardBackProgress = {value: 0};
// Upload.upload({
// url: '/attachment/yeepayFiles',
// data: {file: file}
// }).then(function (resp) {
// delete $scope.legalIDcardBackProgress;
// $scope.legalIDcardBack = resp.data.path;
// vouchers['legalIDcardBack'] = resp.data.path;
// merchantId = resp.data.merchantId;
// commonDialog.alert({title: 'Upload Success', content: 'Upload Success', type: 'success'})
// }, function (resp) {
// delete $scope.legalIDcardBackProgress;
// commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
// }, function (evt) {
// $scope.legalIDcardBackProgress.value = parseInt(100 * evt.loaded / evt.total);
// })
// }
// }
// };
$scope.uploadBusinessLicence = function (file) {
if (file != null) { if (file != null) {
if (file.size > 3 * 1024 * 1024) { if (file.size > 3 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'}) commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'})
} else { } else {
$scope.orgCodeProgress = {value: 0}; $scope.businessLicenceProgress = {value: 0};
Upload.upload({ Upload.upload({
url: '/attachment/yeepayFiles', url: '/attachment/yeepayFiles',
data: {file: file} data: {file: file}
}).then(function (resp) { }).then(function (resp) {
delete $scope.orgCodeProgress; delete $scope.businessLicenceProgress;
$scope.orgCode = resp.data.path; $scope.businessLicence = resp.data.path;
vouchers['orgCode'] = resp.data.path; merchantInfo['business_licence'] = resp.data.path;
merchantId = resp.data.merchantId; merchantId = resp.data.merchantId;
commonDialog.alert({title: 'Upload Success', content: 'Upload Success', type: 'success'}) commonDialog.alert({title: 'Upload Success', content: 'Upload Success', type: 'success'})
}, function (resp) { }, function (resp) {
delete $scope.orgCodeProgress; delete $scope.businessLicenceProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) { }, function (evt) {
$scope.orgCodeProgress.value = parseInt(100 * evt.loaded / evt.total); $scope.businessLicenceProgress.value = parseInt(100 * evt.loaded / evt.total);
}) })
} }
} }
}; };
$scope.uploadNonStanProtocol = function (file) { // $scope.uploadTaxLevel = function (file) {
// if (file != null) {
// if (file.size > 3 * 1024 * 1024) {
// commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'})
// } else {
// $scope.taxLevelProgress = {value: 0};
// Upload.upload({
// url: '/attachment/yeepayFiles',
// data: {file: file}
// }).then(function (resp) {
// delete $scope.taxLevelProgress;
// $scope.taxLevel = resp.data.path;
// vouchers['taxLevel'] = resp.data.path;
// merchantId = resp.data.merchantId;
// commonDialog.alert({title: 'Upload Success', content: 'Upload Success', type: 'success'})
// }, function (resp) {
// delete $scope.taxLevelProgress;
// commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
// }, function (evt) {
// $scope.taxLevelProgress.value = parseInt(100 * evt.loaded / evt.total);
// })
// }
// }
// };
// $scope.uploadBankAccountOpen = function (file) {
// if (file != null) {
// if (file.size > 3 * 1024 * 1024) {
// commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'})
// } else {
// $scope.bankAccountOpenProgress = {value: 0};
// Upload.upload({
// url: '/attachment/yeepayFiles',
// data: {file: file}
// }).then(function (resp) {
// delete $scope.bankAccountOpenProgress;
// $scope.bankAccountOpen = resp.data.path;
// vouchers['bankAccountOpen'] = resp.data.path;
// merchantId = resp.data.merchantId;
// commonDialog.alert({title: 'Upload Success', content: 'Upload Success', type: 'success'})
// }, function (resp) {
// delete $scope.bankAccountOpenProgress;
// commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
// }, function (evt) {
// $scope.bankAccountOpenProgress.value = parseInt(100 * evt.loaded / evt.total);
// })
// }
// }
// };
// $scope.uploadOrgCode = function (file) {
// if (file != null) {
// if (file.size > 3 * 1024 * 1024) {
// commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'})
// } else {
// $scope.orgCodeProgress = {value: 0};
// Upload.upload({
// url: '/attachment/yeepayFiles',
// data: {file: file}
// }).then(function (resp) {
// delete $scope.orgCodeProgress;
// $scope.orgCode = resp.data.path;
// vouchers['orgCode'] = resp.data.path;
// merchantId = resp.data.merchantId;
// commonDialog.alert({title: 'Upload Success', content: 'Upload Success', type: 'success'})
// }, function (resp) {
// delete $scope.orgCodeProgress;
// commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
// }, function (evt) {
// $scope.orgCodeProgress.value = parseInt(100 * evt.loaded / evt.total);
// })
// }
// }
// };
//
// $scope.uploadNonStanProtocol = function (file) {
// if (file != null) {
// if (file.size > 3 * 1024 * 1024) {
// commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'})
// } else {
// $scope.nonStanProtocolProgress = {value: 0};
// Upload.upload({
// url: '/attachment/yeepayFiles',
// data: {file: file}
// }).then(function (resp) {
// delete $scope.nonStanProtocolProgress;
// $scope.nonStanProtocol = resp.data.path;
// vouchers['nonStanProtocol'] = resp.data.path;
// merchantId = resp.data.merchantId;
// commonDialog.alert({title: 'Upload Success', content: 'Upload Success', type: 'success'})
// }, function (resp) {
// delete $scope.nonStanProtocolProgress;
// commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
// }, function (evt) {
// $scope.nonStanProtocolProgress.value = parseInt(100 * evt.loaded / evt.total);
// })
// }
// }
// };
//
// $scope.uploadZipPath = function (file) {
// if (file != null) {
// if (file.size > 3 * 1024 * 1024) {
// commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'})
// } else {
// $scope.zipPathProgress = {value: 0};
// Upload.upload({
// url: '/attachment/yeepayFiles',
// data: {file: file}
// }).then(function (resp) {
// delete $scope.zipPathProgress;
// $scope.zipPath = resp.data.path;
// vouchers['zipPath'] = resp.data.path;
// merchantId = resp.data.merchantId;
// commonDialog.alert({title: 'Upload Success', content: 'Upload Success', type: 'success'})
// }, function (resp) {
// delete $scope.zipPathProgress;
// commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
// }, function (evt) {
// $scope.zipPathProgress.value = parseInt(100 * evt.loaded / evt.total);
// })
// }
// }
// };
$scope.uploadDirectorPassport = function (file) {
if (file != null) { if (file != null) {
if (file.size > 3 * 1024 * 1024) { if (file.size > 3 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'}) commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'})
} else { } else {
$scope.nonStanProtocolProgress = {value: 0}; $scope.directorPassportProgress = {value: 0};
Upload.upload({ Upload.upload({
url: '/attachment/yeepayFiles', url: '/attachment/yeepayFiles',
data: {file: file} data: {file: file}
}).then(function (resp) { }).then(function (resp) {
delete $scope.nonStanProtocolProgress; delete $scope.directorPassportProgress;
$scope.nonStanProtocol = resp.data.path; $scope.directorPassport = resp.data.path;
vouchers['nonStanProtocol'] = resp.data.path; $scope.directors.filePath = resp.data.path;
merchantId = resp.data.merchantId; merchantId = resp.data.merchantId;
commonDialog.alert({title: 'Upload Success', content: 'Upload Success', type: 'success'}) commonDialog.alert({title: 'Upload Success', content: 'Upload Success', type: 'success'})
}, function (resp) { }, function (resp) {
delete $scope.nonStanProtocolProgress; delete $scope.directorPassportProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) { }, function (evt) {
$scope.nonStanProtocolProgress.value = parseInt(100 * evt.loaded / evt.total); $scope.directorPassportProgress.value = parseInt(100 * evt.loaded / evt.total);
}) })
} }
} }
}; };
$scope.uploadZipPath = function (file) { $scope.uploadExecutivePassport = function (file) {
if (file != null) { if (file != null) {
if (file.size > 3 * 1024 * 1024) { if (file.size > 3 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'}) commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'})
} else { } else {
$scope.zipPathProgress = {value: 0}; $scope.executivePassportProgress = {value: 0};
Upload.upload({ Upload.upload({
url: '/attachment/yeepayFiles', url: '/attachment/yeepayFiles',
data: {file: file} data: {file: file}
}).then(function (resp) { }).then(function (resp) {
delete $scope.zipPathProgress; delete $scope.executivePassportProgress;
$scope.zipPath = resp.data.path; $scope.executivePassport = resp.data.path;
vouchers['zipPath'] = resp.data.path; $scope.executives.filePath = resp.data.path;
merchantId = resp.data.merchantId; merchantId = resp.data.merchantId;
commonDialog.alert({title: 'Upload Success', content: 'Upload Success', type: 'success'}) commonDialog.alert({title: 'Upload Success', content: 'Upload Success', type: 'success'})
}, function (resp) { }, function (resp) {
delete $scope.zipPathProgress; delete $scope.executivePassportProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) { }, function (evt) {
$scope.zipPathProgress.value = parseInt(100 * evt.loaded / evt.total); $scope.executivePassportProgress.value = parseInt(100 * evt.loaded / evt.total);
}) })
} }
} }
}; };
$scope.saveYeepayApply = function (form) { $scope.updateYeepayApply = function (form) {
var merchantInfo = {};
$scope.errmsg = null; $scope.errmsg = null;
if (form.$invalid) { if (form.$invalid) {
angular.forEach(form, function (item, key) { angular.forEach(form, function (item, key) {
@ -3718,22 +4100,28 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}); });
return; return;
} }
angular.forEach(form, function (item, key) { // angular.forEach(form, function (item, key) {
if(item !=null) { // if(item !=null) {
if(item.$name !=null) { // if(item.$name !=null) {
merchantInfo[key] = item.$modelValue; // merchantInfo[key] = item.$modelValue;
} // }
} // }
}); // });
merchantInfo['vouchers'] = vouchers; merchantInfo['company_website'] = $scope.subMerchantInfo.company_website;
merchantInfo['abn'] = $scope.subMerchantInfo.abn;
merchantInfo['executives'] = $scope.executives;
merchantInfo['subMerchantId'] = angular.copy(subMerchantId);
merchantInfo['directors'] = $scope.directors;
merchantInfo['business_content'] = $scope.business_content;
merchantInfo['industry'] = $scope.industry;
merchantInfo['merchantId'] = merchantId; merchantInfo['merchantId'] = merchantId;
$http.post('/sys/partners/' + $scope.subMerchantInfo.client_moniker + '/registYeepaySubMerchantId', merchantInfo).then(function (resp) { $http.post('/sys/partners/' + $scope.subMerchantInfo.client_moniker + '/updateYeepaySubMerchantId', merchantInfo).then(function (resp) {
$scope.apply_sub_merchant_id = resp.data; $scope.apply_sub_merchant_id = resp.data;
$scope.$close(); $scope.$close();
if (subMerchantInfo.yeepay_sub_merchant_id != null) { if (subMerchantInfo.yeepay_sub_merchant_id != null) {
commonDialog.alert({ commonDialog.alert({
title: 'Success', title: 'Success',
content: 'Modify Yeepay Sub Merchant ID successfully', content: 'Update Successfully,Please Wait For Review!',
type: 'success' type: 'success'
}); });
$state.reload(); $state.reload();
@ -3748,6 +4136,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
} }
}]); }]);
app.controller('permissionClientCtrl', ['$scope', '$http', '$uibModal', '$state', '$filter', 'commonDialog', function ($scope, $http, $uibModal, $state, $filter, commonDialog) { app.controller('permissionClientCtrl', ['$scope', '$http', '$uibModal', '$state', '$filter', 'commonDialog', function ($scope, $http, $uibModal, $state, $filter, commonDialog) {
$scope.clientPermission = {client_moniker:$scope.partner.client_moniker}; $scope.clientPermission = {client_moniker:$scope.partner.client_moniker};
$scope.loadPermissionList = function () { $scope.loadPermissionList = function () {

@ -77,7 +77,7 @@
<input class="form-control" ng-model="partner.short_name" <input class="form-control" ng-model="partner.short_name"
type="text" type="text"
name="short_name" id="short-name-input" required name="short_name" id="short-name-input" required
maxlength="50"> maxlength="15">
<p class="small text-info">short name for WeChat payment display <p class="small text-info">short name for WeChat payment display
and partner and partner
name</p> name</p>
@ -86,7 +86,7 @@
<p class="small text-danger" ng-message="required">Required <p class="small text-danger" ng-message="required">Required
Field</p> Field</p>
<p class="small text-danger" ng-message="maxlength">Less <p class="small text-danger" ng-message="maxlength">Less
Than 50 Than 15
Characters(including symbols and spaces)</p> Characters(including symbols and spaces)</p>
</div> </div>
</div> </div>

@ -58,13 +58,13 @@
<label class="control-label col-sm-2" for="short-name-input">* Short Name</label> <label class="control-label col-sm-2" for="short-name-input">* Short Name</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input class="form-control" ng-model="partner.short_name" type="text" <input class="form-control" ng-model="partner.short_name" type="text"
name="short_name" id="short-name-input" required maxlength="50"> name="short_name" id="short-name-input" required maxlength="15">
<p class="small text-info">short name for WeChat payment display and partner <p class="small text-info">short name for WeChat payment display and partner
name</p> name</p>
<div ng-messages="partnerForm.short_name.$error" <div ng-messages="partnerForm.short_name.$error"
ng-if="partnerForm.company_name.$dirty"> ng-if="partnerForm.company_name.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p> <p class="small text-danger" ng-message="required">Required Field</p>
<p class="small text-danger" ng-message="maxlength">Less Than 50 <p class="small text-danger" ng-message="maxlength">Less Than 15
Characters(including symbols and spaces)</p> Characters(including symbols and spaces)</p>
</div> </div>
</div> </div>

@ -37,10 +37,10 @@
<label class="control-label col-sm-3" for="company_shortname_input">* Company Short Name</label> <label class="control-label col-sm-3" for="company_shortname_input">* Company Short Name</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.short_name" <input class="form-control" ng-model="subMerchantInfo.short_name"
type="text" name="company_shortname" id="company_shortname_input" required maxlength="50"> type="text" name="company_shortname" id="company_shortname_input" required maxlength="15">
<div ng-messages="subForm.company_shortname.$error" ng-if="subForm.company_shortname.$dirty"> <div ng-messages="subForm.company_shortname.$error" ng-if="subForm.company_shortname.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p> <p class="small text-danger" ng-message="required">Required Field</p>
<p class="small text-danger" ng-message="maxlength">Length is more than 50</p> <p class="small text-danger" ng-message="maxlength">Length is more than 15</p>
</div> </div>
</div> </div>
</div> </div>

@ -11,7 +11,7 @@
<label class="control-label col-sm-3" for="business_content">* Business Content</label> <label class="control-label col-sm-3" for="business_content">* Business Content</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select class="form-control" name="business_content" <select class="form-control" name="business_content"
ng-model="subMerchantInfo.business_content" ng-model="business_content"
id="business_content" required id="business_content" required
ng-options="business_content.value as business_content.label for business_content in yeepay_business_contents"> ng-options="business_content.value as business_content.label for business_content in yeepay_business_contents">
<option value="">Please Choose</option> <option value="">Please Choose</option>
@ -28,7 +28,7 @@
<label class="control-label col-sm-3" for="industry">* Business Category</label> <label class="control-label col-sm-3" for="industry">* Business Category</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select class="form-control" name="industry" <select class="form-control" name="industry"
ng-model="subMerchantInfo.industry" ng-model="industry"
id="industry" required id="industry" required
ng-options="industry.value as industry.label for industry in yeepay_industries"> ng-options="industry.value as industry.label for industry in yeepay_industries">
<option value="">Please Choose</option> <option value="">Please Choose</option>
@ -39,38 +39,62 @@
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group" ng-class="{'has-error':subForm.company_website.$invalid && subForm.company_website.$dirty}">
<label class="control-label col-sm-3" >* Corporate ID Card Front</label> <label class="control-label col-sm-3" for="company_website_input">* Website</label>
<div class="col-sm-8"> <div class="col-sm-8">
<div class="form-control-static"> <input class="form-control" ng-model="subMerchantInfo.company_website" required
<button class="btn btn-success" type="button" type="url" name="company_website" id="company_website_input">
ngf-select="uploadLegalIDcardFront($file)" <div ng-messages="subForm.company_website.$error" ng-if="subForm.company_website.$dirty">
accept="image/*"> <p class="small text-danger" ng-message="required">Required Field</p>
<i class="fa fa-upload"></i> Upload Corporate ID Card Front </div>
</button> <div ng-messages="subForm.company_website.$error" ng-if="subForm.company_website.$dirty">
<p class="small text-danger" ng-message="url">eg:https://www.royalpay.com.au</p>
</div> </div>
<uib-progressbar value="legalIDcardFrontProgress.value"
ng-if="legalIDcardFrontProgress"></uib-progressbar>
<div ng-if="legalIDcardFront">Url:{{legalIDcardFront}}</div>
</div> </div>
</div> </div>
<div class="form-group" ng-class="{'has-error':subForm.abn.$invalid && subForm.abn.$dirty}">
<div class="form-group"> <label class="control-label col-sm-3" for="abn_input">* ABN</label>
<label class="control-label col-sm-3" >* Corporate ID Card Back</label>
<div class="col-sm-8"> <div class="col-sm-8">
<div class="form-control-static"> <input class="form-control" ng-model="subMerchantInfo.abn" required
<button class="btn btn-success" type="button" type="text" name="abn" id="abn_input">
ngf-select="uploadLegalIDcardBack($file)" <div ng-messages="subForm.abn.$error" ng-if="subForm.abn.$dirty">
accept="image/*"> <p class="small text-danger" ng-message="required">Required Field</p>
<i class="fa fa-upload"></i> Upload Corporate ID Card Back
</button>
</div> </div>
<uib-progressbar value="legalIDcardBackProgress.value"
ng-if="legalIDcardBackProgress"></uib-progressbar>
<div ng-if="legalIDcardBack">Url:{{legalIDcardBack}}</div>
</div> </div>
</div> </div>
<!--<div class="form-group">-->
<!--<label class="control-label col-sm-3" >* Corporate ID Card Front</label>-->
<!--<div class="col-sm-8">-->
<!--<div class="form-control-static">-->
<!--<button class="btn btn-success" type="button"-->
<!--ngf-select="uploadLegalIDcardFront($file)"-->
<!--accept="image/*">-->
<!--<i class="fa fa-upload"></i> Upload Corporate ID Card Front-->
<!--</button>-->
<!--</div>-->
<!--<uib-progressbar value="legalIDcardFrontProgress.value"-->
<!--ng-if="legalIDcardFrontProgress"></uib-progressbar>-->
<!--<div ng-if="legalIDcardFront">Url:{{legalIDcardFront}}</div>-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group">-->
<!--<label class="control-label col-sm-3" >* Corporate ID Card Back</label>-->
<!--<div class="col-sm-8">-->
<!--<div class="form-control-static">-->
<!--<button class="btn btn-success" type="button"-->
<!--ngf-select="uploadLegalIDcardBack($file)"-->
<!--accept="image/*">-->
<!--<i class="fa fa-upload"></i> Upload Corporate ID Card Back-->
<!--</button>-->
<!--</div>-->
<!--<uib-progressbar value="legalIDcardBackProgress.value"-->
<!--ng-if="legalIDcardBackProgress"></uib-progressbar>-->
<!--<div ng-if="legalIDcardBack">Url:{{legalIDcardBack}}</div>-->
<!--</div>-->
<!--</div>-->
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-3" >* Business Licence</label> <label class="control-label col-sm-3" >* Business Licence</label>
<div class="col-sm-8"> <div class="col-sm-8">
@ -87,86 +111,215 @@
</div> </div>
</div> </div>
<div class="form-group"> <!--<div class="form-group">-->
<label class="control-label col-sm-3" >* Tax Level</label> <!--<label class="control-label col-sm-3" >* Tax Level</label>-->
<!--<div class="col-sm-8">-->
<!--<div class="form-control-static">-->
<!--<button class="btn btn-success" type="button"-->
<!--ngf-select="uploadTaxLevel($file)"-->
<!--accept="image/*">-->
<!--<i class="fa fa-upload"></i> Upload Tax Level-->
<!--</button>-->
<!--</div>-->
<!--<uib-progressbar value="taxLevelProgress.value"-->
<!--ng-if="taxLevelProgress"></uib-progressbar>-->
<!--<div ng-if="taxLevel">Url:{{taxLevel}}</div>-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group">-->
<!--<label class="control-label col-sm-3" >* Bank Account Opening Permit</label>-->
<!--<div class="col-sm-8">-->
<!--<div class="form-control-static">-->
<!--<button class="btn btn-success" type="button"-->
<!--ngf-select="uploadBankAccountOpen($file)"-->
<!--accept="image/*">-->
<!--<i class="fa fa-upload"></i> Upload Bank Account Opening Permit-->
<!--</button>-->
<!--</div>-->
<!--<uib-progressbar value="bankAccountOpenProgress.value"-->
<!--ng-if="bankAccountOpenProgress"></uib-progressbar>-->
<!--<div ng-if="bankAccountOpen">Url:{{bankAccountOpen}}</div>-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group">-->
<!--<label class="control-label col-sm-3" >* Organization Code Proof</label>-->
<!--<div class="col-sm-8">-->
<!--<div class="form-control-static">-->
<!--<button class="btn btn-success" type="button"-->
<!--ngf-select="uploadOrgCode($file)"-->
<!--accept="image/*">-->
<!--<i class="fa fa-upload"></i> Upload Organization Code Proof-->
<!--</button>-->
<!--</div>-->
<!--<uib-progressbar value="orgCodeProgress.value"-->
<!--ng-if="orgCodeProgress"></uib-progressbar>-->
<!--<div ng-if="orgCode">Url:{{orgCode}}</div>-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group">-->
<!--<label class="control-label col-sm-3" >Non-standard Protocol File</label>-->
<!--<div class="col-sm-8">-->
<!--<div class="form-control-static">-->
<!--<button class="btn btn-success" type="button"-->
<!--ngf-select="uploadNonStanProtocol($file)"-->
<!--accept="image/*">-->
<!--<i class="fa fa-upload"></i> Upload Non-standard Protocol File-->
<!--</button>-->
<!--</div>-->
<!--<uib-progressbar value="nonStanProtocolProgress.value"-->
<!--ng-if="nonStanProtocolProgress"></uib-progressbar>-->
<!--<div ng-if="nonStanProtocol">Url:{{nonStanProtocol}}</div>-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group">-->
<!--<label class="control-label col-sm-3" >Other Zip File</label>-->
<!--<div class="col-sm-8">-->
<!--<div class="form-control-static">-->
<!--<button class="btn btn-success" type="button"-->
<!--ngf-select="uploadZipPath($file)"-->
<!--accept="image/*">-->
<!--<i class="fa fa-upload"></i> Upload Other Zip File-->
<!--</button>-->
<!--</div>-->
<!--<uib-progressbar value="zipPathProgress.value"-->
<!--ng-if="zipPathProgress"></uib-progressbar>-->
<!--<div ng-if="zipPath">Url:{{zipPath}}</div>-->
<!--</div>-->
<!--</div>-->
<div class="form-group"
ng-class="{'has-error':subForm.directorLastName.$invalid && subForm.directorLastName.$dirty}">
<label class="control-label col-sm-3" for="executiveLastName_input">* Director Last Name</label>
<div class="col-sm-8"> <div class="col-sm-8">
<div class="form-control-static"> <input class="form-control" ng-model="directors.directorLastName"
<button class="btn btn-success" type="button" type="text" name="directorLastName" id="directorLastName_input" required maxlength="50">
ngf-select="uploadTaxLevel($file)" <div ng-messages="subForm.directorLastName.$error" ng-if="subForm.directorLastName.$dirty">
accept="image/*"> <p class="small text-danger" ng-message="required">Required Field</p>
<i class="fa fa-upload"></i> Upload Tax Level <p class="small text-danger" ng-message="maxlength">Length is more than 50</p>
</button>
</div> </div>
<uib-progressbar value="taxLevelProgress.value"
ng-if="taxLevelProgress"></uib-progressbar>
<div ng-if="taxLevel">Url:{{taxLevel}}</div>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group"
<label class="control-label col-sm-3" >* Bank Account Opening Permit</label> ng-class="{'has-error':subForm.directorFirstName.$invalid && subForm.directorFirstName.$dirty}">
<label class="control-label col-sm-3" for="directorFirstName_input">* Director First Name</label>
<div class="col-sm-8"> <div class="col-sm-8">
<div class="form-control-static"> <input class="form-control" ng-model="directors.directorFirstName"
<button class="btn btn-success" type="button" type="text" name="directorFirstName" id="directorFirstName_input" required maxlength="50">
ngf-select="uploadBankAccountOpen($file)" <div ng-messages="subForm.directorFirstName.$error" ng-if="subForm.directorFirstName.$dirty">
accept="image/*"> <p class="small text-danger" ng-message="required">Required Field</p>
<i class="fa fa-upload"></i> Upload Bank Account Opening Permit <p class="small text-danger" ng-message="maxlength">Length is more than 50</p>
</button>
</div> </div>
<uib-progressbar value="bankAccountOpenProgress.value"
ng-if="bankAccountOpenProgress"></uib-progressbar>
<div ng-if="bankAccountOpen">Url:{{bankAccountOpen}}</div>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-3" >* Organization Code Proof</label> <label class="control-label col-sm-3" >* Director Passport</label>
<div class="col-sm-8"> <div class="col-sm-8">
<div class="form-control-static"> <div class="form-control-static">
<button class="btn btn-success" type="button" <button class="btn btn-success" type="button"
ngf-select="uploadOrgCode($file)" ngf-select="uploadDirectorPassport($file)"
accept="image/*"> accept="image/*">
<i class="fa fa-upload"></i> Upload Organization Code Proof <i class="fa fa-upload"></i> Upload Director Passport
</button> </button>
</div> </div>
<uib-progressbar value="orgCodeProgress.value" <uib-progressbar value="directorPassportProgress.value"
ng-if="orgCodeProgress"></uib-progressbar> ng-if="directorPassportProgress"></uib-progressbar>
<div ng-if="orgCode">Url:{{orgCode}}</div> <div ng-if="directorPassport">Url:{{directorPassport}}</div>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group"
<label class="control-label col-sm-3" >Non-standard Protocol File</label> ng-class="{'has-error':subForm.directorPassPort.$invalid && subForm.directorPassPort.$dirty}">
<label class="control-label col-sm-3" for="executivePassPort_input">* Director Passport Number</label>
<div class="col-sm-8"> <div class="col-sm-8">
<div class="form-control-static"> <input class="form-control" ng-model="directors.directorPassPort"
<button class="btn btn-success" type="button" type="text" name="directorPassPort" id="directorPassPort_input" required maxlength="50">
ngf-select="uploadNonStanProtocol($file)" <div ng-messages="subForm.directorPassPort.$error" ng-if="subForm.directorPassPort.$dirty">
accept="image/*"> <p class="small text-danger" ng-message="required">Required Field</p>
<i class="fa fa-upload"></i> Upload Non-standard Protocol File <p class="small text-danger" ng-message="maxlength">Length is more than 50</p>
</button> </div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':subForm.executiveLastName.$invalid && subForm.executiveLastName.$dirty}">
<label class="control-label col-sm-3" for="executiveLastName_input">* Executive Last Name</label>
<div class="col-sm-8">
<input class="form-control" ng-model="executives.executiveLastName"
type="text" name="executiveLastName" id="executiveLastName_input" required maxlength="50">
<div ng-messages="subForm.executiveLastName.$error" ng-if="subForm.executiveLastName.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
<p class="small text-danger" ng-message="maxlength">Length is more than 50</p>
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':subForm.executiveFirstName.$invalid && subForm.executiveFirstName.$dirty}">
<label class="control-label col-sm-3" for="executiveFirstName_input">* Executive First Name</label>
<div class="col-sm-8">
<input class="form-control" ng-model="executives.executiveFirstName"
type="text" name="executiveFirstName" id="executiveFirstName_input" required maxlength="50">
<div ng-messages="subForm.executiveFirstName.$error" ng-if="subForm.executiveFirstName.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
<p class="small text-danger" ng-message="maxlength">Length is more than 50</p>
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':subForm.industry.$invalid && subForm.industry.$dirty}">
<label class="control-label col-sm-3" for="industry">* Executive Level</label>
<div class="col-sm-8">
<select class="form-control" name="executiveLevel"
ng-model="executives.executiveLevel"
required
>
<option value="">Please Choose</option>
<option value="CEO">CEO</option>
<option value="CTO">CTO</option>
<option value="COO">COO</option>
<option value="CFO">CFO</option>
<option value="CCO">CCO</option>
</select>
<div ng-messages="subForm.executiveLevel.$error" ng-if="subForm.executiveLevel.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
</div> </div>
<uib-progressbar value="nonStanProtocolProgress.value"
ng-if="nonStanProtocolProgress"></uib-progressbar>
<div ng-if="nonStanProtocol">Url:{{nonStanProtocol}}</div>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-3" >Other Zip File</label> <label class="control-label col-sm-3" >* Executive Passport</label>
<div class="col-sm-8"> <div class="col-sm-8">
<div class="form-control-static"> <div class="form-control-static">
<button class="btn btn-success" type="button" <button class="btn btn-success" type="button"
ngf-select="uploadZipPath($file)" ngf-select="uploadExecutivePassport($file)"
accept="image/*"> accept="image/*">
<i class="fa fa-upload"></i> Upload Other Zip File <i class="fa fa-upload"></i> Upload Executive Passport
</button> </button>
</div> </div>
<uib-progressbar value="zipPathProgress.value" <uib-progressbar value="executivePassportProgress.value"
ng-if="zipPathProgress"></uib-progressbar> ng-if="executivePassportProgress"></uib-progressbar>
<div ng-if="zipPath">Url:{{zipPath}}</div> <div ng-if="executivePassport">Url:{{executivePassport}}</div>
</div> </div>
</div> </div>
<div class="form-group"
ng-class="{'has-error':subForm.executivePassPort.$invalid && subForm.executivePassPort.$dirty}">
<label class="control-label col-sm-3" for="executivePassPort_input">* Executive Passport Number</label>
<div class="col-sm-8">
<input class="form-control" ng-model="executives.executivePassPort"
type="text" name="executivePassPort" id="executivePassPort_input" required maxlength="50">
<div ng-messages="subForm.executivePassPort.$error" ng-if="subForm.executivePassPort.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
<p class="small text-danger" ng-message="maxlength">Length is more than 50</p>
</div>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>

@ -344,9 +344,9 @@
<label class="control-label col-sm-2" for="company-name-input">Short Name</label> <label class="control-label col-sm-2" for="company-name-input">Short Name</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input class="form-control" ng-model="partner.short_name" type="text" name="short_name" <input class="form-control" ng-model="partner.short_name" type="text" name="short_name"
id="short-name-input" maxlength="50" required> id="short-name-input" maxlength="15" required>
<div ng-messages="partnerForm.short_name.$error" ng-if="partnerForm.short_name.$dirty"> <div ng-messages="partnerForm.short_name.$error" ng-if="partnerForm.short_name.$dirty">
<p class="small text-danger" ng-message="required">No more than 50 characters</p> <p class="small text-danger" ng-message="required">No more than 15 characters</p>
</div> </div>
</div> </div>
</div> </div>

@ -224,6 +224,11 @@
<input type="checkbox" ng-model="params.bd_upload_material"> 等待BD上传材料审核 <input type="checkbox" ng-model="params.bd_upload_material"> 等待BD上传材料审核
</label> </label>
</span> </span>
<span class="checkbox-inline">
<label>
<input type="checkbox" ng-model="params.is_valid"> 禁用
</label>
</span>
</span> </span>
<!--</div>--> <!--</div>-->

@ -62,13 +62,13 @@
<div class="col-sm-8"> <div class="col-sm-8">
<input class="form-control" ng-model="partner.short_name" type="text" <input class="form-control" ng-model="partner.short_name" type="text"
name="short_name" name="short_name"
id="short-name-input" required maxlength="50"> id="short-name-input" required maxlength="15">
<p class="small text-info">short name for WeChat payment display and partner <p class="small text-info">short name for WeChat payment display and partner
name</p> name</p>
<div ng-messages="partnerForm.short_name.$error" <div ng-messages="partnerForm.short_name.$error"
ng-if="partnerForm.company_name.$dirty"> ng-if="partnerForm.company_name.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p> <p class="small text-danger" ng-message="required">Required Field</p>
<p class="small text-danger" ng-message="maxlength">Less Than 50 <p class="small text-danger" ng-message="maxlength">Less Than 15
Characters(including symbols and spaces)</p> Characters(including symbols and spaces)</p>
</div> </div>
</div> </div>
@ -111,13 +111,13 @@
<div class="col-sm-8"> <div class="col-sm-8">
<input class="form-control" ng-model="partner.short_name" type="text" <input class="form-control" ng-model="partner.short_name" type="text"
name="short_name" name="short_name"
id="short-name-input" required maxlength="50"> id="short-name-input" required maxlength="15">
<p class="small text-info">short name for WeChat payment display and partner <p class="small text-info">short name for WeChat payment display and partner
name</p> name</p>
<div ng-messages="partnerForm.short_name.$error" <div ng-messages="partnerForm.short_name.$error"
ng-if="partnerForm.company_name.$dirty"> ng-if="partnerForm.company_name.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p> <p class="small text-danger" ng-message="required">Required Field</p>
<p class="small text-danger" ng-message="maxlength">Less Than 50 <p class="small text-danger" ng-message="maxlength">Less Than 15
Characters(including symbols and spaces)</p> Characters(including symbols and spaces)</p>
</div> </div>
</div> </div>

@ -201,6 +201,10 @@
ng-click="useYeepaySubMerchantId(id_apply.sub_merchant_id)"> ng-click="useYeepaySubMerchantId(id_apply.sub_merchant_id)">
USE USE
</button> </button>
<button role="button" class="btn btn-info" title="update"
ng-click="updateYeepaySubMerchantId(id_apply.sub_merchant_id)" ng-if="partner.yeepay_sub_merchant_id == id_apply.sub_merchant_id">
UPDATE
</button>
</div> </div>
</div> </div>
</div> </div>

@ -0,0 +1,334 @@
<div class="content">
<form novalidate name="subForm">
<div class="row">
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">Update Yeepay Sub Merchant Id</div>
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group"
ng-class="{'has-error':subForm.business_content.$invalid && subForm.business_content.$dirty}">
<label class="control-label col-sm-3" for="business_content">* Business Content</label>
<div class="col-sm-8">
<select class="form-control" name="business_content"
ng-model="business_content"
id="business_content" required
ng-options="business_content.value as business_content.label for business_content in yeepay_business_contents">
<option value="">Please Choose</option>
</select>
<div ng-messages="subForm.business_content.$error" ng-if="subForm.business_content.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':subForm.industry.$invalid && subForm.industry.$dirty}">
<label class="control-label col-sm-3" for="industry">* Business Category</label>
<div class="col-sm-8">
<select class="form-control" name="industry"
ng-model="industry"
id="industry" required
ng-options="industry.value as industry.label for industry in yeepay_industries">
<option value="">Please Choose</option>
</select>
<div ng-messages="subForm.industry.$error" ng-if="subForm.industry.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
</div>
</div>
</div>
<div class="form-group" ng-class="{'has-error':subForm.company_website.$invalid && subForm.company_website.$dirty}">
<label class="control-label col-sm-3" for="company_website_input">* Website</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.company_website" required
type="url" name="company_website" id="company_website_input">
<div ng-messages="subForm.company_website.$error" ng-if="subForm.company_website.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
</div>
<div ng-messages="subForm.company_website.$error" ng-if="subForm.company_website.$dirty">
<p class="small text-danger" ng-message="url">eg:https://www.royalpay.com.au</p>
</div>
</div>
</div>
<div class="form-group" ng-class="{'has-error':subForm.abn.$invalid && subForm.abn.$dirty}">
<label class="control-label col-sm-3" for="abn_input">* ABN</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.abn" required
type="text" name="abn" id="abn_input">
<div ng-messages="subForm.abn.$error" ng-if="subForm.abn.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
</div>
</div>
</div>
<!--<div class="form-group">-->
<!--<label class="control-label col-sm-3" >* Corporate ID Card Front</label>-->
<!--<div class="col-sm-8">-->
<!--<div class="form-control-static">-->
<!--<button class="btn btn-success" type="button"-->
<!--ngf-select="uploadLegalIDcardFront($file)"-->
<!--accept="image/*">-->
<!--<i class="fa fa-upload"></i> Upload Corporate ID Card Front-->
<!--</button>-->
<!--</div>-->
<!--<uib-progressbar value="legalIDcardFrontProgress.value"-->
<!--ng-if="legalIDcardFrontProgress"></uib-progressbar>-->
<!--<div ng-if="legalIDcardFront">Url:{{legalIDcardFront}}</div>-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group">-->
<!--<label class="control-label col-sm-3" >* Corporate ID Card Back</label>-->
<!--<div class="col-sm-8">-->
<!--<div class="form-control-static">-->
<!--<button class="btn btn-success" type="button"-->
<!--ngf-select="uploadLegalIDcardBack($file)"-->
<!--accept="image/*">-->
<!--<i class="fa fa-upload"></i> Upload Corporate ID Card Back-->
<!--</button>-->
<!--</div>-->
<!--<uib-progressbar value="legalIDcardBackProgress.value"-->
<!--ng-if="legalIDcardBackProgress"></uib-progressbar>-->
<!--<div ng-if="legalIDcardBack">Url:{{legalIDcardBack}}</div>-->
<!--</div>-->
<!--</div>-->
<div class="form-group">
<label class="control-label col-sm-3" >* Business Licence</label>
<div class="col-sm-8">
<div class="form-control-static">
<button class="btn btn-success" type="button"
ngf-select="uploadBusinessLicence($file)"
accept="image/*">
<i class="fa fa-upload"></i> Upload Business Licence
</button>
</div>
<uib-progressbar value="businessLicenceProgress.value"
ng-if="businessLicenceProgress"></uib-progressbar>
<div ng-if="businessLicence">Url:{{businessLicence}}</div>
</div>
</div>
<!--<div class="form-group">-->
<!--<label class="control-label col-sm-3" >* Tax Level</label>-->
<!--<div class="col-sm-8">-->
<!--<div class="form-control-static">-->
<!--<button class="btn btn-success" type="button"-->
<!--ngf-select="uploadTaxLevel($file)"-->
<!--accept="image/*">-->
<!--<i class="fa fa-upload"></i> Upload Tax Level-->
<!--</button>-->
<!--</div>-->
<!--<uib-progressbar value="taxLevelProgress.value"-->
<!--ng-if="taxLevelProgress"></uib-progressbar>-->
<!--<div ng-if="taxLevel">Url:{{taxLevel}}</div>-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group">-->
<!--<label class="control-label col-sm-3" >* Bank Account Opening Permit</label>-->
<!--<div class="col-sm-8">-->
<!--<div class="form-control-static">-->
<!--<button class="btn btn-success" type="button"-->
<!--ngf-select="uploadBankAccountOpen($file)"-->
<!--accept="image/*">-->
<!--<i class="fa fa-upload"></i> Upload Bank Account Opening Permit-->
<!--</button>-->
<!--</div>-->
<!--<uib-progressbar value="bankAccountOpenProgress.value"-->
<!--ng-if="bankAccountOpenProgress"></uib-progressbar>-->
<!--<div ng-if="bankAccountOpen">Url:{{bankAccountOpen}}</div>-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group">-->
<!--<label class="control-label col-sm-3" >* Organization Code Proof</label>-->
<!--<div class="col-sm-8">-->
<!--<div class="form-control-static">-->
<!--<button class="btn btn-success" type="button"-->
<!--ngf-select="uploadOrgCode($file)"-->
<!--accept="image/*">-->
<!--<i class="fa fa-upload"></i> Upload Organization Code Proof-->
<!--</button>-->
<!--</div>-->
<!--<uib-progressbar value="orgCodeProgress.value"-->
<!--ng-if="orgCodeProgress"></uib-progressbar>-->
<!--<div ng-if="orgCode">Url:{{orgCode}}</div>-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group">-->
<!--<label class="control-label col-sm-3" >Non-standard Protocol File</label>-->
<!--<div class="col-sm-8">-->
<!--<div class="form-control-static">-->
<!--<button class="btn btn-success" type="button"-->
<!--ngf-select="uploadNonStanProtocol($file)"-->
<!--accept="image/*">-->
<!--<i class="fa fa-upload"></i> Upload Non-standard Protocol File-->
<!--</button>-->
<!--</div>-->
<!--<uib-progressbar value="nonStanProtocolProgress.value"-->
<!--ng-if="nonStanProtocolProgress"></uib-progressbar>-->
<!--<div ng-if="nonStanProtocol">Url:{{nonStanProtocol}}</div>-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group">-->
<!--<label class="control-label col-sm-3" >Other Zip File</label>-->
<!--<div class="col-sm-8">-->
<!--<div class="form-control-static">-->
<!--<button class="btn btn-success" type="button"-->
<!--ngf-select="uploadZipPath($file)"-->
<!--accept="image/*">-->
<!--<i class="fa fa-upload"></i> Upload Other Zip File-->
<!--</button>-->
<!--</div>-->
<!--<uib-progressbar value="zipPathProgress.value"-->
<!--ng-if="zipPathProgress"></uib-progressbar>-->
<!--<div ng-if="zipPath">Url:{{zipPath}}</div>-->
<!--</div>-->
<!--</div>-->
<div class="form-group"
ng-class="{'has-error':subForm.directorLastName.$invalid && subForm.directorLastName.$dirty}">
<label class="control-label col-sm-3" for="executiveLastName_input">* Director Last Name</label>
<div class="col-sm-8">
<input class="form-control" ng-model="directors.directorLastName"
type="text" name="directorLastName" id="directorLastName_input" required maxlength="50">
<div ng-messages="subForm.directorLastName.$error" ng-if="subForm.directorLastName.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
<p class="small text-danger" ng-message="maxlength">Length is more than 50</p>
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':subForm.directorFirstName.$invalid && subForm.directorFirstName.$dirty}">
<label class="control-label col-sm-3" for="directorFirstName_input">* Director First Name</label>
<div class="col-sm-8">
<input class="form-control" ng-model="directors.directorFirstName"
type="text" name="directorFirstName" id="directorFirstName_input" required maxlength="50">
<div ng-messages="subForm.directorFirstName.$error" ng-if="subForm.directorFirstName.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
<p class="small text-danger" ng-message="maxlength">Length is more than 50</p>
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3" >* Director Passport</label>
<div class="col-sm-8">
<div class="form-control-static">
<button class="btn btn-success" type="button"
ngf-select="uploadDirectorPassport($file)"
accept="image/*">
<i class="fa fa-upload"></i> Upload Director Passport
</button>
</div>
<uib-progressbar value="directorPassportProgress.value"
ng-if="directorPassportProgress"></uib-progressbar>
<div ng-if="directorPassport">Url:{{directorPassport}}</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':subForm.directorPassPort.$invalid && subForm.directorPassPort.$dirty}">
<label class="control-label col-sm-3" for="executivePassPort_input">* Director Passport Number</label>
<div class="col-sm-8">
<input class="form-control" ng-model="directors.directorPassPort"
type="text" name="directorPassPort" id="directorPassPort_input" required maxlength="50">
<div ng-messages="subForm.directorPassPort.$error" ng-if="subForm.directorPassPort.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
<p class="small text-danger" ng-message="maxlength">Length is more than 50</p>
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':subForm.executiveLastName.$invalid && subForm.executiveLastName.$dirty}">
<label class="control-label col-sm-3" for="executiveLastName_input">* Executive Last Name</label>
<div class="col-sm-8">
<input class="form-control" ng-model="executives.executiveLastName"
type="text" name="executiveLastName" id="executiveLastName_input" required maxlength="50">
<div ng-messages="subForm.executiveLastName.$error" ng-if="subForm.executiveLastName.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
<p class="small text-danger" ng-message="maxlength">Length is more than 50</p>
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':subForm.executiveFirstName.$invalid && subForm.executiveFirstName.$dirty}">
<label class="control-label col-sm-3" for="executiveFirstName_input">* Executive First Name</label>
<div class="col-sm-8">
<input class="form-control" ng-model="executives.executiveFirstName"
type="text" name="executiveFirstName" id="executiveFirstName_input" required maxlength="50">
<div ng-messages="subForm.executiveFirstName.$error" ng-if="subForm.executiveFirstName.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
<p class="small text-danger" ng-message="maxlength">Length is more than 50</p>
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':subForm.industry.$invalid && subForm.industry.$dirty}">
<label class="control-label col-sm-3" for="industry">* Executive Level</label>
<div class="col-sm-8">
<select class="form-control" name="executiveLevel"
ng-model="executives.executiveLevel"
required
>
<option value="">Please Choose</option>
<option value="CEO">CEO</option>
<option value="CTO">CTO</option>
<option value="COO">COO</option>
<option value="CFO">CFO</option>
<option value="CCO">CCO</option>
</select>
<div ng-messages="subForm.executiveLevel.$error" ng-if="subForm.executiveLevel.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3" >* Executive Passport</label>
<div class="col-sm-8">
<div class="form-control-static">
<button class="btn btn-success" type="button"
ngf-select="uploadExecutivePassport($file)"
accept="image/*">
<i class="fa fa-upload"></i> Upload Executive Passport
</button>
</div>
<uib-progressbar value="executivePassportProgress.value"
ng-if="executivePassportProgress"></uib-progressbar>
<div ng-if="executivePassport">Url:{{executivePassport}}</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':subForm.executivePassPort.$invalid && subForm.executivePassPort.$dirty}">
<label class="control-label col-sm-3" for="executivePassPort_input">* Executive Passport Number</label>
<div class="col-sm-8">
<input class="form-control" ng-model="executives.executivePassPort"
type="text" name="executivePassPort" id="executivePassPort_input" required maxlength="50">
<div ng-messages="subForm.executivePassPort.$error" ng-if="subForm.executivePassPort.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
<p class="small text-danger" ng-message="maxlength">Length is more than 50</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="btn-group margin-bottom margin-top">
<button class="btn btn-success" type="button"
ng-click="saveYeepayApply(subForm)">Submit
</button>
</div>
</div>
</div>
</form>
</div>

@ -92,6 +92,22 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
}; };
$scope.loadSettlementLogs(1); $scope.loadSettlementLogs(1);
$scope.exportSettlementLogs = function() {
var params = angular.copy($scope.params);
var url = '/client/trans_flow/settlement/log/excel';
var connectSymbol = '?';
if (params.datefrom) {
params.datefrom = $filter('date')(params.datefrom, 'yyyyMMdd');
url += connectSymbol + 'datefrom=' + params.datefrom;
connectSymbol = '&';
}
if (params.dateto) {
params.dateto = $filter('date')(params.dateto, 'yyyyMMdd');
url += connectSymbol + 'dateto=' + params.dateto;
}
return url;
};
var getClientUnClearedAmount = function () { var getClientUnClearedAmount = function () {
$http.get('/client/trans_flow/settlement/unclear').then(function (resp) { $http.get('/client/trans_flow/settlement/unclear').then(function (resp) {
$scope.unclear = resp.data; $scope.unclear = resp.data;

@ -88,6 +88,9 @@
<button class="btn btn-success" type="button" ng-click="loadSettlementLogs()"> <button class="btn btn-success" type="button" ng-click="loadSettlementLogs()">
<i class="fa fa-search"></i> Search <i class="fa fa-search"></i> Search
</button> </button>
<a role="button" class="btn btn-primary" style="float: right;right: 20px;" type="button" ng-href="{{exportSettlementLogs()}}">
<i class="fa fa-download"></i> export
</a>
</div> </div>
</div> </div>
</div> </div>

@ -33,7 +33,7 @@
</section> </section>
<div class="content"> <div class="content">
<div class="callout callout-info" ng-repeat="order in alerts"> <div class="callout callout-info" ng-repeat="order in alerts">
<h4><span style="font-size: 22px">{{order.customer_payment_amount|currency:order.currency+' '}}</span> Paid <h4><span style="font-size: 22px">{{order.display_amount|currency:order.currency+' '}}</span> Paid
Success!</h4> Success!</h4>
<p>Pay Time:{{order.pay_time_local}}</p> <p>Pay Time:{{order.pay_time_local}}</p>
</div> </div>

Loading…
Cancel
Save