Merge branch 'develop'

master
yangkai 6 years ago
commit 141389f712

@ -8,8 +8,6 @@ import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.apache.ibatis.annotations.Param;
import org.joda.time.DateTime;
import org.springframework.beans.factory.annotation.Autowired;
import java.math.BigDecimal;
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 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);
List<JSONObject> listTransactionForCityPartnerCommissionByDate(@Param("year") int year, @Param("month") int month);
@ -120,9 +119,9 @@ public interface TransactionMapper {
@AdvanceSelect(addonWhereClause = "transaction_type='Credit'")
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)
@AdvanceSelect(addonWhereClause = "system_generate=1")
@ -156,6 +155,7 @@ public interface TransactionMapper {
/**
* 退退
*
* @param clientId
* @param systemTransactionId
* @return
@ -164,4 +164,14 @@ public interface TransactionMapper {
PageList<JSONObject> findByClientIdAndSystemTransactionId(@Param("client_id") int clientId,
@Param("system_transaction_id") String systemTransactionId,
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);
}

@ -3720,7 +3720,16 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
merchantInfo.put("create_time",new Date());
merchantInfo.put("operator",manager.getString("display_name"));
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);
JSONObject yeepayConfig = yeePayClientConfigMapper.findMerchantConfig(client.getIntValue("client_id"));
SubmerchantRegisterResult result = yeePayClient.registerMerchant(client,yeepayConfig);

@ -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("production_flag")) {
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());
}
}

@ -50,4 +50,6 @@ public interface TradeLogService {
void fullReleasePreAuthorization(JSONObject account, TradeLogQuery query)throws Exception;
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.TradeLogQuery;
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.exceptions.BadRequestException;
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.HSSFWorkbook;
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.LoggerFactory;
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()));
}
@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();
}
@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.account-no=837022519
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.get_prize,
c.bd_group,
c.kpi_amount
c.kpi_amount,
m.is_valid
FROM sys_managers m
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>

@ -4,13 +4,19 @@
<update id="removeSettleRemark">
UPDATE pmt_transactions AS t
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}
</update>
<delete id="deleteSettlementTransaction">
DELETE t FROM pmt_transactions t
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 t
FROM pmt_transactions t
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>
<select id="listTransFlowPage" resultType="com.alibaba.fastjson.JSONObject">
SELECT t.*,if(t.refund_id is not null,'refund',if(t.transaction_type='Debit' AND
@ -95,7 +101,7 @@
THEN 'Native QR Code'
WHEN 14
THEN 'Share Link'
END AS gateway,
END AS gateway,
CASE o.channel
WHEN 'Alipay' THEN ra.login_id
WHEN 'AlipayOnline' THEN ra.login_email
@ -217,14 +223,16 @@
<select id="findLastIncome" resultType="com.alibaba.fastjson.JSONObject">
SELECT *
FROM pmt_transactions
WHERE channel = 'Wechat' AND transaction_type = 'Credit'
WHERE channel = 'Wechat'
AND transaction_type = 'Credit'
ORDER BY transaction_time DESC
LIMIT 1
</select>
<select id="getClientUnClearedAmount" resultType="java.lang.Double">
SELECT ifnull(sum(if(transaction_type = 'Credit', clearing_amount, -clearing_amount)), 0)
FROM pmt_transactions
WHERE clearing_status = 0 AND client_id = #{client_id}
WHERE clearing_status = 0
AND client_id = #{client_id}
</select>
<select id="getClientsUnClearedAmount" resultType="com.alibaba.fastjson.JSONObject">
@ -252,14 +260,13 @@
</select>
<select id="listPreRefundClients" resultType="com.alibaba.fastjson.JSONObject">
SELECT *
FROM (SELECT
ifnull(sum(if(transaction_type = 'Credit', clearing_amount, -clearing_amount)), 0) amount,
c.client_id client_id,
max(t.transaction_time) transation_time,
c.client_moniker client_moniker
FROM (SELECT ifnull(sum(if(transaction_type = 'Credit', clearing_amount, -clearing_amount)), 0) amount,
c.client_id client_id,
max(t.transaction_time) transation_time,
c.client_moniker client_moniker
FROM pmt_transactions t
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_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
GROUP BY c.client_id) a
WHERE a.amount &lt; 0
</select>
@ -281,41 +288,38 @@
</select>
<select id="listUnclearedTransactionsOfClient" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
SELECT
c.client_id,
c.client_moniker,
c.parent_client_id,
c.org_id,
cc.clean_days,
t.transaction_id,
t.transaction_type,
t.transaction_time,
t.clearing_amount,
t.channel,
t.system_generate,
t.order_id,
t.refund_id,
t.cny_amount,
t.exchange_rate,
o.display_amount,
o.total_amount
SELECT c.client_id,
c.client_moniker,
c.parent_client_id,
c.org_id,
cc.clean_days,
t.transaction_id,
t.transaction_type,
t.transaction_time,
t.clearing_amount,
t.channel,
t.system_generate,
t.order_id,
t.refund_id,
t.cny_amount,
t.exchange_rate,
o.display_amount,
o.total_amount
FROM pmt_transactions t
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
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
t.client_id = #{client_id} AND
((t.transaction_type = 'Credit' AND t.transaction_time < #{end} AND t.channel != 'System')
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())
)
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
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 t.client_id = #{client_id}
AND ((t.transaction_type = 'Credit' AND t.transaction_time < #{end} AND t.channel != 'System')
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
ORDER BY t.transaction_type, t.transaction_time
]]>
</select>
@ -461,77 +465,66 @@
<select id="getMerchantAmount" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
SELECT temp.*
FROM (
SELECT
#{clearing_date} AS order_time,
#{clearing_date} AS clearing_time,
t.client_id,
round(sum(if(t.transaction_type = 'Credit', t.clearing_amount, -t.clearing_amount)) *
(100 - ifnull(min(r.rate_value), 1.4))) / 100 clearing_amount,
t.transaction_currency currency,
t.order_id
SELECT #{clearing_date} AS order_time,
#{clearing_date} AS clearing_time,
t.client_id,
round(sum(if(t.transaction_type = 'Credit', t.clearing_amount, -t.clearing_amount)) *
(100 - ifnull(min(r.rate_value), 1.4))) / 100 clearing_amount,
t.transaction_currency currency,
t.order_id
FROM pmt_transactions t
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
AND date(r.expiry_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
WHERE
t.transaction_time >= #{from} AND t.transaction_time < #{to} AND t.channel != 'Settlement'
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
AND date(r.expiry_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
WHERE t.transaction_time >= #{from}
AND t.transaction_time < #{to}
AND t.channel != 'Settlement'
GROUP BY t.client_id) temp
WHERE clearing_amount != 0
]]>
</select>
<select id="getSumMerchantAmount" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
SELECT SUM(temp.clearing_amount) clearing_amount
FROM
(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
FROM pmt_transactions t
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
AND date(r.expiry_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
WHERE
t.transaction_time >= #{from} AND t.transaction_time < #{to} AND t.channel != 'Settlement'
GROUP BY t.client_id) temp
FROM (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
FROM pmt_transactions t
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
AND date(r.expiry_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
WHERE t.transaction_time >= #{from}
AND t.transaction_time < #{to}
AND t.channel != 'Settlement'
GROUP BY t.client_id) temp
WHERE temp.clearing_amount != 0
]]>
</select>
<select id="analysisTotalTransactions" resultType="java.lang.Double">
<![CDATA[
SELECT ifnull(sum(clearing_amount), 0) total
FROM pmt_transactions
WHERE client_id = #{client_id} AND date(transaction_time) >= date(#{begin}) AND
date(transaction_time) <= date(#{end})
WHERE client_id = #{client_id}
AND date(transaction_time) >= date(#{begin})
AND date(transaction_time) <= date(#{end})
]]>
</select>
<select id="listTransactionsOfClearingTask" resultType="com.alibaba.fastjson.JSONObject">
SELECT
t.*,
cl.client_moniker
SELECT t.*,
cl.client_moniker
FROM pmt_transactions t
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 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
WHERE t.transaction_type = 'Credit' OR t.refund_id IS NOT NULL
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 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
WHERE t.transaction_type = 'Credit'
OR t.refund_id IS NOT NULL
ORDER BY t.order_id ASC
</select>
@ -560,259 +553,267 @@
<select id="TotalAmountForBDPrize" resultType="java.math.BigDecimal">
<![CDATA[
select sum(if(temp.transaction_type='Credit',temp.clearing_amount*d.proportion,-temp.clearing_amount*d.proportion))
total FROM
(SELECT l.client_id,l.clearing_amount,l.refund_id,l.transaction_type,o.create_time FROM pmt_transactions l
INNER JOIN pmt_orders o
ON o.order_id = l.order_id
and year(o.create_time) = #{year} AND month(o.create_time) = #{month}
where (l.transaction_type='Credit' or l.refund_id is not null)
) temp
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'
AND (d.end_date is null or d.end_date > temp.create_time)
and d.bd_id=#{bd_id}
select sum(if(temp.transaction_type = 'Credit', temp.clearing_amount * d.proportion,
-temp.clearing_amount * d.proportion))
total
FROM (SELECT l.client_id,l.clearing_amount,l.refund_id,l.transaction_type,o.create_time
FROM pmt_transactions l
INNER JOIN pmt_orders o
ON o.order_id = l.order_id
and year(o.create_time) = #{year} AND month(o.create_time) = #{month}
where (l.transaction_type = 'Credit' or l.refund_id is not null)
) temp
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'
AND (d.end_date is null or d.end_date > temp.create_time)
and d.bd_id = #{bd_id}
]]>
</select>
<select id="TotalAmountForBDLeaderPrize" resultType="java.math.BigDecimal">
SELECT
ifnull(sum(t.total),0)
total
SELECT ifnull(sum(t.total), 0)
total
FROM statistics_customer_order t
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}
and t.client_id!=0
and t.client_id in
(SELECT b.client_id FROM sys_client_bd b
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})
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}
and t.client_id != 0
and t.client_id in
(SELECT b.client_id
FROM sys_client_bd b
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 id="TotalAmountForSydneyGMPrize" resultType="java.math.BigDecimal">
SELECT
ifnull(sum(t.total),0)
total
SELECT ifnull(sum(t.total), 0)
total
FROM statistics_customer_order t
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}
and t.client_id!=0
and t.client_id in
(SELECT b.client_id FROM sys_client_bd b
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')
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}
and t.client_id != 0
and t.client_id in
(SELECT b.client_id
FROM sys_client_bd b
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 id="listTransactionsForCityPartnerCommission" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
SELECT
sum(if(t.transaction_type = 'Credit', t.clearing_amount, -t.clearing_amount)) * b.proportion
total,
t.client_id,
m.org_id,
c.approve_time client_create_time,
c.source client_source,
date(t.transaction_time) trade_date,
t.channel channel,
ifnull((SELECT min(r.rate_value)
FROM sys_client_rates r
WHERE r.client_id = t.client_id AND r.active_time <= t.transaction_time AND
r.expiry_time >= t.transaction_time AND
r.rate_name = 'Wechat'), 1) wechat_rate_value,
ifnull((SELECT min(r.rate_value)
FROM sys_client_rates r
WHERE r.client_id = t.client_id AND r.active_time <= t.transaction_time AND
r.expiry_time >= t.transaction_time AND
r.rate_name = 'Alipay'), 1) alipay_rate_value,
ifnull((SELECT min(r.rate_value)
FROM sys_client_rates r
WHERE r.client_id = t.client_id AND r.active_time <= t.transaction_time AND
r.expiry_time >= t.transaction_time AND
r.rate_name = 'Bestpay'), 1) bestpay_rate_value,
ifnull((SELECT min(r.rate_value)
FROM sys_client_rates r
WHERE r.client_id = t.client_id AND r.active_time <= t.transaction_time AND
r.expiry_time >= t.transaction_time AND
r.rate_name = 'jd'), 1) jd_rate_value,
ifnull((SELECT min(r.rate_value)
FROM sys_client_rates r
WHERE r.client_id = t.client_id AND r.active_time <= t.transaction_time AND
r.expiry_time >= t.transaction_time AND
r.rate_name = 'AlipayOnline'), 2.0) AlipayOnline_rate_value
SELECT sum(if(t.transaction_type = 'Credit', t.clearing_amount, -t.clearing_amount)) * b.proportion
total,
t.client_id,
m.org_id,
c.approve_time client_create_time,
c.source client_source,
date(t.transaction_time) trade_date,
t.channel channel,
ifnull((SELECT min(r.rate_value)
FROM sys_client_rates r
WHERE r.client_id = t.client_id
AND r.active_time <= t.transaction_time
AND r.expiry_time >= t.transaction_time
AND r.rate_name = 'Wechat'), 1) wechat_rate_value,
ifnull((SELECT min(r.rate_value)
FROM sys_client_rates r
WHERE r.client_id = t.client_id
AND r.active_time <= t.transaction_time
AND r.expiry_time >= t.transaction_time
AND r.rate_name = 'Alipay'), 1) alipay_rate_value,
ifnull((SELECT min(r.rate_value)
FROM sys_client_rates r
WHERE r.client_id = t.client_id
AND r.active_time <= t.transaction_time
AND r.expiry_time >= t.transaction_time
AND r.rate_name = 'Bestpay'), 1) bestpay_rate_value,
ifnull((SELECT min(r.rate_value)
FROM sys_client_rates r
WHERE r.client_id = t.client_id
AND r.active_time <= t.transaction_time
AND r.expiry_time >= t.transaction_time
AND r.rate_name = 'jd'), 1) jd_rate_value,
ifnull((SELECT min(r.rate_value)
FROM sys_client_rates r
WHERE r.client_id = t.client_id
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
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
AND (b.end_date IS NULL OR b.end_date >= t.transaction_time) AND
b.is_valid = 1
INNER JOIN sys_managers m ON m.manager_id = b.bd_id
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
WHERE year(t.transaction_time) = #{year} AND month(t.transaction_time) = #{month} AND t.channel != 'Settlement'
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
AND (b.end_date IS NULL OR b.end_date >= t.transaction_time) AND
b.is_valid = 1
INNER JOIN sys_managers m ON m.manager_id = b.bd_id
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
WHERE year(t.transaction_time) = #{year}
AND month(t.transaction_time) = #{month}
AND t.channel != 'Settlement'
GROUP BY t.client_id, trade_date, channel
ORDER BY c.org_id ASC, t.client_id ASC, trade_date ASC
]]>
</select>
<select id="listTransactionForCityPartnerCommissionByDate" resultType="com.alibaba.fastjson.JSONObject">
<![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,
if(t.transaction_type = 'Credit', t.total_surcharge, -t.total_surcharge) total_surcharge,
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'
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,
if(t.transaction_type = 'Credit', t.total_surcharge, -t.total_surcharge) total_surcharge,
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
]]>
]]>
</select>
<select id="listTransactionForCityPartnerAgentCommissionByDate" resultType="com.alibaba.fastjson.JSONObject">
<![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,
if(t.transaction_type = 'Credit', t.total_surcharge, -t.total_surcharge) total_surcharge,
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.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'
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,
if(t.transaction_type = 'Credit', t.total_surcharge, -t.total_surcharge) total_surcharge,
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.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
]]>
]]>
</select>
<select id="listTransactionsForReferrerCommission" resultType="com.alibaba.fastjson.JSONObject">
SELECT
sum(if(t.transaction_type = 'Credit', t.clearing_amount, -t.clearing_amount))
total,
t.client_id client_id,
so.org_id org_id,
c.source client_source,
date(t.transaction_time) trade_date,
ifnull(so.rate_value, 1) rate_value
SELECT sum(if(t.transaction_type = 'Credit', t.clearing_amount, -t.clearing_amount))
total,
t.client_id client_id,
so.org_id org_id,
c.source client_source,
date(t.transaction_time) trade_date,
ifnull(so.rate_value, 1) rate_value
FROM pmt_transactions t
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_org so
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'
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_org so
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'
GROUP BY so.org_id, trade_date, t.client_id
ORDER BY c.org_id ASC, t.client_id ASC, trade_date ASC
</select>
<select id="listTransactionsForAgentCommission" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
SELECT
sum(if(t.transaction_type = 'Credit', t.clearing_amount, -t.clearing_amount))
total,
t.client_id client_id,
c.approve_time client_create_time,
c.source client_source,
date(t.transaction_time) trade_date,
t.channel channel,
ifnull(so.rate_value, 1) rate_value,
ifnull((SELECT min(r.rate_value)
FROM sys_client_rates r
WHERE r.client_id = t.client_id AND r.active_time <= t.transaction_time AND
r.expiry_time >= t.transaction_time AND
r.rate_name = 'Wechat'), 1) wechat_rate_value,
ifnull((SELECT min(r.rate_value)
FROM sys_client_rates r
WHERE r.client_id = t.client_id AND r.active_time <= t.transaction_time AND
r.expiry_time >= t.transaction_time AND
r.rate_name = 'Alipay'), 1) alipay_rate_value,
ifnull((SELECT min(r.rate_value)
FROM sys_client_rates r
WHERE r.client_id = t.client_id AND r.active_time <= t.transaction_time AND
r.expiry_time >= t.transaction_time AND
r.rate_name = 'Bestpay'), 1) bestpay_rate_value,
ifnull((SELECT min(r.rate_value)
FROM sys_client_rates r
WHERE r.client_id = t.client_id AND r.active_time <= t.transaction_time AND
r.expiry_time >= t.transaction_time AND
r.rate_name = 'jd'), 1) jd_rate_value,
ifnull((SELECT min(r.rate_value)
FROM sys_client_rates r
WHERE r.client_id = t.client_id AND r.active_time <= t.transaction_time AND
r.expiry_time >= t.transaction_time AND
r.rate_name = 'AlipayOnline'), 2.0) AlipayOnline_rate_value
SELECT sum(if(t.transaction_type = 'Credit', t.clearing_amount, -t.clearing_amount))
total,
t.client_id client_id,
c.approve_time client_create_time,
c.source client_source,
date(t.transaction_time) trade_date,
t.channel channel,
ifnull(so.rate_value, 1) rate_value,
ifnull((SELECT min(r.rate_value)
FROM sys_client_rates r
WHERE r.client_id = t.client_id
AND r.active_time <= t.transaction_time
AND r.expiry_time >= t.transaction_time
AND r.rate_name = 'Wechat'), 1) wechat_rate_value,
ifnull((SELECT min(r.rate_value)
FROM sys_client_rates r
WHERE r.client_id = t.client_id
AND r.active_time <= t.transaction_time
AND r.expiry_time >= t.transaction_time
AND r.rate_name = 'Alipay'), 1) alipay_rate_value,
ifnull((SELECT min(r.rate_value)
FROM sys_client_rates r
WHERE r.client_id = t.client_id
AND r.active_time <= t.transaction_time
AND r.expiry_time >= t.transaction_time
AND r.rate_name = 'Bestpay'), 1) bestpay_rate_value,
ifnull((SELECT min(r.rate_value)
FROM sys_client_rates r
WHERE r.client_id = t.client_id
AND r.active_time <= t.transaction_time
AND r.expiry_time >= t.transaction_time
AND r.rate_name = 'jd'), 1) jd_rate_value,
ifnull((SELECT min(r.rate_value)
FROM sys_client_rates r
WHERE r.client_id = t.client_id
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
INNER JOIN sys_clients c ON c.client_id = t.client_id
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}
WHERE year(t.transaction_time) = #{year} AND month(t.transaction_time) = #{month} AND t.channel != 'Settlement'
INNER JOIN sys_clients c ON c.client_id = t.client_id
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}
WHERE year(t.transaction_time) = #{year}
AND month(t.transaction_time) = #{month}
AND t.channel != 'Settlement'
GROUP BY t.client_id, trade_date, channel
ORDER BY c.org_id ASC, t.client_id ASC, trade_date ASC
]]>
</select>
<select id="checkBalance" resultType="java.math.BigDecimal">
<![CDATA[
SELECT sum(subval)
FROM (SELECT
c.client_moniker,
a.client_id,
a.total_credit,
a.total_debit,
a.total_debit - a.total_credit subval
FROM
(
SELECT
sum(
IF(
t.transaction_type = 'Credit',
t.clearing_amount,
0
)
) total_credit,
sum(
IF(
t.transaction_type = 'Debit',
t.clearing_amount,
0
)
) total_debit,
t.client_id
FROM
pmt_transactions t
WHERE
t.clearing_status = 1
AND (date(t.clearing_time) <= date(#{end}) OR t.clearing_time IS NULL)
GROUP BY
t.client_id
) a
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
FROM (SELECT c.client_moniker,
a.client_id,
a.total_credit,
a.total_debit,
a.total_debit - a.total_credit subval
FROM (
SELECT sum(
IF(
t.transaction_type = 'Credit',
t.clearing_amount,
0
)
) total_credit,
sum(
IF(
t.transaction_type = 'Debit',
t.clearing_amount,
0
)
) total_debit,
t.client_id
FROM pmt_transactions t
WHERE t.clearing_status = 1
AND (date(t.clearing_time) <= date(#{end}) OR t.clearing_time IS NULL)
GROUP BY t.client_id
) a
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 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 id="listTransactionsOfClearingOrder" 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
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
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
WHERE t.channel != 'Settlement' AND t.clearing_order = #{clearing_order}
LEFT JOIN pmt_orders o ON o.order_id = t.order_id
LEFT JOIN pmt_refunds r ON r.refund_id = t.refund_id
WHERE t.channel != 'Settlement'
AND t.clearing_order = #{clearing_order}
]]>
</select>
<select id="listSettlementTransactions" resultType="com.alibaba.fastjson.JSONObject">
SELECT 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 id="analysisCustomerPaid" resultType="java.math.BigDecimal">
SELECT ifnull(sum(t.clearing_amount), 0)
FROM pmt_transactions t
INNER JOIN pmt_orders o
ON o.order_id = t.order_id AND o.transaction_date BETWEEN #{startDate} AND #{endDate} AND
o.customer_id = #{customer_id}
WHERE t.system_generate = 0 AND t.transaction_type = 'Credit'
INNER JOIN pmt_orders o
ON o.order_id = t.order_id AND o.transaction_date BETWEEN #{startDate} AND #{endDate} AND
o.customer_id = #{customer_id}
WHERE t.system_generate = 0
AND t.transaction_type = 'Credit'
</select>
<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
</select>
<select id="listClientUnsettleDataByDate" resultType="com.alibaba.fastjson.JSONObject">
SELECT
date(transaction_time) trans_date,
sum(if(transaction_type = 'Credit', clearing_amount, -clearing_amount)) clearing_amount,
sum(if(transaction_type = 'Credit', settle_amount, -settle_amount)) settle_amount
SELECT date(transaction_time) trans_date,
sum(if(transaction_type = 'Credit', clearing_amount, -clearing_amount)) clearing_amount,
sum(if(transaction_type = 'Credit', settle_amount, -settle_amount)) settle_amount
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
ORDER BY trans_date DESC
</select>
<select id="getHfClearAmount" resultType="com.alibaba.fastjson.JSONObject">
SELECT sum(clearing_amount) clear_amount,
sum(channel_surcharge) charge_amount ,
SELECT sum(clearing_amount) clear_amount,
sum(channel_surcharge) charge_amount,
transaction_type
FROM pmt_transactions where channel='hf'
AND transaction_time >= #{datefrom}
AND transaction_time &lt;= #{dateto}
GROUP BY transaction_type
FROM pmt_transactions
where channel = 'hf'
AND transaction_time >= #{datefrom}
AND transaction_time &lt;= #{dateto}
GROUP BY transaction_type
</select>
<select id="analysisForATOReport" resultType="com.alibaba.fastjson.JSONObject">
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='Debit',t.clearing_amount,0)) total_refund,
sum(if(transaction_type='Debit',1,0)) refund_count,
min(t.transaction_time) period_start,
max(t.transaction_time) period_end,
cd.bsb_no,
cd.account_no,
cd.account_name
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 = 'Debit', t.clearing_amount, 0)) total_refund,
sum(if(transaction_type = 'Debit', 1, 0)) refund_count,
min(t.transaction_time) period_start,
max(t.transaction_time) period_end,
cd.bsb_no,
cd.account_no,
cd.account_name
from pmt_transactions t
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}
and t.channel!='Settlement'
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}
and t.channel != 'Settlement'
group by cd.bsb_no,cd.account_no
order by period_start
</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>

@ -124,7 +124,8 @@
</thead>
<tbody>
<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>
<input type="number" ng-model="bd.kpi_amount" min="0">
</td>

@ -3402,6 +3402,22 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$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;
},
yeepaySubMerchantId: function () {
return sub_merchant_id;
}
}
}).result.then(function () {
$scope.loadSubMerchantInfos();
})
};
$scope.loadSubMerchantInfos();
}]);
app.controller('applyWxSubMerchantIdCtrl', ['$scope', '$http', '$uibModal', '$state', 'subMerchantInfo', '$filter', 'merchantIds', 'commonDialog', function ($scope, $http, $uibModal, $state, subMerchantInfo, $filter, merchantIds, commonDialog) {
@ -3505,6 +3521,12 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.subMerchantInfo = angular.copy(subMerchantInfo);
var vouchers={};
$scope.directors={};
$scope.executives={};
$scope.industry = '';
$scope.business_content = '';
var merchantInfo = {};
var merchantId = '';
@ -3570,7 +3592,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}).then(function (resp) {
delete $scope.businessLicenceProgress;
$scope.businessLicence = resp.data.path;
vouchers['businessLicence'] = resp.data.path;
merchantInfo['business_licence'] = resp.data.path;
merchantId = resp.data.merchantId;
commonDialog.alert({title: 'Upload Success', content: 'Upload Success', type: 'success'})
}, function (resp) {
@ -3708,8 +3730,57 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}
};
$scope.uploadDirectorPassport = function (file) {
if (file != null) {
if (file.size > 3 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'})
} else {
$scope.directorPassportProgress = {value: 0};
Upload.upload({
url: '/attachment/yeepayFiles',
data: {file: file}
}).then(function (resp) {
delete $scope.directorPassportProgress;
$scope.directorPassport = resp.data.path;
$scope.directors.filePath = resp.data.path;
merchantId = resp.data.merchantId;
commonDialog.alert({title: 'Upload Success', content: 'Upload Success', type: 'success'})
}, function (resp) {
delete $scope.directorPassportProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.directorPassportProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
$scope.uploadExecutivePassport = function (file) {
if (file != null) {
if (file.size > 3 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'})
} else {
$scope.executivePassportProgress = {value: 0};
Upload.upload({
url: '/attachment/yeepayFiles',
data: {file: file}
}).then(function (resp) {
delete $scope.executivePassportProgress;
$scope.executivePassport = resp.data.path;
$scope.executives.filePath = resp.data.path;
merchantId = resp.data.merchantId;
commonDialog.alert({title: 'Upload Success', content: 'Upload Success', type: 'success'})
}, function (resp) {
delete $scope.executivePassportProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.executivePassportProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
$scope.saveYeepayApply = function (form) {
var merchantInfo = {};
$scope.errmsg = null;
if (form.$invalid) {
angular.forEach(form, function (item, key) {
@ -3719,14 +3790,325 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
});
return;
}
angular.forEach(form, function (item, key) {
if(item !=null) {
if(item.$name !=null) {
merchantInfo[key] = item.$modelValue;
}
// angular.forEach(form, function (item, key) {
// if(item !=null) {
// if(item.$name !=null) {
// merchantInfo[key] = item.$modelValue;
// }
// }
// });
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();
}
});
merchantInfo['vouchers'] = vouchers;
}, 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', function ($scope, $http, $uibModal, $state,subMerchantInfo,yeepayIndustryMap,yeepayBusinessContentMap,$filter, commonDialog,Upload) {
$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.size > 3 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'})
} else {
$scope.businessLicenceProgress = {value: 0};
Upload.upload({
url: '/attachment/yeepayFiles',
data: {file: file}
}).then(function (resp) {
delete $scope.businessLicenceProgress;
$scope.businessLicence = resp.data.path;
merchantInfo['business_licence'] = resp.data.path;
merchantId = resp.data.merchantId;
commonDialog.alert({title: 'Upload Success', content: 'Upload Success', type: 'success'})
}, function (resp) {
delete $scope.businessLicenceProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.businessLicenceProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
$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.size > 3 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'})
} else {
$scope.directorPassportProgress = {value: 0};
Upload.upload({
url: '/attachment/yeepayFiles',
data: {file: file}
}).then(function (resp) {
delete $scope.directorPassportProgress;
$scope.directorPassport = resp.data.path;
$scope.directors.filePath = resp.data.path;
merchantId = resp.data.merchantId;
commonDialog.alert({title: 'Upload Success', content: 'Upload Success', type: 'success'})
}, function (resp) {
delete $scope.directorPassportProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.directorPassportProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
$scope.uploadExecutivePassport = function (file) {
if (file != null) {
if (file.size > 3 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'})
} else {
$scope.executivePassportProgress = {value: 0};
Upload.upload({
url: '/attachment/yeepayFiles',
data: {file: file}
}).then(function (resp) {
delete $scope.executivePassportProgress;
$scope.executivePassport = resp.data.path;
$scope.executives.filePath = resp.data.path;
merchantId = resp.data.merchantId;
commonDialog.alert({title: 'Upload Success', content: 'Upload Success', type: 'success'})
}, function (resp) {
delete $scope.executivePassportProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.executivePassportProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
$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['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;
@ -3749,6 +4131,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) {
$scope.clientPermission = {client_moniker:$scope.partner.client_moniker};
$scope.loadPermissionList = function () {

@ -11,7 +11,7 @@
<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="subMerchantInfo.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>
@ -28,7 +28,7 @@
<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="subMerchantInfo.industry"
ng-model="industry"
id="industry" required
ng-options="industry.value as industry.label for industry in yeepay_industries">
<option value="">Please Choose</option>
@ -39,134 +39,263 @@
</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" >* Corporate ID Card Front</label>
<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="uploadLegalIDcardFront($file)"
ngf-select="uploadBusinessLicence($file)"
accept="image/*">
<i class="fa fa-upload"></i> Upload Corporate ID Card Front
<i class="fa fa-upload"></i> Upload Business Licence
</button>
</div>
<uib-progressbar value="legalIDcardFrontProgress.value"
ng-if="legalIDcardFrontProgress"></uib-progressbar>
<div ng-if="legalIDcardFront">Url:{{legalIDcardFront}}</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" >* Corporate ID Card Back</label>
<!--<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">
<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>
<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>
<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="form-group"
ng-class="{'has-error':subForm.directorFirstName.$invalid && subForm.directorFirstName.$dirty}">
<label class="control-label col-sm-3" for="directorFirstName_input">* Director Fist Name</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>
<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>
<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>
<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="uploadTaxLevel($file)"
ngf-select="uploadDirectorPassport($file)"
accept="image/*">
<i class="fa fa-upload"></i> Upload Tax Level
<i class="fa fa-upload"></i> Upload Director Passport
</button>
</div>
<uib-progressbar value="taxLevelProgress.value"
ng-if="taxLevelProgress"></uib-progressbar>
<div ng-if="taxLevel">Url:{{taxLevel}}</div>
<uib-progressbar value="directorPassportProgress.value"
ng-if="directorPassportProgress"></uib-progressbar>
<div ng-if="directorPassport">Url:{{directorPassport}}</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3" >* Bank Account Opening Permit</label>
<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">
<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>
<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>
<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="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">
<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>
<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>
<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="form-group"
ng-class="{'has-error':subForm.executiveFirstName.$invalid && subForm.executiveFirstName.$dirty}">
<label class="control-label col-sm-3" for="executiveFirstName_input">* Executive Fist Name</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>
<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>
<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>
<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="uploadZipPath($file)"
ngf-select="uploadExecutivePassport($file)"
accept="image/*">
<i class="fa fa-upload"></i> Upload Other Zip File
<i class="fa fa-upload"></i> Upload Executive Passport
</button>
</div>
<uib-progressbar value="zipPathProgress.value"
ng-if="zipPathProgress"></uib-progressbar>
<div ng-if="zipPath">Url:{{zipPath}}</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>

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

@ -0,0 +1,310 @@
<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">-->
<!--<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 Fist 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 Fist 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.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 () {
$http.get('/client/trans_flow/settlement/unclear').then(function (resp) {
$scope.unclear = resp.data;

@ -88,6 +88,9 @@
<button class="btn btn-success" type="button" ng-click="loadSettlementLogs()">
<i class="fa fa-search"></i> Search
</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>

Loading…
Cancel
Save