Merge remote-tracking branch 'origin/master'

master
yixian 6 years ago
commit 2e8ba2ab29

@ -106,60 +106,7 @@
* @apiError (ERROR_CODE) ORDER_NOT_EXIST 订单不存在 * @apiError (ERROR_CODE) ORDER_NOT_EXIST 订单不存在
* @apiError (ERROR_CODE) ORDER_MISMATCH 订单号与商户不匹配 * @apiError (ERROR_CODE) ORDER_MISMATCH 订单号与商户不匹配
*/ */
/**
* @api {PUT} /api/v1.0/h5_payment/partners/{partner_code}/orders/{order_id} 创建H5支付单
* @apiName NewMobileH5Pay
* @apiGroup MobileH5
* @apiVersion 1.0.0
* @apiDescription
* <b>注意微信H5支付接口必须单独申请腾讯批复后方可使用有需要的商户请联系RoyalPay客服支付宝无此限制</b><br>
* H5支付适用场景为移动端App或者手机自带浏览器进行支付用户下单后浏览器跳转至微信支付页面并自动拉起微信/支付宝客户端完成支付<br>
* 返回值包括跳转支付地址跳转支付页需要带上签名信息
* 货币类型如果是CNY注意通过汇率转换后不得低于0.01AUD否则订单可以创建成功但支付时会报金额不合法错误<br>
* <img src="img/h5_api_payment.jpg">
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
* @apiParam (PathVariable) {String} partner_code 必填商户编码由4位大写字母或数字构成
* @apiParam (PathVariable) {String} order_id 必填商户支付订单号要求同一商户唯一
* @apiUse Sign
* @apiParam (JSON) {String} description 必填订单标题最大长度128字符超出自动截取
* @apiParam (JSON) {int} price 必填金额单位为货币最小单位例如使用100表示AUD1.00
* @apiParam (JSON) {String=AUD,CNY} currency=AUD 币种代码
* @apiParam (JSON) {String=Alipay,Wechat} channel 支付渠道大小写敏感
* @apiParam (JSON) {String} notify_url 支付通知url详见支付通知api不填则不会推送支付通知
* @apiParam (JSON) {String} operator 操作人员标识
*
* @apiSuccess {String} return_code 执行结果
* @apiSuccess {String} result_code SUCCESS表示创建订单成功EXISTS表示订单已存在
* @apiSuccess {String} partner_code 商户编码
* @apiSuccess {String} channel 支付渠道
* @apiSuccess {String} full_name 商户注册全名
* @apiSuccess {String} partner_name 商户名称
* @apiSuccess {String} order_id RoyalPay订单ID同时也是微信订单ID最终支付成功的订单ID可能不同
* @apiSuccess {String} partner_order_id 商户订单ID
* @apiSuccess {String} pay_url 跳转URL
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_MISMATCH 订单号与商户不匹配
* @apiError (ERROR_CODE) ORDER_PAID 订单已支付
*
*/
/**
* @api {GET} /api/v1.0/h5_payment/partners/{partner_code}/orders/{order_id}/pay H5支付跳转页
* @apiName MobileH5Pay
* @apiDescription 必须先调用创建H5支付订单接口再进行跳转
* 建议在用户回调到对应页时通过后台查询订单状态接口确认订单的支付状态
* @apiVersion 1.0.0
* @apiGroup MobileH5
* @apiParam (PathVariable) {String} partner_code 必填商户编码由4位大写字母或数字构成
* @apiParam (PathVariable) {String} order_id 必填商户支付订单号要求已预先创建
* @apiUse Sign
* @apiParam (QueryParam) {String} redirect 必填支付成功后跳转页面回调时会带上签名参数用于校验
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_NOT_EXIST 订单不存在
* @apiError (ERROR_CODE) ORDER_MISMATCH 订单号与商户不匹配
*/
/** /**
* @api {PUT} /api/v1.0/jsapi_gateway/partners/{partner_code}/orders/{order_id} 创建JSAPI订单 * @api {PUT} /api/v1.0/jsapi_gateway/partners/{partner_code}/orders/{order_id} 创建JSAPI订单

@ -109,62 +109,7 @@
* @apiError (ERROR_CODE) ORDER_NOT_EXIST Order does not exist * @apiError (ERROR_CODE) ORDER_NOT_EXIST Order does not exist
* @apiError (ERROR_CODE) ORDER_MISMATCH Order is not belong to this partner * @apiError (ERROR_CODE) ORDER_MISMATCH Order is not belong to this partner
*/ */
/**
* @api {PUT} /api/v1.0/h5_payment/partners/{partner_code}/orders/{order_id} Create H5 Payment
* @apiName NewMobileH5Pay
* @apiGroup MobileH5
* @apiVersion 1.0.0
* @apiDescription
* <b>WarningH5 Payment socket requires application separately and requires agreement from Tencent. Merchants who needs this socket please contact RoyalPay first.
* Alipay has no limit at the moment.</b><br>
* H5 Payment is used for payment in Webpage or App on mobile outside WeChat or Alipay App. The browser would redirect to a webpage from WeChat or Alipay and call the App to finish the payment.<br>
* Return value contains a payment page. Partners shall guide users to redirect to this page. Sign params are required.
* If the currency is CNY, equivalent AUD amount shall never less than 0.01AUD,
* otherwise user will get Invalid Amount Error from WeChat when making the payment.<br>
* <img src="img/h5_api_payment.jpg">
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
* @apiParam (PathVariable) {String} partner_code Required, Partner code
* @apiParam (PathVariable) {String} order_id Required, Partner order id
* @apiUse Sign
* @apiParam (JSON) {String} description Required, Order description
* @apiParam (JSON) {int} price Required, Price of the order. Use the base unit of the currency.
* @apiParam (JSON) {String=AUD,CNY} currency=AUD currency
* @apiParam (JSON) {String=Alipay,Wechat} channel Payment channel, case sensitive
* @apiParam (JSON) {String} notify_url System will call the notify url if provided when the payment succeeds
* @apiParam (JSON) {String} operator Note for the operator who created this order.
*
* @apiSuccess {String} return_code Execution result
* @apiSuccess {String} result_code SUCCESS means order created successfully, EXISTS means order has already existed.
* @apiSuccess {String} partner_code Partner code
* @apiSuccess {String} channel Payment channel
* @apiSuccess {String} full_name Partner's full company name when registered
* @apiSuccess {String} partner_name Partner's name
* @apiSuccess {String} order_id Order id in RoyalPay, which is also WeChat order id.
* @apiSuccess {String} partner_order_id Partner order id
* @apiSuccess {String} pay_url Payment page in RoyalPay.
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_MISMATCH Order is not belong to this partner
* @apiError (ERROR_CODE) ORDER_PAID Order has already been paid
*
*/
/**
* @api {GET} /api/v1.0/h5_payment/partners/{partner_code}/orders/{order_id}/pay H5 Payment Page
* @apiName MobileH5Pay
* @apiDescription This page mush be called after payment order has been created.
* When jumping back to redirection URL, it is recommended to call the order query API to make sure the payment has succeeded.
* @apiVersion 1.0.0
* @apiGroup MobileH5
* @apiParam (PathVariable) {String} partner_code Required, Partner code
* @apiParam (PathVariable) {String} order_id Required, Partner order id. It shall have already been created
* @apiUse Sign
* @apiParam (QueryParam) {String} redirect Required, Redirect url when payment succeeded. Contain sign parameters for validation.
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_NOT_EXIST Order does not exist
* @apiError (ERROR_CODE) ORDER_MISMATCH Order is not belong to this partner
*/
/** /**
* @api {PUT} /api/v1.0/jsapi_gateway/partners/{partner_code}/orders/{order_id} Create JSAPI Payment Order * @api {PUT} /api/v1.0/jsapi_gateway/partners/{partner_code}/orders/{order_id} Create JSAPI Payment Order

@ -62,7 +62,7 @@ public class AnalysisBean {
if (bd_id != null){ if (bd_id != null){
params.put("bd_id",bd_id); params.put("bd_id",bd_id);
} }
if (org_id !=null){ if (org_id != null){
params.put("org_id",org_id); params.put("org_id",org_id);
} }
if (begin_month != null){ if (begin_month != null){
@ -71,25 +71,25 @@ public class AnalysisBean {
if (end_month != null){ if (end_month != null){
params.put("end_month",end_month); params.put("end_month",end_month);
} }
if (customer_id!=null && !customer_id.isEmpty()){ if (customer_id != null && !customer_id.isEmpty()){
params.put("customer_id",customer_id.trim()); params.put("customer_id", customer_id.trim());
} }
if (rankType!=null){ if (rankType != null){
params.put("rankType",rankType); params.put("rankType", rankType);
} }
if(channel!=null){ if(channel != null){
params.put("channel",channel); params.put("channel", channel);
} }
if(bd_name!=null){ if(bd_name != null){
params.put("bd_name",bd_name); params.put("bd_name", bd_name);
} }
if (client_moniker!=null){ if (client_moniker != null){
params.put("client_moniker", client_moniker); params.put("client_moniker", client_moniker);
} }
if (amount_from!=null && amount_from.length()>0){ if (amount_from != null && amount_from.length() > 0){
params.put("amount_from", new BigDecimal(amount_from)); params.put("amount_from", new BigDecimal(amount_from));
} }
if (amount_to!=null && amount_to.length()>0){ if (amount_to != null && amount_to.length() > 0){
params.put("amount_to", new BigDecimal(amount_to)); params.put("amount_to", new BigDecimal(amount_to));
} }
return params; return params;

@ -24,7 +24,7 @@ public interface DashboardService {
List<JSONObject> getTopTradePartners(JSONObject params, int limit); List<JSONObject> getTopTradePartners(JSONObject params, int limit);
List<JSONObject> getTopTradePartners(JSONObject params); List<JSONObject> getTopTradePartnersNew(JSONObject params);
List<JSONObject> getTradeAnalysisInHours(JSONObject params); List<JSONObject> getTradeAnalysisInHours(JSONObject params);

@ -14,5 +14,7 @@ public interface PlatformClearService {
void generateSettleLogs(); void generateSettleLogs();
void generateAliPaySettleLogs();
void doVerifyHFSettleLog(JSONObject param); void doVerifyHFSettleLog(JSONObject param);
} }

@ -40,7 +40,7 @@ public class ChannelsAnalysisServiceImpl implements ChannelsAnalysisService {
} }
List<JSONObject> list = new ArrayList<>(); List<JSONObject> list = new ArrayList<>();
Map<Date,JSONObject> analysisMap = new TreeMap<>(); Map<Date,JSONObject> analysisMap = new TreeMap<>();
String[] channels = {"Wechat","Bestpay","Alipay","jd","AlipayOnline","hf"}; String[] channels = {"Wechat","Bestpay","Alipay","jd","AlipayOnline","hf", "Rpay"};
for (String channel:channels){ for (String channel:channels){
analysisChannelCustomers(params, analysisMap, channel); analysisChannelCustomers(params, analysisMap, channel);
} }

@ -78,6 +78,7 @@ public class CustomersAnalysisServiceImp implements CustomersAnalysisService {
PageList<JSONObject> logs = orderAnalysisMapper.listCustomersData(params, new PageBounds(page, limit, Order.formString("amount.desc"))); PageList<JSONObject> logs = orderAnalysisMapper.listCustomersData(params, new PageBounds(page, limit, Order.formString("amount.desc")));
JSONObject result = PageListUtils.buildPageListResult(logs); JSONObject result = PageListUtils.buildPageListResult(logs);
result.put("analysis", orderAnalysisMapper.listCustomersDataAnalysis(params)); result.put("analysis", orderAnalysisMapper.listCustomersDataAnalysis(params));
result.put("openid_type", params.getIntValue("openid_type"));
return result; return result;
} }

@ -102,7 +102,10 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT
} }
JSONObject res = new JSONObject(); JSONObject res = new JSONObject();
res.put("new_partners", clientAnalysisMapper.countNewClients(params)); res.put("new_partners", clientAnalysisMapper.countNewClients(params));
res.put("total_partners", clientAnalysisMapper.countClients(params));
//res.put("total_partners", clientAnalysisMapper.countClients(params));
// 统计所有的商户,包括禁用的
res.put("total_partners", clientAnalysisMapper.countClientsAll(params));
stringRedisTemplate.boundValueOps("org_commonAnalysis3"+params.getString("org_id")+params.getString("begin")).set(res.toJSONString(), 5, TimeUnit.MINUTES); stringRedisTemplate.boundValueOps("org_commonAnalysis3"+params.getString("org_id")+params.getString("begin")).set(res.toJSONString(), 5, TimeUnit.MINUTES);
return res; return res;
} }
@ -145,7 +148,7 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT
return commonAnalysis4; return commonAnalysis4;
} }
JSONObject res = new JSONObject(); JSONObject res = new JSONObject();
List<JSONObject> topOrders = transactionAnalysisMapper.getTopOrders(params, new PageBounds(1, 1, Order.formString("aud_fee.desc"))); List<JSONObject> topOrders = transactionAnalysisMapper.getTopOrders(params);
if (!topOrders.isEmpty()) { if (!topOrders.isEmpty()) {
res.put("top_amount_order", topOrders.get(0)); res.put("top_amount_order", topOrders.get(0));
} }
@ -158,18 +161,18 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT
return transactionAnalysisMapper.getTradeAmountInTypes(params); return transactionAnalysisMapper.getTradeAmountInTypes(params);
} }
@Override @Override
public List<JSONObject> getTopTradePartners(JSONObject params, int limit) { public List<JSONObject> getTopTradePartners(JSONObject params, int limit) {
return clientAnalysisMapper.listPartnersTradeAmount(params, new PageBounds(1, limit, Order.formString("aud_fee.desc"))); return clientAnalysisMapper.listPartnersTradeAmount(params,
new PageBounds(1, limit, Order.formString("aud_fee.desc")));
} }
@Override @Override
public List<JSONObject> getTopTradePartners(JSONObject params) { public List<JSONObject> getTopTradePartnersNew(JSONObject params) {
String rankType = "aud_fee"; params.putIfAbsent("rankType", "aud_fee");
if (params.getString("rankType")!=null){ return clientAnalysisMapper.listPartnersTradeAmountNew(params);
rankType = params.getString("rankType");
}
return clientAnalysisMapper.listPartnersTradeAmount(params, new PageBounds(Order.formString(rankType+".desc")));
} }
@Override @Override
@ -553,7 +556,7 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT
} }
} }
private JSONObject getTodayChannelCount(JSONObject params){ private JSONObject getTodayChannelCount(JSONObject params){
String[] channels = new String[]{"Bestpay","Wechat","Alipay","jd","AlipayOnline","hf"}; String[] channels = new String[]{"Bestpay","Wechat","Alipay","jd","AlipayOnline","hf", "Rpay"};
JSONObject resp = new JSONObject(); JSONObject resp = new JSONObject();
for(String channel:channels) { for(String channel:channels) {
params.put("channel", channel); params.put("channel", channel);

@ -127,6 +127,13 @@ public class PlatformClearAnalysisServiceImpl implements PlatformClearService {
generateAlipayOnlineSettleLogs(); generateAlipayOnlineSettleLogs();
} }
@Override
@Transactional
public void generateAliPaySettleLogs() {
generateAlipaySettleLogs();
generateAlipayOnlineSettleLogs();
}
@Transactional @Transactional
public void generateWechatSettleLogs() { public void generateWechatSettleLogs() {
try { try {
@ -138,7 +145,7 @@ public class PlatformClearAnalysisServiceImpl implements PlatformClearService {
} }
} }
public void generateAlipaySettleLogs() { private void generateAlipaySettleLogs() {
try { try {
List<Date> dateList = TimeZoneUtils.getStatetime(); List<Date> dateList = TimeZoneUtils.getStatetime();
for (Date dateStr : dateList) { for (Date dateStr : dateList) {
@ -154,7 +161,7 @@ public class PlatformClearAnalysisServiceImpl implements PlatformClearService {
} }
public void generateAlipayOnlineSettleLogs() { private void generateAlipayOnlineSettleLogs() {
try { try {
List<Date> dateList = TimeZoneUtils.getStatetime(); List<Date> dateList = TimeZoneUtils.getStatetime();
for (Date dateStr : dateList) { for (Date dateStr : dateList) {

@ -22,6 +22,9 @@ public interface ClientAnalysisMapper {
int countClients(JSONObject params); int countClients(JSONObject params);
// 统计所有的商户,包括禁用的
int countClientsAll(JSONObject params);
@AutoSql(type = SqlType.COUNT) @AutoSql(type = SqlType.COUNT)
@AdvanceSelect(addonWhereClause = "sub_merchant_id is not null") @AdvanceSelect(addonWhereClause = "sub_merchant_id is not null")
int countTotalPartners(); int countTotalPartners();
@ -30,6 +33,8 @@ public interface ClientAnalysisMapper {
List<JSONObject> countTradePartnersHistory(JSONObject params); List<JSONObject> countTradePartnersHistory(JSONObject params);
List<JSONObject> listPartnersTradeAmountNew(JSONObject params);
List<JSONObject> listPartnersTradeAmount(JSONObject params, PageBounds pageBounds); List<JSONObject> listPartnersTradeAmount(JSONObject params, PageBounds pageBounds);
List<JSONObject> countClientsTypes(JSONObject params); List<JSONObject> countClientsTypes(JSONObject params);

@ -33,7 +33,7 @@ public interface TransactionAnalysisMapper {
JSONObject getEarliestOrder(@Param("client_id") int client_id); JSONObject getEarliestOrder(@Param("client_id") int client_id);
List<JSONObject> getTopOrders(JSONObject params, PageBounds pagination); List<JSONObject> getTopOrders(JSONObject params);
List<JSONObject> getTradeAmountInTypes(JSONObject params); List<JSONObject> getTradeAmountInTypes(JSONObject params);

@ -67,22 +67,24 @@ public class DashboardController {
@ManagerMapping("/top_trade_partners") @ManagerMapping("/top_trade_partners")
public List<JSONObject> topTradePartners(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, public List<JSONObject> topTradePartners(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager,
@RequestParam(defaultValue = "10") int limit) { @RequestParam(defaultValue = "10") int limit) {
JSONObject params = analysis.toParams(analysis.getTimezone()); JSONObject params = analysis.toParams(analysis.getTimezone());
orgManager.checkOrg(manager,params); orgManager.checkOrg(manager, params);
return dashboardService.getTopTradePartners(params, limit); params.put("limit", limit);
return dashboardService.getTopTradePartnersNew(params);
} }
@ManagerMapping("/rank_trade_partners") @ManagerMapping("/rank_trade_partners")
public List<JSONObject> rankTradePartners(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { public List<JSONObject> rankTradePartners(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
JSONObject params = analysis.toParams(null); JSONObject params = analysis.toParams(null);
orgManager.checkOrg(manager,params); orgManager.checkOrg(manager, params);
if (analysis.isOnlyGroup() && ManagerRole.BD_LEADER.hasRole(manager.getIntValue("role"))) { if (analysis.isOnlyGroup() && ManagerRole.BD_LEADER.hasRole(manager.getIntValue("role"))) {
params.put("bd_group", manager.getString("manager_id")); params.put("bd_group", manager.getString("manager_id"));
if (analysis.getGroup_bd()>0){ if (analysis.getGroup_bd() > 0){
params.put("bd_group_bd",analysis.getGroup_bd()); params.put("bd_group_bd", analysis.getGroup_bd());
} }
} }
return dashboardService.getTopTradePartners(params); return dashboardService.getTopTradePartnersNew(params);
} }
@ManagerMapping("/trade_in_hours") @ManagerMapping("/trade_in_hours")

@ -80,7 +80,7 @@ public class BDPrizeServiceImpl implements BDPrizeService {
private static BigDecimal percent = new BigDecimal(100); private static BigDecimal percent = new BigDecimal(100);
private static String[] channels = new String[]{"Wechat", "Alipay", "Bestpay", "jd", "AlipayOnline","hf"}; private static String[] channels = new String[]{"Wechat", "Alipay", "Bestpay", "jd", "AlipayOnline","hf", "Rpay"};
private static Logger logger = LoggerFactory.getLogger(BDPrizeServiceImpl.class); private static Logger logger = LoggerFactory.getLogger(BDPrizeServiceImpl.class);
@Override @Override

@ -17,6 +17,9 @@ import org.springframework.web.util.UriComponentsBuilder;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
@Service @Service
public class CustomerLotteryCountServiceImpl implements ApplicationListener<AfterPaymentFinishEvent> { public class CustomerLotteryCountServiceImpl implements ApplicationListener<AfterPaymentFinishEvent> {
@ -39,9 +42,20 @@ public class CustomerLotteryCountServiceImpl implements ApplicationListener<Afte
@Override @Override
public void onApplicationEvent(AfterPaymentFinishEvent event) { public void onApplicationEvent(AfterPaymentFinishEvent event) {
final JSONObject order = event.getFinishedEvent().getOrder(); final JSONObject order = event.getFinishedEvent().getOrder();
//只允许pine商户参与该活动 //判断是否是pine测试商户若不是则判断是否在活动时间
if (order.getIntValue("client_id") != 9) { if (order.getIntValue("client_id") != 9) {
return; SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
Date newDay = new Date();
try {
if (newDay.compareTo(sdf.parse("2018-09-24 00:00:00")) < 0) {
return;
}
if (newDay.compareTo(sdf.parse("2018-10-15 00:00:00")) > 0) {
return;
}
} catch (ParseException e) {
}
} }
BigDecimal clearAmount = event.getFinishedEvent().getAudFee(); BigDecimal clearAmount = event.getFinishedEvent().getAudFee();
String channel = order.getString("channel"); String channel = order.getString("channel");

@ -23,6 +23,8 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.TimeZone; import java.util.TimeZone;
@ -284,7 +286,18 @@ public class CustomerPointsServiceImp implements CustomerPointsService {
public BigDecimal checkLotteryAfterPay(String order_id) { public BigDecimal checkLotteryAfterPay(String order_id) {
JSONObject order = transactionAnalysisMapper.getOrderClearAmount(order_id); JSONObject order = transactionAnalysisMapper.getOrderClearAmount(order_id);
if (order.getIntValue("client_id") != 9) { if (order.getIntValue("client_id") != 9) {
return BigDecimal.valueOf(0); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
Date newDay = new Date();
try {
if (newDay.compareTo(sdf.parse("2018-09-24 00:00:00")) < 0) {
return BigDecimal.valueOf(0);
}
if (newDay.compareTo(sdf.parse("2018-10-15 00:00:00")) > 0) {
return BigDecimal.valueOf(0);
}
} catch (ParseException e) {
}
} }
return order.getBigDecimal("clearing_amount"); return order.getBigDecimal("clearing_amount");
} }

@ -6,4 +6,6 @@ public interface HfUpdateService {
String updateStatus(); String updateStatus();
String rpayUpdate();
} }

@ -1,5 +1,6 @@
package au.com.royalpay.payment.manage.dev.core.impl; package au.com.royalpay.payment.manage.dev.core.impl;
import au.com.royalpay.payment.channels.rpay.runtime.RpayApi;
import au.com.royalpay.payment.manage.dev.core.HfUpdateService; import au.com.royalpay.payment.manage.dev.core.HfUpdateService;
import au.com.royalpay.payment.manage.mappers.system.ClientConfigMapper; import au.com.royalpay.payment.manage.mappers.system.ClientConfigMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientMapper; import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
@ -9,6 +10,8 @@ import au.com.royalpay.payment.tools.env.PlatformEnvironment;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
@ -23,6 +26,10 @@ public class HfUpdateImpl implements HfUpdateService {
private MpWechatApiProvider mpWechatApiProvider; private MpWechatApiProvider mpWechatApiProvider;
@Resource @Resource
private ClientConfigMapper clientConfigMapper; private ClientConfigMapper clientConfigMapper;
@Resource
private RpayApi rpayApi;
private Logger logger = LoggerFactory.getLogger(getClass());
@Override @Override
public String updateStatus() { public String updateStatus() {
@ -41,4 +48,19 @@ public class HfUpdateImpl implements HfUpdateService {
}); });
return "ok"; return "ok";
} }
@Override
public String rpayUpdate() {
List<JSONObject> clientIds = clientMapper.findByrpayNotNull();
StringBuffer sb = new StringBuffer();
clientIds.forEach(dbResult -> {
try {
rpayApi.modifySurchargeConfig(dbResult);
} catch (Exception e) {
sb.append("【" + dbResult.getString("client_moniker") + "】、");
}
});
logger.info("test for update rpay clearing date,fail + " + sb.toString());
return "ok";
}
} }

@ -1,7 +1,9 @@
package au.com.royalpay.payment.manage.dev.core.impl; package au.com.royalpay.payment.manage.dev.core.impl;
import au.com.royalpay.payment.channels.rpay.runtime.RpayApi;
import au.com.royalpay.payment.manage.dev.core.ManualService; import au.com.royalpay.payment.manage.dev.core.ManualService;
import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper; import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientRateMapper; import au.com.royalpay.payment.manage.mappers.system.ClientRateMapper;
import au.com.royalpay.payment.manage.merchants.core.ClientModifySupport; import au.com.royalpay.payment.manage.merchants.core.ClientModifySupport;
import au.com.royalpay.payment.manage.merchants.entity.impls.SwitchPermissionModify; import au.com.royalpay.payment.manage.merchants.entity.impls.SwitchPermissionModify;
@ -15,6 +17,7 @@ import org.apache.commons.lang3.time.DateUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import java.util.Date; import java.util.Date;
@ -40,6 +43,10 @@ public class ManualServiceimpl implements ManualService {
private SynchronizedScheduler synchronizedScheduler; private SynchronizedScheduler synchronizedScheduler;
@Resource @Resource
private ClientModifySupport clientModifySupport; private ClientModifySupport clientModifySupport;
@Resource
private RpayApi rpayApi;
@Resource
private ClientMapper clientMapper;
@Override @Override
public void clientPostpone() { public void clientPostpone() {
@ -70,24 +77,37 @@ public class ManualServiceimpl implements ManualService {
cleanDays = wechatRate.getIntValue("c_clean_days"); cleanDays = wechatRate.getIntValue("c_clean_days");
} }
int finalCleanDays = cleanDays; int finalCleanDays = cleanDays;
clientRates.forEach(o -> {
JSONObject record = clientRateMapper.latestExpiryConfig(client_id, o.getString("rate_name"));
record.remove("client_rate_id");
record.put("active_time", now);
record.put("manager_id", 0);
record.put("expiry_time", yearTomorrow);
record.put("create_time", now);
record.put("update_time", now);
record.put("clean_days", finalCleanDays);
record.put("manager_name", "System");
record.put("remark", "费率到期系统自动延期1年");
clientRateMapper.saveRate(record);
}); modifyClientRates(finalCleanDays,clientRates,client_id,p.getString("client_moniker"));
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(null, p.getString("client_moniker"), "tax_in_surcharge", false));
}); });
}); });
logger.info("end doing client postpone"); logger.info("end doing client postpone");
} }
@Transactional
public void modifyClientRates(int finalCleanDays,List<JSONObject> clientRates,int client_id,String client_moniker) {
Date now = new Date();
Date tomorrow = DateUtils.addDays(now, 1);
Date yearTomorrow = DateUtils.addYears(tomorrow, 1);
clientRates.forEach(o -> {
JSONObject record = clientRateMapper.latestExpiryConfig(client_id, o.getString("rate_name"));
record.remove("client_rate_id");
record.put("active_time", now);
record.put("manager_id", 0);
record.put("expiry_time", yearTomorrow);
record.put("create_time", now);
record.put("update_time", now);
record.put("clean_days", finalCleanDays);
record.put("manager_name", "System");
record.put("remark", "费率到期系统自动延期1年");
clientRateMapper.saveRate(record);
if ("Rpay".equals(o.getString("rate_name"))) {
rpayApi.modifySurchargeConfig(clientMapper.findClient(client_id));
}
});
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(null, client_moniker, "tax_in_surcharge", false));
}
} }

@ -4,6 +4,7 @@ import au.com.royalpay.payment.channels.alipay.config.AlipayEnvironment;
import au.com.royalpay.payment.channels.alipay.runtime.AlipayClient; import au.com.royalpay.payment.channels.alipay.runtime.AlipayClient;
import au.com.royalpay.payment.channels.bestpay.runtime.BestPayClient; import au.com.royalpay.payment.channels.bestpay.runtime.BestPayClient;
import au.com.royalpay.payment.channels.jd.runtime.JDClient; import au.com.royalpay.payment.channels.jd.runtime.JDClient;
import au.com.royalpay.payment.channels.rpay.runtime.RpayClient;
import au.com.royalpay.payment.channels.wechat.runtime.WxPayClient; import au.com.royalpay.payment.channels.wechat.runtime.WxPayClient;
import au.com.royalpay.payment.core.PaymentApi; import au.com.royalpay.payment.core.PaymentApi;
import au.com.royalpay.payment.core.exceptions.InvalidShortIdException; import au.com.royalpay.payment.core.exceptions.InvalidShortIdException;
@ -20,6 +21,7 @@ import au.com.royalpay.payment.manage.mappers.payment.OrderMapper;
import au.com.royalpay.payment.manage.mappers.payment.RefundMapper; import au.com.royalpay.payment.manage.mappers.payment.RefundMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientBankAccountMapper; import au.com.royalpay.payment.manage.mappers.system.ClientBankAccountMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientMapper; import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.manage.tradelog.core.TradeLogService; import au.com.royalpay.payment.manage.tradelog.core.TradeLogService;
import au.com.royalpay.payment.tools.CommonConsts; import au.com.royalpay.payment.tools.CommonConsts;
@ -55,6 +57,8 @@ import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.net.URISyntaxException; import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -96,6 +100,8 @@ public class TestController implements ApplicationEventPublisherAware {
@Resource @Resource
private JDClient jdClient; private JDClient jdClient;
@Resource @Resource
private RpayClient rpayClient;
@Resource
private TradeLogService tradeLogService; private TradeLogService tradeLogService;
@Resource @Resource
private RetailAppService retailAppService; private RetailAppService retailAppService;
@ -110,6 +116,9 @@ public class TestController implements ApplicationEventPublisherAware {
private HfClearAmountService hfClearAmountService; private HfClearAmountService hfClearAmountService;
@Resource @Resource
private HfUpdateService hfUpdateService; private HfUpdateService hfUpdateService;
@Resource
private ClientManager clientManager;
private final static String EMAIL = "lily.tao@royalpay.com.au,bella.sun@royalpay.com.au,astro.dai@royalpay.com.au,taylor.dang@royalpay.com.au";
@ManagerMapping(value = "/{clientMoniker}/export/agreepdf", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.DIRECTOR, ManagerRole.OPERATOR}) @ManagerMapping(value = "/{clientMoniker}/export/agreepdf", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.DIRECTOR, ManagerRole.OPERATOR})
public void exportAgreeFile(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, HttpServletResponse httpResponse) throws Exception { public void exportAgreeFile(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, HttpServletResponse httpResponse) throws Exception {
@ -292,6 +301,11 @@ public class TestController implements ApplicationEventPublisherAware {
xmlStr = XmlFormatUtils.formatXml(elem); xmlStr = XmlFormatUtils.formatXml(elem);
res.put("xml", xmlStr); res.put("xml", xmlStr);
break; break;
case "Rpay":
JSONObject orderInfo = rpayClient.queryOrderStatus(orderId);
String rpayjson = JSON.toJSONString(orderInfo, SerializerFeature.PrettyFormat);
res.put("xml", rpayjson);
break;
default: default:
throw new BadRequestException("Not Support channel:" + channel); throw new BadRequestException("Not Support channel:" + channel);
} }
@ -403,4 +417,21 @@ public class TestController implements ApplicationEventPublisherAware {
public String hfClearAmount() { public String hfClearAmount() {
return hfUpdateService.updateStatus(); return hfUpdateService.updateStatus();
} }
@ManagerMapping(value = "/rpayUpdate", method = RequestMethod.PUT, role = ManagerRole.DEVELOPER)
public String rpayUpdateClearing() {
return hfUpdateService.rpayUpdate();
}
@ManagerMapping(value = "/partner/reset_password", method = RequestMethod.GET, role = ManagerRole.DEVELOPER)
public void resetPartnerPassword() {
final List<String> emails = new ArrayList<>();
List<String> emailList = Arrays.asList(EMAIL.split(","));
emailList.stream().forEach(email -> {
if (!emails.contains(email)) {
emails.add(email);
}
});
clientManager.updateAllPartnerPassword("PINE", emails);
}
} }

@ -15,6 +15,10 @@ public class NotifyQueryBean {
private int page = 1; private int page = 1;
private int limit = 20; private int limit = 20;
private String moniker; private String moniker;
// 新增orderId查询字段
private String orderId;
private String clientOrderId; private String clientOrderId;
private String date; private String date;
private Boolean success; private Boolean success;
@ -24,6 +28,11 @@ public class NotifyQueryBean {
if (StringUtils.isNotEmpty(moniker)) { if (StringUtils.isNotEmpty(moniker)) {
param.put("client_moniker", moniker); param.put("client_moniker", moniker);
} }
if (StringUtils.isNotEmpty(orderId)) {
param.put("order_id", orderId);
}
if (StringUtils.isNotEmpty(clientOrderId)) { if (StringUtils.isNotEmpty(clientOrderId)) {
param.put("client_order_id", clientOrderId); param.put("client_order_id", clientOrderId);
} }
@ -88,4 +97,12 @@ public class NotifyQueryBean {
public void setSuccess(Boolean success) { public void setSuccess(Boolean success) {
this.success = success; this.success = success;
} }
public String getOrderId() {
return orderId;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
}
} }

@ -618,7 +618,7 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
Date expiryTime = client.getDate("expiry_time"); Date expiryTime = client.getDate("expiry_time");
client.put("generatable", expiryTime != null); client.put("generatable", expiryTime != null);
if (expiryTime != null) { if (expiryTime != null) {
client.put("expiry_time", expiryTime.getTime()); client.put("expiry_time", DateFormatUtils.format(client.getDate("expiry_time"), "dd/MM/yyyy"));
} }
} }
warnings.put("no_rate", rateInDanger); warnings.put("no_rate", rateInDanger);

@ -34,11 +34,11 @@ public interface RiskAttentionMerchantsMapper {
PageList<JSONObject> query(JSONObject params, PageBounds pagination); PageList<JSONObject> query(JSONObject params, PageBounds pagination);
@Select("SELECT client_moniker FROM risk_attention_merchants " + @Select("SELECT client_moniker FROM risk_attention_merchants " +
"WHERE (abn = #{abn} ) OR (acn = #{acn} ) " + "WHERE ((abn = #{abn} ) OR (acn = #{acn} ) " +
" OR (contact_phone = #{contact_phone} ) " + " OR (contact_phone = #{contact_phone} ) " +
" OR (contact_person = #{contact_person} ) " + " OR (contact_person = #{contact_person} ) " +
" OR (client_moniker = #{client_moniker} ) " + " OR (client_moniker = #{client_moniker} ) " +
" OR (bank_account_no = #{bank_account_no} ) AND is_valid=1") " OR (bank_account_no = #{bank_account_no} )) AND is_valid=1")
List<JSONObject> listRiskySimilarMerchants(JSONObject params); List<JSONObject> listRiskySimilarMerchants(JSONObject params);
} }

@ -102,4 +102,6 @@ public interface ClientMapper {
@AutoSql(type = SqlType.UPDATE) @AutoSql(type = SqlType.UPDATE)
void updateRpayEnterpriseId(@Param("client_id") int clientId, @Param("rpay_enterprise_id") String rpayEnterpriseId); void updateRpayEnterpriseId(@Param("client_id") int clientId, @Param("rpay_enterprise_id") String rpayEnterpriseId);
List<JSONObject> findByrpayNotNull();
} }

@ -10,7 +10,7 @@ import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
/** /**
* Created by yangluo on 2017-03-14. * Created by yangluo on 2018-09-18.
*/ */
@AutoMapper(tablename = "sys_rpay_merchant_apply",pkName = "merchant_app_id") @AutoMapper(tablename = "sys_rpay_merchant_apply",pkName = "merchant_app_id")
public interface SysRpayMerchantApplyMapper { public interface SysRpayMerchantApplyMapper {
@ -21,6 +21,6 @@ public interface SysRpayMerchantApplyMapper {
void insertRpayMerchantApply(JSONObject params); void insertRpayMerchantApply(JSONObject params);
@AutoSql(type = SqlType.SELECT) @AutoSql(type = SqlType.SELECT)
List<JSONObject> listByShortName(@Param("client_id") int client_id,@Param("merchant_shortname") String shortName); List<JSONObject> listByShortName(@Param("merchant_shortname") String shortName);
} }

@ -18,15 +18,23 @@ public class ClientRateConfig {
@JSONField(name = "rate_name") @JSONField(name = "rate_name")
@NotEmpty(message = "error.payment.valid.param_missing") @NotEmpty(message = "error.payment.valid.param_missing")
private String rateName; private String rateName;
@JSONField(name = "rate_value") @JSONField(name = "rate_value")
@NotNull(message = "error.payment.valid.param_missing") @NotNull(message = "error.payment.valid.param_missing")
private Double rateValue; private Double rateValue;
@JSONField(name = "transaction_fee")
@NotNull(message = "error.payment.valid.param_missing")
private Double transactionFee;
@JSONField(name = "active_time") @JSONField(name = "active_time")
@NotNull(message = "error.payment.valid.param_missing") @NotNull(message = "error.payment.valid.param_missing")
private Date activeTime; private Date activeTime;
@JSONField(name = "expiry_time") @JSONField(name = "expiry_time")
@NotNull(message = "error.payment.valid.param_missing") @NotNull(message = "error.payment.valid.param_missing")
private Date expiryTime; private Date expiryTime;
@JSONField(name = "clean_days") @JSONField(name = "clean_days")
@NotNull(message = "error.payment.valid.param_missing") @NotNull(message = "error.payment.valid.param_missing")
private Integer cleanDays = 3; private Integer cleanDays = 3;
@ -86,4 +94,12 @@ public class ClientRateConfig {
public void setRemark(String remark) { public void setRemark(String remark) {
this.remark = remark; this.remark = remark;
} }
public Double getTransactionFee() {
return transactionFee;
}
public void setTransactionFee(Double transactionFee) {
this.transactionFee = transactionFee;
}
} }

@ -23,6 +23,7 @@ import org.springframework.web.bind.annotation.PathVariable;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
@ -336,7 +337,9 @@ public interface ClientManager {
void sendHfEmailNotice(JSONObject order); void sendHfEmailNotice(JSONObject order);
void subRpayMerchantApplication(String clientMoniker, JSONObject manager); void subRpayMerchantApplication(String clientMoniker,JSONObject merchantInfo, JSONObject manager);
void updateAllPartnerPassword(String clientMoniker, List<String> emails); void updateAllPartnerPassword(String clientMoniker, List<String> emails);
void postponeClientRate(Date now, Date yearTomorrow, String expireDate, JSONObject client);
} }

@ -123,6 +123,7 @@ import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.RandomUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils; import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils; import org.apache.commons.lang3.time.DateUtils;
@ -239,6 +240,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Resource @Resource
private WxPayClient wxPayClient; private WxPayClient wxPayClient;
@Resource
private RpayApi rpayApi;
@Resource @Resource
private ManagerMapper managerMapper; private ManagerMapper managerMapper;
@Resource @Resource
@ -282,8 +286,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Resource @Resource
private ClientInfoCacheSupport clientInfoCacheSupport; private ClientInfoCacheSupport clientInfoCacheSupport;
@Resource
private RpayApi rpayApi;
@Resource @Resource
private SimpleClientApplyService simpleClientApplyService; private SimpleClientApplyService simpleClientApplyService;
@Resource @Resource
@ -790,18 +792,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
logger.error("记录log_client_sub_merchant_id失败", e); logger.error("记录log_client_sub_merchant_id失败", e);
} }
clientMapper.update(update); clientMapper.update(update);
List<JSONObject> children = clientMapper.listChildClients(clientId);
for (JSONObject child : children) {
if (Objects.equals(child.getString("rpay_enterprise_id"), originSubMerchantId)) {
update.put("client_id", child.getIntValue("client_id"));
try {
recordSubMerchantLog(child, rpaySubMerchantInfo, manager);
} catch (Exception e) {
logger.error("记录log_client_sub_merchant_id失败", e);
}
clientMapper.update(update);
}
}
clientInfoCacheSupport.clearClientCache(clientId); clientInfoCacheSupport.clearClientCache(clientId);
} }
@ -1574,6 +1564,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} }
@Override @Override
@Transactional
public void newConfigRate(JSONObject manager, String clientMoniker, JSONObject config) { public void newConfigRate(JSONObject manager, String clientMoniker, JSONObject config) {
JSONObject client = getClientInfoByMoniker(clientMoniker); JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) { if (client == null) {
@ -1609,6 +1600,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
configNewClientRate(config, clientId, "hf", "hf_rate_value", org, "min_hf_rate"); configNewClientRate(config, clientId, "hf", "hf_rate_value", org, "min_hf_rate");
configNewClientRate(config, clientId, "Rpay", "Rpay_rate_value", org, "min_Rpay_rate"); configNewClientRate(config, clientId, "Rpay", "Rpay_rate_value", org, "min_Rpay_rate");
rpayApi.modifySurchargeConfig(client);
} }
private void configNewClientRate(JSONObject config, int clientId, String channel, String rateKey, JSONObject org, String rateValueKey) { private void configNewClientRate(JSONObject config, int clientId, String channel, String rateKey, JSONObject org, String rateValueKey) {
@ -1632,6 +1625,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} }
@Override @Override
@Transactional
public void modifyRateConfig(JSONObject manager, String clientMoniker, int rateId, ClientRateConfig config) { public void modifyRateConfig(JSONObject manager, String clientMoniker, int rateId, ClientRateConfig config) {
JSONObject client = getClientInfoByMoniker(clientMoniker); JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) { if (client == null) {
@ -1650,6 +1644,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
configJson.put("manager_name", manager.getString("username")); configJson.put("manager_name", manager.getString("username"));
configJson.put("update_time", new Date()); configJson.put("update_time", new Date());
clientRateMapper.updateConfig(configJson); clientRateMapper.updateConfig(configJson);
if ("Rpay".equals(configJson.getString("rate_name"))) {
rpayApi.modifySurchargeConfig(client);
}
int clientId = client.getIntValue("client_id"); int clientId = client.getIntValue("client_id");
JSONObject changeRate = merchantInfoProvider.clientCurrentRate(clientId, new Date(), "Wechat"); JSONObject changeRate = merchantInfoProvider.clientCurrentRate(clientId, new Date(), "Wechat");
int cleanDays = changeRate.getIntValue("clean_days"); int cleanDays = changeRate.getIntValue("clean_days");
@ -3188,12 +3185,15 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} }
@Override @Override
@Transactional
public void setSkipClearing(JSONObject account, String clientMoniker, Boolean skip_clearing) { public void setSkipClearing(JSONObject account, String clientMoniker, Boolean skip_clearing) {
JSONObject client = getClientInfoByMoniker(clientMoniker); JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) { if (client == null) {
throw new InvalidShortIdException(); throw new InvalidShortIdException();
} }
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account, clientMoniker, "skip_clearing", skip_clearing)); clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account, clientMoniker, "skip_clearing", skip_clearing));
client.put("skip_clearing", skip_clearing);
rpayApi.switchMerchantSettle(client);
} }
@Override @Override
@ -3598,33 +3598,35 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} }
@Override @Override
public void subRpayMerchantApplication(String clientMoniker, JSONObject manager) { public void subRpayMerchantApplication(String clientMoniker, JSONObject merchantInfo,JSONObject manager) {
JSONObject client = getClientInfoByMoniker(clientMoniker); JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) { if (client == null) {
throw new InvalidShortIdException(); throw new InvalidShortIdException();
} }
checkOrgPermission(manager, client); checkOrgPermission(manager, client);
List<JSONObject> listByshortName = sysRpayMerchantApplyMapper.listByShortName(client.getIntValue("client_id"),client.getString("short_name")); List<JSONObject> listByshortName = sysRpayMerchantApplyMapper.listByShortName(merchantInfo.getString("company_shortname"));
if (listByshortName.size()>0) { if (listByshortName.size()>0) {
throw new BadRequestException("请修改【" + clientMoniker + "】的Company shortName信息请避免和Rpay+商务号列表内的Company Short Name重复"); throw new BadRequestException("请修改【" + clientMoniker + "】的Company shortName信息Short Name 已被使用)");
}
if (client.getString("rpay_enterprise_id") != null) {
throw new BadRequestException("您已申请成功子商务号,请勿重复申请");
} }
SubRpayMerchantInfo subRpayMerchantInfo = JSONObject.toJavaObject(client, SubRpayMerchantInfo.class); SubRpayMerchantInfo subRpayMerchantInfo = JSONObject.toJavaObject(merchantInfo, SubRpayMerchantInfo.class);
subRpayMerchantInfo.CheckEmpty(); subRpayMerchantInfo.CheckEmpty();
JSONObject rpayMerchantInfo = rpayApi.registerMerchant(client.getIntValue("client_id"), subRpayMerchantInfo); JSONObject rpayMerchantInfo = rpayApi.registerMerchant(client.getIntValue("client_id"), subRpayMerchantInfo);
if (rpayMerchantInfo != null) { if (rpayMerchantInfo != null) {
JSONObject merchantApply = new JSONObject(); merchantInfo.put("merchant_id", rpayMerchantInfo.getString("rpay_order_id"));
merchantApply.put("merchant_id", rpayMerchantInfo.getString("rpay_order_id")); merchantInfo.put("client_id", client.getString("client_id"));
merchantApply.put("client_id", client.getString("client_id")); merchantInfo.put("create_time", new Date());
merchantApply.put("create_time", new Date()); merchantInfo.put("operator", manager.getString("display_name"));
merchantApply.put("operator", manager.getString("display_name")); merchantInfo.put("sub_merchant_id", rpayMerchantInfo.getString("merchantId"));
merchantApply.put("sub_merchant_id", rpayMerchantInfo.getString("merchantId")); merchantInfo.put("business_category", client.getString("royalpayindustry"));
merchantApply.put("business_category", client.getString("royalpayindustry")); merchantInfo.put("merchant_shortname", merchantInfo.getString("company_shortname"));
merchantApply.put("merchant_shortname", client.getString("short_name")); sysRpayMerchantApplyMapper.insertRpayMerchantApply(merchantInfo);
sysRpayMerchantApplyMapper.insertRpayMerchantApply(merchantApply);
clientMapper.updateRpayEnterpriseId(client.getIntValue("client_id"), rpayMerchantInfo.getString("merchantId")); clientMapper.updateRpayEnterpriseId(client.getIntValue("client_id"), rpayMerchantInfo.getString("merchantId"));
}else { }else {
throw new BadRequestException("请求失败"); throw new BadRequestException("请求失败");
@ -3969,6 +3971,74 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} }
private void sendClientPostponeNotify(JSONObject account, String newExpireDate) {
JSONObject client = getClientInfo(account.getIntValue("client_id"));
try {
if (StringUtils.isEmpty(account.getString("wechat_openid"))) {
return;
}
MpWechatApi api = mpWechatApiProvider.getApiFromOpenId(account.getString("wechat_openid"));
if (api != null) {
String templateId = api.getTemplateId("client-postpone");
if (templateId != null) {
TemplateMessage notice = initClientMessage(client, newExpireDate, account.getString("wechat_openid"), templateId);
api.sendTemplateMessage(notice);
}
}
} catch (Exception e) {
logger.error("Sending Notify failure", e);
}
}
@Override
@Transactional
public void postponeClientRate(Date now, Date yearTomorrow, String expireDate, JSONObject client) {
int client_id = client.getIntValue("client_id");
List<JSONObject> adminAccounts = clientAccountMapper.listAdminAccounts(client_id);
List<JSONObject> clientRates = clientRateMapper.maxChannelExpiryTime(client_id, null);
JSONObject wechatRate = clientRateMapper.latestChannelCleanDays("Wechat", client.getIntValue("client_id"));
int cleanDays = 1;
if (wechatRate.getInteger("clean_days") != null) {
cleanDays = wechatRate.getIntValue("clean_days");
} else {
cleanDays = wechatRate.getIntValue("c_clean_days");
}
int finalCleanDays = cleanDays;
for (JSONObject o : clientRates) {
JSONObject record = clientRateMapper.latestExpiryConfig(client_id, o.getString("rate_name"));
record.remove("client_rate_id");
record.put("active_time", now);
record.put("manager_id", 0);
record.put("expiry_time", yearTomorrow);
record.put("create_time", now);
record.put("update_time", now);
record.put("clean_days", finalCleanDays);
record.put("manager_name", "System");
record.put("remark", "费率到期系统自动延期1年");
clientRateMapper.saveRate(record);
if ("Rpay".equals(o.getString("rate_name"))) {
//rpayApi.modifySurchargeConfig(clientMapper.findClient(client_id));
}
}
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(null, client.getString("client_moniker"), "tax_in_surcharge", false));
adminAccounts.forEach(o -> {
sendClientPostponeNotify(o, expireDate);
});
}
private TemplateMessage initClientMessage(JSONObject client, String newExpiryDate, String wechatOpenid, String templateId) {
TemplateMessage notice = new TemplateMessage(wechatOpenid, templateId, null);
notice.put("first", "您好您的合同费率已到期根据合同协议系统已自动为您延期1年。", "#ff0000");
notice.put("keyword1", client.getString("short_name") + "(" + client.getString("client_moniker") + ")", "#ff0000");
notice.put("keyword2", newExpiryDate, "#0000ff");
notice.put("remark", "如有疑问请联系RoyalPay", "#000000");
return notice;
}
private void sendTestMerchantPassword(List<JSONObject> accounts, List<String> emails) { private void sendTestMerchantPassword(List<JSONObject> accounts, List<String> emails) {
Context ctx = new Context(); Context ctx = new Context();
ctx.setVariable("accounts", accounts); ctx.setVariable("accounts", accounts);

@ -17,9 +17,7 @@ import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.http.HttpUtils; import au.com.royalpay.payment.tools.http.HttpUtils;
import au.com.royalpay.payment.tools.merchants.beans.QRCodeConfig; import au.com.royalpay.payment.tools.merchants.beans.QRCodeConfig;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole; import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.springframework.validation.Errors; import org.springframework.validation.Errors;
import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
@ -581,9 +579,10 @@ public class PartnerManageController {
public void switchHfEmailNotice(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { public void switchHfEmailNotice(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
clientManager.switchPermission(manager, clientMoniker, "enable_hf_email_notice", pass.getBooleanValue("allow")); clientManager.switchPermission(manager, clientMoniker, "enable_hf_email_notice", pass.getBooleanValue("allow"));
} }
@ManagerMapping(value = "/{clientMoniker}/registRpaySubMerchantId", method = RequestMethod.POST, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) @ManagerMapping(value = "/{clientMoniker}/registRpaySubMerchantId", method = RequestMethod.POST, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN})
public void subRpayMerchantApplication(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { public void subRpayMerchantApplication(@PathVariable String clientMoniker,@RequestBody JSONObject merchantInfo,@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
clientManager.subRpayMerchantApplication(clientMoniker, manager); clientManager.subRpayMerchantApplication(clientMoniker, merchantInfo,manager);
} }
} }

@ -0,0 +1,15 @@
package au.com.royalpay.payment.manage.support.cms.core;
import com.alibaba.fastjson.JSONObject;
public interface AppStyleService {
JSONObject listAppStyleGroup(int page, int limit);
JSONObject getAppStyleByStyleId(String style_id);
void switchGroupByStyleId(String style_id);
void addAppStyle(String style_id, JSONObject appStyleGroup);
void updateAppStyleByStyleId(String style_id, String originStyleId, JSONObject appStyleGroup);
}

@ -0,0 +1,47 @@
package au.com.royalpay.payment.manage.support.cms.core.Impl;
import au.com.royalpay.payment.manage.support.cms.core.AppStyleService;
import au.com.royalpay.payment.tools.cms.RoyalPayCMSSupport;
import com.alibaba.fastjson.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Service
public class AppStyleServiceImpl implements AppStyleService {
@Value("${app.cms.host}")
private String cmsHost;
private Logger logger = LoggerFactory.getLogger(getClass());
@Resource
private RoyalPayCMSSupport royalPayCMSSupport;
@Override
public JSONObject listAppStyleGroup(int page, int limit) {
return royalPayCMSSupport.listAppStyleGroup(page,limit);
}
@Override
public JSONObject getAppStyleByStyleId(String style_id) {
return royalPayCMSSupport.getAppStyleByStyleId(style_id);
}
@Override
public void switchGroupByStyleId(String style_id) {
royalPayCMSSupport.switchGroupByStyleId(style_id);
}
@Override
public void addAppStyle(String style_id, JSONObject appStyleGroup) {
royalPayCMSSupport.addAppStyle(style_id,appStyleGroup);
}
@Override
public void updateAppStyleByStyleId(String style_id, String originStyleId, JSONObject appStyleGroup) {
royalPayCMSSupport.updateAppStyleByStyleId(style_id,originStyleId,appStyleGroup);
}
}

@ -0,0 +1,42 @@
package au.com.royalpay.payment.manage.support.cms.web;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.manage.support.cms.core.AppStyleService;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@RestController
@ManagerMapping(value = "/app/cms/app_style", role = {ManagerRole.SITE_MANAGER})
public class AppStyleController {
@Resource
private AppStyleService appStyleService;
@RequestMapping(value = "/style_group", method = RequestMethod.GET)
public JSONObject listAppStyleGroup(@RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "10") int limit) {
return appStyleService.listAppStyleGroup(page, limit);
}
@RequestMapping(value = "/style_group/{style_id}", method = RequestMethod.GET)
public JSONObject getAppStyleByStyleId(@PathVariable String style_id) {
return appStyleService.getAppStyleByStyleId(style_id);
}
@RequestMapping(value = "/style_group/{style_id}", method = RequestMethod.PUT)
public void switchGroupByStyleId(@PathVariable String style_id) {
appStyleService.switchGroupByStyleId(style_id);
}
@RequestMapping(value = "/style_group", method = RequestMethod.POST)
public void addOneGroupAppStyle(@RequestParam String style_id, @RequestBody JSONObject appStyleGroup) {
appStyleService.addAppStyle(style_id, appStyleGroup);
}
@RequestMapping(value = "/style_group/{style_id}/style", method = RequestMethod.PUT)
public void updateAppStyleByStyleId(@PathVariable String style_id,@RequestParam String originStyleId, @RequestBody JSONObject appStyleGroup) {
appStyleService.updateAppStyleByStyleId(style_id, originStyleId, appStyleGroup);
}
}

@ -1,11 +1,8 @@
package au.com.royalpay.payment.manage.task; package au.com.royalpay.payment.manage.task;
import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientRateMapper; import au.com.royalpay.payment.manage.mappers.system.ClientRateMapper;
import au.com.royalpay.payment.manage.mappers.system.ManagerMapper; import au.com.royalpay.payment.manage.mappers.system.ManagerMapper;
import au.com.royalpay.payment.manage.merchants.core.ClientManager; import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.merchants.core.ClientModifySupport;
import au.com.royalpay.payment.manage.merchants.entity.impls.SwitchPermissionModify;
import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi; import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi;
import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider; import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider;
import au.com.royalpay.payment.tools.connections.mpsupport.beans.TemplateMessage; import au.com.royalpay.payment.tools.connections.mpsupport.beans.TemplateMessage;
@ -21,12 +18,9 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.util.Date; import java.util.Date;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import javax.annotation.Resource; import javax.annotation.Resource;
@ -45,13 +39,9 @@ public class PostponeClientTask {
@Resource @Resource
private ClientManager clientManager; private ClientManager clientManager;
@Resource @Resource
private ClientAccountMapper clientAccountMapper;
@Resource
private ManagerMapper managerMapper; private ManagerMapper managerMapper;
@Resource @Resource
private SynchronizedScheduler synchronizedScheduler; private SynchronizedScheduler synchronizedScheduler;
@Resource
private ClientModifySupport clientModifySupport;
@Scheduled(cron = "0 30 8 * * ?") @Scheduled(cron = "0 30 8 * * ?")
public void postponeClient() { public void postponeClient() {
@ -61,76 +51,25 @@ public class PostponeClientTask {
Date yearTomorrow = DateUtils.addYears(tomorrow, 1); Date yearTomorrow = DateUtils.addYears(tomorrow, 1);
String expireDate = DateFormatUtils.format(yearTomorrow, "yyyy-MM-dd"); String expireDate = DateFormatUtils.format(yearTomorrow, "yyyy-MM-dd");
List<JSONObject> expiryClient = clientRateMapper.getAllExpiry(now); List<JSONObject> expiryClient = clientRateMapper.getAllExpiry(now);
StringBuilder sb = new StringBuilder();
if (CollectionUtils.isEmpty(expiryClient)) { if (CollectionUtils.isEmpty(expiryClient)) {
return; return;
} }
Map<Integer, JSONObject> expiryClients = new HashMap<>(); for (JSONObject client : expiryClient) {
expiryClient.forEach(p -> { try {
expiryClients.put(p.getInteger("client_id"), p); clientManager.postponeClientRate(now, yearTomorrow, expireDate, client);
}); sb.append(client.getString("client_moniker"));
expiryClients.values().forEach(p -> { sb.append("、");
int client_id = p.getIntValue("client_id"); } catch (Exception ignore) {
List<JSONObject> adminAccounts = clientAccountMapper.listAdminAccounts(client_id); continue;
List<JSONObject> clientRates = clientRateMapper.maxChannelExpiryTime(client_id, null);
JSONObject wechatRate = clientRateMapper.latestChannelCleanDays("Wechat", p.getIntValue("client_id"));
int cleanDays = 1;
if (wechatRate.getInteger("clean_days") != null) {
cleanDays = wechatRate.getIntValue("clean_days");
} else {
cleanDays = wechatRate.getIntValue("c_clean_days");
}
int finalCleanDays = cleanDays;
clientRates.forEach(o -> {
JSONObject record = clientRateMapper.latestExpiryConfig(client_id, o.getString("rate_name"));
record.remove("client_rate_id");
record.put("active_time", now);
record.put("manager_id", 0);
record.put("expiry_time", yearTomorrow);
record.put("create_time", now);
record.put("update_time", now);
record.put("clean_days", finalCleanDays);
record.put("manager_name", "System");
record.put("remark", "费率到期系统自动延期1年");
clientRateMapper.saveRate(record);
});
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(null, p.getString("client_moniker"), "tax_in_surcharge", false));
adminAccounts.forEach(o -> {
sendClientPostponeNotify(o, expireDate);
});
});
sendComplianceNotify(expiryClients, expireDate);
});
}
private void sendClientPostponeNotify(JSONObject account, String newExpireDate) {
JSONObject client = clientManager.getClientInfo(account.getIntValue("client_id"));
try {
if (StringUtils.isEmpty(account.getString("wechat_openid"))) {
return;
}
MpWechatApi api = mpWechatApiProvider.getApiFromOpenId(account.getString("wechat_openid"));
if (api != null) {
String templateId = api.getTemplateId("client-postpone");
if (templateId != null) {
TemplateMessage notice = initClientMessage(client, newExpireDate, account.getString("wechat_openid"), templateId);
api.sendTemplateMessage(notice);
} }
} }
} catch (Exception e) { sb.deleteCharAt(sb.length() - 1);
logger.error("Sending Notify failure", e); sendComplianceNotify(sb, expireDate);
} });
} }
private void sendComplianceNotify(Map<Integer, JSONObject> clients, String newExpireDate) { private void sendComplianceNotify(StringBuilder sb, String newExpireDate) {
StringBuffer sb = new StringBuffer();
clients.values().forEach(p -> {
sb.append(p.getString("client_moniker"));
sb.append("、");
});
sb.deleteCharAt(sb.length() - 1);
List<String> compliance = managerMapper.listOpenIdsOfCompliances(); List<String> compliance = managerMapper.listOpenIdsOfCompliances();
compliance.forEach(p -> { compliance.forEach(p -> {
MpWechatApi api = mpWechatApiProvider.getApiFromOpenId(p); MpWechatApi api = mpWechatApiProvider.getApiFromOpenId(p);
@ -139,16 +78,6 @@ public class PostponeClientTask {
}); });
} }
private TemplateMessage initClientMessage(JSONObject client, String newExpiryDate, String wechatOpenid, String templateId) {
TemplateMessage notice = new TemplateMessage(wechatOpenid, templateId, null);
notice.put("first", "您好您的合同费率已到期根据合同协议系统已自动为您延期1年。", "#ff0000");
notice.put("keyword1", client.getString("short_name") + "(" + client.getString("client_moniker") + ")", "#ff0000");
notice.put("keyword2", newExpiryDate, "#0000ff");
notice.put("remark", "如有疑问请联系RoyalPay", "#000000");
return notice;
}
private TemplateMessage initComplianceMessage(String clients, String newExpiryDate, String wechatOpenid, String templateId) { private TemplateMessage initComplianceMessage(String clients, String newExpiryDate, String wechatOpenid, String templateId) {
TemplateMessage notice = new TemplateMessage(wechatOpenid, templateId, null); TemplateMessage notice = new TemplateMessage(wechatOpenid, templateId, null);
notice.put("first", "以下商户据合同费率已经自动延期1年", "#ff0000"); notice.put("first", "以下商户据合同费率已经自动延期1年", "#ff0000");
@ -157,5 +86,4 @@ public class PostponeClientTask {
notice.put("remark", " ", "#000000"); notice.put("remark", " ", "#000000");
return notice; return notice;
} }
} }

@ -42,6 +42,6 @@ public class SettleEstimateTaskManger {
@Scheduled(cron = "0 0 10 * * ?") @Scheduled(cron = "0 0 10 * * ?")
public void generateSettleLogs2() { public void generateSettleLogs2() {
synchronizedScheduler.executeProcess("manage_task:genSettleLogappli2", 120_000, () -> platformClearService.generateSettleLogs()); synchronizedScheduler.executeProcess("manage_task:generateAliPaySettleLog", 120_000, () -> platformClearService.generateAliPaySettleLogs());
} }
} }

@ -10,6 +10,7 @@ import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
@ -24,13 +25,12 @@ public class UpdatePartnerPasswordTask {
@Resource @Resource
private ManagerMapper managerMapper; private ManagerMapper managerMapper;
private final static String EMAIL = "lily.tao@royalpay.com.au,bella.sun@royalpay.com.au," + private final static String EMAIL = "lily.tao@royalpay.com.au,bella.sun@royalpay.com.au,astro.dai@royalpay.com.au,taylor.dang@royalpay.com.au";
"astro.dai@royalpay.com.au,taylor.dang@royalpay.com.au";
@Scheduled(cron = "0 0 9 28 * ?") @Scheduled(cron = "0 0 9 28 * ?")
public void resetPartnerPassword() { public void resetPartnerPassword() {
synchronizedScheduler.executeProcess("manage_task:resetPartnerPassword", 120_000, () -> { synchronizedScheduler.executeProcess("manage_task:resetPartnerPassword", 300_000, () -> {
final List<String> emails = managerMapper.listDevManager(); final List<String> emails = new ArrayList<>();
List<String> emailList = Arrays.asList(EMAIL.split(",")); List<String> emailList = Arrays.asList(EMAIL.split(","));
emailList.stream().forEach(email -> { emailList.stream().forEach(email -> {
if (!emails.contains(email)) { if (!emails.contains(email)) {

@ -40,6 +40,19 @@
</if> </if>
GROUP BY a.datelist GROUP BY a.datelist
</select> </select>
<!--显示所有的商户,包括禁用的-->
<select id="countClientsAll" resultType="java.lang.Integer">
<![CDATA[
SELECT count(client_id)
FROM sys_clients
WHERE
create_time <= #{end} and (approve_result is null or approve_result !=0)
]]>
<if test="org_id!=null and org_ids==null">and org_id=#{org_id}</if>
<if test="org_ids!=null">and org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
</select>
<select id="countClients" resultType="java.lang.Integer"> <select id="countClients" resultType="java.lang.Integer">
<![CDATA[ <![CDATA[
SELECT count(client_id) SELECT count(client_id)
@ -84,31 +97,108 @@
GROUP BY date(o.create_time) GROUP BY date(o.create_time)
</select> </select>
<!-- 原来的SQL语句
<select id="listPartnersTradeAmount" resultType="com.alibaba.fastjson.JSONObject"> <select id="listPartnersTradeAmount" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[ <![CDATA[
SELECT SELECT
p.client_moniker,p.short_name,ifnull(sum(if(t.transaction_type='Credit',t.clearing_amount,0)),0)aud_fee, p.client_moniker,
count(DISTINCT t.order_id) orders,max(t.clearing_amount)max_order,ifnull(sum(if(t.refund_id is not null,if(t.transaction_type='Debit',t.clearing_amount,-t.clearing_amount),0)),0)refund_amount, p.short_name,
ifnull(sum(if(t.refund_id is not null and t.transaction_type='Debit',1,0)),0)refund_orders,max(if(t.refund_id is not null and t.transaction_type='Debit',t.clearing_amount,0))max_refund ifnull(sum(if(t.transaction_type = 'Credit', t.clearing_amount, 0)), 0) aud_fee,
count(DISTINCT t.order_id) orders,
max(t.clearing_amount) max_order,
ifnull(sum(if(t.refund_id is not null, if(t.transaction_type='Debit', t.clearing_amount, -t.clearing_amount), 0)), 0) refund_amount,
ifnull(sum(if(t.refund_id is not null and t.transaction_type='Debit', 1, 0)), 0)refund_orders, max(if(t.refund_id is not null and t.transaction_type='Debit', t.clearing_amount, 0)) max_refund
FROM sys_clients p FROM sys_clients p
INNER JOIN pmt_transactions t ON t.client_id = p.client_id and (t.transaction_type='Credit' or t.refund_id is not null) INNER JOIN pmt_transactions t
INNER JOIN pmt_orders o ON t.order_id = o.order_id ON t.client_id = p.client_id
WHERE o.create_time >= #{begin} AND o.create_time <= #{end} and (t.transaction_type = 'Credit' or t.refund_id is not null)
INNER JOIN pmt_orders o
ON t.order_id = o.order_id
WHERE o.create_time >= #{begin}
AND o.create_time <= #{end}
]]> ]]>
<if test="org_id!=null and org_ids==null">and p.org_id=#{org_id}</if> <if test="org_id != null and org_ids == null">
<if test="org_ids!=null">and p.org_id in and p.org_id = #{org_id}
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if> </if>
<if test="bd_group!=null">and p.client_id in <if test="org_ids != null">
(SELECT b.client_id FROM sys_client_bd b and p.org_id in
INNER JOIN financial_bd_config c ON c.manager_id=b.bd_id <foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">
where b.is_valid=1 and b.start_date&lt;=now() and (b.end_date is null or b.end_date &gt;= now()) #{org_id}
AND (c.bd_group=#{bd_group} or c.manager_id=#{bd_group}) </foreach>
<if test="bd_group_bd">and c.manager_id=#{bd_group_bd}</if> </if>
<if test="bd_group != null">
and p.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})
<if test="bd_group_bd">
and c.manager_id = #{bd_group_bd}
</if>
) )
</if> </if>
GROUP BY p.client_id GROUP BY p.client_id
</select> </select>
-->
<!--
优化后的SQL语句
在之前的SQL语句中与transaction表内连接时加了and (t.transaction_type = 'Credit' or t.refund_id is not null)这个条件
是因为在transaction_type = 'Debit'的记录中有的并没有refund_id所以剔除这些记录
优化后的SQL语句去掉了这个条件而是在需要的字段中添加t.refund_id IS NOT NULL这一条件
-->
<select id="listPartnersTradeAmountNew" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
SELECT
p.short_name,
p.client_moniker,
COUNT(t.refund_id) refund_orders,
COUNT(DISTINCT t.order_id) orders,
IFNULL(MAX(t.clearing_amount), 0) max_order,
MAX(IF(t.refund_id IS NOT NULL, t.clearing_amount, 0)) max_refund,
SUM(IF(t.refund_id IS NOT NULL, t.clearing_amount, 0)) refund_amount,
IFNULL(SUM(IF(t.transaction_type = 'Credit', t.clearing_amount, 0)), 0) aud_fee
FROM sys_clients p
INNER JOIN pmt_transactions t
ON t.client_id = p.client_id
WHERE t.create_time >= #{begin}
AND t.create_time <= #{end}
]]>
<if test="org_id != null and org_ids == null">
AND p.org_id = #{org_id}
</if>
<if test="org_ids != null">
AND p.org_id IN
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">
#{org_id}
</foreach>
</if>
<if test="bd_group != null">
AND p.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})
<if test="bd_group_bd">
AND c.manager_id = #{bd_group_bd}
</if>
)
</if>
GROUP BY p.client_id
<if test="rankType != null">
ORDER BY ${rankType} DESC
</if>
<if test="limit != null">
LIMIT ${limit}
</if>
</select>
<select id="countClientsTypes" resultType="com.alibaba.fastjson.JSONObject"> <select id="countClientsTypes" resultType="com.alibaba.fastjson.JSONObject">
SELECT c.industry,c.royalpayindustry,count(1) partner_counts FROM sys_clients c SELECT c.industry,c.royalpayindustry,count(1) partner_counts FROM sys_clients c

@ -316,7 +316,9 @@
ifnull(sum(CASE WHEN s.channel = 'AlipayOnline' THEN s.total ELSE 0 END),0) alipayonlineamount, ifnull(sum(CASE WHEN s.channel = 'AlipayOnline' THEN s.total ELSE 0 END),0) alipayonlineamount,
ifnull(sum(CASE WHEN s.channel = 'AlipayOnline' THEN s.orders ELSE 0 END),0) alipayonline_order_count, ifnull(sum(CASE WHEN s.channel = 'AlipayOnline' THEN s.orders ELSE 0 END),0) alipayonline_order_count,
ifnull(sum(CASE WHEN s.channel = 'hf' THEN s.total ELSE 0 END),0) hfamount, ifnull(sum(CASE WHEN s.channel = 'hf' THEN s.total ELSE 0 END),0) hfamount,
ifnull(sum(CASE WHEN s.channel = 'hf' THEN s.orders ELSE 0 END),0) hf_order_count ifnull(sum(CASE WHEN s.channel = 'hf' THEN s.orders ELSE 0 END),0) hf_order_count,
ifnull(sum(CASE WHEN s.channel = 'Rpay' THEN s.total ELSE 0 END),0) rpayamount,
ifnull(sum(CASE WHEN s.channel = 'Rpay' THEN s.orders ELSE 0 END),0) rpay_order_count
FROM statistics_customer_order s FROM statistics_customer_order s
LEFT JOIN sys_clients c ON c.client_id = s.client_id and c.is_valid=1 LEFT JOIN sys_clients c ON c.client_id = s.client_id and c.is_valid=1
]]> ]]>

@ -197,10 +197,16 @@
</select> </select>
<select id="listCustomersData" resultType="com.alibaba.fastjson.JSONObject"> <select id="listCustomersData" resultType="com.alibaba.fastjson.JSONObject">
SELECT o.customer_id,sum(if(t.transaction_type='Credit',t.clearing_amount,0)) amount, SELECT r.nickname,r.headimg,o.customer_id,sum(if(t.transaction_type='Credit',t.clearing_amount,0)) amount,
COUNT(DISTINCT o.order_id) orders,max(t.clearing_amount) max_order COUNT(DISTINCT o.order_id) orders,max(t.clearing_amount) max_order
FROM pmt_orders o FROM pmt_orders o
INNER JOIN pmt_transactions t on t.order_id=o.order_id and t.system_generate=0 and (t.transaction_type='Credit' or t.transaction_type>0) INNER JOIN pmt_transactions t on t.order_id=o.order_id and t.system_generate=0 and (t.transaction_type='Credit' or t.transaction_type>0)
<if test="openid_type==4">
LEFT JOIN sys_customer_relation r on r.globalpay_openid = o.customer_id
</if>
<if test="openid_type!=4">
LEFT JOIN sys_customer_relation r on r.wechat_openid = o.customer_id
</if>
<where> <where>
<if test="begin!=null">and o.create_time &gt;= #{begin}</if> <if test="begin!=null">and o.create_time &gt;= #{begin}</if>
<if test="end!=null">and o.create_time &lt; #{end}</if> <if test="end!=null">and o.create_time &lt; #{end}</if>
@ -216,6 +222,9 @@
<if test="openid_type==3"> <if test="openid_type==3">
and o.channel='Bestpay' and o.channel='Bestpay'
</if> </if>
<if test="openid_type==4">
AND o.customer_id LIKE 'olH%' and o.channel='Wechat'
</if>
<if test="customer_id!=null"> <if test="customer_id!=null">
and o.customer_id=#{customer_id} and o.customer_id=#{customer_id}
</if> </if>
@ -245,6 +254,9 @@
<if test="openid_type==3"> <if test="openid_type==3">
and o.channel='Bestpay' and o.channel='Bestpay'
</if> </if>
<if test="openid_type==4">
AND customer_id LIKE 'olH%'
</if>
<if test="customer_id!=null"> <if test="customer_id!=null">
and o.customer_id=#{customer_id} and o.customer_id=#{customer_id}
</if> </if>

@ -163,7 +163,7 @@
<if test="org_ids!=null">and o.org_id in <if test="org_ids!=null">and o.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if> <foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
<![CDATA[ <![CDATA[
GROUP BY o.order_id GROUP BY o.order_id ORDER BY aud_fee DESC limit 1
]]> ]]>
</select> </select>

@ -1,6 +1,8 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="au.com.royalpay.payment.manage.mappers.log.NotifyErrorLogMapper"> <mapper namespace="au.com.royalpay.payment.manage.mappers.log.NotifyErrorLogMapper">
<!--
原来的SQL语句
<select id="listErrorLogs" resultType="com.alibaba.fastjson.JSONObject"> <select id="listErrorLogs" resultType="com.alibaba.fastjson.JSONObject">
SELECT l.* FROM log_notify_error l SELECT l.* FROM log_notify_error l
<if test="client_moniker!=null"> <if test="client_moniker!=null">
@ -14,6 +16,36 @@
<if test="success!=null">and l.success=#{success}</if> <if test="success!=null">and l.success=#{success}</if>
</where> </where>
</select> </select>
-->
<!-- 新增client_order_id字段SQL语句修改如下 -->
<select id="listErrorLogs" resultType="com.alibaba.fastjson.JSONObject">
SELECT lne.*, po.client_order_id
FROM log_notify_error lne
INNER JOIN pmt_orders po
ON lne.order_id = po.order_id
<if test = "client_moniker != null">
INNER JOIN sys_clients sc
ON sc.client_id = lne.client_id
AND sc.is_valid = 1
AND sc.client_moniker = #{client_moniker}
</if>
<where>
<if test = "order_id != null">
lne.order_id = #{order_id}
</if>
<if test = "client_order_id != null">
AND po.client_order_id = #{client_order_id}
</if>
<if test = "date != null">
AND DATE(lne.addtime) = DATE(#{date})
</if>
<if test = "success != null">
AND lne.success = #{success}
</if>
</where>
</select>
<select id="listUnsentOrders" resultType="com.alibaba.fastjson.JSONObject"> <select id="listUnsentOrders" resultType="com.alibaba.fastjson.JSONObject">
SELECT SELECT
order_id, order_id,

@ -18,7 +18,7 @@
FROM FROM
pmt_transactions pmt_transactions
WHERE WHERE
channel = #{channel} order_channel = #{channel}
AND transaction_type = #{transaction_type} AND transaction_type = #{transaction_type}
AND transaction_time >= #{start_date} AND transaction_time >= #{start_date}
AND #{end_date} > transaction_time AND #{end_date} > transaction_time
@ -33,7 +33,7 @@
ELSE 0 END), ELSE 0 END),
0.00) ali_charge_amount 0.00) ali_charge_amount
FROM pmt_transactions FROM pmt_transactions
WHERE channel = #{channel} WHERE order_channel = #{channel}
AND transaction_time >= #{start_date} AND transaction_time >= #{start_date}
AND #{end_date} > transaction_time AND #{end_date} > transaction_time
AND system_generate = 0 AND system_generate = 0
@ -47,7 +47,7 @@
FROM FROM
pmt_transactions pmt_transactions
WHERE WHERE
channel = #{channel} order_channel = #{channel}
AND transaction_type = #{transaction_type} AND transaction_type = #{transaction_type}
AND transaction_time >= #{start_date} AND transaction_time >= #{start_date}
AND #{end_date} > transaction_time AND #{end_date} > transaction_time

@ -18,7 +18,7 @@
</where> </where>
</select> </select>
<select id="partnerAndSubPartnerAccounts" resultType="com.alibaba.fastjson.JSONObject"> <select id="partnerAndSubPartnerAccounts" resultType="com.alibaba.fastjson.JSONObject">
SELECT sc.client_moniker, sa.* SELECT sc.client_moniker, sa.account_id, sa.role, sa.username
FROM sys_clients sc FROM sys_clients sc
INNER JOIN sys_accounts sa ON sc.client_id = sa.client_id AND sa.is_valid = 1 INNER JOIN sys_accounts sa ON sc.client_id = sa.client_id AND sa.is_valid = 1
WHERE sc.client_id = #{client_id} OR sc.parent_client_id = #{client_id} AND sc.is_valid = 1 WHERE sc.client_id = #{client_id} OR sc.parent_client_id = #{client_id} AND sc.is_valid = 1

@ -365,4 +365,8 @@
<select id="findByhfPayUrlNotNull" resultType="com.alibaba.fastjson.JSONObject"> <select id="findByhfPayUrlNotNull" resultType="com.alibaba.fastjson.JSONObject">
select client_id,client_moniker FROM sys_clients WHERE hf_pay_url != '' select client_id,client_moniker FROM sys_clients WHERE hf_pay_url != ''
</select> </select>
<select id="findByrpayNotNull" resultType="com.alibaba.fastjson.JSONObject">
select * FROM sys_clients WHERE rpay_enterprise_id != ''
</select>
</mapper> </mapper>

@ -113,7 +113,7 @@
sys_client_rates cr sys_client_rates cr
inner join sys_clients c on c.client_id = cr.client_id and c.is_valid = 1 and (c.approve_result = 1 or c.approve_result = 2) inner join sys_clients c on c.client_id = cr.client_id and c.is_valid = 1 and (c.approve_result = 1 or c.approve_result = 2)
GROUP BY GROUP BY
cr.client_id ,cr.rate_name cr.client_id
) a ) a
WHERE WHERE
a.expiry_time < #{expiry_date} a.expiry_time < #{expiry_date}

@ -542,6 +542,8 @@ define(['angular', 'decimal', 'uiBootstrap', 'uiRouter', 'angularEcharts'], func
return '/static/images/jd_sign_lg.png'; return '/static/images/jd_sign_lg.png';
case 'hf': case 'hf':
return '/static/images/hf_sign_lg.png'; return '/static/images/hf_sign_lg.png';
case 'Rpay':
return '/static/images/rpayplus_sign_lg.png';
} }
} }
}); });

@ -77,6 +77,7 @@ define(['angular', 'static/commons/commons', 'static/commons/angular-ueditor', '
$http.get('/analysis/customers/ranking/'+$scope.params.openid_type, {params: params}).then(function (resp) { $http.get('/analysis/customers/ranking/'+$scope.params.openid_type, {params: params}).then(function (resp) {
$scope.customer_loading = false; $scope.customer_loading = false;
$scope.customers = resp.data.data; $scope.customers = resp.data.data;
$scope.customers_type = resp.data.openid_type;
$scope.customers_analysis = resp.data.analysis; $scope.customers_analysis = resp.data.analysis;
$scope.pagination = resp.data.pagination; $scope.pagination = resp.data.pagination;
if($scope.customers.length>0){ if($scope.customers.length>0){

@ -22,6 +22,7 @@
<option value='1'>白RoyalPay</option> <option value='1'>白RoyalPay</option>
<option value='2'>Alipay</option> <option value='2'>Alipay</option>
<option value='3'>Bestpay</option> <option value='3'>Bestpay</option>
<option value='4'>Nap</option>
</select> </select>
</div> </div>
<div class="form-group col-xs-4 form-inline"> <div class="form-group col-xs-4 form-inline">
@ -99,6 +100,7 @@
<table class="table table-striped"> <table class="table table-striped">
<thead> <thead>
<tr> <tr>
<th style="width: 200px">Nick Name</th>
<th>Customer openId</th> <th>Customer openId</th>
<th>Amount(AUD)</th> <th>Amount(AUD)</th>
<!-- <th>Points</th>--> <!-- <th>Points</th>-->
@ -110,6 +112,26 @@
<tr ng-repeat="customer in customers" <tr ng-repeat="customer in customers"
ng-class="{'selectRow':order_params.customer_id==customer.customer_id}" ng-class="{'selectRow':order_params.customer_id==customer.customer_id}"
ng-click="order_params.customer_id=customer.customer_id;listCustomerOrders()"> ng-click="order_params.customer_id=customer.customer_id;listCustomerOrders()">
<td style="width: 60px" ng-if="customers_type ==0 || customers_type==1">
<span>
<img style="height: 30px;width: 30px" class="img-circle" ng-src="{{customer.headimg||'static/images/royalpay_sign_ln.png'}}" />
{{customer.nickname}}
</span></td>
<td style="width: 60px" ng-if="customers_type ==2">
<span>
<img style="height: 30px;width: 30px" class="img-circle" ng-src="{{customer.headimg||'static/images/alipay_sign.png'}}" />
{{customer.nickname}}
</span></td>
<td style="width: 60px" ng-if="customers_type ==3">
<span>
<img style="height: 30px;width: 30px" class="img-circle" ng-src="{{customer.headimg||'static/images/bestpay_sign.png'}}" />
{{customer.nickname}}
</span></td>
<td style="width: 60px" ng-if="customers_type ==4">
<span>
<img style="height: 30px;width: 30px" class="img-circle" ng-src="{{customer.headimg||'static/images/nap.png'}}" />
{{customer.nickname}}
</span></td>
<td ng-bind="customer.customer_id"></td> <td ng-bind="customer.customer_id"></td>
<td ng-bind="customer.amount"></td> <td ng-bind="customer.amount"></td>
<!-- <td ng-bind="customer.points"></td>--> <!-- <td ng-bind="customer.points"></td>-->
@ -179,6 +201,8 @@
uib-tooltip="JD Pay" ng-if="order.channel=='jd'"/> uib-tooltip="JD Pay" ng-if="order.channel=='jd'"/>
<img src="/static/images/hf_sign.png" <img src="/static/images/hf_sign.png"
uib-tooltip="HF Pay" ng-if="order.channel=='hf'"/> uib-tooltip="HF Pay" ng-if="order.channel=='hf'"/>
<img src="/static/images/rpayplus_sign.png"
uib-tooltip="RPay+" ng-if="order.channel=='Rpay'"/>
{{order.order_id}} {{order.order_id}}
</td> </td>
<td>{{order.short_name}}(<a class="text-primary" role="button" title="Detail" <td>{{order.short_name}}(<a class="text-primary" role="button" title="Detail"

@ -90,7 +90,9 @@
<a role="button" ng-class="{'bg-primary':params.channel=='jd'}" <a role="button" ng-class="{'bg-primary':params.channel=='jd'}"
ng-click="params.channel='jd';doAnalysis(1)">JD Pay</a> | ng-click="params.channel='jd';doAnalysis(1)">JD Pay</a> |
<a role="button" ng-class="{'bg-primary':params.channel=='hf'}" <a role="button" ng-class="{'bg-primary':params.channel=='hf'}"
ng-click="params.channel='hf';doAnalysis(1)">HF Pay</a> ng-click="params.channel='hf';doAnalysis(1)">HF Pay</a> |
<a role="button" ng-class="{'bg-primary':params.channel=='RPAY'}"
ng-click="params.channel='RPAY';doAnalysis(1)">RPay +</a>
</p> </p>
</div> </div>
</div> </div>

@ -48,6 +48,11 @@
<img src="/static/images/hf_sign_lg.png" class="channel-icon-lg"> <img src="/static/images/hf_sign_lg.png" class="channel-icon-lg">
</a> </a>
</li> </li>
<li ng-class="{active:ctrl.channel=='Rpay'}" ng-if="report.channels.Rpay">
<a role="button" ng-click="ctrl.channel='Rpay';channelAndDayOfAnalysis()" title="RPAY">
<img src="/static/images/rpayplus_sign_lg.png" class="channel-icon-lg">
</a>
</li>
</ul> </ul>
</div> </div>
</div> </div>

@ -97,7 +97,9 @@
<a role="button" ng-class="{'bg-primary':params.channel=='jd'}" <a role="button" ng-class="{'bg-primary':params.channel=='jd'}"
ng-click="params.channel='jd';doAnalysis(1)">JD Pay</a> | ng-click="params.channel='jd';doAnalysis(1)">JD Pay</a> |
<a role="button" ng-class="{'bg-primary':params.channel=='hf'}" <a role="button" ng-class="{'bg-primary':params.channel=='hf'}"
ng-click="params.channel='hf';doAnalysis(1)">HF Pay</a> ng-click="params.channel='hf';doAnalysis(1)">HF Pay</a> |
<a role="button" ng-class="{'bg-primary':params.channel=='RPAY'}"
ng-click="params.channel='RPAY';doAnalysis(1)">RPay +</a>
</p> </p>
</div> </div>
</div> </div>
@ -197,6 +199,17 @@
</div> </div>
</div> </div>
</div> </div>
<!-- Rpay+显示交易额分析-->
<div class="col-sm-2 col-xs-6">
<div class="description-block">
<div class="description-header text-bold"><img src="/static/images/rpayplus_sign.png"/>RPay+</div>
<div class="description-text text-red">
<label class="description-text"
ng-bind="totalChannelAmount.rpayamount|currency: ' $ '"></label>
</div>
</div>
</div>
</div> </div>
<!--<table class="table"> <!--<table class="table">
<tr> <tr>
@ -216,9 +229,12 @@
<th> <th>
<img src="/static/images/jd_sign.png"/> <img src="/static/images/jd_sign.png"/>
JD Pay:{{totalChannelAmount.jdPayAmount|currency: ' $ '}}</th> JD Pay:{{totalChannelAmount.jdPayAmount|currency: ' $ '}}</th>
<th>
<img src="/static/images/rpayplus_sign.png"/>
R Pay:{{totalChannelAmount.rpayamount|currency: ' $ '}}</th>
<th> <th>
<img src="/static/images/hf_sign.png"/> <img src="/static/images/hf_sign.png"/>
JD Pay:{{totalChannelAmount.hfPayAmount|currency: ' $ '}}</th> hf Pay:{{totalChannelAmount.hfPayAmount|currency: ' $ '}}</th>
&lt;!&ndash;<th>&ndash;&gt; &lt;!&ndash;<th>&ndash;&gt;
&lt;!&ndash;<img src="/static/images/wechatpay_sign.png"/>&ndash;&gt; &lt;!&ndash;<img src="/static/images/wechatpay_sign.png"/>&ndash;&gt;
&lt;!&ndash;Znyoo:{{totalChannelAmount.znyooAmount|currency: ' $ '}}</th>&ndash;&gt; &lt;!&ndash;Znyoo:{{totalChannelAmount.znyooAmount|currency: ' $ '}}</th>&ndash;&gt;

@ -67,7 +67,9 @@
<a role="button" ng-class="{'bg-primary':params.channel=='jd'}" <a role="button" ng-class="{'bg-primary':params.channel=='jd'}"
ng-click="params.channel='jd';doAnalysis(1)">JD Pay</a> | ng-click="params.channel='jd';doAnalysis(1)">JD Pay</a> |
<a role="button" ng-class="{'bg-primary':params.channel=='hf'}" <a role="button" ng-class="{'bg-primary':params.channel=='hf'}"
ng-click="params.channel='hf';doAnalysis(1)">HF Pay</a> ng-click="params.channel='hf';doAnalysis(1)">HF Pay</a> |
<a role="button" ng-class="{'bg-primary':params.channel=='RPAY'}"
ng-click="params.channel='RPAY';doAnalysis(1)">RPay +</a>
</p> </p>
</div> </div>
</div> </div>
@ -157,6 +159,18 @@
</div> </div>
</div> </div>
</div> </div>
<!-- 显示Rpay+交易额分析-->
<div class="col-sm-2 col-xs-6">
<div class="description-block">
<div class="description-header text-bold"><img src="/static/images/rpayplus_sign.png"/>RPay+</div>
<div class="description-text">
<label class="description-text text-red"
ng-bind="totalChannelAmount.rpayamount|currency: ' $ '"></label>
</div>
</div>
</div>
</div> </div>
<!-- <table class="table"> <!-- <table class="table">
<tr> <tr>
@ -178,6 +192,9 @@
<th> <th>
<img src="/static/images/hf_sign.png"/> <img src="/static/images/hf_sign.png"/>
JD Pay:{{totalChannelAmount.hfPayAmount|currency: ' $ '}}</th> JD Pay:{{totalChannelAmount.hfPayAmount|currency: ' $ '}}</th>
<th>
<img src="/static/images/rpayplus_sign.png"/>
R Pay:{{totalChannelAmount.rpayamount|currency: ' $ '}}</th>
</tr> </tr>
</table>--> </table>-->
</div> </div>

@ -32,6 +32,8 @@
ng-click="params.channel='jd';loadTradeLogs()">JD Pay</a> | ng-click="params.channel='jd';loadTradeLogs()">JD Pay</a> |
<a role="button" ng-class="{'bg-primary':params.channel=='hf'}" <a role="button" ng-class="{'bg-primary':params.channel=='hf'}"
ng-click="params.channel='hf';loadTradeLogs()">HF Pay</a> ng-click="params.channel='hf';loadTradeLogs()">HF Pay</a>
<a role="button" ng-class="{'bg-primary':params.channel=='RPAY'}"
ng-click="params.channel='RPAY';loadTradeLogs(1)">RPay +</a>
</p> </p>
</div> </div>
</div> </div>

@ -4,6 +4,67 @@
define(['angular', 'uiRouter', 'static/commons/angular-ueditor'], function (angular) { define(['angular', 'uiRouter', 'static/commons/angular-ueditor'], function (angular) {
'use strict'; 'use strict';
var app = angular.module('cms', ['ui.router','ng.uditor']); var app = angular.module('cms', ['ui.router','ng.uditor']);
var style = [
{
"style_key":"settlement",
"style_value":""
},
{
"style_key":"home_select",
"style_value":""
},
{
"style_key":"activity_gray",
"style_value":""
},
{
"style_key":"activity_select",
"style_value":""
},
{
"style_key":"mess_gray",
"style_value":""
},
{
"style_key":"mess_select",
"style_value":""
},
{
"style_key":"my_select",
"style_value":""
},
{
"style_key":"transaction",
"style_value":""
},
{
"style_key":"statistics",
"style_value":""
},
{
"style_key":"marketing_account",
"style_value":""
},
{
"style_key":"usergroup",
"style_value":""
},
{
"style_key":"coupon",
"style_value":""
},
{
"style_key":"rpbill",
"style_value":""
},
{
"style_key":"invoice_assistant",
"style_value":""
},
{
"style_key":"home_gray",
"style_value":""
}];
app.config(['$stateProvider', function ($stateProvider) { app.config(['$stateProvider', function ($stateProvider) {
$stateProvider.state('cms', { $stateProvider.state('cms', {
url: '/cms', url: '/cms',
@ -38,7 +99,41 @@ define(['angular', 'uiRouter', 'static/commons/angular-ueditor'], function (angu
}).state('cms.phone_top_up', { }).state('cms.phone_top_up', {
url: '/phone_top_up', url: '/phone_top_up',
controller: 'CmsPhonetopupCtrl', controller: 'CmsPhonetopupCtrl',
templateUrl: '/static/cms/templates/phone_top_up.html' templateUrl: '/static/cms/templates/phone_top_up.html',
}).state('cms.app_style',{
url: '/app_style',
controller: 'cmsAppStyleListCtrl',
templateUrl: '/static/cms/templates/app_style.html',
}).state('cms.app_style.app_style_preview',{
url: '/{style_id}/preview',
controller: 'cmsAppStylePreviewCtrl',
templateUrl: '/static/cms/templates/app_style_preview.html',
resolve: {
appStyles: ['$http', '$stateParams', function ($http, $stateParams) {
return $http.get('/app/cms/app_style/style_group/' + $stateParams.style_id);
}]
}
}).state('cms.app_style.app_style_save',{
url: '/save',
controller: 'cmsAppStyleSaveCtrl',
templateUrl: '/static/cms/templates/app_style_config.html',
resolve: {
style: function () {
return angular.copy(style);
}
}
}).state('cms.app_style.app_style_edit',{
url: '/{style_id}/edit',
controller: 'cmsAppStyleEditCtrl',
templateUrl: '/static/cms/templates/app_style_config.html',
resolve: {
appStyles: ['$http', '$stateParams', function ($http, $stateParams) {
return $http.get('/app/cms/app_style/style_group/' + $stateParams.style_id);
}],
style: function () {
return angular.copy(style);
}
}
}) })
}]); }]);
app.controller('cmsRootCtrl', ['$scope', function ($scope) { app.controller('cmsRootCtrl', ['$scope', function ($scope) {
@ -140,6 +235,142 @@ define(['angular', 'uiRouter', 'static/commons/angular-ueditor'], function (angu
$scope.article = article.data; $scope.article = article.data;
}]); }]);
app.controller('cmsAppStyleListCtrl', ['$scope', '$http', '$uibModal', function ($scope, $http, $uibModal) {
$scope.pagination = {};
$scope.appStyleGroupList = function (page) {
var params = $scope.queryParams || {};
params.page = page || $scope.pagination.page || 1;
$http.get('/app/cms/app_style/style_group', {params: params}).then(function (resp) {
$scope.appStyleGroups = resp.data.data;
$scope.pagination = resp.data.pagination;
})
};
$scope.appStyleGroupList(1);
}]);
app.controller('cmsAppStylePreviewCtrl', ['$scope', '$http', 'appStyles', function ($scope, $http, appStyles) {
$scope.appStyles = appStyles.data.data;
}]);
app.controller('cmsAppStyleEditCtrl', ['$scope', '$http', '$state','commonDialog', 'appStyles', 'style', function ($scope, $http, $state, commonDialog, appStyles, style) {
$scope.ctrl = {sending: false, flag: false, originStyleId: angular.copy(appStyles.data.data[0].style_id)};
$scope.entity={};
$scope.style = angular.copy(style);
$scope.entity.appStyle = angular.copy(appStyles.data.data);
$scope.params = {style_id: angular.copy(appStyles.data.data[0].style_id)};
$scope.appStyleList = function() {
var styleKeyStr = "";
$scope.entity.appStyle.forEach(function(item){
styleKeyStr += item.style_key + ",";
});
$scope.style.forEach(function(item){
if (styleKeyStr.indexOf(item.style_key) < 0) {
$scope.entity.appStyle.push({"style_key": item.style_key,"style_value":""});
}
})
};
$scope.appStyleList();
$scope.addSpecOption = function() {
$scope.entity.appStyle.push({});
};
// 删除规格选项
$scope.delSpecOption = function(index) {
$scope.entity.appStyle.splice(index, 1);
};
$scope.saveOneGroupAppStyle = function() {
if ($scope.params.style_id == "" || $scope.params.style_id == null) {
$scope.errmsg = "title不能为空";
return;
}
var item = "";
for (var i=0;i<$scope.entity.appStyle.length;i++) {
item = $scope.entity.appStyle[i];
if (item.style_value == "" || item.style_value == null) {
$scope.errmsg = "value不能为空";
return;
}
if (item.style_value.substr(0,4).toLowerCase() != "http" &&
item.style_value.substr(0,5).toLowerCase() != "https") {
$scope.errmsg = "value必须以http或者https开头";
return;
}
}
$scope.ctrl.sending = true;
$http.put('/app/cms/app_style/style_group/' + $scope.params.style_id + '/style?originStyleId=' + $scope.ctrl.originStyleId, $scope.entity).then(function(){
$scope.ctrl.sending = false;
$state.go('cms.app_style.app_style_preview',{style_id: $scope.params.style_id});
}, function (resp) {
$scope.ctrl.sending = false;
$scope.errmsg = resp.data.message;
})
}
$scope.toggleAppStyleIsValid = function(styleId) {
if (styleId) {
commonDialog.confirm({
title: '确认操作',
content: '当前操作将发布title为' +styleId +"的app图标是否确认"
}).then(function () {
$http.put('/app/cms/app_style/style_group/' + styleId).then(function () {
$state.reload();
})
})
}
}
}]);
app.controller('cmsAppStyleSaveCtrl', ['$scope', '$http', '$state', 'style', function ($scope, $http, $state, style) {
$scope.ctrl = {sending: false, flag: true};
$scope.entity={};
$scope.entity.appStyle = angular.copy(style);
$scope.params = {style_id: ""};
$scope.addSpecOption = function() {
$scope.entity.appStyle.push({});
};
// 删除规格选项
$scope.delSpecOption = function(index) {
console.log(index)
$scope.entity.appStyle.splice(index, 1);
};
$scope.saveOneGroupAppStyle = function() {
if ($scope.params.style_id == "" || $scope.params.style_id == null) {
$scope.errmsg = "title不能为空";
return;
}
var item = "";
for (var i=0;i<$scope.entity.appStyle.length;i++) {
item = $scope.entity.appStyle[i];
if (item.style_value == "" || item.style_value == null) {
$scope.errmsg = "value不能为空";
return;
}
if (item.style_value.substr(0,4).toLowerCase() != "http" &&
item.style_value.substr(0,5).toLowerCase() != "https") {
$scope.errmsg = "value必须以http或者https开头";
return;
}
}
$scope.ctrl.sending = true;
$http.post('/app/cms/app_style/style_group?style_id=' + $scope.params.style_id, $scope.entity).then(function(){
$scope.ctrl.sending = false;
$state.go('cms.app_style.app_style_preview', {style_id: $scope.params.style_id});
}, function (resp) {
$scope.ctrl.sending = false;
$scope.errmsg = resp.data.message;
})
};
$scope.checkStyleValue = function () {
}
}]);
app.filter('topUpType', function () { app.filter('topUpType', function () {
return function (status) { return function (status) {
switch (status + '') { switch (status + '') {

@ -0,0 +1,65 @@
<div ui-view>
<section class="content-header">
<h1>APP_STYLE</h1>
<ol class="breadcrumb">
<li><a ui-sref="cms">网站管理</a></li>
<li>app图标</li>
</ol>
</section>
<section class="content" >
<div class="box box-warning">
<div class="box-body">
<div class="form-inline">
<div class="form-group">
<a class="btn btn-success" ui-sref=".app_style_save">
<i class="fa fa-plus"></i> New App Style
</a>
</div>
</div>
</div>
</div>
<div class="box box-default">
<div class="box-body table-responsive">
<table class="table table-bordered table-hover table-striped">
<thead>
<tr>
<th>Title</th>
<th>Published</th>
<th>Operation</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="appStyleGroup in appStyleGroups" class="ng-scope">
<td><a role="button" ui-sref=".app_style_preview({style_id:appStyleGroup.style_id})" ng-bind="appStyleGroup.style_id"></a></td>
<td>
<a title="Toggle publish status">
<i class="fa" ng-class="{'fa-check text-success':appStyleGroup.is_valid,'fa-remove text-danger':!appStyleGroup.is_valid}"></i>
</a>
</td>
<td>
<a role="button" ui-sref=".app_style_edit({style_id:appStyleGroup.style_id})" title="edit"><i class="fa fa-edit"></i></a>
<a role="button" ui-sref=".app_style_preview({style_id:appStyleGroup.style_id})" title="preview"><i class="fa fa-eye"></i></a>
</td>
</tr>
</tbody>
</table>
</div>
<div class="box-footer">
<uib-pagination class="pagination"
total-items="pagination.totalCount"
boundary-links="true"
ng-model="pagination.page"
items-per-page="pagination.limit"
max-size="10"
ng-change="appStyleGroupList()"
previous-text="&lsaquo;"
next-text="&rsaquo;"
first-text="&laquo;"
last-text="&raquo;"></uib-pagination>
<div class="row">
<div class="col-xs-12">Total Records:{{pagination.totalCount}};Total Pages:{{pagination.totalPages}}</div>
</div>
</div>
</div>
</section>
</div>

@ -0,0 +1,67 @@
<div ui-view xmlns="http://www.w3.org/1999/html">
<section class="content-header">
<h1>APP_STYLE</h1>
<ol class="breadcrumb">
<li><a ui-sref="cms">网站管理</a></li>
<li><a ui-sref="^" ui-sref-opts="{reload:true}">app图标</a></li>
<li class="active" ng-bind="!ctrl.flag?'Edit Article':'New Article'"></li>
</ol>
</section>
<section class="content" >
<div class="box box-warning">
<div class="box-body">
<div class="form-inline">
<div class="form-group">
<div class="form-group">
<label class="control-label" for="short-name-search">title</label>
<input type="text" class="form-control" id="short-name-search" name="style_id"
ng-model="params.style_id" required>
<div class="checkbox-inline" ng-if="!ctrl.flag">
<label><input role="button" type="radio" ng-value="true" ng-model="entity.appStyle[0].is_valid" ng-change="toggleAppStyleIsValid(params.style_id)"> Published</label>
</div>
</div>
<!--<div class="form-group">-->
<!--<button class="btn btn-success" type="button" ng-click="addSpecOption()">-->
<!--<i class="fa fa-plus"></i> New App Style-->
<!--</button>-->
<!--</div>-->
</div>
</div>
</div>
</div>
<div class="box box-default">
<div class="alert alert-danger" ng-if="errmsg" ng-bind="errmsg"></div>
<div class="box-body table-responsive">
<table class="table table-bordered table-hover table-striped">
<thead>
<tr>
<th>Key</th>
<th>Value</th>
<!--<th class=>Operation</th>-->
</tr>
</thead>
<tbody>
<tr ng-repeat="appStyle in entity.appStyle">
<td>
<input class="form-control" ng-model="appStyle.style_key" placeholder="Key" disabled>
</td>
<td>
<input class="form-control" name="style_value" ng-model="appStyle.style_value" placeholder="Value">
</td>
<!--<td>-->
<!--<button type="button" ng-click="delSpecOption($index)"-->
<!--class="btn btn-default" title="删除">-->
<!--<i class="fa fa-trash-o"></i> 删除-->
<!--</button>-->
<!--</td>-->
</tr>
</tbody>
</table>
</div>
<div class="modal-footer">
<button class="btn btn-success" type="button" ng-click="saveOneGroupAppStyle(style_form)" ng-disabled="ctrl.sending">Submit</button>
<a role="button" class="btn btn-danger" ui-sref="^" ui-sref-opts="{reload:true}">Cancel</a>
</div>
</div>
</section>
</div>

@ -0,0 +1,46 @@
<div ui-view>
<section class="content-header">
<h1>APP_STYLE</h1>
<ol class="breadcrumb">
<li><a ui-sref="cms">网站管理</a></li>
<li><a ui-sref="^" ui-sref-opts="{reload:true}">app图标</a></li>
<li class="active">app图标详情</li>
</ol>
</section>
<section class="content" >
<div class="box box-warning">
<div class="box-body">
<div class="form-inline">
<div class="form-group">
<a class="btn btn-success" ui-sref="cms.app_style.app_style_save">
<i class="fa fa-plus"></i> New App Style
</a>
<a class="btn btn-primary" ui-sref="cms.app_style.app_style_edit({style_id:appStyles[0].style_id})">
<i class="fa fa-edit"></i> Edit App Style
</a>
</div>
</div>
</div>
</div>
<div class="box box-default">
<div class="box-body table-responsive">
<table class="table table-bordered table-hover table-striped">
<thead>
<tr>
<th>Title</th>
<th>Style_Key</th>
<th>Style_Value</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="appStyle in appStyles">
<td ng-bind="appStyle.style_id"></td>
<td ng-bind="appStyle.style_key"></td>
<td style="width: 50%;" ng-bind="appStyle.style_value"></td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
</div>

@ -26,6 +26,9 @@
<div class="btn-group"> <div class="btn-group">
<a class="btn btn-default" ui-sref=".category({catId:'app_ad'})">App广告页</a> <a class="btn btn-default" ui-sref=".category({catId:'app_ad'})">App广告页</a>
</div> </div>
<div class="btn-group">
<a class="btn btn-default" ui-sref=".app_style">App图标</a>
</div>
<div class="btn-group"> <div class="btn-group">
<a class="btn btn-default" ui-sref=".phone_top_up">话费充值</a> <a class="btn btn-default" ui-sref=".phone_top_up">话费充值</a>
</div> </div>

@ -60,6 +60,8 @@ define(['../app','decimal'], function (app,Decimal) {
return '/static/images/jd_sign_lg.png'; return '/static/images/jd_sign_lg.png';
case 'hf': case 'hf':
return '/static/images/hf_sign_lg.png'; return '/static/images/hf_sign_lg.png';
case 'Rpay':
return '/static/images/rpayplus_sign_lg.png';
} }
} }
}); });

@ -45,6 +45,8 @@
uib-tooltip="JD Pay" ng-if="order.channel=='jd'"/> uib-tooltip="JD Pay" ng-if="order.channel=='jd'"/>
<img src="/static/images/hf_sign.png" <img src="/static/images/hf_sign.png"
uib-tooltip="HF Pay" ng-if="order.channel=='hf'"/> uib-tooltip="HF Pay" ng-if="order.channel=='hf'"/>
<img src="/static/images/rpayplus_sign.png"
uib-tooltip="RPay+" ng-if="order.channel=='Rpay'"/>
{{order.order_id}} {{order.order_id}}
</td> </td>
</p> </p>
@ -120,7 +122,7 @@
<p class="form-control-static" ng-bind="order.customer_payment_amount|currency:order.currency+' '"></p> <p class="form-control-static" ng-bind="order.customer_payment_amount|currency:order.currency+' '"></p>
</div> </div>
</div> </div>
<div class="form-group" ng-if="order.status>=5 && order.channel!='hf'"> <div class="form-group" ng-if="order.status>=5 && (order.channel!='hf'||order.channel!='Rpay')">
<label class="control-label col-xs-3">Exchange Rate</label> <label class="control-label col-xs-3">Exchange Rate</label>
<div class="col-xs-9"> <div class="col-xs-9">
<p class="form-control-static" ng-bind="order.exchange_rate"></p> <p class="form-control-static" ng-bind="order.exchange_rate"></p>

@ -392,6 +392,8 @@ define(['angular', '../../analysis/bd/analysis-bd'], function (angular) {
return '/static/images/jd_sign_lg.png'; return '/static/images/jd_sign_lg.png';
case 'hf': case 'hf':
return '/static/images/hf_sign_lg.png'; return '/static/images/hf_sign_lg.png';
case 'Rpay':
return '/static/images/rpayplus_sign_lg.png';
} }
} }
}); });

@ -132,6 +132,19 @@
</div> </div>
</div> </div>
</div> </div>
<div class="col-xs-4" ng-if="detail.RpayDetail">
<div class="info-box" style="background: lightcyan">
<div class="info-box-icon" style=" background: bottom;">
<img uib-tooltip="Rpay+" src="/static/images/rpayplus_sign_lg.png">
</div>
<div class="info-box-content">
<h5>Transaction: ${{detail.RpayDetail.total_amount}}</h5>
<h5>Commission: ${{detail.RpayDetail.total_prize}}</h5>
<h5>Send: ${{detail.RpayDetail.send_prize}}</h5>
<h5>Fund: ${{detail.RpayDetail.total_donation}}</h5>
</div>
</div>
</div>
</div> </div>
<div class="box box-default" ng-if="!detail.no_record"> <div class="box box-default" ng-if="!detail.no_record">
<div class="box-header">Details<span class="text-danger">(Red Client Moniker means received from BD User who left company.)</span></div> <div class="box-header">Details<span class="text-danger">(Red Client Moniker means received from BD User who left company.)</span></div>
@ -174,6 +187,7 @@
<img ng-if="log.channel=='Bestpay'" uib-tooltip="Bestpay" src="/static/images/bestpay_sign_lg.png"> <img ng-if="log.channel=='Bestpay'" uib-tooltip="Bestpay" src="/static/images/bestpay_sign_lg.png">
<img ng-if="log.channel=='jd'" uib-tooltip="Bestpay" src="/static/images/jd_sign_lg.png"> <img ng-if="log.channel=='jd'" uib-tooltip="Bestpay" src="/static/images/jd_sign_lg.png">
<img ng-if="log.channel=='hf'" uib-tooltip="Bestpay" src="/static/images/hf_sign_lg.png"> <img ng-if="log.channel=='hf'" uib-tooltip="Bestpay" src="/static/images/hf_sign_lg.png">
<img ng-if="log.channel=='Rpay'" uib-tooltip="Rpay" src="/static/images/rpayplus_sign_lg.png">
</td> </td>
</tr> </tr>
</tbody> </tbody>

@ -107,6 +107,18 @@
</div> </div>
</div> </div>
</div> </div>
<div class="col-xs-4" ng-if="report.RpayReport">
<div class="info-box" style="background: lightcyan">
<div class="info-box-icon" style=" background: bottom;">
<img uib-tooltip="Rpay+" src="/static/images/rpayplus_sign_lg.png">
</div>
<div class="info-box-content">
<h5>BD Total Commission: ${{report.RpayReport.total_prize}}</h5>
<h5>BD Total Send: ${{report.RpayReport.total_send_prize}}</h5>
<h5>BD Total Fund: ${{report.RpayReport.total_donation}}</h5>
</div>
</div>
</div>
</div> </div>
<div class="box box-default"> <div class="box box-default">
<div class="box-header">BD Commission</div> <div class="box-header">BD Commission</div>

@ -63,6 +63,10 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
url: '/hfupdate', url: '/hfupdate',
templateUrl: '/static/config/devtools/templates/hfupdate.html', templateUrl: '/static/config/devtools/templates/hfupdate.html',
controller: 'hfupdateCtrl' controller: 'hfupdateCtrl'
}).state('devtools.rpayupdate', {
url: '/rpayupdate',
templateUrl: '/static/config/devtools/templates/rpayupdate.html',
controller: 'rpayupdateCtrl'
}) })
}]); }]);
app.controller('devManualRefundCtrl', ['$scope', '$http', 'commonDialog', function ($scope, $http, commonDialog) { app.controller('devManualRefundCtrl', ['$scope', '$http', 'commonDialog', function ($scope, $http, commonDialog) {
@ -384,6 +388,22 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
}]); }]);
app.controller('rpayupdateCtrl', ['$scope', '$http','$filter', function ($scope, $http,$filter) {
$scope.selecttotal = true;
$scope.update = function () {
$scope.totalhide = true;
$scope.selecttotal = false;
$http.put('/dev/rpayUpdate').then(function (resp) {
$scope.totalhide = false;
$scope.selecttotal = true;
}, function (resp) {
alert(resp.data.message);
})
}
}]);
return app; return app;
}); });

@ -1,5 +1,5 @@
<section class="content-header"> <section class="content-header">
<h1>更新HF短链接</h1> <h1>更新HF短链接</h1>
<ol class="breadcrumb"> <ol class="breadcrumb">
<li> <li>
<i class="fa fa-cog"></i> Basic Config <i class="fa fa-cog"></i> Basic Config

@ -83,6 +83,10 @@
<i class="fa fa-credit-card-alt"></i> <i class="fa fa-credit-card-alt"></i>
更新HF短连接 更新HF短连接
</a> </a>
<a class="btn btn-app" role="button" ui-sref=".rpayupdate">
<i class="fa fa-credit-card-alt"></i>
更新Rpay+商户费率时间
</a>
</div> </div>
</div> </div>
</section> </section>

@ -0,0 +1,15 @@
<section class="content-header">
<h1>更新Rpay进件费率时间</h1>
<ol class="breadcrumb">
<li>
<i class="fa fa-cog"></i> Basic Config
</li>
<li><a ui-sref="^">Dev Tools</a></li>
<li class="active">rpayupdate</li>
</ol>
</section>
<section class="content">
<div class="box">
<button class="btn btn-primary" ng-click="update()">Update</button> <label ng-hide="selecttotal" style="padding-left: 30px">请稍后</label>
</div>
</section>

@ -53,7 +53,7 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr ng-repeat="log in settleLogs"> <tr ng-repeat="log in settleLogs | orderBy:'-settlementDate':desc">
<td ng-bind="log.startString"></td> <td ng-bind="log.startString"></td>
<td ng-bind="log.endString"></td> <td ng-bind="log.endString"></td>
<td ng-bind="log.settlementDateString"></td> <td ng-bind="log.settlementDateString"></td>

@ -24,6 +24,21 @@
is-open="dtCtrl.open" ng-click="dtCtrl.open=true"> is-open="dtCtrl.open" ng-click="dtCtrl.open=true">
</div> </div>
</div> </div>
<!-- 新增orderId查询条件 -->
<div class="form-group">
<label class="control-label col-sm-3"
for="orderIdInput">
Order ID
</label>
<div class="col-sm-7">
<input class="form-control"
type="text"
ng-model="params.orderId"
id="orderIdInput">
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-3" for="clientOrderIdInput">Client Order ID</label> <label class="control-label col-sm-3" for="clientOrderIdInput">Client Order ID</label>
<div class="col-sm-7"> <div class="col-sm-7">
@ -61,6 +76,7 @@
<tr> <tr>
<th>Time</th> <th>Time</th>
<th>Order ID</th> <th>Order ID</th>
<th>Client Order ID</th>
<th>Notify Url</th> <th>Notify Url</th>
<th>Success</th> <th>Success</th>
<th>Http Code</th> <th>Http Code</th>
@ -71,7 +87,8 @@
<tr ng-repeat="log in notifyLogs"> <tr ng-repeat="log in notifyLogs">
<td ng-bind="log.addtime|date:'yyyy-MM-dd HH:mm:ss'"></td> <td ng-bind="log.addtime|date:'yyyy-MM-dd HH:mm:ss'"></td>
<td ng-bind="log.order_id"></td> <td ng-bind="log.order_id"></td>
<td ng-bind="log.notify_url|limitTo:50" title="{{log.notify_url}}"></td> <td ng-bind="log.client_order_id"></td>
<td ng-bind="log.notify_url" title="{{log.notify_url}}"></td>
<td ng-bind="log.success?'Yes':'No'" ng-class="{'text-success':log.success,'text-danger':!log.success}"></td> <td ng-bind="log.success?'Yes':'No'" ng-class="{'text-success':log.success,'text-danger':!log.success}"></td>
<td ng-bind="log.http_code"></td> <td ng-bind="log.http_code"></td>
<td ng-bind="log.err_msg|limitTo:10" title="{{log.err_msg}}"></td> <td ng-bind="log.err_msg|limitTo:10" title="{{log.err_msg}}"></td>

@ -159,6 +159,23 @@
<div class="description-header text-bold"><img src="/static/images/hf_sign.png"/>HF</div> <div class="description-header text-bold"><img src="/static/images/hf_sign.png"/>HF</div>
</div> </div>
</div> </div>
<!-- dashboard显示Rpay+交易额-->
<div class="col-sm-4 col-xs-6">
<div class="description-block">
<div class="description-text">交易额:
<label class="description-text text-red"
ng-bind="totalChannelAmount.rpayamount|currency: ' $ '"></label>
</div>
<div class="description-text">订单数:
<label class="description-text text-red"
ng-bind="totalChannelAmount.rpay_order_count"></label>
</div>
<div class="description-header text-bold"><img src="/static/images/rpayplus_sign.png"/>Rpay+</div>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

@ -206,6 +206,8 @@
uib-tooltip="JD Pay" ng-if="trade.channel=='jd'"/> uib-tooltip="JD Pay" ng-if="trade.channel=='jd'"/>
<img src="/static/images/hf_sign.png" <img src="/static/images/hf_sign.png"
uib-tooltip="HF Pay" ng-if="trade.channel=='hf'"/> uib-tooltip="HF Pay" ng-if="trade.channel=='hf'"/>
<img src="/static/images/rpayplus_sign.png"
uib-tooltip="RPay+" ng-if="trade.channel=='Rpay'"/>
{{trade.order_id2}} {{trade.order_id2}}
</td> </td>
<td ng-bind="trade.currency"></td> <td ng-bind="trade.currency"></td>
@ -237,7 +239,7 @@
- -
</p> </p>
</td> </td>
<td ng-bind="trade.order_detail||trade.remark"></td> <td ng-bind="trade.order_detail"></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

@ -101,6 +101,8 @@
uib-tooltip="JD Pay" ng-if="order.channel=='jd'"/> uib-tooltip="JD Pay" ng-if="order.channel=='jd'"/>
<img src="/static/images/hf_sign.png" <img src="/static/images/hf_sign.png"
uib-tooltip="HF Pay" ng-if="order.channel=='hf'"/> uib-tooltip="HF Pay" ng-if="order.channel=='hf'"/>
<img src="/static/images/rpayplus_sign.png"
uib-tooltip="RPay+" ng-if="order.channel=='Rpay'"/>
{{order.order_id}} {{order.order_id}}
</td> </td>
</p> </p>

@ -200,6 +200,8 @@
uib-tooltip="JD Pay" ng-if="trade.channel=='jd'"/> uib-tooltip="JD Pay" ng-if="trade.channel=='jd'"/>
<img src="/static/images/hf_sign.png" <img src="/static/images/hf_sign.png"
uib-tooltip="HF Pay" ng-if="trade.channel=='hf'"/> uib-tooltip="HF Pay" ng-if="trade.channel=='hf'"/>
<img src="/static/images/rpayplus_sign.png"
uib-tooltip="RPay+" ng-if="trade.channel=='Rpay'"/>
{{trade.order_id2}} {{trade.order_id2}}
</td> </td>
<td ng-bind="trade.currency"></td> <td ng-bind="trade.currency"></td>
@ -211,7 +213,7 @@
<p ng-if="trade.trans_type=='clearing'"> <p ng-if="trade.trans_type=='clearing'">
- -
</p> </p>
<p ng-if="trade.trans_type !='clearing' && trade.channel!='hf'"> <p ng-if="trade.trans_type !='clearing' && (order.channel!='hf'||order.channel!='Rpay')">
{{trade.exchange_rate}} {{trade.exchange_rate}}
</p> </p>
</td> </td>
@ -231,7 +233,7 @@
- -
</p> </p>
</td> </td>
<td ng-bind="trade.order_detail||trade.remark"></td> <td ng-bind="trade.order_detail"></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

@ -3142,20 +3142,17 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}) })
}; };
$scope.applyRpaySubMerchantId = function () { $scope.applyRpaySubMerchantId = function () {
$http.post('/sys/partners/' + $scope.partner.client_moniker + '/registRpaySubMerchantId').then(function (resp) { $uibModal.open({
commonDialog.alert({ templateUrl: '/static/payment/partner/templates/apply_rpay_sub_merchant_id.html',
title: 'Success', controller: 'applyRpaySubMerchantIdCtrl',
content: 'Modify Rpay+ Sub Merchant ID successfully', resolve: {
type: 'success' subMerchantInfo: function () {
}); return $scope.partner;
$state.reload(); }
}, function (resp) { }
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}) }).result.then(function () {
}); $scope.loadSubMerchantInfos();
})
}; };
$scope.loadSubMerchantInfos(); $scope.loadSubMerchantInfos();
}]); }]);
@ -3203,10 +3200,57 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}); });
} }
}, function (resp) { }, function (resp) {
$scope.errmsg = resp.data.message; commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
}) })
} }
}]); }]);
app.controller('applyRpaySubMerchantIdCtrl', ['$scope', '$http', '$uibModal', '$state', 'subMerchantInfo', 'businessStructuresMap','$filter', 'commonDialog','timezone', function ($scope, $http, $uibModal, $state, subMerchantInfo, businessStructuresMap,$filter, commonDialog,timezone) {
$scope.subMerchantInfo = angular.copy(subMerchantInfo);
$scope.business_structures = businessStructuresMap.configs();
$scope.timezone = timezone.configs();
$scope.saveRpayAppliy = function (form) {
var merchantInfo = {};
$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;
}
}
});
$http.post('/sys/partners/' + $scope.subMerchantInfo.client_moniker + '/registRpaySubMerchantId', merchantInfo).then(function (resp) {
$scope.apply_sub_merchant_id = resp.data;
$scope.$close();
if (subMerchantInfo.sub_merchant_id != null) {
commonDialog.alert({
title: 'Success',
content: 'Modify Rpay+ Sub Merchant ID successfully',
type: 'success'
});
$state.reload();
}
}, function (resp) {
commonDialog.alert({
title: 'Error',
content: resp.data.message,
type: 'error'
});
})
}
}]);
app.controller('permissionClientCtrl', ['$scope', '$http', '$uibModal', '$state', '$filter', 'commonDialog', function ($scope, $http, $uibModal, $state, $filter, commonDialog) { app.controller('permissionClientCtrl', ['$scope', '$http', '$uibModal', '$state', '$filter', 'commonDialog', function ($scope, $http, $uibModal, $state, $filter, commonDialog) {
$scope.clientPermission = {client_moniker:$scope.partner.client_moniker}; $scope.clientPermission = {client_moniker:$scope.partner.client_moniker};
$scope.loadPermissionList = function () { $scope.loadPermissionList = function () {

@ -70,6 +70,13 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload'], funct
$scope.partner = partner.data; $scope.partner = partner.data;
$scope.partner.partner_type = $scope.partner.website ? 'website' : 'photo'; $scope.partner.partner_type = $scope.partner.website ? 'website' : 'photo';
$scope.getMerchantLocation = function () {
$http.get('/sys/partners/' + $scope.partner.client_moniker + '/location').then(function (resp) {
$scope.merchant_location = resp.data;
});
};
$scope.getMerchantLocation();
$scope.uploadLogo = function (file) { $scope.uploadLogo = function (file) {
if (file != null) { if (file != null) {
if (file.size > 1 * 1024 * 1024) { if (file.size > 1 * 1024 * 1024) {
@ -553,7 +560,7 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload'], funct
}; };
}]); }]);
app.controller('clientPaymentInfoCtrl', ['$scope', '$http', 'commonDialog', function ($scope, $http, commonDialog) { app.controller('clientPaymentInfoCtrl', ['$scope', '$http', '$state', 'commonDialog', function ($scope, $http, $state, commonDialog) {
$scope.paymentInfo = $scope.partner; $scope.paymentInfo = $scope.partner;
$scope.old_customer_surcharge_rate = angular.copy($scope.partner.customer_surcharge_rate); $scope.old_customer_surcharge_rate = angular.copy($scope.partner.customer_surcharge_rate);
$scope.qrConfig = {currency: 'AUD'}; $scope.qrConfig = {currency: 'AUD'};
@ -822,7 +829,25 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload'], funct
$scope.bankshow = false; $scope.bankshow = false;
}; };
// 新增需求,商户端刷新支付秘钥
$scope.refreshCredential = function () {
commonDialog.confirm({
title: 'Warning',
content: 'Refresh Credential will expire the current one, ' +
'which will cause the current payment service disabled. ' +
'Are you sure going on?'
}).then(function () {
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/credential_code').then(function () {
$state.reload();
}, function (resp) {
commonDialog.alert({
title: 'Error',
content: resp.data.message,
type: 'error'
})
})
})
};
}]); }]);
app.controller('clientPaymentMaterialCtrl', ['$scope', '$http', 'partner', function ($scope, $http, partner) { app.controller('clientPaymentMaterialCtrl', ['$scope', '$http', 'partner', function ($scope, $http, partner) {

@ -0,0 +1,238 @@
<div class="content">
<form novalidate name="subForm">
<div class="row">
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">Apply Rpay+ Sub Merchant Id</div>
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group"
ng-class="{'has-error':subForm.company_name.$invalid && subForm.company_name.$dirty}">
<label class="control-label col-sm-3" for="company_name_input">* Company Name</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.company_name"
type="text" name="company_name" id="company_name_input" required maxlength="50">
<div ng-messages="subForm.company_name.$error" ng-if="subForm.company_name.$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.business_name.$invalid && subForm.business_name.$dirty}">
<label class="control-label col-sm-3" for="business_name_input">* Business Name</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.business_name"
type="text" name="business_name" id="business_name_input" required maxlength="50">
<div ng-messages="subForm.business_name.$error" ng-if="subForm.business_name.$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.company_shortname.$invalid && subForm.company_shortname.$dirty}">
<label class="control-label col-sm-3" for="company_shortname_input">* Company Short Name</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.short_name"
type="text" name="company_shortname" id="company_shortname_input" required maxlength="50">
<div ng-messages="subForm.company_shortname.$error" ng-if="subForm.company_shortname.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
<p class="small text-danger" ng-message="maxlength">Length is more than 50</p>
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3" for="company_website_input">Website</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.company_website"
type="text" name="company_website" id="company_website_input">
</div>
</div>
<div class="form-group"
ng-class="{'has-error':subForm.description.$invalid && subForm.description.$dirty}">
<label class="control-label col-sm-3" for="description_input">* Company description</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.description"
type="text" name="description" id="description_input" required maxlength="256">
<div ng-messages="subForm.description.$error" ng-if="subForm.description.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
<p class="small text-danger" ng-message="maxlength">Length is more than 256</p>
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':subForm.abn.$invalid && subForm.abn.$dirty}">
<label class="control-label col-sm-3" for="abn_input">* abn</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.abn"
type="text" name="abn" id="abn_input" required maxlength="256">
<div ng-messages="subForm.abn.$error" ng-if="subForm.abn.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3" for="acn_input">acn</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.acn"
type="text" name="acn" id="acn_input">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3" for="business-structure-input">Business Structure</label>
<div class="col-sm-8">
<select class="form-control" name="business_structure" ng-model="subMerchantInfo.business_structure"
id="business-structure-input"
ng-options="structure.value as structure.label for structure in business_structures">
<option value="">Please Choose</option>
</select>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':subForm.company_phone.$invalid && subForm.company_phone.$dirty}">
<label class="control-label col-sm-3" for="company_phone_input">* Company Phone</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.company_phone"
type="tel" name="company_phone" id="company_phone_input" required maxlength="256">
<div ng-messages="subForm.company_phone.$error" ng-if="subForm.company_phone.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
</div>
</div>
</div>
<div class="form-group" ng-class="{'has-error':subForm.contact_name.$invalid && subForm.contact_name.$dirty}">
<label class="control-label col-sm-3" for="contact_name_input">* Contact Name</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.contact_person"
type="text" name="contact_name" id="contact_name_input" required maxlength="256">
<div ng-messages="subForm.contact_name.$error" ng-if="subForm.contact_name.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
</div>
</div>
</div>
<div class="form-group" ng-class="{'has-error':subForm.contact_phone.$invalid && subForm.contact_phone.$dirty}">
<label class="control-label col-sm-3" for="contact_phone_input">* Contact Phone</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.contact_phone"
type="text" name="contact_phone" id="contact_phone_input" required maxlength="256">
<div ng-messages="subForm.contact_phone.$error" ng-if="subForm.contact_phone.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
</div>
</div>
</div>
<div class="form-group" ng-class="{'has-error':subForm.contact_email.$invalid && subForm.contact_email.$dirty}">
<label class="control-label col-sm-3" for="contact_email_input">* Contact Email</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.contact_email"
type="text" name="contact_email" id="contact_email_input" required maxlength="256">
<div ng-messages="subForm.contact_email.$error" ng-if="subForm.contact_email.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
</div>
</div>
</div>
<div class="form-group" ng-class="{'has-error':subForm.country.$invalid && subForm.country.$dirty}">
<label class="control-label col-sm-3" for="country_input">* Company country</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.country"
type="text" name="country" id="country_input" required maxlength="256">
<div ng-messages="subForm.country.$error" ng-if="subForm.country.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
</div>
</div>
</div>
<div class="form-group" ng-class="{'has-error':subForm.address.$invalid && subForm.address.$dirty}">
<label class="control-label col-sm-3" for="company_address_input">* Company address</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.address"
type="text" name="address" id="company_address_input" required maxlength="256">
<div ng-messages="subForm.address.$error" ng-if="subForm.address.$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.suburb.$invalid && subForm.suburb.$dirty}">
<label class="control-label col-sm-3" for="company_suburb_input">* suburb</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.suburb"
type="text" name="suburb" id="company_suburb_input" required maxlength="256">
<div ng-messages="subForm.suburb.$error" ng-if="subForm.suburb.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
</div>
</div>
</div>
<div class="form-group" ng-class="{'has-error':subForm.postcode.$invalid && subForm.postcode.$dirty}">
<label class="control-label col-sm-3" for="company_postcode_input">* postCode</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.postcode"
type="text" name="postcode" id="company_postcode_input" required maxlength="256">
<div ng-messages="subForm.postcode.$error" ng-if="subForm.postcode.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
</div>
</div>
</div>
<div class="form-group" ng-class="{'has-error':subForm.state.$invalid && subForm.state.$dirty}">
<label class="control-label col-sm-3" for="state_input">* state</label>
<div class="col-sm-8">
<input class="form-control" ng-model="subMerchantInfo.state"
type="text" name="state" id="state_input" required maxlength="256">
<div ng-messages="subForm.state.$error" ng-if="subForm.state.$dirty">
<p class="small text-danger" ng-message="required">Required Field</p>
<p class="small text-danger" ng-message="maxlength">Length is more than 10</p>
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3" for="timezone-input">TimeZone</label>
<div class="col-sm-8">
<select class="form-control" name="timezone" ng-model="subMerchantInfo.timezone"
id="timezone-input"
ng-options="tz.key as tz.detail for tz in timezone">
<option value="">Please Choose</option>
</select>
</div>
</div>
</div>
</div>
</div>
<!--end 商品基本资料-->
<!--<div class="panel panel-default">-->
<!--<div class="panel-heading">Goods Qr Code</div>-->
<!--<div class="panel-body">-->
<!--</div>-->
<!--</div>-->
<!--end 商品二维码-->
<div class="btn-group margin-bottom margin-top">
<button class="btn btn-success" type="button"
ng-click="saveRpayAppliy(subForm)">Submit
</button>
</div>
</div>
</div>
</form>
</div>

@ -3,7 +3,7 @@
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12">
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading">Apply Sub Merchant Id</div> <div class="panel-heading">Apply Wechat Sub Merchant Id</div>
<div class="panel-body"> <div class="panel-body">
<div class="form-horizontal"> <div class="form-horizontal">
<div class="form-group" <div class="form-group"

@ -303,6 +303,19 @@
</div> </div>
</div> </div>
</div> </div>
<span id="merchant_location" hidden>{{merchant_location}}</span>
<div class="panel panel-default">
<div class="panel-heading" style="font-size: larger">Location
<span id="editmap" hidden>false</span>
<span id="add_view" hidden>false</span>
</div>
<div class="form-group">
<div class="embed-responsive" style="height: 300px;">
<iframe id="merchant_detail" name="merchant_detail" class="embed-responsive-item"
src="one_locations.html"></iframe>
</div>
</div>
</div>
</div> </div>
<div ng-show="partner.source == 4 && (partner.approve_result !=3 && partner.approve_result !=1)"> <div ng-show="partner.source == 4 && (partner.approve_result !=3 && partner.approve_result !=1)">
<form class="form-horizontal" novalidate name="partnerForm"> <form class="form-horizontal" novalidate name="partnerForm">

@ -87,7 +87,15 @@
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-2">Gateway Credential</label> <label class="control-label col-sm-2">Gateway Credential</label>
<div class="col-sm-10"> <div class="col-sm-10">
<p class="form-control-static" ng-bind="partner.credential_code"></p> <p class="form-control-static">
<span ng-bind="partner.credential_code"></span>
<a role="button"
ng-click="refreshCredential()"
title="refresh"
ng-if="'111'|withRole">
<i class="fa fa-refresh"></i>
</a>
</p>
</div> </div>
</div> </div>
</div> </div>

@ -179,6 +179,7 @@
<tr> <tr>
<th>Rate Name</th> <th>Rate Name</th>
<th>Rate Value</th> <th>Rate Value</th>
<th>Transaction Fee</th>
<th>Active Time</th> <th>Active Time</th>
<th>Expire Time</th> <th>Expire Time</th>
<th ng-if="bankCtrl.rate_name=='Wechat'">Clean Days</th> <th ng-if="bankCtrl.rate_name=='Wechat'">Clean Days</th>
@ -193,6 +194,7 @@
ng-class="{'text-bold':rate.current,'success':rate.active}"> ng-class="{'text-bold':rate.current,'success':rate.active}">
<td ng-bind="rate.rate_name"></td> <td ng-bind="rate.rate_name"></td>
<td ng-bind="rate.rate_value"></td> <td ng-bind="rate.rate_value"></td>
<td ng-bind="rate.transaction_fee"></td>
<td ng-bind="rate.active_time|date:'yyyy-MM-dd'"></td> <td ng-bind="rate.active_time|date:'yyyy-MM-dd'"></td>
<td ng-bind="rate.expiry_time|date:'yyyy-MM-dd'"></td> <td ng-bind="rate.expiry_time|date:'yyyy-MM-dd'"></td>
<td ng-if="rate.rate_name=='Wechat'">T+{{rate.clean_days}}</td> <td ng-if="rate.rate_name=='Wechat'">T+{{rate.clean_days}}</td>

@ -88,30 +88,6 @@
</div> </div>
</div> </div>
<div class="form-group"
ng-class="{'has-error':rate_form.bestpay_rate_value.$invalid && rate_form.bestpay_rate_value.$dirty}">
<label class="control-label col-sm-4" for="bestpay_rate_value_input">Bestpay Rate Value</label>
<div class="col-sm-6">
<div class="input-group">
<input type="number" name="bestpay_rate_value" stringToNumber2 class="form-control" ng-model="rate.bestpay_rate_value"
min="0.6" max="2.2" step="0.1" id="bestpay_rate_value_input" required>
<div class="input-group-addon">%</div>
</div>
<div ng-messages="rate_form.bestpay_rate_value.$error" ng-if="rate_form.bestpay_rate_value.$dirty">
<div class="small text-danger" ng-message="max">
<i class="glyphicon glyphicon-alert"></i> No more than 2.2%
</div>
<div class="small text-danger" ng-message="min">
<i class="glyphicon glyphicon-alert"></i> No less than 0.6%
</div>
<div class="small text-danger" ng-message="required">
<i class="glyphicon glyphicon-alert"></i> Required Field
</div>
</div>
</div>
</div>
<div class="form-group" <div class="form-group"
ng-class="{'has-error':rate_form.jd_rate_value.$invalid && rate_form.jd_rate_value.$dirty}"> ng-class="{'has-error':rate_form.jd_rate_value.$invalid && rate_form.jd_rate_value.$dirty}">
<label class="control-label col-sm-4" for="jd_rate_value_input">JD Rate Value</label> <label class="control-label col-sm-4" for="jd_rate_value_input">JD Rate Value</label>
@ -184,6 +160,29 @@
</div> </div>
</div> </div>
<!-- 新增transaction_fee -->
<div class="form-group"
ng-class="{'has-error':rate_form.transaction_fee.$invalid && rate_form.transaction_fee.$dirty}">
<label class="control-label col-sm-4" for="transaction_fee_input">Transaction Fee</label>
<div class="col-sm-6">
<div class="input-group">
<input type="number" name="Transaction_fee_value" stringToNumber2 class="form-control" ng-model="rate.transaction_fee"
min="0" step="0.1" id="transaction_fee_input" required>
</div>
<div ng-messages="rate_form.transaction_fee.$error" ng-if="rate_form.transaction_fee.$dirty">
<div class="small text-danger" ng-message="min">
<i class="glyphicon glyphicon-alert"></i> No less than 0
</div>
<div class="small text-danger" ng-message="required">
<i class="glyphicon glyphicon-alert"></i> Required Field
</div>
</div>
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-4" for="active_time_input">Active Date</label> <label class="control-label col-sm-4" for="active_time_input">Active Date</label>
<div class="col-sm-6"> <div class="col-sm-6">

@ -85,7 +85,9 @@
<a role="button" ng-class="{'bg-primary':params.channel=='JD'}" <a role="button" ng-class="{'bg-primary':params.channel=='JD'}"
ng-click="params.channel='JD';loadTradeLogs(1)">JDpay</a> | ng-click="params.channel='JD';loadTradeLogs(1)">JDpay</a> |
<a role="button" ng-class="{'bg-primary':params.channel=='HF'}" <a role="button" ng-class="{'bg-primary':params.channel=='HF'}"
ng-click="params.channel='HF';loadTradeLogs(1)">HFpay</a> ng-click="params.channel='HF';loadTradeLogs(1)">HFpay</a> |
<a role="button" ng-class="{'bg-primary':params.channel=='RPAY'}"
ng-click="params.channel='RPAY';loadTradeLogs(1)">RPay +</a>
</p> </p>
</div> </div>
</div> </div>
@ -185,6 +187,7 @@
<img src="/static/images/alipay_sign.png" uib-tooltip="AlipayOnline" ng-if="trade.channel=='AlipayOnline'"/> <img src="/static/images/alipay_sign.png" uib-tooltip="AlipayOnline" ng-if="trade.channel=='AlipayOnline'"/>
<img src="/static/images/jd_sign.png" uib-tooltip="JD Pay" ng-if="trade.channel=='jd'"/> <img src="/static/images/jd_sign.png" uib-tooltip="JD Pay" ng-if="trade.channel=='jd'"/>
<img src="/static/images/hf_sign.png" uib-tooltip="HF Pay" ng-if="trade.channel=='hf'"/> <img src="/static/images/hf_sign.png" uib-tooltip="HF Pay" ng-if="trade.channel=='hf'"/>
<img src="/static/images/rpayplus_sign.png" uib-tooltip="RPay+" ng-if="trade.channel=='Rpay'"/>
{{trade.order_id}} {{trade.order_id}}
</td> </td>
<td> <td>
@ -195,7 +198,8 @@
<td ng-bind="trade.display_amount|currency:trade.currency"></td> <td ng-bind="trade.display_amount|currency:trade.currency"></td>
<td ng-bind="trade.clearing_amount|currency:'AUD '"></td> <td ng-bind="trade.clearing_amount|currency:'AUD '"></td>
<td> <td>
<span ng-if="trade.channel!='hf'" ng-bind="trade.exchange_rate"></span> <span ng-if="(trade.channel!='hf') && (trade.channel!='Rpay')" ng-bind="trade.exchange_rate"></span>
<span ng-if="(trade.channel=='hf') || (trade.channel=='Rpay')" > - </span>
</td> </td>
<td ng-bind="trade.status|tradeStatus"></td> <td ng-bind="trade.status|tradeStatus"></td>
<td ng-bind="trade.create_time"></td> <td ng-bind="trade.create_time"></td>

@ -35,6 +35,31 @@
</div> </div>
</div> </div>
<!-- 新增transaction_fee字段 -->
<div class="form-group"
ng-class="{'has-error':rate_form.transaction_fee.$invalid && rate_form.transaction_fee.$dirty}">
<label class="control-label col-sm-4" for="transaction_fee_input">Transaction Fee</label>
<div class="col-sm-6">
<div class="input-group">
<input type="number" name="transaction_fee" class="form-control" ng-model="rate.transaction_fee"
min="0" step="0.1" id="transaction_fee_input" required>
</div>
<div ng-messages="rate_form.transaction_fee.$error" ng-if="rate_form.transaction_fee.$dirty">
<!--<div class="small text-danger" ng-message="max">-->
<!--<i class="glyphicon glyphicon-alert"></i> No more than 2.2%-->
<!--</div>-->
<div class="small text-danger" ng-message="min">
<i class="glyphicon glyphicon-alert"></i> No less than 0
</div>
<div class="small text-danger" ng-message="required">
<i class="glyphicon glyphicon-alert"></i> Required Field
</div>
</div>
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-4" for="active_time_input">Active Date</label> <label class="control-label col-sm-4" for="active_time_input">Active Date</label>
<div class="col-sm-6"> <div class="col-sm-6">

@ -99,7 +99,7 @@
Rpay+ Sub Merchant Id : {{partner.rpay_enterprise_id}} Rpay+ Sub Merchant Id : {{partner.rpay_enterprise_id}}
<i class="fa fa-clock-o text-danger" title="Using temp Sub Merchant ID" ng-if="partner.temp_sub_merchant"></i> <i class="fa fa-clock-o text-danger" title="Using temp Sub Merchant ID" ng-if="partner.temp_sub_merchant"></i>
</h3> </h3>
<button role="button" class="btn btn-info pull-right" title="Apply Sub Merchant Id" <button role="button" ng-if="!partner.rpay_enterprise_id" class="btn btn-info pull-right" title="Apply Sub Merchant Id"
ng-click="applyRpaySubMerchantId()"> ng-click="applyRpaySubMerchantId()">
<i class="fa fa-plus"></i> <i class="fa fa-plus"></i>
Apply Sub Merchant Id Apply Sub Merchant Id

@ -95,9 +95,9 @@
<a role="button" ng-class="{'bg-primary':params.channel=='JD'}" <a role="button" ng-class="{'bg-primary':params.channel=='JD'}"
ng-click="params.channel='JD';loadTradeLogs(1)">JD Pay</a> | ng-click="params.channel='JD';loadTradeLogs(1)">JD Pay</a> |
<a role="button" ng-class="{'bg-primary':params.channel=='HF'}" <a role="button" ng-class="{'bg-primary':params.channel=='HF'}"
ng-click="params.channel='HF';loadTradeLogs(1)">HF Pay</a><!--| ng-click="params.channel='HF';loadTradeLogs(1)">HF Pay</a> |
<a role="button" ng-class="{'bg-primary':params.channel=='ZNYOO'}" <a role="button" ng-class="{'bg-primary':params.channel=='RPAY'}"
ng-click="params.channel='ZNYOO';loadTradeLogs(1)">Znyoo</a>--> ng-click="params.channel='RPAY';loadTradeLogs(1)">RPay +</a>
</p> </p>
</div> </div>
</div> </div>
@ -296,6 +296,8 @@
uib-tooltip="JD Pay" ng-if="trade.channel=='jd'"/> uib-tooltip="JD Pay" ng-if="trade.channel=='jd'"/>
<img src="/static/images/hf_sign.png" <img src="/static/images/hf_sign.png"
uib-tooltip="HF Pay" ng-if="trade.channel=='hf'"/> uib-tooltip="HF Pay" ng-if="trade.channel=='hf'"/>
<img src="/static/images/rpayplus_sign.png"
uib-tooltip="RPay" ng-if="trade.channel=='Rpay'"/>
{{trade.order_id2}} {{trade.order_id2}}
</td> </td>
<td ng-bind="trade.currency"></td> <td ng-bind="trade.currency"></td>
@ -343,7 +345,7 @@
- -
</p> </p>
</td> </td>
<td ng-bind="trade.order_detail||trade.remark"></td> <td ng-bind="trade.order_detail"></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

@ -7,7 +7,7 @@
<ul class="nav nav-pills"> <ul class="nav nav-pills">
<li ng-class="{active:ctrl.channel==null}"> <li ng-class="{active:ctrl.channel==null}">
<a role="button" ng-click="ctrl.channel=null;channelAndDayOfAnalysis()" title="All"> <a role="button" ng-click="ctrl.channel=null;channelAndDayOfAnalysis()" title="All">
<img src="/static/images/royalpay_sign.png"> <img src="/static/images/rpayplus_sign_lg.png">
</a> </a>
</li> </li>
<li ng-class="{active:ctrl.channel=='Wechat'}" ng-if="report.channels.Wechat"> <li ng-class="{active:ctrl.channel=='Wechat'}" ng-if="report.channels.Wechat">
@ -40,6 +40,11 @@
<img src="/static/images/hf_sign_lg.png"> <img src="/static/images/hf_sign_lg.png">
</a> </a>
</li> </li>
<li ng-class="{active:ctrl.channel=='Rpay'}" ng-if="report.channels.Rpay">
<a role="button" ng-click="ctrl.channel='Rpay';channelAndDayOfAnalysis()" title="Rpay Pay">
<img src="/static/images/rpayplus_sign_lg.png">
</a>
</li>
</ul> </ul>
</div> </div>
</div> </div>

@ -98,7 +98,7 @@
</table> </table>
</div> </div>
</div> </div>
<div class="form-group" ng-if="order.status>=5 && order.channel!='hf'"> <div class="form-group" ng-if="order.status>=5 && (order.channel!='hf' || order.channel!='Rpay')">
<label class="control-label col-xs-3">Exchange Rate</label> <label class="control-label col-xs-3">Exchange Rate</label>
<div class="col-xs-9"> <div class="col-xs-9">
<p class="form-control-static" ng-bind="order.exchange_rate"></p> <p class="form-control-static" ng-bind="order.exchange_rate"></p>

@ -96,6 +96,8 @@
ng-click="params.channel='JD';loadTradeLogs(1)">JD Pay</a> | ng-click="params.channel='JD';loadTradeLogs(1)">JD Pay</a> |
<a role="button" ng-class="{'bg-primary':params.channel=='HF'}" <a role="button" ng-class="{'bg-primary':params.channel=='HF'}"
ng-click="params.channel='HF';loadTradeLogs(1)">HF Pay</a> ng-click="params.channel='HF';loadTradeLogs(1)">HF Pay</a>
<a role="button" ng-class="{'bg-primary':params.channel=='RPAY'}"
ng-click="params.channel='RPAY';loadTradeLogs(1)">RPay+</a>
</p> </p>
</div> </div>
</div> </div>
@ -322,6 +324,7 @@
<img src="/static/images/alipay_sign.png" uib-tooltip="AlipayOnline" alt="AlipayOnline" ng-if="trade.channel=='AlipayOnline'"/> <img src="/static/images/alipay_sign.png" uib-tooltip="AlipayOnline" alt="AlipayOnline" ng-if="trade.channel=='AlipayOnline'"/>
<img src="/static/images/jd_sign.png" uib-tooltip="JD Pay" ng-if="trade.channel=='jd'"/> <img src="/static/images/jd_sign.png" uib-tooltip="JD Pay" ng-if="trade.channel=='jd'"/>
<img src="/static/images/hf_sign.png" uib-tooltip="HF Pay" ng-if="trade.channel=='hf'"/> <img src="/static/images/hf_sign.png" uib-tooltip="HF Pay" ng-if="trade.channel=='hf'"/>
<img src="/static/images/rpayplus_sign.png" uib-tooltip="RPay+" ng-if="trade.channel=='Rpay'"/>
{{trade.order_id}} {{trade.order_id}}
</td> </td>
<td> <td>
@ -333,7 +336,8 @@
<td ng-bind="trade.clearing_amount|currency:'AUD '"></td> <td ng-bind="trade.clearing_amount|currency:'AUD '"></td>
<td ng-bind="trade.settle_amount|currency:'AUD '"></td> <td ng-bind="trade.settle_amount|currency:'AUD '"></td>
<td> <td>
<span ng-if="trade.channel!='hf'" ng-bind="trade.exchange_rate"></span> <span ng-if="(trade.channel!='hf') && (trade.channel!='Rpay')" ng-bind="trade.exchange_rate"></span>
<span ng-if="(trade.channel=='hf') || (trade.channel=='Rpay')" > - </span>
</td> </td>
<td ng-bind="trade.status|tradeStatus"></td> <td ng-bind="trade.status|tradeStatus"></td>
<td ng-bind="trade.create_time"></td> <td ng-bind="trade.create_time"></td>

@ -133,7 +133,9 @@
<a role="button" ng-class="{'bg-primary':params.channel=='JD'}" <a role="button" ng-class="{'bg-primary':params.channel=='JD'}"
ng-click="params.channel='JD';loadTradeLogs(1)">JD Pay</a> | ng-click="params.channel='JD';loadTradeLogs(1)">JD Pay</a> |
<a role="button" ng-class="{'bg-primary':params.channel=='HF'}" <a role="button" ng-class="{'bg-primary':params.channel=='HF'}"
ng-click="params.channel='HF';loadTradeLogs(1)">HF Pay</a> ng-click="params.channel='HF';loadTradeLogs(1)">HF Pay</a> |
<a role="button" ng-class="{'bg-primary':params.channel=='RPAY'}"
ng-click="params.channel='RPAY';loadTradeLogs(1)">RPay +</a>
</p> </p>
</div> </div>
</div> </div>
@ -351,6 +353,8 @@
uib-tooltip="JD Pay" ng-if="trade.channel=='jd'"/> uib-tooltip="JD Pay" ng-if="trade.channel=='jd'"/>
<img src="/static/images/hf_sign.png" <img src="/static/images/hf_sign.png"
uib-tooltip="HF Pay" ng-if="trade.channel=='hf'"/> uib-tooltip="HF Pay" ng-if="trade.channel=='hf'"/>
<img src="/static/images/rpayplus_sign.png"
uib-tooltip="Royal Pay" ng-if="trade.channel=='Rpay'"/>
{{trade.order_id}} {{trade.order_id}}
</td> </td>
<td> <td>
@ -361,7 +365,8 @@
<td ng-bind="trade.display_amount|currency:trade.currency"></td> <td ng-bind="trade.display_amount|currency:trade.currency"></td>
<td ng-bind="trade.clearing_amount|currency:'AUD'"></td> <td ng-bind="trade.clearing_amount|currency:'AUD'"></td>
<td> <td>
<span ng-if="trade.channel!='hf'" ng-bind="trade.exchange_rate"></span> <span ng-if="(trade.channel!='hf') && (trade.channel!='Rpay')" ng-bind="trade.exchange_rate"></span>
<span ng-if="(trade.channel=='hf') || (trade.channel=='Rpay')" > - </span>
</td> </td>
<td ng-bind="trade.status|tradeStatus"></td> <td ng-bind="trade.status|tradeStatus"></td>
<td ng-bind="trade.create_time"></td> <td ng-bind="trade.create_time"></td>

@ -126,7 +126,8 @@
</td> </td>
<td ng-bind="trade.clearing_amount|currency:'AUD '"></td> <td ng-bind="trade.clearing_amount|currency:'AUD '"></td>
<td> <td>
<span ng-if="trade.channel!='hf'" ng-bind="trade.exchange_rate"></span> <span ng-if="(trade.channel!='hf') && (trade.channel!='Rpay')" ng-bind="trade.exchange_rate"></span>
<span ng-if="(trade.channel=='hf') || (trade.channel=='Rpay')" > - </span>
</td> </td>
<td ng-bind="trade.status|tradeStatus"></td> <td ng-bind="trade.status|tradeStatus"></td>
<td ng-bind="trade.create_time"></td> <td ng-bind="trade.create_time"></td>

@ -67,7 +67,7 @@
<td>{{client.bank_account_no}}</td> <td>{{client.bank_account_no}}</td>
<td>{{client.contact_person}}</td> <td>{{client.contact_person}}</td>
<td>{{client.contact_phone}}</td> <td>{{client.contact_phone}}</td>
<td>{{client.last_update_date}}</td> <td>{{client.creation_date}}</td>
<td>{{client.remark}}</td> <td>{{client.remark}}</td>
<td> <td>
<a role="button" class="text-bold text-danger" <a role="button" class="text-bold text-danger"

@ -16,6 +16,7 @@
border-radius: 50%; border-radius: 50%;
vertical-align: middle; vertical-align: middle;
margin-left: 8%; margin-left: 8%;
background-color: white;
} }
.pleft { .pleft {
@ -354,7 +355,7 @@
width: 90%; width: 90%;
display: block; display: block;
position: relative; position: relative;
margin-top: 130px; margin-top: 100px;
padding-top: 25px; padding-top: 25px;
padding-bottom: 19px; padding-bottom: 19px;
border-radius: 5px; border-radius: 5px;
@ -382,12 +383,12 @@
width: 100%; width: 100%;
font-size: 14px; font-size: 14px;
color: rgb(157, 255, 221); color: rgb(157, 255, 221);
margin-bottom: 24px; margin-bottom: 10px;
} }
.points-content .coin{ .points-content .coin{
width: 100px; width: 50px;
height: 100px; height: 50px;
position: relative; position: relative;
background: url(/static/images/star.png) no-repeat; background: url(/static/images/star.png) no-repeat;
background-size: contain; background-size: contain;

@ -366,7 +366,7 @@ input.value:focus {
background-color: #108ee9; background-color: #108ee9;
} }
.button_sp_area.alipay .paynow { .button_sp_area.rpay .paynow {
background-color: #FF2D55; background-color: #FF2D55;
} }

@ -219,7 +219,7 @@ $(function () {
if (window.requireRemark) { if (window.requireRemark) {
if (!dataCache.remark) { if (!dataCache.remark) {
var config = { var config = {
title: '请先输入备注', title: 'Please enter the remarks first',
template: '' template: ''
}; };
showWeuiDialog(config); showWeuiDialog(config);
@ -254,8 +254,8 @@ $(function () {
data.customerrate = true; data.customerrate = true;
} }
data.coupons = dataCache.coupons; data.coupons = dataCache.coupons;
data.customerId = window.RpayUserId;
data.qrcodeVersion = window.qrcodeVersion; data.qrcodeVersion = window.qrcodeVersion;
data.customerId = window.customerId;
dataCache.remark = ''; dataCache.remark = '';
@ -270,7 +270,7 @@ $(function () {
window.RPayPlus.send("closeLoading", null, null); window.RPayPlus.send("closeLoading", null, null);
pay(resp,function(data){ pay(resp,function(data){
if(data == 'success'){ if(data == 'success'){
location.href = '/api/v1.0/rpay/partners/' + window.client_moniker + '/orders/' + resp.mch_order_id + '/result' startCheckOrder(resp.mch_order_id, '/api/v1.0/rpay/partners/' + window.client_moniker + '/orders/' + resp.mch_order_id + '/result');
}else if(data == 'fail'){ }else if(data == 'fail'){
alert('Oops,Network fluctuation,please try again later...'); alert('Oops,Network fluctuation,please try again later...');
} }
@ -423,9 +423,28 @@ $(function () {
} }
function startCheckOrder(orderId, url) {
function checkOrderStd() {
$.ajax({
url: '/api/v1.0/payment/orders/' + orderId + '/status',
method: 'GET',
dataType: 'json',
success: function (res) {
if (res.paid) {
location.href = url;
} else {
setTimeout(checkOrderStd, 500);
}
}
})
}
checkOrderStd();
}
function getUserId(){ function getUserId(){
window.RPayPlus.send("getUserId", null, function(data){ window.RPayPlus.send("getUserId", null, function(data){
window.RpayUserId = data; window.customerId = data;
}); });
} }

@ -10,9 +10,9 @@ import org.springframework.test.context.junit4.SpringRunner;
import javax.annotation.Resource; import javax.annotation.Resource;
@SpringBootTest @SpringBootTest
@ActiveProfiles({ "local", "alipay", "wechat", "jd", "bestpay" }) @ActiveProfiles({ "local","rpay", "alipay", "wechat", "jd", "bestpay" })
@RunWith(SpringRunner.class) @RunWith(SpringRunner.class)
public class PostponeClientTaskTest { public class PostponeClientTaskTest {
@Resource @Resource
private ClientRateMapper clientRateMapper; private ClientRateMapper clientRateMapper;

Loading…
Cancel
Save