diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DashboardServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DashboardServiceImpl.java index ece285f7a..97ef7c216 100644 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DashboardServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DashboardServiceImpl.java @@ -148,7 +148,7 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT return commonAnalysis4; } JSONObject res = new JSONObject(); - List topOrders = transactionAnalysisMapper.getTopOrders(params, new PageBounds(1, 1, Order.formString("aud_fee.desc"))); + List topOrders = transactionAnalysisMapper.getTopOrders(params); if (!topOrders.isEmpty()) { res.put("top_amount_order", topOrders.get(0)); } @@ -163,16 +163,15 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT @Override public List getTopTradePartners(JSONObject params, int limit) { - return clientAnalysisMapper.listPartnersTradeAmount(params, new PageBounds(1, limit, Order.formString("aud_fee.desc"))); + params.put("rankType", "aud_fee"); + params.put("limit", limit); + return clientAnalysisMapper.listPartnersTradeAmount(params); } @Override public List getTopTradePartners(JSONObject params) { - String rankType = "aud_fee"; - if (params.getString("rankType")!=null){ - rankType = params.getString("rankType"); - } - return clientAnalysisMapper.listPartnersTradeAmount(params, new PageBounds(Order.formString(rankType+".desc"))); + params.putIfAbsent("rankType", "aud_fee"); + return clientAnalysisMapper.listPartnersTradeAmount(params); } @Override diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/ClientAnalysisMapper.java b/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/ClientAnalysisMapper.java index dd4272dd2..93913f7e4 100644 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/ClientAnalysisMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/ClientAnalysisMapper.java @@ -33,7 +33,7 @@ public interface ClientAnalysisMapper { List countTradePartnersHistory(JSONObject params); - List listPartnersTradeAmount(JSONObject params, PageBounds pageBounds); + List listPartnersTradeAmount(JSONObject params); List countClientsTypes(JSONObject params); diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/TransactionAnalysisMapper.java b/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/TransactionAnalysisMapper.java index c28d1b8b2..d9986be29 100644 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/TransactionAnalysisMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/TransactionAnalysisMapper.java @@ -33,7 +33,7 @@ public interface TransactionAnalysisMapper { JSONObject getEarliestOrder(@Param("client_id") int client_id); - List getTopOrders(JSONObject params, PageBounds pagination); + List getTopOrders(JSONObject params); List getTradeAmountInTypes(JSONObject params); diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/web/DashboardController.java b/src/main/java/au/com/royalpay/payment/manage/analysis/web/DashboardController.java index 86cb29a46..a0000005a 100644 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/web/DashboardController.java +++ b/src/main/java/au/com/royalpay/payment/manage/analysis/web/DashboardController.java @@ -75,11 +75,11 @@ public class DashboardController { @ManagerMapping("/rank_trade_partners") public List rankTradePartners(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { JSONObject params = analysis.toParams(null); - orgManager.checkOrg(manager,params); + orgManager.checkOrg(manager, params); if (analysis.isOnlyGroup() && ManagerRole.BD_LEADER.hasRole(manager.getIntValue("role"))) { params.put("bd_group", manager.getString("manager_id")); 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); diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java b/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java index 5d664eac8..57adeb692 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java @@ -21,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.system.ClientBankAccountMapper; 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.tradelog.core.TradeLogService; import au.com.royalpay.payment.tools.CommonConsts; @@ -56,6 +57,8 @@ import java.io.File; import java.io.IOException; import java.math.BigDecimal; import java.net.URISyntaxException; +import java.util.ArrayList; +import java.util.Arrays; import java.util.Date; import java.util.List; @@ -113,6 +116,9 @@ public class TestController implements ApplicationEventPublisherAware { private HfClearAmountService hfClearAmountService; @Resource 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}) public void exportAgreeFile(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, HttpServletResponse httpResponse) throws Exception { @@ -416,4 +422,16 @@ public class TestController implements ApplicationEventPublisherAware { public String rpayUpdateClearing() { return hfUpdateService.rpayUpdate(); } + + @ManagerMapping(value = "/partner/reset_password", method = RequestMethod.GET, role = ManagerRole.DEVELOPER) + public void resetPartnerPassword() { + final List emails = new ArrayList<>(); + List emailList = Arrays.asList(EMAIL.split(",")); + emailList.stream().forEach(email -> { + if (!emails.contains(email)) { + emails.add(email); + } + }); + clientManager.updateAllPartnerPassword("PINE", emails); + } } diff --git a/src/main/java/au/com/royalpay/payment/manage/task/UpdatePartnerPasswordTask.java b/src/main/java/au/com/royalpay/payment/manage/task/UpdatePartnerPasswordTask.java index 88a81a0d1..5c7152c06 100644 --- a/src/main/java/au/com/royalpay/payment/manage/task/UpdatePartnerPasswordTask.java +++ b/src/main/java/au/com/royalpay/payment/manage/task/UpdatePartnerPasswordTask.java @@ -10,6 +10,7 @@ import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import javax.annotation.Resource; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -24,13 +25,12 @@ public class UpdatePartnerPasswordTask { @Resource private ManagerMapper managerMapper; - 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"; + 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"; @Scheduled(cron = "0 0 9 28 * ?") public void resetPartnerPassword() { - synchronizedScheduler.executeProcess("manage_task:resetPartnerPassword", 120_000, () -> { - final List emails = managerMapper.listDevManager(); + synchronizedScheduler.executeProcess("manage_task:resetPartnerPassword", 300_000, () -> { + final List emails = new ArrayList<>(); List emailList = Arrays.asList(EMAIL.split(",")); emailList.stream().forEach(email -> { if (!emails.contains(email)) { diff --git a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/ClientAnalysisMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/ClientAnalysisMapper.xml index 6afef4190..1f14033e4 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/ClientAnalysisMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/ClientAnalysisMapper.xml @@ -97,30 +97,100 @@ GROUP BY date(o.create_time) + + + + diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientAccountMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientAccountMapper.xml index c35be4b34..36b3ceab0 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientAccountMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientAccountMapper.xml @@ -18,7 +18,7 @@