diff --git a/src/main/java/au/com/royalpay/payment/manage/cashiers/core/impls/CashierOrderServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/cashiers/core/impls/CashierOrderServiceImp.java index 2a49581a6..3b279a7ce 100644 --- a/src/main/java/au/com/royalpay/payment/manage/cashiers/core/impls/CashierOrderServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/cashiers/core/impls/CashierOrderServiceImp.java @@ -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")); diff --git a/src/main/java/au/com/royalpay/payment/manage/cashiers/core/impls/CashierServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/cashiers/core/impls/CashierServiceImp.java index b7a5862cd..09d4343e9 100644 --- a/src/main/java/au/com/royalpay/payment/manage/cashiers/core/impls/CashierServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/cashiers/core/impls/CashierServiceImp.java @@ -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); } diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/cashiers/CashierMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/cashiers/CashierMapper.java index c495ca7b6..b52161bc7 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/cashiers/CashierMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/cashiers/CashierMapper.java @@ -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); diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java index 5ec1b35b2..73059b3ab 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java @@ -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); } diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java index 7d53238bb..6e50ed185 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java @@ -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"))) { diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java index ba7beafc9..9286f8051 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java @@ -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); + } } diff --git a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/CustomerAndOrdersStatisticsMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/CustomerAndOrdersStatisticsMapper.xml index d7bd716c5..0cd8a813d 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/CustomerAndOrdersStatisticsMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/CustomerAndOrdersStatisticsMapper.xml @@ -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, diff --git a/src/main/ui/static/analysis/templates/trans_analysis.html b/src/main/ui/static/analysis/templates/trans_analysis.html index ee403d5cf..30299c8ff 100644 --- a/src/main/ui/static/analysis/templates/trans_analysis.html +++ b/src/main/ui/static/analysis/templates/trans_analysis.html @@ -272,7 +272,7 @@
{{order.card_bank}}
diff --git a/src/main/ui/static/dashboard/templates/partner_dashboard.html b/src/main/ui/static/dashboard/templates/partner_dashboard.html index 7cd046263..805e0603d 100644 --- a/src/main/ui/static/dashboard/templates/partner_dashboard.html +++ b/src/main/ui/static/dashboard/templates/partner_dashboard.html @@ -361,7 +361,7 @@{{order.card_bank}}