add citypartner support && upay application form

master
luoyang 5 years ago
parent 7dfb2f341b
commit 432ea24894

@ -1,88 +1,39 @@
package au.com.royalpay.payment.manage.citypartner.core.impls; package au.com.royalpay.payment.manage.citypartner.core.impls;
import java.io.IOException;
import java.io.OutputStream;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.swing.plaf.basic.BasicScrollPaneUI;
import au.com.royalpay.payment.manage.mappers.system.ClientBankAccountMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientRateMapper;
import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFFont;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.ss.usermodel.*;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.alibaba.fastjson.JSONObject;
import au.com.royalpay.payment.manage.citypartner.beans.AgentCommissionAnalysis; import au.com.royalpay.payment.manage.citypartner.beans.AgentCommissionAnalysis;
import au.com.royalpay.payment.manage.citypartner.beans.CityPartnerCommissionAnalysis; import au.com.royalpay.payment.manage.citypartner.beans.CityPartnerCommissionAnalysis;
import au.com.royalpay.payment.manage.citypartner.beans.ReferrerCommissionAnalysis; import au.com.royalpay.payment.manage.citypartner.beans.ReferrerCommissionAnalysis;
import au.com.royalpay.payment.manage.citypartner.core.CityPartnerPrizeService; import au.com.royalpay.payment.manage.citypartner.core.CityPartnerPrizeService;
import au.com.royalpay.payment.manage.mappers.financial.FinancialAgentCommissionDetailMapper; import au.com.royalpay.payment.manage.mappers.financial.*;
import au.com.royalpay.payment.manage.mappers.financial.FinancialAgentCommissionMapper;
import au.com.royalpay.payment.manage.mappers.financial.FinancialPartnerCommissionDetailMapper;
import au.com.royalpay.payment.manage.mappers.financial.FinancialPartnerCommissionMapper;
import au.com.royalpay.payment.manage.mappers.financial.FinancialReferrerCommissionDetailMapper;
import au.com.royalpay.payment.manage.mappers.financial.FinancialReferrerCommissionMapper;
import au.com.royalpay.payment.manage.mappers.financial.FinancialSeniorPartnerCommissionDetailMapper;
import au.com.royalpay.payment.manage.mappers.financial.FinancialSeniorPartnerCommissionMapper;
import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper; import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper;
import au.com.royalpay.payment.manage.mappers.system.OrgMapper; import au.com.royalpay.payment.manage.mappers.system.OrgMapper;
import au.com.royalpay.payment.tools.CommonConsts; import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.env.SysConfigManager; import au.com.royalpay.payment.tools.env.SysConfigManager;
import au.com.royalpay.payment.tools.exceptions.BadRequestException; import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.exceptions.ServerErrorException; import au.com.royalpay.payment.tools.exceptions.ServerErrorException;
import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils; import org.apache.commons.lang3.time.DateUtils;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFFont;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.ss.usermodel.*;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.*;
import java.util.Calendar; import java.util.stream.Collectors;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.annotation.Resource;
/** /**
* Created by yixian on 2017-03-08. * Created by yixian on 2017-03-08.
@ -476,6 +427,7 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService {
BigDecimal total_surage = BigDecimal.ZERO; BigDecimal total_surage = BigDecimal.ZERO;
BigDecimal net_surage = BigDecimal.ZERO; BigDecimal net_surage = BigDecimal.ZERO;
BigDecimal royalpay_surage = BigDecimal.ZERO; BigDecimal royalpay_surage = BigDecimal.ZERO;
BigDecimal transaction_fee = BigDecimal.ZERO;
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
String channel = oneChannel.getKey(); String channel = oneChannel.getKey();
if ("hf".equals(oneChannel.getKey().toLowerCase()) || "yeepay".equals(oneChannel.getKey().toLowerCase()) || "lakalapay".equals(oneChannel.getKey().toLowerCase())) { if ("hf".equals(oneChannel.getKey().toLowerCase()) || "yeepay".equals(oneChannel.getKey().toLowerCase()) || "lakalapay".equals(oneChannel.getKey().toLowerCase())) {
@ -491,7 +443,7 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService {
for (JSONObject params : oneChannel.getValue()) { for (JSONObject params : oneChannel.getValue()) {
BigDecimal tmpClearingAmount = params.getBooleanValue("customer_surcharge") ? params.getBigDecimal("settle_amount") : params.getBigDecimal("clearing_amount"); BigDecimal tmpClearingAmount = params.getBooleanValue("customer_surcharge") ? params.getBigDecimal("settle_amount") : params.getBigDecimal("clearing_amount");
BigDecimal channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal(channel.toLowerCase() + "_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)); BigDecimal channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal(channel.toLowerCase() + "_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
BigDecimal tmpTotalSurcharge = params.getBigDecimal("total_surcharge").subtract(params.getBigDecimal("surcharge_cashback")); BigDecimal tmpTotalSurcharge = params.getBigDecimal("total_surcharge").subtract(params.getBigDecimal("surcharge_cashback")).subtract(params.getBigDecimal("transaction_fee"));
//增加货币判断 //增加货币判断
int i = currencyScale(params.getString("clearing_currency")); int i = currencyScale(params.getString("clearing_currency"));
total = total.add(tmpClearingAmount); total = total.add(tmpClearingAmount);
@ -499,11 +451,13 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService {
royalpay_surage = royalpay_surage.add(tmpClearingAmount.multiply(channelRate).setScale(i, RoundingMode.HALF_UP)); royalpay_surage = royalpay_surage.add(tmpClearingAmount.multiply(channelRate).setScale(i, RoundingMode.HALF_UP));
// net_surage = net_surage.add(getThirdPartyCharge(params.getString("channel"), params.getBigDecimal("clearing_amount"), channelCharge)); // net_surage = net_surage.add(getThirdPartyCharge(params.getString("channel"), params.getBigDecimal("clearing_amount"), channelCharge));
net_surage = net_surage.add(params.getBigDecimal("channel_surcharge")); net_surage = net_surage.add(params.getBigDecimal("channel_surcharge"));
transaction_fee = transaction_fee.add(params.getBigDecimal("transaction_fee"));
} }
BigDecimal org_charge = total_surage.subtract(royalpay_surage); BigDecimal org_charge = total_surage.subtract(royalpay_surage);
json.put("channel", oneChannel.getKey()); json.put("channel", oneChannel.getKey());
json.put("gross_amount", total); json.put("gross_amount", total);
json.put("total_charge", total_surage); json.put("total_charge", total_surage);
json.put("transaction_fee", transaction_fee);
json.put("net_charge", net_surage); json.put("net_charge", net_surage);
json.put("org_rate", orgInfo.getBigDecimal(channel.toLowerCase() + "_rate_value")); json.put("org_rate", orgInfo.getBigDecimal(channel.toLowerCase() + "_rate_value"));
json.put("royalpay_charge", royalpay_surage); json.put("royalpay_charge", royalpay_surage);
@ -525,6 +479,7 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService {
BigDecimal net_surage = BigDecimal.ZERO; BigDecimal net_surage = BigDecimal.ZERO;
BigDecimal royalpay_surage = BigDecimal.ZERO; BigDecimal royalpay_surage = BigDecimal.ZERO;
BigDecimal share_surage = BigDecimal.ZERO; BigDecimal share_surage = BigDecimal.ZERO;
BigDecimal transaction_fee = BigDecimal.ZERO;
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
String channel = oneChannel.getKey(); String channel = oneChannel.getKey();
@ -534,7 +489,7 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService {
for (JSONObject params : oneChannel.getValue()) { for (JSONObject params : oneChannel.getValue()) {
BigDecimal tmpClearingAmount = params.getBooleanValue("customer_surcharge") ? params.getBigDecimal("settle_amount") : params.getBigDecimal("clearing_amount"); BigDecimal tmpClearingAmount = params.getBooleanValue("customer_surcharge") ? params.getBigDecimal("settle_amount") : params.getBigDecimal("clearing_amount");
BigDecimal channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal(channel.toLowerCase() + "_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)); BigDecimal channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal(channel.toLowerCase() + "_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
BigDecimal tmpTotalSurcharge = params.getBigDecimal("total_surcharge").subtract(params.getBigDecimal("surcharge_cashback")); BigDecimal tmpTotalSurcharge = params.getBigDecimal("total_surcharge").subtract(params.getBigDecimal("surcharge_cashback")).subtract(params.getBigDecimal("transaction_fee"));
//增加货币判断 //增加货币判断
int i = currencyScale(params.getString("clearing_currency")); int i = currencyScale(params.getString("clearing_currency"));
BigDecimal parent_surage = tmpClearingAmount.multiply(parentOrgInfo.getBigDecimal(channel.toLowerCase() + "_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)).setScale(i, RoundingMode.HALF_UP); BigDecimal parent_surage = tmpClearingAmount.multiply(parentOrgInfo.getBigDecimal(channel.toLowerCase() + "_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)).setScale(i, RoundingMode.HALF_UP);
@ -545,6 +500,7 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService {
//net_surage = net_surage.add(getThirdPartyCharge(params.getString("channel"), params.getBigDecimal("clearing_amount"), channelCharge)); //net_surage = net_surage.add(getThirdPartyCharge(params.getString("channel"), params.getBigDecimal("clearing_amount"), channelCharge));
net_surage = net_surage.add(params.getBigDecimal("channel_surcharge")); net_surage = net_surage.add(params.getBigDecimal("channel_surcharge"));
share_surage = share_surage.add(roy_surage.subtract(parent_surage)).setScale(i, RoundingMode.HALF_UP); share_surage = share_surage.add(roy_surage.subtract(parent_surage)).setScale(i, RoundingMode.HALF_UP);
transaction_fee = transaction_fee.add(params.getBigDecimal("transaction_fee"));
} }
BigDecimal org_charge = total_surage.subtract(royalpay_surage); BigDecimal org_charge = total_surage.subtract(royalpay_surage);
@ -556,6 +512,7 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService {
json.put("partner_charge", royalpay_surage); json.put("partner_charge", royalpay_surage);
json.put("share_charge", share_surage); json.put("share_charge", share_surage);
json.put("org_charge", org_charge); json.put("org_charge", org_charge);
json.put("transaction_fee", transaction_fee);
json.put("commission_type", "1"); json.put("commission_type", "1");
json.put("create_time", new Date()); json.put("create_time", new Date());
amountByChannel.add(json); amountByChannel.add(json);
@ -579,6 +536,7 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService {
BigDecimal total_surage = BigDecimal.ZERO; BigDecimal total_surage = BigDecimal.ZERO;
BigDecimal net_surage = BigDecimal.ZERO; BigDecimal net_surage = BigDecimal.ZERO;
BigDecimal royalpay_surage = BigDecimal.ZERO; BigDecimal royalpay_surage = BigDecimal.ZERO;
BigDecimal transaction_fee = BigDecimal.ZERO;
Date datefrom = new Date(); Date datefrom = new Date();
Date dateto = new Date(); Date dateto = new Date();
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
@ -617,6 +575,7 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService {
royalpay_surage = royalpay_surage.add(tmpClearingAmount.multiply(channelRate).setScale(i, RoundingMode.HALF_UP)); royalpay_surage = royalpay_surage.add(tmpClearingAmount.multiply(channelRate).setScale(i, RoundingMode.HALF_UP));
//net_surage = net_surage.add(getThirdPartyCharge(params.getString("channel"), params.getBigDecimal("clearing_amount"), channelCharge)); //net_surage = net_surage.add(getThirdPartyCharge(params.getString("channel"), params.getBigDecimal("clearing_amount"), channelCharge));
net_surage = net_surage.add(params.getBigDecimal("channel_surcharge")); net_surage = net_surage.add(params.getBigDecimal("channel_surcharge"));
transaction_fee = transaction_fee.add(params.getBigDecimal("transaction_fee"));
} }
BigDecimal org_charge = total_surage.subtract(royalpay_surage); BigDecimal org_charge = total_surage.subtract(royalpay_surage);
if (channel.toLowerCase().equals("alipay_direct")) { if (channel.toLowerCase().equals("alipay_direct")) {
@ -642,6 +601,7 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService {
json.put("org_net_charge", net_surage); json.put("org_net_charge", net_surage);
} }
json.put("org_charge", org_charge); json.put("org_charge", org_charge);
json.put("transaction_fee", transaction_fee);
json.put("commission_type", "1"); json.put("commission_type", "1");
json.put("create_time", new Date()); json.put("create_time", new Date());
json.put("date_from", DateFormatUtils.format(datefrom, "yyyy-MM-dd")); json.put("date_from", DateFormatUtils.format(datefrom, "yyyy-MM-dd"));
@ -825,6 +785,7 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService {
temp.put("total_charge", 0); temp.put("total_charge", 0);
temp.put("royalpay_charge", 0); temp.put("royalpay_charge", 0);
temp.put("org_charge", 0); temp.put("org_charge", 0);
temp.put("transaction_fee", 0);
temp.put("share_charge", 0); temp.put("share_charge", 0);
temp.put("channel", channel.getString("channel")); temp.put("channel", channel.getString("channel"));
temp.put("net_charge", 0); temp.put("net_charge", 0);
@ -839,28 +800,8 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService {
mineCommission.put("share_charge", mineCommission.getBigDecimal("share_charge").subtract(channel.getBigDecimal("share_charge"))); mineCommission.put("share_charge", mineCommission.getBigDecimal("share_charge").subtract(channel.getBigDecimal("share_charge")));
financialPartnerCommissionMapper.update(mineCommission); financialPartnerCommissionMapper.update(mineCommission);
} }
channel.put("month", month);
channel.put("year", year);
channel.put("org_id", orgId);
//撤销agent表
// financialAgentCommissionMapper.save(channel);
} }
} }
//撤销agent表
// Map<Integer, List<JSONObject>> groupByClientMap = transactionDetail.stream().collect(Collectors.groupingBy(e -> e.getInteger("client_id")));
// for (Map.Entry<Integer, List<JSONObject>> oneClient : groupByClientMap.entrySet()) {
//
// JSONObject org = orgMapper.findOne(oneClient.getValue().get(0).getInteger("org_id"));
// Map<String, List<JSONObject>> groupByChannel = oneClient.getValue().stream().collect(Collectors.groupingBy(e -> e.getString("channel")));
//
// List<JSONObject> clientChannelAmount = clientChannelAmount(oneClient.getKey(),org, groupByChannel, channelCharge,year,month,2);
// for (JSONObject channel : clientChannelAmount) {
// financialAgentCommissionDetailMapper.save(channel);
// }
//
// }
} }
@Override @Override

@ -19,6 +19,7 @@ public class ClientMWAuthFilesInfo {
private String kyc_utility_bill_file; private String kyc_utility_bill_file;
private String upay_risk_level; private String upay_risk_level;
private String upay_risk_remark; private String upay_risk_remark;
private String upay_application_form;
public JSONObject toJson(){ public JSONObject toJson(){
return (JSONObject)JSONObject.toJSON(this); return (JSONObject)JSONObject.toJSON(this);
@ -130,4 +131,12 @@ public class ClientMWAuthFilesInfo {
public void setKyc_utility_bill_file(String kyc_utility_bill_file) { public void setKyc_utility_bill_file(String kyc_utility_bill_file) {
this.kyc_utility_bill_file = kyc_utility_bill_file; this.kyc_utility_bill_file = kyc_utility_bill_file;
} }
public void setUpay_application_form(String upay_application_form) {
this.upay_application_form = upay_application_form;
}
public String getUpay_application_form() {
return upay_application_form;
}
} }

@ -3932,6 +3932,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
updateSysMWClientFiles(manager, clientId, UPayAuthFileEnum.UPAY_PROMOTIONAL_OFFER.getFileName(), filesInfo.getUpay_promotional_offer()); updateSysMWClientFiles(manager, clientId, UPayAuthFileEnum.UPAY_PROMOTIONAL_OFFER.getFileName(), filesInfo.getUpay_promotional_offer());
updateSysMWClientFiles(manager, clientId, UPayAuthFileEnum.UPAY_TERMS_CONDITIONS.getFileName(), filesInfo.getUpay_terms_conditions()); updateSysMWClientFiles(manager, clientId, UPayAuthFileEnum.UPAY_TERMS_CONDITIONS.getFileName(), filesInfo.getUpay_terms_conditions());
updateSysMWClientFiles(manager, clientId, UPayAuthFileEnum.KYC_UTILITY_BILL_FILE.getFileName(), filesInfo.getKyc_utility_bill_file()); updateSysMWClientFiles(manager, clientId, UPayAuthFileEnum.KYC_UTILITY_BILL_FILE.getFileName(), filesInfo.getKyc_utility_bill_file());
updateSysMWClientFiles(manager, clientId, UPayAuthFileEnum.UPAY_APPLICATION_FORM.getFileName(), filesInfo.getUpay_application_form());
} catch (Exception e) { } catch (Exception e) {
logger.error("上传合规文件失败", e); logger.error("上传合规文件失败", e);
} }

@ -11,7 +11,8 @@ public enum UPayAuthFileEnum {
UPAY_OFFER_LETTER("upay_offer_letter"), UPAY_OFFER_LETTER("upay_offer_letter"),
UPAY_PROMOTIONAL_OFFER("upay_promotional_offer"), UPAY_PROMOTIONAL_OFFER("upay_promotional_offer"),
UPAY_TERMS_CONDITIONS("upay_terms_conditions"), UPAY_TERMS_CONDITIONS("upay_terms_conditions"),
KYC_UTILITY_BILL_FILE("kyc_utility_bill_file"); KYC_UTILITY_BILL_FILE("kyc_utility_bill_file"),
UPAY_APPLICATION_FORM("upay_application_form");
private final String fileName; private final String fileName;
@ -33,6 +34,7 @@ public enum UPayAuthFileEnum {
UPAY_OFFER_LETTER.getFileName(), UPAY_OFFER_LETTER.getFileName(),
UPAY_PROMOTIONAL_OFFER.getFileName(), UPAY_PROMOTIONAL_OFFER.getFileName(),
UPAY_TERMS_CONDITIONS.getFileName(), UPAY_TERMS_CONDITIONS.getFileName(),
KYC_UTILITY_BILL_FILE.getFileName()}; KYC_UTILITY_BILL_FILE.getFileName(),
UPAY_APPLICATION_FORM.getFileName()};
} }
} }

@ -940,6 +940,7 @@
t.transaction_time, t.transaction_time,
if(t.transaction_type = 'Credit', t.clearing_amount, -t.clearing_amount) clearing_amount, 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.total_surcharge, -t.total_surcharge) total_surcharge,
if(t.transaction_type = 'Credit', t.transaction_fee, -t.transaction_fee) transaction_fee,
if(t.transaction_type = 'Credit', t.channel_surcharge, -t.channel_surcharge) channel_surcharge, if(t.transaction_type = 'Credit', t.channel_surcharge, -t.channel_surcharge) channel_surcharge,
if(t.transaction_type = 'Credit', t.settle_amount, -t.settle_amount) settle_amount, if(t.transaction_type = 'Credit', t.settle_amount, -t.settle_amount) settle_amount,
t.order_id, t.order_id,
@ -967,12 +968,13 @@
t.transaction_time, t.transaction_time,
if(t.transaction_type = 'Credit', t.clearing_amount, -t.clearing_amount) clearing_amount, 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.total_surcharge, -t.total_surcharge) total_surcharge,
if(t.transaction_type = 'Credit', t.transaction_fee, -t.transaction_fee) transaction_fee,
if(t.transaction_type = 'Credit', t.channel_surcharge, -t.channel_surcharge) channel_surcharge, if(t.transaction_type = 'Credit', t.channel_surcharge, -t.channel_surcharge) channel_surcharge,
if(t.transaction_type = 'Credit', t.settle_amount, -t.settle_amount) settle_amount, if(t.transaction_type = 'Credit', t.settle_amount, -t.settle_amount) settle_amount,
t.order_id, t.order_id,
t.org_rate, t.org_rate,
t.surcharge_cashback, t.surcharge_cashback,
o.customer_surcharge o.customer_surcharge,
from pmt_transactions t from pmt_transactions t
LEFT JOIN pmt_orders o on o.order_id = t.order_id LEFT JOIN pmt_orders o on o.order_id = t.order_id
INNER JOIN sys_org so ON t.org_id = so.org_id AND so.is_valid = 1 INNER JOIN sys_org so ON t.org_id = so.org_id AND so.is_valid = 1

@ -3672,6 +3672,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.letterIsImage = true; $scope.letterIsImage = true;
$scope.promotionalIsImage = true; $scope.promotionalIsImage = true;
$scope.termsIsImage = true; $scope.termsIsImage = true;
$scope.applicationIsImage = true;
if ($scope.file.client_bank_file && $scope.file.client_bank_file.endsWith('pdf')) { if ($scope.file.client_bank_file && $scope.file.client_bank_file.endsWith('pdf')) {
$scope.bankIsImage = false; $scope.bankIsImage = false;
} }
@ -3702,8 +3703,38 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
if ($scope.file.upay_terms_conditions && $scope.file.upay_terms_conditions.endsWith('pdf')) { if ($scope.file.upay_terms_conditions && $scope.file.upay_terms_conditions.endsWith('pdf')) {
$scope.termsIsImage = false; $scope.termsIsImage = false;
} }
if ($scope.file.upay_application_form && $scope.file.upay_application_form.endsWith('pdf')) {
$scope.applicationIsImage = false;
}
$scope.uploadApplicationFile = function (file) {
if (file != null) {
if (file.size > 3 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'})
} else {
$scope.applicationFileProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
$scope.uploadFile = {};
delete $scope.applicationFileProgress;
$scope.file.upay_application_form = resp.data.url;
$scope.uploadFile.upay_application_form = resp.data.url;
$scope.updateFile();
if ($scope.file.upay_application_form.endsWith('pdf')) {
$scope.bankIsImage = false;
} else {
$scope.bankIsImage = true;
}
}, function (resp) {
delete $scope.applicationFileProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.applicationFileProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
$scope.uploadBankFile = function (file) { $scope.uploadBankFile = function (file) {
if (file != null) { if (file != null) {
if (file.size > 3 * 1024 * 1024) { if (file.size > 3 * 1024 * 1024) {

@ -65,6 +65,23 @@
<button class="btn btn-danger" ng-click="cancelIdInfo()">取消</button> <button class="btn btn-danger" ng-click="cancelIdInfo()">取消</button>
</div> </div>
</div> </div>
<div class="form-group">
<label class="control-label col-sm-2">* Application Form | 商户申请表</label>
<div class="col-sm-4">
<div class="form-control-static">
<button class="btn btn-primary" type="button"
ngf-select="uploadApplicationFile($file)">
<i class="fa fa-upload"></i> Upload
</button>
<i class="fa fa-check-square-o check-i" aria-hidden="true" style="float: none" ng-if="$root.complianceCheck.authFile"></i>
<a role="button" download="" target="_blank" class="btn-group btn btn-warning" type="button" href="{{file.upay_application_form}}" ><i class="fa fa-download"></i></a>
</div>
<uib-progressbar value="applicationFileProgress.value" ng-if="applicationFileProgress"></uib-progressbar>
<a ng-if="applicationIsImage" target="_blank" ng-href="{{file.upay_application_form}}">
<img ng-src="{{file.upay_application_form}}"class="col-sm-6" onerror="this.src='/static/images/file_close.png'">
</a>
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-2">* Six Months Bank Statement | 六个月银行对账单</label> <label class="control-label col-sm-2">* Six Months Bank Statement | 六个月银行对账单</label>
<div class="col-sm-4"> <div class="col-sm-4">

Loading…
Cancel
Save