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

master
yixian 5 years ago
commit 5834044776

@ -4,13 +4,13 @@ import au.com.royalpay.payment.manage.cashiers.beans.CashierQueryBean;
import au.com.royalpay.payment.manage.cashiers.core.CashierOrderService;
import au.com.royalpay.payment.manage.mappers.cashiers.CashierMapper;
import au.com.royalpay.payment.manage.mappers.cashiers.CashierOrderMapper;
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.utils.PageListUtils;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.Order;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;
import javax.annotation.Resource;
@ -36,8 +36,10 @@ public class CashierOrderServiceImp implements CashierOrderService {
@Override
public JSONObject listCashierOrders(String cashier_id, JSONObject partner, CashierQueryBean query) {
JSONObject cashier = cashierMapper.findOne(cashier_id);
Assert.notNull(cashier, "cashier not found");
JSONObject cashier = cashierMapper.findIsValidById(cashier_id);
if (cashier == null) {
throw new BadRequestException("Cashier Not Found Or Disabled");
}
String timezone = partner.getJSONObject("client").getString("timezone");
JSONObject params = query.params(timezone);
params.put("client_id", partner.getIntValue("client_id"));

@ -82,6 +82,13 @@ public class CashierServiceImp implements CashierService {
throw new ForbiddenException("You have no permission!");
}
cashier.put("is_valid", isValid);
if (!isValid) {
cashier.put("wechat_openid", null);
cashier.put("nick_name", null);
cashier.put("headimgurl", null);
cashier.put("phone", null);
cashier.put("photo", null);
}
cashierMapper.update(cashier);
}

@ -1,11 +1,12 @@
package au.com.royalpay.payment.manage.mappers.cashiers;
import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper;
import com.yixsoft.support.mybatis.autosql.annotations.AutoSql;
import com.yixsoft.support.mybatis.autosql.annotations.SqlType;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect;
import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper;
import com.yixsoft.support.mybatis.autosql.annotations.AutoSql;
import com.yixsoft.support.mybatis.autosql.annotations.SqlType;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -26,6 +27,10 @@ public interface CashierMapper {
@AutoSql(SqlType.SELECT)
JSONObject findOne(@Param("cashier_id") String cashier_id);
@AutoSql(SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "is_valid=1")
JSONObject findIsValidById(@Param("cashier_id") String cashier_id);
@AutoSql(SqlType.INSERT)
void save(JSONObject cashier);

@ -571,4 +571,6 @@ public interface ClientManager {
RPayMerchantEntity applyMWMerchantId(String clientMoniker, JSONObject manager);
RPayMerchantEntity queryMWMerchantIdStatus(String clientMoniker, JSONObject manager);
RPayMerchantEntity queryMWMerchantInfo(String clientMoniker, JSONObject manager);
}

@ -2063,7 +2063,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if (StringUtils.equalsIgnoreCase("rpaypmt_card", config.getString("type"))) {
JSONObject extRateParams = new JSONObject(){{
put("domestic_rate_value", config.getBigDecimal("rate_value"));
put("overseas_rate_value", config.getBigDecimal("international_rate_value"));
put("overseas_rate_value", config.getJSONObject("ext_rates").getBigDecimal("international_rate_value"));
}};
newConfig.put("ext_rates", extRateParams.toJSONString());
}
@ -6862,6 +6862,16 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
return rPayPaymentCardSvcApi.findMerchant(client);
}
@Override
public RPayMerchantEntity queryMWMerchantInfo(String clientMoniker, JSONObject manager) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
}
JSONObject bankAccount = getBankAccountByClientId(client.getIntValue("client_id"));
return (new RPayMerchantEntity()).applyClientInfo(client).applyBankAccount(bankAccount);
}
private boolean isAddCardPaymentRate(JSONObject config, int clientId) {
if (!StringUtils.equalsIgnoreCase("rpaypmt_card", config.getString("type"))
&& !StringUtils.equalsIgnoreCase("rpaypmt_dd", config.getString("type"))) {

@ -898,4 +898,9 @@ public class PartnerManageController {
@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager){
return clientManager.queryMWMerchantIdStatus(clientMoniker,manager);
}
@ManagerMapping(value = "/{clientMoniker}/query/mw_info", method = RequestMethod.GET, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN})
public RPayMerchantEntity queryMWMerchantInfo(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return clientManager.queryMWMerchantInfo(clientMoniker, manager);
}
}

@ -356,10 +356,10 @@
ifnull(sum(CASE WHEN s.channel = 'LakalaPay' THEN s.total ELSE 0 END),0) lakalapayamount,
ifnull(sum(CASE WHEN s.channel = 'LakalaPay' THEN s.orders ELSE 0 END),0) lakalapay_order_count,
ifnull(COUNT(DISTINCT s.client_id,IF(s.channel = 'LakalaPay',TRUE,NULL)),0) lakala_client_count,
ifnull(sum(CASE WHEN s.channel = 'rpaypmt_card' THEN s.total ELSE 0 END),0) rpaypmt_cardpayamount,
ifnull(sum(CASE WHEN s.channel = 'rpaypmt_card' THEN s.total ELSE 0 END),0) rpaypmt_cardamount,
ifnull(sum(CASE WHEN s.channel = 'rpaypmt_card' THEN s.orders ELSE 0 END),0) rpaypmt_card_order_count,
ifnull(COUNT(DISTINCT s.client_id,IF(s.channel = 'rpaypmt_card',TRUE,NULL)),0) rpaypmt_card_client_count,
ifnull(sum(CASE WHEN s.channel = 'rpaypmt_dd' THEN s.total ELSE 0 END),0) rpaypmt_ddpayamount,
ifnull(sum(CASE WHEN s.channel = 'rpaypmt_dd' THEN s.total ELSE 0 END),0) rpaypmt_ddamount,
ifnull(sum(CASE WHEN s.channel = 'rpaypmt_dd' THEN s.orders ELSE 0 END),0) rpaypmt_dd_order_count,
ifnull(COUNT(DISTINCT s.client_id,IF(s.channel = 'rpaypmt_dd',TRUE,NULL)),0) rpaypmt_dd_client_count,
ifnull(sum(s.orders), 0) all_count,

@ -272,7 +272,7 @@
<div class="description-header text-bold"><small><img src="/static/images/card_payment_sign.png"/>Card Payment</small></div>
<div class="description-text">
<label class="description-text text-red"
ng-bind="totalChannelAmount.rpaypmt_cardpayamount|currency: ' $ '"></label></br>
ng-bind="totalChannelAmount.rpaypmt_cardamount|currency: ' $ '"></label></br>
<label class="description-text text-red">交易笔数:{{ totalChannelAmount.rpaypmt_card_order_count }}</label>
<label class="description-text text-red">交易商户数:{{ totalChannelAmount.rpaypmt_card_client_count }}</label>
</div>
@ -283,7 +283,7 @@
<div class="description-header text-bold"><small><img src="/static/images/direct_debit_sign.png"/>Direct Debit</small></div>
<div class="description-text">
<label class="description-text text-red"
ng-bind="totalChannelAmount.rpaypmt_ddpayamount|currency: ' $ '"></label></br>
ng-bind="totalChannelAmount.rpaypmt_ddamount|currency: ' $ '"></label></br>
<label class="description-text text-red">交易笔数:{{ totalChannelAmount.rpaypmt_dd_order_count }}</label>
<label class="description-text text-red">交易商户数:{{ totalChannelAmount.rpaypmt_dd_client_count }}</label>
</div>

@ -239,7 +239,7 @@
<div class="description-header text-bold"><img src="/static/images/card_payment_sign.png"/>Card Payment</div>
<div class="description-text">
<label class="description-text text-red"
ng-bind="totalChannelAmount.rpaypmt_cardpayamount|currency: ' $ '"></label></br>
ng-bind="totalChannelAmount.rpaypmt_cardamount|currency: ' $ '"></label></br>
<label class="description-text text-red">交易笔数:{{ totalChannelAmount.rpaypmt_card_order_count }}</label>
<label class="description-text text-red">交易商户数:{{ totalChannelAmount.rpaypmt_card_client_count }}</label>
</div>
@ -250,7 +250,7 @@
<div class="description-header text-bold"><img src="/static/images/direct_debit_sign.png"/>Direct Debit</div>
<div class="description-text">
<label class="description-text text-red"
ng-bind="totalChannelAmount.rpaypmt_ddpayamount|currency: ' $ '"></label></br>
ng-bind="totalChannelAmount.rpaypmt_ddamount|currency: ' $ '"></label></br>
<label class="description-text text-red">交易笔数:{{ totalChannelAmount.rpaypmt_dd_order_count }}</label>
<label class="description-text text-red">交易商户数:{{ totalChannelAmount.rpaypmt_dd_client_count }}</label>
</div>

@ -175,9 +175,9 @@
<p class="form-control-static" ng-bind="order.order_detail"></p>
</div>
</div>
<div class="form-group" ng-if="order.channel=='rpaypmt_card' || order.channel=='rpaypmt_dd'">
<div style="text-align: center;">
<p ng-click="hidePayerCardInfo()"><label class="control-label" style="cursor: pointer;padding-right: 0;color: gray;">—————————— Payer Card Information ——————————</label></p>
<div class="form-group" ng-if="order.channel=='rpaypmt_card' || order.channel=='rpaypmt_dd'" style="margin: 15px 6%;border: 1px dashed gray;">
<div style="text-align: center;cursor: pointer;color: grey" ng-click="hidePayerCardInfo()">
<p><label class="control-label" style="cursor: pointer">Payer Card Information</label></p>
</div>
<div ng-if="showPayerCardInfo">
<p class="tradeCardInfo"><label style="padding-right: 20%;">Card Bank: </label> {{order.card_bank}}</p>

@ -361,7 +361,7 @@
</span>
<div ng-if="showUnSettleDetail">
<span class="counter text-white" style="font-size: 1px">
System : {{transcommon.sys_not_settled|currency:'AUD '}}
Cross-border Payment : {{transcommon.sys_not_settled|currency:'AUD '}}
</span>
<span class="counter text-white" style="font-size: 1px">
Card Payment : {{transcommon.rpaypmt_card_not_settled|currency:'AUD '}}

@ -70,14 +70,16 @@
</a>
</td>
<td>
<a class="text-primary" style="padding-right: 5px" role="button" title="Edit"
<a ng-if="cashier.is_valid" class="text-primary" style="padding-right: 5px" role="button" title="Edit"
ui-sref=".edit({cashier_id:cashier.cashier_id})">
<i class="fa fa-pencil-square-o"></i>
</a> |
<a class="text-primary" style="padding-right: 5px" role="button" title="Detail"
</a>
<span ng-if="cashier.is_valid"> |</span>
<a ng-if="cashier.is_valid" class="text-primary" style="padding-right: 5px" role="button" title="Detail"
ui-sref=".detail({cashier_id:cashier.cashier_id})">
<i class="fa fa-search"></i>
</a> |
</a>
<span ng-if="cashier.is_valid"> |</span>
<a ng-if="cashier.is_valid" role="button" class="text-danger text-bold" ng-click="disableCashier(cashier)">Disable</a>
<a ng-if="!cashier.is_valid" role="button" class="text-success text-bold" ng-click="enableCashier(cashier)">Enable</a>
</td>

@ -4964,9 +4964,11 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
})
};
$scope.applyMWSubMerchantId = function () {
$http.get('/sys/partners/' + $scope.partner.client_moniker + '/query/mw_info').then(function (resp) {
commonDialog.confirm({
title: 'Apply Merchant Warrior Sub Merchant Id',
contentHtml: $sce.trustAsHtml('Are you sure to apply merchant Warrior sub merchant id for <span style="color: red">[' + $scope.partner.company_name + ']</span>?')
contentHtml: $sce.trustAsHtml('Are you sure to apply merchant Warrior sub merchant id for <span style="color: red">[' + $scope.partner.company_name + ']</span>?'),
json: resp.data
}).then(function () {
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/applyMWMerchantId').then(function (res) {
commonDialog.alert({
@ -4979,6 +4981,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
})
})
});
};
$scope.applyRpaySubMerchantId = function () {
$uibModal.open({

@ -48,7 +48,7 @@
<label class="control-label col-sm-4" for="international_rate_value_input">International Rate Value</label>
<div class="col-sm-6">
<div class="input-group">
<input type="number" name="international_rate_value" stringToNumber2 class="form-control" ng-model="rate.ext_rates.overseas_rate_value"
<input type="number" name="international_rate_value" stringToNumber2 class="form-control" ng-model="rate.ext_rates.international_rate_value"
min="0" max="5" step="0.1" id="international_rate_value_input" required>
<div class="input-group-addon">%</div>
</div>
@ -91,13 +91,13 @@
</div>
<!-- 新增transaction_fee -->
<div class="form-group" ng-if="cardRateConfig.type=='rpaypmt_card'"
<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" max="1" id="transaction_fee_input" required>
min="0" step="0.1" id="transaction_fee_input" required>
<div class="input-group-addon">$</div>
</div>
<div ng-messages="rate_form.transaction_fee.$error" ng-if="rate_form.transaction_fee.$dirty">

@ -183,7 +183,7 @@
</li>
<li class="list-group-item list-group-item-success" ng-if="showMoreMerchantInfo">
Category
<span style="float: right" ng-bind="partner.cardInfo.category"></span>
<span style="float: right" ng-bind="partner.cardInfo.category|partner_royalpay_industry"></span>
</li>
<li class="list-group-item list-group-item-success" style="text-align: center" ng-if="showMoreMerchantInfo" ng-click="hideMerchantInfo()">
<span> Hide.....</span>

@ -148,9 +148,9 @@
</div>
</div>
</div>
<div class="form-group" ng-if="order.channel=='rpaypmt_card' || order.channel=='rpaypmt_dd'">
<div style="text-align: center;">
<p ng-click="hidePayerCardInfo()"><label class="control-label" style="cursor: pointer;padding-right: 0;color: gray;">—————————— Payer Card Information ——————————</label></p>
<div class="form-group" ng-if="order.channel=='rpaypmt_card' || order.channel=='rpaypmt_dd'" style="margin: 15px 6%;border: 1px dashed gray;">
<div style="text-align: center;cursor: pointer;color: grey" ng-click="hidePayerCardInfo()">
<p><label class="control-label" style="cursor: pointer">Payer Card Information</label></p>
</div>
<div ng-if="showPayerCardInfo">
<p class="tradeCardInfo"><label style="padding-right: 20%;">Card Bank: </label> {{order.card_bank}}</p>

Loading…
Cancel
Save